@marcoappio/marco-config 2.0.413 → 2.0.415

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.
Files changed (131) hide show
  1. package/dist/clients/account.d.ts +144 -0
  2. package/dist/clients/account.d.ts.map +1 -0
  3. package/dist/clients/account.js +93 -0
  4. package/dist/clients/contact.d.ts +14 -0
  5. package/dist/clients/contact.d.ts.map +1 -0
  6. package/dist/clients/contact.js +14 -0
  7. package/dist/clients/draft.d.ts +196 -0
  8. package/dist/clients/draft.d.ts.map +1 -0
  9. package/dist/clients/draft.js +122 -0
  10. package/dist/clients/index.d.ts +526 -0
  11. package/dist/clients/index.d.ts.map +1 -0
  12. package/dist/clients/index.js +13 -0
  13. package/dist/clients/thread.d.ts +125 -0
  14. package/dist/clients/thread.d.ts.map +1 -0
  15. package/dist/clients/thread.js +117 -0
  16. package/dist/clients/user.d.ts +53 -0
  17. package/dist/clients/user.d.ts.map +1 -0
  18. package/dist/clients/user.js +52 -0
  19. package/dist/clients/utils/index.d.ts +4 -0
  20. package/dist/clients/utils/index.d.ts.map +1 -0
  21. package/dist/clients/utils/index.js +4 -0
  22. package/dist/clients/utils/labelSpecialUseOrdering.d.ts +3 -0
  23. package/dist/clients/utils/labelSpecialUseOrdering.d.ts.map +1 -0
  24. package/dist/clients/utils/labelSpecialUseOrdering.js +1 -0
  25. package/dist/index.d.ts +3 -2
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +2 -1
  28. package/dist/marcoPublicConfig.d.ts +6 -0
  29. package/dist/marcoPublicConfig.d.ts.map +1 -1
  30. package/dist/marcoPublicConfig.js +18 -0
  31. package/dist/sdk/endpoints/index.d.ts +1073 -0
  32. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  33. package/dist/sdk/endpoints/index.js +2 -0
  34. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.d.ts +21 -0
  35. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.d.ts.map +1 -0
  36. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageAttachment.js +16 -0
  37. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.d.ts +19 -0
  38. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.d.ts.map +1 -0
  39. package/dist/sdk/endpoints/private/emailMessage/getEmailMessageHTML.js +19 -0
  40. package/dist/sdk/endpoints/private/emailMessage/index.d.ts +39 -0
  41. package/dist/sdk/endpoints/private/emailMessage/index.d.ts.map +1 -0
  42. package/dist/sdk/endpoints/private/emailMessage/index.js +6 -0
  43. package/dist/sdk/endpoints/private/index.d.ts +938 -0
  44. package/dist/sdk/endpoints/private/index.d.ts.map +1 -0
  45. package/dist/sdk/endpoints/private/index.js +8 -0
  46. package/dist/sdk/endpoints/private/sync/index.d.ts +888 -0
  47. package/dist/sdk/endpoints/private/sync/index.d.ts.map +1 -0
  48. package/dist/sdk/endpoints/private/sync/index.js +3 -0
  49. package/dist/sdk/endpoints/private/sync/pull/account.d.ts +71 -0
  50. package/dist/sdk/endpoints/private/sync/pull/account.d.ts.map +1 -0
  51. package/dist/sdk/endpoints/private/sync/pull/account.js +33 -0
  52. package/dist/sdk/endpoints/private/sync/pull/contact.d.ts +56 -0
  53. package/dist/sdk/endpoints/private/sync/pull/contact.d.ts.map +1 -0
  54. package/dist/sdk/endpoints/private/sync/pull/contact.js +40 -0
  55. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts +72 -0
  56. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts.map +1 -0
  57. package/dist/sdk/endpoints/private/sync/pull/draft.js +36 -0
  58. package/dist/sdk/endpoints/private/sync/pull/index.d.ts +349 -0
  59. package/dist/sdk/endpoints/private/sync/pull/index.d.ts.map +1 -0
  60. package/dist/sdk/endpoints/private/sync/pull/index.js +6 -0
  61. package/dist/sdk/endpoints/private/sync/pull/thread.d.ts +100 -0
  62. package/dist/sdk/endpoints/private/sync/pull/thread.d.ts.map +1 -0
  63. package/dist/sdk/endpoints/private/sync/pull/thread.js +45 -0
  64. package/dist/sdk/endpoints/private/sync/pull/user.d.ts +57 -0
  65. package/dist/sdk/endpoints/private/sync/pull/user.d.ts.map +1 -0
  66. package/dist/sdk/endpoints/private/sync/pull/user.js +33 -0
  67. package/dist/sdk/endpoints/private/sync/push/account.d.ts +151 -0
  68. package/dist/sdk/endpoints/private/sync/push/account.d.ts.map +1 -0
  69. package/dist/sdk/endpoints/private/sync/push/account.js +73 -0
  70. package/dist/sdk/endpoints/private/sync/push/draft.d.ts +206 -0
  71. package/dist/sdk/endpoints/private/sync/push/draft.d.ts.map +1 -0
  72. package/dist/sdk/endpoints/private/sync/push/draft.js +79 -0
  73. package/dist/sdk/endpoints/private/sync/push/index.d.ts +538 -0
  74. package/dist/sdk/endpoints/private/sync/push/index.d.ts.map +1 -0
  75. package/dist/sdk/endpoints/private/sync/push/index.js +5 -0
  76. package/dist/sdk/endpoints/private/sync/push/thread.d.ts +122 -0
  77. package/dist/sdk/endpoints/private/sync/push/thread.d.ts.map +1 -0
  78. package/dist/sdk/endpoints/private/sync/push/thread.js +79 -0
  79. package/dist/sdk/endpoints/private/sync/push/user.d.ts +64 -0
  80. package/dist/sdk/endpoints/private/sync/push/user.d.ts.map +1 -0
  81. package/dist/sdk/endpoints/private/sync/push/user.js +43 -0
  82. package/dist/sdk/endpoints/private/user/deleteUser.d.ts +10 -0
  83. package/dist/sdk/endpoints/private/user/deleteUser.d.ts.map +1 -0
  84. package/dist/sdk/endpoints/private/user/deleteUser.js +13 -0
  85. package/dist/sdk/endpoints/private/user/index.d.ts +11 -0
  86. package/dist/sdk/endpoints/private/user/index.d.ts.map +1 -0
  87. package/dist/sdk/endpoints/private/user/index.js +4 -0
  88. package/dist/sdk/endpoints/public/auth/index.d.ts +137 -0
  89. package/dist/sdk/endpoints/public/auth/index.d.ts.map +1 -0
  90. package/dist/sdk/endpoints/public/auth/index.js +8 -0
  91. package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts +41 -0
  92. package/dist/sdk/endpoints/public/auth/refreshAuth.d.ts.map +1 -0
  93. package/dist/sdk/endpoints/public/auth/refreshAuth.js +33 -0
  94. package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts +27 -0
  95. package/dist/sdk/endpoints/public/auth/sendAuthCode.d.ts.map +1 -0
  96. package/dist/sdk/endpoints/public/auth/sendAuthCode.js +19 -0
  97. package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts +72 -0
  98. package/dist/sdk/endpoints/public/auth/verifyAuthCode.d.ts.map +1 -0
  99. package/dist/sdk/endpoints/public/auth/verifyAuthCode.js +37 -0
  100. package/dist/sdk/endpoints/public/index.d.ts +136 -0
  101. package/dist/sdk/endpoints/public/index.d.ts.map +1 -1
  102. package/dist/sdk/endpoints/public/index.js +2 -0
  103. package/dist/sdk/index.d.ts +1073 -0
  104. package/dist/sdk/index.d.ts.map +1 -1
  105. package/dist/types/Endpoint.d.ts +2 -1
  106. package/dist/types/Endpoint.d.ts.map +1 -1
  107. package/dist/types/MarcoClient.d.ts +12 -0
  108. package/dist/types/MarcoClient.d.ts.map +1 -0
  109. package/dist/types/MarcoClient.js +1 -0
  110. package/dist/types/SDKError.d.ts +4 -0
  111. package/dist/types/SDKError.d.ts.map +1 -0
  112. package/dist/types/SDKError.js +1 -0
  113. package/dist/types/WS.d.ts +7 -0
  114. package/dist/types/WS.d.ts.map +1 -0
  115. package/dist/types/WS.js +1 -0
  116. package/dist/types/index.d.ts +3 -0
  117. package/dist/types/index.d.ts.map +1 -1
  118. package/dist/types/index.js +3 -0
  119. package/dist/ws.d.ts +6 -0
  120. package/dist/ws.d.ts.map +1 -0
  121. package/dist/ws.js +5 -0
  122. package/package.json +1 -2
  123. package/dist/instantDB/index.d.ts +0 -3
  124. package/dist/instantDB/index.d.ts.map +0 -1
  125. package/dist/instantDB/index.js +0 -2
  126. package/dist/instantDB/instant.perms.d.ts +0 -110
  127. package/dist/instantDB/instant.perms.d.ts.map +0 -1
  128. package/dist/instantDB/instant.perms.js +0 -109
  129. package/dist/instantDB/instant.schema.d.ts +0 -313
  130. package/dist/instantDB/instant.schema.d.ts.map +0 -1
  131. package/dist/instantDB/instant.schema.js +0 -156
@@ -0,0 +1,144 @@
1
+ import * as v from 'valibot';
2
+ export declare const account: {
3
+ model: v.ObjectSchema<{
4
+ readonly aliases: v.ObjectSchema<{
5
+ readonly nonPrimary: v.ArraySchema<v.ObjectSchema<{
6
+ readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
7
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
8
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
9
+ }, undefined>, undefined>;
10
+ readonly primary: v.ObjectSchema<{
11
+ readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
12
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
13
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
14
+ }, undefined>;
15
+ }, undefined>;
16
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
17
+ readonly imapConnectionStatus: v.PicklistSchema<readonly ["AWAITING_CONNECTION", "CONNECTED", "CONNECTION_FAILED_AUTHENTICATION_ERROR", "CONNECTION_FAILED_CONNECTION_ERROR", "CONNECTION_FAILED_OAUTH_EXCHANGE_ERROR", "CONNECTION_FAILED_QUOTA_ERROR", "CONNECTION_FAILED_UNKNOWN_ERROR"], undefined>;
18
+ readonly labels: v.ArraySchema<v.ObjectSchema<{
19
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
20
+ readonly path: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
21
+ readonly specialUse: v.NullableSchema<v.PicklistSchema<readonly ["ARCHIVE", "INBOX", "SENT", "SPAM", "TRASH"], undefined>, undefined>;
22
+ }, undefined>, undefined>;
23
+ readonly mailCounts: v.ObjectSchema<{
24
+ readonly processed: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
25
+ readonly total: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
26
+ }, undefined>;
27
+ readonly settings: v.ObjectSchema<{
28
+ readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
29
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
30
+ }, undefined>;
31
+ }, undefined>;
32
+ mutators: {
33
+ createAccount: {
34
+ delta: v.ObjectSchema<{
35
+ readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
36
+ readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
37
+ readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
38
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
39
+ }, undefined>;
40
+ };
41
+ createAlias: {
42
+ delta: v.ObjectSchema<{
43
+ readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
44
+ readonly alias: v.ObjectSchema<{
45
+ readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
46
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
47
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
48
+ }, undefined>;
49
+ }, undefined>;
50
+ };
51
+ deleteAccount: {
52
+ delta: v.ObjectSchema<{
53
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
54
+ }, undefined>;
55
+ };
56
+ deleteAlias: {
57
+ delta: v.ObjectSchema<{
58
+ readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
59
+ readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
60
+ }, undefined>;
61
+ };
62
+ setAliasName: {
63
+ delta: v.ObjectSchema<{
64
+ readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
65
+ readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
66
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
67
+ }, undefined>;
68
+ };
69
+ setAliasPrimary: {
70
+ delta: v.ObjectSchema<{
71
+ readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
72
+ readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
73
+ }, undefined>;
74
+ };
75
+ setConnectionConfigImapRaw: {
76
+ delta: v.ObjectSchema<{
77
+ readonly connectionConfig: v.ObjectSchema<{
78
+ readonly imapHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
79
+ readonly imapPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
80
+ readonly imapPort: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
81
+ readonly imapSocketType: v.UnionSchema<[v.LiteralSchema<"STARTTLS", undefined>, v.LiteralSchema<"SSL", undefined>], undefined>;
82
+ readonly imapUser: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
83
+ readonly smtpHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
84
+ readonly smtpPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
85
+ readonly smtpPort: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, number, undefined>, v.MaxValueAction<number, number, undefined>]>, undefined>;
86
+ readonly smtpSocketType: v.UnionSchema<[v.LiteralSchema<"STARTTLS", undefined>, v.LiteralSchema<"SSL", undefined>], undefined>;
87
+ readonly smtpUser: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
88
+ }, undefined>;
89
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
90
+ }, undefined>;
91
+ };
92
+ setConnectionConfigOauth: {
93
+ delta: v.ObjectSchema<{
94
+ readonly connectionConfig: v.ObjectSchema<{
95
+ readonly code: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
96
+ readonly provider: v.UnionSchema<[v.LiteralSchema<"GOOGLE", undefined>, v.LiteralSchema<"OUTLOOK", undefined>], undefined>;
97
+ readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
98
+ }, undefined>;
99
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
100
+ }, undefined>;
101
+ };
102
+ setSettings: {
103
+ delta: v.ObjectSchema<{
104
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
105
+ readonly settings: Omit<v.ObjectSchema<{
106
+ readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
107
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
108
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
109
+ readonly entries: {
110
+ readonly color: v.OptionalSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
111
+ readonly name: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
112
+ };
113
+ readonly '~standard': v.StandardProps<{
114
+ color?: string | undefined;
115
+ name?: string | null | undefined;
116
+ }, {
117
+ color?: string | undefined;
118
+ name?: string | null | undefined;
119
+ }>;
120
+ readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
121
+ color?: string | undefined;
122
+ name?: string | null | undefined;
123
+ }, v.ObjectIssue | v.StringIssue | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>>;
124
+ readonly '~types'?: {
125
+ readonly input: {
126
+ color?: string | undefined;
127
+ name?: string | null | undefined;
128
+ };
129
+ readonly output: {
130
+ color?: string | undefined;
131
+ name?: string | null | undefined;
132
+ };
133
+ readonly issue: v.ObjectIssue | v.StringIssue | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>;
134
+ } | undefined;
135
+ };
136
+ }, undefined>;
137
+ };
138
+ };
139
+ name: "account";
140
+ pullUrl: "/v1/pv/sync/pull/account";
141
+ pushUrl: "/v1/pv/sync/push/account";
142
+ schemaVersion: "v1";
143
+ };
144
+ //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/clients/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAgB5B,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmFG,CAAA"}
@@ -0,0 +1,93 @@
1
+ import * as v from 'valibot';
2
+ import { marcoSchemas } from '../schemas';
3
+ const accountSettingsSchema = v.object({
4
+ color: marcoSchemas.string.required(),
5
+ name: marcoSchemas.string.nullable(),
6
+ });
7
+ const aliasSchema = v.object({
8
+ emailAddress: marcoSchemas.string.email(),
9
+ id: marcoSchemas.string.required(),
10
+ name: marcoSchemas.string.nullable(),
11
+ });
12
+ export const account = {
13
+ model: v.object({
14
+ aliases: v.object({
15
+ nonPrimary: v.array(aliasSchema),
16
+ primary: aliasSchema,
17
+ }),
18
+ id: marcoSchemas.string.required(),
19
+ imapConnectionStatus: marcoSchemas.emailAccount.imapConnectionStatus(),
20
+ labels: v.array(v.object({
21
+ id: marcoSchemas.string.required(),
22
+ path: marcoSchemas.string.required(),
23
+ specialUse: v.nullable(marcoSchemas.labels.specialUse()),
24
+ })),
25
+ mailCounts: v.object({
26
+ processed: marcoSchemas.number.positiveInteger(),
27
+ total: marcoSchemas.number.positiveInteger(),
28
+ }),
29
+ settings: accountSettingsSchema,
30
+ }),
31
+ mutators: {
32
+ createAccount: {
33
+ delta: v.object({
34
+ aliasId: marcoSchemas.string.required(),
35
+ color: marcoSchemas.string.required(),
36
+ emailAddress: marcoSchemas.string.email(),
37
+ id: marcoSchemas.string.required(),
38
+ }),
39
+ },
40
+ createAlias: {
41
+ delta: v.object({
42
+ accountId: marcoSchemas.string.required(),
43
+ alias: aliasSchema,
44
+ }),
45
+ },
46
+ deleteAccount: {
47
+ delta: v.object({
48
+ id: marcoSchemas.string.required(),
49
+ }),
50
+ },
51
+ deleteAlias: {
52
+ delta: v.object({
53
+ accountId: marcoSchemas.string.required(),
54
+ aliasId: marcoSchemas.string.required(),
55
+ }),
56
+ },
57
+ setAliasName: {
58
+ delta: v.object({
59
+ accountId: marcoSchemas.string.required(),
60
+ aliasId: marcoSchemas.string.required(),
61
+ name: marcoSchemas.string.nullable(),
62
+ }),
63
+ },
64
+ setAliasPrimary: {
65
+ delta: v.object({
66
+ accountId: marcoSchemas.string.required(),
67
+ aliasId: marcoSchemas.string.required(),
68
+ }),
69
+ },
70
+ setConnectionConfigImapRaw: {
71
+ delta: v.object({
72
+ connectionConfig: marcoSchemas.emailAccount.connectionConfigImapRaw(),
73
+ id: marcoSchemas.string.required(),
74
+ }),
75
+ },
76
+ setConnectionConfigOauth: {
77
+ delta: v.object({
78
+ connectionConfig: marcoSchemas.emailAccount.connectionConfigOauth(),
79
+ id: marcoSchemas.string.required(),
80
+ }),
81
+ },
82
+ setSettings: {
83
+ delta: v.object({
84
+ id: marcoSchemas.string.required(),
85
+ settings: v.partial(accountSettingsSchema),
86
+ }),
87
+ },
88
+ },
89
+ name: 'account',
90
+ pullUrl: '/v1/pv/sync/pull/account',
91
+ pushUrl: '/v1/pv/sync/push/account',
92
+ schemaVersion: 'v1',
93
+ };
@@ -0,0 +1,14 @@
1
+ import * as v from 'valibot';
2
+ export declare const contact: {
3
+ model: v.ObjectSchema<{
4
+ readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
5
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
6
+ readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
7
+ }, undefined>;
8
+ mutators: {};
9
+ name: "contact";
10
+ pullUrl: "/v1/pv/sync/pull/contact";
11
+ pushUrl: null;
12
+ schemaVersion: "v1";
13
+ };
14
+ //# sourceMappingURL=contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/clients/contact.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAK5B,eAAO,MAAM,OAAO;;;;;;;;;;;CAWG,CAAA"}
@@ -0,0 +1,14 @@
1
+ import * as v from 'valibot';
2
+ import { marcoSchemas } from '../schemas';
3
+ export const contact = {
4
+ model: v.object({
5
+ emailAddress: marcoSchemas.string.email(),
6
+ id: marcoSchemas.string.required(),
7
+ name: marcoSchemas.string.nullable(),
8
+ }),
9
+ mutators: {},
10
+ name: 'contact',
11
+ pullUrl: '/v1/pv/sync/pull/contact',
12
+ pushUrl: null,
13
+ schemaVersion: 'v1',
14
+ };
@@ -0,0 +1,196 @@
1
+ import * as v from 'valibot';
2
+ export declare const draft: {
3
+ model: v.ObjectSchema<{
4
+ readonly attachments: v.ArraySchema<v.ObjectSchema<{
5
+ readonly failed: v.BooleanSchema<undefined>;
6
+ readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
7
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
8
+ readonly mimeType: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
9
+ readonly totalChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
10
+ readonly totalSize: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
11
+ readonly uploadedChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
12
+ }, undefined>, undefined>;
13
+ readonly body: v.ObjectSchema<{
14
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
15
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
16
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
17
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
18
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
19
+ }, undefined>;
20
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
21
+ readonly error: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
22
+ readonly from: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
23
+ readonly fromName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
24
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
25
+ readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
26
+ readonly scheduledFor: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
27
+ readonly status: v.PicklistSchema<readonly ["DRAFT", "SEND_REQUESTED", "SEND_CONFIRMED", "SEND_FAILED"], undefined>;
28
+ readonly type: v.PicklistSchema<readonly ["NEW", "REPLY", "FORWARD"], undefined>;
29
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
30
+ }, undefined>;
31
+ mutators: {
32
+ cancelSend: {
33
+ delta: v.ObjectSchema<{
34
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
35
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
36
+ }, undefined>;
37
+ };
38
+ createAttachment: {
39
+ delta: v.ObjectSchema<{
40
+ readonly attachment: v.ObjectSchema<{
41
+ readonly failed: v.BooleanSchema<undefined>;
42
+ readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
43
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
44
+ readonly mimeType: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
45
+ readonly totalChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
46
+ readonly totalSize: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
47
+ readonly uploadedChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
48
+ }, undefined>;
49
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
50
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
51
+ }, undefined>;
52
+ };
53
+ createDraft: {
54
+ delta: v.ObjectSchema<{
55
+ readonly attachments: v.ArraySchema<v.ObjectSchema<{
56
+ readonly failed: v.BooleanSchema<undefined>;
57
+ readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
58
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
59
+ readonly mimeType: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
60
+ readonly totalChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
61
+ readonly totalSize: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
62
+ readonly uploadedChunks: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
63
+ }, undefined>, undefined>;
64
+ readonly body: v.ObjectSchema<{
65
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
66
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
67
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
68
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
69
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
70
+ }, undefined>;
71
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
72
+ readonly error: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
73
+ readonly from: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
74
+ readonly fromName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
75
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
76
+ readonly referencedMessageId: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
77
+ readonly scheduledFor: v.NullableSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>, undefined>;
78
+ readonly status: v.PicklistSchema<readonly ["DRAFT", "SEND_REQUESTED", "SEND_CONFIRMED", "SEND_FAILED"], undefined>;
79
+ readonly type: v.PicklistSchema<readonly ["NEW", "REPLY", "FORWARD"], undefined>;
80
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
81
+ }, undefined>;
82
+ };
83
+ deleteAttachment: {
84
+ delta: v.ObjectSchema<{
85
+ readonly attachmentId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
86
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
87
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
88
+ }, undefined>;
89
+ };
90
+ deleteDraft: {
91
+ delta: v.ObjectSchema<{
92
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
93
+ }, undefined>;
94
+ };
95
+ scheduleSend: {
96
+ delta: v.UnionSchema<[v.ObjectSchema<{
97
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
98
+ readonly kind: v.LiteralSchema<"IMMEDIATE", undefined>;
99
+ readonly undoMs: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
100
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
101
+ }, undefined>, v.ObjectSchema<{
102
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
103
+ readonly kind: v.LiteralSchema<"SCHEDULED", undefined>;
104
+ readonly scheduledFor: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
105
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
106
+ }, undefined>], undefined>;
107
+ };
108
+ setContent: {
109
+ delta: v.ObjectSchema<{
110
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
111
+ readonly patch: v.ArraySchema<v.ObjectSchema<{
112
+ readonly index: v.NumberSchema<undefined>;
113
+ readonly type: v.UnionSchema<[v.LiteralSchema<"INSERTION", undefined>, v.LiteralSchema<"DELETION", undefined>], undefined>;
114
+ readonly value: v.StringSchema<undefined>;
115
+ }, undefined>, undefined>;
116
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
117
+ }, undefined>;
118
+ };
119
+ setEnvelope: {
120
+ delta: v.ObjectSchema<{
121
+ readonly envelope: Omit<v.ObjectSchema<{
122
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
123
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
124
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
125
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
126
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
127
+ }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
128
+ readonly entries: Omit<{
129
+ readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
130
+ readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
131
+ readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
132
+ readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
133
+ readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
134
+ }, "content">;
135
+ readonly '~standard': v.StandardProps<{
136
+ bcc: string[];
137
+ cc: string[];
138
+ to: string[];
139
+ subject: string | null;
140
+ }, {
141
+ bcc: string[];
142
+ cc: string[];
143
+ to: string[];
144
+ subject: string | null;
145
+ }>;
146
+ readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
147
+ bcc: string[];
148
+ cc: string[];
149
+ to: string[];
150
+ subject: string | null;
151
+ }, v.ObjectIssue | v.StringIssue | v.ArrayIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>>;
152
+ readonly '~types'?: {
153
+ readonly input: {
154
+ bcc: string[];
155
+ cc: string[];
156
+ to: string[];
157
+ subject: string | null;
158
+ };
159
+ readonly output: {
160
+ bcc: string[];
161
+ cc: string[];
162
+ to: string[];
163
+ subject: string | null;
164
+ };
165
+ readonly issue: v.ObjectIssue | v.StringIssue | v.ArrayIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>;
166
+ } | undefined;
167
+ };
168
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
169
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
170
+ }, undefined>;
171
+ };
172
+ setFrom: {
173
+ delta: v.ObjectSchema<{
174
+ readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
175
+ readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
176
+ readonly from: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
177
+ readonly fromName: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
178
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
179
+ readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
180
+ }, undefined>;
181
+ };
182
+ uploadAttachmentChunk: {
183
+ delta: v.ObjectSchema<{
184
+ readonly attachmentId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
185
+ readonly chunk: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>;
186
+ readonly chunkIndex: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
187
+ readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
188
+ }, undefined>;
189
+ };
190
+ };
191
+ name: "draft";
192
+ pullUrl: "/v1/pv/sync/pull/draft";
193
+ pushUrl: "/v1/pv/sync/push/draft";
194
+ schemaVersion: "v1";
195
+ };
196
+ //# sourceMappingURL=draft.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../src/clients/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AA0D5B,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuEK,CAAA"}
@@ -0,0 +1,122 @@
1
+ import * as v from 'valibot';
2
+ import { marcoSchemas } from '../schemas';
3
+ import { DRAFT_STATUSES, DRAFT_TYPES } from '../types';
4
+ const draftStatusSchema = v.picklist(DRAFT_STATUSES);
5
+ const draftTypeSchema = v.picklist(DRAFT_TYPES);
6
+ const bodySchema = v.object({
7
+ bcc: v.array(marcoSchemas.string.email()),
8
+ cc: v.array(marcoSchemas.string.email()),
9
+ content: v.pipe(v.string(), v.maxLength(384000)),
10
+ subject: marcoSchemas.string.nullable(),
11
+ to: v.array(marcoSchemas.string.email()),
12
+ });
13
+ const attachmentSchema = v.object({
14
+ failed: v.boolean(),
15
+ fileName: marcoSchemas.string.required(),
16
+ id: marcoSchemas.string.required(),
17
+ mimeType: marcoSchemas.string.required(),
18
+ totalChunks: marcoSchemas.number.positiveInteger(),
19
+ totalSize: marcoSchemas.number.positiveInteger(),
20
+ uploadedChunks: marcoSchemas.number.positiveInteger(),
21
+ });
22
+ const scheduledForSchema = v.nullable(marcoSchemas.number.positiveInteger());
23
+ const scheduleSchema = v.union([
24
+ v.object({
25
+ id: marcoSchemas.string.required(),
26
+ kind: v.literal('IMMEDIATE'),
27
+ undoMs: marcoSchemas.number.positiveInteger(),
28
+ updatedAt: marcoSchemas.number.positiveInteger(),
29
+ }),
30
+ v.object({
31
+ id: marcoSchemas.string.required(),
32
+ kind: v.literal('SCHEDULED'),
33
+ scheduledFor: marcoSchemas.number.positiveInteger(),
34
+ updatedAt: marcoSchemas.number.positiveInteger(),
35
+ }),
36
+ ]);
37
+ const draftSchema = v.object({
38
+ attachments: v.array(attachmentSchema),
39
+ body: bodySchema,
40
+ emailAccountId: marcoSchemas.string.required(),
41
+ error: marcoSchemas.string.nullable(),
42
+ from: marcoSchemas.string.email(),
43
+ fromName: marcoSchemas.string.nullable(),
44
+ id: marcoSchemas.string.required(),
45
+ referencedMessageId: marcoSchemas.string.nullable(),
46
+ scheduledFor: scheduledForSchema,
47
+ status: draftStatusSchema,
48
+ type: draftTypeSchema,
49
+ updatedAt: marcoSchemas.number.positiveInteger(),
50
+ });
51
+ export const draft = {
52
+ model: draftSchema,
53
+ mutators: {
54
+ cancelSend: {
55
+ delta: v.object({
56
+ id: marcoSchemas.string.required(),
57
+ updatedAt: marcoSchemas.number.positiveInteger(),
58
+ }),
59
+ },
60
+ createAttachment: {
61
+ delta: v.object({
62
+ attachment: attachmentSchema,
63
+ id: marcoSchemas.string.required(),
64
+ updatedAt: marcoSchemas.number.positiveInteger(),
65
+ }),
66
+ },
67
+ createDraft: {
68
+ delta: draftSchema,
69
+ },
70
+ deleteAttachment: {
71
+ delta: v.object({
72
+ attachmentId: marcoSchemas.string.required(),
73
+ id: marcoSchemas.string.required(),
74
+ updatedAt: marcoSchemas.number.positiveInteger(),
75
+ }),
76
+ },
77
+ deleteDraft: {
78
+ delta: v.object({
79
+ id: marcoSchemas.string.required(),
80
+ }),
81
+ },
82
+ scheduleSend: {
83
+ delta: scheduleSchema,
84
+ },
85
+ setContent: {
86
+ delta: v.object({
87
+ id: marcoSchemas.string.required(),
88
+ patch: marcoSchemas.drafts.contentPatch.patch(),
89
+ updatedAt: marcoSchemas.number.positiveInteger(),
90
+ }),
91
+ },
92
+ setEnvelope: {
93
+ delta: v.object({
94
+ envelope: v.omit(bodySchema, ['content']),
95
+ id: marcoSchemas.string.required(),
96
+ updatedAt: marcoSchemas.number.positiveInteger(),
97
+ }),
98
+ },
99
+ setFrom: {
100
+ delta: v.object({
101
+ aliasId: marcoSchemas.string.required(),
102
+ emailAccountId: marcoSchemas.string.required(),
103
+ from: marcoSchemas.string.email(),
104
+ fromName: marcoSchemas.string.nullable(),
105
+ id: marcoSchemas.string.required(),
106
+ updatedAt: marcoSchemas.number.positiveInteger(),
107
+ }),
108
+ },
109
+ uploadAttachmentChunk: {
110
+ delta: v.object({
111
+ attachmentId: marcoSchemas.string.required(),
112
+ chunk: v.pipe(v.string(), v.base64()),
113
+ chunkIndex: marcoSchemas.number.positiveInteger(),
114
+ id: marcoSchemas.string.required(),
115
+ }),
116
+ },
117
+ },
118
+ name: 'draft',
119
+ pullUrl: '/v1/pv/sync/pull/draft',
120
+ pushUrl: '/v1/pv/sync/push/draft',
121
+ schemaVersion: 'v1',
122
+ };