@playdrop/playdrop-cli 0.7.4 → 0.7.13
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/config/client-meta.json +4 -51
- package/dist/apps/build.js +6 -6
- package/dist/apps/upload.js +1 -3
- package/dist/captureRuntime.js +4 -1
- package/dist/catalogue.js +7 -6
- package/dist/commands/capture.js +5 -3
- package/dist/commands/create.js +26 -18
- package/dist/commands/devBrowser.js +5 -3
- package/dist/commands/devServer.js +80 -1
- package/node_modules/@playdrop/ai-client/package.json +1 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +18 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts +12 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/admin.js +106 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +7 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/auth.js +63 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +18 -1
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +42 -0
- package/node_modules/@playdrop/api-client/package.json +1 -1
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js +1 -0
- package/node_modules/@playdrop/boxel-core/dist/src/transforms/textured-boxes/layer-mode.js.map +1 -1
- package/node_modules/@playdrop/boxel-core/package.json +1 -1
- package/node_modules/@playdrop/boxel-three/package.json +1 -1
- package/node_modules/@playdrop/config/client-meta.json +4 -51
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts +1 -0
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +31 -0
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +4 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/server/fastify.js +3 -0
- package/node_modules/@playdrop/config/dist/test/deployment.test.js +24 -0
- package/node_modules/@playdrop/config/dist/test/fastify.test.d.ts +2 -0
- package/node_modules/@playdrop/config/dist/test/fastify.test.d.ts.map +1 -0
- package/node_modules/@playdrop/config/dist/test/fastify.test.js +12 -0
- package/node_modules/@playdrop/config/dist/test/validateClientEnvironment.test.js +22 -23
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/config/package.json +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +95 -1
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +11 -0
- package/node_modules/@playdrop/vox-three/package.json +1 -1
- package/package.json +2 -2
|
@@ -1,56 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.7.
|
|
3
|
-
"build":
|
|
4
|
-
"platforms": {
|
|
5
|
-
"ios": {
|
|
6
|
-
"minimumVersion": "16.0"
|
|
7
|
-
},
|
|
8
|
-
"macos": {
|
|
9
|
-
"minimumVersion": "10.15"
|
|
10
|
-
},
|
|
11
|
-
"linux": {
|
|
12
|
-
"minimumVersion": "any"
|
|
13
|
-
},
|
|
14
|
-
"windows": {
|
|
15
|
-
"minimumVersion": "any"
|
|
16
|
-
},
|
|
17
|
-
"android": {
|
|
18
|
-
"minimumVersion": "any"
|
|
19
|
-
},
|
|
20
|
-
"browser": {
|
|
21
|
-
"minimumVersion": "any"
|
|
22
|
-
},
|
|
23
|
-
"unknown": {
|
|
24
|
-
"minimumVersion": "any"
|
|
25
|
-
}
|
|
26
|
-
},
|
|
2
|
+
"version": "0.7.13",
|
|
3
|
+
"build": 1,
|
|
27
4
|
"clients": {
|
|
28
|
-
"
|
|
29
|
-
"minimumVersion": "0.7.
|
|
30
|
-
"minimumBuild": 2
|
|
31
|
-
},
|
|
32
|
-
"admin": {
|
|
33
|
-
"minimumVersion": "0.7.3",
|
|
34
|
-
"minimumBuild": 2
|
|
35
|
-
},
|
|
36
|
-
"apple": {
|
|
37
|
-
"minimumVersion": "0.3.10",
|
|
38
|
-
"minimumBuild": 1
|
|
39
|
-
},
|
|
40
|
-
"apple-playdrop": {
|
|
41
|
-
"minimumVersion": "0.3.10",
|
|
42
|
-
"minimumBuild": 1
|
|
43
|
-
},
|
|
44
|
-
"apple-games": {
|
|
45
|
-
"minimumVersion": "0.3.10",
|
|
46
|
-
"minimumBuild": 1
|
|
47
|
-
},
|
|
48
|
-
"android-games": {
|
|
49
|
-
"minimumVersion": "0.7.3",
|
|
50
|
-
"minimumBuild": 2
|
|
51
|
-
},
|
|
52
|
-
"cli": {
|
|
53
|
-
"minimumVersion": "0.7.3"
|
|
5
|
+
"all": {
|
|
6
|
+
"minimumVersion": "0.7.4"
|
|
54
7
|
}
|
|
55
8
|
}
|
|
56
9
|
}
|
|
@@ -10,6 +10,7 @@ export interface StructuredLogFields {
|
|
|
10
10
|
deploy_role: PlaydropDeployRole;
|
|
11
11
|
public_surface: PlaydropPublicSurface;
|
|
12
12
|
}
|
|
13
|
+
export declare function isCurrentSlotActive(env?: NodeJS.ProcessEnv): boolean | null;
|
|
13
14
|
export declare function parseDeployRole(value: unknown): PlaydropDeployRole | null;
|
|
14
15
|
export declare function parseDeploySlot(value: unknown): PlaydropDeploySlot | null;
|
|
15
16
|
export declare function parsePublicSurface(value: unknown): PlaydropPublicSurface | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/deployment.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,SAAS,CAAC;AACpD,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,OAAO,CAAC;AAClD,MAAM,MAAM,qBAAqB,G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B,iBAAiB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,kBAAkB,GAAG,IAAI,CAEjG;AAED,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,qBAAqB,CAUhG;AAED,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAOnF;AAED,wBAAgB,uBAAuB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAUrF;AAED,wBAAgB,sBAAsB,CACpC,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,QAAQ,GAAG,SAAS,GAAG,SAAS,CAYlC;AAED,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAU7E;AAED,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAM7E;AAED,wBAAgB,qBAAqB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAMlF;AAED,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAM5E;AAED,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,mBAAmB,CAYrH"}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.isCurrentSlotActive = isCurrentSlotActive;
|
|
6
7
|
exports.parseDeployRole = parseDeployRole;
|
|
7
8
|
exports.parseDeploySlot = parseDeploySlot;
|
|
8
9
|
exports.parsePublicSurface = parsePublicSurface;
|
|
@@ -85,6 +86,32 @@ function parseBoolean(value) {
|
|
|
85
86
|
}
|
|
86
87
|
return null;
|
|
87
88
|
}
|
|
89
|
+
function resolveSlotStatePath(env = process.env) {
|
|
90
|
+
const raw = typeof env['PLAYDROP_SLOT_STATE_PATH'] === 'string' ? env['PLAYDROP_SLOT_STATE_PATH'].trim() : '';
|
|
91
|
+
return raw.length > 0 ? raw : null;
|
|
92
|
+
}
|
|
93
|
+
function readActiveSlotFromStateFile(env = process.env) {
|
|
94
|
+
const slotStatePath = resolveSlotStatePath(env);
|
|
95
|
+
if (!slotStatePath) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
try {
|
|
99
|
+
const raw = fs_1.default.readFileSync(slotStatePath, 'utf8');
|
|
100
|
+
const parsed = JSON.parse(raw);
|
|
101
|
+
return parseDeploySlot(parsed?.activeSlot);
|
|
102
|
+
}
|
|
103
|
+
catch {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function isCurrentSlotActive(env = process.env) {
|
|
108
|
+
const slot = resolveDeploySlot(env);
|
|
109
|
+
const activeSlot = readActiveSlotFromStateFile(env);
|
|
110
|
+
if (!slot || !activeSlot) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
return slot === activeSlot;
|
|
114
|
+
}
|
|
88
115
|
function parseDeployRole(value) {
|
|
89
116
|
const normalized = normalizeValue(value);
|
|
90
117
|
if (!normalized || !DEPLOY_ROLE_VALUES.has(normalized)) {
|
|
@@ -137,6 +164,10 @@ function isBackgroundWorkEnabled(env = process.env) {
|
|
|
137
164
|
if (explicit !== null) {
|
|
138
165
|
return explicit;
|
|
139
166
|
}
|
|
167
|
+
const currentSlotActive = isCurrentSlotActive(env);
|
|
168
|
+
if (currentSlotActive !== null) {
|
|
169
|
+
return currentSlotActive;
|
|
170
|
+
}
|
|
140
171
|
return resolveDeployRole(env) === 'prod';
|
|
141
172
|
}
|
|
142
173
|
function resolveSeoIndexingMode(env = process.env) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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UxF;AAwBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,sBAAsB,CAqEzF"}
|
|
@@ -100,6 +100,9 @@ function collectMissingHeaders(info) {
|
|
|
100
100
|
})
|
|
101
101
|
.map((entry) => entry.header);
|
|
102
102
|
}
|
|
103
|
+
function resolveClientRule(meta, clientKey) {
|
|
104
|
+
return meta.clients[clientKey] ?? meta.clients['all'];
|
|
105
|
+
}
|
|
103
106
|
function validateClientEnvironment(info) {
|
|
104
107
|
const normalized = normalizeRuntimeInfo(info);
|
|
105
108
|
if (!normalized) {
|
|
@@ -112,7 +115,7 @@ function validateClientEnvironment(info) {
|
|
|
112
115
|
}
|
|
113
116
|
const meta = loadClientMeta();
|
|
114
117
|
const clientKey = normalized.client;
|
|
115
|
-
const clientRule = meta
|
|
118
|
+
const clientRule = resolveClientRule(meta, clientKey);
|
|
116
119
|
if (!clientRule) {
|
|
117
120
|
return {
|
|
118
121
|
ok: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fastify.d.ts","sourceRoot":"","sources":["../../../src/server/fastify.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,YAAY,EACZ,cAAc,EACd,oBAAoB,EAEpB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAQjB,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EACjB,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAElB,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,cAAc;QACtB,aAAa,CAAC,EAAE,2BAA2B,CAAC;QAC5C,iBAAiB,CAAC,EAAE;YAClB,MAAM,CAAC,EAAE,MAAM,CAAC;YAChB,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;KACH;CACF;AAUD,wBAAgB,oBAAoB,CAClC,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AO,EAAE,uBAAuB,GAC/B,uBAAuB,CAkEzB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,CAAC,OAAO,EAAE,cAAc,KAAK,iBAAqC,EAC1E,SAAS,GAAE,eAA2C,EACtD,SAAS,GAAE,CAAC,OAAO,EAAE,uBAAuB,KAAK,uBAA2C,GAC3F,WAAW,CAkBb;AAED,eAAO,MAAM,qBAAqB,aAAqB,CAAC"}
|
|
@@ -71,6 +71,9 @@ function buildFastifyLogger(service) {
|
|
|
71
71
|
}
|
|
72
72
|
function buildFastifyServerOptions(params) {
|
|
73
73
|
return {
|
|
74
|
+
routerOptions: {
|
|
75
|
+
maxParamLength: 2048,
|
|
76
|
+
},
|
|
74
77
|
logger: buildFastifyLogger(params.service),
|
|
75
78
|
disableRequestLogging: true,
|
|
76
79
|
requestIdHeader: 'x-request-id',
|
|
@@ -4,6 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_fs_1 = __importDefault(require("node:fs"));
|
|
8
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
9
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
7
10
|
const node_test_1 = __importDefault(require("node:test"));
|
|
8
11
|
const deployment_1 = require("../src/deployment");
|
|
9
12
|
(0, node_test_1.default)('deploy role parsing stays strict', () => {
|
|
@@ -43,6 +46,27 @@ const deployment_1 = require("../src/deployment");
|
|
|
43
46
|
strict_1.default.equal((0, deployment_1.resolveSeoIndexingMode)(env), 'noindex');
|
|
44
47
|
strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), false);
|
|
45
48
|
});
|
|
49
|
+
(0, node_test_1.default)('background work follows the runtime slot-state file when present', () => {
|
|
50
|
+
const tempDir = node_fs_1.default.mkdtempSync(node_path_1.default.join(node_os_1.default.tmpdir(), 'playdrop-slot-state-'));
|
|
51
|
+
const slotStatePath = node_path_1.default.join(tempDir, 'slot-state.json');
|
|
52
|
+
try {
|
|
53
|
+
node_fs_1.default.writeFileSync(slotStatePath, JSON.stringify({ activeSlot: 'green' }));
|
|
54
|
+
const env = {
|
|
55
|
+
NODE_ENV: 'production',
|
|
56
|
+
PLAYDROP_DEPLOY_ROLE: 'prod',
|
|
57
|
+
PLAYDROP_SLOT: 'green',
|
|
58
|
+
PLAYDROP_SLOT_STATE_PATH: slotStatePath,
|
|
59
|
+
};
|
|
60
|
+
strict_1.default.equal((0, deployment_1.isCurrentSlotActive)(env), true);
|
|
61
|
+
strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), true);
|
|
62
|
+
node_fs_1.default.writeFileSync(slotStatePath, JSON.stringify({ activeSlot: 'blue' }));
|
|
63
|
+
strict_1.default.equal((0, deployment_1.isCurrentSlotActive)(env), false);
|
|
64
|
+
strict_1.default.equal((0, deployment_1.isBackgroundWorkEnabled)(env), false);
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
node_fs_1.default.rmSync(tempDir, { recursive: true, force: true });
|
|
68
|
+
}
|
|
69
|
+
});
|
|
46
70
|
(0, node_test_1.default)('explicit origin overrides win over derived defaults', () => {
|
|
47
71
|
const env = {
|
|
48
72
|
PLAYDROP_PUBLIC_ORIGIN: 'https://blue.playdrop.ai/',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fastify.test.d.ts","sourceRoot":"","sources":["../../test/fastify.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const strict_1 = __importDefault(require("node:assert/strict"));
|
|
7
|
+
const node_test_1 = __importDefault(require("node:test"));
|
|
8
|
+
const fastify_1 = require("../src/server/fastify");
|
|
9
|
+
(0, node_test_1.default)('buildFastifyServerOptions allows long path params for encrypted auth tokens', () => {
|
|
10
|
+
const options = (0, fastify_1.buildFastifyServerOptions)({ service: 'api-server' });
|
|
11
|
+
strict_1.default.equal(options.routerOptions?.maxParamLength, 2048);
|
|
12
|
+
});
|
|
@@ -23,8 +23,8 @@ function runtime(overrides = {}) {
|
|
|
23
23
|
});
|
|
24
24
|
(0, node_test_1.default)('enforces minimum build when version matches requirement', () => {
|
|
25
25
|
const meta = (0, index_1.loadClientMeta)();
|
|
26
|
-
const requiredVersion = meta.clients['
|
|
27
|
-
const requiredBuild = meta.clients['
|
|
26
|
+
const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
|
|
27
|
+
const requiredBuild = meta.clients['all']?.minimumBuild;
|
|
28
28
|
if (typeof requiredBuild !== 'number') {
|
|
29
29
|
strict_1.default.equal(true, true);
|
|
30
30
|
return;
|
|
@@ -45,32 +45,31 @@ function runtime(overrides = {}) {
|
|
|
45
45
|
strict_1.default.equal(result.code, 'unsupported_client_version');
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
(0, node_test_1.default)('
|
|
48
|
+
(0, node_test_1.default)('accepts supported clients without platform-specific floors', () => {
|
|
49
49
|
const info = runtime({ platform: 'ios', platformVersion: '15.5', client: 'apple-playdrop' });
|
|
50
50
|
const result = (0, index_1.validateClientEnvironment)(info);
|
|
51
|
-
strict_1.default.equal(result.ok,
|
|
52
|
-
if (!result.ok) {
|
|
53
|
-
strict_1.default.equal(result.code, 'unsupported_platform_version');
|
|
54
|
-
}
|
|
51
|
+
strict_1.default.equal(result.ok, true);
|
|
55
52
|
});
|
|
56
53
|
(0, node_test_1.default)('accepts product-specific Apple client ids that meet the minimum version', () => {
|
|
57
54
|
const meta = (0, index_1.loadClientMeta)();
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
for (const clientName of ['apple-games', 'apple-music']) {
|
|
56
|
+
const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
|
|
57
|
+
const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
|
|
58
|
+
const info = runtime({
|
|
59
|
+
client: clientName,
|
|
60
|
+
clientVersion: requiredVersion,
|
|
61
|
+
clientBuild: requiredBuild,
|
|
62
|
+
platform: 'ios',
|
|
63
|
+
platformVersion: '18.0',
|
|
64
|
+
});
|
|
65
|
+
const result = (0, index_1.validateClientEnvironment)(info);
|
|
66
|
+
strict_1.default.equal(result.ok, true, clientName);
|
|
67
|
+
}
|
|
69
68
|
});
|
|
70
69
|
(0, node_test_1.default)('accepts android-games as a first-class client identity', () => {
|
|
71
70
|
const meta = (0, index_1.loadClientMeta)();
|
|
72
|
-
const requiredVersion = meta.clients['
|
|
73
|
-
const requiredBuild = meta.clients['
|
|
71
|
+
const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
|
|
72
|
+
const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
|
|
74
73
|
const info = runtime({
|
|
75
74
|
client: 'android-games',
|
|
76
75
|
clientVersion: requiredVersion,
|
|
@@ -83,8 +82,8 @@ function runtime(overrides = {}) {
|
|
|
83
82
|
});
|
|
84
83
|
(0, node_test_1.default)('keeps accepting the legacy Apple client id during rollout', () => {
|
|
85
84
|
const meta = (0, index_1.loadClientMeta)();
|
|
86
|
-
const requiredVersion = meta.clients['
|
|
87
|
-
const requiredBuild = meta.clients['
|
|
85
|
+
const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
|
|
86
|
+
const requiredBuild = meta.clients['all']?.minimumBuild ?? meta.build;
|
|
88
87
|
const info = runtime({
|
|
89
88
|
client: 'apple',
|
|
90
89
|
clientVersion: requiredVersion,
|
|
@@ -97,7 +96,7 @@ function runtime(overrides = {}) {
|
|
|
97
96
|
});
|
|
98
97
|
(0, node_test_1.default)('does not require a build floor for newer cli versions once the version is supported', () => {
|
|
99
98
|
const meta = (0, index_1.loadClientMeta)();
|
|
100
|
-
const requiredVersion = meta.clients['
|
|
99
|
+
const requiredVersion = meta.clients['all']?.minimumVersion ?? meta.version;
|
|
101
100
|
const info = runtime({
|
|
102
101
|
client: 'cli',
|
|
103
102
|
clientVersion: requiredVersion,
|