@metamask/snaps-utils 8.0.1 → 8.1.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 +16 -1
- package/dist/array.cjs +17 -0
- package/dist/array.cjs.map +1 -0
- package/dist/array.d.cts +11 -0
- package/dist/array.d.cts.map +1 -0
- package/dist/array.d.mts +11 -0
- package/dist/array.d.mts.map +1 -0
- package/dist/array.mjs +12 -7
- package/dist/array.mjs.map +1 -1
- package/dist/auxiliary-files.cjs +39 -0
- package/dist/auxiliary-files.cjs.map +1 -0
- package/dist/auxiliary-files.d.cts +17 -0
- package/dist/auxiliary-files.d.cts.map +1 -0
- package/dist/auxiliary-files.d.mts +17 -0
- package/dist/auxiliary-files.d.mts.map +1 -0
- package/dist/auxiliary-files.mjs +33 -14
- package/dist/auxiliary-files.mjs.map +1 -1
- package/dist/base64.cjs +38 -0
- package/dist/base64.cjs.map +1 -0
- package/dist/base64.d.cts +16 -0
- package/dist/base64.d.cts.map +1 -0
- package/dist/base64.d.mts +16 -0
- package/dist/base64.d.mts.map +1 -0
- package/dist/base64.mjs +32 -12
- package/dist/base64.mjs.map +1 -1
- package/dist/bytes.cjs +22 -0
- package/dist/bytes.cjs.map +1 -0
- package/dist/bytes.d.cts +9 -0
- package/dist/bytes.d.cts.map +1 -0
- package/dist/bytes.d.mts +9 -0
- package/dist/bytes.d.mts.map +1 -0
- package/dist/bytes.mjs +17 -9
- package/dist/bytes.mjs.map +1 -1
- package/dist/caveats.cjs +51 -0
- package/dist/caveats.cjs.map +1 -0
- package/dist/caveats.d.cts +47 -0
- package/dist/caveats.d.cts.map +1 -0
- package/dist/caveats.d.mts +47 -0
- package/dist/caveats.d.mts.map +1 -0
- package/dist/caveats.mjs +47 -7
- package/dist/caveats.mjs.map +1 -1
- package/dist/checksum.cjs +49 -0
- package/dist/checksum.cjs.map +1 -0
- package/dist/checksum.d.cts +22 -0
- package/dist/checksum.d.cts.map +1 -0
- package/dist/checksum.d.mts +22 -0
- package/dist/checksum.d.mts.map +1 -0
- package/dist/checksum.mjs +43 -12
- package/dist/checksum.mjs.map +1 -1
- package/dist/constants.cjs +8 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +2 -0
- package/dist/constants.d.cts.map +1 -0
- package/dist/constants.d.mts +2 -0
- package/dist/constants.d.mts.map +1 -0
- package/dist/constants.mjs +4 -7
- package/dist/constants.mjs.map +1 -1
- package/dist/cronjob.cjs +70 -0
- package/dist/cronjob.cjs.map +1 -0
- package/dist/cronjob.d.cts +90 -0
- package/dist/cronjob.d.cts.map +1 -0
- package/dist/cronjob.d.mts +90 -0
- package/dist/cronjob.d.mts.map +1 -0
- package/dist/cronjob.mjs +64 -19
- package/dist/cronjob.mjs.map +1 -1
- package/dist/deep-clone.cjs +9 -0
- package/dist/deep-clone.cjs.map +1 -0
- package/dist/deep-clone.d.cts +2 -0
- package/dist/deep-clone.d.cts.map +1 -0
- package/dist/deep-clone.d.mts +2 -0
- package/dist/deep-clone.d.mts.map +1 -0
- package/dist/deep-clone.mjs +9 -7
- package/dist/deep-clone.mjs.map +1 -1
- package/dist/default-endowments.cjs +42 -0
- package/dist/default-endowments.cjs.map +1 -0
- package/dist/default-endowments.d.cts +5 -0
- package/dist/default-endowments.d.cts.map +1 -0
- package/dist/default-endowments.d.mts +5 -0
- package/dist/default-endowments.d.mts.map +1 -0
- package/dist/default-endowments.mjs +38 -7
- package/dist/default-endowments.mjs.map +1 -1
- package/dist/derivation-paths.cjs +215 -0
- package/dist/derivation-paths.cjs.map +1 -0
- package/dist/derivation-paths.d.cts +25 -0
- package/dist/derivation-paths.d.cts.map +1 -0
- package/dist/derivation-paths.d.mts +25 -0
- package/dist/derivation-paths.d.mts.map +1 -0
- package/dist/derivation-paths.mjs +206 -12
- package/dist/derivation-paths.mjs.map +1 -1
- package/dist/entropy.cjs +8 -0
- package/dist/entropy.cjs.map +1 -0
- package/dist/entropy.d.cts +4 -0
- package/dist/entropy.d.cts.map +1 -0
- package/dist/entropy.d.mts +4 -0
- package/dist/entropy.d.mts.map +1 -0
- package/dist/entropy.mjs +4 -9
- package/dist/entropy.mjs.map +1 -1
- package/dist/errors.cjs +189 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +85 -0
- package/dist/errors.d.cts.map +1 -0
- package/dist/errors.d.mts +85 -0
- package/dist/errors.d.mts.map +1 -0
- package/dist/errors.mjs +179 -18
- package/dist/errors.mjs.map +1 -1
- package/dist/eval-worker.cjs +42 -0
- package/dist/eval-worker.cjs.map +1 -0
- package/dist/eval-worker.d.cts +2 -0
- package/dist/eval-worker.d.cts.map +1 -0
- package/dist/eval-worker.d.mts +2 -0
- package/dist/eval-worker.d.mts.map +1 -0
- package/dist/eval-worker.mjs +28 -31
- package/dist/eval-worker.mjs.map +1 -1
- package/dist/eval.cjs +54 -0
- package/dist/eval.cjs.map +1 -0
- package/dist/eval.d.cts +17 -0
- package/dist/eval.d.cts.map +1 -0
- package/dist/eval.d.mts +17 -0
- package/dist/eval.d.mts.map +1 -0
- package/dist/eval.mjs +48 -16
- package/dist/eval.mjs.map +1 -1
- package/dist/fs.cjs +159 -0
- package/dist/fs.cjs.map +1 -0
- package/dist/fs.d.cts +70 -0
- package/dist/fs.d.cts.map +1 -0
- package/dist/fs.d.mts +70 -0
- package/dist/fs.d.mts.map +1 -0
- package/dist/fs.mjs +144 -27
- package/dist/fs.mjs.map +1 -1
- package/dist/handler-types.cjs +18 -0
- package/dist/handler-types.cjs.map +1 -0
- package/dist/handler-types.d.cts +35 -0
- package/dist/handler-types.d.cts.map +1 -0
- package/dist/handler-types.d.mts +35 -0
- package/dist/handler-types.d.mts.map +1 -0
- package/dist/handler-types.mjs +14 -9
- package/dist/handler-types.mjs.map +1 -1
- package/dist/handlers.cjs +119 -0
- package/dist/handlers.cjs.map +1 -0
- package/dist/handlers.d.cts +750 -0
- package/dist/handlers.d.cts.map +1 -0
- package/dist/handlers.d.mts +750 -0
- package/dist/handlers.d.mts.map +1 -0
- package/dist/handlers.mjs +114 -33
- package/dist/handlers.mjs.map +1 -1
- package/dist/icon.cjs +58 -0
- package/dist/icon.cjs.map +1 -0
- package/dist/icon.d.cts +20 -0
- package/dist/icon.d.cts.map +1 -0
- package/dist/icon.d.mts +20 -0
- package/dist/icon.d.mts.map +1 -0
- package/dist/icon.mjs +52 -14
- package/dist/icon.mjs.map +1 -1
- package/dist/iframe.cjs +54 -0
- package/dist/iframe.cjs.map +1 -0
- package/dist/iframe.d.cts +12 -0
- package/dist/iframe.d.cts.map +1 -0
- package/dist/iframe.d.mts +12 -0
- package/dist/iframe.d.mts.map +1 -0
- package/dist/iframe.mjs +49 -7
- package/dist/iframe.mjs.map +1 -1
- package/dist/iframe.test.browser.cjs +15 -0
- package/dist/iframe.test.browser.cjs.map +1 -0
- package/dist/iframe.test.browser.d.cts +2 -0
- package/dist/iframe.test.browser.d.cts.map +1 -0
- package/dist/iframe.test.browser.d.mts +2 -0
- package/dist/iframe.test.browser.d.mts.map +1 -0
- package/dist/iframe.test.browser.mjs +13 -0
- package/dist/iframe.test.browser.mjs.map +1 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +33 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +33 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.executionenv.cjs +25 -0
- package/dist/index.executionenv.cjs.map +1 -0
- package/dist/index.executionenv.d.cts +8 -0
- package/dist/index.executionenv.d.cts.map +1 -0
- package/dist/index.executionenv.d.mts +8 -0
- package/dist/index.executionenv.d.mts.map +1 -0
- package/dist/index.executionenv.mjs +8 -127
- package/dist/index.executionenv.mjs.map +1 -1
- package/dist/index.mjs +32 -397
- package/dist/index.mjs.map +1 -1
- package/dist/json-rpc.cjs +135 -0
- package/dist/json-rpc.cjs.map +1 -0
- package/dist/json-rpc.d.cts +56 -0
- package/dist/json-rpc.d.cts.map +1 -0
- package/dist/json-rpc.d.mts +56 -0
- package/dist/json-rpc.d.mts.map +1 -0
- package/dist/json-rpc.mjs +127 -17
- package/dist/json-rpc.mjs.map +1 -1
- package/dist/json.cjs +34 -0
- package/dist/json.cjs.map +1 -0
- package/dist/json.d.cts +23 -0
- package/dist/json.d.cts.map +1 -0
- package/dist/json.d.mts +23 -0
- package/dist/json.d.mts.map +1 -0
- package/dist/json.mjs +28 -9
- package/dist/json.mjs.map +1 -1
- package/dist/localization.cjs +128 -0
- package/dist/localization.cjs.map +1 -0
- package/dist/localization.d.cts +146 -0
- package/dist/localization.d.cts.map +1 -0
- package/dist/localization.d.mts +146 -0
- package/dist/localization.d.mts.map +1 -0
- package/dist/localization.mjs +119 -22
- package/dist/localization.mjs.map +1 -1
- package/dist/logging.cjs +67 -0
- package/dist/logging.cjs.map +1 -0
- package/dist/logging.d.cts +50 -0
- package/dist/logging.d.cts.map +1 -0
- package/dist/logging.d.mts +50 -0
- package/dist/logging.d.mts.map +1 -0
- package/dist/logging.mjs +60 -13
- package/dist/logging.mjs.map +1 -1
- package/dist/manifest/index.cjs +18 -0
- package/dist/manifest/index.cjs.map +1 -0
- package/dist/manifest/index.d.cts +2 -0
- package/dist/manifest/index.d.cts.map +1 -0
- package/dist/manifest/index.d.mts +2 -0
- package/dist/manifest/index.d.mts.map +1 -0
- package/dist/manifest/index.mjs +1 -64
- package/dist/manifest/index.mjs.map +1 -1
- package/dist/manifest/manifest.cjs +267 -0
- package/dist/manifest/manifest.cjs.map +1 -0
- package/dist/manifest/manifest.d.cts +100 -0
- package/dist/manifest/manifest.d.cts.map +1 -0
- package/dist/manifest/manifest.d.mts +100 -0
- package/dist/manifest/manifest.d.mts.map +1 -0
- package/dist/manifest/manifest.mjs +252 -57
- package/dist/manifest/manifest.mjs.map +1 -1
- package/dist/manifest/node.cjs +19 -0
- package/dist/manifest/node.cjs.map +1 -0
- package/dist/manifest/node.d.cts +3 -0
- package/dist/manifest/node.d.cts.map +1 -0
- package/dist/manifest/node.d.mts +3 -0
- package/dist/manifest/node.d.mts.map +1 -0
- package/dist/manifest/node.mjs +2 -105
- package/dist/manifest/node.mjs.map +1 -1
- package/dist/manifest/validation.cjs +194 -0
- package/dist/manifest/validation.cjs.map +1 -0
- package/dist/manifest/validation.d.cts +254 -0
- package/dist/manifest/validation.d.cts.map +1 -0
- package/dist/manifest/validation.d.mts +254 -0
- package/dist/manifest/validation.d.mts.map +1 -0
- package/dist/manifest/validation.mjs +186 -63
- package/dist/manifest/validation.mjs.map +1 -1
- package/dist/manifest/validator-types.cjs +3 -0
- package/dist/manifest/validator-types.cjs.map +1 -0
- package/dist/manifest/validator-types.d.cts +35 -0
- package/dist/manifest/validator-types.d.cts.map +1 -0
- package/dist/manifest/validator-types.d.mts +35 -0
- package/dist/manifest/validator-types.d.mts.map +1 -0
- package/dist/manifest/validator-types.mjs +1 -0
- package/dist/manifest/validator-types.mjs.map +1 -1
- package/dist/manifest/validator.cjs +109 -0
- package/dist/manifest/validator.cjs.map +1 -0
- package/dist/manifest/validator.d.cts +24 -0
- package/dist/manifest/validator.d.cts.map +1 -0
- package/dist/manifest/validator.d.mts +24 -0
- package/dist/manifest/validator.d.mts.map +1 -0
- package/dist/manifest/validator.mjs +79 -42
- package/dist/manifest/validator.mjs.map +1 -1
- package/dist/manifest/validators/checksum.cjs +23 -0
- package/dist/manifest/validators/checksum.cjs.map +1 -0
- package/dist/manifest/validators/checksum.d.cts +6 -0
- package/dist/manifest/validators/checksum.d.cts.map +1 -0
- package/dist/manifest/validators/checksum.d.mts +6 -0
- package/dist/manifest/validators/checksum.d.mts.map +1 -0
- package/dist/manifest/validators/checksum.mjs +18 -13
- package/dist/manifest/validators/checksum.mjs.map +1 -1
- package/dist/manifest/validators/expected-files.cjs +24 -0
- package/dist/manifest/validators/expected-files.cjs.map +1 -0
- package/dist/manifest/validators/expected-files.d.cts +6 -0
- package/dist/manifest/validators/expected-files.d.cts.map +1 -0
- package/dist/manifest/validators/expected-files.d.mts +6 -0
- package/dist/manifest/validators/expected-files.d.mts.map +1 -0
- package/dist/manifest/validators/expected-files.mjs +19 -7
- package/dist/manifest/validators/expected-files.mjs.map +1 -1
- package/dist/manifest/validators/icon-declared.cjs +15 -0
- package/dist/manifest/validators/icon-declared.cjs.map +1 -0
- package/dist/manifest/validators/icon-declared.d.cts +6 -0
- package/dist/manifest/validators/icon-declared.d.cts.map +1 -0
- package/dist/manifest/validators/icon-declared.d.mts +6 -0
- package/dist/manifest/validators/icon-declared.d.mts.map +1 -0
- package/dist/manifest/validators/icon-declared.mjs +10 -6
- package/dist/manifest/validators/icon-declared.mjs.map +1 -1
- package/dist/manifest/validators/icon-dimensions.cjs +20 -0
- package/dist/manifest/validators/icon-dimensions.cjs.map +1 -0
- package/dist/manifest/validators/icon-dimensions.d.cts +6 -0
- package/dist/manifest/validators/icon-dimensions.d.cts.map +1 -0
- package/dist/manifest/validators/icon-dimensions.d.mts +6 -0
- package/dist/manifest/validators/icon-dimensions.d.mts.map +1 -0
- package/dist/manifest/validators/icon-dimensions.mjs +15 -8
- package/dist/manifest/validators/icon-dimensions.mjs.map +1 -1
- package/dist/manifest/validators/icon-missing.cjs +16 -0
- package/dist/manifest/validators/icon-missing.cjs.map +1 -0
- package/dist/manifest/validators/icon-missing.d.cts +6 -0
- package/dist/manifest/validators/icon-missing.d.cts.map +1 -0
- package/dist/manifest/validators/icon-missing.d.mts +6 -0
- package/dist/manifest/validators/icon-missing.d.mts.map +1 -0
- package/dist/manifest/validators/icon-missing.mjs +11 -6
- package/dist/manifest/validators/icon-missing.mjs.map +1 -1
- package/dist/manifest/validators/index.cjs +31 -0
- package/dist/manifest/validators/index.cjs.map +1 -0
- package/dist/manifest/validators/index.d.cts +15 -0
- package/dist/manifest/validators/index.d.cts.map +1 -0
- package/dist/manifest/validators/index.d.mts +15 -0
- package/dist/manifest/validators/index.d.mts.map +1 -0
- package/dist/manifest/validators/index.mjs +14 -79
- package/dist/manifest/validators/index.mjs.map +1 -1
- package/dist/manifest/validators/is-localization-file.cjs +23 -0
- package/dist/manifest/validators/is-localization-file.cjs.map +1 -0
- package/dist/manifest/validators/is-localization-file.d.cts +6 -0
- package/dist/manifest/validators/is-localization-file.d.cts.map +1 -0
- package/dist/manifest/validators/is-localization-file.d.mts +6 -0
- package/dist/manifest/validators/is-localization-file.d.mts.map +1 -0
- package/dist/manifest/validators/is-localization-file.mjs +18 -10
- package/dist/manifest/validators/is-localization-file.mjs.map +1 -1
- package/dist/manifest/validators/is-package-json.cjs +24 -0
- package/dist/manifest/validators/is-package-json.cjs.map +1 -0
- package/dist/manifest/validators/is-package-json.d.cts +6 -0
- package/dist/manifest/validators/is-package-json.d.cts.map +1 -0
- package/dist/manifest/validators/is-package-json.d.mts +6 -0
- package/dist/manifest/validators/is-package-json.d.mts.map +1 -0
- package/dist/manifest/validators/is-package-json.mjs +19 -9
- package/dist/manifest/validators/is-package-json.mjs.map +1 -1
- package/dist/manifest/validators/is-snap-icon.cjs +24 -0
- package/dist/manifest/validators/is-snap-icon.cjs.map +1 -0
- package/dist/manifest/validators/is-snap-icon.d.cts +6 -0
- package/dist/manifest/validators/is-snap-icon.d.cts.map +1 -0
- package/dist/manifest/validators/is-snap-icon.d.mts +6 -0
- package/dist/manifest/validators/is-snap-icon.d.mts.map +1 -0
- package/dist/manifest/validators/is-snap-icon.mjs +19 -8
- package/dist/manifest/validators/is-snap-icon.mjs.map +1 -1
- package/dist/manifest/validators/is-snap-manifest.cjs +25 -0
- package/dist/manifest/validators/is-snap-manifest.cjs.map +1 -0
- package/dist/manifest/validators/is-snap-manifest.d.cts +6 -0
- package/dist/manifest/validators/is-snap-manifest.d.cts.map +1 -0
- package/dist/manifest/validators/is-snap-manifest.d.mts +6 -0
- package/dist/manifest/validators/is-snap-manifest.d.mts.map +1 -0
- package/dist/manifest/validators/is-snap-manifest.mjs +20 -21
- package/dist/manifest/validators/is-snap-manifest.mjs.map +1 -1
- package/dist/manifest/validators/manifest-localization.cjs +30 -0
- package/dist/manifest/validators/manifest-localization.cjs.map +1 -0
- package/dist/manifest/validators/manifest-localization.d.cts +6 -0
- package/dist/manifest/validators/manifest-localization.d.cts.map +1 -0
- package/dist/manifest/validators/manifest-localization.d.mts +6 -0
- package/dist/manifest/validators/manifest-localization.d.mts.map +1 -0
- package/dist/manifest/validators/manifest-localization.mjs +25 -8
- package/dist/manifest/validators/manifest-localization.mjs.map +1 -1
- package/dist/manifest/validators/package-json-recommended-fields.cjs +18 -0
- package/dist/manifest/validators/package-json-recommended-fields.cjs.map +1 -0
- package/dist/manifest/validators/package-json-recommended-fields.d.cts +6 -0
- package/dist/manifest/validators/package-json-recommended-fields.d.cts.map +1 -0
- package/dist/manifest/validators/package-json-recommended-fields.d.mts +6 -0
- package/dist/manifest/validators/package-json-recommended-fields.d.mts.map +1 -0
- package/dist/manifest/validators/package-json-recommended-fields.mjs +13 -6
- package/dist/manifest/validators/package-json-recommended-fields.mjs.map +1 -1
- package/dist/manifest/validators/package-name-match.cjs +21 -0
- package/dist/manifest/validators/package-name-match.cjs.map +1 -0
- package/dist/manifest/validators/package-name-match.d.cts +6 -0
- package/dist/manifest/validators/package-name-match.d.cts.map +1 -0
- package/dist/manifest/validators/package-name-match.d.mts +6 -0
- package/dist/manifest/validators/package-name-match.d.mts.map +1 -0
- package/dist/manifest/validators/package-name-match.mjs +16 -7
- package/dist/manifest/validators/package-name-match.mjs.map +1 -1
- package/dist/manifest/validators/repository-match.cjs +29 -0
- package/dist/manifest/validators/repository-match.cjs.map +1 -0
- package/dist/manifest/validators/repository-match.d.cts +6 -0
- package/dist/manifest/validators/repository-match.d.cts.map +1 -0
- package/dist/manifest/validators/repository-match.d.mts +6 -0
- package/dist/manifest/validators/repository-match.d.mts.map +1 -0
- package/dist/manifest/validators/repository-match.mjs +28 -8
- package/dist/manifest/validators/repository-match.mjs.map +1 -1
- package/dist/manifest/validators/version-match.cjs +21 -0
- package/dist/manifest/validators/version-match.cjs.map +1 -0
- package/dist/manifest/validators/version-match.d.cts +6 -0
- package/dist/manifest/validators/version-match.d.cts.map +1 -0
- package/dist/manifest/validators/version-match.d.mts +6 -0
- package/dist/manifest/validators/version-match.d.mts.map +1 -0
- package/dist/manifest/validators/version-match.mjs +16 -7
- package/dist/manifest/validators/version-match.mjs.map +1 -1
- package/dist/mock.cjs +113 -0
- package/dist/mock.cjs.map +1 -0
- package/dist/mock.d.cts +15 -0
- package/dist/mock.d.cts.map +1 -0
- package/dist/mock.d.mts +15 -0
- package/dist/mock.d.mts.map +1 -0
- package/dist/mock.mjs +103 -11
- package/dist/mock.mjs.map +1 -1
- package/dist/namespace.cjs +136 -0
- package/dist/namespace.cjs.map +1 -0
- package/dist/namespace.d.cts +130 -0
- package/dist/namespace.d.cts.map +1 -0
- package/dist/namespace.d.mts +130 -0
- package/dist/namespace.d.mts.map +1 -0
- package/dist/namespace.mjs +125 -43
- package/dist/namespace.mjs.map +1 -1
- package/dist/node.cjs +25 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +8 -0
- package/dist/node.d.cts.map +1 -0
- package/dist/node.d.mts +8 -0
- package/dist/node.d.mts.map +1 -0
- package/dist/node.mjs +8 -475
- package/dist/node.mjs.map +1 -1
- package/dist/path.cjs +21 -0
- package/dist/path.cjs.map +1 -0
- package/dist/path.d.cts +8 -0
- package/dist/path.d.cts.map +1 -0
- package/dist/path.d.mts +8 -0
- package/dist/path.d.mts.map +1 -0
- package/dist/path.mjs +16 -7
- package/dist/path.mjs.map +1 -1
- package/dist/post-process.cjs +339 -0
- package/dist/post-process.cjs.map +1 -0
- package/dist/post-process.d.cts +72 -0
- package/dist/post-process.d.cts.map +1 -0
- package/dist/post-process.d.mts +72 -0
- package/dist/post-process.d.mts.map +1 -0
- package/dist/post-process.mjs +335 -9
- package/dist/post-process.mjs.map +1 -1
- package/dist/promise.cjs +3 -0
- package/dist/promise.cjs.map +1 -0
- package/dist/promise.d.cts +2 -0
- package/dist/promise.d.cts.map +1 -0
- package/dist/promise.d.mts +2 -0
- package/dist/promise.d.mts.map +1 -0
- package/dist/promise.mjs +1 -1
- package/dist/promise.mjs.map +1 -1
- package/dist/snaps.cjs +207 -0
- package/dist/snaps.cjs.map +1 -0
- package/dist/snaps.d.cts +170 -0
- package/dist/snaps.d.cts.map +1 -0
- package/dist/snaps.d.mts +170 -0
- package/dist/snaps.d.mts.map +1 -0
- package/dist/snaps.mjs +200 -45
- package/dist/snaps.mjs.map +1 -1
- package/dist/strings.cjs +15 -0
- package/dist/strings.cjs.map +1 -0
- package/dist/strings.d.cts +9 -0
- package/dist/strings.d.cts.map +1 -0
- package/dist/strings.d.mts +9 -0
- package/dist/strings.d.mts.map +1 -0
- package/dist/strings.mjs +10 -7
- package/dist/strings.mjs.map +1 -1
- package/dist/structs.cjs +316 -0
- package/dist/structs.cjs.map +1 -0
- package/dist/structs.d.cts +181 -0
- package/dist/structs.d.cts.map +1 -0
- package/dist/structs.d.mts +181 -0
- package/dist/structs.d.mts.map +1 -0
- package/dist/structs.mjs +300 -32
- package/dist/structs.mjs.map +1 -1
- package/dist/svg.cjs +49 -0
- package/dist/svg.cjs.map +1 -0
- package/dist/svg.d.cts +15 -0
- package/dist/svg.d.cts.map +1 -0
- package/dist/svg.d.mts +15 -0
- package/dist/svg.d.mts.map +1 -0
- package/dist/svg.mjs +43 -9
- package/dist/svg.mjs.map +1 -1
- package/dist/types.cjs +64 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.cts +104 -0
- package/dist/types.d.cts.map +1 -0
- package/dist/types.d.mts +104 -0
- package/dist/types.d.mts.map +1 -0
- package/dist/types.mjs +58 -21
- package/dist/types.mjs.map +1 -1
- package/dist/ui.cjs +405 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +93 -0
- package/dist/ui.d.cts.map +1 -0
- package/dist/ui.d.mts +93 -0
- package/dist/ui.d.mts.map +1 -0
- package/dist/ui.mjs +391 -23
- package/dist/ui.mjs.map +1 -1
- package/dist/validation.cjs +23 -0
- package/dist/validation.cjs.map +1 -0
- package/dist/validation.d.cts +9 -0
- package/dist/validation.d.cts.map +1 -0
- package/dist/validation.d.mts +9 -0
- package/dist/validation.d.mts.map +1 -0
- package/dist/validation.mjs +18 -26
- package/dist/validation.mjs.map +1 -1
- package/dist/versions.cjs +44 -0
- package/dist/versions.cjs.map +1 -0
- package/dist/versions.d.cts +22 -0
- package/dist/versions.d.cts.map +1 -0
- package/dist/versions.d.mts +22 -0
- package/dist/versions.d.mts.map +1 -0
- package/dist/versions.mjs +38 -11
- package/dist/versions.mjs.map +1 -1
- package/dist/virtual-file/VirtualFile.cjs +75 -0
- package/dist/virtual-file/VirtualFile.cjs.map +1 -0
- package/dist/virtual-file/VirtualFile.d.cts +35 -0
- package/dist/virtual-file/VirtualFile.d.cts.map +1 -0
- package/dist/virtual-file/VirtualFile.d.mts +35 -0
- package/dist/virtual-file/VirtualFile.d.mts.map +1 -0
- package/dist/virtual-file/VirtualFile.mjs +70 -8
- package/dist/virtual-file/VirtualFile.mjs.map +1 -1
- package/dist/virtual-file/index.cjs +18 -0
- package/dist/virtual-file/index.cjs.map +1 -0
- package/dist/virtual-file/index.d.cts +2 -0
- package/dist/virtual-file/index.d.cts.map +1 -0
- package/dist/virtual-file/index.d.mts +2 -0
- package/dist/virtual-file/index.d.mts.map +1 -0
- package/dist/virtual-file/index.mjs +1 -9
- package/dist/virtual-file/index.mjs.map +1 -1
- package/dist/virtual-file/node.cjs +19 -0
- package/dist/virtual-file/node.cjs.map +1 -0
- package/dist/virtual-file/node.d.cts +3 -0
- package/dist/virtual-file/node.d.cts.map +1 -0
- package/dist/virtual-file/node.d.mts +3 -0
- package/dist/virtual-file/node.d.mts.map +1 -0
- package/dist/virtual-file/node.mjs +2 -16
- package/dist/virtual-file/node.mjs.map +1 -1
- package/dist/virtual-file/toVirtualFile.cjs +31 -0
- package/dist/virtual-file/toVirtualFile.cjs.map +1 -0
- package/dist/virtual-file/toVirtualFile.d.cts +24 -0
- package/dist/virtual-file/toVirtualFile.d.cts.map +1 -0
- package/dist/virtual-file/toVirtualFile.d.mts +24 -0
- package/dist/virtual-file/toVirtualFile.d.mts.map +1 -0
- package/dist/virtual-file/toVirtualFile.mjs +25 -11
- package/dist/virtual-file/toVirtualFile.mjs.map +1 -1
- package/package.json +36 -24
- package/dist/array.js +0 -8
- package/dist/array.js.map +0 -1
- package/dist/auxiliary-files.js +0 -15
- package/dist/auxiliary-files.js.map +0 -1
- package/dist/base64.js +0 -13
- package/dist/base64.js.map +0 -1
- package/dist/bytes.js +0 -10
- package/dist/bytes.js.map +0 -1
- package/dist/caveats.js +0 -8
- package/dist/caveats.js.map +0 -1
- package/dist/checksum.js +0 -13
- package/dist/checksum.js.map +0 -1
- package/dist/chunk-37EUH3KZ.js +0 -293
- package/dist/chunk-37EUH3KZ.js.map +0 -1
- package/dist/chunk-3N27GIUS.mjs +0 -229
- package/dist/chunk-3N27GIUS.mjs.map +0 -1
- package/dist/chunk-3OXW5H4F.js +0 -30
- package/dist/chunk-3OXW5H4F.js.map +0 -1
- package/dist/chunk-3RFGTBEP.js +0 -151
- package/dist/chunk-3RFGTBEP.js.map +0 -1
- package/dist/chunk-3RUWAMJT.mjs +0 -31
- package/dist/chunk-3RUWAMJT.mjs.map +0 -1
- package/dist/chunk-3S4INAGA.mjs +0 -18
- package/dist/chunk-3S4INAGA.mjs.map +0 -1
- package/dist/chunk-44VFHYJO.js +0 -249
- package/dist/chunk-44VFHYJO.js.map +0 -1
- package/dist/chunk-4AA3TKRJ.mjs +0 -153
- package/dist/chunk-4AA3TKRJ.mjs.map +0 -1
- package/dist/chunk-4BGZ2CHC.mjs +0 -22
- package/dist/chunk-4BGZ2CHC.mjs.map +0 -1
- package/dist/chunk-4CMD46B2.js +0 -1
- package/dist/chunk-4CMD46B2.js.map +0 -1
- package/dist/chunk-4RYTYEUQ.mjs +0 -33
- package/dist/chunk-4RYTYEUQ.mjs.map +0 -1
- package/dist/chunk-4ZJOU3LR.js +0 -71
- package/dist/chunk-4ZJOU3LR.js.map +0 -1
- package/dist/chunk-53QXTM77.js +0 -229
- package/dist/chunk-53QXTM77.js.map +0 -1
- package/dist/chunk-5FTBWYCW.mjs +0 -27
- package/dist/chunk-5FTBWYCW.mjs.map +0 -1
- package/dist/chunk-5MABKEV7.mjs +0 -66
- package/dist/chunk-5MABKEV7.mjs.map +0 -1
- package/dist/chunk-5R7UF7KM.mjs +0 -21
- package/dist/chunk-5R7UF7KM.mjs.map +0 -1
- package/dist/chunk-5UAPBOKO.js +0 -37
- package/dist/chunk-5UAPBOKO.js.map +0 -1
- package/dist/chunk-5WKQI22S.js +0 -7
- package/dist/chunk-5WKQI22S.js.map +0 -1
- package/dist/chunk-63OXILAY.mjs +0 -69
- package/dist/chunk-63OXILAY.mjs.map +0 -1
- package/dist/chunk-6ATNGN44.js +0 -300
- package/dist/chunk-6ATNGN44.js.map +0 -1
- package/dist/chunk-6HXIPMBN.js +0 -103
- package/dist/chunk-6HXIPMBN.js.map +0 -1
- package/dist/chunk-6YJWU77L.js +0 -19
- package/dist/chunk-6YJWU77L.js.map +0 -1
- package/dist/chunk-7HLSXEHK.mjs +0 -300
- package/dist/chunk-7HLSXEHK.mjs.map +0 -1
- package/dist/chunk-7LG4D4XA.mjs +0 -20
- package/dist/chunk-7LG4D4XA.mjs.map +0 -1
- package/dist/chunk-7P62OIGX.js +0 -69
- package/dist/chunk-7P62OIGX.js.map +0 -1
- package/dist/chunk-7T7FYH77.mjs +0 -37
- package/dist/chunk-7T7FYH77.mjs.map +0 -1
- package/dist/chunk-7VJ2BOVU.js +0 -15
- package/dist/chunk-7VJ2BOVU.js.map +0 -1
- package/dist/chunk-A3RRMELT.mjs +0 -1
- package/dist/chunk-A3RRMELT.mjs.map +0 -1
- package/dist/chunk-AMW2VJ3N.js +0 -32
- package/dist/chunk-AMW2VJ3N.js.map +0 -1
- package/dist/chunk-ANYNWSCA.mjs +0 -104
- package/dist/chunk-ANYNWSCA.mjs.map +0 -1
- package/dist/chunk-AOGVLPQZ.js +0 -18
- package/dist/chunk-AOGVLPQZ.js.map +0 -1
- package/dist/chunk-AS5P6JRP.mjs +0 -9
- package/dist/chunk-AS5P6JRP.mjs.map +0 -1
- package/dist/chunk-ASZWZ7JT.js +0 -20
- package/dist/chunk-ASZWZ7JT.js.map +0 -1
- package/dist/chunk-B5GNTDE2.js +0 -109
- package/dist/chunk-B5GNTDE2.js.map +0 -1
- package/dist/chunk-BGSO2GQC.mjs +0 -41
- package/dist/chunk-BGSO2GQC.mjs.map +0 -1
- package/dist/chunk-BPK5BH7K.js +0 -27
- package/dist/chunk-BPK5BH7K.js.map +0 -1
- package/dist/chunk-CJK7DDV2.mjs +0 -109
- package/dist/chunk-CJK7DDV2.mjs.map +0 -1
- package/dist/chunk-CPG2UGAA.js +0 -25
- package/dist/chunk-CPG2UGAA.js.map +0 -1
- package/dist/chunk-DE22V5AO.mjs +0 -53
- package/dist/chunk-DE22V5AO.mjs.map +0 -1
- package/dist/chunk-DEQUNIME.js +0 -53
- package/dist/chunk-DEQUNIME.js.map +0 -1
- package/dist/chunk-DKO64Y4H.mjs +0 -27
- package/dist/chunk-DKO64Y4H.mjs.map +0 -1
- package/dist/chunk-E3BDBG6T.js +0 -20
- package/dist/chunk-E3BDBG6T.js.map +0 -1
- package/dist/chunk-EFRPCO3C.js +0 -1
- package/dist/chunk-EFRPCO3C.js.map +0 -1
- package/dist/chunk-EVHDXNOC.mjs +0 -35
- package/dist/chunk-EVHDXNOC.mjs.map +0 -1
- package/dist/chunk-EYWMVDCD.mjs +0 -25
- package/dist/chunk-EYWMVDCD.mjs.map +0 -1
- package/dist/chunk-FA4QIZH6.js +0 -1
- package/dist/chunk-FA4QIZH6.js.map +0 -1
- package/dist/chunk-FBZ5SU7X.js +0 -189
- package/dist/chunk-FBZ5SU7X.js.map +0 -1
- package/dist/chunk-GIVJAZ2Q.mjs +0 -248
- package/dist/chunk-GIVJAZ2Q.mjs.map +0 -1
- package/dist/chunk-GJAVOB7B.js +0 -24
- package/dist/chunk-GJAVOB7B.js.map +0 -1
- package/dist/chunk-GXSTPU7D.mjs +0 -293
- package/dist/chunk-GXSTPU7D.mjs.map +0 -1
- package/dist/chunk-HY4W6BUH.mjs +0 -24
- package/dist/chunk-HY4W6BUH.mjs.map +0 -1
- package/dist/chunk-HYF7Q6VY.mjs +0 -1
- package/dist/chunk-HYF7Q6VY.mjs.map +0 -1
- package/dist/chunk-I2SWLZ34.js +0 -30
- package/dist/chunk-I2SWLZ34.js.map +0 -1
- package/dist/chunk-IELPPZJP.mjs +0 -189
- package/dist/chunk-IELPPZJP.mjs.map +0 -1
- package/dist/chunk-IJX3CXOY.js +0 -9
- package/dist/chunk-IJX3CXOY.js.map +0 -1
- package/dist/chunk-IPUL74MZ.mjs +0 -30
- package/dist/chunk-IPUL74MZ.mjs.map +0 -1
- package/dist/chunk-IV3FSWZ7.mjs +0 -9
- package/dist/chunk-IV3FSWZ7.mjs.map +0 -1
- package/dist/chunk-IVDERT5W.js +0 -22
- package/dist/chunk-IVDERT5W.js.map +0 -1
- package/dist/chunk-JETPRED3.js +0 -248
- package/dist/chunk-JETPRED3.js.map +0 -1
- package/dist/chunk-JI5NQ2C3.mjs +0 -1
- package/dist/chunk-JI5NQ2C3.mjs.map +0 -1
- package/dist/chunk-JJTIVHFX.mjs +0 -38
- package/dist/chunk-JJTIVHFX.mjs.map +0 -1
- package/dist/chunk-L2DHOOBX.js +0 -33
- package/dist/chunk-L2DHOOBX.js.map +0 -1
- package/dist/chunk-LEKZPKS2.js +0 -21
- package/dist/chunk-LEKZPKS2.js.map +0 -1
- package/dist/chunk-LHQP7CUJ.mjs +0 -107
- package/dist/chunk-LHQP7CUJ.mjs.map +0 -1
- package/dist/chunk-LOJA2ZS4.js +0 -107
- package/dist/chunk-LOJA2ZS4.js.map +0 -1
- package/dist/chunk-LQSEBGOX.js +0 -34
- package/dist/chunk-LQSEBGOX.js.map +0 -1
- package/dist/chunk-MDOG3S4V.mjs +0 -34
- package/dist/chunk-MDOG3S4V.mjs.map +0 -1
- package/dist/chunk-MFGLB75H.mjs +0 -22
- package/dist/chunk-MFGLB75H.mjs.map +0 -1
- package/dist/chunk-MKFQAXRF.js +0 -21
- package/dist/chunk-MKFQAXRF.js.map +0 -1
- package/dist/chunk-MQURBEO4.mjs +0 -16
- package/dist/chunk-MQURBEO4.mjs.map +0 -1
- package/dist/chunk-MWAZGSRO.js +0 -75
- package/dist/chunk-MWAZGSRO.js.map +0 -1
- package/dist/chunk-N2JAYIUP.mjs +0 -75
- package/dist/chunk-N2JAYIUP.mjs.map +0 -1
- package/dist/chunk-N4MA537G.js +0 -22
- package/dist/chunk-N4MA537G.js.map +0 -1
- package/dist/chunk-N5HVDE3P.mjs +0 -30
- package/dist/chunk-N5HVDE3P.mjs.map +0 -1
- package/dist/chunk-N722KRZW.js +0 -41
- package/dist/chunk-N722KRZW.js.map +0 -1
- package/dist/chunk-NNYGTNHP.mjs +0 -1
- package/dist/chunk-NNYGTNHP.mjs.map +0 -1
- package/dist/chunk-NSVVZNSD.mjs +0 -183
- package/dist/chunk-NSVVZNSD.mjs.map +0 -1
- package/dist/chunk-NUCLSR2G.js +0 -8
- package/dist/chunk-NUCLSR2G.js.map +0 -1
- package/dist/chunk-OBN2WDFU.js +0 -38
- package/dist/chunk-OBN2WDFU.js.map +0 -1
- package/dist/chunk-P252LKUT.mjs +0 -9
- package/dist/chunk-P252LKUT.mjs.map +0 -1
- package/dist/chunk-PAOTMYIM.mjs +0 -69
- package/dist/chunk-PAOTMYIM.mjs.map +0 -1
- package/dist/chunk-PJMEJVOB.mjs +0 -29
- package/dist/chunk-PJMEJVOB.mjs.map +0 -1
- package/dist/chunk-PLBSSUVY.js +0 -29
- package/dist/chunk-PLBSSUVY.js.map +0 -1
- package/dist/chunk-PLNIERDY.js +0 -34
- package/dist/chunk-PLNIERDY.js.map +0 -1
- package/dist/chunk-PO5BBHHX.mjs +0 -22
- package/dist/chunk-PO5BBHHX.mjs.map +0 -1
- package/dist/chunk-PTOH2SVI.mjs +0 -55
- package/dist/chunk-PTOH2SVI.mjs.map +0 -1
- package/dist/chunk-PZF4KWU2.mjs +0 -151
- package/dist/chunk-PZF4KWU2.mjs.map +0 -1
- package/dist/chunk-QD3LTING.js +0 -34
- package/dist/chunk-QD3LTING.js.map +0 -1
- package/dist/chunk-QGCNQRIQ.js +0 -35
- package/dist/chunk-QGCNQRIQ.js.map +0 -1
- package/dist/chunk-QYPLUMB7.mjs +0 -249
- package/dist/chunk-QYPLUMB7.mjs.map +0 -1
- package/dist/chunk-RAZ7XG4Z.mjs +0 -1
- package/dist/chunk-RAZ7XG4Z.mjs.map +0 -1
- package/dist/chunk-RNMJQSVQ.js +0 -69
- package/dist/chunk-RNMJQSVQ.js.map +0 -1
- package/dist/chunk-RRFKK45V.mjs +0 -15
- package/dist/chunk-RRFKK45V.mjs.map +0 -1
- package/dist/chunk-S3BWTUTZ.js +0 -31
- package/dist/chunk-S3BWTUTZ.js.map +0 -1
- package/dist/chunk-SKKANJ45.mjs +0 -19
- package/dist/chunk-SKKANJ45.mjs.map +0 -1
- package/dist/chunk-SPCIIRSB.mjs +0 -7
- package/dist/chunk-SPCIIRSB.mjs.map +0 -1
- package/dist/chunk-SRMDDOVO.mjs +0 -20
- package/dist/chunk-SRMDDOVO.mjs.map +0 -1
- package/dist/chunk-SYYDKPK3.js +0 -15
- package/dist/chunk-SYYDKPK3.js.map +0 -1
- package/dist/chunk-T2VA4YJE.js +0 -104
- package/dist/chunk-T2VA4YJE.js.map +0 -1
- package/dist/chunk-T3VM5YXY.js +0 -1
- package/dist/chunk-T3VM5YXY.js.map +0 -1
- package/dist/chunk-T3YY4JIJ.js +0 -9
- package/dist/chunk-T3YY4JIJ.js.map +0 -1
- package/dist/chunk-T5ZOOZ46.js +0 -22
- package/dist/chunk-T5ZOOZ46.js.map +0 -1
- package/dist/chunk-TAMKWZ4E.js +0 -183
- package/dist/chunk-TAMKWZ4E.js.map +0 -1
- package/dist/chunk-TFP64TMV.js +0 -1
- package/dist/chunk-TFP64TMV.js.map +0 -1
- package/dist/chunk-TYWGZIOF.mjs +0 -34
- package/dist/chunk-TYWGZIOF.mjs.map +0 -1
- package/dist/chunk-UAINMOUU.js +0 -18
- package/dist/chunk-UAINMOUU.js.map +0 -1
- package/dist/chunk-UNNEBOL4.mjs +0 -15
- package/dist/chunk-UNNEBOL4.mjs.map +0 -1
- package/dist/chunk-UW74NLTC.mjs +0 -18
- package/dist/chunk-UW74NLTC.mjs.map +0 -1
- package/dist/chunk-VBYSWMSU.js +0 -66
- package/dist/chunk-VBYSWMSU.js.map +0 -1
- package/dist/chunk-VEPYH26P.js +0 -27
- package/dist/chunk-VEPYH26P.js.map +0 -1
- package/dist/chunk-VIAHMNTA.mjs +0 -34
- package/dist/chunk-VIAHMNTA.mjs.map +0 -1
- package/dist/chunk-VWLBM7XM.js +0 -1
- package/dist/chunk-VWLBM7XM.js.map +0 -1
- package/dist/chunk-W7A3BYUP.mjs +0 -1
- package/dist/chunk-W7A3BYUP.mjs.map +0 -1
- package/dist/chunk-W7KRIAIX.js +0 -55
- package/dist/chunk-W7KRIAIX.js.map +0 -1
- package/dist/chunk-X2GGUOMY.js +0 -153
- package/dist/chunk-X2GGUOMY.js.map +0 -1
- package/dist/chunk-X3UZCGO5.mjs +0 -103
- package/dist/chunk-X3UZCGO5.mjs.map +0 -1
- package/dist/chunk-XF2AZMWG.mjs +0 -32
- package/dist/chunk-XF2AZMWG.mjs.map +0 -1
- package/dist/chunk-XWYJQWHG.js +0 -56
- package/dist/chunk-XWYJQWHG.js.map +0 -1
- package/dist/chunk-XZ7362GQ.mjs +0 -63
- package/dist/chunk-XZ7362GQ.mjs.map +0 -1
- package/dist/chunk-XZNJFDBF.mjs +0 -21
- package/dist/chunk-XZNJFDBF.mjs.map +0 -1
- package/dist/chunk-YJHQZFR4.mjs +0 -71
- package/dist/chunk-YJHQZFR4.mjs.map +0 -1
- package/dist/chunk-YL2EHYAA.js +0 -16
- package/dist/chunk-YL2EHYAA.js.map +0 -1
- package/dist/chunk-Z2JQNSVL.mjs +0 -8
- package/dist/chunk-Z2JQNSVL.mjs.map +0 -1
- package/dist/chunk-ZT3KKTS2.js +0 -9
- package/dist/chunk-ZT3KKTS2.js.map +0 -1
- package/dist/constants.js +0 -8
- package/dist/constants.js.map +0 -1
- package/dist/cronjob.js +0 -20
- package/dist/cronjob.js.map +0 -1
- package/dist/deep-clone.js +0 -8
- package/dist/deep-clone.js.map +0 -1
- package/dist/default-endowments.js +0 -8
- package/dist/default-endowments.js.map +0 -1
- package/dist/derivation-paths.js +0 -13
- package/dist/derivation-paths.js.map +0 -1
- package/dist/entropy.js +0 -10
- package/dist/entropy.js.map +0 -1
- package/dist/errors.js +0 -20
- package/dist/errors.js.map +0 -1
- package/dist/eval-worker.js +0 -43
- package/dist/eval-worker.js.map +0 -1
- package/dist/eval.js +0 -17
- package/dist/eval.js.map +0 -1
- package/dist/fs.js +0 -28
- package/dist/fs.js.map +0 -1
- package/dist/handler-types.js +0 -10
- package/dist/handler-types.js.map +0 -1
- package/dist/handlers.js +0 -35
- package/dist/handlers.js.map +0 -1
- package/dist/icon.js +0 -15
- package/dist/icon.js.map +0 -1
- package/dist/iframe.js +0 -8
- package/dist/iframe.js.map +0 -1
- package/dist/index.executionenv.js +0 -128
- package/dist/index.executionenv.js.map +0 -1
- package/dist/index.js +0 -398
- package/dist/index.js.map +0 -1
- package/dist/json-rpc.js +0 -18
- package/dist/json-rpc.js.map +0 -1
- package/dist/json.js +0 -10
- package/dist/json.js.map +0 -1
- package/dist/localization.js +0 -23
- package/dist/localization.js.map +0 -1
- package/dist/logging.js +0 -14
- package/dist/logging.js.map +0 -1
- package/dist/manifest/index.js +0 -65
- package/dist/manifest/index.js.map +0 -1
- package/dist/manifest/manifest.js +0 -59
- package/dist/manifest/manifest.js.map +0 -1
- package/dist/manifest/node.js +0 -106
- package/dist/manifest/node.js.map +0 -1
- package/dist/manifest/validation.js +0 -64
- package/dist/manifest/validation.js.map +0 -1
- package/dist/manifest/validator-types.js +0 -1
- package/dist/manifest/validator-types.js.map +0 -1
- package/dist/manifest/validator.js +0 -44
- package/dist/manifest/validator.js.map +0 -1
- package/dist/manifest/validators/checksum.js +0 -15
- package/dist/manifest/validators/checksum.js.map +0 -1
- package/dist/manifest/validators/expected-files.js +0 -9
- package/dist/manifest/validators/expected-files.js.map +0 -1
- package/dist/manifest/validators/icon-declared.js +0 -8
- package/dist/manifest/validators/icon-declared.js.map +0 -1
- package/dist/manifest/validators/icon-dimensions.js +0 -10
- package/dist/manifest/validators/icon-dimensions.js.map +0 -1
- package/dist/manifest/validators/icon-missing.js +0 -8
- package/dist/manifest/validators/icon-missing.js.map +0 -1
- package/dist/manifest/validators/index.js +0 -80
- package/dist/manifest/validators/index.js.map +0 -1
- package/dist/manifest/validators/is-localization-file.js +0 -12
- package/dist/manifest/validators/is-localization-file.js.map +0 -1
- package/dist/manifest/validators/is-package-json.js +0 -11
- package/dist/manifest/validators/is-package-json.js.map +0 -1
- package/dist/manifest/validators/is-snap-icon.js +0 -10
- package/dist/manifest/validators/is-snap-icon.js.map +0 -1
- package/dist/manifest/validators/is-snap-manifest.js +0 -23
- package/dist/manifest/validators/is-snap-manifest.js.map +0 -1
- package/dist/manifest/validators/manifest-localization.js +0 -10
- package/dist/manifest/validators/manifest-localization.js.map +0 -1
- package/dist/manifest/validators/package-json-recommended-fields.js +0 -8
- package/dist/manifest/validators/package-json-recommended-fields.js.map +0 -1
- package/dist/manifest/validators/package-name-match.js +0 -9
- package/dist/manifest/validators/package-name-match.js.map +0 -1
- package/dist/manifest/validators/repository-match.js +0 -10
- package/dist/manifest/validators/repository-match.js.map +0 -1
- package/dist/manifest/validators/version-match.js +0 -9
- package/dist/manifest/validators/version-match.js.map +0 -1
- package/dist/mock.js +0 -13
- package/dist/mock.js.map +0 -1
- package/dist/namespace.js +0 -44
- package/dist/namespace.js.map +0 -1
- package/dist/node.js +0 -476
- package/dist/node.js.map +0 -1
- package/dist/path.js +0 -8
- package/dist/path.js.map +0 -1
- package/dist/post-process.js +0 -10
- package/dist/post-process.js.map +0 -1
- package/dist/promise.js +0 -2
- package/dist/promise.js.map +0 -1
- package/dist/snaps.js +0 -46
- package/dist/snaps.js.map +0 -1
- package/dist/strings.js +0 -8
- package/dist/strings.js.map +0 -1
- package/dist/structs.js +0 -33
- package/dist/structs.js.map +0 -1
- package/dist/svg.js +0 -10
- package/dist/svg.js.map +0 -1
- package/dist/tsconfig.build.tsbuildinfo +0 -1
- package/dist/types/array.d.ts +0 -10
- package/dist/types/auxiliary-files.d.ts +0 -16
- package/dist/types/base64.d.ts +0 -15
- package/dist/types/bytes.d.ts +0 -8
- package/dist/types/caveats.d.ts +0 -46
- package/dist/types/checksum.d.ts +0 -21
- package/dist/types/constants.d.ts +0 -1
- package/dist/types/cronjob.d.ts +0 -89
- package/dist/types/deep-clone.d.ts +0 -1
- package/dist/types/default-endowments.d.ts +0 -4
- package/dist/types/derivation-paths.d.ts +0 -24
- package/dist/types/entropy.d.ts +0 -3
- package/dist/types/errors.d.ts +0 -84
- package/dist/types/eval-worker.d.ts +0 -1
- package/dist/types/eval.d.ts +0 -16
- package/dist/types/fs.d.ts +0 -69
- package/dist/types/handler-types.d.ts +0 -34
- package/dist/types/handlers.d.ts +0 -749
- package/dist/types/icon.d.ts +0 -19
- package/dist/types/iframe.d.ts +0 -11
- package/dist/types/iframe.test.browser.d.ts +0 -1
- package/dist/types/index.d.ts +0 -32
- package/dist/types/index.executionenv.d.ts +0 -7
- package/dist/types/json-rpc.d.ts +0 -55
- package/dist/types/json.d.ts +0 -22
- package/dist/types/localization.d.ts +0 -145
- package/dist/types/logging.d.ts +0 -49
- package/dist/types/manifest/index.d.ts +0 -1
- package/dist/types/manifest/manifest.d.ts +0 -98
- package/dist/types/manifest/node.d.ts +0 -2
- package/dist/types/manifest/validation.d.ts +0 -253
- package/dist/types/manifest/validator-types.d.ts +0 -34
- package/dist/types/manifest/validator.d.ts +0 -22
- package/dist/types/manifest/validators/checksum.d.ts +0 -5
- package/dist/types/manifest/validators/expected-files.d.ts +0 -5
- package/dist/types/manifest/validators/icon-declared.d.ts +0 -5
- package/dist/types/manifest/validators/icon-dimensions.d.ts +0 -5
- package/dist/types/manifest/validators/icon-missing.d.ts +0 -5
- package/dist/types/manifest/validators/index.d.ts +0 -14
- package/dist/types/manifest/validators/is-localization-file.d.ts +0 -5
- package/dist/types/manifest/validators/is-package-json.d.ts +0 -5
- package/dist/types/manifest/validators/is-snap-icon.d.ts +0 -5
- package/dist/types/manifest/validators/is-snap-manifest.d.ts +0 -5
- package/dist/types/manifest/validators/manifest-localization.d.ts +0 -5
- package/dist/types/manifest/validators/package-json-recommended-fields.d.ts +0 -5
- package/dist/types/manifest/validators/package-name-match.d.ts +0 -5
- package/dist/types/manifest/validators/repository-match.d.ts +0 -5
- package/dist/types/manifest/validators/version-match.d.ts +0 -5
- package/dist/types/mock.d.ts +0 -14
- package/dist/types/namespace.d.ts +0 -129
- package/dist/types/node.d.ts +0 -7
- package/dist/types/path.d.ts +0 -7
- package/dist/types/post-process.d.ts +0 -71
- package/dist/types/promise.d.ts +0 -1
- package/dist/types/snaps.d.ts +0 -169
- package/dist/types/strings.d.ts +0 -8
- package/dist/types/structs.d.ts +0 -180
- package/dist/types/svg.d.ts +0 -14
- package/dist/types/types.d.ts +0 -103
- package/dist/types/ui.d.ts +0 -84
- package/dist/types/validation.d.ts +0 -8
- package/dist/types/versions.d.ts +0 -21
- package/dist/types/virtual-file/VirtualFile.d.ts +0 -34
- package/dist/types/virtual-file/index.d.ts +0 -1
- package/dist/types/virtual-file/node.d.ts +0 -2
- package/dist/types/virtual-file/toVirtualFile.d.ts +0 -21
- package/dist/types.js +0 -22
- package/dist/types.js.map +0 -1
- package/dist/ui.js +0 -24
- package/dist/ui.js.map +0 -1
- package/dist/validation.js +0 -27
- package/dist/validation.js.map +0 -1
- package/dist/versions.js +0 -12
- package/dist/versions.js.map +0 -1
- package/dist/virtual-file/VirtualFile.js +0 -9
- package/dist/virtual-file/VirtualFile.js.map +0 -1
- package/dist/virtual-file/index.js +0 -10
- package/dist/virtual-file/index.js.map +0 -1
- package/dist/virtual-file/node.js +0 -17
- package/dist/virtual-file/node.js.map +0 -1
- package/dist/virtual-file/toVirtualFile.js +0 -12
- package/dist/virtual-file/toVirtualFile.js.map +0 -1
package/dist/chunk-53QXTM77.js
DELETED
|
@@ -1,229 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunkIJX3CXOYjs = require('./chunk-IJX3CXOY.js');
|
|
4
|
-
|
|
5
|
-
// src/structs.ts
|
|
6
|
-
var _snapssdk = require('@metamask/snaps-sdk');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
var _superstruct = require('@metamask/superstruct');
|
|
16
|
-
var _utils = require('@metamask/utils');
|
|
17
|
-
var _chalk = require('chalk');
|
|
18
|
-
function color(value, colorFunction, enabled) {
|
|
19
|
-
if (enabled) {
|
|
20
|
-
return colorFunction(value);
|
|
21
|
-
}
|
|
22
|
-
return value;
|
|
23
|
-
}
|
|
24
|
-
function named(name, struct) {
|
|
25
|
-
return new (0, _superstruct.Struct)({
|
|
26
|
-
...struct,
|
|
27
|
-
type: name
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
var SnapsStructError = class extends _superstruct.StructError {
|
|
31
|
-
constructor(struct, prefix, suffix, failure, failures, colorize = true) {
|
|
32
|
-
super(failure, failures);
|
|
33
|
-
this.name = "SnapsStructError";
|
|
34
|
-
this.message = `${prefix}.
|
|
35
|
-
|
|
36
|
-
${getStructErrorMessage(
|
|
37
|
-
struct,
|
|
38
|
-
[...failures()],
|
|
39
|
-
colorize
|
|
40
|
-
)}${suffix ? `
|
|
41
|
-
|
|
42
|
-
${suffix}` : ""}`;
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
function* arrayToGenerator(array) {
|
|
46
|
-
for (const item of array) {
|
|
47
|
-
yield item;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
function getError({
|
|
51
|
-
struct,
|
|
52
|
-
prefix,
|
|
53
|
-
suffix = "",
|
|
54
|
-
error,
|
|
55
|
-
colorize
|
|
56
|
-
}) {
|
|
57
|
-
return new SnapsStructError(
|
|
58
|
-
struct,
|
|
59
|
-
prefix,
|
|
60
|
-
suffix,
|
|
61
|
-
error,
|
|
62
|
-
() => arrayToGenerator(error.failures()),
|
|
63
|
-
colorize
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
function createFromStruct(value, struct, prefix, suffix = "") {
|
|
67
|
-
try {
|
|
68
|
-
return _superstruct.create.call(void 0, value, struct);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
if (error instanceof _superstruct.StructError) {
|
|
71
|
-
throw getError({ struct, prefix, suffix, error });
|
|
72
|
-
}
|
|
73
|
-
throw error;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
function getStructFromPath(struct, path) {
|
|
77
|
-
return path.reduce((result, key) => {
|
|
78
|
-
if (_utils.isObject.call(void 0, struct.schema) && struct.schema[key]) {
|
|
79
|
-
return struct.schema[key];
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
}, struct);
|
|
83
|
-
}
|
|
84
|
-
function getUnionStructNames(struct, colorize = true) {
|
|
85
|
-
if (Array.isArray(struct.schema)) {
|
|
86
|
-
return struct.schema.map(({ type }) => color(type, _chalk.green, colorize));
|
|
87
|
-
}
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
function getStructErrorPrefix(failure, colorize = true) {
|
|
91
|
-
if (failure.type === "never" || failure.path.length === 0) {
|
|
92
|
-
return "";
|
|
93
|
-
}
|
|
94
|
-
return `At path: ${color(failure.path.join("."), _chalk.bold, colorize)} \u2014 `;
|
|
95
|
-
}
|
|
96
|
-
function getStructFailureMessage(struct, failure, colorize = true) {
|
|
97
|
-
const received = color(JSON.stringify(failure.value), _chalk.red, colorize);
|
|
98
|
-
const prefix = getStructErrorPrefix(failure, colorize);
|
|
99
|
-
if (failure.type === "union") {
|
|
100
|
-
const childStruct = getStructFromPath(struct, failure.path);
|
|
101
|
-
const unionNames = getUnionStructNames(childStruct, colorize);
|
|
102
|
-
if (unionNames) {
|
|
103
|
-
return `${prefix}Expected the value to be one of: ${unionNames.join(
|
|
104
|
-
", "
|
|
105
|
-
)}, but received: ${received}.`;
|
|
106
|
-
}
|
|
107
|
-
return `${prefix}${failure.message}.`;
|
|
108
|
-
}
|
|
109
|
-
if (failure.type === "literal") {
|
|
110
|
-
const message = failure.message.replace(
|
|
111
|
-
/the literal `(.+)`,/u,
|
|
112
|
-
`the value to be \`${color("$1", _chalk.green, colorize)}\`,`
|
|
113
|
-
).replace(
|
|
114
|
-
/, but received: (.+)/u,
|
|
115
|
-
`, but received: ${color("$1", _chalk.red, colorize)}`
|
|
116
|
-
);
|
|
117
|
-
return `${prefix}${message}.`;
|
|
118
|
-
}
|
|
119
|
-
if (failure.type === "never") {
|
|
120
|
-
return `Unknown key: ${color(
|
|
121
|
-
failure.path.join("."),
|
|
122
|
-
_chalk.bold,
|
|
123
|
-
colorize
|
|
124
|
-
)}, received: ${received}.`;
|
|
125
|
-
}
|
|
126
|
-
if (failure.refinement === "size") {
|
|
127
|
-
const message = failure.message.replace(
|
|
128
|
-
/length between `(\d+)` and `(\d+)`/u,
|
|
129
|
-
`length between ${color("$1", _chalk.green, colorize)} and ${color(
|
|
130
|
-
"$2",
|
|
131
|
-
_chalk.green,
|
|
132
|
-
colorize
|
|
133
|
-
)},`
|
|
134
|
-
).replace(/length of `(\d+)`/u, `length of ${color("$1", _chalk.red, colorize)}`).replace(/a array/u, "an array");
|
|
135
|
-
return `${prefix}${message}.`;
|
|
136
|
-
}
|
|
137
|
-
if (failure.refinement !== void 0) {
|
|
138
|
-
return `${prefix}${failure.message}.`;
|
|
139
|
-
}
|
|
140
|
-
return `${prefix}Expected a value of type ${color(
|
|
141
|
-
failure.type,
|
|
142
|
-
_chalk.green,
|
|
143
|
-
colorize
|
|
144
|
-
)}, but received: ${received}.`;
|
|
145
|
-
}
|
|
146
|
-
function getStructErrorMessage(struct, failures, colorize = true) {
|
|
147
|
-
const formattedFailures = failures.map(
|
|
148
|
-
(failure) => _chunkIJX3CXOYjs.indent.call(void 0, `\u2022 ${getStructFailureMessage(struct, failure, colorize)}`)
|
|
149
|
-
);
|
|
150
|
-
return formattedFailures.join("\n");
|
|
151
|
-
}
|
|
152
|
-
function validateUnion(value, struct, structKey, coerce = false) {
|
|
153
|
-
_utils.assert.call(void 0,
|
|
154
|
-
struct.schema,
|
|
155
|
-
"Expected a struct with a schema. Make sure to use `union` from `@metamask/snaps-sdk`."
|
|
156
|
-
);
|
|
157
|
-
_utils.assert.call(void 0, struct.schema.length > 0, "Expected a non-empty array of structs.");
|
|
158
|
-
const keyUnion = struct.schema.map(
|
|
159
|
-
(innerStruct) => innerStruct.schema[structKey]
|
|
160
|
-
// This is guaranteed to be a non-empty array by the assertion above. We
|
|
161
|
-
// need to cast it since `superstruct` requires a non-empty array of structs
|
|
162
|
-
// for the `union` struct.
|
|
163
|
-
);
|
|
164
|
-
const key = _superstruct.type.call(void 0, {
|
|
165
|
-
[structKey]: _snapssdk.union.call(void 0, keyUnion)
|
|
166
|
-
});
|
|
167
|
-
const [keyError] = _superstruct.validate.call(void 0, value, key, { coerce });
|
|
168
|
-
if (keyError) {
|
|
169
|
-
throw new Error(
|
|
170
|
-
getStructFailureMessage(key, keyError.failures()[0], false)
|
|
171
|
-
);
|
|
172
|
-
}
|
|
173
|
-
const objectValue = value;
|
|
174
|
-
const objectStructs = struct.schema.filter(
|
|
175
|
-
(innerStruct) => _superstruct.is.call(void 0, objectValue[structKey], innerStruct.schema[structKey])
|
|
176
|
-
);
|
|
177
|
-
_utils.assert.call(void 0, objectStructs.length > 0, "Expected a struct to match the value.");
|
|
178
|
-
const validationResults = objectStructs.map(
|
|
179
|
-
(objectStruct) => _superstruct.validate.call(void 0, objectValue, objectStruct, { coerce })
|
|
180
|
-
);
|
|
181
|
-
const validatedValue = validationResults.find(([error]) => !error);
|
|
182
|
-
if (validatedValue) {
|
|
183
|
-
return validatedValue[1];
|
|
184
|
-
}
|
|
185
|
-
_utils.assert.call(void 0, validationResults[0][0], "Expected at least one error.");
|
|
186
|
-
const validationError = validationResults.reduce((error, [innerError]) => {
|
|
187
|
-
_utils.assert.call(void 0, innerError, "Expected an error.");
|
|
188
|
-
if (innerError.failures().length < error.failures().length) {
|
|
189
|
-
return innerError;
|
|
190
|
-
}
|
|
191
|
-
return error;
|
|
192
|
-
}, validationResults[0][0]);
|
|
193
|
-
throw new Error(
|
|
194
|
-
getStructFailureMessage(struct, validationError.failures()[0], false)
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
function createUnion(value, struct, structKey) {
|
|
198
|
-
return validateUnion(value, struct, structKey, true);
|
|
199
|
-
}
|
|
200
|
-
function mergeStructs(...structs) {
|
|
201
|
-
const mergedStruct = _superstruct.assign.call(void 0,
|
|
202
|
-
...structs
|
|
203
|
-
);
|
|
204
|
-
return new (0, _superstruct.Struct)({
|
|
205
|
-
...mergedStruct,
|
|
206
|
-
*refiner(value, ctx) {
|
|
207
|
-
for (const struct of structs) {
|
|
208
|
-
yield* struct.refiner(value, ctx);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
exports.named = named; exports.SnapsStructError = SnapsStructError; exports.arrayToGenerator = arrayToGenerator; exports.getError = getError; exports.createFromStruct = createFromStruct; exports.getStructFromPath = getStructFromPath; exports.getUnionStructNames = getUnionStructNames; exports.getStructErrorPrefix = getStructErrorPrefix; exports.getStructFailureMessage = getStructFailureMessage; exports.getStructErrorMessage = getStructErrorMessage; exports.validateUnion = validateUnion; exports.createUnion = createUnion; exports.mergeStructs = mergeStructs;
|
|
229
|
-
//# sourceMappingURL=chunk-53QXTM77.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/structs.ts"],"names":[],"mappings":"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","sourcesContent":["import { union } from '@metamask/snaps-sdk';\nimport type {\n AnyStruct,\n Assign,\n Failure,\n ObjectSchema,\n ObjectType,\n} from '@metamask/superstruct';\nimport {\n assign,\n is,\n validate,\n type as superstructType,\n Struct,\n StructError,\n create,\n} from '@metamask/superstruct';\nimport type { NonEmptyArray } from '@metamask/utils';\nimport { assert, isObject } from '@metamask/utils';\nimport { bold, green, red } from 'chalk';\n\nimport { indent } from './strings';\n\n/**\n * Infer a struct type, only if it matches the specified type. This is useful\n * for defining types and structs that are related to each other in separate\n * files.\n *\n * @example\n * ```typescript\n * // In file A\n * export type GetFileArgs = {\n * path: string;\n * encoding?: EnumToUnion<AuxiliaryFileEncoding>;\n * };\n *\n * // In file B\n * export const GetFileArgsStruct = object(...);\n *\n * // If the type and struct are in the same file, this will return the type.\n * // Otherwise, it will return `never`.\n * export type GetFileArgs =\n * InferMatching<typeof GetFileArgsStruct, GetFileArgs>;\n * ```\n */\nexport type InferMatching<\n StructType extends Struct<any, any>,\n Type,\n> = StructType['TYPE'] extends Type ? Type : never;\n\n/**\n * Colorize a value with a color function. This is useful for colorizing values\n * in error messages. If colorization is disabled, the original value is\n * returned.\n *\n * @param value - The value to colorize.\n * @param colorFunction - The color function to use.\n * @param enabled - Whether to colorize the value.\n * @returns The colorized value, or the original value if colorization is\n * disabled.\n */\nfunction color(\n value: string,\n colorFunction: (value: string) => string,\n enabled: boolean,\n) {\n if (enabled) {\n return colorFunction(value);\n }\n\n return value;\n}\n\n/**\n * Define a struct, and also define the name of the struct as the given name.\n *\n * This is useful for improving the error messages returned by `superstruct`.\n *\n * @param name - The name of the struct.\n * @param struct - The struct.\n * @returns The struct.\n */\nexport function named<Type, Schema>(\n name: string,\n struct: Struct<Type, Schema>,\n) {\n return new Struct({\n ...struct,\n type: name,\n });\n}\n\nexport class SnapsStructError<Type, Schema> extends StructError {\n constructor(\n struct: Struct<Type, Schema>,\n prefix: string,\n suffix: string,\n failure: StructError,\n failures: () => Generator<Failure>,\n colorize = true,\n ) {\n super(failure, failures);\n\n this.name = 'SnapsStructError';\n this.message = `${prefix}.\\n\\n${getStructErrorMessage(\n struct,\n [...failures()],\n colorize,\n )}${suffix ? `\\n\\n${suffix}` : ''}`;\n }\n}\n\ntype GetErrorOptions<Type, Schema> = {\n struct: Struct<Type, Schema>;\n prefix: string;\n suffix?: string;\n error: StructError;\n colorize?: boolean;\n};\n\n/**\n * Converts an array to a generator function that yields the items in the\n * array.\n *\n * @param array - The array.\n * @returns A generator function.\n * @yields The items in the array.\n */\nexport function* arrayToGenerator<Type>(\n array: Type[],\n): Generator<Type, void, undefined> {\n for (const item of array) {\n yield item;\n }\n}\n\n/**\n * Returns a `SnapsStructError` with the given prefix and suffix.\n *\n * @param options - The options.\n * @param options.struct - The struct that caused the error.\n * @param options.prefix - The prefix to add to the error message.\n * @param options.suffix - The suffix to add to the error message. Defaults to\n * an empty string.\n * @param options.error - The `superstruct` error to wrap.\n * @param options.colorize - Whether to colorize the value. Defaults to `true`.\n * @returns The `SnapsStructError`.\n */\nexport function getError<Type, Schema>({\n struct,\n prefix,\n suffix = '',\n error,\n colorize,\n}: GetErrorOptions<Type, Schema>) {\n return new SnapsStructError(\n struct,\n prefix,\n suffix,\n error,\n () => arrayToGenerator(error.failures()),\n colorize,\n );\n}\n\n/**\n * A wrapper of `superstruct`'s `create` function that throws a\n * `SnapsStructError` instead of a `StructError`. This is useful for improving\n * the error messages returned by `superstruct`.\n *\n * @param value - The value to validate.\n * @param struct - The `superstruct` struct to validate the value against.\n * @param prefix - The prefix to add to the error message.\n * @param suffix - The suffix to add to the error message. Defaults to an empty\n * string.\n * @returns The validated value.\n */\nexport function createFromStruct<Type, Schema>(\n value: unknown,\n struct: Struct<Type, Schema>,\n prefix: string,\n suffix = '',\n) {\n try {\n return create(value, struct);\n } catch (error) {\n if (error instanceof StructError) {\n throw getError({ struct, prefix, suffix, error });\n }\n\n throw error;\n }\n}\n\n/**\n * Get a struct from a failure path.\n *\n * @param struct - The struct.\n * @param path - The failure path.\n * @returns The struct at the failure path.\n */\nexport function getStructFromPath<Type, Schema>(\n struct: Struct<Type, Schema>,\n path: string[],\n) {\n return path.reduce<AnyStruct>((result, key) => {\n if (isObject(struct.schema) && struct.schema[key]) {\n return struct.schema[key] as AnyStruct;\n }\n\n return result;\n }, struct);\n}\n\n/**\n * Get the union struct names from a struct.\n *\n * @param struct - The struct.\n * @param colorize - Whether to colorize the value. Defaults to `true`.\n * @returns The union struct names, or `null` if the struct is not a union\n * struct.\n */\nexport function getUnionStructNames<Type, Schema>(\n struct: Struct<Type, Schema>,\n colorize = true,\n) {\n if (Array.isArray(struct.schema)) {\n return struct.schema.map(({ type }) => color(type, green, colorize));\n }\n\n return null;\n}\n\n/**\n * Get an error prefix from a `superstruct` failure. This is useful for\n * formatting the error message returned by `superstruct`.\n *\n * @param failure - The `superstruct` failure.\n * @param colorize - Whether to colorize the value. Defaults to `true`.\n * @returns The error prefix.\n */\nexport function getStructErrorPrefix(failure: Failure, colorize = true) {\n if (failure.type === 'never' || failure.path.length === 0) {\n return '';\n }\n\n return `At path: ${color(failure.path.join('.'), bold, colorize)} — `;\n}\n\n/**\n * Get a string describing the failure. This is similar to the `message`\n * property of `superstruct`'s `Failure` type, but formats the value in a more\n * readable way.\n *\n * @param struct - The struct that caused the failure.\n * @param failure - The `superstruct` failure.\n * @param colorize - Whether to colorize the value. Defaults to `true`.\n * @returns A string describing the failure.\n */\nexport function getStructFailureMessage<Type, Schema>(\n struct: Struct<Type, Schema>,\n failure: Failure,\n colorize = true,\n) {\n const received = color(JSON.stringify(failure.value), red, colorize);\n const prefix = getStructErrorPrefix(failure, colorize);\n\n if (failure.type === 'union') {\n const childStruct = getStructFromPath(struct, failure.path);\n const unionNames = getUnionStructNames(childStruct, colorize);\n\n if (unionNames) {\n return `${prefix}Expected the value to be one of: ${unionNames.join(\n ', ',\n )}, but received: ${received}.`;\n }\n\n return `${prefix}${failure.message}.`;\n }\n\n if (failure.type === 'literal') {\n // Superstruct's failure does not provide information about which literal\n // value was expected, so we need to parse the message to get the literal.\n const message = failure.message\n .replace(\n /the literal `(.+)`,/u,\n `the value to be \\`${color('$1', green, colorize)}\\`,`,\n )\n .replace(\n /, but received: (.+)/u,\n `, but received: ${color('$1', red, colorize)}`,\n );\n\n return `${prefix}${message}.`;\n }\n\n if (failure.type === 'never') {\n return `Unknown key: ${color(\n failure.path.join('.'),\n bold,\n colorize,\n )}, received: ${received}.`;\n }\n\n if (failure.refinement === 'size') {\n const message = failure.message\n .replace(\n /length between `(\\d+)` and `(\\d+)`/u,\n `length between ${color('$1', green, colorize)} and ${color(\n '$2',\n green,\n colorize,\n )},`,\n )\n .replace(/length of `(\\d+)`/u, `length of ${color('$1', red, colorize)}`)\n .replace(/a array/u, 'an array');\n\n return `${prefix}${message}.`;\n }\n\n // Refinements we built ourselves have nice error messages\n if (failure.refinement !== undefined) {\n return `${prefix}${failure.message}.`;\n }\n\n return `${prefix}Expected a value of type ${color(\n failure.type,\n green,\n colorize,\n )}, but received: ${received}.`;\n}\n\n/**\n * Get a string describing the errors. This formats all the errors in a\n * human-readable way.\n *\n * @param struct - The struct that caused the failures.\n * @param failures - The `superstruct` failures.\n * @param colorize - Whether to colorize the value. Defaults to `true`.\n * @returns A string describing the errors.\n */\nexport function getStructErrorMessage<Type, Schema>(\n struct: Struct<Type, Schema>,\n failures: Failure[],\n colorize = true,\n) {\n const formattedFailures = failures.map((failure) =>\n indent(`• ${getStructFailureMessage(struct, failure, colorize)}`),\n );\n\n return formattedFailures.join('\\n');\n}\n\n/**\n * Validate a union struct, and throw readable errors if the value does not\n * satisfy the struct. This is useful for improving the error messages returned\n * by `superstruct`.\n *\n * @param value - The value to validate.\n * @param struct - The `superstruct` union struct to validate the value against.\n * This struct must be a union of object structs, and must have at least one\n * shared key to validate against.\n * @param structKey - The key to validate against. This key must be present in\n * all the object structs in the union struct, and is expected to be a literal\n * value.\n * @param coerce - Whether to coerce the value to satisfy the struct. Defaults\n * to `false`.\n * @returns The validated value.\n * @throws If the value does not satisfy the struct.\n * @example\n * const struct = union([\n * object({ type: literal('a'), value: string() }),\n * object({ type: literal('b'), value: number() }),\n * object({ type: literal('c'), value: boolean() }),\n * // ...\n * ]);\n *\n * // At path: type — Expected the value to be one of: \"a\", \"b\", \"c\", but received: \"d\".\n * validateUnion({ type: 'd', value: 'foo' }, struct, 'type');\n *\n * // At path: value — Expected a value of type string, but received: 42.\n * validateUnion({ type: 'a', value: 42 }, struct, 'value');\n */\nexport function validateUnion<Type, Schema extends readonly Struct<any, any>[]>(\n value: unknown,\n struct: Struct<Type, Schema>,\n structKey: keyof Type,\n coerce = false,\n) {\n assert(\n struct.schema,\n 'Expected a struct with a schema. Make sure to use `union` from `@metamask/snaps-sdk`.',\n );\n assert(struct.schema.length > 0, 'Expected a non-empty array of structs.');\n\n const keyUnion = struct.schema.map(\n (innerStruct) => innerStruct.schema[structKey],\n // This is guaranteed to be a non-empty array by the assertion above. We\n // need to cast it since `superstruct` requires a non-empty array of structs\n // for the `union` struct.\n ) as NonEmptyArray<Struct>;\n\n const key = superstructType({\n [structKey]: union(keyUnion),\n });\n\n const [keyError] = validate(value, key, { coerce });\n if (keyError) {\n throw new Error(\n getStructFailureMessage(key, keyError.failures()[0], false),\n );\n }\n\n // At this point it's guaranteed that the value is an object, so we can safely\n // cast it to a Record.\n const objectValue = value as Record<PropertyKey, unknown>;\n const objectStructs = struct.schema.filter((innerStruct) =>\n is(objectValue[structKey], innerStruct.schema[structKey]),\n );\n\n assert(objectStructs.length > 0, 'Expected a struct to match the value.');\n\n // We need to validate the value against all the object structs that match the\n // struct key, and return the first validated value.\n const validationResults = objectStructs.map((objectStruct) =>\n validate(objectValue, objectStruct, { coerce }),\n );\n\n const validatedValue = validationResults.find(([error]) => !error);\n if (validatedValue) {\n return validatedValue[1];\n }\n\n assert(validationResults[0][0], 'Expected at least one error.');\n\n // If there is no validated value, we need to find the error with the least\n // number of failures (with the assumption that it's the most specific error).\n const validationError = validationResults.reduce((error, [innerError]) => {\n assert(innerError, 'Expected an error.');\n if (innerError.failures().length < error.failures().length) {\n return innerError;\n }\n\n return error;\n }, validationResults[0][0]);\n\n throw new Error(\n getStructFailureMessage(struct, validationError.failures()[0], false),\n );\n}\n\n/**\n * Create a value with the coercion logic of a union struct, and throw readable\n * errors if the value does not satisfy the struct. This is useful for improving\n * the error messages returned by `superstruct`.\n *\n * @param value - The value to validate.\n * @param struct - The `superstruct` union struct to validate the value against.\n * This struct must be a union of object structs, and must have at least one\n * shared key to validate against.\n * @param structKey - The key to validate against. This key must be present in\n * all the object structs in the union struct, and is expected to be a literal\n * value.\n * @returns The validated value.\n * @throws If the value does not satisfy the struct.\n * @see validateUnion\n */\nexport function createUnion<Type, Schema extends readonly Struct<any, any>[]>(\n value: unknown,\n struct: Struct<Type, Schema>,\n structKey: keyof Type,\n) {\n return validateUnion(value, struct, structKey, true);\n}\n\n// These types are copied from Superstruct, to mirror `assign`.\nexport function mergeStructs<\n ObjectA extends ObjectSchema,\n ObjectB extends ObjectSchema,\n>(\n A: Struct<ObjectType<ObjectA>, ObjectA>,\n B: Struct<ObjectType<ObjectB>, ObjectB>,\n): Struct<ObjectType<Assign<ObjectA, ObjectB>>, Assign<ObjectA, ObjectB>>;\nexport function mergeStructs<\n ObjectA extends ObjectSchema,\n ObjectB extends ObjectSchema,\n ObjectC extends ObjectSchema,\n>(\n A: Struct<ObjectType<ObjectA>, ObjectA>,\n B: Struct<ObjectType<ObjectB>, ObjectB>,\n C: Struct<ObjectType<ObjectC>, ObjectC>,\n): Struct<\n ObjectType<Assign<Assign<ObjectA, ObjectB>, ObjectC>>,\n Assign<Assign<ObjectA, ObjectB>, ObjectC>\n>;\nexport function mergeStructs<\n ObjectA extends ObjectSchema,\n ObjectB extends ObjectSchema,\n ObjectC extends ObjectSchema,\n ObjectD extends ObjectSchema,\n>(\n A: Struct<ObjectType<ObjectA>, ObjectA>,\n B: Struct<ObjectType<ObjectB>, ObjectB>,\n C: Struct<ObjectType<ObjectC>, ObjectC>,\n D: Struct<ObjectType<ObjectD>, ObjectD>,\n): Struct<\n ObjectType<Assign<Assign<Assign<ObjectA, ObjectB>, ObjectC>, ObjectD>>,\n Assign<Assign<Assign<ObjectA, ObjectB>, ObjectC>, ObjectD>\n>;\nexport function mergeStructs<\n ObjectA extends ObjectSchema,\n ObjectB extends ObjectSchema,\n ObjectC extends ObjectSchema,\n ObjectD extends ObjectSchema,\n ObjectE extends ObjectSchema,\n>(\n A: Struct<ObjectType<ObjectA>, ObjectA>,\n B: Struct<ObjectType<ObjectB>, ObjectB>,\n C: Struct<ObjectType<ObjectC>, ObjectC>,\n D: Struct<ObjectType<ObjectD>, ObjectD>,\n E: Struct<ObjectType<ObjectE>, ObjectE>,\n): Struct<\n ObjectType<\n Assign<Assign<Assign<Assign<ObjectA, ObjectB>, ObjectC>, ObjectD>, ObjectE>\n >,\n Assign<Assign<Assign<Assign<ObjectA, ObjectB>, ObjectC>, ObjectD>, ObjectE>\n>;\n\n/**\n * Merge multiple structs into one, using superstruct `assign`.\n *\n * Differently from plain `assign`, this function also copies over refinements from each struct.\n *\n * @param structs - The `superstruct` structs to merge.\n * @returns The merged struct.\n */\nexport function mergeStructs(...structs: Struct<any>[]): Struct<any> {\n const mergedStruct = (assign as (...structs: Struct<any>[]) => Struct)(\n ...structs,\n );\n return new Struct({\n ...mergedStruct,\n *refiner(value, ctx) {\n for (const struct of structs) {\n yield* struct.refiner(value, ctx);\n }\n },\n });\n}\n"]}
|
package/dist/chunk-5FTBWYCW.mjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
deepClone
|
|
3
|
-
} from "./chunk-Z2JQNSVL.mjs";
|
|
4
|
-
|
|
5
|
-
// src/manifest/validators/repository-match.ts
|
|
6
|
-
import deepEqual from "fast-deep-equal";
|
|
7
|
-
var repositoryMatch = {
|
|
8
|
-
severity: "error",
|
|
9
|
-
semanticCheck(files, context) {
|
|
10
|
-
const packageJsonRepository = files.packageJson.result.repository;
|
|
11
|
-
const manifestRepository = files.manifest.result.repository;
|
|
12
|
-
if ((packageJsonRepository || manifestRepository) && !deepEqual(packageJsonRepository, manifestRepository)) {
|
|
13
|
-
context.report(
|
|
14
|
-
`"${"snap.manifest.json" /* Manifest */}" "repository" field does not match the "${"package.json" /* PackageJson */}" "repository" field.`,
|
|
15
|
-
({ manifest }) => {
|
|
16
|
-
manifest.repository = packageJsonRepository ? deepClone(packageJsonRepository) : void 0;
|
|
17
|
-
return { manifest };
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export {
|
|
25
|
-
repositoryMatch
|
|
26
|
-
};
|
|
27
|
-
//# sourceMappingURL=chunk-5FTBWYCW.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/manifest/validators/repository-match.ts"],"sourcesContent":["import deepEqual from 'fast-deep-equal';\n\nimport { deepClone } from '../../deep-clone';\nimport { NpmSnapFileNames } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Check if the repository object in manifest is the same as in package.json.\n */\nexport const repositoryMatch: ValidatorMeta = {\n severity: 'error',\n semanticCheck(files, context) {\n const packageJsonRepository = files.packageJson.result.repository;\n const manifestRepository = files.manifest.result.repository;\n if (\n (packageJsonRepository || manifestRepository) &&\n !deepEqual(packageJsonRepository, manifestRepository)\n ) {\n context.report(\n `\"${NpmSnapFileNames.Manifest}\" \"repository\" field does not match the \"${NpmSnapFileNames.PackageJson}\" \"repository\" field.`,\n ({ manifest }) => {\n manifest.repository = packageJsonRepository\n ? deepClone(packageJsonRepository)\n : undefined;\n return { manifest };\n },\n );\n }\n },\n};\n"],"mappings":";;;;;AAAA,OAAO,eAAe;AASf,IAAM,kBAAiC;AAAA,EAC5C,UAAU;AAAA,EACV,cAAc,OAAO,SAAS;AAC5B,UAAM,wBAAwB,MAAM,YAAY,OAAO;AACvD,UAAM,qBAAqB,MAAM,SAAS,OAAO;AACjD,SACG,yBAAyB,uBAC1B,CAAC,UAAU,uBAAuB,kBAAkB,GACpD;AACA,cAAQ;AAAA,QACN,uCAA6B,4EAAwE;AAAA,QACrG,CAAC,EAAE,SAAS,MAAM;AAChB,mBAAS,aAAa,wBAClB,UAAU,qBAAqB,IAC/B;AACJ,iBAAO,EAAE,SAAS;AAAA,QACpB;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
|
package/dist/chunk-5MABKEV7.mjs
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
validators_exports
|
|
3
|
-
} from "./chunk-PAOTMYIM.mjs";
|
|
4
|
-
import {
|
|
5
|
-
__privateAdd,
|
|
6
|
-
__privateGet,
|
|
7
|
-
__privateSet
|
|
8
|
-
} from "./chunk-3RUWAMJT.mjs";
|
|
9
|
-
|
|
10
|
-
// src/manifest/validator.ts
|
|
11
|
-
import { assert } from "@metamask/utils";
|
|
12
|
-
var _nextSeverity;
|
|
13
|
-
var Context = class {
|
|
14
|
-
constructor() {
|
|
15
|
-
this.reports = [];
|
|
16
|
-
__privateAdd(this, _nextSeverity, void 0);
|
|
17
|
-
}
|
|
18
|
-
report(message, fix) {
|
|
19
|
-
assert(__privateGet(this, _nextSeverity) !== void 0);
|
|
20
|
-
this.reports.push({
|
|
21
|
-
severity: __privateGet(this, _nextSeverity),
|
|
22
|
-
message,
|
|
23
|
-
fix
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
prepareForValidator(settings) {
|
|
27
|
-
__privateSet(this, _nextSeverity, settings.severity);
|
|
28
|
-
}
|
|
29
|
-
get hasErrors() {
|
|
30
|
-
return this.reports.some((report) => report.severity === "error");
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
_nextSeverity = new WeakMap();
|
|
34
|
-
async function runValidators(files, rules = Object.values(validators_exports)) {
|
|
35
|
-
const context = new Context();
|
|
36
|
-
for (const rule of rules) {
|
|
37
|
-
context.prepareForValidator({
|
|
38
|
-
severity: rule.severity
|
|
39
|
-
});
|
|
40
|
-
await rule.structureCheck?.(files, context);
|
|
41
|
-
}
|
|
42
|
-
if (context.hasErrors) {
|
|
43
|
-
return {
|
|
44
|
-
reports: context.reports
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
for (const rule of rules) {
|
|
48
|
-
context.prepareForValidator({
|
|
49
|
-
severity: rule.severity
|
|
50
|
-
});
|
|
51
|
-
await rule.semanticCheck?.(files, context);
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
files,
|
|
55
|
-
reports: context.reports
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
function hasFixes(results) {
|
|
59
|
-
return results.reports.some((report) => report.fix);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export {
|
|
63
|
-
runValidators,
|
|
64
|
-
hasFixes
|
|
65
|
-
};
|
|
66
|
-
//# sourceMappingURL=chunk-5MABKEV7.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/manifest/validator.ts"],"sourcesContent":["import { assert } from '@metamask/utils';\n\nimport type { SnapFiles, UnvalidatedSnapFiles } from '../types';\nimport type {\n ValidatorContext,\n ValidatorFix,\n ValidatorMeta,\n ValidatorReport,\n ValidatorSeverity,\n} from './validator-types';\nimport * as defaultValidators from './validators';\n\nexport type ValidatorResults = {\n files?: SnapFiles;\n reports: ValidatorReport[];\n};\n\nclass Context implements ValidatorContext {\n reports: ValidatorReport[] = [];\n\n #nextSeverity?: ValidatorSeverity = undefined;\n\n report(message: string, fix?: ValidatorFix): void {\n assert(this.#nextSeverity !== undefined);\n this.reports.push({\n severity: this.#nextSeverity,\n message,\n fix,\n });\n }\n\n prepareForValidator(settings: { severity: ValidatorSeverity }) {\n this.#nextSeverity = settings.severity;\n }\n\n get hasErrors() {\n return this.reports.some((report) => report.severity === 'error');\n }\n}\n\n/**\n * Verify that snap files are completely valid.\n * First it runs validators on unparsed files to check structure.\n * Secondly it runs validators on parsed files to check semantics.\n *\n * @param files - All files required to run a snap.\n * @param rules - Validators to run.\n */\n// TODO(ritave): snap.manifest.json and package.json should check\n// json parsing as well instead of assuming it's\n// already parsed\nexport async function runValidators(\n files: UnvalidatedSnapFiles,\n rules: ValidatorMeta[] = Object.values(defaultValidators),\n): Promise<ValidatorResults> {\n const context = new Context();\n\n for (const rule of rules) {\n context.prepareForValidator({\n severity: rule.severity,\n });\n await rule.structureCheck?.(files, context);\n }\n if (context.hasErrors) {\n return {\n reports: context.reports,\n };\n }\n\n for (const rule of rules) {\n context.prepareForValidator({\n severity: rule.severity,\n });\n await rule.semanticCheck?.(files as SnapFiles, context);\n }\n return {\n files: files as SnapFiles,\n reports: context.reports,\n };\n}\n\n/**\n * Get whether any reports has pending fixes.\n *\n * @param results - Results of the validation run.\n * @returns Whether there are fixes pending.\n */\nexport function hasFixes(results: ValidatorResults): boolean {\n return results.reports.some((report) => report.fix);\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,cAAc;AAAvB;AAiBA,IAAM,UAAN,MAA0C;AAAA,EAA1C;AACE,mBAA6B,CAAC;AAE9B,sCAAoC;AAAA;AAAA,EAEpC,OAAO,SAAiB,KAA0B;AAChD,WAAO,mBAAK,mBAAkB,MAAS;AACvC,SAAK,QAAQ,KAAK;AAAA,MAChB,UAAU,mBAAK;AAAA,MACf;AAAA,MACA;AAAA,IACF,CAAC;AAAA,EACH;AAAA,EAEA,oBAAoB,UAA2C;AAC7D,uBAAK,eAAgB,SAAS;AAAA,EAChC;AAAA,EAEA,IAAI,YAAY;AACd,WAAO,KAAK,QAAQ,KAAK,CAAC,WAAW,OAAO,aAAa,OAAO;AAAA,EAClE;AACF;AAlBE;AA+BF,eAAsB,cACpB,OACA,QAAyB,OAAO,OAAO,kBAAiB,GAC7B;AAC3B,QAAM,UAAU,IAAI,QAAQ;AAE5B,aAAW,QAAQ,OAAO;AACxB,YAAQ,oBAAoB;AAAA,MAC1B,UAAU,KAAK;AAAA,IACjB,CAAC;AACD,UAAM,KAAK,iBAAiB,OAAO,OAAO;AAAA,EAC5C;AACA,MAAI,QAAQ,WAAW;AACrB,WAAO;AAAA,MACL,SAAS,QAAQ;AAAA,IACnB;AAAA,EACF;AAEA,aAAW,QAAQ,OAAO;AACxB,YAAQ,oBAAoB;AAAA,MAC1B,UAAU,KAAK;AAAA,IACjB,CAAC;AACD,UAAM,KAAK,gBAAgB,OAAoB,OAAO;AAAA,EACxD;AACA,SAAO;AAAA,IACL;AAAA,IACA,SAAS,QAAQ;AAAA,EACnB;AACF;AAQO,SAAS,SAAS,SAAoC;AAC3D,SAAO,QAAQ,QAAQ,KAAK,CAAC,WAAW,OAAO,GAAG;AACpD;","names":[]}
|
package/dist/chunk-5R7UF7KM.mjs
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
// src/handler-types.ts
|
|
2
|
-
var HandlerType = /* @__PURE__ */ ((HandlerType2) => {
|
|
3
|
-
HandlerType2["OnRpcRequest"] = "onRpcRequest";
|
|
4
|
-
HandlerType2["OnSignature"] = "onSignature";
|
|
5
|
-
HandlerType2["OnTransaction"] = "onTransaction";
|
|
6
|
-
HandlerType2["OnCronjob"] = "onCronjob";
|
|
7
|
-
HandlerType2["OnInstall"] = "onInstall";
|
|
8
|
-
HandlerType2["OnUpdate"] = "onUpdate";
|
|
9
|
-
HandlerType2["OnNameLookup"] = "onNameLookup";
|
|
10
|
-
HandlerType2["OnKeyringRequest"] = "onKeyringRequest";
|
|
11
|
-
HandlerType2["OnHomePage"] = "onHomePage";
|
|
12
|
-
HandlerType2["OnUserInput"] = "onUserInput";
|
|
13
|
-
return HandlerType2;
|
|
14
|
-
})(HandlerType || {});
|
|
15
|
-
var SNAP_EXPORT_NAMES = Object.values(HandlerType);
|
|
16
|
-
|
|
17
|
-
export {
|
|
18
|
-
HandlerType,
|
|
19
|
-
SNAP_EXPORT_NAMES
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=chunk-5R7UF7KM.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/handler-types.ts"],"sourcesContent":["export enum HandlerType {\n OnRpcRequest = 'onRpcRequest',\n OnSignature = 'onSignature',\n OnTransaction = 'onTransaction',\n OnCronjob = 'onCronjob',\n OnInstall = 'onInstall',\n OnUpdate = 'onUpdate',\n OnNameLookup = 'onNameLookup',\n OnKeyringRequest = 'onKeyringRequest',\n OnHomePage = 'onHomePage',\n OnUserInput = 'onUserInput',\n}\n\nexport type SnapHandler = {\n /**\n * The type of handler.\n */\n type: HandlerType;\n\n /**\n * Whether the handler is required, i.e., whether the request will fail if the\n * handler is called, but the snap does not export it.\n *\n * This is primarily used for the lifecycle handlers, which are optional.\n */\n required: boolean;\n\n /**\n * Validate the given snap export. This should return a type guard for the\n * handler type.\n *\n * @param snapExport - The export to validate.\n * @returns Whether the export is valid.\n */\n validator: (snapExport: unknown) => boolean;\n};\n\nexport const SNAP_EXPORT_NAMES = Object.values(HandlerType);\n"],"mappings":";AAAO,IAAK,cAAL,kBAAKA,iBAAL;AACL,EAAAA,aAAA,kBAAe;AACf,EAAAA,aAAA,iBAAc;AACd,EAAAA,aAAA,mBAAgB;AAChB,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,kBAAe;AACf,EAAAA,aAAA,sBAAmB;AACnB,EAAAA,aAAA,gBAAa;AACb,EAAAA,aAAA,iBAAc;AAVJ,SAAAA;AAAA,GAAA;AAqCL,IAAM,oBAAoB,OAAO,OAAO,WAAW;","names":["HandlerType"]}
|
package/dist/chunk-5UAPBOKO.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
var _chunk53QXTM77js = require('./chunk-53QXTM77.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var _chunkMWAZGSROjs = require('./chunk-MWAZGSRO.js');
|
|
7
|
-
|
|
8
|
-
// src/manifest/validators/is-package-json.ts
|
|
9
|
-
var _superstruct = require('@metamask/superstruct');
|
|
10
|
-
var isPackageJson = {
|
|
11
|
-
severity: "error",
|
|
12
|
-
structureCheck(files, context) {
|
|
13
|
-
if (!files.packageJson) {
|
|
14
|
-
return;
|
|
15
|
-
}
|
|
16
|
-
const [error] = _superstruct.validate.call(void 0,
|
|
17
|
-
files.packageJson.result,
|
|
18
|
-
_chunkMWAZGSROjs.NpmSnapPackageJsonStruct
|
|
19
|
-
);
|
|
20
|
-
if (error) {
|
|
21
|
-
for (const failure of error.failures()) {
|
|
22
|
-
context.report(
|
|
23
|
-
`"${"package.json" /* PackageJson */}" is invalid: ${_chunk53QXTM77js.getStructFailureMessage.call(void 0,
|
|
24
|
-
_chunkMWAZGSROjs.NpmSnapPackageJsonStruct,
|
|
25
|
-
failure,
|
|
26
|
-
false
|
|
27
|
-
)}`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
exports.isPackageJson = isPackageJson;
|
|
37
|
-
//# sourceMappingURL=chunk-5UAPBOKO.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/manifest/validators/is-package-json.ts"],"names":[],"mappings":";;;;;;;;AAAA,SAAS,gBAAgB;AASlB,IAAM,gBAA+B;AAAA,EAC1C,UAAU;AAAA,EACV,eAAe,OAAO,SAAS;AAC7B,QAAI,CAAC,MAAM,aAAa;AACtB;AAAA,IACF;AACA,UAAM,CAAC,KAAK,IAAI;AAAA,MACd,MAAM,YAAY;AAAA,MAClB;AAAA,IACF;AACA,QAAI,OAAO;AACT,iBAAW,WAAW,MAAM,SAAS,GAAG;AACtC,gBAAQ;AAAA,UACN,oCAEA,iBAAiB;AAAA,YACf;AAAA,YACA;AAAA,YACA;AAAA,UACF,CAAC;AAAA,QACH;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF","sourcesContent":["import { validate } from '@metamask/superstruct';\n\nimport { getStructFailureMessage } from '../../structs';\nimport { NpmSnapFileNames, NpmSnapPackageJsonStruct } from '../../types';\nimport type { ValidatorMeta } from '../validator-types';\n\n/**\n * Verify the structure of package.json.\n */\nexport const isPackageJson: ValidatorMeta = {\n severity: 'error',\n structureCheck(files, context) {\n if (!files.packageJson) {\n return;\n }\n const [error] = validate(\n files.packageJson.result,\n NpmSnapPackageJsonStruct,\n );\n if (error) {\n for (const failure of error.failures()) {\n context.report(\n `\"${\n NpmSnapFileNames.PackageJson\n }\" is invalid: ${getStructFailureMessage(\n NpmSnapPackageJsonStruct,\n failure,\n false,\n )}`,\n );\n }\n }\n },\n};\n"]}
|
package/dist/chunk-5WKQI22S.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/constants.ts"],"names":[],"mappings":";AAGO,IAAM,gBAAgB","sourcesContent":["// The max file size for Snap source code and auxiliary files.\n// 64 MB - we chose this number because it is the size limit for postMessage\n// between the extension and the offscreen document enforced by Chrome.\nexport const MAX_FILE_SIZE = 64_000_000;\n"]}
|
package/dist/chunk-63OXILAY.mjs
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DEFAULT_ENDOWMENTS
|
|
3
|
-
} from "./chunk-BGSO2GQC.mjs";
|
|
4
|
-
|
|
5
|
-
// src/mock.ts
|
|
6
|
-
import crypto from "crypto";
|
|
7
|
-
import EventEmitter from "events";
|
|
8
|
-
var NETWORK_APIS = ["fetch", "Request", "Headers", "Response"];
|
|
9
|
-
var ALL_APIS = [
|
|
10
|
-
...DEFAULT_ENDOWMENTS,
|
|
11
|
-
...NETWORK_APIS,
|
|
12
|
-
"WebAssembly"
|
|
13
|
-
];
|
|
14
|
-
function getMockSnapGlobal() {
|
|
15
|
-
return { request: async () => true };
|
|
16
|
-
}
|
|
17
|
-
function getMockEthereumProvider() {
|
|
18
|
-
const mockProvider = new EventEmitter();
|
|
19
|
-
mockProvider.request = async () => true;
|
|
20
|
-
return mockProvider;
|
|
21
|
-
}
|
|
22
|
-
var isConstructor = (value) => Boolean(typeof value?.prototype?.constructor?.name === "string");
|
|
23
|
-
var mockFunction = () => true;
|
|
24
|
-
var MockClass = class {
|
|
25
|
-
};
|
|
26
|
-
var handler = {
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
-
construct(Target, args) {
|
|
29
|
-
return new Proxy(new Target(...args), handler);
|
|
30
|
-
},
|
|
31
|
-
get(_target, _prop) {
|
|
32
|
-
return mockFunction;
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
var generateMockClass = (value) => {
|
|
36
|
-
return new Proxy(value, handler);
|
|
37
|
-
};
|
|
38
|
-
var mockWindow = {
|
|
39
|
-
crypto,
|
|
40
|
-
SubtleCrypto: MockClass
|
|
41
|
-
};
|
|
42
|
-
var generateMockEndowment = (key) => {
|
|
43
|
-
const globalValue = globalThis[key];
|
|
44
|
-
if (globalValue && DEFAULT_ENDOWMENTS.includes(key)) {
|
|
45
|
-
return globalValue;
|
|
46
|
-
}
|
|
47
|
-
const globalOrMocked = globalValue ?? mockWindow[key];
|
|
48
|
-
const type = typeof globalOrMocked;
|
|
49
|
-
const isFunction = type === "function";
|
|
50
|
-
if (isFunction && isConstructor(globalOrMocked)) {
|
|
51
|
-
return generateMockClass(globalOrMocked);
|
|
52
|
-
} else if (isFunction || !globalOrMocked) {
|
|
53
|
-
return mockFunction;
|
|
54
|
-
}
|
|
55
|
-
return globalOrMocked;
|
|
56
|
-
};
|
|
57
|
-
var generateMockEndowments = () => {
|
|
58
|
-
return ALL_APIS.reduce(
|
|
59
|
-
(acc, cur) => ({ ...acc, [cur]: generateMockEndowment(cur) }),
|
|
60
|
-
{ snap: getMockSnapGlobal(), ethereum: getMockEthereumProvider() }
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
ALL_APIS,
|
|
66
|
-
isConstructor,
|
|
67
|
-
generateMockEndowments
|
|
68
|
-
};
|
|
69
|
-
//# sourceMappingURL=chunk-63OXILAY.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mock.ts"],"sourcesContent":["import crypto from 'crypto';\nimport EventEmitter from 'events';\n\nimport { DEFAULT_ENDOWMENTS } from './default-endowments';\n\nconst NETWORK_APIS = ['fetch', 'Request', 'Headers', 'Response'];\n\nexport const ALL_APIS: string[] = [\n ...DEFAULT_ENDOWMENTS,\n ...NETWORK_APIS,\n 'WebAssembly',\n];\n\ntype MockSnapGlobal = {\n request: () => Promise<any>;\n};\n\ntype MockEthereumProvider = EventEmitter & {\n request: () => Promise<any>;\n};\n\n/**\n * Get a mock snap API, that always returns `true` for requests.\n *\n * @returns A mocked snap provider.\n */\nfunction getMockSnapGlobal(): MockSnapGlobal {\n // eslint-disable-next-line @typescript-eslint/require-await\n return { request: async () => true };\n}\n\n/**\n * Get a mock Ethereum provider, that always returns `true` for requests.\n *\n * @returns A mocked ethereum provider.\n */\nfunction getMockEthereumProvider(): MockEthereumProvider {\n const mockProvider = new EventEmitter() as Partial<MockEthereumProvider>;\n // eslint-disable-next-line @typescript-eslint/require-await\n mockProvider.request = async () => true;\n return mockProvider as MockEthereumProvider;\n}\n\n/**\n * Check if a value is a constructor.\n *\n * @param value - The value to check.\n * @returns `true` if the value is a constructor, or `false` otherwise.\n */\nexport const isConstructor = (value: any) =>\n Boolean(typeof value?.prototype?.constructor?.name === 'string');\n\n/**\n * A function that always returns `true`.\n *\n * @returns `true`.\n */\nconst mockFunction = () => true;\nclass MockClass {}\n\nconst handler = {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n construct(Target: any, args: any[]): any {\n return new Proxy(new Target(...args), handler);\n },\n get(_target: any, _prop: any) {\n return mockFunction;\n },\n};\n\n/**\n * Generate a mock class for a given value. The value is wrapped in a Proxy, and\n * all methods are replaced with a mock function.\n *\n * @param value - The value to mock.\n * @returns A mock class.\n */\nconst generateMockClass = (value: any) => {\n return new Proxy(value, handler);\n};\n\n// Things not currently auto-mocked because of NodeJS, by adding them here we\n// have types for them and can use that to generate mocks if needed.\nconst mockWindow: Record<string, unknown> = {\n crypto,\n SubtleCrypto: MockClass,\n};\n\n/**\n * Generate a mock endowment for a certain class or function on the `globalThis`\n * object.\n *\n * @param key - The key to generate the mock endowment for.\n * @returns A mocked class or function. If the key is part of the default\n * endowments, the original value is returned.\n */\nconst generateMockEndowment = (key: string) => {\n const globalValue = (globalThis as any)[key];\n\n // Default exposed APIs don't need to be mocked\n if (globalValue && DEFAULT_ENDOWMENTS.includes(key)) {\n return globalValue;\n }\n\n // Fall back to mockWindow for certain APIs not exposed in global in Node.JS\n const globalOrMocked = globalValue ?? mockWindow[key];\n\n const type = typeof globalOrMocked;\n const isFunction = type === 'function';\n if (isFunction && isConstructor(globalOrMocked)) {\n return generateMockClass(globalOrMocked);\n } else if (isFunction || !globalOrMocked) {\n // Fall back to function mock for now\n return mockFunction;\n }\n return globalOrMocked;\n};\n\n/**\n * Generate mock endowments for all the APIs as defined in {@link ALL_APIS}.\n *\n * @returns A map of endowments.\n */\nexport const generateMockEndowments = () => {\n return ALL_APIS.reduce<Record<string, any>>(\n (acc, cur) => ({ ...acc, [cur]: generateMockEndowment(cur) }),\n { snap: getMockSnapGlobal(), ethereum: getMockEthereumProvider() },\n );\n};\n"],"mappings":";;;;;AAAA,OAAO,YAAY;AACnB,OAAO,kBAAkB;AAIzB,IAAM,eAAe,CAAC,SAAS,WAAW,WAAW,UAAU;AAExD,IAAM,WAAqB;AAAA,EAChC,GAAG;AAAA,EACH,GAAG;AAAA,EACH;AACF;AAeA,SAAS,oBAAoC;AAE3C,SAAO,EAAE,SAAS,YAAY,KAAK;AACrC;AAOA,SAAS,0BAAgD;AACvD,QAAM,eAAe,IAAI,aAAa;AAEtC,eAAa,UAAU,YAAY;AACnC,SAAO;AACT;AAQO,IAAM,gBAAgB,CAAC,UAC5B,QAAQ,OAAO,OAAO,WAAW,aAAa,SAAS,QAAQ;AAOjE,IAAM,eAAe,MAAM;AAC3B,IAAM,YAAN,MAAgB;AAAC;AAEjB,IAAM,UAAU;AAAA;AAAA,EAEd,UAAU,QAAa,MAAkB;AACvC,WAAO,IAAI,MAAM,IAAI,OAAO,GAAG,IAAI,GAAG,OAAO;AAAA,EAC/C;AAAA,EACA,IAAI,SAAc,OAAY;AAC5B,WAAO;AAAA,EACT;AACF;AASA,IAAM,oBAAoB,CAAC,UAAe;AACxC,SAAO,IAAI,MAAM,OAAO,OAAO;AACjC;AAIA,IAAM,aAAsC;AAAA,EAC1C;AAAA,EACA,cAAc;AAChB;AAUA,IAAM,wBAAwB,CAAC,QAAgB;AAC7C,QAAM,cAAe,WAAmB,GAAG;AAG3C,MAAI,eAAe,mBAAmB,SAAS,GAAG,GAAG;AACnD,WAAO;AAAA,EACT;AAGA,QAAM,iBAAiB,eAAe,WAAW,GAAG;AAEpD,QAAM,OAAO,OAAO;AACpB,QAAM,aAAa,SAAS;AAC5B,MAAI,cAAc,cAAc,cAAc,GAAG;AAC/C,WAAO,kBAAkB,cAAc;AAAA,EACzC,WAAW,cAAc,CAAC,gBAAgB;AAExC,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAOO,IAAM,yBAAyB,MAAM;AAC1C,SAAO,SAAS;AAAA,IACd,CAAC,KAAK,SAAS,EAAE,GAAG,KAAK,CAAC,GAAG,GAAG,sBAAsB,GAAG,EAAE;AAAA,IAC3D,EAAE,MAAM,kBAAkB,GAAG,UAAU,wBAAwB,EAAE;AAAA,EACnE;AACF;","names":[]}
|