@ankhorage/data-sources 2.0.40 → 2.1.0
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 +6 -0
- package/README.md +1 -1
- package/dist/ankh.provider.d.ts +41 -1
- package/dist/ankh.provider.d.ts.map +1 -1
- package/dist/ankh.provider.js +2 -7
- package/dist/ankh.provider.js.map +1 -1
- package/dist/capabilities/index.d.ts +43 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +36 -0
- package/dist/capabilities/index.js.map +1 -0
- package/package.json +68 -7
- package/src/ankh.provider.ts +5 -9
- package/src/capabilities/index.test.ts +21 -0
- package/src/capabilities/index.ts +37 -0
- package/src/provider.test.ts +8 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/data-sources
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Provider-neutral data source and endpoint system for APIs, databases, and runtime bindings.
|
|
9
9
|
|
package/dist/ankh.provider.d.ts
CHANGED
|
@@ -2,7 +2,47 @@ declare const provider: {
|
|
|
2
2
|
id: "@ankhorage/data-sources";
|
|
3
3
|
category: string;
|
|
4
4
|
version: string;
|
|
5
|
-
capabilities: readonly [
|
|
5
|
+
capabilities: readonly [{
|
|
6
|
+
readonly id: "data-sources.inspect";
|
|
7
|
+
readonly owner: "@ankhorage/data-sources";
|
|
8
|
+
readonly access: readonly ["invoke"];
|
|
9
|
+
readonly binding: {
|
|
10
|
+
readonly kind: "action";
|
|
11
|
+
readonly bindableAs: readonly ["target"];
|
|
12
|
+
};
|
|
13
|
+
readonly label: "Inspect data sources";
|
|
14
|
+
readonly description: "List supported data-source kinds.";
|
|
15
|
+
}, {
|
|
16
|
+
readonly id: "data-sources.validate";
|
|
17
|
+
readonly owner: "@ankhorage/data-sources";
|
|
18
|
+
readonly access: readonly ["invoke"];
|
|
19
|
+
readonly binding: {
|
|
20
|
+
readonly kind: "action";
|
|
21
|
+
readonly bindableAs: readonly ["target"];
|
|
22
|
+
};
|
|
23
|
+
readonly label: "Validate data-source config";
|
|
24
|
+
readonly description: "Validate a data-source config with the data-sources package.";
|
|
25
|
+
}, {
|
|
26
|
+
readonly id: "data-sources.test";
|
|
27
|
+
readonly owner: "@ankhorage/data-sources";
|
|
28
|
+
readonly access: readonly ["invoke"];
|
|
29
|
+
readonly binding: {
|
|
30
|
+
readonly kind: "action";
|
|
31
|
+
readonly bindableAs: readonly ["target"];
|
|
32
|
+
};
|
|
33
|
+
readonly label: "Test data-source endpoint";
|
|
34
|
+
readonly description: "Build or execute a data-source endpoint test request.";
|
|
35
|
+
}, {
|
|
36
|
+
readonly id: "data-sources.normalize";
|
|
37
|
+
readonly owner: "@ankhorage/data-sources";
|
|
38
|
+
readonly access: readonly ["invoke"];
|
|
39
|
+
readonly binding: {
|
|
40
|
+
readonly kind: "action";
|
|
41
|
+
readonly bindableAs: readonly ["target"];
|
|
42
|
+
};
|
|
43
|
+
readonly label: "Normalize data-source config";
|
|
44
|
+
readonly description: "Normalize imported data-source config output.";
|
|
45
|
+
}];
|
|
6
46
|
commands: readonly [{
|
|
7
47
|
readonly path: readonly ["kind", "list"];
|
|
8
48
|
readonly summary: "List supported data-source kinds.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ankh.provider.d.ts","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ankh.provider.d.ts","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAoDA,QAAA,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAdK;YACf,QAAQ,CAAC,OAAO,EAAE;gBAChB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;aACjC,CAAC;SACH;;;;CAiBF,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
package/dist/ankh.provider.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
+
import { CAPABILITIES } from './capabilities';
|
|
1
2
|
import { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './packageInfo';
|
|
2
3
|
const DATA_SOURCES_PACKAGE_VERSION = '0.5.1';
|
|
3
4
|
const DATA_SOURCES_COMMAND_CATEGORY = 'data-sources';
|
|
4
|
-
const DATA_SOURCES_CAPABILITIES = [
|
|
5
|
-
'data-sources.inspect',
|
|
6
|
-
'data-sources.validate',
|
|
7
|
-
'data-sources.test',
|
|
8
|
-
'data-sources.normalize',
|
|
9
|
-
];
|
|
10
5
|
const commands = [
|
|
11
6
|
{
|
|
12
7
|
path: ['kind', 'list'],
|
|
@@ -47,7 +42,7 @@ const provider = {
|
|
|
47
42
|
id: DATA_SOURCES_PACKAGE_NAME,
|
|
48
43
|
category: DATA_SOURCES_COMMAND_CATEGORY,
|
|
49
44
|
version: DATA_SOURCES_PACKAGE_VERSION,
|
|
50
|
-
capabilities:
|
|
45
|
+
capabilities: CAPABILITIES,
|
|
51
46
|
commands,
|
|
52
47
|
handlers,
|
|
53
48
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ankh.provider.js","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ankh.provider.js","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAEvF,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAC7C,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAErD,MAAM,QAAQ,GAAG;IACf;QACE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,mCAAmC;QAC5C,UAAU,EAAE,sBAAsB;QAClC,OAAO,EAAE,CAAC,OAAO,CAAC;QAClB,QAAQ,EAAE,CAAC,6BAA6B,CAAC;KAC1C;IACD;QACE,IAAI,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC;QAC5B,OAAO,EAAE,8DAA8D;QACvE,UAAU,EAAE,uBAAuB;QACnC,QAAQ,EAAE,CAAC,sDAAsD,CAAC;KACnE;IACD;QACE,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,CAAC;QAC1B,OAAO,EAAE,uDAAuD;QAChE,UAAU,EAAE,mBAAmB;QAC/B,QAAQ,EAAE,CAAC,6DAA6D,CAAC;KAC1E;IACD;QACE,IAAI,EAAE,CAAC,QAAQ,EAAE,WAAW,CAAC;QAC7B,OAAO,EAAE,+CAA+C;QACxD,UAAU,EAAE,wBAAwB;QACpC,QAAQ,EAAE,CAAC,mDAAmD,CAAC;KAChE;CACkD,CAAC;AAEtD,MAAM,QAAQ,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,EAAE,OAAO,CAAC,IAAI;IAClB,OAAO,CAAC,OAIP;QACC,MAAM,cAAc,GAAG,2BAA2B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC9D,OAAO,CAAC,OAAO,CAAC,WAAW,CACzB,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,yBAAyB,IAAI;YACvE,oBAAoB,cAAc,KAAK,CAC1C,CAAC;QACF,OAAO,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACzB,CAAC;CACF,CAAC,CAAC,CAAC;AAEJ,MAAM,QAAQ,GAAG;IACf,EAAE,EAAE,yBAAyB;IAC7B,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,4BAA4B;IACrC,YAAY,EAAE,YAAY;IAC1B,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import type { AnkhCommandDescriptor } from '@ankhorage/contracts/cli';\n\nimport { CAPABILITIES } from './capabilities';\nimport { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './packageInfo';\n\nconst DATA_SOURCES_PACKAGE_VERSION = '0.5.1';\nconst DATA_SOURCES_COMMAND_CATEGORY = 'data-sources';\n\nconst commands = [\n {\n path: ['kind', 'list'],\n summary: 'List supported data-source kinds.',\n capability: 'data-sources.inspect',\n aliases: ['kinds'],\n examples: ['ankh data-sources kind list'],\n },\n {\n path: ['config', 'validate'],\n summary: 'Validate a data-source config with the data-sources package.',\n capability: 'data-sources.validate',\n examples: ['ankh data-sources config validate ./data-source.json'],\n },\n {\n path: ['endpoint', 'test'],\n summary: 'Build or execute a data-source endpoint test request.',\n capability: 'data-sources.test',\n examples: ['ankh data-sources endpoint test orders listOrders --dry-run'],\n },\n {\n path: ['config', 'normalize'],\n summary: 'Normalize imported data-source config output.',\n capability: 'data-sources.normalize',\n examples: ['ankh data-sources config normalize ./openapi.json'],\n },\n] as const satisfies readonly AnkhCommandDescriptor[];\n\nconst handlers = commands.map((command) => ({\n path: command.path,\n handler(request: {\n readonly context: {\n writeStdout(text: string): void;\n };\n }) {\n const supportedKinds = SUPPORTED_DATA_SOURCE_KINDS.join(', ');\n request.context.writeStdout(\n `${command.path.join(' ')} is provided by ${DATA_SOURCES_PACKAGE_NAME}. ` +\n `Supported kinds: ${supportedKinds}.\\n`,\n );\n return { exitCode: 0 };\n },\n}));\n\nconst provider = {\n id: DATA_SOURCES_PACKAGE_NAME,\n category: DATA_SOURCES_COMMAND_CATEGORY,\n version: DATA_SOURCES_PACKAGE_VERSION,\n capabilities: CAPABILITIES,\n commands,\n handlers,\n};\n\nexport default provider;\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/*** Publish the canonical catalog for Data Sources CLI capabilities. */
|
|
2
|
+
export declare const CAPABILITIES: readonly [{
|
|
3
|
+
readonly id: "data-sources.inspect";
|
|
4
|
+
readonly owner: "@ankhorage/data-sources";
|
|
5
|
+
readonly access: readonly ["invoke"];
|
|
6
|
+
readonly binding: {
|
|
7
|
+
readonly kind: "action";
|
|
8
|
+
readonly bindableAs: readonly ["target"];
|
|
9
|
+
};
|
|
10
|
+
readonly label: "Inspect data sources";
|
|
11
|
+
readonly description: "List supported data-source kinds.";
|
|
12
|
+
}, {
|
|
13
|
+
readonly id: "data-sources.validate";
|
|
14
|
+
readonly owner: "@ankhorage/data-sources";
|
|
15
|
+
readonly access: readonly ["invoke"];
|
|
16
|
+
readonly binding: {
|
|
17
|
+
readonly kind: "action";
|
|
18
|
+
readonly bindableAs: readonly ["target"];
|
|
19
|
+
};
|
|
20
|
+
readonly label: "Validate data-source config";
|
|
21
|
+
readonly description: "Validate a data-source config with the data-sources package.";
|
|
22
|
+
}, {
|
|
23
|
+
readonly id: "data-sources.test";
|
|
24
|
+
readonly owner: "@ankhorage/data-sources";
|
|
25
|
+
readonly access: readonly ["invoke"];
|
|
26
|
+
readonly binding: {
|
|
27
|
+
readonly kind: "action";
|
|
28
|
+
readonly bindableAs: readonly ["target"];
|
|
29
|
+
};
|
|
30
|
+
readonly label: "Test data-source endpoint";
|
|
31
|
+
readonly description: "Build or execute a data-source endpoint test request.";
|
|
32
|
+
}, {
|
|
33
|
+
readonly id: "data-sources.normalize";
|
|
34
|
+
readonly owner: "@ankhorage/data-sources";
|
|
35
|
+
readonly access: readonly ["invoke"];
|
|
36
|
+
readonly binding: {
|
|
37
|
+
readonly kind: "action";
|
|
38
|
+
readonly bindableAs: readonly ["target"];
|
|
39
|
+
};
|
|
40
|
+
readonly label: "Normalize data-source config";
|
|
41
|
+
readonly description: "Normalize imported data-source config output.";
|
|
42
|
+
}];
|
|
43
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCiB,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*** Publish the canonical catalog for Data Sources CLI capabilities. */
|
|
2
|
+
export const CAPABILITIES = [
|
|
3
|
+
{
|
|
4
|
+
id: 'data-sources.inspect',
|
|
5
|
+
owner: '@ankhorage/data-sources',
|
|
6
|
+
access: ['invoke'],
|
|
7
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
8
|
+
label: 'Inspect data sources',
|
|
9
|
+
description: 'List supported data-source kinds.',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'data-sources.validate',
|
|
13
|
+
owner: '@ankhorage/data-sources',
|
|
14
|
+
access: ['invoke'],
|
|
15
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
16
|
+
label: 'Validate data-source config',
|
|
17
|
+
description: 'Validate a data-source config with the data-sources package.',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: 'data-sources.test',
|
|
21
|
+
owner: '@ankhorage/data-sources',
|
|
22
|
+
access: ['invoke'],
|
|
23
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
24
|
+
label: 'Test data-source endpoint',
|
|
25
|
+
description: 'Build or execute a data-source endpoint test request.',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 'data-sources.normalize',
|
|
29
|
+
owner: '@ankhorage/data-sources',
|
|
30
|
+
access: ['invoke'],
|
|
31
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
32
|
+
label: 'Normalize data-source config',
|
|
33
|
+
description: 'Normalize imported data-source config output.',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/capabilities/index.ts"],"names":[],"mappings":"AAEA,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B;QACE,EAAE,EAAE,sBAAsB;QAC1B,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,sBAAsB;QAC7B,WAAW,EAAE,mCAAmC;KACjD;IACD;QACE,EAAE,EAAE,uBAAuB;QAC3B,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,6BAA6B;QACpC,WAAW,EAAE,8DAA8D;KAC5E;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,2BAA2B;QAClC,WAAW,EAAE,uDAAuD;KACrE;IACD;QACE,EAAE,EAAE,wBAAwB;QAC5B,KAAK,EAAE,yBAAyB;QAChC,MAAM,EAAE,CAAC,QAAQ,CAAC;QAClB,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE;QACnD,KAAK,EAAE,8BAA8B;QACrC,WAAW,EAAE,+CAA+C;KAC7D;CACuC,CAAC","sourcesContent":["import type { Capability } from '@ankhorage/contracts/capabilities';\n\n/*** Publish the canonical catalog for Data Sources CLI capabilities. */\nexport const CAPABILITIES = [\n {\n id: 'data-sources.inspect',\n owner: '@ankhorage/data-sources',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Inspect data sources',\n description: 'List supported data-source kinds.',\n },\n {\n id: 'data-sources.validate',\n owner: '@ankhorage/data-sources',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Validate data-source config',\n description: 'Validate a data-source config with the data-sources package.',\n },\n {\n id: 'data-sources.test',\n owner: '@ankhorage/data-sources',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Test data-source endpoint',\n description: 'Build or execute a data-source endpoint test request.',\n },\n {\n id: 'data-sources.normalize',\n owner: '@ankhorage/data-sources',\n access: ['invoke'],\n binding: { kind: 'action', bindableAs: ['target'] },\n label: 'Normalize data-source config',\n description: 'Normalize imported data-source config output.',\n },\n] as const satisfies readonly Capability[];\n"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/data-sources",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "2.0
|
|
4
|
+
"version": "2.1.0",
|
|
5
5
|
"description": "Headless toolkit for importing, normalizing, and executing canonical Ankhorage API and data-source configs.",
|
|
6
6
|
"homepage": "https://github.com/ankhorage/data-sources#readme",
|
|
7
7
|
"bugs": {
|
|
@@ -31,10 +31,66 @@
|
|
|
31
31
|
"category": "data-sources",
|
|
32
32
|
"provider": "./dist/cli/index.js",
|
|
33
33
|
"capabilities": [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
{
|
|
35
|
+
"id": "data-sources.inspect",
|
|
36
|
+
"owner": "@ankhorage/data-sources",
|
|
37
|
+
"access": [
|
|
38
|
+
"invoke"
|
|
39
|
+
],
|
|
40
|
+
"binding": {
|
|
41
|
+
"kind": "action",
|
|
42
|
+
"bindableAs": [
|
|
43
|
+
"target"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"label": "Inspect data sources",
|
|
47
|
+
"description": "List supported data-source kinds."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"id": "data-sources.validate",
|
|
51
|
+
"owner": "@ankhorage/data-sources",
|
|
52
|
+
"access": [
|
|
53
|
+
"invoke"
|
|
54
|
+
],
|
|
55
|
+
"binding": {
|
|
56
|
+
"kind": "action",
|
|
57
|
+
"bindableAs": [
|
|
58
|
+
"target"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
"label": "Validate data-source config",
|
|
62
|
+
"description": "Validate a data-source config with the data-sources package."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"id": "data-sources.test",
|
|
66
|
+
"owner": "@ankhorage/data-sources",
|
|
67
|
+
"access": [
|
|
68
|
+
"invoke"
|
|
69
|
+
],
|
|
70
|
+
"binding": {
|
|
71
|
+
"kind": "action",
|
|
72
|
+
"bindableAs": [
|
|
73
|
+
"target"
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
"label": "Test data-source endpoint",
|
|
77
|
+
"description": "Build or execute a data-source endpoint test request."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"id": "data-sources.normalize",
|
|
81
|
+
"owner": "@ankhorage/data-sources",
|
|
82
|
+
"access": [
|
|
83
|
+
"invoke"
|
|
84
|
+
],
|
|
85
|
+
"binding": {
|
|
86
|
+
"kind": "action",
|
|
87
|
+
"bindableAs": [
|
|
88
|
+
"target"
|
|
89
|
+
]
|
|
90
|
+
},
|
|
91
|
+
"label": "Normalize data-source config",
|
|
92
|
+
"description": "Normalize imported data-source config output."
|
|
93
|
+
}
|
|
38
94
|
]
|
|
39
95
|
},
|
|
40
96
|
"files": [
|
|
@@ -57,7 +113,12 @@
|
|
|
57
113
|
"import": "./dist/cli/index.js",
|
|
58
114
|
"default": "./dist/cli/index.js"
|
|
59
115
|
},
|
|
60
|
-
"./package.json": "./package.json"
|
|
116
|
+
"./package.json": "./package.json",
|
|
117
|
+
"./capabilities": {
|
|
118
|
+
"types": "./dist/capabilities/index.d.ts",
|
|
119
|
+
"import": "./dist/capabilities/index.js",
|
|
120
|
+
"default": "./dist/capabilities/index.js"
|
|
121
|
+
}
|
|
61
122
|
},
|
|
62
123
|
"publishConfig": {
|
|
63
124
|
"access": "public"
|
|
@@ -78,7 +139,7 @@
|
|
|
78
139
|
"knip:check": "ankhorage-knip"
|
|
79
140
|
},
|
|
80
141
|
"devDependencies": {
|
|
81
|
-
"@ankhorage/devtools": "^2.
|
|
142
|
+
"@ankhorage/devtools": "^2.3.5",
|
|
82
143
|
"@ankhorage/paradox": "^0.3.1",
|
|
83
144
|
"@types/bun": "^1.4.2",
|
|
84
145
|
"@types/node": "^26.6.4",
|
package/src/ankh.provider.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
+
import type { AnkhCommandDescriptor } from '@ankhorage/contracts/cli';
|
|
2
|
+
|
|
3
|
+
import { CAPABILITIES } from './capabilities';
|
|
1
4
|
import { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './packageInfo';
|
|
2
5
|
|
|
3
6
|
const DATA_SOURCES_PACKAGE_VERSION = '0.5.1';
|
|
4
7
|
const DATA_SOURCES_COMMAND_CATEGORY = 'data-sources';
|
|
5
8
|
|
|
6
|
-
const DATA_SOURCES_CAPABILITIES = [
|
|
7
|
-
'data-sources.inspect',
|
|
8
|
-
'data-sources.validate',
|
|
9
|
-
'data-sources.test',
|
|
10
|
-
'data-sources.normalize',
|
|
11
|
-
] as const;
|
|
12
|
-
|
|
13
9
|
const commands = [
|
|
14
10
|
{
|
|
15
11
|
path: ['kind', 'list'],
|
|
@@ -36,7 +32,7 @@ const commands = [
|
|
|
36
32
|
capability: 'data-sources.normalize',
|
|
37
33
|
examples: ['ankh data-sources config normalize ./openapi.json'],
|
|
38
34
|
},
|
|
39
|
-
] as const;
|
|
35
|
+
] as const satisfies readonly AnkhCommandDescriptor[];
|
|
40
36
|
|
|
41
37
|
const handlers = commands.map((command) => ({
|
|
42
38
|
path: command.path,
|
|
@@ -58,7 +54,7 @@ const provider = {
|
|
|
58
54
|
id: DATA_SOURCES_PACKAGE_NAME,
|
|
59
55
|
category: DATA_SOURCES_COMMAND_CATEGORY,
|
|
60
56
|
version: DATA_SOURCES_PACKAGE_VERSION,
|
|
61
|
-
capabilities:
|
|
57
|
+
capabilities: CAPABILITIES,
|
|
62
58
|
commands,
|
|
63
59
|
handlers,
|
|
64
60
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { isCapability } from '@ankhorage/contracts/capabilities';
|
|
2
|
+
import { describe, expect, test } from 'bun:test';
|
|
3
|
+
|
|
4
|
+
import packageManifest from '../../package.json';
|
|
5
|
+
import { CAPABILITIES } from './index';
|
|
6
|
+
|
|
7
|
+
describe('CAPABILITIES', () => {
|
|
8
|
+
test('publishes the current data-source provider capability surface', () => {
|
|
9
|
+
expect(CAPABILITIES.map((capability) => capability.id)).toEqual([
|
|
10
|
+
'data-sources.inspect',
|
|
11
|
+
'data-sources.validate',
|
|
12
|
+
'data-sources.test',
|
|
13
|
+
'data-sources.normalize',
|
|
14
|
+
]);
|
|
15
|
+
expect(CAPABILITIES.every(isCapability)).toBe(true);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
test('matches published package discovery metadata', () => {
|
|
19
|
+
expect(packageManifest.ankh.capabilities).toEqual(CAPABILITIES);
|
|
20
|
+
});
|
|
21
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Capability } from '@ankhorage/contracts/capabilities';
|
|
2
|
+
|
|
3
|
+
/*** Publish the canonical catalog for Data Sources CLI capabilities. */
|
|
4
|
+
export const CAPABILITIES = [
|
|
5
|
+
{
|
|
6
|
+
id: 'data-sources.inspect',
|
|
7
|
+
owner: '@ankhorage/data-sources',
|
|
8
|
+
access: ['invoke'],
|
|
9
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
10
|
+
label: 'Inspect data sources',
|
|
11
|
+
description: 'List supported data-source kinds.',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
id: 'data-sources.validate',
|
|
15
|
+
owner: '@ankhorage/data-sources',
|
|
16
|
+
access: ['invoke'],
|
|
17
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
18
|
+
label: 'Validate data-source config',
|
|
19
|
+
description: 'Validate a data-source config with the data-sources package.',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'data-sources.test',
|
|
23
|
+
owner: '@ankhorage/data-sources',
|
|
24
|
+
access: ['invoke'],
|
|
25
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
26
|
+
label: 'Test data-source endpoint',
|
|
27
|
+
description: 'Build or execute a data-source endpoint test request.',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
id: 'data-sources.normalize',
|
|
31
|
+
owner: '@ankhorage/data-sources',
|
|
32
|
+
access: ['invoke'],
|
|
33
|
+
binding: { kind: 'action', bindableAs: ['target'] },
|
|
34
|
+
label: 'Normalize data-source config',
|
|
35
|
+
description: 'Normalize imported data-source config output.',
|
|
36
|
+
},
|
|
37
|
+
] as const satisfies readonly Capability[];
|
package/src/provider.test.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { describe, expect, test } from 'bun:test';
|
|
2
2
|
|
|
3
3
|
import provider from './ankh.provider';
|
|
4
|
+
import { CAPABILITIES } from './capabilities';
|
|
4
5
|
|
|
5
6
|
describe('provider', () => {
|
|
6
7
|
test('lists data-source commands', () => {
|
|
@@ -12,4 +13,11 @@ describe('provider', () => {
|
|
|
12
13
|
'config normalize',
|
|
13
14
|
]);
|
|
14
15
|
});
|
|
16
|
+
|
|
17
|
+
test('uses the canonical capability catalog for provider and command metadata', () => {
|
|
18
|
+
expect(provider.capabilities).toBe(CAPABILITIES);
|
|
19
|
+
expect(provider.commands.map((command) => command.capability)).toEqual(
|
|
20
|
+
CAPABILITIES.map((capability) => capability.id),
|
|
21
|
+
);
|
|
22
|
+
});
|
|
15
23
|
});
|