@metamask/snaps-utils 9.1.0 → 9.2.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 +10 -1
- package/dist/cronjob.d.cts +9 -9
- package/dist/cronjob.d.mts +9 -9
- package/dist/eval-worker.cjs +2 -2
- package/dist/eval-worker.cjs.map +1 -1
- package/dist/eval-worker.mjs +1 -1
- package/dist/eval-worker.mjs.map +1 -1
- package/dist/handlers/asset-historical-price.cjs +25 -0
- package/dist/handlers/asset-historical-price.cjs.map +1 -0
- package/dist/handlers/asset-historical-price.d.cts +37 -0
- package/dist/handlers/asset-historical-price.d.cts.map +1 -0
- package/dist/handlers/asset-historical-price.d.mts +37 -0
- package/dist/handlers/asset-historical-price.d.mts.map +1 -0
- package/dist/handlers/asset-historical-price.mjs +22 -0
- package/dist/handlers/asset-historical-price.mjs.map +1 -0
- package/dist/handlers/assets-conversion.cjs +38 -0
- package/dist/handlers/assets-conversion.cjs.map +1 -0
- package/dist/handlers/assets-conversion.d.cts +90 -0
- package/dist/handlers/assets-conversion.d.cts.map +1 -0
- package/dist/handlers/assets-conversion.d.mts +90 -0
- package/dist/handlers/assets-conversion.d.mts.map +1 -0
- package/dist/handlers/assets-conversion.mjs +35 -0
- package/dist/handlers/assets-conversion.mjs.map +1 -0
- package/dist/handlers/exports.cjs +113 -0
- package/dist/handlers/exports.cjs.map +1 -0
- package/dist/handlers/exports.d.cts +81 -0
- package/dist/handlers/exports.d.cts.map +1 -0
- package/dist/handlers/exports.d.mts +81 -0
- package/dist/handlers/exports.d.mts.map +1 -0
- package/dist/{handlers.mjs → handlers/exports.mjs} +10 -45
- package/dist/handlers/exports.mjs.map +1 -0
- package/dist/handlers/home-page.cjs +16 -0
- package/dist/handlers/home-page.cjs.map +1 -0
- package/dist/handlers/home-page.d.cts +268 -0
- package/dist/handlers/home-page.d.cts.map +1 -0
- package/dist/handlers/home-page.d.mts +268 -0
- package/dist/handlers/home-page.d.mts.map +1 -0
- package/dist/handlers/home-page.mjs +13 -0
- package/dist/handlers/home-page.mjs.map +1 -0
- package/dist/handlers/index.cjs +26 -0
- package/dist/handlers/index.cjs.map +1 -0
- package/dist/handlers/index.d.cts +10 -0
- package/dist/handlers/index.d.cts.map +1 -0
- package/dist/handlers/index.d.mts +10 -0
- package/dist/handlers/index.d.mts.map +1 -0
- package/dist/handlers/index.mjs +10 -0
- package/dist/handlers/index.mjs.map +1 -0
- package/dist/handlers/name-lookup.cjs +21 -0
- package/dist/handlers/name-lookup.cjs.map +1 -0
- package/dist/handlers/name-lookup.d.cts +67 -0
- package/dist/handlers/name-lookup.d.cts.map +1 -0
- package/dist/handlers/name-lookup.d.mts +67 -0
- package/dist/handlers/name-lookup.d.mts.map +1 -0
- package/dist/handlers/name-lookup.mjs +18 -0
- package/dist/handlers/name-lookup.mjs.map +1 -0
- package/dist/handlers/settings-page.cjs +6 -0
- package/dist/handlers/settings-page.cjs.map +1 -0
- package/dist/handlers/settings-page.d.cts +90 -0
- package/dist/handlers/settings-page.d.cts.map +1 -0
- package/dist/handlers/settings-page.d.mts +90 -0
- package/dist/handlers/settings-page.d.mts.map +1 -0
- package/dist/handlers/settings-page.mjs +3 -0
- package/dist/handlers/settings-page.mjs.map +1 -0
- package/dist/handlers/signature.cjs +6 -0
- package/dist/handlers/signature.cjs.map +1 -0
- package/dist/handlers/signature.d.cts +92 -0
- package/dist/handlers/signature.d.cts.map +1 -0
- package/dist/handlers/signature.d.mts +92 -0
- package/dist/handlers/signature.d.mts.map +1 -0
- package/dist/handlers/signature.mjs +3 -0
- package/dist/handlers/signature.mjs.map +1 -0
- package/dist/handlers/transaction.cjs +19 -0
- package/dist/handlers/transaction.cjs.map +1 -0
- package/dist/handlers/transaction.d.cts +280 -0
- package/dist/handlers/transaction.d.cts.map +1 -0
- package/dist/handlers/transaction.d.mts +280 -0
- package/dist/handlers/transaction.d.mts.map +1 -0
- package/dist/handlers/transaction.mjs +16 -0
- package/dist/handlers/transaction.mjs.map +1 -0
- package/dist/{handler-types.cjs → handlers/types.cjs} +3 -3
- package/dist/handlers/types.cjs.map +1 -0
- package/dist/{handler-types.d.mts → handlers/types.d.cts} +22 -2
- package/dist/handlers/types.d.cts.map +1 -0
- package/dist/{handler-types.d.cts → handlers/types.d.mts} +22 -2
- package/dist/handlers/types.d.mts.map +1 -0
- package/dist/{handler-types.mjs → handlers/types.mjs} +2 -2
- package/dist/handlers/types.mjs.map +1 -0
- package/dist/iframe.test.browser.cjs +20 -19
- package/dist/iframe.test.browser.cjs.map +1 -1
- package/dist/iframe.test.browser.mjs +2 -1
- package/dist/iframe.test.browser.mjs.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.mts.map +1 -1
- package/dist/index.executionenv.cjs +2 -2
- package/dist/index.executionenv.cjs.map +1 -1
- package/dist/index.executionenv.d.cts +2 -2
- package/dist/index.executionenv.d.cts.map +1 -1
- package/dist/index.executionenv.d.mts +2 -2
- package/dist/index.executionenv.d.mts.map +1 -1
- package/dist/index.executionenv.mjs +2 -2
- package/dist/index.executionenv.mjs.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/localization.d.cts +5 -5
- package/dist/localization.d.mts +5 -5
- package/dist/manifest/validation.d.cts +12 -12
- package/dist/manifest/validation.d.mts +12 -12
- package/dist/time.cjs +34 -0
- package/dist/time.cjs.map +1 -0
- package/dist/time.d.cts +9 -0
- package/dist/time.d.cts.map +1 -0
- package/dist/time.d.mts +9 -0
- package/dist/time.d.mts.map +1 -0
- package/dist/time.mjs +31 -0
- package/dist/time.mjs.map +1 -0
- package/dist/types.d.cts +2 -2
- package/dist/types.d.cts.map +1 -1
- package/dist/types.d.mts +2 -2
- package/dist/types.d.mts.map +1 -1
- package/package.json +13 -21
- package/dist/handler-types.cjs.map +0 -1
- package/dist/handler-types.d.cts.map +0 -1
- package/dist/handler-types.d.mts.map +0 -1
- package/dist/handler-types.mjs.map +0 -1
- package/dist/handlers.cjs +0 -148
- package/dist/handlers.cjs.map +0 -1
- package/dist/handlers.d.cts +0 -887
- package/dist/handlers.d.cts.map +0 -1
- package/dist/handlers.d.mts +0 -887
- package/dist/handlers.d.mts.map +0 -1
- package/dist/handlers.mjs.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -13,8 +13,7 @@ export * from "./default-endowments.cjs";
|
|
|
13
13
|
export * from "./derivation-paths.cjs";
|
|
14
14
|
export * from "./entropy.cjs";
|
|
15
15
|
export * from "./errors.cjs";
|
|
16
|
-
export * from "./handlers.cjs";
|
|
17
|
-
export * from "./handler-types.cjs";
|
|
16
|
+
export * from "./handlers/index.cjs";
|
|
18
17
|
export * from "./iframe.cjs";
|
|
19
18
|
export * from "./json.cjs";
|
|
20
19
|
export * from "./json-rpc.cjs";
|
|
@@ -26,6 +25,7 @@ export * from "./platform-version.cjs";
|
|
|
26
25
|
export * from "./snaps.cjs";
|
|
27
26
|
export * from "./strings.cjs";
|
|
28
27
|
export * from "./structs.cjs";
|
|
28
|
+
export * from "./time.cjs";
|
|
29
29
|
export * from "./types.cjs";
|
|
30
30
|
export * from "./ui.cjs";
|
|
31
31
|
export * from "./url.cjs";
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB,qCAA2B;AAC3B,6BAAyB;AACzB,2BAAuB;AACvB,+BAA2B;AAC3B,mCAA+B;AAC/B,8BAA0B;AAC1B,qCAA2B;AAC3B,2BAAuB;AACvB,uCAAmC;AACnC,4BAAwB;AACxB,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,4BAAwB;AACxB,yBAAqB;AACrB,0BAAsB;AACtB,iCAA6B;AAC7B,+BAA2B;AAC3B,yCAA+B;AAC/B,mCAA+B"}
|
package/dist/index.d.mts
CHANGED
|
@@ -13,8 +13,7 @@ export * from "./default-endowments.mjs";
|
|
|
13
13
|
export * from "./derivation-paths.mjs";
|
|
14
14
|
export * from "./entropy.mjs";
|
|
15
15
|
export * from "./errors.mjs";
|
|
16
|
-
export * from "./handlers.mjs";
|
|
17
|
-
export * from "./handler-types.mjs";
|
|
16
|
+
export * from "./handlers/index.mjs";
|
|
18
17
|
export * from "./iframe.mjs";
|
|
19
18
|
export * from "./json.mjs";
|
|
20
19
|
export * from "./json-rpc.mjs";
|
|
@@ -26,6 +25,7 @@ export * from "./platform-version.mjs";
|
|
|
26
25
|
export * from "./snaps.mjs";
|
|
27
26
|
export * from "./strings.mjs";
|
|
28
27
|
export * from "./structs.mjs";
|
|
28
|
+
export * from "./time.mjs";
|
|
29
29
|
export * from "./types.mjs";
|
|
30
30
|
export * from "./ui.mjs";
|
|
31
31
|
export * from "./url.mjs";
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,mCAA+B;AAC/B,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB,qCAA2B;AAC3B,6BAAyB;AACzB,2BAAuB;AACvB,+BAA2B;AAC3B,mCAA+B;AAC/B,8BAA0B;AAC1B,qCAA2B;AAC3B,2BAAuB;AACvB,uCAAmC;AACnC,4BAAwB;AACxB,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,4BAAwB;AACxB,yBAAqB;AACrB,0BAAsB;AACtB,iCAA6B;AAC7B,+BAA2B;AAC3B,yCAA+B;AAC/B,mCAA+B"}
|
|
@@ -16,8 +16,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
// Special entrypoint for execution environments for bundle sizing reasons
|
|
18
18
|
__exportStar(require("./errors.cjs"), exports);
|
|
19
|
-
__exportStar(require("./handlers.cjs"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
19
|
+
__exportStar(require("./handlers/exports.cjs"), exports);
|
|
20
|
+
__exportStar(require("./handlers/types.cjs"), exports);
|
|
21
21
|
__exportStar(require("./iframe.cjs"), exports);
|
|
22
22
|
__exportStar(require("./logging.cjs"), exports);
|
|
23
23
|
__exportStar(require("./types.cjs"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.executionenv.cjs","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAA0E;AAC1E,+CAAyB;AACzB,
|
|
1
|
+
{"version":3,"file":"index.executionenv.cjs","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0EAA0E;AAC1E,+CAAyB;AACzB,yDAAmC;AACnC,uDAAiC;AACjC,+CAAyB;AACzB,gDAA0B;AAC1B,8CAAwB","sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers/exports';\nexport * from './handlers/types';\nexport * from './iframe';\nexport * from './logging';\nexport * from './types';\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./errors.cjs";
|
|
2
|
-
export * from "./handlers.cjs";
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./handlers/exports.cjs";
|
|
3
|
+
export * from "./handlers/types.cjs";
|
|
4
4
|
export * from "./iframe.cjs";
|
|
5
5
|
export * from "./logging.cjs";
|
|
6
6
|
export * from "./types.cjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.executionenv.d.cts","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AACA,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.executionenv.d.cts","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AACA,6BAAyB;AACzB,uCAAmC;AACnC,qCAAiC;AACjC,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./errors.mjs";
|
|
2
|
-
export * from "./handlers.mjs";
|
|
3
|
-
export * from "./
|
|
2
|
+
export * from "./handlers/exports.mjs";
|
|
3
|
+
export * from "./handlers/types.mjs";
|
|
4
4
|
export * from "./iframe.mjs";
|
|
5
5
|
export * from "./logging.mjs";
|
|
6
6
|
export * from "./types.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.executionenv.d.mts","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AACA,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.executionenv.d.mts","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AACA,6BAAyB;AACzB,uCAAmC;AACnC,qCAAiC;AACjC,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Special entrypoint for execution environments for bundle sizing reasons
|
|
2
2
|
export * from "./errors.mjs";
|
|
3
|
-
export * from "./handlers.mjs";
|
|
4
|
-
export * from "./
|
|
3
|
+
export * from "./handlers/exports.mjs";
|
|
4
|
+
export * from "./handlers/types.mjs";
|
|
5
5
|
export * from "./iframe.mjs";
|
|
6
6
|
export * from "./logging.mjs";
|
|
7
7
|
export * from "./types.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.executionenv.mjs","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.executionenv.mjs","sourceRoot":"","sources":["../src/index.executionenv.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,6BAAyB;AACzB,uCAAmC;AACnC,qCAAiC;AACjC,6BAAyB;AACzB,8BAA0B;AAC1B,4BAAwB","sourcesContent":["// Special entrypoint for execution environments for bundle sizing reasons\nexport * from './errors';\nexport * from './handlers/exports';\nexport * from './handlers/types';\nexport * from './iframe';\nexport * from './logging';\nexport * from './types';\n"]}
|
package/dist/index.mjs
CHANGED
|
@@ -12,8 +12,7 @@ export * from "./default-endowments.mjs";
|
|
|
12
12
|
export * from "./derivation-paths.mjs";
|
|
13
13
|
export * from "./entropy.mjs";
|
|
14
14
|
export * from "./errors.mjs";
|
|
15
|
-
export * from "./handlers.mjs";
|
|
16
|
-
export * from "./handler-types.mjs";
|
|
15
|
+
export * from "./handlers/index.mjs";
|
|
17
16
|
export * from "./iframe.mjs";
|
|
18
17
|
export * from "./json.mjs";
|
|
19
18
|
export * from "./json-rpc.mjs";
|
|
@@ -25,6 +24,7 @@ export * from "./platform-version.mjs";
|
|
|
25
24
|
export * from "./snaps.mjs";
|
|
26
25
|
export * from "./strings.mjs";
|
|
27
26
|
export * from "./structs.mjs";
|
|
27
|
+
export * from "./time.mjs";
|
|
28
28
|
export * from "./types.mjs";
|
|
29
29
|
export * from "./ui.mjs";
|
|
30
30
|
export * from "./url.mjs";
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB
|
|
1
|
+
{"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,4BAAwB;AACxB,sCAAkC;AAClC,6BAAyB;AACzB,4BAAwB;AACxB,8BAA0B;AAC1B,+BAA2B;AAC3B,gCAA4B;AAC5B,8BAA0B;AAC1B,+BAA2B;AAC3B,iCAA6B;AAC7B,yCAAqC;AACrC,uCAAmC;AACnC,8BAA0B;AAC1B,6BAAyB;AACzB,qCAA2B;AAC3B,6BAAyB;AACzB,2BAAuB;AACvB,+BAA2B;AAC3B,mCAA+B;AAC/B,8BAA0B;AAC1B,qCAA2B;AAC3B,2BAAuB;AACvB,uCAAmC;AACnC,4BAAwB;AACxB,8BAA0B;AAC1B,8BAA0B;AAC1B,2BAAuB;AACvB,4BAAwB;AACxB,yBAAqB;AACrB,0BAAsB;AACtB,iCAA6B;AAC7B,+BAA2B;AAC3B,yCAA+B","sourcesContent":["export type * from './account';\nexport * from './array';\nexport * from './auxiliary-files';\nexport * from './base64';\nexport * from './bytes';\nexport * from './caveats';\nexport * from './checksum';\nexport * from './constants';\nexport * from './cronjob';\nexport * from './currency';\nexport * from './deep-clone';\nexport * from './default-endowments';\nexport * from './derivation-paths';\nexport * from './entropy';\nexport * from './errors';\nexport * from './handlers';\nexport * from './iframe';\nexport * from './json';\nexport * from './json-rpc';\nexport * from './localization';\nexport * from './logging';\nexport * from './manifest';\nexport * from './path';\nexport * from './platform-version';\nexport * from './snaps';\nexport * from './strings';\nexport * from './structs';\nexport * from './time';\nexport * from './types';\nexport * from './ui';\nexport * from './url';\nexport * from './validation';\nexport * from './versions';\nexport * from './virtual-file';\nexport type * from './promise';\n"]}
|
package/dist/localization.d.cts
CHANGED
|
@@ -3,11 +3,11 @@ import type { SnapManifest } from "./manifest/index.cjs";
|
|
|
3
3
|
import type { VirtualFile } from "./virtual-file/index.cjs";
|
|
4
4
|
export declare const LOCALIZABLE_FIELDS: readonly ["description", "proposedName"];
|
|
5
5
|
export declare const LocalizationFileStruct: import("@metamask/superstruct").Struct<{
|
|
6
|
+
locale: string;
|
|
6
7
|
messages: Record<string, {
|
|
7
8
|
message: string;
|
|
8
9
|
description?: string | undefined;
|
|
9
10
|
}>;
|
|
10
|
-
locale: string;
|
|
11
11
|
}, {
|
|
12
12
|
locale: import("@metamask/superstruct").Struct<string, null>;
|
|
13
13
|
messages: import("@metamask/superstruct").Struct<Record<string, {
|
|
@@ -34,11 +34,11 @@ export declare function getValidatedLocalizationFiles(localizationFiles: Virtual
|
|
|
34
34
|
* found.
|
|
35
35
|
*/
|
|
36
36
|
export declare function getLocalizationFile(locale: string, localizationFiles: LocalizationFile[]): {
|
|
37
|
+
locale: string;
|
|
37
38
|
messages: Record<string, {
|
|
38
39
|
message: string;
|
|
39
40
|
description?: string | undefined;
|
|
40
41
|
}>;
|
|
41
|
-
locale: string;
|
|
42
42
|
} | undefined;
|
|
43
43
|
export declare const TRANSLATION_REGEX: RegExp;
|
|
44
44
|
/**
|
|
@@ -63,20 +63,20 @@ export declare function translate(value: string, file: LocalizationFile | undefi
|
|
|
63
63
|
* @returns The localized Snap manifest.
|
|
64
64
|
*/
|
|
65
65
|
export declare function getLocalizedSnapManifest(snapManifest: SnapManifest, locale: string, localizationFiles: LocalizationFile[]): {
|
|
66
|
+
description: string;
|
|
66
67
|
source: {
|
|
68
|
+
shasum: string;
|
|
67
69
|
location: {
|
|
68
70
|
npm: {
|
|
69
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
70
71
|
filePath: string;
|
|
71
72
|
packageName: string;
|
|
73
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
72
74
|
iconPath?: string | undefined;
|
|
73
75
|
};
|
|
74
76
|
};
|
|
75
|
-
shasum: string;
|
|
76
77
|
files?: string[] | undefined;
|
|
77
78
|
locales?: string[] | undefined;
|
|
78
79
|
};
|
|
79
|
-
description: string;
|
|
80
80
|
version: import("@metamask/utils").SemVerVersion;
|
|
81
81
|
proposedName: string;
|
|
82
82
|
initialPermissions: Partial<{
|
package/dist/localization.d.mts
CHANGED
|
@@ -3,11 +3,11 @@ import type { SnapManifest } from "./manifest/index.mjs";
|
|
|
3
3
|
import type { VirtualFile } from "./virtual-file/index.mjs";
|
|
4
4
|
export declare const LOCALIZABLE_FIELDS: readonly ["description", "proposedName"];
|
|
5
5
|
export declare const LocalizationFileStruct: import("@metamask/superstruct").Struct<{
|
|
6
|
+
locale: string;
|
|
6
7
|
messages: Record<string, {
|
|
7
8
|
message: string;
|
|
8
9
|
description?: string | undefined;
|
|
9
10
|
}>;
|
|
10
|
-
locale: string;
|
|
11
11
|
}, {
|
|
12
12
|
locale: import("@metamask/superstruct").Struct<string, null>;
|
|
13
13
|
messages: import("@metamask/superstruct").Struct<Record<string, {
|
|
@@ -34,11 +34,11 @@ export declare function getValidatedLocalizationFiles(localizationFiles: Virtual
|
|
|
34
34
|
* found.
|
|
35
35
|
*/
|
|
36
36
|
export declare function getLocalizationFile(locale: string, localizationFiles: LocalizationFile[]): {
|
|
37
|
+
locale: string;
|
|
37
38
|
messages: Record<string, {
|
|
38
39
|
message: string;
|
|
39
40
|
description?: string | undefined;
|
|
40
41
|
}>;
|
|
41
|
-
locale: string;
|
|
42
42
|
} | undefined;
|
|
43
43
|
export declare const TRANSLATION_REGEX: RegExp;
|
|
44
44
|
/**
|
|
@@ -63,20 +63,20 @@ export declare function translate(value: string, file: LocalizationFile | undefi
|
|
|
63
63
|
* @returns The localized Snap manifest.
|
|
64
64
|
*/
|
|
65
65
|
export declare function getLocalizedSnapManifest(snapManifest: SnapManifest, locale: string, localizationFiles: LocalizationFile[]): {
|
|
66
|
+
description: string;
|
|
66
67
|
source: {
|
|
68
|
+
shasum: string;
|
|
67
69
|
location: {
|
|
68
70
|
npm: {
|
|
69
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
70
71
|
filePath: string;
|
|
71
72
|
packageName: string;
|
|
73
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
72
74
|
iconPath?: string | undefined;
|
|
73
75
|
};
|
|
74
76
|
};
|
|
75
|
-
shasum: string;
|
|
76
77
|
files?: string[] | undefined;
|
|
77
78
|
locales?: string[] | undefined;
|
|
78
79
|
};
|
|
79
|
-
description: string;
|
|
80
80
|
version: import("@metamask/utils").SemVerVersion;
|
|
81
81
|
proposedName: string;
|
|
82
82
|
initialPermissions: Partial<{
|
|
@@ -10,22 +10,22 @@ export declare const bip32entropy: <Type extends {
|
|
|
10
10
|
}, Schema>(struct: Struct<Type, Schema>) => Struct<Type, Schema>;
|
|
11
11
|
export declare const CurveStruct: Describe<SupportedCurve>;
|
|
12
12
|
export declare const Bip32EntropyStruct: Struct<{
|
|
13
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
14
13
|
path: string[];
|
|
14
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
15
15
|
}, {
|
|
16
16
|
path: Struct<string[], Struct<string, null>>;
|
|
17
|
-
curve: Describe<"
|
|
17
|
+
curve: Describe<"secp256k1" | "ed25519" | "ed25519Bip32">;
|
|
18
18
|
}>;
|
|
19
19
|
export type Bip32Entropy = Infer<typeof Bip32EntropyStruct>;
|
|
20
20
|
export declare const SnapGetBip32EntropyPermissionsStruct: Struct<{
|
|
21
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
22
21
|
path: string[];
|
|
22
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
23
23
|
}[], Struct<{
|
|
24
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
25
24
|
path: string[];
|
|
25
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
26
26
|
}, {
|
|
27
27
|
path: Struct<string[], Struct<string, null>>;
|
|
28
|
-
curve: Describe<"
|
|
28
|
+
curve: Describe<"secp256k1" | "ed25519" | "ed25519Bip32">;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const SemVerRangeStruct: Struct<string, null>;
|
|
31
31
|
export declare const SnapIdsStruct: Struct<Record<string, {
|
|
@@ -60,20 +60,20 @@ export declare const SnapAuxilaryFilesStruct: Struct<string[], Struct<string, nu
|
|
|
60
60
|
export declare const InitialConnectionsStruct: Struct<Record<string & URL, {}>, null>;
|
|
61
61
|
export type InitialConnections = Infer<typeof InitialConnectionsStruct>;
|
|
62
62
|
export declare const SnapManifestStruct: Struct<{
|
|
63
|
+
description: string;
|
|
63
64
|
source: {
|
|
65
|
+
shasum: string;
|
|
64
66
|
location: {
|
|
65
67
|
npm: {
|
|
66
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
67
68
|
filePath: string;
|
|
68
69
|
packageName: string;
|
|
70
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
69
71
|
iconPath?: string | undefined;
|
|
70
72
|
};
|
|
71
73
|
};
|
|
72
|
-
shasum: string;
|
|
73
74
|
files?: string[] | undefined;
|
|
74
75
|
locales?: string[] | undefined;
|
|
75
76
|
};
|
|
76
|
-
description: string;
|
|
77
77
|
version: import("@metamask/utils").SemVerVersion;
|
|
78
78
|
proposedName: string;
|
|
79
79
|
initialPermissions: Partial<{
|
|
@@ -147,31 +147,31 @@ export declare const SnapManifestStruct: Struct<{
|
|
|
147
147
|
url: Struct<string, null>;
|
|
148
148
|
}>;
|
|
149
149
|
source: Struct<{
|
|
150
|
+
shasum: string;
|
|
150
151
|
location: {
|
|
151
152
|
npm: {
|
|
152
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
153
153
|
filePath: string;
|
|
154
154
|
packageName: string;
|
|
155
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
155
156
|
iconPath?: string | undefined;
|
|
156
157
|
};
|
|
157
158
|
};
|
|
158
|
-
shasum: string;
|
|
159
159
|
files?: string[] | undefined;
|
|
160
160
|
locales?: string[] | undefined;
|
|
161
161
|
}, {
|
|
162
162
|
shasum: Struct<string, null>;
|
|
163
163
|
location: Struct<{
|
|
164
164
|
npm: {
|
|
165
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
166
165
|
filePath: string;
|
|
167
166
|
packageName: string;
|
|
167
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
168
168
|
iconPath?: string | undefined;
|
|
169
169
|
};
|
|
170
170
|
}, {
|
|
171
171
|
npm: Struct<{
|
|
172
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
173
172
|
filePath: string;
|
|
174
173
|
packageName: string;
|
|
174
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
175
175
|
iconPath?: string | undefined;
|
|
176
176
|
}, {
|
|
177
177
|
filePath: Struct<string, null>;
|
|
@@ -10,22 +10,22 @@ export declare const bip32entropy: <Type extends {
|
|
|
10
10
|
}, Schema>(struct: Struct<Type, Schema>) => Struct<Type, Schema>;
|
|
11
11
|
export declare const CurveStruct: Describe<SupportedCurve>;
|
|
12
12
|
export declare const Bip32EntropyStruct: Struct<{
|
|
13
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
14
13
|
path: string[];
|
|
14
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
15
15
|
}, {
|
|
16
16
|
path: Struct<string[], Struct<string, null>>;
|
|
17
|
-
curve: Describe<"
|
|
17
|
+
curve: Describe<"secp256k1" | "ed25519" | "ed25519Bip32">;
|
|
18
18
|
}>;
|
|
19
19
|
export type Bip32Entropy = Infer<typeof Bip32EntropyStruct>;
|
|
20
20
|
export declare const SnapGetBip32EntropyPermissionsStruct: Struct<{
|
|
21
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
22
21
|
path: string[];
|
|
22
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
23
23
|
}[], Struct<{
|
|
24
|
-
curve: "ed25519" | "ed25519Bip32" | "secp256k1";
|
|
25
24
|
path: string[];
|
|
25
|
+
curve: "secp256k1" | "ed25519" | "ed25519Bip32";
|
|
26
26
|
}, {
|
|
27
27
|
path: Struct<string[], Struct<string, null>>;
|
|
28
|
-
curve: Describe<"
|
|
28
|
+
curve: Describe<"secp256k1" | "ed25519" | "ed25519Bip32">;
|
|
29
29
|
}>>;
|
|
30
30
|
export declare const SemVerRangeStruct: Struct<string, null>;
|
|
31
31
|
export declare const SnapIdsStruct: Struct<Record<string, {
|
|
@@ -60,20 +60,20 @@ export declare const SnapAuxilaryFilesStruct: Struct<string[], Struct<string, nu
|
|
|
60
60
|
export declare const InitialConnectionsStruct: Struct<Record<string & URL, {}>, null>;
|
|
61
61
|
export type InitialConnections = Infer<typeof InitialConnectionsStruct>;
|
|
62
62
|
export declare const SnapManifestStruct: Struct<{
|
|
63
|
+
description: string;
|
|
63
64
|
source: {
|
|
65
|
+
shasum: string;
|
|
64
66
|
location: {
|
|
65
67
|
npm: {
|
|
66
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
67
68
|
filePath: string;
|
|
68
69
|
packageName: string;
|
|
70
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
69
71
|
iconPath?: string | undefined;
|
|
70
72
|
};
|
|
71
73
|
};
|
|
72
|
-
shasum: string;
|
|
73
74
|
files?: string[] | undefined;
|
|
74
75
|
locales?: string[] | undefined;
|
|
75
76
|
};
|
|
76
|
-
description: string;
|
|
77
77
|
version: import("@metamask/utils").SemVerVersion;
|
|
78
78
|
proposedName: string;
|
|
79
79
|
initialPermissions: Partial<{
|
|
@@ -147,31 +147,31 @@ export declare const SnapManifestStruct: Struct<{
|
|
|
147
147
|
url: Struct<string, null>;
|
|
148
148
|
}>;
|
|
149
149
|
source: Struct<{
|
|
150
|
+
shasum: string;
|
|
150
151
|
location: {
|
|
151
152
|
npm: {
|
|
152
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
153
153
|
filePath: string;
|
|
154
154
|
packageName: string;
|
|
155
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
155
156
|
iconPath?: string | undefined;
|
|
156
157
|
};
|
|
157
158
|
};
|
|
158
|
-
shasum: string;
|
|
159
159
|
files?: string[] | undefined;
|
|
160
160
|
locales?: string[] | undefined;
|
|
161
161
|
}, {
|
|
162
162
|
shasum: Struct<string, null>;
|
|
163
163
|
location: Struct<{
|
|
164
164
|
npm: {
|
|
165
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
166
165
|
filePath: string;
|
|
167
166
|
packageName: string;
|
|
167
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
168
168
|
iconPath?: string | undefined;
|
|
169
169
|
};
|
|
170
170
|
}, {
|
|
171
171
|
npm: Struct<{
|
|
172
|
-
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
173
172
|
filePath: string;
|
|
174
173
|
packageName: string;
|
|
174
|
+
registry: "https://registry.npmjs.org" | "https://registry.npmjs.org/";
|
|
175
175
|
iconPath?: string | undefined;
|
|
176
176
|
}, {
|
|
177
177
|
filePath: Struct<string, null>;
|
package/dist/time.cjs
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ISO8601DateStruct = exports.ISO8601DurationStruct = void 0;
|
|
4
|
+
const superstruct_1 = require("@metamask/superstruct");
|
|
5
|
+
const luxon_1 = require("luxon");
|
|
6
|
+
/**
|
|
7
|
+
* Refines a string as an ISO 8601 duration.
|
|
8
|
+
*/
|
|
9
|
+
exports.ISO8601DurationStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'ISO 8601 duration', (value) => {
|
|
10
|
+
const parsedDuration = luxon_1.Duration.fromISO(value);
|
|
11
|
+
if (!parsedDuration.isValid) {
|
|
12
|
+
return 'Not a valid ISO 8601 duration';
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Regex to match the offset part of an ISO 8601 date.
|
|
18
|
+
*/
|
|
19
|
+
const offsetRegex = /Z|([+-]\d{2}:?\d{2})$/u;
|
|
20
|
+
/**
|
|
21
|
+
* Refines a string as an ISO 8601 date.
|
|
22
|
+
*/
|
|
23
|
+
exports.ISO8601DateStruct = (0, superstruct_1.refine)((0, superstruct_1.string)(), 'ISO 8601 date', (value) => {
|
|
24
|
+
const parsedDate = luxon_1.DateTime.fromISO(value);
|
|
25
|
+
if (!parsedDate.isValid) {
|
|
26
|
+
return 'Not a valid ISO 8601 date';
|
|
27
|
+
}
|
|
28
|
+
if (!offsetRegex.test(value)) {
|
|
29
|
+
// Luxon doesn't have a reliable way to check if timezone info was not provided
|
|
30
|
+
return 'ISO 8601 date must have timezone information';
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=time.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.cjs","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;;AAAA,uDAAuD;AACvD,iCAA2C;AAE3C;;GAEG;AACU,QAAA,qBAAqB,GAAG,IAAA,oBAAM,EACzC,IAAA,oBAAM,GAAE,EACR,mBAAmB,EACnB,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,cAAc,GAAG,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC5B,OAAO,+BAA+B,CAAC;IACzC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3E,MAAM,UAAU,GAAG,gBAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,+EAA+E;QAC/E,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC","sourcesContent":["import { refine, string } from '@metamask/superstruct';\nimport { DateTime, Duration } from 'luxon';\n\n/**\n * Refines a string as an ISO 8601 duration.\n */\nexport const ISO8601DurationStruct = refine(\n string(),\n 'ISO 8601 duration',\n (value) => {\n const parsedDuration = Duration.fromISO(value);\n if (!parsedDuration.isValid) {\n return 'Not a valid ISO 8601 duration';\n }\n return true;\n },\n);\n\n/**\n * Regex to match the offset part of an ISO 8601 date.\n */\nconst offsetRegex = /Z|([+-]\\d{2}:?\\d{2})$/u;\n\n/**\n * Refines a string as an ISO 8601 date.\n */\nexport const ISO8601DateStruct = refine(string(), 'ISO 8601 date', (value) => {\n const parsedDate = DateTime.fromISO(value);\n\n if (!parsedDate.isValid) {\n return 'Not a valid ISO 8601 date';\n }\n\n if (!offsetRegex.test(value)) {\n // Luxon doesn't have a reliable way to check if timezone info was not provided\n return 'ISO 8601 date must have timezone information';\n }\n\n return true;\n});\n"]}
|
package/dist/time.d.cts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refines a string as an ISO 8601 duration.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ISO8601DurationStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
5
|
+
/**
|
|
6
|
+
* Refines a string as an ISO 8601 date.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ISO8601DateStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
9
|
+
//# sourceMappingURL=time.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.cts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,qBAAqB,sDAUjC,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,iBAAiB,sDAa5B,CAAC"}
|
package/dist/time.d.mts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refines a string as an ISO 8601 duration.
|
|
3
|
+
*/
|
|
4
|
+
export declare const ISO8601DurationStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
5
|
+
/**
|
|
6
|
+
* Refines a string as an ISO 8601 date.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ISO8601DateStruct: import("@metamask/superstruct").Struct<string, null>;
|
|
9
|
+
//# sourceMappingURL=time.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.mts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,eAAO,MAAM,qBAAqB,sDAUjC,CAAC;AAOF;;GAEG;AACH,eAAO,MAAM,iBAAiB,sDAa5B,CAAC"}
|
package/dist/time.mjs
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { refine, string } from "@metamask/superstruct";
|
|
2
|
+
import { DateTime, Duration } from "luxon";
|
|
3
|
+
/**
|
|
4
|
+
* Refines a string as an ISO 8601 duration.
|
|
5
|
+
*/
|
|
6
|
+
export const ISO8601DurationStruct = refine(string(), 'ISO 8601 duration', (value) => {
|
|
7
|
+
const parsedDuration = Duration.fromISO(value);
|
|
8
|
+
if (!parsedDuration.isValid) {
|
|
9
|
+
return 'Not a valid ISO 8601 duration';
|
|
10
|
+
}
|
|
11
|
+
return true;
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Regex to match the offset part of an ISO 8601 date.
|
|
15
|
+
*/
|
|
16
|
+
const offsetRegex = /Z|([+-]\d{2}:?\d{2})$/u;
|
|
17
|
+
/**
|
|
18
|
+
* Refines a string as an ISO 8601 date.
|
|
19
|
+
*/
|
|
20
|
+
export const ISO8601DateStruct = refine(string(), 'ISO 8601 date', (value) => {
|
|
21
|
+
const parsedDate = DateTime.fromISO(value);
|
|
22
|
+
if (!parsedDate.isValid) {
|
|
23
|
+
return 'Not a valid ISO 8601 date';
|
|
24
|
+
}
|
|
25
|
+
if (!offsetRegex.test(value)) {
|
|
26
|
+
// Luxon doesn't have a reliable way to check if timezone info was not provided
|
|
27
|
+
return 'ISO 8601 date must have timezone information';
|
|
28
|
+
}
|
|
29
|
+
return true;
|
|
30
|
+
});
|
|
31
|
+
//# sourceMappingURL=time.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.mjs","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,8BAA8B;AACvD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CACzC,MAAM,EAAE,EACR,mBAAmB,EACnB,CAAC,KAAK,EAAE,EAAE;IACR,MAAM,cAAc,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/C,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC;QAC5B,OAAO,+BAA+B,CAAC;IACzC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC,CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAG,wBAAwB,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;IAC3E,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAE3C,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACxB,OAAO,2BAA2B,CAAC;IACrC,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC7B,+EAA+E;QAC/E,OAAO,8CAA8C,CAAC;IACxD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC,CAAC,CAAC","sourcesContent":["import { refine, string } from '@metamask/superstruct';\nimport { DateTime, Duration } from 'luxon';\n\n/**\n * Refines a string as an ISO 8601 duration.\n */\nexport const ISO8601DurationStruct = refine(\n string(),\n 'ISO 8601 duration',\n (value) => {\n const parsedDuration = Duration.fromISO(value);\n if (!parsedDuration.isValid) {\n return 'Not a valid ISO 8601 duration';\n }\n return true;\n },\n);\n\n/**\n * Regex to match the offset part of an ISO 8601 date.\n */\nconst offsetRegex = /Z|([+-]\\d{2}:?\\d{2})$/u;\n\n/**\n * Refines a string as an ISO 8601 date.\n */\nexport const ISO8601DateStruct = refine(string(), 'ISO 8601 date', (value) => {\n const parsedDate = DateTime.fromISO(value);\n\n if (!parsedDate.isValid) {\n return 'Not a valid ISO 8601 date';\n }\n\n if (!offsetRegex.test(value)) {\n // Luxon doesn't have a reliable way to check if timezone info was not provided\n return 'ISO 8601 date must have timezone information';\n }\n\n return true;\n});\n"]}
|
package/dist/types.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Infer, Struct } from "@metamask/superstruct";
|
|
2
2
|
import type { Json } from "@metamask/utils";
|
|
3
3
|
import type { SnapCaveatType } from "./caveats.cjs";
|
|
4
|
-
import type { SnapFunctionExports, SnapRpcHookArgs } from "./handlers.cjs";
|
|
4
|
+
import type { SnapFunctionExports, SnapRpcHookArgs } from "./handlers/index.cjs";
|
|
5
5
|
import type { LocalizationFile } from "./localization.cjs";
|
|
6
6
|
import type { SnapManifest } from "./manifest/index.cjs";
|
|
7
7
|
import type { VirtualFile } from "./virtual-file/index.cjs";
|
|
@@ -11,8 +11,8 @@ export declare enum NpmSnapFileNames {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const NameStruct: Struct<string, null>;
|
|
13
13
|
export declare const NpmSnapPackageJsonStruct: Struct<{
|
|
14
|
-
name: string;
|
|
15
14
|
version: import("@metamask/utils").SemVerVersion;
|
|
15
|
+
name: string;
|
|
16
16
|
main?: string | undefined;
|
|
17
17
|
repository?: {
|
|
18
18
|
type: string;
|
package/dist/types.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.cts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,8BAA8B;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,wBAAwB;AAG5C,OAAO,KAAK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AC,+BAWrC,CAAC;AAEL;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,GAAG,EAAE,OAAO,EACZ,IAAI,GAAE,UAAU,CAAC,GAAG,CAAM,GACzB,GAAG,IAAI,MAAM,GAAG,GAAG,CAErB;AAGD,eAAO,MAAM,0BAA0B,gBAAgB,CAAC;AAExD,MAAM,MAAM,sBAAsB,GAAG;IACnC,CAAC,0BAA0B,CAAC,EAAE;QAC5B,OAAO,EAAE;YACP;gBACE,IAAI,EAAE,cAAc,CAAC,OAAO,CAAC;gBAC7B,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;aAC7B;SACF,CAAC;KACH,CAAC;CACH,CAAC"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Infer, Struct } from "@metamask/superstruct";
|
|
2
2
|
import type { Json } from "@metamask/utils";
|
|
3
3
|
import type { SnapCaveatType } from "./caveats.mjs";
|
|
4
|
-
import type { SnapFunctionExports, SnapRpcHookArgs } from "./handlers.mjs";
|
|
4
|
+
import type { SnapFunctionExports, SnapRpcHookArgs } from "./handlers/index.mjs";
|
|
5
5
|
import type { LocalizationFile } from "./localization.mjs";
|
|
6
6
|
import type { SnapManifest } from "./manifest/index.mjs";
|
|
7
7
|
import type { VirtualFile } from "./virtual-file/index.mjs";
|
|
@@ -11,8 +11,8 @@ export declare enum NpmSnapFileNames {
|
|
|
11
11
|
}
|
|
12
12
|
export declare const NameStruct: Struct<string, null>;
|
|
13
13
|
export declare const NpmSnapPackageJsonStruct: Struct<{
|
|
14
|
-
name: string;
|
|
15
14
|
version: import("@metamask/utils").SemVerVersion;
|
|
15
|
+
name: string;
|
|
16
16
|
main?: string | undefined;
|
|
17
17
|
repository?: {
|
|
18
18
|
type: string;
|
package/dist/types.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings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