@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.
- package/dist/cjs/Client.js +2 -2
- package/dist/cjs/api/resources/billing/client/Client.d.ts +3 -0
- package/dist/cjs/api/resources/billing/client/Client.js +5 -0
- package/dist/cjs/api/resources/billing/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/billing/resources/index.js +2 -1
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.d.ts +13 -0
- package/dist/cjs/api/resources/billing/resources/lineItemGroups/client/Client.js +59 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/client/Client.d.ts +23 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/client/Client.js +17 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/client/index.js +2 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/index.d.ts +2 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/index.js +18 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/index.d.ts +2 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/index.js +41 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.d.ts +83 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.js +308 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.d.ts +2 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.js +17 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.d.ts +13 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.js +5 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.js +2 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/index.d.ts +1 -0
- package/dist/cjs/api/resources/billing/resources/lineItems/resources/s3Objects/index.js +17 -0
- package/dist/cjs/api/types/LineItemGroupLineItemsRes.d.ts +11 -0
- package/dist/cjs/api/types/LineItemGroupLineItemsRes.js +5 -0
- package/dist/cjs/api/types/LineItemS3ObjectMetadata1.d.ts +19 -0
- package/dist/cjs/api/types/LineItemS3ObjectMetadata1.js +5 -0
- package/dist/cjs/api/types/index.d.ts +2 -0
- package/dist/cjs/api/types/index.js +2 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.mjs +2 -2
- package/dist/esm/api/resources/billing/client/Client.d.mts +3 -0
- package/dist/esm/api/resources/billing/client/Client.mjs +5 -0
- package/dist/esm/api/resources/billing/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/billing/resources/index.mjs +1 -0
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.d.mts +13 -0
- package/dist/esm/api/resources/billing/resources/lineItemGroups/client/Client.mjs +59 -0
- package/dist/esm/api/resources/billing/resources/lineItems/client/Client.d.mts +23 -0
- package/dist/esm/api/resources/billing/resources/lineItems/client/Client.mjs +13 -0
- package/dist/esm/api/resources/billing/resources/lineItems/client/index.d.mts +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/client/index.mjs +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/index.d.mts +2 -0
- package/dist/esm/api/resources/billing/resources/lineItems/index.mjs +2 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/index.d.mts +2 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/index.mjs +2 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.d.mts +83 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.mjs +271 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.d.mts +2 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.mjs +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.d.mts +13 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.mjs +4 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/requests/index.mjs +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/index.d.mts +1 -0
- package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/index.mjs +1 -0
- package/dist/esm/api/types/LineItemGroupLineItemsRes.d.mts +11 -0
- package/dist/esm/api/types/LineItemGroupLineItemsRes.mjs +4 -0
- package/dist/esm/api/types/LineItemS3ObjectMetadata1.d.mts +19 -0
- package/dist/esm/api/types/LineItemS3ObjectMetadata1.mjs +4 -0
- package/dist/esm/api/types/index.d.mts +2 -0
- package/dist/esm/api/types/index.mjs +2 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +327 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../core/index.mjs";
|
|
6
|
+
import { S3Objects } from "../resources/s3Objects/client/Client.mjs";
|
|
7
|
+
export declare namespace LineItems {
|
|
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
|
+
}
|
|
18
|
+
export declare class LineItems {
|
|
19
|
+
protected readonly _options: LineItems.Options;
|
|
20
|
+
protected _s3Objects: S3Objects | undefined;
|
|
21
|
+
constructor(_options?: LineItems.Options);
|
|
22
|
+
get s3Objects(): S3Objects;
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import { S3Objects } from "../resources/s3Objects/client/Client.mjs";
|
|
5
|
+
export class LineItems {
|
|
6
|
+
constructor(_options = {}) {
|
|
7
|
+
this._options = _options;
|
|
8
|
+
}
|
|
9
|
+
get s3Objects() {
|
|
10
|
+
var _a;
|
|
11
|
+
return ((_a = this._s3Objects) !== null && _a !== void 0 ? _a : (this._s3Objects = new S3Objects(this._options)));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.d.mts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
5
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
6
|
+
import * as Chrt from "../../../../../../../index.mjs";
|
|
7
|
+
export declare namespace S3Objects {
|
|
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 S3Objects {
|
|
31
|
+
protected readonly _options: S3Objects.Options;
|
|
32
|
+
constructor(_options?: S3Objects.Options);
|
|
33
|
+
/**
|
|
34
|
+
* Retrieves metadata for a line item S3 object. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemS3ObjectMetadata1)
|
|
35
|
+
*
|
|
36
|
+
* @param {string} lineItemS3ObjectMetadataId
|
|
37
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
+
*
|
|
39
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* await client.billing.lineItems.s3Objects.getS3ObjectMetadataV1("line_item_s3_object_metadata_id")
|
|
43
|
+
*/
|
|
44
|
+
getS3ObjectMetadataV1(lineItemS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<Chrt.LineItemS3ObjectMetadata1>;
|
|
45
|
+
private __getS3ObjectMetadataV1;
|
|
46
|
+
/**
|
|
47
|
+
* Streams a line item S3 object file from storage. | authz_personas=[lig_org_operators, lig_driver] | () -> (binary)
|
|
48
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
49
|
+
*/
|
|
50
|
+
getV1(lineItemS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
51
|
+
private __getV1;
|
|
52
|
+
/**
|
|
53
|
+
* Uploads a file to a line item. Automatic blurhash generation for images. | authz_personas=[lig_org_operators, lig_driver] | (UploadFile) -> (bool)
|
|
54
|
+
*
|
|
55
|
+
* @param {string} lineItemId
|
|
56
|
+
* @param {Chrt.billing.lineItems.BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost} request
|
|
57
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
58
|
+
*
|
|
59
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* import { createReadStream } from "fs";
|
|
63
|
+
* await client.billing.lineItems.s3Objects.addV1("line_item_id", {
|
|
64
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
65
|
+
* })
|
|
66
|
+
*/
|
|
67
|
+
addV1(lineItemId: string, request: Chrt.billing.lineItems.BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
68
|
+
private __addV1;
|
|
69
|
+
/**
|
|
70
|
+
* Deletes an S3 object metadata and the associated S3 object from a line item. | authz_personas=[lig_org_operators, lig_driver] | () -> (bool)
|
|
71
|
+
*
|
|
72
|
+
* @param {string} lineItemS3ObjectMetadataId
|
|
73
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
74
|
+
*
|
|
75
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* await client.billing.lineItems.s3Objects.deleteV1("line_item_s3_object_metadata_id")
|
|
79
|
+
*/
|
|
80
|
+
deleteV1(lineItemS3ObjectMetadataId: string, requestOptions?: S3Objects.RequestOptions): core.HttpResponsePromise<boolean>;
|
|
81
|
+
private __deleteV1;
|
|
82
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
83
|
+
}
|
package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/Client.mjs
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
5
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
6
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
7
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
8
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
9
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
10
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
import * as environments from "../../../../../../../../environments.mjs";
|
|
14
|
+
import * as core from "../../../../../../../../core/index.mjs";
|
|
15
|
+
import * as Chrt from "../../../../../../../index.mjs";
|
|
16
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../../../core/headers.mjs";
|
|
17
|
+
import * as errors from "../../../../../../../../errors/index.mjs";
|
|
18
|
+
export class S3Objects {
|
|
19
|
+
constructor(_options = {}) {
|
|
20
|
+
this._options = _options;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Retrieves metadata for a line item S3 object. | authz_personas=[lig_org_operators, lig_driver] | () -> (LineItemS3ObjectMetadata1)
|
|
24
|
+
*
|
|
25
|
+
* @param {string} lineItemS3ObjectMetadataId
|
|
26
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
27
|
+
*
|
|
28
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* await client.billing.lineItems.s3Objects.getS3ObjectMetadataV1("line_item_s3_object_metadata_id")
|
|
32
|
+
*/
|
|
33
|
+
getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
34
|
+
return core.HttpResponsePromise.fromPromise(this.__getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions));
|
|
35
|
+
}
|
|
36
|
+
__getS3ObjectMetadataV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
var _a, _b, _c, _d;
|
|
39
|
+
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);
|
|
40
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
41
|
+
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)}`),
|
|
42
|
+
method: "GET",
|
|
43
|
+
headers: _headers,
|
|
44
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
45
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
46
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
47
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
48
|
+
});
|
|
49
|
+
if (_response.ok) {
|
|
50
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
51
|
+
}
|
|
52
|
+
if (_response.error.reason === "status-code") {
|
|
53
|
+
switch (_response.error.statusCode) {
|
|
54
|
+
case 422:
|
|
55
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
56
|
+
default:
|
|
57
|
+
throw new errors.ChrtError({
|
|
58
|
+
statusCode: _response.error.statusCode,
|
|
59
|
+
body: _response.error.body,
|
|
60
|
+
rawResponse: _response.rawResponse,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
switch (_response.error.reason) {
|
|
65
|
+
case "non-json":
|
|
66
|
+
throw new errors.ChrtError({
|
|
67
|
+
statusCode: _response.error.statusCode,
|
|
68
|
+
body: _response.error.rawBody,
|
|
69
|
+
rawResponse: _response.rawResponse,
|
|
70
|
+
});
|
|
71
|
+
case "timeout":
|
|
72
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing/line_items/s3_objects/s3_object_metadata/v1/{line_item_s3_object_metadata_id}.");
|
|
73
|
+
case "unknown":
|
|
74
|
+
throw new errors.ChrtError({
|
|
75
|
+
message: _response.error.errorMessage,
|
|
76
|
+
rawResponse: _response.rawResponse,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Streams a line item S3 object file from storage. | authz_personas=[lig_org_operators, lig_driver] | () -> (binary)
|
|
83
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
84
|
+
*/
|
|
85
|
+
getV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
86
|
+
return core.HttpResponsePromise.fromPromise(this.__getV1(lineItemS3ObjectMetadataId, requestOptions));
|
|
87
|
+
}
|
|
88
|
+
__getV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
var _a, _b, _c, _d;
|
|
91
|
+
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);
|
|
92
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
93
|
+
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)}`),
|
|
94
|
+
method: "GET",
|
|
95
|
+
headers: _headers,
|
|
96
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
97
|
+
responseType: "binary-response",
|
|
98
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
99
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
100
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
101
|
+
});
|
|
102
|
+
if (_response.ok) {
|
|
103
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
104
|
+
}
|
|
105
|
+
if (_response.error.reason === "status-code") {
|
|
106
|
+
switch (_response.error.statusCode) {
|
|
107
|
+
case 422:
|
|
108
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
109
|
+
default:
|
|
110
|
+
throw new errors.ChrtError({
|
|
111
|
+
statusCode: _response.error.statusCode,
|
|
112
|
+
body: _response.error.body,
|
|
113
|
+
rawResponse: _response.rawResponse,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
switch (_response.error.reason) {
|
|
118
|
+
case "non-json":
|
|
119
|
+
throw new errors.ChrtError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.rawBody,
|
|
122
|
+
rawResponse: _response.rawResponse,
|
|
123
|
+
});
|
|
124
|
+
case "timeout":
|
|
125
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /billing/line_items/s3_objects/v1/{line_item_s3_object_metadata_id}.");
|
|
126
|
+
case "unknown":
|
|
127
|
+
throw new errors.ChrtError({
|
|
128
|
+
message: _response.error.errorMessage,
|
|
129
|
+
rawResponse: _response.rawResponse,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Uploads a file to a line item. Automatic blurhash generation for images. | authz_personas=[lig_org_operators, lig_driver] | (UploadFile) -> (bool)
|
|
136
|
+
*
|
|
137
|
+
* @param {string} lineItemId
|
|
138
|
+
* @param {Chrt.billing.lineItems.BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost} request
|
|
139
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
140
|
+
*
|
|
141
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
142
|
+
*
|
|
143
|
+
* @example
|
|
144
|
+
* import { createReadStream } from "fs";
|
|
145
|
+
* await client.billing.lineItems.s3Objects.addV1("line_item_id", {
|
|
146
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
147
|
+
* })
|
|
148
|
+
*/
|
|
149
|
+
addV1(lineItemId, request, requestOptions) {
|
|
150
|
+
return core.HttpResponsePromise.fromPromise(this.__addV1(lineItemId, request, requestOptions));
|
|
151
|
+
}
|
|
152
|
+
__addV1(lineItemId, request, requestOptions) {
|
|
153
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
154
|
+
var _a, _b, _c, _d;
|
|
155
|
+
const _request = yield core.newFormData();
|
|
156
|
+
yield _request.appendFile("file", request.file);
|
|
157
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
158
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
160
|
+
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)}`),
|
|
161
|
+
method: "POST",
|
|
162
|
+
headers: _headers,
|
|
163
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
164
|
+
requestType: "file",
|
|
165
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
166
|
+
body: _maybeEncodedRequest.body,
|
|
167
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
168
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
169
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
170
|
+
});
|
|
171
|
+
if (_response.ok) {
|
|
172
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
173
|
+
}
|
|
174
|
+
if (_response.error.reason === "status-code") {
|
|
175
|
+
switch (_response.error.statusCode) {
|
|
176
|
+
case 422:
|
|
177
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
178
|
+
default:
|
|
179
|
+
throw new errors.ChrtError({
|
|
180
|
+
statusCode: _response.error.statusCode,
|
|
181
|
+
body: _response.error.body,
|
|
182
|
+
rawResponse: _response.rawResponse,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
switch (_response.error.reason) {
|
|
187
|
+
case "non-json":
|
|
188
|
+
throw new errors.ChrtError({
|
|
189
|
+
statusCode: _response.error.statusCode,
|
|
190
|
+
body: _response.error.rawBody,
|
|
191
|
+
rawResponse: _response.rawResponse,
|
|
192
|
+
});
|
|
193
|
+
case "timeout":
|
|
194
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /billing/line_items/s3_objects/add/v1/{line_item_id}.");
|
|
195
|
+
case "unknown":
|
|
196
|
+
throw new errors.ChrtError({
|
|
197
|
+
message: _response.error.errorMessage,
|
|
198
|
+
rawResponse: _response.rawResponse,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Deletes an S3 object metadata and the associated S3 object from a line item. | authz_personas=[lig_org_operators, lig_driver] | () -> (bool)
|
|
205
|
+
*
|
|
206
|
+
* @param {string} lineItemS3ObjectMetadataId
|
|
207
|
+
* @param {S3Objects.RequestOptions} requestOptions - Request-specific configuration.
|
|
208
|
+
*
|
|
209
|
+
* @throws {@link Chrt.UnprocessableEntityError}
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* await client.billing.lineItems.s3Objects.deleteV1("line_item_s3_object_metadata_id")
|
|
213
|
+
*/
|
|
214
|
+
deleteV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
215
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteV1(lineItemS3ObjectMetadataId, requestOptions));
|
|
216
|
+
}
|
|
217
|
+
__deleteV1(lineItemS3ObjectMetadataId, requestOptions) {
|
|
218
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
219
|
+
var _a, _b, _c, _d;
|
|
220
|
+
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);
|
|
221
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
222
|
+
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)}`),
|
|
223
|
+
method: "DELETE",
|
|
224
|
+
headers: _headers,
|
|
225
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
226
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
227
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
228
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
229
|
+
});
|
|
230
|
+
if (_response.ok) {
|
|
231
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
232
|
+
}
|
|
233
|
+
if (_response.error.reason === "status-code") {
|
|
234
|
+
switch (_response.error.statusCode) {
|
|
235
|
+
case 422:
|
|
236
|
+
throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
237
|
+
default:
|
|
238
|
+
throw new errors.ChrtError({
|
|
239
|
+
statusCode: _response.error.statusCode,
|
|
240
|
+
body: _response.error.body,
|
|
241
|
+
rawResponse: _response.rawResponse,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
switch (_response.error.reason) {
|
|
246
|
+
case "non-json":
|
|
247
|
+
throw new errors.ChrtError({
|
|
248
|
+
statusCode: _response.error.statusCode,
|
|
249
|
+
body: _response.error.rawBody,
|
|
250
|
+
rawResponse: _response.rawResponse,
|
|
251
|
+
});
|
|
252
|
+
case "timeout":
|
|
253
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling DELETE /billing/line_items/s3_objects/delete/v1/{line_item_s3_object_metadata_id}.");
|
|
254
|
+
case "unknown":
|
|
255
|
+
throw new errors.ChrtError({
|
|
256
|
+
message: _response.error.errorMessage,
|
|
257
|
+
rawResponse: _response.rawResponse,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
_getAuthorizationHeader() {
|
|
263
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
264
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
265
|
+
if (bearer != null) {
|
|
266
|
+
return `Bearer ${bearer}`;
|
|
267
|
+
}
|
|
268
|
+
return undefined;
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
}
|
package/dist/esm/api/resources/billing/resources/lineItems/resources/s3Objects/client/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.mjs";
|
|
@@ -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.mjs";
|
|
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 @@
|
|
|
1
|
+
export { type BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost } from "./BodyLineItemsS3ObjectPostAddV1BillingLineItemsS3ObjectsAddV1LineItemIdPost.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.mjs";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Chrt from "../index.mjs";
|
|
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,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
|
+
}
|
|
@@ -138,11 +138,13 @@ export * from "./LineItem1.mjs";
|
|
|
138
138
|
export * from "./LineItemClientCreate1.mjs";
|
|
139
139
|
export * from "./LineItemEnum1.mjs";
|
|
140
140
|
export * from "./LineItemGroup1.mjs";
|
|
141
|
+
export * from "./LineItemGroupLineItemsRes.mjs";
|
|
141
142
|
export * from "./LineItemGroupListRes.mjs";
|
|
142
143
|
export * from "./LineItemGroupMessage1.mjs";
|
|
143
144
|
export * from "./LineItemGroupS3ObjectMetadata1.mjs";
|
|
144
145
|
export * from "./LineItemGroupStatusEnum1.mjs";
|
|
145
146
|
export * from "./LineItemProvenanceEnum.mjs";
|
|
147
|
+
export * from "./LineItemS3ObjectMetadata1.mjs";
|
|
146
148
|
export * from "./LineItemStatusEnum.mjs";
|
|
147
149
|
export * from "./LineString.mjs";
|
|
148
150
|
export * from "./Listing1.mjs";
|
|
@@ -138,11 +138,13 @@ export * from "./LineItem1.mjs";
|
|
|
138
138
|
export * from "./LineItemClientCreate1.mjs";
|
|
139
139
|
export * from "./LineItemEnum1.mjs";
|
|
140
140
|
export * from "./LineItemGroup1.mjs";
|
|
141
|
+
export * from "./LineItemGroupLineItemsRes.mjs";
|
|
141
142
|
export * from "./LineItemGroupListRes.mjs";
|
|
142
143
|
export * from "./LineItemGroupMessage1.mjs";
|
|
143
144
|
export * from "./LineItemGroupS3ObjectMetadata1.mjs";
|
|
144
145
|
export * from "./LineItemGroupStatusEnum1.mjs";
|
|
145
146
|
export * from "./LineItemProvenanceEnum.mjs";
|
|
147
|
+
export * from "./LineItemS3ObjectMetadata1.mjs";
|
|
146
148
|
export * from "./LineItemStatusEnum.mjs";
|
|
147
149
|
export * from "./LineString.mjs";
|
|
148
150
|
export * from "./Listing1.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.661.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.661.0";
|