@chrt-inc/typescript-sdk 0.0.183-b → 0.0.184

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 (96) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/dev/client/Client.d.ts +10 -10
  3. package/dist/cjs/api/resources/dev/client/Client.js +47 -47
  4. package/dist/cjs/api/resources/drivers/client/requests/DriverLastSeenReq.d.ts +1 -1
  5. package/dist/cjs/api/resources/offChrtShipperOrgConnectionInfo/client/requests/OffChrtShipperOrgConnectionInfoClientCreate1.d.ts +1 -1
  6. package/dist/cjs/api/resources/offChrtShipperOrgConnectionInfo/client/requests/OffChrtShipperOrgConnectionInfoClientUpdate1.d.ts +1 -1
  7. package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/requests/CourierOrgConnectionInfoClientCreate1.d.ts +1 -1
  8. package/dist/cjs/api/resources/orgConnectionInfos/resources/courier/client/requests/CourierOrgConnectionInfoClientUpdate1.d.ts +1 -1
  9. package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/requests/ShipperOrgConnectionInfoClientCreate1.d.ts +1 -1
  10. package/dist/cjs/api/resources/orgConnectionInfos/resources/shipper/client/requests/ShipperOrgConnectionInfoClientUpdate1.d.ts +1 -1
  11. package/dist/cjs/api/resources/payments/client/Client.d.ts +41 -0
  12. package/dist/cjs/api/resources/payments/client/Client.js +174 -0
  13. package/dist/cjs/api/resources/payments/client/requests/CreateConnectAccountLinkReq.d.ts +12 -0
  14. package/dist/cjs/api/resources/payments/client/requests/CreateDirectChargeReq.d.ts +17 -0
  15. package/dist/cjs/api/resources/payments/client/requests/index.d.ts +2 -0
  16. package/dist/cjs/api/resources/shipperContactInfo/client/requests/ShipperContactInfoClientUpdate1.d.ts +1 -1
  17. package/dist/cjs/api/types/CourierOrgConnectionInfo1.d.ts +1 -1
  18. package/dist/cjs/api/types/{BaseModel.d.ts → CreateConnectAccountLinkRes.d.ts} +2 -1
  19. package/dist/cjs/api/types/CreateConnectAccountRes.d.ts +6 -0
  20. package/dist/cjs/api/types/CreateDirectChargeRes.d.ts +8 -0
  21. package/dist/cjs/api/types/CreateDirectChargeRes.js +5 -0
  22. package/dist/cjs/api/types/Driver1.d.ts +1 -1
  23. package/dist/cjs/api/types/LocationFeature.d.ts +17 -0
  24. package/dist/cjs/api/types/LocationFeature.js +5 -0
  25. package/dist/cjs/api/types/{FeatureInputGeometry.d.ts → LocationFeatureInputGeometry.d.ts} +2 -2
  26. package/dist/cjs/api/types/LocationFeatureInputGeometry.js +5 -0
  27. package/dist/cjs/api/types/{FeatureOutputGeometry.d.ts → LocationFeatureOutputGeometry.d.ts} +2 -2
  28. package/dist/cjs/api/types/LocationFeatureOutputGeometry.js +5 -0
  29. package/dist/cjs/api/types/LocationProperties.d.ts +11 -0
  30. package/dist/cjs/api/types/LocationProperties.js +5 -0
  31. package/dist/cjs/api/types/Milestone1.d.ts +1 -1
  32. package/dist/cjs/api/types/OffChrtShipperOrgConnectionInfo1.d.ts +1 -1
  33. package/dist/cjs/api/types/ShipperContactInfo1.d.ts +1 -1
  34. package/dist/cjs/api/types/ShipperContactInfoClientCreate1.d.ts +1 -1
  35. package/dist/cjs/api/types/ShipperOrgConnectionInfo1.d.ts +1 -1
  36. package/dist/cjs/api/types/Task1.d.ts +1 -1
  37. package/dist/cjs/api/types/TaskClientCreate1.d.ts +1 -1
  38. package/dist/cjs/api/types/UserPublicData6.d.ts +1 -0
  39. package/dist/cjs/api/types/index.d.ts +7 -4
  40. package/dist/cjs/api/types/index.js +7 -4
  41. package/dist/cjs/version.d.ts +1 -1
  42. package/dist/cjs/version.js +1 -1
  43. package/dist/esm/Client.mjs +2 -2
  44. package/dist/esm/api/resources/dev/client/Client.d.mts +10 -10
  45. package/dist/esm/api/resources/dev/client/Client.mjs +47 -47
  46. package/dist/esm/api/resources/drivers/client/requests/DriverLastSeenReq.d.mts +1 -1
  47. package/dist/esm/api/resources/offChrtShipperOrgConnectionInfo/client/requests/OffChrtShipperOrgConnectionInfoClientCreate1.d.mts +1 -1
  48. package/dist/esm/api/resources/offChrtShipperOrgConnectionInfo/client/requests/OffChrtShipperOrgConnectionInfoClientUpdate1.d.mts +1 -1
  49. package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/requests/CourierOrgConnectionInfoClientCreate1.d.mts +1 -1
  50. package/dist/esm/api/resources/orgConnectionInfos/resources/courier/client/requests/CourierOrgConnectionInfoClientUpdate1.d.mts +1 -1
  51. package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/requests/ShipperOrgConnectionInfoClientCreate1.d.mts +1 -1
  52. package/dist/esm/api/resources/orgConnectionInfos/resources/shipper/client/requests/ShipperOrgConnectionInfoClientUpdate1.d.mts +1 -1
  53. package/dist/esm/api/resources/payments/client/Client.d.mts +41 -0
  54. package/dist/esm/api/resources/payments/client/Client.mjs +174 -0
  55. package/dist/esm/api/resources/payments/client/requests/CreateConnectAccountLinkReq.d.mts +12 -0
  56. package/dist/esm/api/resources/payments/client/requests/CreateDirectChargeReq.d.mts +17 -0
  57. package/dist/esm/api/resources/payments/client/requests/index.d.mts +2 -0
  58. package/dist/esm/api/resources/shipperContactInfo/client/requests/ShipperContactInfoClientUpdate1.d.mts +1 -1
  59. package/dist/esm/api/types/CourierOrgConnectionInfo1.d.mts +1 -1
  60. package/dist/esm/api/types/{BaseModel.d.mts → CreateConnectAccountLinkRes.d.mts} +2 -1
  61. package/dist/esm/api/types/CreateConnectAccountRes.d.mts +6 -0
  62. package/dist/esm/api/types/CreateDirectChargeRes.d.mts +8 -0
  63. package/dist/esm/api/types/CreateDirectChargeRes.mjs +4 -0
  64. package/dist/esm/api/types/Driver1.d.mts +1 -1
  65. package/dist/esm/api/types/LocationFeature.d.mts +17 -0
  66. package/dist/esm/api/types/LocationFeature.mjs +4 -0
  67. package/dist/esm/api/types/{FeatureInputGeometry.d.mts → LocationFeatureInputGeometry.d.mts} +2 -2
  68. package/dist/esm/api/types/LocationFeatureInputGeometry.mjs +4 -0
  69. package/dist/esm/api/types/{FeatureOutputGeometry.d.mts → LocationFeatureOutputGeometry.d.mts} +2 -2
  70. package/dist/esm/api/types/LocationFeatureOutputGeometry.mjs +4 -0
  71. package/dist/esm/api/types/LocationProperties.d.mts +11 -0
  72. package/dist/esm/api/types/LocationProperties.mjs +4 -0
  73. package/dist/esm/api/types/Milestone1.d.mts +1 -1
  74. package/dist/esm/api/types/OffChrtShipperOrgConnectionInfo1.d.mts +1 -1
  75. package/dist/esm/api/types/ShipperContactInfo1.d.mts +1 -1
  76. package/dist/esm/api/types/ShipperContactInfoClientCreate1.d.mts +1 -1
  77. package/dist/esm/api/types/ShipperOrgConnectionInfo1.d.mts +1 -1
  78. package/dist/esm/api/types/Task1.d.mts +1 -1
  79. package/dist/esm/api/types/TaskClientCreate1.d.mts +1 -1
  80. package/dist/esm/api/types/UserPublicData6.d.mts +1 -0
  81. package/dist/esm/api/types/index.d.mts +7 -4
  82. package/dist/esm/api/types/index.mjs +7 -4
  83. package/dist/esm/version.d.mts +1 -1
  84. package/dist/esm/version.mjs +1 -1
  85. package/package.json +1 -1
  86. package/reference.md +207 -21
  87. package/dist/cjs/api/types/Feature.d.ts +0 -18
  88. package/dist/esm/api/types/Feature.d.mts +0 -18
  89. /package/dist/cjs/api/{types/BaseModel.js → resources/payments/client/requests/CreateConnectAccountLinkReq.js} +0 -0
  90. /package/dist/cjs/api/{types/Feature.js → resources/payments/client/requests/CreateDirectChargeReq.js} +0 -0
  91. /package/dist/cjs/api/types/{FeatureInputGeometry.js → CreateConnectAccountLinkRes.js} +0 -0
  92. /package/dist/cjs/api/types/{FeatureOutputGeometry.js → CreateConnectAccountRes.js} +0 -0
  93. /package/dist/esm/api/{types/BaseModel.mjs → resources/payments/client/requests/CreateConnectAccountLinkReq.mjs} +0 -0
  94. /package/dist/esm/api/{types/Feature.mjs → resources/payments/client/requests/CreateDirectChargeReq.mjs} +0 -0
  95. /package/dist/esm/api/types/{FeatureInputGeometry.mjs → CreateConnectAccountLinkRes.mjs} +0 -0
  96. /package/dist/esm/api/types/{FeatureOutputGeometry.mjs → CreateConnectAccountRes.mjs} +0 -0
@@ -63,8 +63,8 @@ class ChrtClient {
63
63
  this._options = Object.assign(Object.assign({}, _options), { headers: (0, headers_js_1.mergeHeaders)({
64
64
  "X-Fern-Language": "JavaScript",
65
65
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
66
- "X-Fern-SDK-Version": "0.0.183-b",
67
- "User-Agent": "@chrt-inc/typescript-sdk/0.0.183-b",
66
+ "X-Fern-SDK-Version": "0.0.184",
67
+ "User-Agent": "@chrt-inc/typescript-sdk/0.0.184",
68
68
  "X-Fern-Runtime": core.RUNTIME.type,
69
69
  "X-Fern-Runtime-Version": core.RUNTIME.version,
70
70
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -58,16 +58,6 @@ export declare class Dev {
58
58
  */
59
59
  getEmail(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
60
60
  private __getEmail;
61
- /**
62
- * Returns the current GitHub PR number and commit hash for the deployment.
63
- *
64
- * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
65
- *
66
- * @example
67
- * await client.dev.getGitInfo()
68
- */
69
- getGitInfo(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, string>>;
70
- private __getGitInfo;
71
61
  /**
72
62
  * Development template endpoint that returns the authenticated user's ID for testing.
73
63
  *
@@ -95,5 +85,15 @@ export declare class Dev {
95
85
  */
96
86
  createTemplate(request: Chrt.TemplateReq, requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Chrt.TemplateRes>;
97
87
  private __createTemplate;
88
+ /**
89
+ * Returns the current GitHub PR number and commit hash for the deployment.
90
+ *
91
+ * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
92
+ *
93
+ * @example
94
+ * await client.dev.getGitInfo()
95
+ */
96
+ getGitInfo(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, string>>;
97
+ private __getGitInfo;
98
98
  protected _getAuthorizationHeader(): Promise<string | undefined>;
99
99
  }
@@ -203,21 +203,21 @@ class Dev {
203
203
  });
204
204
  }
205
205
  /**
206
- * Returns the current GitHub PR number and commit hash for the deployment.
206
+ * Development template endpoint that returns the authenticated user's ID for testing.
207
207
  *
208
208
  * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
209
209
  *
210
210
  * @example
211
- * await client.dev.getGitInfo()
211
+ * await client.dev.getTemplate()
212
212
  */
213
- getGitInfo(requestOptions) {
214
- return core.HttpResponsePromise.fromPromise(this.__getGitInfo(requestOptions));
213
+ getTemplate(requestOptions) {
214
+ return core.HttpResponsePromise.fromPromise(this.__getTemplate(requestOptions));
215
215
  }
216
- __getGitInfo(requestOptions) {
216
+ __getTemplate(requestOptions) {
217
217
  return __awaiter(this, void 0, void 0, function* () {
218
218
  var _a, _b, _c, _d;
219
219
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
220
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/git_info"),
220
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/template"),
221
221
  method: "GET",
222
222
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
223
223
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -242,7 +242,7 @@ class Dev {
242
242
  rawResponse: _response.rawResponse,
243
243
  });
244
244
  case "timeout":
245
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/git_info.");
245
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/template.");
246
246
  case "unknown":
247
247
  throw new errors.ChrtError({
248
248
  message: _response.error.errorMessage,
@@ -252,23 +252,33 @@ class Dev {
252
252
  });
253
253
  }
254
254
  /**
255
- * Development template endpoint that returns the authenticated user's ID for testing.
255
+ * Development template endpoint that demonstrates transaction handling and request mirroring.
256
256
  *
257
+ * @param {Chrt.TemplateReq} request
257
258
  * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
258
259
  *
260
+ * @throws {@link Chrt.UnprocessableEntityError}
261
+ *
259
262
  * @example
260
- * await client.dev.getTemplate()
263
+ * await client.dev.createTemplate({
264
+ * message: "message",
265
+ * number: 1,
266
+ * timestamp: "2024-01-15T09:30:00Z"
267
+ * })
261
268
  */
262
- getTemplate(requestOptions) {
263
- return core.HttpResponsePromise.fromPromise(this.__getTemplate(requestOptions));
269
+ createTemplate(request, requestOptions) {
270
+ return core.HttpResponsePromise.fromPromise(this.__createTemplate(request, requestOptions));
264
271
  }
265
- __getTemplate(requestOptions) {
272
+ __createTemplate(request, requestOptions) {
266
273
  return __awaiter(this, void 0, void 0, function* () {
267
274
  var _a, _b, _c, _d;
268
275
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
269
276
  url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/template"),
270
- method: "GET",
277
+ method: "POST",
271
278
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
279
+ contentType: "application/json",
280
+ requestType: "json",
281
+ body: request,
272
282
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
273
283
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
274
284
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -277,11 +287,16 @@ class Dev {
277
287
  return { data: _response.body, rawResponse: _response.rawResponse };
278
288
  }
279
289
  if (_response.error.reason === "status-code") {
280
- throw new errors.ChrtError({
281
- statusCode: _response.error.statusCode,
282
- body: _response.error.body,
283
- rawResponse: _response.rawResponse,
284
- });
290
+ switch (_response.error.statusCode) {
291
+ case 422:
292
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
293
+ default:
294
+ throw new errors.ChrtError({
295
+ statusCode: _response.error.statusCode,
296
+ body: _response.error.body,
297
+ rawResponse: _response.rawResponse,
298
+ });
299
+ }
285
300
  }
286
301
  switch (_response.error.reason) {
287
302
  case "non-json":
@@ -291,7 +306,7 @@ class Dev {
291
306
  rawResponse: _response.rawResponse,
292
307
  });
293
308
  case "timeout":
294
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/template.");
309
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /dev/template.");
295
310
  case "unknown":
296
311
  throw new errors.ChrtError({
297
312
  message: _response.error.errorMessage,
@@ -301,33 +316,23 @@ class Dev {
301
316
  });
302
317
  }
303
318
  /**
304
- * Development template endpoint that demonstrates transaction handling and request mirroring.
319
+ * Returns the current GitHub PR number and commit hash for the deployment.
305
320
  *
306
- * @param {Chrt.TemplateReq} request
307
321
  * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
308
322
  *
309
- * @throws {@link Chrt.UnprocessableEntityError}
310
- *
311
323
  * @example
312
- * await client.dev.createTemplate({
313
- * message: "message",
314
- * number: 1,
315
- * timestamp: "2024-01-15T09:30:00Z"
316
- * })
324
+ * await client.dev.getGitInfo()
317
325
  */
318
- createTemplate(request, requestOptions) {
319
- return core.HttpResponsePromise.fromPromise(this.__createTemplate(request, requestOptions));
326
+ getGitInfo(requestOptions) {
327
+ return core.HttpResponsePromise.fromPromise(this.__getGitInfo(requestOptions));
320
328
  }
321
- __createTemplate(request, requestOptions) {
329
+ __getGitInfo(requestOptions) {
322
330
  return __awaiter(this, void 0, void 0, function* () {
323
331
  var _a, _b, _c, _d;
324
332
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
325
- url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/template"),
326
- method: "POST",
333
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "dev/git_info"),
334
+ method: "GET",
327
335
  headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
328
- contentType: "application/json",
329
- requestType: "json",
330
- body: request,
331
336
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
332
337
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
333
338
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -336,16 +341,11 @@ class Dev {
336
341
  return { data: _response.body, rawResponse: _response.rawResponse };
337
342
  }
338
343
  if (_response.error.reason === "status-code") {
339
- switch (_response.error.statusCode) {
340
- case 422:
341
- throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
342
- default:
343
- throw new errors.ChrtError({
344
- statusCode: _response.error.statusCode,
345
- body: _response.error.body,
346
- rawResponse: _response.rawResponse,
347
- });
348
- }
344
+ throw new errors.ChrtError({
345
+ statusCode: _response.error.statusCode,
346
+ body: _response.error.body,
347
+ rawResponse: _response.rawResponse,
348
+ });
349
349
  }
350
350
  switch (_response.error.reason) {
351
351
  case "non-json":
@@ -355,7 +355,7 @@ class Dev {
355
355
  rawResponse: _response.rawResponse,
356
356
  });
357
357
  case "timeout":
358
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /dev/template.");
358
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/git_info.");
359
359
  case "unknown":
360
360
  throw new errors.ChrtError({
361
361
  message: _response.error.errorMessage,
@@ -11,5 +11,5 @@ import * as Chrt from "../../../../index.js";
11
11
  * }
12
12
  */
13
13
  export interface DriverLastSeenReq {
14
- location: Chrt.Feature;
14
+ location: Chrt.LocationFeature;
15
15
  }
@@ -12,7 +12,7 @@ import * as Chrt from "../../../../index.js";
12
12
  export interface OffChrtShipperOrgConnectionInfoClientCreate1 {
13
13
  schema_version: number;
14
14
  industry?: string | null;
15
- street_address?: Chrt.Feature | null;
15
+ street_address?: Chrt.LocationFeature | null;
16
16
  contact_first_name?: string | null;
17
17
  contact_last_name?: string | null;
18
18
  phone_number_primary?: string | null;
@@ -8,7 +8,7 @@ import * as Chrt from "../../../../index.js";
8
8
  */
9
9
  export interface OffChrtShipperOrgConnectionInfoClientUpdate1 {
10
10
  industry?: string | null;
11
- street_address?: Chrt.Feature | null;
11
+ street_address?: Chrt.LocationFeature | null;
12
12
  contact_first_name?: string | null;
13
13
  contact_last_name?: string | null;
14
14
  phone_number_primary?: string | null;
@@ -12,7 +12,7 @@ import * as Chrt from "../../../../../../index.js";
12
12
  export interface CourierOrgConnectionInfoClientCreate1 {
13
13
  schema_version: number;
14
14
  industry?: string | null;
15
- street_address?: Chrt.Feature | null;
15
+ street_address?: Chrt.LocationFeature | null;
16
16
  contact_first_name?: string | null;
17
17
  contact_last_name?: string | null;
18
18
  phone_number_primary?: string | null;
@@ -8,7 +8,7 @@ import * as Chrt from "../../../../../../index.js";
8
8
  */
9
9
  export interface CourierOrgConnectionInfoClientUpdate1 {
10
10
  industry?: string | null;
11
- street_address?: Chrt.Feature | null;
11
+ street_address?: Chrt.LocationFeature | null;
12
12
  contact_first_name?: string | null;
13
13
  contact_last_name?: string | null;
14
14
  phone_number_primary?: string | null;
@@ -12,7 +12,7 @@ import * as Chrt from "../../../../../../index.js";
12
12
  export interface ShipperOrgConnectionInfoClientCreate1 {
13
13
  schema_version: number;
14
14
  industry?: string | null;
15
- street_address?: Chrt.Feature | null;
15
+ street_address?: Chrt.LocationFeature | null;
16
16
  contact_first_name?: string | null;
17
17
  contact_last_name?: string | null;
18
18
  phone_number_primary?: string | null;
@@ -8,7 +8,7 @@ import * as Chrt from "../../../../../../index.js";
8
8
  */
9
9
  export interface ShipperOrgConnectionInfoClientUpdate1 {
10
10
  industry?: string | null;
11
- street_address?: Chrt.Feature | null;
11
+ street_address?: Chrt.LocationFeature | null;
12
12
  contact_first_name?: string | null;
13
13
  contact_last_name?: string | null;
14
14
  phone_number_primary?: string | null;
@@ -43,6 +43,47 @@ export declare class Payments {
43
43
  */
44
44
  createCheckoutSession(request: Chrt.CreateCheckoutSessionReq2, requestOptions?: Payments.RequestOptions): core.HttpResponsePromise<Chrt.CreateCheckoutSessionRes2>;
45
45
  private __createCheckoutSession;
46
+ /**
47
+ * Create a Stripe Connect account for receiving payments
48
+ *
49
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
50
+ *
51
+ * @example
52
+ * await client.payments.createConnectAccount()
53
+ */
54
+ createConnectAccount(requestOptions?: Payments.RequestOptions): core.HttpResponsePromise<Chrt.CreateConnectAccountRes>;
55
+ private __createConnectAccount;
56
+ /**
57
+ * Create an onboarding link for a Stripe Connect account
58
+ *
59
+ * @param {Chrt.CreateConnectAccountLinkReq} request
60
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
61
+ *
62
+ * @throws {@link Chrt.UnprocessableEntityError}
63
+ *
64
+ * @example
65
+ * await client.payments.createConnectAccountLink({
66
+ * account_id: "account_id"
67
+ * })
68
+ */
69
+ createConnectAccountLink(request: Chrt.CreateConnectAccountLinkReq, requestOptions?: Payments.RequestOptions): core.HttpResponsePromise<Chrt.CreateConnectAccountLinkRes>;
70
+ private __createConnectAccountLink;
71
+ /**
72
+ * Create a direct charge checkout session to a Connect account
73
+ *
74
+ * @param {Chrt.CreateDirectChargeReq} request
75
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
76
+ *
77
+ * @throws {@link Chrt.UnprocessableEntityError}
78
+ *
79
+ * @example
80
+ * await client.payments.createDirectCharge({
81
+ * amount: 1,
82
+ * connect_account_id: "connect_account_id"
83
+ * })
84
+ */
85
+ createDirectCharge(request: Chrt.CreateDirectChargeReq, requestOptions?: Payments.RequestOptions): core.HttpResponsePromise<Chrt.CreateDirectChargeRes>;
86
+ private __createDirectCharge;
46
87
  /**
47
88
  * Synchronizes subscription data from Stripe to the authentication service for the current user.
48
89
  *
@@ -117,6 +117,180 @@ class Payments {
117
117
  }
118
118
  });
119
119
  }
120
+ /**
121
+ * Create a Stripe Connect account for receiving payments
122
+ *
123
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
124
+ *
125
+ * @example
126
+ * await client.payments.createConnectAccount()
127
+ */
128
+ createConnectAccount(requestOptions) {
129
+ return core.HttpResponsePromise.fromPromise(this.__createConnectAccount(requestOptions));
130
+ }
131
+ __createConnectAccount(requestOptions) {
132
+ return __awaiter(this, void 0, void 0, function* () {
133
+ var _a, _b, _c, _d;
134
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
135
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "payments/create-connect-account"),
136
+ method: "POST",
137
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
139
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
140
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
141
+ });
142
+ if (_response.ok) {
143
+ return { data: _response.body, rawResponse: _response.rawResponse };
144
+ }
145
+ if (_response.error.reason === "status-code") {
146
+ throw new errors.ChrtError({
147
+ statusCode: _response.error.statusCode,
148
+ body: _response.error.body,
149
+ rawResponse: _response.rawResponse,
150
+ });
151
+ }
152
+ switch (_response.error.reason) {
153
+ case "non-json":
154
+ throw new errors.ChrtError({
155
+ statusCode: _response.error.statusCode,
156
+ body: _response.error.rawBody,
157
+ rawResponse: _response.rawResponse,
158
+ });
159
+ case "timeout":
160
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /payments/create-connect-account.");
161
+ case "unknown":
162
+ throw new errors.ChrtError({
163
+ message: _response.error.errorMessage,
164
+ rawResponse: _response.rawResponse,
165
+ });
166
+ }
167
+ });
168
+ }
169
+ /**
170
+ * Create an onboarding link for a Stripe Connect account
171
+ *
172
+ * @param {Chrt.CreateConnectAccountLinkReq} request
173
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
174
+ *
175
+ * @throws {@link Chrt.UnprocessableEntityError}
176
+ *
177
+ * @example
178
+ * await client.payments.createConnectAccountLink({
179
+ * account_id: "account_id"
180
+ * })
181
+ */
182
+ createConnectAccountLink(request, requestOptions) {
183
+ return core.HttpResponsePromise.fromPromise(this.__createConnectAccountLink(request, requestOptions));
184
+ }
185
+ __createConnectAccountLink(request, requestOptions) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ var _a, _b, _c, _d;
188
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
189
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "payments/create-connect-account-link"),
190
+ method: "POST",
191
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
192
+ contentType: "application/json",
193
+ requestType: "json",
194
+ body: request,
195
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
196
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
197
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
198
+ });
199
+ if (_response.ok) {
200
+ return { data: _response.body, rawResponse: _response.rawResponse };
201
+ }
202
+ if (_response.error.reason === "status-code") {
203
+ switch (_response.error.statusCode) {
204
+ case 422:
205
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
206
+ default:
207
+ throw new errors.ChrtError({
208
+ statusCode: _response.error.statusCode,
209
+ body: _response.error.body,
210
+ rawResponse: _response.rawResponse,
211
+ });
212
+ }
213
+ }
214
+ switch (_response.error.reason) {
215
+ case "non-json":
216
+ throw new errors.ChrtError({
217
+ statusCode: _response.error.statusCode,
218
+ body: _response.error.rawBody,
219
+ rawResponse: _response.rawResponse,
220
+ });
221
+ case "timeout":
222
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /payments/create-connect-account-link.");
223
+ case "unknown":
224
+ throw new errors.ChrtError({
225
+ message: _response.error.errorMessage,
226
+ rawResponse: _response.rawResponse,
227
+ });
228
+ }
229
+ });
230
+ }
231
+ /**
232
+ * Create a direct charge checkout session to a Connect account
233
+ *
234
+ * @param {Chrt.CreateDirectChargeReq} request
235
+ * @param {Payments.RequestOptions} requestOptions - Request-specific configuration.
236
+ *
237
+ * @throws {@link Chrt.UnprocessableEntityError}
238
+ *
239
+ * @example
240
+ * await client.payments.createDirectCharge({
241
+ * amount: 1,
242
+ * connect_account_id: "connect_account_id"
243
+ * })
244
+ */
245
+ createDirectCharge(request, requestOptions) {
246
+ return core.HttpResponsePromise.fromPromise(this.__createDirectCharge(request, requestOptions));
247
+ }
248
+ __createDirectCharge(request, requestOptions) {
249
+ return __awaiter(this, void 0, void 0, function* () {
250
+ var _a, _b, _c, _d;
251
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
252
+ url: core.url.join((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.ChrtEnvironment.Local, "payments/create-direct-charge"),
253
+ method: "POST",
254
+ headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
255
+ contentType: "application/json",
256
+ requestType: "json",
257
+ body: request,
258
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
259
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
260
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
261
+ });
262
+ if (_response.ok) {
263
+ return { data: _response.body, rawResponse: _response.rawResponse };
264
+ }
265
+ if (_response.error.reason === "status-code") {
266
+ switch (_response.error.statusCode) {
267
+ case 422:
268
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
269
+ default:
270
+ throw new errors.ChrtError({
271
+ statusCode: _response.error.statusCode,
272
+ body: _response.error.body,
273
+ rawResponse: _response.rawResponse,
274
+ });
275
+ }
276
+ }
277
+ switch (_response.error.reason) {
278
+ case "non-json":
279
+ throw new errors.ChrtError({
280
+ statusCode: _response.error.statusCode,
281
+ body: _response.error.rawBody,
282
+ rawResponse: _response.rawResponse,
283
+ });
284
+ case "timeout":
285
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /payments/create-direct-charge.");
286
+ case "unknown":
287
+ throw new errors.ChrtError({
288
+ message: _response.error.errorMessage,
289
+ rawResponse: _response.rawResponse,
290
+ });
291
+ }
292
+ });
293
+ }
120
294
  /**
121
295
  * Synchronizes subscription data from Stripe to the authentication service for the current user.
122
296
  *
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * account_id: "account_id"
8
+ * }
9
+ */
10
+ export interface CreateConnectAccountLinkReq {
11
+ account_id: string;
12
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * amount: 1,
8
+ * connect_account_id: "connect_account_id"
9
+ * }
10
+ */
11
+ export interface CreateDirectChargeReq {
12
+ amount: number;
13
+ connect_account_id: string;
14
+ description?: string;
15
+ success_url?: string;
16
+ cancel_url?: string;
17
+ }
@@ -1 +1,3 @@
1
1
  export { type CreateCheckoutSessionReq2 } from "./CreateCheckoutSessionReq2.js";
2
+ export { type CreateConnectAccountLinkReq } from "./CreateConnectAccountLinkReq.js";
3
+ export { type CreateDirectChargeReq } from "./CreateDirectChargeReq.js";
@@ -9,7 +9,7 @@ import * as Chrt from "../../../../index.js";
9
9
  export interface ShipperContactInfoClientUpdate1 {
10
10
  company_name?: string | null;
11
11
  industry?: string | null;
12
- street_address?: Chrt.Feature | null;
12
+ street_address?: Chrt.LocationFeature | null;
13
13
  contact_first_name?: string | null;
14
14
  contact_last_name?: string | null;
15
15
  phone_number_primary?: string | null;
@@ -5,7 +5,7 @@ import * as Chrt from "../index.js";
5
5
  export interface CourierOrgConnectionInfo1 {
6
6
  schema_version: number;
7
7
  industry?: string | null;
8
- street_address?: Chrt.Feature | null;
8
+ street_address?: Chrt.LocationFeature | null;
9
9
  contact_first_name?: string | null;
10
10
  contact_last_name?: string | null;
11
11
  phone_number_primary?: string | null;
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export interface BaseModel {
4
+ export interface CreateConnectAccountLinkRes {
5
+ url: string;
5
6
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CreateConnectAccountRes {
5
+ account_id: string;
6
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface CreateDirectChargeRes {
5
+ checkout_session_id: string;
6
+ checkout_url: string;
7
+ status: string;
8
+ }
@@ -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 });
@@ -13,7 +13,7 @@ export interface Driver1 {
13
13
  last_name?: string | null;
14
14
  vehicle_types?: Chrt.VehicleTypeEnum[];
15
15
  status?: Chrt.DriverStatusEnum;
16
- last_seen_at_location?: Chrt.Feature | null;
16
+ last_seen_at_location?: Chrt.LocationFeature | null;
17
17
  last_seen_at_timestamp?: string | null;
18
18
  _id: string;
19
19
  /** Must be a string starting with `org_` */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../index.js";
5
+ /**
6
+ * GeoJSON Feature with typed properties for locations
7
+ */
8
+ export interface LocationFeature {
9
+ bbox?: unknown[];
10
+ type: "Feature";
11
+ geometry?: Chrt.LocationFeatureOutputGeometry | null;
12
+ properties?: Chrt.LocationProperties | null;
13
+ id?: LocationFeature.Id | null;
14
+ }
15
+ export declare namespace LocationFeature {
16
+ type Id = number | string;
17
+ }