1.4.7 • Published 18 days ago

@aac/directory v1.4.7

Weekly downloads
42
License
ISC
Repository
github
Last release
18 days ago

Directory ClientReach

Add this package to your project: npm i @aac/directory

I recommend adding a helper function in your project so that you don't pass configuration everytime you use the function. Configure the directory:

const {Directory} = require('@aac/directory');

const directory = (props = {query: ''}) => {
    const {query = {}} = props;
    return new Directory({
        credentials: {
            api: CLIENTREACH_API_URL,
            username: CLIENTREACH_API_USERNAME,
            password: CLIENTREACH_API_PASSWORD,
        },
        specialty: 'addiction-treatment',
        listings_path: 'local',
        listings_path_use_hierarchical: false,
        facilities_path: 'listings',
        site_name: 'Project Know',
        phone: '',
        query,
    });
};

Directory Parameters:

ParameterDescriptionsDefault
pluginPath.null
seedUsed for generating the facility profile unique ID in the URL for facility pages. Ex: EX: /listings/greenhouse-treatment-center-1868084797 Rehabs (2), Recovery (3), Detox (3)2
specialtyUsed for filtering free posts by specialty. projectknow, detox, drugabuse, recovery, rehab'rehab'
listings_pathUsed for generating the state/city url path. State example: /local/california City example: /local/los-angeles-ca'local'
listings_path_use_hierarchicalIndicator for generating hierarchical state/city url path. State example: /local/california City example: /local/california/los-angelesfalse
facilities_pathUsed for generating the facility profile url path. EX: /listings/ greenhouse-treatment-center-1868084797'listings'
aac_account_idUsed in functions that determine/validate if a facility is AAC or not. There are business compliance cases where we cannot show some data on non-aac facilities.'cuJjm8Z5'
credentialsThis object is passed to the ClientReach Class which handles authenticated requests. {username: '', password: ''}null
site_nameThere are helper functions that have output including the site name.null
phoneEach directory has a unique CallRail Phone number associated with it.null
queryCurrently there are helper functions that determine page type based on query parameters, pass the Express context.query if you need those functions. See Directory.getVars for the list of accepted parameters{}

Gotchas

  • This package uses the format: 'legacy' header on all GET and POST requests. This can debugging issues when issues postman if this header isn't set. This format was originally chosen because the response size is drastically smaller. Those headers can be found here.

  • This project requires Node version 14

nvm use 14

Publishing Beta Version (for QA on staging sites)

You must be logged in via CLI (npm login), and be listed as a collaborator here

  1. npm run build - build files are committed here
  2. npm version x.x.x-beta.x - increase using semantic versioning
    • It is crucial that we add beta.0 at the end of your version. The .0 indicates which beta version it is. When we publish a new fix as beta, we will increment the .0 to .1 and so on.
  3. npm publish --tag beta
  4. Confirm version on npm page

Publishing

You must be logged in via CLI (npm login), and be listed as a collaborator here

  1. npm run build - build files are committed here
  2. Merge pull request into master
  3. npm version x.x.x - increase using semantic versioning
  4. npm publish
  5. Confirm version on npm page
1.4.7

18 days ago

1.4.7-beta.0

19 days ago

1.4.7-beta.3

19 days ago

1.4.7-beta.1

19 days ago

1.4.7-beta.2

19 days ago

1.4.6

1 month ago

1.4.5

1 month ago

1.4.6-beta.0

1 month ago

1.4.5-beta.0

1 month ago

1.4.5-beta.1

1 month ago

1.4.4

4 months ago

1.4.4-beta.0

4 months ago

1.4.3

4 months ago

1.4.3-beta.0

4 months ago

1.4.2

5 months ago

1.4.2-beta.0

6 months ago

1.4.2-beta.1

6 months ago

1.4.2-beta.2

6 months ago

1.4.1

8 months ago

1.4.1-beta.0

8 months ago

1.4.0

1 year ago

1.4.0-beta.0

1 year ago

1.3.2

1 year ago

1.3.2-beta.0

1 year ago

1.3.1

1 year ago

1.3.1-beta.1

1 year ago

1.3.1-beta.0

1 year ago

1.3.1-beta.6

1 year ago

1.3.1-beta.5

1 year ago

1.3.1-beta.4

1 year ago

1.3.1-beta.3

1 year ago

1.3.1-beta.2

1 year ago

1.3.0

2 years ago

1.3.0-beta.0

2 years ago

1.2.9

2 years ago

1.2.8

2 years ago

1.2.7

2 years ago

1.2.6

2 years ago

1.2.5

2 years ago

1.2.4

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.0.19

4 years ago

1.1.0

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago