@prisma/cli 8.0.0-rc.10-dev.82 → 8.0.0-rc.10-dev.83
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/cli.js +18 -38
- package/package.json +8 -8
package/dist/cli.js
CHANGED
|
@@ -8697,7 +8697,7 @@ function createAppProvider(client, options) {
|
|
|
8697
8697
|
if (ApiError.is(deploymentResult.error) && deploymentResult.error.statusCode === 404) return null;
|
|
8698
8698
|
throw new Error(deploymentResult.error.message);
|
|
8699
8699
|
}
|
|
8700
|
-
const app = await
|
|
8700
|
+
const app = await owningService(sdk, deploymentResult.value.serviceId, options?.signal);
|
|
8701
8701
|
const promotedUrl = app !== null && app.liveDeploymentId === deploymentResult.value.id ? app.liveUrl : null;
|
|
8702
8702
|
return {
|
|
8703
8703
|
app,
|
|
@@ -8783,6 +8783,23 @@ async function listComputeServices(client, options) {
|
|
|
8783
8783
|
}
|
|
8784
8784
|
return services.map(toAppRecord);
|
|
8785
8785
|
}
|
|
8786
|
+
async function owningService(sdk, serviceId, signal) {
|
|
8787
|
+
const result = await sdk.showApp({
|
|
8788
|
+
appId: serviceId,
|
|
8789
|
+
signal
|
|
8790
|
+
});
|
|
8791
|
+
if (result.isErr()) {
|
|
8792
|
+
if (ApiError.is(result.error) && result.error.statusCode === 404) return null;
|
|
8793
|
+
throw new Error(result.error.message);
|
|
8794
|
+
}
|
|
8795
|
+
return {
|
|
8796
|
+
id: result.value.id,
|
|
8797
|
+
name: result.value.name,
|
|
8798
|
+
region: result.value.region ?? null,
|
|
8799
|
+
liveDeploymentId: result.value.latestDeploymentId ?? null,
|
|
8800
|
+
liveUrl: toAbsoluteUrl(result.value.appEndpointDomain ?? null)
|
|
8801
|
+
};
|
|
8802
|
+
}
|
|
8786
8803
|
function toAppRecord(service) {
|
|
8787
8804
|
return {
|
|
8788
8805
|
id: service.id,
|
|
@@ -8892,43 +8909,6 @@ function domainApiCallError(summary, response, error) {
|
|
|
8892
8909
|
hint: error.error?.hint ?? null
|
|
8893
8910
|
});
|
|
8894
8911
|
}
|
|
8895
|
-
async function findAppForDeployment(sdk, deploymentId, signal) {
|
|
8896
|
-
const projectsResult = await sdk.listProjects({ signal });
|
|
8897
|
-
if (projectsResult.isErr()) throw new Error(projectsResult.error.message);
|
|
8898
|
-
for (const project of projectsResult.value) {
|
|
8899
|
-
const servicesResult = await sdk.listApps({
|
|
8900
|
-
projectId: project.id,
|
|
8901
|
-
signal
|
|
8902
|
-
});
|
|
8903
|
-
if (servicesResult.isErr()) throw new Error(servicesResult.error.message);
|
|
8904
|
-
for (const service of servicesResult.value) {
|
|
8905
|
-
const app = await findServiceAppForDeployment(sdk, service.id, deploymentId, signal);
|
|
8906
|
-
if (app) return app;
|
|
8907
|
-
}
|
|
8908
|
-
}
|
|
8909
|
-
return null;
|
|
8910
|
-
}
|
|
8911
|
-
async function findServiceAppForDeployment(sdk, serviceId, deploymentId, signal) {
|
|
8912
|
-
const detailResult = await sdk.showApp({
|
|
8913
|
-
appId: serviceId,
|
|
8914
|
-
signal
|
|
8915
|
-
});
|
|
8916
|
-
if (detailResult.isErr()) throw new Error(detailResult.error.message);
|
|
8917
|
-
const app = {
|
|
8918
|
-
id: detailResult.value.id,
|
|
8919
|
-
name: detailResult.value.name,
|
|
8920
|
-
region: detailResult.value.region ?? null,
|
|
8921
|
-
liveDeploymentId: detailResult.value.latestDeploymentId ?? null,
|
|
8922
|
-
liveUrl: toAbsoluteUrl(detailResult.value.appEndpointDomain ?? null)
|
|
8923
|
-
};
|
|
8924
|
-
if (app.liveDeploymentId === deploymentId) return app;
|
|
8925
|
-
const versionsResult = await sdk.listDeployments({
|
|
8926
|
-
appId: serviceId,
|
|
8927
|
-
signal
|
|
8928
|
-
});
|
|
8929
|
-
if (versionsResult.isErr()) throw new Error(versionsResult.error.message);
|
|
8930
|
-
return versionsResult.value.some((version) => version.id === deploymentId) ? app : null;
|
|
8931
|
-
}
|
|
8932
8912
|
function toAbsoluteUrl(url) {
|
|
8933
8913
|
if (!url) return null;
|
|
8934
8914
|
return url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prisma/cli",
|
|
3
|
-
"version": "8.0.0-rc.10-dev.
|
|
3
|
+
"version": "8.0.0-rc.10-dev.83",
|
|
4
4
|
"description": "Command-line interface for the Prisma Developer Platform.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@manypkg/tools": "^2.1.2",
|
|
43
43
|
"@prisma/cli-engine": "0.2.3",
|
|
44
|
-
"@prisma/composer-cli": "0.14.0-dev.
|
|
45
|
-
"@prisma/compute-sdk": "0.
|
|
44
|
+
"@prisma/composer-cli": "0.14.0-dev.5",
|
|
45
|
+
"@prisma/compute-sdk": "0.42.0",
|
|
46
46
|
"@prisma/management-api-sdk": "1.55.0",
|
|
47
|
-
"@prisma/orm-toolchain": "8.0.0-rc.7-dev.
|
|
47
|
+
"@prisma/orm-toolchain": "8.0.0-rc.7-dev.4",
|
|
48
48
|
"@vercel/detect-agent": "^1.2.3",
|
|
49
49
|
"better-result": "^2.9.2",
|
|
50
50
|
"dotenv": "^17.4.2",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"open": "^11.0.0"
|
|
53
53
|
},
|
|
54
54
|
"devDependencies": {
|
|
55
|
-
"@prisma/composer": "0.14.0-dev.
|
|
55
|
+
"@prisma/composer": "0.14.0-dev.5",
|
|
56
56
|
"@prisma/credentials-store": "^7.8.0",
|
|
57
|
-
"@repo/cli-conformance": "8.0.0-rc.10-dev.
|
|
58
|
-
"@repo/cli-telemetry": "8.0.0-rc.10-dev.
|
|
59
|
-
"@repo/tsconfig": "8.0.0-rc.10-dev.
|
|
57
|
+
"@repo/cli-conformance": "8.0.0-rc.10-dev.83",
|
|
58
|
+
"@repo/cli-telemetry": "8.0.0-rc.10-dev.83",
|
|
59
|
+
"@repo/tsconfig": "8.0.0-rc.10-dev.83",
|
|
60
60
|
"@types/node": "^22.19.19",
|
|
61
61
|
"tsdown": "^0.21.10",
|
|
62
62
|
"tsx": "^4.22.4",
|