@nizam-os/dashboard-sdk 5.2.1 → 5.3.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 (33) hide show
  1. package/dist/Client.d.ts +6 -0
  2. package/dist/Client.js +24 -16
  3. package/dist/api/resources/activity/client/Client.d.ts +36 -0
  4. package/dist/api/resources/activity/client/Client.js +128 -0
  5. package/dist/api/resources/activity/client/index.d.ts +1 -0
  6. package/dist/api/resources/activity/client/index.js +17 -0
  7. package/dist/api/resources/activity/client/requests/ListActivityRequest.d.ts +20 -0
  8. package/dist/api/resources/activity/client/requests/ListActivityRequest.js +3 -0
  9. package/dist/api/resources/activity/client/requests/index.d.ts +1 -0
  10. package/dist/api/resources/activity/client/requests/index.js +2 -0
  11. package/dist/api/resources/activity/exports.d.ts +2 -0
  12. package/dist/api/resources/activity/exports.js +21 -0
  13. package/dist/api/resources/activity/index.d.ts +1 -0
  14. package/dist/api/resources/activity/index.js +17 -0
  15. package/dist/api/resources/index.d.ts +3 -0
  16. package/dist/api/resources/index.js +4 -1
  17. package/dist/api/resources/realtime/client/Client.d.ts +30 -0
  18. package/dist/api/resources/realtime/client/Client.js +105 -0
  19. package/dist/api/resources/realtime/client/index.d.ts +1 -0
  20. package/dist/api/resources/realtime/client/index.js +2 -0
  21. package/dist/api/resources/realtime/exports.d.ts +2 -0
  22. package/dist/api/resources/realtime/exports.js +21 -0
  23. package/dist/api/resources/realtime/index.d.ts +1 -0
  24. package/dist/api/resources/realtime/index.js +17 -0
  25. package/dist/api/types/ActivityResource.d.ts +55 -0
  26. package/dist/api/types/ActivityResource.js +31 -0
  27. package/dist/api/types/ListResponseActivityResource.d.ts +27 -0
  28. package/dist/api/types/ListResponseActivityResource.js +11 -0
  29. package/dist/api/types/RealtimeTicket.d.ts +18 -0
  30. package/dist/api/types/RealtimeTicket.js +11 -0
  31. package/dist/api/types/index.d.ts +3 -0
  32. package/dist/api/types/index.js +3 -0
  33. 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.
@@ -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);
@@ -1,5 +1,7 @@
1
1
  export * from "./activeOrganization/client/requests/index.js";
2
2
  export * as activeOrganization from "./activeOrganization/index.js";
3
+ export * from "./activity/client/requests/index.js";
4
+ export * as activity from "./activity/index.js";
3
5
  export * from "./assets/client/requests/index.js";
4
6
  export * as assets from "./assets/index.js";
5
7
  export * from "./assignments/client/requests/index.js";
@@ -13,5 +15,6 @@ export * from "./operators/client/requests/index.js";
13
15
  export * as operators from "./operators/index.js";
14
16
  export * from "./organizations/client/requests/index.js";
15
17
  export * as organizations from "./organizations/index.js";
18
+ export * as realtime from "./realtime/index.js";
16
19
  export * from "./users/client/requests/index.js";
17
20
  export * as users from "./users/index.js";
@@ -36,9 +36,11 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.users = exports.organizations = exports.operators = exports.memberships = exports.lookups = exports.invites = exports.assignments = exports.assets = exports.activeOrganization = void 0;
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;
40
40
  __exportStar(require("./activeOrganization/client/requests/index.js"), exports);
41
41
  exports.activeOrganization = __importStar(require("./activeOrganization/index.js"));
42
+ __exportStar(require("./activity/client/requests/index.js"), exports);
43
+ exports.activity = __importStar(require("./activity/index.js"));
42
44
  __exportStar(require("./assets/client/requests/index.js"), exports);
43
45
  exports.assets = __importStar(require("./assets/index.js"));
44
46
  __exportStar(require("./assignments/client/requests/index.js"), exports);
@@ -52,5 +54,6 @@ __exportStar(require("./operators/client/requests/index.js"), exports);
52
54
  exports.operators = __importStar(require("./operators/index.js"));
53
55
  __exportStar(require("./organizations/client/requests/index.js"), exports);
54
56
  exports.organizations = __importStar(require("./organizations/index.js"));
57
+ exports.realtime = __importStar(require("./realtime/index.js"));
55
58
  __exportStar(require("./users/client/requests/index.js"), exports);
56
59
  exports.users = __importStar(require("./users/index.js"));
@@ -0,0 +1,30 @@
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 RealtimeClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * Realtime (STOMP/WebSocket) session bootstrap — mint a ticket to open a connection.
12
+ */
13
+ export declare class RealtimeClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<RealtimeClient.Options>;
15
+ constructor(options: RealtimeClient.Options);
16
+ /**
17
+ * Returns a short-lived ticket to present as `Authorization: Bearer <ticket>` on the STOMP CONNECT frame to `/ws`. Browser clients need this because their Keycloak access token lives in an HTTP-only cookie that JavaScript cannot read; native/mobile clients holding a Keycloak access token may present it directly on CONNECT and skip this call. Mint a fresh ticket per connection attempt — it expires within seconds.
18
+ *
19
+ * @param {RealtimeClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link NizamDashboard.UnauthorizedError}
22
+ * @throws {@link NizamDashboard.ForbiddenError}
23
+ * @throws {@link NizamDashboard.InternalServerError}
24
+ *
25
+ * @example
26
+ * await client.realtime.createRealtimeTicket()
27
+ */
28
+ createRealtimeTicket(requestOptions?: RealtimeClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.RealtimeTicket>;
29
+ private __createRealtimeTicket;
30
+ }
@@ -0,0 +1,105 @@
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.RealtimeClient = 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
+ * Realtime (STOMP/WebSocket) session bootstrap — mint a ticket to open a connection.
47
+ */
48
+ class RealtimeClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * Returns a short-lived ticket to present as `Authorization: Bearer <ticket>` on the STOMP CONNECT frame to `/ws`. Browser clients need this because their Keycloak access token lives in an HTTP-only cookie that JavaScript cannot read; native/mobile clients holding a Keycloak access token may present it directly on CONNECT and skip this call. Mint a fresh ticket per connection attempt — it expires within seconds.
54
+ *
55
+ * @param {RealtimeClient.RequestOptions} requestOptions - Request-specific configuration.
56
+ *
57
+ * @throws {@link NizamDashboard.UnauthorizedError}
58
+ * @throws {@link NizamDashboard.ForbiddenError}
59
+ * @throws {@link NizamDashboard.InternalServerError}
60
+ *
61
+ * @example
62
+ * await client.realtime.createRealtimeTicket()
63
+ */
64
+ createRealtimeTicket(requestOptions) {
65
+ return core.HttpResponsePromise.fromPromise(this.__createRealtimeTicket(requestOptions));
66
+ }
67
+ async __createRealtimeTicket(requestOptions) {
68
+ const _authRequest = await this._options.authProvider.getAuthRequest();
69
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
70
+ const _response = await core.fetcher({
71
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
72
+ (await core.Supplier.get(this._options.environment)) ??
73
+ environments.NizamDashboardEnvironment.Production, "v1/realtime/tickets"),
74
+ method: "POST",
75
+ headers: _headers,
76
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
77
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
78
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
79
+ abortSignal: requestOptions?.abortSignal,
80
+ fetchFn: this._options?.fetch,
81
+ logging: this._options.logging,
82
+ });
83
+ if (_response.ok) {
84
+ return { data: _response.body, rawResponse: _response.rawResponse };
85
+ }
86
+ if (_response.error.reason === "status-code") {
87
+ switch (_response.error.statusCode) {
88
+ case 401:
89
+ throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
90
+ case 403:
91
+ throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
92
+ case 500:
93
+ throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
94
+ default:
95
+ throw new errors.NizamDashboardError({
96
+ statusCode: _response.error.statusCode,
97
+ body: _response.error.body,
98
+ rawResponse: _response.rawResponse,
99
+ });
100
+ }
101
+ }
102
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/realtime/tickets");
103
+ }
104
+ }
105
+ exports.RealtimeClient = RealtimeClient;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ export { RealtimeClient } 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.RealtimeClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "RealtimeClient", { enumerable: true, get: function () { return Client_js_1.RealtimeClient; } });
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);
@@ -0,0 +1,55 @@
1
+ /**
2
+ * One entry in an organization's activity feed (append-only audit timeline).
3
+ */
4
+ export interface ActivityResource {
5
+ /** Stable UUID of this activity row — the resource id and pagination key. */
6
+ id?: string | undefined;
7
+ /** Per-publication idempotency key — equal to the realtime ActivityFeedItem's `id` for the same event, so a client can dedupe realtime against REST. Null for directly-written audit rows. */
8
+ event_id?: string | undefined;
9
+ /** Canonical event verb. */
10
+ event?: ActivityResource.Event | undefined;
11
+ /** Human-readable narrative shown in the feed UI. */
12
+ description?: string | undefined;
13
+ /** Type of the entity the action targeted (polymorphic subject). */
14
+ subject_type?: string | undefined;
15
+ /** Id of the entity the action targeted. */
16
+ subject_id?: string | undefined;
17
+ /** Type of the actor that performed the action. */
18
+ causer_type?: string | undefined;
19
+ /** Id of the actor that performed the action. Null for system/scheduled actions. */
20
+ causer_id?: string | undefined;
21
+ /** Optional UI filtering bucket. */
22
+ log_name?: string | undefined;
23
+ /** When the activity was recorded — the authoritative timestamp. */
24
+ occurred_at?: string | undefined;
25
+ /** Object type discriminator (Stripe pattern). */
26
+ object?: ActivityResource.Object_ | undefined;
27
+ }
28
+ export declare namespace ActivityResource {
29
+ /** Canonical event verb. */
30
+ const Event: {
31
+ readonly Created: "created";
32
+ readonly Updated: "updated";
33
+ readonly Deleted: "deleted";
34
+ readonly Restored: "restored";
35
+ readonly StateChanged: "state_changed";
36
+ readonly Assigned: "assigned";
37
+ readonly Unassigned: "unassigned";
38
+ readonly Completed: "completed";
39
+ readonly Failed: "failed";
40
+ readonly Cancelled: "cancelled";
41
+ readonly Sent: "sent";
42
+ readonly Received: "received";
43
+ readonly Attached: "attached";
44
+ readonly Detached: "detached";
45
+ readonly LoggedIn: "logged_in";
46
+ readonly LoggedOut: "logged_out";
47
+ readonly Custom: "custom";
48
+ };
49
+ type Event = (typeof Event)[keyof typeof Event];
50
+ /** Object type discriminator (Stripe pattern). */
51
+ const Object_: {
52
+ readonly Activity: "activity";
53
+ };
54
+ type Object_ = (typeof Object_)[keyof typeof Object_];
55
+ }
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ActivityResource = void 0;
5
+ var ActivityResource;
6
+ (function (ActivityResource) {
7
+ /** Canonical event verb. */
8
+ ActivityResource.Event = {
9
+ Created: "created",
10
+ Updated: "updated",
11
+ Deleted: "deleted",
12
+ Restored: "restored",
13
+ StateChanged: "state_changed",
14
+ Assigned: "assigned",
15
+ Unassigned: "unassigned",
16
+ Completed: "completed",
17
+ Failed: "failed",
18
+ Cancelled: "cancelled",
19
+ Sent: "sent",
20
+ Received: "received",
21
+ Attached: "attached",
22
+ Detached: "detached",
23
+ LoggedIn: "logged_in",
24
+ LoggedOut: "logged_out",
25
+ Custom: "custom",
26
+ };
27
+ /** Object type discriminator (Stripe pattern). */
28
+ ActivityResource.Object_ = {
29
+ Activity: "activity",
30
+ };
31
+ })(ActivityResource || (exports.ActivityResource = ActivityResource = {}));
@@ -0,0 +1,27 @@
1
+ import type * as NizamDashboard from "../index.js";
2
+ /**
3
+ * Envelope for paginated list responses (Stripe-style cursor pagination).
4
+ */
5
+ export interface ListResponseActivityResource {
6
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
7
+ object?: ListResponseActivityResource.Object_ | undefined;
8
+ /** Page of resources. Empty array when there are no matches. */
9
+ data?: NizamDashboard.ActivityResource[] | undefined;
10
+ /** True when more pages exist; pass `next_cursor` as `?starting_after=` to fetch the next page. */
11
+ has_more?: boolean | undefined;
12
+ /** True when earlier pages exist; pass `prev_cursor` as `?ending_before=` to fetch the previous page. */
13
+ has_previous?: boolean | undefined;
14
+ /** Opaque cursor for the next page. `null` on the last page. */
15
+ next_cursor?: string | undefined;
16
+ /** Opaque cursor for the previous page. `null` on the first page. */
17
+ prev_cursor?: string | undefined;
18
+ /** Page size that produced this response. */
19
+ limit?: number | undefined;
20
+ }
21
+ export declare namespace ListResponseActivityResource {
22
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
23
+ const Object_: {
24
+ readonly List: "list";
25
+ };
26
+ type Object_ = (typeof Object_)[keyof typeof Object_];
27
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ListResponseActivityResource = void 0;
5
+ var ListResponseActivityResource;
6
+ (function (ListResponseActivityResource) {
7
+ /** Object type discriminator (Stripe pattern). Always `list` for this envelope. */
8
+ ListResponseActivityResource.Object_ = {
9
+ List: "list",
10
+ };
11
+ })(ListResponseActivityResource || (exports.ListResponseActivityResource = ListResponseActivityResource = {}));
@@ -0,0 +1,18 @@
1
+ /**
2
+ * A short-lived ticket authorizing a single realtime (STOMP/WebSocket) connection.
3
+ */
4
+ export interface RealtimeTicket {
5
+ /** The signed ticket. Send it as `Authorization: Bearer <ticket>` on the STOMP CONNECT frame to /ws. Opaque to the client; do not parse or store it. */
6
+ ticket?: string | undefined;
7
+ /** When the ticket expires (ISO-8601). Connect promptly; mint a fresh ticket for each new connection attempt. */
8
+ expires_at?: string | undefined;
9
+ /** Object type discriminator (Stripe pattern). */
10
+ object?: RealtimeTicket.Object_ | undefined;
11
+ }
12
+ export declare namespace RealtimeTicket {
13
+ /** Object type discriminator (Stripe pattern). */
14
+ const Object_: {
15
+ readonly RealtimeTicket: "realtime_ticket";
16
+ };
17
+ type Object_ = (typeof Object_)[keyof typeof Object_];
18
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RealtimeTicket = void 0;
5
+ var RealtimeTicket;
6
+ (function (RealtimeTicket) {
7
+ /** Object type discriminator (Stripe pattern). */
8
+ RealtimeTicket.Object_ = {
9
+ RealtimeTicket: "realtime_ticket",
10
+ };
11
+ })(RealtimeTicket || (exports.RealtimeTicket = RealtimeTicket = {}));
@@ -1,4 +1,5 @@
1
1
  export * from "./ActiveOrganization.js";
2
+ export * from "./ActivityResource.js";
2
3
  export * from "./ApiFieldError.js";
3
4
  export * from "./Asset.js";
4
5
  export * from "./Assignment.js";
@@ -12,6 +13,7 @@ export * from "./Currency.js";
12
13
  export * from "./InternalUserUpdateRequest.js";
13
14
  export * from "./Invite.js";
14
15
  export * from "./Language.js";
16
+ export * from "./ListResponseActivityResource.js";
15
17
  export * from "./ListResponseBusinessCategory.js";
16
18
  export * from "./ListResponseCountry.js";
17
19
  export * from "./ListResponseCurrency.js";
@@ -26,6 +28,7 @@ export * from "./MembershipDriftResponse.js";
26
28
  export * from "./Operator.js";
27
29
  export * from "./Organization.js";
28
30
  export * from "./ProblemDetail.js";
31
+ export * from "./RealtimeTicket.js";
29
32
  export * from "./ReconcileResponse.js";
30
33
  export * from "./Timezone.js";
31
34
  export * from "./User.js";
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./ActiveOrganization.js"), exports);
18
+ __exportStar(require("./ActivityResource.js"), exports);
18
19
  __exportStar(require("./ApiFieldError.js"), exports);
19
20
  __exportStar(require("./Asset.js"), exports);
20
21
  __exportStar(require("./Assignment.js"), exports);
@@ -28,6 +29,7 @@ __exportStar(require("./Currency.js"), exports);
28
29
  __exportStar(require("./InternalUserUpdateRequest.js"), exports);
29
30
  __exportStar(require("./Invite.js"), exports);
30
31
  __exportStar(require("./Language.js"), exports);
32
+ __exportStar(require("./ListResponseActivityResource.js"), exports);
31
33
  __exportStar(require("./ListResponseBusinessCategory.js"), exports);
32
34
  __exportStar(require("./ListResponseCountry.js"), exports);
33
35
  __exportStar(require("./ListResponseCurrency.js"), exports);
@@ -42,6 +44,7 @@ __exportStar(require("./MembershipDriftResponse.js"), exports);
42
44
  __exportStar(require("./Operator.js"), exports);
43
45
  __exportStar(require("./Organization.js"), exports);
44
46
  __exportStar(require("./ProblemDetail.js"), exports);
47
+ __exportStar(require("./RealtimeTicket.js"), exports);
45
48
  __exportStar(require("./ReconcileResponse.js"), exports);
46
49
  __exportStar(require("./Timezone.js"), exports);
47
50
  __exportStar(require("./User.js"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nizam-os/dashboard-sdk",
3
- "version": "5.2.1",
3
+ "version": "5.3.0",
4
4
  "description": "Nizam Dashboard API SDK for TypeScript / JavaScript.",
5
5
  "license": "MIT",
6
6
  "private": false,