@marcoappio/marco-config 2.0.350 → 2.0.352
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/clients/account.d.ts +17 -17
- package/dist/clients/account.js +15 -15
- package/dist/clients/contact.d.ts +1 -1
- package/dist/clients/contact.js +1 -1
- package/dist/clients/draft.d.ts +25 -25
- package/dist/clients/draft.js +19 -19
- package/dist/clients/index.d.ts +64 -59
- package/dist/clients/index.d.ts.map +1 -1
- package/dist/clients/thread.d.ts +18 -13
- package/dist/clients/thread.d.ts.map +1 -1
- package/dist/clients/thread.js +18 -13
- package/dist/clients/user.d.ts +3 -3
- package/dist/clients/user.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/index.d.ts +3 -4
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/number.d.ts +1 -0
- package/dist/schemas/number.d.ts.map +1 -1
- package/dist/schemas/number.js +1 -0
- package/dist/schemas/pushNotifications.d.ts +2 -2
- package/dist/schemas/pushNotifications.js +2 -2
- package/dist/schemas/string.d.ts +0 -2
- package/dist/schemas/string.d.ts.map +1 -1
- package/dist/schemas/string.js +0 -3
- package/dist/sdk/endpoints/index.d.ts +83 -76
- package/dist/sdk/endpoints/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.d.ts +1 -1
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.js +1 -1
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.d.ts +1 -1
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.js +2 -1
- package/dist/sdk/endpoints/private/emailMessage/index.d.ts +2 -2
- package/dist/sdk/endpoints/private/index.d.ts +75 -68
- package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/index.d.ts +73 -66
- package/dist/sdk/endpoints/private/sync/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/account.d.ts +4 -4
- package/dist/sdk/endpoints/private/sync/pull/account.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/account.js +3 -2
- package/dist/sdk/endpoints/private/sync/pull/contact.d.ts +2 -2
- package/dist/sdk/endpoints/private/sync/pull/contact.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/contact.js +3 -2
- package/dist/sdk/endpoints/private/sync/pull/draft.d.ts +6 -6
- package/dist/sdk/endpoints/private/sync/pull/draft.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/draft.js +3 -2
- package/dist/sdk/endpoints/private/sync/pull/index.d.ts +21 -21
- package/dist/sdk/endpoints/private/sync/pull/thread.d.ts +7 -7
- package/dist/sdk/endpoints/private/sync/pull/thread.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/thread.js +4 -3
- package/dist/sdk/endpoints/private/sync/pull/user.d.ts +2 -2
- package/dist/sdk/endpoints/private/sync/pull/user.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/pull/user.js +3 -2
- package/dist/sdk/endpoints/private/sync/push/account.d.ts +14 -14
- package/dist/sdk/endpoints/private/sync/push/draft.d.ts +20 -20
- package/dist/sdk/endpoints/private/sync/push/index.d.ts +52 -45
- package/dist/sdk/endpoints/private/sync/push/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/push/thread.d.ts +16 -9
- package/dist/sdk/endpoints/private/sync/push/thread.d.ts.map +1 -1
- package/dist/sdk/endpoints/private/sync/push/thread.js +6 -0
- package/dist/sdk/endpoints/private/sync/push/user.d.ts +2 -2
- package/dist/sdk/endpoints/public/auth/index.d.ts +7 -7
- package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts +4 -4
- package/dist/sdk/endpoints/public/auth/refreshAuth.js +4 -4
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts +3 -3
- package/dist/sdk/endpoints/public/auth/verifyAuthCode.js +3 -3
- package/dist/sdk/endpoints/public/config/index.d.ts +1 -1
- package/dist/sdk/endpoints/public/config/index.d.ts.map +1 -1
- package/dist/sdk/endpoints/public/config/index.js +2 -1
- package/dist/sdk/endpoints/public/index.d.ts +8 -8
- package/dist/sdk/index.d.ts +83 -76
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/utils/accounts/index.d.ts +0 -4
- package/dist/utils/accounts/index.d.ts.map +1 -1
- package/dist/utils/accounts/index.js +0 -2
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +0 -1
- package/dist/ws.d.ts.map +1 -1
- package/dist/ws.js +1 -6
- package/package.json +3 -4
- package/dist/schemas/string.test.d.ts +0 -2
- package/dist/schemas/string.test.d.ts.map +0 -1
- package/dist/schemas/string.test.js +0 -20
- package/dist/utils/accounts/labelIdGenerate.d.ts +0 -5
- package/dist/utils/accounts/labelIdGenerate.d.ts.map +0 -1
- package/dist/utils/accounts/labelIdGenerate.js +0 -6
- package/dist/utils/accounts/labelIdGenerate.test.d.ts +0 -2
- package/dist/utils/accounts/labelIdGenerate.test.d.ts.map +0 -1
- package/dist/utils/accounts/labelIdGenerate.test.js +0 -51
- package/dist/utils/shortUUID/index.d.ts +0 -2
- package/dist/utils/shortUUID/index.d.ts.map +0 -1
- package/dist/utils/shortUUID/index.js +0 -1
- package/dist/utils/shortUUID/shortUUID.d.ts +0 -7
- package/dist/utils/shortUUID/shortUUID.d.ts.map +0 -1
- package/dist/utils/shortUUID/shortUUID.js +0 -8
- package/dist/utils/shortUUID/shortUUID.test.d.ts +0 -2
- package/dist/utils/shortUUID/shortUUID.test.d.ts.map +0 -1
- package/dist/utils/shortUUID/shortUUID.test.js +0 -19
package/dist/clients/thread.js
CHANGED
|
@@ -7,29 +7,29 @@ const inlineContact = v.object({
|
|
|
7
7
|
});
|
|
8
8
|
const inlineAttachment = v.object({
|
|
9
9
|
fileName: marcoSchemas.string.required(),
|
|
10
|
-
id: marcoSchemas.string.
|
|
10
|
+
id: marcoSchemas.string.required(),
|
|
11
11
|
mimeType: marcoSchemas.string.required(),
|
|
12
12
|
size: marcoSchemas.number.positiveInteger(),
|
|
13
13
|
});
|
|
14
14
|
const specialUseMutators = {
|
|
15
15
|
setArchive: {
|
|
16
16
|
delta: v.object({
|
|
17
|
-
threadId: marcoSchemas.string.
|
|
17
|
+
threadId: marcoSchemas.string.required(),
|
|
18
18
|
}),
|
|
19
19
|
},
|
|
20
20
|
setInbox: {
|
|
21
21
|
delta: v.object({
|
|
22
|
-
threadId: marcoSchemas.string.
|
|
22
|
+
threadId: marcoSchemas.string.required(),
|
|
23
23
|
}),
|
|
24
24
|
},
|
|
25
25
|
setSpam: {
|
|
26
26
|
delta: v.object({
|
|
27
|
-
threadId: marcoSchemas.string.
|
|
27
|
+
threadId: marcoSchemas.string.required(),
|
|
28
28
|
}),
|
|
29
29
|
},
|
|
30
30
|
setTrash: {
|
|
31
31
|
delta: v.object({
|
|
32
|
-
threadId: marcoSchemas.string.
|
|
32
|
+
threadId: marcoSchemas.string.required(),
|
|
33
33
|
}),
|
|
34
34
|
},
|
|
35
35
|
};
|
|
@@ -38,7 +38,7 @@ export const thread = {
|
|
|
38
38
|
bagOfWords: v.array(marcoSchemas.string.required()),
|
|
39
39
|
emailAccountId: marcoSchemas.string.required(),
|
|
40
40
|
flagged: v.nonOptional(v.boolean()),
|
|
41
|
-
id: marcoSchemas.string.
|
|
41
|
+
id: marcoSchemas.string.required(),
|
|
42
42
|
messages: v.array(v.object({
|
|
43
43
|
attachments: v.array(inlineAttachment),
|
|
44
44
|
bcc: v.array(inlineContact),
|
|
@@ -47,8 +47,8 @@ export const thread = {
|
|
|
47
47
|
envelopeDate: marcoSchemas.number.positiveInteger(),
|
|
48
48
|
envelopeSubject: marcoSchemas.string.nullable(),
|
|
49
49
|
from: v.array(inlineContact),
|
|
50
|
-
id: marcoSchemas.string.
|
|
51
|
-
labelIds: v.array(marcoSchemas.string.
|
|
50
|
+
id: marcoSchemas.string.required(),
|
|
51
|
+
labelIds: v.array(marcoSchemas.string.required()),
|
|
52
52
|
previewText: marcoSchemas.string.required(marcoConstants.messages.PREVIEW_TEXT_MAX_LENGTH),
|
|
53
53
|
replyTo: v.array(inlineContact),
|
|
54
54
|
to: v.array(inlineContact),
|
|
@@ -59,25 +59,30 @@ export const thread = {
|
|
|
59
59
|
...specialUseMutators,
|
|
60
60
|
delete: {
|
|
61
61
|
delta: v.object({
|
|
62
|
-
threadId: marcoSchemas.string.
|
|
62
|
+
threadId: marcoSchemas.string.required(),
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
requestAttachmentDownload: {
|
|
66
|
+
delta: v.object({
|
|
67
|
+
attachmentId: marcoSchemas.string.required(),
|
|
63
68
|
}),
|
|
64
69
|
},
|
|
65
70
|
setFlagged: {
|
|
66
71
|
delta: v.object({
|
|
67
72
|
flagged: v.nonOptional(v.boolean()),
|
|
68
|
-
threadId: marcoSchemas.string.
|
|
73
|
+
threadId: marcoSchemas.string.required(),
|
|
69
74
|
}),
|
|
70
75
|
},
|
|
71
76
|
setLabels: {
|
|
72
77
|
delta: v.object({
|
|
73
|
-
labelIds: v.array(marcoSchemas.string.
|
|
74
|
-
threadId: marcoSchemas.string.
|
|
78
|
+
labelIds: v.array(marcoSchemas.string.required()),
|
|
79
|
+
threadId: marcoSchemas.string.required(),
|
|
75
80
|
}),
|
|
76
81
|
},
|
|
77
82
|
setSeen: {
|
|
78
83
|
delta: v.object({
|
|
79
84
|
seen: v.boolean(),
|
|
80
|
-
threadId: marcoSchemas.string.
|
|
85
|
+
threadId: marcoSchemas.string.required(),
|
|
81
86
|
}),
|
|
82
87
|
},
|
|
83
88
|
},
|
package/dist/clients/user.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
export declare const user: {
|
|
3
3
|
model: v.ObjectSchema<{
|
|
4
|
-
readonly id: v.
|
|
4
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
5
5
|
readonly settings: v.ObjectSchema<{
|
|
6
6
|
readonly name: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
7
7
|
readonly notifications: v.ObjectSchema<{
|
|
@@ -16,13 +16,13 @@ export declare const user: {
|
|
|
16
16
|
mutators: {
|
|
17
17
|
setSettingsName: {
|
|
18
18
|
delta: v.ObjectSchema<{
|
|
19
|
-
readonly id: v.
|
|
19
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
20
20
|
readonly name: v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
21
21
|
}, undefined>;
|
|
22
22
|
};
|
|
23
23
|
setSettingsPushNotificationToken: {
|
|
24
24
|
delta: v.ObjectSchema<{
|
|
25
|
-
readonly id: v.
|
|
25
|
+
readonly id: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
26
26
|
readonly pushNotificationToken: v.ObjectSchema<{
|
|
27
27
|
readonly createdAt: v.NonOptionalSchema<v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
28
28
|
readonly deviceId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
package/dist/clients/user.js
CHANGED
|
@@ -14,19 +14,19 @@ const userSettings = v.object({
|
|
|
14
14
|
});
|
|
15
15
|
export const user = {
|
|
16
16
|
model: v.object({
|
|
17
|
-
id: marcoSchemas.string.
|
|
17
|
+
id: marcoSchemas.string.required(),
|
|
18
18
|
settings: userSettings,
|
|
19
19
|
}),
|
|
20
20
|
mutators: {
|
|
21
21
|
setSettingsName: {
|
|
22
22
|
delta: v.object({
|
|
23
|
-
id: marcoSchemas.string.
|
|
23
|
+
id: marcoSchemas.string.required(),
|
|
24
24
|
name: marcoSchemas.string.nullable(),
|
|
25
25
|
}),
|
|
26
26
|
},
|
|
27
27
|
setSettingsPushNotificationToken: {
|
|
28
28
|
delta: v.object({
|
|
29
|
-
id: marcoSchemas.string.
|
|
29
|
+
id: marcoSchemas.string.required(),
|
|
30
30
|
pushNotificationToken,
|
|
31
31
|
}),
|
|
32
32
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { accountUtils,
|
|
1
|
+
export { accountUtils, stringPatch } from './utils';
|
|
2
2
|
export { marcoClients, marcoClientsUtils } from './clients';
|
|
3
3
|
export { marcoConstants } from './constants';
|
|
4
4
|
export { marcoPublicConfig, MARCO_ENV, MarcoEnvironment } from './marcoPublicConfig';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,IAAI,gBAAgB,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { accountUtils,
|
|
1
|
+
export { accountUtils, stringPatch } from './utils';
|
|
2
2
|
export { marcoClients, marcoClientsUtils } from './clients';
|
|
3
3
|
export { marcoConstants } from './constants';
|
|
4
4
|
export { marcoPublicConfig, MARCO_ENV } from './marcoPublicConfig';
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ export declare const marcoSchemas: {
|
|
|
51
51
|
};
|
|
52
52
|
number: {
|
|
53
53
|
minMax: (min: number, max: number) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").MinValueAction<number, number, undefined>, import("valibot").MaxValueAction<number, number, undefined>]>, undefined>;
|
|
54
|
+
nullable: () => import("valibot").NullableSchema<import("valibot").NumberSchema<undefined>, undefined>;
|
|
54
55
|
positiveInteger: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").NumberSchema<undefined>, import("valibot").IntegerAction<number, undefined>, import("valibot").MinValueAction<number, 0, undefined>]>, undefined>;
|
|
55
56
|
};
|
|
56
57
|
oauth: {
|
|
@@ -59,8 +60,8 @@ export declare const marcoSchemas: {
|
|
|
59
60
|
pushNotifications: {
|
|
60
61
|
payload: import("valibot").UnionSchema<[import("valibot").ObjectSchema<{
|
|
61
62
|
readonly data: import("valibot").ObjectSchema<{
|
|
62
|
-
readonly messageId: import("valibot").
|
|
63
|
-
readonly threadId: import("valibot").
|
|
63
|
+
readonly messageId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
64
|
+
readonly threadId: import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
64
65
|
}, undefined>;
|
|
65
66
|
readonly event: import("valibot").LiteralSchema<"EMAIL_RECEIVED", undefined>;
|
|
66
67
|
}, undefined>], undefined>;
|
|
@@ -72,8 +73,6 @@ export declare const marcoSchemas: {
|
|
|
72
73
|
nullable: (maxLength?: number) => import("valibot").NullableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
73
74
|
optional: (maxLength?: number) => import("valibot").UndefinedableSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
74
75
|
required: (maxLength?: number) => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
75
|
-
shortUUID: () => import("valibot").CustomSchema<string, import("valibot").ErrorMessage<import("valibot").CustomIssue> | undefined>;
|
|
76
|
-
uuid: () => import("valibot").NonOptionalSchema<import("valibot").SchemaWithPipe<[import("valibot").StringSchema<undefined>, import("valibot").NonEmptyAction<string, undefined>, import("valibot").UuidAction<string, undefined>]>, undefined>;
|
|
77
76
|
};
|
|
78
77
|
};
|
|
79
78
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAUxB,CAAA"}
|
package/dist/schemas/number.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
export declare const number: {
|
|
3
3
|
minMax: (min: number, max: number) => v.NonOptionalSchema<v.SchemaWithPipe<[v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
|
|
4
|
+
nullable: () => v.NullableSchema<v.NumberSchema<undefined>, undefined>;
|
|
4
5
|
positiveInteger: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
|
|
5
6
|
};
|
|
6
7
|
//# sourceMappingURL=number.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/schemas/number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,MAAM;kBACH,MAAM,OAAO,MAAM
|
|
1
|
+
{"version":3,"file":"number.d.ts","sourceRoot":"","sources":["../../src/schemas/number.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,MAAM;kBACH,MAAM,OAAO,MAAM;;;CAMlC,CAAA"}
|
package/dist/schemas/number.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
export const number = {
|
|
3
3
|
minMax: (min, max) => v.nonOptional(v.pipe(v.number(), v.minValue(min), v.maxValue(max))),
|
|
4
|
+
nullable: () => v.nullable(v.number()),
|
|
4
5
|
positiveInteger: () => v.nonOptional(v.pipe(v.number(), v.integer(), v.minValue(0))),
|
|
5
6
|
};
|
|
@@ -2,8 +2,8 @@ import * as v from 'valibot';
|
|
|
2
2
|
export declare const pushNotifications: {
|
|
3
3
|
payload: v.UnionSchema<[v.ObjectSchema<{
|
|
4
4
|
readonly data: v.ObjectSchema<{
|
|
5
|
-
readonly messageId: v.
|
|
6
|
-
readonly threadId: v.
|
|
5
|
+
readonly messageId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
6
|
+
readonly threadId: v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
7
7
|
}, undefined>;
|
|
8
8
|
readonly event: v.LiteralSchema<"EMAIL_RECEIVED", undefined>;
|
|
9
9
|
}, undefined>], undefined>;
|
|
@@ -2,8 +2,8 @@ import * as v from 'valibot';
|
|
|
2
2
|
import { string } from './string';
|
|
3
3
|
const pushNotificationEmailReceivedPayload = v.object({
|
|
4
4
|
data: v.object({
|
|
5
|
-
messageId: string.
|
|
6
|
-
threadId: string.
|
|
5
|
+
messageId: string.required(),
|
|
6
|
+
threadId: string.required(),
|
|
7
7
|
}),
|
|
8
8
|
event: v.literal('EMAIL_RECEIVED'),
|
|
9
9
|
});
|
package/dist/schemas/string.d.ts
CHANGED
|
@@ -6,7 +6,5 @@ export declare const string: {
|
|
|
6
6
|
nullable: (maxLength?: number) => v.NullableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
7
7
|
optional: (maxLength?: number) => v.UndefinedableSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
8
8
|
required: (maxLength?: number) => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
|
|
9
|
-
shortUUID: () => v.CustomSchema<string, v.ErrorMessage<v.CustomIssue> | undefined>;
|
|
10
|
-
uuid: () => v.NonOptionalSchema<v.SchemaWithPipe<[v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.UuidAction<string, undefined>]>, undefined>;
|
|
11
9
|
};
|
|
12
10
|
//# sourceMappingURL=string.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/schemas/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"string.d.ts","sourceRoot":"","sources":["../../src/schemas/string.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAE5B,eAAO,MAAM,MAAM;;mBAGF,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;qBAEpB,MAAM;;;;CAQxB,CAAA"}
|
package/dist/schemas/string.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
import { shortUUID } from '../utils';
|
|
3
2
|
export const string = {
|
|
4
3
|
email: () => v.nonOptional(v.pipe(v.string(), v.email(), v.maxLength(255))),
|
|
5
4
|
enum: (values) => v.nonOptional(v.pipe(v.string(), v.enum(values))),
|
|
@@ -7,6 +6,4 @@ export const string = {
|
|
|
7
6
|
nullable: (maxLength = 255) => v.nullable(v.pipe(v.string(), v.nonEmpty(), v.maxLength(maxLength))),
|
|
8
7
|
optional: (maxLength = 255) => v.undefinedable(v.pipe(v.string(), v.nonEmpty(), v.maxLength(maxLength))),
|
|
9
8
|
required: (maxLength = 255) => v.nonOptional(v.pipe(v.string(), v.nonEmpty(), v.maxLength(maxLength))),
|
|
10
|
-
shortUUID: () => v.custom((input) => typeof input === 'string' && shortUUID.validate(input), 'Invalid short UUID format'),
|
|
11
|
-
uuid: () => v.nonOptional(v.pipe(v.string(), v.nonEmpty(), v.uuid())),
|
|
12
9
|
};
|