@undefineds.co/xpod 0.3.14 → 0.3.16
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/config/local.json +5 -5
- package/config/xpod.json +24 -10
- package/dist/cli/commands/auth.d.ts +1 -0
- package/dist/cli/commands/auth.js +117 -37
- package/dist/cli/commands/auth.js.map +1 -1
- package/dist/cli/commands/login.js +16 -23
- package/dist/cli/commands/login.js.map +1 -1
- package/dist/cli/commands/logs.d.ts +2 -0
- package/dist/cli/commands/logs.js +20 -5
- package/dist/cli/commands/logs.js.map +1 -1
- package/dist/cli/commands/obj.d.ts +44 -0
- package/dist/cli/commands/obj.js +1059 -0
- package/dist/cli/commands/obj.js.map +1 -0
- package/dist/cli/commands/rdf.d.ts +14 -0
- package/dist/cli/commands/rdf.js +235 -0
- package/dist/cli/commands/rdf.js.map +1 -0
- package/dist/cli/commands/resource.d.ts +31 -0
- package/dist/cli/commands/resource.js +191 -0
- package/dist/cli/commands/resource.js.map +1 -0
- package/dist/cli/commands/secret.d.ts +36 -0
- package/dist/cli/commands/secret.js +285 -0
- package/dist/cli/commands/secret.js.map +1 -0
- package/dist/cli/commands/server.d.ts +11 -0
- package/dist/cli/commands/server.js +168 -0
- package/dist/cli/commands/server.js.map +1 -0
- package/dist/cli/commands/start.d.ts +1 -0
- package/dist/cli/commands/start.js +5 -0
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/status.d.ts +1 -0
- package/dist/cli/commands/status.js +21 -6
- package/dist/cli/commands/status.js.map +1 -1
- package/dist/cli/commands/stop.d.ts +3 -0
- package/dist/cli/commands/stop.js +40 -6
- package/dist/cli/commands/stop.js.map +1 -1
- package/dist/cli/index.js +23 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/lib/auth-context.d.ts +24 -0
- package/dist/cli/lib/auth-context.js +70 -0
- package/dist/cli/lib/auth-context.js.map +1 -0
- package/dist/cli/lib/output.d.ts +23 -0
- package/dist/cli/lib/output.js +63 -0
- package/dist/cli/lib/output.js.map +1 -0
- package/dist/cli/lib/resource.d.ts +29 -0
- package/dist/cli/lib/resource.js +114 -0
- package/dist/cli/lib/resource.js.map +1 -0
- package/dist/components/context.jsonld +6 -0
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.d.ts +11 -10
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js +13 -24
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.js.map +1 -1
- package/dist/identity/oidc/AutoDetectIdentityProviderHandler.jsonld +4 -4
- package/dist/identity/oidc/AutoDetectOidcHandler.d.ts +8 -4
- package/dist/identity/oidc/AutoDetectOidcHandler.js +10 -6
- package/dist/identity/oidc/AutoDetectOidcHandler.js.map +1 -1
- package/dist/identity/oidc/AutoDetectOidcHandler.jsonld +3 -3
- package/dist/storage/accessors/MixDataAccessor.js +3 -0
- package/dist/storage/accessors/MixDataAccessor.js.map +1 -1
- package/dist/storage/quint/SqliteQuintStore.d.ts +26 -1
- package/dist/storage/quint/SqliteQuintStore.js +551 -318
- package/dist/storage/quint/SqliteQuintStore.js.map +1 -1
- package/dist/storage/quint/SqliteQuintStore.jsonld +102 -2
- package/dist/storage/quint/schema.d.ts +76 -0
- package/dist/storage/quint/schema.js +13 -7
- package/dist/storage/quint/schema.js.map +1 -1
- package/dist/storage/rdf/RdfLocalQueryEngine.d.ts +4 -1
- package/dist/storage/rdf/RdfLocalQueryEngine.js +77 -8
- package/dist/storage/rdf/RdfLocalQueryEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfEngine.d.ts +5 -0
- package/dist/storage/rdf/SolidRdfEngine.js +31 -3
- package/dist/storage/rdf/SolidRdfEngine.js.map +1 -1
- package/dist/storage/rdf/SolidRdfEngine.jsonld +34 -0
- package/dist/storage/sparql/ComunicaQuintEngine.js +16 -3
- package/dist/storage/sparql/ComunicaQuintEngine.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli/commands/config.d.ts +0 -42
- package/dist/cli/commands/config.js +0 -289
- package/dist/cli/commands/config.js.map +0 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logsCommand = void 0;
|
|
4
|
+
const output_1 = require("../lib/output");
|
|
4
5
|
exports.logsCommand = {
|
|
5
6
|
command: 'logs',
|
|
6
7
|
describe: 'View service logs',
|
|
@@ -15,6 +16,11 @@ exports.logsCommand = {
|
|
|
15
16
|
type: 'string',
|
|
16
17
|
description: 'Gateway host',
|
|
17
18
|
default: 'localhost',
|
|
19
|
+
})
|
|
20
|
+
.option('env', {
|
|
21
|
+
alias: 'e',
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Env file path for runtime context',
|
|
18
24
|
})
|
|
19
25
|
.option('service', {
|
|
20
26
|
alias: 's',
|
|
@@ -32,6 +38,11 @@ exports.logsCommand = {
|
|
|
32
38
|
type: 'number',
|
|
33
39
|
description: 'Number of log lines to show',
|
|
34
40
|
default: 50,
|
|
41
|
+
})
|
|
42
|
+
.option('json', {
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: false,
|
|
45
|
+
description: 'Output JSON envelope',
|
|
35
46
|
}),
|
|
36
47
|
handler: async (argv) => {
|
|
37
48
|
const baseUrl = `http://${argv.host}:${argv.port}`;
|
|
@@ -44,10 +55,15 @@ exports.logsCommand = {
|
|
|
44
55
|
try {
|
|
45
56
|
const res = await fetch(`${baseUrl}/service/logs?${params}`);
|
|
46
57
|
if (!res.ok) {
|
|
47
|
-
|
|
48
|
-
|
|
58
|
+
throw new output_1.CliCommandError('server_logs_failed', `Failed to get logs: HTTP ${res.status}`, 1, {
|
|
59
|
+
status: res.status,
|
|
60
|
+
});
|
|
49
61
|
}
|
|
50
62
|
const logs = (await res.json());
|
|
63
|
+
if (argv.json) {
|
|
64
|
+
(0, output_1.writeJsonResult)({ logs });
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
51
67
|
if (logs.length === 0) {
|
|
52
68
|
console.log('No logs found.');
|
|
53
69
|
return;
|
|
@@ -58,9 +74,8 @@ exports.logsCommand = {
|
|
|
58
74
|
console.log(`${ts} [${level}] [${entry.source}] ${entry.message}`);
|
|
59
75
|
}
|
|
60
76
|
}
|
|
61
|
-
catch {
|
|
62
|
-
|
|
63
|
-
process.exit(1);
|
|
77
|
+
catch (error) {
|
|
78
|
+
(0, output_1.handleCliError)(error instanceof Error ? error : new Error(`Cannot connect to xpod at ${baseUrl}. Is it running?`), argv.json);
|
|
64
79
|
}
|
|
65
80
|
},
|
|
66
81
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":";;;AACA,0CAAiF;AAYpE,QAAA,WAAW,GAAoC;IAC1D,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,mBAAmB;IAC7B,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,MAAM,CAAC,MAAM,EAAE;QACd,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,IAAI;KACd,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,cAAc;QAC3B,OAAO,EAAE,WAAW;KACrB,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mCAAmC;KACjD,CAAC;SACD,MAAM,CAAC,SAAS,EAAE;QACjB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mCAAmC;KACjD,CAAC;SACD,MAAM,CAAC,OAAO,EAAE;QACf,KAAK,EAAE,GAAG;QACV,IAAI,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,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;gBACd,IAAA,wBAAe,EAAC,EAAE,IAAI,EAAE,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YAED,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACtB,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;gBAC9B,OAAO;YACT,CAAC;YAED,KAAK,MAAM,KAAK,IAAI,IAAI,EAAE,CAAC;gBACzB,MAAM,EAAE,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,kBAAkB,EAAE,CAAC;gBAC1D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;gBAClD,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,KAAK,MAAM,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAA,uBAAc,EAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,6BAA6B,OAAO,kBAAkB,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;QAChI,CAAC;IACH,CAAC;CACF,CAAC","sourcesContent":["import type { CommandModule } from 'yargs';\nimport { CliCommandError, handleCliError, writeJsonResult } from '../lib/output';\n\ninterface LogsArgs {\n port: number;\n host: string;\n service?: string;\n level?: string;\n limit: number;\n env?: string;\n json: boolean;\n}\n\nexport const logsCommand: CommandModule<object, LogsArgs> = {\n command: 'logs',\n describe: 'View service logs',\n builder: (yargs) =>\n yargs\n .option('port', {\n alias: 'p',\n type: 'number',\n description: 'Gateway port',\n default: 3000,\n })\n .option('host', {\n type: 'string',\n description: 'Gateway host',\n default: 'localhost',\n })\n .option('env', {\n alias: 'e',\n type: 'string',\n description: 'Env file path for runtime context',\n })\n .option('service', {\n alias: 's',\n type: 'string',\n description: 'Filter by service name (css, api)',\n })\n .option('level', {\n alias: 'l',\n type: 'string',\n choices: ['info', 'warn', 'error'],\n description: 'Filter by log level',\n })\n .option('limit', {\n alias: 'n',\n type: 'number',\n description: 'Number of log lines to show',\n default: 50,\n })\n .option('json', {\n type: 'boolean',\n default: false,\n description: 'Output JSON envelope',\n }),\n handler: async (argv) => {\n const baseUrl = `http://${argv.host}:${argv.port}`;\n const params = new URLSearchParams();\n if (argv.service) params.set('source', argv.service);\n if (argv.level) params.set('level', argv.level);\n params.set('limit', String(argv.limit));\n\n try {\n const res = await fetch(`${baseUrl}/service/logs?${params}`);\n if (!res.ok) {\n throw new CliCommandError('server_logs_failed', `Failed to get logs: HTTP ${res.status}`, 1, {\n status: res.status,\n });\n }\n\n const logs = (await res.json()) as Array<{\n timestamp: string;\n level: string;\n source: string;\n message: string;\n }>;\n\n if (argv.json) {\n writeJsonResult({ logs });\n return;\n }\n\n if (logs.length === 0) {\n console.log('No logs found.');\n return;\n }\n\n for (const entry of logs) {\n const ts = new Date(entry.timestamp).toLocaleTimeString();\n const level = entry.level.toUpperCase().padEnd(5);\n console.log(`${ts} [${level}] [${entry.source}] ${entry.message}`);\n }\n } catch (error) {\n handleCliError(error instanceof Error ? error : new Error(`Cannot connect to xpod at ${baseUrl}. Is it running?`), argv.json);\n }\n },\n};\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { CommandModule } from 'yargs';
|
|
2
|
+
import { type PodModelDescriptor } from '@undefineds.co/models';
|
|
3
|
+
interface ObjArgs {
|
|
4
|
+
url?: string;
|
|
5
|
+
json: boolean;
|
|
6
|
+
}
|
|
7
|
+
interface ObjMutationRow {
|
|
8
|
+
op?: string;
|
|
9
|
+
schema?: string;
|
|
10
|
+
match?: Record<string, unknown>;
|
|
11
|
+
set?: Record<string, unknown>;
|
|
12
|
+
subject?: string;
|
|
13
|
+
path?: string;
|
|
14
|
+
resource?: string;
|
|
15
|
+
predicate?: string;
|
|
16
|
+
object?: string;
|
|
17
|
+
ifMatch?: string;
|
|
18
|
+
body?: string;
|
|
19
|
+
from?: string;
|
|
20
|
+
contentType?: string;
|
|
21
|
+
}
|
|
22
|
+
interface ResolvedObjSelector {
|
|
23
|
+
descriptor: PodModelDescriptor;
|
|
24
|
+
subject?: string;
|
|
25
|
+
resourceUrl?: string;
|
|
26
|
+
where: Record<string, unknown>;
|
|
27
|
+
relations: Record<string, string>;
|
|
28
|
+
limit: number;
|
|
29
|
+
includeMetadata: boolean;
|
|
30
|
+
}
|
|
31
|
+
export declare function redactDescriptorObject(descriptor: PodModelDescriptor, value: Record<string, unknown>): Record<string, unknown>;
|
|
32
|
+
export declare function buildDescriptorUpsertSparql(descriptor: PodModelDescriptor, subject: string, row: ObjMutationRow): string;
|
|
33
|
+
export declare function buildDescriptorPatchSparql(descriptor: PodModelDescriptor, subject: string, set: Record<string, unknown>): string;
|
|
34
|
+
export declare function buildDescriptorLinkSparql(subject: string, predicate: string, object: string): string;
|
|
35
|
+
export declare function buildDescriptorDeleteSparql(subject: string): string;
|
|
36
|
+
export declare function extractReservedWhereSelectors(where: Record<string, unknown>): {
|
|
37
|
+
where: Record<string, unknown>;
|
|
38
|
+
subject?: string;
|
|
39
|
+
resource?: string;
|
|
40
|
+
path?: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function buildDescriptorObjectQuery(selector: ResolvedObjSelector): string;
|
|
43
|
+
export declare const objCommand: CommandModule<object, ObjArgs>;
|
|
44
|
+
export {};
|