@marcoappio/marco-config 4.0.9 → 4.0.10

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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/appwrite/tableContract/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAsB5B,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe7B,CAAA;AAEF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBhC,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkBxB,CAAA;AAEF,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2BtB,CAAA;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CvB,CAAA;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgB5B,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BxB,CAAA;AAEF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAQrB,CAAA"}
@@ -0,0 +1,191 @@
1
+ import * as v from 'valibot';
2
+ /* oxlint-disable eslint/sort-keys */
3
+ import { appwriteColumnDefinitions, appwriteIds, appwriteRelationship, appwriteRelationshipIdSchema, defineAppwriteTable, draftStates, draftTypes, identifierSchema, mailboxAddressSchema, messageLocationCoordinateCheck, nonNegativeIntegerSchema, positiveIntegerSchema, timestampSchema, } from './shared';
4
+ const { bigint, boolean, dateTime, enumValue, identifier, integer, longText, string: stringColumn, stringArray, text } = appwriteColumnDefinitions;
5
+ export const threadAliasesTable = defineAppwriteTable({
6
+ fields: {
7
+ aliasAssignmentKey: identifier(identifierSchema),
8
+ latestMessageAt: dateTime(timestampSchema),
9
+ threadAssignmentKey: identifier(identifierSchema),
10
+ alias: appwriteRelationship(appwriteRelationshipIdSchema, 'aliases'),
11
+ thread: appwriteRelationship(appwriteRelationshipIdSchema, 'threads'),
12
+ },
13
+ id: appwriteIds.tables.threadAliases,
14
+ indexes: [
15
+ { attributes: ['threadAssignmentKey', 'aliasAssignmentKey'], name: 'assignment_thread_alias_unique', type: 'unique' },
16
+ { attributes: ['aliasAssignmentKey', 'latestMessageAt'], name: 'assignment_alias_latest', type: 'key' },
17
+ ],
18
+ key: 'threadAliases',
19
+ name: 'Thread aliases',
20
+ });
21
+ export const messageLocationsTable = defineAppwriteTable({
22
+ dataCheck: messageLocationCoordinateCheck,
23
+ fields: {
24
+ accountAssignmentKey: identifier(identifierSchema),
25
+ flagged: boolean(v.boolean()),
26
+ labelAssignmentKey: identifier(identifierSchema),
27
+ messageAt: dateTime(timestampSchema),
28
+ seen: boolean(v.boolean()),
29
+ threadAssignmentKey: identifier(identifierSchema),
30
+ uid: bigint(v.nullable(positiveIntegerSchema), false),
31
+ uidValidity: bigint(v.nullable(positiveIntegerSchema), false),
32
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
33
+ label: appwriteRelationship(appwriteRelationshipIdSchema, 'labels'),
34
+ message: appwriteRelationship(appwriteRelationshipIdSchema, 'messages'),
35
+ thread: appwriteRelationship(appwriteRelationshipIdSchema, 'threads'),
36
+ },
37
+ id: appwriteIds.tables.messageLocations,
38
+ indexes: [
39
+ { attributes: ['accountAssignmentKey', 'labelAssignmentKey', 'uidValidity', 'uid'], name: 'assignment_account_label_uid', type: 'key' },
40
+ { attributes: ['accountAssignmentKey', 'threadAssignmentKey'], name: 'assignment_account_thread', type: 'key' },
41
+ { attributes: ['threadAssignmentKey', 'labelAssignmentKey', 'messageAt'], name: 'assignment_thread_label_latest', type: 'key' },
42
+ ],
43
+ key: 'messageLocations',
44
+ name: 'Message locations',
45
+ });
46
+ export const contactsTable = defineAppwriteTable({
47
+ fields: {
48
+ normalisedAddress: stringColumn(mailboxAddressSchema, true, 320),
49
+ displayName: stringColumn(v.nullable(identifierSchema), false),
50
+ lastContactedAt: dateTime(v.nullable(timestampSchema), false),
51
+ messageCount: integer(nonNegativeIntegerSchema),
52
+ profileAssignmentKey: identifier(identifierSchema),
53
+ searchText: text(v.string()),
54
+ profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
55
+ },
56
+ id: appwriteIds.tables.contacts,
57
+ indexes: [
58
+ { attributes: ['profileAssignmentKey', 'lastContactedAt'], name: 'assignment_profile_last_contacted', type: 'key' },
59
+ { attributes: ['profileAssignmentKey', 'normalisedAddress'], name: 'assignment_profile_address_unique', type: 'unique' },
60
+ { attributes: ['searchText'], name: 'search', type: 'fulltext' },
61
+ ],
62
+ key: 'contacts',
63
+ name: 'Contacts',
64
+ });
65
+ export const draftsTable = defineAppwriteTable({
66
+ fields: {
67
+ accountAssignmentKey: identifier(identifierSchema),
68
+ type: enumValue(v.picklist(draftTypes), draftTypes),
69
+ envelope: text(v.string()),
70
+ html: longText(v.string()),
71
+ attachmentMetadata: text(v.string()),
72
+ contentHash: stringColumn(identifierSchema),
73
+ scheduledAt: dateTime(v.nullable(timestampSchema), false),
74
+ status: enumValue(v.picklist(draftStates), draftStates),
75
+ revision: integer(nonNegativeIntegerSchema),
76
+ sequence: integer(nonNegativeIntegerSchema),
77
+ executionLeaseId: stringColumn(v.nullable(identifierSchema), false),
78
+ executionLeaseExpiresAt: dateTime(v.nullable(timestampSchema), false),
79
+ errorCode: stringColumn(v.nullable(identifierSchema), false),
80
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
81
+ fromAlias: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'aliases', 'manyToOne', 'setNull'),
82
+ referencedMessage: appwriteRelationship(v.nullable(appwriteRelationshipIdSchema), 'messages', 'manyToOne', 'setNull'),
83
+ },
84
+ id: appwriteIds.tables.drafts,
85
+ indexes: [
86
+ { attributes: ['accountAssignmentKey'], name: 'assignment_account', type: 'key' },
87
+ { attributes: ['accountAssignmentKey', 'status'], name: 'assignment_account_status', type: 'key' },
88
+ { attributes: ['scheduledAt'], name: 'scheduled', type: 'key' },
89
+ ],
90
+ key: 'drafts',
91
+ name: 'Drafts',
92
+ });
93
+ export const threadsTable = defineAppwriteTable({
94
+ fields: {
95
+ accountAssignmentKey: identifier(identifierSchema),
96
+ providerId: stringColumn(identifierSchema),
97
+ subject: text(v.nullable(v.string()), false),
98
+ firstMessageAt: dateTime(v.nullable(timestampSchema), false),
99
+ senderEmail: stringColumn(v.nullable(mailboxAddressSchema), false, 320),
100
+ senderName: stringColumn(v.nullable(identifierSchema), false),
101
+ preview: text(v.nullable(v.string()), false),
102
+ participants: text(v.nullable(v.string()), false),
103
+ labelIds: stringArray(v.array(identifierSchema), true, 36),
104
+ latestMessageAt: dateTime(timestampSchema),
105
+ latestMessageId: identifier(identifierSchema),
106
+ messageCount: integer(nonNegativeIntegerSchema),
107
+ hasAttachments: boolean(v.boolean()),
108
+ unseenLocationCount: integer(nonNegativeIntegerSchema),
109
+ flaggedLocationCount: integer(nonNegativeIntegerSchema),
110
+ seen: boolean(v.boolean()),
111
+ flagged: boolean(v.boolean()),
112
+ archived: boolean(v.boolean()),
113
+ spam: boolean(v.boolean()),
114
+ trashed: boolean(v.boolean()),
115
+ snoozedUntil: dateTime(v.nullable(timestampSchema), false),
116
+ revision: integer(nonNegativeIntegerSchema),
117
+ searchText: text(v.nullable(v.string()), false),
118
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
119
+ },
120
+ id: appwriteIds.tables.threads,
121
+ indexes: [
122
+ { attributes: ['accountAssignmentKey', 'providerId'], name: 'assignment_account_provider_unique', type: 'unique' },
123
+ { attributes: ['accountAssignmentKey', 'latestMessageAt'], name: 'assignment_account_latest', type: 'key' },
124
+ { attributes: ['accountAssignmentKey', 'seen', 'latestMessageAt'], name: 'assignment_account_seen_latest', type: 'key' },
125
+ { attributes: ['accountAssignmentKey', 'flagged', 'latestMessageAt'], name: 'assignment_account_flagged_latest', type: 'key' },
126
+ { attributes: ['accountAssignmentKey', 'snoozedUntil', 'latestMessageAt'], name: 'assignment_account_snoozed_latest', type: 'key' },
127
+ { attributes: ['snoozedUntil'], name: 'snoozed_due', type: 'key' },
128
+ { attributes: ['accountAssignmentKey', 'archived', 'latestMessageAt'], name: 'assignment_account_archived_latest', type: 'key' },
129
+ { attributes: ['accountAssignmentKey', 'spam', 'latestMessageAt'], name: 'assignment_account_spam_latest', type: 'key' },
130
+ { attributes: ['accountAssignmentKey', 'trashed', 'latestMessageAt'], name: 'assignment_account_trashed_latest', type: 'key' },
131
+ { attributes: ['searchText'], name: 'search', type: 'fulltext' },
132
+ ],
133
+ key: 'threads',
134
+ name: 'Threads',
135
+ });
136
+ export const threadLabelsTable = defineAppwriteTable({
137
+ fields: {
138
+ labelAssignmentKey: identifier(identifierSchema),
139
+ latestMessageAt: dateTime(timestampSchema),
140
+ locationCount: integer(nonNegativeIntegerSchema),
141
+ threadAssignmentKey: identifier(identifierSchema),
142
+ label: appwriteRelationship(appwriteRelationshipIdSchema, 'labels'),
143
+ thread: appwriteRelationship(appwriteRelationshipIdSchema, 'threads'),
144
+ },
145
+ id: appwriteIds.tables.threadLabels,
146
+ indexes: [
147
+ { attributes: ['threadAssignmentKey', 'labelAssignmentKey'], name: 'assignment_thread_label_unique', type: 'unique' },
148
+ { attributes: ['labelAssignmentKey', 'latestMessageAt'], name: 'assignment_label_latest', type: 'key' },
149
+ ],
150
+ key: 'threadLabels',
151
+ name: 'Thread labels',
152
+ });
153
+ export const messagesTable = defineAppwriteTable({
154
+ fields: {
155
+ accountAssignmentKey: identifier(identifierSchema),
156
+ providerId: stringColumn(identifierSchema),
157
+ rfcMessageId: stringColumn(v.nullable(identifierSchema), false),
158
+ sender: text(v.nullable(v.string()), false),
159
+ senderName: text(v.nullable(v.string()), false),
160
+ recipients: text(v.nullable(v.string()), false),
161
+ sentAt: dateTime(timestampSchema),
162
+ receivedAt: dateTime(v.nullable(timestampSchema), false),
163
+ preview: text(v.nullable(v.string()), false),
164
+ attachmentMetadata: longText(v.string()),
165
+ htmlFileId: stringColumn(v.nullable(identifierSchema), false),
166
+ rawFileId: stringColumn(v.nullable(identifierSchema), false),
167
+ size: integer(nonNegativeIntegerSchema),
168
+ subject: text(v.nullable(v.string()), false),
169
+ revision: integer(nonNegativeIntegerSchema),
170
+ threadAssignmentKey: identifier(identifierSchema),
171
+ account: appwriteRelationship(appwriteRelationshipIdSchema, 'accounts'),
172
+ thread: appwriteRelationship(appwriteRelationshipIdSchema, 'threads'),
173
+ },
174
+ id: appwriteIds.tables.messages,
175
+ indexes: [
176
+ { attributes: ['threadAssignmentKey', 'sentAt'], name: 'assignment_thread_sent', type: 'key' },
177
+ { attributes: ['accountAssignmentKey', 'providerId'], name: 'assignment_account_provider_unique', type: 'unique' },
178
+ { attributes: ['accountAssignmentKey', 'rfcMessageId'], name: 'assignment_account_rfc_message', type: 'key' },
179
+ ],
180
+ key: 'messages',
181
+ name: 'Messages',
182
+ });
183
+ export const mailboxTableInputs = {
184
+ contacts: contactsTable,
185
+ drafts: draftsTable,
186
+ messageLocations: messageLocationsTable,
187
+ messages: messagesTable,
188
+ threadAliases: threadAliasesTable,
189
+ threadLabels: threadLabelsTable,
190
+ threads: threadsTable,
191
+ };