@nizam-os/dashboard-sdk 11.0.0 → 11.1.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.
@@ -135,6 +135,8 @@ export declare class AssetsClient {
135
135
  getAssetImportTemplate(requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<core.BinaryResponse>;
136
136
  private __getAssetImportTemplate;
137
137
  /**
138
+ * Returns one asset. Visible to members of the asset's organization and to L4-granted cross-tenant readers; anyone else gets 404 — indistinguishable from a non-existent id (prevents tenant probing).
139
+ *
138
140
  * @param {NizamDashboard.GetAssetRequest} request
139
141
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
140
142
  *
@@ -154,6 +156,8 @@ export declare class AssetsClient {
154
156
  /**
155
157
  * Soft-deletes the asset: it disappears from listings immediately and frees its VIN for re-registration. Assignments and historical records are left untouched. There is no synchronous bulk-delete endpoint — delete a selection by fanning out per-id requests (each is naturally idempotent).
156
158
  *
159
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
160
+ *
157
161
  * @param {NizamDashboard.DeleteAssetRequest} request
158
162
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
159
163
  *
@@ -173,6 +177,8 @@ export declare class AssetsClient {
173
177
  /**
174
178
  * Set-only partial update of an asset's mutable fields — display name, sub-kind, autonomy level, and the vehicle identity (VIN, plate, make, model, year). Omitted or null fields are left unchanged. An asset's `kind` is immutable and lifecycle `status` moves through dedicated transitions, so neither is editable here.
175
179
  *
180
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
181
+ *
176
182
  * @param {NizamDashboard.UpdateAssetRequest} request
177
183
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
178
184
  *
@@ -205,6 +211,8 @@ export declare class AssetsClient {
205
211
  /**
206
212
  * Returns the asset to `active` service. Idempotent no-op if already active; an illegal edge (e.g. from a terminal sold/lost asset) → 409 `asset.invalid_transition`. No body — fan out per id for a bulk change.
207
213
  *
214
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
215
+ *
208
216
  * @param {NizamDashboard.ActivateAssetRequest} request
209
217
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
210
218
  *
@@ -225,6 +233,8 @@ export declare class AssetsClient {
225
233
  /**
226
234
  * Marks the asset `inactive` (idle but still in-fleet). Idempotent no-op if already inactive; an illegal edge → 409 `asset.invalid_transition`. No body.
227
235
  *
236
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
237
+ *
228
238
  * @param {NizamDashboard.DeactivateAssetRequest} request
229
239
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
230
240
  *
@@ -245,6 +255,8 @@ export declare class AssetsClient {
245
255
  /**
246
256
  * Moves the asset into `maintenance`. Idempotent no-op if already in maintenance; an illegal edge → 409 `asset.invalid_transition`. No body.
247
257
  *
258
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
259
+ *
248
260
  * @param {NizamDashboard.EnterAssetMaintenanceRequest} request
249
261
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
250
262
  *
@@ -265,6 +277,8 @@ export declare class AssetsClient {
265
277
  /**
266
278
  * Marks the asset `lost` — a terminal state; the asset has left the fleet and accepts no further transitions. Idempotent no-op if already lost; an illegal edge → 409 `asset.invalid_transition`. No body.
267
279
  *
280
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
281
+ *
268
282
  * @param {NizamDashboard.ReportAssetLostRequest} request
269
283
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
270
284
  *
@@ -285,6 +299,8 @@ export declare class AssetsClient {
285
299
  /**
286
300
  * Retires the asset (`retired`) — decommissioned but still owned; it may later be reactivated, sold, or reported lost. Idempotent no-op if already retired; an illegal edge → 409 `asset.invalid_transition`. No body.
287
301
  *
302
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
303
+ *
288
304
  * @param {NizamDashboard.RetireAssetRequest} request
289
305
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
290
306
  *
@@ -305,6 +321,8 @@ export declare class AssetsClient {
305
321
  /**
306
322
  * Marks the asset `sold` — a terminal state; the asset has left the fleet and accepts no further transitions. Idempotent no-op if already sold; an illegal edge → 409 `asset.invalid_transition`. No body.
307
323
  *
324
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
325
+ *
308
326
  * @param {NizamDashboard.SellAssetRequest} request
309
327
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
310
328
  *
@@ -325,6 +343,8 @@ export declare class AssetsClient {
325
343
  /**
326
344
  * Moves the asset `out_of_service`. Idempotent no-op if already out of service; an illegal edge → 409 `asset.invalid_transition`. No body.
327
345
  *
346
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
347
+ *
328
348
  * @param {NizamDashboard.TakeAssetOutOfServiceRequest} request
329
349
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
330
350
  *
@@ -418,6 +418,8 @@ class AssetsClient {
418
418
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/assets/imports/template");
419
419
  }
420
420
  /**
421
+ * Returns one asset. Visible to members of the asset's organization and to L4-granted cross-tenant readers; anyone else gets 404 — indistinguishable from a non-existent id (prevents tenant probing).
422
+ *
421
423
  * @param {NizamDashboard.GetAssetRequest} request
422
424
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
423
425
  *
@@ -480,6 +482,8 @@ class AssetsClient {
480
482
  /**
481
483
  * Soft-deletes the asset: it disappears from listings immediately and frees its VIN for re-registration. Assignments and historical records are left untouched. There is no synchronous bulk-delete endpoint — delete a selection by fanning out per-id requests (each is naturally idempotent).
482
484
  *
485
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
486
+ *
483
487
  * @param {NizamDashboard.DeleteAssetRequest} request
484
488
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
485
489
  *
@@ -542,6 +546,8 @@ class AssetsClient {
542
546
  /**
543
547
  * Set-only partial update of an asset's mutable fields — display name, sub-kind, autonomy level, and the vehicle identity (VIN, plate, make, model, year). Omitted or null fields are left unchanged. An asset's `kind` is immutable and lifecycle `status` moves through dedicated transitions, so neither is editable here.
544
548
  *
549
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
550
+ *
545
551
  * @param {NizamDashboard.UpdateAssetRequest} request
546
552
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
547
553
  *
@@ -624,6 +630,8 @@ class AssetsClient {
624
630
  /**
625
631
  * Returns the asset to `active` service. Idempotent no-op if already active; an illegal edge (e.g. from a terminal sold/lost asset) → 409 `asset.invalid_transition`. No body — fan out per id for a bulk change.
626
632
  *
633
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
634
+ *
627
635
  * @param {NizamDashboard.ActivateAssetRequest} request
628
636
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
629
637
  *
@@ -689,6 +697,8 @@ class AssetsClient {
689
697
  /**
690
698
  * Marks the asset `inactive` (idle but still in-fleet). Idempotent no-op if already inactive; an illegal edge → 409 `asset.invalid_transition`. No body.
691
699
  *
700
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
701
+ *
692
702
  * @param {NizamDashboard.DeactivateAssetRequest} request
693
703
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
694
704
  *
@@ -754,6 +764,8 @@ class AssetsClient {
754
764
  /**
755
765
  * Moves the asset into `maintenance`. Idempotent no-op if already in maintenance; an illegal edge → 409 `asset.invalid_transition`. No body.
756
766
  *
767
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
768
+ *
757
769
  * @param {NizamDashboard.EnterAssetMaintenanceRequest} request
758
770
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
759
771
  *
@@ -819,6 +831,8 @@ class AssetsClient {
819
831
  /**
820
832
  * Marks the asset `lost` — a terminal state; the asset has left the fleet and accepts no further transitions. Idempotent no-op if already lost; an illegal edge → 409 `asset.invalid_transition`. No body.
821
833
  *
834
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
835
+ *
822
836
  * @param {NizamDashboard.ReportAssetLostRequest} request
823
837
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
824
838
  *
@@ -884,6 +898,8 @@ class AssetsClient {
884
898
  /**
885
899
  * Retires the asset (`retired`) — decommissioned but still owned; it may later be reactivated, sold, or reported lost. Idempotent no-op if already retired; an illegal edge → 409 `asset.invalid_transition`. No body.
886
900
  *
901
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
902
+ *
887
903
  * @param {NizamDashboard.RetireAssetRequest} request
888
904
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
889
905
  *
@@ -949,6 +965,8 @@ class AssetsClient {
949
965
  /**
950
966
  * Marks the asset `sold` — a terminal state; the asset has left the fleet and accepts no further transitions. Idempotent no-op if already sold; an illegal edge → 409 `asset.invalid_transition`. No body.
951
967
  *
968
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
969
+ *
952
970
  * @param {NizamDashboard.SellAssetRequest} request
953
971
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
954
972
  *
@@ -1014,6 +1032,8 @@ class AssetsClient {
1014
1032
  /**
1015
1033
  * Moves the asset `out_of_service`. Idempotent no-op if already out of service; an illegal edge → 409 `asset.invalid_transition`. No body.
1016
1034
  *
1035
+ * > **Requires** `manage` on `asset` (SpiceDB permission expression).
1036
+ *
1017
1037
  * @param {NizamDashboard.TakeAssetOutOfServiceRequest} request
1018
1038
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
1019
1039
  *
@@ -86,7 +86,7 @@ export declare class OrganizationsClient {
86
86
  getOrganization(request: NizamDashboard.GetOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Organization>;
87
87
  private __getOrganization;
88
88
  /**
89
- * Owner-only. Sets `deleted_at` on the organizations row; subsequent reads filter it out. The Keycloak Organization is intentionally left in place — restore is just an UPDATE un-setting `deleted_at`. Members are not removed; their memberships persist alongside the soft-deleted row in case a restore path is added later. L4 @HasPermission ensures the caller is an admin; the owner-only check inside the handler narrows further.
89
+ * Owner-only. Sets `deleted_at` on the organizations row; subsequent reads filter it out. The Keycloak Organization is intentionally left in place — restore is just an UPDATE un-setting `deleted_at`. Members are not removed; their memberships persist alongside the soft-deleted row in case a restore path is added later. L4 @RequirePermission ensures the caller is an admin; the owner-only check inside the handler narrows further.
90
90
  *
91
91
  * > **Requires** `administer` on `organization` (SpiceDB permission expression).
92
92
  *
@@ -269,7 +269,7 @@ class OrganizationsClient {
269
269
  return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/organizations/{id}");
270
270
  }
271
271
  /**
272
- * Owner-only. Sets `deleted_at` on the organizations row; subsequent reads filter it out. The Keycloak Organization is intentionally left in place — restore is just an UPDATE un-setting `deleted_at`. Members are not removed; their memberships persist alongside the soft-deleted row in case a restore path is added later. L4 @HasPermission ensures the caller is an admin; the owner-only check inside the handler narrows further.
272
+ * Owner-only. Sets `deleted_at` on the organizations row; subsequent reads filter it out. The Keycloak Organization is intentionally left in place — restore is just an UPDATE un-setting `deleted_at`. Members are not removed; their memberships persist alongside the soft-deleted row in case a restore path is added later. L4 @RequirePermission ensures the caller is an admin; the owner-only check inside the handler narrows further.
273
273
  *
274
274
  * > **Requires** `administer` on `organization` (SpiceDB permission expression).
275
275
  *
@@ -0,0 +1,64 @@
1
+ /**
2
+ * An asset as seen by an operator assigned to operate it — the operational identity fields, without the dashboard's lifecycle-management hints.
3
+ */
4
+ export interface OperatorAsset {
5
+ /** Stable UUID. */
6
+ id: string;
7
+ /** Top-level kind. */
8
+ kind: OperatorAsset.Kind;
9
+ /** Sub-kind within the kind (free-form). */
10
+ sub_kind?: string | undefined;
11
+ /** SAE J3016 autonomy level 0..5. */
12
+ autonomy_level?: number | undefined;
13
+ /** Lifecycle status. */
14
+ status: OperatorAsset.Status;
15
+ /** Display name. */
16
+ name?: string | undefined;
17
+ /** Vehicle Identification Number. */
18
+ vin?: string | undefined;
19
+ /** License plate. */
20
+ plate_number?: string | undefined;
21
+ /** Manufacturer. */
22
+ make?: string | undefined;
23
+ /** Model designation. */
24
+ model?: string | undefined;
25
+ /** Model year. */
26
+ year?: number | undefined;
27
+ /** Owning organization id. */
28
+ organization_id?: string | undefined;
29
+ /** Current primary operator (active assignment, role=primary). */
30
+ current_primary_operator_id?: string | undefined;
31
+ /** Object type discriminator. */
32
+ object: OperatorAsset.Object_;
33
+ }
34
+ export declare namespace OperatorAsset {
35
+ /** Top-level kind. */
36
+ const Kind: {
37
+ readonly GroundVehicle: "ground_vehicle";
38
+ readonly AerialVehicle: "aerial_vehicle";
39
+ readonly MarineVehicle: "marine_vehicle";
40
+ readonly Robot: "robot";
41
+ readonly Agv: "agv";
42
+ readonly Trailer: "trailer";
43
+ readonly Container: "container";
44
+ readonly Pallet: "pallet";
45
+ readonly Equipment: "equipment";
46
+ };
47
+ type Kind = (typeof Kind)[keyof typeof Kind];
48
+ /** Lifecycle status. */
49
+ const Status: {
50
+ readonly Active: "active";
51
+ readonly Maintenance: "maintenance";
52
+ readonly OutOfService: "out_of_service";
53
+ readonly Retired: "retired";
54
+ readonly Sold: "sold";
55
+ readonly Inactive: "inactive";
56
+ readonly Lost: "lost";
57
+ };
58
+ type Status = (typeof Status)[keyof typeof Status];
59
+ /** Object type discriminator. */
60
+ const Object_: {
61
+ readonly Asset: "asset";
62
+ };
63
+ type Object_ = (typeof Object_)[keyof typeof Object_];
64
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.OperatorAsset = void 0;
5
+ var OperatorAsset;
6
+ (function (OperatorAsset) {
7
+ /** Top-level kind. */
8
+ OperatorAsset.Kind = {
9
+ GroundVehicle: "ground_vehicle",
10
+ AerialVehicle: "aerial_vehicle",
11
+ MarineVehicle: "marine_vehicle",
12
+ Robot: "robot",
13
+ Agv: "agv",
14
+ Trailer: "trailer",
15
+ Container: "container",
16
+ Pallet: "pallet",
17
+ Equipment: "equipment",
18
+ };
19
+ /** Lifecycle status. */
20
+ OperatorAsset.Status = {
21
+ Active: "active",
22
+ Maintenance: "maintenance",
23
+ OutOfService: "out_of_service",
24
+ Retired: "retired",
25
+ Sold: "sold",
26
+ Inactive: "inactive",
27
+ Lost: "lost",
28
+ };
29
+ /** Object type discriminator. */
30
+ OperatorAsset.Object_ = {
31
+ Asset: "asset",
32
+ };
33
+ })(OperatorAsset || (exports.OperatorAsset = OperatorAsset = {}));
@@ -9,6 +9,8 @@ export interface User {
9
9
  /** Keycloak Organization id the user belongs to. Null for cross-tenant platform admins. */
10
10
  organization_id?: string | undefined;
11
11
  roles: string[];
12
+ /** The caller's effective permission ids for the active organization (epic #317): the union of catalog grants for every role they hold. Gate actions on these (`can("asset:create")`) rather than role strings, so frontend and backend reference the one catalog and cannot drift. Coarse and instance-independent; per-instance authority ('may delete THIS asset') is enforced server-side at the mutation, never precomputed here. */
13
+ permissions: User.Permissions.Item[];
12
14
  /** Email shadowed from Keycloak. Null until the user completes a profile. */
13
15
  email?: string | undefined;
14
16
  /** Display name shadowed from Keycloak. */
@@ -34,6 +36,26 @@ export declare namespace User {
34
36
  readonly Admin: "admin";
35
37
  };
36
38
  type Portal = (typeof Portal)[keyof typeof Portal];
39
+ type Permissions = Permissions.Item[];
40
+ namespace Permissions {
41
+ const Item: {
42
+ readonly AssetCreate: "asset:create";
43
+ readonly AssetDelete: "asset:delete";
44
+ readonly AssetDispose: "asset:dispose";
45
+ readonly AssetExport: "asset:export";
46
+ readonly AssetImport: "asset:import";
47
+ readonly AssetRead: "asset:read";
48
+ readonly AssetTransition: "asset:transition";
49
+ readonly AssetUpdate: "asset:update";
50
+ readonly KeycloakProjectionAdminister: "keycloak-projection:administer";
51
+ readonly NotificationDeliveryRead: "notification-delivery:read";
52
+ readonly OrgMaintenanceAdminister: "org-maintenance:administer";
53
+ readonly ServiceAccountAdminister: "service-account:administer";
54
+ readonly UserAdminister: "user:administer";
55
+ readonly UserInvite: "user:invite";
56
+ };
57
+ type Item = (typeof Item)[keyof typeof Item];
58
+ }
37
59
  /** Object type discriminator. */
38
60
  const Object_: {
39
61
  readonly User: "user";
@@ -14,6 +14,25 @@ var User;
14
14
  PlatformStaff: "platform_staff",
15
15
  Admin: "admin",
16
16
  };
17
+ let Permissions;
18
+ (function (Permissions) {
19
+ Permissions.Item = {
20
+ AssetCreate: "asset:create",
21
+ AssetDelete: "asset:delete",
22
+ AssetDispose: "asset:dispose",
23
+ AssetExport: "asset:export",
24
+ AssetImport: "asset:import",
25
+ AssetRead: "asset:read",
26
+ AssetTransition: "asset:transition",
27
+ AssetUpdate: "asset:update",
28
+ KeycloakProjectionAdminister: "keycloak-projection:administer",
29
+ NotificationDeliveryRead: "notification-delivery:read",
30
+ OrgMaintenanceAdminister: "org-maintenance:administer",
31
+ ServiceAccountAdminister: "service-account:administer",
32
+ UserAdminister: "user:administer",
33
+ UserInvite: "user:invite",
34
+ };
35
+ })(Permissions = User.Permissions || (User.Permissions = {}));
17
36
  /** Object type discriminator. */
18
37
  User.Object_ = {
19
38
  User: "user",
@@ -60,6 +60,7 @@ export * from "./NotificationsArchived.js";
60
60
  export * from "./NotificationsMarkedRead.js";
61
61
  export * from "./NotificationUnreadCount.js";
62
62
  export * from "./Operator.js";
63
+ export * from "./OperatorAsset.js";
63
64
  export * from "./OperatorPosition.js";
64
65
  export * from "./Organization.js";
65
66
  export * from "./Position.js";
@@ -76,6 +76,7 @@ __exportStar(require("./NotificationsArchived.js"), exports);
76
76
  __exportStar(require("./NotificationsMarkedRead.js"), exports);
77
77
  __exportStar(require("./NotificationUnreadCount.js"), exports);
78
78
  __exportStar(require("./Operator.js"), exports);
79
+ __exportStar(require("./OperatorAsset.js"), exports);
79
80
  __exportStar(require("./OperatorPosition.js"), exports);
80
81
  __exportStar(require("./Organization.js"), exports);
81
82
  __exportStar(require("./Position.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizam-os/dashboard-sdk",
3
- "version": "11.0.0",
3
+ "version": "11.1.0",
4
4
  "description": "Nizam Dashboard API SDK for TypeScript / JavaScript.",
5
5
  "license": "MIT",
6
6
  "private": false,