@zyphr-dev/node-sdk 0.1.9 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -12
- package/dist/index.cjs +433 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +358 -1
- package/dist/index.d.ts +358 -1
- package/dist/index.js +417 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +3 -0
- package/src/client.ts +10 -1
- package/src/src/apis/InboxApi.ts +548 -0
- package/src/src/models/MarkAllSubscriberNotificationsReadRequest.ts +65 -0
- package/src/src/models/UpdateSubscriberPreferencesRequest.ts +74 -0
- package/src/src/models/UpdateSubscriberPreferencesRequestPreferencesInner.ts +96 -0
- package/src/src/models/index.ts +3 -0
package/package.json
CHANGED
|
@@ -119,6 +119,7 @@ src/models/MagicLinkVerifyResponseData.ts
|
|
|
119
119
|
src/models/MarkAllInboxReadRequest.ts
|
|
120
120
|
src/models/MarkAllReadData.ts
|
|
121
121
|
src/models/MarkAllReadResponse.ts
|
|
122
|
+
src/models/MarkAllSubscriberNotificationsReadRequest.ts
|
|
122
123
|
src/models/MarkInboxReadRequest.ts
|
|
123
124
|
src/models/MfaBackupCodesResponse.ts
|
|
124
125
|
src/models/MfaBackupCodesResponseData.ts
|
|
@@ -284,6 +285,8 @@ src/models/UnsubscribeRequest.ts
|
|
|
284
285
|
src/models/UnsubscribeResponse.ts
|
|
285
286
|
src/models/UpdateCategoryRequest.ts
|
|
286
287
|
src/models/UpdateEndUserRequest.ts
|
|
288
|
+
src/models/UpdateSubscriberPreferencesRequest.ts
|
|
289
|
+
src/models/UpdateSubscriberPreferencesRequestPreferencesInner.ts
|
|
287
290
|
src/models/UpdateSubscriberRequest.ts
|
|
288
291
|
src/models/UpdateTemplateRequest.ts
|
|
289
292
|
src/models/UpdateTopicRequest.ts
|
package/src/client.ts
CHANGED
|
@@ -50,6 +50,10 @@ export interface ZyphrOptions {
|
|
|
50
50
|
apiKey: string;
|
|
51
51
|
/** Override the base API URL (defaults to https://api.zyphr.dev/v1) */
|
|
52
52
|
baseUrl?: string;
|
|
53
|
+
/** Application public key (za_pub_*) for Auth-as-a-Service endpoints */
|
|
54
|
+
applicationKey?: string;
|
|
55
|
+
/** Application secret key (za_sec_*) for Auth-as-a-Service endpoints */
|
|
56
|
+
applicationSecret?: string;
|
|
53
57
|
}
|
|
54
58
|
|
|
55
59
|
/**
|
|
@@ -102,7 +106,12 @@ export class Zyphr {
|
|
|
102
106
|
constructor(options: ZyphrOptions) {
|
|
103
107
|
const config = new Configuration({
|
|
104
108
|
basePath: options.baseUrl,
|
|
105
|
-
apiKey: () =>
|
|
109
|
+
apiKey: (name: string) => {
|
|
110
|
+
// Route application credential headers to the right keys
|
|
111
|
+
if (name === 'X-Application-Key' && options.applicationKey) return options.applicationKey;
|
|
112
|
+
if (name === 'X-Application-Secret' && options.applicationSecret) return options.applicationSecret;
|
|
113
|
+
return options.apiKey;
|
|
114
|
+
},
|
|
106
115
|
middleware: [errorMiddleware],
|
|
107
116
|
});
|
|
108
117
|
|