@chrt-inc/typescript-sdk 1.888.0 → 1.891.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 (148) hide show
  1. package/dist/cjs/Client.js +2 -2
  2. package/dist/cjs/api/resources/trackingIntegrations/client/Client.d.ts +3 -0
  3. package/dist/cjs/api/resources/trackingIntegrations/client/Client.js +7 -2
  4. package/dist/cjs/api/resources/trackingIntegrations/resources/index.d.ts +1 -0
  5. package/dist/cjs/api/resources/trackingIntegrations/resources/index.js +2 -1
  6. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/client/Client.d.ts +29 -0
  7. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/client/Client.js +27 -0
  8. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/client/index.d.ts +1 -0
  9. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/client/index.js +2 -0
  10. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/index.d.ts +2 -0
  11. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/index.js +18 -0
  12. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/Client.d.ts +93 -0
  13. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/Client.js +328 -0
  14. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/index.d.ts +2 -0
  15. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/index.js +17 -0
  16. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/AssetsListV1Request.d.ts +21 -0
  17. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/AssetsListV1Request.js +5 -0
  18. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/ReelablesAssetClientUpdate1.d.ts +14 -0
  19. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/ReelablesAssetClientUpdate1.js +5 -0
  20. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/index.d.ts +2 -0
  21. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/index.js +2 -0
  22. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/index.d.ts +1 -0
  23. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/assets/index.js +17 -0
  24. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/index.d.ts +6 -0
  25. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/index.js +45 -0
  26. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/Client.d.ts +51 -0
  27. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/Client.js +135 -0
  28. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/index.d.ts +2 -0
  29. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/index.js +17 -0
  30. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/TimeseriesDataPointsV1Request.d.ts +14 -0
  31. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/TimeseriesDataPointsV1Request.js +5 -0
  32. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/index.d.ts +1 -0
  33. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/index.js +2 -0
  34. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/index.d.ts +1 -0
  35. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/index.js +17 -0
  36. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/Client.d.ts +62 -0
  37. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/Client.js +197 -0
  38. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/index.d.ts +2 -0
  39. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/index.js +17 -0
  40. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/WorkspacesListV1Request.d.ts +21 -0
  41. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/WorkspacesListV1Request.js +5 -0
  42. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/index.d.ts +1 -0
  43. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/index.js +2 -0
  44. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/index.d.ts +1 -0
  45. package/dist/cjs/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/index.js +17 -0
  46. package/dist/cjs/api/types/ReelablesAsset1.d.ts +22 -0
  47. package/dist/cjs/api/types/ReelablesAsset1.js +5 -0
  48. package/dist/cjs/api/types/ReelablesAssetListRes.d.ts +8 -0
  49. package/dist/cjs/api/types/ReelablesAssetListRes.js +5 -0
  50. package/dist/cjs/api/types/ReelablesAssetSortByEnum.d.ts +8 -0
  51. package/dist/cjs/api/types/ReelablesAssetSortByEnum.js +10 -0
  52. package/dist/cjs/api/types/ReelablesAssetSyncRes.d.ts +8 -0
  53. package/dist/cjs/api/types/ReelablesAssetSyncRes.js +5 -0
  54. package/dist/cjs/api/types/ReelablesDataPoint1.d.ts +12 -0
  55. package/dist/cjs/api/types/ReelablesDataPoint1.js +5 -0
  56. package/dist/cjs/api/types/ReelablesDataPointMetadata1.d.ts +6 -0
  57. package/dist/cjs/api/types/ReelablesDataPointMetadata1.js +5 -0
  58. package/dist/cjs/api/types/ReelablesLabel1.d.ts +9 -0
  59. package/dist/cjs/api/types/ReelablesLabel1.js +5 -0
  60. package/dist/cjs/api/types/ReelablesTimeseriesRes.d.ts +7 -0
  61. package/dist/cjs/api/types/ReelablesTimeseriesRes.js +5 -0
  62. package/dist/cjs/api/types/ReelablesWorkspace1.d.ts +13 -0
  63. package/dist/cjs/api/types/ReelablesWorkspace1.js +5 -0
  64. package/dist/cjs/api/types/ReelablesWorkspaceListRes.d.ts +8 -0
  65. package/dist/cjs/api/types/ReelablesWorkspaceListRes.js +5 -0
  66. package/dist/cjs/api/types/ReelablesWorkspaceSortByEnum.d.ts +4 -0
  67. package/dist/cjs/api/types/ReelablesWorkspaceSortByEnum.js +5 -0
  68. package/dist/cjs/api/types/ReelablesWorkspaceSyncRes.d.ts +9 -0
  69. package/dist/cjs/api/types/ReelablesWorkspaceSyncRes.js +5 -0
  70. package/dist/cjs/api/types/index.d.ts +12 -0
  71. package/dist/cjs/api/types/index.js +12 -0
  72. package/dist/cjs/version.d.ts +1 -1
  73. package/dist/cjs/version.js +1 -1
  74. package/dist/esm/Client.mjs +2 -2
  75. package/dist/esm/api/resources/trackingIntegrations/client/Client.d.mts +3 -0
  76. package/dist/esm/api/resources/trackingIntegrations/client/Client.mjs +5 -0
  77. package/dist/esm/api/resources/trackingIntegrations/resources/index.d.mts +1 -0
  78. package/dist/esm/api/resources/trackingIntegrations/resources/index.mjs +1 -0
  79. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/client/Client.d.mts +29 -0
  80. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/client/Client.mjs +23 -0
  81. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/client/index.d.mts +1 -0
  82. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/client/index.mjs +1 -0
  83. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/index.d.mts +2 -0
  84. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/index.mjs +2 -0
  85. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/Client.d.mts +93 -0
  86. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/Client.mjs +291 -0
  87. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/index.d.mts +2 -0
  88. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/index.mjs +1 -0
  89. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/AssetsListV1Request.d.mts +21 -0
  90. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/AssetsListV1Request.mjs +4 -0
  91. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/ReelablesAssetClientUpdate1.d.mts +14 -0
  92. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/ReelablesAssetClientUpdate1.mjs +4 -0
  93. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/index.d.mts +2 -0
  94. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/client/requests/index.mjs +1 -0
  95. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/index.d.mts +1 -0
  96. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/assets/index.mjs +1 -0
  97. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/index.d.mts +6 -0
  98. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/index.mjs +6 -0
  99. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/Client.d.mts +51 -0
  100. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/Client.mjs +98 -0
  101. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/index.d.mts +2 -0
  102. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/index.mjs +1 -0
  103. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/TimeseriesDataPointsV1Request.d.mts +14 -0
  104. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/TimeseriesDataPointsV1Request.mjs +4 -0
  105. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/index.d.mts +1 -0
  106. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/client/requests/index.mjs +1 -0
  107. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/index.d.mts +1 -0
  108. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/timeseries/index.mjs +1 -0
  109. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/Client.d.mts +62 -0
  110. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/Client.mjs +160 -0
  111. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/index.d.mts +2 -0
  112. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/index.mjs +1 -0
  113. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/WorkspacesListV1Request.d.mts +21 -0
  114. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/WorkspacesListV1Request.mjs +4 -0
  115. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/index.d.mts +1 -0
  116. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/client/requests/index.mjs +1 -0
  117. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/index.d.mts +1 -0
  118. package/dist/esm/api/resources/trackingIntegrations/resources/reelables/resources/workspaces/index.mjs +1 -0
  119. package/dist/esm/api/types/ReelablesAsset1.d.mts +22 -0
  120. package/dist/esm/api/types/ReelablesAsset1.mjs +4 -0
  121. package/dist/esm/api/types/ReelablesAssetListRes.d.mts +8 -0
  122. package/dist/esm/api/types/ReelablesAssetListRes.mjs +4 -0
  123. package/dist/esm/api/types/ReelablesAssetSortByEnum.d.mts +8 -0
  124. package/dist/esm/api/types/ReelablesAssetSortByEnum.mjs +7 -0
  125. package/dist/esm/api/types/ReelablesAssetSyncRes.d.mts +8 -0
  126. package/dist/esm/api/types/ReelablesAssetSyncRes.mjs +4 -0
  127. package/dist/esm/api/types/ReelablesDataPoint1.d.mts +12 -0
  128. package/dist/esm/api/types/ReelablesDataPoint1.mjs +4 -0
  129. package/dist/esm/api/types/ReelablesDataPointMetadata1.d.mts +6 -0
  130. package/dist/esm/api/types/ReelablesDataPointMetadata1.mjs +4 -0
  131. package/dist/esm/api/types/ReelablesLabel1.d.mts +9 -0
  132. package/dist/esm/api/types/ReelablesLabel1.mjs +4 -0
  133. package/dist/esm/api/types/ReelablesTimeseriesRes.d.mts +7 -0
  134. package/dist/esm/api/types/ReelablesTimeseriesRes.mjs +4 -0
  135. package/dist/esm/api/types/ReelablesWorkspace1.d.mts +13 -0
  136. package/dist/esm/api/types/ReelablesWorkspace1.mjs +4 -0
  137. package/dist/esm/api/types/ReelablesWorkspaceListRes.d.mts +8 -0
  138. package/dist/esm/api/types/ReelablesWorkspaceListRes.mjs +4 -0
  139. package/dist/esm/api/types/ReelablesWorkspaceSortByEnum.d.mts +4 -0
  140. package/dist/esm/api/types/ReelablesWorkspaceSortByEnum.mjs +4 -0
  141. package/dist/esm/api/types/ReelablesWorkspaceSyncRes.d.mts +9 -0
  142. package/dist/esm/api/types/ReelablesWorkspaceSyncRes.mjs +4 -0
  143. package/dist/esm/api/types/index.d.mts +12 -0
  144. package/dist/esm/api/types/index.mjs +12 -0
  145. package/dist/esm/version.d.mts +1 -1
  146. package/dist/esm/version.mjs +1 -1
  147. package/package.json +1 -1
  148. package/reference.md +476 -0
@@ -0,0 +1,291 @@
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 Assets {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Refreshes and retrieves a Reelables asset by its external ID. | authz: min_org_role=operator | () -> (ReelablesAsset1)
24
+ *
25
+ * @param {string} assetId
26
+ * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
27
+ *
28
+ * @throws {@link Chrt.UnprocessableEntityError}
29
+ *
30
+ * @example
31
+ * await client.trackingIntegrations.reelables.assets.getV1("asset_id")
32
+ */
33
+ getV1(assetId, requestOptions) {
34
+ return core.HttpResponsePromise.fromPromise(this.__getV1(assetId, requestOptions));
35
+ }
36
+ __getV1(assetId, requestOptions) {
37
+ return __awaiter(this, void 0, void 0, function* () {
38
+ var _a, _b, _c, _d;
39
+ let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
40
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
41
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.ChrtEnvironment.Local, `tracking_integrations/reelables/assets/get/v1/${encodeURIComponent(assetId)}`),
42
+ method: "GET",
43
+ headers: _headers,
44
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
45
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
46
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
47
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
48
+ });
49
+ if (_response.ok) {
50
+ return { data: _response.body, rawResponse: _response.rawResponse };
51
+ }
52
+ if (_response.error.reason === "status-code") {
53
+ switch (_response.error.statusCode) {
54
+ case 422:
55
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
56
+ default:
57
+ throw new errors.ChrtError({
58
+ statusCode: _response.error.statusCode,
59
+ body: _response.error.body,
60
+ rawResponse: _response.rawResponse,
61
+ });
62
+ }
63
+ }
64
+ switch (_response.error.reason) {
65
+ case "non-json":
66
+ throw new errors.ChrtError({
67
+ statusCode: _response.error.statusCode,
68
+ body: _response.error.rawBody,
69
+ rawResponse: _response.rawResponse,
70
+ });
71
+ case "timeout":
72
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking_integrations/reelables/assets/get/v1/{asset_id}.");
73
+ case "unknown":
74
+ throw new errors.ChrtError({
75
+ message: _response.error.errorMessage,
76
+ rawResponse: _response.rawResponse,
77
+ });
78
+ }
79
+ });
80
+ }
81
+ /**
82
+ * Lists cached Reelables assets for a workspace. | authz: min_org_role=operator | () -> (ReelablesAssetListRes)
83
+ *
84
+ * @param {string} workspaceId
85
+ * @param {Chrt.trackingIntegrations.reelables.AssetsListV1Request} request
86
+ * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
87
+ *
88
+ * @throws {@link Chrt.UnprocessableEntityError}
89
+ *
90
+ * @example
91
+ * await client.trackingIntegrations.reelables.assets.listV1("workspace_id", {
92
+ * sort_by: "asset_id",
93
+ * sort_order: "asc",
94
+ * page: 1,
95
+ * page_size: 1
96
+ * })
97
+ */
98
+ listV1(workspaceId, request = {}, requestOptions) {
99
+ return core.HttpResponsePromise.fromPromise(this.__listV1(workspaceId, request, requestOptions));
100
+ }
101
+ __listV1(workspaceId_1) {
102
+ return __awaiter(this, arguments, void 0, function* (workspaceId, request = {}, requestOptions) {
103
+ var _a, _b, _c, _d, _e, _f;
104
+ const { sort_by: sortBy, sort_order: sortOrder, page, page_size: pageSize } = request;
105
+ const _queryParams = {};
106
+ if (sortBy !== undefined) {
107
+ _queryParams["sort_by"] = sortBy;
108
+ }
109
+ if (sortOrder !== undefined) {
110
+ _queryParams["sort_order"] = sortOrder;
111
+ }
112
+ if (page !== undefined) {
113
+ _queryParams["page"] = (_a = page === null || page === void 0 ? void 0 : page.toString()) !== null && _a !== void 0 ? _a : null;
114
+ }
115
+ if (pageSize !== undefined) {
116
+ _queryParams["page_size"] = (_b = pageSize === null || pageSize === void 0 ? void 0 : pageSize.toString()) !== null && _b !== void 0 ? _b : null;
117
+ }
118
+ let _headers = mergeHeaders((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
119
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
120
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.ChrtEnvironment.Local, `tracking_integrations/reelables/assets/list/v1/${encodeURIComponent(workspaceId)}`),
121
+ method: "GET",
122
+ headers: _headers,
123
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
124
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
125
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
126
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
127
+ });
128
+ if (_response.ok) {
129
+ return { data: _response.body, rawResponse: _response.rawResponse };
130
+ }
131
+ if (_response.error.reason === "status-code") {
132
+ switch (_response.error.statusCode) {
133
+ case 422:
134
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
135
+ default:
136
+ throw new errors.ChrtError({
137
+ statusCode: _response.error.statusCode,
138
+ body: _response.error.body,
139
+ rawResponse: _response.rawResponse,
140
+ });
141
+ }
142
+ }
143
+ switch (_response.error.reason) {
144
+ case "non-json":
145
+ throw new errors.ChrtError({
146
+ statusCode: _response.error.statusCode,
147
+ body: _response.error.rawBody,
148
+ rawResponse: _response.rawResponse,
149
+ });
150
+ case "timeout":
151
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking_integrations/reelables/assets/list/v1/{workspace_id}.");
152
+ case "unknown":
153
+ throw new errors.ChrtError({
154
+ message: _response.error.errorMessage,
155
+ rawResponse: _response.rawResponse,
156
+ });
157
+ }
158
+ });
159
+ }
160
+ /**
161
+ * Synchronizes all Reelables assets for a cached workspace. | authz: min_org_role=operator | () -> (ReelablesAssetSyncRes)
162
+ *
163
+ * @param {string} workspaceId
164
+ * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
165
+ *
166
+ * @throws {@link Chrt.UnprocessableEntityError}
167
+ *
168
+ * @example
169
+ * await client.trackingIntegrations.reelables.assets.syncV1("workspace_id")
170
+ */
171
+ syncV1(workspaceId, requestOptions) {
172
+ return core.HttpResponsePromise.fromPromise(this.__syncV1(workspaceId, requestOptions));
173
+ }
174
+ __syncV1(workspaceId, requestOptions) {
175
+ return __awaiter(this, void 0, void 0, function* () {
176
+ var _a, _b, _c, _d;
177
+ 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);
178
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
179
+ 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, `tracking_integrations/reelables/assets/sync/v1/${encodeURIComponent(workspaceId)}`),
180
+ method: "POST",
181
+ headers: _headers,
182
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
183
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
184
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
185
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
186
+ });
187
+ if (_response.ok) {
188
+ return { data: _response.body, rawResponse: _response.rawResponse };
189
+ }
190
+ if (_response.error.reason === "status-code") {
191
+ switch (_response.error.statusCode) {
192
+ case 422:
193
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
194
+ default:
195
+ throw new errors.ChrtError({
196
+ statusCode: _response.error.statusCode,
197
+ body: _response.error.body,
198
+ rawResponse: _response.rawResponse,
199
+ });
200
+ }
201
+ }
202
+ switch (_response.error.reason) {
203
+ case "non-json":
204
+ throw new errors.ChrtError({
205
+ statusCode: _response.error.statusCode,
206
+ body: _response.error.rawBody,
207
+ rawResponse: _response.rawResponse,
208
+ });
209
+ case "timeout":
210
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling POST /tracking_integrations/reelables/assets/sync/v1/{workspace_id}.");
211
+ case "unknown":
212
+ throw new errors.ChrtError({
213
+ message: _response.error.errorMessage,
214
+ rawResponse: _response.rawResponse,
215
+ });
216
+ }
217
+ });
218
+ }
219
+ /**
220
+ * Updates a Reelables asset, applying name changes upstream before updating CHRT. | authz: min_org_role=operator | (ReelablesAssetClientUpdate1) -> (ReelablesAsset1)
221
+ *
222
+ * @param {string} assetId
223
+ * @param {Chrt.trackingIntegrations.reelables.ReelablesAssetClientUpdate1} request
224
+ * @param {Assets.RequestOptions} requestOptions - Request-specific configuration.
225
+ *
226
+ * @throws {@link Chrt.UnprocessableEntityError}
227
+ *
228
+ * @example
229
+ * await client.trackingIntegrations.reelables.assets.updateV1("asset_id")
230
+ */
231
+ updateV1(assetId, request = {}, requestOptions) {
232
+ return core.HttpResponsePromise.fromPromise(this.__updateV1(assetId, request, requestOptions));
233
+ }
234
+ __updateV1(assetId_1) {
235
+ return __awaiter(this, arguments, void 0, function* (assetId, request = {}, requestOptions) {
236
+ var _a, _b, _c, _d;
237
+ 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);
238
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
239
+ 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, `tracking_integrations/reelables/assets/update/v1/${encodeURIComponent(assetId)}`),
240
+ method: "PATCH",
241
+ headers: _headers,
242
+ contentType: "application/json",
243
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
244
+ requestType: "json",
245
+ body: request,
246
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
247
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
248
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
249
+ });
250
+ if (_response.ok) {
251
+ return { data: _response.body, rawResponse: _response.rawResponse };
252
+ }
253
+ if (_response.error.reason === "status-code") {
254
+ switch (_response.error.statusCode) {
255
+ case 422:
256
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
257
+ default:
258
+ throw new errors.ChrtError({
259
+ statusCode: _response.error.statusCode,
260
+ body: _response.error.body,
261
+ rawResponse: _response.rawResponse,
262
+ });
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 PATCH /tracking_integrations/reelables/assets/update/v1/{asset_id}.");
274
+ case "unknown":
275
+ throw new errors.ChrtError({
276
+ message: _response.error.errorMessage,
277
+ rawResponse: _response.rawResponse,
278
+ });
279
+ }
280
+ });
281
+ }
282
+ _getAuthorizationHeader() {
283
+ return __awaiter(this, void 0, void 0, function* () {
284
+ const bearer = yield core.Supplier.get(this._options.token);
285
+ if (bearer != null) {
286
+ return `Bearer ${bearer}`;
287
+ }
288
+ return undefined;
289
+ });
290
+ }
291
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1,21 @@
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
+ * sort_by: "asset_id",
9
+ * sort_order: "asc",
10
+ * page: 1,
11
+ * page_size: 1
12
+ * }
13
+ */
14
+ export interface AssetsListV1Request {
15
+ /** Field to sort by */
16
+ sort_by?: Chrt.ReelablesAssetSortByEnum | null;
17
+ /** Sort order (asc or desc) */
18
+ sort_order?: Chrt.SortOrderEnum | null;
19
+ page?: number | null;
20
+ page_size?: number | null;
21
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,14 @@
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
+ */
9
+ export interface ReelablesAssetClientUpdate1 {
10
+ destination_geofence_location?: Chrt.LocationFeature | null;
11
+ destination_geofence_location__set_to_None?: boolean;
12
+ destination_geofence_radius_miles?: number | null;
13
+ name?: string | null;
14
+ }
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export {};
@@ -0,0 +1,2 @@
1
+ export { type AssetsListV1Request } from "./AssetsListV1Request.mjs";
2
+ export { type ReelablesAssetClientUpdate1 } from "./ReelablesAssetClientUpdate1.mjs";
@@ -0,0 +1,6 @@
1
+ export * as assets from "./assets/index.mjs";
2
+ export * as timeseries from "./timeseries/index.mjs";
3
+ export * as workspaces from "./workspaces/index.mjs";
4
+ export * from "./assets/client/requests/index.mjs";
5
+ export * from "./timeseries/client/requests/index.mjs";
6
+ export * from "./workspaces/client/requests/index.mjs";
@@ -0,0 +1,6 @@
1
+ export * as assets from "./assets/index.mjs";
2
+ export * as timeseries from "./timeseries/index.mjs";
3
+ export * as workspaces from "./workspaces/index.mjs";
4
+ export * from "./assets/client/requests/index.mjs";
5
+ export * from "./timeseries/client/requests/index.mjs";
6
+ export * from "./workspaces/client/requests/index.mjs";
@@ -0,0 +1,51 @@
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 Timeseries {
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 Timeseries {
31
+ protected readonly _options: Timeseries.Options;
32
+ constructor(_options?: Timeseries.Options);
33
+ /**
34
+ * Refreshes and returns Reelables location data points within the requested time range. | authz: min_org_role=operator | () -> (ReelablesTimeseriesRes)
35
+ *
36
+ * @param {string} assetId
37
+ * @param {Chrt.trackingIntegrations.reelables.TimeseriesDataPointsV1Request} request
38
+ * @param {Timeseries.RequestOptions} requestOptions - Request-specific configuration.
39
+ *
40
+ * @throws {@link Chrt.UnprocessableEntityError}
41
+ *
42
+ * @example
43
+ * await client.trackingIntegrations.reelables.timeseries.dataPointsV1("asset_id", {
44
+ * start_timestamp: "2024-01-15T09:30:00Z",
45
+ * end_timestamp: "2024-01-15T09:30:00Z"
46
+ * })
47
+ */
48
+ dataPointsV1(assetId: string, request: Chrt.trackingIntegrations.reelables.TimeseriesDataPointsV1Request, requestOptions?: Timeseries.RequestOptions): core.HttpResponsePromise<Chrt.ReelablesTimeseriesRes>;
49
+ private __dataPointsV1;
50
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
51
+ }
@@ -0,0 +1,98 @@
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 Timeseries {
19
+ constructor(_options = {}) {
20
+ this._options = _options;
21
+ }
22
+ /**
23
+ * Refreshes and returns Reelables location data points within the requested time range. | authz: min_org_role=operator | () -> (ReelablesTimeseriesRes)
24
+ *
25
+ * @param {string} assetId
26
+ * @param {Chrt.trackingIntegrations.reelables.TimeseriesDataPointsV1Request} request
27
+ * @param {Timeseries.RequestOptions} requestOptions - Request-specific configuration.
28
+ *
29
+ * @throws {@link Chrt.UnprocessableEntityError}
30
+ *
31
+ * @example
32
+ * await client.trackingIntegrations.reelables.timeseries.dataPointsV1("asset_id", {
33
+ * start_timestamp: "2024-01-15T09:30:00Z",
34
+ * end_timestamp: "2024-01-15T09:30:00Z"
35
+ * })
36
+ */
37
+ dataPointsV1(assetId, request, requestOptions) {
38
+ return core.HttpResponsePromise.fromPromise(this.__dataPointsV1(assetId, request, requestOptions));
39
+ }
40
+ __dataPointsV1(assetId, request, requestOptions) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ var _a, _b, _c, _d;
43
+ const { start_timestamp: startTimestamp, end_timestamp: endTimestamp } = request;
44
+ const _queryParams = {};
45
+ _queryParams["start_timestamp"] = startTimestamp;
46
+ _queryParams["end_timestamp"] = endTimestamp;
47
+ 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);
48
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
49
+ 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, `tracking_integrations/reelables/timeseries/data_points/v1/${encodeURIComponent(assetId)}`),
50
+ method: "GET",
51
+ headers: _headers,
52
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
53
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
54
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
55
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
56
+ });
57
+ if (_response.ok) {
58
+ return { data: _response.body, rawResponse: _response.rawResponse };
59
+ }
60
+ if (_response.error.reason === "status-code") {
61
+ switch (_response.error.statusCode) {
62
+ case 422:
63
+ throw new Chrt.UnprocessableEntityError(_response.error.body, _response.rawResponse);
64
+ default:
65
+ throw new errors.ChrtError({
66
+ statusCode: _response.error.statusCode,
67
+ body: _response.error.body,
68
+ rawResponse: _response.rawResponse,
69
+ });
70
+ }
71
+ }
72
+ switch (_response.error.reason) {
73
+ case "non-json":
74
+ throw new errors.ChrtError({
75
+ statusCode: _response.error.statusCode,
76
+ body: _response.error.rawBody,
77
+ rawResponse: _response.rawResponse,
78
+ });
79
+ case "timeout":
80
+ throw new errors.ChrtTimeoutError("Timeout exceeded when calling GET /tracking_integrations/reelables/timeseries/data_points/v1/{asset_id}.");
81
+ case "unknown":
82
+ throw new errors.ChrtError({
83
+ message: _response.error.errorMessage,
84
+ rawResponse: _response.rawResponse,
85
+ });
86
+ }
87
+ });
88
+ }
89
+ _getAuthorizationHeader() {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const bearer = yield core.Supplier.get(this._options.token);
92
+ if (bearer != null) {
93
+ return `Bearer ${bearer}`;
94
+ }
95
+ return undefined;
96
+ });
97
+ }
98
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ export * from "./requests/index.mjs";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * start_timestamp: "2024-01-15T09:30:00Z",
8
+ * end_timestamp: "2024-01-15T09:30:00Z"
9
+ * }
10
+ */
11
+ export interface TimeseriesDataPointsV1Request {
12
+ start_timestamp: string;
13
+ end_timestamp: string;
14
+ }
@@ -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 TimeseriesDataPointsV1Request } from "./TimeseriesDataPointsV1Request.mjs";
@@ -0,0 +1,62 @@
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 Workspaces {
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 Workspaces {
31
+ protected readonly _options: Workspaces.Options;
32
+ constructor(_options?: Workspaces.Options);
33
+ /**
34
+ * Lists cached Reelables workspaces for the caller's organization. | authz: min_org_role=operator | () -> (ReelablesWorkspaceListRes)
35
+ *
36
+ * @param {Chrt.trackingIntegrations.reelables.WorkspacesListV1Request} request
37
+ * @param {Workspaces.RequestOptions} requestOptions - Request-specific configuration.
38
+ *
39
+ * @throws {@link Chrt.UnprocessableEntityError}
40
+ *
41
+ * @example
42
+ * await client.trackingIntegrations.reelables.workspaces.listV1({
43
+ * sort_by: "name",
44
+ * sort_order: "asc",
45
+ * page: 1,
46
+ * page_size: 1
47
+ * })
48
+ */
49
+ listV1(request?: Chrt.trackingIntegrations.reelables.WorkspacesListV1Request, requestOptions?: Workspaces.RequestOptions): core.HttpResponsePromise<Chrt.ReelablesWorkspaceListRes>;
50
+ private __listV1;
51
+ /**
52
+ * Synchronizes Reelables workspaces available to the caller's organization without deleting missing workspaces. | authz: min_org_role=operator | () -> (ReelablesWorkspaceSyncRes)
53
+ *
54
+ * @param {Workspaces.RequestOptions} requestOptions - Request-specific configuration.
55
+ *
56
+ * @example
57
+ * await client.trackingIntegrations.reelables.workspaces.syncV1()
58
+ */
59
+ syncV1(requestOptions?: Workspaces.RequestOptions): core.HttpResponsePromise<Chrt.ReelablesWorkspaceSyncRes>;
60
+ private __syncV1;
61
+ protected _getAuthorizationHeader(): Promise<string | undefined>;
62
+ }