@vrplatform/kysely 1.3.9 → 1.3.12

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.
@@ -290,6 +290,7 @@ export interface AccountingTransaction {
290
290
  description: string;
291
291
  dueAt: Timestamp | null;
292
292
  id: Generated<string>;
293
+ matchBankAccountLast4: string | null;
293
294
  matchers: Json | null;
294
295
  matchStatus: Generated<string | null>;
295
296
  paidAt: Timestamp | null;
@@ -401,19 +402,24 @@ export interface CoreFlow {
401
402
  appId: string;
402
403
  description: string | null;
403
404
  id: Generated<string>;
405
+ isPublic: Generated<boolean>;
406
+ leftType: string | null;
404
407
  mappingSchema: Json;
408
+ rightType: string | null;
405
409
  settingSchema: Json;
406
410
  title: string;
407
411
  type: Generated<PublicFlowType | null>;
408
412
  uniqueRef: string;
413
+ useGlobalMapping: Generated<boolean>;
409
414
  }
410
415
 
411
416
  export interface CoreFlowMapping {
412
417
  accountId: string | null;
413
418
  bookingChannelId: string | null;
419
+ connectionId: string;
414
420
  contactId: string | null;
415
421
  createdAt: Generated<Timestamp>;
416
- flowId: string;
422
+ flowId: string | null;
417
423
  id: Generated<string>;
418
424
  listingId: string | null;
419
425
  mappingKey: string;
@@ -1164,6 +1170,7 @@ export interface PublicPaymentLine {
1164
1170
  connectionId: string | null;
1165
1171
  createdAt: Generated<Timestamp>;
1166
1172
  description: string | null;
1173
+ generalLedgerPostingAt: Timestamp | null;
1167
1174
  id: Generated<string>;
1168
1175
  lineId: string | null;
1169
1176
  listingId: string | null;
@@ -1393,6 +1400,7 @@ export interface PublicSource {
1393
1400
  indexedJson: Json | null;
1394
1401
  isArchived: Generated<boolean | null>;
1395
1402
  json: Json | null;
1403
+ lastWebhookAt: Timestamp | null;
1396
1404
  /**
1397
1405
  * deprecated
1398
1406
  */
@@ -1718,6 +1726,17 @@ export interface TrackingIntercomReportConversation {
1718
1726
  reportId: string;
1719
1727
  }
1720
1728
 
1729
+ export interface TrackingMetricCache {
1730
+ connectionId: Generated<string>;
1731
+ date: Timestamp;
1732
+ name: Generated<string>;
1733
+ refreshedAt: Generated<Timestamp>;
1734
+ status: Generated<string>;
1735
+ tenantId: string;
1736
+ total: Numeric;
1737
+ type: string;
1738
+ }
1739
+
1721
1740
  export interface TrackingMonitorConnection {
1722
1741
  appId: string;
1723
1742
  connectionId: string;
@@ -1875,6 +1894,7 @@ export interface DB {
1875
1894
  "tracking.intercomConversationUser": TrackingIntercomConversationUser;
1876
1895
  "tracking.intercomReport": TrackingIntercomReport;
1877
1896
  "tracking.intercomReportConversation": TrackingIntercomReportConversation;
1897
+ "tracking.metricCache": TrackingMetricCache;
1878
1898
  "tracking.monitorConnection": TrackingMonitorConnection;
1879
1899
  "tracking.monitorConnectionState": TrackingMonitorConnectionState;
1880
1900
  }
@@ -1,17 +0,0 @@
1
- import { type LogConfig } from 'kysely';
2
- import type { Kysely } from '../isomorphic';
3
- export * from '../isomorphic';
4
- export type UseBrowserKyselyOptions = {
5
- repositoryName?: string;
6
- log?: true | LogConfig;
7
- adapter?: 'memory' | 'idb';
8
- };
9
- /**
10
- * Initialize Kysely with PGlite for browser environments.
11
- *
12
- * @param dumpData - The database dump data as a Blob, ArrayBuffer, or Uint8Array.
13
- * This should be the .data.tar file loaded as a blob.
14
- * @param options - Configuration options
15
- * @returns A Kysely instance connected to the in-memory PGlite database
16
- */
17
- export declare function useBrowserKysely(options?: UseBrowserKyselyOptions): Promise<Kysely>;
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.useBrowserKysely = useBrowserKysely;
18
- // import { live } from '@electric-sql/pglite/live';
19
- const worker_1 = require("@electric-sql/pglite/worker");
20
- const kysely_1 = require("kysely");
21
- const kysely_pglite_dialect_1 = require("kysely-pglite-dialect");
22
- __exportStar(require("../isomorphic"), exports);
23
- // Create worker with Vite-compatible URL
24
- const worker = new Worker(new URL('./worker.ts', import.meta.url), {
25
- type: 'module',
26
- });
27
- /**
28
- * Initialize Kysely with PGlite for browser environments.
29
- *
30
- * @param dumpData - The database dump data as a Blob, ArrayBuffer, or Uint8Array.
31
- * This should be the .data.tar file loaded as a blob.
32
- * @param options - Configuration options
33
- * @returns A Kysely instance connected to the in-memory PGlite database
34
- */
35
- async function useBrowserKysely(options = {}) {
36
- let isDestroyed = false;
37
- //const now = performance.now();
38
- const pglite = new worker_1.PGliteWorker(worker, {
39
- dataDir: options.adapter === 'idb' ? 'idb://pglite' : 'memory://',
40
- extensions: {
41
- //live,
42
- },
43
- });
44
- const dialect = new kysely_pglite_dialect_1.PGliteDialect(pglite);
45
- const kysely = new kysely_1.Kysely({
46
- dialect,
47
- log: options.log === true ? ['query', 'error'] : options.log,
48
- plugins: [new kysely_1.CamelCasePlugin()],
49
- });
50
- const originalDestroy = kysely.destroy.bind(kysely);
51
- kysely.destroy = async () => {
52
- if (isDestroyed)
53
- return;
54
- isDestroyed = true;
55
- //const destroyTime = performance.now();
56
- await originalDestroy().catch(() => undefined);
57
- await pglite.close().catch(() => undefined);
58
- //console.log(
59
- // `Database destroyed: ${Math.round(performance.now() - destroyTime)}ms`
60
- //);
61
- };
62
- //console.log(`Database initialized: ${Math.round(performance.now() - now)}ms`);
63
- return kysely;
64
- }
65
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,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AAS,CAAC,CAAC;QAC/C,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC5C,cAAc;QACd,0EAA0E;QAC1E,IAAI;IACN,CAAC,CAAC;IAEF,gFAAgF;IAEhF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// import { live } from '@electric-sql/pglite/live';\nimport { PGliteWorker } from '@electric-sql/pglite/worker';\nimport { CamelCasePlugin, Kysely as K, type LogConfig } from 'kysely';\nimport { PGliteDialect } from 'kysely-pglite-dialect';\nimport type { DB, Kysely } from '../isomorphic';\n\nexport * from '../isomorphic';\n\nexport type UseBrowserKyselyOptions = {\n repositoryName?: string;\n log?: true | LogConfig;\n adapter?: 'memory' | 'idb';\n};\n\n// Create worker with Vite-compatible URL\nconst worker = new Worker(new URL('./worker.ts', import.meta.url), {\n type: 'module',\n});\n\n/**\n * Initialize Kysely with PGlite for browser environments.\n *\n * @param dumpData - The database dump data as a Blob, ArrayBuffer, or Uint8Array.\n * This should be the .data.tar file loaded as a blob.\n * @param options - Configuration options\n * @returns A Kysely instance connected to the in-memory PGlite database\n */\nexport async function useBrowserKysely(\n options: UseBrowserKyselyOptions = {}\n): Promise<Kysely> {\n let isDestroyed = false;\n //const now = performance.now();\n\n const pglite = new PGliteWorker(worker, {\n dataDir: options.adapter === 'idb' ? 'idb://pglite' : 'memory://',\n extensions: {\n //live,\n },\n });\n\n const dialect = new PGliteDialect(pglite);\n const kysely = new K<DB>({\n dialect,\n log: options.log === true ? ['query', 'error'] : options.log,\n plugins: [new CamelCasePlugin()],\n });\n\n const originalDestroy = kysely.destroy.bind(kysely);\n kysely.destroy = async () => {\n if (isDestroyed) return;\n isDestroyed = true;\n //const destroyTime = performance.now();\n await originalDestroy().catch(() => undefined);\n await pglite.close().catch(() => undefined);\n //console.log(\n // `Database destroyed: ${Math.round(performance.now() - destroyTime)}ms`\n //);\n };\n\n //console.log(`Database initialized: ${Math.round(performance.now() - now)}ms`);\n\n return kysely;\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const pglite_1 = require("@electric-sql/pglite");
4
- const worker_1 = require("@electric-sql/pglite/worker");
5
- (0, worker_1.worker)({
6
- async init({ dataDir }) {
7
- const databases = await self.indexedDB.databases();
8
- if (dataDir?.startsWith('idb://') && databases.length) {
9
- const pglite = new pglite_1.PGlite({
10
- dataDir,
11
- });
12
- // warm up
13
- await pglite.sql `SELECT 1`;
14
- return pglite;
15
- }
16
- console.log('Loading database dump...', dataDir);
17
- // Load the database dump file
18
- const dumpResponse = await fetch('/.data.tar').catch((error) => {
19
- console.error('Failed to load database dump:', error);
20
- throw new Error(`Failed to load database dump: ${error.message}`);
21
- });
22
- if (!dumpResponse.ok) {
23
- console.error('Failed to load database dump:', dumpResponse.statusText);
24
- throw new Error(`Failed to load database dump: ${dumpResponse.statusText}`);
25
- }
26
- console.log('Loaded database dump:', dumpResponse.status);
27
- const dumpBlob = await dumpResponse.blob();
28
- if (!dumpBlob.size) {
29
- console.error('Failed to load database dump:', dumpBlob.size);
30
- throw new Error(`Failed to load database dump: ${dumpBlob.size}`);
31
- }
32
- const pglite = new pglite_1.PGlite({
33
- dataDir,
34
- loadDataDir: dumpBlob,
35
- });
36
- // warm up
37
- await pglite.sql `SELECT 1`;
38
- return pglite;
39
- },
40
- });
41
- console.log('Worker process started');
42
- //# sourceMappingURL=worker.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"worker.js","sourceRoot":"src/","sources":["browser/worker.ts"],"names":[],"mappings":";;AAEA,iDAA8C;AAC9C,wDAAqD;AAErD,IAAA,eAAM,EAAC;IACL,KAAK,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE;QACpB,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC;QACnD,IAAI,OAAO,EAAE,UAAU,CAAC,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M,CAAC,GAAG,CAAA,UAAU,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC,CAAC;AAEH,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAC","sourcesContent":["declare var self: Worker & { indexedDB: typeof window.indexedDB };\n\nimport { PGlite } from '@electric-sql/pglite';\nimport { worker } from '@electric-sql/pglite/worker';\n\nworker({\n async init({ dataDir }) {\n const databases = await self.indexedDB.databases();\n if (dataDir?.startsWith('idb://') && databases.length) {\n const pglite = new PGlite({\n dataDir,\n });\n // warm up\n await pglite.sql`SELECT 1`;\n return pglite;\n }\n\n console.log('Loading database dump...', dataDir);\n // Load the database dump file\n const dumpResponse = await fetch('/.data.tar').catch((error) => {\n console.error('Failed to load database dump:', error);\n throw new Error(`Failed to load database dump: ${error.message}`);\n });\n if (!dumpResponse.ok) {\n console.error('Failed to load database dump:', dumpResponse.statusText);\n throw new Error(\n `Failed to load database dump: ${dumpResponse.statusText}`\n );\n }\n\n console.log('Loaded database dump:', dumpResponse.status);\n const dumpBlob = await dumpResponse.blob();\n if (!dumpBlob.size) {\n console.error('Failed to load database dump:', dumpBlob.size);\n throw new Error(`Failed to load database dump: ${dumpBlob.size}`);\n }\n\n const pglite = new PGlite({\n dataDir,\n loadDataDir: dumpBlob,\n });\n // warm up\n await pglite.sql`SELECT 1`;\n\n return pglite;\n },\n});\n\nconsole.log('Worker process started');\n"]}