@prisma/composer-prisma-cloud 0.16.0-dev.1 → 0.16.0-dev.3

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/control.mjs CHANGED
@@ -1811,10 +1811,15 @@ async function fillMissing(client, projectId, branchId, key, value) {
1811
1811
  const tokenRequiredError = () => /* @__PURE__ */ new Error("environment variable PRISMA_SERVICE_TOKEN is required for deploy preflight.");
1812
1812
  const listFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: Prisma Management API error listing "${key}": ${JSON.stringify(error)}.`);
1813
1813
  const fillFailedError = (key, error) => /* @__PURE__ */ new Error(`deploy preflight: failed to provision "${key}" from the deploy shell: ${JSON.stringify(error)}.`);
1814
- function missingError(missing, branchId, stage) {
1815
- const scope = branchId === void 0 ? "the production class (project-level template)" : `the preview class of stage "${stage ?? branchId}" (branch override or template)`;
1816
- const lines = missing.map((m) => ` - ${m.name} (required by service "${m.serviceAddress}")`);
1817
- return /* @__PURE__ */ new Error(`Deploy preflight failed ${missing.length} env var(s) (secret or env-sourced param) are not provisioned on Prisma Cloud for ${scope}, and are absent from the deploy shell:\n${lines.join("\n")}\n\nSet each in the deploy shell environment (the CLI will provision it on deploy), or create it on the platform (Prisma Console or the Management API) in ${scope}.`);
1814
+ function missingError(missing, projectId, branchId, stage) {
1815
+ const lines = missing.map((m) => ` - ${m.name} (used by service "${m.serviceAddress}")`);
1816
+ const countPhrase = missing.length === 1 ? "1 required setting has" : `${missing.length} required settings have`;
1817
+ const scopeFlag = branchId === void 0 ? "--role production" : `--branch "${stage ?? branchId}"`;
1818
+ const commands = missing.map((m) => `prisma project env add ${m.name}="<value>" --project ${projectId} ${scopeFlag}`);
1819
+ const runStep = commands.length === 1 ? `Run: ${commands[0]}` : `Run, once per setting:\n${commands.map((cmd) => ` ${cmd}`).join("\n")}`;
1820
+ const consoleStep = branchId === void 0 ? "add each one under Production. Those values apply when the default branch deploys to production." : `add each one under Preview. Preview values apply to every branch deploy, including "${stage ?? branchId}".`;
1821
+ return /* @__PURE__ */ new Error(`Deploy failed. ${countPhrase} no value:\n${lines.join("\n")}\n\nSet the value in one of these two places, then deploy again:
1822
+ - ${runStep}\n - Or in the Prisma Console: open the project, go to Environment variables, and ${consoleStep}`);
1818
1823
  }
1819
1824
  async function managementClient() {
1820
1825
  if ((process.env["PRISMA_SERVICE_TOKEN"] ?? "").length === 0) throw tokenRequiredError();
@@ -1856,7 +1861,7 @@ async function runPreflight(input, deps) {
1856
1861
  }
1857
1862
  missing.push(meta);
1858
1863
  }
1859
- if (missing.length > 0) throw missingError(missing, branchId, input.stage);
1864
+ if (missing.length > 0) throw missingError(missing, projectId, branchId, input.stage);
1860
1865
  return updatedAt;
1861
1866
  }
1862
1867
  /**