@customyai/cli 0.6.0 → 0.7.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @customyai/cli
2
2
 
3
+ ## 0.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Environment discovery without hand-written ids: `createCustomy` resolves the Access URL, the Workspace environment and the project from `CUSTOMY_ACCESS_URL` (falls back to `CUSTOMY_ISSUER`), `CUSTOMY_WORKSPACE_ENVIRONMENT_ID` and `CUSTOMY_PROJECT_ID` (explicit option, then variable, then what `discoverApplication` found), `issuer` is now optional, and `customy.apps` fills `organizationId`, `projectId` and `accessEnvironmentId` the same way. `readCustomyEnvironment` is exported. Typed capability values: `customy apps codegen` also writes `CustomyCapabilityValues` (and `capabilityValues` in `CustomyAppTypes`), and `typedCapability` narrows the `value` of a check; existing code keeps compiling. `createFakeAccess` simulates sessions (`sessions.create/get/revoke`) and discovery (`application()`, `environment()`).
8
+
3
9
  ## 0.6.0
4
10
 
5
11
  ### Minor Changes
package/dist/bin.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunk6S5U7ZKO_cjs = require('./chunk-6S5U7ZKO.cjs');
4
+ var chunk6KGKN5HN_cjs = require('./chunk-6KGKN5HN.cjs');
5
5
  var promises = require('readline/promises');
6
6
 
7
7
  async function prompt(question) {
@@ -12,7 +12,7 @@ async function prompt(question) {
12
12
  rl.close();
13
13
  }
14
14
  }
15
- chunk6S5U7ZKO_cjs.runCli(process.argv.slice(2), {
15
+ chunk6KGKN5HN_cjs.runCli(process.argv.slice(2), {
16
16
  cwd: process.cwd(),
17
17
  env: process.env,
18
18
  out: (line) => console.log(line),
package/dist/bin.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { runCli } from './chunk-L2FCAP2K.mjs';
2
+ import { runCli } from './chunk-KDUW3KTG.mjs';
3
3
  import { createInterface } from 'readline/promises';
4
4
 
5
5
  async function prompt(question) {
@@ -57,6 +57,11 @@ function generateAppTypes(manifest) {
57
57
  "};",
58
58
  "",
59
59
  `export type CustomyCapability = ${union(manifest.capabilities.map((capability) => capability.lookupKey))};`,
60
+ "",
61
+ "/** Valor que devuelve cada capability: `boolean`, `number` (medida) o `unknown` (configuraci\xF3n). */",
62
+ `export type CustomyCapabilityValues = {
63
+ ${manifest.capabilities.map((capability) => ` ${literal(capability.lookupKey)}: ${capability.type === "boolean" ? "boolean" : capability.type === "metered" ? "number" : "unknown"};`).join("\n")}
64
+ };`,
60
65
  `export type CustomyPlan = ${union(manifest.plans.map((plan2) => plan2.code))};`,
61
66
  `export type CustomyMeter = ${union(manifest.meters.map((meter) => meter.code))};`,
62
67
  "",
@@ -74,6 +79,7 @@ ${roles.map((role) => ` ${literal(role.key)}: ${literal(role.permissions)},`).j
74
79
  " events: CustomyEventProperties;",
75
80
  " meters: CustomyMeter;",
76
81
  " capabilities: CustomyCapability;",
82
+ " capabilityValues: CustomyCapabilityValues;",
77
83
  " roles: CustomyRole;",
78
84
  " permissions: CustomyPermission;",
79
85
  "};",
@@ -51,6 +51,11 @@ function generateAppTypes(manifest) {
51
51
  "};",
52
52
  "",
53
53
  `export type CustomyCapability = ${union(manifest.capabilities.map((capability) => capability.lookupKey))};`,
54
+ "",
55
+ "/** Valor que devuelve cada capability: `boolean`, `number` (medida) o `unknown` (configuraci\xF3n). */",
56
+ `export type CustomyCapabilityValues = {
57
+ ${manifest.capabilities.map((capability) => ` ${literal(capability.lookupKey)}: ${capability.type === "boolean" ? "boolean" : capability.type === "metered" ? "number" : "unknown"};`).join("\n")}
58
+ };`,
54
59
  `export type CustomyPlan = ${union(manifest.plans.map((plan2) => plan2.code))};`,
55
60
  `export type CustomyMeter = ${union(manifest.meters.map((meter) => meter.code))};`,
56
61
  "",
@@ -68,6 +73,7 @@ ${roles.map((role) => ` ${literal(role.key)}: ${literal(role.permissions)},`).j
68
73
  " events: CustomyEventProperties;",
69
74
  " meters: CustomyMeter;",
70
75
  " capabilities: CustomyCapability;",
76
+ " capabilityValues: CustomyCapabilityValues;",
71
77
  " roles: CustomyRole;",
72
78
  " permissions: CustomyPermission;",
73
79
  "};",
package/dist/index.cjs CHANGED
@@ -1,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunk6S5U7ZKO_cjs = require('./chunk-6S5U7ZKO.cjs');
3
+ var chunk6KGKN5HN_cjs = require('./chunk-6KGKN5HN.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "EXPERIMENTS_EXIT_CODES", {
8
8
  enumerable: true,
9
- get: function () { return chunk6S5U7ZKO_cjs.EXPERIMENTS_EXIT; }
9
+ get: function () { return chunk6KGKN5HN_cjs.EXPERIMENTS_EXIT; }
10
10
  });
11
11
  Object.defineProperty(exports, "PROVISIONING_EXIT_CODES", {
12
12
  enumerable: true,
13
- get: function () { return chunk6S5U7ZKO_cjs.EXIT; }
13
+ get: function () { return chunk6KGKN5HN_cjs.EXIT; }
14
14
  });
15
15
  Object.defineProperty(exports, "SyncError", {
16
16
  enumerable: true,
17
- get: function () { return chunk6S5U7ZKO_cjs.SyncError; }
17
+ get: function () { return chunk6KGKN5HN_cjs.SyncError; }
18
18
  });
19
19
  Object.defineProperty(exports, "generateAppTypes", {
20
20
  enumerable: true,
21
- get: function () { return chunk6S5U7ZKO_cjs.generateAppTypes; }
21
+ get: function () { return chunk6KGKN5HN_cjs.generateAppTypes; }
22
22
  });
23
23
  Object.defineProperty(exports, "runCli", {
24
24
  enumerable: true,
25
- get: function () { return chunk6S5U7ZKO_cjs.runCli; }
25
+ get: function () { return chunk6KGKN5HN_cjs.runCli; }
26
26
  });
27
27
  Object.defineProperty(exports, "runExperimentsCli", {
28
28
  enumerable: true,
29
- get: function () { return chunk6S5U7ZKO_cjs.runExperimentsCli; }
29
+ get: function () { return chunk6KGKN5HN_cjs.runExperimentsCli; }
30
30
  });
31
31
  Object.defineProperty(exports, "runProvisioningCli", {
32
32
  enumerable: true,
33
- get: function () { return chunk6S5U7ZKO_cjs.runProvisioningCli; }
33
+ get: function () { return chunk6KGKN5HN_cjs.runProvisioningCli; }
34
34
  });
35
35
  Object.defineProperty(exports, "schemaToType", {
36
36
  enumerable: true,
37
- get: function () { return chunk6S5U7ZKO_cjs.schemaToType; }
37
+ get: function () { return chunk6KGKN5HN_cjs.schemaToType; }
38
38
  });
39
39
  Object.defineProperty(exports, "syncApp", {
40
40
  enumerable: true,
41
- get: function () { return chunk6S5U7ZKO_cjs.syncApp; }
41
+ get: function () { return chunk6KGKN5HN_cjs.syncApp; }
42
42
  });
43
43
  Object.defineProperty(exports, "validateManifest", {
44
44
  enumerable: true,
45
- get: function () { return chunk6S5U7ZKO_cjs.validateManifest; }
45
+ get: function () { return chunk6KGKN5HN_cjs.validateManifest; }
46
46
  });
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { EXPERIMENTS_EXIT as EXPERIMENTS_EXIT_CODES, EXIT as PROVISIONING_EXIT_CODES, SyncError, generateAppTypes, runCli, runExperimentsCli, runProvisioningCli, schemaToType, syncApp, validateManifest } from './chunk-L2FCAP2K.mjs';
1
+ export { EXPERIMENTS_EXIT as EXPERIMENTS_EXIT_CODES, EXIT as PROVISIONING_EXIT_CODES, SyncError, generateAppTypes, runCli, runExperimentsCli, runProvisioningCli, schemaToType, syncApp, validateManifest } from './chunk-KDUW3KTG.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@customyai/cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Customy CLI: validate, type and sync customy.app.json (customy apps ...) and provision TEST users (customy users | audit | policy | whoami). Also usable as a library.",
5
5
  "license": "MIT",
6
6
  "author": "Customy <hello@customy.ai>",