@antasphere/chassis-contract 1.6.0 → 1.8.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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/docs-source.d.ts +55 -0
- package/dist/schemas/docs-source.d.ts.map +1 -0
- package/dist/schemas/docs-source.js +41 -0
- package/dist/schemas/docs-source.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/schemas/docs-source.ts +47 -0
- package/test/docs-source.test.ts +52 -0
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export * from './schemas/webhooks.js';
|
|
|
19
19
|
export * from './schemas/connections.js';
|
|
20
20
|
export * from './schemas/demo-passes.js';
|
|
21
21
|
export * from './schemas/apps.js';
|
|
22
|
+
export * from './schemas/docs-source.js';
|
|
22
23
|
export * from './fleet.js';
|
|
23
24
|
export * from './tools.js';
|
|
24
25
|
export * from './seams.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAAE,KAAK,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtF,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACpB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,cAAc,EACpB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAA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CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,YAAY,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -26,6 +26,7 @@ export * from './schemas/webhooks.js';
|
|
|
26
26
|
export * from './schemas/connections.js';
|
|
27
27
|
export * from './schemas/demo-passes.js';
|
|
28
28
|
export * from './schemas/apps.js';
|
|
29
|
+
export * from './schemas/docs-source.js';
|
|
29
30
|
export * from './fleet.js';
|
|
30
31
|
export * from './tools.js';
|
|
31
32
|
export * from './seams.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,2EAA2E;AAC3E,EAAE;AACF,2EAA2E;AAC3E,qEAAqE;AACrE,8EAA8E;AAC9E,oFAAoF;AACpF,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,yBAAyB,EAA4B,MAAM,iBAAiB,CAAC;AACtF,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EAKrB,MAAM,uBAAuB,CAAC;AAC/B,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;A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B,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The docs source (PRDCT-4098): what a tool answers on `GET /docs-source`,
|
|
4
|
+
* read from the `docs/` folder its image carries, to a direct network peer
|
|
5
|
+
* presenting `Authorization: Bearer <DOCS_SOURCE_TOKEN>` (off when the tool
|
|
6
|
+
* has no token; a request through a proxy answers 404). A
|
|
7
|
+
* reader (the Handbook) validates the answer with this schema, the way
|
|
8
|
+
* `toolOriginsSchema` guards the fleet read.
|
|
9
|
+
*
|
|
10
|
+
* - `product`, `description`: `docs/nav.yml`'s own keys.
|
|
11
|
+
* - `version`: the instance's reported version (`APP_VERSION`); `slug`: the
|
|
12
|
+
* tool identity's slug. Together they say what was read.
|
|
13
|
+
* - `groups`: `nav.yml`'s groups in order, each page with its `path` (as
|
|
14
|
+
* `nav.yml` lists it, no `.md`), its `title` (the page's leading H1) and its
|
|
15
|
+
* `description` (the intro paragraph under the H1, inline markdown
|
|
16
|
+
* flattened to text: the public docs site's page contract; empty when the
|
|
17
|
+
* page has none). A page `nav.yml` lists but the folder lacks is left out.
|
|
18
|
+
*
|
|
19
|
+
* A page's markdown is `GET /docs-source/pages/<path>` for a `path` listed
|
|
20
|
+
* here, `text/markdown; charset=utf-8`; every other path answers 404.
|
|
21
|
+
*/
|
|
22
|
+
export declare const docsSourcePageSchema: z.ZodObject<{
|
|
23
|
+
path: z.ZodString;
|
|
24
|
+
title: z.ZodString;
|
|
25
|
+
description: z.ZodString;
|
|
26
|
+
}, z.core.$strip>;
|
|
27
|
+
export type DocsSourcePage = z.infer<typeof docsSourcePageSchema>;
|
|
28
|
+
export declare const docsSourceGroupSchema: z.ZodObject<{
|
|
29
|
+
title: z.ZodString;
|
|
30
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
31
|
+
path: z.ZodString;
|
|
32
|
+
title: z.ZodString;
|
|
33
|
+
description: z.ZodString;
|
|
34
|
+
}, z.core.$strip>>;
|
|
35
|
+
}, z.core.$strip>;
|
|
36
|
+
export type DocsSourceGroup = z.infer<typeof docsSourceGroupSchema>;
|
|
37
|
+
export declare const docsSourceManifestSchema: z.ZodObject<{
|
|
38
|
+
product: z.ZodString;
|
|
39
|
+
description: z.ZodString;
|
|
40
|
+
version: z.ZodString;
|
|
41
|
+
slug: z.ZodString;
|
|
42
|
+
groups: z.ZodArray<z.ZodObject<{
|
|
43
|
+
title: z.ZodString;
|
|
44
|
+
pages: z.ZodArray<z.ZodObject<{
|
|
45
|
+
path: z.ZodString;
|
|
46
|
+
title: z.ZodString;
|
|
47
|
+
description: z.ZodString;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export type DocsSourceManifest = z.infer<typeof docsSourceManifestSchema>;
|
|
52
|
+
/** The route's paths, for a reader that builds the URLs. */
|
|
53
|
+
export declare const DOCS_SOURCE_PATH = "/docs-source";
|
|
54
|
+
export declare const DOCS_SOURCE_PAGES_PATH = "/docs-source/pages";
|
|
55
|
+
//# sourceMappingURL=docs-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-source.d.ts","sourceRoot":"","sources":["../../src/schemas/docs-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,oBAAoB;;;;iBAI/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,qBAAqB;;;;;;;iBAGhC,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;iBAMnC,CAAC;AACH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE1E,4DAA4D;AAC5D,eAAO,MAAM,gBAAgB,iBAAiB,CAAC;AAC/C,eAAO,MAAM,sBAAsB,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The docs source (PRDCT-4098): what a tool answers on `GET /docs-source`,
|
|
4
|
+
* read from the `docs/` folder its image carries, to a direct network peer
|
|
5
|
+
* presenting `Authorization: Bearer <DOCS_SOURCE_TOKEN>` (off when the tool
|
|
6
|
+
* has no token; a request through a proxy answers 404). A
|
|
7
|
+
* reader (the Handbook) validates the answer with this schema, the way
|
|
8
|
+
* `toolOriginsSchema` guards the fleet read.
|
|
9
|
+
*
|
|
10
|
+
* - `product`, `description`: `docs/nav.yml`'s own keys.
|
|
11
|
+
* - `version`: the instance's reported version (`APP_VERSION`); `slug`: the
|
|
12
|
+
* tool identity's slug. Together they say what was read.
|
|
13
|
+
* - `groups`: `nav.yml`'s groups in order, each page with its `path` (as
|
|
14
|
+
* `nav.yml` lists it, no `.md`), its `title` (the page's leading H1) and its
|
|
15
|
+
* `description` (the intro paragraph under the H1, inline markdown
|
|
16
|
+
* flattened to text: the public docs site's page contract; empty when the
|
|
17
|
+
* page has none). A page `nav.yml` lists but the folder lacks is left out.
|
|
18
|
+
*
|
|
19
|
+
* A page's markdown is `GET /docs-source/pages/<path>` for a `path` listed
|
|
20
|
+
* here, `text/markdown; charset=utf-8`; every other path answers 404.
|
|
21
|
+
*/
|
|
22
|
+
export const docsSourcePageSchema = z.object({
|
|
23
|
+
path: z.string().min(1),
|
|
24
|
+
title: z.string(),
|
|
25
|
+
description: z.string()
|
|
26
|
+
});
|
|
27
|
+
export const docsSourceGroupSchema = z.object({
|
|
28
|
+
title: z.string(),
|
|
29
|
+
pages: z.array(docsSourcePageSchema)
|
|
30
|
+
});
|
|
31
|
+
export const docsSourceManifestSchema = z.object({
|
|
32
|
+
product: z.string(),
|
|
33
|
+
description: z.string(),
|
|
34
|
+
version: z.string(),
|
|
35
|
+
slug: z.string(),
|
|
36
|
+
groups: z.array(docsSourceGroupSchema)
|
|
37
|
+
});
|
|
38
|
+
/** The route's paths, for a reader that builds the URLs. */
|
|
39
|
+
export const DOCS_SOURCE_PATH = '/docs-source';
|
|
40
|
+
export const DOCS_SOURCE_PAGES_PATH = '/docs-source/pages';
|
|
41
|
+
//# sourceMappingURL=docs-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docs-source.js","sourceRoot":"","sources":["../../src/schemas/docs-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACvB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;CACxB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,oBAAoB,CAAC;CACrC,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC;CACvC,CAAC,CAAC;AAGH,4DAA4D;AAC5D,MAAM,CAAC,MAAM,gBAAgB,GAAG,cAAc,CAAC;AAC/C,MAAM,CAAC,MAAM,sBAAsB,GAAG,oBAAoB,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export * from './schemas/webhooks.js';
|
|
|
35
35
|
export * from './schemas/connections.js';
|
|
36
36
|
export * from './schemas/demo-passes.js';
|
|
37
37
|
export * from './schemas/apps.js';
|
|
38
|
+
export * from './schemas/docs-source.js';
|
|
38
39
|
export * from './fleet.js';
|
|
39
40
|
export * from './tools.js';
|
|
40
41
|
export * from './seams.js';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* The docs source (PRDCT-4098): what a tool answers on `GET /docs-source`,
|
|
5
|
+
* read from the `docs/` folder its image carries, to a direct network peer
|
|
6
|
+
* presenting `Authorization: Bearer <DOCS_SOURCE_TOKEN>` (off when the tool
|
|
7
|
+
* has no token; a request through a proxy answers 404). A
|
|
8
|
+
* reader (the Handbook) validates the answer with this schema, the way
|
|
9
|
+
* `toolOriginsSchema` guards the fleet read.
|
|
10
|
+
*
|
|
11
|
+
* - `product`, `description`: `docs/nav.yml`'s own keys.
|
|
12
|
+
* - `version`: the instance's reported version (`APP_VERSION`); `slug`: the
|
|
13
|
+
* tool identity's slug. Together they say what was read.
|
|
14
|
+
* - `groups`: `nav.yml`'s groups in order, each page with its `path` (as
|
|
15
|
+
* `nav.yml` lists it, no `.md`), its `title` (the page's leading H1) and its
|
|
16
|
+
* `description` (the intro paragraph under the H1, inline markdown
|
|
17
|
+
* flattened to text: the public docs site's page contract; empty when the
|
|
18
|
+
* page has none). A page `nav.yml` lists but the folder lacks is left out.
|
|
19
|
+
*
|
|
20
|
+
* A page's markdown is `GET /docs-source/pages/<path>` for a `path` listed
|
|
21
|
+
* here, `text/markdown; charset=utf-8`; every other path answers 404.
|
|
22
|
+
*/
|
|
23
|
+
export const docsSourcePageSchema = z.object({
|
|
24
|
+
path: z.string().min(1),
|
|
25
|
+
title: z.string(),
|
|
26
|
+
description: z.string()
|
|
27
|
+
});
|
|
28
|
+
export type DocsSourcePage = z.infer<typeof docsSourcePageSchema>;
|
|
29
|
+
|
|
30
|
+
export const docsSourceGroupSchema = z.object({
|
|
31
|
+
title: z.string(),
|
|
32
|
+
pages: z.array(docsSourcePageSchema)
|
|
33
|
+
});
|
|
34
|
+
export type DocsSourceGroup = z.infer<typeof docsSourceGroupSchema>;
|
|
35
|
+
|
|
36
|
+
export const docsSourceManifestSchema = z.object({
|
|
37
|
+
product: z.string(),
|
|
38
|
+
description: z.string(),
|
|
39
|
+
version: z.string(),
|
|
40
|
+
slug: z.string(),
|
|
41
|
+
groups: z.array(docsSourceGroupSchema)
|
|
42
|
+
});
|
|
43
|
+
export type DocsSourceManifest = z.infer<typeof docsSourceManifestSchema>;
|
|
44
|
+
|
|
45
|
+
/** The route's paths, for a reader that builds the URLs. */
|
|
46
|
+
export const DOCS_SOURCE_PATH = '/docs-source';
|
|
47
|
+
export const DOCS_SOURCE_PAGES_PATH = '/docs-source/pages';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { DOCS_SOURCE_PAGES_PATH, DOCS_SOURCE_PATH, docsSourceManifestSchema } from '../src/index.js';
|
|
3
|
+
|
|
4
|
+
/** The docs source manifest (PRDCT-4098): the shape a reader (the Handbook) validates. */
|
|
5
|
+
describe('docsSourceManifestSchema', () => {
|
|
6
|
+
const manifest = {
|
|
7
|
+
product: 'Your Tool',
|
|
8
|
+
description: 'A tool.',
|
|
9
|
+
version: '1.8.0',
|
|
10
|
+
slug: 'yourtool',
|
|
11
|
+
groups: [
|
|
12
|
+
{ title: 'Getting started', pages: [{ path: 'index', title: 'Your Tool', description: 'Intro.' }] },
|
|
13
|
+
{ title: 'Empty', pages: [] }
|
|
14
|
+
]
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
it('accepts the route answer', () => {
|
|
18
|
+
expect(docsSourceManifestSchema.parse(manifest)).toEqual(manifest);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
it('accepts an empty description and keeps an additive field out', () => {
|
|
22
|
+
const parsed = docsSourceManifestSchema.parse({ ...manifest, description: '', extra: 1 });
|
|
23
|
+
expect(parsed.description).toBe('');
|
|
24
|
+
expect('extra' in parsed).toBe(false);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it.each([
|
|
28
|
+
['no version', { ...manifest, version: undefined }],
|
|
29
|
+
['no slug', { ...manifest, slug: undefined }],
|
|
30
|
+
['no groups', { ...manifest, groups: undefined }],
|
|
31
|
+
[
|
|
32
|
+
'a page without a path',
|
|
33
|
+
{ ...manifest, groups: [{ title: 'G', pages: [{ title: 'T', description: '' }] }] }
|
|
34
|
+
],
|
|
35
|
+
[
|
|
36
|
+
'an empty path',
|
|
37
|
+
{ ...manifest, groups: [{ title: 'G', pages: [{ path: '', title: 'T', description: '' }] }] }
|
|
38
|
+
],
|
|
39
|
+
['a group without pages', { ...manifest, groups: [{ title: 'G' }] }],
|
|
40
|
+
[
|
|
41
|
+
'a page without a title',
|
|
42
|
+
{ ...manifest, groups: [{ title: 'G', pages: [{ path: 'p', description: '' }] }] }
|
|
43
|
+
]
|
|
44
|
+
])('refuses %s', (_what, value) => {
|
|
45
|
+
expect(docsSourceManifestSchema.safeParse(value).success).toBe(false);
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it('names the two paths', () => {
|
|
49
|
+
expect(DOCS_SOURCE_PATH).toBe('/docs-source');
|
|
50
|
+
expect(DOCS_SOURCE_PAGES_PATH).toBe('/docs-source/pages');
|
|
51
|
+
});
|
|
52
|
+
});
|