@workclaw/openclaw-workclaw 1.0.339 → 1.0.340

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 (73) hide show
  1. package/dist/_virtual/index10.js +2 -2
  2. package/dist/_virtual/index11.js +2 -2
  3. package/dist/_virtual/index12.js +2 -2
  4. package/dist/_virtual/index13.js +2 -2
  5. package/dist/_virtual/index14.js +2 -2
  6. package/dist/_virtual/index17.js +2 -2
  7. package/dist/_virtual/index18.js +2 -2
  8. package/dist/_virtual/index4.js +2 -2
  9. package/dist/_virtual/index5.js +2 -2
  10. package/dist/_virtual/index6.js +2 -2
  11. package/dist/_virtual/index7.js +2 -2
  12. package/dist/_virtual/index8.js +2 -2
  13. package/dist/_virtual/index9.js +2 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +23 -14
  16. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/index.js +2 -2
  17. package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.20.0/node_modules/ajv-formats/dist/limit.js +1 -1
  18. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js +8 -6
  19. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +1 -1
  20. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -1
  21. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +19 -17
  22. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -1
  23. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -1
  24. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +16 -22
  25. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +43 -49
  26. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +4 -3
  27. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +28 -34
  28. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +466 -467
  29. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +103 -109
  30. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +73 -79
  31. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +8 -6
  32. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +7 -16
  33. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -1
  34. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -1
  35. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -1
  36. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +1 -1
  37. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -1
  38. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
  39. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -1
  40. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -1
  41. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -1
  42. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -1
  43. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +3 -2
  44. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -1
  45. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -1
  46. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
  47. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +2 -2
  48. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +3 -3
  49. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js +4 -4
  50. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -1
  51. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
  52. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -1
  53. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -1
  54. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
  55. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -1
  56. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -1
  57. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -1
  58. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -1
  59. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -1
  60. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -1
  61. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -1
  62. package/dist/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -1
  63. package/dist/node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/index.js +1 -1
  64. package/dist/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +1 -1
  65. package/dist/node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/installed-plugin-index-store-C1Oen9wR.js +1 -1
  66. package/dist/node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/zod-schema.core-D7Y_eqdd.js +2 -2
  67. package/dist/node_modules/.pnpm/path-key@3.1.1/node_modules/path-key/index.js +1 -1
  68. package/dist/node_modules/.pnpm/signal-exit@3.0.7/node_modules/signal-exit/index.js +1 -1
  69. package/dist/packages/plugin/src/gateway/config-writer.js +1 -34
  70. package/dist/src/gateway/config-writer.d.ts.map +1 -1
  71. package/openclaw.plugin.json +7 -1
  72. package/package.json +1 -1
  73. package/dist/node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/config-schema-DBTUnI0T.js +0 -34
@@ -1,4 +1,4 @@
1
- var core = {};
1
+ var compile = {};
2
2
  export {
3
- core as __exports
3
+ compile as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var validation = {};
1
+ var core = {};
2
2
  export {
3
- validation as __exports
3
+ core as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var format = {};
1
+ var validation = {};
2
2
  export {
3
- format as __exports
3
+ validation as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var applicator = {};
1
+ var format = {};
2
2
  export {
3
- applicator as __exports
3
+ format as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var validate = {};
1
+ var applicator = {};
2
2
  export {
3
- validate as __exports
3
+ applicator as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var pathKey = { exports: {} };
1
+ var fastUri = { exports: {} };
2
2
  export {
3
- pathKey as __module
3
+ fastUri as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var fastUri = { exports: {} };
1
+ var pathKey = { exports: {} };
2
2
  export {
3
- fastUri as __module
3
+ pathKey as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var codegen = {};
1
+ var validate = {};
2
2
  export {
3
- codegen as __exports
3
+ validate as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var discriminator = {};
1
+ var codegen = {};
2
2
  export {
3
- discriminator as __exports
3
+ codegen as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var dist = { exports: {} };
1
+ var discriminator = {};
2
2
  export {
3
- dist as __module
3
+ discriminator as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var crossSpawn = { exports: {} };
1
+ var dist = { exports: {} };
2
2
  export {
3
- crossSpawn as __module
3
+ dist as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var signalExit = { exports: {} };
1
+ var crossSpawn = { exports: {} };
2
2
  export {
3
- signalExit as __module
3
+ crossSpawn as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var compile = {};
1
+ var signalExit = { exports: {} };
2
2
  export {
3
- compile as __exports
3
+ signalExit as __module
4
4
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;;kBA+V5C,iBAAiB;;;;;;;;AAFjC,wBAOC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;;kBA2W5C,iBAAiB;;;;;;;;AAFjC,wBAOC"}
package/dist/index.js CHANGED
@@ -2,27 +2,24 @@ import { mkdir, readFile, writeFile } from "node:fs/promises";
2
2
  import path__default from "node:path";
3
3
  import process from "node:process";
4
4
  import { fileURLToPath } from "node:url";
5
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/paths-Cw7f9XhU.js";
6
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/utils-sBTEdeml.js";
7
+ import "node:fs";
8
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/secure-temp-dir-aidxCRgA.js";
9
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/subsystem-DSPWLoK5.js";
10
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/ip-WAe3-2zT.js";
11
+ import "node:os";
12
+ import "node:net";
13
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/config-schema-ChfiQrSg.js";
5
14
  import "node:crypto";
6
- import "node:async_hooks";
7
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/registry-DxH_0Os-.js";
8
15
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/discovery-GEDtU7uI.js";
9
16
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/installed-plugin-index-record-reader-BvE-GqxR.js";
10
- import "node:fs";
11
- import "node:os";
12
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/utils-sBTEdeml.js";
13
17
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/fs-safe-defaults-B7hUN42l.js";
14
18
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/model-catalog-DtQLR692.js";
15
19
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/bundled-0oTAwz0N.js";
16
20
  import "./node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/system/hashing/hash.js";
17
21
  import "./node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/script/token/internal/char.js";
18
22
  import "./node_modules/.pnpm/typebox@1.1.38/node_modules/typebox/build/type/script/token/ident.js";
19
- import { r as emptyPluginConfigSchema } from "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/config-schema-DBTUnI0T.js";
20
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/paths-Cw7f9XhU.js";
21
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/secure-temp-dir-aidxCRgA.js";
22
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/subsystem-DSPWLoK5.js";
23
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/ip-WAe3-2zT.js";
24
- import "node:net";
25
- import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/config-schema-ChfiQrSg.js";
26
23
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/fs-safe-CV86zY9G.js";
27
24
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/mime-DppuT-pZ.js";
28
25
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/tool-images-Cv3ZnK02.js";
@@ -30,6 +27,7 @@ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/works
30
27
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/theme-D58JpUfy.js";
31
28
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/logger-Dg9dVaLI.js";
32
29
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/ids-BE_yccbC.js";
30
+ import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/schema-validator-CoHaB3Uu.js";
33
31
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/setup-helpers-BC9z9VvG.js";
34
32
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/tailscale-status-zDpKLtE_.js";
35
33
  import "./node_modules/.pnpm/openclaw@2026.5.22/node_modules/openclaw/dist/chat-meta-2H4wOcrq.js";
@@ -45,6 +43,17 @@ import { setWorkclawRuntime, deleteToolContext, setToolCallIdToRunIdMapping, get
45
43
  import { registerAllOpenclawWorkclawCronTools } from "./packages/plugin/src/tools/openclaw-workclaw-cron/index.js";
46
44
  import logger, { isLogLevel } from "./packages/plugin/src/logging.js";
47
45
  const PLUGIN_ID = "openclaw-workclaw";
46
+ const pluginConfigSchema = {
47
+ type: "object",
48
+ additionalProperties: false,
49
+ properties: {
50
+ scene: {
51
+ type: "string",
52
+ enum: ["test", "production"],
53
+ description: "控制插件日志输出的场景"
54
+ }
55
+ }
56
+ };
48
57
  function formatToolParams(toolName, params) {
49
58
  if (!params || typeof params !== "object") {
50
59
  return "";
@@ -168,7 +177,7 @@ function registerRuntimeCapabilities(api) {
168
177
  return;
169
178
  registeredRuntimeApis.add(marker);
170
179
  logger.setApi(api);
171
- const scene = api.config?.plugins?.installs?.[PLUGIN_ID]?.scene;
180
+ const scene = api.config?.plugins?.entries?.[PLUGIN_ID]?.config?.scene ?? api.config?.plugins?.installs?.[PLUGIN_ID]?.scene;
172
181
  if (isLogLevel(scene)) {
173
182
  logger.setLevel(scene);
174
183
  }
@@ -254,7 +263,7 @@ const channelEntry = defineChannelPluginEntry({
254
263
  id: "openclaw-workclaw",
255
264
  name: "智小途",
256
265
  description: "智小途企业通讯平台 OpenClaw 渠道插件,支持消息收发、定时任务、工具调用等",
257
- configSchema: emptyPluginConfigSchema(),
266
+ configSchema: pluginConfigSchema,
258
267
  plugin: workclawPlugin,
259
268
  registerFull(api) {
260
269
  logger.info("[智小途] registerFull 调用");
@@ -1,8 +1,8 @@
1
- import { __module as dist } from "../../../../../../_virtual/index6.js";
1
+ import { __module as dist } from "../../../../../../_virtual/index7.js";
2
2
  import "./formats.js";
3
3
  import "./limit.js";
4
4
  import "../../../../ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js";
5
- import { __exports as codegen } from "../../../../../../_virtual/index4.js";
5
+ import { __exports as codegen } from "../../../../../../_virtual/index5.js";
6
6
  import { __exports as formats } from "../../../../../../_virtual/formats.js";
7
7
  import { __exports as limit } from "../../../../../../_virtual/limit.js";
8
8
  (function(module, exports$1) {
@@ -1,7 +1,7 @@
1
1
  import { __exports as limit } from "../../../../../../_virtual/limit.js";
2
2
  import { a as ajvExports } from "../../../../ajv@8.20.0/node_modules/ajv/dist/ajv.js";
3
3
  import "../../../../ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js";
4
- import { __exports as codegen } from "../../../../../../_virtual/index4.js";
4
+ import { __exports as codegen } from "../../../../../../_virtual/index5.js";
5
5
  (function(exports$1) {
6
6
  Object.defineProperty(exports$1, "__esModule", { value: true });
7
7
  exports$1.formatLimitDefinition = void 0;
@@ -4,15 +4,17 @@ import "./core.js";
4
4
  import "./vocabularies/draft7.js";
5
5
  import "./vocabularies/discriminator/index.js";
6
6
  import require$$3 from "./refs/json-schema-draft-07.json.js";
7
- import { __require as requireValidate } from "./compile/validate/index.js";
7
+ import "./compile/validate/index.js";
8
8
  import "./compile/codegen/index.js";
9
- import { __require as requireValidation_error } from "./runtime/validation_error.js";
9
+ import "./runtime/validation_error.js";
10
10
  import "./compile/ref_error.js";
11
- import { __exports as codegen } from "../../../../../../_virtual/index4.js";
11
+ import { __exports as validate } from "../../../../../../_virtual/index4.js";
12
+ import { __exports as codegen } from "../../../../../../_virtual/index5.js";
13
+ import { __exports as validation_error } from "../../../../../../_virtual/validation_error.js";
12
14
  import { __exports as ref_error } from "../../../../../../_virtual/ref_error.js";
13
15
  import { __exports as core } from "../../../../../../_virtual/core.js";
14
16
  import { __exports as draft7 } from "../../../../../../_virtual/draft7.js";
15
- import { __exports as discriminator } from "../../../../../../_virtual/index5.js";
17
+ import { __exports as discriminator } from "../../../../../../_virtual/index6.js";
16
18
  (function(module, exports$1) {
17
19
  Object.defineProperty(exports$1, "__esModule", { value: true });
18
20
  exports$1.MissingRefError = exports$1.ValidationError = exports$1.CodeGen = exports$1.Name = exports$1.nil = exports$1.stringify = exports$1.str = exports$1._ = exports$1.KeywordCxt = exports$1.Ajv = void 0;
@@ -46,7 +48,7 @@ import { __exports as discriminator } from "../../../../../../_virtual/index5.js
46
48
  module.exports.Ajv = Ajv2;
47
49
  Object.defineProperty(exports$1, "__esModule", { value: true });
48
50
  exports$1.default = Ajv2;
49
- var validate_1 = requireValidate();
51
+ var validate_1 = validate;
50
52
  Object.defineProperty(exports$1, "KeywordCxt", { enumerable: true, get: function() {
51
53
  return validate_1.KeywordCxt;
52
54
  } });
@@ -69,7 +71,7 @@ import { __exports as discriminator } from "../../../../../../_virtual/index5.js
69
71
  Object.defineProperty(exports$1, "CodeGen", { enumerable: true, get: function() {
70
72
  return codegen_1.CodeGen;
71
73
  } });
72
- var validation_error_1 = requireValidation_error();
74
+ var validation_error_1 = validation_error;
73
75
  Object.defineProperty(exports$1, "ValidationError", { enumerable: true, get: function() {
74
76
  return validation_error_1.default;
75
77
  } });
@@ -1,4 +1,4 @@
1
- import { __exports as codegen } from "../../../../../../../../_virtual/index4.js";
1
+ import { __exports as codegen } from "../../../../../../../../_virtual/index5.js";
2
2
  import "./code.js";
3
3
  import "./scope.js";
4
4
  import { __exports as code } from "../../../../../../../../_virtual/code.js";
@@ -2,7 +2,7 @@ import { __exports as errors } from "../../../../../../../_virtual/errors.js";
2
2
  import "./codegen/index.js";
3
3
  import "./util.js";
4
4
  import "./names.js";
5
- import { __exports as codegen } from "../../../../../../../_virtual/index4.js";
5
+ import { __exports as codegen } from "../../../../../../../_virtual/index5.js";
6
6
  import { __exports as names } from "../../../../../../../_virtual/names.js";
7
7
  import { __exports as util } from "../../../../../../../_virtual/util.js";
8
8
  (function(exports$1) {
@@ -1,22 +1,24 @@
1
- import { __exports as compile } from "../../../../../../../_virtual/index9.js";
1
+ import { __exports as compile } from "../../../../../../../_virtual/index10.js";
2
2
  import "./codegen/index.js";
3
- import { __require as requireValidation_error } from "../runtime/validation_error.js";
3
+ import "../runtime/validation_error.js";
4
4
  import "./names.js";
5
5
  import "./resolve.js";
6
6
  import "./util.js";
7
- import { __require as requireValidate } from "./validate/index.js";
7
+ import "./validate/index.js";
8
8
  import { __exports as resolve$1 } from "../../../../../../../_virtual/resolve.js";
9
- import { __exports as codegen } from "../../../../../../../_virtual/index4.js";
9
+ import { __exports as codegen } from "../../../../../../../_virtual/index5.js";
10
+ import { __exports as validation_error } from "../../../../../../../_virtual/validation_error.js";
10
11
  import { __exports as names } from "../../../../../../../_virtual/names.js";
12
+ import { __exports as validate } from "../../../../../../../_virtual/index4.js";
11
13
  import { __exports as util } from "../../../../../../../_virtual/util.js";
12
14
  Object.defineProperty(compile, "__esModule", { value: true });
13
15
  compile.resolveSchema = compile.getCompilingSchema = compile.resolveRef = compile.compileSchema = compile.SchemaEnv = void 0;
14
16
  const codegen_1 = codegen;
15
- const validation_error_1 = requireValidation_error();
17
+ const validation_error_1 = validation_error;
16
18
  const names_1 = names;
17
19
  const resolve_1 = resolve$1;
18
20
  const util_1 = util;
19
- const validate_1 = requireValidate();
21
+ const validate_1 = validate;
20
22
  class SchemaEnv {
21
23
  constructor(env) {
22
24
  var _a;
@@ -89,28 +91,28 @@ function compileSchema(sch) {
89
91
  if (this.opts.code.process)
90
92
  sourceCode = this.opts.code.process(sourceCode, sch);
91
93
  const makeValidate = new Function(`${names_1.default.self}`, `${names_1.default.scope}`, sourceCode);
92
- const validate = makeValidate(this, this.scope.get());
93
- this.scope.value(validateName, { ref: validate });
94
- validate.errors = null;
95
- validate.schema = sch.schema;
96
- validate.schemaEnv = sch;
94
+ const validate2 = makeValidate(this, this.scope.get());
95
+ this.scope.value(validateName, { ref: validate2 });
96
+ validate2.errors = null;
97
+ validate2.schema = sch.schema;
98
+ validate2.schemaEnv = sch;
97
99
  if (sch.$async)
98
- validate.$async = true;
100
+ validate2.$async = true;
99
101
  if (this.opts.code.source === true) {
100
- validate.source = { validateName, validateCode, scopeValues: gen._values };
102
+ validate2.source = { validateName, validateCode, scopeValues: gen._values };
101
103
  }
102
104
  if (this.opts.unevaluated) {
103
105
  const { props, items } = schemaCxt;
104
- validate.evaluated = {
106
+ validate2.evaluated = {
105
107
  props: props instanceof codegen_1.Name ? void 0 : props,
106
108
  items: items instanceof codegen_1.Name ? void 0 : items,
107
109
  dynamicProps: props instanceof codegen_1.Name,
108
110
  dynamicItems: items instanceof codegen_1.Name
109
111
  };
110
- if (validate.source)
111
- validate.source.evaluated = (0, codegen_1.stringify)(validate.evaluated);
112
+ if (validate2.source)
113
+ validate2.source.evaluated = (0, codegen_1.stringify)(validate2.evaluated);
112
114
  }
113
- sch.validate = validate;
115
+ sch.validate = validate2;
114
116
  return sch;
115
117
  } catch (e) {
116
118
  delete sch.validate;
@@ -1,6 +1,6 @@
1
1
  import { __exports as names$1 } from "../../../../../../../_virtual/names.js";
2
2
  import "./codegen/index.js";
3
- import { __exports as codegen } from "../../../../../../../_virtual/index4.js";
3
+ import { __exports as codegen } from "../../../../../../../_virtual/index5.js";
4
4
  Object.defineProperty(names$1, "__esModule", { value: true });
5
5
  const codegen_1 = codegen;
6
6
  const names = {
@@ -1,7 +1,7 @@
1
1
  import { __exports as util } from "../../../../../../../_virtual/util.js";
2
2
  import "./codegen/index.js";
3
3
  import "./codegen/code.js";
4
- import { __exports as codegen } from "../../../../../../../_virtual/index4.js";
4
+ import { __exports as codegen } from "../../../../../../../_virtual/index5.js";
5
5
  import { __exports as code } from "../../../../../../../_virtual/code.js";
6
6
  Object.defineProperty(util, "__esModule", { value: true });
7
7
  util.checkStrictMode = util.getErrorPath = util.Type = util.useFunc = util.setEvaluated = util.evaluatedPropsToName = util.mergeEvaluated = util.eachItem = util.unescapeJsonPointer = util.escapeJsonPointer = util.escapeFragment = util.unescapeFragment = util.schemaRefOrVal = util.schemaHasRulesButRef = util.schemaHasRules = util.checkUnknownRules = util.alwaysValidSchema = util.toHash = void 0;
@@ -1,26 +1,20 @@
1
1
  import { __exports as applicability } from "../../../../../../../../_virtual/applicability.js";
2
- var hasRequiredApplicability;
3
- function requireApplicability() {
4
- if (hasRequiredApplicability) return applicability;
5
- hasRequiredApplicability = 1;
6
- Object.defineProperty(applicability, "__esModule", { value: true });
7
- applicability.shouldUseRule = applicability.shouldUseGroup = applicability.schemaHasRulesForType = void 0;
8
- function schemaHasRulesForType({ schema, self }, type) {
9
- const group = self.RULES.types[type];
10
- return group && group !== true && shouldUseGroup(schema, group);
11
- }
12
- applicability.schemaHasRulesForType = schemaHasRulesForType;
13
- function shouldUseGroup(schema, group) {
14
- return group.rules.some((rule) => shouldUseRule(schema, rule));
15
- }
16
- applicability.shouldUseGroup = shouldUseGroup;
17
- function shouldUseRule(schema, rule) {
18
- var _a;
19
- return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
20
- }
21
- applicability.shouldUseRule = shouldUseRule;
22
- return applicability;
2
+ Object.defineProperty(applicability, "__esModule", { value: true });
3
+ applicability.shouldUseRule = applicability.shouldUseGroup = applicability.schemaHasRulesForType = void 0;
4
+ function schemaHasRulesForType({ schema, self }, type) {
5
+ const group = self.RULES.types[type];
6
+ return group && group !== true && shouldUseGroup(schema, group);
23
7
  }
8
+ applicability.schemaHasRulesForType = schemaHasRulesForType;
9
+ function shouldUseGroup(schema, group) {
10
+ return group.rules.some((rule) => shouldUseRule(schema, rule));
11
+ }
12
+ applicability.shouldUseGroup = shouldUseGroup;
13
+ function shouldUseRule(schema, rule) {
14
+ var _a;
15
+ return schema[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== void 0));
16
+ }
17
+ applicability.shouldUseRule = shouldUseRule;
24
18
  export {
25
- requireApplicability as __require
19
+ applicability as default
26
20
  };
@@ -3,58 +3,52 @@ import "../errors.js";
3
3
  import "../codegen/index.js";
4
4
  import "../names.js";
5
5
  import { __exports as names } from "../../../../../../../../_virtual/names.js";
6
- import { __exports as codegen } from "../../../../../../../../_virtual/index4.js";
6
+ import { __exports as codegen } from "../../../../../../../../_virtual/index5.js";
7
7
  import { __exports as errors } from "../../../../../../../../_virtual/errors.js";
8
- var hasRequiredBoolSchema;
9
- function requireBoolSchema() {
10
- if (hasRequiredBoolSchema) return boolSchema;
11
- hasRequiredBoolSchema = 1;
12
- Object.defineProperty(boolSchema, "__esModule", { value: true });
13
- boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
14
- const errors_1 = errors;
15
- const codegen_1 = codegen;
16
- const names_1 = names;
17
- const boolError = {
18
- message: "boolean schema is false"
19
- };
20
- function topBoolOrEmptySchema(it) {
21
- const { gen, schema, validateName } = it;
22
- if (schema === false) {
23
- falseSchemaError(it, false);
24
- } else if (typeof schema == "object" && schema.$async === true) {
25
- gen.return(names_1.default.data);
26
- } else {
27
- gen.assign((0, codegen_1._)`${validateName}.errors`, null);
28
- gen.return(true);
29
- }
30
- }
31
- boolSchema.topBoolOrEmptySchema = topBoolOrEmptySchema;
32
- function boolOrEmptySchema(it, valid) {
33
- const { gen, schema } = it;
34
- if (schema === false) {
35
- gen.var(valid, false);
36
- falseSchemaError(it);
37
- } else {
38
- gen.var(valid, true);
39
- }
8
+ Object.defineProperty(boolSchema, "__esModule", { value: true });
9
+ boolSchema.boolOrEmptySchema = boolSchema.topBoolOrEmptySchema = void 0;
10
+ const errors_1 = errors;
11
+ const codegen_1 = codegen;
12
+ const names_1 = names;
13
+ const boolError = {
14
+ message: "boolean schema is false"
15
+ };
16
+ function topBoolOrEmptySchema(it) {
17
+ const { gen, schema, validateName } = it;
18
+ if (schema === false) {
19
+ falseSchemaError(it, false);
20
+ } else if (typeof schema == "object" && schema.$async === true) {
21
+ gen.return(names_1.default.data);
22
+ } else {
23
+ gen.assign((0, codegen_1._)`${validateName}.errors`, null);
24
+ gen.return(true);
40
25
  }
41
- boolSchema.boolOrEmptySchema = boolOrEmptySchema;
42
- function falseSchemaError(it, overrideAllErrors) {
43
- const { gen, data } = it;
44
- const cxt = {
45
- gen,
46
- keyword: "false schema",
47
- data,
48
- schema: false,
49
- schemaCode: false,
50
- schemaValue: false,
51
- params: {},
52
- it
53
- };
54
- (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
26
+ }
27
+ boolSchema.topBoolOrEmptySchema = topBoolOrEmptySchema;
28
+ function boolOrEmptySchema(it, valid) {
29
+ const { gen, schema } = it;
30
+ if (schema === false) {
31
+ gen.var(valid, false);
32
+ falseSchemaError(it);
33
+ } else {
34
+ gen.var(valid, true);
55
35
  }
56
- return boolSchema;
36
+ }
37
+ boolSchema.boolOrEmptySchema = boolOrEmptySchema;
38
+ function falseSchemaError(it, overrideAllErrors) {
39
+ const { gen, data } = it;
40
+ const cxt = {
41
+ gen,
42
+ keyword: "false schema",
43
+ data,
44
+ schema: false,
45
+ schemaCode: false,
46
+ schemaValue: false,
47
+ params: {},
48
+ it
49
+ };
50
+ (0, errors_1.reportError)(cxt, boolError, void 0, overrideAllErrors);
57
51
  }
58
52
  export {
59
- requireBoolSchema as __require
53
+ boolSchema as default
60
54
  };
@@ -1,17 +1,18 @@
1
1
  import { __exports as dataType } from "../../../../../../../../_virtual/dataType.js";
2
2
  import "../rules.js";
3
- import { __require as requireApplicability } from "./applicability.js";
3
+ import "./applicability.js";
4
4
  import "../errors.js";
5
5
  import "../codegen/index.js";
6
6
  import "../util.js";
7
7
  import { __exports as rules } from "../../../../../../../../_virtual/rules.js";
8
- import { __exports as codegen } from "../../../../../../../../_virtual/index4.js";
8
+ import { __exports as applicability } from "../../../../../../../../_virtual/applicability.js";
9
+ import { __exports as codegen } from "../../../../../../../../_virtual/index5.js";
9
10
  import { __exports as util } from "../../../../../../../../_virtual/util.js";
10
11
  import { __exports as errors } from "../../../../../../../../_virtual/errors.js";
11
12
  Object.defineProperty(dataType, "__esModule", { value: true });
12
13
  dataType.reportTypeError = dataType.checkDataTypes = dataType.checkDataType = dataType.coerceAndCheckDataType = dataType.getJSONTypes = dataType.getSchemaTypes = dataType.DataType = void 0;
13
14
  const rules_1 = rules;
14
- const applicability_1 = requireApplicability();
15
+ const applicability_1 = applicability;
15
16
  const errors_1 = errors;
16
17
  const codegen_1 = codegen;
17
18
  const util_1 = util;
@@ -1,44 +1,38 @@
1
1
  import { __exports as defaults } from "../../../../../../../../_virtual/defaults.js";
2
2
  import "../codegen/index.js";
3
3
  import "../util.js";
4
- import { __exports as codegen } from "../../../../../../../../_virtual/index4.js";
4
+ import { __exports as codegen } from "../../../../../../../../_virtual/index5.js";
5
5
  import { __exports as util } from "../../../../../../../../_virtual/util.js";
6
- var hasRequiredDefaults;
7
- function requireDefaults() {
8
- if (hasRequiredDefaults) return defaults;
9
- hasRequiredDefaults = 1;
10
- Object.defineProperty(defaults, "__esModule", { value: true });
11
- defaults.assignDefaults = void 0;
12
- const codegen_1 = codegen;
13
- const util_1 = util;
14
- function assignDefaults(it, ty) {
15
- const { properties, items } = it.schema;
16
- if (ty === "object" && properties) {
17
- for (const key in properties) {
18
- assignDefault(it, key, properties[key].default);
19
- }
20
- } else if (ty === "array" && Array.isArray(items)) {
21
- items.forEach((sch, i) => assignDefault(it, i, sch.default));
6
+ Object.defineProperty(defaults, "__esModule", { value: true });
7
+ defaults.assignDefaults = void 0;
8
+ const codegen_1 = codegen;
9
+ const util_1 = util;
10
+ function assignDefaults(it, ty) {
11
+ const { properties, items } = it.schema;
12
+ if (ty === "object" && properties) {
13
+ for (const key in properties) {
14
+ assignDefault(it, key, properties[key].default);
22
15
  }
16
+ } else if (ty === "array" && Array.isArray(items)) {
17
+ items.forEach((sch, i) => assignDefault(it, i, sch.default));
23
18
  }
24
- defaults.assignDefaults = assignDefaults;
25
- function assignDefault(it, prop, defaultValue) {
26
- const { gen, compositeRule, data, opts } = it;
27
- if (defaultValue === void 0)
28
- return;
29
- const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;
30
- if (compositeRule) {
31
- (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
32
- return;
33
- }
34
- let condition = (0, codegen_1._)`${childData} === undefined`;
35
- if (opts.useDefaults === "empty") {
36
- condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`;
37
- }
38
- gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
19
+ }
20
+ defaults.assignDefaults = assignDefaults;
21
+ function assignDefault(it, prop, defaultValue) {
22
+ const { gen, compositeRule, data, opts } = it;
23
+ if (defaultValue === void 0)
24
+ return;
25
+ const childData = (0, codegen_1._)`${data}${(0, codegen_1.getProperty)(prop)}`;
26
+ if (compositeRule) {
27
+ (0, util_1.checkStrictMode)(it, `default is ignored for: ${childData}`);
28
+ return;
29
+ }
30
+ let condition = (0, codegen_1._)`${childData} === undefined`;
31
+ if (opts.useDefaults === "empty") {
32
+ condition = (0, codegen_1._)`${condition} || ${childData} === null || ${childData} === ""`;
39
33
  }
40
- return defaults;
34
+ gen.if(condition, (0, codegen_1._)`${childData} = ${(0, codegen_1.stringify)(defaultValue)}`);
41
35
  }
42
36
  export {
43
- requireDefaults as __require
37
+ defaults as default
44
38
  };