File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change
1
+ import { API_REGION } from './interfaces' ;
2
+
1
3
export const api = async (
2
4
method : 'GET' | 'POST' | 'PATCH' | 'DELETE' ,
3
- host : string ,
5
+ host : string | API_REGION ,
4
6
resource : string ,
5
7
clientId : string ,
6
8
userId : string ,
Original file line number Diff line number Diff line change 1
1
import { api } from './api' ;
2
2
import {
3
+ API_REGION ,
3
4
BaseDeliveryOptions ,
4
5
Channels ,
5
6
DeliveryOptionsForEmail ,
6
7
DeliveryOptionsForInappWeb ,
7
8
PostUserRequest ,
8
- UserAccountMetadata
9
+ UserAccountMetadata ,
10
+ WS_REGION
9
11
} from './interfaces' ;
10
12
import {
11
13
GetPreferencesResponse ,
@@ -17,14 +19,14 @@ type NotificationAPIClientSDKConfig = {
17
19
userId : string ;
18
20
clientId : string ;
19
21
hashedUserId : string ;
20
- host : string ;
22
+ host : string | API_REGION ;
21
23
22
24
// inapp notifications:
23
25
getInAppDefaultCount : number ;
24
26
getInAppDefaultOldest : string ;
25
27
26
28
// Websocket:
27
- websocketHost : string ;
29
+ websocketHost : string | WS_REGION ;
28
30
keepWebSocketAliveForSeconds : number ;
29
31
onNewInAppNotifications ?: ( notifications : InAppNotification [ ] ) => unknown ;
30
32
} ;
Original file line number Diff line number Diff line change @@ -48,7 +48,17 @@ export interface WebSocket_NewNotification_Message {
48
48
notifications : InAppNotification [ ] ;
49
49
} ;
50
50
}
51
+ export enum API_REGION {
52
+ US = 'api.notificationapi.com' ,
53
+ EU = 'api.eu.notificationapi.com' ,
54
+ CA = 'api.ca.notificationapi.com'
55
+ }
51
56
57
+ export enum WS_REGION {
58
+ US = 'ws.notificationapi.com' ,
59
+ EU = 'ws.eu.notificationapi.com' ,
60
+ CA = 'ws.ca.notificationapi.com'
61
+ }
52
62
export type Channels =
53
63
| 'EMAIL'
54
64
| 'INAPP_WEB'
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @notificationapi/core" ,
3
- "version" : " 0.0.14 " ,
3
+ "version" : " 0.0.15 " ,
4
4
"type" : " module" ,
5
5
"main" : " dist/main.js" ,
6
6
"types" : " dist/main.d.ts" ,
You can’t perform that action at this time.
0 commit comments