@tstdl/base 0.93.183 → 0.93.185
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.
|
@@ -96,10 +96,12 @@ export declare const notificationApiDefinition: {
|
|
|
96
96
|
updatePreferences: {
|
|
97
97
|
resource: string;
|
|
98
98
|
method: "POST";
|
|
99
|
-
parameters: import("../../schema/index.js").
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
100
|
+
preferences: {
|
|
101
|
+
type: string;
|
|
102
|
+
enabled: boolean;
|
|
103
|
+
channel: "email" | "in-app" | "web-push";
|
|
104
|
+
}[];
|
|
103
105
|
}>;
|
|
104
106
|
result: import("../../schema/index.js").LiteralSchema<"ok">;
|
|
105
107
|
credentials: true;
|
|
@@ -213,10 +215,12 @@ declare const _NotificationApiClient: import("../../api/client/index.js").ApiCli
|
|
|
213
215
|
updatePreferences: {
|
|
214
216
|
resource: string;
|
|
215
217
|
method: "POST";
|
|
216
|
-
parameters: import("../../schema/index.js").
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
218
|
+
parameters: import("../../schema/index.js").ObjectSchema<{
|
|
219
|
+
preferences: {
|
|
220
|
+
type: string;
|
|
221
|
+
enabled: boolean;
|
|
222
|
+
channel: "email" | "in-app" | "web-push";
|
|
223
|
+
}[];
|
|
220
224
|
}>;
|
|
221
225
|
result: import("../../schema/index.js").LiteralSchema<"ok">;
|
|
222
226
|
credentials: true;
|
|
@@ -99,11 +99,13 @@ export const notificationApiDefinition = defineApi({
|
|
|
99
99
|
updatePreferences: {
|
|
100
100
|
resource: 'preferences',
|
|
101
101
|
method: 'POST',
|
|
102
|
-
parameters:
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
parameters: object({
|
|
103
|
+
preferences: array(object({
|
|
104
|
+
type: string(),
|
|
105
|
+
channel: enumeration(NotificationChannel),
|
|
106
|
+
enabled: boolean(),
|
|
107
|
+
})),
|
|
108
|
+
}),
|
|
107
109
|
result: literal('ok'),
|
|
108
110
|
credentials: true,
|
|
109
111
|
},
|
|
@@ -87,7 +87,7 @@ let NotificationApiController = class NotificationApiController {
|
|
|
87
87
|
}
|
|
88
88
|
async updatePreferences({ parameters, getToken }) {
|
|
89
89
|
const token = await getToken();
|
|
90
|
-
await this.notificationService.updatePreferences(token.payload.tenant, token.payload.subject, parameters);
|
|
90
|
+
await this.notificationService.updatePreferences(token.payload.tenant, token.payload.subject, parameters.preferences);
|
|
91
91
|
return 'ok';
|
|
92
92
|
}
|
|
93
93
|
async registerWebPush({ parameters, getToken }) {
|
package/package.json
CHANGED
|
@@ -15,9 +15,10 @@ import type { WritableSignal } from './signal.js';
|
|
|
15
15
|
*
|
|
16
16
|
* Ordinary values can be turned into `Signal`s with the `signal` function.
|
|
17
17
|
*/
|
|
18
|
-
export
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
export interface Signal<T> {
|
|
19
|
+
(): T;
|
|
20
|
+
[SIGNAL]?: unknown;
|
|
21
|
+
}
|
|
21
22
|
/**
|
|
22
23
|
* Checks if the given `value` is a reactive `Signal`.
|
|
23
24
|
*/
|