@middlewr/contracts 0.0.16 → 0.0.18
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/dist/cjs/index.d.ts +312 -0
- package/dist/cjs/index.d.ts.map +1 -1
- package/dist/cjs/index.js +22 -0
- package/dist/cjs/links.schema.d.ts +129 -0
- package/dist/cjs/links.schema.d.ts.map +1 -1
- package/dist/esm/index.d.ts +312 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +21 -0
- package/dist/esm/links.schema.d.ts +129 -0
- package/dist/esm/links.schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/links.schema.ts +22 -0
package/dist/esm/index.js
CHANGED
|
@@ -164,6 +164,20 @@ var UpdateTagInputSchema = z6.object({
|
|
|
164
164
|
});
|
|
165
165
|
|
|
166
166
|
// src/links.schema.ts
|
|
167
|
+
var DotStyleSchema = z7.enum(["square", "dots", "rounded", "classy", "classy-rounded", "extra-rounded"]);
|
|
168
|
+
var EyeOuterStyleSchema = z7.enum(["square", "dot", "extra-rounded"]);
|
|
169
|
+
var EyeInnerStyleSchema = z7.enum(["square", "dot"]);
|
|
170
|
+
var QrCodeSettingsSchema = z7.object({
|
|
171
|
+
fg_color: z7.string().max(20),
|
|
172
|
+
bg_color: z7.string().max(20),
|
|
173
|
+
dot_style: DotStyleSchema,
|
|
174
|
+
eye_outer_style: EyeOuterStyleSchema,
|
|
175
|
+
eye_inner_style: EyeInnerStyleSchema,
|
|
176
|
+
frame_enabled: z7.boolean(),
|
|
177
|
+
frame_text: z7.string().max(255),
|
|
178
|
+
frame_color: z7.string().max(20),
|
|
179
|
+
frame_text_color: z7.string().max(20)
|
|
180
|
+
});
|
|
167
181
|
var LinkSchema = z7.object({
|
|
168
182
|
id: z7.string().uuid(),
|
|
169
183
|
workspace_id: z7.string().uuid(),
|
|
@@ -181,12 +195,14 @@ var LinkSchema = z7.object({
|
|
|
181
195
|
password: z7.string().nullable(),
|
|
182
196
|
starts_at: z7.coerce.date().nullable(),
|
|
183
197
|
expires_at: z7.coerce.date().nullable(),
|
|
198
|
+
fallback_url: z7.string().nullable(),
|
|
184
199
|
is_active: z7.boolean(),
|
|
185
200
|
redirect_type: z7.number().int(),
|
|
186
201
|
click_count: z7.coerce.number().int(),
|
|
187
202
|
click_count_updated_at: z7.coerce.date().nullable(),
|
|
188
203
|
created_at: z7.coerce.date(),
|
|
189
204
|
updated_at: z7.coerce.date().nullable(),
|
|
205
|
+
qr_code_settings: QrCodeSettingsSchema.nullable(),
|
|
190
206
|
tags: z7.array(TagSchema)
|
|
191
207
|
});
|
|
192
208
|
var CreateLinkInputSchema = z7.object({
|
|
@@ -203,7 +219,9 @@ var CreateLinkInputSchema = z7.object({
|
|
|
203
219
|
password: z7.string().min(4).max(100).optional(),
|
|
204
220
|
starts_at: z7.coerce.date().optional(),
|
|
205
221
|
expires_at: z7.coerce.date().optional(),
|
|
222
|
+
fallback_url: z7.string().url().max(2048).optional(),
|
|
206
223
|
redirect_type: z7.coerce.number().refine((v) => [301, 302, 307, 308].includes(v)).optional(),
|
|
224
|
+
qr_code_settings: QrCodeSettingsSchema.nullable().optional(),
|
|
207
225
|
tag_ids: z7.array(z7.string().uuid()).optional()
|
|
208
226
|
});
|
|
209
227
|
var UpdateLinkInputSchema = z7.object({
|
|
@@ -220,8 +238,10 @@ var UpdateLinkInputSchema = z7.object({
|
|
|
220
238
|
password: z7.string().min(4).max(100).nullable().optional(),
|
|
221
239
|
starts_at: z7.coerce.date().nullable().optional(),
|
|
222
240
|
expires_at: z7.coerce.date().nullable().optional(),
|
|
241
|
+
fallback_url: z7.string().url().max(2048).nullable().optional(),
|
|
223
242
|
is_active: z7.boolean().optional(),
|
|
224
243
|
redirect_type: z7.coerce.number().refine((v) => [301, 302, 307, 308].includes(v)).optional(),
|
|
244
|
+
qr_code_settings: QrCodeSettingsSchema.nullable().optional(),
|
|
225
245
|
tag_ids: z7.array(z7.string().uuid()).optional()
|
|
226
246
|
});
|
|
227
247
|
var stringToBoolean = z7.union([z7.boolean(), z7.enum(["true", "false"])]).transform((val) => typeof val === "string" ? val === "true" : val);
|
|
@@ -437,6 +457,7 @@ export {
|
|
|
437
457
|
LinkSchema,
|
|
438
458
|
MemberIdParamSchema,
|
|
439
459
|
PaginatedLinksSchema,
|
|
460
|
+
QrCodeSettingsSchema,
|
|
440
461
|
SignInInputSchema,
|
|
441
462
|
TagIdParamSchema,
|
|
442
463
|
TagSchema,
|
|
@@ -1,4 +1,29 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
export declare const QrCodeSettingsSchema: z.ZodObject<{
|
|
3
|
+
fg_color: z.ZodString;
|
|
4
|
+
bg_color: z.ZodString;
|
|
5
|
+
dot_style: z.ZodEnum<{
|
|
6
|
+
square: "square";
|
|
7
|
+
dots: "dots";
|
|
8
|
+
rounded: "rounded";
|
|
9
|
+
classy: "classy";
|
|
10
|
+
"classy-rounded": "classy-rounded";
|
|
11
|
+
"extra-rounded": "extra-rounded";
|
|
12
|
+
}>;
|
|
13
|
+
eye_outer_style: z.ZodEnum<{
|
|
14
|
+
square: "square";
|
|
15
|
+
"extra-rounded": "extra-rounded";
|
|
16
|
+
dot: "dot";
|
|
17
|
+
}>;
|
|
18
|
+
eye_inner_style: z.ZodEnum<{
|
|
19
|
+
square: "square";
|
|
20
|
+
dot: "dot";
|
|
21
|
+
}>;
|
|
22
|
+
frame_enabled: z.ZodBoolean;
|
|
23
|
+
frame_text: z.ZodString;
|
|
24
|
+
frame_color: z.ZodString;
|
|
25
|
+
frame_text_color: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
2
27
|
export declare const LinkSchema: z.ZodObject<{
|
|
3
28
|
id: z.ZodString;
|
|
4
29
|
workspace_id: z.ZodString;
|
|
@@ -16,12 +41,38 @@ export declare const LinkSchema: z.ZodObject<{
|
|
|
16
41
|
password: z.ZodNullable<z.ZodString>;
|
|
17
42
|
starts_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
18
43
|
expires_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
44
|
+
fallback_url: z.ZodNullable<z.ZodString>;
|
|
19
45
|
is_active: z.ZodBoolean;
|
|
20
46
|
redirect_type: z.ZodNumber;
|
|
21
47
|
click_count: z.ZodCoercedNumber<unknown>;
|
|
22
48
|
click_count_updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
23
49
|
created_at: z.ZodCoercedDate<unknown>;
|
|
24
50
|
updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
51
|
+
qr_code_settings: z.ZodNullable<z.ZodObject<{
|
|
52
|
+
fg_color: z.ZodString;
|
|
53
|
+
bg_color: z.ZodString;
|
|
54
|
+
dot_style: z.ZodEnum<{
|
|
55
|
+
square: "square";
|
|
56
|
+
dots: "dots";
|
|
57
|
+
rounded: "rounded";
|
|
58
|
+
classy: "classy";
|
|
59
|
+
"classy-rounded": "classy-rounded";
|
|
60
|
+
"extra-rounded": "extra-rounded";
|
|
61
|
+
}>;
|
|
62
|
+
eye_outer_style: z.ZodEnum<{
|
|
63
|
+
square: "square";
|
|
64
|
+
"extra-rounded": "extra-rounded";
|
|
65
|
+
dot: "dot";
|
|
66
|
+
}>;
|
|
67
|
+
eye_inner_style: z.ZodEnum<{
|
|
68
|
+
square: "square";
|
|
69
|
+
dot: "dot";
|
|
70
|
+
}>;
|
|
71
|
+
frame_enabled: z.ZodBoolean;
|
|
72
|
+
frame_text: z.ZodString;
|
|
73
|
+
frame_color: z.ZodString;
|
|
74
|
+
frame_text_color: z.ZodString;
|
|
75
|
+
}, z.core.$strip>>;
|
|
25
76
|
tags: z.ZodArray<z.ZodObject<{
|
|
26
77
|
id: z.ZodString;
|
|
27
78
|
workspace_id: z.ZodString;
|
|
@@ -45,7 +96,33 @@ export declare const CreateLinkInputSchema: z.ZodObject<{
|
|
|
45
96
|
password: z.ZodOptional<z.ZodString>;
|
|
46
97
|
starts_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
47
98
|
expires_at: z.ZodOptional<z.ZodCoercedDate<unknown>>;
|
|
99
|
+
fallback_url: z.ZodOptional<z.ZodString>;
|
|
48
100
|
redirect_type: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
101
|
+
qr_code_settings: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
102
|
+
fg_color: z.ZodString;
|
|
103
|
+
bg_color: z.ZodString;
|
|
104
|
+
dot_style: z.ZodEnum<{
|
|
105
|
+
square: "square";
|
|
106
|
+
dots: "dots";
|
|
107
|
+
rounded: "rounded";
|
|
108
|
+
classy: "classy";
|
|
109
|
+
"classy-rounded": "classy-rounded";
|
|
110
|
+
"extra-rounded": "extra-rounded";
|
|
111
|
+
}>;
|
|
112
|
+
eye_outer_style: z.ZodEnum<{
|
|
113
|
+
square: "square";
|
|
114
|
+
"extra-rounded": "extra-rounded";
|
|
115
|
+
dot: "dot";
|
|
116
|
+
}>;
|
|
117
|
+
eye_inner_style: z.ZodEnum<{
|
|
118
|
+
square: "square";
|
|
119
|
+
dot: "dot";
|
|
120
|
+
}>;
|
|
121
|
+
frame_enabled: z.ZodBoolean;
|
|
122
|
+
frame_text: z.ZodString;
|
|
123
|
+
frame_color: z.ZodString;
|
|
124
|
+
frame_text_color: z.ZodString;
|
|
125
|
+
}, z.core.$strip>>>;
|
|
49
126
|
tag_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
127
|
}, z.core.$strip>;
|
|
51
128
|
export declare const UpdateLinkInputSchema: z.ZodObject<{
|
|
@@ -62,8 +139,34 @@ export declare const UpdateLinkInputSchema: z.ZodObject<{
|
|
|
62
139
|
password: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
140
|
starts_at: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
64
141
|
expires_at: z.ZodOptional<z.ZodNullable<z.ZodCoercedDate<unknown>>>;
|
|
142
|
+
fallback_url: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
65
143
|
is_active: z.ZodOptional<z.ZodBoolean>;
|
|
66
144
|
redirect_type: z.ZodOptional<z.ZodCoercedNumber<unknown>>;
|
|
145
|
+
qr_code_settings: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
146
|
+
fg_color: z.ZodString;
|
|
147
|
+
bg_color: z.ZodString;
|
|
148
|
+
dot_style: z.ZodEnum<{
|
|
149
|
+
square: "square";
|
|
150
|
+
dots: "dots";
|
|
151
|
+
rounded: "rounded";
|
|
152
|
+
classy: "classy";
|
|
153
|
+
"classy-rounded": "classy-rounded";
|
|
154
|
+
"extra-rounded": "extra-rounded";
|
|
155
|
+
}>;
|
|
156
|
+
eye_outer_style: z.ZodEnum<{
|
|
157
|
+
square: "square";
|
|
158
|
+
"extra-rounded": "extra-rounded";
|
|
159
|
+
dot: "dot";
|
|
160
|
+
}>;
|
|
161
|
+
eye_inner_style: z.ZodEnum<{
|
|
162
|
+
square: "square";
|
|
163
|
+
dot: "dot";
|
|
164
|
+
}>;
|
|
165
|
+
frame_enabled: z.ZodBoolean;
|
|
166
|
+
frame_text: z.ZodString;
|
|
167
|
+
frame_color: z.ZodString;
|
|
168
|
+
frame_text_color: z.ZodString;
|
|
169
|
+
}, z.core.$strip>>>;
|
|
67
170
|
tag_ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
68
171
|
}, z.core.$strip>;
|
|
69
172
|
export declare const LinkFiltersSchema: z.ZodObject<{
|
|
@@ -116,12 +219,38 @@ export declare const PaginatedLinksSchema: z.ZodObject<{
|
|
|
116
219
|
password: z.ZodNullable<z.ZodString>;
|
|
117
220
|
starts_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
118
221
|
expires_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
222
|
+
fallback_url: z.ZodNullable<z.ZodString>;
|
|
119
223
|
is_active: z.ZodBoolean;
|
|
120
224
|
redirect_type: z.ZodNumber;
|
|
121
225
|
click_count: z.ZodCoercedNumber<unknown>;
|
|
122
226
|
click_count_updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
123
227
|
created_at: z.ZodCoercedDate<unknown>;
|
|
124
228
|
updated_at: z.ZodNullable<z.ZodCoercedDate<unknown>>;
|
|
229
|
+
qr_code_settings: z.ZodNullable<z.ZodObject<{
|
|
230
|
+
fg_color: z.ZodString;
|
|
231
|
+
bg_color: z.ZodString;
|
|
232
|
+
dot_style: z.ZodEnum<{
|
|
233
|
+
square: "square";
|
|
234
|
+
dots: "dots";
|
|
235
|
+
rounded: "rounded";
|
|
236
|
+
classy: "classy";
|
|
237
|
+
"classy-rounded": "classy-rounded";
|
|
238
|
+
"extra-rounded": "extra-rounded";
|
|
239
|
+
}>;
|
|
240
|
+
eye_outer_style: z.ZodEnum<{
|
|
241
|
+
square: "square";
|
|
242
|
+
"extra-rounded": "extra-rounded";
|
|
243
|
+
dot: "dot";
|
|
244
|
+
}>;
|
|
245
|
+
eye_inner_style: z.ZodEnum<{
|
|
246
|
+
square: "square";
|
|
247
|
+
dot: "dot";
|
|
248
|
+
}>;
|
|
249
|
+
frame_enabled: z.ZodBoolean;
|
|
250
|
+
frame_text: z.ZodString;
|
|
251
|
+
frame_color: z.ZodString;
|
|
252
|
+
frame_text_color: z.ZodString;
|
|
253
|
+
}, z.core.$strip>>;
|
|
125
254
|
tags: z.ZodArray<z.ZodObject<{
|
|
126
255
|
id: z.ZodString;
|
|
127
256
|
workspace_id: z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.schema.d.ts","sourceRoot":"","sources":["../../src/links.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"links.schema.d.ts","sourceRoot":"","sources":["../../src/links.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;iBAU/B,CAAC;AAEH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BrB,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BhC,CAAC;AAMH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAe5B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAM/B,CAAC"}
|
package/package.json
CHANGED
package/src/links.schema.ts
CHANGED
|
@@ -2,6 +2,22 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
import { TagSchema } from './tags.schema';
|
|
4
4
|
|
|
5
|
+
const DotStyleSchema = z.enum(['square', 'dots', 'rounded', 'classy', 'classy-rounded', 'extra-rounded']);
|
|
6
|
+
const EyeOuterStyleSchema = z.enum(['square', 'dot', 'extra-rounded']);
|
|
7
|
+
const EyeInnerStyleSchema = z.enum(['square', 'dot']);
|
|
8
|
+
|
|
9
|
+
export const QrCodeSettingsSchema = z.object({
|
|
10
|
+
fg_color: z.string().max(20),
|
|
11
|
+
bg_color: z.string().max(20),
|
|
12
|
+
dot_style: DotStyleSchema,
|
|
13
|
+
eye_outer_style: EyeOuterStyleSchema,
|
|
14
|
+
eye_inner_style: EyeInnerStyleSchema,
|
|
15
|
+
frame_enabled: z.boolean(),
|
|
16
|
+
frame_text: z.string().max(255),
|
|
17
|
+
frame_color: z.string().max(20),
|
|
18
|
+
frame_text_color: z.string().max(20),
|
|
19
|
+
});
|
|
20
|
+
|
|
5
21
|
export const LinkSchema = z.object({
|
|
6
22
|
id: z.string().uuid(),
|
|
7
23
|
workspace_id: z.string().uuid(),
|
|
@@ -19,12 +35,14 @@ export const LinkSchema = z.object({
|
|
|
19
35
|
password: z.string().nullable(),
|
|
20
36
|
starts_at: z.coerce.date().nullable(),
|
|
21
37
|
expires_at: z.coerce.date().nullable(),
|
|
38
|
+
fallback_url: z.string().nullable(),
|
|
22
39
|
is_active: z.boolean(),
|
|
23
40
|
redirect_type: z.number().int(),
|
|
24
41
|
click_count: z.coerce.number().int(),
|
|
25
42
|
click_count_updated_at: z.coerce.date().nullable(),
|
|
26
43
|
created_at: z.coerce.date(),
|
|
27
44
|
updated_at: z.coerce.date().nullable(),
|
|
45
|
+
qr_code_settings: QrCodeSettingsSchema.nullable(),
|
|
28
46
|
tags: z.array(TagSchema),
|
|
29
47
|
});
|
|
30
48
|
|
|
@@ -47,10 +65,12 @@ export const CreateLinkInputSchema = z.object({
|
|
|
47
65
|
password: z.string().min(4).max(100).optional(),
|
|
48
66
|
starts_at: z.coerce.date().optional(),
|
|
49
67
|
expires_at: z.coerce.date().optional(),
|
|
68
|
+
fallback_url: z.string().url().max(2048).optional(),
|
|
50
69
|
redirect_type: z.coerce
|
|
51
70
|
.number()
|
|
52
71
|
.refine((v) => [301, 302, 307, 308].includes(v))
|
|
53
72
|
.optional(),
|
|
73
|
+
qr_code_settings: QrCodeSettingsSchema.nullable().optional(),
|
|
54
74
|
tag_ids: z.array(z.string().uuid()).optional(),
|
|
55
75
|
});
|
|
56
76
|
|
|
@@ -73,11 +93,13 @@ export const UpdateLinkInputSchema = z.object({
|
|
|
73
93
|
password: z.string().min(4).max(100).nullable().optional(),
|
|
74
94
|
starts_at: z.coerce.date().nullable().optional(),
|
|
75
95
|
expires_at: z.coerce.date().nullable().optional(),
|
|
96
|
+
fallback_url: z.string().url().max(2048).nullable().optional(),
|
|
76
97
|
is_active: z.boolean().optional(),
|
|
77
98
|
redirect_type: z.coerce
|
|
78
99
|
.number()
|
|
79
100
|
.refine((v) => [301, 302, 307, 308].includes(v))
|
|
80
101
|
.optional(),
|
|
102
|
+
qr_code_settings: QrCodeSettingsSchema.nullable().optional(),
|
|
81
103
|
tag_ids: z.array(z.string().uuid()).optional(),
|
|
82
104
|
});
|
|
83
105
|
|