@marcoappio/marco-config 4.0.16 → 4.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/appwrite/appwrite.d.ts +557 -561
- package/dist/appwrite/appwrite.d.ts.map +1 -1
- package/dist/appwrite/appwrite.js +4 -7
- package/dist/appwrite/appwrite.test.js +2 -1
- package/dist/appwrite/commands.d.ts +20 -20
- package/dist/appwrite/commands.js +5 -5
- package/dist/appwrite/commands.test.js +3 -3
- package/dist/appwrite/decodedSchemas.js +2 -2
- package/dist/appwrite/functions.d.ts +10 -10
- package/dist/appwrite/functions.js +6 -6
- package/dist/appwrite/functions.test.js +1 -1
- package/dist/appwrite/index.d.ts +5 -3
- package/dist/appwrite/index.d.ts.map +1 -1
- package/dist/appwrite/index.js +4 -3
- package/dist/appwrite/tableContract/identity.d.ts +62 -297
- package/dist/appwrite/tableContract/identity.d.ts.map +1 -1
- package/dist/appwrite/tableContract/identity.js +122 -146
- package/dist/appwrite/tableContract/index.d.ts +726 -818
- package/dist/appwrite/tableContract/index.d.ts.map +1 -1
- package/dist/appwrite/tableContract/index.js +23 -10
- package/dist/appwrite/tableContract/index.test.js +40 -4
- package/dist/appwrite/tableContract/mailbox.d.ts +88 -411
- package/dist/appwrite/tableContract/mailbox.d.ts.map +1 -1
- package/dist/appwrite/tableContract/mailbox.js +159 -180
- package/dist/appwrite/tableContract/operational.d.ts +76 -351
- package/dist/appwrite/tableContract/operational.d.ts.map +1 -1
- package/dist/appwrite/tableContract/operational.js +154 -178
- package/dist/appwrite/tableContract/shared.d.ts +14 -7
- package/dist/appwrite/tableContract/shared.d.ts.map +1 -1
- package/dist/appwrite/tableContract/shared.js +2 -2
- package/dist/constants/emailProvider.js +1 -1
- package/dist/constants/index.js +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.test.js +67 -6
- package/dist/schemas/app.js +1 -1
- package/dist/schemas/auth.js +1 -1
- package/dist/schemas/emailAccount.d.ts +1 -1
- package/dist/schemas/emailAccount.js +5 -5
- package/dist/schemas/index.d.ts +3 -3
- package/dist/schemas/index.js +9 -9
- package/dist/schemas/models/account.js +4 -4
- package/dist/schemas/models/contact.js +2 -2
- package/dist/schemas/models/draft.js +4 -4
- package/dist/schemas/models/index.d.ts +5 -5
- package/dist/schemas/models/index.js +5 -5
- package/dist/schemas/models/mailboxAddress.test.js +3 -3
- package/dist/schemas/models/numericSemantics.test.js +2 -2
- package/dist/schemas/models/thread.js +5 -5
- package/dist/schemas/models/user.d.ts +1 -1
- package/dist/schemas/models/user.js +3 -3
- package/dist/schemas/models/user.test.js +2 -2
- package/dist/schemas/number.js +1 -1
- package/dist/schemas/oauth.js +1 -1
- package/dist/schemas/pushNotifications.js +1 -1
- package/dist/schemas/scalars.test.js +2 -2
- package/dist/schemas/schemaValues.test.js +1 -1
- package/dist/schemas/string.js +1 -1
- package/dist/types/IMAPSourceLocation.d.ts +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.js +11 -11
- package/dist/utils/accounts/index.d.ts +1 -1
- package/dist/utils/accounts/index.js +1 -1
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +3 -3
- package/dist/utils/labels/index.d.ts +1 -1
- package/dist/utils/threads/index.d.ts +2 -2
- package/dist/utils/threads/index.js +2 -2
- package/dist/utils/threads/parseLabelIdList/parseLabelIdList.test.js +1 -1
- package/dist/utils/threads/processSearchTerm/processSearchTerm.test.js +1 -1
- package/package.json +15 -3
|
@@ -1,191 +1,167 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
2
|
/* oxlint-disable eslint/sort-keys */
|
|
3
|
-
import { accountProviders, appwriteColumnDefinitions,
|
|
3
|
+
import { accountProviders, appwriteColumnDefinitions, appwriteRelationship, appwriteRelationshipIdSchema, canonicalTimestampSchema, commandStates, defineAppwriteTableGroup, identifierSchema, jobStates, labelSpecialUses, mailboxSortKeySchema, mailboxSyncLaneStates, mailboxSyncLanes, mailboxSyncProvisionedStates, nonNegativeIntegerSchema, positiveIntegerSchema, pollShardStates, isoTimestampSchema, } from './shared.js';
|
|
4
4
|
const { bigint, dateTime, enumValue, identifier, integer, longText, string: stringColumn, stringArray, text } = appwriteColumnDefinitions;
|
|
5
|
-
export const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
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
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReadonlyDeep } from 'type-fest';
|
|
2
2
|
import * as v from 'valibot';
|
|
3
|
-
export { canonicalTimestampSchema, isoTimestampSchema, jsonObjectTextSchema, mailboxAddressSchema, nonNegativeIntegerSchema, portSchema, positiveIntegerSchema, rfcEmailSchema, socketTypeSchema, socketTypes, webEmailSchema, } from '../../schemas/scalars';
|
|
3
|
+
export { canonicalTimestampSchema, isoTimestampSchema, jsonObjectTextSchema, mailboxAddressSchema, nonNegativeIntegerSchema, portSchema, positiveIntegerSchema, rfcEmailSchema, socketTypeSchema, socketTypes, webEmailSchema, } from '../../schemas/scalars.js';
|
|
4
4
|
export declare const appwriteIds: {
|
|
5
5
|
readonly bucket: "marco-files";
|
|
6
6
|
readonly database: "marco";
|
|
@@ -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
|
|
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
|
-
|
|
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
|
|
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,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,CAAC,MAAM,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B,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as v from 'valibot';
|
|
2
|
-
export { canonicalTimestampSchema, isoTimestampSchema, jsonObjectTextSchema, mailboxAddressSchema, nonNegativeIntegerSchema, portSchema, positiveIntegerSchema, rfcEmailSchema, socketTypeSchema, socketTypes, webEmailSchema, } from '../../schemas/scalars';
|
|
2
|
+
export { canonicalTimestampSchema, isoTimestampSchema, jsonObjectTextSchema, mailboxAddressSchema, nonNegativeIntegerSchema, portSchema, positiveIntegerSchema, rfcEmailSchema, socketTypeSchema, socketTypes, webEmailSchema, } from '../../schemas/scalars.js';
|
|
3
3
|
export const appwriteIds = {
|
|
4
4
|
bucket: 'marco-files',
|
|
5
5
|
database: 'marco',
|
|
@@ -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
|
|
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/constants/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { emailAccounts } from './emailAccounts';
|
|
2
|
-
import { emailProvider } from './emailProvider';
|
|
3
|
-
import { messages } from './messages';
|
|
4
|
-
import { oauth } from './oauth';
|
|
5
|
-
import { user } from './user';
|
|
1
|
+
import { emailAccounts } from './emailAccounts.js';
|
|
2
|
+
import { emailProvider } from './emailProvider.js';
|
|
3
|
+
import { messages } from './messages.js';
|
|
4
|
+
import { oauth } from './oauth.js';
|
|
5
|
+
import { user } from './user.js';
|
|
6
6
|
export const marcoConstants = {
|
|
7
7
|
emailAccounts,
|
|
8
8
|
emailProvider,
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { marcoConstants } from './constants';
|
|
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
|
-
export * from './types';
|
|
5
|
-
export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils';
|
|
1
|
+
export * from './appwrite/index.js';
|
|
2
|
+
export { marcoConstants } from './constants/index.js';
|
|
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/index.js';
|
|
4
|
+
export * from './types/index.js';
|
|
5
|
+
export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils/index.js';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { marcoConstants } from './constants';
|
|
3
|
-
export { marcoSchemas, } from './schemas';
|
|
4
|
-
export * from './types';
|
|
5
|
-
export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils';
|
|
1
|
+
export * from './appwrite/index.js';
|
|
2
|
+
export { marcoConstants } from './constants/index.js';
|
|
3
|
+
export { marcoSchemas, } from './schemas/index.js';
|
|
4
|
+
export * from './types/index.js';
|
|
5
|
+
export { generateAccountColor, labelSpecialUseOrdering, parseLabelIdList, processSearchTerm } from './utils/index.js';
|
package/dist/index.test.js
CHANGED
|
@@ -1,18 +1,79 @@
|
|
|
1
1
|
import { describe, expect, it } from 'bun:test';
|
|
2
2
|
const removedSchemaRequirements = undefined;
|
|
3
|
+
const appwriteExportKeys = [
|
|
4
|
+
'accountProviders',
|
|
5
|
+
'accountStates',
|
|
6
|
+
'appwrite',
|
|
7
|
+
'appwriteAvatar',
|
|
8
|
+
'appwriteCommandGroups',
|
|
9
|
+
'appwriteCommands',
|
|
10
|
+
'appwriteDataSchemas',
|
|
11
|
+
'appwriteFunctions',
|
|
12
|
+
'appwriteRelationshipIdSchema',
|
|
13
|
+
'appwriteRowSchemas',
|
|
14
|
+
'appwriteTableContract',
|
|
15
|
+
'appwriteTableIdSchema',
|
|
16
|
+
'appwriteTableIds',
|
|
17
|
+
'appwriteTables',
|
|
18
|
+
'commandStates',
|
|
19
|
+
'defineAppwriteTables',
|
|
20
|
+
'draftStates',
|
|
21
|
+
'draftTypes',
|
|
22
|
+
'jobStates',
|
|
23
|
+
'labelSpecialUses',
|
|
24
|
+
'mailboxSyncLaneStates',
|
|
25
|
+
'mailboxSyncLanes',
|
|
26
|
+
'mailboxSyncProvisionedStates',
|
|
27
|
+
'mailboxSyncStates',
|
|
28
|
+
'oauthOperations',
|
|
29
|
+
'oauthProviders',
|
|
30
|
+
'oauthReturnUriSchema',
|
|
31
|
+
'oauthReturnUris',
|
|
32
|
+
'pollShardStates',
|
|
33
|
+
];
|
|
34
|
+
const rootExportKeys = [
|
|
35
|
+
'CustomViewIcon',
|
|
36
|
+
'DRAFT_ATTACHMENT_UPLOAD_STATUSES',
|
|
37
|
+
'DRAFT_STATUSES',
|
|
38
|
+
'DRAFT_TYPES',
|
|
39
|
+
'EmailProvider',
|
|
40
|
+
'IMAP_CONNECTION_STATUSES',
|
|
41
|
+
'LABEL_SPECIAL_USES',
|
|
42
|
+
'MARCO_PLATFORM',
|
|
43
|
+
'MESSAGE_RECIPIENT_TYPES',
|
|
44
|
+
'OAUTH_PROVIDERS',
|
|
45
|
+
'USER_SETTINGS_CUSTOM_VIEW_ICONS',
|
|
46
|
+
...appwriteExportKeys,
|
|
47
|
+
'generateAccountColor',
|
|
48
|
+
'labelSpecialUseOrdering',
|
|
49
|
+
'marcoConstants',
|
|
50
|
+
'marcoSchemas',
|
|
51
|
+
'parseLabelIdList',
|
|
52
|
+
'processSearchTerm',
|
|
53
|
+
].sort();
|
|
3
54
|
describe('public exports', () => {
|
|
4
55
|
it('loads the public entry point', async () => {
|
|
5
|
-
await expect(import('./index')).resolves.toBeDefined();
|
|
56
|
+
await expect(import('./index.js')).resolves.toBeDefined();
|
|
57
|
+
});
|
|
58
|
+
it('publishes the exact root and Appwrite entrypoint manifests', async () => {
|
|
59
|
+
const [appwrite, root] = await Promise.all([import('./appwrite/index.js'), import('./index.js')]);
|
|
60
|
+
expect(Object.keys(appwrite).sort()).toEqual([...appwriteExportKeys].sort());
|
|
61
|
+
expect(Object.keys(root).sort()).toEqual(rootExportKeys);
|
|
62
|
+
});
|
|
63
|
+
it('keeps wildcard barrel sources collision-free', async () => {
|
|
64
|
+
const [appwrite, types] = await Promise.all([import('./appwrite/index.js'), import('./types/index.js')]);
|
|
65
|
+
const typeExportKeys = new Set(Object.keys(types));
|
|
66
|
+
expect(Object.keys(appwrite).filter(key => typeExportKeys.has(key))).toEqual([]);
|
|
6
67
|
});
|
|
7
68
|
it('omits Railway-era runtime contracts', async () => {
|
|
8
|
-
const config = await import('./index');
|
|
69
|
+
const config = await import('./index.js');
|
|
9
70
|
const removedExports = ['MARCO_ENV', 'marcoPublicConfig', 'marcoSDK'];
|
|
10
71
|
for (const removedExport of removedExports) {
|
|
11
72
|
expect(removedExport in config).toBe(false);
|
|
12
73
|
}
|
|
13
74
|
});
|
|
14
75
|
it('omits legacy schemas', async () => {
|
|
15
|
-
const config = await import('./index');
|
|
76
|
+
const config = await import('./index.js');
|
|
16
77
|
const removedSchemas = ['mutators', 'websocket'];
|
|
17
78
|
for (const removedSchema of removedSchemas) {
|
|
18
79
|
expect(removedSchema in config.marcoSchemas).toBe(false);
|
|
@@ -21,7 +82,7 @@ describe('public exports', () => {
|
|
|
21
82
|
expect('userSchema' in config.marcoSchemas.models).toBe(false);
|
|
22
83
|
});
|
|
23
84
|
it('omits unused schema and validation helpers', async () => {
|
|
24
|
-
const config = await import('./index');
|
|
85
|
+
const config = await import('./index.js');
|
|
25
86
|
expect(removedSchemaRequirements).toBeUndefined();
|
|
26
87
|
expect('flattenRequirements' in config).toBe(false);
|
|
27
88
|
expect('boolean' in config.marcoSchemas).toBe(false);
|
|
@@ -35,7 +96,7 @@ describe('public exports', () => {
|
|
|
35
96
|
expect('threadListSchema' in config.marcoSchemas.models).toBe(false);
|
|
36
97
|
});
|
|
37
98
|
it('exports utility functions directly without wrapper objects', async () => {
|
|
38
|
-
const config = await import('./index');
|
|
99
|
+
const config = await import('./index.js');
|
|
39
100
|
expect(config.generateAccountColor).toBeTypeOf('function');
|
|
40
101
|
expect(config.labelSpecialUseOrdering).toEqual(['INBOX', 'SENT', 'SPAM', 'TRASH', 'ARCHIVE']);
|
|
41
102
|
expect(config.parseLabelIdList).toBeTypeOf('function');
|
|
@@ -45,7 +106,7 @@ describe('public exports', () => {
|
|
|
45
106
|
expect('threadsUtils' in config).toBe(false);
|
|
46
107
|
});
|
|
47
108
|
it('omits the Railway REST constants', async () => {
|
|
48
|
-
const config = await import('./index');
|
|
109
|
+
const config = await import('./index.js');
|
|
49
110
|
expect('api' in config.marcoConstants).toBe(false);
|
|
50
111
|
});
|
|
51
112
|
});
|