@nizam-os/dashboard-sdk 6.3.0 → 6.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/Client.d.ts +6 -0
  2. package/dist/Client.js +20 -12
  3. package/dist/api/resources/index.d.ts +4 -0
  4. package/dist/api/resources/index.js +5 -1
  5. package/dist/api/resources/jobs/client/Client.d.ts +75 -0
  6. package/dist/api/resources/jobs/client/Client.js +255 -0
  7. package/dist/api/resources/jobs/client/index.d.ts +1 -0
  8. package/dist/api/resources/jobs/client/index.js +17 -0
  9. package/dist/api/resources/jobs/client/requests/CancelJobRequest.d.ts +9 -0
  10. package/dist/api/resources/jobs/client/requests/CancelJobRequest.js +3 -0
  11. package/dist/api/resources/jobs/client/requests/GetJobRequest.d.ts +9 -0
  12. package/dist/api/resources/jobs/client/requests/GetJobRequest.js +3 -0
  13. package/dist/api/resources/jobs/client/requests/ListJobsRequest.d.ts +21 -0
  14. package/dist/api/resources/jobs/client/requests/ListJobsRequest.js +3 -0
  15. package/dist/api/resources/jobs/client/requests/index.d.ts +3 -0
  16. package/dist/api/resources/jobs/client/requests/index.js +2 -0
  17. package/dist/api/resources/jobs/exports.d.ts +2 -0
  18. package/dist/api/resources/jobs/exports.js +21 -0
  19. package/dist/api/resources/jobs/index.d.ts +1 -0
  20. package/dist/api/resources/jobs/index.js +17 -0
  21. package/dist/api/resources/positions/client/Client.d.ts +73 -0
  22. package/dist/api/resources/positions/client/Client.js +266 -0
  23. package/dist/api/resources/positions/client/index.d.ts +1 -0
  24. package/dist/api/resources/positions/client/index.js +17 -0
  25. package/dist/api/resources/positions/client/requests/GetPositionsHeatmapRequest.d.ts +14 -0
  26. package/dist/api/resources/positions/client/requests/GetPositionsHeatmapRequest.js +3 -0
  27. package/dist/api/resources/positions/client/requests/ListPositionsRequest.d.ts +21 -0
  28. package/dist/api/resources/positions/client/requests/ListPositionsRequest.js +3 -0
  29. package/dist/api/resources/positions/client/requests/index.d.ts +2 -0
  30. package/dist/api/resources/positions/client/requests/index.js +2 -0
  31. package/dist/api/resources/positions/exports.d.ts +2 -0
  32. package/dist/api/resources/positions/exports.js +21 -0
  33. package/dist/api/resources/positions/index.d.ts +1 -0
  34. package/dist/api/resources/positions/index.js +17 -0
  35. package/dist/api/types/BulkJobSubmission.d.ts +15 -0
  36. package/dist/api/types/BulkJobSubmission.js +10 -0
  37. package/dist/api/types/HeatmapCell.d.ts +18 -0
  38. package/dist/api/types/HeatmapCell.js +10 -0
  39. package/dist/api/types/Job.d.ts +66 -0
  40. package/dist/api/types/Job.js +24 -0
  41. package/dist/api/types/JobSubmission.d.ts +14 -0
  42. package/dist/api/types/JobSubmission.js +10 -0
  43. package/dist/api/types/ListResponseHeatmapCell.d.ts +27 -0
  44. package/dist/api/types/ListResponseHeatmapCell.js +11 -0
  45. package/dist/api/types/ListResponseJob.d.ts +27 -0
  46. package/dist/api/types/ListResponseJob.js +11 -0
  47. package/dist/api/types/ListResponseOperatorPosition.d.ts +27 -0
  48. package/dist/api/types/ListResponseOperatorPosition.js +11 -0
  49. package/dist/api/types/ListResponsePosition.d.ts +27 -0
  50. package/dist/api/types/ListResponsePosition.js +11 -0
  51. package/dist/api/types/MqttToken.d.ts +12 -0
  52. package/dist/api/types/MqttToken.js +3 -0
  53. package/dist/api/types/OperatorPosition.d.ts +28 -0
  54. package/dist/api/types/OperatorPosition.js +10 -0
  55. package/dist/api/types/Position.d.ts +30 -0
  56. package/dist/api/types/Position.js +10 -0
  57. package/dist/api/types/index.d.ts +11 -0
  58. package/dist/api/types/index.js +11 -0
  59. package/package.json +1 -1
package/dist/Client.d.ts CHANGED
@@ -3,10 +3,12 @@ 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 { InvitesClient } from "./api/resources/invites/client/Client.js";
6
+ import { JobsClient } from "./api/resources/jobs/client/Client.js";
6
7
  import { LookupsClient } from "./api/resources/lookups/client/Client.js";
7
8
  import { MembershipsClient } from "./api/resources/memberships/client/Client.js";
8
9
  import { OperatorsClient } from "./api/resources/operators/client/Client.js";
9
10
  import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
11
+ import { PositionsClient } from "./api/resources/positions/client/Client.js";
10
12
  import { RealtimeClient } from "./api/resources/realtime/client/Client.js";
11
13
  import { UsersClient } from "./api/resources/users/client/Client.js";
12
14
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
@@ -22,7 +24,9 @@ export declare class NizamDashboardClient {
22
24
  protected _activity: ActivityClient | undefined;
23
25
  protected _assets: AssetsClient | undefined;
24
26
  protected _assignments: AssignmentsClient | undefined;
27
+ protected _positions: PositionsClient | undefined;
25
28
  protected _invites: InvitesClient | undefined;
29
+ protected _jobs: JobsClient | undefined;
26
30
  protected _lookups: LookupsClient | undefined;
27
31
  protected _users: UsersClient | undefined;
28
32
  protected _activeOrganization: ActiveOrganizationClient | undefined;
@@ -34,7 +38,9 @@ export declare class NizamDashboardClient {
34
38
  get activity(): ActivityClient;
35
39
  get assets(): AssetsClient;
36
40
  get assignments(): AssignmentsClient;
41
+ get positions(): PositionsClient;
37
42
  get invites(): InvitesClient;
43
+ get jobs(): JobsClient;
38
44
  get lookups(): LookupsClient;
39
45
  get users(): UsersClient;
40
46
  get activeOrganization(): ActiveOrganizationClient;
package/dist/Client.js CHANGED
@@ -40,12 +40,14 @@ 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/invites/client/Client.js");
43
- const Client_js_6 = require("./api/resources/lookups/client/Client.js");
44
- const Client_js_7 = require("./api/resources/memberships/client/Client.js");
45
- const Client_js_8 = require("./api/resources/operators/client/Client.js");
46
- const Client_js_9 = require("./api/resources/organizations/client/Client.js");
47
- const Client_js_10 = require("./api/resources/realtime/client/Client.js");
48
- const Client_js_11 = require("./api/resources/users/client/Client.js");
43
+ const Client_js_6 = require("./api/resources/jobs/client/Client.js");
44
+ const Client_js_7 = require("./api/resources/lookups/client/Client.js");
45
+ const Client_js_8 = require("./api/resources/memberships/client/Client.js");
46
+ const Client_js_9 = require("./api/resources/operators/client/Client.js");
47
+ const Client_js_10 = require("./api/resources/organizations/client/Client.js");
48
+ const Client_js_11 = require("./api/resources/positions/client/Client.js");
49
+ const Client_js_12 = require("./api/resources/realtime/client/Client.js");
50
+ const Client_js_13 = require("./api/resources/users/client/Client.js");
49
51
  const BaseClient_js_1 = require("./BaseClient.js");
50
52
  const core = __importStar(require("./core/index.js"));
51
53
  class NizamDashboardClient {
@@ -61,29 +63,35 @@ class NizamDashboardClient {
61
63
  get assignments() {
62
64
  return (this._assignments ?? (this._assignments = new Client_js_4.AssignmentsClient(this._options)));
63
65
  }
66
+ get positions() {
67
+ return (this._positions ?? (this._positions = new Client_js_11.PositionsClient(this._options)));
68
+ }
64
69
  get invites() {
65
70
  return (this._invites ?? (this._invites = new Client_js_5.InvitesClient(this._options)));
66
71
  }
72
+ get jobs() {
73
+ return (this._jobs ?? (this._jobs = new Client_js_6.JobsClient(this._options)));
74
+ }
67
75
  get lookups() {
68
- return (this._lookups ?? (this._lookups = new Client_js_6.LookupsClient(this._options)));
76
+ return (this._lookups ?? (this._lookups = new Client_js_7.LookupsClient(this._options)));
69
77
  }
70
78
  get users() {
71
- return (this._users ?? (this._users = new Client_js_11.UsersClient(this._options)));
79
+ return (this._users ?? (this._users = new Client_js_13.UsersClient(this._options)));
72
80
  }
73
81
  get activeOrganization() {
74
82
  return (this._activeOrganization ?? (this._activeOrganization = new Client_js_1.ActiveOrganizationClient(this._options)));
75
83
  }
76
84
  get memberships() {
77
- return (this._memberships ?? (this._memberships = new Client_js_7.MembershipsClient(this._options)));
85
+ return (this._memberships ?? (this._memberships = new Client_js_8.MembershipsClient(this._options)));
78
86
  }
79
87
  get operators() {
80
- return (this._operators ?? (this._operators = new Client_js_8.OperatorsClient(this._options)));
88
+ return (this._operators ?? (this._operators = new Client_js_9.OperatorsClient(this._options)));
81
89
  }
82
90
  get organizations() {
83
- return (this._organizations ?? (this._organizations = new Client_js_9.OrganizationsClient(this._options)));
91
+ return (this._organizations ?? (this._organizations = new Client_js_10.OrganizationsClient(this._options)));
84
92
  }
85
93
  get realtime() {
86
- return (this._realtime ?? (this._realtime = new Client_js_10.RealtimeClient(this._options)));
94
+ return (this._realtime ?? (this._realtime = new Client_js_12.RealtimeClient(this._options)));
87
95
  }
88
96
  /**
89
97
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -8,6 +8,8 @@ export * from "./assignments/client/requests/index.js";
8
8
  export * as assignments from "./assignments/index.js";
9
9
  export * from "./invites/client/requests/index.js";
10
10
  export * as invites from "./invites/index.js";
11
+ export * from "./jobs/client/requests/index.js";
12
+ export * as jobs from "./jobs/index.js";
11
13
  export * as lookups from "./lookups/index.js";
12
14
  export * from "./memberships/client/requests/index.js";
13
15
  export * as memberships from "./memberships/index.js";
@@ -15,6 +17,8 @@ export * from "./operators/client/requests/index.js";
15
17
  export * as operators from "./operators/index.js";
16
18
  export * from "./organizations/client/requests/index.js";
17
19
  export * as organizations from "./organizations/index.js";
20
+ export * from "./positions/client/requests/index.js";
21
+ export * as positions from "./positions/index.js";
18
22
  export * as realtime from "./realtime/index.js";
19
23
  export * from "./users/client/requests/index.js";
20
24
  export * as users from "./users/index.js";
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.users = exports.realtime = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.invites = exports.assignments = exports.assets = exports.activity = exports.activeOrganization = void 0;
39
+ exports.users = exports.realtime = exports.positions = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.jobs = exports.invites = 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("./invites/client/requests/index.js"), exports);
49
49
  exports.invites = __importStar(require("./invites/index.js"));
50
+ __exportStar(require("./jobs/client/requests/index.js"), exports);
51
+ exports.jobs = __importStar(require("./jobs/index.js"));
50
52
  exports.lookups = __importStar(require("./lookups/index.js"));
51
53
  __exportStar(require("./memberships/client/requests/index.js"), exports);
52
54
  exports.memberships = __importStar(require("./memberships/index.js"));
@@ -54,6 +56,8 @@ __exportStar(require("./operators/client/requests/index.js"), exports);
54
56
  exports.operators = __importStar(require("./operators/index.js"));
55
57
  __exportStar(require("./organizations/client/requests/index.js"), exports);
56
58
  exports.organizations = __importStar(require("./organizations/index.js"));
59
+ __exportStar(require("./positions/client/requests/index.js"), exports);
60
+ exports.positions = __importStar(require("./positions/index.js"));
57
61
  exports.realtime = __importStar(require("./realtime/index.js"));
58
62
  __exportStar(require("./users/client/requests/index.js"), exports);
59
63
  exports.users = __importStar(require("./users/index.js"));
@@ -0,0 +1,75 @@
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 JobsClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * Async jobs — persistent handles for long-running, retryable work (imports, exports, backfills, cache rebuilds): status, progress, cooperative cancellation.
12
+ */
13
+ export declare class JobsClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<JobsClient.Options>;
15
+ constructor(options: JobsClient.Options);
16
+ /**
17
+ * The active organization's jobs ordered by `created_at` descending (pass `sort=created_at` for ascending). Org-scoped: every member sees the org's backlog. `kind` / `status` accept comma-separated values. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
18
+ *
19
+ * @param {NizamDashboard.ListJobsRequest} request
20
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
21
+ *
22
+ * @throws {@link NizamDashboard.BadRequestError}
23
+ * @throws {@link NizamDashboard.UnauthorizedError}
24
+ * @throws {@link NizamDashboard.ForbiddenError}
25
+ * @throws {@link NizamDashboard.TooManyRequestsError}
26
+ * @throws {@link NizamDashboard.InternalServerError}
27
+ *
28
+ * @example
29
+ * await client.jobs.listJobs({
30
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
31
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
32
+ * })
33
+ */
34
+ listJobs(request?: NizamDashboard.ListJobsRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseJob>;
35
+ private __listJobs;
36
+ /**
37
+ * Single job view: status, progress counters, source/report handles, retry budget. Org-scoped: any member of the owning organization can read it.
38
+ *
39
+ * @param {NizamDashboard.GetJobRequest} request
40
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
41
+ *
42
+ * @throws {@link NizamDashboard.UnauthorizedError}
43
+ * @throws {@link NizamDashboard.ForbiddenError}
44
+ * @throws {@link NizamDashboard.NotFoundError}
45
+ * @throws {@link NizamDashboard.TooManyRequestsError}
46
+ * @throws {@link NizamDashboard.InternalServerError}
47
+ *
48
+ * @example
49
+ * await client.jobs.getJob({
50
+ * id: "00000000-0000-0000-0000-000000000000"
51
+ * })
52
+ */
53
+ getJob(request: NizamDashboard.GetJobRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Job>;
54
+ private __getJob;
55
+ /**
56
+ * Requests cancellation. A `pending` job cancels immediately; a `running` job moves to `cancelling` and the engine winds down cooperatively at its next checkpoint — already-running work may still finish. Idempotent: cancelling an already- cancelling or cancelled job is a no-op returning the current state. A `completed` or `failed` job conflicts (409). Org admins can cancel any job; members only their own.
57
+ *
58
+ * @param {NizamDashboard.CancelJobRequest} request
59
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
60
+ *
61
+ * @throws {@link NizamDashboard.UnauthorizedError}
62
+ * @throws {@link NizamDashboard.ForbiddenError}
63
+ * @throws {@link NizamDashboard.NotFoundError}
64
+ * @throws {@link NizamDashboard.ConflictError}
65
+ * @throws {@link NizamDashboard.TooManyRequestsError}
66
+ * @throws {@link NizamDashboard.InternalServerError}
67
+ *
68
+ * @example
69
+ * await client.jobs.cancelJob({
70
+ * id: "00000000-0000-0000-0000-000000000000"
71
+ * })
72
+ */
73
+ cancelJob(request: NizamDashboard.CancelJobRequest, requestOptions?: JobsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Job>;
74
+ private __cancelJob;
75
+ }
@@ -0,0 +1,255 @@
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.JobsClient = 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
+ /**
46
+ * Async jobs — persistent handles for long-running, retryable work (imports, exports, backfills, cache rebuilds): status, progress, cooperative cancellation.
47
+ */
48
+ class JobsClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * The active organization's jobs ordered by `created_at` descending (pass `sort=created_at` for ascending). Org-scoped: every member sees the org's backlog. `kind` / `status` accept comma-separated values. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
54
+ *
55
+ * @param {NizamDashboard.ListJobsRequest} request
56
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link NizamDashboard.BadRequestError}
59
+ * @throws {@link NizamDashboard.UnauthorizedError}
60
+ * @throws {@link NizamDashboard.ForbiddenError}
61
+ * @throws {@link NizamDashboard.TooManyRequestsError}
62
+ * @throws {@link NizamDashboard.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.jobs.listJobs({
66
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
67
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
68
+ * })
69
+ */
70
+ listJobs(request = {}, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__listJobs(request, requestOptions));
72
+ }
73
+ async __listJobs(request = {}, requestOptions) {
74
+ const { kind, status, sort, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
75
+ const _queryParams = {
76
+ kind,
77
+ status,
78
+ sort,
79
+ limit,
80
+ starting_after: startingAfter,
81
+ ending_before: endingBefore,
82
+ };
83
+ const _authRequest = await this._options.authProvider.getAuthRequest();
84
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
85
+ const _response = await core.fetcher({
86
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
87
+ (await core.Supplier.get(this._options.environment)) ??
88
+ environments.NizamDashboardEnvironment.Production, "v1/jobs"),
89
+ method: "GET",
90
+ headers: _headers,
91
+ queryString: core.url
92
+ .queryBuilder()
93
+ .addMany(_queryParams)
94
+ .mergeAdditional(requestOptions?.queryParams)
95
+ .build(),
96
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
97
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
98
+ abortSignal: requestOptions?.abortSignal,
99
+ fetchFn: this._options?.fetch,
100
+ logging: this._options.logging,
101
+ });
102
+ if (_response.ok) {
103
+ return { data: _response.body, rawResponse: _response.rawResponse };
104
+ }
105
+ if (_response.error.reason === "status-code") {
106
+ switch (_response.error.statusCode) {
107
+ case 400:
108
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
109
+ case 401:
110
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
111
+ case 403:
112
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
113
+ case 429:
114
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
115
+ case 500:
116
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
117
+ default:
118
+ throw new errors.NizamDashboardError({
119
+ statusCode: _response.error.statusCode,
120
+ body: _response.error.body,
121
+ rawResponse: _response.rawResponse,
122
+ });
123
+ }
124
+ }
125
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/jobs");
126
+ }
127
+ /**
128
+ * Single job view: status, progress counters, source/report handles, retry budget. Org-scoped: any member of the owning organization can read it.
129
+ *
130
+ * @param {NizamDashboard.GetJobRequest} request
131
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
132
+ *
133
+ * @throws {@link NizamDashboard.UnauthorizedError}
134
+ * @throws {@link NizamDashboard.ForbiddenError}
135
+ * @throws {@link NizamDashboard.NotFoundError}
136
+ * @throws {@link NizamDashboard.TooManyRequestsError}
137
+ * @throws {@link NizamDashboard.InternalServerError}
138
+ *
139
+ * @example
140
+ * await client.jobs.getJob({
141
+ * id: "00000000-0000-0000-0000-000000000000"
142
+ * })
143
+ */
144
+ getJob(request, requestOptions) {
145
+ return core.HttpResponsePromise.fromPromise(this.__getJob(request, requestOptions));
146
+ }
147
+ async __getJob(request, requestOptions) {
148
+ const { id } = request;
149
+ const _authRequest = await this._options.authProvider.getAuthRequest();
150
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
151
+ const _response = await core.fetcher({
152
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
153
+ (await core.Supplier.get(this._options.environment)) ??
154
+ environments.NizamDashboardEnvironment.Production, `v1/jobs/${core.url.encodePathParam(id)}`),
155
+ method: "GET",
156
+ headers: _headers,
157
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
158
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
159
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
160
+ abortSignal: requestOptions?.abortSignal,
161
+ fetchFn: this._options?.fetch,
162
+ logging: this._options.logging,
163
+ });
164
+ if (_response.ok) {
165
+ return { data: _response.body, rawResponse: _response.rawResponse };
166
+ }
167
+ if (_response.error.reason === "status-code") {
168
+ switch (_response.error.statusCode) {
169
+ case 401:
170
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
171
+ case 403:
172
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
173
+ case 404:
174
+ throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
175
+ case 429:
176
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
177
+ case 500:
178
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
179
+ default:
180
+ throw new errors.NizamDashboardError({
181
+ statusCode: _response.error.statusCode,
182
+ body: _response.error.body,
183
+ rawResponse: _response.rawResponse,
184
+ });
185
+ }
186
+ }
187
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/jobs/{id}");
188
+ }
189
+ /**
190
+ * Requests cancellation. A `pending` job cancels immediately; a `running` job moves to `cancelling` and the engine winds down cooperatively at its next checkpoint — already-running work may still finish. Idempotent: cancelling an already- cancelling or cancelled job is a no-op returning the current state. A `completed` or `failed` job conflicts (409). Org admins can cancel any job; members only their own.
191
+ *
192
+ * @param {NizamDashboard.CancelJobRequest} request
193
+ * @param {JobsClient.RequestOptions} requestOptions - Request-specific configuration.
194
+ *
195
+ * @throws {@link NizamDashboard.UnauthorizedError}
196
+ * @throws {@link NizamDashboard.ForbiddenError}
197
+ * @throws {@link NizamDashboard.NotFoundError}
198
+ * @throws {@link NizamDashboard.ConflictError}
199
+ * @throws {@link NizamDashboard.TooManyRequestsError}
200
+ * @throws {@link NizamDashboard.InternalServerError}
201
+ *
202
+ * @example
203
+ * await client.jobs.cancelJob({
204
+ * id: "00000000-0000-0000-0000-000000000000"
205
+ * })
206
+ */
207
+ cancelJob(request, requestOptions) {
208
+ return core.HttpResponsePromise.fromPromise(this.__cancelJob(request, requestOptions));
209
+ }
210
+ async __cancelJob(request, requestOptions) {
211
+ const { id } = request;
212
+ const _authRequest = await this._options.authProvider.getAuthRequest();
213
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
214
+ const _response = await core.fetcher({
215
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
216
+ (await core.Supplier.get(this._options.environment)) ??
217
+ environments.NizamDashboardEnvironment.Production, `v1/jobs/${core.url.encodePathParam(id)}/cancel`),
218
+ method: "POST",
219
+ headers: _headers,
220
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
221
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
222
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
223
+ abortSignal: requestOptions?.abortSignal,
224
+ fetchFn: this._options?.fetch,
225
+ logging: this._options.logging,
226
+ });
227
+ if (_response.ok) {
228
+ return { data: _response.body, rawResponse: _response.rawResponse };
229
+ }
230
+ if (_response.error.reason === "status-code") {
231
+ switch (_response.error.statusCode) {
232
+ case 401:
233
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
234
+ case 403:
235
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
236
+ case 404:
237
+ throw new NizamDashboard.NotFoundError(_response.error.body, _response.rawResponse);
238
+ case 409:
239
+ throw new NizamDashboard.ConflictError(_response.error.body, _response.rawResponse);
240
+ case 429:
241
+ throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
242
+ case 500:
243
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
244
+ default:
245
+ throw new errors.NizamDashboardError({
246
+ statusCode: _response.error.statusCode,
247
+ body: _response.error.body,
248
+ rawResponse: _response.rawResponse,
249
+ });
250
+ }
251
+ }
252
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/jobs/{id}/cancel");
253
+ }
254
+ }
255
+ exports.JobsClient = JobsClient;
@@ -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,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface CancelJobRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * id: "00000000-0000-0000-0000-000000000000"
5
+ * }
6
+ */
7
+ export interface GetJobRequest {
8
+ id: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
5
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
6
+ * }
7
+ */
8
+ export interface ListJobsRequest {
9
+ /** Filter by job kind. Comma-separated; values: `membership_cache_rebuild`, `service_account_api_key_regeneration`. */
10
+ kind?: string | string[];
11
+ /** Filter by lifecycle status. Comma-separated; values: `pending`, `running`, `cancelling`, `completed`, `failed`, `cancelled`. */
12
+ status?: string | string[];
13
+ /** Sort order. Allowed fields: `created_at`. Prefix a field with `-` for descending (e.g. `-created_at`); unknown fields are rejected with `400 validation_failed`. */
14
+ sort?: string | string[];
15
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
16
+ limit?: number;
17
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
18
+ starting_after?: string;
19
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
20
+ ending_before?: string;
21
+ }
@@ -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,3 @@
1
+ export type { CancelJobRequest } from "./CancelJobRequest.js";
2
+ export type { GetJobRequest } from "./GetJobRequest.js";
3
+ export type { ListJobsRequest } from "./ListJobsRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { JobsClient } from "./client/Client.js";
2
+ export * from "./client/index.js";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.JobsClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "JobsClient", { enumerable: true, get: function () { return Client_js_1.JobsClient; } });
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);