@vibes.diy/api-sql 0.0.0-smoke-85ffc167-1775073098
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/LICENSE.md +232 -0
- package/README.md +539 -0
- package/index.d.ts +12 -0
- package/index.js +17 -0
- package/index.js.map +1 -0
- package/package.json +26 -0
- package/sql-peer.d.ts +26 -0
- package/sql-peer.js +114 -0
- package/sql-peer.js.map +1 -0
- package/tables.d.ts +1542 -0
- package/tables.js +47 -0
- package/tables.js.map +1 -0
- package/tsconfig.json +18 -0
- package/vibes-diy-api-schema-pg.d.ts +1418 -0
- package/vibes-diy-api-schema-pg.js +141 -0
- package/vibes-diy-api-schema-pg.js.map +1 -0
- package/vibes-diy-api-schema-sqlite.d.ts +1536 -0
- package/vibes-diy-api-schema-sqlite.js +131 -0
- package/vibes-diy-api-schema-sqlite.js.map +1 -0
package/tables.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import * as sqlite from "./vibes-diy-api-schema-sqlite.js";
|
|
2
|
+
import * as pg from "./vibes-diy-api-schema-pg.js";
|
|
3
|
+
import { type } from "arktype";
|
|
4
|
+
function createSqliteVibesApiTables() {
|
|
5
|
+
return {
|
|
6
|
+
assets: sqlite.sqlAssets,
|
|
7
|
+
userSlugBinding: sqlite.sqlUserSlugBinding,
|
|
8
|
+
appSlugBinding: sqlite.sqlAppSlugBinding,
|
|
9
|
+
apps: sqlite.sqlApps,
|
|
10
|
+
chatContexts: sqlite.sqlChatContexts,
|
|
11
|
+
chatSections: sqlite.sqlChatSections,
|
|
12
|
+
promptContexts: sqlite.sqlPromptContexts,
|
|
13
|
+
applicationChats: sqlite.sqlApplicationChats,
|
|
14
|
+
userSettings: sqlite.sqlUserSettings,
|
|
15
|
+
appSettings: sqlite.sqlAppSettings,
|
|
16
|
+
requestGrants: sqlite.sqlRequestGrants,
|
|
17
|
+
inviteGrants: sqlite.sqlInviteGrants,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export const DBFlavour = type("'sqlite' | 'pg'");
|
|
21
|
+
export function toDBFlavour(flavour) {
|
|
22
|
+
const res = DBFlavour(flavour);
|
|
23
|
+
if (res instanceof type.errors) {
|
|
24
|
+
return "sqlite";
|
|
25
|
+
}
|
|
26
|
+
return res;
|
|
27
|
+
}
|
|
28
|
+
export function createVibesApiTables(flavour) {
|
|
29
|
+
if (flavour === "pg") {
|
|
30
|
+
return {
|
|
31
|
+
assets: pg.sqlAssets,
|
|
32
|
+
userSlugBinding: pg.sqlUserSlugBinding,
|
|
33
|
+
appSlugBinding: pg.sqlAppSlugBinding,
|
|
34
|
+
apps: pg.sqlApps,
|
|
35
|
+
chatContexts: pg.sqlChatContexts,
|
|
36
|
+
chatSections: pg.sqlChatSections,
|
|
37
|
+
promptContexts: pg.sqlPromptContexts,
|
|
38
|
+
applicationChats: pg.sqlApplicationChats,
|
|
39
|
+
userSettings: pg.sqlUserSettings,
|
|
40
|
+
appSettings: pg.sqlAppSettings,
|
|
41
|
+
requestGrants: pg.sqlRequestGrants,
|
|
42
|
+
inviteGrants: pg.sqlInviteGrants,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return createSqliteVibesApiTables();
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=tables.js.map
|
package/tables.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../jsr/tables.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,kCAAkC,CAAC;AAC3D,OAAO,KAAK,EAAE,MAAM,8BAA8B,CAAC;AAInD,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAI/B,SAAS,0BAA0B;IACjC,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,SAAS;QACxB,eAAe,EAAE,MAAM,CAAC,kBAAkB;QAC1C,cAAc,EAAE,MAAM,CAAC,iBAAiB;QACxC,IAAI,EAAE,MAAM,C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
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": [
|
|
3
|
+
"/Users/menabe/Software/fproof/vibes.diy/tsconfig.dist.json"
|
|
4
|
+
],
|
|
5
|
+
"compilerOptions": {
|
|
6
|
+
"outDir": "../npm/",
|
|
7
|
+
"noEmit": false
|
|
8
|
+
},
|
|
9
|
+
"include": [
|
|
10
|
+
"**/*"
|
|
11
|
+
],
|
|
12
|
+
"exclude": [
|
|
13
|
+
"node_modules",
|
|
14
|
+
"dist",
|
|
15
|
+
".git",
|
|
16
|
+
".vscode"
|
|
17
|
+
]
|
|
18
|
+
}
|