@nizam-os/dashboard-sdk 5.2.1 → 5.4.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 (60) hide show
  1. package/dist/Client.d.ts +6 -0
  2. package/dist/Client.js +24 -16
  3. package/dist/api/resources/activeOrganization/client/Client.d.ts +5 -0
  4. package/dist/api/resources/activeOrganization/client/Client.js +5 -0
  5. package/dist/api/resources/activeOrganization/client/requests/SetActiveOrganizationRequest.d.ts +5 -0
  6. package/dist/api/resources/activity/client/Client.d.ts +36 -0
  7. package/dist/api/resources/activity/client/Client.js +128 -0
  8. package/dist/api/resources/activity/client/index.d.ts +1 -0
  9. package/dist/api/resources/activity/client/index.js +17 -0
  10. package/dist/api/resources/activity/client/requests/ListActivityRequest.d.ts +20 -0
  11. package/dist/api/resources/activity/client/requests/ListActivityRequest.js +3 -0
  12. package/dist/api/resources/activity/client/requests/index.d.ts +1 -0
  13. package/dist/api/resources/activity/client/requests/index.js +2 -0
  14. package/dist/api/resources/activity/exports.d.ts +2 -0
  15. package/dist/api/resources/activity/exports.js +21 -0
  16. package/dist/api/resources/activity/index.d.ts +1 -0
  17. package/dist/api/resources/activity/index.js +17 -0
  18. package/dist/api/resources/assets/client/Client.d.ts +39 -0
  19. package/dist/api/resources/assets/client/Client.js +94 -0
  20. package/dist/api/resources/assets/client/requests/CreateAssetRequest.d.ts +19 -0
  21. package/dist/api/resources/assets/client/requests/ListAssetsRequest.d.ts +20 -0
  22. package/dist/api/resources/assets/client/requests/ListAssetsRequest.js +3 -0
  23. package/dist/api/resources/assets/client/requests/index.d.ts +1 -0
  24. package/dist/api/resources/assignments/client/Client.d.ts +13 -0
  25. package/dist/api/resources/assignments/client/Client.js +13 -0
  26. package/dist/api/resources/assignments/client/requests/CloseAssignmentRequest.d.ts +6 -0
  27. package/dist/api/resources/assignments/client/requests/OpenAssignmentRequest.d.ts +7 -0
  28. package/dist/api/resources/index.d.ts +3 -0
  29. package/dist/api/resources/index.js +4 -1
  30. package/dist/api/resources/invites/client/Client.d.ts +16 -1
  31. package/dist/api/resources/invites/client/Client.js +16 -1
  32. package/dist/api/resources/invites/client/requests/CreateInviteRequest.d.ts +16 -1
  33. package/dist/api/resources/organizations/client/Client.d.ts +14 -6
  34. package/dist/api/resources/organizations/client/Client.js +14 -6
  35. package/dist/api/resources/organizations/client/requests/CreateOrganizationRequest.d.ts +5 -0
  36. package/dist/api/resources/organizations/client/requests/UpdateOrganizationRequest.d.ts +9 -6
  37. package/dist/api/resources/realtime/client/Client.d.ts +30 -0
  38. package/dist/api/resources/realtime/client/Client.js +105 -0
  39. package/dist/api/resources/realtime/client/index.d.ts +1 -0
  40. package/dist/api/resources/realtime/client/index.js +2 -0
  41. package/dist/api/resources/realtime/exports.d.ts +2 -0
  42. package/dist/api/resources/realtime/exports.js +21 -0
  43. package/dist/api/resources/realtime/index.d.ts +1 -0
  44. package/dist/api/resources/realtime/index.js +17 -0
  45. package/dist/api/resources/users/client/Client.d.ts +5 -0
  46. package/dist/api/resources/users/client/Client.js +5 -0
  47. package/dist/api/resources/users/client/requests/InviteUserRequest.d.ts +5 -0
  48. package/dist/api/types/ActivityResource.d.ts +55 -0
  49. package/dist/api/types/ActivityResource.js +31 -0
  50. package/dist/api/types/AssetListItem.d.ts +62 -0
  51. package/dist/api/types/AssetListItem.js +33 -0
  52. package/dist/api/types/ListResponseActivityResource.d.ts +27 -0
  53. package/dist/api/types/ListResponseActivityResource.js +11 -0
  54. package/dist/api/types/ListResponseAssetListItem.d.ts +27 -0
  55. package/dist/api/types/ListResponseAssetListItem.js +11 -0
  56. package/dist/api/types/RealtimeTicket.d.ts +18 -0
  57. package/dist/api/types/RealtimeTicket.js +11 -0
  58. package/dist/api/types/index.d.ts +5 -0
  59. package/dist/api/types/index.js +5 -0
  60. package/package.json +1 -1
package/dist/Client.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ActiveOrganizationClient } from "./api/resources/activeOrganization/client/Client.js";
2
+ import { ActivityClient } from "./api/resources/activity/client/Client.js";
2
3
  import { AssetsClient } from "./api/resources/assets/client/Client.js";
3
4
  import { AssignmentsClient } from "./api/resources/assignments/client/Client.js";
4
5
  import { InvitesClient } from "./api/resources/invites/client/Client.js";
@@ -6,6 +7,7 @@ import { LookupsClient } from "./api/resources/lookups/client/Client.js";
6
7
  import { MembershipsClient } from "./api/resources/memberships/client/Client.js";
7
8
  import { OperatorsClient } from "./api/resources/operators/client/Client.js";
8
9
  import { OrganizationsClient } from "./api/resources/organizations/client/Client.js";
10
+ import { RealtimeClient } from "./api/resources/realtime/client/Client.js";
9
11
  import { UsersClient } from "./api/resources/users/client/Client.js";
10
12
  import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.js";
11
13
  import { type NormalizedClientOptionsWithAuth } from "./BaseClient.js";
@@ -17,6 +19,7 @@ export declare namespace NizamDashboardClient {
17
19
  }
18
20
  export declare class NizamDashboardClient {
19
21
  protected readonly _options: NormalizedClientOptionsWithAuth<NizamDashboardClient.Options>;
22
+ protected _activity: ActivityClient | undefined;
20
23
  protected _assets: AssetsClient | undefined;
21
24
  protected _assignments: AssignmentsClient | undefined;
22
25
  protected _invites: InvitesClient | undefined;
@@ -26,7 +29,9 @@ export declare class NizamDashboardClient {
26
29
  protected _memberships: MembershipsClient | undefined;
27
30
  protected _operators: OperatorsClient | undefined;
28
31
  protected _organizations: OrganizationsClient | undefined;
32
+ protected _realtime: RealtimeClient | undefined;
29
33
  constructor(options: NizamDashboardClient.Options);
34
+ get activity(): ActivityClient;
30
35
  get assets(): AssetsClient;
31
36
  get assignments(): AssignmentsClient;
32
37
  get invites(): InvitesClient;
@@ -36,6 +41,7 @@ export declare class NizamDashboardClient {
36
41
  get memberships(): MembershipsClient;
37
42
  get operators(): OperatorsClient;
38
43
  get organizations(): OrganizationsClient;
44
+ get realtime(): RealtimeClient;
39
45
  /**
40
46
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
41
47
  * This is useful for making requests to endpoints not yet supported in the SDK.
package/dist/Client.js CHANGED
@@ -36,46 +36,54 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.NizamDashboardClient = void 0;
38
38
  const Client_js_1 = require("./api/resources/activeOrganization/client/Client.js");
39
- const Client_js_2 = require("./api/resources/assets/client/Client.js");
40
- const Client_js_3 = require("./api/resources/assignments/client/Client.js");
41
- const Client_js_4 = require("./api/resources/invites/client/Client.js");
42
- const Client_js_5 = require("./api/resources/lookups/client/Client.js");
43
- const Client_js_6 = require("./api/resources/memberships/client/Client.js");
44
- const Client_js_7 = require("./api/resources/operators/client/Client.js");
45
- const Client_js_8 = require("./api/resources/organizations/client/Client.js");
46
- const Client_js_9 = require("./api/resources/users/client/Client.js");
39
+ const Client_js_2 = require("./api/resources/activity/client/Client.js");
40
+ const Client_js_3 = require("./api/resources/assets/client/Client.js");
41
+ const Client_js_4 = require("./api/resources/assignments/client/Client.js");
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");
47
49
  const BaseClient_js_1 = require("./BaseClient.js");
48
50
  const core = __importStar(require("./core/index.js"));
49
51
  class NizamDashboardClient {
50
52
  constructor(options) {
51
53
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
52
54
  }
55
+ get activity() {
56
+ return (this._activity ?? (this._activity = new Client_js_2.ActivityClient(this._options)));
57
+ }
53
58
  get assets() {
54
- return (this._assets ?? (this._assets = new Client_js_2.AssetsClient(this._options)));
59
+ return (this._assets ?? (this._assets = new Client_js_3.AssetsClient(this._options)));
55
60
  }
56
61
  get assignments() {
57
- return (this._assignments ?? (this._assignments = new Client_js_3.AssignmentsClient(this._options)));
62
+ return (this._assignments ?? (this._assignments = new Client_js_4.AssignmentsClient(this._options)));
58
63
  }
59
64
  get invites() {
60
- return (this._invites ?? (this._invites = new Client_js_4.InvitesClient(this._options)));
65
+ return (this._invites ?? (this._invites = new Client_js_5.InvitesClient(this._options)));
61
66
  }
62
67
  get lookups() {
63
- return (this._lookups ?? (this._lookups = new Client_js_5.LookupsClient(this._options)));
68
+ return (this._lookups ?? (this._lookups = new Client_js_6.LookupsClient(this._options)));
64
69
  }
65
70
  get users() {
66
- return (this._users ?? (this._users = new Client_js_9.UsersClient(this._options)));
71
+ return (this._users ?? (this._users = new Client_js_11.UsersClient(this._options)));
67
72
  }
68
73
  get activeOrganization() {
69
74
  return (this._activeOrganization ?? (this._activeOrganization = new Client_js_1.ActiveOrganizationClient(this._options)));
70
75
  }
71
76
  get memberships() {
72
- return (this._memberships ?? (this._memberships = new Client_js_6.MembershipsClient(this._options)));
77
+ return (this._memberships ?? (this._memberships = new Client_js_7.MembershipsClient(this._options)));
73
78
  }
74
79
  get operators() {
75
- return (this._operators ?? (this._operators = new Client_js_7.OperatorsClient(this._options)));
80
+ return (this._operators ?? (this._operators = new Client_js_8.OperatorsClient(this._options)));
76
81
  }
77
82
  get organizations() {
78
- return (this._organizations ?? (this._organizations = new Client_js_8.OrganizationsClient(this._options)));
83
+ return (this._organizations ?? (this._organizations = new Client_js_9.OrganizationsClient(this._options)));
84
+ }
85
+ get realtime() {
86
+ return (this._realtime ?? (this._realtime = new Client_js_10.RealtimeClient(this._options)));
79
87
  }
80
88
  /**
81
89
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -55,6 +55,11 @@ export declare class ActiveOrganizationClient {
55
55
  * await client.activeOrganization.setActiveOrganization({
56
56
  * slug: "acme-logistics"
57
57
  * })
58
+ *
59
+ * @example
60
+ * await client.activeOrganization.setActiveOrganization({
61
+ * slug: "globex-freight"
62
+ * })
58
63
  */
59
64
  setActiveOrganization(request: NizamDashboard.SetActiveOrganizationRequest, requestOptions?: ActiveOrganizationClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ActiveOrganization>;
60
65
  private __setActiveOrganization;
@@ -129,6 +129,11 @@ class ActiveOrganizationClient {
129
129
  * await client.activeOrganization.setActiveOrganization({
130
130
  * slug: "acme-logistics"
131
131
  * })
132
+ *
133
+ * @example
134
+ * await client.activeOrganization.setActiveOrganization({
135
+ * slug: "globex-freight"
136
+ * })
132
137
  */
133
138
  setActiveOrganization(request, requestOptions) {
134
139
  return core.HttpResponsePromise.fromPromise(this.__setActiveOrganization(request, requestOptions));
@@ -3,6 +3,11 @@
3
3
  * {
4
4
  * slug: "acme-logistics"
5
5
  * }
6
+ *
7
+ * @example
8
+ * {
9
+ * slug: "globex-freight"
10
+ * }
6
11
  */
7
12
  export interface SetActiveOrganizationRequest {
8
13
  /** Slug of the organization to make active. Must match an active membership. */
@@ -0,0 +1,36 @@
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 ActivityClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * Organization activity feed — the append-only timeline of what happened, and the durable source of truth behind realtime dashboard updates.
12
+ */
13
+ export declare class ActivityClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<ActivityClient.Options>;
15
+ constructor(options: ActivityClient.Options);
16
+ /**
17
+ * Newest-first feed of audited events for the caller's active organization (dashboard; tenant-scoped). Platform staff see across tenants. This is the durable, REST source of truth behind the realtime `/topic/organization.<id>.activity` STOMP stream: on reconnect, a client passes `since=<last_seen>` to catch up missed items, then resumes realtime. Each item's `event_id` correlates with the realtime ActivityFeedItem's `id` for deduplication. Sortable: `created_at` (default `-created_at`). Bidirectional opaque cursors via `starting_after` / `ending_before`.
18
+ *
19
+ * @param {NizamDashboard.ListActivityRequest} request
20
+ * @param {ActivityClient.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.InternalServerError}
26
+ *
27
+ * @example
28
+ * await client.activity.listActivity({
29
+ * since: "2026-05-20T14:00:00Z",
30
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
31
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
32
+ * })
33
+ */
34
+ listActivity(request?: NizamDashboard.ListActivityRequest, requestOptions?: ActivityClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseActivityResource>;
35
+ private __listActivity;
36
+ }
@@ -0,0 +1,128 @@
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.ActivityClient = 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
+ * Organization activity feed — the append-only timeline of what happened, and the durable source of truth behind realtime dashboard updates.
47
+ */
48
+ class ActivityClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * Newest-first feed of audited events for the caller's active organization (dashboard; tenant-scoped). Platform staff see across tenants. This is the durable, REST source of truth behind the realtime `/topic/organization.<id>.activity` STOMP stream: on reconnect, a client passes `since=<last_seen>` to catch up missed items, then resumes realtime. Each item's `event_id` correlates with the realtime ActivityFeedItem's `id` for deduplication. Sortable: `created_at` (default `-created_at`). Bidirectional opaque cursors via `starting_after` / `ending_before`.
54
+ *
55
+ * @param {NizamDashboard.ListActivityRequest} request
56
+ * @param {ActivityClient.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.InternalServerError}
62
+ *
63
+ * @example
64
+ * await client.activity.listActivity({
65
+ * since: "2026-05-20T14:00:00Z",
66
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
67
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
68
+ * })
69
+ */
70
+ listActivity(request = {}, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__listActivity(request, requestOptions));
72
+ }
73
+ async __listActivity(request = {}, requestOptions) {
74
+ const { since, sort, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
75
+ const _queryParams = {
76
+ since: since != null ? since : undefined,
77
+ sort,
78
+ limit,
79
+ starting_after: startingAfter,
80
+ ending_before: endingBefore,
81
+ };
82
+ const _authRequest = await this._options.authProvider.getAuthRequest();
83
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
84
+ const _response = await core.fetcher({
85
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
86
+ (await core.Supplier.get(this._options.environment)) ??
87
+ environments.NizamDashboardEnvironment.Production, "v1/activity"),
88
+ method: "GET",
89
+ headers: _headers,
90
+ queryString: core.url
91
+ .queryBuilder()
92
+ .addMany(_queryParams)
93
+ .mergeAdditional(requestOptions?.queryParams)
94
+ .build(),
95
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
96
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
97
+ abortSignal: requestOptions?.abortSignal,
98
+ fetchFn: this._options?.fetch,
99
+ logging: this._options.logging,
100
+ });
101
+ if (_response.ok) {
102
+ return {
103
+ data: _response.body,
104
+ rawResponse: _response.rawResponse,
105
+ };
106
+ }
107
+ if (_response.error.reason === "status-code") {
108
+ switch (_response.error.statusCode) {
109
+ case 400:
110
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
111
+ case 401:
112
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
113
+ case 403:
114
+ throw new NizamDashboard.ForbiddenError(_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/activity");
126
+ }
127
+ }
128
+ exports.ActivityClient = ActivityClient;
@@ -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,20 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * since: "2026-05-20T14:00:00Z",
5
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
6
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
7
+ * }
8
+ */
9
+ export interface ListActivityRequest {
10
+ /** Return only activity at or after this instant (ISO-8601). Pass the last-seen timestamp to reconcile after a realtime disconnect. */
11
+ since?: string;
12
+ /** Sorting criteria in the format: property,(asc|desc). Default sort order is ascending. Multiple sort criteria are supported. */
13
+ sort?: string | string[];
14
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
15
+ limit?: number;
16
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
17
+ starting_after?: string;
18
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
19
+ ending_before?: string;
20
+ }
@@ -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 @@
1
+ export type { ListActivityRequest } from "./ListActivityRequest.js";
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { ActivityClient } 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.ActivityClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "ActivityClient", { enumerable: true, get: function () { return Client_js_1.ActivityClient; } });
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);
@@ -13,6 +13,26 @@ export declare namespace AssetsClient {
13
13
  export declare class AssetsClient {
14
14
  protected readonly _options: NormalizedClientOptionsWithAuth<AssetsClient.Options>;
15
15
  constructor(options: AssetsClient.Options);
16
+ /**
17
+ * Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked full-text search across name, VIN, code, plate, serial, call sign, make, model and sub-kind — accent-insensitive, language-agnostic (epic #97). Search results are ordered by relevance and support forward-only cursors (`starting_after`). `highlight=true` adds a `<mark>`-wrapped match snippet.
18
+ *
19
+ * @param {NizamDashboard.ListAssetsRequest} request
20
+ * @param {AssetsClient.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.InternalServerError}
26
+ *
27
+ * @example
28
+ * await client.assets.listAssets({
29
+ * q: "<string>",
30
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
31
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
32
+ * })
33
+ */
34
+ listAssets(request?: NizamDashboard.ListAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseAssetListItem>;
35
+ private __listAssets;
16
36
  /**
17
37
  * Creates a new asset (vehicle, drone, robot, container, equipment, ...) owned by the active organization.
18
38
  *
@@ -31,6 +51,25 @@ export declare class AssetsClient {
31
51
  * name: "Truck 7",
32
52
  * autonomy_level: 0
33
53
  * })
54
+ *
55
+ * @example
56
+ * await client.assets.createAsset({
57
+ * kind: "aerial_vehicle",
58
+ * name: "Delivery Drone D-12",
59
+ * autonomy_level: 4
60
+ * })
61
+ *
62
+ * @example
63
+ * await client.assets.createAsset({
64
+ * kind: "robot",
65
+ * name: "Picker Bot 3",
66
+ * autonomy_level: 5
67
+ * })
68
+ *
69
+ * @example
70
+ * await client.assets.createAsset({
71
+ * kind: "container"
72
+ * })
34
73
  */
35
74
  createAsset(request: NizamDashboard.CreateAssetRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Asset>;
36
75
  private __createAsset;
@@ -49,6 +49,81 @@ class AssetsClient {
49
49
  constructor(options) {
50
50
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
51
  }
52
+ /**
53
+ * Without `q`: the org's assets ordered by `created_at` descending. With `q`: ranked full-text search across name, VIN, code, plate, serial, call sign, make, model and sub-kind — accent-insensitive, language-agnostic (epic #97). Search results are ordered by relevance and support forward-only cursors (`starting_after`). `highlight=true` adds a `<mark>`-wrapped match snippet.
54
+ *
55
+ * @param {NizamDashboard.ListAssetsRequest} request
56
+ * @param {AssetsClient.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.InternalServerError}
62
+ *
63
+ * @example
64
+ * await client.assets.listAssets({
65
+ * q: "<string>",
66
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
67
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
68
+ * })
69
+ */
70
+ listAssets(request = {}, requestOptions) {
71
+ return core.HttpResponsePromise.fromPromise(this.__listAssets(request, requestOptions));
72
+ }
73
+ async __listAssets(request = {}, requestOptions) {
74
+ const { q, highlight, limit, starting_after: startingAfter, ending_before: endingBefore } = request;
75
+ const _queryParams = {
76
+ q,
77
+ highlight,
78
+ limit,
79
+ starting_after: startingAfter,
80
+ ending_before: endingBefore,
81
+ };
82
+ const _authRequest = await this._options.authProvider.getAuthRequest();
83
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
84
+ const _response = await core.fetcher({
85
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
86
+ (await core.Supplier.get(this._options.environment)) ??
87
+ environments.NizamDashboardEnvironment.Production, "v1/assets"),
88
+ method: "GET",
89
+ headers: _headers,
90
+ queryString: core.url
91
+ .queryBuilder()
92
+ .addMany(_queryParams)
93
+ .mergeAdditional(requestOptions?.queryParams)
94
+ .build(),
95
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
96
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
97
+ abortSignal: requestOptions?.abortSignal,
98
+ fetchFn: this._options?.fetch,
99
+ logging: this._options.logging,
100
+ });
101
+ if (_response.ok) {
102
+ return {
103
+ data: _response.body,
104
+ rawResponse: _response.rawResponse,
105
+ };
106
+ }
107
+ if (_response.error.reason === "status-code") {
108
+ switch (_response.error.statusCode) {
109
+ case 400:
110
+ throw new NizamDashboard.BadRequestError(_response.error.body, _response.rawResponse);
111
+ case 401:
112
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
113
+ case 403:
114
+ throw new NizamDashboard.ForbiddenError(_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/assets");
126
+ }
52
127
  /**
53
128
  * Creates a new asset (vehicle, drone, robot, container, equipment, ...) owned by the active organization.
54
129
  *
@@ -67,6 +142,25 @@ class AssetsClient {
67
142
  * name: "Truck 7",
68
143
  * autonomy_level: 0
69
144
  * })
145
+ *
146
+ * @example
147
+ * await client.assets.createAsset({
148
+ * kind: "aerial_vehicle",
149
+ * name: "Delivery Drone D-12",
150
+ * autonomy_level: 4
151
+ * })
152
+ *
153
+ * @example
154
+ * await client.assets.createAsset({
155
+ * kind: "robot",
156
+ * name: "Picker Bot 3",
157
+ * autonomy_level: 5
158
+ * })
159
+ *
160
+ * @example
161
+ * await client.assets.createAsset({
162
+ * kind: "container"
163
+ * })
70
164
  */
71
165
  createAsset(request, requestOptions) {
72
166
  return core.HttpResponsePromise.fromPromise(this.__createAsset(request, requestOptions));
@@ -5,6 +5,25 @@
5
5
  * name: "Truck 7",
6
6
  * autonomy_level: 0
7
7
  * }
8
+ *
9
+ * @example
10
+ * {
11
+ * kind: "aerial_vehicle",
12
+ * name: "Delivery Drone D-12",
13
+ * autonomy_level: 4
14
+ * }
15
+ *
16
+ * @example
17
+ * {
18
+ * kind: "robot",
19
+ * name: "Picker Bot 3",
20
+ * autonomy_level: 5
21
+ * }
22
+ *
23
+ * @example
24
+ * {
25
+ * kind: "container"
26
+ * }
8
27
  */
9
28
  export interface CreateAssetRequest {
10
29
  /** Top-level kind. */
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * q: "<string>",
5
+ * starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
6
+ * ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
7
+ * }
8
+ */
9
+ export interface ListAssetsRequest {
10
+ /** Free-text search query (max 200 chars). */
11
+ q?: string;
12
+ /** Include a highlighted match snippet per hit (search mode only). */
13
+ highlight?: boolean;
14
+ /** Page size. Default 20, maximum 100. Out-of-range values are silently clamped; the response body's `limit` field reflects what was applied. */
15
+ limit?: number;
16
+ /** Opaque cursor — return the page starting strictly after this entity in the sort order. Mutually exclusive with `ending_before`. */
17
+ starting_after?: string;
18
+ /** Opaque cursor — return the page ending strictly before this entity in the sort order. Mutually exclusive with `starting_after`. */
19
+ ending_before?: string;
20
+ }
@@ -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 });
@@ -1,2 +1,3 @@
1
1
  export { CreateAssetRequest } from "./CreateAssetRequest.js";
2
2
  export type { GetAssetRequest } from "./GetAssetRequest.js";
3
+ export type { ListAssetsRequest } from "./ListAssetsRequest.js";