@marcoappio/marco-config 2.0.415 → 2.0.417

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 (126) hide show
  1. package/dist/index.d.ts +3 -4
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +3 -3
  4. package/dist/marcoPublicConfig.d.ts +9 -1
  5. package/dist/marcoPublicConfig.d.ts.map +1 -1
  6. package/dist/marcoPublicConfig.js +12 -0
  7. package/dist/schemas/app.d.ts +1 -1
  8. package/dist/schemas/app.d.ts.map +1 -1
  9. package/dist/schemas/app.js +2 -1
  10. package/dist/schemas/emailAccount.d.ts +1 -1
  11. package/dist/schemas/index.d.ts +3 -3
  12. package/dist/schemas/oauth.d.ts +1 -1
  13. package/dist/schemas/oauth.d.ts.map +1 -1
  14. package/dist/schemas/oauth.js +2 -1
  15. package/dist/sdk/endpoints/index.d.ts +0 -887
  16. package/dist/sdk/endpoints/index.d.ts.map +1 -1
  17. package/dist/sdk/endpoints/private/index.d.ts +0 -887
  18. package/dist/sdk/endpoints/private/index.d.ts.map +1 -1
  19. package/dist/sdk/endpoints/private/index.js +0 -2
  20. package/dist/sdk/index.d.ts +0 -887
  21. package/dist/sdk/index.d.ts.map +1 -1
  22. package/dist/types/MarcoPlatform.d.ts +3 -0
  23. package/dist/types/MarcoPlatform.d.ts.map +1 -0
  24. package/dist/types/MarcoPlatform.js +1 -0
  25. package/dist/types/OAuthProvider.d.ts +3 -0
  26. package/dist/types/OAuthProvider.d.ts.map +1 -0
  27. package/dist/types/OAuthProvider.js +1 -0
  28. package/dist/types/index.d.ts +2 -2
  29. package/dist/types/index.d.ts.map +1 -1
  30. package/dist/types/index.js +2 -2
  31. package/dist/utils/index.d.ts +1 -0
  32. package/dist/utils/index.d.ts.map +1 -1
  33. package/dist/utils/index.js +1 -0
  34. package/dist/utils/labels/index.d.ts +4 -0
  35. package/dist/utils/labels/index.d.ts.map +1 -0
  36. package/dist/utils/labels/index.js +4 -0
  37. package/dist/zero/index.d.ts +1448 -0
  38. package/dist/zero/index.d.ts.map +1 -0
  39. package/dist/zero/index.js +13 -0
  40. package/dist/{sdk/endpoints/private/sync/push → zero/mutators}/account.d.ts +33 -75
  41. package/dist/zero/mutators/account.d.ts.map +1 -0
  42. package/dist/zero/mutators/account.js +69 -0
  43. package/dist/{sdk/endpoints/private/sync/push → zero/mutators}/draft.d.ts +35 -79
  44. package/dist/{clients → zero/mutators}/draft.d.ts.map +1 -1
  45. package/dist/zero/mutators/draft.js +114 -0
  46. package/dist/{sdk/endpoints/private/sync/push → zero/mutators}/thread.d.ts +32 -76
  47. package/dist/zero/mutators/thread.d.ts.map +1 -0
  48. package/dist/zero/mutators/thread.js +76 -0
  49. package/dist/zero/mutators/user.d.ts +32 -0
  50. package/dist/zero/mutators/user.d.ts.map +1 -0
  51. package/dist/zero/mutators/user.js +33 -0
  52. package/dist/zero/mutators.d.ts +412 -0
  53. package/dist/zero/mutators.d.ts.map +1 -0
  54. package/dist/zero/mutators.js +44 -0
  55. package/dist/zero/mutators.test.d.ts +2 -0
  56. package/dist/zero/mutators.test.d.ts.map +1 -0
  57. package/dist/zero/mutators.test.js +33 -0
  58. package/dist/zero/schema.d.ts +1438 -0
  59. package/dist/zero/schema.d.ts.map +1 -0
  60. package/dist/zero/schema.js +430 -0
  61. package/package.json +2 -1
  62. package/dist/clients/account.d.ts +0 -144
  63. package/dist/clients/account.d.ts.map +0 -1
  64. package/dist/clients/account.js +0 -93
  65. package/dist/clients/contact.d.ts +0 -14
  66. package/dist/clients/contact.d.ts.map +0 -1
  67. package/dist/clients/contact.js +0 -14
  68. package/dist/clients/draft.d.ts +0 -196
  69. package/dist/clients/draft.js +0 -122
  70. package/dist/clients/index.d.ts +0 -526
  71. package/dist/clients/index.d.ts.map +0 -1
  72. package/dist/clients/index.js +0 -13
  73. package/dist/clients/thread.d.ts +0 -125
  74. package/dist/clients/thread.d.ts.map +0 -1
  75. package/dist/clients/thread.js +0 -117
  76. package/dist/clients/user.d.ts +0 -53
  77. package/dist/clients/user.d.ts.map +0 -1
  78. package/dist/clients/user.js +0 -52
  79. package/dist/clients/utils/index.d.ts +0 -4
  80. package/dist/clients/utils/index.d.ts.map +0 -1
  81. package/dist/clients/utils/index.js +0 -4
  82. package/dist/clients/utils/labelSpecialUseOrdering.d.ts +0 -3
  83. package/dist/clients/utils/labelSpecialUseOrdering.d.ts.map +0 -1
  84. package/dist/clients/utils/labelSpecialUseOrdering.js +0 -1
  85. package/dist/sdk/endpoints/private/sync/index.d.ts +0 -888
  86. package/dist/sdk/endpoints/private/sync/index.d.ts.map +0 -1
  87. package/dist/sdk/endpoints/private/sync/index.js +0 -3
  88. package/dist/sdk/endpoints/private/sync/pull/account.d.ts +0 -71
  89. package/dist/sdk/endpoints/private/sync/pull/account.d.ts.map +0 -1
  90. package/dist/sdk/endpoints/private/sync/pull/account.js +0 -33
  91. package/dist/sdk/endpoints/private/sync/pull/contact.d.ts +0 -56
  92. package/dist/sdk/endpoints/private/sync/pull/contact.d.ts.map +0 -1
  93. package/dist/sdk/endpoints/private/sync/pull/contact.js +0 -40
  94. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts +0 -72
  95. package/dist/sdk/endpoints/private/sync/pull/draft.d.ts.map +0 -1
  96. package/dist/sdk/endpoints/private/sync/pull/draft.js +0 -36
  97. package/dist/sdk/endpoints/private/sync/pull/index.d.ts +0 -349
  98. package/dist/sdk/endpoints/private/sync/pull/index.d.ts.map +0 -1
  99. package/dist/sdk/endpoints/private/sync/pull/index.js +0 -6
  100. package/dist/sdk/endpoints/private/sync/pull/thread.d.ts +0 -100
  101. package/dist/sdk/endpoints/private/sync/pull/thread.d.ts.map +0 -1
  102. package/dist/sdk/endpoints/private/sync/pull/thread.js +0 -45
  103. package/dist/sdk/endpoints/private/sync/pull/user.d.ts +0 -57
  104. package/dist/sdk/endpoints/private/sync/pull/user.d.ts.map +0 -1
  105. package/dist/sdk/endpoints/private/sync/pull/user.js +0 -33
  106. package/dist/sdk/endpoints/private/sync/push/account.d.ts.map +0 -1
  107. package/dist/sdk/endpoints/private/sync/push/account.js +0 -73
  108. package/dist/sdk/endpoints/private/sync/push/draft.d.ts.map +0 -1
  109. package/dist/sdk/endpoints/private/sync/push/draft.js +0 -79
  110. package/dist/sdk/endpoints/private/sync/push/index.d.ts +0 -538
  111. package/dist/sdk/endpoints/private/sync/push/index.d.ts.map +0 -1
  112. package/dist/sdk/endpoints/private/sync/push/index.js +0 -5
  113. package/dist/sdk/endpoints/private/sync/push/thread.d.ts.map +0 -1
  114. package/dist/sdk/endpoints/private/sync/push/thread.js +0 -79
  115. package/dist/sdk/endpoints/private/sync/push/user.d.ts +0 -64
  116. package/dist/sdk/endpoints/private/sync/push/user.d.ts.map +0 -1
  117. package/dist/sdk/endpoints/private/sync/push/user.js +0 -43
  118. package/dist/types/MarcoClient.d.ts +0 -12
  119. package/dist/types/MarcoClient.d.ts.map +0 -1
  120. package/dist/types/MarcoClient.js +0 -1
  121. package/dist/types/WS.d.ts +0 -7
  122. package/dist/types/WS.d.ts.map +0 -1
  123. package/dist/types/WS.js +0 -1
  124. package/dist/ws.d.ts +0 -6
  125. package/dist/ws.d.ts.map +0 -1
  126. package/dist/ws.js +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/zero/index.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIZ,CAAA;AAEV,YAAY,EACV,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,cAAc,EACd,0BAA0B,EAC1B,kBAAkB,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAA;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAA;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAA;AACxD,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA"}
@@ -0,0 +1,13 @@
1
+ import { createMutators } from './mutators';
2
+ import { schema, zeroTables } from './schema';
3
+ export const marcoZero = {
4
+ createMutators,
5
+ schema,
6
+ tables: zeroTables,
7
+ };
8
+ export { createMutators, ZeroMutatorValidationError, zeroMutatorSchemas, } from './mutators';
9
+ export { accountMutatorDefinitions } from './mutators/account';
10
+ export { draftMutatorDefinitions } from './mutators/draft';
11
+ export { threadMutatorDefinitions } from './mutators/thread';
12
+ export { userMutatorDefinitions } from './mutators/user';
13
+ export { schema, zeroTables } from './schema';
@@ -1,18 +1,15 @@
1
1
  import * as v from 'valibot';
2
- export declare const syncPushAccount: import("../../../../..").EndpointConfig<"/v1/pv/sync/push/account", v.ObjectSchema<{
3
- readonly clientGroupID: v.StringSchema<undefined>;
4
- readonly mutations: v.ArraySchema<v.UnionSchema<(v.ObjectSchema<{
5
- readonly args: v.ObjectSchema<{
2
+ export declare const accountMutatorDefinitions: {
3
+ readonly createAccount: {
4
+ readonly delta: v.ObjectSchema<{
6
5
  readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
7
6
  readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
8
7
  readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
9
8
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
10
9
  }, undefined>;
11
- readonly clientID: v.StringSchema<undefined>;
12
- readonly id: v.NumberSchema<undefined>;
13
- readonly name: v.LiteralSchema<"createAccount", undefined>;
14
- }, undefined> | v.ObjectSchema<{
15
- readonly args: v.ObjectSchema<{
10
+ };
11
+ readonly createAlias: {
12
+ readonly delta: v.ObjectSchema<{
16
13
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
17
14
  readonly alias: v.ObjectSchema<{
18
15
  readonly emailAddress: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
@@ -20,43 +17,33 @@ export declare const syncPushAccount: import("../../../../..").EndpointConfig<"/
20
17
  readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
21
18
  }, undefined>;
22
19
  }, undefined>;
23
- readonly clientID: v.StringSchema<undefined>;
24
- readonly id: v.NumberSchema<undefined>;
25
- readonly name: v.LiteralSchema<"createAlias", undefined>;
26
- }, undefined> | v.ObjectSchema<{
27
- readonly args: v.ObjectSchema<{
20
+ };
21
+ readonly deleteAccount: {
22
+ readonly delta: v.ObjectSchema<{
28
23
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
29
24
  }, undefined>;
30
- readonly clientID: v.StringSchema<undefined>;
31
- readonly id: v.NumberSchema<undefined>;
32
- readonly name: v.LiteralSchema<"deleteAccount", undefined>;
33
- }, undefined> | v.ObjectSchema<{
34
- readonly args: v.ObjectSchema<{
25
+ };
26
+ readonly deleteAlias: {
27
+ readonly delta: v.ObjectSchema<{
35
28
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
36
29
  readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
37
30
  }, undefined>;
38
- readonly clientID: v.StringSchema<undefined>;
39
- readonly id: v.NumberSchema<undefined>;
40
- readonly name: v.LiteralSchema<"deleteAlias", undefined>;
41
- }, undefined> | v.ObjectSchema<{
42
- readonly args: v.ObjectSchema<{
31
+ };
32
+ readonly setAliasName: {
33
+ readonly delta: v.ObjectSchema<{
43
34
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
44
35
  readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
45
36
  readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
46
37
  }, undefined>;
47
- readonly clientID: v.StringSchema<undefined>;
48
- readonly id: v.NumberSchema<undefined>;
49
- readonly name: v.LiteralSchema<"setAliasName", undefined>;
50
- }, undefined> | v.ObjectSchema<{
51
- readonly args: v.ObjectSchema<{
38
+ };
39
+ readonly setAliasPrimary: {
40
+ readonly delta: v.ObjectSchema<{
52
41
  readonly accountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
53
42
  readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
54
43
  }, undefined>;
55
- readonly clientID: v.StringSchema<undefined>;
56
- readonly id: v.NumberSchema<undefined>;
57
- readonly name: v.LiteralSchema<"setAliasPrimary", undefined>;
58
- }, undefined> | v.ObjectSchema<{
59
- readonly args: v.ObjectSchema<{
44
+ };
45
+ readonly setConnectionConfigImapRaw: {
46
+ readonly delta: v.ObjectSchema<{
60
47
  readonly connectionConfig: v.ObjectSchema<{
61
48
  readonly imapHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
62
49
  readonly imapPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -71,28 +58,24 @@ export declare const syncPushAccount: import("../../../../..").EndpointConfig<"/
71
58
  }, undefined>;
72
59
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
73
60
  }, undefined>;
74
- readonly clientID: v.StringSchema<undefined>;
75
- readonly id: v.NumberSchema<undefined>;
76
- readonly name: v.LiteralSchema<"setConnectionConfigImapRaw", undefined>;
77
- }, undefined> | v.ObjectSchema<{
78
- readonly args: v.ObjectSchema<{
61
+ };
62
+ readonly setConnectionConfigOauth: {
63
+ readonly delta: v.ObjectSchema<{
79
64
  readonly connectionConfig: v.ObjectSchema<{
80
65
  readonly code: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
81
- readonly provider: v.UnionSchema<[v.LiteralSchema<"GOOGLE", undefined>, v.LiteralSchema<"OUTLOOK", undefined>], undefined>;
66
+ readonly provider: v.PicklistSchema<readonly ["GOOGLE", "OUTLOOK"], undefined>;
82
67
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
83
68
  }, undefined>;
84
69
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
85
70
  }, undefined>;
86
- readonly clientID: v.StringSchema<undefined>;
87
- readonly id: v.NumberSchema<undefined>;
88
- readonly name: v.LiteralSchema<"setConnectionConfigOauth", undefined>;
89
- }, undefined> | v.ObjectSchema<{
90
- readonly args: v.ObjectSchema<{
71
+ };
72
+ readonly setSettings: {
73
+ readonly delta: v.ObjectSchema<{
91
74
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
92
75
  readonly settings: Omit<v.ObjectSchema<{
93
76
  readonly color: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
94
77
  readonly name: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
95
- }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
78
+ }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
96
79
  readonly entries: {
97
80
  readonly color: v.OptionalSchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
98
81
  readonly name: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>, undefined>;
@@ -107,7 +90,7 @@ export declare const syncPushAccount: import("../../../../..").EndpointConfig<"/
107
90
  readonly '~run': (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
108
91
  color?: string | undefined;
109
92
  name?: string | null | undefined;
110
- }, v.ObjectIssue | v.StringIssue | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>>;
93
+ }, v.StringIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.NonOptionalIssue>;
111
94
  readonly '~types'?: {
112
95
  readonly input: {
113
96
  color?: string | undefined;
@@ -117,35 +100,10 @@ export declare const syncPushAccount: import("../../../../..").EndpointConfig<"/
117
100
  color?: string | undefined;
118
101
  name?: string | null | undefined;
119
102
  };
120
- readonly issue: v.ObjectIssue | v.StringIssue | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>;
103
+ readonly issue: v.StringIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.NonOptionalIssue;
121
104
  } | undefined;
122
105
  };
123
106
  }, undefined>;
124
- readonly clientID: v.StringSchema<undefined>;
125
- readonly id: v.NumberSchema<undefined>;
126
- readonly name: v.LiteralSchema<"setSettings", undefined>;
127
- }, undefined>)[], undefined>, undefined>;
128
- }, undefined>, v.GenericSchema | undefined, v.UnionSchema<[v.ObjectSchema<{
129
- readonly data: v.ObjectSchema<{
130
- readonly code: v.LiteralSchema<"VALIDATION_FAILED", undefined>;
131
- readonly issues: v.ObjectSchema<{
132
- readonly nested: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
133
- readonly other: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
134
- readonly root: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
135
- }, undefined>;
136
- }, undefined>;
137
- readonly status: v.LiteralSchema<400, undefined>;
138
- }, undefined>, v.ObjectSchema<{
139
- readonly data: v.ObjectSchema<{
140
- readonly code: v.LiteralSchema<"MUTATION_REJECTED", undefined>;
141
- }, undefined>;
142
- readonly status: v.LiteralSchema<409, undefined>;
143
- }, undefined>, v.ObjectSchema<{
144
- readonly data: v.ObjectSchema<{
145
- readonly code: v.LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
146
- }, undefined>;
147
- readonly status: v.LiteralSchema<401, undefined>;
148
- }, undefined>, v.ObjectSchema<{
149
- readonly status: v.LiteralSchema<200, undefined>;
150
- }, undefined>], undefined>>;
107
+ };
108
+ };
151
109
  //# sourceMappingURL=account.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/account.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAe5B,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyD5B,CAAA"}
@@ -0,0 +1,69 @@
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 accountAliasSchema = v.object({
8
+ emailAddress: marcoSchemas.string.email(),
9
+ id: marcoSchemas.string.required(),
10
+ name: marcoSchemas.string.nullable(),
11
+ });
12
+ export const accountMutatorDefinitions = {
13
+ createAccount: {
14
+ delta: v.object({
15
+ aliasId: marcoSchemas.string.required(),
16
+ color: marcoSchemas.string.required(),
17
+ emailAddress: marcoSchemas.string.email(),
18
+ id: marcoSchemas.string.required(),
19
+ }),
20
+ },
21
+ createAlias: {
22
+ delta: v.object({
23
+ accountId: marcoSchemas.string.required(),
24
+ alias: accountAliasSchema,
25
+ }),
26
+ },
27
+ deleteAccount: {
28
+ delta: v.object({
29
+ id: marcoSchemas.string.required(),
30
+ }),
31
+ },
32
+ deleteAlias: {
33
+ delta: v.object({
34
+ accountId: marcoSchemas.string.required(),
35
+ aliasId: marcoSchemas.string.required(),
36
+ }),
37
+ },
38
+ setAliasName: {
39
+ delta: v.object({
40
+ accountId: marcoSchemas.string.required(),
41
+ aliasId: marcoSchemas.string.required(),
42
+ name: marcoSchemas.string.nullable(),
43
+ }),
44
+ },
45
+ setAliasPrimary: {
46
+ delta: v.object({
47
+ accountId: marcoSchemas.string.required(),
48
+ aliasId: marcoSchemas.string.required(),
49
+ }),
50
+ },
51
+ setConnectionConfigImapRaw: {
52
+ delta: v.object({
53
+ connectionConfig: marcoSchemas.emailAccount.connectionConfigImapRaw(),
54
+ id: marcoSchemas.string.required(),
55
+ }),
56
+ },
57
+ setConnectionConfigOauth: {
58
+ delta: v.object({
59
+ connectionConfig: marcoSchemas.emailAccount.connectionConfigOauth(),
60
+ id: marcoSchemas.string.required(),
61
+ }),
62
+ },
63
+ setSettings: {
64
+ delta: v.object({
65
+ id: marcoSchemas.string.required(),
66
+ settings: v.partial(accountSettingsSchema),
67
+ }),
68
+ },
69
+ };
@@ -1,16 +1,13 @@
1
1
  import * as v from 'valibot';
2
- export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1/pv/sync/push/draft", v.ObjectSchema<{
3
- readonly clientGroupID: v.StringSchema<undefined>;
4
- readonly mutations: v.ArraySchema<v.UnionSchema<(v.ObjectSchema<{
5
- readonly args: v.ObjectSchema<{
2
+ export declare const draftMutatorDefinitions: {
3
+ readonly cancelSend: {
4
+ readonly delta: v.ObjectSchema<{
6
5
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
7
6
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
8
7
  }, undefined>;
9
- readonly clientID: v.StringSchema<undefined>;
10
- readonly id: v.NumberSchema<undefined>;
11
- readonly name: v.LiteralSchema<"cancelSend", undefined>;
12
- }, undefined> | v.ObjectSchema<{
13
- readonly args: v.ObjectSchema<{
8
+ };
9
+ readonly createAttachment: {
10
+ readonly delta: v.ObjectSchema<{
14
11
  readonly attachment: v.ObjectSchema<{
15
12
  readonly failed: v.BooleanSchema<undefined>;
16
13
  readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -23,11 +20,9 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
23
20
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
24
21
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
25
22
  }, undefined>;
26
- readonly clientID: v.StringSchema<undefined>;
27
- readonly id: v.NumberSchema<undefined>;
28
- readonly name: v.LiteralSchema<"createAttachment", undefined>;
29
- }, undefined> | v.ObjectSchema<{
30
- readonly args: v.ObjectSchema<{
23
+ };
24
+ readonly createDraft: {
25
+ readonly delta: v.ObjectSchema<{
31
26
  readonly attachments: v.ArraySchema<v.ObjectSchema<{
32
27
  readonly failed: v.BooleanSchema<undefined>;
33
28
  readonly fileName: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
@@ -55,27 +50,21 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
55
50
  readonly type: v.PicklistSchema<readonly ["NEW", "REPLY", "FORWARD"], undefined>;
56
51
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
57
52
  }, undefined>;
58
- readonly clientID: v.StringSchema<undefined>;
59
- readonly id: v.NumberSchema<undefined>;
60
- readonly name: v.LiteralSchema<"createDraft", undefined>;
61
- }, undefined> | v.ObjectSchema<{
62
- readonly args: v.ObjectSchema<{
53
+ };
54
+ readonly deleteAttachment: {
55
+ readonly delta: v.ObjectSchema<{
63
56
  readonly attachmentId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
64
57
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
65
58
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
66
59
  }, undefined>;
67
- readonly clientID: v.StringSchema<undefined>;
68
- readonly id: v.NumberSchema<undefined>;
69
- readonly name: v.LiteralSchema<"deleteAttachment", undefined>;
70
- }, undefined> | v.ObjectSchema<{
71
- readonly args: v.ObjectSchema<{
60
+ };
61
+ readonly deleteDraft: {
62
+ readonly delta: v.ObjectSchema<{
72
63
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
73
64
  }, undefined>;
74
- readonly clientID: v.StringSchema<undefined>;
75
- readonly id: v.NumberSchema<undefined>;
76
- readonly name: v.LiteralSchema<"deleteDraft", undefined>;
77
- }, undefined> | v.ObjectSchema<{
78
- readonly args: v.UnionSchema<[v.ObjectSchema<{
65
+ };
66
+ readonly scheduleSend: {
67
+ readonly delta: v.UnionSchema<[v.ObjectSchema<{
79
68
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
80
69
  readonly kind: v.LiteralSchema<"IMMEDIATE", undefined>;
81
70
  readonly undoMs: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
@@ -86,11 +75,9 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
86
75
  readonly scheduledFor: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
87
76
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
88
77
  }, undefined>], undefined>;
89
- readonly clientID: v.StringSchema<undefined>;
90
- readonly id: v.NumberSchema<undefined>;
91
- readonly name: v.LiteralSchema<"scheduleSend", undefined>;
92
- }, undefined> | v.ObjectSchema<{
93
- readonly args: v.ObjectSchema<{
78
+ };
79
+ readonly setContent: {
80
+ readonly delta: v.ObjectSchema<{
94
81
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
95
82
  readonly patch: v.ArraySchema<v.ObjectSchema<{
96
83
  readonly index: v.NumberSchema<undefined>;
@@ -99,18 +86,16 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
99
86
  }, undefined>, undefined>;
100
87
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
101
88
  }, undefined>;
102
- readonly clientID: v.StringSchema<undefined>;
103
- readonly id: v.NumberSchema<undefined>;
104
- readonly name: v.LiteralSchema<"setContent", undefined>;
105
- }, undefined> | v.ObjectSchema<{
106
- readonly args: v.ObjectSchema<{
89
+ };
90
+ readonly setEnvelope: {
91
+ readonly delta: v.ObjectSchema<{
107
92
  readonly envelope: Omit<v.ObjectSchema<{
108
93
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
109
94
  readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
110
95
  readonly content: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 384000, undefined>]>;
111
96
  readonly subject: v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
112
97
  readonly to: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
113
- }, undefined>, "~types" | "~run" | "~standard" | "entries"> & {
98
+ }, undefined>, "~standard" | "~run" | "~types" | "entries"> & {
114
99
  readonly entries: Omit<{
115
100
  readonly bcc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
116
101
  readonly cc: v.ArraySchema<v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
@@ -134,7 +119,7 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
134
119
  cc: string[];
135
120
  to: string[];
136
121
  subject: string | null;
137
- }, v.ObjectIssue | v.StringIssue | v.ArrayIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>>;
122
+ }, v.StringIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.ArrayIssue | v.NonOptionalIssue>;
138
123
  readonly '~types'?: {
139
124
  readonly input: {
140
125
  bcc: string[];
@@ -148,17 +133,15 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
148
133
  to: string[];
149
134
  subject: string | null;
150
135
  };
151
- readonly issue: v.ObjectIssue | v.StringIssue | v.ArrayIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonOptionalIssue | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number>;
136
+ readonly issue: v.StringIssue | v.EmailIssue<string> | v.MaxLengthIssue<string, 255> | v.NonEmptyIssue<string> | v.MaxLengthIssue<string, number> | v.ObjectIssue | v.ArrayIssue | v.NonOptionalIssue;
152
137
  } | undefined;
153
138
  };
154
139
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
155
140
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
156
141
  }, undefined>;
157
- readonly clientID: v.StringSchema<undefined>;
158
- readonly id: v.NumberSchema<undefined>;
159
- readonly name: v.LiteralSchema<"setEnvelope", undefined>;
160
- }, undefined> | v.ObjectSchema<{
161
- readonly args: v.ObjectSchema<{
142
+ };
143
+ readonly setFrom: {
144
+ readonly delta: v.ObjectSchema<{
162
145
  readonly aliasId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
163
146
  readonly emailAccountId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
164
147
  readonly from: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.EmailAction<string, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>;
@@ -166,41 +149,14 @@ export declare const syncPushDraft: import("../../../../..").EndpointConfig<"/v1
166
149
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
167
150
  readonly updatedAt: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
168
151
  }, undefined>;
169
- readonly clientID: v.StringSchema<undefined>;
170
- readonly id: v.NumberSchema<undefined>;
171
- readonly name: v.LiteralSchema<"setFrom", undefined>;
172
- }, undefined> | v.ObjectSchema<{
173
- readonly args: v.ObjectSchema<{
152
+ };
153
+ readonly uploadAttachmentChunk: {
154
+ readonly delta: v.ObjectSchema<{
174
155
  readonly attachmentId: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
175
156
  readonly chunk: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.Base64Action<string, undefined>]>;
176
157
  readonly chunkIndex: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
177
158
  readonly id: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
178
159
  }, undefined>;
179
- readonly clientID: v.StringSchema<undefined>;
180
- readonly id: v.NumberSchema<undefined>;
181
- readonly name: v.LiteralSchema<"uploadAttachmentChunk", undefined>;
182
- }, undefined>)[], undefined>, undefined>;
183
- }, undefined>, v.GenericSchema | undefined, v.UnionSchema<[v.ObjectSchema<{
184
- readonly data: v.ObjectSchema<{
185
- readonly code: v.LiteralSchema<"VALIDATION_FAILED", undefined>;
186
- readonly issues: v.ObjectSchema<{
187
- readonly nested: v.OptionalSchema<v.RecordSchema<v.StringSchema<undefined>, v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>, undefined>, undefined>;
188
- readonly other: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
189
- readonly root: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
190
- }, undefined>;
191
- }, undefined>;
192
- readonly status: v.LiteralSchema<400, undefined>;
193
- }, undefined>, v.ObjectSchema<{
194
- readonly data: v.ObjectSchema<{
195
- readonly code: v.LiteralSchema<"MUTATION_REJECTED", undefined>;
196
- }, undefined>;
197
- readonly status: v.LiteralSchema<409, undefined>;
198
- }, undefined>, v.ObjectSchema<{
199
- readonly data: v.ObjectSchema<{
200
- readonly code: v.LiteralSchema<"AUTHENTICATION_FAILED", undefined>;
201
- }, undefined>;
202
- readonly status: v.LiteralSchema<401, undefined>;
203
- }, undefined>, v.ObjectSchema<{
204
- readonly status: v.LiteralSchema<200, undefined>;
205
- }, undefined>], undefined>>;
160
+ };
161
+ };
206
162
  //# sourceMappingURL=draft.d.ts.map
@@ -1 +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"}
1
+ {"version":3,"file":"draft.d.ts","sourceRoot":"","sources":["../../../src/zero/mutators/draft.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAwD5B,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgE1B,CAAA"}
@@ -0,0 +1,114 @@
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 draftBodySchema = 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 draftAttachmentSchema = 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 draftScheduleSchema = v.union([
23
+ v.object({
24
+ id: marcoSchemas.string.required(),
25
+ kind: v.literal('IMMEDIATE'),
26
+ undoMs: marcoSchemas.number.positiveInteger(),
27
+ updatedAt: marcoSchemas.number.positiveInteger(),
28
+ }),
29
+ v.object({
30
+ id: marcoSchemas.string.required(),
31
+ kind: v.literal('SCHEDULED'),
32
+ scheduledFor: marcoSchemas.number.positiveInteger(),
33
+ updatedAt: marcoSchemas.number.positiveInteger(),
34
+ }),
35
+ ]);
36
+ const draftModelSchema = v.object({
37
+ attachments: v.array(draftAttachmentSchema),
38
+ body: draftBodySchema,
39
+ emailAccountId: marcoSchemas.string.required(),
40
+ error: marcoSchemas.string.nullable(),
41
+ from: marcoSchemas.string.email(),
42
+ fromName: marcoSchemas.string.nullable(),
43
+ id: marcoSchemas.string.required(),
44
+ referencedMessageId: marcoSchemas.string.nullable(),
45
+ scheduledFor: v.nullable(marcoSchemas.number.positiveInteger()),
46
+ status: draftStatusSchema,
47
+ type: draftTypeSchema,
48
+ updatedAt: marcoSchemas.number.positiveInteger(),
49
+ });
50
+ export const draftMutatorDefinitions = {
51
+ cancelSend: {
52
+ delta: v.object({
53
+ id: marcoSchemas.string.required(),
54
+ updatedAt: marcoSchemas.number.positiveInteger(),
55
+ }),
56
+ },
57
+ createAttachment: {
58
+ delta: v.object({
59
+ attachment: draftAttachmentSchema,
60
+ id: marcoSchemas.string.required(),
61
+ updatedAt: marcoSchemas.number.positiveInteger(),
62
+ }),
63
+ },
64
+ createDraft: {
65
+ delta: draftModelSchema,
66
+ },
67
+ deleteAttachment: {
68
+ delta: v.object({
69
+ attachmentId: marcoSchemas.string.required(),
70
+ id: marcoSchemas.string.required(),
71
+ updatedAt: marcoSchemas.number.positiveInteger(),
72
+ }),
73
+ },
74
+ deleteDraft: {
75
+ delta: v.object({
76
+ id: marcoSchemas.string.required(),
77
+ }),
78
+ },
79
+ scheduleSend: {
80
+ delta: draftScheduleSchema,
81
+ },
82
+ setContent: {
83
+ delta: v.object({
84
+ id: marcoSchemas.string.required(),
85
+ patch: marcoSchemas.drafts.contentPatch.patch(),
86
+ updatedAt: marcoSchemas.number.positiveInteger(),
87
+ }),
88
+ },
89
+ setEnvelope: {
90
+ delta: v.object({
91
+ envelope: v.omit(draftBodySchema, ['content']),
92
+ id: marcoSchemas.string.required(),
93
+ updatedAt: marcoSchemas.number.positiveInteger(),
94
+ }),
95
+ },
96
+ setFrom: {
97
+ delta: v.object({
98
+ aliasId: marcoSchemas.string.required(),
99
+ emailAccountId: marcoSchemas.string.required(),
100
+ from: marcoSchemas.string.email(),
101
+ fromName: marcoSchemas.string.nullable(),
102
+ id: marcoSchemas.string.required(),
103
+ updatedAt: marcoSchemas.number.positiveInteger(),
104
+ }),
105
+ },
106
+ uploadAttachmentChunk: {
107
+ delta: v.object({
108
+ attachmentId: marcoSchemas.string.required(),
109
+ chunk: v.pipe(v.string(), v.base64()),
110
+ chunkIndex: marcoSchemas.number.positiveInteger(),
111
+ id: marcoSchemas.string.required(),
112
+ }),
113
+ },
114
+ };