Skip to content

Commit

Permalink
Merge pull request #221 from skedify/feature/SKED-6289
Browse files Browse the repository at this point in the history
  • Loading branch information
Ken Depelchin authored Mar 23, 2021
2 parents 4b56ccd + 11d89e4 commit c94591c
Show file tree
Hide file tree
Showing 19 changed files with 138 additions and 3 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,28 @@ SDK.appointments('appointment id').then({ data } => {
})
```

## Custom Domain Map
Some endpoints require a domain mapping when instantiating the SDK. Consider the
following example:

```js
const SDK = new API({
auth_provider: API.createAuthProviderString('public_client', {
client_id: 'someclientidtokengoeshere',
realm: 'https://api.example.com',
}),
locale: 'nl-BE',
resource_domain_map: {
events: {
url: 'https://events-api.example.com',
},
'users.events': {
url: 'https://users-events-api.example.com',
},
},
})
```

## Testing

If you want to test your application's code, you can use these test utils so that you can safely execute the calls.
Expand Down
2 changes: 1 addition & 1 deletion src/__snapshots__/Skedify.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ exports[`API API/Resources should throw an error when an external://abc123 call

exports[`API API/Resources should throw an error when an external://abc123 call returns no records 2`] = `Array []`;

exports[`API API/Resources should throw an error when calling a non existing filter function 1`] = `"[RESOURCE]: item.nonExistingMethod is not a function. You can only call \`.category_id()\`, \`.external_id()\`, \`.lead_segment_code()\`, \`.schedulable_at_office()\`, \`.schedulable_for_meeting_type()\`, \`.schedulable_with_contact()\`, \`.schedulable()\`, \`.page()\` or \`.per_page()\`."`;
exports[`API API/Resources should throw an error when calling a non existing filter function 1`] = `"[RESOURCE]: item.nonExistingMethod is not a function. You can only call \`.category_id()\`, \`.external_id()\`, \`.lead_segment_code()\`, \`.schedulable_at_office()\`, \`.schedulable_for_meeting_type()\`, \`.schedulable_with_contact()\`, \`.schedulable()\`, \`.page()\`, \`.per_page()\` or \`.id()\`."`;

exports[`API API/Resources should throw an error when calling a non existing filter function and one of the defined filters is using an object alias 1`] = `"[RESOURCE]: item.nonExistingMethod is not a function. You can only call \`.type()\`."`;

Expand Down
Loading

0 comments on commit c94591c

Please sign in to comment.