@elevasis/sdk 0.5.4 → 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
@@ -43695,15 +43695,23 @@ var esbuild = __toESM(require("esbuild"), 1);
43695
43695
  // src/cli/config.ts
43696
43696
  var DEV_API_URL = "http://localhost:5170";
43697
43697
  var PROD_API_URL = "https://api.elevasis.io";
43698
- function resolveApiUrl(cliOverride) {
43698
+ function resolveApiUrl(cliOverride, prod) {
43699
43699
  if (cliOverride) return cliOverride;
43700
+ if (prod) return PROD_API_URL;
43700
43701
  if (process.env.ELEVASIS_API_URL) return process.env.ELEVASIS_API_URL;
43701
43702
  if (process.env.NODE_ENV === "development") return DEV_API_URL;
43702
43703
  return PROD_API_URL;
43703
43704
  }
43704
- function resolveEnvironment() {
43705
+ function resolveEnvironment(prod) {
43706
+ if (prod) return "production";
43705
43707
  return process.env.NODE_ENV === "development" ? "development" : "production";
43706
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
+ }
43707
43715
 
43708
43716
  // src/cli/api-client.ts
43709
43717
  function getApiKey() {
@@ -43785,7 +43793,7 @@ async function apiDelete(endpoint, apiUrl = resolveApiUrl()) {
43785
43793
  // package.json
43786
43794
  var package_default = {
43787
43795
  name: "@elevasis/sdk",
43788
- version: "0.5.4",
43796
+ version: "0.5.6",
43789
43797
  description: "SDK for building Elevasis organization resources",
43790
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.",
43791
43799
  type: "module",
@@ -44304,10 +44312,10 @@ async function generateProjectMap(org) {
44304
44312
  await (0, import_promises.writeFile)((0, import_path.resolve)("docs/project-map.mdx"), lines.join("\n"), "utf-8");
44305
44313
  }
44306
44314
  function registerDeployCommand(program3) {
44307
- program3.command("deploy").description("Validate, bundle, upload, and deploy project resources\n Example: elevasis deploy --api-url http://localhost:5170").option("--api-url <url>", "API URL").option("--entry <path>", "Path to entry file (default: ./src/index.ts)").action(wrapAction("deploy", async (options2) => {
44315
+ program3.command("deploy").description("Validate, bundle, upload, and deploy project resources\n Example: elevasis deploy --api-url http://localhost:5170").option("--api-url <url>", "API URL").option("--entry <path>", "Path to entry file (default: ./src/index.ts)").option("--prod", "Deploy to production (overrides NODE_ENV=development)").action(wrapAction("deploy", async (options2) => {
44308
44316
  const startTime = Date.now();
44309
- const apiUrl = resolveApiUrl(options2.apiUrl);
44310
- const env2 = resolveEnvironment();
44317
+ const apiUrl = resolveApiUrl(options2.apiUrl, options2.prod);
44318
+ const env2 = resolveEnvironment(options2.prod);
44311
44319
  const entryPath = options2.entry ?? "./src/index.ts";
44312
44320
  const authSpinner = ora("Authenticating...").start();
44313
44321
  let orgName;
@@ -44321,11 +44329,12 @@ function registerDeployCommand(program3) {
44321
44329
  authSpinner.fail(source_default.red("Authentication failed"));
44322
44330
  const errMsg = error46 instanceof Error ? error46.message : String(error46);
44323
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";
44324
44333
  console.error(source_default.red(" Invalid API key."));
44325
- 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.`));
44326
44335
  console.error(source_default.gray(" Check your .env file and verify the key in the Elevasis dashboard."));
44327
44336
  } else {
44328
- 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."));
44329
44338
  }
44330
44339
  throw error46;
44331
44340
  }
@@ -44480,12 +44489,16 @@ startWorker(org)
44480
44489
  const uploadSpinner = ora("Uploading...").start();
44481
44490
  try {
44482
44491
  const bundleBuffer = await (0, import_promises.readFile)(bundleOutfile);
44483
- const apiKey = process.env.ELEVASIS_API_KEY;
44492
+ const apiKey = resolveApiKey(options2.prod);
44484
44493
  if (!apiKey) {
44485
- uploadSpinner.fail(source_default.red("Missing ELEVASIS_API_KEY environment variable"));
44494
+ uploadSpinner.fail(source_default.red("Missing API key environment variable"));
44486
44495
  console.error(source_default.gray(" Set it in your .env file or shell environment:"));
44487
- console.error(source_default.gray(" ELEVASIS_API_KEY=sk_..."));
44488
- 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");
44489
44502
  }
44490
44503
  const metadata = {
44491
44504
  sdkVersion: SDK_VERSION,
@@ -45440,6 +45453,19 @@ proactivity -- to their assessed levels.
45440
45453
 
45441
45454
  All \`reference/\` paths resolve to \`node_modules/@elevasis/sdk/reference/\`.
45442
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
+
45443
45469
  ## Rules
45444
45470
 
45445
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.4",
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",
@@ -131,6 +131,7 @@ elevasis deploy
131
131
  | Flag | Description |
132
132
  | ---- | ----------- |
133
133
  | `--api-url <url>` | Override the API base URL (default: production) |
134
+ | `--prod` | Force production target, overriding `NODE_ENV=development` (internal use) |
134
135
 
135
136
  **Environment variables:**
136
137
 
@@ -491,7 +492,8 @@ These flags are accepted by all commands:
491
492
  - Production (default): `https://api.elevasis.io`
492
493
  - Development (`NODE_ENV=development`): `http://localhost:<port>`
493
494
  - Override: set `ELEVASIS_API_URL` or pass `--api-url`
495
+ - Force production: pass `--prod` on `deploy` (overrides `NODE_ENV=development`)
494
496
 
495
497
  ---
496
498
 
497
- **Last Updated:** 2026-02-25
499
+ **Last Updated:** 2026-03-03