@chrt-inc/typescript-sdk 1.359.0 → 1.363.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 (127) hide show
  1. package/dist/cjs/Client.d.ts +3 -6
  2. package/dist/cjs/Client.js +9 -14
  3. package/dist/cjs/api/resources/index.d.ts +2 -3
  4. package/dist/cjs/api/resources/index.js +3 -4
  5. package/dist/cjs/api/resources/notifications/client/Client.d.ts +41 -6
  6. package/dist/cjs/api/resources/notifications/client/Client.js +171 -8
  7. package/dist/cjs/api/resources/notifications/client/index.d.ts +1 -0
  8. package/dist/cjs/api/resources/notifications/client/index.js +15 -0
  9. package/dist/cjs/api/resources/notifications/client/requests/NotificationReq.d.ts +17 -0
  10. package/dist/cjs/api/resources/notifications/client/requests/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/notifications/index.d.ts +0 -1
  12. package/dist/cjs/api/resources/notifications/index.js +0 -1
  13. package/dist/cjs/api/types/ChrtEmailRecipient.d.ts +10 -0
  14. package/dist/cjs/api/types/{CourierNotificationEventEnum.js → ChrtEmailRecipient.js} +7 -0
  15. package/dist/cjs/api/types/NotificationRes.d.ts +10 -0
  16. package/dist/cjs/api/types/index.d.ts +2 -6
  17. package/dist/cjs/api/types/index.js +2 -6
  18. package/dist/cjs/version.d.ts +1 -1
  19. package/dist/cjs/version.js +1 -1
  20. package/dist/esm/Client.d.mts +3 -6
  21. package/dist/esm/Client.mjs +5 -10
  22. package/dist/esm/api/resources/index.d.mts +2 -3
  23. package/dist/esm/api/resources/index.mjs +2 -3
  24. package/dist/esm/api/resources/notifications/client/Client.d.mts +41 -6
  25. package/dist/esm/api/resources/notifications/client/Client.mjs +138 -8
  26. package/dist/esm/api/resources/notifications/client/index.d.mts +1 -0
  27. package/dist/esm/api/resources/notifications/client/index.mjs +1 -1
  28. package/dist/esm/api/resources/notifications/client/requests/NotificationReq.d.mts +17 -0
  29. package/dist/esm/api/resources/notifications/client/requests/index.d.mts +1 -0
  30. package/dist/esm/api/resources/notifications/index.d.mts +0 -1
  31. package/dist/esm/api/resources/notifications/index.mjs +0 -1
  32. package/dist/esm/api/types/ChrtEmailRecipient.d.mts +10 -0
  33. package/dist/esm/api/types/ChrtEmailRecipient.mjs +9 -0
  34. package/dist/esm/api/types/NotificationRes.d.mts +10 -0
  35. package/dist/esm/api/types/index.d.mts +2 -6
  36. package/dist/esm/api/types/index.mjs +2 -6
  37. package/dist/esm/version.d.mts +1 -1
  38. package/dist/esm/version.mjs +1 -1
  39. package/package.json +1 -1
  40. package/reference.md +13 -255
  41. package/dist/cjs/api/resources/notifications/resources/courier/client/Client.d.ts +0 -59
  42. package/dist/cjs/api/resources/notifications/resources/courier/client/Client.js +0 -183
  43. package/dist/cjs/api/resources/notifications/resources/courier/client/index.d.ts +0 -2
  44. package/dist/cjs/api/resources/notifications/resources/courier/client/index.js +0 -17
  45. package/dist/cjs/api/resources/notifications/resources/courier/client/requests/CourierNotificationPreferencesClientCreate1.d.ts +0 -18
  46. package/dist/cjs/api/resources/notifications/resources/courier/client/requests/index.d.ts +0 -1
  47. package/dist/cjs/api/resources/notifications/resources/courier/index.d.ts +0 -1
  48. package/dist/cjs/api/resources/notifications/resources/courier/index.js +0 -17
  49. package/dist/cjs/api/resources/notifications/resources/index.d.ts +0 -4
  50. package/dist/cjs/api/resources/notifications/resources/index.js +0 -43
  51. package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.d.ts +0 -59
  52. package/dist/cjs/api/resources/notifications/resources/shipper/client/Client.js +0 -183
  53. package/dist/cjs/api/resources/notifications/resources/shipper/client/index.d.ts +0 -2
  54. package/dist/cjs/api/resources/notifications/resources/shipper/client/index.js +0 -17
  55. package/dist/cjs/api/resources/notifications/resources/shipper/client/requests/ShipperNotificationPreferencesClientCreate1.d.ts +0 -18
  56. package/dist/cjs/api/resources/notifications/resources/shipper/client/requests/index.d.ts +0 -1
  57. package/dist/cjs/api/resources/notifications/resources/shipper/client/requests/index.js +0 -2
  58. package/dist/cjs/api/resources/notifications/resources/shipper/index.d.ts +0 -1
  59. package/dist/cjs/api/resources/notifications/resources/shipper/index.js +0 -17
  60. package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.d.ts +0 -59
  61. package/dist/cjs/api/resources/taskArtifactNotifications/client/Client.js +0 -186
  62. package/dist/cjs/api/resources/taskArtifactNotifications/client/index.d.ts +0 -2
  63. package/dist/cjs/api/resources/taskArtifactNotifications/client/index.js +0 -17
  64. package/dist/cjs/api/resources/taskArtifactNotifications/client/requests/TaskArtifactNotificationPreferencesClientCreate1.d.ts +0 -18
  65. package/dist/cjs/api/resources/taskArtifactNotifications/client/requests/TaskArtifactNotificationPreferencesClientCreate1.js +0 -5
  66. package/dist/cjs/api/resources/taskArtifactNotifications/client/requests/index.d.ts +0 -1
  67. package/dist/cjs/api/resources/taskArtifactNotifications/client/requests/index.js +0 -2
  68. package/dist/cjs/api/resources/taskArtifactNotifications/index.d.ts +0 -1
  69. package/dist/cjs/api/resources/taskArtifactNotifications/index.js +0 -17
  70. package/dist/cjs/api/types/CourierNotificationEventEnum.d.ts +0 -7
  71. package/dist/cjs/api/types/CourierNotificationPreferences1.d.ts +0 -18
  72. package/dist/cjs/api/types/CourierNotificationPreferences1.js +0 -5
  73. package/dist/cjs/api/types/NotificationChannelEnum.d.ts +0 -13
  74. package/dist/cjs/api/types/NotificationChannelEnum.js +0 -12
  75. package/dist/cjs/api/types/ShipperNotificationEventEnum.d.ts +0 -7
  76. package/dist/cjs/api/types/ShipperNotificationEventEnum.js +0 -5
  77. package/dist/cjs/api/types/ShipperNotificationPreferences1.d.ts +0 -18
  78. package/dist/cjs/api/types/ShipperNotificationPreferences1.js +0 -5
  79. package/dist/cjs/api/types/TaskArtifactNotificationPreferences1.d.ts +0 -18
  80. package/dist/cjs/api/types/TaskArtifactNotificationPreferences1.js +0 -5
  81. package/dist/esm/api/resources/notifications/resources/courier/client/Client.d.mts +0 -59
  82. package/dist/esm/api/resources/notifications/resources/courier/client/Client.mjs +0 -146
  83. package/dist/esm/api/resources/notifications/resources/courier/client/index.d.mts +0 -2
  84. package/dist/esm/api/resources/notifications/resources/courier/client/index.mjs +0 -1
  85. package/dist/esm/api/resources/notifications/resources/courier/client/requests/CourierNotificationPreferencesClientCreate1.d.mts +0 -18
  86. package/dist/esm/api/resources/notifications/resources/courier/client/requests/index.d.mts +0 -1
  87. package/dist/esm/api/resources/notifications/resources/courier/index.d.mts +0 -1
  88. package/dist/esm/api/resources/notifications/resources/courier/index.mjs +0 -1
  89. package/dist/esm/api/resources/notifications/resources/index.d.mts +0 -4
  90. package/dist/esm/api/resources/notifications/resources/index.mjs +0 -4
  91. package/dist/esm/api/resources/notifications/resources/shipper/client/Client.d.mts +0 -59
  92. package/dist/esm/api/resources/notifications/resources/shipper/client/Client.mjs +0 -146
  93. package/dist/esm/api/resources/notifications/resources/shipper/client/index.d.mts +0 -2
  94. package/dist/esm/api/resources/notifications/resources/shipper/client/index.mjs +0 -1
  95. package/dist/esm/api/resources/notifications/resources/shipper/client/requests/ShipperNotificationPreferencesClientCreate1.d.mts +0 -18
  96. package/dist/esm/api/resources/notifications/resources/shipper/client/requests/index.d.mts +0 -1
  97. package/dist/esm/api/resources/notifications/resources/shipper/client/requests/index.mjs +0 -1
  98. package/dist/esm/api/resources/notifications/resources/shipper/index.d.mts +0 -1
  99. package/dist/esm/api/resources/notifications/resources/shipper/index.mjs +0 -1
  100. package/dist/esm/api/resources/taskArtifactNotifications/client/Client.d.mts +0 -59
  101. package/dist/esm/api/resources/taskArtifactNotifications/client/Client.mjs +0 -149
  102. package/dist/esm/api/resources/taskArtifactNotifications/client/index.d.mts +0 -2
  103. package/dist/esm/api/resources/taskArtifactNotifications/client/index.mjs +0 -1
  104. package/dist/esm/api/resources/taskArtifactNotifications/client/requests/TaskArtifactNotificationPreferencesClientCreate1.d.mts +0 -18
  105. package/dist/esm/api/resources/taskArtifactNotifications/client/requests/TaskArtifactNotificationPreferencesClientCreate1.mjs +0 -4
  106. package/dist/esm/api/resources/taskArtifactNotifications/client/requests/index.d.mts +0 -1
  107. package/dist/esm/api/resources/taskArtifactNotifications/client/requests/index.mjs +0 -1
  108. package/dist/esm/api/resources/taskArtifactNotifications/index.d.mts +0 -1
  109. package/dist/esm/api/resources/taskArtifactNotifications/index.mjs +0 -1
  110. package/dist/esm/api/types/CourierNotificationEventEnum.d.mts +0 -7
  111. package/dist/esm/api/types/CourierNotificationEventEnum.mjs +0 -4
  112. package/dist/esm/api/types/CourierNotificationPreferences1.d.mts +0 -18
  113. package/dist/esm/api/types/CourierNotificationPreferences1.mjs +0 -4
  114. package/dist/esm/api/types/NotificationChannelEnum.d.mts +0 -13
  115. package/dist/esm/api/types/NotificationChannelEnum.mjs +0 -9
  116. package/dist/esm/api/types/ShipperNotificationEventEnum.d.mts +0 -7
  117. package/dist/esm/api/types/ShipperNotificationEventEnum.mjs +0 -4
  118. package/dist/esm/api/types/ShipperNotificationPreferences1.d.mts +0 -18
  119. package/dist/esm/api/types/ShipperNotificationPreferences1.mjs +0 -4
  120. package/dist/esm/api/types/TaskArtifactNotificationPreferences1.d.mts +0 -18
  121. package/dist/esm/api/types/TaskArtifactNotificationPreferences1.mjs +0 -4
  122. /package/dist/cjs/api/resources/notifications/{resources/courier/client/requests/CourierNotificationPreferencesClientCreate1.js → client/requests/NotificationReq.js} +0 -0
  123. /package/dist/cjs/api/resources/notifications/{resources/courier/client → client}/requests/index.js +0 -0
  124. /package/dist/cjs/api/{resources/notifications/resources/shipper/client/requests/ShipperNotificationPreferencesClientCreate1.js → types/NotificationRes.js} +0 -0
  125. /package/dist/esm/api/resources/notifications/{resources/courier/client/requests/CourierNotificationPreferencesClientCreate1.mjs → client/requests/NotificationReq.mjs} +0 -0
  126. /package/dist/esm/api/resources/notifications/{resources/courier/client → client}/requests/index.mjs +0 -0
  127. /package/dist/esm/api/{resources/notifications/resources/shipper/client/requests/ShipperNotificationPreferencesClientCreate1.mjs → types/NotificationRes.mjs} +0 -0
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.courier = exports.shipper = void 0;
40
- exports.shipper = __importStar(require("./shipper/index.js"));
41
- exports.courier = __importStar(require("./courier/index.js"));
42
- __exportStar(require("./shipper/client/requests/index.js"), exports);
43
- __exportStar(require("./courier/client/requests/index.js"), exports);
@@ -1,59 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../../../environments.js";
5
- import * as core from "../../../../../../core/index.js";
6
- import * as Chrt from "../../../../../index.js";
7
- export declare namespace Shipper {
8
- interface Options {
9
- environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
- /** Specify a custom URL to connect the client to. */
11
- baseUrl?: core.Supplier<string>;
12
- token?: core.Supplier<core.BearerToken | undefined>;
13
- /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
- fetcher?: core.FetchFunction;
16
- }
17
- interface RequestOptions {
18
- /** The maximum time to wait for a response in seconds. */
19
- timeoutInSeconds?: number;
20
- /** The number of times to retry the request. Defaults to 2. */
21
- maxRetries?: number;
22
- /** A hook to abort the request. */
23
- abortSignal?: AbortSignal;
24
- /** Additional query string parameters to include in the request. */
25
- queryParams?: Record<string, unknown>;
26
- /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
- }
29
- }
30
- export declare class Shipper {
31
- protected readonly _options: Shipper.Options;
32
- constructor(_options?: Shipper.Options);
33
- /**
34
- * Retrieves notification preferences for the caller's shipper organization. | () -> (ShipperNotificationPreferences1)
35
- *
36
- * @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
37
- *
38
- * @example
39
- * await client.notifications.shipper.getPreferencesV1()
40
- */
41
- getPreferencesV1(requestOptions?: Shipper.RequestOptions): core.HttpResponsePromise<Chrt.ShipperNotificationPreferences1>;
42
- private __getPreferencesV1;
43
- /**
44
- * Creates or updates notification preferences for the caller's shipper organization. | (ShipperNotificationPreferencesClientCreate1) -> (PydanticObjectId)
45
- *
46
- * @param {Chrt.notifications.ShipperNotificationPreferencesClientCreate1} request
47
- * @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
48
- *
49
- * @throws {@link Chrt.UnprocessableEntityError}
50
- *
51
- * @example
52
- * await client.notifications.shipper.upsertPreferencesV1({
53
- * schema_version: 1
54
- * })
55
- */
56
- upsertPreferencesV1(request: Chrt.notifications.ShipperNotificationPreferencesClientCreate1, requestOptions?: Shipper.RequestOptions): core.HttpResponsePromise<string>;
57
- private __upsertPreferencesV1;
58
- protected _getAuthorizationHeader(): Promise<string | undefined>;
59
- }
@@ -1,183 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.Shipper = void 0;
49
- const environments = __importStar(require("../../../../../../environments.js"));
50
- const core = __importStar(require("../../../../../../core/index.js"));
51
- const Chrt = __importStar(require("../../../../../index.js"));
52
- const headers_js_1 = require("../../../../../../core/headers.js");
53
- const errors = __importStar(require("../../../../../../errors/index.js"));
54
- class Shipper {
55
- constructor(_options = {}) {
56
- this._options = _options;
57
- }
58
- /**
59
- * Retrieves notification preferences for the caller's shipper organization. | () -> (ShipperNotificationPreferences1)
60
- *
61
- * @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
62
- *
63
- * @example
64
- * await client.notifications.shipper.getPreferencesV1()
65
- */
66
- getPreferencesV1(requestOptions) {
67
- return core.HttpResponsePromise.fromPromise(this.__getPreferencesV1(requestOptions));
68
- }
69
- __getPreferencesV1(requestOptions) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- var _a, _b, _c, _d;
72
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
73
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
74
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "notifications/shipper_preferences/v1"),
75
- method: "GET",
76
- headers: _headers,
77
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
78
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
79
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
80
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
81
- });
82
- if (_response.ok) {
83
- return { data: _response.body, rawResponse: _response.rawResponse };
84
- }
85
- if (_response.error.reason === "status-code") {
86
- throw new errors.ChrtError({
87
- statusCode: _response.error.statusCode,
88
- body: _response.error.body,
89
- rawResponse: _response.rawResponse,
90
- });
91
- }
92
- switch (_response.error.reason) {
93
- case "non-json":
94
- throw new errors.ChrtError({
95
- statusCode: _response.error.statusCode,
96
- body: _response.error.rawBody,
97
- rawResponse: _response.rawResponse,
98
- });
99
- case "timeout":
100
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /notifications/shipper_preferences/v1.");
101
- case "unknown":
102
- throw new errors.ChrtError({
103
- message: _response.error.errorMessage,
104
- rawResponse: _response.rawResponse,
105
- });
106
- }
107
- });
108
- }
109
- /**
110
- * Creates or updates notification preferences for the caller's shipper organization. | (ShipperNotificationPreferencesClientCreate1) -> (PydanticObjectId)
111
- *
112
- * @param {Chrt.notifications.ShipperNotificationPreferencesClientCreate1} request
113
- * @param {Shipper.RequestOptions} requestOptions - Request-specific configuration.
114
- *
115
- * @throws {@link Chrt.UnprocessableEntityError}
116
- *
117
- * @example
118
- * await client.notifications.shipper.upsertPreferencesV1({
119
- * schema_version: 1
120
- * })
121
- */
122
- upsertPreferencesV1(request, requestOptions) {
123
- return core.HttpResponsePromise.fromPromise(this.__upsertPreferencesV1(request, requestOptions));
124
- }
125
- __upsertPreferencesV1(request, requestOptions) {
126
- return __awaiter(this, void 0, void 0, function* () {
127
- var _a, _b, _c, _d;
128
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
129
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
130
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "notifications/shipper_preferences/upsert/v1"),
131
- method: "POST",
132
- headers: _headers,
133
- contentType: "application/json",
134
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
135
- requestType: "json",
136
- body: request,
137
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
138
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
139
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
140
- });
141
- if (_response.ok) {
142
- return { data: _response.body, rawResponse: _response.rawResponse };
143
- }
144
- if (_response.error.reason === "status-code") {
145
- switch (_response.error.statusCode) {
146
- case 422:
147
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
148
- default:
149
- throw new errors.ChrtError({
150
- statusCode: _response.error.statusCode,
151
- body: _response.error.body,
152
- rawResponse: _response.rawResponse,
153
- });
154
- }
155
- }
156
- switch (_response.error.reason) {
157
- case "non-json":
158
- throw new errors.ChrtError({
159
- statusCode: _response.error.statusCode,
160
- body: _response.error.rawBody,
161
- rawResponse: _response.rawResponse,
162
- });
163
- case "timeout":
164
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /notifications/shipper_preferences/upsert/v1.");
165
- case "unknown":
166
- throw new errors.ChrtError({
167
- message: _response.error.errorMessage,
168
- rawResponse: _response.rawResponse,
169
- });
170
- }
171
- });
172
- }
173
- _getAuthorizationHeader() {
174
- return __awaiter(this, void 0, void 0, function* () {
175
- const bearer = yield core.Supplier.get(this._options.token);
176
- if (bearer != null) {
177
- return `Bearer ${bearer}`;
178
- }
179
- return undefined;
180
- });
181
- }
182
- }
183
- exports.Shipper = Shipper;
@@ -1,2 +0,0 @@
1
- export {};
2
- export * from "./requests/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./requests/index.js"), exports);
@@ -1,18 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Chrt from "../../../../../../index.js";
5
- /**
6
- * @example
7
- * {
8
- * schema_version: 1
9
- * }
10
- */
11
- export interface ShipperNotificationPreferencesClientCreate1 {
12
- schema_version: number;
13
- email_addresses?: string[];
14
- sms_phone_numbers?: string[];
15
- voice_phone_numbers?: string[];
16
- /** For each ShipperNotificationEventEnum, which channels (email/sms/push/phone_call) are enabled */
17
- preferences?: Record<string, Chrt.NotificationChannelEnum[]>;
18
- }
@@ -1 +0,0 @@
1
- export { type ShipperNotificationPreferencesClientCreate1 } from "./ShipperNotificationPreferencesClientCreate1.js";
@@ -1,2 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +0,0 @@
1
- export * from "./client/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client/index.js"), exports);
@@ -1,59 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as environments from "../../../../environments.js";
5
- import * as core from "../../../../core/index.js";
6
- import * as Chrt from "../../../index.js";
7
- export declare namespace TaskArtifactNotifications {
8
- interface Options {
9
- environment?: core.Supplier<environments.ChrtEnvironment | string>;
10
- /** Specify a custom URL to connect the client to. */
11
- baseUrl?: core.Supplier<string>;
12
- token?: core.Supplier<core.BearerToken | undefined>;
13
- /** Additional headers to include in requests. */
14
- headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
15
- fetcher?: core.FetchFunction;
16
- }
17
- interface RequestOptions {
18
- /** The maximum time to wait for a response in seconds. */
19
- timeoutInSeconds?: number;
20
- /** The number of times to retry the request. Defaults to 2. */
21
- maxRetries?: number;
22
- /** A hook to abort the request. */
23
- abortSignal?: AbortSignal;
24
- /** Additional query string parameters to include in the request. */
25
- queryParams?: Record<string, unknown>;
26
- /** Additional headers to include in the request. */
27
- headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
28
- }
29
- }
30
- export declare class TaskArtifactNotifications {
31
- protected readonly _options: TaskArtifactNotifications.Options;
32
- constructor(_options?: TaskArtifactNotifications.Options);
33
- /**
34
- * Retrieves task_artifact notification preferences for the caller's organization. | () -> (TaskArtifactNotificationPreferences1)
35
- *
36
- * @param {TaskArtifactNotifications.RequestOptions} requestOptions - Request-specific configuration.
37
- *
38
- * @example
39
- * await client.taskArtifactNotifications.getPreferencesV1()
40
- */
41
- getPreferencesV1(requestOptions?: TaskArtifactNotifications.RequestOptions): core.HttpResponsePromise<Chrt.TaskArtifactNotificationPreferences1>;
42
- private __getPreferencesV1;
43
- /**
44
- * Creates or updates task_artifact notification preferences for the caller's organization. | (TaskArtifactNotificationPreferencesClientCreate1) -> (PydanticObjectId)
45
- *
46
- * @param {Chrt.TaskArtifactNotificationPreferencesClientCreate1} request
47
- * @param {TaskArtifactNotifications.RequestOptions} requestOptions - Request-specific configuration.
48
- *
49
- * @throws {@link Chrt.UnprocessableEntityError}
50
- *
51
- * @example
52
- * await client.taskArtifactNotifications.upsertPreferencesV1({
53
- * schema_version: 1
54
- * })
55
- */
56
- upsertPreferencesV1(request: Chrt.TaskArtifactNotificationPreferencesClientCreate1, requestOptions?: TaskArtifactNotifications.RequestOptions): core.HttpResponsePromise<string>;
57
- private __upsertPreferencesV1;
58
- protected _getAuthorizationHeader(): Promise<string | undefined>;
59
- }
@@ -1,186 +0,0 @@
1
- "use strict";
2
- /**
3
- * This file was auto-generated by Fern from our API Definition.
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
- desc = { enumerable: true, get: function() { return m[k]; } };
10
- }
11
- Object.defineProperty(o, k2, desc);
12
- }) : (function(o, m, k, k2) {
13
- if (k2 === undefined) k2 = k;
14
- o[k2] = m[k];
15
- }));
16
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
- Object.defineProperty(o, "default", { enumerable: true, value: v });
18
- }) : function(o, v) {
19
- o["default"] = v;
20
- });
21
- var __importStar = (this && this.__importStar) || (function () {
22
- var ownKeys = function(o) {
23
- ownKeys = Object.getOwnPropertyNames || function (o) {
24
- var ar = [];
25
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
26
- return ar;
27
- };
28
- return ownKeys(o);
29
- };
30
- return function (mod) {
31
- if (mod && mod.__esModule) return mod;
32
- var result = {};
33
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
34
- __setModuleDefault(result, mod);
35
- return result;
36
- };
37
- })();
38
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
39
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
40
- return new (P || (P = Promise))(function (resolve, reject) {
41
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
42
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
43
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44
- step((generator = generator.apply(thisArg, _arguments || [])).next());
45
- });
46
- };
47
- Object.defineProperty(exports, "__esModule", { value: true });
48
- exports.TaskArtifactNotifications = void 0;
49
- const environments = __importStar(require("../../../../environments.js"));
50
- const core = __importStar(require("../../../../core/index.js"));
51
- const Chrt = __importStar(require("../../../index.js"));
52
- const headers_js_1 = require("../../../../core/headers.js");
53
- const errors = __importStar(require("../../../../errors/index.js"));
54
- class TaskArtifactNotifications {
55
- constructor(_options = {}) {
56
- this._options = _options;
57
- }
58
- /**
59
- * Retrieves task_artifact notification preferences for the caller's organization. | () -> (TaskArtifactNotificationPreferences1)
60
- *
61
- * @param {TaskArtifactNotifications.RequestOptions} requestOptions - Request-specific configuration.
62
- *
63
- * @example
64
- * await client.taskArtifactNotifications.getPreferencesV1()
65
- */
66
- getPreferencesV1(requestOptions) {
67
- return core.HttpResponsePromise.fromPromise(this.__getPreferencesV1(requestOptions));
68
- }
69
- __getPreferencesV1(requestOptions) {
70
- return __awaiter(this, void 0, void 0, function* () {
71
- var _a, _b, _c, _d;
72
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
73
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
74
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "oort/task_artifact_notification_preferences/v1"),
75
- method: "GET",
76
- headers: _headers,
77
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
78
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
79
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
80
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
81
- });
82
- if (_response.ok) {
83
- return {
84
- data: _response.body,
85
- rawResponse: _response.rawResponse,
86
- };
87
- }
88
- if (_response.error.reason === "status-code") {
89
- throw new errors.ChrtError({
90
- statusCode: _response.error.statusCode,
91
- body: _response.error.body,
92
- rawResponse: _response.rawResponse,
93
- });
94
- }
95
- switch (_response.error.reason) {
96
- case "non-json":
97
- throw new errors.ChrtError({
98
- statusCode: _response.error.statusCode,
99
- body: _response.error.rawBody,
100
- rawResponse: _response.rawResponse,
101
- });
102
- case "timeout":
103
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /oort/task_artifact_notification_preferences/v1.");
104
- case "unknown":
105
- throw new errors.ChrtError({
106
- message: _response.error.errorMessage,
107
- rawResponse: _response.rawResponse,
108
- });
109
- }
110
- });
111
- }
112
- /**
113
- * Creates or updates task_artifact notification preferences for the caller's organization. | (TaskArtifactNotificationPreferencesClientCreate1) -> (PydanticObjectId)
114
- *
115
- * @param {Chrt.TaskArtifactNotificationPreferencesClientCreate1} request
116
- * @param {TaskArtifactNotifications.RequestOptions} requestOptions - Request-specific configuration.
117
- *
118
- * @throws {@link Chrt.UnprocessableEntityError}
119
- *
120
- * @example
121
- * await client.taskArtifactNotifications.upsertPreferencesV1({
122
- * schema_version: 1
123
- * })
124
- */
125
- upsertPreferencesV1(request, requestOptions) {
126
- return core.HttpResponsePromise.fromPromise(this.__upsertPreferencesV1(request, requestOptions));
127
- }
128
- __upsertPreferencesV1(request, requestOptions) {
129
- return __awaiter(this, void 0, void 0, function* () {
130
- var _a, _b, _c, _d;
131
- let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
132
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
133
- url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, "oort/task_artifact_notification_preferences/upsert/v1"),
134
- method: "POST",
135
- headers: _headers,
136
- contentType: "application/json",
137
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
138
- requestType: "json",
139
- body: request,
140
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
141
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
142
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
143
- });
144
- if (_response.ok) {
145
- return { data: _response.body, rawResponse: _response.rawResponse };
146
- }
147
- if (_response.error.reason === "status-code") {
148
- switch (_response.error.statusCode) {
149
- case 422:
150
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
151
- default:
152
- throw new errors.ChrtError({
153
- statusCode: _response.error.statusCode,
154
- body: _response.error.body,
155
- rawResponse: _response.rawResponse,
156
- });
157
- }
158
- }
159
- switch (_response.error.reason) {
160
- case "non-json":
161
- throw new errors.ChrtError({
162
- statusCode: _response.error.statusCode,
163
- body: _response.error.rawBody,
164
- rawResponse: _response.rawResponse,
165
- });
166
- case "timeout":
167
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /oort/task_artifact_notification_preferences/upsert/v1.");
168
- case "unknown":
169
- throw new errors.ChrtError({
170
- message: _response.error.errorMessage,
171
- rawResponse: _response.rawResponse,
172
- });
173
- }
174
- });
175
- }
176
- _getAuthorizationHeader() {
177
- return __awaiter(this, void 0, void 0, function* () {
178
- const bearer = yield core.Supplier.get(this._options.token);
179
- if (bearer != null) {
180
- return `Bearer ${bearer}`;
181
- }
182
- return undefined;
183
- });
184
- }
185
- }
186
- exports.TaskArtifactNotifications = TaskArtifactNotifications;
@@ -1,2 +0,0 @@
1
- export {};
2
- export * from "./requests/index.js";
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./requests/index.js"), exports);
@@ -1,18 +0,0 @@
1
- /**
2
- * This file was auto-generated by Fern from our API Definition.
3
- */
4
- import * as Chrt from "../../../../index.js";
5
- /**
6
- * @example
7
- * {
8
- * schema_version: 1
9
- * }
10
- */
11
- export interface TaskArtifactNotificationPreferencesClientCreate1 {
12
- schema_version: number;
13
- email_addresses?: string[];
14
- sms_phone_numbers?: string[];
15
- voice_phone_numbers?: string[];
16
- /** For each ChrtGroundCourierTaskActionEnum1, which channels (email/sms/voice) are enabled */
17
- preferences?: Record<string, Chrt.NotificationChannelEnum[]>;
18
- }
@@ -1,5 +0,0 @@
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 +0,0 @@
1
- export { type TaskArtifactNotificationPreferencesClientCreate1 } from "./TaskArtifactNotificationPreferencesClientCreate1.js";