@stack-spot/portal-network 0.184.0 → 0.185.0-beta.1
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/CHANGELOG.md +2444 -2412
- package/dist/api/account.js +1 -1
- package/dist/api/agent-tools.js +1 -1
- package/dist/api/agent.js +1 -1
- package/dist/api/ai.js +1 -1
- package/dist/api/apiManagement.js +1 -1
- package/dist/api/apiRuntime.js +1 -1
- package/dist/api/cloudAccount.js +1 -1
- package/dist/api/cloudPlatform.js +1 -1
- package/dist/api/cloudPlatformHorizon.js +1 -1
- package/dist/api/cloudRuntimes.js +1 -1
- package/dist/api/cloudServices.js +1 -1
- package/dist/api/codeShift.d.ts +63 -4
- package/dist/api/codeShift.d.ts.map +1 -1
- package/dist/api/codeShift.js +14 -1
- package/dist/api/codeShift.js.map +1 -1
- package/dist/api/content.js +1 -1
- package/dist/api/dataIntegration.js +1 -1
- package/dist/api/discover.js +1 -1
- package/dist/api/genAiInference.js +1 -1
- package/dist/api/insights.js +1 -1
- package/dist/api/notification.js +1 -1
- package/dist/api/secrets.js +1 -1
- package/dist/api/serviceCatalog.js +1 -1
- package/dist/api/workspace-ai.js +1 -1
- package/dist/api/workspace.js +1 -1
- package/dist/api/workspaceManager.js +1 -1
- package/dist/api/workspaceSearchEngine.js +1 -1
- package/dist/client/ai.d.ts.map +1 -1
- package/dist/client/ai.js +84 -14
- package/dist/client/ai.js.map +1 -1
- package/dist/client/code-shift.d.ts +30 -0
- package/dist/client/code-shift.d.ts.map +1 -1
- package/dist/client/code-shift.js +37 -1
- package/dist/client/code-shift.js.map +1 -1
- package/dist/client/types.d.ts +26 -6
- package/dist/client/types.d.ts.map +1 -1
- package/package.json +7 -7
- package/readme.md +1 -1
- package/scripts/generate-apis.ts +134 -134
- package/src/api/account.ts +8368 -8367
- package/src/api/agent-tools.ts +2172 -2169
- package/src/api/agent.ts +1085 -1083
- package/src/api/ai.ts +3388 -3388
- package/src/api/apiManagement.ts +570 -570
- package/src/api/apiRuntime.ts +2103 -2103
- package/src/api/cloudAccount.ts +1239 -1239
- package/src/api/cloudPlatform.ts +927 -927
- package/src/api/cloudPlatformHorizon.ts +2655 -2655
- package/src/api/cloudRuntimes.ts +2043 -2043
- package/src/api/cloudServices.ts +1445 -1445
- package/src/api/codeShift.ts +3567 -3481
- package/src/api/content.ts +9785 -9785
- package/src/api/dataIntegration.ts +1657 -1657
- package/src/api/discover.ts +435 -435
- package/src/api/eventBus.ts +171 -171
- package/src/api/genAiInference.ts +603 -603
- package/src/api/insights.ts +310 -310
- package/src/api/notification.ts +336 -334
- package/src/api/secrets.ts +342 -342
- package/src/api/serviceCatalog.ts +2908 -2908
- package/src/api/workflows.ts +1669 -1669
- package/src/api/workspace-ai.ts +677 -677
- package/src/api/workspace.ts +5889 -5889
- package/src/api/workspaceManager.ts +2951 -2951
- package/src/api/workspaceSearchEngine.ts +153 -153
- package/src/api-addresses.ts +120 -120
- package/src/apis-itau.json +225 -225
- package/src/apis.json +225 -225
- package/src/client/account.ts +902 -902
- package/src/client/agent-tools.ts +210 -210
- package/src/client/agent.ts +81 -81
- package/src/client/ai.ts +469 -395
- package/src/client/api-management.ts +40 -40
- package/src/client/cloud-account.ts +70 -70
- package/src/client/cloud-platform-horizon.ts +113 -113
- package/src/client/cloud-platform.ts +163 -163
- package/src/client/cloud-runtimes.ts +129 -129
- package/src/client/cloud-services.ts +94 -94
- package/src/client/code-shift.ts +371 -349
- package/src/client/content.ts +538 -538
- package/src/client/data-integration.ts +191 -191
- package/src/client/discover.ts +89 -89
- package/src/client/event-bus.ts +84 -84
- package/src/client/gen-ai-inference.ts +65 -65
- package/src/client/insights.ts +28 -28
- package/src/client/notification.ts +32 -32
- package/src/client/runtime-manager.ts +76 -76
- package/src/client/secrets.ts +60 -60
- package/src/client/types.ts +398 -377
- package/src/client/workflow.ts +83 -83
- package/src/client/workspace-ai.ts +191 -191
- package/src/client/workspace-manager.ts +564 -564
- package/src/client/workspace-search.ts +39 -39
- package/src/client/workspace.ts +480 -480
- package/src/error/DefaultAPIError.ts +151 -151
- package/src/error/FileUploadError.ts +18 -18
- package/src/error/IgnoredErrorCodes.ts +3 -3
- package/src/error/StackspotAPIError.ts +101 -101
- package/src/error/StreamCanceledError.ts +10 -10
- package/src/error/StreamError.ts +7 -7
- package/src/error/StreamJsonError.ts +10 -10
- package/src/error/dictionary/account.ts +58 -58
- package/src/error/dictionary/action-details.ts +20 -20
- package/src/error/dictionary/action.ts +211 -211
- package/src/error/dictionary/agent-tools.ts +75 -75
- package/src/error/dictionary/ai-inference.ts +28 -28
- package/src/error/dictionary/base.ts +22 -22
- package/src/error/dictionary/cloud-platform.ts +82 -82
- package/src/error/dictionary/cnt-fields.ts +14 -14
- package/src/error/dictionary/cnt.ts +103 -103
- package/src/error/dictionary/code-shift.ts +12 -12
- package/src/error/dictionary/rte.ts +24 -24
- package/src/error/dictionary/rtm.ts +10 -10
- package/src/error/dictionary/secrets.ts +14 -14
- package/src/error/dictionary/workspace-ai.ts +10 -10
- package/src/error/dictionary/workspace-details.ts +15 -15
- package/src/error/dictionary/workspace-fields.ts +10 -10
- package/src/error/dictionary/workspace.ts +209 -209
- package/src/error/types.ts +21 -21
- package/src/index.ts +43 -43
- package/src/network/AutoInfiniteQuery.ts +115 -115
- package/src/network/AutoMutation.ts +27 -27
- package/src/network/AutoOperation.ts +73 -73
- package/src/network/AutoQuery.ts +75 -75
- package/src/network/ManualInfiniteQuery.ts +95 -95
- package/src/network/ManualMutation.ts +40 -40
- package/src/network/ManualOperation.ts +52 -52
- package/src/network/ManualQuery.ts +82 -82
- package/src/network/NetworkClient.ts +167 -167
- package/src/network/ReactQueryNetworkClient.ts +312 -312
- package/src/network/react-query-client.ts +14 -14
- package/src/network/types.ts +294 -294
- package/src/types.ts +1 -1
- package/src/utils/StreamedArray.tsx +146 -146
- package/src/utils/StreamedJson.tsx +166 -166
- package/src/utils/remove-authorization-param.ts +6 -6
- package/src/utils/string.ts +19 -19
- package/src/utils/use-extended-list.ts +80 -80
- package/src/utils/use-streamed-array.ts +17 -17
- package/tsconfig.build.json +4 -4
- package/tsconfig.json +10 -10
package/src/api/notification.ts
CHANGED
|
@@ -1,334 +1,336 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Notification Engine
|
|
3
|
-
* 1.0.0
|
|
4
|
-
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
-
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
-
*/
|
|
7
|
-
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
-
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
-
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
-
headers: {},
|
|
11
|
-
baseUrl: "https://account-notification-engine.stg.stackspot.com",
|
|
12
|
-
};
|
|
13
|
-
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
-
export const servers = {
|
|
15
|
-
generatedServerUrl: "https://account-notification-engine.stg.stackspot.com"
|
|
16
|
-
};
|
|
17
|
-
export type NotificationContentRequest = {
|
|
18
|
-
/** User friendly title for the notification */
|
|
19
|
-
title: string;
|
|
20
|
-
/** User friendly description for the notification (allows the use of markdown) */
|
|
21
|
-
description: string;
|
|
22
|
-
};
|
|
23
|
-
export type NotificationTargetBase = {
|
|
24
|
-
"type": string;
|
|
25
|
-
};
|
|
26
|
-
export type AccountValue = {
|
|
27
|
-
"type": "AccountValue";
|
|
28
|
-
} & NotificationTargetBase & {
|
|
29
|
-
value?: string;
|
|
30
|
-
};
|
|
31
|
-
export type Attribute = {
|
|
32
|
-
key: string;
|
|
33
|
-
value: string;
|
|
34
|
-
};
|
|
35
|
-
export type Value = {
|
|
36
|
-
attribute?: Attribute;
|
|
37
|
-
resourceType: string;
|
|
38
|
-
resourceSlug: string;
|
|
39
|
-
action: string;
|
|
40
|
-
};
|
|
41
|
-
export type ResourceValue = {
|
|
42
|
-
"type": "ResourceValue";
|
|
43
|
-
} & NotificationTargetBase & {
|
|
44
|
-
value?: Value;
|
|
45
|
-
};
|
|
46
|
-
export type UsersValue = {
|
|
47
|
-
"type": "UsersValue";
|
|
48
|
-
} & NotificationTargetBase & {
|
|
49
|
-
value?: string[];
|
|
50
|
-
};
|
|
51
|
-
export type CreateTenantNotificationRequest = {
|
|
52
|
-
/** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
|
|
53
|
-
content: {
|
|
54
|
-
[key: string]: NotificationContentRequest;
|
|
55
|
-
};
|
|
56
|
-
/** Level of broadcasting to the notification. */
|
|
57
|
-
broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE" | "ACCOUNT" | "INDIVIDUAL" | "RESOURCE";
|
|
58
|
-
target: AccountValue | ResourceValue | UsersValue;
|
|
59
|
-
/** Criticality of the notification. */
|
|
60
|
-
criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
|
|
61
|
-
/** Which context to publish the notification */
|
|
62
|
-
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
|
|
63
|
-
/** Possible redirect link for the notification button. */
|
|
64
|
-
call_to_action: string;
|
|
65
|
-
/** If the notification should be re-consumed until 'last_until' is reached. */
|
|
66
|
-
persistent?: boolean;
|
|
67
|
-
/** UTC formatted timestamp to when the notification should finally end, if the persistent is set to true. */
|
|
68
|
-
last_until?: string;
|
|
69
|
-
/** UTC formatted timestamp for when to triggers the notification. */
|
|
70
|
-
trigger_at: string;
|
|
71
|
-
/** Notification channel audience. Determines which platform will receive the notification. */
|
|
72
|
-
audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
|
|
73
|
-
};
|
|
74
|
-
export type ErrorDetails = {
|
|
75
|
-
code: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
|
|
76
|
-
field?: string;
|
|
77
|
-
details?: string;
|
|
78
|
-
values?: string[];
|
|
79
|
-
};
|
|
80
|
-
export type ApiErrorResponse = {
|
|
81
|
-
code?: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
|
|
82
|
-
status: number;
|
|
83
|
-
message: string;
|
|
84
|
-
details?: ErrorDetails[];
|
|
85
|
-
};
|
|
86
|
-
export type CreatePlatformNotificationRequest = {
|
|
87
|
-
/** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
|
|
88
|
-
content: {
|
|
89
|
-
[key: string]: NotificationContentRequest;
|
|
90
|
-
};
|
|
91
|
-
target?: ResourceValue;
|
|
92
|
-
/** Criticality of the notification. */
|
|
93
|
-
criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
|
|
94
|
-
/** Which context to publish the notification */
|
|
95
|
-
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
|
|
96
|
-
/** Possible redirect link for the notification button. */
|
|
97
|
-
call_to_action: string;
|
|
98
|
-
/** If the notification should be re-consumed until last_until is reached. */
|
|
99
|
-
persistent?: boolean;
|
|
100
|
-
/** UTC formatted timestamp to when the notification should finally ended if the persistent is set to true. */
|
|
101
|
-
last_until?: string;
|
|
102
|
-
/** UTC formatted timestamp for when to triggers the notification. */
|
|
103
|
-
trigger_at: string;
|
|
104
|
-
/** If the notification should be shown as banner. */
|
|
105
|
-
is_banner?: boolean;
|
|
106
|
-
/** Notification channel audience. Determines which platform will receive the notification. */
|
|
107
|
-
audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
|
|
108
|
-
};
|
|
109
|
-
export type CreatePlatformNotificationResponse = {
|
|
110
|
-
intentId: string;
|
|
111
|
-
};
|
|
112
|
-
export type NotificationContentResponse = {
|
|
113
|
-
title: string;
|
|
114
|
-
description: string;
|
|
115
|
-
};
|
|
116
|
-
export type GetTenantNotificationsResponse = {
|
|
117
|
-
id: string;
|
|
118
|
-
content: {
|
|
119
|
-
[key: string]: NotificationContentResponse;
|
|
120
|
-
};
|
|
121
|
-
broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE";
|
|
122
|
-
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
|
|
123
|
-
criticality: "LOW" | "MEDIUM" | "HIGH";
|
|
124
|
-
call_to_action: string;
|
|
125
|
-
persistent: boolean;
|
|
126
|
-
committed: boolean;
|
|
127
|
-
last_until?: string;
|
|
128
|
-
trigger_at: string;
|
|
129
|
-
created_at?: string;
|
|
130
|
-
is_banner: boolean;
|
|
131
|
-
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
132
|
-
};
|
|
133
|
-
export type PagingResponseModelGetTenantNotificationsResponse = {
|
|
134
|
-
items: GetTenantNotificationsResponse[];
|
|
135
|
-
size: number;
|
|
136
|
-
total_elements: number;
|
|
137
|
-
};
|
|
138
|
-
export type GetCommittedNotificationsResponse = {
|
|
139
|
-
/** If there are uncommitted notifications for the user */
|
|
140
|
-
uncommitted_messages: boolean;
|
|
141
|
-
};
|
|
142
|
-
/**
|
|
143
|
-
* Generate a new notification intent to the specified tenant
|
|
144
|
-
*/
|
|
145
|
-
export function create({ dryRun, tenantId, createTenantNotificationRequest }: {
|
|
146
|
-
dryRun?: boolean;
|
|
147
|
-
tenantId: string;
|
|
148
|
-
createTenantNotificationRequest: CreateTenantNotificationRequest;
|
|
149
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
150
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
151
|
-
status: 201;
|
|
152
|
-
data: object;
|
|
153
|
-
} | {
|
|
154
|
-
status: 403;
|
|
155
|
-
data: ApiErrorResponse;
|
|
156
|
-
} | {
|
|
157
|
-
status: 500;
|
|
158
|
-
data: ApiErrorResponse;
|
|
159
|
-
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
|
|
160
|
-
dryRun
|
|
161
|
-
}))}`, oazapfts.json({
|
|
162
|
-
...opts,
|
|
163
|
-
method: "POST",
|
|
164
|
-
body: createTenantNotificationRequest
|
|
165
|
-
})));
|
|
166
|
-
}
|
|
167
|
-
/**
|
|
168
|
-
* Allows to mark a notification as committed
|
|
169
|
-
*/
|
|
170
|
-
export function commit({ notificationId, tenantId }: {
|
|
171
|
-
notificationId: string;
|
|
172
|
-
tenantId: string;
|
|
173
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
174
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
175
|
-
status: 204;
|
|
176
|
-
} | {
|
|
177
|
-
status: 403;
|
|
178
|
-
data: ApiErrorResponse;
|
|
179
|
-
} | {
|
|
180
|
-
status: 500;
|
|
181
|
-
data: ApiErrorResponse;
|
|
182
|
-
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}/commit`, {
|
|
183
|
-
...opts,
|
|
184
|
-
method: "POST"
|
|
185
|
-
}));
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Generate a new notification intent to the specified tenant
|
|
189
|
-
*/
|
|
190
|
-
export function create1({ createPlatformNotificationRequest }: {
|
|
191
|
-
createPlatformNotificationRequest: CreatePlatformNotificationRequest;
|
|
192
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
193
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
194
|
-
status: 200;
|
|
195
|
-
data: CreatePlatformNotificationResponse;
|
|
196
|
-
}>("/v1/notifications", oazapfts.json({
|
|
197
|
-
...opts,
|
|
198
|
-
method: "POST",
|
|
199
|
-
body: createPlatformNotificationRequest
|
|
200
|
-
})));
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Get notifications for tenant
|
|
204
|
-
*/
|
|
205
|
-
export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, audience, tenantId }: {
|
|
206
|
-
size?: number;
|
|
207
|
-
page?: number;
|
|
208
|
-
createdSince?: number;
|
|
209
|
-
context?: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
|
|
210
|
-
criticality?: "LOW" | "MEDIUM" | "HIGH";
|
|
211
|
-
content?: string;
|
|
212
|
-
committed?: boolean;
|
|
213
|
-
isBanner?: boolean;
|
|
214
|
-
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
215
|
-
tenantId: string;
|
|
216
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
217
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
218
|
-
status: 200;
|
|
219
|
-
data: PagingResponseModelGetTenantNotificationsResponse;
|
|
220
|
-
} | {
|
|
221
|
-
status: 403;
|
|
222
|
-
data: ApiErrorResponse;
|
|
223
|
-
} | {
|
|
224
|
-
status: 500;
|
|
225
|
-
data: ApiErrorResponse;
|
|
226
|
-
}>(`/v2/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
|
|
227
|
-
size,
|
|
228
|
-
page,
|
|
229
|
-
createdSince,
|
|
230
|
-
context,
|
|
231
|
-
criticality,
|
|
232
|
-
content,
|
|
233
|
-
committed,
|
|
234
|
-
isBanner,
|
|
235
|
-
audience
|
|
236
|
-
}))}`, {
|
|
237
|
-
...opts
|
|
238
|
-
}));
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Allows to check if there are any uncommitted notifications for the user
|
|
242
|
-
*/
|
|
243
|
-
export function committedNotifications({ audience, tenantId }: {
|
|
244
|
-
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
245
|
-
tenantId: string;
|
|
246
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
247
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
248
|
-
status: 200;
|
|
249
|
-
data: GetCommittedNotificationsResponse;
|
|
250
|
-
} | {
|
|
251
|
-
status: 403;
|
|
252
|
-
data: ApiErrorResponse;
|
|
253
|
-
} | {
|
|
254
|
-
status: 500;
|
|
255
|
-
data: ApiErrorResponse;
|
|
256
|
-
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/committed${QS.query(QS.explode({
|
|
257
|
-
audience
|
|
258
|
-
}))}`, {
|
|
259
|
-
...opts
|
|
260
|
-
}));
|
|
261
|
-
}
|
|
262
|
-
/**
|
|
263
|
-
* Actuator web endpoint 'health'
|
|
264
|
-
*/
|
|
265
|
-
export function health(opts?: Oazapfts.RequestOpts) {
|
|
266
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
267
|
-
status: 200;
|
|
268
|
-
data: object;
|
|
269
|
-
}>("/healthz", {
|
|
270
|
-
...opts
|
|
271
|
-
}));
|
|
272
|
-
}
|
|
273
|
-
/**
|
|
274
|
-
* Actuator web endpoint 'health-path'
|
|
275
|
-
*/
|
|
276
|
-
export function getHealthz(opts?: Oazapfts.RequestOpts) {
|
|
277
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
278
|
-
status: 200;
|
|
279
|
-
data: object;
|
|
280
|
-
}>("/healthz/**", {
|
|
281
|
-
...opts
|
|
282
|
-
}));
|
|
283
|
-
}
|
|
284
|
-
/**
|
|
285
|
-
* Delete notification by intent id
|
|
286
|
-
*/
|
|
287
|
-
export function deleteV1TenantsByTenantIdNotificationsAndNotificationIntentId({ notificationIntentId, tenantId }: {
|
|
288
|
-
notificationIntentId: string;
|
|
289
|
-
tenantId: string;
|
|
290
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
291
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
292
|
-
status: 204;
|
|
293
|
-
} | {
|
|
294
|
-
status: 403;
|
|
295
|
-
data: ApiErrorResponse;
|
|
296
|
-
} | {
|
|
297
|
-
status: 500;
|
|
298
|
-
data: ApiErrorResponse;
|
|
299
|
-
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationIntentId)}`, {
|
|
300
|
-
...opts,
|
|
301
|
-
method: "DELETE"
|
|
302
|
-
}));
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* Allows to unmark a notification as committed
|
|
306
|
-
*/
|
|
307
|
-
export function uncommit({ notificationId, tenantId }: {
|
|
308
|
-
notificationId: string;
|
|
309
|
-
tenantId: string;
|
|
310
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
311
|
-
return oazapfts.ok(oazapfts.fetchJson<{
|
|
312
|
-
status: 204;
|
|
313
|
-
} | {
|
|
314
|
-
status: 403;
|
|
315
|
-
data: ApiErrorResponse;
|
|
316
|
-
} | {
|
|
317
|
-
status: 500;
|
|
318
|
-
data: ApiErrorResponse;
|
|
319
|
-
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}/uncommit`, {
|
|
320
|
-
...opts,
|
|
321
|
-
method: "DELETE"
|
|
322
|
-
}));
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Batches deletes the notification in all tenants
|
|
326
|
-
*/
|
|
327
|
-
export function delete1({ notificationIntentId }: {
|
|
328
|
-
notificationIntentId: string;
|
|
329
|
-
}, opts?: Oazapfts.RequestOpts) {
|
|
330
|
-
return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationIntentId)}`, {
|
|
331
|
-
...opts,
|
|
332
|
-
method: "DELETE"
|
|
333
|
-
}));
|
|
334
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Notification Engine
|
|
3
|
+
* 1.0.0
|
|
4
|
+
* DO NOT MODIFY - This file has been generated using oazapfts.
|
|
5
|
+
* See https://www.npmjs.com/package/oazapfts
|
|
6
|
+
*/
|
|
7
|
+
import * as Oazapfts from "@oazapfts/runtime";
|
|
8
|
+
import * as QS from "@oazapfts/runtime/query";
|
|
9
|
+
export const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders> = {
|
|
10
|
+
headers: {},
|
|
11
|
+
baseUrl: "https://account-notification-engine.stg.stackspot.com",
|
|
12
|
+
};
|
|
13
|
+
const oazapfts = Oazapfts.runtime(defaults);
|
|
14
|
+
export const servers = {
|
|
15
|
+
generatedServerUrl: "https://account-notification-engine.stg.stackspot.com"
|
|
16
|
+
};
|
|
17
|
+
export type NotificationContentRequest = {
|
|
18
|
+
/** User friendly title for the notification */
|
|
19
|
+
title: string;
|
|
20
|
+
/** User friendly description for the notification (allows the use of markdown) */
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
export type NotificationTargetBase = {
|
|
24
|
+
"type": string;
|
|
25
|
+
};
|
|
26
|
+
export type AccountValue = {
|
|
27
|
+
"type": "AccountValue";
|
|
28
|
+
} & NotificationTargetBase & {
|
|
29
|
+
value?: string;
|
|
30
|
+
};
|
|
31
|
+
export type Attribute = {
|
|
32
|
+
key: string;
|
|
33
|
+
value: string;
|
|
34
|
+
};
|
|
35
|
+
export type Value = {
|
|
36
|
+
attribute?: Attribute;
|
|
37
|
+
resourceType: string;
|
|
38
|
+
resourceSlug: string;
|
|
39
|
+
action: string;
|
|
40
|
+
};
|
|
41
|
+
export type ResourceValue = {
|
|
42
|
+
"type": "ResourceValue";
|
|
43
|
+
} & NotificationTargetBase & {
|
|
44
|
+
value?: Value;
|
|
45
|
+
};
|
|
46
|
+
export type UsersValue = {
|
|
47
|
+
"type": "UsersValue";
|
|
48
|
+
} & NotificationTargetBase & {
|
|
49
|
+
value?: string[];
|
|
50
|
+
};
|
|
51
|
+
export type CreateTenantNotificationRequest = {
|
|
52
|
+
/** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
|
|
53
|
+
content: {
|
|
54
|
+
[key: string]: NotificationContentRequest;
|
|
55
|
+
};
|
|
56
|
+
/** Level of broadcasting to the notification. */
|
|
57
|
+
broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE" | "ACCOUNT" | "INDIVIDUAL" | "RESOURCE";
|
|
58
|
+
target: AccountValue | ResourceValue | UsersValue;
|
|
59
|
+
/** Criticality of the notification. */
|
|
60
|
+
criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
|
|
61
|
+
/** Which context to publish the notification */
|
|
62
|
+
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
|
|
63
|
+
/** Possible redirect link for the notification button. */
|
|
64
|
+
call_to_action: string;
|
|
65
|
+
/** If the notification should be re-consumed until 'last_until' is reached. */
|
|
66
|
+
persistent?: boolean;
|
|
67
|
+
/** UTC formatted timestamp to when the notification should finally end, if the persistent is set to true. */
|
|
68
|
+
last_until?: string;
|
|
69
|
+
/** UTC formatted timestamp for when to triggers the notification. */
|
|
70
|
+
trigger_at: string;
|
|
71
|
+
/** Notification channel audience. Determines which platform will receive the notification. */
|
|
72
|
+
audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
|
|
73
|
+
};
|
|
74
|
+
export type ErrorDetails = {
|
|
75
|
+
code: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
|
|
76
|
+
field?: string;
|
|
77
|
+
details?: string;
|
|
78
|
+
values?: string[];
|
|
79
|
+
};
|
|
80
|
+
export type ApiErrorResponse = {
|
|
81
|
+
code?: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
|
|
82
|
+
status: number;
|
|
83
|
+
message: string;
|
|
84
|
+
details?: ErrorDetails[];
|
|
85
|
+
};
|
|
86
|
+
export type CreatePlatformNotificationRequest = {
|
|
87
|
+
/** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
|
|
88
|
+
content: {
|
|
89
|
+
[key: string]: NotificationContentRequest;
|
|
90
|
+
};
|
|
91
|
+
target?: ResourceValue;
|
|
92
|
+
/** Criticality of the notification. */
|
|
93
|
+
criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
|
|
94
|
+
/** Which context to publish the notification */
|
|
95
|
+
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
|
|
96
|
+
/** Possible redirect link for the notification button. */
|
|
97
|
+
call_to_action: string;
|
|
98
|
+
/** If the notification should be re-consumed until last_until is reached. */
|
|
99
|
+
persistent?: boolean;
|
|
100
|
+
/** UTC formatted timestamp to when the notification should finally ended if the persistent is set to true. */
|
|
101
|
+
last_until?: string;
|
|
102
|
+
/** UTC formatted timestamp for when to triggers the notification. */
|
|
103
|
+
trigger_at: string;
|
|
104
|
+
/** If the notification should be shown as banner. */
|
|
105
|
+
is_banner?: boolean;
|
|
106
|
+
/** Notification channel audience. Determines which platform will receive the notification. */
|
|
107
|
+
audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
|
|
108
|
+
};
|
|
109
|
+
export type CreatePlatformNotificationResponse = {
|
|
110
|
+
intentId: string;
|
|
111
|
+
};
|
|
112
|
+
export type NotificationContentResponse = {
|
|
113
|
+
title: string;
|
|
114
|
+
description: string;
|
|
115
|
+
};
|
|
116
|
+
export type GetTenantNotificationsResponse = {
|
|
117
|
+
id: string;
|
|
118
|
+
content: {
|
|
119
|
+
[key: string]: NotificationContentResponse;
|
|
120
|
+
};
|
|
121
|
+
broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE";
|
|
122
|
+
context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
|
|
123
|
+
criticality: "LOW" | "MEDIUM" | "HIGH";
|
|
124
|
+
call_to_action: string;
|
|
125
|
+
persistent: boolean;
|
|
126
|
+
committed: boolean;
|
|
127
|
+
last_until?: string;
|
|
128
|
+
trigger_at: string;
|
|
129
|
+
created_at?: string;
|
|
130
|
+
is_banner: boolean;
|
|
131
|
+
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
132
|
+
};
|
|
133
|
+
export type PagingResponseModelGetTenantNotificationsResponse = {
|
|
134
|
+
items: GetTenantNotificationsResponse[];
|
|
135
|
+
size: number;
|
|
136
|
+
total_elements: number;
|
|
137
|
+
};
|
|
138
|
+
export type GetCommittedNotificationsResponse = {
|
|
139
|
+
/** If there are uncommitted notifications for the user */
|
|
140
|
+
uncommitted_messages: boolean;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Generate a new notification intent to the specified tenant
|
|
144
|
+
*/
|
|
145
|
+
export function create({ dryRun, tenantId, createTenantNotificationRequest }: {
|
|
146
|
+
dryRun?: boolean;
|
|
147
|
+
tenantId: string;
|
|
148
|
+
createTenantNotificationRequest: CreateTenantNotificationRequest;
|
|
149
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
150
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
151
|
+
status: 201;
|
|
152
|
+
data: object;
|
|
153
|
+
} | {
|
|
154
|
+
status: 403;
|
|
155
|
+
data: ApiErrorResponse;
|
|
156
|
+
} | {
|
|
157
|
+
status: 500;
|
|
158
|
+
data: ApiErrorResponse;
|
|
159
|
+
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
|
|
160
|
+
dryRun
|
|
161
|
+
}))}`, oazapfts.json({
|
|
162
|
+
...opts,
|
|
163
|
+
method: "POST",
|
|
164
|
+
body: createTenantNotificationRequest
|
|
165
|
+
})));
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Allows to mark a notification as committed
|
|
169
|
+
*/
|
|
170
|
+
export function commit({ notificationId, tenantId }: {
|
|
171
|
+
notificationId: string;
|
|
172
|
+
tenantId: string;
|
|
173
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
174
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
175
|
+
status: 204;
|
|
176
|
+
} | {
|
|
177
|
+
status: 403;
|
|
178
|
+
data: ApiErrorResponse;
|
|
179
|
+
} | {
|
|
180
|
+
status: 500;
|
|
181
|
+
data: ApiErrorResponse;
|
|
182
|
+
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}/commit`, {
|
|
183
|
+
...opts,
|
|
184
|
+
method: "POST"
|
|
185
|
+
}));
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Generate a new notification intent to the specified tenant
|
|
189
|
+
*/
|
|
190
|
+
export function create1({ createPlatformNotificationRequest }: {
|
|
191
|
+
createPlatformNotificationRequest: CreatePlatformNotificationRequest;
|
|
192
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
193
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
194
|
+
status: 200;
|
|
195
|
+
data: CreatePlatformNotificationResponse;
|
|
196
|
+
}>("/v1/notifications", oazapfts.json({
|
|
197
|
+
...opts,
|
|
198
|
+
method: "POST",
|
|
199
|
+
body: createPlatformNotificationRequest
|
|
200
|
+
})));
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Get notifications for tenant
|
|
204
|
+
*/
|
|
205
|
+
export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, audience, tenantId }: {
|
|
206
|
+
size?: number;
|
|
207
|
+
page?: number;
|
|
208
|
+
createdSince?: number;
|
|
209
|
+
context?: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
|
|
210
|
+
criticality?: "LOW" | "MEDIUM" | "HIGH";
|
|
211
|
+
content?: string;
|
|
212
|
+
committed?: boolean;
|
|
213
|
+
isBanner?: boolean;
|
|
214
|
+
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
215
|
+
tenantId: string;
|
|
216
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
217
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
218
|
+
status: 200;
|
|
219
|
+
data: PagingResponseModelGetTenantNotificationsResponse;
|
|
220
|
+
} | {
|
|
221
|
+
status: 403;
|
|
222
|
+
data: ApiErrorResponse;
|
|
223
|
+
} | {
|
|
224
|
+
status: 500;
|
|
225
|
+
data: ApiErrorResponse;
|
|
226
|
+
}>(`/v2/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
|
|
227
|
+
size,
|
|
228
|
+
page,
|
|
229
|
+
createdSince,
|
|
230
|
+
context,
|
|
231
|
+
criticality,
|
|
232
|
+
content,
|
|
233
|
+
committed,
|
|
234
|
+
isBanner,
|
|
235
|
+
audience
|
|
236
|
+
}))}`, {
|
|
237
|
+
...opts
|
|
238
|
+
}));
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Allows to check if there are any uncommitted notifications for the user
|
|
242
|
+
*/
|
|
243
|
+
export function committedNotifications({ audience, tenantId }: {
|
|
244
|
+
audience?: "AI" | "EDP" | "ACCOUNT";
|
|
245
|
+
tenantId: string;
|
|
246
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
247
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
248
|
+
status: 200;
|
|
249
|
+
data: GetCommittedNotificationsResponse;
|
|
250
|
+
} | {
|
|
251
|
+
status: 403;
|
|
252
|
+
data: ApiErrorResponse;
|
|
253
|
+
} | {
|
|
254
|
+
status: 500;
|
|
255
|
+
data: ApiErrorResponse;
|
|
256
|
+
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/committed${QS.query(QS.explode({
|
|
257
|
+
audience
|
|
258
|
+
}))}`, {
|
|
259
|
+
...opts
|
|
260
|
+
}));
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Actuator web endpoint 'health'
|
|
264
|
+
*/
|
|
265
|
+
export function health(opts?: Oazapfts.RequestOpts) {
|
|
266
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
267
|
+
status: 200;
|
|
268
|
+
data: object;
|
|
269
|
+
}>("/healthz", {
|
|
270
|
+
...opts
|
|
271
|
+
}));
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Actuator web endpoint 'health-path'
|
|
275
|
+
*/
|
|
276
|
+
export function getHealthz(opts?: Oazapfts.RequestOpts) {
|
|
277
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
278
|
+
status: 200;
|
|
279
|
+
data: object;
|
|
280
|
+
}>("/healthz/**", {
|
|
281
|
+
...opts
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
285
|
+
* Delete notification by intent id
|
|
286
|
+
*/
|
|
287
|
+
export function deleteV1TenantsByTenantIdNotificationsAndNotificationIntentId({ notificationIntentId, tenantId }: {
|
|
288
|
+
notificationIntentId: string;
|
|
289
|
+
tenantId: string;
|
|
290
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
291
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
292
|
+
status: 204;
|
|
293
|
+
} | {
|
|
294
|
+
status: 403;
|
|
295
|
+
data: ApiErrorResponse;
|
|
296
|
+
} | {
|
|
297
|
+
status: 500;
|
|
298
|
+
data: ApiErrorResponse;
|
|
299
|
+
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationIntentId)}`, {
|
|
300
|
+
...opts,
|
|
301
|
+
method: "DELETE"
|
|
302
|
+
}));
|
|
303
|
+
}
|
|
304
|
+
/**
|
|
305
|
+
* Allows to unmark a notification as committed
|
|
306
|
+
*/
|
|
307
|
+
export function uncommit({ notificationId, tenantId }: {
|
|
308
|
+
notificationId: string;
|
|
309
|
+
tenantId: string;
|
|
310
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
311
|
+
return oazapfts.ok(oazapfts.fetchJson<{
|
|
312
|
+
status: 204;
|
|
313
|
+
} | {
|
|
314
|
+
status: 403;
|
|
315
|
+
data: ApiErrorResponse;
|
|
316
|
+
} | {
|
|
317
|
+
status: 500;
|
|
318
|
+
data: ApiErrorResponse;
|
|
319
|
+
}>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}/uncommit`, {
|
|
320
|
+
...opts,
|
|
321
|
+
method: "DELETE"
|
|
322
|
+
}));
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Batches deletes the notification in all tenants
|
|
326
|
+
*/
|
|
327
|
+
export function delete1({ notificationIntentId }: {
|
|
328
|
+
notificationIntentId: string;
|
|
329
|
+
}, opts?: Oazapfts.RequestOpts) {
|
|
330
|
+
return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationIntentId)}`, {
|
|
331
|
+
...opts,
|
|
332
|
+
method: "DELETE"
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
|