@ankhorage/data-sources 0.5.0 → 0.5.2

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @ankhorage/data-sources
2
2
 
3
+ ## 0.5.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 6436cf9: Expose data-source inspection, validation, test, and normalization commands through an Ankh provider manifest.
8
+
9
+ ## 0.5.1
10
+
11
+ ### Patch Changes
12
+
13
+ - 84abe70: Update CONTRACTS & update docs
14
+
3
15
  ## 0.5.0
4
16
 
5
17
  ### Minor Changes
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  # @ankhorage/data-sources
5
5
 
6
- ![license: MIT](././paradox/badges/license.svg) ![npm: v0.3.0](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
6
+ ![license: MIT](././paradox/badges/license.svg) ![npm: v0.5.1](././paradox/badges/npm.svg) ![runtime: bun](././paradox/badges/runtime.svg) ![typescript: strict](././paradox/badges/typescript.svg) ![eslint: checked](././paradox/badges/eslint.svg) ![prettier: checked](././paradox/badges/prettier.svg) ![build: checked](././paradox/badges/build.svg) ![tests: checked](././paradox/badges/tests.svg) ![docs: paradox](././paradox/badges/docs.svg)
7
7
 
8
8
  Provider-neutral data source and endpoint system for APIs, databases, and runtime bindings.
9
9
 
@@ -34,6 +34,9 @@ graph TD
34
34
  package__ankhorage_data_sources["@ankhorage/data-sources"]
35
35
  entrypoint_src_index_ts["src/index.ts"]
36
36
  package__ankhorage_data_sources --> entrypoint_src_index_ts
37
+ module_src_ankh_provider_ts["src/ankh.provider.ts"]
38
+ package__ankhorage_data_sources -.-> module_src_ankh_provider_ts
39
+ module_src_ankh_provider_ts --> module_src_index_ts
37
40
  module_src_graphql_index_ts["src/graphql/index.ts"]
38
41
  package__ankhorage_data_sources -.-> module_src_graphql_index_ts
39
42
  module_src_index_ts["src/index.ts"]
@@ -0,0 +1,40 @@
1
+ declare const provider: {
2
+ id: "@ankhorage/data-sources";
3
+ category: string;
4
+ version: string;
5
+ capabilities: readonly ["data-sources.inspect", "data-sources.validate", "data-sources.test", "data-sources.normalize"];
6
+ commands: readonly [{
7
+ readonly path: readonly ["kind", "list"];
8
+ readonly summary: "List supported data-source kinds.";
9
+ readonly capability: "data-sources.inspect";
10
+ readonly aliases: readonly ["kinds"];
11
+ readonly examples: readonly ["ankh data-sources kind list"];
12
+ }, {
13
+ readonly path: readonly ["config", "validate"];
14
+ readonly summary: "Validate a data-source config with the data-sources package.";
15
+ readonly capability: "data-sources.validate";
16
+ readonly examples: readonly ["ankh data-sources config validate ./data-source.json"];
17
+ }, {
18
+ readonly path: readonly ["endpoint", "test"];
19
+ readonly summary: "Build or execute a data-source endpoint test request.";
20
+ readonly capability: "data-sources.test";
21
+ readonly examples: readonly ["ankh data-sources endpoint test orders listOrders --dry-run"];
22
+ }, {
23
+ readonly path: readonly ["config", "normalize"];
24
+ readonly summary: "Normalize imported data-source config output.";
25
+ readonly capability: "data-sources.normalize";
26
+ readonly examples: readonly ["ankh data-sources config normalize ./openapi.json"];
27
+ }];
28
+ handlers: {
29
+ path: readonly ["kind", "list"] | readonly ["config", "validate"] | readonly ["endpoint", "test"] | readonly ["config", "normalize"];
30
+ handler(request: {
31
+ readonly context: {
32
+ writeStdout(text: string): void;
33
+ };
34
+ }): {
35
+ exitCode: number;
36
+ };
37
+ }[];
38
+ };
39
+ export default provider;
40
+ //# sourceMappingURL=ankh.provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ankh.provider.d.ts","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAwDA,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"}
@@ -0,0 +1,55 @@
1
+ import { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './index';
2
+ const DATA_SOURCES_PACKAGE_VERSION = '0.5.1';
3
+ 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
+ const commands = [
11
+ {
12
+ path: ['kind', 'list'],
13
+ summary: 'List supported data-source kinds.',
14
+ capability: 'data-sources.inspect',
15
+ aliases: ['kinds'],
16
+ examples: ['ankh data-sources kind list'],
17
+ },
18
+ {
19
+ path: ['config', 'validate'],
20
+ summary: 'Validate a data-source config with the data-sources package.',
21
+ capability: 'data-sources.validate',
22
+ examples: ['ankh data-sources config validate ./data-source.json'],
23
+ },
24
+ {
25
+ path: ['endpoint', 'test'],
26
+ summary: 'Build or execute a data-source endpoint test request.',
27
+ capability: 'data-sources.test',
28
+ examples: ['ankh data-sources endpoint test orders listOrders --dry-run'],
29
+ },
30
+ {
31
+ path: ['config', 'normalize'],
32
+ summary: 'Normalize imported data-source config output.',
33
+ capability: 'data-sources.normalize',
34
+ examples: ['ankh data-sources config normalize ./openapi.json'],
35
+ },
36
+ ];
37
+ const handlers = commands.map((command) => ({
38
+ path: command.path,
39
+ handler(request) {
40
+ const supportedKinds = SUPPORTED_DATA_SOURCE_KINDS.join(', ');
41
+ request.context.writeStdout(`${command.path.join(' ')} is provided by ${DATA_SOURCES_PACKAGE_NAME}. ` +
42
+ `Supported kinds: ${supportedKinds}.\n`);
43
+ return { exitCode: 0 };
44
+ },
45
+ }));
46
+ const provider = {
47
+ id: DATA_SOURCES_PACKAGE_NAME,
48
+ category: DATA_SOURCES_COMMAND_CATEGORY,
49
+ version: DATA_SOURCES_PACKAGE_VERSION,
50
+ capabilities: DATA_SOURCES_CAPABILITIES,
51
+ commands,
52
+ handlers,
53
+ };
54
+ export default provider;
55
+ //# sourceMappingURL=ankh.provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ankh.provider.js","sourceRoot":"","sources":["../src/ankh.provider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,SAAS,CAAC;AAEjF,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAC7C,MAAM,6BAA6B,GAAG,cAAc,CAAC;AAErD,MAAM,yBAAyB,GAAG;IAChC,sBAAsB;IACtB,uBAAuB;IACvB,mBAAmB;IACnB,wBAAwB;CAChB,CAAC;AAEX,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;CACO,CAAC;AAEX,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,yBAAyB;IACvC,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './index';\n\nconst DATA_SOURCES_PACKAGE_VERSION = '0.5.1';\nconst DATA_SOURCES_COMMAND_CATEGORY = 'data-sources';\n\nconst DATA_SOURCES_CAPABILITIES = [\n 'data-sources.inspect',\n 'data-sources.validate',\n 'data-sources.test',\n 'data-sources.normalize',\n] as const;\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;\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: DATA_SOURCES_CAPABILITIES,\n commands,\n handlers,\n};\n\nexport default provider;\n"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ankhorage/data-sources",
3
3
  "type": "module",
4
- "version": "0.5.0",
4
+ "version": "0.5.2",
5
5
  "description": "Headless toolkit for importing, generating, normalizing, and testing Ankhorage data-source configs.",
6
6
  "homepage": "https://github.com/ankhorage/data-sources#readme",
7
7
  "bugs": {
@@ -25,7 +25,17 @@
25
25
  "typescript"
26
26
  ],
27
27
  "dependencies": {
28
- "@ankhorage/contracts": "^1.12.0"
28
+ "@ankhorage/contracts": "^1.18.3"
29
+ },
30
+ "ankh": {
31
+ "category": "data-sources",
32
+ "provider": "./dist/ankh.provider.js",
33
+ "capabilities": [
34
+ "data-sources.inspect",
35
+ "data-sources.validate",
36
+ "data-sources.test",
37
+ "data-sources.normalize"
38
+ ]
29
39
  },
30
40
  "files": [
31
41
  "dist",
@@ -54,7 +64,7 @@
54
64
  "docs": "paradox",
55
65
  "knip": "ankhorage-knip",
56
66
  "lint": "ankhorage-eslint . --max-warnings=0",
57
- "lint:fix": "ankhorage-eslint . --fix --max-warnings=0",
67
+ "lint:fix": "ankhorage-eslint . --fix",
58
68
  "format": "ankhorage-prettier --write .",
59
69
  "format:check": "ankhorage-prettier --check .",
60
70
  "prepack": "bun run build",
@@ -0,0 +1,66 @@
1
+ import { DATA_SOURCES_PACKAGE_NAME, SUPPORTED_DATA_SOURCE_KINDS } from './index';
2
+
3
+ const DATA_SOURCES_PACKAGE_VERSION = '0.5.1';
4
+ const DATA_SOURCES_COMMAND_CATEGORY = 'data-sources';
5
+
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
+ const commands = [
14
+ {
15
+ path: ['kind', 'list'],
16
+ summary: 'List supported data-source kinds.',
17
+ capability: 'data-sources.inspect',
18
+ aliases: ['kinds'],
19
+ examples: ['ankh data-sources kind list'],
20
+ },
21
+ {
22
+ path: ['config', 'validate'],
23
+ summary: 'Validate a data-source config with the data-sources package.',
24
+ capability: 'data-sources.validate',
25
+ examples: ['ankh data-sources config validate ./data-source.json'],
26
+ },
27
+ {
28
+ path: ['endpoint', 'test'],
29
+ summary: 'Build or execute a data-source endpoint test request.',
30
+ capability: 'data-sources.test',
31
+ examples: ['ankh data-sources endpoint test orders listOrders --dry-run'],
32
+ },
33
+ {
34
+ path: ['config', 'normalize'],
35
+ summary: 'Normalize imported data-source config output.',
36
+ capability: 'data-sources.normalize',
37
+ examples: ['ankh data-sources config normalize ./openapi.json'],
38
+ },
39
+ ] as const;
40
+
41
+ const handlers = commands.map((command) => ({
42
+ path: command.path,
43
+ handler(request: {
44
+ readonly context: {
45
+ writeStdout(text: string): void;
46
+ };
47
+ }) {
48
+ const supportedKinds = SUPPORTED_DATA_SOURCE_KINDS.join(', ');
49
+ request.context.writeStdout(
50
+ `${command.path.join(' ')} is provided by ${DATA_SOURCES_PACKAGE_NAME}. ` +
51
+ `Supported kinds: ${supportedKinds}.\n`,
52
+ );
53
+ return { exitCode: 0 };
54
+ },
55
+ }));
56
+
57
+ const provider = {
58
+ id: DATA_SOURCES_PACKAGE_NAME,
59
+ category: DATA_SOURCES_COMMAND_CATEGORY,
60
+ version: DATA_SOURCES_PACKAGE_VERSION,
61
+ capabilities: DATA_SOURCES_CAPABILITIES,
62
+ commands,
63
+ handlers,
64
+ };
65
+
66
+ export default provider;
@@ -0,0 +1,15 @@
1
+ import { describe, expect, test } from 'bun:test';
2
+
3
+ import provider from './ankh.provider';
4
+
5
+ describe('provider', () => {
6
+ test('lists data-source commands', () => {
7
+ expect(provider.category).toBe('data-sources');
8
+ expect(provider.commands.map((command) => command.path.join(' '))).toEqual([
9
+ 'kind list',
10
+ 'config validate',
11
+ 'endpoint test',
12
+ 'config normalize',
13
+ ]);
14
+ });
15
+ });