@nizam-os/carrier-sdk 2.7.0 → 2.7.2

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.
@@ -48,7 +48,7 @@ class BadRequestError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "BadRequestError";
52
52
  }
53
53
  }
54
54
  exports.BadRequestError = BadRequestError;
@@ -48,7 +48,7 @@ class ConflictError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "ConflictError";
52
52
  }
53
53
  }
54
54
  exports.ConflictError = ConflictError;
@@ -48,7 +48,7 @@ class ContentTooLargeError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "ContentTooLargeError";
52
52
  }
53
53
  }
54
54
  exports.ContentTooLargeError = ContentTooLargeError;
@@ -48,7 +48,7 @@ class ForbiddenError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "ForbiddenError";
52
52
  }
53
53
  }
54
54
  exports.ForbiddenError = ForbiddenError;
@@ -48,7 +48,7 @@ class GoneError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "GoneError";
52
52
  }
53
53
  }
54
54
  exports.GoneError = GoneError;
@@ -48,7 +48,7 @@ class InternalServerError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "InternalServerError";
52
52
  }
53
53
  }
54
54
  exports.InternalServerError = InternalServerError;
@@ -48,7 +48,7 @@ class NotFoundError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "NotFoundError";
52
52
  }
53
53
  }
54
54
  exports.NotFoundError = NotFoundError;
@@ -48,7 +48,7 @@ class TooManyRequestsError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "TooManyRequestsError";
52
52
  }
53
53
  }
54
54
  exports.TooManyRequestsError = TooManyRequestsError;
@@ -48,7 +48,7 @@ class UnauthorizedError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "UnauthorizedError";
52
52
  }
53
53
  }
54
54
  exports.UnauthorizedError = UnauthorizedError;
@@ -48,7 +48,7 @@ class UnprocessableEntityError extends errors.NizamCarrierError {
48
48
  if (Error.captureStackTrace) {
49
49
  Error.captureStackTrace(this, this.constructor);
50
50
  }
51
- this.name = this.constructor.name;
51
+ this.name = "UnprocessableEntityError";
52
52
  }
53
53
  }
54
54
  exports.UnprocessableEntityError = UnprocessableEntityError;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Initiates a bulk import: the import kind plus the source file's upload declaration. Returns a job handle and a presigned upload session.
3
+ */
4
+ export interface CreateImportRequest {
5
+ /** The import kind to run (lowercase). */
6
+ kind: string;
7
+ /** Original filename of the source file. */
8
+ filename: string;
9
+ /** Declared MIME type (must be allowed for import sources). */
10
+ content_type: string;
11
+ /** Declared byte size of the file. */
12
+ size_bytes?: number | undefined;
13
+ /** Client-computed SHA-256 of the file, 64 lowercase hex characters. */
14
+ checksum_sha256?: string | undefined;
15
+ }
@@ -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,22 @@
1
+ /**
2
+ * One validation error against one import row: the row number, the offending field (null for a whole-row error), the stable code/message and the raw value.
3
+ */
4
+ export interface ImportError {
5
+ /** The 1-based data-row index that failed (header excluded). */
6
+ row_number?: number | undefined;
7
+ /** The offending column header, or null for a whole-row error. */
8
+ field?: string | undefined;
9
+ /** Stable machine-readable error code. */
10
+ error_code?: string | undefined;
11
+ /** Human-readable explanation of the error. */
12
+ error_message?: string | undefined;
13
+ /** The raw cell value that failed (truncated), when relevant. */
14
+ raw_value?: string | undefined;
15
+ object?: ImportError.Object_ | undefined;
16
+ }
17
+ export declare namespace ImportError {
18
+ const Object_: {
19
+ readonly ImportError: "import_error";
20
+ };
21
+ type Object_ = (typeof Object_)[keyof typeof Object_];
22
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImportError = void 0;
5
+ var ImportError;
6
+ (function (ImportError) {
7
+ ImportError.Object_ = {
8
+ ImportError: "import_error",
9
+ };
10
+ })(ImportError || (exports.ImportError = ImportError = {}));
@@ -0,0 +1,18 @@
1
+ import type * as NizamCarrier from "../index.js";
2
+ /**
3
+ * Acknowledgement that an import was submitted: the job handle, the reserved source-file id, and the presigned upload session to push the file's bytes through.
4
+ */
5
+ export interface ImportSubmission {
6
+ /** The created import job — poll/cancel it via /v1/jobs/{id}. */
7
+ job_id?: string | undefined;
8
+ /** The id the uploaded source file will carry. */
9
+ file_id?: string | undefined;
10
+ upload?: NizamCarrier.FileUploadSession | undefined;
11
+ object?: ImportSubmission.Object_ | undefined;
12
+ }
13
+ export declare namespace ImportSubmission {
14
+ const Object_: {
15
+ readonly ImportSubmission: "import_submission";
16
+ };
17
+ type Object_ = (typeof Object_)[keyof typeof Object_];
18
+ }
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ImportSubmission = void 0;
5
+ var ImportSubmission;
6
+ (function (ImportSubmission) {
7
+ ImportSubmission.Object_ = {
8
+ ImportSubmission: "import_submission",
9
+ };
10
+ })(ImportSubmission || (exports.ImportSubmission = ImportSubmission = {}));
@@ -12,10 +12,10 @@ export interface Job {
12
12
  status?: Job.Status | undefined;
13
13
  /** User who submitted the job. Null only if that user was since deleted. */
14
14
  requested_by_id?: string | undefined;
15
- /** Input handle the job consumes (kind-specific), e.g. an uploaded import file. */
16
- source_uri?: string | undefined;
17
- /** Artifact produced by a completed job (kind-specific), e.g. a result report. */
18
- report_uri?: string | undefined;
15
+ /** File the job consumes (kind-specific), e.g. an uploaded import file. References a file id; download via the file's own endpoint. */
16
+ source_file_id?: string | undefined;
17
+ /** Artifact file produced by the job (kind-specific), e.g. an import's annotated result report. Present on a completed job, or a cancelled one that produced a partial report. */
18
+ report_file_id?: string | undefined;
19
19
  /** Total work items, once the engine has sized the work. Null while unknown. */
20
20
  rows_total?: number | undefined;
21
21
  /** Work items processed so far (monotonic). */
@@ -49,6 +49,7 @@ export declare namespace Job {
49
49
  readonly ServiceAccountApiKeyRegeneration: "service_account_api_key_regeneration";
50
50
  readonly FileVirusScan: "file_virus_scan";
51
51
  readonly FileThumbnailGeneration: "file_thumbnail_generation";
52
+ readonly ImportFleetAssetsXlsx: "import_fleet_assets_xlsx";
52
53
  };
53
54
  type Kind = (typeof Kind)[keyof typeof Kind];
54
55
  /** Lifecycle status. Terminal states are `completed`, `failed`, `cancelled`. */
@@ -10,6 +10,7 @@ var Job;
10
10
  ServiceAccountApiKeyRegeneration: "service_account_api_key_regeneration",
11
11
  FileVirusScan: "file_virus_scan",
12
12
  FileThumbnailGeneration: "file_thumbnail_generation",
13
+ ImportFleetAssetsXlsx: "import_fleet_assets_xlsx",
13
14
  };
14
15
  /** Lifecycle status. Terminal states are `completed`, `failed`, `cancelled`. */
15
16
  Job.Status = {
@@ -11,6 +11,7 @@ export * from "./Country.js";
11
11
  export * from "./CreateAssetRequest.js";
12
12
  export * from "./CreateAutonomousOperatorRequest.js";
13
13
  export * from "./CreateHumanOperatorRequest.js";
14
+ export * from "./CreateImportRequest.js";
14
15
  export * from "./CreateInviteRequest.js";
15
16
  export * from "./CreateOperatorRequest.js";
16
17
  export * from "./CreateOrganizationRequest.js";
@@ -22,6 +23,8 @@ export * from "./FileUploadPart.js";
22
23
  export * from "./FileUploadPartReport.js";
23
24
  export * from "./FileUploadSession.js";
24
25
  export * from "./HeatmapCell.js";
26
+ export * from "./ImportError.js";
27
+ export * from "./ImportSubmission.js";
25
28
  export * from "./InternalUserUpdateRequest.js";
26
29
  export * from "./Invite.js";
27
30
  export * from "./InviteUserRequest.js";
@@ -27,6 +27,7 @@ __exportStar(require("./Country.js"), exports);
27
27
  __exportStar(require("./CreateAssetRequest.js"), exports);
28
28
  __exportStar(require("./CreateAutonomousOperatorRequest.js"), exports);
29
29
  __exportStar(require("./CreateHumanOperatorRequest.js"), exports);
30
+ __exportStar(require("./CreateImportRequest.js"), exports);
30
31
  __exportStar(require("./CreateInviteRequest.js"), exports);
31
32
  __exportStar(require("./CreateOperatorRequest.js"), exports);
32
33
  __exportStar(require("./CreateOrganizationRequest.js"), exports);
@@ -38,6 +39,8 @@ __exportStar(require("./FileUploadPart.js"), exports);
38
39
  __exportStar(require("./FileUploadPartReport.js"), exports);
39
40
  __exportStar(require("./FileUploadSession.js"), exports);
40
41
  __exportStar(require("./HeatmapCell.js"), exports);
42
+ __exportStar(require("./ImportError.js"), exports);
43
+ __exportStar(require("./ImportSubmission.js"), exports);
41
44
  __exportStar(require("./InternalUserUpdateRequest.js"), exports);
42
45
  __exportStar(require("./Invite.js"), exports);
43
46
  __exportStar(require("./InviteUserRequest.js"), exports);
@@ -10,7 +10,7 @@ class NizamCarrierError extends Error {
10
10
  if (Error.captureStackTrace) {
11
11
  Error.captureStackTrace(this, this.constructor);
12
12
  }
13
- this.name = this.constructor.name;
13
+ this.name = "NizamCarrierError";
14
14
  this.statusCode = statusCode;
15
15
  this.body = body;
16
16
  this.rawResponse = rawResponse;
@@ -9,7 +9,7 @@ class NizamCarrierTimeoutError extends Error {
9
9
  if (Error.captureStackTrace) {
10
10
  Error.captureStackTrace(this, this.constructor);
11
11
  }
12
- this.name = this.constructor.name;
12
+ this.name = "NizamCarrierTimeoutError";
13
13
  if (opts?.cause != null) {
14
14
  this.cause = opts.cause;
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizam-os/carrier-sdk",
3
- "version": "2.7.0",
3
+ "version": "2.7.2",
4
4
  "description": "Nizam Carrier API SDK for TypeScript / JavaScript.",
5
5
  "license": "MIT",
6
6
  "private": false,