@marcoappio/marco-config 2.0.474 → 2.0.475

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":"getThread.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/getThread.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAGlE,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,MAAM,CAAA;CACX,CAAA;AASD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gBAMrB,CAAA"}
@@ -0,0 +1,14 @@
1
+ import { syncedQueryWithContext } from '@rocicorp/zero';
2
+ import * as v from 'valibot';
3
+ import { z } from '../../zero/queries';
4
+ const parseArgs = (args) => {
5
+ const schema = v.object({
6
+ id: v.string(),
7
+ });
8
+ return [v.parse(schema, args[0])];
9
+ };
10
+ export const getThread = syncedQueryWithContext('getThread', parseArgs, ({ userId }, { id }) => z.thread
11
+ .where('userId', userId)
12
+ .where('id', id)
13
+ .related('messages', m => m.related('recipients').related('attachments').orderBy('envelopeDate', 'asc'))
14
+ .one());
@@ -28,7 +28,7 @@ export const getThreadList = syncedQueryWithContext('getThreadList', parseArgs,
28
28
  .related('thread', t => {
29
29
  let threadQuery = t
30
30
  .where('userId', userId)
31
- .related('messages', m => m.related('attachments').orderBy('envelopeDate', 'asc'));
31
+ .related('messages', x => x.related('attachments').orderBy('envelopeDate', 'asc'));
32
32
  if (where?.id) {
33
33
  threadQuery = threadQuery.where('id', where.id);
34
34
  }
@@ -57,7 +57,7 @@ export const getThreadList = syncedQueryWithContext('getThreadList', parseArgs,
57
57
  return threadQuery;
58
58
  });
59
59
  for (const additionalLabelId of additionalLabelIds) {
60
- query = query.whereExists('thread', t => t.whereExists('threadByLabel', tbl => tbl.where('labelId', additionalLabelId)));
60
+ query = query.whereExists('thread', x => x.whereExists('threadByLabel', y => y.where('labelId', additionalLabelId)));
61
61
  }
62
62
  return query;
63
63
  });
@@ -28,7 +28,7 @@ export const getThreads = syncedQueryWithContext('getThreads', parseArgs, ({ use
28
28
  .related('thread', t => {
29
29
  let threadQuery = t
30
30
  .where('userId', userId)
31
- .related('messages', m => m.related('recipients').related('attachments').orderBy('envelopeDate', 'asc'));
31
+ .related('messages', x => x.related('recipients').related('attachments').orderBy('envelopeDate', 'asc'));
32
32
  if (where?.id) {
33
33
  threadQuery = threadQuery.where('id', where.id);
34
34
  }
@@ -57,7 +57,7 @@ export const getThreads = syncedQueryWithContext('getThreads', parseArgs, ({ use
57
57
  return threadQuery;
58
58
  });
59
59
  for (const additionalLabelId of additionalLabelIds) {
60
- query = query.whereExists('thread', t => t.whereExists('threadByLabel', tbl => tbl.where('labelId', additionalLabelId)));
60
+ query = query.whereExists('thread', x => x.whereExists('threadByLabel', y => y.where('labelId', additionalLabelId)));
61
61
  }
62
62
  return query;
63
63
  });
@@ -973,6 +973,7 @@ export declare const z: import("@rocicorp/zero").SchemaQuery<{
973
973
  export { getAccounts } from './getAccounts';
974
974
  export { getContacts } from './getContacts';
975
975
  export { getDrafts } from './getDrafts';
976
+ export { getThread } from './getThread';
976
977
  export { getThreadList } from './getThreadList';
977
978
  export { getThreads } from './getThreads';
978
979
  export { getUser } from './getUser';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/zero/queries/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA"}
@@ -4,6 +4,7 @@ export const z = createBuilder(schema);
4
4
  export { getAccounts } from './getAccounts';
5
5
  export { getContacts } from './getContacts';
6
6
  export { getDrafts } from './getDrafts';
7
+ export { getThread } from './getThread';
7
8
  export { getThreadList } from './getThreadList';
8
9
  export { getThreads } from './getThreads';
9
10
  export { getUser } from './getUser';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marcoappio/marco-config",
3
- "version": "2.0.474",
3
+ "version": "2.0.475",
4
4
  "author": "team@marcoapp.io",
5
5
  "main": "dist/index.js",
6
6
  "repository": "git@github.com:marcoappio/marco-config.git",