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

encode user id and hash #2

Merged
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 lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@
generic(
method: 'GET' | 'POST' | 'PATCH' | 'DELETE',
resource: string,
data?: any

Check warning on line 56 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type
): Promise<any>;

Check warning on line 57 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type
getNotifications(before: string, count: number): Promise<any>;

Check warning on line 58 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type
patchNotifications(params: any): Promise<any>;

Check warning on line 59 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type

Check warning on line 59 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type
getPreferences(): Promise<GetPreferencesResponse>;
postPreferences(
params: Array<{
Expand All @@ -68,7 +68,7 @@
| DeliveryOptionsForInappWeb
| BaseDeliveryOptions;
}>
): Promise<any>;

Check warning on line 71 in lib/client.ts

View workflow job for this annotation

GitHub Actions / pull_request_pipeline

Unexpected any. Specify a different type
};
websocket: {
object: WebSocket | undefined;
Expand Down Expand Up @@ -150,9 +150,9 @@
websocket: {
object: undefined,
connect: function () {
let address = `wss://${NotificationAPIClientSDK.config.websocketHost}?userId=${NotificationAPIClientSDK.config.userId}&envId=${NotificationAPIClientSDK.config.clientId}`;
let address = `wss://${NotificationAPIClientSDK.config.websocketHost}?userId=${encodeURIComponent(NotificationAPIClientSDK.config.userId)}&envId=${NotificationAPIClientSDK.config.clientId}`;
if (NotificationAPIClientSDK.config.hashedUserId) {
address += `&userIdHash=${NotificationAPIClientSDK.config.hashedUserId}`;
address += `&userIdHash=${encodeURIComponent(NotificationAPIClientSDK.config.hashedUserId)}`;
}
NotificationAPIClientSDK.websocket.object = new WebSocket(address);
NotificationAPIClientSDK.websocket.object.onmessage = (m) => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@notificationapi/core",
"version": "0.0.7",
"version": "0.0.8",
"type": "module",
"main": "dist/main.js",
"types": "dist/main.d.ts",
Expand Down
Loading