@tstdl/base 0.93.184 → 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").ArraySchema<{
100
- type: string;
101
- enabled: boolean;
102
- channel: "email" | "in-app" | "web-push";
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").ArraySchema<{
217
- type: string;
218
- enabled: boolean;
219
- channel: "email" | "in-app" | "web-push";
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: array(object({
103
- type: string(),
104
- channel: enumeration(NotificationChannel),
105
- enabled: boolean(),
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tstdl/base",
3
- "version": "0.93.184",
3
+ "version": "0.93.185",
4
4
  "author": "Patrick Hein",
5
5
  "publishConfig": {
6
6
  "access": "public"