@stack-spot/portal-network 0.184.0-beta.1 → 0.184.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 (151) hide show
  1. package/CHANGELOG.md +2412 -2431
  2. package/dist/api/account.js +1 -1
  3. package/dist/api/agent-tools.js +1 -1
  4. package/dist/api/agent.js +1 -1
  5. package/dist/api/ai.js +1 -1
  6. package/dist/api/apiManagement.js +1 -1
  7. package/dist/api/apiRuntime.js +1 -1
  8. package/dist/api/cloudAccount.js +1 -1
  9. package/dist/api/cloudPlatform.js +1 -1
  10. package/dist/api/cloudPlatformHorizon.js +1 -1
  11. package/dist/api/cloudRuntimes.js +1 -1
  12. package/dist/api/cloudServices.js +1 -1
  13. package/dist/api/codeShift.d.ts +4 -76
  14. package/dist/api/codeShift.d.ts.map +1 -1
  15. package/dist/api/codeShift.js +1 -14
  16. package/dist/api/codeShift.js.map +1 -1
  17. package/dist/api/content.js +1 -1
  18. package/dist/api/dataIntegration.js +1 -1
  19. package/dist/api/discover.js +1 -1
  20. package/dist/api/genAiInference.js +1 -1
  21. package/dist/api/insights.js +1 -1
  22. package/dist/api/notification.js +1 -1
  23. package/dist/api/secrets.js +1 -1
  24. package/dist/api/serviceCatalog.js +1 -1
  25. package/dist/api/workspace-ai.js +1 -1
  26. package/dist/api/workspace.js +1 -1
  27. package/dist/api/workspaceManager.d.ts +16 -10
  28. package/dist/api/workspaceManager.d.ts.map +1 -1
  29. package/dist/api/workspaceManager.js +11 -1
  30. package/dist/api/workspaceManager.js.map +1 -1
  31. package/dist/api/workspaceSearchEngine.js +1 -1
  32. package/dist/client/ai.d.ts.map +1 -1
  33. package/dist/client/ai.js +14 -84
  34. package/dist/client/ai.js.map +1 -1
  35. package/dist/client/code-shift.d.ts +0 -30
  36. package/dist/client/code-shift.d.ts.map +1 -1
  37. package/dist/client/code-shift.js +1 -37
  38. package/dist/client/code-shift.js.map +1 -1
  39. package/dist/client/types.d.ts +6 -26
  40. package/dist/client/types.d.ts.map +1 -1
  41. package/dist/client/workspace-manager.d.ts +6 -0
  42. package/dist/client/workspace-manager.d.ts.map +1 -1
  43. package/dist/client/workspace-manager.js +10 -1
  44. package/dist/client/workspace-manager.js.map +1 -1
  45. package/package.json +1 -1
  46. package/readme.md +1 -1
  47. package/scripts/generate-apis.ts +134 -134
  48. package/src/api/account.ts +8367 -8368
  49. package/src/api/agent-tools.ts +2169 -2172
  50. package/src/api/agent.ts +1083 -1085
  51. package/src/api/ai.ts +3388 -3388
  52. package/src/api/apiManagement.ts +570 -570
  53. package/src/api/apiRuntime.ts +2103 -2103
  54. package/src/api/cloudAccount.ts +1239 -1239
  55. package/src/api/cloudPlatform.ts +927 -927
  56. package/src/api/cloudPlatformHorizon.ts +2655 -2655
  57. package/src/api/cloudRuntimes.ts +2043 -2043
  58. package/src/api/cloudServices.ts +1445 -1445
  59. package/src/api/codeShift.ts +3481 -3580
  60. package/src/api/content.ts +9785 -9785
  61. package/src/api/dataIntegration.ts +1657 -1657
  62. package/src/api/discover.ts +435 -435
  63. package/src/api/eventBus.ts +171 -171
  64. package/src/api/genAiInference.ts +603 -603
  65. package/src/api/insights.ts +310 -310
  66. package/src/api/notification.ts +334 -336
  67. package/src/api/secrets.ts +342 -342
  68. package/src/api/serviceCatalog.ts +2908 -2908
  69. package/src/api/workflows.ts +1669 -1669
  70. package/src/api/workspace-ai.ts +677 -677
  71. package/src/api/workspace.ts +5889 -5889
  72. package/src/api/workspaceManager.ts +2951 -2936
  73. package/src/api/workspaceSearchEngine.ts +153 -153
  74. package/src/api-addresses.ts +120 -120
  75. package/src/apis-itau.json +225 -225
  76. package/src/apis.json +225 -225
  77. package/src/client/account.ts +902 -902
  78. package/src/client/agent-tools.ts +210 -210
  79. package/src/client/agent.ts +81 -81
  80. package/src/client/ai.ts +395 -469
  81. package/src/client/api-management.ts +40 -40
  82. package/src/client/cloud-account.ts +70 -70
  83. package/src/client/cloud-platform-horizon.ts +113 -113
  84. package/src/client/cloud-platform.ts +163 -163
  85. package/src/client/cloud-runtimes.ts +129 -129
  86. package/src/client/cloud-services.ts +94 -94
  87. package/src/client/code-shift.ts +349 -371
  88. package/src/client/content.ts +538 -538
  89. package/src/client/data-integration.ts +191 -191
  90. package/src/client/discover.ts +89 -89
  91. package/src/client/event-bus.ts +84 -84
  92. package/src/client/gen-ai-inference.ts +65 -65
  93. package/src/client/insights.ts +28 -28
  94. package/src/client/notification.ts +32 -32
  95. package/src/client/runtime-manager.ts +76 -76
  96. package/src/client/secrets.ts +60 -60
  97. package/src/client/types.ts +377 -398
  98. package/src/client/workflow.ts +83 -83
  99. package/src/client/workspace-ai.ts +191 -191
  100. package/src/client/workspace-manager.ts +564 -560
  101. package/src/client/workspace-search.ts +39 -39
  102. package/src/client/workspace.ts +480 -480
  103. package/src/error/DefaultAPIError.ts +151 -151
  104. package/src/error/FileUploadError.ts +18 -18
  105. package/src/error/IgnoredErrorCodes.ts +3 -3
  106. package/src/error/StackspotAPIError.ts +101 -101
  107. package/src/error/StreamCanceledError.ts +10 -10
  108. package/src/error/StreamError.ts +7 -7
  109. package/src/error/StreamJsonError.ts +10 -10
  110. package/src/error/dictionary/account.ts +58 -58
  111. package/src/error/dictionary/action-details.ts +20 -20
  112. package/src/error/dictionary/action.ts +211 -211
  113. package/src/error/dictionary/agent-tools.ts +75 -75
  114. package/src/error/dictionary/ai-inference.ts +28 -28
  115. package/src/error/dictionary/base.ts +22 -22
  116. package/src/error/dictionary/cloud-platform.ts +82 -82
  117. package/src/error/dictionary/cnt-fields.ts +14 -14
  118. package/src/error/dictionary/cnt.ts +103 -103
  119. package/src/error/dictionary/code-shift.ts +12 -12
  120. package/src/error/dictionary/rte.ts +24 -24
  121. package/src/error/dictionary/rtm.ts +10 -10
  122. package/src/error/dictionary/secrets.ts +14 -14
  123. package/src/error/dictionary/workspace-ai.ts +10 -10
  124. package/src/error/dictionary/workspace-details.ts +15 -15
  125. package/src/error/dictionary/workspace-fields.ts +10 -10
  126. package/src/error/dictionary/workspace.ts +209 -209
  127. package/src/error/types.ts +21 -21
  128. package/src/index.ts +43 -43
  129. package/src/network/AutoInfiniteQuery.ts +115 -115
  130. package/src/network/AutoMutation.ts +27 -27
  131. package/src/network/AutoOperation.ts +73 -73
  132. package/src/network/AutoQuery.ts +75 -75
  133. package/src/network/ManualInfiniteQuery.ts +95 -95
  134. package/src/network/ManualMutation.ts +40 -40
  135. package/src/network/ManualOperation.ts +52 -52
  136. package/src/network/ManualQuery.ts +82 -82
  137. package/src/network/NetworkClient.ts +167 -167
  138. package/src/network/ReactQueryNetworkClient.ts +312 -312
  139. package/src/network/react-query-client.ts +14 -14
  140. package/src/network/types.ts +294 -294
  141. package/src/types.ts +1 -1
  142. package/src/utils/StreamedArray.tsx +146 -146
  143. package/src/utils/StreamedJson.tsx +166 -166
  144. package/src/utils/remove-authorization-param.ts +6 -6
  145. package/src/utils/string.ts +19 -19
  146. package/src/utils/use-extended-list.ts +80 -80
  147. package/src/utils/use-streamed-array.ts +17 -17
  148. package/tsconfig.build.json +4 -4
  149. package/tsconfig.json +10 -10
  150. package/logs/simple-failure/01JBER7AWKACEC3Y1NF7M6PHFF/job_id_1.log +0 -3
  151. package/logs/simple-suspend/01JBEMQG94ADPT99MSZ7EJKGXZ/job_id_1.log +0 -5
@@ -1,336 +1,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
-
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
+ }