@nizam-os/operator-sdk 2.8.3 → 2.9.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 (137) hide show
  1. package/dist/Client.d.ts +9 -0
  2. package/dist/Client.js +26 -14
  3. package/dist/api/resources/devices/client/Client.d.ts +71 -0
  4. package/dist/api/resources/devices/client/Client.js +238 -0
  5. package/dist/api/resources/devices/client/index.d.ts +1 -0
  6. package/dist/api/resources/devices/client/index.js +17 -0
  7. package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.d.ts +9 -0
  8. package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.js +3 -0
  9. package/dist/api/resources/devices/client/requests/RegisterDevice.d.ts +22 -0
  10. package/dist/api/resources/devices/client/requests/RegisterDevice.js +13 -0
  11. package/dist/api/resources/devices/client/requests/index.d.ts +2 -0
  12. package/dist/api/resources/devices/client/requests/index.js +5 -0
  13. package/dist/api/resources/devices/exports.d.ts +2 -0
  14. package/dist/api/resources/devices/exports.js +21 -0
  15. package/dist/api/resources/devices/index.d.ts +1 -0
  16. package/dist/api/resources/devices/index.js +17 -0
  17. package/dist/api/resources/index.d.ts +6 -0
  18. package/dist/api/resources/index.js +7 -1
  19. package/dist/api/resources/notificationPreferences/client/Client.d.ts +49 -0
  20. package/dist/api/resources/notificationPreferences/client/Client.js +175 -0
  21. package/dist/api/resources/notificationPreferences/client/index.d.ts +1 -0
  22. package/dist/api/resources/notificationPreferences/client/index.js +17 -0
  23. package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.d.ts +11 -0
  24. package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.js +3 -0
  25. package/dist/api/resources/notificationPreferences/client/requests/index.d.ts +1 -0
  26. package/dist/api/resources/notificationPreferences/client/requests/index.js +2 -0
  27. package/dist/api/resources/notificationPreferences/exports.d.ts +2 -0
  28. package/dist/api/resources/notificationPreferences/exports.js +21 -0
  29. package/dist/api/resources/notificationPreferences/index.d.ts +1 -0
  30. package/dist/api/resources/notificationPreferences/index.js +17 -0
  31. package/dist/api/resources/notifications/client/Client.d.ts +88 -0
  32. package/dist/api/resources/notifications/client/Client.js +316 -0
  33. package/dist/api/resources/notifications/client/index.d.ts +1 -0
  34. package/dist/api/resources/notifications/client/index.js +17 -0
  35. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +22 -0
  36. package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.js +3 -0
  37. package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.d.ts +9 -0
  38. package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.js +3 -0
  39. package/dist/api/resources/notifications/client/requests/index.d.ts +2 -0
  40. package/dist/api/resources/notifications/client/requests/index.js +2 -0
  41. package/dist/api/resources/notifications/exports.d.ts +2 -0
  42. package/dist/api/resources/notifications/exports.js +21 -0
  43. package/dist/api/resources/notifications/index.d.ts +1 -0
  44. package/dist/api/resources/notifications/index.js +17 -0
  45. package/dist/api/types/ActiveOrganization.d.ts +2 -2
  46. package/dist/api/types/ActiveOrganization.js +1 -1
  47. package/dist/api/types/ActivityResource.d.ts +2 -2
  48. package/dist/api/types/ActivityResource.js +1 -1
  49. package/dist/api/types/Asset.d.ts +2 -2
  50. package/dist/api/types/Asset.js +1 -1
  51. package/dist/api/types/AssetListItem.d.ts +2 -2
  52. package/dist/api/types/AssetListItem.js +1 -1
  53. package/dist/api/types/Assignment.d.ts +2 -2
  54. package/dist/api/types/Assignment.js +1 -1
  55. package/dist/api/types/BusinessCategory.d.ts +2 -2
  56. package/dist/api/types/BusinessCategory.js +1 -1
  57. package/dist/api/types/Country.d.ts +2 -2
  58. package/dist/api/types/Country.js +1 -1
  59. package/dist/api/types/Currency.d.ts +2 -2
  60. package/dist/api/types/Currency.js +1 -1
  61. package/dist/api/types/Device.d.ts +24 -0
  62. package/dist/api/types/Device.js +11 -0
  63. package/dist/api/types/Devices.d.ts +17 -0
  64. package/dist/api/types/Devices.js +11 -0
  65. package/dist/api/types/Invite.d.ts +2 -2
  66. package/dist/api/types/Invite.js +1 -1
  67. package/dist/api/types/Language.d.ts +2 -2
  68. package/dist/api/types/Language.js +1 -1
  69. package/dist/api/types/ListResponseActivityResource.d.ts +3 -3
  70. package/dist/api/types/ListResponseActivityResource.js +1 -1
  71. package/dist/api/types/ListResponseAssetListItem.d.ts +3 -3
  72. package/dist/api/types/ListResponseAssetListItem.js +1 -1
  73. package/dist/api/types/ListResponseBusinessCategory.d.ts +3 -3
  74. package/dist/api/types/ListResponseBusinessCategory.js +1 -1
  75. package/dist/api/types/ListResponseCountry.d.ts +3 -3
  76. package/dist/api/types/ListResponseCountry.js +1 -1
  77. package/dist/api/types/ListResponseCurrency.d.ts +3 -3
  78. package/dist/api/types/ListResponseCurrency.js +1 -1
  79. package/dist/api/types/ListResponseFile.d.ts +3 -3
  80. package/dist/api/types/ListResponseFile.js +1 -1
  81. package/dist/api/types/ListResponseHeatmapCell.d.ts +3 -3
  82. package/dist/api/types/ListResponseHeatmapCell.js +1 -1
  83. package/dist/api/types/ListResponseJob.d.ts +3 -3
  84. package/dist/api/types/ListResponseJob.js +1 -1
  85. package/dist/api/types/ListResponseLanguage.d.ts +3 -3
  86. package/dist/api/types/ListResponseLanguage.js +1 -1
  87. package/dist/api/types/ListResponseMembership.d.ts +3 -3
  88. package/dist/api/types/ListResponseMembership.js +1 -1
  89. package/dist/api/types/ListResponseNotification.d.ts +27 -0
  90. package/dist/api/types/ListResponseNotification.js +11 -0
  91. package/dist/api/types/ListResponseNotificationDeadLetter.d.ts +27 -0
  92. package/dist/api/types/ListResponseNotificationDeadLetter.js +11 -0
  93. package/dist/api/types/ListResponseOperatorPosition.d.ts +3 -3
  94. package/dist/api/types/ListResponseOperatorPosition.js +1 -1
  95. package/dist/api/types/ListResponseOrganization.d.ts +3 -3
  96. package/dist/api/types/ListResponseOrganization.js +1 -1
  97. package/dist/api/types/ListResponsePosition.d.ts +3 -3
  98. package/dist/api/types/ListResponsePosition.js +1 -1
  99. package/dist/api/types/ListResponseTimezone.d.ts +3 -3
  100. package/dist/api/types/ListResponseTimezone.js +1 -1
  101. package/dist/api/types/ListResponseUserResource.d.ts +3 -3
  102. package/dist/api/types/ListResponseUserResource.js +1 -1
  103. package/dist/api/types/Membership.d.ts +2 -2
  104. package/dist/api/types/Membership.js +1 -1
  105. package/dist/api/types/Notification.d.ts +48 -0
  106. package/dist/api/types/Notification.js +27 -0
  107. package/dist/api/types/NotificationDeadLetter.d.ts +36 -0
  108. package/dist/api/types/NotificationDeadLetter.js +11 -0
  109. package/dist/api/types/NotificationPreference.d.ts +13 -0
  110. package/dist/api/types/NotificationPreference.js +3 -0
  111. package/dist/api/types/NotificationPreferenceItem.d.ts +13 -0
  112. package/dist/api/types/NotificationPreferenceItem.js +3 -0
  113. package/dist/api/types/NotificationPreferences.d.ts +17 -0
  114. package/dist/api/types/NotificationPreferences.js +11 -0
  115. package/dist/api/types/NotificationUnreadCount.d.ts +16 -0
  116. package/dist/api/types/NotificationUnreadCount.js +11 -0
  117. package/dist/api/types/NotificationsMarkedRead.d.ts +16 -0
  118. package/dist/api/types/NotificationsMarkedRead.js +11 -0
  119. package/dist/api/types/Operator.d.ts +2 -2
  120. package/dist/api/types/Operator.js +1 -1
  121. package/dist/api/types/Organization.d.ts +2 -2
  122. package/dist/api/types/Organization.js +1 -1
  123. package/dist/api/types/QuietHours.d.ts +11 -0
  124. package/dist/api/types/QuietHours.js +3 -0
  125. package/dist/api/types/RealtimeTicket.d.ts +2 -2
  126. package/dist/api/types/RealtimeTicket.js +1 -1
  127. package/dist/api/types/ReconcileResponse.d.ts +2 -2
  128. package/dist/api/types/ReconcileResponse.js +1 -1
  129. package/dist/api/types/Timezone.d.ts +2 -2
  130. package/dist/api/types/Timezone.js +1 -1
  131. package/dist/api/types/User.d.ts +2 -2
  132. package/dist/api/types/User.js +1 -1
  133. package/dist/api/types/UserResource.d.ts +2 -2
  134. package/dist/api/types/UserResource.js +1 -1
  135. package/dist/api/types/index.d.ts +12 -0
  136. package/dist/api/types/index.js +12 -0
  137. package/package.json +1 -1
package/dist/Client.d.ts CHANGED
@@ -1,6 +1,9 @@
1
+ import { DevicesClient } from "./api/resources/devices/client/Client.js";
1
2
  import { FilesClient } from "./api/resources/files/client/Client.js";
2
3
  import { InvitesClient } from "./api/resources/invites/client/Client.js";
3
4
  import { LookupsClient } from "./api/resources/lookups/client/Client.js";
5
+ import { NotificationPreferencesClient } from "./api/resources/notificationPreferences/client/Client.js";
6
+ import { NotificationsClient } from "./api/resources/notifications/client/Client.js";
4
7
  import { PositionsClient } from "./api/resources/positions/client/Client.js";
5
8
  import { RealtimeClient } from "./api/resources/realtime/client/Client.js";
6
9
  import { TaskAttemptsClient } from "./api/resources/taskAttempts/client/Client.js";
@@ -19,7 +22,10 @@ export declare class NizamOperatorRuntimeClient {
19
22
  protected _invites: InvitesClient | undefined;
20
23
  protected _lookups: LookupsClient | undefined;
21
24
  protected _users: UsersClient | undefined;
25
+ protected _devices: DevicesClient | undefined;
22
26
  protected _positions: PositionsClient | undefined;
27
+ protected _notificationPreferences: NotificationPreferencesClient | undefined;
28
+ protected _notifications: NotificationsClient | undefined;
23
29
  protected _realtime: RealtimeClient | undefined;
24
30
  protected _taskAttempts: TaskAttemptsClient | undefined;
25
31
  constructor(options: NizamOperatorRuntimeClient.Options);
@@ -27,7 +33,10 @@ export declare class NizamOperatorRuntimeClient {
27
33
  get invites(): InvitesClient;
28
34
  get lookups(): LookupsClient;
29
35
  get users(): UsersClient;
36
+ get devices(): DevicesClient;
30
37
  get positions(): PositionsClient;
38
+ get notificationPreferences(): NotificationPreferencesClient;
39
+ get notifications(): NotificationsClient;
31
40
  get realtime(): RealtimeClient;
32
41
  get taskAttempts(): TaskAttemptsClient;
33
42
  /**
package/dist/Client.js CHANGED
@@ -35,13 +35,16 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.NizamOperatorRuntimeClient = void 0;
38
- const Client_js_1 = require("./api/resources/files/client/Client.js");
39
- const Client_js_2 = require("./api/resources/invites/client/Client.js");
40
- const Client_js_3 = require("./api/resources/lookups/client/Client.js");
41
- const Client_js_4 = require("./api/resources/positions/client/Client.js");
42
- const Client_js_5 = require("./api/resources/realtime/client/Client.js");
43
- const Client_js_6 = require("./api/resources/taskAttempts/client/Client.js");
44
- const Client_js_7 = require("./api/resources/users/client/Client.js");
38
+ const Client_js_1 = require("./api/resources/devices/client/Client.js");
39
+ const Client_js_2 = require("./api/resources/files/client/Client.js");
40
+ const Client_js_3 = require("./api/resources/invites/client/Client.js");
41
+ const Client_js_4 = require("./api/resources/lookups/client/Client.js");
42
+ const Client_js_5 = require("./api/resources/notificationPreferences/client/Client.js");
43
+ const Client_js_6 = require("./api/resources/notifications/client/Client.js");
44
+ const Client_js_7 = require("./api/resources/positions/client/Client.js");
45
+ const Client_js_8 = require("./api/resources/realtime/client/Client.js");
46
+ const Client_js_9 = require("./api/resources/taskAttempts/client/Client.js");
47
+ const Client_js_10 = require("./api/resources/users/client/Client.js");
45
48
  const BaseClient_js_1 = require("./BaseClient.js");
46
49
  const core = __importStar(require("./core/index.js"));
47
50
  class NizamOperatorRuntimeClient {
@@ -49,25 +52,34 @@ class NizamOperatorRuntimeClient {
49
52
  this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
50
53
  }
51
54
  get files() {
52
- return (this._files ?? (this._files = new Client_js_1.FilesClient(this._options)));
55
+ return (this._files ?? (this._files = new Client_js_2.FilesClient(this._options)));
53
56
  }
54
57
  get invites() {
55
- return (this._invites ?? (this._invites = new Client_js_2.InvitesClient(this._options)));
58
+ return (this._invites ?? (this._invites = new Client_js_3.InvitesClient(this._options)));
56
59
  }
57
60
  get lookups() {
58
- return (this._lookups ?? (this._lookups = new Client_js_3.LookupsClient(this._options)));
61
+ return (this._lookups ?? (this._lookups = new Client_js_4.LookupsClient(this._options)));
59
62
  }
60
63
  get users() {
61
- return (this._users ?? (this._users = new Client_js_7.UsersClient(this._options)));
64
+ return (this._users ?? (this._users = new Client_js_10.UsersClient(this._options)));
65
+ }
66
+ get devices() {
67
+ return (this._devices ?? (this._devices = new Client_js_1.DevicesClient(this._options)));
62
68
  }
63
69
  get positions() {
64
- return (this._positions ?? (this._positions = new Client_js_4.PositionsClient(this._options)));
70
+ return (this._positions ?? (this._positions = new Client_js_7.PositionsClient(this._options)));
71
+ }
72
+ get notificationPreferences() {
73
+ return (this._notificationPreferences ?? (this._notificationPreferences = new Client_js_5.NotificationPreferencesClient(this._options)));
74
+ }
75
+ get notifications() {
76
+ return (this._notifications ?? (this._notifications = new Client_js_6.NotificationsClient(this._options)));
65
77
  }
66
78
  get realtime() {
67
- return (this._realtime ?? (this._realtime = new Client_js_5.RealtimeClient(this._options)));
79
+ return (this._realtime ?? (this._realtime = new Client_js_8.RealtimeClient(this._options)));
68
80
  }
69
81
  get taskAttempts() {
70
- return (this._taskAttempts ?? (this._taskAttempts = new Client_js_6.TaskAttemptsClient(this._options)));
82
+ return (this._taskAttempts ?? (this._taskAttempts = new Client_js_9.TaskAttemptsClient(this._options)));
71
83
  }
72
84
  /**
73
85
  * Make a passthrough request using the SDK's configured auth, retry, logging, etc.
@@ -0,0 +1,71 @@
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 NizamOperatorRuntime from "../../../index.js";
5
+ export declare namespace DevicesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * The authenticated user's registered push devices.
12
+ */
13
+ export declare class DevicesClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<DevicesClient.Options>;
15
+ constructor(options: DevicesClient.Options);
16
+ /**
17
+ * The caller's live push-device registrations, most-recently-registered first. Tokens are omitted — they are delivery secrets.
18
+ *
19
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
22
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
23
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
24
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
25
+ *
26
+ * @example
27
+ * await client.devices.listDevices()
28
+ */
29
+ listDevices(requestOptions?: DevicesClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.Devices>;
30
+ private __listDevices;
31
+ /**
32
+ * Registers the calling user's device for push delivery, or refreshes an existing registration of the same token. Idempotent on the (user, token) key: re-posting a token refreshes its row — reviving it if the user had logged out — instead of duplicating the delivery target. The token is a secret and is never echoed back.
33
+ *
34
+ * @param {NizamOperatorRuntime.RegisterDevice} request
35
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
38
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
39
+ * @throws {@link NizamOperatorRuntime.ConflictError}
40
+ * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
41
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
42
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
43
+ *
44
+ * @example
45
+ * await client.devices.registerDevice({
46
+ * platform: "android",
47
+ * token: "fcm-Aa1Bb2Cc3\u2026"
48
+ * })
49
+ */
50
+ registerDevice(request: NizamOperatorRuntime.RegisterDevice, requestOptions?: DevicesClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.Device>;
51
+ private __registerDevice;
52
+ /**
53
+ * Soft-deletes the caller's device so it stops receiving pushes (typically called on logout). Reversible: re-registering the same token revives the row.
54
+ *
55
+ * @param {NizamOperatorRuntime.DeregisterDeviceRequest} request
56
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
57
+ *
58
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
59
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
60
+ * @throws {@link NizamOperatorRuntime.NotFoundError}
61
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
62
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.devices.deregisterDevice({
66
+ * deviceId: "<string>"
67
+ * })
68
+ */
69
+ deregisterDevice(request: NizamOperatorRuntime.DeregisterDeviceRequest, requestOptions?: DevicesClient.RequestOptions): core.HttpResponsePromise<void>;
70
+ private __deregisterDevice;
71
+ }
@@ -0,0 +1,238 @@
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.DevicesClient = 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 NizamOperatorRuntime = __importStar(require("../../../index.js"));
45
+ /**
46
+ * The authenticated user's registered push devices.
47
+ */
48
+ class DevicesClient {
49
+ constructor(options) {
50
+ this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
51
+ }
52
+ /**
53
+ * The caller's live push-device registrations, most-recently-registered first. Tokens are omitted — they are delivery secrets.
54
+ *
55
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
56
+ *
57
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
58
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
59
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
60
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
61
+ *
62
+ * @example
63
+ * await client.devices.listDevices()
64
+ */
65
+ listDevices(requestOptions) {
66
+ return core.HttpResponsePromise.fromPromise(this.__listDevices(requestOptions));
67
+ }
68
+ async __listDevices(requestOptions) {
69
+ const _authRequest = await this._options.authProvider.getAuthRequest();
70
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
71
+ const _response = await core.fetcher({
72
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
73
+ (await core.Supplier.get(this._options.environment)) ??
74
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/me/devices"),
75
+ method: "GET",
76
+ headers: _headers,
77
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
78
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
79
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
80
+ abortSignal: requestOptions?.abortSignal,
81
+ fetchFn: this._options?.fetch,
82
+ logging: this._options.logging,
83
+ });
84
+ if (_response.ok) {
85
+ return { data: _response.body, rawResponse: _response.rawResponse };
86
+ }
87
+ if (_response.error.reason === "status-code") {
88
+ switch (_response.error.statusCode) {
89
+ case 401:
90
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
91
+ case 403:
92
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
93
+ case 429:
94
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
95
+ case 500:
96
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
97
+ default:
98
+ throw new errors.NizamOperatorRuntimeError({
99
+ statusCode: _response.error.statusCode,
100
+ body: _response.error.body,
101
+ rawResponse: _response.rawResponse,
102
+ });
103
+ }
104
+ }
105
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me/devices");
106
+ }
107
+ /**
108
+ * Registers the calling user's device for push delivery, or refreshes an existing registration of the same token. Idempotent on the (user, token) key: re-posting a token refreshes its row — reviving it if the user had logged out — instead of duplicating the delivery target. The token is a secret and is never echoed back.
109
+ *
110
+ * @param {NizamOperatorRuntime.RegisterDevice} request
111
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
112
+ *
113
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
114
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
115
+ * @throws {@link NizamOperatorRuntime.ConflictError}
116
+ * @throws {@link NizamOperatorRuntime.UnprocessableEntityError}
117
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
118
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
119
+ *
120
+ * @example
121
+ * await client.devices.registerDevice({
122
+ * platform: "android",
123
+ * token: "fcm-Aa1Bb2Cc3\u2026"
124
+ * })
125
+ */
126
+ registerDevice(request, requestOptions) {
127
+ return core.HttpResponsePromise.fromPromise(this.__registerDevice(request, requestOptions));
128
+ }
129
+ async __registerDevice(request, requestOptions) {
130
+ const _authRequest = await this._options.authProvider.getAuthRequest();
131
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
132
+ const _response = await core.fetcher({
133
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
134
+ (await core.Supplier.get(this._options.environment)) ??
135
+ environments.NizamOperatorRuntimeEnvironment.Production, "v1/me/devices"),
136
+ method: "POST",
137
+ headers: _headers,
138
+ contentType: "application/json",
139
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
140
+ requestType: "json",
141
+ body: request,
142
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
143
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
144
+ abortSignal: requestOptions?.abortSignal,
145
+ fetchFn: this._options?.fetch,
146
+ logging: this._options.logging,
147
+ });
148
+ if (_response.ok) {
149
+ return { data: _response.body, rawResponse: _response.rawResponse };
150
+ }
151
+ if (_response.error.reason === "status-code") {
152
+ switch (_response.error.statusCode) {
153
+ case 401:
154
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
155
+ case 403:
156
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
157
+ case 409:
158
+ throw new NizamOperatorRuntime.ConflictError(_response.error.body, _response.rawResponse);
159
+ case 422:
160
+ throw new NizamOperatorRuntime.UnprocessableEntityError(_response.error.body, _response.rawResponse);
161
+ case 429:
162
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
163
+ case 500:
164
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
165
+ default:
166
+ throw new errors.NizamOperatorRuntimeError({
167
+ statusCode: _response.error.statusCode,
168
+ body: _response.error.body,
169
+ rawResponse: _response.rawResponse,
170
+ });
171
+ }
172
+ }
173
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "POST", "/v1/me/devices");
174
+ }
175
+ /**
176
+ * Soft-deletes the caller's device so it stops receiving pushes (typically called on logout). Reversible: re-registering the same token revives the row.
177
+ *
178
+ * @param {NizamOperatorRuntime.DeregisterDeviceRequest} request
179
+ * @param {DevicesClient.RequestOptions} requestOptions - Request-specific configuration.
180
+ *
181
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
182
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
183
+ * @throws {@link NizamOperatorRuntime.NotFoundError}
184
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
185
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
186
+ *
187
+ * @example
188
+ * await client.devices.deregisterDevice({
189
+ * deviceId: "<string>"
190
+ * })
191
+ */
192
+ deregisterDevice(request, requestOptions) {
193
+ return core.HttpResponsePromise.fromPromise(this.__deregisterDevice(request, requestOptions));
194
+ }
195
+ async __deregisterDevice(request, requestOptions) {
196
+ const { deviceId } = request;
197
+ const _authRequest = await this._options.authProvider.getAuthRequest();
198
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, this._options?.headers, requestOptions?.headers);
199
+ const _response = await core.fetcher({
200
+ url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
201
+ (await core.Supplier.get(this._options.environment)) ??
202
+ environments.NizamOperatorRuntimeEnvironment.Production, `v1/me/devices/${core.url.encodePathParam(deviceId)}`),
203
+ method: "DELETE",
204
+ headers: _headers,
205
+ queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(),
206
+ timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
207
+ maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
208
+ abortSignal: requestOptions?.abortSignal,
209
+ fetchFn: this._options?.fetch,
210
+ logging: this._options.logging,
211
+ });
212
+ if (_response.ok) {
213
+ return { data: undefined, rawResponse: _response.rawResponse };
214
+ }
215
+ if (_response.error.reason === "status-code") {
216
+ switch (_response.error.statusCode) {
217
+ case 401:
218
+ throw new NizamOperatorRuntime.UnauthorizedError(_response.error.body, _response.rawResponse);
219
+ case 403:
220
+ throw new NizamOperatorRuntime.ForbiddenError(_response.error.body, _response.rawResponse);
221
+ case 404:
222
+ throw new NizamOperatorRuntime.NotFoundError(_response.error.body, _response.rawResponse);
223
+ case 429:
224
+ throw new NizamOperatorRuntime.TooManyRequestsError(_response.error.body, _response.rawResponse);
225
+ case 500:
226
+ throw new NizamOperatorRuntime.InternalServerError(_response.error.body, _response.rawResponse);
227
+ default:
228
+ throw new errors.NizamOperatorRuntimeError({
229
+ statusCode: _response.error.statusCode,
230
+ body: _response.error.body,
231
+ rawResponse: _response.rawResponse,
232
+ });
233
+ }
234
+ }
235
+ return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "DELETE", "/v1/me/devices/{deviceId}");
236
+ }
237
+ }
238
+ exports.DevicesClient = DevicesClient;
@@ -0,0 +1 @@
1
+ export * from "./requests/index.js";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./requests/index.js"), exports);
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * deviceId: "<string>"
5
+ * }
6
+ */
7
+ export interface DeregisterDeviceRequest {
8
+ deviceId: string;
9
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * platform: "android",
5
+ * token: "fcm-Aa1Bb2Cc3\u2026"
6
+ * }
7
+ */
8
+ export interface RegisterDevice {
9
+ /** Push transport. */
10
+ platform: RegisterDevice.Platform;
11
+ /** The raw APNs/FCM/web-push token. Treated as a secret — never logged. */
12
+ token: string;
13
+ }
14
+ export declare namespace RegisterDevice {
15
+ /** Push transport. */
16
+ const Platform: {
17
+ readonly Ios: "ios";
18
+ readonly Android: "android";
19
+ readonly Web: "web";
20
+ };
21
+ type Platform = (typeof Platform)[keyof typeof Platform];
22
+ }
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.RegisterDevice = void 0;
5
+ var RegisterDevice;
6
+ (function (RegisterDevice) {
7
+ /** Push transport. */
8
+ RegisterDevice.Platform = {
9
+ Ios: "ios",
10
+ Android: "android",
11
+ Web: "web",
12
+ };
13
+ })(RegisterDevice || (exports.RegisterDevice = RegisterDevice = {}));
@@ -0,0 +1,2 @@
1
+ export type { DeregisterDeviceRequest } from "./DeregisterDeviceRequest.js";
2
+ export { RegisterDevice } from "./RegisterDevice.js";
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RegisterDevice = void 0;
4
+ var RegisterDevice_js_1 = require("./RegisterDevice.js");
5
+ Object.defineProperty(exports, "RegisterDevice", { enumerable: true, get: function () { return RegisterDevice_js_1.RegisterDevice; } });
@@ -0,0 +1,2 @@
1
+ export { DevicesClient } 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.DevicesClient = void 0;
19
+ var Client_js_1 = require("./client/Client.js");
20
+ Object.defineProperty(exports, "DevicesClient", { enumerable: true, get: function () { return Client_js_1.DevicesClient; } });
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,8 +1,14 @@
1
+ export * from "./devices/client/requests/index.js";
2
+ export * as devices from "./devices/index.js";
1
3
  export * from "./files/client/requests/index.js";
2
4
  export * as files from "./files/index.js";
3
5
  export * from "./invites/client/requests/index.js";
4
6
  export * as invites from "./invites/index.js";
5
7
  export * as lookups from "./lookups/index.js";
8
+ export * from "./notificationPreferences/client/requests/index.js";
9
+ export * as notificationPreferences from "./notificationPreferences/index.js";
10
+ export * from "./notifications/client/requests/index.js";
11
+ export * as notifications from "./notifications/index.js";
6
12
  export * as positions from "./positions/index.js";
7
13
  export * as realtime from "./realtime/index.js";
8
14
  export * from "./taskAttempts/client/requests/index.js";
@@ -36,12 +36,18 @@ var __importStar = (this && this.__importStar) || (function () {
36
36
  };
37
37
  })();
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.lookups = exports.invites = exports.files = void 0;
39
+ exports.users = exports.taskAttempts = exports.realtime = exports.positions = exports.notifications = exports.notificationPreferences = exports.lookups = exports.invites = exports.files = exports.devices = void 0;
40
+ __exportStar(require("./devices/client/requests/index.js"), exports);
41
+ exports.devices = __importStar(require("./devices/index.js"));
40
42
  __exportStar(require("./files/client/requests/index.js"), exports);
41
43
  exports.files = __importStar(require("./files/index.js"));
42
44
  __exportStar(require("./invites/client/requests/index.js"), exports);
43
45
  exports.invites = __importStar(require("./invites/index.js"));
44
46
  exports.lookups = __importStar(require("./lookups/index.js"));
47
+ __exportStar(require("./notificationPreferences/client/requests/index.js"), exports);
48
+ exports.notificationPreferences = __importStar(require("./notificationPreferences/index.js"));
49
+ __exportStar(require("./notifications/client/requests/index.js"), exports);
50
+ exports.notifications = __importStar(require("./notifications/index.js"));
45
51
  exports.positions = __importStar(require("./positions/index.js"));
46
52
  exports.realtime = __importStar(require("./realtime/index.js"));
47
53
  __exportStar(require("./taskAttempts/client/requests/index.js"), exports);
@@ -0,0 +1,49 @@
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 NizamOperatorRuntime from "../../../index.js";
5
+ export declare namespace NotificationPreferencesClient {
6
+ type Options = BaseClientOptions;
7
+ interface RequestOptions extends BaseRequestOptions {
8
+ }
9
+ }
10
+ /**
11
+ * The authenticated user's per-kind × channel delivery preferences.
12
+ */
13
+ export declare class NotificationPreferencesClient {
14
+ protected readonly _options: NormalizedClientOptionsWithAuth<NotificationPreferencesClient.Options>;
15
+ constructor(options: NotificationPreferencesClient.Options);
16
+ /**
17
+ * The user's explicit per-kind × channel overrides. A (kind, channel) with no row uses the kind's coded default (so an empty list means 'all defaults').
18
+ *
19
+ * @param {NotificationPreferencesClient.RequestOptions} requestOptions - Request-specific configuration.
20
+ *
21
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
22
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
23
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
24
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
25
+ *
26
+ * @example
27
+ * await client.notificationPreferences.getNotificationPreferences()
28
+ */
29
+ getNotificationPreferences(requestOptions?: NotificationPreferencesClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.NotificationPreferences>;
30
+ private __getNotificationPreferences;
31
+ /**
32
+ * Upserts the supplied overrides — each item fully declares the desired state of one (kind, channel). Unlisted preferences are untouched. Returns the full resulting set.
33
+ *
34
+ * @param {NizamOperatorRuntime.UpdateNotificationPreferences} request
35
+ * @param {NotificationPreferencesClient.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link NizamOperatorRuntime.UnauthorizedError}
38
+ * @throws {@link NizamOperatorRuntime.ForbiddenError}
39
+ * @throws {@link NizamOperatorRuntime.TooManyRequestsError}
40
+ * @throws {@link NizamOperatorRuntime.InternalServerError}
41
+ *
42
+ * @example
43
+ * await client.notificationPreferences.updateNotificationPreferences({
44
+ * preferences: [{}]
45
+ * })
46
+ */
47
+ updateNotificationPreferences(request?: NizamOperatorRuntime.UpdateNotificationPreferences, requestOptions?: NotificationPreferencesClient.RequestOptions): core.HttpResponsePromise<NizamOperatorRuntime.NotificationPreferences>;
48
+ private __updateNotificationPreferences;
49
+ }