@ankhorage/contracts 1.19.1 → 1.19.3

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/contracts
2
2
 
3
+ ## 1.19.3
4
+
5
+ ### Patch Changes
6
+
7
+ - 01a73ed: Update CLI provider metadata examples.
8
+
9
+ ## 1.19.2
10
+
11
+ ### Patch Changes
12
+
13
+ - 20bd7b6: Add shared runtime callback contracts for node prop resolvers and callback maps.
14
+
3
15
  ## 1.19.1
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -88,7 +88,7 @@ provider module path:
88
88
  {
89
89
  "ankh": {
90
90
  "category": "infra",
91
- "provider": "./dist/ankh.provider.js",
91
+ "provider": "./dist/cli/index.js",
92
92
  "capabilities": ["infra.up", "infra.status"]
93
93
  }
94
94
  }
package/dist/index.d.ts CHANGED
@@ -5,6 +5,7 @@ export * from './data';
5
5
  export * from './db';
6
6
  export * from './nutrition';
7
7
  export * from './requirements';
8
+ export * from './runtimeCallbacks';
8
9
  export * from './state';
9
10
  export * from './storage';
10
11
  export * from './types';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC"}
package/dist/index.js CHANGED
@@ -5,6 +5,7 @@ export * from './data';
5
5
  export * from './db';
6
6
  export * from './nutrition';
7
7
  export * from './requirements';
8
+ export * from './runtimeCallbacks';
8
9
  export * from './state';
9
10
  export * from './storage';
10
11
  export * from './types';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './cli';\nexport * from './data';\nexport * from './db';\nexport * from './nutrition';\nexport * from './requirements';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\nexport * from './ui';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,MAAM,CAAC","sourcesContent":["export * from './auth';\nexport * from './bindings';\nexport * from './cli';\nexport * from './data';\nexport * from './db';\nexport * from './nutrition';\nexport * from './requirements';\nexport * from './runtimeCallbacks';\nexport * from './state';\nexport * from './storage';\nexport * from './types';\nexport * from './ui';\n"]}
@@ -0,0 +1,14 @@
1
+ import type { UiNode } from './types';
2
+ export interface RuntimeResolveNodePropsArgs {
3
+ readonly node: UiNode;
4
+ readonly props: Record<string, unknown>;
5
+ }
6
+ export type RuntimeNodePropsResolver = (args: RuntimeResolveNodePropsArgs) => Record<string, unknown>;
7
+ export interface RuntimeCallbackArgs {
8
+ readonly payload: unknown;
9
+ readonly node?: UiNode;
10
+ readonly resolvedPayload?: object;
11
+ }
12
+ export type RuntimeCallback = (args: RuntimeCallbackArgs) => Promise<void> | void;
13
+ export type RuntimeCallbackMap = Readonly<Record<string, RuntimeCallback>>;
14
+ //# sourceMappingURL=runtimeCallbacks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeCallbacks.d.ts","sourceRoot":"","sources":["../src/runtimeCallbacks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,MAAM,wBAAwB,GAAG,CACrC,IAAI,EAAE,2BAA2B,KAC9B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7B,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CACnC;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,mBAAmB,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAClF,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtimeCallbacks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtimeCallbacks.js","sourceRoot":"","sources":["../src/runtimeCallbacks.ts"],"names":[],"mappings":"","sourcesContent":["import type { UiNode } from './types';\n\nexport interface RuntimeResolveNodePropsArgs {\n readonly node: UiNode;\n readonly props: Record<string, unknown>;\n}\n\nexport type RuntimeNodePropsResolver = (\n args: RuntimeResolveNodePropsArgs,\n) => Record<string, unknown>;\n\nexport interface RuntimeCallbackArgs {\n readonly payload: unknown;\n readonly node?: UiNode;\n readonly resolvedPayload?: object;\n}\n\nexport type RuntimeCallback = (args: RuntimeCallbackArgs) => Promise<void> | void;\nexport type RuntimeCallbackMap = Readonly<Record<string, RuntimeCallback>>;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ankhorage/contracts",
3
- "version": "1.19.1",
3
+ "version": "1.19.3",
4
4
  "main": "./dist/index.js",
5
5
  "ankh": {
6
6
  "category": "contracts",
@@ -48,6 +48,10 @@
48
48
  "types": "./dist/nutrition/index.d.ts",
49
49
  "default": "./dist/nutrition/index.js"
50
50
  },
51
+ "./runtime": {
52
+ "types": "./dist/runtimeCallbacks.d.ts",
53
+ "default": "./dist/runtimeCallbacks.js"
54
+ },
51
55
  "./state": {
52
56
  "types": "./dist/state.d.ts",
53
57
  "default": "./dist/state.js"
package/src/cli.test.ts CHANGED
@@ -11,7 +11,7 @@ describe('cli contracts', () => {
11
11
  it('accepts provider package metadata and provider manifests', () => {
12
12
  const packageMetadata = {
13
13
  category: 'infra',
14
- provider: './dist/ankh.provider.js',
14
+ provider: './dist/cli/index.js',
15
15
  capabilities: ['infra.up', 'infra.status'],
16
16
  } as const satisfies AnkhPackageMetadata;
17
17
 
package/src/index.ts CHANGED
@@ -5,6 +5,7 @@ export * from './data';
5
5
  export * from './db';
6
6
  export * from './nutrition';
7
7
  export * from './requirements';
8
+ export * from './runtimeCallbacks';
8
9
  export * from './state';
9
10
  export * from './storage';
10
11
  export * from './types';
@@ -0,0 +1,19 @@
1
+ import type { UiNode } from './types';
2
+
3
+ export interface RuntimeResolveNodePropsArgs {
4
+ readonly node: UiNode;
5
+ readonly props: Record<string, unknown>;
6
+ }
7
+
8
+ export type RuntimeNodePropsResolver = (
9
+ args: RuntimeResolveNodePropsArgs,
10
+ ) => Record<string, unknown>;
11
+
12
+ export interface RuntimeCallbackArgs {
13
+ readonly payload: unknown;
14
+ readonly node?: UiNode;
15
+ readonly resolvedPayload?: object;
16
+ }
17
+
18
+ export type RuntimeCallback = (args: RuntimeCallbackArgs) => Promise<void> | void;
19
+ export type RuntimeCallbackMap = Readonly<Record<string, RuntimeCallback>>;