@marcoappio/marco-config 2.0.471 → 2.0.473
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/zero/index.d.ts +2434 -44
- package/dist/zero/index.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.d.ts.map +1 -1
- package/dist/zero/mutators/threadMutators/threadMutators.js +60 -2
- package/dist/zero/mutators/threadMutators/threadMutators.test.js +105 -2
- package/dist/zero/queries/getAccounts.d.ts +49 -0
- package/dist/zero/queries/getAccounts.d.ts.map +1 -1
- package/dist/zero/queries/getContacts.d.ts +49 -0
- package/dist/zero/queries/getContacts.d.ts.map +1 -1
- package/dist/zero/queries/getDrafts.d.ts +49 -0
- package/dist/zero/queries/getDrafts.d.ts.map +1 -1
- package/dist/zero/queries/getThreadList.d.ts +1054 -0
- package/dist/zero/queries/getThreadList.d.ts.map +1 -1
- package/dist/zero/queries/getThreadList.js +42 -5
- package/dist/zero/queries/getThreads.d.ts +1062 -0
- package/dist/zero/queries/getThreads.d.ts.map +1 -1
- package/dist/zero/queries/getThreads.js +42 -5
- package/dist/zero/queries/getUser.d.ts +49 -0
- package/dist/zero/queries/getUser.d.ts.map +1 -1
- package/dist/zero/queries/index.d.ts +49 -0
- package/dist/zero/queries/index.d.ts.map +1 -1
- package/dist/zero/schema.d.ts +78 -0
- package/dist/zero/schema.d.ts.map +1 -1
- package/dist/zero/schema.js +28 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getThreads.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/getThreads.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAOlE,KAAK,cAAc,GAAG;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE;QACN,OAAO,CAAC,EAAE,OAAO,CAAA;Q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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyGtB,CAAA"}
|
|
@@ -20,6 +20,48 @@ const parseArgs = (args) => {
|
|
|
20
20
|
return [v.parse(schema, args[0])];
|
|
21
21
|
};
|
|
22
22
|
export const getThreads = syncedQueryWithContext('getThreads', parseArgs, ({ userId }, { search, limit, where }) => {
|
|
23
|
+
if (where?.labelIds && where.labelIds.length > 0) {
|
|
24
|
+
const [primaryLabelId, ...additionalLabelIds] = where.labelIds;
|
|
25
|
+
let query = z.threadByLabel
|
|
26
|
+
.where('labelId', primaryLabelId)
|
|
27
|
+
.orderBy('latestMessageDate', 'desc')
|
|
28
|
+
.limit(limit)
|
|
29
|
+
.related('thread', t => {
|
|
30
|
+
let threadQuery = t
|
|
31
|
+
.where('userId', userId)
|
|
32
|
+
.related('messages', m => m.related('recipients').related('attachments').orderBy('envelopeDate', 'asc'));
|
|
33
|
+
if (where?.id) {
|
|
34
|
+
threadQuery = threadQuery.where('id', where.id);
|
|
35
|
+
}
|
|
36
|
+
if (typeof where?.flagged === 'boolean') {
|
|
37
|
+
threadQuery = threadQuery.where('flagged', where.flagged);
|
|
38
|
+
}
|
|
39
|
+
if (typeof where?.seen === 'boolean') {
|
|
40
|
+
threadQuery = threadQuery.where('seen', where.seen);
|
|
41
|
+
}
|
|
42
|
+
if (where?.messageIds && where.messageIds.length > 0) {
|
|
43
|
+
for (const messageId of where.messageIds) {
|
|
44
|
+
threadQuery = threadQuery.whereExists('messages', x => x.where('id', messageId));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (where?.participants && where.participants.length > 0) {
|
|
48
|
+
for (const participant of where.participants) {
|
|
49
|
+
threadQuery = threadQuery.whereExists('messages', x => x.whereExists('recipients', y => y.where('emailAddress', participant)));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
if (search) {
|
|
53
|
+
const tokens = threadsUtils.processSearchTerm(search);
|
|
54
|
+
if (tokens.length > 0) {
|
|
55
|
+
threadQuery = threadQuery.where(({ and, cmp }) => and(...tokens.map(x => cmp('words', 'ILIKE', `%${x}%`))));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return threadQuery;
|
|
59
|
+
});
|
|
60
|
+
for (const additionalLabelId of additionalLabelIds) {
|
|
61
|
+
query = query.whereExists('thread', t => t.whereExists('threadByLabel', tbl => tbl.where('labelId', additionalLabelId)));
|
|
62
|
+
}
|
|
63
|
+
return query;
|
|
64
|
+
}
|
|
23
65
|
let query = z.thread
|
|
24
66
|
.where('userId', userId)
|
|
25
67
|
.related('messages', x => x.related('recipients').related('attachments').orderBy('envelopeDate', 'asc'))
|
|
@@ -33,11 +75,6 @@ export const getThreads = syncedQueryWithContext('getThreads', parseArgs, ({ use
|
|
|
33
75
|
if (typeof where?.seen === 'boolean') {
|
|
34
76
|
query = query.where('seen', where.seen);
|
|
35
77
|
}
|
|
36
|
-
if (where?.labelIds && where.labelIds.length > 0) {
|
|
37
|
-
for (const labelId of where.labelIds) {
|
|
38
|
-
query = query.where('labelIdList', 'LIKE', `% ${labelId} %`);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
78
|
if (where?.messageIds && where.messageIds.length > 0) {
|
|
42
79
|
for (const messageId of where.messageIds) {
|
|
43
80
|
query = query.whereExists('messages', x => x.where('id', messageId));
|
|
@@ -533,6 +533,35 @@ export declare const getUser: import("@rocicorp/zero").SyncedQuery<"getUser", Ma
|
|
|
533
533
|
} & {
|
|
534
534
|
primaryKey: ["accountId", "labelId", "threadMessageId"];
|
|
535
535
|
};
|
|
536
|
+
readonly threadByLabel: {
|
|
537
|
+
name: "threadByLabel";
|
|
538
|
+
columns: {
|
|
539
|
+
readonly labelId: {
|
|
540
|
+
type: "string";
|
|
541
|
+
optional: false;
|
|
542
|
+
customType: string;
|
|
543
|
+
} & {
|
|
544
|
+
serverName: string;
|
|
545
|
+
};
|
|
546
|
+
readonly latestMessageDate: {
|
|
547
|
+
type: "number";
|
|
548
|
+
optional: false;
|
|
549
|
+
customType: number;
|
|
550
|
+
} & {
|
|
551
|
+
serverName: string;
|
|
552
|
+
};
|
|
553
|
+
readonly threadId: {
|
|
554
|
+
type: "string";
|
|
555
|
+
optional: false;
|
|
556
|
+
customType: string;
|
|
557
|
+
} & {
|
|
558
|
+
serverName: string;
|
|
559
|
+
};
|
|
560
|
+
};
|
|
561
|
+
primaryKey: readonly [string, ...string[]];
|
|
562
|
+
} & {
|
|
563
|
+
primaryKey: ["labelId", "threadId"];
|
|
564
|
+
};
|
|
536
565
|
readonly threadMessage: {
|
|
537
566
|
name: "threadMessage";
|
|
538
567
|
columns: {
|
|
@@ -844,6 +873,12 @@ export declare const getUser: import("@rocicorp/zero").SyncedQuery<"getUser", Ma
|
|
|
844
873
|
readonly destSchema: "threadMessage";
|
|
845
874
|
readonly cardinality: "many";
|
|
846
875
|
}];
|
|
876
|
+
threadByLabel: [{
|
|
877
|
+
readonly sourceField: string[];
|
|
878
|
+
readonly destField: ("latestMessageDate" | "labelId" | "threadId")[];
|
|
879
|
+
readonly destSchema: "threadByLabel";
|
|
880
|
+
readonly cardinality: "many";
|
|
881
|
+
}];
|
|
847
882
|
user: [{
|
|
848
883
|
readonly sourceField: string[];
|
|
849
884
|
readonly destField: ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
@@ -871,6 +906,20 @@ export declare const getUser: import("@rocicorp/zero").SyncedQuery<"getUser", Ma
|
|
|
871
906
|
readonly cardinality: "one";
|
|
872
907
|
}];
|
|
873
908
|
};
|
|
909
|
+
readonly threadByLabel: {
|
|
910
|
+
label: [{
|
|
911
|
+
readonly sourceField: string[];
|
|
912
|
+
readonly destField: ("id" | "name" | "accountId" | "path" | "specialUse" | "uidValidity" | "unreadCount")[];
|
|
913
|
+
readonly destSchema: "accountLabel";
|
|
914
|
+
readonly cardinality: "one";
|
|
915
|
+
}];
|
|
916
|
+
thread: [{
|
|
917
|
+
readonly sourceField: string[];
|
|
918
|
+
readonly destField: ("id" | "userId" | "accountId" | "flagged" | "labelIdList" | "latestMessageDate" | "seen" | "words")[];
|
|
919
|
+
readonly destSchema: "thread";
|
|
920
|
+
readonly cardinality: "one";
|
|
921
|
+
}];
|
|
922
|
+
};
|
|
874
923
|
readonly threadMessage: {
|
|
875
924
|
attachments: [{
|
|
876
925
|
readonly sourceField: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/getUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAGlE,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"getUser.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/getUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,C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;;;;;;;;;;;;;;;;;;;;GAMnB,CAAA"}
|
|
@@ -532,6 +532,35 @@ export declare const z: import("@rocicorp/zero").SchemaQuery<{
|
|
|
532
532
|
} & {
|
|
533
533
|
primaryKey: ["accountId", "labelId", "threadMessageId"];
|
|
534
534
|
};
|
|
535
|
+
readonly threadByLabel: {
|
|
536
|
+
name: "threadByLabel";
|
|
537
|
+
columns: {
|
|
538
|
+
readonly labelId: {
|
|
539
|
+
type: "string";
|
|
540
|
+
optional: false;
|
|
541
|
+
customType: string;
|
|
542
|
+
} & {
|
|
543
|
+
serverName: string;
|
|
544
|
+
};
|
|
545
|
+
readonly latestMessageDate: {
|
|
546
|
+
type: "number";
|
|
547
|
+
optional: false;
|
|
548
|
+
customType: number;
|
|
549
|
+
} & {
|
|
550
|
+
serverName: string;
|
|
551
|
+
};
|
|
552
|
+
readonly threadId: {
|
|
553
|
+
type: "string";
|
|
554
|
+
optional: false;
|
|
555
|
+
customType: string;
|
|
556
|
+
} & {
|
|
557
|
+
serverName: string;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
primaryKey: readonly [string, ...string[]];
|
|
561
|
+
} & {
|
|
562
|
+
primaryKey: ["labelId", "threadId"];
|
|
563
|
+
};
|
|
535
564
|
readonly threadMessage: {
|
|
536
565
|
name: "threadMessage";
|
|
537
566
|
columns: {
|
|
@@ -843,6 +872,12 @@ export declare const z: import("@rocicorp/zero").SchemaQuery<{
|
|
|
843
872
|
readonly destSchema: "threadMessage";
|
|
844
873
|
readonly cardinality: "many";
|
|
845
874
|
}];
|
|
875
|
+
threadByLabel: [{
|
|
876
|
+
readonly sourceField: string[];
|
|
877
|
+
readonly destField: ("latestMessageDate" | "labelId" | "threadId")[];
|
|
878
|
+
readonly destSchema: "threadByLabel";
|
|
879
|
+
readonly cardinality: "many";
|
|
880
|
+
}];
|
|
846
881
|
user: [{
|
|
847
882
|
readonly sourceField: string[];
|
|
848
883
|
readonly destField: ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
@@ -870,6 +905,20 @@ export declare const z: import("@rocicorp/zero").SchemaQuery<{
|
|
|
870
905
|
readonly cardinality: "one";
|
|
871
906
|
}];
|
|
872
907
|
};
|
|
908
|
+
readonly threadByLabel: {
|
|
909
|
+
label: [{
|
|
910
|
+
readonly sourceField: string[];
|
|
911
|
+
readonly destField: ("id" | "name" | "accountId" | "path" | "specialUse" | "uidValidity" | "unreadCount")[];
|
|
912
|
+
readonly destSchema: "accountLabel";
|
|
913
|
+
readonly cardinality: "one";
|
|
914
|
+
}];
|
|
915
|
+
thread: [{
|
|
916
|
+
readonly sourceField: string[];
|
|
917
|
+
readonly destField: ("id" | "userId" | "accountId" | "flagged" | "labelIdList" | "latestMessageDate" | "seen" | "words")[];
|
|
918
|
+
readonly destSchema: "thread";
|
|
919
|
+
readonly cardinality: "one";
|
|
920
|
+
}];
|
|
921
|
+
};
|
|
873
922
|
readonly threadMessage: {
|
|
874
923
|
attachments: [{
|
|
875
924
|
readonly sourceField: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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534
534
|
};
|
|
535
|
+
readonly threadByLabel: {
|
|
536
|
+
name: "threadByLabel";
|
|
537
|
+
columns: {
|
|
538
|
+
readonly labelId: {
|
|
539
|
+
type: "string";
|
|
540
|
+
optional: false;
|
|
541
|
+
customType: string;
|
|
542
|
+
} & {
|
|
543
|
+
serverName: string;
|
|
544
|
+
};
|
|
545
|
+
readonly latestMessageDate: {
|
|
546
|
+
type: "number";
|
|
547
|
+
optional: false;
|
|
548
|
+
customType: number;
|
|
549
|
+
} & {
|
|
550
|
+
serverName: string;
|
|
551
|
+
};
|
|
552
|
+
readonly threadId: {
|
|
553
|
+
type: "string";
|
|
554
|
+
optional: false;
|
|
555
|
+
customType: string;
|
|
556
|
+
} & {
|
|
557
|
+
serverName: string;
|
|
558
|
+
};
|
|
559
|
+
};
|
|
560
|
+
primaryKey: readonly [string, ...string[]];
|
|
561
|
+
} & {
|
|
562
|
+
primaryKey: ["labelId", "threadId"];
|
|
563
|
+
};
|
|
535
564
|
readonly threadMessage: {
|
|
536
565
|
name: "threadMessage";
|
|
537
566
|
columns: {
|
|
@@ -843,6 +872,12 @@ export declare const schema: {
|
|
|
843
872
|
readonly destSchema: "threadMessage";
|
|
844
873
|
readonly cardinality: "many";
|
|
845
874
|
}];
|
|
875
|
+
threadByLabel: [{
|
|
876
|
+
readonly sourceField: string[];
|
|
877
|
+
readonly destField: ("latestMessageDate" | "labelId" | "threadId")[];
|
|
878
|
+
readonly destSchema: "threadByLabel";
|
|
879
|
+
readonly cardinality: "many";
|
|
880
|
+
}];
|
|
846
881
|
user: [{
|
|
847
882
|
readonly sourceField: string[];
|
|
848
883
|
readonly destField: ("id" | "profilePicture" | "undoSendEnabled" | "name")[];
|
|
@@ -870,6 +905,20 @@ export declare const schema: {
|
|
|
870
905
|
readonly cardinality: "one";
|
|
871
906
|
}];
|
|
872
907
|
};
|
|
908
|
+
readonly threadByLabel: {
|
|
909
|
+
label: [{
|
|
910
|
+
readonly sourceField: string[];
|
|
911
|
+
readonly destField: ("id" | "name" | "accountId" | "path" | "specialUse" | "uidValidity" | "unreadCount")[];
|
|
912
|
+
readonly destSchema: "accountLabel";
|
|
913
|
+
readonly cardinality: "one";
|
|
914
|
+
}];
|
|
915
|
+
thread: [{
|
|
916
|
+
readonly sourceField: string[];
|
|
917
|
+
readonly destField: ("id" | "userId" | "accountId" | "flagged" | "labelIdList" | "latestMessageDate" | "seen" | "words")[];
|
|
918
|
+
readonly destSchema: "thread";
|
|
919
|
+
readonly cardinality: "one";
|
|
920
|
+
}];
|
|
921
|
+
};
|
|
873
922
|
readonly threadMessage: {
|
|
874
923
|
attachments: [{
|
|
875
924
|
readonly sourceField: string[];
|
|
@@ -1332,6 +1381,35 @@ export declare const zeroTables: {
|
|
|
1332
1381
|
} & {
|
|
1333
1382
|
primaryKey: ["id"];
|
|
1334
1383
|
}>;
|
|
1384
|
+
readonly threadByLabel: import("@rocicorp/zero").TableBuilderWithColumns<{
|
|
1385
|
+
name: "threadByLabel";
|
|
1386
|
+
columns: {
|
|
1387
|
+
readonly labelId: {
|
|
1388
|
+
type: "string";
|
|
1389
|
+
optional: false;
|
|
1390
|
+
customType: string;
|
|
1391
|
+
} & {
|
|
1392
|
+
serverName: string;
|
|
1393
|
+
};
|
|
1394
|
+
readonly latestMessageDate: {
|
|
1395
|
+
type: "number";
|
|
1396
|
+
optional: false;
|
|
1397
|
+
customType: number;
|
|
1398
|
+
} & {
|
|
1399
|
+
serverName: string;
|
|
1400
|
+
};
|
|
1401
|
+
readonly threadId: {
|
|
1402
|
+
type: "string";
|
|
1403
|
+
optional: false;
|
|
1404
|
+
customType: string;
|
|
1405
|
+
} & {
|
|
1406
|
+
serverName: string;
|
|
1407
|
+
};
|
|
1408
|
+
};
|
|
1409
|
+
primaryKey: readonly [string, ...string[]];
|
|
1410
|
+
} & {
|
|
1411
|
+
primaryKey: ["labelId", "threadId"];
|
|
1412
|
+
}>;
|
|
1335
1413
|
readonly threadLabel: import("@rocicorp/zero").TableBuilderWithColumns<{
|
|
1336
1414
|
name: "threadLabel";
|
|
1337
1415
|
columns: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/zero/schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/zero/schema.ts"],"names":[],"mappings":"AAmbA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA1VJ,MAAM;4BACX,MAAM,EAAE;4BACR,MAAM,EAAE;6BACP,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;CA4YT,CAAA"}
|
package/dist/zero/schema.js
CHANGED
|
@@ -111,6 +111,14 @@ const threadLabel = table('threadLabel')
|
|
|
111
111
|
uidValidity: numeric().from('uid_validity'),
|
|
112
112
|
})
|
|
113
113
|
.primaryKey('accountId', 'labelId', 'threadMessageId');
|
|
114
|
+
const threadByLabel = table('threadByLabel')
|
|
115
|
+
.from('thread_by_label')
|
|
116
|
+
.columns({
|
|
117
|
+
labelId: string().from('label_id'),
|
|
118
|
+
latestMessageDate: numeric().from('latest_message_date'),
|
|
119
|
+
threadId: string().from('thread_id'),
|
|
120
|
+
})
|
|
121
|
+
.primaryKey('labelId', 'threadId');
|
|
114
122
|
const threadMessage = table('threadMessage')
|
|
115
123
|
.from('thread_message')
|
|
116
124
|
.columns({
|
|
@@ -284,6 +292,11 @@ const threadRelationships = relationships(thread, ({ one, many }) => ({
|
|
|
284
292
|
destSchema: threadMessage,
|
|
285
293
|
sourceField: ['id'],
|
|
286
294
|
}),
|
|
295
|
+
threadByLabel: many({
|
|
296
|
+
destField: ['threadId'],
|
|
297
|
+
destSchema: threadByLabel,
|
|
298
|
+
sourceField: ['id'],
|
|
299
|
+
}),
|
|
287
300
|
user: one({
|
|
288
301
|
destField: ['id'],
|
|
289
302
|
destSchema: user,
|
|
@@ -307,6 +320,18 @@ const threadLabelRelationships = relationships(threadLabel, ({ one }) => ({
|
|
|
307
320
|
sourceField: ['threadId'],
|
|
308
321
|
}),
|
|
309
322
|
}));
|
|
323
|
+
const threadByLabelRelationships = relationships(threadByLabel, ({ one }) => ({
|
|
324
|
+
label: one({
|
|
325
|
+
destField: ['id'],
|
|
326
|
+
destSchema: accountLabel,
|
|
327
|
+
sourceField: ['labelId'],
|
|
328
|
+
}),
|
|
329
|
+
thread: one({
|
|
330
|
+
destField: ['id'],
|
|
331
|
+
destSchema: thread,
|
|
332
|
+
sourceField: ['threadId'],
|
|
333
|
+
}),
|
|
334
|
+
}));
|
|
310
335
|
const threadMessageRelationships = relationships(threadMessage, ({ one, many }) => ({
|
|
311
336
|
attachments: many({
|
|
312
337
|
destField: ['threadMessageId'],
|
|
@@ -360,6 +385,7 @@ export const schema = createSchema({
|
|
|
360
385
|
draftAttachmentRelationships,
|
|
361
386
|
threadRelationships,
|
|
362
387
|
threadLabelRelationships,
|
|
388
|
+
threadByLabelRelationships,
|
|
363
389
|
threadMessageRelationships,
|
|
364
390
|
threadMessageAttachmentRelationships,
|
|
365
391
|
threadMessageRecipientRelationships,
|
|
@@ -375,6 +401,7 @@ export const schema = createSchema({
|
|
|
375
401
|
draftAttachment,
|
|
376
402
|
thread,
|
|
377
403
|
threadLabel,
|
|
404
|
+
threadByLabel,
|
|
378
405
|
threadMessage,
|
|
379
406
|
threadMessageRecipient,
|
|
380
407
|
threadMessageAttachment,
|
|
@@ -388,6 +415,7 @@ export const zeroTables = {
|
|
|
388
415
|
draft,
|
|
389
416
|
draftAttachment,
|
|
390
417
|
thread,
|
|
418
|
+
threadByLabel,
|
|
391
419
|
threadLabel,
|
|
392
420
|
threadMessage,
|
|
393
421
|
threadMessageAttachment,
|