@customyai/cli 0.7.0 → 0.7.2

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,20 @@
1
1
  # @customyai/cli
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Los comandos de Experiments (`flags`, `segments`, `experiments`) se niegan, antes de enviar el Bearer, a un origen que no sea `https://` (`http://` solo hacia `localhost`, `127.0.0.1` o `[::1]`) (P-B8).
8
+ `customy audit export --out` escribe el archivo con permisos 0600 (solo el dueño), también si ya existía con otros permisos (P-B9): la auditoría nombra personas y acciones.
9
+
10
+ ## 0.7.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Licence: this package is now distributed under a proprietary licence (all rights reserved). Use requires a written agreement with Customy. Earlier versions keep the licence they were published with (MIT).
15
+ - Dependencias actualizadas:
16
+ - @customyai/provisioning@0.1.2
17
+
3
18
  ## 0.7.0
4
19
 
5
20
  ### Minor Changes
package/LICENSE CHANGED
@@ -1,21 +1,7 @@
1
- MIT License
1
+ Copyright (c) 2026 Customy. All rights reserved.
2
2
 
3
- Copyright (c) 2026 Customy
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
3
+ This software is proprietary. It is distributed so that Customy products and
4
+ parties that hold a written agreement with Customy can install it. Its
5
+ availability on any package registry or source repository grants no licence to
6
+ use, copy, modify, merge, publish, distribute, sublicense or sell it. Any use
7
+ outside such an agreement is prohibited.
package/dist/bin.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  'use strict';
3
3
 
4
- var chunk6KGKN5HN_cjs = require('./chunk-6KGKN5HN.cjs');
4
+ var chunkTSPERSQL_cjs = require('./chunk-TSPERSQL.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
- chunk6KGKN5HN_cjs.runCli(process.argv.slice(2), {
15
+ chunkTSPERSQL_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-KDUW3KTG.mjs';
2
+ import { runCli } from './chunk-762M6SBX.mjs';
3
3
  import { createInterface } from 'readline/promises';
4
4
 
5
5
  async function prompt(question) {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- import { mkdir, writeFile, readFile } from 'fs/promises';
2
+ import { mkdir, writeFile, chmod, readFile } from 'fs/promises';
3
3
  import path3 from 'path';
4
4
  import { CustomyProvisioningError, CustomyScopeError, CustomyEnvironmentMismatchError, CustomyConflictError, CustomyRateLimitError, CustomyAuthError, createProvisioning } from '@customyai/provisioning';
5
5
 
@@ -731,7 +731,9 @@ async function audit(args, io) {
731
731
  const text = await liveClient(ctx).audit.export({ format, ...pick(flags) });
732
732
  const out = str(flags, "out");
733
733
  if (out) {
734
- await writeFile(path3.resolve(io.cwd, out), text);
734
+ const target = path3.resolve(io.cwd, out);
735
+ await writeFile(target, text, { mode: 384 });
736
+ await chmod(target, 384).catch(() => void 0);
735
737
  emit(ctx, { out, bytes: text.length, format }, [`wrote ${text.length} characters of ${format} to ${out}`]);
736
738
  } else io.out(text.replace(/\n$/, ""));
737
739
  return EXIT.ok;
@@ -970,6 +972,9 @@ async function runExperimentsCli(group, args, io) {
970
972
  const call = await plan(group, args, io);
971
973
  const base = (typeof flags["base-url"] === "string" ? flags["base-url"] : io.env.CUSTOMY_EXPERIMENTS_URL)?.replace(/\/$/, "");
972
974
  if (!base) throw new UsageError2("falta el origen: --base-url o CUSTOMY_EXPERIMENTS_URL");
975
+ if (!/^https:\/\//i.test(base) && !/^http:\/\/(localhost|127\.0\.0\.1|\[::1\])(:\d+)?(\/|$)/i.test(base)) {
976
+ throw new UsageError2("el origen de Experiments debe ser https:// (http:// solo hacia localhost): el token viajar\xEDa en claro");
977
+ }
973
978
  const query = call.query && Object.keys(call.query).length ? `?${new URLSearchParams(call.query)}` : "";
974
979
  const url = `${base}/v1/experiments${call.path}${query}`;
975
980
  if (call.write && flags["dry-run"]) {
@@ -737,7 +737,9 @@ async function audit(args, io) {
737
737
  const text = await liveClient(ctx).audit.export({ format, ...pick(flags) });
738
738
  const out = str(flags, "out");
739
739
  if (out) {
740
- await promises.writeFile(path3__default.default.resolve(io.cwd, out), text);
740
+ const target = path3__default.default.resolve(io.cwd, out);
741
+ await promises.writeFile(target, text, { mode: 384 });
742
+ await promises.chmod(target, 384).catch(() => void 0);
741
743
  emit(ctx, { out, bytes: text.length, format }, [`wrote ${text.length} characters of ${format} to ${out}`]);
742
744
  } else io.out(text.replace(/\n$/, ""));
743
745
  return EXIT.ok;
@@ -976,6 +978,9 @@ async function runExperimentsCli(group, args, io) {
976
978
  const call = await plan(group, args, io);
977
979
  const base = (typeof flags["base-url"] === "string" ? flags["base-url"] : io.env.CUSTOMY_EXPERIMENTS_URL)?.replace(/\/$/, "");
978
980
  if (!base) throw new UsageError2("falta el origen: --base-url o CUSTOMY_EXPERIMENTS_URL");
981
+ if (!/^https:\/\//i.test(base) && !/^http:\/\/(localhost|127\.0\.0\.1|\[::1\])(:\d+)?(\/|$)/i.test(base)) {
982
+ throw new UsageError2("el origen de Experiments debe ser https:// (http:// solo hacia localhost): el token viajar\xEDa en claro");
983
+ }
979
984
  const query = call.query && Object.keys(call.query).length ? `?${new URLSearchParams(call.query)}` : "";
980
985
  const url = `${base}/v1/experiments${call.path}${query}`;
981
986
  if (call.write && flags["dry-run"]) {
package/dist/index.cjs CHANGED
@@ -1,46 +1,46 @@
1
1
  'use strict';
2
2
 
3
- var chunk6KGKN5HN_cjs = require('./chunk-6KGKN5HN.cjs');
3
+ var chunkTSPERSQL_cjs = require('./chunk-TSPERSQL.cjs');
4
4
 
5
5
 
6
6
 
7
7
  Object.defineProperty(exports, "EXPERIMENTS_EXIT_CODES", {
8
8
  enumerable: true,
9
- get: function () { return chunk6KGKN5HN_cjs.EXPERIMENTS_EXIT; }
9
+ get: function () { return chunkTSPERSQL_cjs.EXPERIMENTS_EXIT; }
10
10
  });
11
11
  Object.defineProperty(exports, "PROVISIONING_EXIT_CODES", {
12
12
  enumerable: true,
13
- get: function () { return chunk6KGKN5HN_cjs.EXIT; }
13
+ get: function () { return chunkTSPERSQL_cjs.EXIT; }
14
14
  });
15
15
  Object.defineProperty(exports, "SyncError", {
16
16
  enumerable: true,
17
- get: function () { return chunk6KGKN5HN_cjs.SyncError; }
17
+ get: function () { return chunkTSPERSQL_cjs.SyncError; }
18
18
  });
19
19
  Object.defineProperty(exports, "generateAppTypes", {
20
20
  enumerable: true,
21
- get: function () { return chunk6KGKN5HN_cjs.generateAppTypes; }
21
+ get: function () { return chunkTSPERSQL_cjs.generateAppTypes; }
22
22
  });
23
23
  Object.defineProperty(exports, "runCli", {
24
24
  enumerable: true,
25
- get: function () { return chunk6KGKN5HN_cjs.runCli; }
25
+ get: function () { return chunkTSPERSQL_cjs.runCli; }
26
26
  });
27
27
  Object.defineProperty(exports, "runExperimentsCli", {
28
28
  enumerable: true,
29
- get: function () { return chunk6KGKN5HN_cjs.runExperimentsCli; }
29
+ get: function () { return chunkTSPERSQL_cjs.runExperimentsCli; }
30
30
  });
31
31
  Object.defineProperty(exports, "runProvisioningCli", {
32
32
  enumerable: true,
33
- get: function () { return chunk6KGKN5HN_cjs.runProvisioningCli; }
33
+ get: function () { return chunkTSPERSQL_cjs.runProvisioningCli; }
34
34
  });
35
35
  Object.defineProperty(exports, "schemaToType", {
36
36
  enumerable: true,
37
- get: function () { return chunk6KGKN5HN_cjs.schemaToType; }
37
+ get: function () { return chunkTSPERSQL_cjs.schemaToType; }
38
38
  });
39
39
  Object.defineProperty(exports, "syncApp", {
40
40
  enumerable: true,
41
- get: function () { return chunk6KGKN5HN_cjs.syncApp; }
41
+ get: function () { return chunkTSPERSQL_cjs.syncApp; }
42
42
  });
43
43
  Object.defineProperty(exports, "validateManifest", {
44
44
  enumerable: true,
45
- get: function () { return chunk6KGKN5HN_cjs.validateManifest; }
45
+ get: function () { return chunkTSPERSQL_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-KDUW3KTG.mjs';
1
+ export { EXPERIMENTS_EXIT as EXPERIMENTS_EXIT_CODES, EXIT as PROVISIONING_EXIT_CODES, SyncError, generateAppTypes, runCli, runExperimentsCli, runProvisioningCli, schemaToType, syncApp, validateManifest } from './chunk-762M6SBX.mjs';
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@customyai/cli",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
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
- "license": "MIT",
5
+ "license": "UNLICENSED",
6
6
  "author": "Customy <hello@customy.ai>",
7
7
  "repository": {
8
8
  "type": "git",
@@ -56,7 +56,7 @@
56
56
  "test": "vitest run"
57
57
  },
58
58
  "dependencies": {
59
- "@customyai/provisioning": "^0.1.1",
59
+ "@customyai/provisioning": "^0.1.2",
60
60
  "zod": "^3.23.8"
61
61
  },
62
62
  "devDependencies": {