@elevasis/sdk 1.36.3 → 1.36.4

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.
Files changed (2) hide show
  1. package/dist/cli.cjs +45 -1
  2. package/package.json +4 -4
package/dist/cli.cjs CHANGED
@@ -45808,7 +45808,7 @@ function wrapAction(commandName, fn) {
45808
45808
  // package.json
45809
45809
  var package_default = {
45810
45810
  name: "@elevasis/sdk",
45811
- version: "1.36.3",
45811
+ version: "1.36.4",
45812
45812
  description: "SDK for building Elevasis organization resources",
45813
45813
  type: "module",
45814
45814
  bin: {
@@ -52369,6 +52369,49 @@ function registerGrantCreate(program3) {
52369
52369
  })
52370
52370
  );
52371
52371
  }
52372
+ function registerGrantUpdate(program3) {
52373
+ program3.command("grant:update <slug>").description("Update mutable fields on an existing agent access grant (branding, limits, mode, origins)").option("--mode <mode>", "Access mode: public | code").option("--code <code>", "Access code; required when switching --mode code without an existing code").option("--origins <origins>", "Comma-separated allowed origins (replaces existing)").option("--expires-at <iso>", "ISO timestamp when the grant expires").option("--max-turns <number>", "Maximum turns per public session").option("--max-sessions <number>", "Maximum sessions per visitor").option("--branding <json>", "Branding metadata JSON object (full replace)").option("--capture-fields <json>", "Capture fields JSON array (full replace)").option("--tool-policy <json>", "Tool policy JSON object (full replace)").option("--public-base-url <url>", "Client public app base URL for printed public URL").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
52374
+ wrapAction("grant:update", async (slug, options) => {
52375
+ const body = {};
52376
+ if (options.mode !== void 0) {
52377
+ if (options.mode !== "public" && options.mode !== "code") {
52378
+ throw new Error("--mode must be public or code");
52379
+ }
52380
+ body.mode = options.mode;
52381
+ }
52382
+ if (options.code) body.code = options.code;
52383
+ if (options.expiresAt) body.expiresAt = options.expiresAt;
52384
+ const allowedOrigins = parseOrigins(options.origins);
52385
+ if (allowedOrigins) body.allowedOrigins = allowedOrigins;
52386
+ const maxTurns = parsePositiveInt(options.maxTurns, "--max-turns");
52387
+ if (maxTurns !== void 0) body.maxTurnsPerSession = maxTurns;
52388
+ const maxSessions = parsePositiveInt(options.maxSessions, "--max-sessions");
52389
+ if (maxSessions !== void 0) body.maxSessionsPerVisitor = maxSessions;
52390
+ const branding = parseJson2(options.branding, "--branding");
52391
+ if (branding !== void 0) body.branding = branding;
52392
+ const captureFields = parseJson2(options.captureFields, "--capture-fields");
52393
+ if (captureFields !== void 0) body.captureFields = captureFields;
52394
+ const toolPolicy = parseJson2(options.toolPolicy, "--tool-policy");
52395
+ if (toolPolicy !== void 0) body.toolPolicy = toolPolicy;
52396
+ if (Object.keys(body).length === 0) {
52397
+ throw new Error("Provide at least one field to update (e.g. --branding, --mode, --max-turns)");
52398
+ }
52399
+ const apiUrl = resolveApiUrl(options.apiUrl);
52400
+ const result = await apiPatch(
52401
+ `/api/external/agent-access-grants/${encodeURIComponent(slug)}`,
52402
+ body,
52403
+ apiUrl
52404
+ );
52405
+ if (options.json) {
52406
+ printJson8(result.grant);
52407
+ return;
52408
+ }
52409
+ console.log(source_default.green(`Updated agent access grant ${result.grant.slug}.`));
52410
+ console.log(source_default.gray(` Public URL: ${resolvePublicUrl(result.grant.slug, options.publicBaseUrl)}`));
52411
+ printGrant(result.grant);
52412
+ })
52413
+ );
52414
+ }
52372
52415
  function registerGrantDisable(program3) {
52373
52416
  program3.command("grant:disable <slug>").description("Disable an agent access grant without deleting it").option("--api-url <url>", "API base URL").option("--json", "Output as JSON").action(
52374
52417
  wrapAction("grant:disable", async (slug, options) => {
@@ -52391,6 +52434,7 @@ function registerGrantDisable(program3) {
52391
52434
  function registerGrantCommands(program3) {
52392
52435
  registerGrantList(program3);
52393
52436
  registerGrantCreate(program3);
52437
+ registerGrantUpdate(program3);
52394
52438
  registerGrantDisable(program3);
52395
52439
  }
52396
52440
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elevasis/sdk",
3
- "version": "1.36.3",
3
+ "version": "1.36.4",
4
4
  "description": "SDK for building Elevasis organization resources",
5
5
  "type": "module",
6
6
  "bin": {
@@ -58,9 +58,9 @@
58
58
  "tsup": "^8.0.0",
59
59
  "typescript": "5.9.2",
60
60
  "zod": "^4.1.0",
61
- "@repo/core": "0.49.1",
62
- "@repo/typescript-config": "0.0.0",
63
- "@repo/eslint-config": "0.0.0"
61
+ "@repo/core": "0.50.0",
62
+ "@repo/eslint-config": "0.0.0",
63
+ "@repo/typescript-config": "0.0.0"
64
64
  },
65
65
  "scripts": {
66
66
  "lint": "eslint src --max-warnings 0",