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