Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaking - Update userPreferences to support batching #27

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notificationapi-node-server-sdk",
"version": "1.0.0",
"version": "2.0.0",
"description": "NotificationAPI server-side library for Node.js",
"keywords": [
"notificationapi",
Expand Down
4 changes: 2 additions & 2 deletions src/__tests__/notificationapi.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
const promise = notificationapi[func](params);

Check warning on line 65 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
expect(promise).toBeInstanceOf(Promise);
});

Expand All @@ -74,7 +74,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await notificationapi[func](params);

Check warning on line 77 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
expect(axiosMock.history.post).toHaveLength(1);
});

Expand All @@ -87,7 +87,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await notificationapi[func](params);

Check warning on line 90 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
expect(axiosMock.history.post).toHaveLength(1);
expect(axiosMock.history.post[0].headers['Authorization']).toEqual(
'Basic ' + cred
Expand All @@ -104,7 +104,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
await notificationapi[func](params);

Check warning on line 107 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
expect(console.log).toHaveBeenCalledTimes(1);
});

Expand All @@ -118,7 +118,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
return notificationapi[func](params).catch(() => {

Check warning on line 121 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
expect(console.error).toHaveBeenCalledTimes(1);
});
});
Expand All @@ -133,7 +133,7 @@
notificationapi.init(clientId, clientSecret);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
expect(notificationapi[func](params)).rejects.toEqual(

Check warning on line 136 in src/__tests__/notificationapi.test.ts

View workflow job for this annotation

GitHub Actions / Pull Request Pipeline

Function Call Object Injection Sink
new Error('Request failed with status code 500')
);
});
Expand Down Expand Up @@ -509,7 +509,7 @@
{
notificationId: 'notificationId',
channel: Channels.EMAIL,
state: true
delivery: 'instant'
}
];
test('makes API calls to the correct end-point', async () => {
Expand Down Expand Up @@ -541,7 +541,7 @@
{
notificationId: 'notificationId',
channel: Channels.EMAIL,
state: true,
delivery: 'instant',
subNotificationId: 'subNotificationId'
}
];
Expand Down
3 changes: 1 addition & 2 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,8 @@ export interface SetUserPreferencesRequest {
notificationId: string;
/** The channel related to the userPreferences. Required.*/
channel: Channels;
/** Determines the . Required.*/
state: boolean;
/** The subNotificationId is used to specify further subcategories within a notification. Required.*/
delivery: 'off' | 'instant' | 'hourly' | 'daily' | 'weekly' | 'monthly';
subNotificationId?: string;
}
/** Supporting notification Channels.*/
Expand Down
Loading