@nizam-os/dashboard-sdk 8.0.1 → 9.0.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.
- package/dist/Client.d.ts +9 -0
- package/dist/Client.js +36 -24
- package/dist/api/resources/devices/client/Client.d.ts +71 -0
- package/dist/api/resources/devices/client/Client.js +238 -0
- package/dist/api/resources/devices/client/index.d.ts +1 -0
- package/dist/api/resources/devices/client/index.js +17 -0
- package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.d.ts +9 -0
- package/dist/api/resources/devices/client/requests/DeregisterDeviceRequest.js +3 -0
- package/dist/api/resources/devices/client/requests/RegisterDevice.d.ts +22 -0
- package/dist/api/resources/devices/client/requests/RegisterDevice.js +13 -0
- package/dist/api/resources/devices/client/requests/index.d.ts +2 -0
- package/dist/api/resources/devices/client/requests/index.js +5 -0
- package/dist/api/resources/devices/exports.d.ts +2 -0
- package/dist/api/resources/devices/exports.js +21 -0
- package/dist/api/resources/devices/index.d.ts +1 -0
- package/dist/api/resources/devices/index.js +17 -0
- package/dist/api/resources/index.d.ts +6 -0
- package/dist/api/resources/index.js +7 -1
- package/dist/api/resources/notificationPreferences/client/Client.d.ts +49 -0
- package/dist/api/resources/notificationPreferences/client/Client.js +175 -0
- package/dist/api/resources/notificationPreferences/client/index.d.ts +1 -0
- package/dist/api/resources/notificationPreferences/client/index.js +17 -0
- package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.d.ts +11 -0
- package/dist/api/resources/notificationPreferences/client/requests/UpdateNotificationPreferences.js +3 -0
- package/dist/api/resources/notificationPreferences/client/requests/index.d.ts +1 -0
- package/dist/api/resources/notificationPreferences/client/requests/index.js +2 -0
- package/dist/api/resources/notificationPreferences/exports.d.ts +2 -0
- package/dist/api/resources/notificationPreferences/exports.js +21 -0
- package/dist/api/resources/notificationPreferences/index.d.ts +1 -0
- package/dist/api/resources/notificationPreferences/index.js +17 -0
- package/dist/api/resources/notifications/client/Client.d.ts +179 -0
- package/dist/api/resources/notifications/client/Client.js +623 -0
- package/dist/api/resources/notifications/client/index.d.ts +1 -0
- package/dist/api/resources/notifications/client/index.js +17 -0
- package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/ArchiveNotificationRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.d.ts +30 -0
- package/dist/api/resources/notifications/client/requests/ListNotificationsRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/MarkNotificationReadRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/MarkNotificationUnreadRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.d.ts +9 -0
- package/dist/api/resources/notifications/client/requests/UnarchiveNotificationRequest.js +3 -0
- package/dist/api/resources/notifications/client/requests/index.d.ts +5 -0
- package/dist/api/resources/notifications/client/requests/index.js +2 -0
- package/dist/api/resources/notifications/exports.d.ts +2 -0
- package/dist/api/resources/notifications/exports.js +21 -0
- package/dist/api/resources/notifications/index.d.ts +1 -0
- package/dist/api/resources/notifications/index.js +17 -0
- package/dist/api/types/ActiveOrganization.d.ts +2 -2
- package/dist/api/types/ActiveOrganization.js +1 -1
- package/dist/api/types/ActivityResource.d.ts +2 -2
- package/dist/api/types/ActivityResource.js +1 -1
- package/dist/api/types/Asset.d.ts +2 -2
- package/dist/api/types/Asset.js +1 -1
- package/dist/api/types/AssetListItem.d.ts +2 -2
- package/dist/api/types/AssetListItem.js +1 -1
- package/dist/api/types/Assignment.d.ts +2 -2
- package/dist/api/types/Assignment.js +1 -1
- package/dist/api/types/BusinessCategory.d.ts +2 -2
- package/dist/api/types/BusinessCategory.js +1 -1
- package/dist/api/types/Country.d.ts +2 -2
- package/dist/api/types/Country.js +1 -1
- package/dist/api/types/Currency.d.ts +2 -2
- package/dist/api/types/Currency.js +1 -1
- package/dist/api/types/Device.d.ts +24 -0
- package/dist/api/types/Device.js +11 -0
- package/dist/api/types/Devices.d.ts +17 -0
- package/dist/api/types/Devices.js +11 -0
- package/dist/api/types/Invite.d.ts +2 -2
- package/dist/api/types/Invite.js +1 -1
- package/dist/api/types/Language.d.ts +2 -2
- package/dist/api/types/Language.js +1 -1
- package/dist/api/types/ListResponseActivityResource.d.ts +3 -3
- package/dist/api/types/ListResponseActivityResource.js +1 -1
- package/dist/api/types/ListResponseAssetListItem.d.ts +3 -3
- package/dist/api/types/ListResponseAssetListItem.js +1 -1
- package/dist/api/types/ListResponseBusinessCategory.d.ts +3 -3
- package/dist/api/types/ListResponseBusinessCategory.js +1 -1
- package/dist/api/types/ListResponseCountry.d.ts +3 -3
- package/dist/api/types/ListResponseCountry.js +1 -1
- package/dist/api/types/ListResponseCurrency.d.ts +3 -3
- package/dist/api/types/ListResponseCurrency.js +1 -1
- package/dist/api/types/ListResponseFile.d.ts +3 -3
- package/dist/api/types/ListResponseFile.js +1 -1
- package/dist/api/types/ListResponseHeatmapCell.d.ts +3 -3
- package/dist/api/types/ListResponseHeatmapCell.js +1 -1
- package/dist/api/types/ListResponseJob.d.ts +3 -3
- package/dist/api/types/ListResponseJob.js +1 -1
- package/dist/api/types/ListResponseLanguage.d.ts +3 -3
- package/dist/api/types/ListResponseLanguage.js +1 -1
- package/dist/api/types/ListResponseMembership.d.ts +3 -3
- package/dist/api/types/ListResponseMembership.js +1 -1
- package/dist/api/types/ListResponseNotification.d.ts +27 -0
- package/dist/api/types/ListResponseNotification.js +11 -0
- package/dist/api/types/ListResponseNotificationDeadLetter.d.ts +27 -0
- package/dist/api/types/ListResponseNotificationDeadLetter.js +11 -0
- package/dist/api/types/ListResponseOperatorPosition.d.ts +3 -3
- package/dist/api/types/ListResponseOperatorPosition.js +1 -1
- package/dist/api/types/ListResponseOrganization.d.ts +3 -3
- package/dist/api/types/ListResponseOrganization.js +1 -1
- package/dist/api/types/ListResponsePosition.d.ts +3 -3
- package/dist/api/types/ListResponsePosition.js +1 -1
- package/dist/api/types/ListResponseTimezone.d.ts +3 -3
- package/dist/api/types/ListResponseTimezone.js +1 -1
- package/dist/api/types/ListResponseUserResource.d.ts +3 -3
- package/dist/api/types/ListResponseUserResource.js +1 -1
- package/dist/api/types/Membership.d.ts +2 -2
- package/dist/api/types/Membership.js +1 -1
- package/dist/api/types/Notification.d.ts +52 -0
- package/dist/api/types/Notification.js +27 -0
- package/dist/api/types/NotificationCategoryCount.d.ts +23 -0
- package/dist/api/types/NotificationCategoryCount.js +16 -0
- package/dist/api/types/NotificationCounts.d.ts +23 -0
- package/dist/api/types/NotificationCounts.js +11 -0
- package/dist/api/types/NotificationDeadLetter.d.ts +36 -0
- package/dist/api/types/NotificationDeadLetter.js +11 -0
- package/dist/api/types/NotificationPreference.d.ts +13 -0
- package/dist/api/types/NotificationPreference.js +3 -0
- package/dist/api/types/NotificationPreferenceItem.d.ts +13 -0
- package/dist/api/types/NotificationPreferenceItem.js +3 -0
- package/dist/api/types/NotificationPreferences.d.ts +17 -0
- package/dist/api/types/NotificationPreferences.js +11 -0
- package/dist/api/types/NotificationUnreadCount.d.ts +16 -0
- package/dist/api/types/NotificationUnreadCount.js +11 -0
- package/dist/api/types/NotificationsArchived.d.ts +16 -0
- package/dist/api/types/NotificationsArchived.js +11 -0
- package/dist/api/types/NotificationsMarkedRead.d.ts +16 -0
- package/dist/api/types/NotificationsMarkedRead.js +11 -0
- package/dist/api/types/Operator.d.ts +2 -2
- package/dist/api/types/Operator.js +1 -1
- package/dist/api/types/Organization.d.ts +2 -2
- package/dist/api/types/Organization.js +1 -1
- package/dist/api/types/QuietHours.d.ts +11 -0
- package/dist/api/types/QuietHours.js +3 -0
- package/dist/api/types/RealtimeTicket.d.ts +2 -2
- package/dist/api/types/RealtimeTicket.js +1 -1
- package/dist/api/types/ReconcileResponse.d.ts +2 -2
- package/dist/api/types/ReconcileResponse.js +1 -1
- package/dist/api/types/Timezone.d.ts +2 -2
- package/dist/api/types/Timezone.js +1 -1
- package/dist/api/types/User.d.ts +2 -2
- package/dist/api/types/User.js +1 -1
- package/dist/api/types/UserResource.d.ts +2 -2
- package/dist/api/types/UserResource.js +1 -1
- package/dist/api/types/index.d.ts +15 -0
- package/dist/api/types/index.js +15 -0
- package/package.json +1 -1
|
@@ -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 NizamDashboard 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 NizamDashboard.UnauthorizedError}
|
|
22
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
23
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
24
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* await client.notificationPreferences.getNotificationPreferences()
|
|
28
|
+
*/
|
|
29
|
+
getNotificationPreferences(requestOptions?: NotificationPreferencesClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.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 {NizamDashboard.UpdateNotificationPreferences} request
|
|
35
|
+
* @param {NotificationPreferencesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
|
+
*
|
|
37
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
38
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
39
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
40
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* await client.notificationPreferences.updateNotificationPreferences({
|
|
44
|
+
* preferences: [{}]
|
|
45
|
+
* })
|
|
46
|
+
*/
|
|
47
|
+
updateNotificationPreferences(request?: NizamDashboard.UpdateNotificationPreferences, requestOptions?: NotificationPreferencesClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.NotificationPreferences>;
|
|
48
|
+
private __updateNotificationPreferences;
|
|
49
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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.NotificationPreferencesClient = 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
|
+
* The authenticated user's per-kind × channel delivery preferences.
|
|
47
|
+
*/
|
|
48
|
+
class NotificationPreferencesClient {
|
|
49
|
+
constructor(options) {
|
|
50
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 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').
|
|
54
|
+
*
|
|
55
|
+
* @param {NotificationPreferencesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
+
*
|
|
57
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
58
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
59
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
60
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* await client.notificationPreferences.getNotificationPreferences()
|
|
64
|
+
*/
|
|
65
|
+
getNotificationPreferences(requestOptions) {
|
|
66
|
+
return core.HttpResponsePromise.fromPromise(this.__getNotificationPreferences(requestOptions));
|
|
67
|
+
}
|
|
68
|
+
async __getNotificationPreferences(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.NizamDashboardEnvironment.Production, "v1/me/notification-preferences"),
|
|
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 {
|
|
86
|
+
data: _response.body,
|
|
87
|
+
rawResponse: _response.rawResponse,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
if (_response.error.reason === "status-code") {
|
|
91
|
+
switch (_response.error.statusCode) {
|
|
92
|
+
case 401:
|
|
93
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
94
|
+
case 403:
|
|
95
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
96
|
+
case 429:
|
|
97
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
98
|
+
case 500:
|
|
99
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
100
|
+
default:
|
|
101
|
+
throw new errors.NizamDashboardError({
|
|
102
|
+
statusCode: _response.error.statusCode,
|
|
103
|
+
body: _response.error.body,
|
|
104
|
+
rawResponse: _response.rawResponse,
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "GET", "/v1/me/notification-preferences");
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Upserts the supplied overrides — each item fully declares the desired state of one (kind, channel). Unlisted preferences are untouched. Returns the full resulting set.
|
|
112
|
+
*
|
|
113
|
+
* @param {NizamDashboard.UpdateNotificationPreferences} request
|
|
114
|
+
* @param {NotificationPreferencesClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
115
|
+
*
|
|
116
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
117
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
118
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
119
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* await client.notificationPreferences.updateNotificationPreferences({
|
|
123
|
+
* preferences: [{}]
|
|
124
|
+
* })
|
|
125
|
+
*/
|
|
126
|
+
updateNotificationPreferences(request = {}, requestOptions) {
|
|
127
|
+
return core.HttpResponsePromise.fromPromise(this.__updateNotificationPreferences(request, requestOptions));
|
|
128
|
+
}
|
|
129
|
+
async __updateNotificationPreferences(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.NizamDashboardEnvironment.Production, "v1/me/notification-preferences"),
|
|
136
|
+
method: "PATCH",
|
|
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 {
|
|
150
|
+
data: _response.body,
|
|
151
|
+
rawResponse: _response.rawResponse,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
if (_response.error.reason === "status-code") {
|
|
155
|
+
switch (_response.error.statusCode) {
|
|
156
|
+
case 401:
|
|
157
|
+
throw new NizamDashboard.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
158
|
+
case 403:
|
|
159
|
+
throw new NizamDashboard.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
160
|
+
case 429:
|
|
161
|
+
throw new NizamDashboard.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
162
|
+
case 500:
|
|
163
|
+
throw new NizamDashboard.InternalServerError(_response.error.body, _response.rawResponse);
|
|
164
|
+
default:
|
|
165
|
+
throw new errors.NizamDashboardError({
|
|
166
|
+
statusCode: _response.error.statusCode,
|
|
167
|
+
body: _response.error.body,
|
|
168
|
+
rawResponse: _response.rawResponse,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return (0, handleNonStatusCodeError_js_1.handleNonStatusCodeError)(_response.error, _response.rawResponse, "PATCH", "/v1/me/notification-preferences");
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
exports.NotificationPreferencesClient = NotificationPreferencesClient;
|
|
@@ -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,11 @@
|
|
|
1
|
+
import type * as NizamDashboard from "../../../../index.js";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* preferences: [{}]
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface UpdateNotificationPreferences {
|
|
9
|
+
/** The overrides to apply; each fully declares one (kind, channel). */
|
|
10
|
+
preferences?: NizamDashboard.NotificationPreferenceItem[];
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { UpdateNotificationPreferences } from "./UpdateNotificationPreferences.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.NotificationPreferencesClient = void 0;
|
|
19
|
+
var Client_js_1 = require("./client/Client.js");
|
|
20
|
+
Object.defineProperty(exports, "NotificationPreferencesClient", { enumerable: true, get: function () { return Client_js_1.NotificationPreferencesClient; } });
|
|
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,179 @@
|
|
|
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 NotificationsClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The authenticated user's notification inbox.
|
|
12
|
+
*/
|
|
13
|
+
export declare class NotificationsClient {
|
|
14
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<NotificationsClient.Options>;
|
|
15
|
+
constructor(options: NotificationsClient.Options);
|
|
16
|
+
/**
|
|
17
|
+
* The caller's own notifications ordered by `created_at` descending (pass `sort=created_at` for ascending). `status` selects the segment — `all` (default; the active inbox, non-archived), `unread`, `read`, or `archived`. `category` and `kind` accept comma-separated values and AND on top of the segment; `q` matches the notification title/body. `since=` (RFC 3339) returns only items at/after the instant for incremental catch-up after a reconnect. Pagination is bidirectional (`starting_after` / `ending_before`); cursors are bound to the sort direction that minted them.
|
|
18
|
+
*
|
|
19
|
+
* @param {NizamDashboard.ListNotificationsRequest} request
|
|
20
|
+
* @param {NotificationsClient.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.TooManyRequestsError}
|
|
26
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* await client.notifications.listNotifications({
|
|
30
|
+
* status: "<string>",
|
|
31
|
+
* q: "<string>",
|
|
32
|
+
* since: "2026-05-20T14:00:00Z",
|
|
33
|
+
* starting_after: "Y3Vyc29yX25leHRfMDFKNVE=",
|
|
34
|
+
* ending_before: "Y3Vyc29yX25leHRfMDFKNVE="
|
|
35
|
+
* })
|
|
36
|
+
*/
|
|
37
|
+
listNotifications(request?: NizamDashboard.ListNotificationsRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.ListResponseNotification>;
|
|
38
|
+
private __listNotifications;
|
|
39
|
+
/**
|
|
40
|
+
* Archives every active notification of the caller in one operation. Returns the number archived (zero when the active inbox was already empty).
|
|
41
|
+
*
|
|
42
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
43
|
+
*
|
|
44
|
+
* @throws {@link NizamDashboard.BadRequestError}
|
|
45
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
46
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
47
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
48
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* await client.notifications.archiveAllNotifications()
|
|
52
|
+
*/
|
|
53
|
+
archiveAllNotifications(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.NotificationsArchived>;
|
|
54
|
+
private __archiveAllNotifications;
|
|
55
|
+
/**
|
|
56
|
+
* The segment-badge roll-up for the active organization: total + unread (active, non-archived), archived, and per-category active total/unread. Computed server-side in one pass so segment badges stay accurate across cursor pages (never inferred from the loaded page). Excludes dismissed (soft-deleted) notifications.
|
|
57
|
+
*
|
|
58
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
59
|
+
*
|
|
60
|
+
* @throws {@link NizamDashboard.BadRequestError}
|
|
61
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
62
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
63
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
64
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* await client.notifications.getNotificationCounts()
|
|
68
|
+
*/
|
|
69
|
+
getNotificationCounts(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.NotificationCounts>;
|
|
70
|
+
private __getNotificationCounts;
|
|
71
|
+
/**
|
|
72
|
+
* Flips every unread notification of the caller to read in one operation. Returns the number of notifications that were flipped (zero when the inbox was already clear).
|
|
73
|
+
*
|
|
74
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link NizamDashboard.BadRequestError}
|
|
77
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
78
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
79
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
80
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* await client.notifications.markAllNotificationsRead()
|
|
84
|
+
*/
|
|
85
|
+
markAllNotificationsRead(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.NotificationsMarkedRead>;
|
|
86
|
+
private __markAllNotificationsRead;
|
|
87
|
+
/**
|
|
88
|
+
* The unread badge count for the active organization. Counts active (non-archived) unread notifications; excludes dismissed (soft-deleted) and archived ones.
|
|
89
|
+
*
|
|
90
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
91
|
+
*
|
|
92
|
+
* @throws {@link NizamDashboard.BadRequestError}
|
|
93
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
94
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
95
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
96
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
97
|
+
*
|
|
98
|
+
* @example
|
|
99
|
+
* await client.notifications.getUnreadNotificationCount()
|
|
100
|
+
*/
|
|
101
|
+
getUnreadNotificationCount(requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.NotificationUnreadCount>;
|
|
102
|
+
private __getUnreadNotificationCount;
|
|
103
|
+
/**
|
|
104
|
+
* Moves a single notification to the archive ("Done") — reversible, not a delete: it leaves the active inbox but stays listable under `status=archived`. Idempotent. 404 if the notification is not the caller's.
|
|
105
|
+
*
|
|
106
|
+
* @param {NizamDashboard.ArchiveNotificationRequest} request
|
|
107
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
108
|
+
*
|
|
109
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
110
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
111
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
112
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
113
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* await client.notifications.archiveNotification({
|
|
117
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
118
|
+
* })
|
|
119
|
+
*/
|
|
120
|
+
archiveNotification(request: NizamDashboard.ArchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Notification>;
|
|
121
|
+
private __archiveNotification;
|
|
122
|
+
/**
|
|
123
|
+
* Flips a single notification to read. Idempotent — a second call is a no-op that preserves the original read timestamp. 404 if the notification is not the caller's.
|
|
124
|
+
*
|
|
125
|
+
* @param {NizamDashboard.MarkNotificationReadRequest} request
|
|
126
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
127
|
+
*
|
|
128
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
129
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
130
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
131
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
132
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* await client.notifications.markNotificationRead({
|
|
136
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
137
|
+
* })
|
|
138
|
+
*/
|
|
139
|
+
markNotificationRead(request: NizamDashboard.MarkNotificationReadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Notification>;
|
|
140
|
+
private __markNotificationRead;
|
|
141
|
+
/**
|
|
142
|
+
* Restores an archived notification to the active inbox — the inverse of archive. Idempotent. 404 if the notification is not the caller's.
|
|
143
|
+
*
|
|
144
|
+
* @param {NizamDashboard.UnarchiveNotificationRequest} request
|
|
145
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
146
|
+
*
|
|
147
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
148
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
149
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
150
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
151
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* await client.notifications.unarchiveNotification({
|
|
155
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
156
|
+
* })
|
|
157
|
+
*/
|
|
158
|
+
unarchiveNotification(request: NizamDashboard.UnarchiveNotificationRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Notification>;
|
|
159
|
+
private __unarchiveNotification;
|
|
160
|
+
/**
|
|
161
|
+
* Flips a single notification back to unread — the inverse of mark-read. Idempotent. 404 if the notification is not the caller's.
|
|
162
|
+
*
|
|
163
|
+
* @param {NizamDashboard.MarkNotificationUnreadRequest} request
|
|
164
|
+
* @param {NotificationsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
165
|
+
*
|
|
166
|
+
* @throws {@link NizamDashboard.UnauthorizedError}
|
|
167
|
+
* @throws {@link NizamDashboard.ForbiddenError}
|
|
168
|
+
* @throws {@link NizamDashboard.NotFoundError}
|
|
169
|
+
* @throws {@link NizamDashboard.TooManyRequestsError}
|
|
170
|
+
* @throws {@link NizamDashboard.InternalServerError}
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* await client.notifications.markNotificationUnread({
|
|
174
|
+
* id: "00000000-0000-0000-0000-000000000000"
|
|
175
|
+
* })
|
|
176
|
+
*/
|
|
177
|
+
markNotificationUnread(request: NizamDashboard.MarkNotificationUnreadRequest, requestOptions?: NotificationsClient.RequestOptions): core.HttpResponsePromise<NizamDashboard.Notification>;
|
|
178
|
+
private __markNotificationUnread;
|
|
179
|
+
}
|