@nizam-os/dashboard-sdk 6.4.0 → 7.0.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 (108) hide show
  1. package/dist/Client.d.ts +9 -0
  2. package/dist/Client.js +28 -16
  3. package/dist/api/errors/ContentTooLargeError.d.ts +6 -0
  4. package/dist/api/errors/ContentTooLargeError.js +54 -0
  5. package/dist/api/errors/index.d.ts +1 -0
  6. package/dist/api/errors/index.js +1 -0
  7. package/dist/api/resources/files/client/Client.d.ts +188 -0
  8. package/dist/api/resources/files/client/Client.js +608 -0
  9. package/dist/api/resources/files/client/index.d.ts +1 -0
  10. package/dist/api/resources/files/client/index.js +17 -0
  11. package/dist/api/resources/files/client/requests/CancelFileUploadRequest.d.ts +9 -0
  12. package/dist/api/resources/files/client/requests/CancelFileUploadRequest.js +3 -0
  13. package/dist/api/resources/files/client/requests/CompleteFileUploadRequest.d.ts +15 -0
  14. package/dist/api/resources/files/client/requests/CompleteFileUploadRequest.js +3 -0
  15. package/dist/api/resources/files/client/requests/CreateFileDownloadUrlRequest.d.ts +9 -0
  16. package/dist/api/resources/files/client/requests/CreateFileDownloadUrlRequest.js +3 -0
  17. package/dist/api/resources/files/client/requests/DeleteFileRequest.d.ts +9 -0
  18. package/dist/api/resources/files/client/requests/DeleteFileRequest.js +3 -0
  19. package/dist/api/resources/files/client/requests/GetFileRequest.d.ts +9 -0
  20. package/dist/api/resources/files/client/requests/GetFileRequest.js +3 -0
  21. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +41 -0
  22. package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.js +17 -0
  23. package/dist/api/resources/files/client/requests/ListFilesRequest.d.ts +27 -0
  24. package/dist/api/resources/files/client/requests/ListFilesRequest.js +3 -0
  25. package/dist/api/resources/files/client/requests/ResumeFileUploadRequest.d.ts +9 -0
  26. package/dist/api/resources/files/client/requests/ResumeFileUploadRequest.js +3 -0
  27. package/dist/api/resources/files/client/requests/index.d.ts +8 -0
  28. package/dist/api/resources/files/client/requests/index.js +5 -0
  29. package/dist/api/resources/files/exports.d.ts +2 -0
  30. package/dist/api/resources/files/exports.js +21 -0
  31. package/dist/api/resources/files/index.d.ts +1 -0
  32. package/dist/api/resources/files/index.js +17 -0
  33. package/dist/api/resources/index.d.ts +6 -0
  34. package/dist/api/resources/index.js +7 -1
  35. package/dist/api/resources/positions/client/Client.d.ts +73 -0
  36. package/dist/api/resources/positions/client/Client.js +266 -0
  37. package/dist/api/resources/positions/client/index.d.ts +1 -0
  38. package/dist/api/resources/positions/client/index.js +17 -0
  39. package/dist/api/resources/positions/client/requests/GetPositionsHeatmapRequest.d.ts +14 -0
  40. package/dist/api/resources/positions/client/requests/GetPositionsHeatmapRequest.js +3 -0
  41. package/dist/api/resources/positions/client/requests/ListPositionsRequest.d.ts +21 -0
  42. package/dist/api/resources/positions/client/requests/ListPositionsRequest.js +3 -0
  43. package/dist/api/resources/positions/client/requests/index.d.ts +2 -0
  44. package/dist/api/resources/positions/client/requests/index.js +2 -0
  45. package/dist/api/resources/positions/exports.d.ts +2 -0
  46. package/dist/api/resources/positions/exports.js +21 -0
  47. package/dist/api/resources/positions/index.d.ts +1 -0
  48. package/dist/api/resources/positions/index.js +17 -0
  49. package/dist/api/resources/taskAttempts/client/Client.d.ts +65 -0
  50. package/dist/api/resources/taskAttempts/client/Client.js +208 -0
  51. package/dist/api/resources/taskAttempts/client/index.d.ts +1 -0
  52. package/dist/api/resources/taskAttempts/client/index.js +17 -0
  53. package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.d.ts +49 -0
  54. package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.js +20 -0
  55. package/dist/api/resources/taskAttempts/client/requests/ListTaskAttemptPhotosRequest.d.ts +17 -0
  56. package/dist/api/resources/taskAttempts/client/requests/ListTaskAttemptPhotosRequest.js +3 -0
  57. package/dist/api/resources/taskAttempts/client/requests/index.d.ts +2 -0
  58. package/dist/api/resources/taskAttempts/client/requests/index.js +5 -0
  59. package/dist/api/resources/taskAttempts/exports.d.ts +2 -0
  60. package/dist/api/resources/taskAttempts/exports.js +21 -0
  61. package/dist/api/resources/taskAttempts/index.d.ts +1 -0
  62. package/dist/api/resources/taskAttempts/index.js +17 -0
  63. package/dist/api/resources/users/client/Client.d.ts +43 -0
  64. package/dist/api/resources/users/client/Client.js +142 -0
  65. package/dist/api/resources/users/client/requests/GetUserProfilePictureRequest.d.ts +11 -0
  66. package/dist/api/resources/users/client/requests/GetUserProfilePictureRequest.js +3 -0
  67. package/dist/api/resources/users/client/requests/InitiateProfilePictureUploadRequest.d.ts +19 -0
  68. package/dist/api/resources/users/client/requests/InitiateProfilePictureUploadRequest.js +3 -0
  69. package/dist/api/resources/users/client/requests/index.d.ts +2 -0
  70. package/dist/api/types/FileDownloadUrl.d.ts +16 -0
  71. package/dist/api/types/FileDownloadUrl.js +10 -0
  72. package/dist/api/types/FileUploadPart.d.ts +13 -0
  73. package/dist/api/types/FileUploadPart.js +3 -0
  74. package/dist/api/types/FileUploadPartReport.d.ts +9 -0
  75. package/dist/api/types/FileUploadPartReport.js +3 -0
  76. package/dist/api/types/FileUploadSession.d.ts +51 -0
  77. package/dist/api/types/FileUploadSession.js +28 -0
  78. package/dist/api/types/File_.d.ts +86 -0
  79. package/dist/api/types/File_.js +40 -0
  80. package/dist/api/types/HeatmapCell.d.ts +18 -0
  81. package/dist/api/types/HeatmapCell.js +10 -0
  82. package/dist/api/types/Job.d.ts +2 -0
  83. package/dist/api/types/Job.js +2 -0
  84. package/dist/api/types/ListResponseFile.d.ts +27 -0
  85. package/dist/api/types/ListResponseFile.js +11 -0
  86. package/dist/api/types/ListResponseHeatmapCell.d.ts +27 -0
  87. package/dist/api/types/ListResponseHeatmapCell.js +11 -0
  88. package/dist/api/types/ListResponseOperatorPosition.d.ts +27 -0
  89. package/dist/api/types/ListResponseOperatorPosition.js +11 -0
  90. package/dist/api/types/ListResponsePosition.d.ts +27 -0
  91. package/dist/api/types/ListResponsePosition.js +11 -0
  92. package/dist/api/types/MqttToken.d.ts +12 -0
  93. package/dist/api/types/MqttToken.js +3 -0
  94. package/dist/api/types/OperatorPosition.d.ts +28 -0
  95. package/dist/api/types/OperatorPosition.js +10 -0
  96. package/dist/api/types/Position.d.ts +30 -0
  97. package/dist/api/types/Position.js +10 -0
  98. package/dist/api/types/TaskAttemptPhoto.d.ts +30 -0
  99. package/dist/api/types/TaskAttemptPhoto.js +10 -0
  100. package/dist/api/types/TaskAttemptPhotoThumbnail.d.ts +9 -0
  101. package/dist/api/types/TaskAttemptPhotoThumbnail.js +3 -0
  102. package/dist/api/types/UploadInitiation.d.ts +22 -0
  103. package/dist/api/types/UploadInitiation.js +10 -0
  104. package/dist/api/types/UploadInitiationPart.d.ts +13 -0
  105. package/dist/api/types/UploadInitiationPart.js +3 -0
  106. package/dist/api/types/index.d.ts +17 -0
  107. package/dist/api/types/index.js +17 -0
  108. package/package.json +1 -1
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface CreateFileDownloadUrlRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface DeleteFileRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface GetFileRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,41 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * kind: "profile_picture",
5
+ * subject_type: "task_attempt",
6
+ * subject_id: "b3c4d5e6-7f8a-9b0c-1d2e-3f4a5b6c7d8e",
7
+ * filename: "pod-photo.jpg",
8
+ * content_type: "image/jpeg",
9
+ * size_bytes: 2048576,
10
+ * checksum_sha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08"
11
+ * }
12
+ */
13
+ export interface InitiateFileUploadRequest {
14
+ /** What the bytes are for the platform — fixes the policy applied to them. */
15
+ kind: InitiateFileUploadRequest.Kind;
16
+ /** Type of the business entity this file documents (optional at upload time; can also be attached later). */
17
+ subject_type?: string;
18
+ /** Id of the business entity this file documents. Requires subject_type. */
19
+ subject_id?: string;
20
+ /** Original filename; served back via Content-Disposition on download. */
21
+ filename: string;
22
+ /** Declared MIME type. Must be on the kind's allow-list; re-verified by server-side detection at completion. */
23
+ content_type: string;
24
+ /** Exact byte size of the file. Verified against storage at completion. */
25
+ size_bytes?: number;
26
+ /** SHA-256 of the content as 64 lowercase hex characters (compute with crypto.subtle.digest). Re-verified server-side by the scan pipeline. */
27
+ checksum_sha256: string;
28
+ }
29
+ export declare namespace InitiateFileUploadRequest {
30
+ /** What the bytes are for the platform — fixes the policy applied to them. */
31
+ const Kind: {
32
+ readonly ProfilePicture: "profile_picture";
33
+ readonly ChatAttachment: "chat_attachment";
34
+ readonly TaskPodPhoto: "task_pod_photo";
35
+ readonly ImportSource: "import_source";
36
+ readonly ImportReport: "import_report";
37
+ readonly SignedDocument: "signed_document";
38
+ readonly ProductImage: "product_image";
39
+ };
40
+ type Kind = (typeof Kind)[keyof typeof Kind];
41
+ }
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.InitiateFileUploadRequest = void 0;
5
+ var InitiateFileUploadRequest;
6
+ (function (InitiateFileUploadRequest) {
7
+ /** What the bytes are for the platform — fixes the policy applied to them. */
8
+ InitiateFileUploadRequest.Kind = {
9
+ ProfilePicture: "profile_picture",
10
+ ChatAttachment: "chat_attachment",
11
+ TaskPodPhoto: "task_pod_photo",
12
+ ImportSource: "import_source",
13
+ ImportReport: "import_report",
14
+ SignedDocument: "signed_document",
15
+ ProductImage: "product_image",
16
+ };
17
+ })(InitiateFileUploadRequest || (exports.InitiateFileUploadRequest = InitiateFileUploadRequest = {}));
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * subject_type: "<string>",
5
+ * subject_id: "00000000-0000-0000-0000-000000000000",
6
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
7
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
8
+ * }
9
+ */
10
+ export interface ListFilesRequest {
11
+ /** Filter by file kind. Comma-separated; values: `profile_picture`, `chat_attachment`, `task_pod_photo`, `import_source`, `import_report`, `signed_document`, `product_image`. */
12
+ kind?: string | string[];
13
+ /** Filter by lifecycle status. Comma-separated; values: `active`, `quarantined`, `deleted`. */
14
+ status?: string | string[];
15
+ /** Filter by the documented entity's type (pairs with `subject_id`). */
16
+ subject_type?: string;
17
+ /** Filter by the documented entity's id (requires `subject_type`). */
18
+ subject_id?: string;
19
+ /** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
20
+ sort?: string | string[];
21
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
22
+ limit?: number;
23
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
24
+ starting_after?: string;
25
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
26
+ ending_before?: string;
27
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface ResumeFileUploadRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ export type { CancelFileUploadRequest } from "./CancelFileUploadRequest.js";
2
+ export type { CompleteFileUploadRequest } from "./CompleteFileUploadRequest.js";
3
+ export type { CreateFileDownloadUrlRequest } from "./CreateFileDownloadUrlRequest.js";
4
+ export type { DeleteFileRequest } from "./DeleteFileRequest.js";
5
+ export type { GetFileRequest } from "./GetFileRequest.js";
6
+ export { InitiateFileUploadRequest } from "./InitiateFileUploadRequest.js";
7
+ export type { ListFilesRequest } from "./ListFilesRequest.js";
8
+ export type { ResumeFileUploadRequest } from "./ResumeFileUploadRequest.js";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.InitiateFileUploadRequest = void 0;
4
+ var InitiateFileUploadRequest_js_1 = require("./InitiateFileUploadRequest.js");
5
+ Object.defineProperty(exports, "InitiateFileUploadRequest", { enumerable: true, get: function () { return InitiateFileUploadRequest_js_1.InitiateFileUploadRequest; } });
@@ -0,0 +1,2 @@
1
+ export { FilesClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.FilesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "FilesClient", { enumerable: true, get: function () { return Client_js_1.FilesClient; } });
21
+ __exportStar(require("./client/index.js"), exports);
@@ -0,0 +1 @@
1
+ export * from "./client/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./client/index.js"), exports);
@@ -6,6 +6,8 @@ export * from "./assets/client/requests/index.js";
6
6
  export * as assets from "./assets/index.js";
7
7
  export * from "./assignments/client/requests/index.js";
8
8
  export * as assignments from "./assignments/index.js";
9
+ export * from "./files/client/requests/index.js";
10
+ export * as files from "./files/index.js";
9
11
  export * from "./invites/client/requests/index.js";
10
12
  export * as invites from "./invites/index.js";
11
13
  export * from "./jobs/client/requests/index.js";
@@ -17,6 +19,10 @@ export * from "./operators/client/requests/index.js";
17
19
  export * as operators from "./operators/index.js";
18
20
  export * from "./organizations/client/requests/index.js";
19
21
  export * as organizations from "./organizations/index.js";
22
+ export * from "./positions/client/requests/index.js";
23
+ export * as positions from "./positions/index.js";
20
24
  export * as realtime from "./realtime/index.js";
25
+ export * from "./taskAttempts/client/requests/index.js";
26
+ export * as taskAttempts from "./taskAttempts/index.js";
21
27
  export * from "./users/client/requests/index.js";
22
28
  export * as users from "./users/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.users = exports.realtime = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.jobs = exports.invites = exports.assignments = exports.assets = exports.activity = exports.activeOrganization = void 0;
39
+ exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.jobs = exports.invites = exports.files = exports.assignments = exports.assets = exports.activity = exports.activeOrganization = void 0;
40
40
  __exportStar(require("./activeOrganization/client/requests/index.js"), exports);
41
41
  exports.activeOrganization = __importStar(require("./activeOrganization/index.js"));
42
42
  __exportStar(require("./activity/client/requests/index.js"), exports);
@@ -45,6 +45,8 @@ __exportStar(require("./assets/client/requests/index.js"), exports);
45
45
  exports.assets = __importStar(require("./assets/index.js"));
46
46
  __exportStar(require("./assignments/client/requests/index.js"), exports);
47
47
  exports.assignments = __importStar(require("./assignments/index.js"));
48
+ __exportStar(require("./files/client/requests/index.js"), exports);
49
+ exports.files = __importStar(require("./files/index.js"));
48
50
  __exportStar(require("./invites/client/requests/index.js"), exports);
49
51
  exports.invites = __importStar(require("./invites/index.js"));
50
52
  __exportStar(require("./jobs/client/requests/index.js"), exports);
@@ -56,6 +58,10 @@ __exportStar(require("./operators/client/requests/index.js"), exports);
56
58
  exports.operators = __importStar(require("./operators/index.js"));
57
59
  __exportStar(require("./organizations/client/requests/index.js"), exports);
58
60
  exports.organizations = __importStar(require("./organizations/index.js"));
61
+ __exportStar(require("./positions/client/requests/index.js"), exports);
62
+ exports.positions = __importStar(require("./positions/index.js"));
59
63
  exports.realtime = __importStar(require("./realtime/index.js"));
64
+ __exportStar(require("./taskAttempts/client/requests/index.js"), exports);
65
+ exports.taskAttempts = __importStar(require("./taskAttempts/index.js"));
60
66
  __exportStar(require("./users/client/requests/index.js"), exports);
61
67
  exports.users = __importStar(require("./users/index.js"));
@@ -0,0 +1,73 @@
1
+ import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
2
+ import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
3
+ import * as core from "../../../../core/index.js";
4
+ import * as NizamDashboard from "../../../index.js";
5
+ export declare namespace PositionsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ export declare class PositionsClient {
11
+ protected readonly _options: NormalizedClientOptionsWithAuth<PositionsClient.Options>;
12
+ constructor(options: PositionsClient.Options);
13
+ /**
14
+ * Keyset-paginated track over a required [start, end) device-time window (max 31 days — the window drives partition pruning). Optionally narrowed to one operator.
15
+ *
16
+ * @param {NizamDashboard.ListPositionsRequest} request
17
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
18
+ *
19
+ * @throws {@link NizamDashboard.BadRequestError}
20
+ * @throws {@link NizamDashboard.UnauthorizedError}
21
+ * @throws {@link NizamDashboard.ForbiddenError}
22
+ * @throws {@link NizamDashboard.TooManyRequestsError}
23
+ * @throws {@link NizamDashboard.InternalServerError}
24
+ *
25
+ * @example
26
+ * await client.positions.listPositions({
27
+ * operator_id: "00000000-0000-0000-0000-000000000000",
28
+ * start: "2026-05-20T14:00:00Z",
29
+ * end: "2026-05-20T14:00:00Z",
30
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
31
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
32
+ * })
33
+ */
34
+ listPositions(request: NizamDashboard.ListPositionsRequest, requestOptions?: PositionsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponsePosition>;
35
+ private __listPositions;
36
+ /**
37
+ * Live snapshot for initial map load and STOMP-reconnect reconciliation. Served from the Redis hot cache (positions fresher than ~60s); a cold cache falls back to the most recent recorded position per operator over the last 15 minutes. Unpaginated by design: the result is bounded by the fleet's currently-reporting operators.
38
+ *
39
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
40
+ *
41
+ * @throws {@link NizamDashboard.BadRequestError}
42
+ * @throws {@link NizamDashboard.UnauthorizedError}
43
+ * @throws {@link NizamDashboard.ForbiddenError}
44
+ * @throws {@link NizamDashboard.TooManyRequestsError}
45
+ * @throws {@link NizamDashboard.InternalServerError}
46
+ *
47
+ * @example
48
+ * await client.positions.listCurrentPositions()
49
+ */
50
+ listCurrentPositions(requestOptions?: PositionsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseOperatorPosition>;
51
+ private __listCurrentPositions;
52
+ /**
53
+ * Counts recorded positions per H3 hex cell (resolution 9 ≈ 150 m or 11 ≈ 24 m) inside a `bbox` viewport over a device-time window (default: the last 24 hours). Cells are returned as hex strings — H3 indexes exceed the JavaScript safe-integer range. Unpaginated: bounded by the viewport's cell cover (max 4096 cells).
54
+ *
55
+ * @param {NizamDashboard.GetPositionsHeatmapRequest} request
56
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link NizamDashboard.BadRequestError}
59
+ * @throws {@link NizamDashboard.UnauthorizedError}
60
+ * @throws {@link NizamDashboard.ForbiddenError}
61
+ * @throws {@link NizamDashboard.TooManyRequestsError}
62
+ * @throws {@link NizamDashboard.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.positions.getPositionsHeatmap({
66
+ * bbox: "<string>",
67
+ * start: "2026-05-20T14:00:00Z",
68
+ * end: "2026-05-20T14:00:00Z"
69
+ * })
70
+ */
71
+ getPositionsHeatmap(request: NizamDashboard.GetPositionsHeatmapRequest, requestOptions?: PositionsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseHeatmapCell>;
72
+ private __getPositionsHeatmap;
73
+ }
@@ -0,0 +1,266 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.PositionsClient = void 0;
38
+ const BaseClient_js_1 = require("../../../../BaseClient.js");
39
+ const headers_js_1 = require("../../../../core/headers.js");
40
+ const core = __importStar(require("../../../../core/index.js"));
41
+ const environments = __importStar(require("../../../../environments.js"));
42
+ const handleNonStatusCodeError_js_1 = require("../../../../errors/handleNonStatusCodeError.js");
43
+ const errors = __importStar(require("../../../../errors/index.js"));
44
+ const NizamDashboard = __importStar(require("../../../index.js"));
45
+ class PositionsClient {
46
+ constructor(options) {
47
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
48
+ }
49
+ /**
50
+ * Keyset-paginated track over a required [start, end) device-time window (max 31 days — the window drives partition pruning). Optionally narrowed to one operator.
51
+ *
52
+ * @param {NizamDashboard.ListPositionsRequest} request
53
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
54
+ *
55
+ * @throws {@link NizamDashboard.BadRequestError}
56
+ * @throws {@link NizamDashboard.UnauthorizedError}
57
+ * @throws {@link NizamDashboard.ForbiddenError}
58
+ * @throws {@link NizamDashboard.TooManyRequestsError}
59
+ * @throws {@link NizamDashboard.InternalServerError}
60
+ *
61
+ * @example
62
+ * await client.positions.listPositions({
63
+ * operator_id: "00000000-0000-0000-0000-000000000000",
64
+ * start: "2026-05-20T14:00:00Z",
65
+ * end: "2026-05-20T14:00:00Z",
66
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
67
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
68
+ * })
69
+ */
70
+ listPositions(request, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__listPositions(request, requestOptions));
72
+ }
73
+ async __listPositions(request, requestOptions) {
74
+ const { operator_id: operatorId, start, end, limit, starting_after: startingAfter, ending_before: endingBefore, } = request;
75
+ const _queryParams = {
76
+ operator_id: operatorId,
77
+ start,
78
+ end,
79
+ limit,
80
+ starting_after: startingAfter,
81
+ ending_before: endingBefore,
82
+ };
83
+ const _authRequest = await this._options.authProvider.getAuthRequest();
84
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
85
+ const _response = await core.fetcher({
86
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
87
+ (await core.Supplier.get(this._options.environment)) ??
88
+ environments.NizamDashboardEnvironment.Production, "v1/fleet/positions"),
89
+ method: "GET",
90
+ headers: _headers,
91
+ queryString: core.url
92
+ .queryBuilder()
93
+ .addMany(_queryParams)
94
+ .mergeAdditional(requestOptions?.queryParams)
95
+ .build(),
96
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
97
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
98
+ abortSignal: requestOptions?.abortSignal,
99
+ fetchFn: this._options?.fetch,
100
+ logging: this._options.logging,
101
+ });
102
+ if (_response.ok) {
103
+ return { data: _response.body, rawResponse: _response.rawResponse };
104
+ }
105
+ if (_response.error.reason === "status-code") {
106
+ switch (_response.error.statusCode) {
107
+ case 400:
108
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
109
+ case 401:
110
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
111
+ case 403:
112
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
113
+ case 429:
114
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
115
+ case 500:
116
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
117
+ default:
118
+ throw new errors.NizamDashboardError({
119
+ statusCode: _response.error.statusCode,
120
+ body: _response.error.body,
121
+ rawResponse: _response.rawResponse,
122
+ });
123
+ }
124
+ }
125
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/fleet/positions");
126
+ }
127
+ /**
128
+ * Live snapshot for initial map load and STOMP-reconnect reconciliation. Served from the Redis hot cache (positions fresher than ~60s); a cold cache falls back to the most recent recorded position per operator over the last 15 minutes. Unpaginated by design: the result is bounded by the fleet's currently-reporting operators.
129
+ *
130
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
131
+ *
132
+ * @throws {@link NizamDashboard.BadRequestError}
133
+ * @throws {@link NizamDashboard.UnauthorizedError}
134
+ * @throws {@link NizamDashboard.ForbiddenError}
135
+ * @throws {@link NizamDashboard.TooManyRequestsError}
136
+ * @throws {@link NizamDashboard.InternalServerError}
137
+ *
138
+ * @example
139
+ * await client.positions.listCurrentPositions()
140
+ */
141
+ listCurrentPositions(requestOptions) {
142
+ return core.HttpResponsePromise.fromPromise(this.__listCurrentPositions(requestOptions));
143
+ }
144
+ async __listCurrentPositions(requestOptions) {
145
+ const _authRequest = await this._options.authProvider.getAuthRequest();
146
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
147
+ const _response = await core.fetcher({
148
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
149
+ (await core.Supplier.get(this._options.environment)) ??
150
+ environments.NizamDashboardEnvironment.Production, "v1/fleet/positions/current"),
151
+ method: "GET",
152
+ headers: _headers,
153
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
154
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
155
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
156
+ abortSignal: requestOptions?.abortSignal,
157
+ fetchFn: this._options?.fetch,
158
+ logging: this._options.logging,
159
+ });
160
+ if (_response.ok) {
161
+ return {
162
+ data: _response.body,
163
+ rawResponse: _response.rawResponse,
164
+ };
165
+ }
166
+ if (_response.error.reason === "status-code") {
167
+ switch (_response.error.statusCode) {
168
+ case 400:
169
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
170
+ case 401:
171
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
172
+ case 403:
173
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
174
+ case 429:
175
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
176
+ case 500:
177
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
178
+ default:
179
+ throw new errors.NizamDashboardError({
180
+ statusCode: _response.error.statusCode,
181
+ body: _response.error.body,
182
+ rawResponse: _response.rawResponse,
183
+ });
184
+ }
185
+ }
186
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/fleet/positions/current");
187
+ }
188
+ /**
189
+ * Counts recorded positions per H3 hex cell (resolution 9 ≈ 150 m or 11 ≈ 24 m) inside a `bbox` viewport over a device-time window (default: the last 24 hours). Cells are returned as hex strings — H3 indexes exceed the JavaScript safe-integer range. Unpaginated: bounded by the viewport's cell cover (max 4096 cells).
190
+ *
191
+ * @param {NizamDashboard.GetPositionsHeatmapRequest} request
192
+ * @param {PositionsClient.RequestOptions} requestOptions - Request-specific configuration.
193
+ *
194
+ * @throws {@link NizamDashboard.BadRequestError}
195
+ * @throws {@link NizamDashboard.UnauthorizedError}
196
+ * @throws {@link NizamDashboard.ForbiddenError}
197
+ * @throws {@link NizamDashboard.TooManyRequestsError}
198
+ * @throws {@link NizamDashboard.InternalServerError}
199
+ *
200
+ * @example
201
+ * await client.positions.getPositionsHeatmap({
202
+ * bbox: "<string>",
203
+ * start: "2026-05-20T14:00:00Z",
204
+ * end: "2026-05-20T14:00:00Z"
205
+ * })
206
+ */
207
+ getPositionsHeatmap(request, requestOptions) {
208
+ return core.HttpResponsePromise.fromPromise(this.__getPositionsHeatmap(request, requestOptions));
209
+ }
210
+ async __getPositionsHeatmap(request, requestOptions) {
211
+ const { h3_res: h3Res, bbox, start, end } = request;
212
+ const _queryParams = {
213
+ h3_res: h3Res,
214
+ bbox,
215
+ start: start != null ? start : undefined,
216
+ end: end != null ? end : undefined,
217
+ };
218
+ const _authRequest = await this._options.authProvider.getAuthRequest();
219
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
220
+ const _response = await core.fetcher({
221
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
222
+ (await core.Supplier.get(this._options.environment)) ??
223
+ environments.NizamDashboardEnvironment.Production, "v1/fleet/positions/heatmap"),
224
+ method: "GET",
225
+ headers: _headers,
226
+ queryString: core.url
227
+ .queryBuilder()
228
+ .addMany(_queryParams)
229
+ .mergeAdditional(requestOptions?.queryParams)
230
+ .build(),
231
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
232
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
233
+ abortSignal: requestOptions?.abortSignal,
234
+ fetchFn: this._options?.fetch,
235
+ logging: this._options.logging,
236
+ });
237
+ if (_response.ok) {
238
+ return {
239
+ data: _response.body,
240
+ rawResponse: _response.rawResponse,
241
+ };
242
+ }
243
+ if (_response.error.reason === "status-code") {
244
+ switch (_response.error.statusCode) {
245
+ case 400:
246
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
247
+ case 401:
248
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
249
+ case 403:
250
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
251
+ case 429:
252
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
253
+ case 500:
254
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
255
+ default:
256
+ throw new errors.NizamDashboardError({
257
+ statusCode: _response.error.statusCode,
258
+ body: _response.error.body,
259
+ rawResponse: _response.rawResponse,
260
+ });
261
+ }
262
+ }
263
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/fleet/positions/heatmap");
264
+ }
265
+ }
266
+ exports.PositionsClient = PositionsClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * bbox: "<string>",
5
+ * start: "2026-05-20T14:00:00Z",
6
+ * end: "2026-05-20T14:00:00Z"
7
+ * }
8
+ */
9
+ export interface GetPositionsHeatmapRequest {
10
+ h3_res?: number;
11
+ bbox: string;
12
+ start?: string;
13
+ end?: string;
14
+ }