@zyphr-dev/node-sdk 0.1.8 → 0.1.10
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/dist/index.cjs +579 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +499 -1
- package/dist/index.d.ts +499 -1
- package/dist/index.js +548 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/.openapi-generator/FILES +6 -0
- package/src/src/apis/InboxApi.ts +619 -0
- package/src/src/models/GenerateSubscriberToken200Response.ts +73 -0
- package/src/src/models/GenerateSubscriberToken200ResponseData.ts +81 -0
- package/src/src/models/GenerateSubscriberTokenRequest.ts +73 -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 +6 -0
package/dist/index.js
CHANGED
|
@@ -2683,6 +2683,93 @@ function ForgotPasswordRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
2683
2683
|
};
|
|
2684
2684
|
}
|
|
2685
2685
|
|
|
2686
|
+
// src/src/models/GenerateSubscriberToken200ResponseData.ts
|
|
2687
|
+
function instanceOfGenerateSubscriberToken200ResponseData(value) {
|
|
2688
|
+
return true;
|
|
2689
|
+
}
|
|
2690
|
+
function GenerateSubscriberToken200ResponseDataFromJSON(json) {
|
|
2691
|
+
return GenerateSubscriberToken200ResponseDataFromJSONTyped(json, false);
|
|
2692
|
+
}
|
|
2693
|
+
function GenerateSubscriberToken200ResponseDataFromJSONTyped(json, ignoreDiscriminator) {
|
|
2694
|
+
if (json == null) {
|
|
2695
|
+
return json;
|
|
2696
|
+
}
|
|
2697
|
+
return {
|
|
2698
|
+
"token": json["token"] == null ? void 0 : json["token"],
|
|
2699
|
+
"subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
|
|
2700
|
+
"expiresIn": json["expires_in"] == null ? void 0 : json["expires_in"]
|
|
2701
|
+
};
|
|
2702
|
+
}
|
|
2703
|
+
function GenerateSubscriberToken200ResponseDataToJSON(json) {
|
|
2704
|
+
return GenerateSubscriberToken200ResponseDataToJSONTyped(json, false);
|
|
2705
|
+
}
|
|
2706
|
+
function GenerateSubscriberToken200ResponseDataToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2707
|
+
if (value == null) {
|
|
2708
|
+
return value;
|
|
2709
|
+
}
|
|
2710
|
+
return {
|
|
2711
|
+
"token": value["token"],
|
|
2712
|
+
"subscriber_id": value["subscriberId"],
|
|
2713
|
+
"expires_in": value["expiresIn"]
|
|
2714
|
+
};
|
|
2715
|
+
}
|
|
2716
|
+
|
|
2717
|
+
// src/src/models/GenerateSubscriberToken200Response.ts
|
|
2718
|
+
function instanceOfGenerateSubscriberToken200Response(value) {
|
|
2719
|
+
return true;
|
|
2720
|
+
}
|
|
2721
|
+
function GenerateSubscriberToken200ResponseFromJSON(json) {
|
|
2722
|
+
return GenerateSubscriberToken200ResponseFromJSONTyped(json, false);
|
|
2723
|
+
}
|
|
2724
|
+
function GenerateSubscriberToken200ResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
2725
|
+
if (json == null) {
|
|
2726
|
+
return json;
|
|
2727
|
+
}
|
|
2728
|
+
return {
|
|
2729
|
+
"data": json["data"] == null ? void 0 : GenerateSubscriberToken200ResponseDataFromJSON(json["data"])
|
|
2730
|
+
};
|
|
2731
|
+
}
|
|
2732
|
+
function GenerateSubscriberToken200ResponseToJSON(json) {
|
|
2733
|
+
return GenerateSubscriberToken200ResponseToJSONTyped(json, false);
|
|
2734
|
+
}
|
|
2735
|
+
function GenerateSubscriberToken200ResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2736
|
+
if (value == null) {
|
|
2737
|
+
return value;
|
|
2738
|
+
}
|
|
2739
|
+
return {
|
|
2740
|
+
"data": GenerateSubscriberToken200ResponseDataToJSON(value["data"])
|
|
2741
|
+
};
|
|
2742
|
+
}
|
|
2743
|
+
|
|
2744
|
+
// src/src/models/GenerateSubscriberTokenRequest.ts
|
|
2745
|
+
function instanceOfGenerateSubscriberTokenRequest(value) {
|
|
2746
|
+
return true;
|
|
2747
|
+
}
|
|
2748
|
+
function GenerateSubscriberTokenRequestFromJSON(json) {
|
|
2749
|
+
return GenerateSubscriberTokenRequestFromJSONTyped(json, false);
|
|
2750
|
+
}
|
|
2751
|
+
function GenerateSubscriberTokenRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
2752
|
+
if (json == null) {
|
|
2753
|
+
return json;
|
|
2754
|
+
}
|
|
2755
|
+
return {
|
|
2756
|
+
"subscriberId": json["subscriber_id"] == null ? void 0 : json["subscriber_id"],
|
|
2757
|
+
"externalId": json["external_id"] == null ? void 0 : json["external_id"]
|
|
2758
|
+
};
|
|
2759
|
+
}
|
|
2760
|
+
function GenerateSubscriberTokenRequestToJSON(json) {
|
|
2761
|
+
return GenerateSubscriberTokenRequestToJSONTyped(json, false);
|
|
2762
|
+
}
|
|
2763
|
+
function GenerateSubscriberTokenRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
2764
|
+
if (value == null) {
|
|
2765
|
+
return value;
|
|
2766
|
+
}
|
|
2767
|
+
return {
|
|
2768
|
+
"subscriber_id": value["subscriberId"],
|
|
2769
|
+
"external_id": value["externalId"]
|
|
2770
|
+
};
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2686
2773
|
// src/src/models/WaaSPortalTokenResponse.ts
|
|
2687
2774
|
function instanceOfWaaSPortalTokenResponse(value) {
|
|
2688
2775
|
return true;
|
|
@@ -3435,6 +3522,33 @@ function MarkAllReadResponseToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
3435
3522
|
};
|
|
3436
3523
|
}
|
|
3437
3524
|
|
|
3525
|
+
// src/src/models/MarkAllSubscriberNotificationsReadRequest.ts
|
|
3526
|
+
function instanceOfMarkAllSubscriberNotificationsReadRequest(value) {
|
|
3527
|
+
return true;
|
|
3528
|
+
}
|
|
3529
|
+
function MarkAllSubscriberNotificationsReadRequestFromJSON(json) {
|
|
3530
|
+
return MarkAllSubscriberNotificationsReadRequestFromJSONTyped(json, false);
|
|
3531
|
+
}
|
|
3532
|
+
function MarkAllSubscriberNotificationsReadRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
3533
|
+
if (json == null) {
|
|
3534
|
+
return json;
|
|
3535
|
+
}
|
|
3536
|
+
return {
|
|
3537
|
+
"category": json["category"] == null ? void 0 : json["category"]
|
|
3538
|
+
};
|
|
3539
|
+
}
|
|
3540
|
+
function MarkAllSubscriberNotificationsReadRequestToJSON(json) {
|
|
3541
|
+
return MarkAllSubscriberNotificationsReadRequestToJSONTyped(json, false);
|
|
3542
|
+
}
|
|
3543
|
+
function MarkAllSubscriberNotificationsReadRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
3544
|
+
if (value == null) {
|
|
3545
|
+
return value;
|
|
3546
|
+
}
|
|
3547
|
+
return {
|
|
3548
|
+
"category": value["category"]
|
|
3549
|
+
};
|
|
3550
|
+
}
|
|
3551
|
+
|
|
3438
3552
|
// src/src/models/MarkInboxReadRequest.ts
|
|
3439
3553
|
function instanceOfMarkInboxReadRequest(value) {
|
|
3440
3554
|
return true;
|
|
@@ -8729,6 +8843,73 @@ function UpdateEndUserRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
8729
8843
|
};
|
|
8730
8844
|
}
|
|
8731
8845
|
|
|
8846
|
+
// src/src/models/UpdateSubscriberPreferencesRequestPreferencesInner.ts
|
|
8847
|
+
var UpdateSubscriberPreferencesRequestPreferencesInnerChannelEnum = {
|
|
8848
|
+
EMAIL: "email",
|
|
8849
|
+
PUSH: "push",
|
|
8850
|
+
SMS: "sms",
|
|
8851
|
+
IN_APP: "in_app"
|
|
8852
|
+
};
|
|
8853
|
+
function instanceOfUpdateSubscriberPreferencesRequestPreferencesInner(value) {
|
|
8854
|
+
if (!("channel" in value) || value["channel"] === void 0) return false;
|
|
8855
|
+
if (!("enabled" in value) || value["enabled"] === void 0) return false;
|
|
8856
|
+
return true;
|
|
8857
|
+
}
|
|
8858
|
+
function UpdateSubscriberPreferencesRequestPreferencesInnerFromJSON(json) {
|
|
8859
|
+
return UpdateSubscriberPreferencesRequestPreferencesInnerFromJSONTyped(json, false);
|
|
8860
|
+
}
|
|
8861
|
+
function UpdateSubscriberPreferencesRequestPreferencesInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
8862
|
+
if (json == null) {
|
|
8863
|
+
return json;
|
|
8864
|
+
}
|
|
8865
|
+
return {
|
|
8866
|
+
"categoryId": json["category_id"] == null ? void 0 : json["category_id"],
|
|
8867
|
+
"channel": json["channel"],
|
|
8868
|
+
"enabled": json["enabled"]
|
|
8869
|
+
};
|
|
8870
|
+
}
|
|
8871
|
+
function UpdateSubscriberPreferencesRequestPreferencesInnerToJSON(json) {
|
|
8872
|
+
return UpdateSubscriberPreferencesRequestPreferencesInnerToJSONTyped(json, false);
|
|
8873
|
+
}
|
|
8874
|
+
function UpdateSubscriberPreferencesRequestPreferencesInnerToJSONTyped(value, ignoreDiscriminator = false) {
|
|
8875
|
+
if (value == null) {
|
|
8876
|
+
return value;
|
|
8877
|
+
}
|
|
8878
|
+
return {
|
|
8879
|
+
"category_id": value["categoryId"],
|
|
8880
|
+
"channel": value["channel"],
|
|
8881
|
+
"enabled": value["enabled"]
|
|
8882
|
+
};
|
|
8883
|
+
}
|
|
8884
|
+
|
|
8885
|
+
// src/src/models/UpdateSubscriberPreferencesRequest.ts
|
|
8886
|
+
function instanceOfUpdateSubscriberPreferencesRequest(value) {
|
|
8887
|
+
if (!("preferences" in value) || value["preferences"] === void 0) return false;
|
|
8888
|
+
return true;
|
|
8889
|
+
}
|
|
8890
|
+
function UpdateSubscriberPreferencesRequestFromJSON(json) {
|
|
8891
|
+
return UpdateSubscriberPreferencesRequestFromJSONTyped(json, false);
|
|
8892
|
+
}
|
|
8893
|
+
function UpdateSubscriberPreferencesRequestFromJSONTyped(json, ignoreDiscriminator) {
|
|
8894
|
+
if (json == null) {
|
|
8895
|
+
return json;
|
|
8896
|
+
}
|
|
8897
|
+
return {
|
|
8898
|
+
"preferences": json["preferences"].map(UpdateSubscriberPreferencesRequestPreferencesInnerFromJSON)
|
|
8899
|
+
};
|
|
8900
|
+
}
|
|
8901
|
+
function UpdateSubscriberPreferencesRequestToJSON(json) {
|
|
8902
|
+
return UpdateSubscriberPreferencesRequestToJSONTyped(json, false);
|
|
8903
|
+
}
|
|
8904
|
+
function UpdateSubscriberPreferencesRequestToJSONTyped(value, ignoreDiscriminator = false) {
|
|
8905
|
+
if (value == null) {
|
|
8906
|
+
return value;
|
|
8907
|
+
}
|
|
8908
|
+
return {
|
|
8909
|
+
"preferences": value["preferences"].map(UpdateSubscriberPreferencesRequestPreferencesInnerToJSON)
|
|
8910
|
+
};
|
|
8911
|
+
}
|
|
8912
|
+
|
|
8732
8913
|
// src/src/models/UpdateSubscriberRequest.ts
|
|
8733
8914
|
var UpdateSubscriberRequestStatusEnum = {
|
|
8734
8915
|
ACTIVE: "active",
|
|
@@ -13209,6 +13390,39 @@ var InboxApi = class extends BaseAPI {
|
|
|
13209
13390
|
const response = await this.archiveInboxNotificationRaw({ id, markInboxReadRequest }, initOverrides);
|
|
13210
13391
|
return await response.value();
|
|
13211
13392
|
}
|
|
13393
|
+
/**
|
|
13394
|
+
* Archive a notification
|
|
13395
|
+
*/
|
|
13396
|
+
async archiveSubscriberNotificationRaw(requestParameters, initOverrides) {
|
|
13397
|
+
if (requestParameters["id"] == null) {
|
|
13398
|
+
throw new RequiredError(
|
|
13399
|
+
"id",
|
|
13400
|
+
'Required parameter "id" was null or undefined when calling archiveSubscriberNotification().'
|
|
13401
|
+
);
|
|
13402
|
+
}
|
|
13403
|
+
const queryParameters = {};
|
|
13404
|
+
const headerParameters = {};
|
|
13405
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13406
|
+
const token = this.configuration.accessToken;
|
|
13407
|
+
const tokenString = await token("EndUserToken", []);
|
|
13408
|
+
if (tokenString) {
|
|
13409
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13410
|
+
}
|
|
13411
|
+
}
|
|
13412
|
+
const response = await this.request({
|
|
13413
|
+
path: `/subscriber-inbox/{id}/archive`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))),
|
|
13414
|
+
method: "POST",
|
|
13415
|
+
headers: headerParameters,
|
|
13416
|
+
query: queryParameters
|
|
13417
|
+
}, initOverrides);
|
|
13418
|
+
return new VoidApiResponse(response);
|
|
13419
|
+
}
|
|
13420
|
+
/**
|
|
13421
|
+
* Archive a notification
|
|
13422
|
+
*/
|
|
13423
|
+
async archiveSubscriberNotification(id, initOverrides) {
|
|
13424
|
+
await this.archiveSubscriberNotificationRaw({ id }, initOverrides);
|
|
13425
|
+
}
|
|
13212
13426
|
/**
|
|
13213
13427
|
* Permanently delete an in-app notification.
|
|
13214
13428
|
* Delete a notification
|
|
@@ -13246,6 +13460,73 @@ var InboxApi = class extends BaseAPI {
|
|
|
13246
13460
|
async deleteInboxNotification(id, subscriberId, externalId, initOverrides) {
|
|
13247
13461
|
await this.deleteInboxNotificationRaw({ id, subscriberId, externalId }, initOverrides);
|
|
13248
13462
|
}
|
|
13463
|
+
/**
|
|
13464
|
+
* Delete a notification
|
|
13465
|
+
*/
|
|
13466
|
+
async deleteSubscriberNotificationRaw(requestParameters, initOverrides) {
|
|
13467
|
+
if (requestParameters["id"] == null) {
|
|
13468
|
+
throw new RequiredError(
|
|
13469
|
+
"id",
|
|
13470
|
+
'Required parameter "id" was null or undefined when calling deleteSubscriberNotification().'
|
|
13471
|
+
);
|
|
13472
|
+
}
|
|
13473
|
+
const queryParameters = {};
|
|
13474
|
+
const headerParameters = {};
|
|
13475
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13476
|
+
const token = this.configuration.accessToken;
|
|
13477
|
+
const tokenString = await token("EndUserToken", []);
|
|
13478
|
+
if (tokenString) {
|
|
13479
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13480
|
+
}
|
|
13481
|
+
}
|
|
13482
|
+
const response = await this.request({
|
|
13483
|
+
path: `/subscriber-inbox/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))),
|
|
13484
|
+
method: "DELETE",
|
|
13485
|
+
headers: headerParameters,
|
|
13486
|
+
query: queryParameters
|
|
13487
|
+
}, initOverrides);
|
|
13488
|
+
return new VoidApiResponse(response);
|
|
13489
|
+
}
|
|
13490
|
+
/**
|
|
13491
|
+
* Delete a notification
|
|
13492
|
+
*/
|
|
13493
|
+
async deleteSubscriberNotification(id, initOverrides) {
|
|
13494
|
+
await this.deleteSubscriberNotificationRaw({ id }, initOverrides);
|
|
13495
|
+
}
|
|
13496
|
+
/**
|
|
13497
|
+
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
13498
|
+
* Generate a subscriber token
|
|
13499
|
+
*/
|
|
13500
|
+
async generateSubscriberTokenRaw(requestParameters, initOverrides) {
|
|
13501
|
+
if (requestParameters["generateSubscriberTokenRequest"] == null) {
|
|
13502
|
+
throw new RequiredError(
|
|
13503
|
+
"generateSubscriberTokenRequest",
|
|
13504
|
+
'Required parameter "generateSubscriberTokenRequest" was null or undefined when calling generateSubscriberToken().'
|
|
13505
|
+
);
|
|
13506
|
+
}
|
|
13507
|
+
const queryParameters = {};
|
|
13508
|
+
const headerParameters = {};
|
|
13509
|
+
headerParameters["Content-Type"] = "application/json";
|
|
13510
|
+
if (this.configuration && this.configuration.apiKey) {
|
|
13511
|
+
headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key");
|
|
13512
|
+
}
|
|
13513
|
+
const response = await this.request({
|
|
13514
|
+
path: `/subscriber-inbox/token`,
|
|
13515
|
+
method: "POST",
|
|
13516
|
+
headers: headerParameters,
|
|
13517
|
+
query: queryParameters,
|
|
13518
|
+
body: GenerateSubscriberTokenRequestToJSON(requestParameters["generateSubscriberTokenRequest"])
|
|
13519
|
+
}, initOverrides);
|
|
13520
|
+
return new JSONApiResponse(response, (jsonValue) => GenerateSubscriberToken200ResponseFromJSON(jsonValue));
|
|
13521
|
+
}
|
|
13522
|
+
/**
|
|
13523
|
+
* Generate a JWT token for client-side inbox authentication. This is a server-side call that requires your API key. Pass the returned token to `@zyphr/inbox-react`\'s `<ZyphrProvider subscriberToken=\"...\">` or use it as `Authorization: Bearer <token>` for client-side inbox API calls and WebSocket connections. The token expires in 7 days.
|
|
13524
|
+
* Generate a subscriber token
|
|
13525
|
+
*/
|
|
13526
|
+
async generateSubscriberToken(generateSubscriberTokenRequest, initOverrides) {
|
|
13527
|
+
const response = await this.generateSubscriberTokenRaw({ generateSubscriberTokenRequest }, initOverrides);
|
|
13528
|
+
return await response.value();
|
|
13529
|
+
}
|
|
13249
13530
|
/**
|
|
13250
13531
|
* Get a specific in-app notification by ID.
|
|
13251
13532
|
* Get a notification
|
|
@@ -13284,6 +13565,99 @@ var InboxApi = class extends BaseAPI {
|
|
|
13284
13565
|
const response = await this.getInboxNotificationRaw({ id, subscriberId, externalId }, initOverrides);
|
|
13285
13566
|
return await response.value();
|
|
13286
13567
|
}
|
|
13568
|
+
/**
|
|
13569
|
+
* Get notification preferences grouped by category for the authenticated subscriber.
|
|
13570
|
+
* Get subscriber preferences
|
|
13571
|
+
*/
|
|
13572
|
+
async getSubscriberInboxPreferencesRaw(initOverrides) {
|
|
13573
|
+
const queryParameters = {};
|
|
13574
|
+
const headerParameters = {};
|
|
13575
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13576
|
+
const token = this.configuration.accessToken;
|
|
13577
|
+
const tokenString = await token("EndUserToken", []);
|
|
13578
|
+
if (tokenString) {
|
|
13579
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13580
|
+
}
|
|
13581
|
+
}
|
|
13582
|
+
const response = await this.request({
|
|
13583
|
+
path: `/subscriber-inbox/preferences`,
|
|
13584
|
+
method: "GET",
|
|
13585
|
+
headers: headerParameters,
|
|
13586
|
+
query: queryParameters
|
|
13587
|
+
}, initOverrides);
|
|
13588
|
+
return new VoidApiResponse(response);
|
|
13589
|
+
}
|
|
13590
|
+
/**
|
|
13591
|
+
* Get notification preferences grouped by category for the authenticated subscriber.
|
|
13592
|
+
* Get subscriber preferences
|
|
13593
|
+
*/
|
|
13594
|
+
async getSubscriberInboxPreferences(initOverrides) {
|
|
13595
|
+
await this.getSubscriberInboxPreferencesRaw(initOverrides);
|
|
13596
|
+
}
|
|
13597
|
+
/**
|
|
13598
|
+
* Get a specific notification by ID for the authenticated subscriber.
|
|
13599
|
+
* Get a notification
|
|
13600
|
+
*/
|
|
13601
|
+
async getSubscriberNotificationRaw(requestParameters, initOverrides) {
|
|
13602
|
+
if (requestParameters["id"] == null) {
|
|
13603
|
+
throw new RequiredError(
|
|
13604
|
+
"id",
|
|
13605
|
+
'Required parameter "id" was null or undefined when calling getSubscriberNotification().'
|
|
13606
|
+
);
|
|
13607
|
+
}
|
|
13608
|
+
const queryParameters = {};
|
|
13609
|
+
const headerParameters = {};
|
|
13610
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13611
|
+
const token = this.configuration.accessToken;
|
|
13612
|
+
const tokenString = await token("EndUserToken", []);
|
|
13613
|
+
if (tokenString) {
|
|
13614
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13615
|
+
}
|
|
13616
|
+
}
|
|
13617
|
+
const response = await this.request({
|
|
13618
|
+
path: `/subscriber-inbox/{id}`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))),
|
|
13619
|
+
method: "GET",
|
|
13620
|
+
headers: headerParameters,
|
|
13621
|
+
query: queryParameters
|
|
13622
|
+
}, initOverrides);
|
|
13623
|
+
return new VoidApiResponse(response);
|
|
13624
|
+
}
|
|
13625
|
+
/**
|
|
13626
|
+
* Get a specific notification by ID for the authenticated subscriber.
|
|
13627
|
+
* Get a notification
|
|
13628
|
+
*/
|
|
13629
|
+
async getSubscriberNotification(id, initOverrides) {
|
|
13630
|
+
await this.getSubscriberNotificationRaw({ id }, initOverrides);
|
|
13631
|
+
}
|
|
13632
|
+
/**
|
|
13633
|
+
* Get the unread notification count for the authenticated subscriber.
|
|
13634
|
+
* Get unread count
|
|
13635
|
+
*/
|
|
13636
|
+
async getSubscriberUnreadCountRaw(initOverrides) {
|
|
13637
|
+
const queryParameters = {};
|
|
13638
|
+
const headerParameters = {};
|
|
13639
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13640
|
+
const token = this.configuration.accessToken;
|
|
13641
|
+
const tokenString = await token("EndUserToken", []);
|
|
13642
|
+
if (tokenString) {
|
|
13643
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13644
|
+
}
|
|
13645
|
+
}
|
|
13646
|
+
const response = await this.request({
|
|
13647
|
+
path: `/subscriber-inbox/unread-count`,
|
|
13648
|
+
method: "GET",
|
|
13649
|
+
headers: headerParameters,
|
|
13650
|
+
query: queryParameters
|
|
13651
|
+
}, initOverrides);
|
|
13652
|
+
return new VoidApiResponse(response);
|
|
13653
|
+
}
|
|
13654
|
+
/**
|
|
13655
|
+
* Get the unread notification count for the authenticated subscriber.
|
|
13656
|
+
* Get unread count
|
|
13657
|
+
*/
|
|
13658
|
+
async getSubscriberUnreadCount(initOverrides) {
|
|
13659
|
+
await this.getSubscriberUnreadCountRaw(initOverrides);
|
|
13660
|
+
}
|
|
13287
13661
|
/**
|
|
13288
13662
|
* Get the count of unread in-app notifications for a subscriber.
|
|
13289
13663
|
* Get unread notification count
|
|
@@ -13366,6 +13740,50 @@ var InboxApi = class extends BaseAPI {
|
|
|
13366
13740
|
const response = await this.listInboxRaw({ subscriberId, externalId, category, includeRead, includeArchived, limit, offset, cursor }, initOverrides);
|
|
13367
13741
|
return await response.value();
|
|
13368
13742
|
}
|
|
13743
|
+
/**
|
|
13744
|
+
* List notifications for the authenticated subscriber. Supports cursor-based pagination.
|
|
13745
|
+
* List subscriber notifications
|
|
13746
|
+
*/
|
|
13747
|
+
async listSubscriberNotificationsRaw(requestParameters, initOverrides) {
|
|
13748
|
+
const queryParameters = {};
|
|
13749
|
+
if (requestParameters["category"] != null) {
|
|
13750
|
+
queryParameters["category"] = requestParameters["category"];
|
|
13751
|
+
}
|
|
13752
|
+
if (requestParameters["includeRead"] != null) {
|
|
13753
|
+
queryParameters["include_read"] = requestParameters["includeRead"];
|
|
13754
|
+
}
|
|
13755
|
+
if (requestParameters["includeArchived"] != null) {
|
|
13756
|
+
queryParameters["include_archived"] = requestParameters["includeArchived"];
|
|
13757
|
+
}
|
|
13758
|
+
if (requestParameters["limit"] != null) {
|
|
13759
|
+
queryParameters["limit"] = requestParameters["limit"];
|
|
13760
|
+
}
|
|
13761
|
+
if (requestParameters["cursor"] != null) {
|
|
13762
|
+
queryParameters["cursor"] = requestParameters["cursor"];
|
|
13763
|
+
}
|
|
13764
|
+
const headerParameters = {};
|
|
13765
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13766
|
+
const token = this.configuration.accessToken;
|
|
13767
|
+
const tokenString = await token("EndUserToken", []);
|
|
13768
|
+
if (tokenString) {
|
|
13769
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13770
|
+
}
|
|
13771
|
+
}
|
|
13772
|
+
const response = await this.request({
|
|
13773
|
+
path: `/subscriber-inbox`,
|
|
13774
|
+
method: "GET",
|
|
13775
|
+
headers: headerParameters,
|
|
13776
|
+
query: queryParameters
|
|
13777
|
+
}, initOverrides);
|
|
13778
|
+
return new VoidApiResponse(response);
|
|
13779
|
+
}
|
|
13780
|
+
/**
|
|
13781
|
+
* List notifications for the authenticated subscriber. Supports cursor-based pagination.
|
|
13782
|
+
* List subscriber notifications
|
|
13783
|
+
*/
|
|
13784
|
+
async listSubscriberNotifications(category, includeRead, includeArchived, limit, cursor, initOverrides) {
|
|
13785
|
+
await this.listSubscriberNotificationsRaw({ category, includeRead, includeArchived, limit, cursor }, initOverrides);
|
|
13786
|
+
}
|
|
13369
13787
|
/**
|
|
13370
13788
|
* Mark all unread in-app notifications as read for a subscriber. Optionally filter by category.
|
|
13371
13789
|
* Mark all notifications as read
|
|
@@ -13400,6 +13818,35 @@ var InboxApi = class extends BaseAPI {
|
|
|
13400
13818
|
const response = await this.markAllInboxReadRaw({ markAllInboxReadRequest }, initOverrides);
|
|
13401
13819
|
return await response.value();
|
|
13402
13820
|
}
|
|
13821
|
+
/**
|
|
13822
|
+
* Mark all notifications as read
|
|
13823
|
+
*/
|
|
13824
|
+
async markAllSubscriberNotificationsReadRaw(requestParameters, initOverrides) {
|
|
13825
|
+
const queryParameters = {};
|
|
13826
|
+
const headerParameters = {};
|
|
13827
|
+
headerParameters["Content-Type"] = "application/json";
|
|
13828
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13829
|
+
const token = this.configuration.accessToken;
|
|
13830
|
+
const tokenString = await token("EndUserToken", []);
|
|
13831
|
+
if (tokenString) {
|
|
13832
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13833
|
+
}
|
|
13834
|
+
}
|
|
13835
|
+
const response = await this.request({
|
|
13836
|
+
path: `/subscriber-inbox/read-all`,
|
|
13837
|
+
method: "POST",
|
|
13838
|
+
headers: headerParameters,
|
|
13839
|
+
query: queryParameters,
|
|
13840
|
+
body: MarkAllSubscriberNotificationsReadRequestToJSON(requestParameters["markAllSubscriberNotificationsReadRequest"])
|
|
13841
|
+
}, initOverrides);
|
|
13842
|
+
return new VoidApiResponse(response);
|
|
13843
|
+
}
|
|
13844
|
+
/**
|
|
13845
|
+
* Mark all notifications as read
|
|
13846
|
+
*/
|
|
13847
|
+
async markAllSubscriberNotificationsRead(markAllSubscriberNotificationsReadRequest, initOverrides) {
|
|
13848
|
+
await this.markAllSubscriberNotificationsReadRaw({ markAllSubscriberNotificationsReadRequest }, initOverrides);
|
|
13849
|
+
}
|
|
13403
13850
|
/**
|
|
13404
13851
|
* Mark a specific in-app notification as read.
|
|
13405
13852
|
* Mark notification as read
|
|
@@ -13434,6 +13881,39 @@ var InboxApi = class extends BaseAPI {
|
|
|
13434
13881
|
const response = await this.markInboxReadRaw({ id, markInboxReadRequest }, initOverrides);
|
|
13435
13882
|
return await response.value();
|
|
13436
13883
|
}
|
|
13884
|
+
/**
|
|
13885
|
+
* Mark notification as read
|
|
13886
|
+
*/
|
|
13887
|
+
async markSubscriberNotificationReadRaw(requestParameters, initOverrides) {
|
|
13888
|
+
if (requestParameters["id"] == null) {
|
|
13889
|
+
throw new RequiredError(
|
|
13890
|
+
"id",
|
|
13891
|
+
'Required parameter "id" was null or undefined when calling markSubscriberNotificationRead().'
|
|
13892
|
+
);
|
|
13893
|
+
}
|
|
13894
|
+
const queryParameters = {};
|
|
13895
|
+
const headerParameters = {};
|
|
13896
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
13897
|
+
const token = this.configuration.accessToken;
|
|
13898
|
+
const tokenString = await token("EndUserToken", []);
|
|
13899
|
+
if (tokenString) {
|
|
13900
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
13901
|
+
}
|
|
13902
|
+
}
|
|
13903
|
+
const response = await this.request({
|
|
13904
|
+
path: `/subscriber-inbox/{id}/read`.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters["id"]))),
|
|
13905
|
+
method: "POST",
|
|
13906
|
+
headers: headerParameters,
|
|
13907
|
+
query: queryParameters
|
|
13908
|
+
}, initOverrides);
|
|
13909
|
+
return new VoidApiResponse(response);
|
|
13910
|
+
}
|
|
13911
|
+
/**
|
|
13912
|
+
* Mark notification as read
|
|
13913
|
+
*/
|
|
13914
|
+
async markSubscriberNotificationRead(id, initOverrides) {
|
|
13915
|
+
await this.markSubscriberNotificationReadRaw({ id }, initOverrides);
|
|
13916
|
+
}
|
|
13437
13917
|
/**
|
|
13438
13918
|
* Send in-app notifications to multiple subscribers in a single request (max 100).
|
|
13439
13919
|
* Send batch in-app notifications
|
|
@@ -13502,6 +13982,43 @@ var InboxApi = class extends BaseAPI {
|
|
|
13502
13982
|
const response = await this.sendInAppRaw({ sendInAppRequest }, initOverrides);
|
|
13503
13983
|
return await response.value();
|
|
13504
13984
|
}
|
|
13985
|
+
/**
|
|
13986
|
+
* Update notification channel preferences for specific categories or globally.
|
|
13987
|
+
* Update subscriber preferences
|
|
13988
|
+
*/
|
|
13989
|
+
async updateSubscriberPreferencesRaw(requestParameters, initOverrides) {
|
|
13990
|
+
if (requestParameters["updateSubscriberPreferencesRequest"] == null) {
|
|
13991
|
+
throw new RequiredError(
|
|
13992
|
+
"updateSubscriberPreferencesRequest",
|
|
13993
|
+
'Required parameter "updateSubscriberPreferencesRequest" was null or undefined when calling updateSubscriberPreferences().'
|
|
13994
|
+
);
|
|
13995
|
+
}
|
|
13996
|
+
const queryParameters = {};
|
|
13997
|
+
const headerParameters = {};
|
|
13998
|
+
headerParameters["Content-Type"] = "application/json";
|
|
13999
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
14000
|
+
const token = this.configuration.accessToken;
|
|
14001
|
+
const tokenString = await token("EndUserToken", []);
|
|
14002
|
+
if (tokenString) {
|
|
14003
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
14004
|
+
}
|
|
14005
|
+
}
|
|
14006
|
+
const response = await this.request({
|
|
14007
|
+
path: `/subscriber-inbox/preferences`,
|
|
14008
|
+
method: "PUT",
|
|
14009
|
+
headers: headerParameters,
|
|
14010
|
+
query: queryParameters,
|
|
14011
|
+
body: UpdateSubscriberPreferencesRequestToJSON(requestParameters["updateSubscriberPreferencesRequest"])
|
|
14012
|
+
}, initOverrides);
|
|
14013
|
+
return new VoidApiResponse(response);
|
|
14014
|
+
}
|
|
14015
|
+
/**
|
|
14016
|
+
* Update notification channel preferences for specific categories or globally.
|
|
14017
|
+
* Update subscriber preferences
|
|
14018
|
+
*/
|
|
14019
|
+
async updateSubscriberPreferences(updateSubscriberPreferencesRequest, initOverrides) {
|
|
14020
|
+
await this.updateSubscriberPreferencesRaw({ updateSubscriberPreferencesRequest }, initOverrides);
|
|
14021
|
+
}
|
|
13505
14022
|
};
|
|
13506
14023
|
|
|
13507
14024
|
// src/src/apis/PushApi.ts
|
|
@@ -17692,6 +18209,18 @@ export {
|
|
|
17692
18209
|
ForgotPasswordRequestFromJSONTyped,
|
|
17693
18210
|
ForgotPasswordRequestToJSON,
|
|
17694
18211
|
ForgotPasswordRequestToJSONTyped,
|
|
18212
|
+
GenerateSubscriberToken200ResponseDataFromJSON,
|
|
18213
|
+
GenerateSubscriberToken200ResponseDataFromJSONTyped,
|
|
18214
|
+
GenerateSubscriberToken200ResponseDataToJSON,
|
|
18215
|
+
GenerateSubscriberToken200ResponseDataToJSONTyped,
|
|
18216
|
+
GenerateSubscriberToken200ResponseFromJSON,
|
|
18217
|
+
GenerateSubscriberToken200ResponseFromJSONTyped,
|
|
18218
|
+
GenerateSubscriberToken200ResponseToJSON,
|
|
18219
|
+
GenerateSubscriberToken200ResponseToJSONTyped,
|
|
18220
|
+
GenerateSubscriberTokenRequestFromJSON,
|
|
18221
|
+
GenerateSubscriberTokenRequestFromJSONTyped,
|
|
18222
|
+
GenerateSubscriberTokenRequestToJSON,
|
|
18223
|
+
GenerateSubscriberTokenRequestToJSONTyped,
|
|
17695
18224
|
GenerateWaaSPortalToken201ResponseFromJSON,
|
|
17696
18225
|
GenerateWaaSPortalToken201ResponseFromJSONTyped,
|
|
17697
18226
|
GenerateWaaSPortalToken201ResponseToJSON,
|
|
@@ -17781,6 +18310,10 @@ export {
|
|
|
17781
18310
|
MarkAllReadResponseFromJSONTyped,
|
|
17782
18311
|
MarkAllReadResponseToJSON,
|
|
17783
18312
|
MarkAllReadResponseToJSONTyped,
|
|
18313
|
+
MarkAllSubscriberNotificationsReadRequestFromJSON,
|
|
18314
|
+
MarkAllSubscriberNotificationsReadRequestFromJSONTyped,
|
|
18315
|
+
MarkAllSubscriberNotificationsReadRequestToJSON,
|
|
18316
|
+
MarkAllSubscriberNotificationsReadRequestToJSONTyped,
|
|
17784
18317
|
MarkInboxReadRequestFromJSON,
|
|
17785
18318
|
MarkInboxReadRequestFromJSONTyped,
|
|
17786
18319
|
MarkInboxReadRequestToJSON,
|
|
@@ -18466,6 +18999,15 @@ export {
|
|
|
18466
18999
|
UpdateEndUserRequestFromJSONTyped,
|
|
18467
19000
|
UpdateEndUserRequestToJSON,
|
|
18468
19001
|
UpdateEndUserRequestToJSONTyped,
|
|
19002
|
+
UpdateSubscriberPreferencesRequestFromJSON,
|
|
19003
|
+
UpdateSubscriberPreferencesRequestFromJSONTyped,
|
|
19004
|
+
UpdateSubscriberPreferencesRequestPreferencesInnerChannelEnum,
|
|
19005
|
+
UpdateSubscriberPreferencesRequestPreferencesInnerFromJSON,
|
|
19006
|
+
UpdateSubscriberPreferencesRequestPreferencesInnerFromJSONTyped,
|
|
19007
|
+
UpdateSubscriberPreferencesRequestPreferencesInnerToJSON,
|
|
19008
|
+
UpdateSubscriberPreferencesRequestPreferencesInnerToJSONTyped,
|
|
19009
|
+
UpdateSubscriberPreferencesRequestToJSON,
|
|
19010
|
+
UpdateSubscriberPreferencesRequestToJSONTyped,
|
|
18469
19011
|
UpdateSubscriberRequestFromJSON,
|
|
18470
19012
|
UpdateSubscriberRequestFromJSONTyped,
|
|
18471
19013
|
UpdateSubscriberRequestStatusEnum,
|
|
@@ -18878,6 +19420,9 @@ export {
|
|
|
18878
19420
|
instanceOfEndUserDeleteResponse,
|
|
18879
19421
|
instanceOfEndUserDeleteResponseData,
|
|
18880
19422
|
instanceOfForgotPasswordRequest,
|
|
19423
|
+
instanceOfGenerateSubscriberToken200Response,
|
|
19424
|
+
instanceOfGenerateSubscriberToken200ResponseData,
|
|
19425
|
+
instanceOfGenerateSubscriberTokenRequest,
|
|
18881
19426
|
instanceOfGenerateWaaSPortalToken201Response,
|
|
18882
19427
|
instanceOfGetWaaSEndpoint200Response,
|
|
18883
19428
|
instanceOfGetWaaSUsage200Response,
|
|
@@ -18897,6 +19442,7 @@ export {
|
|
|
18897
19442
|
instanceOfMarkAllInboxReadRequest,
|
|
18898
19443
|
instanceOfMarkAllReadData,
|
|
18899
19444
|
instanceOfMarkAllReadResponse,
|
|
19445
|
+
instanceOfMarkAllSubscriberNotificationsReadRequest,
|
|
18900
19446
|
instanceOfMarkInboxReadRequest,
|
|
18901
19447
|
instanceOfMfaBackupCodesResponse,
|
|
18902
19448
|
instanceOfMfaBackupCodesResponseData,
|
|
@@ -19062,6 +19608,8 @@ export {
|
|
|
19062
19608
|
instanceOfUnsubscribeResponse,
|
|
19063
19609
|
instanceOfUpdateCategoryRequest,
|
|
19064
19610
|
instanceOfUpdateEndUserRequest,
|
|
19611
|
+
instanceOfUpdateSubscriberPreferencesRequest,
|
|
19612
|
+
instanceOfUpdateSubscriberPreferencesRequestPreferencesInner,
|
|
19065
19613
|
instanceOfUpdateSubscriberRequest,
|
|
19066
19614
|
instanceOfUpdateTemplateRequest,
|
|
19067
19615
|
instanceOfUpdateTopicRequest,
|