@volter/twin-standard 1.0.89 → 1.0.91
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.
|
@@ -13,7 +13,7 @@ import { gzipSync } from 'node:zlib';
|
|
|
13
13
|
import { parse, visit } from 'graphql';
|
|
14
14
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
15
15
|
import { join } from 'node:path';
|
|
16
|
-
import { databaseSession, getActiveWorldStore, MemoryBlobStore, MemoryWorldStore, setActiveBlobStore, setActiveWorldStore, setDeliveryObserver, setInProcessTwins } from '@volter/world-core/runtime';
|
|
16
|
+
import { databaseSession, getActivePackAssets, getActiveWorldStore, LocalPackAssets, MemoryBlobStore, MemoryWorldStore, setActiveBlobStore, setActivePackAssets, setActiveWorldStore, setDeliveryObserver, setInProcessTwins } from '@volter/world-core/runtime';
|
|
17
17
|
import { createHostTable } from '@volter/world-core/host-routing';
|
|
18
18
|
import packFactsDocument from '@volter/world-core/generated/pack-facts.json' with { type: 'json' };
|
|
19
19
|
import { isMysql, isResp, at, captureAt, echoFailures, expandFills, expectFailures, fill, fillJson, formBody, isGit, isLine, isSql, isSocket, isWait, jwtAuthorization, oauth1Authorization, presignedPath, sigv4Headers, waitMs } from "./journey-kit.js";
|
|
@@ -84,6 +84,8 @@ function directoryFor(vendor) {
|
|
|
84
84
|
export function inMemoryWorld(label) {
|
|
85
85
|
const previousStore = setActiveWorldStore(new MemoryWorldStore());
|
|
86
86
|
const previousBlobs = setActiveBlobStore(new MemoryBlobStore());
|
|
87
|
+
const previousAssets = getActivePackAssets();
|
|
88
|
+
setActivePackAssets(new LocalPackAssets((vendor) => walkPackDirectory(packsDir(), vendor, dependenciesDir())));
|
|
87
89
|
const previousClock = process.env.TWIN_WORLD_CLOCK_FILE;
|
|
88
90
|
// sealed: nothing a walk does reaches a host outside the World (a webhook to a customer's server is refused, not sent)
|
|
89
91
|
const previousEgress = process.env.VOLTER_TWIN_STRICT_EGRESS;
|
|
@@ -97,6 +99,7 @@ export function inMemoryWorld(label) {
|
|
|
97
99
|
restore: () => {
|
|
98
100
|
setActiveWorldStore(previousStore);
|
|
99
101
|
setActiveBlobStore(previousBlobs);
|
|
102
|
+
setActivePackAssets(previousAssets);
|
|
100
103
|
if (previousClock === undefined)
|
|
101
104
|
delete process.env.TWIN_WORLD_CLOCK_FILE;
|
|
102
105
|
else
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/twin-standard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.91",
|
|
4
4
|
"description": "The Protocol 3 standard for Volter twin packs: the criteria a pack is graded by, the grader, the gate a pack repository and the twin catalog run on every change and submission, and the spec derivation the grade checks against. Pin a version: every place a pack is judged judges by that standard.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"twin",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"yaml": "2.9.0"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@volter/world-core": "3.0.
|
|
78
|
+
"@volter/world-core": "3.0.99",
|
|
79
79
|
"@volter/world-runtime": "*",
|
|
80
80
|
"playwright": "^1.63.0"
|
|
81
81
|
},
|
|
@@ -14,7 +14,7 @@ import { gzipSync } from 'node:zlib';
|
|
|
14
14
|
import { parse, visit } from 'graphql';
|
|
15
15
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
16
16
|
import { join } from 'node:path';
|
|
17
|
-
import { databaseSession, type DatabaseSession, getActiveWorldStore, MemoryBlobStore, MemoryWorldStore, setActiveBlobStore, setActiveWorldStore, setDeliveryObserver, setInProcessTwins, type InProcessTwin, type TwinStream, type TwinStreamConnection } from '@volter/world-core/runtime';
|
|
17
|
+
import { databaseSession, type DatabaseSession, getActivePackAssets, getActiveWorldStore, LocalPackAssets, MemoryBlobStore, MemoryWorldStore, setActiveBlobStore, setActivePackAssets, setActiveWorldStore, setDeliveryObserver, setInProcessTwins, type InProcessTwin, type TwinStream, type TwinStreamConnection } from '@volter/world-core/runtime';
|
|
18
18
|
import { createHostTable, type HostFacts } from '@volter/world-core/host-routing';
|
|
19
19
|
import packFactsDocument from '@volter/world-core/generated/pack-facts.json' with { type: 'json' };
|
|
20
20
|
import { type Captured, type GitStep, type Journey, type JourneyStep, type LineStep, type SocketStep, type SqlStep, type RespStep, type MysqlStep, isMysql, isResp, at, captureAt, echoFailures, expandFills, expectFailures, fill, fillJson, formBody, isGit, isLine, isSql, isSocket, isWait, jwtAuthorization, oauth1Authorization, presignedPath, sigv4Headers, waitMs } from './journey-kit.ts';
|
|
@@ -83,6 +83,8 @@ function directoryFor(vendor: string): string {
|
|
|
83
83
|
export function inMemoryWorld(label: string): { root: () => string; restore: () => void } {
|
|
84
84
|
const previousStore = setActiveWorldStore(new MemoryWorldStore());
|
|
85
85
|
const previousBlobs = setActiveBlobStore(new MemoryBlobStore());
|
|
86
|
+
const previousAssets = getActivePackAssets();
|
|
87
|
+
setActivePackAssets(new LocalPackAssets((vendor) => walkPackDirectory(packsDir(), vendor, dependenciesDir())));
|
|
86
88
|
const previousClock = process.env.TWIN_WORLD_CLOCK_FILE;
|
|
87
89
|
// sealed: nothing a walk does reaches a host outside the World (a webhook to a customer's server is refused, not sent)
|
|
88
90
|
const previousEgress = process.env.VOLTER_TWIN_STRICT_EGRESS;
|
|
@@ -96,6 +98,7 @@ export function inMemoryWorld(label: string): { root: () => string; restore: ()
|
|
|
96
98
|
restore: () => {
|
|
97
99
|
setActiveWorldStore(previousStore);
|
|
98
100
|
setActiveBlobStore(previousBlobs);
|
|
101
|
+
setActivePackAssets(previousAssets);
|
|
99
102
|
if (previousClock === undefined) delete process.env.TWIN_WORLD_CLOCK_FILE; else process.env.TWIN_WORLD_CLOCK_FILE = previousClock;
|
|
100
103
|
if (previousEgress === undefined) delete process.env.VOLTER_TWIN_STRICT_EGRESS; else process.env.VOLTER_TWIN_STRICT_EGRESS = previousEgress;
|
|
101
104
|
},
|