@marcoappio/marco-config 4.0.16 → 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.
@@ -9,7 +9,7 @@ const appwriteTableInputs = {
9
9
  ...mailboxTableInputs,
10
10
  ...operationalTableInputs,
11
11
  };
12
- const materialiseTable = (table) => {
12
+ const materialiseTable = (key, id, table) => {
13
13
  const columns = Object.entries(table.fields).flatMap(([key, field]) => {
14
14
  if ('relatedTable' in field.definition) {
15
15
  return [];
@@ -31,9 +31,9 @@ const materialiseTable = (table) => {
31
31
  });
32
32
  return {
33
33
  columns,
34
- id: table.id,
34
+ id,
35
35
  indexes: table.indexes,
36
- key: table.key,
36
+ key,
37
37
  name: table.name,
38
38
  relationships,
39
39
  };
@@ -55,6 +55,13 @@ function createDataSchema(fields, dataCheck) {
55
55
  return schema;
56
56
  }
57
57
  const createRowSchema = (fields, tableId, wirePermissions) => v.strictObject({ ...wireMetadata(tableId, wirePermissions), ...fields });
58
+ const isAppwriteTableKey = (tableKey) => Object.hasOwn(appwriteIds.tables, tableKey);
59
+ const appwriteTableIdentity = (tableKey) => {
60
+ if (isAppwriteTableKey(tableKey)) {
61
+ return { id: appwriteIds.tables[tableKey], key: tableKey };
62
+ }
63
+ throw new Error(`Unknown Appwrite table key: ${tableKey}`);
64
+ };
58
65
  export function defineAppwriteTables(tables) {
59
66
  const createDataSchemaForTable = (fields, dataCheck) => {
60
67
  if (dataCheck) {
@@ -63,8 +70,14 @@ export function defineAppwriteTables(tables) {
63
70
  return createDataSchema(fields);
64
71
  };
65
72
  const dataSchemas = Object.fromEntries(Object.entries(tables).map(([tableKey, table]) => [tableKey, createDataSchemaForTable(table.fields, table.dataCheck)]));
66
- const rowSchemas = Object.fromEntries(Object.entries(tables).map(([tableKey, table]) => [tableKey, createRowSchema(table.fields, table.id, table.wirePermissions)]));
67
- const tableDefinitions = Object.fromEntries(Object.entries(tables).map(([tableKey, table]) => [tableKey, materialiseTable(table)]));
73
+ const rowSchemas = Object.fromEntries(Object.entries(tables).map(([tableKey, table]) => {
74
+ const { id } = appwriteTableIdentity(tableKey);
75
+ return [tableKey, createRowSchema(table.fields, id, table.wirePermissions)];
76
+ }));
77
+ const tableDefinitions = Object.fromEntries(Object.entries(tables).map(([tableKey, table]) => {
78
+ const { id, key } = appwriteTableIdentity(tableKey);
79
+ return [tableKey, materialiseTable(key, id, table)];
80
+ }));
68
81
  return {
69
82
  dataSchemas,
70
83
  rowSchemas,
@@ -4,6 +4,7 @@ import { identityTableInputs } from './identity';
4
4
  import { defineAppwriteTables } from './index';
5
5
  import { mailboxTableInputs } from './mailbox';
6
6
  import { operationalTableInputs } from './operational';
7
+ import { appwriteColumnDefinitions, appwriteIds, appwriteRelationship, appwriteRelationshipIdSchema, defineAppwriteTableGroup, identifierSchema } from './shared';
7
8
  const tableInputs = {
8
9
  ...identityTableInputs,
9
10
  ...mailboxTableInputs,
@@ -29,6 +30,33 @@ const validAccount = {
29
30
  state: 'CONNECTED',
30
31
  };
31
32
  describe('defineAppwriteTables', () => {
33
+ it('constrains table group keys and index attributes at compile time', () => {
34
+ const fields = {
35
+ email: appwriteColumnDefinitions.string(identifierSchema),
36
+ profile: appwriteRelationship(appwriteRelationshipIdSchema, 'profiles'),
37
+ };
38
+ defineAppwriteTableGroup({
39
+ // @ts-expect-error unknown table keys are rejected
40
+ profile: { fields, indexes: [], name: 'Profile' },
41
+ });
42
+ defineAppwriteTableGroup({
43
+ profiles: {
44
+ fields,
45
+ // @ts-expect-error unknown fields are rejected
46
+ indexes: [{ attributes: ['missing'], name: 'missing', type: 'key' }],
47
+ name: 'Profiles',
48
+ },
49
+ });
50
+ defineAppwriteTableGroup({
51
+ profiles: {
52
+ fields,
53
+ // @ts-expect-error relationship fields are rejected
54
+ indexes: [{ attributes: ['profile'], name: 'profile', type: 'key' }],
55
+ name: 'Profiles',
56
+ },
57
+ });
58
+ expect(true).toBe(true);
59
+ });
32
60
  it('applies each supplied table data check to its generated data schema', () => {
33
61
  const contract = defineAppwriteTables({
34
62
  ...tableInputs,
@@ -44,5 +72,13 @@ describe('defineAppwriteTables', () => {
44
72
  expect(Object.keys(contract.dataSchemas).sort()).toEqual(Object.keys(tableInputs).sort());
45
73
  expect(Object.keys(contract.rowSchemas).sort()).toEqual(Object.keys(tableInputs).sort());
46
74
  expect(Object.keys(contract.tables).sort()).toEqual(Object.keys(tableInputs).sort());
75
+ expect(Object.fromEntries(Object.entries(contract.tables).map(([key, table]) => [key, table.id]))).toEqual(appwriteIds.tables);
76
+ expect(Object.entries(contract.tables).every(([key, table]) => table.key === key)).toBe(true);
77
+ });
78
+ it('rejects inherited object property names as table keys', () => {
79
+ expect(() => defineAppwriteTables({
80
+ ...tableInputs,
81
+ toString: tableInputs.accounts,
82
+ })).toThrow('Unknown Appwrite table key: toString');
47
83
  });
48
84
  });
@@ -1,313 +1,4 @@
1
1
  import * as v from 'valibot';
2
- export declare const threadAliasesTable: {
3
- readonly fields: {
4
- readonly aliasAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
5
- readonly latestMessageAt: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>>;
6
- readonly threadAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
7
- readonly alias: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
8
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
9
- }, undefined>, v.TransformAction<{
10
- $id: string;
11
- }, string>]>], undefined>>;
12
- readonly thread: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
13
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
14
- }, undefined>, v.TransformAction<{
15
- $id: string;
16
- }, string>]>], undefined>>;
17
- };
18
- readonly id: "thread_aliases";
19
- readonly indexes: readonly [{
20
- readonly attributes: readonly ["threadAssignmentKey", "aliasAssignmentKey"];
21
- readonly name: "assignment_thread_alias_unique";
22
- readonly type: "unique";
23
- }, {
24
- readonly attributes: readonly ["aliasAssignmentKey", "latestMessageAt"];
25
- readonly name: "assignment_alias_latest";
26
- readonly type: "key";
27
- }];
28
- readonly key: "threadAliases";
29
- readonly name: "Thread aliases";
30
- };
31
- export declare const messageLocationsTable: {
32
- readonly dataCheck: (location: unknown) => boolean;
33
- readonly fields: {
34
- readonly accountAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
35
- readonly flagged: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
36
- readonly labelAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
37
- readonly messageAt: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>>;
38
- readonly seen: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
39
- readonly threadAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
40
- readonly uid: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>>;
41
- readonly uidValidity: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>, undefined>>;
42
- readonly account: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
43
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
44
- }, undefined>, v.TransformAction<{
45
- $id: string;
46
- }, string>]>], undefined>>;
47
- readonly label: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
48
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
49
- }, undefined>, v.TransformAction<{
50
- $id: string;
51
- }, string>]>], undefined>>;
52
- readonly message: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
53
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
54
- }, undefined>, v.TransformAction<{
55
- $id: string;
56
- }, string>]>], undefined>>;
57
- readonly thread: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
58
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
59
- }, undefined>, v.TransformAction<{
60
- $id: string;
61
- }, string>]>], undefined>>;
62
- };
63
- readonly id: "message_locations";
64
- readonly indexes: readonly [{
65
- readonly attributes: readonly ["accountAssignmentKey", "labelAssignmentKey", "uidValidity", "uid"];
66
- readonly name: "assignment_account_label_uid";
67
- readonly type: "key";
68
- }, {
69
- readonly attributes: readonly ["accountAssignmentKey", "threadAssignmentKey"];
70
- readonly name: "assignment_account_thread";
71
- readonly type: "key";
72
- }, {
73
- readonly attributes: readonly ["threadAssignmentKey", "labelAssignmentKey", "messageAt"];
74
- readonly name: "assignment_thread_label_latest";
75
- readonly type: "key";
76
- }];
77
- readonly key: "messageLocations";
78
- readonly name: "Message locations";
79
- };
80
- export declare const contactsTable: {
81
- readonly fields: {
82
- readonly normalisedAddress: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>>;
83
- readonly displayName: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
84
- readonly lastContactedAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
85
- readonly messageCount: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
86
- readonly profileAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
87
- readonly searchText: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
88
- readonly profile: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
89
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
90
- }, undefined>, v.TransformAction<{
91
- $id: string;
92
- }, string>]>], undefined>>;
93
- };
94
- readonly id: "contacts";
95
- readonly indexes: readonly [{
96
- readonly attributes: readonly ["profileAssignmentKey", "lastContactedAt"];
97
- readonly name: "assignment_profile_last_contacted";
98
- readonly type: "key";
99
- }, {
100
- readonly attributes: readonly ["profileAssignmentKey", "normalisedAddress"];
101
- readonly name: "assignment_profile_address_unique";
102
- readonly type: "unique";
103
- }, {
104
- readonly attributes: readonly ["searchText"];
105
- readonly name: "search";
106
- readonly type: "fulltext";
107
- }];
108
- readonly key: "contacts";
109
- readonly name: "Contacts";
110
- };
111
- export declare const draftsTable: {
112
- readonly fields: {
113
- readonly accountAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
114
- readonly type: import("./shared").AppwriteColumnSchema<v.PicklistSchema<readonly ["COMPOSE", "REPLY", "FORWARD"], undefined>>;
115
- readonly envelope: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
116
- readonly html: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
117
- readonly attachmentMetadata: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
118
- readonly contentHash: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
119
- readonly scheduledAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>>;
120
- readonly status: import("./shared").AppwriteColumnSchema<v.PicklistSchema<readonly ["DRAFT", "SCHEDULED", "SENDING", "SENT", "FAILED", "CANCELLED"], undefined>>;
121
- readonly revision: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
122
- readonly sequence: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
123
- readonly executionLeaseId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
124
- readonly executionLeaseExpiresAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>>;
125
- readonly errorCode: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
126
- readonly account: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
127
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
128
- }, undefined>, v.TransformAction<{
129
- $id: string;
130
- }, string>]>], undefined>>;
131
- readonly fromAlias: import("./shared").AppwriteRelationshipSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
132
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
133
- }, undefined>, v.TransformAction<{
134
- $id: string;
135
- }, string>]>], undefined>, undefined>>;
136
- readonly referencedMessage: import("./shared").AppwriteRelationshipSchema<v.NullableSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
137
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
138
- }, undefined>, v.TransformAction<{
139
- $id: string;
140
- }, string>]>], undefined>, undefined>>;
141
- };
142
- readonly id: "drafts";
143
- readonly indexes: readonly [{
144
- readonly attributes: readonly ["accountAssignmentKey"];
145
- readonly name: "assignment_account";
146
- readonly type: "key";
147
- }, {
148
- readonly attributes: readonly ["accountAssignmentKey", "status"];
149
- readonly name: "assignment_account_status";
150
- readonly type: "key";
151
- }, {
152
- readonly attributes: readonly ["scheduledAt"];
153
- readonly name: "scheduled";
154
- readonly type: "key";
155
- }];
156
- readonly key: "drafts";
157
- readonly name: "Drafts";
158
- };
159
- export declare const threadsTable: {
160
- readonly fields: {
161
- readonly accountAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
162
- readonly providerId: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
163
- readonly subject: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
164
- readonly firstMessageAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
165
- readonly senderEmail: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RfcEmailAction<string, undefined>]>, v.MaxLengthAction<string, 320, undefined>]>, undefined>>;
166
- readonly senderName: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
167
- readonly preview: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
168
- readonly participants: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
169
- readonly labelIds: import("./shared").AppwriteColumnSchema<v.ArraySchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
170
- readonly latestMessageAt: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>>;
171
- readonly latestMessageId: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
172
- readonly messageCount: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
173
- readonly hasAttachments: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
174
- readonly unseenLocationCount: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
175
- readonly flaggedLocationCount: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
176
- readonly seen: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
177
- readonly flagged: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
178
- readonly archived: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
179
- readonly spam: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
180
- readonly trashed: import("./shared").AppwriteColumnSchema<v.BooleanSchema<undefined>>;
181
- readonly snoozedUntil: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, v.CheckAction<string, undefined>]>, undefined>>;
182
- readonly revision: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
183
- readonly searchText: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
184
- readonly account: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
185
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
186
- }, undefined>, v.TransformAction<{
187
- $id: string;
188
- }, string>]>], undefined>>;
189
- };
190
- readonly id: "threads";
191
- readonly indexes: readonly [{
192
- readonly attributes: readonly ["accountAssignmentKey", "providerId"];
193
- readonly name: "assignment_account_provider_unique";
194
- readonly type: "unique";
195
- }, {
196
- readonly attributes: readonly ["accountAssignmentKey", "latestMessageAt"];
197
- readonly name: "assignment_account_latest";
198
- readonly type: "key";
199
- }, {
200
- readonly attributes: readonly ["accountAssignmentKey", "seen", "latestMessageAt"];
201
- readonly name: "assignment_account_seen_latest";
202
- readonly type: "key";
203
- }, {
204
- readonly attributes: readonly ["accountAssignmentKey", "flagged", "latestMessageAt"];
205
- readonly name: "assignment_account_flagged_latest";
206
- readonly type: "key";
207
- }, {
208
- readonly attributes: readonly ["accountAssignmentKey", "snoozedUntil", "latestMessageAt"];
209
- readonly name: "assignment_account_snoozed_latest";
210
- readonly type: "key";
211
- }, {
212
- readonly attributes: readonly ["snoozedUntil"];
213
- readonly name: "snoozed_due";
214
- readonly type: "key";
215
- }, {
216
- readonly attributes: readonly ["accountAssignmentKey", "archived", "latestMessageAt"];
217
- readonly name: "assignment_account_archived_latest";
218
- readonly type: "key";
219
- }, {
220
- readonly attributes: readonly ["accountAssignmentKey", "spam", "latestMessageAt"];
221
- readonly name: "assignment_account_spam_latest";
222
- readonly type: "key";
223
- }, {
224
- readonly attributes: readonly ["accountAssignmentKey", "trashed", "latestMessageAt"];
225
- readonly name: "assignment_account_trashed_latest";
226
- readonly type: "key";
227
- }, {
228
- readonly attributes: readonly ["searchText"];
229
- readonly name: "search";
230
- readonly type: "fulltext";
231
- }];
232
- readonly key: "threads";
233
- readonly name: "Threads";
234
- };
235
- export declare const threadLabelsTable: {
236
- readonly fields: {
237
- readonly labelAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
238
- readonly latestMessageAt: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>>;
239
- readonly locationCount: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
240
- readonly threadAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
241
- readonly label: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
242
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
243
- }, undefined>, v.TransformAction<{
244
- $id: string;
245
- }, string>]>], undefined>>;
246
- readonly thread: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
247
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
248
- }, undefined>, v.TransformAction<{
249
- $id: string;
250
- }, string>]>], undefined>>;
251
- };
252
- readonly id: "thread_labels";
253
- readonly indexes: readonly [{
254
- readonly attributes: readonly ["threadAssignmentKey", "labelAssignmentKey"];
255
- readonly name: "assignment_thread_label_unique";
256
- readonly type: "unique";
257
- }, {
258
- readonly attributes: readonly ["labelAssignmentKey", "latestMessageAt"];
259
- readonly name: "assignment_label_latest";
260
- readonly type: "key";
261
- }];
262
- readonly key: "threadLabels";
263
- readonly name: "Thread labels";
264
- };
265
- export declare const messagesTable: {
266
- readonly fields: {
267
- readonly accountAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
268
- readonly providerId: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
269
- readonly rfcMessageId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
270
- readonly sender: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
271
- readonly senderName: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
272
- readonly recipients: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
273
- readonly sentAt: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>>;
274
- readonly receivedAt: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>>;
275
- readonly preview: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
276
- readonly attachmentMetadata: import("./shared").AppwriteColumnSchema<v.StringSchema<undefined>>;
277
- readonly htmlFileId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
278
- readonly rawFileId: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>>;
279
- readonly size: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
280
- readonly subject: import("./shared").AppwriteColumnSchema<v.NullableSchema<v.StringSchema<undefined>, undefined>>;
281
- readonly revision: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>>;
282
- readonly threadAssignmentKey: import("./shared").AppwriteColumnSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>>;
283
- readonly account: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
284
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
285
- }, undefined>, v.TransformAction<{
286
- $id: string;
287
- }, string>]>], undefined>>;
288
- readonly thread: import("./shared").AppwriteRelationshipSchema<v.UnionSchema<[v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>, v.SchemaWithPipe<readonly [v.ObjectSchema<{
289
- readonly $id: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 255, undefined>]>;
290
- }, undefined>, v.TransformAction<{
291
- $id: string;
292
- }, string>]>], undefined>>;
293
- };
294
- readonly id: "messages";
295
- readonly indexes: readonly [{
296
- readonly attributes: readonly ["threadAssignmentKey", "sentAt"];
297
- readonly name: "assignment_thread_sent";
298
- readonly type: "key";
299
- }, {
300
- readonly attributes: readonly ["accountAssignmentKey", "providerId"];
301
- readonly name: "assignment_account_provider_unique";
302
- readonly type: "unique";
303
- }, {
304
- readonly attributes: readonly ["accountAssignmentKey", "rfcMessageId"];
305
- readonly name: "assignment_account_rfc_message";
306
- readonly type: "key";
307
- }];
308
- readonly key: "messages";
309
- readonly name: "Messages";
310
- };
311
2
  export declare const mailboxTableInputs: {
312
3
  readonly contacts: {
313
4
  readonly fields: {
@@ -323,7 +14,6 @@ export declare const mailboxTableInputs: {
323
14
  $id: string;
324
15
  }, string>]>], undefined>>;
325
16
  };
326
- readonly id: "contacts";
327
17
  readonly indexes: readonly [{
328
18
  readonly attributes: readonly ["profileAssignmentKey", "lastContactedAt"];
329
19
  readonly name: "assignment_profile_last_contacted";
@@ -337,7 +27,6 @@ export declare const mailboxTableInputs: {
337
27
  readonly name: "search";
338
28
  readonly type: "fulltext";
339
29
  }];
340
- readonly key: "contacts";
341
30
  readonly name: "Contacts";
342
31
  };
343
32
  readonly drafts: {
@@ -371,7 +60,6 @@ export declare const mailboxTableInputs: {
371
60
  $id: string;
372
61
  }, string>]>], undefined>, undefined>>;
373
62
  };
374
- readonly id: "drafts";
375
63
  readonly indexes: readonly [{
376
64
  readonly attributes: readonly ["accountAssignmentKey"];
377
65
  readonly name: "assignment_account";
@@ -385,7 +73,6 @@ export declare const mailboxTableInputs: {
385
73
  readonly name: "scheduled";
386
74
  readonly type: "key";
387
75
  }];
388
- readonly key: "drafts";
389
76
  readonly name: "Drafts";
390
77
  };
391
78
  readonly messageLocations: {
@@ -420,7 +107,6 @@ export declare const mailboxTableInputs: {
420
107
  $id: string;
421
108
  }, string>]>], undefined>>;
422
109
  };
423
- readonly id: "message_locations";
424
110
  readonly indexes: readonly [{
425
111
  readonly attributes: readonly ["accountAssignmentKey", "labelAssignmentKey", "uidValidity", "uid"];
426
112
  readonly name: "assignment_account_label_uid";
@@ -434,7 +120,6 @@ export declare const mailboxTableInputs: {
434
120
  readonly name: "assignment_thread_label_latest";
435
121
  readonly type: "key";
436
122
  }];
437
- readonly key: "messageLocations";
438
123
  readonly name: "Message locations";
439
124
  };
440
125
  readonly messages: {
@@ -466,7 +151,6 @@ export declare const mailboxTableInputs: {
466
151
  $id: string;
467
152
  }, string>]>], undefined>>;
468
153
  };
469
- readonly id: "messages";
470
154
  readonly indexes: readonly [{
471
155
  readonly attributes: readonly ["threadAssignmentKey", "sentAt"];
472
156
  readonly name: "assignment_thread_sent";
@@ -480,7 +164,6 @@ export declare const mailboxTableInputs: {
480
164
  readonly name: "assignment_account_rfc_message";
481
165
  readonly type: "key";
482
166
  }];
483
- readonly key: "messages";
484
167
  readonly name: "Messages";
485
168
  };
486
169
  readonly threadAliases: {
@@ -499,7 +182,6 @@ export declare const mailboxTableInputs: {
499
182
  $id: string;
500
183
  }, string>]>], undefined>>;
501
184
  };
502
- readonly id: "thread_aliases";
503
185
  readonly indexes: readonly [{
504
186
  readonly attributes: readonly ["threadAssignmentKey", "aliasAssignmentKey"];
505
187
  readonly name: "assignment_thread_alias_unique";
@@ -509,7 +191,6 @@ export declare const mailboxTableInputs: {
509
191
  readonly name: "assignment_alias_latest";
510
192
  readonly type: "key";
511
193
  }];
512
- readonly key: "threadAliases";
513
194
  readonly name: "Thread aliases";
514
195
  };
515
196
  readonly threadLabels: {
@@ -529,7 +210,6 @@ export declare const mailboxTableInputs: {
529
210
  $id: string;
530
211
  }, string>]>], undefined>>;
531
212
  };
532
- readonly id: "thread_labels";
533
213
  readonly indexes: readonly [{
534
214
  readonly attributes: readonly ["threadAssignmentKey", "labelAssignmentKey"];
535
215
  readonly name: "assignment_thread_label_unique";
@@ -539,7 +219,6 @@ export declare const mailboxTableInputs: {
539
219
  readonly name: "assignment_label_latest";
540
220
  readonly type: "key";
541
221
  }];
542
- readonly key: "threadLabels";
543
222
  readonly name: "Thread labels";
544
223
  };
545
224
  readonly threads: {
@@ -573,7 +252,6 @@ export declare const mailboxTableInputs: {
573
252
  $id: string;
574
253
  }, string>]>], undefined>>;
575
254
  };
576
- readonly id: "threads";
577
255
  readonly indexes: readonly [{
578
256
  readonly attributes: readonly ["accountAssignmentKey", "providerId"];
579
257
  readonly name: "assignment_account_provider_unique";
@@ -615,7 +293,6 @@ export declare const mailboxTableInputs: {
615
293
  readonly name: "search";
616
294
  readonly type: "fulltext";
617
295
  }];
618
- readonly key: "threads";
619
296
  readonly name: "Threads";
620
297
  };
621
298
  };
@@ -1 +1 @@
1
- {"version":3,"file":"mailbox.d.ts","sourceRoot":"","sources":["../../../src/appwrite/tableContract/mailbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,SAAS,CAAA;AAuB5B,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"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqK7B,CAAA"}