@stack-spot/portal-network 0.122.1 → 0.123.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.123.0](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.122.1...portal-network@v0.123.0) (2025-05-07)
4
+
5
+
6
+ ### Features
7
+
8
+ * notification audience ([5b6636e](https://github.com/stack-spot/portal-commons/commit/5b6636e52488dd32fece6b2b09d5410e16eea5c6))
9
+
3
10
  ## [0.122.1](https://github.com/stack-spot/portal-commons/compare/portal-network@v0.122.0...portal-network@v0.122.1) (2025-05-07)
4
11
 
5
12
 
@@ -9,49 +9,39 @@ export declare const defaults: Oazapfts.Defaults<Oazapfts.CustomHeaders>;
9
9
  export declare const servers: {
10
10
  generatedServerUrl: string;
11
11
  };
12
- export type NotificationContentResponse = {
12
+ export type NotificationContentRequest = {
13
+ /** User friendly title for the notification */
13
14
  title: string;
15
+ /** User friendly description for the notification (allows the use of markdown) */
14
16
  description: string;
15
17
  };
16
- export type GetTenantNotificationsResponse = {
17
- id: string;
18
- content: {
19
- [key: string]: NotificationContentResponse;
20
- };
21
- broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE";
22
- context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
23
- target?: string;
24
- criticality: "LOW" | "MEDIUM" | "HIGH";
25
- call_to_action: string;
26
- persistent: boolean;
27
- committed: boolean;
28
- last_until?: string;
29
- trigger_at: string;
30
- created_at?: string;
31
- is_banner: boolean;
18
+ export type NotificationTargetBase = {
19
+ "type": string;
32
20
  };
33
- export type PagingResponseModelGetTenantNotificationsResponse = {
34
- items: GetTenantNotificationsResponse[];
35
- size: number;
36
- total_elements: number;
21
+ export type AccountValue = {
22
+ "type": "AccountValue";
23
+ } & NotificationTargetBase & {
24
+ value?: string;
37
25
  };
38
- export type ErrorDetails = {
39
- code: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
40
- field?: string;
41
- details?: string;
42
- values?: string[];
26
+ export type Attribute = {
27
+ key: string;
28
+ value: string;
43
29
  };
44
- export type ApiErrorResponse = {
45
- code?: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
46
- status: number;
47
- message: string;
48
- details?: ErrorDetails[];
30
+ export type Value = {
31
+ attribute?: Attribute;
32
+ resourceType: string;
33
+ resourceSlug: string;
34
+ action: string;
49
35
  };
50
- export type NotificationContentRequest = {
51
- /** User friendly title for the notification */
52
- title: string;
53
- /** User friendly description for the notification (allows the use of markdown) */
54
- description: string;
36
+ export type ResourceValue = {
37
+ "type": "ResourceValue";
38
+ } & NotificationTargetBase & {
39
+ value?: Value;
40
+ };
41
+ export type UsersValue = {
42
+ "type": "UsersValue";
43
+ } & NotificationTargetBase & {
44
+ value?: string[];
55
45
  };
56
46
  export type CreateTenantNotificationRequest = {
57
47
  /** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
@@ -60,65 +50,95 @@ export type CreateTenantNotificationRequest = {
60
50
  };
61
51
  /** Level of broadcasting to the notification. */
62
52
  broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE" | "ACCOUNT" | "INDIVIDUAL" | "RESOURCE";
63
- /** The target of the notification, user id for 'individual', resource id for 'resource', leave empty for any other */
64
- target: string;
53
+ target: AccountValue | ResourceValue | UsersValue;
65
54
  /** Criticality of the notification. */
66
- criticality: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
55
+ criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
67
56
  /** Which context to publish the notification */
68
57
  context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
69
58
  /** Possible redirect link for the notification button. */
70
59
  call_to_action: string;
71
60
  /** If the notification should be re-consumed until 'last_until' is reached. */
72
- persistent: boolean;
61
+ persistent?: boolean;
73
62
  /** UTC formatted timestamp to when the notification should finally end, if the persistent is set to true. */
74
63
  last_until?: string;
75
64
  /** UTC formatted timestamp for when to triggers the notification. */
76
65
  trigger_at: string;
66
+ /** Notification channel audience. Determines which platform will receive the notification. */
67
+ audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
68
+ };
69
+ export type ErrorDetails = {
70
+ code: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
71
+ field?: string;
72
+ details?: string;
73
+ values?: string[];
74
+ };
75
+ export type ApiErrorResponse = {
76
+ code?: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
77
+ status: number;
78
+ message: string;
79
+ details?: ErrorDetails[];
77
80
  };
78
81
  export type CreatePlatformNotificationRequest = {
79
82
  /** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
80
83
  content: {
81
84
  [key: string]: NotificationContentRequest;
82
85
  };
86
+ target?: ResourceValue;
83
87
  /** Criticality of the notification. */
84
- criticality: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
88
+ criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
85
89
  /** Which context to publish the notification */
86
90
  context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
87
91
  /** Possible redirect link for the notification button. */
88
92
  call_to_action: string;
89
93
  /** If the notification should be re-consumed until last_until is reached. */
90
- persistent: boolean;
94
+ persistent?: boolean;
91
95
  /** UTC formatted timestamp to when the notification should finally ended if the persistent is set to true. */
92
96
  last_until?: string;
93
97
  /** UTC formatted timestamp for when to triggers the notification. */
94
98
  trigger_at: string;
95
99
  /** If the notification should be shown as banner. */
96
- is_banner: boolean;
100
+ is_banner?: boolean;
101
+ /** Notification channel audience. Determines which platform will receive the notification. */
102
+ audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
97
103
  };
98
104
  export type CreatePlatformNotificationResponse = {
105
+ intentId: string;
106
+ };
107
+ export type NotificationContentResponse = {
108
+ title: string;
109
+ description: string;
110
+ };
111
+ export type GetTenantNotificationsResponse = {
99
112
  id: string;
113
+ content: {
114
+ [key: string]: NotificationContentResponse;
115
+ };
116
+ broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE";
117
+ context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
118
+ criticality: "LOW" | "MEDIUM" | "HIGH";
119
+ call_to_action: string;
120
+ persistent: boolean;
121
+ committed: boolean;
122
+ last_until?: string;
123
+ trigger_at: string;
124
+ created_at?: string;
125
+ is_banner: boolean;
126
+ audience?: "AI" | "EDP" | "ACCOUNT";
127
+ };
128
+ export type PagingResponseModelGetTenantNotificationsResponse = {
129
+ items: GetTenantNotificationsResponse[];
130
+ size: number;
131
+ total_elements: number;
100
132
  };
101
133
  export type GetCommittedNotificationsResponse = {
102
134
  /** If there are uncommitted notifications for the user */
103
135
  uncommitted_messages: boolean;
104
136
  };
105
- /**
106
- * Get notifications for tenant
107
- */
108
- export declare function findAll1({ size, page, createdSince, context, criticality, content, committed, tenantId }: {
109
- size?: number;
110
- page?: number;
111
- createdSince?: number;
112
- context?: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
113
- criticality?: "LOW" | "MEDIUM" | "HIGH";
114
- content?: string;
115
- committed?: boolean;
116
- tenantId: string;
117
- }, opts?: Oazapfts.RequestOpts): Promise<PagingResponseModelGetTenantNotificationsResponse>;
118
137
  /**
119
138
  * Generate a new notification intent to the specified tenant
120
139
  */
121
- export declare function create({ tenantId, createTenantNotificationRequest }: {
140
+ export declare function create({ dryRun, tenantId, createTenantNotificationRequest }: {
141
+ dryRun?: boolean;
122
142
  tenantId: string;
123
143
  createTenantNotificationRequest: CreateTenantNotificationRequest;
124
144
  }, opts?: Oazapfts.RequestOpts): Promise<object>;
@@ -138,7 +158,7 @@ export declare function create1({ createPlatformNotificationRequest }: {
138
158
  /**
139
159
  * Get notifications for tenant
140
160
  */
141
- export declare function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, tenantId }: {
161
+ export declare function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, audience, tenantId }: {
142
162
  size?: number;
143
163
  page?: number;
144
164
  createdSince?: number;
@@ -147,6 +167,7 @@ export declare function findAll({ size, page, createdSince, context, criticality
147
167
  content?: string;
148
168
  committed?: boolean;
149
169
  isBanner?: boolean;
170
+ audience?: "AI" | "EDP" | "ACCOUNT";
150
171
  tenantId: string;
151
172
  }, opts?: Oazapfts.RequestOpts): Promise<PagingResponseModelGetTenantNotificationsResponse>;
152
173
  /**
@@ -164,10 +185,10 @@ export declare function health(opts?: Oazapfts.RequestOpts): Promise<object>;
164
185
  */
165
186
  export declare function getHealthz(opts?: Oazapfts.RequestOpts): Promise<object>;
166
187
  /**
167
- * Delete notification by id
188
+ * Delete notification by intent id
168
189
  */
169
- export declare function deleteV1TenantsByTenantIdNotificationsAndNotificationId({ notificationId, tenantId }: {
170
- notificationId: string;
190
+ export declare function deleteV1TenantsByTenantIdNotificationsAndNotificationIntentId({ notificationIntentId, tenantId }: {
191
+ notificationIntentId: string;
171
192
  tenantId: string;
172
193
  }, opts?: Oazapfts.RequestOpts): Promise<unknown>;
173
194
  /**
@@ -180,7 +201,7 @@ export declare function uncommit({ notificationId, tenantId }: {
180
201
  /**
181
202
  * Batches deletes the notification in all tenants
182
203
  */
183
- export declare function delete1({ notificationId }: {
184
- notificationId: string;
204
+ export declare function delete1({ notificationIntentId }: {
205
+ notificationIntentId: string;
185
206
  }, opts?: Oazapfts.RequestOpts): Promise<never>;
186
207
  //# sourceMappingURL=notification.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/api/notification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAE9C,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC,aAAa,CAG9D,CAAC;AAEF,eAAO,MAAM,OAAO;;CAEnB,CAAC;AACF,MAAM,MAAM,2BAA2B,GAAG;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACvB,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE;QACL,CAAC,GAAG,EAAE,MAAM,GAAG,2BAA2B,CAAC;KAC9C,CAAC;IACF,eAAe,EAAE,SAAS,GAAG,YAAY,GAAG,UAAU,GAAG,UAAU,CAAC;IACpE,OAAO,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,IAAI,CAAC;IACnD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,CAAC;IACvC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,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AACH,wBAAgB,QAAQ,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,EAAE;IACnD,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;CACpB,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,oBAa7B;AACD;;GAEG;AACH,wBAAgB,OAAO,CAAC,EAAE,oBAAoB,EAAE,EAAE;IAC9C,oBAAoB,EAAE,MAAM,CAAC;CAChC,EAAE,IAAI,CAAC,EAAE,QAAQ,CAAC,WAAW,kBAK7B"}
@@ -14,27 +14,13 @@ const oazapfts = Oazapfts.runtime(defaults);
14
14
  export const servers = {
15
15
  generatedServerUrl: "https://account-notification-engine.dev.stackspot.com"
16
16
  };
17
- /**
18
- * Get notifications for tenant
19
- */
20
- export function findAll1({ size, page, createdSince, context, criticality, content, committed, tenantId }, opts) {
21
- return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
22
- size,
23
- page,
24
- createdSince,
25
- context,
26
- criticality,
27
- content,
28
- committed
29
- }))}`, {
30
- ...opts
31
- }));
32
- }
33
17
  /**
34
18
  * Generate a new notification intent to the specified tenant
35
19
  */
36
- export function create({ tenantId, createTenantNotificationRequest }, opts) {
37
- return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications`, oazapfts.json({
20
+ export function create({ dryRun, tenantId, createTenantNotificationRequest }, opts) {
21
+ return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
22
+ dryRun
23
+ }))}`, oazapfts.json({
38
24
  ...opts,
39
25
  method: "POST",
40
26
  body: createTenantNotificationRequest
@@ -62,7 +48,7 @@ export function create1({ createPlatformNotificationRequest }, opts) {
62
48
  /**
63
49
  * Get notifications for tenant
64
50
  */
65
- export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, tenantId }, opts) {
51
+ export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, audience, tenantId }, opts) {
66
52
  return oazapfts.ok(oazapfts.fetchJson(`/v2/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
67
53
  size,
68
54
  page,
@@ -71,7 +57,8 @@ export function findAll({ size, page, createdSince, context, criticality, conten
71
57
  criticality,
72
58
  content,
73
59
  committed,
74
- isBanner
60
+ isBanner,
61
+ audience
75
62
  }))}`, {
76
63
  ...opts
77
64
  }));
@@ -101,10 +88,10 @@ export function getHealthz(opts) {
101
88
  }));
102
89
  }
103
90
  /**
104
- * Delete notification by id
91
+ * Delete notification by intent id
105
92
  */
106
- export function deleteV1TenantsByTenantIdNotificationsAndNotificationId({ notificationId, tenantId }, opts) {
107
- return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}`, {
93
+ export function deleteV1TenantsByTenantIdNotificationsAndNotificationIntentId({ notificationIntentId, tenantId }, opts) {
94
+ return oazapfts.ok(oazapfts.fetchJson(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationIntentId)}`, {
108
95
  ...opts,
109
96
  method: "DELETE"
110
97
  }));
@@ -121,8 +108,8 @@ export function uncommit({ notificationId, tenantId }, opts) {
121
108
  /**
122
109
  * Batches deletes the notification in all tenants
123
110
  */
124
- export function delete1({ notificationId }, opts) {
125
- return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationId)}`, {
111
+ export function delete1({ notificationIntentId }, opts) {
112
+ return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationIntentId)}`, {
126
113
  ...opts,
127
114
  method: "DELETE"
128
115
  }));
@@ -1 +1 @@
1
- {"version":3,"file":"notification.js","sourceRoot":"","sources":["../../src/api/notification.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,QAAQ,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAA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AAS,CAGlC,aAAa,EAAE;QACd,GAAG,IAAI;KACV,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,6DAA6D,CAAC,EAAE,oBAAoB,EAAE,QAAQ,EAG7G,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAQlC,eAAe,kBAAkB,CAAC,QAAQ,CAAC,kBAAkB,kBAAkB,CAAC,oBAAoB,CAAC,EAAE,EAAE;QACxG,GAAG,IAAI;QACP,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,QAAQ,CAAC,EAAE,cAAc,EAAE,QAAQ,EAGlD,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAQlC,eAAe,kBAAkB,CAAC,QAAQ,CAAC,kBAAkB,kBAAkB,CAAC,cAAc,CAAC,WAAW,EAAE;QAC3G,GAAG,IAAI;QACP,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC,CAAC;AACR,CAAC;AACD;;GAEG;AACH,MAAM,UAAU,OAAO,CAAC,EAAE,oBAAoB,EAE7C,EAAE,IAA2B;IAC1B,OAAO,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,qBAAqB,kBAAkB,CAAC,oBAAoB,CAAC,EAAE,EAAE;QACnG,GAAG,IAAI;QACP,MAAM,EAAE,QAAQ;KACnB,CAAC,CAAC,CAAC;AACR,CAAC"}
@@ -16,6 +16,7 @@ declare class NotificationClient extends ReactQueryNetworkClient {
16
16
  content?: string | undefined;
17
17
  committed?: boolean | undefined;
18
18
  isBanner?: boolean | undefined;
19
+ audience?: "ACCOUNT" | "AI" | "EDP" | undefined;
19
20
  tenantId: string;
20
21
  }, import("../api/notification.js").PagingResponseModelGetTenantNotificationsResponse>;
21
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/client/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,kBAAmB,SAAQ,uBAAuB;;IAMtD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,aAAa;;;;;;;;;;wFAAsB;IACnC;;OAEG;IACH,sBAAsB;;wEAAqC;IAC3D;;OAEG;IACH,MAAM;;;gBAAwB;CAC/B;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAA"}
1
+ {"version":3,"file":"notification.d.ts","sourceRoot":"","sources":["../../src/client/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAK7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAA;AAE5E,cAAM,kBAAmB,SAAQ,uBAAuB;;IAMtD,SAAS,CAAC,mBAAmB,CAAC,KAAK,EAAE,SAAS,GAAG,iBAAiB;IAGlE;;OAEG;IACH,aAAa;;;;;;;;;;;wFAAsB;IACnC;;OAEG;IACH,sBAAsB;;wEAAqC;IAC3D;;OAEG;IACH,MAAM;;;gBAAwB;CAC/B;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stack-spot/portal-network",
3
- "version": "0.122.1",
3
+ "version": "0.123.0",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,49 +14,39 @@ const oazapfts = Oazapfts.runtime(defaults);
14
14
  export const servers = {
15
15
  generatedServerUrl: "https://account-notification-engine.dev.stackspot.com"
16
16
  };
17
- export type NotificationContentResponse = {
17
+ export type NotificationContentRequest = {
18
+ /** User friendly title for the notification */
18
19
  title: string;
20
+ /** User friendly description for the notification (allows the use of markdown) */
19
21
  description: string;
20
22
  };
21
- export type GetTenantNotificationsResponse = {
22
- id: string;
23
- content: {
24
- [key: string]: NotificationContentResponse;
25
- };
26
- broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE";
27
- context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
28
- target?: string;
29
- criticality: "LOW" | "MEDIUM" | "HIGH";
30
- call_to_action: string;
31
- persistent: boolean;
32
- committed: boolean;
33
- last_until?: string;
34
- trigger_at: string;
35
- created_at?: string;
36
- is_banner: boolean;
23
+ export type NotificationTargetBase = {
24
+ "type": string;
37
25
  };
38
- export type PagingResponseModelGetTenantNotificationsResponse = {
39
- items: GetTenantNotificationsResponse[];
40
- size: number;
41
- total_elements: number;
26
+ export type AccountValue = {
27
+ "type": "AccountValue";
28
+ } & NotificationTargetBase & {
29
+ value?: string;
42
30
  };
43
- export type ErrorDetails = {
44
- code: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
45
- field?: string;
46
- details?: string;
47
- values?: string[];
31
+ export type Attribute = {
32
+ key: string;
33
+ value: string;
48
34
  };
49
- export type ApiErrorResponse = {
50
- code?: "INTEGRATION_EXCEPTION" | "INVALID_TENANT" | "VALIDATION_ERROR" | "MANDATORY_FIELD_NOT_INFORMED" | "INVALID_REQUEST" | "NOTIFICATION_NOT_FOUND" | "INVALID_FIELD" | "MISSING_TOKEN";
51
- status: number;
52
- message: string;
53
- details?: ErrorDetails[];
35
+ export type Value = {
36
+ attribute?: Attribute;
37
+ resourceType: string;
38
+ resourceSlug: string;
39
+ action: string;
54
40
  };
55
- export type NotificationContentRequest = {
56
- /** User friendly title for the notification */
57
- title: string;
58
- /** User friendly description for the notification (allows the use of markdown) */
59
- description: string;
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[];
60
50
  };
61
51
  export type CreateTenantNotificationRequest = {
62
52
  /** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
@@ -65,86 +55,95 @@ export type CreateTenantNotificationRequest = {
65
55
  };
66
56
  /** Level of broadcasting to the notification. */
67
57
  broadcast_level: "ACCOUNT" | "INDIVIDUAL" | "PLATFORM" | "RESOURCE" | "ACCOUNT" | "INDIVIDUAL" | "RESOURCE";
68
- /** The target of the notification, user id for 'individual', resource id for 'resource', leave empty for any other */
69
- target: string;
58
+ target: AccountValue | ResourceValue | UsersValue;
70
59
  /** Criticality of the notification. */
71
- criticality: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
60
+ criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
72
61
  /** Which context to publish the notification */
73
62
  context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
74
63
  /** Possible redirect link for the notification button. */
75
64
  call_to_action: string;
76
65
  /** If the notification should be re-consumed until 'last_until' is reached. */
77
- persistent: boolean;
66
+ persistent?: boolean;
78
67
  /** UTC formatted timestamp to when the notification should finally end, if the persistent is set to true. */
79
68
  last_until?: string;
80
69
  /** UTC formatted timestamp for when to triggers the notification. */
81
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[];
82
85
  };
83
86
  export type CreatePlatformNotificationRequest = {
84
87
  /** Map of language codes to notification content. Each entry represents the content of the notification in a specific language. */
85
88
  content: {
86
89
  [key: string]: NotificationContentRequest;
87
90
  };
91
+ target?: ResourceValue;
88
92
  /** Criticality of the notification. */
89
- criticality: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
93
+ criticality?: "LOW" | "MEDIUM" | "HIGH" | "LOW" | "MEDIUM" | "HIGH";
90
94
  /** Which context to publish the notification */
91
95
  context: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI" | "Account" | "Studio" | "Workspace";
92
96
  /** Possible redirect link for the notification button. */
93
97
  call_to_action: string;
94
98
  /** If the notification should be re-consumed until last_until is reached. */
95
- persistent: boolean;
99
+ persistent?: boolean;
96
100
  /** UTC formatted timestamp to when the notification should finally ended if the persistent is set to true. */
97
101
  last_until?: string;
98
102
  /** UTC formatted timestamp for when to triggers the notification. */
99
103
  trigger_at: string;
100
104
  /** If the notification should be shown as banner. */
101
- is_banner: boolean;
105
+ is_banner?: boolean;
106
+ /** Notification channel audience. Determines which platform will receive the notification. */
107
+ audience?: "AI" | "EDP" | "ACCOUNT" | "ACCOUNT" | "AI" | "EDP";
102
108
  };
103
109
  export type CreatePlatformNotificationResponse = {
110
+ intentId: string;
111
+ };
112
+ export type NotificationContentResponse = {
113
+ title: string;
114
+ description: string;
115
+ };
116
+ export type GetTenantNotificationsResponse = {
104
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;
105
137
  };
106
138
  export type GetCommittedNotificationsResponse = {
107
139
  /** If there are uncommitted notifications for the user */
108
140
  uncommitted_messages: boolean;
109
141
  };
110
- /**
111
- * Get notifications for tenant
112
- */
113
- export function findAll1({ size, page, createdSince, context, criticality, content, committed, tenantId }: {
114
- size?: number;
115
- page?: number;
116
- createdSince?: number;
117
- context?: "ACCOUNT" | "STUDIO" | "WORKSPACE" | "AI";
118
- criticality?: "LOW" | "MEDIUM" | "HIGH";
119
- content?: string;
120
- committed?: boolean;
121
- tenantId: string;
122
- }, opts?: Oazapfts.RequestOpts) {
123
- return oazapfts.ok(oazapfts.fetchJson<{
124
- status: 200;
125
- data: PagingResponseModelGetTenantNotificationsResponse;
126
- } | {
127
- status: 403;
128
- data: ApiErrorResponse;
129
- } | {
130
- status: 500;
131
- data: ApiErrorResponse;
132
- }>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
133
- size,
134
- page,
135
- createdSince,
136
- context,
137
- criticality,
138
- content,
139
- committed
140
- }))}`, {
141
- ...opts
142
- }));
143
- }
144
142
  /**
145
143
  * Generate a new notification intent to the specified tenant
146
144
  */
147
- export function create({ tenantId, createTenantNotificationRequest }: {
145
+ export function create({ dryRun, tenantId, createTenantNotificationRequest }: {
146
+ dryRun?: boolean;
148
147
  tenantId: string;
149
148
  createTenantNotificationRequest: CreateTenantNotificationRequest;
150
149
  }, opts?: Oazapfts.RequestOpts) {
@@ -157,7 +156,9 @@ export function create({ tenantId, createTenantNotificationRequest }: {
157
156
  } | {
158
157
  status: 500;
159
158
  data: ApiErrorResponse;
160
- }>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications`, oazapfts.json({
159
+ }>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications${QS.query(QS.explode({
160
+ dryRun
161
+ }))}`, oazapfts.json({
161
162
  ...opts,
162
163
  method: "POST",
163
164
  body: createTenantNotificationRequest
@@ -201,7 +202,7 @@ export function create1({ createPlatformNotificationRequest }: {
201
202
  /**
202
203
  * Get notifications for tenant
203
204
  */
204
- export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, tenantId }: {
205
+ export function findAll({ size, page, createdSince, context, criticality, content, committed, isBanner, audience, tenantId }: {
205
206
  size?: number;
206
207
  page?: number;
207
208
  createdSince?: number;
@@ -210,6 +211,7 @@ export function findAll({ size, page, createdSince, context, criticality, conten
210
211
  content?: string;
211
212
  committed?: boolean;
212
213
  isBanner?: boolean;
214
+ audience?: "AI" | "EDP" | "ACCOUNT";
213
215
  tenantId: string;
214
216
  }, opts?: Oazapfts.RequestOpts) {
215
217
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -229,7 +231,8 @@ export function findAll({ size, page, createdSince, context, criticality, conten
229
231
  criticality,
230
232
  content,
231
233
  committed,
232
- isBanner
234
+ isBanner,
235
+ audience
233
236
  }))}`, {
234
237
  ...opts
235
238
  }));
@@ -276,10 +279,10 @@ export function getHealthz(opts?: Oazapfts.RequestOpts) {
276
279
  }));
277
280
  }
278
281
  /**
279
- * Delete notification by id
282
+ * Delete notification by intent id
280
283
  */
281
- export function deleteV1TenantsByTenantIdNotificationsAndNotificationId({ notificationId, tenantId }: {
282
- notificationId: string;
284
+ export function deleteV1TenantsByTenantIdNotificationsAndNotificationIntentId({ notificationIntentId, tenantId }: {
285
+ notificationIntentId: string;
283
286
  tenantId: string;
284
287
  }, opts?: Oazapfts.RequestOpts) {
285
288
  return oazapfts.ok(oazapfts.fetchJson<{
@@ -290,7 +293,7 @@ export function deleteV1TenantsByTenantIdNotificationsAndNotificationId({ notifi
290
293
  } | {
291
294
  status: 500;
292
295
  data: ApiErrorResponse;
293
- }>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationId)}`, {
296
+ }>(`/v1/tenants/${encodeURIComponent(tenantId)}/notifications/${encodeURIComponent(notificationIntentId)}`, {
294
297
  ...opts,
295
298
  method: "DELETE"
296
299
  }));
@@ -318,10 +321,10 @@ export function uncommit({ notificationId, tenantId }: {
318
321
  /**
319
322
  * Batches deletes the notification in all tenants
320
323
  */
321
- export function delete1({ notificationId }: {
322
- notificationId: string;
324
+ export function delete1({ notificationIntentId }: {
325
+ notificationIntentId: string;
323
326
  }, opts?: Oazapfts.RequestOpts) {
324
- return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationId)}`, {
327
+ return oazapfts.ok(oazapfts.fetchText(`/v1/notifications/${encodeURIComponent(notificationIntentId)}`, {
325
328
  ...opts,
326
329
  method: "DELETE"
327
330
  }));