@chrt-inc/typescript-sdk 1.658.0 → 1.661.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 (68) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/billing/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/billing/client/Client.js +5 -0
  4. package/dist/cjs/api/resources/billing/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/billing/resources/index.js +2 -1
  6. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.d.ts +13 -0
  7. package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +59 -0
  8. package/dist/cjs/api/resources/billing/resources/lineItems/client/Client.d.ts +23 -0
  9. package/dist/cjs/api/resources/billing/resources/lineItems/client/Client.js +17 -0
  10. package/dist/cjs/api/resources/billing/resources/lineItems/client/index.d.ts +1 -0
  11. package/dist/cjs/api/resources/billing/resources/lineItems/client/index.js +2 -0
  12. package/dist/cjs/api/resources/billing/resources/lineItems/index.d.ts +2 -0
  13. package/dist/cjs/api/resources/billing/resources/lineItems/index.js +18 -0
  14. package/dist/cjs/api/resources/billing/resources/lineItems/resources/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/billing/resources/lineItems/resources/index.js +41 -0
  16. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.d.ts +83 -0
  17. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.js +308 -0
  18. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.d.ts +2 -0
  19. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.js +17 -0
  20. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.d.ts +13 -0
  21. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.js +5 -0
  22. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.js +2 -0
  24. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/index.d.ts +1 -0
  25. package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/index.js +17 -0
  26. package/dist/cjs/api/types/LineItemGroupLineItemsRes.d.ts +11 -0
  27. package/dist/cjs/api/types/LineItemGroupLineItemsRes.js +5 -0
  28. package/dist/cjs/api/types/LineItemS3ObjectMetadata1.d.ts +19 -0
  29. package/dist/cjs/api/types/LineItemS3ObjectMetadata1.js +5 -0
  30. package/dist/cjs/api/types/index.d.ts +2 -0
  31. package/dist/cjs/api/types/index.js +2 -0
  32. package/dist/cjs/version.d.ts +1 -1
  33. package/dist/cjs/version.js +1 -1
  34. package/dist/esm/Client.mjs +2 -2
  35. package/dist/esm/api/resources/billing/client/Client.d.mts +3 -0
  36. package/dist/esm/api/resources/billing/client/Client.mjs +5 -0
  37. package/dist/esm/api/resources/billing/resources/index.d.mts +1 -0
  38. package/dist/esm/api/resources/billing/resources/index.mjs +1 -0
  39. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.d.mts +13 -0
  40. package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +59 -0
  41. package/dist/esm/api/resources/billing/resources/lineItems/client/Client.d.mts +23 -0
  42. package/dist/esm/api/resources/billing/resources/lineItems/client/Client.mjs +13 -0
  43. package/dist/esm/api/resources/billing/resources/lineItems/client/index.d.mts +1 -0
  44. package/dist/esm/api/resources/billing/resources/lineItems/client/index.mjs +1 -0
  45. package/dist/esm/api/resources/billing/resources/lineItems/index.d.mts +2 -0
  46. package/dist/esm/api/resources/billing/resources/lineItems/index.mjs +2 -0
  47. package/dist/esm/api/resources/billing/resources/lineItems/resources/index.d.mts +2 -0
  48. package/dist/esm/api/resources/billing/resources/lineItems/resources/index.mjs +2 -0
  49. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.d.mts +83 -0
  50. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.mjs +271 -0
  51. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.d.mts +2 -0
  52. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.mjs +1 -0
  53. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.d.mts +13 -0
  54. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.mjs +4 -0
  55. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.d.mts +1 -0
  56. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.mjs +1 -0
  57. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/index.d.mts +1 -0
  58. package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/index.mjs +1 -0
  59. package/dist/esm/api/types/LineItemGroupLineItemsRes.d.mts +11 -0
  60. package/dist/esm/api/types/LineItemGroupLineItemsRes.mjs +4 -0
  61. package/dist/esm/api/types/LineItemS3ObjectMetadata1.d.mts +19 -0
  62. package/dist/esm/api/types/LineItemS3ObjectMetadata1.mjs +4 -0
  63. package/dist/esm/api/types/index.d.mts +2 -0
  64. package/dist/esm/api/types/index.mjs +2 -0
  65. package/dist/esm/version.d.mts +1 -1
  66. package/dist/esm/version.mjs +1 -1
  67. package/package.json +1 -1
  68. package/reference.md +327 -0
@@ -0,0 +1,308 @@
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.S3Objects = 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 S3Objects {
55
+ constructor(_options = {}) {
56
+ this._options = _options;
57
+ }
58
+ /**
59
+ * Retrieves metadata for a line item S3 object. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemS3ObjectMetadata1)
60
+ *
61
+ * @param {string} lineItemS3ObjectMetadataId
62
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
63
+ *
64
+ * @throws {@link Chrt.UnprocessableEntityError}
65
+ *
66
+ * @example
67
+ * await client.billing.lineItems.s3Objects.getS3ObjectMetadataV1("line_item_s3_object_metadata_id")
68
+ */
69
+ getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions) {
70
+ return core.HttpResponsePromise.fromPromise(this.__getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions));
71
+ }
72
+ __getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ var _a, _b, _c, _d;
75
+ 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);
76
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
77
+ 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, `billing/line_items/s3_objects/s3_object_metadata/v1/${encodeURIComponent(lineItemS3ObjectMetadataId)}`),
78
+ method: "GET",
79
+ headers: _headers,
80
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
81
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
82
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
83
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
84
+ });
85
+ if (_response.ok) {
86
+ return { data: _response.body, rawResponse: _response.rawResponse };
87
+ }
88
+ if (_response.error.reason === "status-code") {
89
+ switch (_response.error.statusCode) {
90
+ case 422:
91
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
92
+ default:
93
+ throw new errors.ChrtError({
94
+ statusCode: _response.error.statusCode,
95
+ body: _response.error.body,
96
+ rawResponse: _response.rawResponse,
97
+ });
98
+ }
99
+ }
100
+ switch (_response.error.reason) {
101
+ case "non-json":
102
+ throw new errors.ChrtError({
103
+ statusCode: _response.error.statusCode,
104
+ body: _response.error.rawBody,
105
+ rawResponse: _response.rawResponse,
106
+ });
107
+ case "timeout":
108
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing/line_items/s3_objects/s3_object_metadata/v1/{line_item_s3_object_metadata_id}.");
109
+ case "unknown":
110
+ throw new errors.ChrtError({
111
+ message: _response.error.errorMessage,
112
+ rawResponse: _response.rawResponse,
113
+ });
114
+ }
115
+ });
116
+ }
117
+ /**
118
+ * Streams a line item S3 object file from storage. | authz_personas=[lig_org_operators, lig_driver] | () -> (binary)
119
+ * @throws {@link Chrt.UnprocessableEntityError}
120
+ */
121
+ getV1(lineItemS3ObjectMetadataId, requestOptions) {
122
+ return core.HttpResponsePromise.fromPromise(this.__getV1(lineItemS3ObjectMetadataId, requestOptions));
123
+ }
124
+ __getV1(lineItemS3ObjectMetadataId, requestOptions) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ var _a, _b, _c, _d;
127
+ 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);
128
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
129
+ 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, `billing/line_items/s3_objects/v1/${encodeURIComponent(lineItemS3ObjectMetadataId)}`),
130
+ method: "GET",
131
+ headers: _headers,
132
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
133
+ responseType: "binary-response",
134
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
135
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
136
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
137
+ });
138
+ if (_response.ok) {
139
+ return { data: _response.body, rawResponse: _response.rawResponse };
140
+ }
141
+ if (_response.error.reason === "status-code") {
142
+ switch (_response.error.statusCode) {
143
+ case 422:
144
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
145
+ default:
146
+ throw new errors.ChrtError({
147
+ statusCode: _response.error.statusCode,
148
+ body: _response.error.body,
149
+ rawResponse: _response.rawResponse,
150
+ });
151
+ }
152
+ }
153
+ switch (_response.error.reason) {
154
+ case "non-json":
155
+ throw new errors.ChrtError({
156
+ statusCode: _response.error.statusCode,
157
+ body: _response.error.rawBody,
158
+ rawResponse: _response.rawResponse,
159
+ });
160
+ case "timeout":
161
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing/line_items/s3_objects/v1/{line_item_s3_object_metadata_id}.");
162
+ case "unknown":
163
+ throw new errors.ChrtError({
164
+ message: _response.error.errorMessage,
165
+ rawResponse: _response.rawResponse,
166
+ });
167
+ }
168
+ });
169
+ }
170
+ /**
171
+ * Uploads a file to a line item. Automatic blurhash generation for images. | authz_personas=[lig_org_operators, lig_driver] | (UploadFile) -> (bool)
172
+ *
173
+ * @param {string} lineItemId
174
+ * @param {Chrt.billing.lineItems.BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost} request
175
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
176
+ *
177
+ * @throws {@link Chrt.UnprocessableEntityError}
178
+ *
179
+ * @example
180
+ * import { createReadStream } from "fs";
181
+ * await client.billing.lineItems.s3Objects.addV1("line_item_id", {
182
+ * file: fs.createReadStream("/path/to/your/file")
183
+ * })
184
+ */
185
+ addV1(lineItemId, request, requestOptions) {
186
+ return core.HttpResponsePromise.fromPromise(this.__addV1(lineItemId, request, requestOptions));
187
+ }
188
+ __addV1(lineItemId, request, requestOptions) {
189
+ return __awaiter(this, void 0, void 0, function* () {
190
+ var _a, _b, _c, _d;
191
+ const _request = yield core.newFormData();
192
+ yield _request.appendFile("file", request.file);
193
+ const _maybeEncodedRequest = yield _request.getRequest();
194
+ let _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
195
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
196
+ 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, `billing/line_items/s3_objects/add/v1/${encodeURIComponent(lineItemId)}`),
197
+ method: "POST",
198
+ headers: _headers,
199
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
200
+ requestType: "file",
201
+ duplex: _maybeEncodedRequest.duplex,
202
+ body: _maybeEncodedRequest.body,
203
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
204
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
205
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
206
+ });
207
+ if (_response.ok) {
208
+ return { data: _response.body, rawResponse: _response.rawResponse };
209
+ }
210
+ if (_response.error.reason === "status-code") {
211
+ switch (_response.error.statusCode) {
212
+ case 422:
213
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
214
+ default:
215
+ throw new errors.ChrtError({
216
+ statusCode: _response.error.statusCode,
217
+ body: _response.error.body,
218
+ rawResponse: _response.rawResponse,
219
+ });
220
+ }
221
+ }
222
+ switch (_response.error.reason) {
223
+ case "non-json":
224
+ throw new errors.ChrtError({
225
+ statusCode: _response.error.statusCode,
226
+ body: _response.error.rawBody,
227
+ rawResponse: _response.rawResponse,
228
+ });
229
+ case "timeout":
230
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/line_items/s3_objects/add/v1/{line_item_id}.");
231
+ case "unknown":
232
+ throw new errors.ChrtError({
233
+ message: _response.error.errorMessage,
234
+ rawResponse: _response.rawResponse,
235
+ });
236
+ }
237
+ });
238
+ }
239
+ /**
240
+ * Deletes an S3 object metadata and the associated S3 object from a line item. | authz_personas=[lig_org_operators, lig_driver] | () -> (bool)
241
+ *
242
+ * @param {string} lineItemS3ObjectMetadataId
243
+ * @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
244
+ *
245
+ * @throws {@link Chrt.UnprocessableEntityError}
246
+ *
247
+ * @example
248
+ * await client.billing.lineItems.s3Objects.deleteV1("line_item_s3_object_metadata_id")
249
+ */
250
+ deleteV1(lineItemS3ObjectMetadataId, requestOptions) {
251
+ return core.HttpResponsePromise.fromPromise(this.__deleteV1(lineItemS3ObjectMetadataId, requestOptions));
252
+ }
253
+ __deleteV1(lineItemS3ObjectMetadataId, requestOptions) {
254
+ return __awaiter(this, void 0, void 0, function* () {
255
+ var _a, _b, _c, _d;
256
+ 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);
257
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
258
+ 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, `billing/line_items/s3_objects/delete/v1/${encodeURIComponent(lineItemS3ObjectMetadataId)}`),
259
+ method: "DELETE",
260
+ headers: _headers,
261
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
262
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
263
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
264
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
265
+ });
266
+ if (_response.ok) {
267
+ return { data: _response.body, rawResponse: _response.rawResponse };
268
+ }
269
+ if (_response.error.reason === "status-code") {
270
+ switch (_response.error.statusCode) {
271
+ case 422:
272
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
273
+ default:
274
+ throw new errors.ChrtError({
275
+ statusCode: _response.error.statusCode,
276
+ body: _response.error.body,
277
+ rawResponse: _response.rawResponse,
278
+ });
279
+ }
280
+ }
281
+ switch (_response.error.reason) {
282
+ case "non-json":
283
+ throw new errors.ChrtError({
284
+ statusCode: _response.error.statusCode,
285
+ body: _response.error.rawBody,
286
+ rawResponse: _response.rawResponse,
287
+ });
288
+ case "timeout":
289
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing/line_items/s3_objects/delete/v1/{line_item_s3_object_metadata_id}.");
290
+ case "unknown":
291
+ throw new errors.ChrtError({
292
+ message: _response.error.errorMessage,
293
+ rawResponse: _response.rawResponse,
294
+ });
295
+ }
296
+ });
297
+ }
298
+ _getAuthorizationHeader() {
299
+ return __awaiter(this, void 0, void 0, function* () {
300
+ const bearer = yield core.Supplier.get(this._options.token);
301
+ if (bearer != null) {
302
+ return `Bearer ${bearer}`;
303
+ }
304
+ return undefined;
305
+ });
306
+ }
307
+ }
308
+ exports.S3Objects = S3Objects;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
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);
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as core from "../../../../../../../../../core/index.js";
5
+ /**
6
+ * @example
7
+ * {
8
+ * file: fs.createReadStream("/path/to/your/file")
9
+ * }
10
+ */
11
+ export interface BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost {
12
+ file: core.file.Uploadable.FileLike;
13
+ }
@@ -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 @@
1
+ export { type BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost } from "./BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
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);
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ export interface LineItemGroupLineItemsRes {
6
+ items: Chrt.LineItem1[];
7
+ agreement_line_items: Chrt.LineItem1[];
8
+ amendment_line_items: Chrt.LineItem1[];
9
+ pending_line_items: Chrt.LineItem1[];
10
+ denied_line_items: Chrt.LineItem1[];
11
+ }
@@ -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,19 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface LineItemS3ObjectMetadata1 {
5
+ schema_version: number;
6
+ _id: string;
7
+ line_item_id: string;
8
+ uploaded_at_timestamp: string;
9
+ /** Must be a string starting with `user_` */
10
+ uploaded_by_user_id: string;
11
+ /** Must be a string starting with `org_` */
12
+ uploaded_by_org_id: string;
13
+ s3_key_prefix?: "billing/line_item_s3_object_metadata";
14
+ blurhash?: string | null;
15
+ /** MIME type of the uploaded file (e.g., 'image/jpeg', 'application/pdf') */
16
+ content_type?: string | null;
17
+ /** Original filename of the uploaded file */
18
+ filename?: string | null;
19
+ }
@@ -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 });
@@ -138,11 +138,13 @@ export * from "./LineItem1.js";
138
138
  export * from "./LineItemClientCreate1.js";
139
139
  export * from "./LineItemEnum1.js";
140
140
  export * from "./LineItemGroup1.js";
141
+ export * from "./LineItemGroupLineItemsRes.js";
141
142
  export * from "./LineItemGroupListRes.js";
142
143
  export * from "./LineItemGroupMessage1.js";
143
144
  export * from "./LineItemGroupS3ObjectMetadata1.js";
144
145
  export * from "./LineItemGroupStatusEnum1.js";
145
146
  export * from "./LineItemProvenanceEnum.js";
147
+ export * from "./LineItemS3ObjectMetadata1.js";
146
148
  export * from "./LineItemStatusEnum.js";
147
149
  export * from "./LineString.js";
148
150
  export * from "./Listing1.js";
@@ -154,11 +154,13 @@ __exportStar(require("./LineItem1.js"), exports);
154
154
  __exportStar(require("./LineItemClientCreate1.js"), exports);
155
155
  __exportStar(require("./LineItemEnum1.js"), exports);
156
156
  __exportStar(require("./LineItemGroup1.js"), exports);
157
+ __exportStar(require("./LineItemGroupLineItemsRes.js"), exports);
157
158
  __exportStar(require("./LineItemGroupListRes.js"), exports);
158
159
  __exportStar(require("./LineItemGroupMessage1.js"), exports);
159
160
  __exportStar(require("./LineItemGroupS3ObjectMetadata1.js"), exports);
160
161
  __exportStar(require("./LineItemGroupStatusEnum1.js"), exports);
161
162
  __exportStar(require("./LineItemProvenanceEnum.js"), exports);
163
+ __exportStar(require("./LineItemS3ObjectMetadata1.js"), exports);
162
164
  __exportStar(require("./LineItemStatusEnum.js"), exports);
163
165
  __exportStar(require("./LineString.js"), exports);
164
166
  __exportStar(require("./Listing1.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.658.0";
1
+ export declare const SDK_VERSION = "1.661.0";
@@ -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 = "1.658.0";
4
+ exports.SDK_VERSION = "1.661.0";
@@ -20,8 +20,8 @@ export class ChrtClient {
20
20
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
21
21
  "X-Fern-Language": "JavaScript",
22
22
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
23
- "X-Fern-SDK-Version": "1.658.0",
24
- "User-Agent": "@chrt-inc/typescript-sdk/1.658.0",
23
+ "X-Fern-SDK-Version": "1.661.0",
24
+ "User-Agent": "@chrt-inc/typescript-sdk/1.661.0",
25
25
  "X-Fern-Runtime": core.RUNTIME.type,
26
26
  "X-Fern-Runtime-Version": core.RUNTIME.version,
27
27
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -13,6 +13,7 @@ import { RateSheetMappings } from "../resources/rateSheetMappings/client/Client.
13
13
  import { Statements } from "../resources/statements/client/Client.mjs";
14
14
  import { Stripe } from "../resources/stripe/client/Client.mjs";
15
15
  import { StripeConnect } from "../resources/stripeConnect/client/Client.mjs";
16
+ import { LineItems } from "../resources/lineItems/client/Client.mjs";
16
17
  export declare namespace Billing {
17
18
  interface Options {
18
19
  environment?: core.Supplier<environments.ChrtEnvironment | string>;
@@ -36,6 +37,7 @@ export declare class Billing {
36
37
  protected _statements: Statements | undefined;
37
38
  protected _stripe: Stripe | undefined;
38
39
  protected _stripeConnect: StripeConnect | undefined;
40
+ protected _lineItems: LineItems | undefined;
39
41
  constructor(_options?: Billing.Options);
40
42
  get billingLedgers(): BillingLedgers;
41
43
  get billingLedgerPeriods(): BillingLedgerPeriods;
@@ -47,4 +49,5 @@ export declare class Billing {
47
49
  get statements(): Statements;
48
50
  get stripe(): Stripe;
49
51
  get stripeConnect(): StripeConnect;
52
+ get lineItems(): LineItems;
50
53
  }
@@ -11,6 +11,7 @@ import { RateSheetMappings } from "../resources/rateSheetMappings/client/Client.
11
11
  import { Statements } from "../resources/statements/client/Client.mjs";
12
12
  import { Stripe } from "../resources/stripe/client/Client.mjs";
13
13
  import { StripeConnect } from "../resources/stripeConnect/client/Client.mjs";
14
+ import { LineItems } from "../resources/lineItems/client/Client.mjs";
14
15
  export class Billing {
15
16
  constructor(_options = {}) {
16
17
  this._options = _options;
@@ -55,4 +56,8 @@ export class Billing {
55
56
  var _a;
56
57
  return ((_a = this._stripeConnect) !== null && _a !== void 0 ? _a : (this._stripeConnect = new StripeConnect(this._options)));
57
58
  }
59
+ get lineItems() {
60
+ var _a;
61
+ return ((_a = this._lineItems) !== null && _a !== void 0 ? _a : (this._lineItems = new LineItems(this._options)));
62
+ }
58
63
  }
@@ -8,6 +8,7 @@ export * as rateSheetMappings from "./rateSheetMappings/index.mjs";
8
8
  export * as statements from "./statements/index.mjs";
9
9
  export * as stripe from "./stripe/index.mjs";
10
10
  export * as stripeConnect from "./stripeConnect/index.mjs";
11
+ export * as lineItems from "./lineItems/index.mjs";
11
12
  export * from "./billingLedgers/client/requests/index.mjs";
12
13
  export * from "./billingLedgerPeriods/client/requests/index.mjs";
13
14
  export * from "./lineItemGroups/client/requests/index.mjs";
@@ -8,6 +8,7 @@ export * as rateSheetMappings from "./rateSheetMappings/index.mjs";
8
8
  export * as statements from "./statements/index.mjs";
9
9
  export * as stripe from "./stripe/index.mjs";
10
10
  export * as stripeConnect from "./stripeConnect/index.mjs";
11
+ export * as lineItems from "./lineItems/index.mjs";
11
12
  export * from "./billingLedgers/client/requests/index.mjs";
12
13
  export * from "./billingLedgerPeriods/client/requests/index.mjs";
13
14
  export * from "./lineItemGroups/client/requests/index.mjs";
@@ -49,6 +49,19 @@ export declare class LineItemGroups {
49
49
  */
50
50
  getByIdV1(id: string, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroup1>;
51
51
  private __getByIdV1;
52
+ /**
53
+ * Retrieves all LineItems referenced by a LineItemGroup the caller can access. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemGroupLineItemsRes)
54
+ *
55
+ * @param {string} lineItemGroupId
56
+ * @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link Chrt.UnprocessableEntityError}
59
+ *
60
+ * @example
61
+ * await client.billing.lineItemGroups.getLineItemsV1("line_item_group_id")
62
+ */
63
+ getLineItemsV1(lineItemGroupId: string, requestOptions?: LineItemGroups.RequestOptions): core.HttpResponsePromise<Chrt.LineItemGroupLineItemsRes>;
64
+ private __getLineItemsV1;
52
65
  /**
53
66
  * Lists LineItemGroups the caller owns, is a payment counterparty on, or is the destination driver for. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemGroupListRes)
54
67
  *
@@ -88,6 +88,65 @@ export class LineItemGroups {
88
88
  }
89
89
  });
90
90
  }
91
+ /**
92
+ * Retrieves all LineItems referenced by a LineItemGroup the caller can access. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemGroupLineItemsRes)
93
+ *
94
+ * @param {string} lineItemGroupId
95
+ * @param {LineItemGroups.RequestOptions} requestOptions - Request-specific configuration.
96
+ *
97
+ * @throws {@link Chrt.UnprocessableEntityError}
98
+ *
99
+ * @example
100
+ * await client.billing.lineItemGroups.getLineItemsV1("line_item_group_id")
101
+ */
102
+ getLineItemsV1(lineItemGroupId, requestOptions) {
103
+ return core.HttpResponsePromise.fromPromise(this.__getLineItemsV1(lineItemGroupId, requestOptions));
104
+ }
105
+ __getLineItemsV1(lineItemGroupId, requestOptions) {
106
+ return __awaiter(this, void 0, void 0, function* () {
107
+ var _a, _b, _c, _d;
108
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
109
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
110
+ 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, `billing/line_item_groups/line_items/v1/${encodeURIComponent(lineItemGroupId)}`),
111
+ method: "GET",
112
+ headers: _headers,
113
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
114
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
115
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
116
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
117
+ });
118
+ if (_response.ok) {
119
+ return { data: _response.body, rawResponse: _response.rawResponse };
120
+ }
121
+ if (_response.error.reason === "status-code") {
122
+ switch (_response.error.statusCode) {
123
+ case 422:
124
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
125
+ default:
126
+ throw new errors.ChrtError({
127
+ statusCode: _response.error.statusCode,
128
+ body: _response.error.body,
129
+ rawResponse: _response.rawResponse,
130
+ });
131
+ }
132
+ }
133
+ switch (_response.error.reason) {
134
+ case "non-json":
135
+ throw new errors.ChrtError({
136
+ statusCode: _response.error.statusCode,
137
+ body: _response.error.rawBody,
138
+ rawResponse: _response.rawResponse,
139
+ });
140
+ case "timeout":
141
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing/line_item_groups/line_items/v1/{line_item_group_id}.");
142
+ case "unknown":
143
+ throw new errors.ChrtError({
144
+ message: _response.error.errorMessage,
145
+ rawResponse: _response.rawResponse,
146
+ });
147
+ }
148
+ });
149
+ }
91
150
  /**
92
151
  * Lists LineItemGroups the caller owns, is a payment counterparty on, or is the destination driver for. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemGroupListRes)
93
152
  *