@marcoappio/marco-config 4.0.15 → 4.0.17

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 (72) hide show
  1. package/dist/appwrite/appwrite.d.ts.map +1 -1
  2. package/dist/appwrite/appwrite.js +15 -23
  3. package/dist/appwrite/appwrite.test.js +31 -11
  4. package/dist/appwrite/commands.d.ts +20 -20
  5. package/dist/appwrite/functions.d.ts +10 -10
  6. package/dist/appwrite/tableContract/identity.d.ts +0 -235
  7. package/dist/appwrite/tableContract/identity.d.ts.map +1 -1
  8. package/dist/appwrite/tableContract/identity.js +122 -146
  9. package/dist/appwrite/tableContract/index.d.ts +0 -92
  10. package/dist/appwrite/tableContract/index.d.ts.map +1 -1
  11. package/dist/appwrite/tableContract/index.js +18 -5
  12. package/dist/appwrite/tableContract/index.test.js +36 -0
  13. package/dist/appwrite/tableContract/mailbox.d.ts +0 -323
  14. package/dist/appwrite/tableContract/mailbox.d.ts.map +1 -1
  15. package/dist/appwrite/tableContract/mailbox.js +159 -180
  16. package/dist/appwrite/tableContract/operational.d.ts +0 -275
  17. package/dist/appwrite/tableContract/operational.d.ts.map +1 -1
  18. package/dist/appwrite/tableContract/operational.js +154 -178
  19. package/dist/appwrite/tableContract/shared.d.ts +13 -6
  20. package/dist/appwrite/tableContract/shared.d.ts.map +1 -1
  21. package/dist/appwrite/tableContract/shared.js +1 -1
  22. package/dist/index.d.ts +1 -1
  23. package/dist/index.d.ts.map +1 -1
  24. package/dist/index.js +1 -1
  25. package/dist/index.test.js +11 -0
  26. package/dist/schemas/app.d.ts +1 -1
  27. package/dist/schemas/app.js +1 -1
  28. package/dist/schemas/emailAccount.d.ts +4 -4
  29. package/dist/schemas/emailAccount.d.ts.map +1 -1
  30. package/dist/schemas/emailAccount.js +5 -5
  31. package/dist/schemas/index.d.ts +9 -27
  32. package/dist/schemas/index.d.ts.map +1 -1
  33. package/dist/schemas/index.js +1 -2
  34. package/dist/schemas/models/index.d.ts +1 -1
  35. package/dist/schemas/models/index.d.ts.map +1 -1
  36. package/dist/schemas/models/index.js +1 -1
  37. package/dist/schemas/models/thread.d.ts +1 -19
  38. package/dist/schemas/models/thread.d.ts.map +1 -1
  39. package/dist/schemas/models/thread.js +0 -1
  40. package/dist/schemas/models/user.d.ts +1 -1
  41. package/dist/schemas/models/user.test.js +7 -0
  42. package/dist/schemas/oauth.d.ts +1 -1
  43. package/dist/schemas/oauth.js +1 -1
  44. package/dist/schemas/pushNotifications.d.ts +2 -2
  45. package/dist/schemas/pushNotifications.d.ts.map +1 -1
  46. package/dist/schemas/pushNotifications.js +1 -2
  47. package/dist/schemas/schemaValues.test.d.ts +2 -0
  48. package/dist/schemas/schemaValues.test.d.ts.map +1 -0
  49. package/dist/schemas/schemaValues.test.js +21 -0
  50. package/dist/types/UserSettings.d.ts +16 -15
  51. package/dist/types/UserSettings.d.ts.map +1 -1
  52. package/dist/types/UserSettings.js +15 -29
  53. package/dist/utils/accounts/index.d.ts +1 -3
  54. package/dist/utils/accounts/index.d.ts.map +1 -1
  55. package/dist/utils/accounts/index.js +1 -4
  56. package/dist/utils/index.d.ts +3 -3
  57. package/dist/utils/index.d.ts.map +1 -1
  58. package/dist/utils/index.js +3 -3
  59. package/dist/utils/labels/index.d.ts +2 -3
  60. package/dist/utils/labels/index.d.ts.map +1 -1
  61. package/dist/utils/labels/index.js +1 -4
  62. package/dist/utils/threads/index.d.ts +2 -4
  63. package/dist/utils/threads/index.d.ts.map +1 -1
  64. package/dist/utils/threads/index.js +2 -6
  65. package/dist/utils/threads/parseLabelIdList/parseLabelIdList.test.js +1 -1
  66. package/package.json +1 -1
  67. package/dist/utils/threads/parseLabelIdList/index.d.ts +0 -2
  68. package/dist/utils/threads/parseLabelIdList/index.d.ts.map +0 -1
  69. package/dist/utils/threads/parseLabelIdList/index.js +0 -1
  70. package/dist/utils/threads/processSearchTerm/index.d.ts +0 -2
  71. package/dist/utils/threads/processSearchTerm/index.d.ts.map +0 -1
  72. package/dist/utils/threads/processSearchTerm/index.js +0 -1
@@ -1,191 +1,167 @@
1
1
  import * as v from 'valibot';
2
2
  /* oxlint-disable eslint/sort-keys */
3
- import { accountProviders, appwriteColumnDefinitions, appwriteIds, appwriteRelationship, appwriteRelationshipIdSchema, canonicalTimestampSchema, commandStates, defineAppwriteTable, identifierSchema, jobStates, labelSpecialUses, mailboxSortKeySchema, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, nonNegativeIntegerSchema, positiveIntegerSchema, pollShardStates, isoTimestampSchema, } from './shared';
3
+ import { accountProviders, appwriteColumnDefinitions, appwriteRelationship, appwriteRelationshipIdSchema, canonicalTimestampSchema, commandStates, defineAppwriteTableGroup, identifierSchema, jobStates, labelSpecialUses, mailboxSortKeySchema, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, nonNegativeIntegerSchema, positiveIntegerSchema, pollShardStates, isoTimestampSchema, } from './shared';
4
4
  const { bigint, dateTime, enumValue, identifier, integer, longText, string: stringColumn, stringArray, text } = appwriteColumnDefinitions;
5
- export const mailboxSyncCandidatesTable = defineAppwriteTable({
6
- fields: {
7
- userId: identifier(identifierSchema),
8
- accountId: identifier(identifierSchema),
9
- generation: integer(nonNegativeIntegerSchema),
10
- lane: enumValue(v.picklist(mailboxSyncLanes), mailboxSyncLanes),
11
- labelId: identifier(identifierSchema),
12
- mailboxPath: stringColumn(identifierSchema),
13
- mailboxPriority: integer(nonNegativeIntegerSchema),
14
- mailboxSortKey: stringColumn(mailboxSortKeySchema, true, 257),
15
- providerId: stringColumn(identifierSchema),
16
- receivedAt: dateTime(isoTimestampSchema),
17
- specialUse: enumValue(v.nullable(v.picklist(labelSpecialUses)), labelSpecialUses, false),
18
- uid: bigint(positiveIntegerSchema),
19
- uidValidity: bigint(positiveIntegerSchema),
20
- account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
21
- label: appwriteRelationship(appwriteRelationshipIdSchema, 'labels'),
5
+ export const operationalTableInputs = defineAppwriteTableGroup({
6
+ commands: {
7
+ fields: {
8
+ userId: stringColumn(identifierSchema),
9
+ accountId: stringColumn(v.nullable(identifierSchema), false),
10
+ draftId: identifier(v.nullable(identifierSchema), false),
11
+ kind: stringColumn(identifierSchema),
12
+ payload: longText(v.string()),
13
+ payloadHash: stringColumn(identifierSchema),
14
+ state: enumValue(v.picklist(commandStates), commandStates),
15
+ attempts: integer(nonNegativeIntegerSchema),
16
+ canonicalRevision: integer(v.nullable(nonNegativeIntegerSchema), false),
17
+ errorCode: stringColumn(v.nullable(identifierSchema), false),
18
+ submittedAt: dateTime(isoTimestampSchema),
19
+ account: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'accounts', 'manyToOne', 'setNull'),
20
+ profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
21
+ },
22
+ indexes: [
23
+ { attributes: ['userId'], name: 'user', type: 'key' },
24
+ { attributes: ['userId', 'submittedAt'], name: 'user_submitted', type: 'key' },
25
+ { attributes: ['accountId', 'state'], name: 'account_state', type: 'key' },
26
+ { attributes: ['draftId', 'canonicalRevision'], name: 'draft_sequence', type: 'key' },
27
+ { attributes: ['state', 'submittedAt'], name: 'state_submitted', type: 'key' },
28
+ ],
29
+ name: 'Commands',
22
30
  },
23
- id: appwriteIds.tables.mailboxSyncCandidates,
24
- indexes: [
25
- { attributes: ['lane'], name: 'lane', type: 'key' },
26
- {
27
- attributes: ['accountId', 'lane', 'generation', 'mailboxPriority', 'receivedAt', 'labelId', 'uid', 'uidValidity'],
28
- name: 'account_lane_generation_order',
29
- type: 'key',
31
+ jobs: {
32
+ fields: {
33
+ commandId: stringColumn(identifierSchema),
34
+ userId: stringColumn(identifierSchema),
35
+ accountId: stringColumn(v.nullable(identifierSchema), false),
36
+ kind: stringColumn(identifierSchema),
37
+ payload: longText(v.string()),
38
+ dedupeKey: stringColumn(identifierSchema),
39
+ state: enumValue(v.picklist(jobStates), jobStates),
40
+ attempts: integer(nonNegativeIntegerSchema),
41
+ maxAttempts: integer(nonNegativeIntegerSchema),
42
+ nextRunAt: dateTime(canonicalTimestampSchema),
43
+ leaseId: stringColumn(v.nullable(identifierSchema), false),
44
+ leaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
45
+ errorCode: stringColumn(v.nullable(identifierSchema), false),
30
46
  },
31
- ],
32
- key: 'mailboxSyncCandidates',
33
- name: 'Mailbox sync candidates',
34
- });
35
- export const mailboxSyncLanesTable = defineAppwriteTable({
36
- fields: {
37
- userId: identifier(identifierSchema),
38
- accountId: identifier(identifierSchema),
39
- commandId: identifier(identifierSchema),
40
- cursor: text(v.nullable(v.string()), false),
41
- generation: integer(nonNegativeIntegerSchema),
42
- lane: enumValue(v.picklist(mailboxSyncLanes), mailboxSyncLanes),
43
- state: enumValue(v.picklist(mailboxSyncLaneStates), mailboxSyncLaneStates),
44
- errorCode: identifier(v.nullable(identifierSchema), false),
45
- account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
47
+ indexes: [
48
+ { attributes: ['state', 'nextRunAt'], name: 'state_next_run', type: 'key' },
49
+ { attributes: ['leaseExpiresAt'], name: 'lease_expiry', type: 'key' },
50
+ { attributes: ['state', 'leaseExpiresAt'], name: 'state_lease_expiry', type: 'key' },
51
+ { attributes: ['userId', 'state', 'leaseExpiresAt'], name: 'user_state_lease_expiry', type: 'key' },
52
+ { attributes: ['state', 'leaseExpiresAt', 'leaseId', 'attempts'], name: 'recovery_fence', type: 'key' },
53
+ { attributes: ['commandId'], name: 'command', type: 'key' },
54
+ { attributes: ['dedupeKey'], name: 'dedupe_key_unique', type: 'unique' },
55
+ { attributes: ['userId'], name: 'user', type: 'key' },
56
+ ],
57
+ name: 'Jobs',
46
58
  },
47
- id: appwriteIds.tables.mailboxSyncLanes,
48
- indexes: [
49
- { attributes: ['accountId', 'lane'], name: 'account_lane_unique', type: 'unique' },
50
- { attributes: ['lane', 'state'], name: 'lane_state', type: 'key' },
51
- ],
52
- key: 'mailboxSyncLanes',
53
- name: 'Mailbox sync lanes',
54
- wirePermissions: 'empty',
55
- });
56
- export const pollShardCoordinatorsTable = defineAppwriteTable({
57
- fields: {
58
- accountCursor: stringColumn(v.nullable(identifierSchema), false),
59
+ mailboxSyncCandidates: {
60
+ fields: {
61
+ userId: identifier(identifierSchema),
62
+ accountId: identifier(identifierSchema),
63
+ generation: integer(nonNegativeIntegerSchema),
64
+ lane: enumValue(v.picklist(mailboxSyncLanes), mailboxSyncLanes),
65
+ labelId: identifier(identifierSchema),
66
+ mailboxPath: stringColumn(identifierSchema),
67
+ mailboxPriority: integer(nonNegativeIntegerSchema),
68
+ mailboxSortKey: stringColumn(mailboxSortKeySchema, true, 257),
69
+ providerId: stringColumn(identifierSchema),
70
+ receivedAt: dateTime(isoTimestampSchema),
71
+ specialUse: enumValue(v.nullable(v.picklist(labelSpecialUses)), labelSpecialUses, false),
72
+ uid: bigint(positiveIntegerSchema),
73
+ uidValidity: bigint(positiveIntegerSchema),
74
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
75
+ label: appwriteRelationship(appwriteRelationshipIdSchema, 'labels'),
76
+ },
77
+ indexes: [
78
+ { attributes: ['lane'], name: 'lane', type: 'key' },
79
+ {
80
+ attributes: ['accountId', 'lane', 'generation', 'mailboxPriority', 'receivedAt', 'labelId', 'uid', 'uidValidity'],
81
+ name: 'account_lane_generation_order',
82
+ type: 'key',
83
+ },
84
+ ],
85
+ name: 'Mailbox sync candidates',
59
86
  },
60
- id: appwriteIds.tables.pollShardCoordinators,
61
- indexes: [],
62
- key: 'pollShardCoordinators',
63
- name: 'Poll shard coordinators',
64
- wirePermissions: 'empty',
65
- });
66
- export const mailboxSyncStatesTable = defineAppwriteTable({
67
- fields: {
68
- userId: stringColumn(identifierSchema),
69
- accountId: stringColumn(identifierSchema),
70
- provider: enumValue(v.picklist(accountProviders), accountProviders),
71
- providerCursor: text(v.nullable(v.string()), false),
72
- uidValidity: stringColumn(v.nullable(v.string()), false),
73
- state: enumValue(v.picklist(mailboxSyncProvisionedStates), mailboxSyncProvisionedStates),
74
- nextPollAt: dateTime(v.nullable(canonicalTimestampSchema), false),
75
- lastEventAt: dateTime(v.nullable(isoTimestampSchema), false),
76
- lastSyncAt: dateTime(v.nullable(isoTimestampSchema), false),
77
- materialisationLeaseId: identifier(v.nullable(identifierSchema), false),
78
- materialisationLeaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
79
- errorCode: stringColumn(v.nullable(identifierSchema), false),
87
+ mailboxSyncLanes: {
88
+ fields: {
89
+ userId: identifier(identifierSchema),
90
+ accountId: identifier(identifierSchema),
91
+ commandId: identifier(identifierSchema),
92
+ cursor: text(v.nullable(v.string()), false),
93
+ generation: integer(nonNegativeIntegerSchema),
94
+ lane: enumValue(v.picklist(mailboxSyncLanes), mailboxSyncLanes),
95
+ state: enumValue(v.picklist(mailboxSyncLaneStates), mailboxSyncLaneStates),
96
+ errorCode: identifier(v.nullable(identifierSchema), false),
97
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
98
+ },
99
+ indexes: [
100
+ { attributes: ['accountId', 'lane'], name: 'account_lane_unique', type: 'unique' },
101
+ { attributes: ['lane', 'state'], name: 'lane_state', type: 'key' },
102
+ ],
103
+ name: 'Mailbox sync lanes',
104
+ wirePermissions: 'empty',
80
105
  },
81
- id: appwriteIds.tables.mailboxSyncStates,
82
- indexes: [
83
- { attributes: ['state', 'nextPollAt'], name: 'state_next_poll', type: 'key' },
84
- { attributes: ['accountId'], name: 'account_unique', type: 'unique' },
85
- ],
86
- key: 'mailboxSyncStates',
87
- name: 'Mailbox sync states',
88
- });
89
- export const commandsTable = defineAppwriteTable({
90
- fields: {
91
- userId: stringColumn(identifierSchema),
92
- accountId: stringColumn(v.nullable(identifierSchema), false),
93
- draftId: identifier(v.nullable(identifierSchema), false),
94
- kind: stringColumn(identifierSchema),
95
- payload: longText(v.string()),
96
- payloadHash: stringColumn(identifierSchema),
97
- state: enumValue(v.picklist(commandStates), commandStates),
98
- attempts: integer(nonNegativeIntegerSchema),
99
- canonicalRevision: integer(v.nullable(nonNegativeIntegerSchema), false),
100
- errorCode: stringColumn(v.nullable(identifierSchema), false),
101
- submittedAt: dateTime(isoTimestampSchema),
102
- account: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'accounts', 'manyToOne', 'setNull'),
103
- profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
106
+ mailboxSyncStates: {
107
+ fields: {
108
+ userId: stringColumn(identifierSchema),
109
+ accountId: stringColumn(identifierSchema),
110
+ provider: enumValue(v.picklist(accountProviders), accountProviders),
111
+ providerCursor: text(v.nullable(v.string()), false),
112
+ uidValidity: stringColumn(v.nullable(v.string()), false),
113
+ state: enumValue(v.picklist(mailboxSyncProvisionedStates), mailboxSyncProvisionedStates),
114
+ nextPollAt: dateTime(v.nullable(canonicalTimestampSchema), false),
115
+ lastEventAt: dateTime(v.nullable(isoTimestampSchema), false),
116
+ lastSyncAt: dateTime(v.nullable(isoTimestampSchema), false),
117
+ materialisationLeaseId: identifier(v.nullable(identifierSchema), false),
118
+ materialisationLeaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
119
+ errorCode: stringColumn(v.nullable(identifierSchema), false),
120
+ },
121
+ indexes: [
122
+ { attributes: ['state', 'nextPollAt'], name: 'state_next_poll', type: 'key' },
123
+ { attributes: ['accountId'], name: 'account_unique', type: 'unique' },
124
+ ],
125
+ name: 'Mailbox sync states',
104
126
  },
105
- id: appwriteIds.tables.commands,
106
- indexes: [
107
- { attributes: ['userId'], name: 'user', type: 'key' },
108
- { attributes: ['userId', 'submittedAt'], name: 'user_submitted', type: 'key' },
109
- { attributes: ['accountId', 'state'], name: 'account_state', type: 'key' },
110
- { attributes: ['draftId', 'canonicalRevision'], name: 'draft_sequence', type: 'key' },
111
- { attributes: ['state', 'submittedAt'], name: 'state_submitted', type: 'key' },
112
- ],
113
- key: 'commands',
114
- name: 'Commands',
115
- });
116
- export const jobsTable = defineAppwriteTable({
117
- fields: {
118
- commandId: stringColumn(identifierSchema),
119
- userId: stringColumn(identifierSchema),
120
- accountId: stringColumn(v.nullable(identifierSchema), false),
121
- kind: stringColumn(identifierSchema),
122
- payload: longText(v.string()),
123
- dedupeKey: stringColumn(identifierSchema),
124
- state: enumValue(v.picklist(jobStates), jobStates),
125
- attempts: integer(nonNegativeIntegerSchema),
126
- maxAttempts: integer(nonNegativeIntegerSchema),
127
- nextRunAt: dateTime(canonicalTimestampSchema),
128
- leaseId: stringColumn(v.nullable(identifierSchema), false),
129
- leaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
130
- errorCode: stringColumn(v.nullable(identifierSchema), false),
127
+ pollShardCoordinators: {
128
+ fields: {
129
+ accountCursor: stringColumn(v.nullable(identifierSchema), false),
130
+ },
131
+ indexes: [],
132
+ name: 'Poll shard coordinators',
133
+ wirePermissions: 'empty',
131
134
  },
132
- id: appwriteIds.tables.jobs,
133
- indexes: [
134
- { attributes: ['state', 'nextRunAt'], name: 'state_next_run', type: 'key' },
135
- { attributes: ['leaseExpiresAt'], name: 'lease_expiry', type: 'key' },
136
- { attributes: ['state', 'leaseExpiresAt'], name: 'state_lease_expiry', type: 'key' },
137
- { attributes: ['userId', 'state', 'leaseExpiresAt'], name: 'user_state_lease_expiry', type: 'key' },
138
- { attributes: ['state', 'leaseExpiresAt', 'leaseId', 'attempts'], name: 'recovery_fence', type: 'key' },
139
- { attributes: ['commandId'], name: 'command', type: 'key' },
140
- { attributes: ['dedupeKey'], name: 'dedupe_key_unique', type: 'unique' },
141
- { attributes: ['userId'], name: 'user', type: 'key' },
142
- ],
143
- key: 'jobs',
144
- name: 'Jobs',
145
- });
146
- export const pollShardsTable = defineAppwriteTable({
147
- fields: {
148
- accountIds: stringArray(v.pipe(v.array(identifierSchema), v.maxLength(10)), true, 36),
149
- generation: integer(nonNegativeIntegerSchema),
150
- state: enumValue(v.picklist(pollShardStates), pollShardStates),
151
- leaseId: identifier(v.nullable(identifierSchema), false),
152
- leaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
153
- lastStartedAt: dateTime(v.nullable(isoTimestampSchema), false),
154
- nextStartAt: dateTime(canonicalTimestampSchema),
155
- pollingSnapshot: longText(v.string()),
156
- scheduledExecutionId: identifier(v.nullable(identifierSchema), false),
157
- errorCode: identifier(v.nullable(identifierSchema), false),
135
+ pollShards: {
136
+ fields: {
137
+ accountIds: stringArray(v.pipe(v.array(identifierSchema), v.maxLength(10)), true, 36),
138
+ generation: integer(nonNegativeIntegerSchema),
139
+ state: enumValue(v.picklist(pollShardStates), pollShardStates),
140
+ leaseId: identifier(v.nullable(identifierSchema), false),
141
+ leaseExpiresAt: dateTime(v.nullable(canonicalTimestampSchema), false),
142
+ lastStartedAt: dateTime(v.nullable(isoTimestampSchema), false),
143
+ nextStartAt: dateTime(canonicalTimestampSchema),
144
+ pollingSnapshot: longText(v.string()),
145
+ scheduledExecutionId: identifier(v.nullable(identifierSchema), false),
146
+ errorCode: identifier(v.nullable(identifierSchema), false),
147
+ },
148
+ indexes: [
149
+ { attributes: ['state', 'nextStartAt'], name: 'state_next_start', type: 'key' },
150
+ { attributes: ['leaseExpiresAt'], name: 'lease_expiry', type: 'key' },
151
+ ],
152
+ name: 'Poll shards',
153
+ wirePermissions: 'empty',
158
154
  },
159
- id: appwriteIds.tables.pollShards,
160
- indexes: [
161
- { attributes: ['state', 'nextStartAt'], name: 'state_next_start', type: 'key' },
162
- { attributes: ['leaseExpiresAt'], name: 'lease_expiry', type: 'key' },
163
- ],
164
- key: 'pollShards',
165
- name: 'Poll shards',
166
- wirePermissions: 'empty',
167
- });
168
- export const pushNotificationTokensTable = defineAppwriteTable({
169
- fields: {
170
- userId: stringColumn(identifierSchema),
171
- token: stringColumn(identifierSchema),
172
- profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
155
+ pushNotificationTokens: {
156
+ fields: {
157
+ userId: stringColumn(identifierSchema),
158
+ token: stringColumn(identifierSchema),
159
+ profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
160
+ },
161
+ indexes: [
162
+ { attributes: ['userId'], name: 'user', type: 'key' },
163
+ { attributes: ['token'], name: 'token_unique', type: 'unique' },
164
+ ],
165
+ name: 'Push notification tokens',
173
166
  },
174
- id: appwriteIds.tables.pushNotificationTokens,
175
- indexes: [
176
- { attributes: ['userId'], name: 'user', type: 'key' },
177
- { attributes: ['token'], name: 'token_unique', type: 'unique' },
178
- ],
179
- key: 'pushNotificationTokens',
180
- name: 'Push notification tokens',
181
167
  });
182
- export const operationalTableInputs = {
183
- commands: commandsTable,
184
- jobs: jobsTable,
185
- mailboxSyncCandidates: mailboxSyncCandidatesTable,
186
- mailboxSyncLanes: mailboxSyncLanesTable,
187
- mailboxSyncStates: mailboxSyncStatesTable,
188
- pollShardCoordinators: pollShardCoordinatorsTable,
189
- pollShards: pollShardsTable,
190
- pushNotificationTokens: pushNotificationTokensTable,
191
- };
@@ -79,8 +79,8 @@ export type AppwriteColumnDefinition = ReadonlyDeep<{
79
79
  size?: number;
80
80
  type: AppwriteColumnType;
81
81
  }>;
82
- export type AppwriteIndexDefinition = ReadonlyDeep<{
83
- attributes: readonly string[];
82
+ export type AppwriteIndexDefinition<TAttribute extends string = string> = ReadonlyDeep<{
83
+ attributes: readonly TAttribute[];
84
84
  name: string;
85
85
  type: AppwriteIndexType;
86
86
  }>;
@@ -111,15 +111,22 @@ export type AppwriteRelationshipSchema<TSchema extends v.GenericSchema = v.Gener
111
111
  readonly definition: AppwriteRelationshipDefinitionInput;
112
112
  };
113
113
  export type AppwriteTableFields = Readonly<Record<string, AppwriteColumnSchema | AppwriteRelationshipSchema>>;
114
+ type AppwriteIndexableFieldKey<TFields extends AppwriteTableFields> = {
115
+ [TKey in keyof TFields]: TFields[TKey] extends AppwriteRelationshipSchema ? never : TKey;
116
+ }[keyof TFields] & string;
114
117
  export type AppwriteTableInput<TFields extends AppwriteTableFields = AppwriteTableFields> = Readonly<{
115
118
  dataCheck?: (input: unknown) => boolean;
116
119
  fields: TFields;
117
- id: string;
118
- indexes: readonly AppwriteIndexDefinition[];
119
- key: AppwriteTableKey;
120
+ readonly indexes: readonly AppwriteIndexDefinition<AppwriteIndexableFieldKey<TFields>>[];
120
121
  name: string;
121
122
  wirePermissions?: 'empty';
122
123
  }>;
124
+ type AppwriteTableGroupShape = Readonly<Record<string, AppwriteTableInput>>;
125
+ type AppwriteTableGroupConstraint<TTables extends AppwriteTableGroupShape> = {
126
+ readonly [TKey in keyof TTables]: TKey extends AppwriteTableKey ? TTables[TKey] extends {
127
+ readonly fields: infer TFields extends AppwriteTableFields;
128
+ } ? AppwriteTableInput<TFields> : never : never;
129
+ };
123
130
  export declare const appwriteColumn: <const TSchema extends v.GenericSchema>(schema: TSchema, definition: AppwriteColumnDefinitionInput) => AppwriteColumnSchema<TSchema>;
124
131
  export declare const appwriteRelationship: <const TSchema extends v.GenericSchema>(schema: TSchema, relatedTable: AppwriteTableKey, type?: AppwriteRelationshipType, onDelete?: AppwriteRelationshipOnDelete) => AppwriteRelationshipSchema<TSchema>;
125
132
  export declare const appwriteColumnDefinitions: {
@@ -134,6 +141,6 @@ export declare const appwriteColumnDefinitions: {
134
141
  stringArray: <const TSchema extends v.GenericSchema>(schema: TSchema, required?: boolean, size?: number) => AppwriteColumnSchema<TSchema>;
135
142
  text: <const TSchema extends v.GenericSchema>(schema: TSchema, required?: boolean) => AppwriteColumnSchema<TSchema>;
136
143
  };
137
- export declare const defineAppwriteTable: <const TTable extends AppwriteTableInput>(table: TTable) => TTable;
144
+ export declare const defineAppwriteTableGroup: <const TTables extends AppwriteTableGroupShape>(tables: TTables & AppwriteTableGroupConstraint<TTables>) => TTables;
138
145
  export declare const messageLocationCoordinateCheck: (location: unknown) => boolean;
139
146
  //# sourceMappingURL=shared.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/appwrite/tableContract/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,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AO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO,cAAc,6BAA6B,KAAG,oBAAoB,CAAC,OAAO,CACpH,CAAA;AAE3C,eAAO,MAAM,oBAAoB,SAAU,OAAO,SAAS,CAAC,CAAC,aAAa,UAChE,OAAO,gBACD,gBAAgB,SACxB,wBAAwB,aACpB,4BAA4B,KACrC,0BAA0B,CAAC,OAAO,CAAgF,CAAA;AAErH,eAAO,MAAM,yBAAyB;mBACrB,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;oBAC/C,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;qBAC/C,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;sBAC/C,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO,YAAY,SAAS,MAAM,EAAE;uBAC5E,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;oBACnD,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;qBAC/C,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;mBAClD,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;wBAC3C,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;iBACvD,OAAO,SAAS,CAAC,CAAC,aAAa,UAAU,OAAO;CAC9D,CAAA;AAED,eAAO,MAAM,wBAAwB,SAAU,OAAO,SAAS,uBAAuB,UAAU,OAAO,GAAG,4BAA4B,CAAC,OAAO,CAAC,KAAG,OAAiB,CAAA;AAEnK,eAAO,MAAM,8BAA8B,aAAc,OAAO,YAM/D,CAAA"}
@@ -74,7 +74,7 @@ export const appwriteColumnDefinitions = {
74
74
  stringArray: (schema, required = true, size = 255) => appwriteColumn(schema, { array: true, required, size, type: 'string' }),
75
75
  text: (schema, required = true) => appwriteColumn(schema, { required, type: 'text' }),
76
76
  };
77
- export const defineAppwriteTable = (table) => table;
77
+ export const defineAppwriteTableGroup = (tables) => tables;
78
78
  export const messageLocationCoordinateCheck = (location) => {
79
79
  if (typeof location === 'object' && location !== null && 'uid' in location && 'uidValidity' in location) {
80
80
  return (location.uid === null && location.uidValidity === null) || (location.uid !== null && location.uidValidity !== null);
package/dist/index.d.ts CHANGED
@@ -2,5 +2,5 @@ export { type AppwriteCommandError, type AppwriteCommandKind, type AppwriteComma
2
2
  export { marcoConstants } from './constants';
3
3
  export { type Account, type AccountAlias, type AccountId, type AccountLabel, type AliasId, type AttachmentId, type Contact, type ContactId, type Draft, type DraftAttachment, type DraftBody, type DraftId, type JobId, type LabelId, type MessageId, marcoSchemas, type PushNotificationTokenId, type RecipientId, type Thread, type ThreadId, type ThreadMessage, type ThreadMessageAttachment, type ThreadMessageRecipient, type UserId, type UserView, type ViewId, } from './schemas';
4
4
  export * from './types';
5
- export { accountUtils, labelUtils, threadsUtils } from './utils';
5
+ export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils';
6
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC5B,KAAK,iBAAiB,EACtB,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,sBAA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Ae,GAChB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,KAAK,EACV,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,KAAK,EACV,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,YAAY,EACZ,KAAK,uBAAuB,EAC5B,KAAK,WAAW,EAChB,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,MAAM,GACZ,MAAM,WAAW,CAAA;AAClB,cAAc,SAAS,CAAA;AACvB,OAAO,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA"}
package/dist/index.js CHANGED
@@ -2,4 +2,4 @@ export { accountProviders, accountStates, appwrite, appwriteAvatar, appwriteComm
2
2
  export { marcoConstants } from './constants';
3
3
  export { marcoSchemas, } from './schemas';
4
4
  export * from './types';
5
- export { accountUtils, labelUtils, threadsUtils } from './utils';
5
+ export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils';
@@ -32,6 +32,17 @@ describe('public exports', () => {
32
32
  expect('enum' in config.marcoSchemas.string).toBe(false);
33
33
  expect('matches' in config.marcoSchemas.string).toBe(false);
34
34
  expect('optional' in config.marcoSchemas.string).toBe(false);
35
+ expect('threadListSchema' in config.marcoSchemas.models).toBe(false);
36
+ });
37
+ it('exports utility functions directly without wrapper objects', async () => {
38
+ const config = await import('./index');
39
+ expect(config.generateAccountColor).toBeTypeOf('function');
40
+ expect(config.labelSpecialUseOrdering).toEqual(['INBOX', 'SENT', 'SPAM', 'TRASH', 'ARCHIVE']);
41
+ expect(config.parseLabelIdList).toBeTypeOf('function');
42
+ expect(config.processSearchTerm).toBeTypeOf('function');
43
+ expect('accountUtils' in config).toBe(false);
44
+ expect('labelUtils' in config).toBe(false);
45
+ expect('threadsUtils' in config).toBe(false);
35
46
  });
36
47
  it('omits the Railway REST constants', async () => {
37
48
  const config = await import('./index');
@@ -1,5 +1,5 @@
1
1
  import * as v from 'valibot';
2
2
  export declare const app: {
3
- platform: () => v.PicklistSchema<readonly ["ios", "osx", "web"], undefined>;
3
+ platform: v.PicklistSchema<readonly ["ios", "osx", "web"], undefined>;
4
4
  };
5
5
  //# sourceMappingURL=app.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import * as v from 'valibot';
2
2
  import { MARCO_PLATFORM } from '../types';
3
3
  export const app = {
4
- platform: () => v.picklist(MARCO_PLATFORM),
4
+ platform: v.picklist(MARCO_PLATFORM),
5
5
  };
@@ -1,7 +1,7 @@
1
1
  import * as v from 'valibot';
2
2
  export { socketTypeSchema } from './scalars';
3
3
  export declare const emailAccount: {
4
- connectionConfigImapRaw: () => v.ObjectSchema<{
4
+ connectionConfigImapRaw: v.ObjectSchema<{
5
5
  readonly imapHost: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
6
6
  readonly imapPassword: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
7
7
  readonly imapPort: v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, v.MaxValueAction<number, 65535, undefined>]>;
@@ -13,12 +13,12 @@ export declare const emailAccount: {
13
13
  readonly smtpSocketType: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
14
14
  readonly smtpUser: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
15
15
  }, undefined>;
16
- connectionConfigOauth: () => v.ObjectSchema<{
16
+ connectionConfigOauth: v.ObjectSchema<{
17
17
  readonly code: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
18
18
  readonly provider: v.PicklistSchema<readonly ["GOOGLE", "OUTLOOK"], undefined>;
19
19
  readonly user: v.NonOptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.NonEmptyAction<string, undefined>, v.MaxLengthAction<string, number, undefined>]>, undefined>;
20
20
  }, undefined>;
21
- 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>;
22
- socketTypeSchema: () => v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
21
+ 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>;
22
+ socketTypeSchema: v.PicklistSchema<readonly ["SSL", "STARTTLS"], undefined>;
23
23
  };
24
24
  //# sourceMappingURL=emailAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"emailAccount.d.ts","sourceRoot":"","sources":["../../src/schemas/emailAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAsBxB,CAAA"}
1
+ {"version":3,"file":"emailAccount.d.ts","sourceRoot":"","sources":["../../src/schemas/emailAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAQ5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAE5C,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;CAoBxB,CAAA"}
@@ -5,7 +5,7 @@ import { portSchema, socketTypeSchema } from './scalars';
5
5
  import { string } from './string';
6
6
  export { socketTypeSchema } from './scalars';
7
7
  export const emailAccount = {
8
- connectionConfigImapRaw: () => v.object({
8
+ connectionConfigImapRaw: v.object({
9
9
  imapHost: string.required(4096),
10
10
  imapPassword: string.required(4096),
11
11
  imapPort: portSchema,
@@ -17,11 +17,11 @@ export const emailAccount = {
17
17
  smtpSocketType: socketTypeSchema,
18
18
  smtpUser: string.required(4096),
19
19
  }),
20
- connectionConfigOauth: () => v.object({
20
+ connectionConfigOauth: v.object({
21
21
  code: string.required(4096),
22
- provider: oauth.provider(),
22
+ provider: oauth.provider,
23
23
  user: string.required(4096),
24
24
  }),
25
- imapConnectionStatus: () => v.picklist(IMAP_CONNECTION_STATUSES),
26
- socketTypeSchema: () => socketTypeSchema,
25
+ imapConnectionStatus: v.picklist(IMAP_CONNECTION_STATUSES),
26
+ socketTypeSchema,
27
27
  };