@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
@@ -32,6 +32,13 @@ export declare class AssignmentsClient {
32
32
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
33
33
  * role: "primary"
34
34
  * })
35
+ *
36
+ * @example
37
+ * await client.assignments.openAssignment({
38
+ * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
39
+ * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
40
+ * role: "safety_monitor"
41
+ * })
35
42
  */
36
43
  openAssignment(request: NizamDashboard.OpenAssignmentRequest, requestOptions?: AssignmentsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Assignment>;
37
44
  private __openAssignment;
@@ -69,6 +76,12 @@ export declare class AssignmentsClient {
69
76
  * id: "00000000-0000-0000-0000-000000000000",
70
77
  * reason: "shift_end"
71
78
  * })
79
+ *
80
+ * @example
81
+ * await client.assignments.closeAssignment({
82
+ * id: "00000000-0000-0000-0000-000000000000",
83
+ * reason: "incident"
84
+ * })
72
85
  */
73
86
  closeAssignment(request: NizamDashboard.CloseAssignmentRequest, requestOptions?: AssignmentsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Assignment>;
74
87
  private __closeAssignment;
@@ -68,6 +68,13 @@ class AssignmentsClient {
68
68
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
69
69
  * role: "primary"
70
70
  * })
71
+ *
72
+ * @example
73
+ * await client.assignments.openAssignment({
74
+ * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
75
+ * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
76
+ * role: "safety_monitor"
77
+ * })
71
78
  */
72
79
  openAssignment(request, requestOptions) {
73
80
  return core.HttpResponsePromise.fromPromise(this.__openAssignment(request, requestOptions));
@@ -193,6 +200,12 @@ class AssignmentsClient {
193
200
  * id: "00000000-0000-0000-0000-000000000000",
194
201
  * reason: "shift_end"
195
202
  * })
203
+ *
204
+ * @example
205
+ * await client.assignments.closeAssignment({
206
+ * id: "00000000-0000-0000-0000-000000000000",
207
+ * reason: "incident"
208
+ * })
196
209
  */
197
210
  closeAssignment(request, requestOptions) {
198
211
  return core.HttpResponsePromise.fromPromise(this.__closeAssignment(request, requestOptions));
@@ -4,6 +4,12 @@
4
4
  * id: "00000000-0000-0000-0000-000000000000",
5
5
  * reason: "shift_end"
6
6
  * }
7
+ *
8
+ * @example
9
+ * {
10
+ * id: "00000000-0000-0000-0000-000000000000",
11
+ * reason: "incident"
12
+ * }
7
13
  */
8
14
  export interface CloseAssignmentRequest {
9
15
  id: string;
@@ -5,6 +5,13 @@
5
5
  * operator_id: "c1d2e3f4-5a6b-7c8d-9e0f-1a2b3c4d5e6f",
6
6
  * role: "primary"
7
7
  * }
8
+ *
9
+ * @example
10
+ * {
11
+ * asset_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
12
+ * operator_id: "d2e3f4a5-6b7c-8d9e-0f1a-2b3c4d5e6f7a",
13
+ * role: "safety_monitor"
14
+ * }
8
15
  */
9
16
  export interface OpenAssignmentRequest {
10
17
  /** Asset id. */
@@ -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"));
@@ -28,8 +28,23 @@ export declare class InvitesClient {
28
28
  * await client.invites.createInvite({
29
29
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
30
30
  * email: "ali@nizam.ai",
31
+ * role: "admin"
32
+ * })
33
+ *
34
+ * @example
35
+ * await client.invites.createInvite({
36
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
37
+ * email: "jordan@example.com",
31
38
  * role: "dispatcher",
32
- * ttl_days: 7
39
+ * ttl_days: 14
40
+ * })
41
+ *
42
+ * @example
43
+ * await client.invites.createInvite({
44
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
45
+ * email: "auditor@partner.example",
46
+ * role: "viewer",
47
+ * ttl_days: 3
33
48
  * })
34
49
  */
35
50
  createInvite(request: NizamDashboard.CreateInviteRequest, requestOptions?: InvitesClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Invite>;
@@ -64,8 +64,23 @@ class InvitesClient {
64
64
  * await client.invites.createInvite({
65
65
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
66
66
  * email: "ali@nizam.ai",
67
+ * role: "admin"
68
+ * })
69
+ *
70
+ * @example
71
+ * await client.invites.createInvite({
72
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
73
+ * email: "jordan@example.com",
67
74
  * role: "dispatcher",
68
- * ttl_days: 7
75
+ * ttl_days: 14
76
+ * })
77
+ *
78
+ * @example
79
+ * await client.invites.createInvite({
80
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
81
+ * email: "auditor@partner.example",
82
+ * role: "viewer",
83
+ * ttl_days: 3
69
84
  * })
70
85
  */
71
86
  createInvite(request, requestOptions) {
@@ -3,8 +3,23 @@
3
3
  * {
4
4
  * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
5
5
  * email: "ali@nizam.ai",
6
+ * role: "admin"
7
+ * }
8
+ *
9
+ * @example
10
+ * {
11
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
12
+ * email: "jordan@example.com",
6
13
  * role: "dispatcher",
7
- * ttl_days: 7
14
+ * ttl_days: 14
15
+ * }
16
+ *
17
+ * @example
18
+ * {
19
+ * organization_id: "8f55f0eb-7d3a-4f2c-9c8d-a1b2c3d4e5f6",
20
+ * email: "auditor@partner.example",
21
+ * role: "viewer",
22
+ * ttl_days: 3
8
23
  * }
9
24
  */
10
25
  export interface CreateInviteRequest {
@@ -47,6 +47,11 @@ export declare class OrganizationsClient {
47
47
  *
48
48
  * @example
49
49
  * await client.organizations.createOrganization({
50
+ * name: "Acme Logistics"
51
+ * })
52
+ *
53
+ * @example
54
+ * await client.organizations.createOrganization({
50
55
  * name: "Acme Logistics",
51
56
  * slug: "acme-logistics",
52
57
  * primary_domain: "acme.com",
@@ -114,12 +119,15 @@ export declare class OrganizationsClient {
114
119
  * @example
115
120
  * await client.organizations.updateOrganization({
116
121
  * id: "00000000-0000-0000-0000-000000000000",
117
- * name: "Acme Logistics",
118
- * slug: "acme-logistics",
119
- * business_category: "third_party_logistics",
120
- * phone: "+15551234567",
121
- * country: "US",
122
- * timezone: "America/Los_Angeles"
122
+ * name: "Acme Freight"
123
+ * })
124
+ *
125
+ * @example
126
+ * await client.organizations.updateOrganization({
127
+ * id: "00000000-0000-0000-0000-000000000000",
128
+ * business_category: "courier",
129
+ * phone: "+15557654321",
130
+ * timezone: "America/New_York"
123
131
  * })
124
132
  */
125
133
  updateOrganization(request: NizamDashboard.UpdateOrganizationRequest, requestOptions?: OrganizationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Organization>;
@@ -135,6 +135,11 @@ class OrganizationsClient {
135
135
  *
136
136
  * @example
137
137
  * await client.organizations.createOrganization({
138
+ * name: "Acme Logistics"
139
+ * })
140
+ *
141
+ * @example
142
+ * await client.organizations.createOrganization({
138
143
  * name: "Acme Logistics",
139
144
  * slug: "acme-logistics",
140
145
  * primary_domain: "acme.com",
@@ -329,12 +334,15 @@ class OrganizationsClient {
329
334
  * @example
330
335
  * await client.organizations.updateOrganization({
331
336
  * id: "00000000-0000-0000-0000-000000000000",
332
- * name: "Acme Logistics",
333
- * slug: "acme-logistics",
334
- * business_category: "third_party_logistics",
335
- * phone: "+15551234567",
336
- * country: "US",
337
- * timezone: "America/Los_Angeles"
337
+ * name: "Acme Freight"
338
+ * })
339
+ *
340
+ * @example
341
+ * await client.organizations.updateOrganization({
342
+ * id: "00000000-0000-0000-0000-000000000000",
343
+ * business_category: "courier",
344
+ * phone: "+15557654321",
345
+ * timezone: "America/New_York"
338
346
  * })
339
347
  */
340
348
  updateOrganization(request, requestOptions) {
@@ -1,4 +1,9 @@
1
1
  /**
2
+ * @example
3
+ * {
4
+ * name: "Acme Logistics"
5
+ * }
6
+ *
2
7
  * @example
3
8
  * {
4
9
  * name: "Acme Logistics",
@@ -2,12 +2,15 @@
2
2
  * @example
3
3
  * {
4
4
  * id: "00000000-0000-0000-0000-000000000000",
5
- * name: "Acme Logistics",
6
- * slug: "acme-logistics",
7
- * business_category: "third_party_logistics",
8
- * phone: "+15551234567",
9
- * country: "US",
10
- * timezone: "America/Los_Angeles"
5
+ * name: "Acme Freight"
6
+ * }
7
+ *
8
+ * @example
9
+ * {
10
+ * id: "00000000-0000-0000-0000-000000000000",
11
+ * business_category: "courier",
12
+ * phone: "+15557654321",
13
+ * timezone: "America/New_York"
11
14
  * }
12
15
  */
13
16
  export interface UpdateOrganizationRequest {
@@ -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);
@@ -72,6 +72,11 @@ export declare class UsersClient {
72
72
  * email: "newhire@acme.example",
73
73
  * name: "New Hire"
74
74
  * })
75
+ *
76
+ * @example
77
+ * await client.users.inviteUser({
78
+ * email: "newhire@acme.example"
79
+ * })
75
80
  */
76
81
  inviteUser(request: NizamDashboard.InviteUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.UserResource>;
77
82
  private __inviteUser;
@@ -202,6 +202,11 @@ class UsersClient {
202
202
  * email: "newhire@acme.example",
203
203
  * name: "New Hire"
204
204
  * })
205
+ *
206
+ * @example
207
+ * await client.users.inviteUser({
208
+ * email: "newhire@acme.example"
209
+ * })
205
210
  */
206
211
  inviteUser(request, requestOptions) {
207
212
  return core.HttpResponsePromise.fromPromise(this.__inviteUser(request, requestOptions));
@@ -4,6 +4,11 @@
4
4
  * email: "newhire@acme.example",
5
5
  * name: "New Hire"
6
6
  * }
7
+ *
8
+ * @example
9
+ * {
10
+ * email: "newhire@acme.example"
11
+ * }
7
12
  */
8
13
  export interface InviteUserRequest {
9
14
  /** Recipient email. */
@@ -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 = {}));