@elevasis/sdk 0.5.5 → 0.5.6

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.cjs CHANGED
@@ -43706,6 +43706,12 @@ function resolveEnvironment(prod) {
43706
43706
  if (prod) return "production";
43707
43707
  return process.env.NODE_ENV === "development" ? "development" : "production";
43708
43708
  }
43709
+ function resolveApiKey(prod) {
43710
+ if (!prod && process.env.NODE_ENV === "development") {
43711
+ return process.env.ELEVASIS_API_KEY_DEV ?? process.env.ELEVASIS_API_KEY ?? "";
43712
+ }
43713
+ return process.env.ELEVASIS_API_KEY ?? "";
43714
+ }
43709
43715
 
43710
43716
  // src/cli/api-client.ts
43711
43717
  function getApiKey() {
@@ -43787,7 +43793,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
43787
43793
  // package.json
43788
43794
  var package_default = {
43789
43795
  name: "@elevasis/sdk",
43790
- version: "0.5.5",
43796
+ version: "0.5.6",
43791
43797
  description: "SDK for building Elevasis organization resources",
43792
43798
  "comment:bin": "IMPORTANT: This package shares the 'elevasis' binary name with @repo/cli. They never conflict because @elevasis/sdk must NEVER be added as a dependency of any workspace package (apps/*, packages/*, organizations/*). Workspace projects use @repo/cli for the 'elevasis' binary. External developers (outside the workspace) get this SDK's binary via npm install.",
43793
43799
  type: "module",
@@ -44323,11 +44329,12 @@ function registerDeployCommand(program3) {
44323
44329
  authSpinner.fail(source_default.red("Authentication failed"));
44324
44330
  const errMsg = error46 instanceof Error ? error46.message : String(error46);
44325
44331
  if (errMsg.includes("401") || errMsg.toLowerCase().includes("unauthorized")) {
44332
+ const keyVar = !options2.prod && process.env.NODE_ENV === "development" && process.env.ELEVASIS_API_KEY_DEV ? "ELEVASIS_API_KEY_DEV" : "ELEVASIS_API_KEY";
44326
44333
  console.error(source_default.red(" Invalid API key."));
44327
- console.error(source_default.gray(" Your ELEVASIS_API_KEY was rejected by the server."));
44334
+ console.error(source_default.gray(` Your ${keyVar} was rejected by the server.`));
44328
44335
  console.error(source_default.gray(" Check your .env file and verify the key in the Elevasis dashboard."));
44329
44336
  } else {
44330
- console.error(source_default.gray(" Check your ELEVASIS_API_KEY and API URL."));
44337
+ console.error(source_default.gray(" Check your API key and API URL."));
44331
44338
  }
44332
44339
  throw error46;
44333
44340
  }
@@ -44482,12 +44489,16 @@ startWorker(org)
44482
44489
  const uploadSpinner = ora("Uploading...").start();
44483
44490
  try {
44484
44491
  const bundleBuffer = await (0, import_promises.readFile)(bundleOutfile);
44485
- const apiKey = process.env.ELEVASIS_API_KEY;
44492
+ const apiKey = resolveApiKey(options2.prod);
44486
44493
  if (!apiKey) {
44487
- uploadSpinner.fail(source_default.red("Missing ELEVASIS_API_KEY environment variable"));
44494
+ uploadSpinner.fail(source_default.red("Missing API key environment variable"));
44488
44495
  console.error(source_default.gray(" Set it in your .env file or shell environment:"));
44489
- console.error(source_default.gray(" ELEVASIS_API_KEY=sk_..."));
44490
- throw new Error("Missing ELEVASIS_API_KEY environment variable");
44496
+ if (!options2.prod && process.env.NODE_ENV === "development") {
44497
+ console.error(source_default.gray(" ELEVASIS_API_KEY_DEV=sk_... (or ELEVASIS_API_KEY as fallback)"));
44498
+ } else {
44499
+ console.error(source_default.gray(" ELEVASIS_API_KEY=sk_..."));
44500
+ }
44501
+ throw new Error("Missing API key environment variable");
44491
44502
  }
44492
44503
  const metadata = {
44493
44504
  sdkVersion: SDK_VERSION,
@@ -45442,6 +45453,19 @@ proactivity -- to their assessed levels.
45442
45453
 
45443
45454
  All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
45444
45455
 
45456
+ ## Elevasis CLI
45457
+
45458
+ **MANDATORY:** Use the \`elevasis\` CLI for all operations -- never \`npx\`, \`curl\`, or any other tool.
45459
+
45460
+ - \`elevasis exec <resource-id> --input '{...}'\` -- run a resource synchronously
45461
+ - \`elevasis exec <resource-id> --input '{...}' --async\` -- run async, returns execution ID
45462
+ - \`elevasis execution <resource-id> <execution-id>\` -- inspect execution detail
45463
+ - \`elevasis check\` -- validate resource definitions without deploying
45464
+ - \`elevasis deploy\` -- deploy to the platform
45465
+
45466
+ Organization is derived from your API key -- no org prefix needed in the resource ID.
45467
+ For full CLI reference: \`reference/cli/index.mdx\`
45468
+
45445
45469
  ## Rules
45446
45470
 
45447
45471
  SDK patterns (imports, source structure, platform tools) are auto-loaded from
package/dist/templates.js CHANGED
@@ -244,6 +244,19 @@ proactivity -- to their assessed levels.
244
244
 
245
245
  All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
246
246
 
247
+ ## Elevasis CLI
248
+
249
+ **MANDATORY:** Use the \`elevasis\` CLI for all operations -- never \`npx\`, \`curl\`, or any other tool.
250
+
251
+ - \`elevasis exec <resource-id> --input '{...}'\` -- run a resource synchronously
252
+ - \`elevasis exec <resource-id> --input '{...}' --async\` -- run async, returns execution ID
253
+ - \`elevasis execution <resource-id> <execution-id>\` -- inspect execution detail
254
+ - \`elevasis check\` -- validate resource definitions without deploying
255
+ - \`elevasis deploy\` -- deploy to the platform
256
+
257
+ Organization is derived from your API key -- no org prefix needed in the resource ID.
258
+ For full CLI reference: \`reference/cli/index.mdx\`
259
+
247
260
  ## Rules
248
261
 
249
262
  SDK patterns (imports, source structure, platform tools) are auto-loaded from
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "0.5.5",
3
+ "version": "0.5.6",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "comment:bin": "IMPORTANT: This package shares the 'elevasis' binary name with @repo/cli. They never conflict because @elevasis/sdk must NEVER be added as a dependency of any workspace package (apps/*, packages/*, organizations/*). Workspace projects use @repo/cli for the 'elevasis' binary. External developers (outside the workspace) get this SDK's binary via npm install.",
6
6
  "type": "module",