@chrt-inc/typescript-sdk 1.271.0 → 1.280.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/dev/client/Client.d.ts +27 -4
- package/dist/cjs/api/resources/dev/client/Client.js +114 -7
- package/dist/cjs/api/resources/dev/index.d.ts +1 -0
- package/dist/cjs/api/resources/dev/index.js +1 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/client/Client.d.ts +43 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/client/Client.js +118 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/client/index.d.ts +1 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/client/index.js +2 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/index.d.ts +1 -0
- package/dist/cjs/api/resources/dev/resources/getUserId/index.js +17 -0
- package/dist/cjs/api/resources/dev/resources/index.d.ts +1 -0
- package/dist/cjs/api/resources/dev/resources/index.js +37 -0
- package/dist/cjs/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.ts +3 -0
- package/dist/cjs/api/types/TaskGroupExpanded.d.ts +3 -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/dev/client/Client.d.mts +27 -4
- package/dist/esm/api/resources/dev/client/Client.mjs +114 -7
- package/dist/esm/api/resources/dev/index.d.mts +1 -0
- package/dist/esm/api/resources/dev/index.mjs +1 -0
- package/dist/esm/api/resources/dev/resources/getUserId/client/Client.d.mts +43 -0
- package/dist/esm/api/resources/dev/resources/getUserId/client/Client.mjs +81 -0
- package/dist/esm/api/resources/dev/resources/getUserId/client/index.d.mts +1 -0
- package/dist/esm/api/resources/dev/resources/getUserId/client/index.mjs +1 -0
- package/dist/esm/api/resources/dev/resources/getUserId/index.d.mts +1 -0
- package/dist/esm/api/resources/dev/resources/getUserId/index.mjs +1 -0
- package/dist/esm/api/resources/dev/resources/index.d.mts +1 -0
- package/dist/esm/api/resources/dev/resources/index.mjs +1 -0
- package/dist/esm/api/resources/taskGroups/client/requests/TaskGroupsExpandedReq.d.mts +3 -0
- package/dist/esm/api/types/TaskGroupExpanded.d.mts +3 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +170 -3
package/dist/cjs/Client.js
CHANGED
|
@@ -68,8 +68,8 @@ class ChrtClient {
|
|
|
68
68
|
this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
|
|
69
69
|
"X-Fern-Language": "JavaScript",
|
|
70
70
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
71
|
-
"X-Fern-SDK-Version": "1.
|
|
72
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
71
|
+
"X-Fern-SDK-Version": "1.280.0",
|
|
72
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.280.0",
|
|
73
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
75
75
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.js";
|
|
5
5
|
import * as core from "../../../../core/index.js";
|
|
6
6
|
import * as Chrt from "../../../index.js";
|
|
7
|
+
import { GetUserId } from "../resources/getUserId/client/Client.js";
|
|
7
8
|
export declare namespace Dev {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -29,17 +30,29 @@ export declare namespace Dev {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class Dev {
|
|
31
32
|
protected readonly _options: Dev.Options;
|
|
33
|
+
protected _getUserId: GetUserId | undefined;
|
|
32
34
|
constructor(_options?: Dev.Options);
|
|
35
|
+
get getUserId(): GetUserId;
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* Experimental route for running AI agentic workflows
|
|
35
38
|
*
|
|
36
39
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
40
|
*
|
|
38
41
|
* @example
|
|
39
|
-
* await client.dev.
|
|
42
|
+
* await client.dev.getAgent()
|
|
40
43
|
*/
|
|
41
|
-
|
|
42
|
-
private
|
|
44
|
+
getAgent(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
45
|
+
private __getAgent;
|
|
46
|
+
/**
|
|
47
|
+
* (DEPRECATED - use v2) Get the user id from the jwt: This is in the description
|
|
48
|
+
*
|
|
49
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.dev.getUserIdV1()
|
|
53
|
+
*/
|
|
54
|
+
getUserIdV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
55
|
+
private __getUserIdV1;
|
|
43
56
|
/**
|
|
44
57
|
* Returns the complete decoded JWT token information for development purposes.
|
|
45
58
|
*
|
|
@@ -60,6 +73,16 @@ export declare class Dev {
|
|
|
60
73
|
*/
|
|
61
74
|
getEmail(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
62
75
|
private __getEmail;
|
|
76
|
+
/**
|
|
77
|
+
* Experimental route for running durable execution
|
|
78
|
+
*
|
|
79
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.dev.getDurable()
|
|
83
|
+
*/
|
|
84
|
+
getDurable(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
|
|
85
|
+
private __getDurable;
|
|
63
86
|
/**
|
|
64
87
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
65
88
|
*
|
|
@@ -51,27 +51,83 @@ const core = __importStar(require("../../../../core/index.js"));
|
|
|
51
51
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
52
52
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
53
|
const Chrt = __importStar(require("../../../index.js"));
|
|
54
|
+
const Client_js_1 = require("../resources/getUserId/client/Client.js");
|
|
54
55
|
class Dev {
|
|
55
56
|
constructor(_options = {}) {
|
|
56
57
|
this._options = _options;
|
|
57
58
|
}
|
|
59
|
+
get getUserId() {
|
|
60
|
+
var _a;
|
|
61
|
+
return ((_a = this._getUserId) !== null && _a !== void 0 ? _a : (this._getUserId = new Client_js_1.GetUserId(this._options)));
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Experimental route for running AI agentic workflows
|
|
65
|
+
*
|
|
66
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* await client.dev.getAgent()
|
|
70
|
+
*/
|
|
71
|
+
getAgent(requestOptions) {
|
|
72
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgent(requestOptions));
|
|
73
|
+
}
|
|
74
|
+
__getAgent(requestOptions) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c, _d;
|
|
77
|
+
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);
|
|
78
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
79
|
+
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, "dev/agent"),
|
|
80
|
+
method: "GET",
|
|
81
|
+
headers: _headers,
|
|
82
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
83
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
84
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
85
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
86
|
+
});
|
|
87
|
+
if (_response.ok) {
|
|
88
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
89
|
+
}
|
|
90
|
+
if (_response.error.reason === "status-code") {
|
|
91
|
+
throw new errors.ChrtError({
|
|
92
|
+
statusCode: _response.error.statusCode,
|
|
93
|
+
body: _response.error.body,
|
|
94
|
+
rawResponse: _response.rawResponse,
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
switch (_response.error.reason) {
|
|
98
|
+
case "non-json":
|
|
99
|
+
throw new errors.ChrtError({
|
|
100
|
+
statusCode: _response.error.statusCode,
|
|
101
|
+
body: _response.error.rawBody,
|
|
102
|
+
rawResponse: _response.rawResponse,
|
|
103
|
+
});
|
|
104
|
+
case "timeout":
|
|
105
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/agent.");
|
|
106
|
+
case "unknown":
|
|
107
|
+
throw new errors.ChrtError({
|
|
108
|
+
message: _response.error.errorMessage,
|
|
109
|
+
rawResponse: _response.rawResponse,
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
58
114
|
/**
|
|
59
|
-
* Get the user id from the jwt: This is in the description
|
|
115
|
+
* (DEPRECATED - use v2) Get the user id from the jwt: This is in the description
|
|
60
116
|
*
|
|
61
117
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
118
|
*
|
|
63
119
|
* @example
|
|
64
|
-
* await client.dev.
|
|
120
|
+
* await client.dev.getUserIdV1()
|
|
65
121
|
*/
|
|
66
|
-
|
|
67
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
122
|
+
getUserIdV1(requestOptions) {
|
|
123
|
+
return core.HttpResponsePromise.fromPromise(this.__getUserIdV1(requestOptions));
|
|
68
124
|
}
|
|
69
|
-
|
|
125
|
+
__getUserIdV1(requestOptions) {
|
|
70
126
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
127
|
var _a, _b, _c, _d;
|
|
72
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);
|
|
73
129
|
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, "dev/user_id"),
|
|
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, "dev/user_id/v1"),
|
|
75
131
|
method: "GET",
|
|
76
132
|
headers: _headers,
|
|
77
133
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -97,7 +153,7 @@ class Dev {
|
|
|
97
153
|
rawResponse: _response.rawResponse,
|
|
98
154
|
});
|
|
99
155
|
case "timeout":
|
|
100
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id.");
|
|
156
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id/v1.");
|
|
101
157
|
case "unknown":
|
|
102
158
|
throw new errors.ChrtError({
|
|
103
159
|
message: _response.error.errorMessage,
|
|
@@ -208,6 +264,57 @@ class Dev {
|
|
|
208
264
|
}
|
|
209
265
|
});
|
|
210
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Experimental route for running durable execution
|
|
269
|
+
*
|
|
270
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
271
|
+
*
|
|
272
|
+
* @example
|
|
273
|
+
* await client.dev.getDurable()
|
|
274
|
+
*/
|
|
275
|
+
getDurable(requestOptions) {
|
|
276
|
+
return core.HttpResponsePromise.fromPromise(this.__getDurable(requestOptions));
|
|
277
|
+
}
|
|
278
|
+
__getDurable(requestOptions) {
|
|
279
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
280
|
+
var _a, _b, _c, _d;
|
|
281
|
+
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);
|
|
282
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
283
|
+
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, "dev/durable"),
|
|
284
|
+
method: "GET",
|
|
285
|
+
headers: _headers,
|
|
286
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
287
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
288
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
289
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
290
|
+
});
|
|
291
|
+
if (_response.ok) {
|
|
292
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
293
|
+
}
|
|
294
|
+
if (_response.error.reason === "status-code") {
|
|
295
|
+
throw new errors.ChrtError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.body,
|
|
298
|
+
rawResponse: _response.rawResponse,
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
switch (_response.error.reason) {
|
|
302
|
+
case "non-json":
|
|
303
|
+
throw new errors.ChrtError({
|
|
304
|
+
statusCode: _response.error.statusCode,
|
|
305
|
+
body: _response.error.rawBody,
|
|
306
|
+
rawResponse: _response.rawResponse,
|
|
307
|
+
});
|
|
308
|
+
case "timeout":
|
|
309
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/durable.");
|
|
310
|
+
case "unknown":
|
|
311
|
+
throw new errors.ChrtError({
|
|
312
|
+
message: _response.error.errorMessage,
|
|
313
|
+
rawResponse: _response.rawResponse,
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
});
|
|
317
|
+
}
|
|
211
318
|
/**
|
|
212
319
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
213
320
|
*
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
export declare namespace GetUserId {
|
|
7
|
+
interface Options {
|
|
8
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
9
|
+
/** Specify a custom URL to connect the client to. */
|
|
10
|
+
baseUrl?: core.Supplier<string>;
|
|
11
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
12
|
+
/** Additional headers to include in requests. */
|
|
13
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
14
|
+
fetcher?: core.FetchFunction;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class GetUserId {
|
|
30
|
+
protected readonly _options: GetUserId.Options;
|
|
31
|
+
constructor(_options?: GetUserId.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Get the user id from the jwt: This is in the description
|
|
34
|
+
*
|
|
35
|
+
* @param {GetUserId.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.dev.getUserId.v2()
|
|
39
|
+
*/
|
|
40
|
+
v2(requestOptions?: GetUserId.RequestOptions): core.HttpResponsePromise<string>;
|
|
41
|
+
private __v2;
|
|
42
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,118 @@
|
|
|
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.GetUserId = void 0;
|
|
49
|
+
const environments = __importStar(require("../../../../../../environments.js"));
|
|
50
|
+
const core = __importStar(require("../../../../../../core/index.js"));
|
|
51
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
52
|
+
const errors = __importStar(require("../../../../../../errors/index.js"));
|
|
53
|
+
class GetUserId {
|
|
54
|
+
constructor(_options = {}) {
|
|
55
|
+
this._options = _options;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the user id from the jwt: This is in the description
|
|
59
|
+
*
|
|
60
|
+
* @param {GetUserId.RequestOptions} requestOptions - Request-specific configuration.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.dev.getUserId.v2()
|
|
64
|
+
*/
|
|
65
|
+
v2(requestOptions) {
|
|
66
|
+
return core.HttpResponsePromise.fromPromise(this.__v2(requestOptions));
|
|
67
|
+
}
|
|
68
|
+
__v2(requestOptions) {
|
|
69
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
+
var _a, _b, _c, _d;
|
|
71
|
+
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);
|
|
72
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
73
|
+
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, "dev/user_id/v2"),
|
|
74
|
+
method: "GET",
|
|
75
|
+
headers: _headers,
|
|
76
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
77
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
78
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
79
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
80
|
+
});
|
|
81
|
+
if (_response.ok) {
|
|
82
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
83
|
+
}
|
|
84
|
+
if (_response.error.reason === "status-code") {
|
|
85
|
+
throw new errors.ChrtError({
|
|
86
|
+
statusCode: _response.error.statusCode,
|
|
87
|
+
body: _response.error.body,
|
|
88
|
+
rawResponse: _response.rawResponse,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
switch (_response.error.reason) {
|
|
92
|
+
case "non-json":
|
|
93
|
+
throw new errors.ChrtError({
|
|
94
|
+
statusCode: _response.error.statusCode,
|
|
95
|
+
body: _response.error.rawBody,
|
|
96
|
+
rawResponse: _response.rawResponse,
|
|
97
|
+
});
|
|
98
|
+
case "timeout":
|
|
99
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id/v2.");
|
|
100
|
+
case "unknown":
|
|
101
|
+
throw new errors.ChrtError({
|
|
102
|
+
message: _response.error.errorMessage,
|
|
103
|
+
rawResponse: _response.rawResponse,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
_getAuthorizationHeader() {
|
|
109
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
111
|
+
if (bearer != null) {
|
|
112
|
+
return `Bearer ${bearer}`;
|
|
113
|
+
}
|
|
114
|
+
return undefined;
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.GetUserId = GetUserId;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export * as getUserId from "./getUserId/index.js";
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.getUserId = void 0;
|
|
37
|
+
exports.getUserId = __importStar(require("./getUserId/index.js"));
|
|
@@ -15,4 +15,7 @@ export interface TaskGroupsExpandedReq {
|
|
|
15
15
|
expand_cargos?: boolean;
|
|
16
16
|
expand_milestones?: boolean;
|
|
17
17
|
expand_shipper_contact_info?: boolean;
|
|
18
|
+
expand_order_org_company_name?: boolean;
|
|
19
|
+
expand_order_org_handle?: boolean;
|
|
20
|
+
expand_task_group_mileage?: boolean;
|
|
18
21
|
}
|
|
@@ -8,4 +8,7 @@ import * as Chrt from "../index.js";
|
|
|
8
8
|
export interface TaskGroupExpanded {
|
|
9
9
|
task_group: Chrt.TaskGroup1;
|
|
10
10
|
tasks_expanded?: Chrt.TaskExpanded[] | null;
|
|
11
|
+
order_org_company_name?: string | null;
|
|
12
|
+
order_org_handle?: string | null;
|
|
13
|
+
task_group_mileage?: number | null;
|
|
11
14
|
}
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.280.0";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/Client.mjs
CHANGED
|
@@ -32,8 +32,8 @@ export class ChrtClient {
|
|
|
32
32
|
this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
|
|
33
33
|
"X-Fern-Language": "JavaScript",
|
|
34
34
|
"X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
|
|
35
|
-
"X-Fern-SDK-Version": "1.
|
|
36
|
-
"User-Agent": "@chrt-inc/typescript-sdk/1.
|
|
35
|
+
"X-Fern-SDK-Version": "1.280.0",
|
|
36
|
+
"User-Agent": "@chrt-inc/typescript-sdk/1.280.0",
|
|
37
37
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
38
38
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
39
39
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as environments from "../../../../environments.mjs";
|
|
5
5
|
import * as core from "../../../../core/index.mjs";
|
|
6
6
|
import * as Chrt from "../../../index.mjs";
|
|
7
|
+
import { GetUserId } from "../resources/getUserId/client/Client.mjs";
|
|
7
8
|
export declare namespace Dev {
|
|
8
9
|
interface Options {
|
|
9
10
|
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
@@ -29,17 +30,29 @@ export declare namespace Dev {
|
|
|
29
30
|
}
|
|
30
31
|
export declare class Dev {
|
|
31
32
|
protected readonly _options: Dev.Options;
|
|
33
|
+
protected _getUserId: GetUserId | undefined;
|
|
32
34
|
constructor(_options?: Dev.Options);
|
|
35
|
+
get getUserId(): GetUserId;
|
|
33
36
|
/**
|
|
34
|
-
*
|
|
37
|
+
* Experimental route for running AI agentic workflows
|
|
35
38
|
*
|
|
36
39
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
40
|
*
|
|
38
41
|
* @example
|
|
39
|
-
* await client.dev.
|
|
42
|
+
* await client.dev.getAgent()
|
|
40
43
|
*/
|
|
41
|
-
|
|
42
|
-
private
|
|
44
|
+
getAgent(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
45
|
+
private __getAgent;
|
|
46
|
+
/**
|
|
47
|
+
* (DEPRECATED - use v2) Get the user id from the jwt: This is in the description
|
|
48
|
+
*
|
|
49
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* await client.dev.getUserIdV1()
|
|
53
|
+
*/
|
|
54
|
+
getUserIdV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
55
|
+
private __getUserIdV1;
|
|
43
56
|
/**
|
|
44
57
|
* Returns the complete decoded JWT token information for development purposes.
|
|
45
58
|
*
|
|
@@ -60,6 +73,16 @@ export declare class Dev {
|
|
|
60
73
|
*/
|
|
61
74
|
getEmail(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
|
|
62
75
|
private __getEmail;
|
|
76
|
+
/**
|
|
77
|
+
* Experimental route for running durable execution
|
|
78
|
+
*
|
|
79
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* await client.dev.getDurable()
|
|
83
|
+
*/
|
|
84
|
+
getDurable(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
|
|
85
|
+
private __getDurable;
|
|
63
86
|
/**
|
|
64
87
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
65
88
|
*
|
|
@@ -15,27 +15,83 @@ import * as core from "../../../../core/index.mjs";
|
|
|
15
15
|
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
|
|
16
16
|
import * as errors from "../../../../errors/index.mjs";
|
|
17
17
|
import * as Chrt from "../../../index.mjs";
|
|
18
|
+
import { GetUserId } from "../resources/getUserId/client/Client.mjs";
|
|
18
19
|
export class Dev {
|
|
19
20
|
constructor(_options = {}) {
|
|
20
21
|
this._options = _options;
|
|
21
22
|
}
|
|
23
|
+
get getUserId() {
|
|
24
|
+
var _a;
|
|
25
|
+
return ((_a = this._getUserId) !== null && _a !== void 0 ? _a : (this._getUserId = new GetUserId(this._options)));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Experimental route for running AI agentic workflows
|
|
29
|
+
*
|
|
30
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* await client.dev.getAgent()
|
|
34
|
+
*/
|
|
35
|
+
getAgent(requestOptions) {
|
|
36
|
+
return core.HttpResponsePromise.fromPromise(this.__getAgent(requestOptions));
|
|
37
|
+
}
|
|
38
|
+
__getAgent(requestOptions) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
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);
|
|
42
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
43
|
+
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, "dev/agent"),
|
|
44
|
+
method: "GET",
|
|
45
|
+
headers: _headers,
|
|
46
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
47
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
48
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
49
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
50
|
+
});
|
|
51
|
+
if (_response.ok) {
|
|
52
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
53
|
+
}
|
|
54
|
+
if (_response.error.reason === "status-code") {
|
|
55
|
+
throw new errors.ChrtError({
|
|
56
|
+
statusCode: _response.error.statusCode,
|
|
57
|
+
body: _response.error.body,
|
|
58
|
+
rawResponse: _response.rawResponse,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
switch (_response.error.reason) {
|
|
62
|
+
case "non-json":
|
|
63
|
+
throw new errors.ChrtError({
|
|
64
|
+
statusCode: _response.error.statusCode,
|
|
65
|
+
body: _response.error.rawBody,
|
|
66
|
+
rawResponse: _response.rawResponse,
|
|
67
|
+
});
|
|
68
|
+
case "timeout":
|
|
69
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/agent.");
|
|
70
|
+
case "unknown":
|
|
71
|
+
throw new errors.ChrtError({
|
|
72
|
+
message: _response.error.errorMessage,
|
|
73
|
+
rawResponse: _response.rawResponse,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
22
78
|
/**
|
|
23
|
-
* Get the user id from the jwt: This is in the description
|
|
79
|
+
* (DEPRECATED - use v2) Get the user id from the jwt: This is in the description
|
|
24
80
|
*
|
|
25
81
|
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
26
82
|
*
|
|
27
83
|
* @example
|
|
28
|
-
* await client.dev.
|
|
84
|
+
* await client.dev.getUserIdV1()
|
|
29
85
|
*/
|
|
30
|
-
|
|
31
|
-
return core.HttpResponsePromise.fromPromise(this.
|
|
86
|
+
getUserIdV1(requestOptions) {
|
|
87
|
+
return core.HttpResponsePromise.fromPromise(this.__getUserIdV1(requestOptions));
|
|
32
88
|
}
|
|
33
|
-
|
|
89
|
+
__getUserIdV1(requestOptions) {
|
|
34
90
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
91
|
var _a, _b, _c, _d;
|
|
36
92
|
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);
|
|
37
93
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
38
|
-
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, "dev/user_id"),
|
|
94
|
+
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, "dev/user_id/v1"),
|
|
39
95
|
method: "GET",
|
|
40
96
|
headers: _headers,
|
|
41
97
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
@@ -61,7 +117,7 @@ export class Dev {
|
|
|
61
117
|
rawResponse: _response.rawResponse,
|
|
62
118
|
});
|
|
63
119
|
case "timeout":
|
|
64
|
-
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id.");
|
|
120
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id/v1.");
|
|
65
121
|
case "unknown":
|
|
66
122
|
throw new errors.ChrtError({
|
|
67
123
|
message: _response.error.errorMessage,
|
|
@@ -172,6 +228,57 @@ export class Dev {
|
|
|
172
228
|
}
|
|
173
229
|
});
|
|
174
230
|
}
|
|
231
|
+
/**
|
|
232
|
+
* Experimental route for running durable execution
|
|
233
|
+
*
|
|
234
|
+
* @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* await client.dev.getDurable()
|
|
238
|
+
*/
|
|
239
|
+
getDurable(requestOptions) {
|
|
240
|
+
return core.HttpResponsePromise.fromPromise(this.__getDurable(requestOptions));
|
|
241
|
+
}
|
|
242
|
+
__getDurable(requestOptions) {
|
|
243
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
var _a, _b, _c, _d;
|
|
245
|
+
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);
|
|
246
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
247
|
+
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, "dev/durable"),
|
|
248
|
+
method: "GET",
|
|
249
|
+
headers: _headers,
|
|
250
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
251
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
252
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
253
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
254
|
+
});
|
|
255
|
+
if (_response.ok) {
|
|
256
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
257
|
+
}
|
|
258
|
+
if (_response.error.reason === "status-code") {
|
|
259
|
+
throw new errors.ChrtError({
|
|
260
|
+
statusCode: _response.error.statusCode,
|
|
261
|
+
body: _response.error.body,
|
|
262
|
+
rawResponse: _response.rawResponse,
|
|
263
|
+
});
|
|
264
|
+
}
|
|
265
|
+
switch (_response.error.reason) {
|
|
266
|
+
case "non-json":
|
|
267
|
+
throw new errors.ChrtError({
|
|
268
|
+
statusCode: _response.error.statusCode,
|
|
269
|
+
body: _response.error.rawBody,
|
|
270
|
+
rawResponse: _response.rawResponse,
|
|
271
|
+
});
|
|
272
|
+
case "timeout":
|
|
273
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/durable.");
|
|
274
|
+
case "unknown":
|
|
275
|
+
throw new errors.ChrtError({
|
|
276
|
+
message: _response.error.errorMessage,
|
|
277
|
+
rawResponse: _response.rawResponse,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}
|
|
175
282
|
/**
|
|
176
283
|
* Development template endpoint that returns the authenticated user's ID for testing.
|
|
177
284
|
*
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
export declare namespace GetUserId {
|
|
7
|
+
interface Options {
|
|
8
|
+
environment?: core.Supplier<environments.ChrtEnvironment | string>;
|
|
9
|
+
/** Specify a custom URL to connect the client to. */
|
|
10
|
+
baseUrl?: core.Supplier<string>;
|
|
11
|
+
token?: core.Supplier<core.BearerToken | undefined>;
|
|
12
|
+
/** Additional headers to include in requests. */
|
|
13
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
14
|
+
fetcher?: core.FetchFunction;
|
|
15
|
+
}
|
|
16
|
+
interface RequestOptions {
|
|
17
|
+
/** The maximum time to wait for a response in seconds. */
|
|
18
|
+
timeoutInSeconds?: number;
|
|
19
|
+
/** The number of times to retry the request. Defaults to 2. */
|
|
20
|
+
maxRetries?: number;
|
|
21
|
+
/** A hook to abort the request. */
|
|
22
|
+
abortSignal?: AbortSignal;
|
|
23
|
+
/** Additional query string parameters to include in the request. */
|
|
24
|
+
queryParams?: Record<string, unknown>;
|
|
25
|
+
/** Additional headers to include in the request. */
|
|
26
|
+
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
export declare class GetUserId {
|
|
30
|
+
protected readonly _options: GetUserId.Options;
|
|
31
|
+
constructor(_options?: GetUserId.Options);
|
|
32
|
+
/**
|
|
33
|
+
* Get the user id from the jwt: This is in the description
|
|
34
|
+
*
|
|
35
|
+
* @param {GetUserId.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await client.dev.getUserId.v2()
|
|
39
|
+
*/
|
|
40
|
+
v2(requestOptions?: GetUserId.RequestOptions): core.HttpResponsePromise<string>;
|
|
41
|
+
private __v2;
|
|
42
|
+
protected _getAuthorizationHeader(): Promise<string | undefined>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
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 { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../../../core/headers.mjs";
|
|
16
|
+
import * as errors from "../../../../../../errors/index.mjs";
|
|
17
|
+
export class GetUserId {
|
|
18
|
+
constructor(_options = {}) {
|
|
19
|
+
this._options = _options;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the user id from the jwt: This is in the description
|
|
23
|
+
*
|
|
24
|
+
* @param {GetUserId.RequestOptions} requestOptions - Request-specific configuration.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.dev.getUserId.v2()
|
|
28
|
+
*/
|
|
29
|
+
v2(requestOptions) {
|
|
30
|
+
return core.HttpResponsePromise.fromPromise(this.__v2(requestOptions));
|
|
31
|
+
}
|
|
32
|
+
__v2(requestOptions) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
var _a, _b, _c, _d;
|
|
35
|
+
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);
|
|
36
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
37
|
+
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, "dev/user_id/v2"),
|
|
38
|
+
method: "GET",
|
|
39
|
+
headers: _headers,
|
|
40
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
41
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
42
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
43
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
44
|
+
});
|
|
45
|
+
if (_response.ok) {
|
|
46
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
47
|
+
}
|
|
48
|
+
if (_response.error.reason === "status-code") {
|
|
49
|
+
throw new errors.ChrtError({
|
|
50
|
+
statusCode: _response.error.statusCode,
|
|
51
|
+
body: _response.error.body,
|
|
52
|
+
rawResponse: _response.rawResponse,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
switch (_response.error.reason) {
|
|
56
|
+
case "non-json":
|
|
57
|
+
throw new errors.ChrtError({
|
|
58
|
+
statusCode: _response.error.statusCode,
|
|
59
|
+
body: _response.error.rawBody,
|
|
60
|
+
rawResponse: _response.rawResponse,
|
|
61
|
+
});
|
|
62
|
+
case "timeout":
|
|
63
|
+
throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/user_id/v2.");
|
|
64
|
+
case "unknown":
|
|
65
|
+
throw new errors.ChrtError({
|
|
66
|
+
message: _response.error.errorMessage,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
_getAuthorizationHeader() {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
74
|
+
const bearer = yield core.Supplier.get(this._options.token);
|
|
75
|
+
if (bearer != null) {
|
|
76
|
+
return `Bearer ${bearer}`;
|
|
77
|
+
}
|
|
78
|
+
return undefined;
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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 @@
|
|
|
1
|
+
export * as getUserId from "./getUserId/index.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as getUserId from "./getUserId/index.mjs";
|
|
@@ -15,4 +15,7 @@ export interface TaskGroupsExpandedReq {
|
|
|
15
15
|
expand_cargos?: boolean;
|
|
16
16
|
expand_milestones?: boolean;
|
|
17
17
|
expand_shipper_contact_info?: boolean;
|
|
18
|
+
expand_order_org_company_name?: boolean;
|
|
19
|
+
expand_order_org_handle?: boolean;
|
|
20
|
+
expand_task_group_mileage?: boolean;
|
|
18
21
|
}
|
|
@@ -8,4 +8,7 @@ import * as Chrt from "../index.mjs";
|
|
|
8
8
|
export interface TaskGroupExpanded {
|
|
9
9
|
task_group: Chrt.TaskGroup1;
|
|
10
10
|
tasks_expanded?: Chrt.TaskExpanded[] | null;
|
|
11
|
+
order_org_company_name?: string | null;
|
|
12
|
+
order_org_handle?: string | null;
|
|
13
|
+
task_group_mileage?: number | null;
|
|
11
14
|
}
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.280.0";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "1.
|
|
1
|
+
export const SDK_VERSION = "1.280.0";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Dev
|
|
4
4
|
|
|
5
|
-
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">
|
|
5
|
+
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getAgent</a>() -> string</code></summary>
|
|
6
6
|
<dl>
|
|
7
7
|
<dd>
|
|
8
8
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<dl>
|
|
15
15
|
<dd>
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Experimental route for running AI agentic workflows
|
|
18
18
|
|
|
19
19
|
</dd>
|
|
20
20
|
</dl>
|
|
@@ -30,7 +30,62 @@ Get the user id from the jwt: This is in the description
|
|
|
30
30
|
<dd>
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
|
-
await client.dev.
|
|
33
|
+
await client.dev.getAgent();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
</dd>
|
|
37
|
+
</dl>
|
|
38
|
+
</dd>
|
|
39
|
+
</dl>
|
|
40
|
+
|
|
41
|
+
#### ⚙️ Parameters
|
|
42
|
+
|
|
43
|
+
<dl>
|
|
44
|
+
<dd>
|
|
45
|
+
|
|
46
|
+
<dl>
|
|
47
|
+
<dd>
|
|
48
|
+
|
|
49
|
+
**requestOptions:** `Dev.RequestOptions`
|
|
50
|
+
|
|
51
|
+
</dd>
|
|
52
|
+
</dl>
|
|
53
|
+
</dd>
|
|
54
|
+
</dl>
|
|
55
|
+
|
|
56
|
+
</dd>
|
|
57
|
+
</dl>
|
|
58
|
+
</details>
|
|
59
|
+
|
|
60
|
+
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getUserIdV1</a>() -> string</code></summary>
|
|
61
|
+
<dl>
|
|
62
|
+
<dd>
|
|
63
|
+
|
|
64
|
+
#### 📝 Description
|
|
65
|
+
|
|
66
|
+
<dl>
|
|
67
|
+
<dd>
|
|
68
|
+
|
|
69
|
+
<dl>
|
|
70
|
+
<dd>
|
|
71
|
+
|
|
72
|
+
(DEPRECATED - use v2) Get the user id from the jwt: This is in the description
|
|
73
|
+
|
|
74
|
+
</dd>
|
|
75
|
+
</dl>
|
|
76
|
+
</dd>
|
|
77
|
+
</dl>
|
|
78
|
+
|
|
79
|
+
#### 🔌 Usage
|
|
80
|
+
|
|
81
|
+
<dl>
|
|
82
|
+
<dd>
|
|
83
|
+
|
|
84
|
+
<dl>
|
|
85
|
+
<dd>
|
|
86
|
+
|
|
87
|
+
```typescript
|
|
88
|
+
await client.dev.getUserIdV1();
|
|
34
89
|
```
|
|
35
90
|
|
|
36
91
|
</dd>
|
|
@@ -167,6 +222,61 @@ await client.dev.getEmail();
|
|
|
167
222
|
</dl>
|
|
168
223
|
</details>
|
|
169
224
|
|
|
225
|
+
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getDurable</a>() -> Record<string, unknown></code></summary>
|
|
226
|
+
<dl>
|
|
227
|
+
<dd>
|
|
228
|
+
|
|
229
|
+
#### 📝 Description
|
|
230
|
+
|
|
231
|
+
<dl>
|
|
232
|
+
<dd>
|
|
233
|
+
|
|
234
|
+
<dl>
|
|
235
|
+
<dd>
|
|
236
|
+
|
|
237
|
+
Experimental route for running durable execution
|
|
238
|
+
|
|
239
|
+
</dd>
|
|
240
|
+
</dl>
|
|
241
|
+
</dd>
|
|
242
|
+
</dl>
|
|
243
|
+
|
|
244
|
+
#### 🔌 Usage
|
|
245
|
+
|
|
246
|
+
<dl>
|
|
247
|
+
<dd>
|
|
248
|
+
|
|
249
|
+
<dl>
|
|
250
|
+
<dd>
|
|
251
|
+
|
|
252
|
+
```typescript
|
|
253
|
+
await client.dev.getDurable();
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
</dd>
|
|
257
|
+
</dl>
|
|
258
|
+
</dd>
|
|
259
|
+
</dl>
|
|
260
|
+
|
|
261
|
+
#### ⚙️ Parameters
|
|
262
|
+
|
|
263
|
+
<dl>
|
|
264
|
+
<dd>
|
|
265
|
+
|
|
266
|
+
<dl>
|
|
267
|
+
<dd>
|
|
268
|
+
|
|
269
|
+
**requestOptions:** `Dev.RequestOptions`
|
|
270
|
+
|
|
271
|
+
</dd>
|
|
272
|
+
</dl>
|
|
273
|
+
</dd>
|
|
274
|
+
</dl>
|
|
275
|
+
|
|
276
|
+
</dd>
|
|
277
|
+
</dl>
|
|
278
|
+
</details>
|
|
279
|
+
|
|
170
280
|
<details><summary><code>client.dev.<a href="/src/api/resources/dev/client/Client.ts">getTemplate</a>() -> string</code></summary>
|
|
171
281
|
<dl>
|
|
172
282
|
<dd>
|
|
@@ -6667,6 +6777,63 @@ await client.courierPayDriverLineItemGroups.removeLineItems.byId("id", {
|
|
|
6667
6777
|
</dl>
|
|
6668
6778
|
</details>
|
|
6669
6779
|
|
|
6780
|
+
## Dev GetUserId
|
|
6781
|
+
|
|
6782
|
+
<details><summary><code>client.dev.getUserId.<a href="/src/api/resources/dev/resources/getUserId/client/Client.ts">v2</a>() -> string</code></summary>
|
|
6783
|
+
<dl>
|
|
6784
|
+
<dd>
|
|
6785
|
+
|
|
6786
|
+
#### 📝 Description
|
|
6787
|
+
|
|
6788
|
+
<dl>
|
|
6789
|
+
<dd>
|
|
6790
|
+
|
|
6791
|
+
<dl>
|
|
6792
|
+
<dd>
|
|
6793
|
+
|
|
6794
|
+
Get the user id from the jwt: This is in the description
|
|
6795
|
+
|
|
6796
|
+
</dd>
|
|
6797
|
+
</dl>
|
|
6798
|
+
</dd>
|
|
6799
|
+
</dl>
|
|
6800
|
+
|
|
6801
|
+
#### 🔌 Usage
|
|
6802
|
+
|
|
6803
|
+
<dl>
|
|
6804
|
+
<dd>
|
|
6805
|
+
|
|
6806
|
+
<dl>
|
|
6807
|
+
<dd>
|
|
6808
|
+
|
|
6809
|
+
```typescript
|
|
6810
|
+
await client.dev.getUserId.v2();
|
|
6811
|
+
```
|
|
6812
|
+
|
|
6813
|
+
</dd>
|
|
6814
|
+
</dl>
|
|
6815
|
+
</dd>
|
|
6816
|
+
</dl>
|
|
6817
|
+
|
|
6818
|
+
#### ⚙️ Parameters
|
|
6819
|
+
|
|
6820
|
+
<dl>
|
|
6821
|
+
<dd>
|
|
6822
|
+
|
|
6823
|
+
<dl>
|
|
6824
|
+
<dd>
|
|
6825
|
+
|
|
6826
|
+
**requestOptions:** `GetUserId.RequestOptions`
|
|
6827
|
+
|
|
6828
|
+
</dd>
|
|
6829
|
+
</dl>
|
|
6830
|
+
</dd>
|
|
6831
|
+
</dl>
|
|
6832
|
+
|
|
6833
|
+
</dd>
|
|
6834
|
+
</dl>
|
|
6835
|
+
</details>
|
|
6836
|
+
|
|
6670
6837
|
## Milestones Images
|
|
6671
6838
|
|
|
6672
6839
|
<details><summary><code>client.milestones.images.<a href="/src/api/resources/milestones/resources/images/client/Client.ts">uploadByMilestoneId</a>(milestoneId, { ...params }) -> boolean</code></summary>
|