@trycourier/courier 6.4.2 → 6.5.0

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.
Files changed (101) hide show
  1. package/Client.js +1 -1
  2. package/README.md +1 -1
  3. package/api/resources/audiences/client/Client.js +5 -5
  4. package/api/resources/auditEvents/client/Client.js +2 -2
  5. package/api/resources/authTokens/client/Client.js +1 -1
  6. package/api/resources/automations/client/Client.js +2 -2
  7. package/api/resources/brands/client/Client.js +5 -5
  8. package/api/resources/bulk/client/Client.js +5 -5
  9. package/api/resources/commons/types/BaseTemplateTenantAssociation.d.ts +15 -0
  10. package/api/resources/commons/types/BaseTemplateTenantAssociation.js +5 -0
  11. package/api/resources/commons/types/ListTemplateTenantAssociation.d.ts +7 -0
  12. package/api/resources/commons/types/ListTemplateTenantAssociation.js +5 -0
  13. package/api/resources/commons/types/SingleTemplateTenantAssociation.d.ts +7 -0
  14. package/api/resources/commons/types/SingleTemplateTenantAssociation.js +5 -0
  15. package/api/resources/commons/types/TenantTemplateData.d.ts +11 -0
  16. package/api/resources/commons/types/TenantTemplateData.js +5 -0
  17. package/api/resources/commons/types/TenantTemplateDataNoContent.d.ts +10 -0
  18. package/api/resources/commons/types/TenantTemplateDataNoContent.js +5 -0
  19. package/api/resources/commons/types/index.d.ts +5 -0
  20. package/api/resources/commons/types/index.js +5 -0
  21. package/api/resources/inbound/client/Client.js +1 -1
  22. package/api/resources/lists/client/Client.d.ts +3 -2
  23. package/api/resources/lists/client/Client.js +17 -15
  24. package/api/resources/lists/client/requests/RestoreListRequest.d.ts +9 -0
  25. package/api/resources/lists/client/requests/RestoreListRequest.js +5 -0
  26. package/api/resources/lists/client/requests/index.d.ts +1 -0
  27. package/api/resources/lists/types/List.d.ts +2 -2
  28. package/api/resources/messages/client/Client.js +6 -6
  29. package/api/resources/messages/types/Reason.d.ts +13 -1
  30. package/api/resources/messages/types/Reason.js +3 -0
  31. package/api/resources/notifications/client/Client.js +6 -6
  32. package/api/resources/profiles/client/Client.js +8 -8
  33. package/api/resources/templates/client/Client.js +1 -1
  34. package/api/resources/tenants/client/Client.d.ts +24 -0
  35. package/api/resources/tenants/client/Client.js +135 -7
  36. package/api/resources/tenants/client/requests/GetTemplateListByTenantParams.d.ts +17 -0
  37. package/api/resources/tenants/client/requests/GetTemplateListByTenantParams.js +5 -0
  38. package/api/resources/tenants/client/requests/index.d.ts +1 -0
  39. package/api/resources/tenants/types/GetTemplateByTenantResponse.d.ts +6 -0
  40. package/api/resources/tenants/types/GetTemplateByTenantResponse.js +5 -0
  41. package/api/resources/tenants/types/ListTemplatesByTenantResponse.d.ts +23 -0
  42. package/api/resources/tenants/types/ListTemplatesByTenantResponse.js +5 -0
  43. package/api/resources/tenants/types/index.d.ts +2 -0
  44. package/api/resources/tenants/types/index.js +2 -0
  45. package/api/resources/translations/client/Client.js +2 -2
  46. package/api/resources/users/resources/preferences/client/Client.js +3 -3
  47. package/api/resources/users/resources/tenants/client/Client.js +5 -5
  48. package/api/resources/users/resources/tokens/client/Client.js +6 -6
  49. package/dist/Client.js +1 -1
  50. package/dist/api/resources/audiences/client/Client.js +5 -5
  51. package/dist/api/resources/auditEvents/client/Client.js +2 -2
  52. package/dist/api/resources/authTokens/client/Client.js +1 -1
  53. package/dist/api/resources/automations/client/Client.js +2 -2
  54. package/dist/api/resources/brands/client/Client.js +5 -5
  55. package/dist/api/resources/bulk/client/Client.js +5 -5
  56. package/dist/api/resources/commons/types/BaseTemplateTenantAssociation.d.ts +15 -0
  57. package/dist/api/resources/commons/types/BaseTemplateTenantAssociation.js +5 -0
  58. package/dist/api/resources/commons/types/ListTemplateTenantAssociation.d.ts +7 -0
  59. package/dist/api/resources/commons/types/ListTemplateTenantAssociation.js +5 -0
  60. package/dist/api/resources/commons/types/SingleTemplateTenantAssociation.d.ts +7 -0
  61. package/dist/api/resources/commons/types/SingleTemplateTenantAssociation.js +5 -0
  62. package/dist/api/resources/commons/types/TenantTemplateData.d.ts +11 -0
  63. package/dist/api/resources/commons/types/TenantTemplateData.js +5 -0
  64. package/dist/api/resources/commons/types/TenantTemplateDataNoContent.d.ts +10 -0
  65. package/dist/api/resources/commons/types/TenantTemplateDataNoContent.js +5 -0
  66. package/dist/api/resources/commons/types/index.d.ts +5 -0
  67. package/dist/api/resources/commons/types/index.js +5 -0
  68. package/dist/api/resources/inbound/client/Client.js +1 -1
  69. package/dist/api/resources/lists/client/Client.d.ts +3 -2
  70. package/dist/api/resources/lists/client/Client.js +17 -15
  71. package/dist/api/resources/lists/client/requests/RestoreListRequest.d.ts +9 -0
  72. package/dist/api/resources/lists/client/requests/RestoreListRequest.js +5 -0
  73. package/dist/api/resources/lists/client/requests/index.d.ts +1 -0
  74. package/dist/api/resources/lists/types/List.d.ts +2 -2
  75. package/dist/api/resources/messages/client/Client.js +6 -6
  76. package/dist/api/resources/messages/types/Reason.d.ts +13 -1
  77. package/dist/api/resources/messages/types/Reason.js +3 -0
  78. package/dist/api/resources/notifications/client/Client.js +6 -6
  79. package/dist/api/resources/profiles/client/Client.js +8 -8
  80. package/dist/api/resources/templates/client/Client.js +1 -1
  81. package/dist/api/resources/tenants/client/Client.d.ts +24 -0
  82. package/dist/api/resources/tenants/client/Client.js +135 -7
  83. package/dist/api/resources/tenants/client/requests/GetTemplateListByTenantParams.d.ts +17 -0
  84. package/dist/api/resources/tenants/client/requests/GetTemplateListByTenantParams.js +5 -0
  85. package/dist/api/resources/tenants/client/requests/index.d.ts +1 -0
  86. package/dist/api/resources/tenants/types/GetTemplateByTenantResponse.d.ts +6 -0
  87. package/dist/api/resources/tenants/types/GetTemplateByTenantResponse.js +5 -0
  88. package/dist/api/resources/tenants/types/ListTemplatesByTenantResponse.d.ts +23 -0
  89. package/dist/api/resources/tenants/types/ListTemplatesByTenantResponse.js +5 -0
  90. package/dist/api/resources/tenants/types/index.d.ts +2 -0
  91. package/dist/api/resources/tenants/types/index.js +2 -0
  92. package/dist/api/resources/translations/client/Client.js +2 -2
  93. package/dist/api/resources/users/resources/preferences/client/Client.js +3 -3
  94. package/dist/api/resources/users/resources/tenants/client/Client.js +5 -5
  95. package/dist/api/resources/users/resources/tokens/client/Client.js +6 -6
  96. package/dist/version.d.ts +1 -1
  97. package/dist/version.js +1 -1
  98. package/package.json +1 -1
  99. package/reference.md +122 -2
  100. package/version.d.ts +1 -1
  101. package/version.js +1 -1
@@ -84,7 +84,7 @@ class Tenants {
84
84
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
85
85
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}`),
86
86
  method: "PUT",
87
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
88
  contentType: "application/json",
89
89
  requestType: "json",
90
90
  body: request,
@@ -142,7 +142,7 @@ class Tenants {
142
142
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
143
143
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}`),
144
144
  method: "GET",
145
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
145
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
146
146
  contentType: "application/json",
147
147
  requestType: "json",
148
148
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -208,7 +208,7 @@ class Tenants {
208
208
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
209
209
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, "/tenants"),
210
210
  method: "GET",
211
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
211
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
212
  contentType: "application/json",
213
213
  queryParameters: _queryParams,
214
214
  requestType: "json",
@@ -259,7 +259,7 @@ class Tenants {
259
259
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
260
260
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}`),
261
261
  method: "DELETE",
262
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
263
263
  contentType: "application/json",
264
264
  requestType: "json",
265
265
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -320,7 +320,7 @@ class Tenants {
320
320
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
321
321
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}/users`),
322
322
  method: "GET",
323
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
323
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
324
324
  contentType: "application/json",
325
325
  queryParameters: _queryParams,
326
326
  requestType: "json",
@@ -382,7 +382,7 @@ class Tenants {
382
382
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
383
383
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}/default_preferences/items/${encodeURIComponent(topicId)}`),
384
384
  method: "PUT",
385
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
385
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
386
386
  contentType: "application/json",
387
387
  requestType: "json",
388
388
  body: request,
@@ -434,7 +434,7 @@ class Tenants {
434
434
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
435
435
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}/default_preferences/items/${encodeURIComponent(topicId)}`),
436
436
  method: "DELETE",
437
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
437
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
438
438
  contentType: "application/json",
439
439
  requestType: "json",
440
440
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -468,6 +468,134 @@ class Tenants {
468
468
  }
469
469
  });
470
470
  }
471
+ /**
472
+ * @param {string} tenantId - Id of the tenant for which to retrieve the template.
473
+ * @param {string} templateId - Id of the template to be retrieved.
474
+ * @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
475
+ *
476
+ * @throws {@link Courier.BadRequestError}
477
+ *
478
+ * @example
479
+ * await client.tenants.getTemplateByTenant("tenant_id", "template_id")
480
+ */
481
+ getTemplateByTenant(tenantId, templateId, requestOptions) {
482
+ return core.HttpResponsePromise.fromPromise(this.__getTemplateByTenant(tenantId, templateId, requestOptions));
483
+ }
484
+ __getTemplateByTenant(tenantId, templateId, requestOptions) {
485
+ return __awaiter(this, void 0, void 0, function* () {
486
+ var _a, _b, _c;
487
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
488
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}/templates/${encodeURIComponent(templateId)}`),
489
+ method: "GET",
490
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
491
+ contentType: "application/json",
492
+ requestType: "json",
493
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
494
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
495
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
496
+ });
497
+ if (_response.ok) {
498
+ return { data: _response.body, rawResponse: _response.rawResponse };
499
+ }
500
+ if (_response.error.reason === "status-code") {
501
+ switch (_response.error.statusCode) {
502
+ case 400:
503
+ throw new Courier.BadRequestError(_response.error.body, _response.rawResponse);
504
+ default:
505
+ throw new errors.CourierError({
506
+ statusCode: _response.error.statusCode,
507
+ body: _response.error.body,
508
+ rawResponse: _response.rawResponse,
509
+ });
510
+ }
511
+ }
512
+ switch (_response.error.reason) {
513
+ case "non-json":
514
+ throw new errors.CourierError({
515
+ statusCode: _response.error.statusCode,
516
+ body: _response.error.rawBody,
517
+ rawResponse: _response.rawResponse,
518
+ });
519
+ case "timeout":
520
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /tenants/{tenant_id}/templates/{template_id}.");
521
+ case "unknown":
522
+ throw new errors.CourierError({
523
+ message: _response.error.errorMessage,
524
+ rawResponse: _response.rawResponse,
525
+ });
526
+ }
527
+ });
528
+ }
529
+ /**
530
+ * @param {string} tenantId - Id of the tenant for which to retrieve the templates.
531
+ * @param {Courier.GetTemplateListByTenantParams} request
532
+ * @param {Tenants.RequestOptions} requestOptions - Request-specific configuration.
533
+ *
534
+ * @throws {@link Courier.BadRequestError}
535
+ *
536
+ * @example
537
+ * await client.tenants.getTemplateListByTenant("tenant_id")
538
+ */
539
+ getTemplateListByTenant(tenantId, request = {}, requestOptions) {
540
+ return core.HttpResponsePromise.fromPromise(this.__getTemplateListByTenant(tenantId, request, requestOptions));
541
+ }
542
+ __getTemplateListByTenant(tenantId_1) {
543
+ return __awaiter(this, arguments, void 0, function* (tenantId, request = {}, requestOptions) {
544
+ var _a, _b, _c;
545
+ const { limit, cursor } = request;
546
+ const _queryParams = {};
547
+ if (limit != null) {
548
+ _queryParams["limit"] = limit.toString();
549
+ }
550
+ if (cursor != null) {
551
+ _queryParams["cursor"] = cursor;
552
+ }
553
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
554
+ url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/tenants/${encodeURIComponent(tenantId)}/templates`),
555
+ method: "GET",
556
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
557
+ contentType: "application/json",
558
+ queryParameters: _queryParams,
559
+ requestType: "json",
560
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
561
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
562
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
563
+ });
564
+ if (_response.ok) {
565
+ return {
566
+ data: _response.body,
567
+ rawResponse: _response.rawResponse,
568
+ };
569
+ }
570
+ if (_response.error.reason === "status-code") {
571
+ switch (_response.error.statusCode) {
572
+ case 400:
573
+ throw new Courier.BadRequestError(_response.error.body, _response.rawResponse);
574
+ default:
575
+ throw new errors.CourierError({
576
+ statusCode: _response.error.statusCode,
577
+ body: _response.error.body,
578
+ rawResponse: _response.rawResponse,
579
+ });
580
+ }
581
+ }
582
+ switch (_response.error.reason) {
583
+ case "non-json":
584
+ throw new errors.CourierError({
585
+ statusCode: _response.error.statusCode,
586
+ body: _response.error.rawBody,
587
+ rawResponse: _response.rawResponse,
588
+ });
589
+ case "timeout":
590
+ throw new errors.CourierTimeoutError("Timeout exceeded when calling GET /tenants/{tenant_id}/templates.");
591
+ case "unknown":
592
+ throw new errors.CourierError({
593
+ message: _response.error.errorMessage,
594
+ rawResponse: _response.rawResponse,
595
+ });
596
+ }
597
+ });
598
+ }
471
599
  _getAuthorizationHeader() {
472
600
  return __awaiter(this, void 0, void 0, function* () {
473
601
  var _a;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface GetTemplateListByTenantParams {
9
+ /**
10
+ * The number of templates to return (defaults to 20, maximum value of 100)
11
+ */
12
+ limit?: number;
13
+ /**
14
+ * Continue the pagination with the next cursor
15
+ */
16
+ cursor?: string;
17
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,4 @@
1
1
  export { type TenantCreateOrReplaceParams } from "./TenantCreateOrReplaceParams";
2
2
  export { type ListTenantParams } from "./ListTenantParams";
3
3
  export { type ListUsersForTenantParams } from "./ListUsersForTenantParams";
4
+ export { type GetTemplateListByTenantParams } from "./GetTemplateListByTenantParams";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Courier from "../../../index";
5
+ export interface GetTemplateByTenantResponse extends Courier.SingleTemplateTenantAssociation {
6
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Courier from "../../../index";
5
+ export interface ListTemplatesByTenantResponse {
6
+ items?: Courier.ListTemplateTenantAssociation[];
7
+ /** Set to true when there are more pages that can be retrieved. */
8
+ has_more: boolean;
9
+ /** A url that may be used to generate these results. */
10
+ url: string;
11
+ /**
12
+ * A url that may be used to generate fetch the next set of results.
13
+ * Defined only when `has_more` is set to true
14
+ */
15
+ next_url?: string;
16
+ /**
17
+ * A pointer to the next page of results. Defined
18
+ * only when `has_more` is set to true
19
+ */
20
+ cursor?: string;
21
+ /** Always set to `list`. Represents the type of this object. */
22
+ type: "list";
23
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -5,4 +5,6 @@ export * from "./SubscriptionTopicStatus";
5
5
  export * from "./Tenant";
6
6
  export * from "./TenantListResponse";
7
7
  export * from "./ListUsersForTenantResponse";
8
+ export * from "./GetTemplateByTenantResponse";
9
+ export * from "./ListTemplatesByTenantResponse";
8
10
  export * from "./TemplateProperty";
@@ -21,4 +21,6 @@ __exportStar(require("./SubscriptionTopicStatus"), exports);
21
21
  __exportStar(require("./Tenant"), exports);
22
22
  __exportStar(require("./TenantListResponse"), exports);
23
23
  __exportStar(require("./ListUsersForTenantResponse"), exports);
24
+ __exportStar(require("./GetTemplateByTenantResponse"), exports);
25
+ __exportStar(require("./ListTemplatesByTenantResponse"), exports);
24
26
  __exportStar(require("./TemplateProperty"), exports);
@@ -79,7 +79,7 @@ class Translations {
79
79
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
80
80
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/translations/${encodeURIComponent(domain)}/${encodeURIComponent(locale)}`),
81
81
  method: "GET",
82
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
83
83
  contentType: "application/json",
84
84
  requestType: "json",
85
85
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -140,7 +140,7 @@ class Translations {
140
140
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
141
141
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/translations/${encodeURIComponent(domain)}/${encodeURIComponent(locale)}`),
142
142
  method: "PUT",
143
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
143
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
144
144
  contentType: "application/json",
145
145
  requestType: "json",
146
146
  body: request,
@@ -95,7 +95,7 @@ class Preferences {
95
95
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
96
96
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences`),
97
97
  method: "GET",
98
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
99
  contentType: "application/json",
100
100
  queryParameters: _queryParams,
101
101
  requestType: "json",
@@ -165,7 +165,7 @@ class Preferences {
165
165
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
166
166
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
167
167
  method: "GET",
168
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
168
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
169
169
  contentType: "application/json",
170
170
  queryParameters: _queryParams,
171
171
  requestType: "json",
@@ -241,7 +241,7 @@ class Preferences {
241
241
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
242
242
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/preferences/${encodeURIComponent(topicId)}`),
243
243
  method: "PUT",
244
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
244
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
245
245
  contentType: "application/json",
246
246
  queryParameters: _queryParams,
247
247
  requestType: "json",
@@ -92,7 +92,7 @@ class Tenants {
92
92
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
93
93
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
94
94
  method: "PUT",
95
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
95
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
96
96
  contentType: "application/json",
97
97
  requestType: "json",
98
98
  body: request,
@@ -153,7 +153,7 @@ class Tenants {
153
153
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
154
154
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants/${encodeURIComponent(tenantId)}`),
155
155
  method: "PUT",
156
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
156
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
157
157
  contentType: "application/json",
158
158
  requestType: "json",
159
159
  body: request,
@@ -206,7 +206,7 @@ class Tenants {
206
206
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
207
207
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
208
208
  method: "DELETE",
209
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
209
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
210
210
  contentType: "application/json",
211
211
  requestType: "json",
212
212
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -259,7 +259,7 @@ class Tenants {
259
259
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
260
260
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants/${encodeURIComponent(tenantId)}`),
261
261
  method: "DELETE",
262
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
263
263
  contentType: "application/json",
264
264
  requestType: "json",
265
265
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -320,7 +320,7 @@ class Tenants {
320
320
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
321
321
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `users/${encodeURIComponent(userId)}/tenants`),
322
322
  method: "GET",
323
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
323
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
324
324
  contentType: "application/json",
325
325
  queryParameters: _queryParams,
326
326
  requestType: "json",
@@ -78,7 +78,7 @@ class Tokens {
78
78
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
79
79
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens`),
80
80
  method: "PUT",
81
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
81
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -146,7 +146,7 @@ class Tokens {
146
146
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
147
147
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
148
148
  method: "PUT",
149
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
149
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
150
150
  contentType: "application/json",
151
151
  requestType: "json",
152
152
  body: request,
@@ -218,7 +218,7 @@ class Tokens {
218
218
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
219
219
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
220
220
  method: "PATCH",
221
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
221
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
222
222
  contentType: "application/json",
223
223
  requestType: "json",
224
224
  body: request,
@@ -279,7 +279,7 @@ class Tokens {
279
279
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
280
280
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
281
281
  method: "GET",
282
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
282
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
283
283
  contentType: "application/json",
284
284
  requestType: "json",
285
285
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -338,7 +338,7 @@ class Tokens {
338
338
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
339
339
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens`),
340
340
  method: "GET",
341
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
341
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
342
342
  contentType: "application/json",
343
343
  requestType: "json",
344
344
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -394,7 +394,7 @@ class Tokens {
394
394
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
395
395
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CourierEnvironment.Production, `/users/${encodeURIComponent(userId)}/tokens/${encodeURIComponent(token)}`),
396
396
  method: "DELETE",
397
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.4.2", "User-Agent": "@trycourier/courier/6.4.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
397
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", "X-Fern-SDK-Version": "6.5.0", "User-Agent": "@trycourier/courier/6.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
398
398
  contentType: "application/json",
399
399
  requestType: "json",
400
400
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "6.4.2";
1
+ export declare const SDK_VERSION = "6.5.0";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "6.4.2";
4
+ exports.SDK_VERSION = "6.5.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier",
3
- "version": "6.4.2",
3
+ "version": "6.5.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/trycourier/courier-node",
6
6
  "main": "./index.js",