@volter/twin-standard 1.0.157 → 1.0.159
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/README.md +3 -2
- package/client-sdks/import.mjs +2 -0
- package/client-sdks/package.json +4 -0
- package/client-sdks/pnpm-lock.yaml +609 -0
- package/dist/client-sdks/import.mjs +2 -0
- package/dist/client-sdks/package.json +4 -0
- package/dist/client-sdks/pnpm-lock.yaml +609 -0
- package/dist/src/assessment.d.ts +13 -3
- package/dist/src/assessment.js +10 -6
- package/dist/src/browser-assessment.js +16 -13
- package/dist/src/clients/harness.d.ts +25 -4
- package/dist/src/clients/harness.js +184 -22
- package/dist/src/clients/jira.js +11 -2
- package/dist/src/clients/run.js +19 -14
- package/dist/src/clients/tinybird.js +15 -6
- package/dist/src/clients/vercel.d.ts +2 -0
- package/dist/src/clients/vercel.js +73 -0
- package/dist/src/conformance.d.ts +2 -0
- package/dist/src/conformance.js +392 -184
- package/dist/src/consumer.d.ts +22 -1
- package/dist/src/consumer.js +91 -26
- package/dist/src/credential-issuer-import.d.ts +3 -0
- package/dist/src/credential-issuer-import.js +42 -0
- package/dist/src/derive.js +3 -0
- package/dist/src/gate.js +4 -0
- package/dist/src/lanes.d.ts +2 -0
- package/dist/src/lanes.js +7 -0
- package/dist/src/protocol-3.js +8 -3
- package/dist/src/spec-documents.d.ts +4 -0
- package/dist/src/spec-documents.js +110 -3
- package/dist/src/tools/life-coverage-walk.js +38 -26
- package/dist/src/tools/score-pack.js +6 -5
- package/dist/src/tools/vendor-examples.js +91 -80
- package/dist/src/walk/behavior-journey.d.ts +22 -14
- package/dist/src/walk/behavior-journey.js +182 -133
- package/dist/src/walk/journey-kit.d.ts +3 -2
- package/dist/src/walk/journey-kit.js +6 -2
- package/dist/src/walk/replay.d.ts +23 -0
- package/dist/src/walk/replay.js +118 -0
- package/dist/src/walk/serve-pack.d.ts +2 -2
- package/dist/src/walk/serve-pack.js +38 -2
- package/dist/src/walk/shape.d.ts +25 -4
- package/dist/src/walk/shape.js +166 -56
- package/dist/src/walk/vendor-fetch.d.ts +7 -2
- package/dist/src/walk/vendor-fetch.js +13 -2
- package/dist/src/walk/walk-database.d.ts +9 -1
- package/dist/src/walk/walk-database.js +35 -13
- package/dist/src/walk/xml-view.d.ts +3 -2
- package/dist/src/walk/xml-view.js +5 -4
- package/package.json +4 -3
- package/src/assessment.ts +12 -8
- package/src/browser-assessment.ts +12 -5
- package/src/clients/harness.ts +142 -19
- package/src/clients/jira.ts +4 -2
- package/src/clients/run.ts +17 -15
- package/src/clients/tinybird.ts +8 -6
- package/src/clients/vercel.ts +67 -0
- package/src/conformance.ts +313 -128
- package/src/consumer.ts +83 -21
- package/src/credential-issuer-import.ts +38 -0
- package/src/derive.ts +3 -1
- package/src/gate.ts +3 -0
- package/src/lanes.ts +7 -0
- package/src/protocol-3.ts +7 -3
- package/src/spec-documents.ts +92 -3
- package/src/tools/life-coverage-walk.ts +32 -22
- package/src/tools/score-pack.ts +7 -6
- package/src/tools/vendor-examples.ts +88 -75
- package/src/walk/behavior-journey.ts +145 -109
- package/src/walk/journey-kit.ts +7 -5
- package/src/walk/replay.ts +103 -0
- package/src/walk/serve-pack.ts +25 -5
- package/src/walk/shape.ts +156 -54
- package/src/walk/vendor-fetch.ts +16 -4
- package/src/walk/walk-database.ts +41 -15
- package/src/walk/xml-view.ts +5 -4
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// Vercel's unchanged REST SDK and Dub's Edge Config client, using the enclosing World's routing.
|
|
2
|
+
import { standardPackageFile } from '../package-file.ts';
|
|
3
|
+
import type { ClientCase } from './harness.ts';
|
|
4
|
+
|
|
5
|
+
const { importSdk } = await import(new URL('import.mjs', standardPackageFile('client-sdks/')).href);
|
|
6
|
+
const { Vercel } = await importSdk('@vercel/sdk');
|
|
7
|
+
const { VercelError } = await importSdk('@vercel/sdk/models/vercelerror.js');
|
|
8
|
+
const { createClient } = await importSdk('@vercel/edge-config');
|
|
9
|
+
const PROJECTS = 'https://unpkg.com/@vercel/sdk@1.28.38/esm/sdk/projects.js';
|
|
10
|
+
const EDGE = 'https://unpkg.com/@vercel/edge-config@0.4.1/dist/index.d.ts';
|
|
11
|
+
|
|
12
|
+
export const cases: ClientCase[] = [
|
|
13
|
+
{
|
|
14
|
+
id: 'project-domain-add-and-read',
|
|
15
|
+
asks: 'the issued project token adds a domain, and an independent SDK read preserves its name, project and verification state',
|
|
16
|
+
source: `${PROJECTS} "Add a domain to the project by passing its domain name"; ${PROJECTS} "Get project domain by project id/name and domain name."`,
|
|
17
|
+
async run(c) {
|
|
18
|
+
const vercel = new Vercel({ bearerToken: c.env.VERCEL_API_KEY });
|
|
19
|
+
const project = c.env.VERCEL_PROJECT_ID;
|
|
20
|
+
const name = 'sdk-client.example.test';
|
|
21
|
+
const added = await vercel.projects.addProjectDomain({ idOrName: project, requestBody: { name } });
|
|
22
|
+
const got = await vercel.projects.getProjectDomain({ idOrName: project, domain: name });
|
|
23
|
+
const wanted = { name, apexName: 'example.test', projectId: project, verified: true };
|
|
24
|
+
return Object.entries(wanted).flatMap(([field, value]) =>
|
|
25
|
+
added[field] === value && got[field] === value ? [] : [`project domain ${field} did not survive SDK create/read`]);
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
id: 'invalid-project-token',
|
|
30
|
+
asks: 'an invalid token cannot read the project domain and the SDK preserves the HTTP refusal status',
|
|
31
|
+
source: `${PROJECTS} "Get project domain by project id/name and domain name."; https://unpkg.com/@vercel/sdk@1.28.38/esm/models/vercelerror.js "HTTP status code"`,
|
|
32
|
+
async run(c) {
|
|
33
|
+
const vercel = new Vercel({ bearerToken: 'throwaway-invalid-token' });
|
|
34
|
+
try {
|
|
35
|
+
await vercel.projects.getProjectDomain({ idOrName: c.env.VERCEL_PROJECT_ID, domain: 'sdk-client.example.test' });
|
|
36
|
+
return ['an invalid token read the project domain'];
|
|
37
|
+
} catch (error) {
|
|
38
|
+
return error instanceof Error && error instanceof VercelError && 'statusCode' in error && error.statusCode === 403
|
|
39
|
+
? [] : [`invalid token refusal differs: ${String(error)}`];
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'edge-config-get-and-selected-get-all',
|
|
45
|
+
asks: 'the issued Edge Config connection string reads a stored value and only the selected keys through the unchanged SDK',
|
|
46
|
+
source: `${EDGE} "Read a single value."; ${EDGE} "Returns all entries when called with no arguments or only entries matching the given keys otherwise."`,
|
|
47
|
+
async run(c) {
|
|
48
|
+
const domains = ['phish-bank.example.test'];
|
|
49
|
+
const terms = ['gift-card'];
|
|
50
|
+
const written = await c.fetch(`https://api.vercel.com/v1/edge-config/${c.env.EDGE_CONFIG_ID}/items`, {
|
|
51
|
+
method: 'PATCH', headers: { authorization: `Bearer ${c.env.VERCEL_API_KEY}`, 'content-type': 'application/json' },
|
|
52
|
+
body: JSON.stringify({ items: [
|
|
53
|
+
{ operation: 'upsert', key: 'sdk_domains', value: domains },
|
|
54
|
+
{ operation: 'upsert', key: 'sdk_terms', value: terms },
|
|
55
|
+
{ operation: 'upsert', key: 'sdk_unselected', value: true },
|
|
56
|
+
] }),
|
|
57
|
+
});
|
|
58
|
+
if (!written.ok || (await written.json() as { status?: string }).status !== 'ok') return ['the Edge Config items were not written through the vendor API'];
|
|
59
|
+
const edge = createClient(c.env.EDGE_CONFIG);
|
|
60
|
+
const value = await edge.get('sdk_domains');
|
|
61
|
+
const selected = await edge.getAll(['sdk_domains', 'sdk_terms']);
|
|
62
|
+
return JSON.stringify(value) === JSON.stringify(domains) && JSON.stringify(selected.sdk_domains) === JSON.stringify(domains)
|
|
63
|
+
&& JSON.stringify(selected.sdk_terms) === JSON.stringify(terms) && Object.keys(selected).length === 2
|
|
64
|
+
? [] : ['Edge Config get/getAll did not preserve the stored values and selected keys'];
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|