@zenstackhq/runtime 3.0.0-alpha.1 → 3.0.0-alpha.3

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.
@@ -1,5 +1,5 @@
1
1
  import * as kysely from 'kysely';
2
- import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-DguafRNB.cjs';
2
+ import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-0F-AwA7Z.cjs';
3
3
  import { SchemaDef } from '@zenstackhq/sdk/schema';
4
4
  import 'decimal.js';
5
5
  import 'utility-types';
@@ -1,5 +1,5 @@
1
1
  import * as kysely from 'kysely';
2
- import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-DguafRNB.js';
2
+ import { V as RuntimePlugin, X as OnKyselyQueryArgs } from '../contract-0F-AwA7Z.js';
3
3
  import { SchemaDef } from '@zenstackhq/sdk/schema';
4
4
  import 'decimal.js';
5
5
  import 'utility-types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenstackhq/runtime",
3
- "version": "3.0.0-alpha.1",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "ZenStack Runtime",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -50,26 +50,6 @@
50
50
  "default": "./dist/plugins/policy.cjs"
51
51
  }
52
52
  },
53
- "./utils/pg-utils": {
54
- "import": {
55
- "types": "./dist/utils/pg-utils.d.ts",
56
- "default": "./dist/utils/pg-utils.js"
57
- },
58
- "require": {
59
- "types": "./dist/utils/pg-utils.d.cts",
60
- "default": "./dist/utils/pg-utils.cjs"
61
- }
62
- },
63
- "./utils/sqlite-utils": {
64
- "import": {
65
- "types": "./dist/utils/sqlite-utils.d.ts",
66
- "default": "./dist/utils/sqlite-utils.js"
67
- },
68
- "require": {
69
- "types": "./dist/utils/sqlite-utils.d.cts",
70
- "default": "./dist/utils/sqlite-utils.cjs"
71
- }
72
- },
73
53
  "./package.json": {
74
54
  "import": "./package.json",
75
55
  "require": "./package.json"
@@ -82,7 +62,6 @@
82
62
  "json-stable-stringify": "^1.3.0",
83
63
  "kysely": "^0.27.5",
84
64
  "nanoid": "^5.0.9",
85
- "pg-connection-string": "^2.9.0",
86
65
  "tiny-invariant": "^1.3.3",
87
66
  "ts-pattern": "^5.6.0",
88
67
  "ulid": "^3.0.0",
@@ -108,9 +87,9 @@
108
87
  "@types/tmp": "^0.2.6",
109
88
  "tmp": "^0.2.3",
110
89
  "tsx": "^4.19.2",
111
- "@zenstackhq/language": "3.0.0-alpha.1",
112
- "@zenstackhq/sdk": "3.0.0-alpha.1",
113
- "@zenstackhq/testtools": "3.0.0-alpha.1"
90
+ "@zenstackhq/language": "3.0.0-alpha.3",
91
+ "@zenstackhq/sdk": "3.0.0-alpha.3",
92
+ "@zenstackhq/testtools": "3.0.0-alpha.3"
114
93
  },
115
94
  "scripts": {
116
95
  "build": "tsup-node",
@@ -1,39 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/utils/pg-utils.ts
22
- var pg_utils_exports = {};
23
- __export(pg_utils_exports, {
24
- toDialectConfig: () => toDialectConfig
25
- });
26
- module.exports = __toCommonJS(pg_utils_exports);
27
- var import_pg = require("pg");
28
- var import_pg_connection_string = require("pg-connection-string");
29
- function toDialectConfig(url) {
30
- return {
31
- pool: new import_pg.Pool((0, import_pg_connection_string.parseIntoClientConfig)(url))
32
- };
33
- }
34
- __name(toDialectConfig, "toDialectConfig");
35
- // Annotate the CommonJS export names for ESM import in node:
36
- 0 && (module.exports = {
37
- toDialectConfig
38
- });
39
- //# sourceMappingURL=pg-utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/pg-utils.ts"],"sourcesContent":["import type { PostgresDialectConfig } from 'kysely';\nimport { Pool } from 'pg';\nimport { parseIntoClientConfig } from 'pg-connection-string';\n\n/**\n * Convert a PostgreSQL connection string to a Kysely dialect config.\n */\nexport function toDialectConfig(url: string): PostgresDialectConfig {\n return {\n pool: new Pool(parseIntoClientConfig(url)),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA;;;;;gBAAqB;AACrB,kCAAsC;AAK/B,SAASA,gBAAgBC,KAAW;AACvC,SAAO;IACHC,MAAM,IAAIC,mBAAKC,mDAAsBH,GAAAA,CAAAA;EACzC;AACJ;AAJgBD;","names":["toDialectConfig","url","pool","Pool","parseIntoClientConfig"]}
@@ -1,8 +0,0 @@
1
- import { PostgresDialectConfig } from 'kysely';
2
-
3
- /**
4
- * Convert a PostgreSQL connection string to a Kysely dialect config.
5
- */
6
- declare function toDialectConfig(url: string): PostgresDialectConfig;
7
-
8
- export { toDialectConfig };
@@ -1,8 +0,0 @@
1
- import { PostgresDialectConfig } from 'kysely';
2
-
3
- /**
4
- * Convert a PostgreSQL connection string to a Kysely dialect config.
5
- */
6
- declare function toDialectConfig(url: string): PostgresDialectConfig;
7
-
8
- export { toDialectConfig };
@@ -1,16 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/utils/pg-utils.ts
5
- import { Pool } from "pg";
6
- import { parseIntoClientConfig } from "pg-connection-string";
7
- function toDialectConfig(url) {
8
- return {
9
- pool: new Pool(parseIntoClientConfig(url))
10
- };
11
- }
12
- __name(toDialectConfig, "toDialectConfig");
13
- export {
14
- toDialectConfig
15
- };
16
- //# sourceMappingURL=pg-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/pg-utils.ts"],"sourcesContent":["import type { PostgresDialectConfig } from 'kysely';\nimport { Pool } from 'pg';\nimport { parseIntoClientConfig } from 'pg-connection-string';\n\n/**\n * Convert a PostgreSQL connection string to a Kysely dialect config.\n */\nexport function toDialectConfig(url: string): PostgresDialectConfig {\n return {\n pool: new Pool(parseIntoClientConfig(url)),\n };\n}\n"],"mappings":";;;;AACA,SAASA,YAAY;AACrB,SAASC,6BAA6B;AAK/B,SAASC,gBAAgBC,KAAW;AACvC,SAAO;IACHC,MAAM,IAAIC,KAAKC,sBAAsBH,GAAAA,CAAAA;EACzC;AACJ;AAJgBD;","names":["Pool","parseIntoClientConfig","toDialectConfig","url","pool","Pool","parseIntoClientConfig"]}
@@ -1,55 +0,0 @@
1
- "use strict";
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
9
- var __export = (target, all) => {
10
- for (var name in all)
11
- __defProp(target, name, { get: all[name], enumerable: true });
12
- };
13
- var __copyProps = (to, from, except, desc) => {
14
- if (from && typeof from === "object" || typeof from === "function") {
15
- for (let key of __getOwnPropNames(from))
16
- if (!__hasOwnProp.call(to, key) && key !== except)
17
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
18
- }
19
- return to;
20
- };
21
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
22
- // If the importer is in node compatibility mode or this is not an ESM
23
- // file that has been converted to a CommonJS file using a Babel-
24
- // compatible transform (i.e. "__esModule" has not been set), then set
25
- // "default" to the CommonJS "module.exports" for node compatibility.
26
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
27
- mod
28
- ));
29
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
30
-
31
- // src/utils/sqlite-utils.ts
32
- var sqlite_utils_exports = {};
33
- __export(sqlite_utils_exports, {
34
- toDialectConfig: () => toDialectConfig
35
- });
36
- module.exports = __toCommonJS(sqlite_utils_exports);
37
- var import_better_sqlite3 = __toESM(require("better-sqlite3"), 1);
38
- var import_node_path = __toESM(require("path"), 1);
39
- function toDialectConfig(url, baseDir) {
40
- if (url === ":memory:") {
41
- return {
42
- database: new import_better_sqlite3.default(":memory:")
43
- };
44
- }
45
- const filePath = import_node_path.default.resolve(baseDir, url);
46
- return {
47
- database: new import_better_sqlite3.default(filePath)
48
- };
49
- }
50
- __name(toDialectConfig, "toDialectConfig");
51
- // Annotate the CommonJS export names for ESM import in node:
52
- 0 && (module.exports = {
53
- toDialectConfig
54
- });
55
- //# sourceMappingURL=sqlite-utils.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/sqlite-utils.ts"],"sourcesContent":["import SQLite from 'better-sqlite3';\nimport type { SqliteDialectConfig } from 'kysely';\nimport path from 'node:path';\n\n/**\n * Convert a SQLite connection string to a Kysely dialect config.\n */\nexport function toDialectConfig(\n url: string,\n baseDir: string\n): SqliteDialectConfig {\n if (url === ':memory:') {\n return {\n database: new SQLite(':memory:'),\n };\n }\n const filePath = path.resolve(baseDir, url);\n return {\n database: new SQLite(filePath),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;4BAAmB;AAEnB,uBAAiB;AAKV,SAASA,gBACZC,KACAC,SAAe;AAEf,MAAID,QAAQ,YAAY;AACpB,WAAO;MACHE,UAAU,IAAIC,sBAAAA,QAAO,UAAA;IACzB;EACJ;AACA,QAAMC,WAAWC,iBAAAA,QAAKC,QAAQL,SAASD,GAAAA;AACvC,SAAO;IACHE,UAAU,IAAIC,sBAAAA,QAAOC,QAAAA;EACzB;AACJ;AAbgBL;","names":["toDialectConfig","url","baseDir","database","SQLite","filePath","path","resolve"]}
@@ -1,8 +0,0 @@
1
- import { SqliteDialectConfig } from 'kysely';
2
-
3
- /**
4
- * Convert a SQLite connection string to a Kysely dialect config.
5
- */
6
- declare function toDialectConfig(url: string, baseDir: string): SqliteDialectConfig;
7
-
8
- export { toDialectConfig };
@@ -1,8 +0,0 @@
1
- import { SqliteDialectConfig } from 'kysely';
2
-
3
- /**
4
- * Convert a SQLite connection string to a Kysely dialect config.
5
- */
6
- declare function toDialectConfig(url: string, baseDir: string): SqliteDialectConfig;
7
-
8
- export { toDialectConfig };
@@ -1,22 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
- // src/utils/sqlite-utils.ts
5
- import SQLite from "better-sqlite3";
6
- import path from "node:path";
7
- function toDialectConfig(url, baseDir) {
8
- if (url === ":memory:") {
9
- return {
10
- database: new SQLite(":memory:")
11
- };
12
- }
13
- const filePath = path.resolve(baseDir, url);
14
- return {
15
- database: new SQLite(filePath)
16
- };
17
- }
18
- __name(toDialectConfig, "toDialectConfig");
19
- export {
20
- toDialectConfig
21
- };
22
- //# sourceMappingURL=sqlite-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/sqlite-utils.ts"],"sourcesContent":["import SQLite from 'better-sqlite3';\nimport type { SqliteDialectConfig } from 'kysely';\nimport path from 'node:path';\n\n/**\n * Convert a SQLite connection string to a Kysely dialect config.\n */\nexport function toDialectConfig(\n url: string,\n baseDir: string\n): SqliteDialectConfig {\n if (url === ':memory:') {\n return {\n database: new SQLite(':memory:'),\n };\n }\n const filePath = path.resolve(baseDir, url);\n return {\n database: new SQLite(filePath),\n };\n}\n"],"mappings":";;;;AAAA,OAAOA,YAAY;AAEnB,OAAOC,UAAU;AAKV,SAASC,gBACZC,KACAC,SAAe;AAEf,MAAID,QAAQ,YAAY;AACpB,WAAO;MACHE,UAAU,IAAIC,OAAO,UAAA;IACzB;EACJ;AACA,QAAMC,WAAWC,KAAKC,QAAQL,SAASD,GAAAA;AACvC,SAAO;IACHE,UAAU,IAAIC,OAAOC,QAAAA;EACzB;AACJ;AAbgBL;","names":["SQLite","path","toDialectConfig","url","baseDir","database","SQLite","filePath","path","resolve"]}