@ankhorage/contracts 22.1.0 → 22.1.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 +6 -0
- package/README.md +2 -1
- package/dist/structure/index.d.ts +1 -0
- package/dist/structure/index.d.ts.map +1 -1
- package/dist/structure/index.js.map +1 -1
- package/package.json +2 -2
- package/src/structure/index.ts +1 -0
- package/src/structure.test.ts +17 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
# @ankhorage/contracts
|
|
5
5
|
|
|
6
|
-
         
|
|
7
7
|
|
|
8
8
|
Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
9
9
|
|
|
@@ -24,4 +24,5 @@ Serializable app, action, theme, auth, and secret-store contracts for Ankhorage.
|
|
|
24
24
|
- [isMediaAssetReference sequence](././paradox/diagrams/sequences/is-media-asset-reference.mmd)
|
|
25
25
|
- [isSerializableSet sequence](././paradox/diagrams/sequences/is-serializable-set.mmd)
|
|
26
26
|
- [isSerializableValue sequence](././paradox/diagrams/sequences/is-serializable-value.mmd)
|
|
27
|
+
- [isStructureDescriptorDocument sequence](././paradox/diagrams/sequences/is-structure-descriptor-document.mmd)
|
|
27
28
|
- [parseInfraManifest sequence](././paradox/diagrams/sequences/parse-infra-manifest.mmd)
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';
|
|
1
2
|
export { isStructureDescriptor } from './isStructureDescriptor';
|
|
2
3
|
export { isStructureDescriptorDocument } from './isStructureDescriptorDocument';
|
|
3
4
|
export type { StructureDescriptor, StructureDescriptorDefinition, StructureDescriptorDocument, StructureDescriptorId, StructureDescriptorRegistry, StructureEntityRegistryDescriptor, StructureEnumDescriptor, StructureLiteralValue, StructureObjectDescriptor, StructureObjectField, StructureOrderedListDescriptor, StructureReferenceDescriptor, StructureScalarDescriptor, StructureScalarType, StructureSetDescriptor, StructureUnionDescriptor, StructureValueMapDescriptor, } from './types';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAChF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,YAAY,EACV,mBAAmB,EACnB,6BAA6B,EAC7B,2BAA2B,EAC3B,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,uBAAuB,EACvB,qBAAqB,EACrB,yBAAyB,EACzB,oBAAoB,EACpB,8BAA8B,EAC9B,4BAA4B,EAC5B,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,2BAA2B,GAC5B,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structure/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC","sourcesContent":["export type { EntityRegistry, SerializableSet, ValueMap } from '../collections';\nexport { isStructureDescriptor } from './isStructureDescriptor';\nexport { isStructureDescriptorDocument } from './isStructureDescriptorDocument';\nexport type {\n StructureDescriptor,\n StructureDescriptorDefinition,\n StructureDescriptorDocument,\n StructureDescriptorId,\n StructureDescriptorRegistry,\n StructureEntityRegistryDescriptor,\n StructureEnumDescriptor,\n StructureLiteralValue,\n StructureObjectDescriptor,\n StructureObjectField,\n StructureOrderedListDescriptor,\n StructureReferenceDescriptor,\n StructureScalarDescriptor,\n StructureScalarType,\n StructureSetDescriptor,\n StructureUnionDescriptor,\n StructureValueMapDescriptor,\n} from './types';\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ankhorage/contracts",
|
|
3
|
-
"version": "22.1.
|
|
3
|
+
"version": "22.1.1",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"ankh": {
|
|
6
6
|
"category": "contracts",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"@ankhorage/utility": "^1.4.0"
|
|
15
15
|
},
|
|
16
16
|
"devDependencies": {
|
|
17
|
-
"@ankhorage/devtools": "^1.
|
|
17
|
+
"@ankhorage/devtools": "^1.17.2",
|
|
18
18
|
"@ankhorage/paradox": "^0.1.26",
|
|
19
19
|
"@types/bun": "^1.4.1",
|
|
20
20
|
"@types/node": "^25.2.3",
|
package/src/structure/index.ts
CHANGED
package/src/structure.test.ts
CHANGED
|
@@ -4,11 +4,28 @@ import { join } from 'node:path';
|
|
|
4
4
|
import { expect, test } from 'bun:test';
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
|
+
type EntityRegistry,
|
|
7
8
|
isStructureDescriptor,
|
|
8
9
|
isStructureDescriptorDocument,
|
|
10
|
+
type SerializableSet,
|
|
9
11
|
type StructureDescriptorDocument,
|
|
12
|
+
type ValueMap,
|
|
10
13
|
} from './structure';
|
|
11
14
|
|
|
15
|
+
test('exports canonical structural collection markers from the structure boundary', () => {
|
|
16
|
+
const registry = { theme: { id: 'theme' } } satisfies EntityRegistry<
|
|
17
|
+
string,
|
|
18
|
+
{ readonly id: string },
|
|
19
|
+
'id'
|
|
20
|
+
>;
|
|
21
|
+
const values = { spacing: 8 } satisfies ValueMap<string, number>;
|
|
22
|
+
const membership = { camera: true } satisfies SerializableSet<'camera' | 'microphone'>;
|
|
23
|
+
|
|
24
|
+
expect(registry.theme.id).toBe('theme');
|
|
25
|
+
expect(values.spacing).toBe(8);
|
|
26
|
+
expect(membership.camera).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
12
29
|
test('accepts scalar, enum and object descriptors', () => {
|
|
13
30
|
expect(isStructureDescriptor({ kind: 'scalar', type: 'string' })).toBe(true);
|
|
14
31
|
expect(isStructureDescriptor({ kind: 'enum', values: ['light', 'dark'] })).toBe(true);
|