@playdrop/playdrop-cli 0.11.9 → 0.12.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/config/client-meta.json +2 -2
- package/dist/apps/build.js +2 -3
- package/dist/apps/index.d.ts +4 -5
- package/dist/apps/index.js +14 -16
- package/dist/apps/loadCheck.d.ts +76 -0
- package/dist/apps/loadCheck.js +874 -0
- package/dist/apps/upload.d.ts +3 -2
- package/dist/apps/upload.js +110 -6
- package/dist/catalogue-utils.d.ts +1 -0
- package/dist/catalogue-utils.js +1 -0
- package/dist/catalogue.d.ts +2 -0
- package/dist/catalogue.js +17 -0
- package/dist/commands/build.js +4 -1
- package/dist/commands/captureListing.d.ts +30 -1
- package/dist/commands/captureListing.js +305 -120
- package/dist/commands/check.d.ts +8 -0
- package/dist/commands/check.js +188 -0
- package/dist/commands/review.d.ts +20 -0
- package/dist/commands/review.js +112 -0
- package/dist/commands/upload-content.d.ts +1 -1
- package/dist/commands/upload.d.ts +2 -1
- package/dist/commands/upload.js +9 -52
- package/dist/commands/validate.js +0 -155
- package/dist/commands/worker/runtime.d.ts +1 -0
- package/dist/commands/worker/runtime.js +43 -3
- package/dist/commands/worker.d.ts +1 -1
- package/dist/commands/worker.js +22 -44
- package/dist/index.js +33 -49
- package/dist/playwright.d.ts +5 -0
- package/dist/playwright.js +60 -1
- package/node_modules/@playdrop/api-client/dist/client.d.ts +4 -2
- package/node_modules/@playdrop/api-client/dist/client.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/client.js +0 -10
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts +2 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/domains/apps.js +11 -0
- package/node_modules/@playdrop/api-client/dist/domains/auth.d.ts +3 -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 +22 -0
- package/node_modules/@playdrop/api-client/dist/index.d.ts +4 -3
- package/node_modules/@playdrop/api-client/dist/index.d.ts.map +1 -1
- package/node_modules/@playdrop/api-client/dist/index.js +10 -5
- package/node_modules/@playdrop/config/client-meta.json +2 -2
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts +8 -0
- package/node_modules/@playdrop/config/dist/src/client-meta.d.ts.map +1 -0
- package/node_modules/@playdrop/config/dist/src/client-meta.js +51 -0
- package/node_modules/@playdrop/config/dist/src/deployment.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/deployment.js +2 -32
- package/node_modules/@playdrop/config/dist/src/index.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/index.js +2 -28
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts +0 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.d.ts.map +1 -1
- package/node_modules/@playdrop/config/dist/src/runtime-service-origins.js +21 -5
- package/node_modules/@playdrop/config/dist/test/runtime-service-origins.test.js +8 -0
- package/node_modules/@playdrop/config/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@playdrop/types/dist/api.d.ts +19 -14
- package/node_modules/@playdrop/types/dist/api.d.ts.map +1 -1
- package/node_modules/@playdrop/types/dist/api.js +5 -10
- package/node_modules/@playdrop/types/dist/version.d.ts +14 -0
- package/node_modules/@playdrop/types/dist/version.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/apps/launchCheck.d.ts +0 -39
- package/dist/apps/launchCheck.js +0 -414
- package/dist/captureRuntime.d.ts +0 -73
- package/dist/captureRuntime.js +0 -1021
- package/dist/commands/capture.d.ts +0 -14
- package/dist/commands/capture.js +0 -548
- package/dist/commands/captureRemote.d.ts +0 -17
- package/dist/commands/captureRemote.js +0 -394
- package/node_modules/@playdrop/types/dist/entity.d.ts +0 -31
- package/node_modules/@playdrop/types/dist/entity.d.ts.map +0 -1
- package/node_modules/@playdrop/types/dist/entity.js +0 -67
|
@@ -56,6 +56,7 @@ __export(dist_exports, {
|
|
|
56
56
|
createCliApiKey: () => createCliApiKey,
|
|
57
57
|
createContentComment: () => createContentComment,
|
|
58
58
|
createCreditPackCheckoutSession: () => createCreditPackCheckoutSession,
|
|
59
|
+
createNativeOAuthLinkStart: () => createNativeOAuthLinkStart,
|
|
59
60
|
createNewGameAgentTask: () => createNewGameAgentTask,
|
|
60
61
|
createRemixGameAgentTask: () => createRemixGameAgentTask,
|
|
61
62
|
deleteAccount: () => deleteAccount,
|
|
@@ -81,6 +82,7 @@ __export(dist_exports, {
|
|
|
81
82
|
enqueueNextAdminAppVersionReviewTask: () => enqueueNextAdminAppVersionReviewTask,
|
|
82
83
|
exchangeAppleOAuthHandoff: () => exchangeAppleOAuthHandoff,
|
|
83
84
|
exchangeGoogleOneTapCredential: () => exchangeGoogleOneTapCredential,
|
|
85
|
+
exchangeNativeOAuthHandoff: () => exchangeNativeOAuthHandoff,
|
|
84
86
|
exportPrivacyData: () => exportPrivacyData,
|
|
85
87
|
fetchAdminAiGeneration: () => fetchAdminAiGeneration,
|
|
86
88
|
fetchAdminAppPlayerMeta: () => fetchAdminAppPlayerMeta,
|
|
@@ -269,7 +271,6 @@ __export(dist_exports, {
|
|
|
269
271
|
updateEmailPreferences: () => updateEmailPreferences,
|
|
270
272
|
updateProfile: () => updateProfile,
|
|
271
273
|
updatePublicEmailPreferences: () => updatePublicEmailPreferences,
|
|
272
|
-
upgradeToCreator: () => upgradeToCreator,
|
|
273
274
|
uploadAdminGameCollectionIcon: () => uploadAdminGameCollectionIcon,
|
|
274
275
|
uploadAgentTaskAttachment: () => uploadAgentTaskAttachment,
|
|
275
276
|
upsertApplePushDevice: () => upsertApplePushDevice,
|
|
@@ -455,9 +456,6 @@ async function exportPrivacyData() {
|
|
|
455
456
|
async function deleteAccount(request) {
|
|
456
457
|
return await getDefaultClient().deleteAccount(request);
|
|
457
458
|
}
|
|
458
|
-
async function upgradeToCreator() {
|
|
459
|
-
return await getDefaultClient().upgradeToCreator();
|
|
460
|
-
}
|
|
461
459
|
async function unlinkX() {
|
|
462
460
|
return await getDefaultClient().unlinkX();
|
|
463
461
|
}
|
|
@@ -470,12 +468,18 @@ async function unlinkApple() {
|
|
|
470
468
|
async function createAppleOAuthLinkStart(request) {
|
|
471
469
|
return await getDefaultClient().createAppleOAuthLinkStart(request);
|
|
472
470
|
}
|
|
471
|
+
async function createNativeOAuthLinkStart(request) {
|
|
472
|
+
return await getDefaultClient().createNativeOAuthLinkStart(request);
|
|
473
|
+
}
|
|
473
474
|
async function createAppleNativeChallenge() {
|
|
474
475
|
return await getDefaultClient().createAppleNativeChallenge();
|
|
475
476
|
}
|
|
476
477
|
async function exchangeAppleOAuthHandoff(request) {
|
|
477
478
|
return await getDefaultClient().exchangeAppleOAuthHandoff(request);
|
|
478
479
|
}
|
|
480
|
+
async function exchangeNativeOAuthHandoff(request) {
|
|
481
|
+
return await getDefaultClient().exchangeNativeOAuthHandoff(request);
|
|
482
|
+
}
|
|
479
483
|
async function signInWithApple(request) {
|
|
480
484
|
return await getDefaultClient().signInWithApple(request);
|
|
481
485
|
}
|
|
@@ -1257,6 +1261,7 @@ function getClientVersionLabel() {
|
|
|
1257
1261
|
createCliApiKey,
|
|
1258
1262
|
createContentComment,
|
|
1259
1263
|
createCreditPackCheckoutSession,
|
|
1264
|
+
createNativeOAuthLinkStart,
|
|
1260
1265
|
createNewGameAgentTask,
|
|
1261
1266
|
createRemixGameAgentTask,
|
|
1262
1267
|
deleteAccount,
|
|
@@ -1282,6 +1287,7 @@ function getClientVersionLabel() {
|
|
|
1282
1287
|
enqueueNextAdminAppVersionReviewTask,
|
|
1283
1288
|
exchangeAppleOAuthHandoff,
|
|
1284
1289
|
exchangeGoogleOneTapCredential,
|
|
1290
|
+
exchangeNativeOAuthHandoff,
|
|
1285
1291
|
exportPrivacyData,
|
|
1286
1292
|
fetchAdminAiGeneration,
|
|
1287
1293
|
fetchAdminAppPlayerMeta,
|
|
@@ -1470,7 +1476,6 @@ function getClientVersionLabel() {
|
|
|
1470
1476
|
updateEmailPreferences,
|
|
1471
1477
|
updateProfile,
|
|
1472
1478
|
updatePublicEmailPreferences,
|
|
1473
|
-
upgradeToCreator,
|
|
1474
1479
|
uploadAdminGameCollectionIcon,
|
|
1475
1480
|
uploadAgentTaskAttachment,
|
|
1476
1481
|
upsertApplePushDevice,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ClientMetaConfig } from './types';
|
|
2
|
+
export declare function resolveClientMetaPath(): string;
|
|
3
|
+
export declare function loadClientMetaFile(): ClientMetaConfig;
|
|
4
|
+
export declare function loadClientReleaseMeta(): {
|
|
5
|
+
version: string;
|
|
6
|
+
build: number;
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=client-meta.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-meta.d.ts","sourceRoot":"","sources":["../../src/client-meta.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,wBAAgB,qBAAqB,IAAI,MAAM,CAY9C;AAED,wBAAgB,kBAAkB,IAAI,gBAAgB,CAMrD;AAED,wBAAgB,qBAAqB,IAAI;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAQ1E"}
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
exports.resolveClientMetaPath = resolveClientMetaPath;
|
|
7
|
+
exports.loadClientMetaFile = loadClientMetaFile;
|
|
8
|
+
exports.loadClientReleaseMeta = loadClientReleaseMeta;
|
|
9
|
+
const fs_1 = __importDefault(require("fs"));
|
|
10
|
+
const path_1 = __importDefault(require("path"));
|
|
11
|
+
let cachedMetaPath = null;
|
|
12
|
+
let cachedMeta = null;
|
|
13
|
+
function clientMetaPathCandidates() {
|
|
14
|
+
return Array.from(new Set([
|
|
15
|
+
path_1.default.resolve(process.cwd(), 'config', 'client-meta.json'),
|
|
16
|
+
path_1.default.resolve(process.cwd(), '..', 'config', 'client-meta.json'),
|
|
17
|
+
path_1.default.resolve(process.cwd(), '..', '..', 'config', 'client-meta.json'),
|
|
18
|
+
path_1.default.resolve(process.cwd(), '..', '..', '..', 'config', 'client-meta.json'),
|
|
19
|
+
path_1.default.resolve(__dirname, '../../..', 'config', 'client-meta.json'),
|
|
20
|
+
path_1.default.resolve(__dirname, '../../../..', 'config', 'client-meta.json'),
|
|
21
|
+
]));
|
|
22
|
+
}
|
|
23
|
+
function resolveClientMetaPath() {
|
|
24
|
+
if (cachedMetaPath) {
|
|
25
|
+
return cachedMetaPath;
|
|
26
|
+
}
|
|
27
|
+
const candidates = clientMetaPathCandidates();
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
if (fs_1.default.existsSync(candidate)) {
|
|
30
|
+
cachedMetaPath = candidate;
|
|
31
|
+
return candidate;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
throw new Error(`missing_client_meta_json:${candidates.join('|')}`);
|
|
35
|
+
}
|
|
36
|
+
function loadClientMetaFile() {
|
|
37
|
+
if (!cachedMeta) {
|
|
38
|
+
const raw = fs_1.default.readFileSync(resolveClientMetaPath(), 'utf8');
|
|
39
|
+
cachedMeta = JSON.parse(raw);
|
|
40
|
+
}
|
|
41
|
+
return cachedMeta;
|
|
42
|
+
}
|
|
43
|
+
function loadClientReleaseMeta() {
|
|
44
|
+
const parsed = loadClientMetaFile();
|
|
45
|
+
const version = typeof parsed.version === 'string' ? parsed.version.trim() : '';
|
|
46
|
+
const build = Number(parsed.build);
|
|
47
|
+
if (!/^\d+\.\d+\.\d+$/.test(version) || !Number.isInteger(build) || build < 1) {
|
|
48
|
+
throw new Error('invalid_client_meta_for_deploy_helpers');
|
|
49
|
+
}
|
|
50
|
+
return { version, build };
|
|
51
|
+
}
|
|
@@ -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,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAM5E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;IAChC,cAAc,EAAE,qBAAqB,CAAC;CACvC;
|
|
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,GAAG,kBAAkB,GAAG,kBAAkB,CAAC;AAM5E,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,kBAAkB,GAAG,MAAM,CAAC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,kBAAkB,CAAC;IAChC,cAAc,EAAE,qBAAqB,CAAC;CACvC;AA8DD,wBAAgB,mBAAmB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,GAAG,IAAI,CAOxF;AAED,wBAAgB,eAAe,CAAC,KAAK,E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in;
|
|
20
20
|
exports.resolveStructuredLogFields = resolveStructuredLogFields;
|
|
21
21
|
const fs_1 = __importDefault(require("fs"));
|
|
22
|
-
const
|
|
22
|
+
const client_meta_1 = require("./client-meta");
|
|
23
23
|
const DEPLOY_ROLE_VALUES = new Set(['prod', 'preview']);
|
|
24
24
|
const DEPLOY_SLOT_VALUES = new Set(['blue', 'green']);
|
|
25
25
|
const PUBLIC_SURFACE_VALUES = new Set(['prod', 'preview', 'blue', 'green']);
|
|
26
|
-
let cachedClientMeta = null;
|
|
27
|
-
function resolveMetaPath() {
|
|
28
|
-
const candidates = Array.from(new Set([
|
|
29
|
-
path_1.default.resolve(process.cwd(), 'config', 'client-meta.json'),
|
|
30
|
-
path_1.default.resolve(process.cwd(), '..', 'config', 'client-meta.json'),
|
|
31
|
-
path_1.default.resolve(process.cwd(), '..', '..', 'config', 'client-meta.json'),
|
|
32
|
-
path_1.default.resolve(process.cwd(), '..', '..', '..', 'config', 'client-meta.json'),
|
|
33
|
-
path_1.default.resolve(__dirname, '../../..', 'config', 'client-meta.json'),
|
|
34
|
-
path_1.default.resolve(__dirname, '../../../..', 'config', 'client-meta.json'),
|
|
35
|
-
]));
|
|
36
|
-
for (const candidate of candidates) {
|
|
37
|
-
if (fs_1.default.existsSync(candidate)) {
|
|
38
|
-
return candidate;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
throw new Error(`missing_client_meta_json:${candidates.join('|')}`);
|
|
42
|
-
}
|
|
43
|
-
function loadReleaseMeta() {
|
|
44
|
-
if (!cachedClientMeta) {
|
|
45
|
-
const raw = fs_1.default.readFileSync(resolveMetaPath(), 'utf8');
|
|
46
|
-
const parsed = JSON.parse(raw);
|
|
47
|
-
const version = typeof parsed.version === 'string' ? parsed.version.trim() : '';
|
|
48
|
-
const build = Number(parsed.build);
|
|
49
|
-
if (!/^\d+\.\d+\.\d+$/.test(version) || !Number.isInteger(build) || build < 1) {
|
|
50
|
-
throw new Error('invalid_client_meta_for_deploy_helpers');
|
|
51
|
-
}
|
|
52
|
-
cachedClientMeta = { version, build };
|
|
53
|
-
}
|
|
54
|
-
return cachedClientMeta;
|
|
55
|
-
}
|
|
56
26
|
function normalizeValue(value) {
|
|
57
27
|
if (typeof value !== 'string') {
|
|
58
28
|
return null;
|
|
@@ -217,7 +187,7 @@ function resolveAiOrigin(env = process.env) {
|
|
|
217
187
|
}
|
|
218
188
|
function resolveStructuredLogFields(service, env = process.env) {
|
|
219
189
|
const slot = resolveDeploySlot(env);
|
|
220
|
-
const release =
|
|
190
|
+
const release = (0, client_meta_1.loadClientReleaseMeta)();
|
|
221
191
|
return {
|
|
222
192
|
environment: resolveEnvironmentName(env),
|
|
223
193
|
slot: slot ?? 'none',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EACV,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAEjB,wBAAgB,cAAc,IAAI,gBAAgB,CAEjD;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAEvC;AAED,wBAAgB,qBAAqB,IAAI,MAAM,CAG9C;AAED,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAE/B,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUxF;AAwBD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,iBAAiB,GAAG,sBAAsB,CAqEzF"}
|
|
@@ -13,9 +13,6 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
17
|
exports.CLIENT_HEADER_NAMES = void 0;
|
|
21
18
|
exports.loadClientMeta = loadClientMeta;
|
|
@@ -24,34 +21,11 @@ exports.getClientBuild = getClientBuild;
|
|
|
24
21
|
exports.getClientVersionLabel = getClientVersionLabel;
|
|
25
22
|
exports.createClientHeaderRecord = createClientHeaderRecord;
|
|
26
23
|
exports.validateClientEnvironment = validateClientEnvironment;
|
|
27
|
-
const fs_1 = __importDefault(require("fs"));
|
|
28
|
-
const path_1 = __importDefault(require("path"));
|
|
29
24
|
const constants_1 = require("./constants");
|
|
30
25
|
Object.defineProperty(exports, "CLIENT_HEADER_NAMES", { enumerable: true, get: function () { return constants_1.CLIENT_HEADER_NAMES; } });
|
|
31
|
-
|
|
32
|
-
const candidates = Array.from(new Set([
|
|
33
|
-
path_1.default.resolve(process.cwd(), 'config', 'client-meta.json'),
|
|
34
|
-
path_1.default.resolve(process.cwd(), '..', 'config', 'client-meta.json'),
|
|
35
|
-
path_1.default.resolve(process.cwd(), '..', '..', 'config', 'client-meta.json'),
|
|
36
|
-
path_1.default.resolve(process.cwd(), '..', '..', '..', 'config', 'client-meta.json'),
|
|
37
|
-
path_1.default.resolve(__dirname, '../../..', 'config', 'client-meta.json'),
|
|
38
|
-
path_1.default.resolve(__dirname, '../../../..', 'config', 'client-meta.json')
|
|
39
|
-
]));
|
|
40
|
-
for (const candidate of candidates) {
|
|
41
|
-
if (fs_1.default.existsSync(candidate)) {
|
|
42
|
-
return candidate;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
throw new Error(`missing_client_meta_json:${candidates.join('|')}`);
|
|
46
|
-
}
|
|
47
|
-
const META_PATH = resolveMetaPath();
|
|
48
|
-
let cachedMeta = null;
|
|
26
|
+
const client_meta_1 = require("./client-meta");
|
|
49
27
|
function loadClientMeta() {
|
|
50
|
-
|
|
51
|
-
const raw = fs_1.default.readFileSync(META_PATH, 'utf8');
|
|
52
|
-
cachedMeta = JSON.parse(raw);
|
|
53
|
-
}
|
|
54
|
-
return cachedMeta;
|
|
28
|
+
return (0, client_meta_1.loadClientMetaFile)();
|
|
55
29
|
}
|
|
56
30
|
function getClientVersion() {
|
|
57
31
|
return loadClientMeta().version;
|
|
@@ -5,7 +5,6 @@ export declare const RUNTIME_SERVICE_DEFAULT_PORTS: {
|
|
|
5
5
|
readonly admin: 8081;
|
|
6
6
|
readonly ai: 8083;
|
|
7
7
|
readonly assets: 8082;
|
|
8
|
-
readonly engine: 3001;
|
|
9
8
|
};
|
|
10
9
|
export type RuntimeServiceName = keyof typeof RUNTIME_SERVICE_DEFAULT_PORTS;
|
|
11
10
|
export type PlaydropSurface = "prod" | "preview" | "blue" | "green";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-service-origins.d.ts","sourceRoot":"","sources":["../../src/runtime-service-origins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B
|
|
1
|
+
{"version":3,"file":"runtime-service-origins.d.ts","sourceRoot":"","sources":["../../src/runtime-service-origins.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B;;;;;;;CAOhC,CAAC;AAEX,MAAM,MAAM,kBAAkB,GAAG,MAAM,OAAO,6BAA6B,CAAC;AAC5E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAoEpE,wBAAgB,sBAAsB,CAAC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17
|
admin: 8081,
|
|
18
18
|
ai: 8083,
|
|
19
19
|
assets: 8082,
|
|
20
|
-
engine: 3001,
|
|
21
20
|
};
|
|
22
21
|
const PLAYDROP_SURFACES = new Set(["prod", "preview", "blue", "green"]);
|
|
23
22
|
const PLAYDROP_SERVICE_PREFIXES = new Set([
|
|
@@ -27,7 +26,6 @@ const PLAYDROP_SERVICE_PREFIXES = new Set([
|
|
|
27
26
|
"admin",
|
|
28
27
|
"ai",
|
|
29
28
|
"assets",
|
|
30
|
-
"engine",
|
|
31
29
|
]);
|
|
32
30
|
function trimTrailingSlash(value) {
|
|
33
31
|
return value.replace(/\/+$/, "");
|
|
@@ -41,7 +39,25 @@ function normalizeHttpProtocol(value) {
|
|
|
41
39
|
function isLoopbackHostname(hostname) {
|
|
42
40
|
return hostname === "localhost"
|
|
43
41
|
|| hostname === "127.0.0.1"
|
|
44
|
-
|| hostname === "0.0.0.0"
|
|
42
|
+
|| hostname === "0.0.0.0"
|
|
43
|
+
|| hostname === "::1"
|
|
44
|
+
|| hostname === "[::1]";
|
|
45
|
+
}
|
|
46
|
+
function isIpv4Hostname(hostname) {
|
|
47
|
+
const parts = hostname.split(".");
|
|
48
|
+
return parts.length === 4 && parts.every((part) => {
|
|
49
|
+
if (!/^\d{1,3}$/.test(part)) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
const value = Number(part);
|
|
53
|
+
return Number.isInteger(value) && value >= 0 && value <= 255;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function isIpHostname(hostname) {
|
|
57
|
+
return isIpv4Hostname(hostname) || hostname.includes(":");
|
|
58
|
+
}
|
|
59
|
+
function formatHostnameForUrl(hostname) {
|
|
60
|
+
return hostname.includes(":") && !hostname.startsWith("[") ? `[${hostname}]` : hostname;
|
|
45
61
|
}
|
|
46
62
|
function resolveDefaultPort(service, defaultPorts = exports.RUNTIME_SERVICE_DEFAULT_PORTS) {
|
|
47
63
|
return defaultPorts[service]
|
|
@@ -108,9 +124,9 @@ function resolveRuntimeServiceBaseUrl(input) {
|
|
|
108
124
|
const protocol = normalizeHttpProtocol(input.protocol);
|
|
109
125
|
const hostname = normalizeHostname(input.hostname);
|
|
110
126
|
const service = input.service.trim().toLowerCase() || "www";
|
|
111
|
-
if (isLoopbackHostname(hostname)) {
|
|
127
|
+
if (isLoopbackHostname(hostname) || isIpHostname(hostname)) {
|
|
112
128
|
const port = resolveDefaultPort(service, input.defaultPorts);
|
|
113
|
-
return `${protocol}//${hostname}:${port}`;
|
|
129
|
+
return `${protocol}//${formatHostnameForUrl(hostname)}:${port}`;
|
|
114
130
|
}
|
|
115
131
|
const localDomainOrigin = resolveLocalDomainServiceOrigin({ protocol, hostname, service });
|
|
116
132
|
if (localDomainOrigin) {
|
|
@@ -10,6 +10,13 @@ const runtime_service_origins_1 = require("../src/runtime-service-origins");
|
|
|
10
10
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "http:", hostname: "localhost", service: "api" }), "http://localhost:4000");
|
|
11
11
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "http:", hostname: "localhost", service: "admin" }), "http://localhost:8081");
|
|
12
12
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "http:", hostname: "localhost", service: "unknown" }), "http://localhost:8080");
|
|
13
|
+
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "http:", hostname: "localhost", service: "engine" }), "http://localhost:8080");
|
|
14
|
+
strict_1.default.equal(runtime_service_origins_1.RUNTIME_SERVICE_DEFAULT_PORTS["engine"], undefined);
|
|
15
|
+
});
|
|
16
|
+
(0, node_test_1.default)("runtime service resolvers use local service ports for LAN IP hosts", () => {
|
|
17
|
+
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeApiBaseUrl)({ protocol: "http:", hostname: "192.168.1.169" }), "http://192.168.1.169:4000");
|
|
18
|
+
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeRealtimeBaseUrl)({ protocol: "http:", hostname: "192.168.1.169" }), "ws://192.168.1.169:3000/ws");
|
|
19
|
+
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeAssetsBaseUrl)({ protocol: "http:", hostname: "192.168.1.169" }), "http://192.168.1.169:8082");
|
|
13
20
|
});
|
|
14
21
|
(0, node_test_1.default)("resolveRuntimeServiceBaseUrl maps generic service subdomains behind real domains", () => {
|
|
15
22
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "https:", hostname: "www.playdrop.test", service: "api" }), "https://api.playdrop.test");
|
|
@@ -17,6 +24,7 @@ const runtime_service_origins_1 = require("../src/runtime-service-origins");
|
|
|
17
24
|
});
|
|
18
25
|
(0, node_test_1.default)("resolveRuntimeServiceBaseUrl understands PlayDrop deployment surfaces", () => {
|
|
19
26
|
strict_1.default.equal((0, runtime_service_origins_1.resolvePlaydropSurface)("admin.blue.playdrop.ai"), "blue");
|
|
27
|
+
strict_1.default.equal((0, runtime_service_origins_1.resolvePlaydropSurface)("engine.playdrop.ai"), null);
|
|
20
28
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "https:", hostname: "admin.blue.playdrop.ai", service: "www" }), "https://blue.playdrop.ai");
|
|
21
29
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "https:", hostname: "admin.blue.playdrop.ai", service: "api" }), "https://api.blue.playdrop.ai");
|
|
22
30
|
strict_1.default.equal((0, runtime_service_origins_1.resolveRuntimeServiceBaseUrl)({ protocol: "https:", hostname: "admin.green.playdrop.ai", service: "play" }), "https://play.green.playdrop.ai");
|