@niscorp/moss 0.8.2 → 0.9.1
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/CHANGELOG.md +22 -0
- package/DESIGN.md +1 -1
- package/DOCS.md +48 -21
- package/README.md +9 -8
- package/dist/{chunk-QB7U2JDQ.cjs → chunk-L2GHVTJW.cjs} +32 -10
- package/dist/chunk-L2GHVTJW.cjs.map +1 -0
- package/dist/{chunk-KLZYTSR2.cjs → chunk-LKTS4PCD.cjs} +5 -5
- package/dist/{chunk-KLZYTSR2.cjs.map → chunk-LKTS4PCD.cjs.map} +1 -1
- package/dist/{chunk-S4JSTWAE.js → chunk-UUOATPZ7.js} +3 -3
- package/dist/{chunk-S4JSTWAE.js.map → chunk-UUOATPZ7.js.map} +1 -1
- package/dist/{chunk-4M2MALV7.js → chunk-Y7PRASR3.js} +33 -12
- package/dist/chunk-Y7PRASR3.js.map +1 -0
- package/dist/index.cjs +14 -10
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +1 -1
- package/dist/node.cjs +6 -6
- package/dist/node.js +2 -2
- package/dist/vite.cjs +7 -7
- package/dist/vite.js +2 -2
- package/package.json +13 -13
- package/dist/chunk-4M2MALV7.js.map +0 -1
- package/dist/chunk-QB7U2JDQ.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkL2GHVTJW_cjs = require('./chunk-L2GHVTJW.cjs');
|
|
4
4
|
var chunkE6YAYR7G_cjs = require('./chunk-E6YAYR7G.cjs');
|
|
5
5
|
require('./chunk-PVZMCEBX.cjs');
|
|
6
6
|
require('./chunk-3RIWTXGI.cjs');
|
|
@@ -9,39 +9,43 @@ require('./chunk-3RIWTXGI.cjs');
|
|
|
9
9
|
|
|
10
10
|
Object.defineProperty(exports, "MOSS_SEQUENCE", {
|
|
11
11
|
enumerable: true,
|
|
12
|
-
get: function () { return
|
|
12
|
+
get: function () { return chunkL2GHVTJW_cjs.MOSS_SEQUENCE; }
|
|
13
13
|
});
|
|
14
14
|
Object.defineProperty(exports, "createServer", {
|
|
15
15
|
enumerable: true,
|
|
16
|
-
get: function () { return
|
|
16
|
+
get: function () { return chunkL2GHVTJW_cjs.createServer; }
|
|
17
17
|
});
|
|
18
18
|
Object.defineProperty(exports, "exportDocuments", {
|
|
19
19
|
enumerable: true,
|
|
20
|
-
get: function () { return
|
|
20
|
+
get: function () { return chunkL2GHVTJW_cjs.exportDocuments; }
|
|
21
21
|
});
|
|
22
22
|
Object.defineProperty(exports, "migrateTables", {
|
|
23
23
|
enumerable: true,
|
|
24
|
-
get: function () { return
|
|
24
|
+
get: function () { return chunkL2GHVTJW_cjs.migrateTables; }
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, "mintDevToken", {
|
|
27
27
|
enumerable: true,
|
|
28
|
-
get: function () { return
|
|
28
|
+
get: function () { return chunkL2GHVTJW_cjs.mintDevToken; }
|
|
29
29
|
});
|
|
30
30
|
Object.defineProperty(exports, "mintSession", {
|
|
31
31
|
enumerable: true,
|
|
32
|
-
get: function () { return
|
|
32
|
+
get: function () { return chunkL2GHVTJW_cjs.mintSession; }
|
|
33
33
|
});
|
|
34
34
|
Object.defineProperty(exports, "renderDocument", {
|
|
35
35
|
enumerable: true,
|
|
36
|
-
get: function () { return
|
|
36
|
+
get: function () { return chunkL2GHVTJW_cjs.renderDocument; }
|
|
37
37
|
});
|
|
38
38
|
Object.defineProperty(exports, "revokeAllFor", {
|
|
39
39
|
enumerable: true,
|
|
40
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkL2GHVTJW_cjs.revokeAllFor; }
|
|
41
41
|
});
|
|
42
42
|
Object.defineProperty(exports, "sessionCookies", {
|
|
43
43
|
enumerable: true,
|
|
44
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkL2GHVTJW_cjs.sessionCookies; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "tableStatus", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkL2GHVTJW_cjs.tableStatus; }
|
|
45
49
|
});
|
|
46
50
|
Object.defineProperty(exports, "defineApp", {
|
|
47
51
|
enumerable: true,
|
package/dist/index.d.cts
CHANGED
|
@@ -5,8 +5,8 @@ import { PgPool } from '@niscorp/vex';
|
|
|
5
5
|
import { N as NiscRuntime } from './index-CSEo7Tys.cjs';
|
|
6
6
|
export { T as Telemetry, a as TelemetrySpan } from './index-CSEo7Tys.cjs';
|
|
7
7
|
import { MigrateReport } from '@niscorp/strata/postgres';
|
|
8
|
+
import { Plan, Sequence } from '@niscorp/strata';
|
|
8
9
|
export { FunctionDefinition } from '@niscorp/nova';
|
|
9
|
-
import { Sequence } from '@niscorp/strata';
|
|
10
10
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
11
11
|
import 'hono';
|
|
12
12
|
import '@niscorp/nova/i18n';
|
|
@@ -39,8 +39,11 @@ type TablesReport = MigrateReport & {
|
|
|
39
39
|
retyped: readonly string[];
|
|
40
40
|
alreadyBroken: readonly string[];
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type TablesRuntime = Pick<NiscRuntime, 'pool' | 'cache' | 'session' | 'tables'>;
|
|
43
|
+
declare const tableStatus: (runtime: TablesRuntime, app: Pick<NiscApp, "features">) => Promise<Plan>;
|
|
44
|
+
declare const migrateTables: (runtime: TablesRuntime, app: Pick<NiscApp, "entries" | "features">, options?: {
|
|
43
45
|
dryRun?: boolean;
|
|
46
|
+
allowRemoval?: boolean;
|
|
44
47
|
}) => Promise<TablesReport>;
|
|
45
48
|
|
|
46
49
|
declare const MOSS_SEQUENCE: Sequence;
|
|
@@ -62,4 +65,4 @@ declare const exportDocuments: (config: Omit<DocumentConfig, "request"> & {
|
|
|
62
65
|
paths: readonly string[];
|
|
63
66
|
}) => Promise<ExportedDocument[]>;
|
|
64
67
|
|
|
65
|
-
export { DocumentConfig, type ExportedDocument, MOSS_SEQUENCE, MossServer, NiscApp, NiscRuntime, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, revokeAllFor, sessionCookies, verifyApp };
|
|
68
|
+
export { DocumentConfig, type ExportedDocument, MOSS_SEQUENCE, MossServer, NiscApp, NiscRuntime, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, revokeAllFor, sessionCookies, tableStatus, verifyApp };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { PgPool } from '@niscorp/vex';
|
|
|
5
5
|
import { N as NiscRuntime } from './index-CSEo7Tys.js';
|
|
6
6
|
export { T as Telemetry, a as TelemetrySpan } from './index-CSEo7Tys.js';
|
|
7
7
|
import { MigrateReport } from '@niscorp/strata/postgres';
|
|
8
|
+
import { Plan, Sequence } from '@niscorp/strata';
|
|
8
9
|
export { FunctionDefinition } from '@niscorp/nova';
|
|
9
|
-
import { Sequence } from '@niscorp/strata';
|
|
10
10
|
import { ScreenHead } from '@niscorp/nova/document';
|
|
11
11
|
import 'hono';
|
|
12
12
|
import '@niscorp/nova/i18n';
|
|
@@ -39,8 +39,11 @@ type TablesReport = MigrateReport & {
|
|
|
39
39
|
retyped: readonly string[];
|
|
40
40
|
alreadyBroken: readonly string[];
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
type TablesRuntime = Pick<NiscRuntime, 'pool' | 'cache' | 'session' | 'tables'>;
|
|
43
|
+
declare const tableStatus: (runtime: TablesRuntime, app: Pick<NiscApp, "features">) => Promise<Plan>;
|
|
44
|
+
declare const migrateTables: (runtime: TablesRuntime, app: Pick<NiscApp, "entries" | "features">, options?: {
|
|
43
45
|
dryRun?: boolean;
|
|
46
|
+
allowRemoval?: boolean;
|
|
44
47
|
}) => Promise<TablesReport>;
|
|
45
48
|
|
|
46
49
|
declare const MOSS_SEQUENCE: Sequence;
|
|
@@ -62,4 +65,4 @@ declare const exportDocuments: (config: Omit<DocumentConfig, "request"> & {
|
|
|
62
65
|
paths: readonly string[];
|
|
63
66
|
}) => Promise<ExportedDocument[]>;
|
|
64
67
|
|
|
65
|
-
export { DocumentConfig, type ExportedDocument, MOSS_SEQUENCE, MossServer, NiscApp, NiscRuntime, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, revokeAllFor, sessionCookies, verifyApp };
|
|
68
|
+
export { DocumentConfig, type ExportedDocument, MOSS_SEQUENCE, MossServer, NiscApp, NiscRuntime, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, revokeAllFor, sessionCookies, tableStatus, verifyApp };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { MOSS_SEQUENCE, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, renderDocument, revokeAllFor, sessionCookies } from './chunk-
|
|
1
|
+
export { MOSS_SEQUENCE, createServer, exportDocuments, migrateTables, mintDevToken, mintSession, renderDocument, revokeAllFor, sessionCookies, tableStatus } from './chunk-Y7PRASR3.js';
|
|
2
2
|
export { defineApp, verifyApp } from './chunk-WTWRLOPK.js';
|
|
3
3
|
import './chunk-QAHDSRPK.js';
|
|
4
4
|
import './chunk-4ZGAFZGS.js';
|
package/dist/node.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
3
|
+
var chunkLKTS4PCD_cjs = require('./chunk-LKTS4PCD.cjs');
|
|
4
|
+
require('./chunk-L2GHVTJW.cjs');
|
|
5
5
|
require('./chunk-E6YAYR7G.cjs');
|
|
6
6
|
require('./chunk-PVZMCEBX.cjs');
|
|
7
7
|
require('./chunk-3RIWTXGI.cjs');
|
|
@@ -10,19 +10,19 @@ require('./chunk-3RIWTXGI.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "MOSS_PATHS", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkLKTS4PCD_cjs.MOSS_PATHS; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "attachSocket", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkLKTS4PCD_cjs.attachSocket; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "mountSite", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkLKTS4PCD_cjs.mountSite; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "serve", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkLKTS4PCD_cjs.serve; }
|
|
26
26
|
});
|
|
27
27
|
//# sourceMappingURL=node.cjs.map
|
|
28
28
|
//# sourceMappingURL=node.cjs.map
|
package/dist/node.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { MOSS_PATHS, attachSocket, mountSite, serve } from './chunk-
|
|
2
|
-
import './chunk-
|
|
1
|
+
export { MOSS_PATHS, attachSocket, mountSite, serve } from './chunk-UUOATPZ7.js';
|
|
2
|
+
import './chunk-Y7PRASR3.js';
|
|
3
3
|
import './chunk-WTWRLOPK.js';
|
|
4
4
|
import './chunk-QAHDSRPK.js';
|
|
5
5
|
import './chunk-4ZGAFZGS.js';
|
package/dist/vite.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkLKTS4PCD_cjs = require('./chunk-LKTS4PCD.cjs');
|
|
4
|
+
var chunkL2GHVTJW_cjs = require('./chunk-L2GHVTJW.cjs');
|
|
5
5
|
require('./chunk-E6YAYR7G.cjs');
|
|
6
6
|
require('./chunk-PVZMCEBX.cjs');
|
|
7
7
|
require('./chunk-3RIWTXGI.cjs');
|
|
@@ -57,7 +57,7 @@ var devMiddleware = (vite, options, owned, current) => (req, res, next) => {
|
|
|
57
57
|
}
|
|
58
58
|
const scheme = "encrypted" in req.socket && req.socket.encrypted === true ? "https" : "http";
|
|
59
59
|
res.statusCode = 302;
|
|
60
|
-
res.setHeader("set-cookie",
|
|
60
|
+
res.setHeader("set-cookie", chunkL2GHVTJW_cjs.sessionCookies(`${scheme}://${req.headers.host ?? "localhost"}`, token, app.tokenKey !== void 0 ? { key: app.tokenKey } : {}));
|
|
61
61
|
res.setHeader("location", "/");
|
|
62
62
|
res.end();
|
|
63
63
|
}).catch(() => {
|
|
@@ -83,7 +83,7 @@ var devMiddleware = (vite, options, owned, current) => (req, res, next) => {
|
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
85
|
const template = await vite.transformIndexHtml(url, await promises.readFile(path.resolve(vite.config.root, options.index ?? "index.html"), "utf8"));
|
|
86
|
-
const page = await
|
|
86
|
+
const page = await chunkL2GHVTJW_cjs.renderDocument({
|
|
87
87
|
server: app.server,
|
|
88
88
|
template,
|
|
89
89
|
request: { path: path$1 === "/index.html" ? "/" : path$1, cookie: req.headers.cookie ?? null, host: req.headers.host ?? null },
|
|
@@ -104,17 +104,17 @@ var mossDev = (options) => ({
|
|
|
104
104
|
configureServer: (vite) => {
|
|
105
105
|
const label = options.label ?? "moss";
|
|
106
106
|
const watch = options.watch ?? DEFAULT_WATCH;
|
|
107
|
-
const owned = options.owned ??
|
|
107
|
+
const owned = options.owned ?? chunkLKTS4PCD_cjs.MOSS_PATHS;
|
|
108
108
|
const load = (id) => vite.ssrLoadModule(id);
|
|
109
109
|
const httpServer = vite.httpServer;
|
|
110
110
|
const boot = async () => {
|
|
111
111
|
const app = await options.app(load);
|
|
112
|
-
return { app, listener: nodeServer.getRequestListener(app.server.fetch), ...httpServer !== null ? { transport:
|
|
112
|
+
return { app, listener: nodeServer.getRequestListener(app.server.fetch), ...httpServer !== null ? { transport: chunkLKTS4PCD_cjs.createTransport(app.server.socket) } : {} };
|
|
113
113
|
};
|
|
114
114
|
let current = boot();
|
|
115
115
|
current.catch((error) => vite.config.logger.error(`[${label}] the app did not boot: ${said(error)}`, { timestamp: true }));
|
|
116
116
|
if (httpServer !== null) {
|
|
117
|
-
|
|
117
|
+
chunkLKTS4PCD_cjs.listenForUpgrades(httpServer, "/socket", (req, socket, head) => {
|
|
118
118
|
void current.then(
|
|
119
119
|
({ transport }) => transport?.upgrade(req, socket, head),
|
|
120
120
|
() => socket.end("HTTP/1.1 503 Service Unavailable\r\nConnection: close\r\nContent-Length: 0\r\n\r\n")
|
package/dist/vite.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MOSS_PATHS, listenForUpgrades, createTransport } from './chunk-
|
|
2
|
-
import { sessionCookies, renderDocument } from './chunk-
|
|
1
|
+
import { MOSS_PATHS, listenForUpgrades, createTransport } from './chunk-UUOATPZ7.js';
|
|
2
|
+
import { sessionCookies, renderDocument } from './chunk-Y7PRASR3.js';
|
|
3
3
|
import './chunk-WTWRLOPK.js';
|
|
4
4
|
import './chunk-QAHDSRPK.js';
|
|
5
5
|
import './chunk-4ZGAFZGS.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@niscorp/moss",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.1",
|
|
4
4
|
"description": "moss — the nisc app server: serves existence (catalog, scoped vex, the socket), derived from artifacts",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -212,12 +212,12 @@
|
|
|
212
212
|
"zod": "^4.2.0",
|
|
213
213
|
"vue": "^3.5.0",
|
|
214
214
|
"vite": ">=6",
|
|
215
|
-
"@niscorp/nova": "^0.5.
|
|
216
|
-
"@niscorp/
|
|
217
|
-
"@niscorp/
|
|
218
|
-
"@niscorp/tide": "^0.1.
|
|
219
|
-
"@niscorp/
|
|
220
|
-
"@niscorp/vex": "^0.4.
|
|
215
|
+
"@niscorp/nova": "^0.5.2",
|
|
216
|
+
"@niscorp/prism": "^0.3.3",
|
|
217
|
+
"@niscorp/charter": "^0.1.5",
|
|
218
|
+
"@niscorp/tide": "^0.1.10",
|
|
219
|
+
"@niscorp/strata": "^0.1.9",
|
|
220
|
+
"@niscorp/vex": "^0.4.4"
|
|
221
221
|
},
|
|
222
222
|
"peerDependenciesMeta": {
|
|
223
223
|
"@niscorp/tide": {
|
|
@@ -255,12 +255,12 @@
|
|
|
255
255
|
"vitest": "^4.1.2",
|
|
256
256
|
"vue": "^3.5.43",
|
|
257
257
|
"zod": "^4.6.5",
|
|
258
|
-
"@niscorp/charter": "^0.1.
|
|
259
|
-
"@niscorp/
|
|
260
|
-
"@niscorp/
|
|
261
|
-
"@niscorp/
|
|
262
|
-
"@niscorp/
|
|
263
|
-
"@niscorp/
|
|
258
|
+
"@niscorp/charter": "^0.1.5",
|
|
259
|
+
"@niscorp/prism": "^0.3.3",
|
|
260
|
+
"@niscorp/tide": "^0.1.10",
|
|
261
|
+
"@niscorp/nova": "^0.5.2",
|
|
262
|
+
"@niscorp/strata": "^0.1.9",
|
|
263
|
+
"@niscorp/vex": "^0.4.4"
|
|
264
264
|
},
|
|
265
265
|
"scripts": {
|
|
266
266
|
"build": "node -e \"fs.rmSync('dist',{recursive:true,force:true})\" && tsup",
|