colibris-types 2.2.1 → 2.2.3

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.
@@ -1,6 +1,7 @@
1
1
  import { z } from "zod";
2
2
  export declare const ChartRefLineSchema: z.ZodObject<{
3
3
  key: z.ZodString;
4
+ label: z.ZodOptional<z.ZodString>;
4
5
  tabKey: z.ZodOptional<z.ZodString>;
5
6
  value: z.ZodOptional<z.ZodNumber>;
6
7
  alert: z.ZodOptional<z.ZodObject<{
@@ -22,6 +23,7 @@ export declare const ChartRefLineSchema: z.ZodObject<{
22
23
  }, "strip", z.ZodTypeAny, {
23
24
  key: string;
24
25
  value?: number | undefined;
26
+ label?: string | undefined;
25
27
  tabKey?: string | undefined;
26
28
  alert?: {
27
29
  direction: "up" | "down";
@@ -32,6 +34,7 @@ export declare const ChartRefLineSchema: z.ZodObject<{
32
34
  }, {
33
35
  key: string;
34
36
  value?: number | undefined;
37
+ label?: string | undefined;
35
38
  tabKey?: string | undefined;
36
39
  alert?: {
37
40
  direction: "up" | "down";
@@ -43,6 +46,7 @@ export declare const ChartRefLineSchema: z.ZodObject<{
43
46
  export declare const ChartSettingsSchema: z.ZodObject<{
44
47
  charts: z.ZodArray<z.ZodObject<{
45
48
  key: z.ZodString;
49
+ label: z.ZodOptional<z.ZodString>;
46
50
  tabKey: z.ZodOptional<z.ZodString>;
47
51
  value: z.ZodOptional<z.ZodNumber>;
48
52
  alert: z.ZodOptional<z.ZodObject<{
@@ -64,6 +68,7 @@ export declare const ChartSettingsSchema: z.ZodObject<{
64
68
  }, "strip", z.ZodTypeAny, {
65
69
  key: string;
66
70
  value?: number | undefined;
71
+ label?: string | undefined;
67
72
  tabKey?: string | undefined;
68
73
  alert?: {
69
74
  direction: "up" | "down";
@@ -74,6 +79,7 @@ export declare const ChartSettingsSchema: z.ZodObject<{
74
79
  }, {
75
80
  key: string;
76
81
  value?: number | undefined;
82
+ label?: string | undefined;
77
83
  tabKey?: string | undefined;
78
84
  alert?: {
79
85
  direction: "up" | "down";
@@ -86,6 +92,7 @@ export declare const ChartSettingsSchema: z.ZodObject<{
86
92
  charts: {
87
93
  key: string;
88
94
  value?: number | undefined;
95
+ label?: string | undefined;
89
96
  tabKey?: string | undefined;
90
97
  alert?: {
91
98
  direction: "up" | "down";
@@ -98,6 +105,7 @@ export declare const ChartSettingsSchema: z.ZodObject<{
98
105
  charts: {
99
106
  key: string;
100
107
  value?: number | undefined;
108
+ label?: string | undefined;
101
109
  tabKey?: string | undefined;
102
110
  alert?: {
103
111
  direction: "up" | "down";
@@ -4,6 +4,7 @@ extendZodWithOpenApi(z);
4
4
  export const ChartRefLineSchema = z
5
5
  .object({
6
6
  key: z.string().openapi({ description: "Chart identifier for notification navigation" }),
7
+ label: z.string().optional().openapi({ description: "Translated display label for the chart" }),
7
8
  tabKey: z.string().optional().openapi({ description: "Tab identifier for multi-tab charts" }),
8
9
  value: z.number().optional().openapi({ description: "Threshold value" }),
9
10
  alert: z
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export { NotificationSchema, NotificationTypeSchema, type Notification, } from "./notification.js";
2
- export { NotificationTypePreferenceSchema, NotificationPreferencesSchema, type NotificationTypePreference, type NotificationPreferences, } from "./notification-settings.js";
2
+ export { NotificationTypePreferenceSchema, NotificationPreferencesSchema, PushSubscriptionKeysSchema, PushSubscriptionSchema, type NotificationTypePreference, type NotificationPreferences, type PushSubscriptionKeys, type PushSubscription, } from "./notification-settings.js";
3
3
  export { ImportsHistorySchema, ImportsHistoryTypeSchema, ImportsHistoryStatusSchema, type ImportsHistory, PeopleUploadSchema, PeopleUploadRowSchema, SubsidiaryUploadSchema, SubsidiaryUploadRowSchema, organizationDefinitions, type PeopleUpload, type SubsidiaryUpload, ComputerUploadSchema, ComputerUploadRowSchema, assetDefinitions, type ComputerUpload, BouyguesGlobalInvoiceUploadSchema, BouyguesGlobalInvoiceUploadRowSchema, BouyguesDetailedInvoiceUploadSchema, BouyguesDetailedInvoiceUploadRowSchema, BouyguesFleetUploadSchema, BouyguesFleetUploadRowSchema, OrangeDetailedInvoiceUploadSchema, OrangeDetailedInvoiceUploadRowSchema, OrangeFleetUploadSchema, OrangeFleetUploadRowSchema, SfrDetailedInvoiceUploadSchema, SfrDetailedInvoiceUploadRowSchema, telecomDefinitions, type BouyguesGlobalInvoiceUpload, type BouyguesDetailedInvoiceUpload, type BouyguesFleetUpload, type OrangeDetailedInvoiceUpload, type OrangeFleetUpload, type SfrDetailedInvoiceUpload, schemasDefinitions, } from "./imports/index.js";
4
4
  export { ChartRefLineSchema, ChartSettingsSchema, type ChartRefLine, type ChartSettings, } from "./chart-settings.js";
package/lib/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // Notification
2
2
  export { NotificationSchema, NotificationTypeSchema, } from "./notification.js";
3
- // Notification Settings (user preferences)
4
- export { NotificationTypePreferenceSchema, NotificationPreferencesSchema, } from "./notification-settings.js";
3
+ // Notification Settings (user preferences + push subscriptions)
4
+ export { NotificationTypePreferenceSchema, NotificationPreferencesSchema, PushSubscriptionKeysSchema, PushSubscriptionSchema, } from "./notification-settings.js";
5
5
  // Imports (history + upload schemas)
6
6
  export {
7
7
  // History
@@ -2,52 +2,141 @@ import { z } from "zod";
2
2
  export declare const NotificationTypePreferenceSchema: z.ZodObject<{
3
3
  inApp: z.ZodBoolean;
4
4
  email: z.ZodBoolean;
5
+ push: z.ZodBoolean;
5
6
  }, "strip", z.ZodTypeAny, {
7
+ push: boolean;
6
8
  inApp: boolean;
7
9
  email: boolean;
8
10
  }, {
11
+ push: boolean;
9
12
  inApp: boolean;
10
13
  email: boolean;
11
14
  }>;
15
+ export declare const PushSubscriptionKeysSchema: z.ZodObject<{
16
+ p256dh: z.ZodString;
17
+ auth: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ p256dh: string;
20
+ auth: string;
21
+ }, {
22
+ p256dh: string;
23
+ auth: string;
24
+ }>;
25
+ export declare const PushSubscriptionSchema: z.ZodObject<{
26
+ endpoint: z.ZodString;
27
+ keys: z.ZodObject<{
28
+ p256dh: z.ZodString;
29
+ auth: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ p256dh: string;
32
+ auth: string;
33
+ }, {
34
+ p256dh: string;
35
+ auth: string;
36
+ }>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ keys: {
39
+ p256dh: string;
40
+ auth: string;
41
+ };
42
+ endpoint: string;
43
+ }, {
44
+ keys: {
45
+ p256dh: string;
46
+ auth: string;
47
+ };
48
+ endpoint: string;
49
+ }>;
12
50
  export declare const NotificationPreferencesSchema: z.ZodObject<{
13
51
  monthlyReport: z.ZodObject<{
14
52
  inApp: z.ZodBoolean;
15
53
  email: z.ZodBoolean;
54
+ push: z.ZodBoolean;
16
55
  }, "strip", z.ZodTypeAny, {
56
+ push: boolean;
17
57
  inApp: boolean;
18
58
  email: boolean;
19
59
  }, {
60
+ push: boolean;
20
61
  inApp: boolean;
21
62
  email: boolean;
22
63
  }>;
23
64
  thresholds: z.ZodObject<{
24
65
  inApp: z.ZodBoolean;
25
66
  email: z.ZodBoolean;
67
+ push: z.ZodBoolean;
26
68
  }, "strip", z.ZodTypeAny, {
69
+ push: boolean;
27
70
  inApp: boolean;
28
71
  email: boolean;
29
72
  }, {
73
+ push: boolean;
30
74
  inApp: boolean;
31
75
  email: boolean;
32
76
  }>;
77
+ pushSubscriptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
78
+ endpoint: z.ZodString;
79
+ keys: z.ZodObject<{
80
+ p256dh: z.ZodString;
81
+ auth: z.ZodString;
82
+ }, "strip", z.ZodTypeAny, {
83
+ p256dh: string;
84
+ auth: string;
85
+ }, {
86
+ p256dh: string;
87
+ auth: string;
88
+ }>;
89
+ }, "strip", z.ZodTypeAny, {
90
+ keys: {
91
+ p256dh: string;
92
+ auth: string;
93
+ };
94
+ endpoint: string;
95
+ }, {
96
+ keys: {
97
+ p256dh: string;
98
+ auth: string;
99
+ };
100
+ endpoint: string;
101
+ }>, "many">>;
33
102
  }, "strip", z.ZodTypeAny, {
34
103
  monthlyReport: {
104
+ push: boolean;
35
105
  inApp: boolean;
36
106
  email: boolean;
37
107
  };
38
108
  thresholds: {
109
+ push: boolean;
39
110
  inApp: boolean;
40
111
  email: boolean;
41
112
  };
113
+ pushSubscriptions?: {
114
+ keys: {
115
+ p256dh: string;
116
+ auth: string;
117
+ };
118
+ endpoint: string;
119
+ }[] | undefined;
42
120
  }, {
43
121
  monthlyReport: {
122
+ push: boolean;
44
123
  inApp: boolean;
45
124
  email: boolean;
46
125
  };
47
126
  thresholds: {
127
+ push: boolean;
48
128
  inApp: boolean;
49
129
  email: boolean;
50
130
  };
131
+ pushSubscriptions?: {
132
+ keys: {
133
+ p256dh: string;
134
+ auth: string;
135
+ };
136
+ endpoint: string;
137
+ }[] | undefined;
51
138
  }>;
52
139
  export type NotificationTypePreference = z.infer<typeof NotificationTypePreferenceSchema>;
140
+ export type PushSubscriptionKeys = z.infer<typeof PushSubscriptionKeysSchema>;
141
+ export type PushSubscription = z.infer<typeof PushSubscriptionSchema>;
53
142
  export type NotificationPreferences = z.infer<typeof NotificationPreferencesSchema>;
@@ -5,8 +5,26 @@ export const NotificationTypePreferenceSchema = z
5
5
  .object({
6
6
  inApp: z.boolean().openapi({ description: "Enable in-app notifications" }),
7
7
  email: z.boolean().openapi({ description: "Enable email notifications" }),
8
+ push: z.boolean().openapi({ description: "Enable push notifications" }),
8
9
  })
9
10
  .openapi("NotificationTypePreference");
11
+ export const PushSubscriptionKeysSchema = z
12
+ .object({
13
+ p256dh: z
14
+ .string()
15
+ .openapi({ description: "User public key for encryption" }),
16
+ auth: z.string().openapi({ description: "Authentication secret" }),
17
+ })
18
+ .openapi("PushSubscriptionKeys");
19
+ export const PushSubscriptionSchema = z
20
+ .object({
21
+ endpoint: z
22
+ .string()
23
+ .url()
24
+ .openapi({ description: "Push service endpoint URL" }),
25
+ keys: PushSubscriptionKeysSchema,
26
+ })
27
+ .openapi("PushSubscription");
10
28
  export const NotificationPreferencesSchema = z
11
29
  .object({
12
30
  monthlyReport: NotificationTypePreferenceSchema.openapi({
@@ -15,5 +33,11 @@ export const NotificationPreferencesSchema = z
15
33
  thresholds: NotificationTypePreferenceSchema.openapi({
16
34
  description: "Threshold alerts notification preferences",
17
35
  }),
36
+ pushSubscriptions: z
37
+ .array(PushSubscriptionSchema)
38
+ .optional()
39
+ .openapi({
40
+ description: "Browser push subscriptions for this user",
41
+ }),
18
42
  })
19
43
  .openapi("NotificationPreferences");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colibris-types",
3
- "version": "2.2.1",
3
+ "version": "2.2.3",
4
4
  "description": "Shared TypeScript types and Zod schemas for Colibris platform",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",