@nizam-os/carrier-sdk 2.5.2 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Client.d.ts +6 -0
- package/dist/Client.js +16 -8
- package/dist/api/errors/BadRequestError.d.ts +6 -0
- package/dist/api/errors/BadRequestError.js +54 -0
- package/dist/api/errors/ContentTooLargeError.d.ts +6 -0
- package/dist/api/errors/ContentTooLargeError.js +54 -0
- package/dist/api/errors/index.d.ts +2 -0
- package/dist/api/errors/index.js +2 -0
- package/dist/api/resources/files/client/Client.d.ts +188 -0
- package/dist/api/resources/files/client/Client.js +608 -0
- package/dist/api/resources/files/client/index.d.ts +1 -0
- package/dist/api/resources/files/client/index.js +17 -0
- package/dist/api/resources/files/client/requests/CancelFileUploadRequest.d.ts +9 -0
- package/dist/api/resources/files/client/requests/CancelFileUploadRequest.js +3 -0
- package/dist/api/resources/files/client/requests/CompleteFileUploadRequest.d.ts +15 -0
- package/dist/api/resources/files/client/requests/CompleteFileUploadRequest.js +3 -0
- package/dist/api/resources/files/client/requests/CreateFileDownloadUrlRequest.d.ts +9 -0
- package/dist/api/resources/files/client/requests/CreateFileDownloadUrlRequest.js +3 -0
- package/dist/api/resources/files/client/requests/DeleteFileRequest.d.ts +9 -0
- package/dist/api/resources/files/client/requests/DeleteFileRequest.js +3 -0
- package/dist/api/resources/files/client/requests/GetFileRequest.d.ts +9 -0
- package/dist/api/resources/files/client/requests/GetFileRequest.js +3 -0
- package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.d.ts +41 -0
- package/dist/api/resources/files/client/requests/InitiateFileUploadRequest.js +17 -0
- package/dist/api/resources/files/client/requests/ListFilesRequest.d.ts +27 -0
- package/dist/api/resources/files/client/requests/ListFilesRequest.js +3 -0
- package/dist/api/resources/files/client/requests/ResumeFileUploadRequest.d.ts +9 -0
- package/dist/api/resources/files/client/requests/ResumeFileUploadRequest.js +3 -0
- package/dist/api/resources/files/client/requests/index.d.ts +8 -0
- package/dist/api/resources/files/client/requests/index.js +5 -0
- package/dist/api/resources/files/exports.d.ts +2 -0
- package/dist/api/resources/files/exports.js +21 -0
- package/dist/api/resources/files/index.d.ts +1 -0
- package/dist/api/resources/files/index.js +17 -0
- package/dist/api/resources/index.d.ts +5 -0
- package/dist/api/resources/index.js +6 -1
- package/dist/api/resources/taskAttempts/client/Client.d.ts +65 -0
- package/dist/api/resources/taskAttempts/client/Client.js +208 -0
- package/dist/api/resources/taskAttempts/client/index.d.ts +1 -0
- package/dist/api/resources/taskAttempts/client/index.js +17 -0
- package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.d.ts +49 -0
- package/dist/api/resources/taskAttempts/client/requests/CaptureTaskAttemptPhotoRequest.js +20 -0
- package/dist/api/resources/taskAttempts/client/requests/ListTaskAttemptPhotosRequest.d.ts +17 -0
- package/dist/api/resources/taskAttempts/client/requests/ListTaskAttemptPhotosRequest.js +3 -0
- package/dist/api/resources/taskAttempts/client/requests/index.d.ts +2 -0
- package/dist/api/resources/taskAttempts/client/requests/index.js +5 -0
- package/dist/api/resources/taskAttempts/exports.d.ts +2 -0
- package/dist/api/resources/taskAttempts/exports.js +21 -0
- package/dist/api/resources/taskAttempts/index.d.ts +1 -0
- package/dist/api/resources/taskAttempts/index.js +17 -0
- package/dist/api/resources/users/client/Client.d.ts +43 -0
- package/dist/api/resources/users/client/Client.js +142 -0
- package/dist/api/resources/users/client/index.d.ts +1 -1
- package/dist/api/resources/users/client/index.js +15 -0
- package/dist/api/resources/users/client/requests/GetUserProfilePictureRequest.d.ts +11 -0
- package/dist/api/resources/users/client/requests/GetUserProfilePictureRequest.js +3 -0
- package/dist/api/resources/users/client/requests/InitiateProfilePictureUploadRequest.d.ts +19 -0
- package/dist/api/resources/users/client/requests/InitiateProfilePictureUploadRequest.js +3 -0
- package/dist/api/resources/users/client/requests/index.d.ts +2 -0
- package/dist/api/resources/users/client/requests/index.js +2 -0
- package/dist/api/types/FileDownloadUrl.d.ts +16 -0
- package/dist/api/types/FileDownloadUrl.js +10 -0
- package/dist/api/types/FileUploadPart.d.ts +13 -0
- package/dist/api/types/FileUploadPart.js +3 -0
- package/dist/api/types/FileUploadPartReport.d.ts +9 -0
- package/dist/api/types/FileUploadPartReport.js +3 -0
- package/dist/api/types/FileUploadSession.d.ts +51 -0
- package/dist/api/types/FileUploadSession.js +28 -0
- package/dist/api/types/File_.d.ts +86 -0
- package/dist/api/types/File_.js +40 -0
- package/dist/api/types/HeatmapCell.d.ts +18 -0
- package/dist/api/types/HeatmapCell.js +10 -0
- package/dist/api/types/Job.d.ts +2 -0
- package/dist/api/types/Job.js +2 -0
- package/dist/api/types/ListResponseFile.d.ts +27 -0
- package/dist/api/types/ListResponseFile.js +11 -0
- package/dist/api/types/ListResponseHeatmapCell.d.ts +27 -0
- package/dist/api/types/ListResponseHeatmapCell.js +11 -0
- package/dist/api/types/ListResponseOperatorPosition.d.ts +27 -0
- package/dist/api/types/ListResponseOperatorPosition.js +11 -0
- package/dist/api/types/ListResponsePosition.d.ts +27 -0
- package/dist/api/types/ListResponsePosition.js +11 -0
- package/dist/api/types/MqttToken.d.ts +12 -0
- package/dist/api/types/MqttToken.js +3 -0
- package/dist/api/types/OperatorPosition.d.ts +28 -0
- package/dist/api/types/OperatorPosition.js +10 -0
- package/dist/api/types/Position.d.ts +30 -0
- package/dist/api/types/Position.js +10 -0
- package/dist/api/types/TaskAttemptPhoto.d.ts +30 -0
- package/dist/api/types/TaskAttemptPhoto.js +10 -0
- package/dist/api/types/TaskAttemptPhotoThumbnail.d.ts +9 -0
- package/dist/api/types/TaskAttemptPhotoThumbnail.js +3 -0
- package/dist/api/types/UploadInitiation.d.ts +22 -0
- package/dist/api/types/UploadInitiation.js +10 -0
- package/dist/api/types/UploadInitiationPart.d.ts +13 -0
- package/dist/api/types/UploadInitiationPart.js +3 -0
- package/dist/api/types/index.d.ts +17 -0
- package/dist/api/types/index.js +17 -0
- package/package.json +1 -1
|
@@ -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,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,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);
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
export * from "./files/client/requests/index.js";
|
|
2
|
+
export * as files from "./files/index.js";
|
|
1
3
|
export * from "./invites/client/requests/index.js";
|
|
2
4
|
export * as invites from "./invites/index.js";
|
|
3
5
|
export * as lookups from "./lookups/index.js";
|
|
4
6
|
export * as realtime from "./realtime/index.js";
|
|
7
|
+
export * from "./taskAttempts/client/requests/index.js";
|
|
8
|
+
export * as taskAttempts from "./taskAttempts/index.js";
|
|
9
|
+
export * from "./users/client/requests/index.js";
|
|
5
10
|
export * as users from "./users/index.js";
|
|
@@ -36,9 +36,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.users = exports.realtime = exports.lookups = exports.invites = void 0;
|
|
39
|
+
exports.users = exports.taskAttempts = exports.realtime = exports.lookups = exports.invites = exports.files = void 0;
|
|
40
|
+
__exportStar(require("./files/client/requests/index.js"), exports);
|
|
41
|
+
exports.files = __importStar(require("./files/index.js"));
|
|
40
42
|
__exportStar(require("./invites/client/requests/index.js"), exports);
|
|
41
43
|
exports.invites = __importStar(require("./invites/index.js"));
|
|
42
44
|
exports.lookups = __importStar(require("./lookups/index.js"));
|
|
43
45
|
exports.realtime = __importStar(require("./realtime/index.js"));
|
|
46
|
+
__exportStar(require("./taskAttempts/client/requests/index.js"), exports);
|
|
47
|
+
exports.taskAttempts = __importStar(require("./taskAttempts/index.js"));
|
|
48
|
+
__exportStar(require("./users/client/requests/index.js"), exports);
|
|
44
49
|
exports.users = __importStar(require("./users/index.js"));
|
|
@@ -0,0 +1,65 @@
|
|
|
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 NizamCarrier from "../../../index.js";
|
|
5
|
+
export declare namespace TaskAttemptsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class TaskAttemptsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<TaskAttemptsClient.Options>;
|
|
12
|
+
constructor(options: TaskAttemptsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* The attempt's photos in capture order, each with its scan-gated downloadability and rendered thumbnail variants. Bytes are requested per file via the generic download-URL endpoint (access-logged for this kind).
|
|
15
|
+
*
|
|
16
|
+
* @param {NizamCarrier.ListTaskAttemptPhotosRequest} request
|
|
17
|
+
* @param {TaskAttemptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link NizamCarrier.BadRequestError}
|
|
20
|
+
* @throws {@link NizamCarrier.UnauthorizedError}
|
|
21
|
+
* @throws {@link NizamCarrier.ForbiddenError}
|
|
22
|
+
* @throws {@link NizamCarrier.NotFoundError}
|
|
23
|
+
* @throws {@link NizamCarrier.TooManyRequestsError}
|
|
24
|
+
* @throws {@link NizamCarrier.InternalServerError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.taskAttempts.listTaskAttemptPhotos({
|
|
28
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
29
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
30
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
31
|
+
* })
|
|
32
|
+
*/
|
|
33
|
+
listTaskAttemptPhotos(request: NizamCarrier.ListTaskAttemptPhotosRequest, requestOptions?: TaskAttemptsClient.RequestOptions): core.HttpResponsePromise<NizamCarrier.TaskAttemptPhoto>;
|
|
34
|
+
private __listTaskAttemptPhotos;
|
|
35
|
+
/**
|
|
36
|
+
* Declares a proof-of-delivery photo upload for the attempt and returns presigned part URLs. PUT the bytes, then complete via the generic file-uploads endpoint — completion records the photo (with the capture facts declared here) atomically and queues the malware scan; the photo becomes downloadable only after a CLEAN verdict.
|
|
37
|
+
*
|
|
38
|
+
* @param {NizamCarrier.CaptureTaskAttemptPhotoRequest} request
|
|
39
|
+
* @param {TaskAttemptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
|
+
*
|
|
41
|
+
* @throws {@link NizamCarrier.BadRequestError}
|
|
42
|
+
* @throws {@link NizamCarrier.UnauthorizedError}
|
|
43
|
+
* @throws {@link NizamCarrier.ForbiddenError}
|
|
44
|
+
* @throws {@link NizamCarrier.NotFoundError}
|
|
45
|
+
* @throws {@link NizamCarrier.ContentTooLargeError}
|
|
46
|
+
* @throws {@link NizamCarrier.UnprocessableEntityError}
|
|
47
|
+
* @throws {@link NizamCarrier.TooManyRequestsError}
|
|
48
|
+
* @throws {@link NizamCarrier.InternalServerError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.taskAttempts.captureTaskAttemptPhoto({
|
|
52
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
53
|
+
* filename: "delivery-door.jpg",
|
|
54
|
+
* content_type: "image/jpeg",
|
|
55
|
+
* size_bytes: 2048576,
|
|
56
|
+
* checksum_sha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
57
|
+
* sequence: 0,
|
|
58
|
+
* photo_type: "placement",
|
|
59
|
+
* caption: "Left at the front door as instructed",
|
|
60
|
+
* taken_at: "2026-06-12T09:41:00Z"
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
captureTaskAttemptPhoto(request: NizamCarrier.CaptureTaskAttemptPhotoRequest, requestOptions?: TaskAttemptsClient.RequestOptions): core.HttpResponsePromise<NizamCarrier.UploadInitiation>;
|
|
64
|
+
private __captureTaskAttemptPhoto;
|
|
65
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
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.TaskAttemptsClient = 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 NizamCarrier = __importStar(require("../../../index.js"));
|
|
45
|
+
class TaskAttemptsClient {
|
|
46
|
+
constructor(options) {
|
|
47
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The attempt's photos in capture order, each with its scan-gated downloadability and rendered thumbnail variants. Bytes are requested per file via the generic download-URL endpoint (access-logged for this kind).
|
|
51
|
+
*
|
|
52
|
+
* @param {NizamCarrier.ListTaskAttemptPhotosRequest} request
|
|
53
|
+
* @param {TaskAttemptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
|
+
*
|
|
55
|
+
* @throws {@link NizamCarrier.BadRequestError}
|
|
56
|
+
* @throws {@link NizamCarrier.UnauthorizedError}
|
|
57
|
+
* @throws {@link NizamCarrier.ForbiddenError}
|
|
58
|
+
* @throws {@link NizamCarrier.NotFoundError}
|
|
59
|
+
* @throws {@link NizamCarrier.TooManyRequestsError}
|
|
60
|
+
* @throws {@link NizamCarrier.InternalServerError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.taskAttempts.listTaskAttemptPhotos({
|
|
64
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
65
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
66
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
67
|
+
* })
|
|
68
|
+
*/
|
|
69
|
+
listTaskAttemptPhotos(request, requestOptions) {
|
|
70
|
+
return core.HttpResponsePromise.fromPromise(this.__listTaskAttemptPhotos(request, requestOptions));
|
|
71
|
+
}
|
|
72
|
+
async __listTaskAttemptPhotos(request, requestOptions) {
|
|
73
|
+
const { attemptId, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
|
|
74
|
+
const _queryParams = {
|
|
75
|
+
limit,
|
|
76
|
+
starting_after: startingAfter,
|
|
77
|
+
ending_before: endingBefore,
|
|
78
|
+
};
|
|
79
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
80
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
81
|
+
const _response = await core.fetcher({
|
|
82
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
83
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
84
|
+
environments.NizamCarrierEnvironment.Production, `v1/task-attempts/${core.url.encodePathParam(attemptId)}/photos`),
|
|
85
|
+
method: "GET",
|
|
86
|
+
headers: _headers,
|
|
87
|
+
queryString: core.url
|
|
88
|
+
.queryBuilder()
|
|
89
|
+
.addMany(_queryParams)
|
|
90
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
91
|
+
.build(),
|
|
92
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
93
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
94
|
+
abortSignal: requestOptions?.abortSignal,
|
|
95
|
+
fetchFn: this._options?.fetch,
|
|
96
|
+
logging: this._options.logging,
|
|
97
|
+
});
|
|
98
|
+
if (_response.ok) {
|
|
99
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
100
|
+
}
|
|
101
|
+
if (_response.error.reason === "status-code") {
|
|
102
|
+
switch (_response.error.statusCode) {
|
|
103
|
+
case 400:
|
|
104
|
+
throw new NizamCarrier.BadRequestError(_response.error.body, _response.rawResponse);
|
|
105
|
+
case 401:
|
|
106
|
+
throw new NizamCarrier.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
107
|
+
case 403:
|
|
108
|
+
throw new NizamCarrier.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
109
|
+
case 404:
|
|
110
|
+
throw new NizamCarrier.NotFoundError(_response.error.body, _response.rawResponse);
|
|
111
|
+
case 429:
|
|
112
|
+
throw new NizamCarrier.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
113
|
+
case 500:
|
|
114
|
+
throw new NizamCarrier.InternalServerError(_response.error.body, _response.rawResponse);
|
|
115
|
+
default:
|
|
116
|
+
throw new errors.NizamCarrierError({
|
|
117
|
+
statusCode: _response.error.statusCode,
|
|
118
|
+
body: _response.error.body,
|
|
119
|
+
rawResponse: _response.rawResponse,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/task-attempts/{attemptId}/photos");
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Declares a proof-of-delivery photo upload for the attempt and returns presigned part URLs. PUT the bytes, then complete via the generic file-uploads endpoint — completion records the photo (with the capture facts declared here) atomically and queues the malware scan; the photo becomes downloadable only after a CLEAN verdict.
|
|
127
|
+
*
|
|
128
|
+
* @param {NizamCarrier.CaptureTaskAttemptPhotoRequest} request
|
|
129
|
+
* @param {TaskAttemptsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
130
|
+
*
|
|
131
|
+
* @throws {@link NizamCarrier.BadRequestError}
|
|
132
|
+
* @throws {@link NizamCarrier.UnauthorizedError}
|
|
133
|
+
* @throws {@link NizamCarrier.ForbiddenError}
|
|
134
|
+
* @throws {@link NizamCarrier.NotFoundError}
|
|
135
|
+
* @throws {@link NizamCarrier.ContentTooLargeError}
|
|
136
|
+
* @throws {@link NizamCarrier.UnprocessableEntityError}
|
|
137
|
+
* @throws {@link NizamCarrier.TooManyRequestsError}
|
|
138
|
+
* @throws {@link NizamCarrier.InternalServerError}
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* await client.taskAttempts.captureTaskAttemptPhoto({
|
|
142
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
143
|
+
* filename: "delivery-door.jpg",
|
|
144
|
+
* content_type: "image/jpeg",
|
|
145
|
+
* size_bytes: 2048576,
|
|
146
|
+
* checksum_sha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
147
|
+
* sequence: 0,
|
|
148
|
+
* photo_type: "placement",
|
|
149
|
+
* caption: "Left at the front door as instructed",
|
|
150
|
+
* taken_at: "2026-06-12T09:41:00Z"
|
|
151
|
+
* })
|
|
152
|
+
*/
|
|
153
|
+
captureTaskAttemptPhoto(request, requestOptions) {
|
|
154
|
+
return core.HttpResponsePromise.fromPromise(this.__captureTaskAttemptPhoto(request, requestOptions));
|
|
155
|
+
}
|
|
156
|
+
async __captureTaskAttemptPhoto(request, requestOptions) {
|
|
157
|
+
const { attemptId, ..._body } = request;
|
|
158
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
159
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
160
|
+
const _response = await core.fetcher({
|
|
161
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
162
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
163
|
+
environments.NizamCarrierEnvironment.Production, `v1/task-attempts/${core.url.encodePathParam(attemptId)}/photos`),
|
|
164
|
+
method: "POST",
|
|
165
|
+
headers: _headers,
|
|
166
|
+
contentType: "application/json",
|
|
167
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
168
|
+
requestType: "json",
|
|
169
|
+
body: _body,
|
|
170
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
171
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
172
|
+
abortSignal: requestOptions?.abortSignal,
|
|
173
|
+
fetchFn: this._options?.fetch,
|
|
174
|
+
logging: this._options.logging,
|
|
175
|
+
});
|
|
176
|
+
if (_response.ok) {
|
|
177
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
178
|
+
}
|
|
179
|
+
if (_response.error.reason === "status-code") {
|
|
180
|
+
switch (_response.error.statusCode) {
|
|
181
|
+
case 400:
|
|
182
|
+
throw new NizamCarrier.BadRequestError(_response.error.body, _response.rawResponse);
|
|
183
|
+
case 401:
|
|
184
|
+
throw new NizamCarrier.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 403:
|
|
186
|
+
throw new NizamCarrier.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
187
|
+
case 404:
|
|
188
|
+
throw new NizamCarrier.NotFoundError(_response.error.body, _response.rawResponse);
|
|
189
|
+
case 413:
|
|
190
|
+
throw new NizamCarrier.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
191
|
+
case 422:
|
|
192
|
+
throw new NizamCarrier.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
193
|
+
case 429:
|
|
194
|
+
throw new NizamCarrier.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
195
|
+
case 500:
|
|
196
|
+
throw new NizamCarrier.InternalServerError(_response.error.body, _response.rawResponse);
|
|
197
|
+
default:
|
|
198
|
+
throw new errors.NizamCarrierError({
|
|
199
|
+
statusCode: _response.error.statusCode,
|
|
200
|
+
body: _response.error.body,
|
|
201
|
+
rawResponse: _response.rawResponse,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/task-attempts/{attemptId}/photos");
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
exports.TaskAttemptsClient = TaskAttemptsClient;
|
|
@@ -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,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
5
|
+
* filename: "delivery-door.jpg",
|
|
6
|
+
* content_type: "image/jpeg",
|
|
7
|
+
* size_bytes: 2048576,
|
|
8
|
+
* checksum_sha256: "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
|
|
9
|
+
* sequence: 0,
|
|
10
|
+
* photo_type: "placement",
|
|
11
|
+
* caption: "Left at the front door as instructed",
|
|
12
|
+
* taken_at: "2026-06-12T09:41:00Z"
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
export interface CaptureTaskAttemptPhotoRequest {
|
|
16
|
+
attemptId: string;
|
|
17
|
+
/** Original filename. */
|
|
18
|
+
filename: string;
|
|
19
|
+
/** Declared MIME type — POD photos accept image/jpeg, image/png, image/webp, image/heic, image/heif. */
|
|
20
|
+
content_type: string;
|
|
21
|
+
/** Exact byte size; verified against storage at completion. */
|
|
22
|
+
size_bytes?: number;
|
|
23
|
+
/** Client-computed SHA-256 of the content, lowercase hex; re-verified server-side by the pipeline. */
|
|
24
|
+
checksum_sha256: string;
|
|
25
|
+
/** Display order within the attempt; defaults to the next free slot. */
|
|
26
|
+
sequence?: number;
|
|
27
|
+
/** Photo category: `proof_of_delivery`, `placement`, `contents`, `damage`, `door`, `signature`, `id_verification`, `barcode`, `site_condition`, `other`. Omit for a free capture. */
|
|
28
|
+
photo_type?: CaptureTaskAttemptPhotoRequest.PhotoType;
|
|
29
|
+
/** Operator-entered caption. */
|
|
30
|
+
caption?: string;
|
|
31
|
+
/** Capture timestamp from the device (EXIF time) — distinct from the upload time, which may lag over flaky mobile connections. */
|
|
32
|
+
taken_at?: string;
|
|
33
|
+
}
|
|
34
|
+
export declare namespace CaptureTaskAttemptPhotoRequest {
|
|
35
|
+
/** Photo category: `proof_of_delivery`, `placement`, `contents`, `damage`, `door`, `signature`, `id_verification`, `barcode`, `site_condition`, `other`. Omit for a free capture. */
|
|
36
|
+
const PhotoType: {
|
|
37
|
+
readonly ProofOfDelivery: "proof_of_delivery";
|
|
38
|
+
readonly Placement: "placement";
|
|
39
|
+
readonly Contents: "contents";
|
|
40
|
+
readonly Damage: "damage";
|
|
41
|
+
readonly Door: "door";
|
|
42
|
+
readonly Signature: "signature";
|
|
43
|
+
readonly IdVerification: "id_verification";
|
|
44
|
+
readonly Barcode: "barcode";
|
|
45
|
+
readonly SiteCondition: "site_condition";
|
|
46
|
+
readonly Other: "other";
|
|
47
|
+
};
|
|
48
|
+
type PhotoType = (typeof PhotoType)[keyof typeof PhotoType];
|
|
49
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CaptureTaskAttemptPhotoRequest = void 0;
|
|
5
|
+
var CaptureTaskAttemptPhotoRequest;
|
|
6
|
+
(function (CaptureTaskAttemptPhotoRequest) {
|
|
7
|
+
/** Photo category: `proof_of_delivery`, `placement`, `contents`, `damage`, `door`, `signature`, `id_verification`, `barcode`, `site_condition`, `other`. Omit for a free capture. */
|
|
8
|
+
CaptureTaskAttemptPhotoRequest.PhotoType = {
|
|
9
|
+
ProofOfDelivery: "proof_of_delivery",
|
|
10
|
+
Placement: "placement",
|
|
11
|
+
Contents: "contents",
|
|
12
|
+
Damage: "damage",
|
|
13
|
+
Door: "door",
|
|
14
|
+
Signature: "signature",
|
|
15
|
+
IdVerification: "id_verification",
|
|
16
|
+
Barcode: "barcode",
|
|
17
|
+
SiteCondition: "site_condition",
|
|
18
|
+
Other: "other",
|
|
19
|
+
};
|
|
20
|
+
})(CaptureTaskAttemptPhotoRequest || (exports.CaptureTaskAttemptPhotoRequest = CaptureTaskAttemptPhotoRequest = {}));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* attemptId: "00000000-0000-0000-0000-000000000000",
|
|
5
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
6
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ListTaskAttemptPhotosRequest {
|
|
10
|
+
attemptId: string;
|
|
11
|
+
/** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
|
|
12
|
+
limit?: number;
|
|
13
|
+
/** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
|
|
14
|
+
starting_after?: string;
|
|
15
|
+
/** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
|
|
16
|
+
ending_before?: string;
|
|
17
|
+
}
|