@chrt-inc/typescript-sdk 1.390.0 → 1.395.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. package/dist/cjs/Client.d.ts +3 -0
  2. package/dist/cjs/Client.js +15 -10
  3. package/dist/cjs/api/resources/analytics/client/Client.d.ts +23 -0
  4. package/dist/cjs/api/resources/analytics/client/Client.js +17 -0
  5. package/dist/cjs/api/resources/analytics/client/index.d.ts +1 -0
  6. package/dist/cjs/api/resources/analytics/client/index.js +2 -0
  7. package/dist/cjs/api/resources/analytics/index.d.ts +2 -0
  8. package/dist/cjs/api/resources/analytics/index.js +18 -0
  9. package/dist/cjs/api/resources/analytics/resources/index.d.ts +2 -0
  10. package/dist/cjs/api/resources/analytics/resources/index.js +41 -0
  11. package/dist/cjs/api/resources/analytics/resources/shipping/client/Client.d.ts +50 -0
  12. package/dist/cjs/api/resources/analytics/resources/shipping/client/Client.js +133 -0
  13. package/dist/cjs/api/resources/analytics/resources/shipping/client/index.d.ts +2 -0
  14. package/dist/cjs/api/resources/analytics/resources/shipping/client/index.js +17 -0
  15. package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.d.ts +18 -0
  16. package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.js +5 -0
  17. package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/index.d.ts +1 -0
  18. package/dist/cjs/api/resources/analytics/resources/shipping/client/requests/index.js +2 -0
  19. package/dist/cjs/api/resources/analytics/resources/shipping/index.d.ts +1 -0
  20. package/dist/cjs/api/resources/analytics/resources/shipping/index.js +17 -0
  21. package/dist/cjs/api/resources/dev/client/Client.d.ts +7 -14
  22. package/dist/cjs/api/resources/dev/client/Client.js +25 -65
  23. package/dist/cjs/api/resources/dev/client/requests/AgentReq.d.ts +10 -0
  24. package/dist/cjs/api/resources/dev/client/requests/AgentReq.js +5 -0
  25. package/dist/cjs/api/resources/dev/client/requests/index.d.ts +1 -0
  26. package/dist/cjs/api/resources/index.d.ts +2 -0
  27. package/dist/cjs/api/resources/index.js +3 -1
  28. package/dist/cjs/api/resources/users/client/Client.d.ts +38 -0
  29. package/dist/cjs/api/resources/users/client/Client.js +178 -0
  30. package/dist/cjs/api/resources/users/client/index.d.ts +1 -0
  31. package/dist/cjs/api/resources/users/client/index.js +15 -0
  32. package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientCreate1.d.ts +14 -0
  33. package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientCreate1.js +5 -0
  34. package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientUpdate1.d.ts +11 -0
  35. package/dist/cjs/api/resources/users/client/requests/UserPrivateDataClientUpdate1.js +5 -0
  36. package/dist/cjs/api/resources/users/client/requests/index.d.ts +2 -0
  37. package/dist/cjs/api/resources/users/client/requests/index.js +2 -0
  38. package/dist/cjs/api/types/AgentRes.d.ts +8 -0
  39. package/dist/cjs/api/types/AgentRes.js +5 -0
  40. package/dist/cjs/api/types/AnalyticsTimeBucketResponse.d.ts +8 -0
  41. package/dist/cjs/api/types/AnalyticsTimeBucketResponse.js +5 -0
  42. package/dist/cjs/api/types/OrderAndTaskGroupExpandedReq.d.ts +1 -0
  43. package/dist/cjs/api/types/OrderDraftExpanded.d.ts +1 -0
  44. package/dist/cjs/api/types/OrderExpanded.d.ts +1 -0
  45. package/dist/cjs/api/types/StartOfWeek.d.ts +13 -0
  46. package/dist/cjs/api/types/StartOfWeek.js +15 -0
  47. package/dist/cjs/api/types/TimeBucket.d.ts +7 -0
  48. package/dist/cjs/api/types/TimeBucket.js +5 -0
  49. package/dist/cjs/api/types/TimeGranularity.d.ts +11 -0
  50. package/dist/cjs/api/types/TimeGranularity.js +13 -0
  51. package/dist/cjs/api/types/TimezoneEnum.d.ts +23 -0
  52. package/dist/cjs/api/types/TimezoneEnum.js +25 -0
  53. package/dist/cjs/api/types/UserPrivateData1.d.ts +12 -0
  54. package/dist/cjs/api/types/UserPrivateData1.js +5 -0
  55. package/dist/cjs/api/types/index.d.ts +7 -0
  56. package/dist/cjs/api/types/index.js +7 -0
  57. package/dist/cjs/version.d.ts +1 -1
  58. package/dist/cjs/version.js +1 -1
  59. package/dist/esm/Client.d.mts +3 -0
  60. package/dist/esm/Client.mjs +7 -2
  61. package/dist/esm/api/resources/analytics/client/Client.d.mts +23 -0
  62. package/dist/esm/api/resources/analytics/client/Client.mjs +13 -0
  63. package/dist/esm/api/resources/analytics/client/index.d.mts +1 -0
  64. package/dist/esm/api/resources/analytics/client/index.mjs +1 -0
  65. package/dist/esm/api/resources/analytics/index.d.mts +2 -0
  66. package/dist/esm/api/resources/analytics/index.mjs +2 -0
  67. package/dist/esm/api/resources/analytics/resources/index.d.mts +2 -0
  68. package/dist/esm/api/resources/analytics/resources/index.mjs +2 -0
  69. package/dist/esm/api/resources/analytics/resources/shipping/client/Client.d.mts +50 -0
  70. package/dist/esm/api/resources/analytics/resources/shipping/client/Client.mjs +96 -0
  71. package/dist/esm/api/resources/analytics/resources/shipping/client/index.d.mts +2 -0
  72. package/dist/esm/api/resources/analytics/resources/shipping/client/index.mjs +1 -0
  73. package/dist/esm/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.d.mts +18 -0
  74. package/dist/esm/api/resources/analytics/resources/shipping/client/requests/AnalyticsTimePeriodRequest.mjs +4 -0
  75. package/dist/esm/api/resources/analytics/resources/shipping/client/requests/index.d.mts +1 -0
  76. package/dist/esm/api/resources/analytics/resources/shipping/client/requests/index.mjs +1 -0
  77. package/dist/esm/api/resources/analytics/resources/shipping/index.d.mts +1 -0
  78. package/dist/esm/api/resources/analytics/resources/shipping/index.mjs +1 -0
  79. package/dist/esm/api/resources/dev/client/Client.d.mts +7 -14
  80. package/dist/esm/api/resources/dev/client/Client.mjs +25 -65
  81. package/dist/esm/api/resources/dev/client/requests/AgentReq.d.mts +10 -0
  82. package/dist/esm/api/resources/dev/client/requests/AgentReq.mjs +4 -0
  83. package/dist/esm/api/resources/dev/client/requests/index.d.mts +1 -0
  84. package/dist/esm/api/resources/index.d.mts +2 -0
  85. package/dist/esm/api/resources/index.mjs +2 -0
  86. package/dist/esm/api/resources/users/client/Client.d.mts +38 -0
  87. package/dist/esm/api/resources/users/client/Client.mjs +178 -0
  88. package/dist/esm/api/resources/users/client/index.d.mts +1 -0
  89. package/dist/esm/api/resources/users/client/index.mjs +1 -1
  90. package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientCreate1.d.mts +14 -0
  91. package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientCreate1.mjs +4 -0
  92. package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientUpdate1.d.mts +11 -0
  93. package/dist/esm/api/resources/users/client/requests/UserPrivateDataClientUpdate1.mjs +4 -0
  94. package/dist/esm/api/resources/users/client/requests/index.d.mts +2 -0
  95. package/dist/esm/api/resources/users/client/requests/index.mjs +1 -0
  96. package/dist/esm/api/types/AgentRes.d.mts +8 -0
  97. package/dist/esm/api/types/AgentRes.mjs +4 -0
  98. package/dist/esm/api/types/AnalyticsTimeBucketResponse.d.mts +8 -0
  99. package/dist/esm/api/types/AnalyticsTimeBucketResponse.mjs +4 -0
  100. package/dist/esm/api/types/OrderAndTaskGroupExpandedReq.d.mts +1 -0
  101. package/dist/esm/api/types/OrderDraftExpanded.d.mts +1 -0
  102. package/dist/esm/api/types/OrderExpanded.d.mts +1 -0
  103. package/dist/esm/api/types/StartOfWeek.d.mts +13 -0
  104. package/dist/esm/api/types/StartOfWeek.mjs +12 -0
  105. package/dist/esm/api/types/TimeBucket.d.mts +7 -0
  106. package/dist/esm/api/types/TimeBucket.mjs +4 -0
  107. package/dist/esm/api/types/TimeGranularity.d.mts +11 -0
  108. package/dist/esm/api/types/TimeGranularity.mjs +10 -0
  109. package/dist/esm/api/types/TimezoneEnum.d.mts +23 -0
  110. package/dist/esm/api/types/TimezoneEnum.mjs +22 -0
  111. package/dist/esm/api/types/UserPrivateData1.d.mts +12 -0
  112. package/dist/esm/api/types/UserPrivateData1.mjs +4 -0
  113. package/dist/esm/api/types/index.d.mts +7 -0
  114. package/dist/esm/api/types/index.mjs +7 -0
  115. package/dist/esm/version.d.mts +1 -1
  116. package/dist/esm/version.mjs +1 -1
  117. package/package.json +1 -1
  118. package/reference.md +262 -58
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.390.0";
1
+ export declare const SDK_VERSION = "1.395.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.390.0";
4
+ exports.SDK_VERSION = "1.395.0";
@@ -21,6 +21,7 @@ import { Orgs } from "./api/resources/orgs/client/Client.mjs";
21
21
  import { Root } from "./api/resources/root/client/Client.mjs";
22
22
  import { Users } from "./api/resources/users/client/Client.mjs";
23
23
  import { Utils } from "./api/resources/utils/client/Client.mjs";
24
+ import { Analytics } from "./api/resources/analytics/client/Client.mjs";
24
25
  import { Billing } from "./api/resources/billing/client/Client.mjs";
25
26
  import { Notifications } from "./api/resources/notifications/client/Client.mjs";
26
27
  import { OrgInfoForConnections } from "./api/resources/orgInfoForConnections/client/Client.mjs";
@@ -68,6 +69,7 @@ export declare class ChrtClient {
68
69
  protected _root: Root | undefined;
69
70
  protected _users: Users | undefined;
70
71
  protected _utils: Utils | undefined;
72
+ protected _analytics: Analytics | undefined;
71
73
  protected _billing: Billing | undefined;
72
74
  protected _notifications: Notifications | undefined;
73
75
  protected _orgInfoForConnections: OrgInfoForConnections | undefined;
@@ -91,6 +93,7 @@ export declare class ChrtClient {
91
93
  get root(): Root;
92
94
  get users(): Users;
93
95
  get utils(): Utils;
96
+ get analytics(): Analytics;
94
97
  get billing(): Billing;
95
98
  get notifications(): Notifications;
96
99
  get orgInfoForConnections(): OrgInfoForConnections;
@@ -21,6 +21,7 @@ import { Orgs } from "./api/resources/orgs/client/Client.mjs";
21
21
  import { Root } from "./api/resources/root/client/Client.mjs";
22
22
  import { Users } from "./api/resources/users/client/Client.mjs";
23
23
  import { Utils } from "./api/resources/utils/client/Client.mjs";
24
+ import { Analytics } from "./api/resources/analytics/client/Client.mjs";
24
25
  import { Billing } from "./api/resources/billing/client/Client.mjs";
25
26
  import { Notifications } from "./api/resources/notifications/client/Client.mjs";
26
27
  import { OrgInfoForConnections } from "./api/resources/orgInfoForConnections/client/Client.mjs";
@@ -30,8 +31,8 @@ export class ChrtClient {
30
31
  this._options = Object.assign(Object.assign({}, _options), { headers: mergeHeaders({
31
32
  "X-Fern-Language": "JavaScript",
32
33
  "X-Fern-SDK-Name": "@chrt-inc/typescript-sdk",
33
- "X-Fern-SDK-Version": "1.390.0",
34
- "User-Agent": "@chrt-inc/typescript-sdk/1.390.0",
34
+ "X-Fern-SDK-Version": "1.395.0",
35
+ "User-Agent": "@chrt-inc/typescript-sdk/1.395.0",
35
36
  "X-Fern-Runtime": core.RUNTIME.type,
36
37
  "X-Fern-Runtime-Version": core.RUNTIME.version,
37
38
  }, _options === null || _options === void 0 ? void 0 : _options.headers) });
@@ -108,6 +109,10 @@ export class ChrtClient {
108
109
  var _a;
109
110
  return ((_a = this._utils) !== null && _a !== void 0 ? _a : (this._utils = new Utils(this._options)));
110
111
  }
112
+ get analytics() {
113
+ var _a;
114
+ return ((_a = this._analytics) !== null && _a !== void 0 ? _a : (this._analytics = new Analytics(this._options)));
115
+ }
111
116
  get billing() {
112
117
  var _a;
113
118
  return ((_a = this._billing) !== null && _a !== void 0 ? _a : (this._billing = new Billing(this._options)));
@@ -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 { Shipping } from "../resources/shipping/client/Client.mjs";
7
+ export declare namespace Analytics {
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 Analytics {
19
+ protected readonly _options: Analytics.Options;
20
+ protected _shipping: Shipping | undefined;
21
+ constructor(_options?: Analytics.Options);
22
+ get shipping(): Shipping;
23
+ }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import { Shipping } from "../resources/shipping/client/Client.mjs";
5
+ export class Analytics {
6
+ constructor(_options = {}) {
7
+ this._options = _options;
8
+ }
9
+ get shipping() {
10
+ var _a;
11
+ return ((_a = this._shipping) !== null && _a !== void 0 ? _a : (this._shipping = new Shipping(this._options)));
12
+ }
13
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * from "./client/index.mjs";
2
+ export * from "./resources/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * as shipping from "./shipping/index.mjs";
2
+ export * from "./shipping/client/requests/index.mjs";
@@ -0,0 +1,2 @@
1
+ export * as shipping from "./shipping/index.mjs";
2
+ export * from "./shipping/client/requests/index.mjs";
@@ -0,0 +1,50 @@
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 Shipping {
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 Shipping {
31
+ protected readonly _options: Shipping.Options;
32
+ constructor(_options?: Shipping.Options);
33
+ /**
34
+ * Retrieves order counts bucketed by time period. | (AnalyticsTimePeriodRequest) -> (AnalyticsTimeBucketResponse)
35
+ *
36
+ * @param {Chrt.analytics.AnalyticsTimePeriodRequest} request
37
+ * @param {Shipping.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.analytics.shipping.retrieveOrdersCountV1({
43
+ * start: "2024-01-15T09:30:00Z",
44
+ * end: "2024-01-15T09:30:00Z"
45
+ * })
46
+ */
47
+ retrieveOrdersCountV1(request: Chrt.analytics.AnalyticsTimePeriodRequest, requestOptions?: Shipping.RequestOptions): core.HttpResponsePromise<Chrt.AnalyticsTimeBucketResponse>;
48
+ private __retrieveOrdersCountV1;
49
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
50
+ }
@@ -0,0 +1,96 @@
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 Shipping {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Retrieves order counts bucketed by time period. | (AnalyticsTimePeriodRequest) -> (AnalyticsTimeBucketResponse)
24
+ *
25
+ * @param {Chrt.analytics.AnalyticsTimePeriodRequest} request
26
+ * @param {Shipping.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.analytics.shipping.retrieveOrdersCountV1({
32
+ * start: "2024-01-15T09:30:00Z",
33
+ * end: "2024-01-15T09:30:00Z"
34
+ * })
35
+ */
36
+ retrieveOrdersCountV1(request, requestOptions) {
37
+ return core.HttpResponsePromise.fromPromise(this.__retrieveOrdersCountV1(request, requestOptions));
38
+ }
39
+ __retrieveOrdersCountV1(request, requestOptions) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ var _a, _b, _c, _d;
42
+ 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);
43
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
44
+ 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, "analytics/shipping/orders/count/v1"),
45
+ method: "POST",
46
+ headers: _headers,
47
+ contentType: "application/json",
48
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
49
+ requestType: "json",
50
+ body: request,
51
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
52
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
53
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
54
+ });
55
+ if (_response.ok) {
56
+ return { data: _response.body, rawResponse: _response.rawResponse };
57
+ }
58
+ if (_response.error.reason === "status-code") {
59
+ switch (_response.error.statusCode) {
60
+ case 422:
61
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
62
+ default:
63
+ throw new errors.ChrtError({
64
+ statusCode: _response.error.statusCode,
65
+ body: _response.error.body,
66
+ rawResponse: _response.rawResponse,
67
+ });
68
+ }
69
+ }
70
+ switch (_response.error.reason) {
71
+ case "non-json":
72
+ throw new errors.ChrtError({
73
+ statusCode: _response.error.statusCode,
74
+ body: _response.error.rawBody,
75
+ rawResponse: _response.rawResponse,
76
+ });
77
+ case "timeout":
78
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /analytics/shipping/orders/count/v1.");
79
+ case "unknown":
80
+ throw new errors.ChrtError({
81
+ message: _response.error.errorMessage,
82
+ rawResponse: _response.rawResponse,
83
+ });
84
+ }
85
+ });
86
+ }
87
+ _getAuthorizationHeader() {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ const bearer = yield core.Supplier.get(this._options.token);
90
+ if (bearer != null) {
91
+ return `Bearer ${bearer}`;
92
+ }
93
+ return undefined;
94
+ });
95
+ }
96
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./requests/index.mjs";
@@ -0,0 +1,18 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Chrt from "../../../../../../index.mjs";
5
+ /**
6
+ * @example
7
+ * {
8
+ * start: "2024-01-15T09:30:00Z",
9
+ * end: "2024-01-15T09:30:00Z"
10
+ * }
11
+ */
12
+ export interface AnalyticsTimePeriodRequest {
13
+ start: string;
14
+ end: string;
15
+ granularity?: Chrt.TimeGranularity;
16
+ timezone?: Chrt.TimezoneEnum;
17
+ start_of_week?: Chrt.StartOfWeek | null;
18
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1 @@
1
+ export { type AnalyticsTimePeriodRequest } from "./AnalyticsTimePeriodRequest.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -0,0 +1 @@
1
+ export * from "./client/index.mjs";
@@ -31,15 +31,18 @@ export declare class Dev {
31
31
  protected readonly _options: Dev.Options;
32
32
  constructor(_options?: Dev.Options);
33
33
  /**
34
- * Experimental endpoint for running AI agentic workflows. Returns the caller's ID for testing purposes. | () -> (str)
34
+ * Runs a customer service agent that responds with logistics fun facts (real order data not yet available). | (AgentReq) -> (AgentRes)
35
35
  *
36
+ * @param {Chrt.AgentReq} request
36
37
  * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
37
38
  *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
38
41
  * @example
39
- * await client.dev.getAgentV1()
42
+ * await client.dev.postAgentV1()
40
43
  */
41
- getAgentV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
42
- private __getAgentV1;
44
+ postAgentV1(request?: Chrt.AgentReq, requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Chrt.AgentRes>;
45
+ private __postAgentV1;
43
46
  /**
44
47
  * (DEPRECATED) Extracts and returns the user ID from the authenticated request's JWT token. | () -> (str)
45
48
  *
@@ -80,16 +83,6 @@ export declare class Dev {
80
83
  */
81
84
  getEmailV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<string>;
82
85
  private __getEmailV1;
83
- /**
84
- * Experimental endpoint for running durable execution workflows. Returns the caller's ID for testing purposes. | () -> (dict[str, Any])
85
- *
86
- * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
87
- *
88
- * @example
89
- * await client.dev.getDurableV1()
90
- */
91
- getDurableV1(requestOptions?: Dev.RequestOptions): core.HttpResponsePromise<Record<string, unknown>>;
92
- private __getDurableV1;
93
86
  /**
94
87
  * Development template endpoint that returns the caller's ID for testing. | () -> (str)
95
88
  *
@@ -12,33 +12,39 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  };
13
13
  import * as environments from "../../../../environments.mjs";
14
14
  import * as core from "../../../../core/index.mjs";
15
+ import * as Chrt from "../../../index.mjs";
15
16
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
16
17
  import * as errors from "../../../../errors/index.mjs";
17
- import * as Chrt from "../../../index.mjs";
18
18
  export class Dev {
19
19
  constructor(_options = {}) {
20
20
  this._options = _options;
21
21
  }
22
22
  /**
23
- * Experimental endpoint for running AI agentic workflows. Returns the caller's ID for testing purposes. | () -> (str)
23
+ * Runs a customer service agent that responds with logistics fun facts (real order data not yet available). | (AgentReq) -> (AgentRes)
24
24
  *
25
+ * @param {Chrt.AgentReq} request
25
26
  * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
26
27
  *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
27
30
  * @example
28
- * await client.dev.getAgentV1()
31
+ * await client.dev.postAgentV1()
29
32
  */
30
- getAgentV1(requestOptions) {
31
- return core.HttpResponsePromise.fromPromise(this.__getAgentV1(requestOptions));
33
+ postAgentV1(request = {}, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__postAgentV1(request, requestOptions));
32
35
  }
33
- __getAgentV1(requestOptions) {
34
- return __awaiter(this, void 0, void 0, function* () {
36
+ __postAgentV1() {
37
+ return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
35
38
  var _a, _b, _c, _d;
36
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);
37
40
  const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
38
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, "dev/agent/v1"),
39
- method: "GET",
42
+ method: "POST",
40
43
  headers: _headers,
44
+ contentType: "application/json",
41
45
  queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
46
+ requestType: "json",
47
+ body: request,
42
48
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
43
49
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
44
50
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -47,11 +53,16 @@ export class Dev {
47
53
  return { data: _response.body, rawResponse: _response.rawResponse };
48
54
  }
49
55
  if (_response.error.reason === "status-code") {
50
- throw new errors.ChrtError({
51
- statusCode: _response.error.statusCode,
52
- body: _response.error.body,
53
- rawResponse: _response.rawResponse,
54
- });
56
+ switch (_response.error.statusCode) {
57
+ case 422:
58
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
59
+ default:
60
+ throw new errors.ChrtError({
61
+ statusCode: _response.error.statusCode,
62
+ body: _response.error.body,
63
+ rawResponse: _response.rawResponse,
64
+ });
65
+ }
55
66
  }
56
67
  switch (_response.error.reason) {
57
68
  case "non-json":
@@ -61,7 +72,7 @@ export class Dev {
61
72
  rawResponse: _response.rawResponse,
62
73
  });
63
74
  case "timeout":
64
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/agent/v1.");
75
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /dev/agent/v1.");
65
76
  case "unknown":
66
77
  throw new errors.ChrtError({
67
78
  message: _response.error.errorMessage,
@@ -274,57 +285,6 @@ export class Dev {
274
285
  }
275
286
  });
276
287
  }
277
- /**
278
- * Experimental endpoint for running durable execution workflows. Returns the caller's ID for testing purposes. | () -> (dict[str, Any])
279
- *
280
- * @param {Dev.RequestOptions} requestOptions - Request-specific configuration.
281
- *
282
- * @example
283
- * await client.dev.getDurableV1()
284
- */
285
- getDurableV1(requestOptions) {
286
- return core.HttpResponsePromise.fromPromise(this.__getDurableV1(requestOptions));
287
- }
288
- __getDurableV1(requestOptions) {
289
- return __awaiter(this, void 0, void 0, function* () {
290
- var _a, _b, _c, _d;
291
- 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);
292
- const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
293
- 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/v1"),
294
- method: "GET",
295
- headers: _headers,
296
- queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
297
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
298
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
299
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
300
- });
301
- if (_response.ok) {
302
- return { data: _response.body, rawResponse: _response.rawResponse };
303
- }
304
- if (_response.error.reason === "status-code") {
305
- throw new errors.ChrtError({
306
- statusCode: _response.error.statusCode,
307
- body: _response.error.body,
308
- rawResponse: _response.rawResponse,
309
- });
310
- }
311
- switch (_response.error.reason) {
312
- case "non-json":
313
- throw new errors.ChrtError({
314
- statusCode: _response.error.statusCode,
315
- body: _response.error.rawBody,
316
- rawResponse: _response.rawResponse,
317
- });
318
- case "timeout":
319
- throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /dev/durable/v1.");
320
- case "unknown":
321
- throw new errors.ChrtError({
322
- message: _response.error.errorMessage,
323
- rawResponse: _response.rawResponse,
324
- });
325
- }
326
- });
327
- }
328
288
  /**
329
289
  * Development template endpoint that returns the caller's ID for testing. | () -> (str)
330
290
  *
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {}
7
+ */
8
+ export interface AgentReq {
9
+ topics?: string[] | null;
10
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -1 +1,2 @@
1
+ export { type AgentReq } from "./AgentReq.mjs";
1
2
  export { type TemplateReq } from "./TemplateReq.mjs";
@@ -18,6 +18,7 @@ export * as orgs from "./orgs/index.mjs";
18
18
  export * as root from "./root/index.mjs";
19
19
  export * as users from "./users/index.mjs";
20
20
  export * as utils from "./utils/index.mjs";
21
+ export * as analytics from "./analytics/index.mjs";
21
22
  export * as notifications from "./notifications/index.mjs";
22
23
  export * as orgInfoForConnections from "./orgInfoForConnections/index.mjs";
23
24
  export * as tracking from "./tracking/index.mjs";
@@ -32,4 +33,5 @@ export * from "./taskGroups/client/requests/index.mjs";
32
33
  export * from "./tasks/client/requests/index.mjs";
33
34
  export * from "./directoryEntries/client/requests/index.mjs";
34
35
  export * from "./orgs/client/requests/index.mjs";
36
+ export * from "./users/client/requests/index.mjs";
35
37
  export * from "./utils/client/requests/index.mjs";
@@ -18,6 +18,7 @@ export * as orgs from "./orgs/index.mjs";
18
18
  export * as root from "./root/index.mjs";
19
19
  export * as users from "./users/index.mjs";
20
20
  export * as utils from "./utils/index.mjs";
21
+ export * as analytics from "./analytics/index.mjs";
21
22
  export * as notifications from "./notifications/index.mjs";
22
23
  export * as orgInfoForConnections from "./orgInfoForConnections/index.mjs";
23
24
  export * as tracking from "./tracking/index.mjs";
@@ -32,4 +33,5 @@ export * from "./taskGroups/client/requests/index.mjs";
32
33
  export * from "./tasks/client/requests/index.mjs";
33
34
  export * from "./directoryEntries/client/requests/index.mjs";
34
35
  export * from "./orgs/client/requests/index.mjs";
36
+ export * from "./users/client/requests/index.mjs";
35
37
  export * from "./utils/client/requests/index.mjs";
@@ -40,5 +40,43 @@ export declare class Users {
40
40
  */
41
41
  getUserPublicDataV1(requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPublicData1>;
42
42
  private __getUserPublicDataV1;
43
+ /**
44
+ * Retrieves private user data for the caller. | () -> (UserPrivateData1)
45
+ *
46
+ * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
47
+ *
48
+ * @example
49
+ * await client.users.getUserPrivateDataV1()
50
+ */
51
+ getUserPrivateDataV1(requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
52
+ private __getUserPrivateDataV1;
53
+ /**
54
+ * Creates private user data for the caller. | (UserPrivateDataClientCreate1) -> (UserPrivateData1)
55
+ *
56
+ * @param {Chrt.UserPrivateDataClientCreate1} request
57
+ * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link Chrt.UnprocessableEntityError}
60
+ *
61
+ * @example
62
+ * await client.users.createUserPrivateDataV1({
63
+ * schema_version: 1
64
+ * })
65
+ */
66
+ createUserPrivateDataV1(request: Chrt.UserPrivateDataClientCreate1, requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
67
+ private __createUserPrivateDataV1;
68
+ /**
69
+ * Updates private user data for the caller. | (UserPrivateDataClientUpdate1) -> (UserPrivateData1)
70
+ *
71
+ * @param {Chrt.UserPrivateDataClientUpdate1} request
72
+ * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
73
+ *
74
+ * @throws {@link Chrt.UnprocessableEntityError}
75
+ *
76
+ * @example
77
+ * await client.users.updateUserPrivateDataV1()
78
+ */
79
+ updateUserPrivateDataV1(request?: Chrt.UserPrivateDataClientUpdate1, requestOptions?: Users.RequestOptions): core.HttpResponsePromise<Chrt.UserPrivateData1>;
80
+ private __updateUserPrivateDataV1;
43
81
  protected _getAuthorizationHeader(): Promise<string | undefined>;
44
82
  }