@nizam-os/dashboard-sdk 7.1.1 → 8.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.
- package/dist/Client.d.ts +3 -0
- package/dist/Client.js +24 -20
- package/dist/api/errors/BadRequestError.js +1 -1
- package/dist/api/errors/ConflictError.js +1 -1
- package/dist/api/errors/ContentTooLargeError.js +1 -1
- package/dist/api/errors/ForbiddenError.js +1 -1
- package/dist/api/errors/GoneError.js +1 -1
- package/dist/api/errors/InternalServerError.js +1 -1
- package/dist/api/errors/NotFoundError.js +1 -1
- package/dist/api/errors/TooManyRequestsError.js +1 -1
- package/dist/api/errors/UnauthorizedError.js +1 -1
- package/dist/api/errors/UnprocessableEntityError.js +1 -1
- package/dist/api/resources/assets/client/Client.d.ts +10 -0
- package/dist/api/resources/assets/client/Client.js +51 -0
- package/dist/api/resources/imports/client/Client.d.ts +79 -0
- package/dist/api/resources/imports/client/Client.js +262 -0
- package/dist/api/resources/imports/client/index.d.ts +1 -0
- package/dist/api/resources/imports/client/index.js +17 -0
- package/dist/api/resources/imports/client/requests/CreateImportReportUrlRequest.d.ts +9 -0
- package/dist/api/resources/imports/client/requests/CreateImportReportUrlRequest.js +3 -0
- package/dist/api/resources/imports/client/requests/CreateImportRequest.d.ts +22 -0
- package/dist/api/resources/imports/client/requests/CreateImportRequest.js +3 -0
- package/dist/api/resources/imports/client/requests/ListImportErrorsRequest.d.ts +17 -0
- package/dist/api/resources/imports/client/requests/ListImportErrorsRequest.js +3 -0
- package/dist/api/resources/imports/client/requests/index.d.ts +3 -0
- package/dist/api/resources/imports/client/requests/index.js +2 -0
- package/dist/api/resources/imports/exports.d.ts +2 -0
- package/dist/api/resources/imports/exports.js +21 -0
- package/dist/api/resources/imports/index.d.ts +1 -0
- package/dist/api/resources/imports/index.js +17 -0
- package/dist/api/resources/index.d.ts +2 -0
- package/dist/api/resources/index.js +3 -1
- package/dist/api/types/ImportError.d.ts +22 -0
- package/dist/api/types/ImportError.js +10 -0
- package/dist/api/types/ImportSubmission.d.ts +18 -0
- package/dist/api/types/ImportSubmission.js +10 -0
- package/dist/api/types/Job.d.ts +5 -4
- package/dist/api/types/Job.js +1 -0
- package/dist/api/types/index.d.ts +2 -0
- package/dist/api/types/index.js +2 -0
- package/dist/errors/NizamDashboardError.js +1 -1
- package/dist/errors/NizamDashboardTimeoutError.js +1 -1
- package/package.json +1 -1
package/dist/Client.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ActivityClient } from "./api/resources/activity/client/Client.js";
|
|
|
3
3
|
import { AssetsClient } from "./api/resources/assets/client/Client.js";
|
|
4
4
|
import { AssignmentsClient } from "./api/resources/assignments/client/Client.js";
|
|
5
5
|
import { FilesClient } from "./api/resources/files/client/Client.js";
|
|
6
|
+
import { ImportsClient } from "./api/resources/imports/client/Client.js";
|
|
6
7
|
import { InvitesClient } from "./api/resources/invites/client/Client.js";
|
|
7
8
|
import { JobsClient } from "./api/resources/jobs/client/Client.js";
|
|
8
9
|
import { LookupsClient } from "./api/resources/lookups/client/Client.js";
|
|
@@ -28,6 +29,7 @@ export declare class NizamDashboardClient {
|
|
|
28
29
|
protected _assignments: AssignmentsClient | undefined;
|
|
29
30
|
protected _files: FilesClient | undefined;
|
|
30
31
|
protected _positions: PositionsClient | undefined;
|
|
32
|
+
protected _imports: ImportsClient | undefined;
|
|
31
33
|
protected _invites: InvitesClient | undefined;
|
|
32
34
|
protected _jobs: JobsClient | undefined;
|
|
33
35
|
protected _lookups: LookupsClient | undefined;
|
|
@@ -44,6 +46,7 @@ export declare class NizamDashboardClient {
|
|
|
44
46
|
get assignments(): AssignmentsClient;
|
|
45
47
|
get files(): FilesClient;
|
|
46
48
|
get positions(): PositionsClient;
|
|
49
|
+
get imports(): ImportsClient;
|
|
47
50
|
get invites(): InvitesClient;
|
|
48
51
|
get jobs(): JobsClient;
|
|
49
52
|
get lookups(): LookupsClient;
|
package/dist/Client.js
CHANGED
|
@@ -40,16 +40,17 @@ const Client_js_2 = require("./api/resources/activity/client/Client.js");
|
|
|
40
40
|
const Client_js_3 = require("./api/resources/assets/client/Client.js");
|
|
41
41
|
const Client_js_4 = require("./api/resources/assignments/client/Client.js");
|
|
42
42
|
const Client_js_5 = require("./api/resources/files/client/Client.js");
|
|
43
|
-
const Client_js_6 = require("./api/resources/
|
|
44
|
-
const Client_js_7 = require("./api/resources/
|
|
45
|
-
const Client_js_8 = require("./api/resources/
|
|
46
|
-
const Client_js_9 = require("./api/resources/
|
|
47
|
-
const Client_js_10 = require("./api/resources/
|
|
48
|
-
const Client_js_11 = require("./api/resources/
|
|
49
|
-
const Client_js_12 = require("./api/resources/
|
|
50
|
-
const Client_js_13 = require("./api/resources/
|
|
51
|
-
const Client_js_14 = require("./api/resources/
|
|
52
|
-
const Client_js_15 = require("./api/resources/
|
|
43
|
+
const Client_js_6 = require("./api/resources/imports/client/Client.js");
|
|
44
|
+
const Client_js_7 = require("./api/resources/invites/client/Client.js");
|
|
45
|
+
const Client_js_8 = require("./api/resources/jobs/client/Client.js");
|
|
46
|
+
const Client_js_9 = require("./api/resources/lookups/client/Client.js");
|
|
47
|
+
const Client_js_10 = require("./api/resources/memberships/client/Client.js");
|
|
48
|
+
const Client_js_11 = require("./api/resources/operators/client/Client.js");
|
|
49
|
+
const Client_js_12 = require("./api/resources/organizations/client/Client.js");
|
|
50
|
+
const Client_js_13 = require("./api/resources/positions/client/Client.js");
|
|
51
|
+
const Client_js_14 = require("./api/resources/realtime/client/Client.js");
|
|
52
|
+
const Client_js_15 = require("./api/resources/taskAttempts/client/Client.js");
|
|
53
|
+
const Client_js_16 = require("./api/resources/users/client/Client.js");
|
|
53
54
|
const BaseClient_js_1 = require("./BaseClient.js");
|
|
54
55
|
const core = __importStar(require("./core/index.js"));
|
|
55
56
|
class NizamDashboardClient {
|
|
@@ -69,37 +70,40 @@ class NizamDashboardClient {
|
|
|
69
70
|
return (this._files ?? (this._files = new Client_js_5.FilesClient(this._options)));
|
|
70
71
|
}
|
|
71
72
|
get positions() {
|
|
72
|
-
return (this._positions ?? (this._positions = new
|
|
73
|
+
return (this._positions ?? (this._positions = new Client_js_13.PositionsClient(this._options)));
|
|
74
|
+
}
|
|
75
|
+
get imports() {
|
|
76
|
+
return (this._imports ?? (this._imports = new Client_js_6.ImportsClient(this._options)));
|
|
73
77
|
}
|
|
74
78
|
get invites() {
|
|
75
|
-
return (this._invites ?? (this._invites = new
|
|
79
|
+
return (this._invites ?? (this._invites = new Client_js_7.InvitesClient(this._options)));
|
|
76
80
|
}
|
|
77
81
|
get jobs() {
|
|
78
|
-
return (this._jobs ?? (this._jobs = new
|
|
82
|
+
return (this._jobs ?? (this._jobs = new Client_js_8.JobsClient(this._options)));
|
|
79
83
|
}
|
|
80
84
|
get lookups() {
|
|
81
|
-
return (this._lookups ?? (this._lookups = new
|
|
85
|
+
return (this._lookups ?? (this._lookups = new Client_js_9.LookupsClient(this._options)));
|
|
82
86
|
}
|
|
83
87
|
get users() {
|
|
84
|
-
return (this._users ?? (this._users = new
|
|
88
|
+
return (this._users ?? (this._users = new Client_js_16.UsersClient(this._options)));
|
|
85
89
|
}
|
|
86
90
|
get activeOrganization() {
|
|
87
91
|
return (this._activeOrganization ?? (this._activeOrganization = new Client_js_1.ActiveOrganizationClient(this._options)));
|
|
88
92
|
}
|
|
89
93
|
get memberships() {
|
|
90
|
-
return (this._memberships ?? (this._memberships = new
|
|
94
|
+
return (this._memberships ?? (this._memberships = new Client_js_10.MembershipsClient(this._options)));
|
|
91
95
|
}
|
|
92
96
|
get operators() {
|
|
93
|
-
return (this._operators ?? (this._operators = new
|
|
97
|
+
return (this._operators ?? (this._operators = new Client_js_11.OperatorsClient(this._options)));
|
|
94
98
|
}
|
|
95
99
|
get organizations() {
|
|
96
|
-
return (this._organizations ?? (this._organizations = new
|
|
100
|
+
return (this._organizations ?? (this._organizations = new Client_js_12.OrganizationsClient(this._options)));
|
|
97
101
|
}
|
|
98
102
|
get realtime() {
|
|
99
|
-
return (this._realtime ?? (this._realtime = new
|
|
103
|
+
return (this._realtime ?? (this._realtime = new Client_js_14.RealtimeClient(this._options)));
|
|
100
104
|
}
|
|
101
105
|
get taskAttempts() {
|
|
102
|
-
return (this._taskAttempts ?? (this._taskAttempts = new
|
|
106
|
+
return (this._taskAttempts ?? (this._taskAttempts = new Client_js_15.TaskAttemptsClient(this._options)));
|
|
103
107
|
}
|
|
104
108
|
/**
|
|
105
109
|
* Make a passthrough request using the SDK's configured auth, retry, logging, etc.
|
|
@@ -48,7 +48,7 @@ class BadRequestError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "BadRequestError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.BadRequestError = BadRequestError;
|
|
@@ -48,7 +48,7 @@ class ConflictError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "ConflictError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.ConflictError = ConflictError;
|
|
@@ -48,7 +48,7 @@ class ContentTooLargeError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "ContentTooLargeError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.ContentTooLargeError = ContentTooLargeError;
|
|
@@ -48,7 +48,7 @@ class ForbiddenError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "ForbiddenError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.ForbiddenError = ForbiddenError;
|
|
@@ -48,7 +48,7 @@ class InternalServerError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "InternalServerError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.InternalServerError = InternalServerError;
|
|
@@ -48,7 +48,7 @@ class NotFoundError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "NotFoundError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.NotFoundError = NotFoundError;
|
|
@@ -48,7 +48,7 @@ class TooManyRequestsError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "TooManyRequestsError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.TooManyRequestsError = TooManyRequestsError;
|
|
@@ -48,7 +48,7 @@ class UnauthorizedError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "UnauthorizedError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.UnauthorizedError = UnauthorizedError;
|
|
@@ -48,7 +48,7 @@ class UnprocessableEntityError extends errors.NizamDashboardError {
|
|
|
48
48
|
if (Error.captureStackTrace) {
|
|
49
49
|
Error.captureStackTrace(this, this.constructor);
|
|
50
50
|
}
|
|
51
|
-
this.name =
|
|
51
|
+
this.name = "UnprocessableEntityError";
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
exports.UnprocessableEntityError = UnprocessableEntityError;
|
|
@@ -75,6 +75,16 @@ export declare class AssetsClient {
|
|
|
75
75
|
*/
|
|
76
76
|
createAsset(request: NizamDashboard.CreateAssetRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Asset>;
|
|
77
77
|
private __createAsset;
|
|
78
|
+
/**
|
|
79
|
+
* Returns a correctly-shaped XLSX template (header row + one example row) for the bulk asset import. Fill it in and upload it via POST /v1/imports to import assets in bulk.
|
|
80
|
+
*
|
|
81
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
82
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
83
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
84
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
85
|
+
*/
|
|
86
|
+
getAssetImportTemplate(requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
|
|
87
|
+
private __getAssetImportTemplate;
|
|
78
88
|
/**
|
|
79
89
|
* @param {NizamDashboard.GetAssetRequest} request
|
|
80
90
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -218,6 +218,57 @@ class AssetsClient {
|
|
|
218
218
|
}
|
|
219
219
|
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/assets");
|
|
220
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Returns a correctly-shaped XLSX template (header row + one example row) for the bulk asset import. Fill it in and upload it via POST /v1/imports to import assets in bulk.
|
|
223
|
+
*
|
|
224
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
225
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
226
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
227
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
228
|
+
*/
|
|
229
|
+
getAssetImportTemplate(requestOptions) {
|
|
230
|
+
return core.HttpResponsePromise.fromPromise(this.__getAssetImportTemplate(requestOptions));
|
|
231
|
+
}
|
|
232
|
+
async __getAssetImportTemplate(requestOptions) {
|
|
233
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
234
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
235
|
+
const _response = await core.fetcher({
|
|
236
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
237
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
238
|
+
environments.NizamDashboardEnvironment.Production, "v1/assets/imports/template"),
|
|
239
|
+
method: "GET",
|
|
240
|
+
headers: _headers,
|
|
241
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
242
|
+
responseType: "binary-response",
|
|
243
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
244
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
245
|
+
abortSignal: requestOptions?.abortSignal,
|
|
246
|
+
fetchFn: this._options?.fetch,
|
|
247
|
+
logging: this._options.logging,
|
|
248
|
+
});
|
|
249
|
+
if (_response.ok) {
|
|
250
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
251
|
+
}
|
|
252
|
+
if (_response.error.reason === "status-code") {
|
|
253
|
+
switch (_response.error.statusCode) {
|
|
254
|
+
case 401:
|
|
255
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
256
|
+
case 403:
|
|
257
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
258
|
+
case 429:
|
|
259
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
260
|
+
case 500:
|
|
261
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
262
|
+
default:
|
|
263
|
+
throw new errors.NizamDashboardError({
|
|
264
|
+
statusCode: _response.error.statusCode,
|
|
265
|
+
body: _response.error.body,
|
|
266
|
+
rawResponse: _response.rawResponse,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/assets/imports/template");
|
|
271
|
+
}
|
|
221
272
|
/**
|
|
222
273
|
* @param {NizamDashboard.GetAssetRequest} request
|
|
223
274
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -0,0 +1,79 @@
|
|
|
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 ImportsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class ImportsClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<ImportsClient.Options>;
|
|
12
|
+
constructor(options: ImportsClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Creates a PENDING import job and a presigned upload session for the source file. Upload the file's bytes directly to the returned session, then complete it — the import starts automatically once the file is scanned and ready. Returns 202 with the job handle (poll/cancel via `GET`/`POST /v1/jobs/{id}`), the reserved file id, and the upload session. Rate-limited per organization; rejected with 429 + `Retry-After` when the hourly budget or the concurrent-imports cap is hit.
|
|
15
|
+
*
|
|
16
|
+
* @param {NizamDashboard.CreateImportRequest} request
|
|
17
|
+
* @param {ImportsClient.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.ContentTooLargeError}
|
|
23
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
24
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
25
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await client.imports.createImport({
|
|
29
|
+
* kind: "import_fleet_assets_xlsx",
|
|
30
|
+
* filename: "fleet-assets.xlsx",
|
|
31
|
+
* content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
32
|
+
* size_bytes: 524288,
|
|
33
|
+
* checksum_sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
|
34
|
+
* })
|
|
35
|
+
*/
|
|
36
|
+
createImport(request: NizamDashboard.CreateImportRequest, requestOptions?: ImportsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ImportSubmission>;
|
|
37
|
+
private __createImport;
|
|
38
|
+
/**
|
|
39
|
+
* The validation errors accumulated for one import, in (row_number, id) ascending order — the natural reading order of the source file. Keyset-paginated (`starting_after` / `ending_before`); no sort parameter. Org-scoped (RLS).
|
|
40
|
+
*
|
|
41
|
+
* @param {NizamDashboard.ListImportErrorsRequest} request
|
|
42
|
+
* @param {ImportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
45
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
46
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
47
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
48
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.imports.listImportErrors({
|
|
52
|
+
* jobId: "00000000-0000-0000-0000-000000000000",
|
|
53
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
54
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
55
|
+
* })
|
|
56
|
+
*/
|
|
57
|
+
listImportErrors(request: NizamDashboard.ListImportErrorsRequest, requestOptions?: ImportsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ImportError>;
|
|
58
|
+
private __listImportErrors;
|
|
59
|
+
/**
|
|
60
|
+
* Authorizes the caller (org membership + the import-report kind policy) and issues a short-lived URL for the annotated result report (original columns + an `_errors` column). 409 if the import produced no report (still running, or finished with no errors). POST because issuing a grant is an audited action, not a cacheable read.
|
|
61
|
+
*
|
|
62
|
+
* @param {NizamDashboard.CreateImportReportUrlRequest} request
|
|
63
|
+
* @param {ImportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
64
|
+
*
|
|
65
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
66
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
67
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
68
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
69
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
70
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* await client.imports.createImportReportUrl({
|
|
74
|
+
* jobId: "00000000-0000-0000-0000-000000000000"
|
|
75
|
+
* })
|
|
76
|
+
*/
|
|
77
|
+
createImportReportUrl(request: NizamDashboard.CreateImportReportUrlRequest, requestOptions?: ImportsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.FileDownloadUrl>;
|
|
78
|
+
private __createImportReportUrl;
|
|
79
|
+
}
|
|
@@ -0,0 +1,262 @@
|
|
|
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.ImportsClient = 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 ImportsClient {
|
|
46
|
+
constructor(options) {
|
|
47
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Creates a PENDING import job and a presigned upload session for the source file. Upload the file's bytes directly to the returned session, then complete it — the import starts automatically once the file is scanned and ready. Returns 202 with the job handle (poll/cancel via `GET`/`POST /v1/jobs/{id}`), the reserved file id, and the upload session. Rate-limited per organization; rejected with 429 + `Retry-After` when the hourly budget or the concurrent-imports cap is hit.
|
|
51
|
+
*
|
|
52
|
+
* @param {NizamDashboard.CreateImportRequest} request
|
|
53
|
+
* @param {ImportsClient.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.ContentTooLargeError}
|
|
59
|
+
* @throws {@link NizamDashboard.UnprocessableEntityError}
|
|
60
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
61
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* await client.imports.createImport({
|
|
65
|
+
* kind: "import_fleet_assets_xlsx",
|
|
66
|
+
* filename: "fleet-assets.xlsx",
|
|
67
|
+
* content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
68
|
+
* size_bytes: 524288,
|
|
69
|
+
* checksum_sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
|
70
|
+
* })
|
|
71
|
+
*/
|
|
72
|
+
createImport(request, requestOptions) {
|
|
73
|
+
return core.HttpResponsePromise.fromPromise(this.__createImport(request, requestOptions));
|
|
74
|
+
}
|
|
75
|
+
async __createImport(request, requestOptions) {
|
|
76
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
77
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
78
|
+
const _response = await core.fetcher({
|
|
79
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
80
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
81
|
+
environments.NizamDashboardEnvironment.Production, "v1/imports"),
|
|
82
|
+
method: "POST",
|
|
83
|
+
headers: _headers,
|
|
84
|
+
contentType: "application/json",
|
|
85
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
86
|
+
requestType: "json",
|
|
87
|
+
body: request,
|
|
88
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
89
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
90
|
+
abortSignal: requestOptions?.abortSignal,
|
|
91
|
+
fetchFn: this._options?.fetch,
|
|
92
|
+
logging: this._options.logging,
|
|
93
|
+
});
|
|
94
|
+
if (_response.ok) {
|
|
95
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
96
|
+
}
|
|
97
|
+
if (_response.error.reason === "status-code") {
|
|
98
|
+
switch (_response.error.statusCode) {
|
|
99
|
+
case 400:
|
|
100
|
+
throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
|
|
101
|
+
case 401:
|
|
102
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
103
|
+
case 403:
|
|
104
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
105
|
+
case 413:
|
|
106
|
+
throw new NizamDashboard.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
107
|
+
case 422:
|
|
108
|
+
throw new NizamDashboard.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
109
|
+
case 429:
|
|
110
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
111
|
+
case 500:
|
|
112
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
113
|
+
default:
|
|
114
|
+
throw new errors.NizamDashboardError({
|
|
115
|
+
statusCode: _response.error.statusCode,
|
|
116
|
+
body: _response.error.body,
|
|
117
|
+
rawResponse: _response.rawResponse,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/imports");
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* The validation errors accumulated for one import, in (row_number, id) ascending order — the natural reading order of the source file. Keyset-paginated (`starting_after` / `ending_before`); no sort parameter. Org-scoped (RLS).
|
|
125
|
+
*
|
|
126
|
+
* @param {NizamDashboard.ListImportErrorsRequest} request
|
|
127
|
+
* @param {ImportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
|
+
*
|
|
129
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
130
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
131
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
132
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
133
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* await client.imports.listImportErrors({
|
|
137
|
+
* jobId: "00000000-0000-0000-0000-000000000000",
|
|
138
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
139
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
140
|
+
* })
|
|
141
|
+
*/
|
|
142
|
+
listImportErrors(request, requestOptions) {
|
|
143
|
+
return core.HttpResponsePromise.fromPromise(this.__listImportErrors(request, requestOptions));
|
|
144
|
+
}
|
|
145
|
+
async __listImportErrors(request, requestOptions) {
|
|
146
|
+
const { jobId, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
|
|
147
|
+
const _queryParams = {
|
|
148
|
+
limit,
|
|
149
|
+
starting_after: startingAfter,
|
|
150
|
+
ending_before: endingBefore,
|
|
151
|
+
};
|
|
152
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
153
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
154
|
+
const _response = await core.fetcher({
|
|
155
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
156
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
157
|
+
environments.NizamDashboardEnvironment.Production, `v1/imports/${core.url.encodePathParam(jobId)}/errors`),
|
|
158
|
+
method: "GET",
|
|
159
|
+
headers: _headers,
|
|
160
|
+
queryString: core.url
|
|
161
|
+
.queryBuilder()
|
|
162
|
+
.addMany(_queryParams)
|
|
163
|
+
.mergeAdditional(requestOptions?.queryParams)
|
|
164
|
+
.build(),
|
|
165
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
166
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
167
|
+
abortSignal: requestOptions?.abortSignal,
|
|
168
|
+
fetchFn: this._options?.fetch,
|
|
169
|
+
logging: this._options.logging,
|
|
170
|
+
});
|
|
171
|
+
if (_response.ok) {
|
|
172
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
173
|
+
}
|
|
174
|
+
if (_response.error.reason === "status-code") {
|
|
175
|
+
switch (_response.error.statusCode) {
|
|
176
|
+
case 401:
|
|
177
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
178
|
+
case 403:
|
|
179
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
180
|
+
case 404:
|
|
181
|
+
throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
|
|
182
|
+
case 429:
|
|
183
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
184
|
+
case 500:
|
|
185
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
186
|
+
default:
|
|
187
|
+
throw new errors.NizamDashboardError({
|
|
188
|
+
statusCode: _response.error.statusCode,
|
|
189
|
+
body: _response.error.body,
|
|
190
|
+
rawResponse: _response.rawResponse,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/imports/{jobId}/errors");
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Authorizes the caller (org membership + the import-report kind policy) and issues a short-lived URL for the annotated result report (original columns + an `_errors` column). 409 if the import produced no report (still running, or finished with no errors). POST because issuing a grant is an audited action, not a cacheable read.
|
|
198
|
+
*
|
|
199
|
+
* @param {NizamDashboard.CreateImportReportUrlRequest} request
|
|
200
|
+
* @param {ImportsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
201
|
+
*
|
|
202
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
203
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
204
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
205
|
+
* @throws {@link NizamDashboard.ConflictError}
|
|
206
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
207
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
208
|
+
*
|
|
209
|
+
* @example
|
|
210
|
+
* await client.imports.createImportReportUrl({
|
|
211
|
+
* jobId: "00000000-0000-0000-0000-000000000000"
|
|
212
|
+
* })
|
|
213
|
+
*/
|
|
214
|
+
createImportReportUrl(request, requestOptions) {
|
|
215
|
+
return core.HttpResponsePromise.fromPromise(this.__createImportReportUrl(request, requestOptions));
|
|
216
|
+
}
|
|
217
|
+
async __createImportReportUrl(request, requestOptions) {
|
|
218
|
+
const { jobId } = request;
|
|
219
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
220
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
|
|
221
|
+
const _response = await core.fetcher({
|
|
222
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
223
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
224
|
+
environments.NizamDashboardEnvironment.Production, `v1/imports/${core.url.encodePathParam(jobId)}/report-url`),
|
|
225
|
+
method: "POST",
|
|
226
|
+
headers: _headers,
|
|
227
|
+
queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
|
|
228
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
229
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
230
|
+
abortSignal: requestOptions?.abortSignal,
|
|
231
|
+
fetchFn: this._options?.fetch,
|
|
232
|
+
logging: this._options.logging,
|
|
233
|
+
});
|
|
234
|
+
if (_response.ok) {
|
|
235
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
236
|
+
}
|
|
237
|
+
if (_response.error.reason === "status-code") {
|
|
238
|
+
switch (_response.error.statusCode) {
|
|
239
|
+
case 401:
|
|
240
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
241
|
+
case 403:
|
|
242
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
243
|
+
case 404:
|
|
244
|
+
throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
|
|
245
|
+
case 409:
|
|
246
|
+
throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
|
|
247
|
+
case 429:
|
|
248
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
249
|
+
case 500:
|
|
250
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
251
|
+
default:
|
|
252
|
+
throw new errors.NizamDashboardError({
|
|
253
|
+
statusCode: _response.error.statusCode,
|
|
254
|
+
body: _response.error.body,
|
|
255
|
+
rawResponse: _response.rawResponse,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/imports/{jobId}/report-url");
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
exports.ImportsClient = ImportsClient;
|
|
@@ -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,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* kind: "import_fleet_assets_xlsx",
|
|
5
|
+
* filename: "fleet-assets.xlsx",
|
|
6
|
+
* content_type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
7
|
+
* size_bytes: 524288,
|
|
8
|
+
* checksum_sha256: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface CreateImportRequest {
|
|
12
|
+
/** The import kind to run (lowercase). */
|
|
13
|
+
kind: string;
|
|
14
|
+
/** Original filename of the source file. */
|
|
15
|
+
filename: string;
|
|
16
|
+
/** Declared MIME type (must be allowed for import sources). */
|
|
17
|
+
content_type: string;
|
|
18
|
+
/** Declared byte size of the file. */
|
|
19
|
+
size_bytes?: number;
|
|
20
|
+
/** Client-computed SHA-256 of the file, 64 lowercase hex characters. */
|
|
21
|
+
checksum_sha256?: string;
|
|
22
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* jobId: "00000000-0000-0000-0000-000000000000",
|
|
5
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
6
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
7
|
+
* }
|
|
8
|
+
*/
|
|
9
|
+
export interface ListImportErrorsRequest {
|
|
10
|
+
jobId: 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
|
+
}
|
|
@@ -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.ImportsClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "ImportsClient", { enumerable: true, get: function () { return Client_js_1.ImportsClient; } });
|
|
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);
|
|
@@ -8,6 +8,8 @@ export * from "./assignments/client/requests/index.js";
|
|
|
8
8
|
export * as assignments from "./assignments/index.js";
|
|
9
9
|
export * from "./files/client/requests/index.js";
|
|
10
10
|
export * as files from "./files/index.js";
|
|
11
|
+
export * from "./imports/client/requests/index.js";
|
|
12
|
+
export * as imports from "./imports/index.js";
|
|
11
13
|
export * from "./invites/client/requests/index.js";
|
|
12
14
|
export * as invites from "./invites/index.js";
|
|
13
15
|
export * from "./jobs/client/requests/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.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;
|
|
39
|
+
exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.jobs = exports.invites = exports.imports = 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);
|
|
@@ -47,6 +47,8 @@ __exportStar(require("./assignments/client/requests/index.js"), exports);
|
|
|
47
47
|
exports.assignments = __importStar(require("./assignments/index.js"));
|
|
48
48
|
__exportStar(require("./files/client/requests/index.js"), exports);
|
|
49
49
|
exports.files = __importStar(require("./files/index.js"));
|
|
50
|
+
__exportStar(require("./imports/client/requests/index.js"), exports);
|
|
51
|
+
exports.imports = __importStar(require("./imports/index.js"));
|
|
50
52
|
__exportStar(require("./invites/client/requests/index.js"), exports);
|
|
51
53
|
exports.invites = __importStar(require("./invites/index.js"));
|
|
52
54
|
__exportStar(require("./jobs/client/requests/index.js"), exports);
|
|
@@ -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 NizamDashboard 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?: NizamDashboard.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 = {}));
|
package/dist/api/types/Job.d.ts
CHANGED
|
@@ -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
|
-
/**
|
|
16
|
-
|
|
17
|
-
/** Artifact produced by
|
|
18
|
-
|
|
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`. */
|
package/dist/api/types/Job.js
CHANGED
|
@@ -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 = {
|
|
@@ -18,6 +18,8 @@ export * from "./FileUploadPart.js";
|
|
|
18
18
|
export * from "./FileUploadPartReport.js";
|
|
19
19
|
export * from "./FileUploadSession.js";
|
|
20
20
|
export * from "./HeatmapCell.js";
|
|
21
|
+
export * from "./ImportError.js";
|
|
22
|
+
export * from "./ImportSubmission.js";
|
|
21
23
|
export * from "./InternalUserUpdateRequest.js";
|
|
22
24
|
export * from "./Invite.js";
|
|
23
25
|
export * from "./Job.js";
|
package/dist/api/types/index.js
CHANGED
|
@@ -34,6 +34,8 @@ __exportStar(require("./FileUploadPart.js"), exports);
|
|
|
34
34
|
__exportStar(require("./FileUploadPartReport.js"), exports);
|
|
35
35
|
__exportStar(require("./FileUploadSession.js"), exports);
|
|
36
36
|
__exportStar(require("./HeatmapCell.js"), exports);
|
|
37
|
+
__exportStar(require("./ImportError.js"), exports);
|
|
38
|
+
__exportStar(require("./ImportSubmission.js"), exports);
|
|
37
39
|
__exportStar(require("./InternalUserUpdateRequest.js"), exports);
|
|
38
40
|
__exportStar(require("./Invite.js"), exports);
|
|
39
41
|
__exportStar(require("./Job.js"), exports);
|
|
@@ -10,7 +10,7 @@ class NizamDashboardError extends Error {
|
|
|
10
10
|
if (Error.captureStackTrace) {
|
|
11
11
|
Error.captureStackTrace(this, this.constructor);
|
|
12
12
|
}
|
|
13
|
-
this.name =
|
|
13
|
+
this.name = "NizamDashboardError";
|
|
14
14
|
this.statusCode = statusCode;
|
|
15
15
|
this.body = body;
|
|
16
16
|
this.rawResponse = rawResponse;
|
|
@@ -9,7 +9,7 @@ class NizamDashboardTimeoutError extends Error {
|
|
|
9
9
|
if (Error.captureStackTrace) {
|
|
10
10
|
Error.captureStackTrace(this, this.constructor);
|
|
11
11
|
}
|
|
12
|
-
this.name =
|
|
12
|
+
this.name = "NizamDashboardTimeoutError";
|
|
13
13
|
if (opts?.cause != null) {
|
|
14
14
|
this.cause = opts.cause;
|
|
15
15
|
}
|