@metamask/snaps-jest 6.0.2 → 7.0.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 +12 -1
- package/README.md +100 -7
- package/dist/{chunk-6RXFM4YC.js → chunk-2JAGD4N6.js} +3 -3
- package/dist/{chunk-7YD4IW43.mjs → chunk-3M4GRUMH.mjs} +3 -6
- package/dist/chunk-3M4GRUMH.mjs.map +1 -0
- package/dist/{chunk-7BFTEFLS.mjs → chunk-5U5WB3SM.mjs} +5 -3
- package/dist/chunk-5U5WB3SM.mjs.map +1 -0
- package/dist/chunk-6POKT4OO.js +127 -0
- package/dist/chunk-6POKT4OO.js.map +1 -0
- package/dist/{chunk-7VILST6M.mjs → chunk-BVGI3E45.mjs} +2 -2
- package/dist/chunk-CKRORVDW.js +1 -0
- package/dist/{chunk-6HW5NGCB.js → chunk-DTDYOBCI.js} +3 -3
- package/dist/{chunk-WIFOID2P.mjs → chunk-EDEJD326.mjs} +20 -10
- package/dist/chunk-EDEJD326.mjs.map +1 -0
- package/dist/{chunk-B4QZXXQY.js → chunk-FIZAYEHV.js} +4 -4
- package/dist/chunk-I5P52IMF.mjs +223 -0
- package/dist/chunk-I5P52IMF.mjs.map +1 -0
- package/dist/{chunk-T2BE4O5H.js → chunk-IDGD7TZ7.js} +33 -23
- package/dist/chunk-IDGD7TZ7.js.map +1 -0
- package/dist/{chunk-BS24WMRW.mjs → chunk-LG3VKXGH.mjs} +2 -2
- package/dist/{chunk-C2ONPIIB.js → chunk-MCYTJUDG.js} +10 -15
- package/dist/chunk-MCYTJUDG.js.map +1 -0
- package/dist/chunk-PVMIH6OB.mjs +127 -0
- package/dist/chunk-PVMIH6OB.mjs.map +1 -0
- package/dist/chunk-S2HLITUN.js +1 -0
- package/dist/{chunk-ISWZ7XZ5.js → chunk-SB5EPHE3.js} +5 -3
- package/dist/chunk-SB5EPHE3.js.map +1 -0
- package/dist/{chunk-HBLJOACO.mjs → chunk-TAIJXTLU.mjs} +2 -10
- package/dist/chunk-TAIJXTLU.mjs.map +1 -0
- package/dist/chunk-TGZ7WOTJ.mjs +1 -0
- package/dist/chunk-UDOXICJK.mjs +1 -0
- package/dist/{chunk-3HU56QS3.mjs → chunk-VSUNWJMQ.mjs} +8 -13
- package/dist/chunk-VSUNWJMQ.mjs.map +1 -0
- package/dist/{chunk-TO46ICOZ.js → chunk-WMLSD6B5.js} +3 -6
- package/dist/chunk-WMLSD6B5.js.map +1 -0
- package/dist/{chunk-3SNZ4SPY.mjs → chunk-X5IPMTHO.mjs} +2 -2
- package/dist/chunk-Y4DKEF7Y.js +223 -0
- package/dist/chunk-Y4DKEF7Y.js.map +1 -0
- package/dist/{chunk-7J34R6YW.mjs → chunk-YEVKBYKO.mjs} +35 -25
- package/dist/chunk-YEVKBYKO.mjs.map +1 -0
- package/dist/{chunk-5PLDD7ZC.js → chunk-Z35PCKFD.js} +24 -14
- package/dist/chunk-Z35PCKFD.js.map +1 -0
- package/dist/{chunk-LXSNRZV4.js → chunk-ZWN4SO2V.js} +5 -13
- package/dist/chunk-ZWN4SO2V.js.map +1 -0
- package/dist/environment.js +13 -14
- package/dist/environment.mjs +12 -13
- package/dist/global.js +2 -0
- package/dist/global.js.map +1 -0
- package/dist/global.mjs +2 -0
- package/dist/global.mjs.map +1 -0
- package/dist/helpers.js +13 -14
- package/dist/helpers.mjs +12 -13
- package/dist/index.js +16 -16
- package/dist/index.mjs +15 -15
- package/dist/internals/index.js +27 -14
- package/dist/internals/index.mjs +30 -17
- package/dist/internals/request.js +12 -11
- package/dist/internals/request.mjs +13 -12
- package/dist/internals/simulation/controllers.js +6 -7
- package/dist/internals/simulation/controllers.mjs +5 -6
- package/dist/internals/simulation/index.js +17 -10
- package/dist/internals/simulation/index.mjs +17 -10
- package/dist/internals/simulation/interface.js +11 -3
- package/dist/internals/simulation/interface.mjs +12 -4
- package/dist/internals/simulation/methods/hooks/index.js +4 -10
- package/dist/internals/simulation/methods/hooks/index.mjs +3 -9
- package/dist/internals/simulation/methods/hooks/notifications.js +1 -1
- package/dist/internals/simulation/methods/hooks/notifications.mjs +1 -1
- package/dist/internals/simulation/methods/hooks/show-dialog.js +1 -1
- package/dist/internals/simulation/methods/hooks/show-dialog.mjs +1 -1
- package/dist/internals/simulation/methods/hooks/state.js +3 -3
- package/dist/internals/simulation/methods/hooks/state.mjs +2 -2
- package/dist/internals/simulation/methods/index.js +5 -6
- package/dist/internals/simulation/methods/index.mjs +4 -5
- package/dist/internals/simulation/methods/specifications.js +5 -6
- package/dist/internals/simulation/methods/specifications.mjs +4 -5
- package/dist/internals/simulation/simulation.js +8 -9
- package/dist/internals/simulation/simulation.mjs +7 -8
- package/dist/internals/simulation/store/index.js +2 -2
- package/dist/internals/simulation/store/index.mjs +1 -1
- package/dist/internals/simulation/store/store.js +2 -2
- package/dist/internals/simulation/store/store.mjs +1 -1
- package/dist/internals/structs.js +6 -2
- package/dist/internals/structs.mjs +5 -1
- package/dist/matchers.js +13 -14
- package/dist/matchers.mjs +12 -13
- package/dist/setup.js +12 -13
- package/dist/setup.mjs +12 -13
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/global.d.ts +69 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/internals/request.d.ts +13 -4
- package/dist/types/internals/simulation/interface.d.ts +47 -4
- package/dist/types/internals/simulation/methods/hooks/index.d.ts +0 -1
- package/dist/types/internals/simulation/methods/hooks/state.d.ts +2 -1
- package/dist/types/internals/simulation/store/store.d.ts +1 -2
- package/dist/types/internals/structs.d.ts +79 -156
- package/dist/types/types.d.ts +42 -21
- package/package.json +6 -6
- package/dist/chunk-2X23DUDP.mjs +0 -22
- package/dist/chunk-2X23DUDP.mjs.map +0 -1
- package/dist/chunk-3HU56QS3.mjs.map +0 -1
- package/dist/chunk-5PLDD7ZC.js.map +0 -1
- package/dist/chunk-6MVV44M5.mjs +0 -76
- package/dist/chunk-6MVV44M5.mjs.map +0 -1
- package/dist/chunk-7BFTEFLS.mjs.map +0 -1
- package/dist/chunk-7J34R6YW.mjs.map +0 -1
- package/dist/chunk-7YD4IW43.mjs.map +0 -1
- package/dist/chunk-C2ONPIIB.js.map +0 -1
- package/dist/chunk-HBLJOACO.mjs.map +0 -1
- package/dist/chunk-HNH5UAKZ.js +0 -80
- package/dist/chunk-HNH5UAKZ.js.map +0 -1
- package/dist/chunk-ISWZ7XZ5.js.map +0 -1
- package/dist/chunk-LXSNRZV4.js.map +0 -1
- package/dist/chunk-LYK6EGZU.mjs +0 -80
- package/dist/chunk-LYK6EGZU.mjs.map +0 -1
- package/dist/chunk-RD7GQCPL.js +0 -22
- package/dist/chunk-RD7GQCPL.js.map +0 -1
- package/dist/chunk-T2BE4O5H.js.map +0 -1
- package/dist/chunk-TO46ICOZ.js.map +0 -1
- package/dist/chunk-U5BLLHIU.js +0 -1
- package/dist/chunk-V6LFAN3U.mjs +0 -1
- package/dist/chunk-WIFOID2P.mjs.map +0 -1
- package/dist/chunk-ZAQZRYPW.js +0 -76
- package/dist/chunk-ZAQZRYPW.js.map +0 -1
- package/dist/internals/simulation/methods/hooks/encryption.js +0 -10
- package/dist/internals/simulation/methods/hooks/encryption.mjs +0 -10
- package/dist/types/internals/simulation/methods/hooks/encryption.d.ts +0 -29
- /package/dist/{chunk-6RXFM4YC.js.map → chunk-2JAGD4N6.js.map} +0 -0
- /package/dist/{chunk-7VILST6M.mjs.map → chunk-BVGI3E45.mjs.map} +0 -0
- /package/dist/{chunk-U5BLLHIU.js.map → chunk-CKRORVDW.js.map} +0 -0
- /package/dist/{chunk-6HW5NGCB.js.map → chunk-DTDYOBCI.js.map} +0 -0
- /package/dist/{chunk-B4QZXXQY.js.map → chunk-FIZAYEHV.js.map} +0 -0
- /package/dist/{chunk-BS24WMRW.mjs.map → chunk-LG3VKXGH.mjs.map} +0 -0
- /package/dist/{internals/simulation/methods/hooks/encryption.js.map → chunk-S2HLITUN.js.map} +0 -0
- /package/dist/{chunk-V6LFAN3U.mjs.map → chunk-TGZ7WOTJ.mjs.map} +0 -0
- /package/dist/{internals/simulation/methods/hooks/encryption.mjs.map → chunk-UDOXICJK.mjs.map} +0 -0
- /package/dist/{chunk-3SNZ4SPY.mjs.map → chunk-X5IPMTHO.mjs.map} +0 -0
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2JTGBHPRjs = require('./chunk-2JTGBHPR.js');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunk6POKT4OOjs = require('./chunk-6POKT4OO.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
+
var _chunkTZB4LBT7js = require('./chunk-TZB4LBT7.js');
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
var _chunkT2BE4O5Hjs = require('./chunk-T2BE4O5H.js');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
15
|
-
var
|
|
15
|
+
var _chunkIDGD7TZ7js = require('./chunk-IDGD7TZ7.js');
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
|
|
19
|
+
var _chunkLACTK6EOjs = require('./chunk-LACTK6EO.js');
|
|
19
20
|
|
|
20
21
|
// src/helpers.ts
|
|
21
22
|
var _snapsutils = require('@metamask/snaps-utils');
|
|
@@ -28,6 +29,9 @@ function getOptions(snapId, options) {
|
|
|
28
29
|
}
|
|
29
30
|
return [snapId, options];
|
|
30
31
|
}
|
|
32
|
+
function assertIsResponseWithInterface(response) {
|
|
33
|
+
_utils.assertStruct.call(void 0, response, _chunkIDGD7TZ7js.SnapResponseWithInterfaceStruct);
|
|
34
|
+
}
|
|
31
35
|
async function installSnap(snapId, options = {}) {
|
|
32
36
|
const resolvedOptions = getOptions(snapId, options);
|
|
33
37
|
const {
|
|
@@ -43,8 +47,8 @@ async function installSnap(snapId, options = {}) {
|
|
|
43
47
|
origin: transactionOrigin,
|
|
44
48
|
chainId,
|
|
45
49
|
...transaction
|
|
46
|
-
} = _superstruct.create.call(void 0, request,
|
|
47
|
-
|
|
50
|
+
} = _superstruct.create.call(void 0, request, _chunkIDGD7TZ7js.TransactionOptionsStruct);
|
|
51
|
+
const response = await _chunk6POKT4OOjs.handleRequest.call(void 0, {
|
|
48
52
|
snapId: installedSnapId,
|
|
49
53
|
store,
|
|
50
54
|
executionService,
|
|
@@ -60,10 +64,12 @@ async function installSnap(snapId, options = {}) {
|
|
|
60
64
|
}
|
|
61
65
|
}
|
|
62
66
|
});
|
|
67
|
+
assertIsResponseWithInterface(response);
|
|
68
|
+
return response;
|
|
63
69
|
};
|
|
64
70
|
const onCronjob = (request) => {
|
|
65
71
|
log("Running cronjob %o.", options);
|
|
66
|
-
return
|
|
72
|
+
return _chunk6POKT4OOjs.handleRequest.call(void 0, {
|
|
67
73
|
snapId: installedSnapId,
|
|
68
74
|
store,
|
|
69
75
|
executionService,
|
|
@@ -76,7 +82,7 @@ async function installSnap(snapId, options = {}) {
|
|
|
76
82
|
return {
|
|
77
83
|
request: (request) => {
|
|
78
84
|
log("Sending request %o.", request);
|
|
79
|
-
return
|
|
85
|
+
return _chunk6POKT4OOjs.handleRequest.call(void 0, {
|
|
80
86
|
snapId: installedSnapId,
|
|
81
87
|
store,
|
|
82
88
|
executionService,
|
|
@@ -92,9 +98,9 @@ async function installSnap(snapId, options = {}) {
|
|
|
92
98
|
log("Requesting signature %o.", request);
|
|
93
99
|
const { origin: signatureOrigin, ...signature } = _superstruct.create.call(void 0,
|
|
94
100
|
request,
|
|
95
|
-
|
|
101
|
+
_chunkIDGD7TZ7js.SignatureOptionsStruct
|
|
96
102
|
);
|
|
97
|
-
|
|
103
|
+
const response = await _chunk6POKT4OOjs.handleRequest.call(void 0, {
|
|
98
104
|
snapId: installedSnapId,
|
|
99
105
|
store,
|
|
100
106
|
executionService,
|
|
@@ -109,12 +115,14 @@ async function installSnap(snapId, options = {}) {
|
|
|
109
115
|
}
|
|
110
116
|
}
|
|
111
117
|
});
|
|
118
|
+
assertIsResponseWithInterface(response);
|
|
119
|
+
return response;
|
|
112
120
|
},
|
|
113
121
|
onCronjob,
|
|
114
122
|
runCronjob: onCronjob,
|
|
115
123
|
onHomePage: async () => {
|
|
116
124
|
log("Rendering home page.");
|
|
117
|
-
|
|
125
|
+
const response = await _chunk6POKT4OOjs.handleRequest.call(void 0, {
|
|
118
126
|
snapId: installedSnapId,
|
|
119
127
|
store,
|
|
120
128
|
executionService,
|
|
@@ -125,10 +133,12 @@ async function installSnap(snapId, options = {}) {
|
|
|
125
133
|
method: ""
|
|
126
134
|
}
|
|
127
135
|
});
|
|
136
|
+
assertIsResponseWithInterface(response);
|
|
137
|
+
return response;
|
|
128
138
|
},
|
|
129
139
|
mockJsonRpc(mock) {
|
|
130
140
|
log("Mocking JSON-RPC request %o.", mock);
|
|
131
|
-
const { method, result } = _superstruct.create.call(void 0, mock,
|
|
141
|
+
const { method, result } = _superstruct.create.call(void 0, mock, _chunkIDGD7TZ7js.JsonRpcMockOptionsStruct);
|
|
132
142
|
store.dispatch(_chunkLACTK6EOjs.addJsonRpcMock.call(void 0, { method, result }));
|
|
133
143
|
return {
|
|
134
144
|
unmock() {
|
|
@@ -150,4 +160,4 @@ async function installSnap(snapId, options = {}) {
|
|
|
150
160
|
|
|
151
161
|
|
|
152
162
|
exports.installSnap = installSnap;
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
163
|
+
//# sourceMappingURL=chunk-Z35PCKFD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/helpers.ts"],"names":[],"mappings":"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","sourcesContent":["import type { AbstractExecutionService } from '@metamask/snaps-controllers';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport { HandlerType, logInfo } from '@metamask/snaps-utils';\nimport { assertStruct, createModuleLogger } from '@metamask/utils';\nimport { create } from 'superstruct';\n\nimport {\n rootLogger,\n handleRequest,\n TransactionOptionsStruct,\n getEnvironment,\n JsonRpcMockOptionsStruct,\n SignatureOptionsStruct,\n SnapResponseWithInterfaceStruct,\n} from './internals';\nimport type { InstallSnapOptions } from './internals';\nimport {\n addJsonRpcMock,\n removeJsonRpcMock,\n} from './internals/simulation/store/mocks';\nimport type {\n SnapResponseWithInterface,\n CronjobOptions,\n JsonRpcMockOptions,\n Snap,\n SnapResponse,\n TransactionOptions,\n} from './types';\n\nconst log = createModuleLogger(rootLogger, 'helpers');\n\n/**\n * Get the options for {@link installSnap}.\n *\n * @param snapId - The ID of the Snap, or the options.\n * @param options - The options, if any.\n * @returns The options.\n */\nfunction getOptions<\n Service extends new (...args: any[]) => InstanceType<\n typeof AbstractExecutionService\n >,\n>(\n snapId: SnapId | Partial<InstallSnapOptions<Service>> | undefined,\n options: Partial<InstallSnapOptions<Service>>,\n): [SnapId | undefined, Partial<InstallSnapOptions<Service>>] {\n if (typeof snapId === 'object') {\n return [undefined, snapId];\n }\n\n return [snapId, options];\n}\n\n/**\n * Ensure that the actual response contains `getInterface`.\n *\n * @param response - The response of the handler.\n */\nfunction assertIsResponseWithInterface(\n response: SnapResponse,\n): asserts response is SnapResponseWithInterface {\n assertStruct(response, SnapResponseWithInterfaceStruct);\n}\n\n/**\n * Load a snap into the environment. This is the main entry point for testing\n * snaps: It returns a {@link Snap} object that can be used to interact with the\n * snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * describe('My Snap', () => {\n * it('should do something', async () => {\n * const { request } = await installSnap('local:my-snap');\n * const response = await request({\n * method: 'foo',\n * params: ['bar'],\n * });\n * expect(response).toRespondWith('bar');\n * });\n * });\n * @returns The snap.\n * @throws If the built-in server is not running, and no snap ID is provided.\n */\nexport async function installSnap(): Promise<Snap>;\n\n/**\n * Load a snap into the environment. This is the main entry point for testing\n * snaps: It returns a {@link Snap} object that can be used to interact with the\n * snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * describe('My Snap', () => {\n * it('should do something', async () => {\n * const { request } = await installSnap('local:my-snap');\n * const response = await request({\n * method: 'foo',\n * params: ['bar'],\n * });\n * expect(response).toRespondWith('bar');\n * });\n * });\n * @param options - The options to use.\n * @param options.executionService - The execution service to use. Defaults to\n * {@link NodeThreadExecutionService}. You do not need to provide this unless\n * you are testing a custom execution service.\n * @param options.executionServiceOptions - The options to use when creating the\n * execution service, if any. This should only include options specific to the\n * provided execution service.\n * @param options.options - The simulation options.\n * @returns The snap.\n * @throws If the built-in server is not running, and no snap ID is provided.\n */\nexport async function installSnap<\n Service extends new (...args: any[]) => InstanceType<\n typeof AbstractExecutionService\n >,\n>(options: Partial<InstallSnapOptions<Service>>): Promise<Snap>;\n\n/**\n * Load a snap into the environment. This is the main entry point for testing\n * snaps: It returns a {@link Snap} object that can be used to interact with the\n * snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * describe('My Snap', () => {\n * it('should do something', async () => {\n * const { request } = await installSnap('local:my-snap');\n * const response = await request({\n * method: 'foo',\n * params: ['bar'],\n * });\n * expect(response).toRespondWith('bar');\n * });\n * });\n * @param snapId - The ID of the snap, including the prefix (`local:`). Defaults\n * to the URL of the built-in server, if it is running. This supports both\n * local snap IDs and NPM snap IDs.\n * @param options - The options to use.\n * @param options.executionService - The execution service to use. Defaults to\n * {@link NodeThreadExecutionService}. You do not need to provide this unless\n * you are testing a custom execution service.\n * @param options.executionServiceOptions - The options to use when creating the\n * execution service, if any. This should only include options specific to the\n * provided execution service.\n * @param options.options - The simulation options.\n * @returns The snap.\n * @throws If the built-in server is not running, and no snap ID is provided.\n */\nexport async function installSnap<\n Service extends new (...args: any[]) => InstanceType<\n typeof AbstractExecutionService\n >,\n>(\n snapId: SnapId,\n options?: Partial<InstallSnapOptions<Service>>,\n): Promise<Snap>;\n\n/**\n * Load a snap into the environment. This is the main entry point for testing\n * snaps: It returns a {@link Snap} object that can be used to interact with the\n * snap.\n *\n * @example\n * import { installSnap } from '@metamask/snaps-jest';\n *\n * describe('My Snap', () => {\n * it('should do something', async () => {\n * const { request } = await installSnap('local:my-snap');\n * const response = await request({\n * method: 'foo',\n * params: ['bar'],\n * });\n * expect(response).toRespondWith('bar');\n * });\n * });\n * @param snapId - The ID of the snap, including the prefix (`local:`). Defaults\n * to the URL of the built-in server, if it is running. This supports both\n * local snap IDs and NPM snap IDs.\n * @param options - The options to use.\n * @param options.executionService - The execution service to use. Defaults to\n * {@link NodeThreadExecutionService}. You do not need to provide this unless\n * you are testing a custom execution service.\n * @param options.executionServiceOptions - The options to use when creating the\n * execution service, if any. This should only include options specific to the\n * provided execution service.\n * @param options.options - The simulation options.\n * @returns The snap.\n * @throws If the built-in server is not running, and no snap ID is provided.\n */\nexport async function installSnap<\n Service extends new (...args: any[]) => InstanceType<\n typeof AbstractExecutionService\n >,\n>(\n snapId?: SnapId | Partial<InstallSnapOptions<Service>>,\n options: Partial<InstallSnapOptions<Service>> = {},\n): Promise<Snap> {\n const resolvedOptions = getOptions(snapId, options);\n const {\n snapId: installedSnapId,\n store,\n executionService,\n runSaga,\n controllerMessenger,\n } = await getEnvironment().installSnap(...resolvedOptions);\n\n const onTransaction = async (\n request: TransactionOptions,\n ): Promise<SnapResponseWithInterface> => {\n log('Sending transaction %o.', request);\n\n const {\n origin: transactionOrigin,\n chainId,\n ...transaction\n } = create(request, TransactionOptionsStruct);\n\n const response = await handleRequest({\n snapId: installedSnapId,\n store,\n executionService,\n runSaga,\n controllerMessenger,\n handler: HandlerType.OnTransaction,\n request: {\n method: '',\n params: {\n chainId,\n transaction,\n transactionOrigin,\n },\n },\n });\n\n assertIsResponseWithInterface(response);\n\n return response;\n };\n\n const onCronjob = (request: CronjobOptions) => {\n log('Running cronjob %o.', options);\n\n return handleRequest({\n snapId: installedSnapId,\n store,\n executionService,\n controllerMessenger,\n runSaga,\n handler: HandlerType.OnCronjob,\n request,\n });\n };\n\n return {\n request: (request) => {\n log('Sending request %o.', request);\n\n return handleRequest({\n snapId: installedSnapId,\n store,\n executionService,\n controllerMessenger,\n runSaga,\n handler: HandlerType.OnRpcRequest,\n request,\n });\n },\n\n onTransaction,\n sendTransaction: onTransaction,\n\n onSignature: async (\n request: unknown,\n ): Promise<SnapResponseWithInterface> => {\n log('Requesting signature %o.', request);\n\n const { origin: signatureOrigin, ...signature } = create(\n request,\n SignatureOptionsStruct,\n );\n\n const response = await handleRequest({\n snapId: installedSnapId,\n store,\n executionService,\n controllerMessenger,\n runSaga,\n handler: HandlerType.OnSignature,\n request: {\n method: '',\n params: {\n signature,\n signatureOrigin,\n },\n },\n });\n\n assertIsResponseWithInterface(response);\n\n return response;\n },\n\n onCronjob,\n runCronjob: onCronjob,\n\n onHomePage: async (): Promise<SnapResponseWithInterface> => {\n log('Rendering home page.');\n\n const response = await handleRequest({\n snapId: installedSnapId,\n store,\n executionService,\n controllerMessenger,\n runSaga,\n handler: HandlerType.OnHomePage,\n request: {\n method: '',\n },\n });\n\n assertIsResponseWithInterface(response);\n\n return response;\n },\n\n mockJsonRpc(mock: JsonRpcMockOptions) {\n log('Mocking JSON-RPC request %o.', mock);\n\n const { method, result } = create(mock, JsonRpcMockOptionsStruct);\n store.dispatch(addJsonRpcMock({ method, result }));\n\n return {\n unmock() {\n log('Unmocking JSON-RPC request %o.', mock);\n\n store.dispatch(removeJsonRpcMock(method));\n },\n };\n },\n\n close: async () => {\n log('Closing execution service.');\n logInfo(\n 'Calling `snap.close()` is deprecated, and will be removed in a future release. Snaps are now automatically closed when the test ends.',\n );\n\n await executionService.terminateAllSnaps();\n },\n };\n}\n"]}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
var _chunkRD7GQCPLjs = require('./chunk-RD7GQCPL.js');
|
|
5
|
-
|
|
6
|
-
|
|
7
3
|
var _chunk265BMFM5js = require('./chunk-265BMFM5.js');
|
|
8
4
|
|
|
9
5
|
|
|
@@ -20,7 +16,7 @@ var _chunkRAMAN5RMjs = require('./chunk-RAMAN5RM.js');
|
|
|
20
16
|
|
|
21
17
|
|
|
22
18
|
|
|
23
|
-
var
|
|
19
|
+
var _chunkSB5EPHE3js = require('./chunk-SB5EPHE3.js');
|
|
24
20
|
|
|
25
21
|
|
|
26
22
|
|
|
@@ -50,14 +46,10 @@ function getPermissionSpecifications({
|
|
|
50
46
|
..._snapsrpcmethods.buildSnapRestrictedMethodSpecifications.call(void 0, _chunkXAOCS6ZDjs.EXCLUDED_SNAP_PERMISSIONS, {
|
|
51
47
|
// Shared hooks.
|
|
52
48
|
...hooks,
|
|
53
|
-
// Encryption and decryption hooks.
|
|
54
|
-
// TODO: Swap these out for the real implementations.
|
|
55
|
-
encrypt: _chunkRD7GQCPLjs.encryptImplementation,
|
|
56
|
-
decrypt: _chunkRD7GQCPLjs.decryptImplementation,
|
|
57
49
|
// Snaps-specific hooks.
|
|
58
|
-
clearSnapState:
|
|
50
|
+
clearSnapState: _chunkSB5EPHE3js.getClearSnapStateMethodImplementation.call(void 0, runSaga),
|
|
59
51
|
getLocale: _chunk265BMFM5js.getGetLocaleMethodImplementation.call(void 0, options),
|
|
60
|
-
getSnapState:
|
|
52
|
+
getSnapState: _chunkSB5EPHE3js.getGetSnapStateMethodImplementation.call(void 0, runSaga),
|
|
61
53
|
getUnlockPromise: asyncResolve(true),
|
|
62
54
|
// TODO: Allow the user to specify the result of this function.
|
|
63
55
|
isOnPhishingList: resolve(false),
|
|
@@ -65,7 +57,7 @@ function getPermissionSpecifications({
|
|
|
65
57
|
showDialog: _chunkRAMAN5RMjs.getShowDialogImplementation.call(void 0, runSaga),
|
|
66
58
|
showInAppNotification: _chunkGMTKFAWOjs.getShowInAppNotificationImplementation.call(void 0, runSaga),
|
|
67
59
|
showNativeNotification: _chunkGMTKFAWOjs.getShowNativeNotificationImplementation.call(void 0, runSaga),
|
|
68
|
-
updateSnapState:
|
|
60
|
+
updateSnapState: _chunkSB5EPHE3js.getUpdateSnapStateMethodImplementation.call(void 0, runSaga),
|
|
69
61
|
createInterface: _chunkMJHR5RTYjs.getCreateInterfaceImplementation.call(void 0, controllerMessenger),
|
|
70
62
|
getInterface: _chunkMJHR5RTYjs.getGetInterfaceImplementation.call(void 0, controllerMessenger)
|
|
71
63
|
})
|
|
@@ -94,4 +86,4 @@ async function getEndowments(permissionController, snapId) {
|
|
|
94
86
|
|
|
95
87
|
|
|
96
88
|
exports.resolve = resolve; exports.asyncResolve = asyncResolve; exports.getPermissionSpecifications = getPermissionSpecifications; exports.getEndowments = getEndowments;
|
|
97
|
-
//# sourceMappingURL=chunk-
|
|
89
|
+
//# sourceMappingURL=chunk-ZWN4SO2V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/internals/simulation/methods/specifications.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,0BAA0B;AA2C5B,SAAS,QAAQ,QAAiB;AACvC,SAAO,MAAM;AACf;AASO,SAAS,aAAa,QAAkB;AAC7C,SAAO,YAAY;AACrB;AAaO,SAAS,4BAA4B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAuC;AACrC,SAAO;AAAA,IACL,GAAG,iCAAiC,wBAAwB;AAAA,IAC5D,GAAG,wCAAwC,2BAA2B;AAAA;AAAA,MAEpE,GAAG;AAAA;AAAA,MAGH,gBAAgB,sCAAsC,OAAO;AAAA,MAC7D,WAAW,iCAAiC,OAAO;AAAA,MACnD,cAAc,oCAAoC,OAAO;AAAA,MACzD,kBAAkB,aAAa,IAAI;AAAA;AAAA,MAGnC,kBAAkB,QAAQ,KAAK;AAAA,MAE/B,yBAAyB,aAAa;AAAA,MACtC,YAAY,4BAA4B,OAAO;AAAA,MAC/C,uBAAuB,uCAAuC,OAAO;AAAA,MACrE,wBAAwB,wCAAwC,OAAO;AAAA,MACvE,iBAAiB,uCAAuC,OAAO;AAAA,MAC/D,iBAAiB,iCAAiC,mBAAmB;AAAA,MACrE,cAAc,8BAA8B,mBAAmB;AAAA,IACjE,CAAC;AAAA,EACH;AACF;AASA,eAAsB,cACpB,sBACA,QACA;AACA,QAAM,gBAAgB,MAAM,OAAO,KAAK,2BAA2B,EAAE,OAEnE,OAAO,SAAS,mBAAmB;AACnC,UAAM,cAAc,MAAM;AAC1B,QAAI,qBAAqB,cAAc,QAAQ,cAAc,GAAG;AAC9D,YAAM,aAAa,MAAM,qBAAqB;AAAA,QAC5C;AAAA,QACA;AAAA,MACF;AAEA,UAAI,YAAY;AACd,eAAO,YAAY,OAAO,UAAsB;AAAA,MAClD;AAAA,IACF;AAEA,WAAO;AAAA,EACT,GAAG,QAAQ,QAAQ,CAAC,CAAC,CAAC;AAEtB,SAAO,CAAC,GAAG,oBAAI,IAAI,CAAC,GAAG,oBAAoB,GAAG,aAAa,CAAC,CAAC;AAC/D","sourcesContent":["import type { GenericPermissionController } from '@metamask/permission-controller';\nimport {\n endowmentPermissionBuilders,\n buildSnapEndowmentSpecifications,\n buildSnapRestrictedMethodSpecifications,\n} from '@metamask/snaps-rpc-methods';\nimport type { SnapId } from '@metamask/snaps-sdk';\nimport { DEFAULT_ENDOWMENTS } from '@metamask/snaps-utils';\n\nimport type { RootControllerMessenger } from '../controllers';\nimport type { SimulationOptions } from '../options';\nimport type { RunSagaFunction } from '../store';\nimport {\n EXCLUDED_SNAP_ENDOWMENTS,\n EXCLUDED_SNAP_PERMISSIONS,\n} from './constants';\nimport {\n getGetLocaleMethodImplementation,\n getClearSnapStateMethodImplementation,\n getGetSnapStateMethodImplementation,\n getUpdateSnapStateMethodImplementation,\n getShowDialogImplementation,\n getShowInAppNotificationImplementation,\n getShowNativeNotificationImplementation,\n getCreateInterfaceImplementation,\n getGetInterfaceImplementation,\n} from './hooks';\n\nexport type PermissionSpecificationsHooks = {\n /**\n * A hook that returns the user's secret recovery phrase.\n *\n * @returns The user's secret recovery phrase.\n */\n getMnemonic: () => Promise<Uint8Array>;\n};\n\nexport type GetPermissionSpecificationsOptions = {\n controllerMessenger: RootControllerMessenger;\n hooks: PermissionSpecificationsHooks;\n runSaga: RunSagaFunction;\n options: SimulationOptions;\n};\n\n/**\n * Get a function which resolves with the specified result.\n *\n * @param result - The result to return.\n * @returns The function implementation.\n */\nexport function resolve(result: unknown) {\n return () => result;\n}\n\n/**\n * Get a function which resolves with the specified result.\n *\n * @param result - The result to return. If not specified, the function will\n * resolve with `undefined`.\n * @returns The function implementation.\n */\nexport function asyncResolve(result?: unknown) {\n return async () => result;\n}\n\n/**\n * Get the permission specifications for the Snap.\n *\n * @param options - The options.\n * @param options.controllerMessenger - The controller messenger.\n * @param options.hooks - The hooks.\n * @param options.runSaga - The function to run a saga outside the usual Redux\n * flow.\n * @param options.options - The simulation options.\n * @returns The permission specifications for the Snap.\n */\nexport function getPermissionSpecifications({\n controllerMessenger,\n hooks,\n runSaga,\n options,\n}: GetPermissionSpecificationsOptions) {\n return {\n ...buildSnapEndowmentSpecifications(EXCLUDED_SNAP_ENDOWMENTS),\n ...buildSnapRestrictedMethodSpecifications(EXCLUDED_SNAP_PERMISSIONS, {\n // Shared hooks.\n ...hooks,\n\n // Snaps-specific hooks.\n clearSnapState: getClearSnapStateMethodImplementation(runSaga),\n getLocale: getGetLocaleMethodImplementation(options),\n getSnapState: getGetSnapStateMethodImplementation(runSaga),\n getUnlockPromise: asyncResolve(true),\n\n // TODO: Allow the user to specify the result of this function.\n isOnPhishingList: resolve(false),\n\n maybeUpdatePhishingList: asyncResolve(),\n showDialog: getShowDialogImplementation(runSaga),\n showInAppNotification: getShowInAppNotificationImplementation(runSaga),\n showNativeNotification: getShowNativeNotificationImplementation(runSaga),\n updateSnapState: getUpdateSnapStateMethodImplementation(runSaga),\n createInterface: getCreateInterfaceImplementation(controllerMessenger),\n getInterface: getGetInterfaceImplementation(controllerMessenger),\n }),\n };\n}\n\n/**\n * Get the endowments for the Snap.\n *\n * @param permissionController - The permission controller.\n * @param snapId - The ID of the Snap.\n * @returns The endowments for the Snap.\n */\nexport async function getEndowments(\n permissionController: GenericPermissionController,\n snapId: SnapId,\n) {\n const allEndowments = await Object.keys(endowmentPermissionBuilders).reduce<\n Promise<string[]>\n >(async (promise, permissionName) => {\n const accumulator = await promise;\n if (permissionController.hasPermission(snapId, permissionName)) {\n const endowments = await permissionController.getEndowments(\n snapId,\n permissionName,\n );\n\n if (endowments) {\n return accumulator.concat(endowments as string[]);\n }\n }\n\n return accumulator;\n }, Promise.resolve([]));\n\n return [...new Set([...DEFAULT_ENDOWMENTS, ...allEndowments])];\n}\n"]}
|
package/dist/environment.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunk2JAGD4N6js = require('./chunk-2JAGD4N6.js');
|
|
5
5
|
require('./chunk-T2PHS5FY.js');
|
|
6
6
|
require('./chunk-HROOL3VI.js');
|
|
7
|
-
require('./chunk-
|
|
7
|
+
require('./chunk-2JTGBHPR.js');
|
|
8
|
+
require('./chunk-6POKT4OO.js');
|
|
8
9
|
require('./chunk-GECE47HW.js');
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
10
|
+
require('./chunk-Y4DKEF7Y.js');
|
|
11
|
+
require('./chunk-MCYTJUDG.js');
|
|
11
12
|
require('./chunk-ZTX624YO.js');
|
|
12
13
|
require('./chunk-XWGECIXI.js');
|
|
13
14
|
require('./chunk-WHGYMK5B.js');
|
|
@@ -15,33 +16,31 @@ require('./chunk-Y3JC4WGW.js');
|
|
|
15
16
|
require('./chunk-WDYPMEZB.js');
|
|
16
17
|
require('./chunk-3FNLFVV2.js');
|
|
17
18
|
require('./chunk-EMTW3H54.js');
|
|
19
|
+
require('./chunk-TVD4SWH7.js');
|
|
18
20
|
require('./chunk-VXPCUDBI.js');
|
|
19
21
|
require('./chunk-N6MAO223.js');
|
|
20
22
|
require('./chunk-TZB4LBT7.js');
|
|
21
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-IDGD7TZ7.js');
|
|
22
24
|
require('./chunk-XKJHFUHE.js');
|
|
23
|
-
require('./chunk-
|
|
25
|
+
require('./chunk-DTDYOBCI.js');
|
|
24
26
|
require('./chunk-DR6Y7IVX.js');
|
|
25
|
-
require('./chunk-
|
|
26
|
-
require('./chunk-
|
|
27
|
-
require('./chunk-RD7GQCPL.js');
|
|
27
|
+
require('./chunk-ZWN4SO2V.js');
|
|
28
|
+
require('./chunk-CKRORVDW.js');
|
|
28
29
|
require('./chunk-265BMFM5.js');
|
|
29
30
|
require('./chunk-MJHR5RTY.js');
|
|
30
31
|
require('./chunk-GMTKFAWO.js');
|
|
31
32
|
require('./chunk-RAMAN5RM.js');
|
|
32
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-SB5EPHE3.js');
|
|
33
34
|
require('./chunk-VHJZERIC.js');
|
|
34
|
-
require('./chunk-
|
|
35
|
+
require('./chunk-WMLSD6B5.js');
|
|
35
36
|
require('./chunk-PZDTZGSI.js');
|
|
36
37
|
require('./chunk-LACTK6EO.js');
|
|
37
38
|
require('./chunk-2YE2P5BZ.js');
|
|
38
39
|
require('./chunk-LBC2OGSN.js');
|
|
39
40
|
require('./chunk-XAOCS6ZD.js');
|
|
40
|
-
require('./chunk-TVD4SWH7.js');
|
|
41
|
-
require('./chunk-2JTGBHPR.js');
|
|
42
41
|
require('./chunk-PHUTP7NB.js');
|
|
43
42
|
|
|
44
43
|
|
|
45
44
|
|
|
46
|
-
exports.SnapsEnvironment =
|
|
45
|
+
exports.SnapsEnvironment = _chunk2JAGD4N6js.SnapsEnvironment; exports.default = _chunk2JAGD4N6js.environment_default;
|
|
47
46
|
//# sourceMappingURL=environment.js.map
|
package/dist/environment.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SnapsEnvironment,
|
|
3
3
|
environment_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X5IPMTHO.mjs";
|
|
5
5
|
import "./chunk-B73P64TE.mjs";
|
|
6
6
|
import "./chunk-MF43OG3Z.mjs";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-XK5HPZZC.mjs";
|
|
8
|
+
import "./chunk-PVMIH6OB.mjs";
|
|
8
9
|
import "./chunk-5ZFHFICZ.mjs";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-I5P52IMF.mjs";
|
|
11
|
+
import "./chunk-VSUNWJMQ.mjs";
|
|
11
12
|
import "./chunk-ZG33OGC3.mjs";
|
|
12
13
|
import "./chunk-KNJNL723.mjs";
|
|
13
14
|
import "./chunk-6HHV6YFQ.mjs";
|
|
@@ -15,30 +16,28 @@ import "./chunk-Q2OQXAUM.mjs";
|
|
|
15
16
|
import "./chunk-VOYBI6T4.mjs";
|
|
16
17
|
import "./chunk-IXKO6X55.mjs";
|
|
17
18
|
import "./chunk-FP4H3ADT.mjs";
|
|
19
|
+
import "./chunk-TBDYQSRT.mjs";
|
|
18
20
|
import "./chunk-IH7UNS5A.mjs";
|
|
19
21
|
import "./chunk-SLU4FNKX.mjs";
|
|
20
22
|
import "./chunk-J4ZPUCLX.mjs";
|
|
21
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-YEVKBYKO.mjs";
|
|
22
24
|
import "./chunk-6KXCBUNZ.mjs";
|
|
23
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-LG3VKXGH.mjs";
|
|
24
26
|
import "./chunk-NTOY6Y4Q.mjs";
|
|
25
|
-
import "./chunk-
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-2X23DUDP.mjs";
|
|
27
|
+
import "./chunk-TAIJXTLU.mjs";
|
|
28
|
+
import "./chunk-UDOXICJK.mjs";
|
|
28
29
|
import "./chunk-KSIBNOB2.mjs";
|
|
29
30
|
import "./chunk-WH5C5WIZ.mjs";
|
|
30
31
|
import "./chunk-ALRZENWP.mjs";
|
|
31
32
|
import "./chunk-ORO3T6BU.mjs";
|
|
32
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-5U5WB3SM.mjs";
|
|
33
34
|
import "./chunk-RQKT6BQ2.mjs";
|
|
34
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-3M4GRUMH.mjs";
|
|
35
36
|
import "./chunk-74TIKA2T.mjs";
|
|
36
37
|
import "./chunk-H2464AXT.mjs";
|
|
37
38
|
import "./chunk-LB4R3BUA.mjs";
|
|
38
39
|
import "./chunk-MPZOXW6I.mjs";
|
|
39
40
|
import "./chunk-57SGDM5B.mjs";
|
|
40
|
-
import "./chunk-TBDYQSRT.mjs";
|
|
41
|
-
import "./chunk-XK5HPZZC.mjs";
|
|
42
41
|
import "./chunk-JMDSN227.mjs";
|
|
43
42
|
export {
|
|
44
43
|
SnapsEnvironment,
|
package/dist/global.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":""}
|
package/dist/global.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/helpers.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZ35PCKFDjs = require('./chunk-Z35PCKFD.js');
|
|
4
4
|
require('./chunk-HROOL3VI.js');
|
|
5
|
-
require('./chunk-
|
|
5
|
+
require('./chunk-2JTGBHPR.js');
|
|
6
|
+
require('./chunk-6POKT4OO.js');
|
|
6
7
|
require('./chunk-GECE47HW.js');
|
|
7
|
-
require('./chunk-
|
|
8
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-Y4DKEF7Y.js');
|
|
9
|
+
require('./chunk-MCYTJUDG.js');
|
|
9
10
|
require('./chunk-ZTX624YO.js');
|
|
10
11
|
require('./chunk-XWGECIXI.js');
|
|
11
12
|
require('./chunk-WHGYMK5B.js');
|
|
@@ -13,32 +14,30 @@ require('./chunk-Y3JC4WGW.js');
|
|
|
13
14
|
require('./chunk-WDYPMEZB.js');
|
|
14
15
|
require('./chunk-3FNLFVV2.js');
|
|
15
16
|
require('./chunk-EMTW3H54.js');
|
|
17
|
+
require('./chunk-TVD4SWH7.js');
|
|
16
18
|
require('./chunk-VXPCUDBI.js');
|
|
17
19
|
require('./chunk-N6MAO223.js');
|
|
18
20
|
require('./chunk-TZB4LBT7.js');
|
|
19
|
-
require('./chunk-
|
|
21
|
+
require('./chunk-IDGD7TZ7.js');
|
|
20
22
|
require('./chunk-XKJHFUHE.js');
|
|
21
|
-
require('./chunk-
|
|
23
|
+
require('./chunk-DTDYOBCI.js');
|
|
22
24
|
require('./chunk-DR6Y7IVX.js');
|
|
23
|
-
require('./chunk-
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-RD7GQCPL.js');
|
|
25
|
+
require('./chunk-ZWN4SO2V.js');
|
|
26
|
+
require('./chunk-CKRORVDW.js');
|
|
26
27
|
require('./chunk-265BMFM5.js');
|
|
27
28
|
require('./chunk-MJHR5RTY.js');
|
|
28
29
|
require('./chunk-GMTKFAWO.js');
|
|
29
30
|
require('./chunk-RAMAN5RM.js');
|
|
30
|
-
require('./chunk-
|
|
31
|
+
require('./chunk-SB5EPHE3.js');
|
|
31
32
|
require('./chunk-VHJZERIC.js');
|
|
32
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-WMLSD6B5.js');
|
|
33
34
|
require('./chunk-PZDTZGSI.js');
|
|
34
35
|
require('./chunk-LACTK6EO.js');
|
|
35
36
|
require('./chunk-2YE2P5BZ.js');
|
|
36
37
|
require('./chunk-LBC2OGSN.js');
|
|
37
38
|
require('./chunk-XAOCS6ZD.js');
|
|
38
|
-
require('./chunk-TVD4SWH7.js');
|
|
39
|
-
require('./chunk-2JTGBHPR.js');
|
|
40
39
|
require('./chunk-PHUTP7NB.js');
|
|
41
40
|
|
|
42
41
|
|
|
43
|
-
exports.installSnap =
|
|
42
|
+
exports.installSnap = _chunkZ35PCKFDjs.installSnap;
|
|
44
43
|
//# sourceMappingURL=helpers.js.map
|
package/dist/helpers.mjs
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
installSnap
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EDEJD326.mjs";
|
|
4
4
|
import "./chunk-MF43OG3Z.mjs";
|
|
5
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-XK5HPZZC.mjs";
|
|
6
|
+
import "./chunk-PVMIH6OB.mjs";
|
|
6
7
|
import "./chunk-5ZFHFICZ.mjs";
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-I5P52IMF.mjs";
|
|
9
|
+
import "./chunk-VSUNWJMQ.mjs";
|
|
9
10
|
import "./chunk-ZG33OGC3.mjs";
|
|
10
11
|
import "./chunk-KNJNL723.mjs";
|
|
11
12
|
import "./chunk-6HHV6YFQ.mjs";
|
|
@@ -13,30 +14,28 @@ import "./chunk-Q2OQXAUM.mjs";
|
|
|
13
14
|
import "./chunk-VOYBI6T4.mjs";
|
|
14
15
|
import "./chunk-IXKO6X55.mjs";
|
|
15
16
|
import "./chunk-FP4H3ADT.mjs";
|
|
17
|
+
import "./chunk-TBDYQSRT.mjs";
|
|
16
18
|
import "./chunk-IH7UNS5A.mjs";
|
|
17
19
|
import "./chunk-SLU4FNKX.mjs";
|
|
18
20
|
import "./chunk-J4ZPUCLX.mjs";
|
|
19
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-YEVKBYKO.mjs";
|
|
20
22
|
import "./chunk-6KXCBUNZ.mjs";
|
|
21
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-LG3VKXGH.mjs";
|
|
22
24
|
import "./chunk-NTOY6Y4Q.mjs";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
25
|
-
import "./chunk-2X23DUDP.mjs";
|
|
25
|
+
import "./chunk-TAIJXTLU.mjs";
|
|
26
|
+
import "./chunk-UDOXICJK.mjs";
|
|
26
27
|
import "./chunk-KSIBNOB2.mjs";
|
|
27
28
|
import "./chunk-WH5C5WIZ.mjs";
|
|
28
29
|
import "./chunk-ALRZENWP.mjs";
|
|
29
30
|
import "./chunk-ORO3T6BU.mjs";
|
|
30
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-5U5WB3SM.mjs";
|
|
31
32
|
import "./chunk-RQKT6BQ2.mjs";
|
|
32
|
-
import "./chunk-
|
|
33
|
+
import "./chunk-3M4GRUMH.mjs";
|
|
33
34
|
import "./chunk-74TIKA2T.mjs";
|
|
34
35
|
import "./chunk-H2464AXT.mjs";
|
|
35
36
|
import "./chunk-LB4R3BUA.mjs";
|
|
36
37
|
import "./chunk-MPZOXW6I.mjs";
|
|
37
38
|
import "./chunk-57SGDM5B.mjs";
|
|
38
|
-
import "./chunk-TBDYQSRT.mjs";
|
|
39
|
-
import "./chunk-XK5HPZZC.mjs";
|
|
40
39
|
import "./chunk-JMDSN227.mjs";
|
|
41
40
|
export {
|
|
42
41
|
installSnap
|
package/dist/index.js
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunk2JAGD4N6js = require('./chunk-2JAGD4N6.js');
|
|
4
|
+
require('./chunk-S2HLITUN.js');
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
var
|
|
7
|
+
var _chunkZ35PCKFDjs = require('./chunk-Z35PCKFD.js');
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
var _chunkT2PHS5FYjs = require('./chunk-T2PHS5FY.js');
|
|
10
11
|
require('./chunk-HROOL3VI.js');
|
|
11
|
-
require('./chunk-
|
|
12
|
+
require('./chunk-2JTGBHPR.js');
|
|
13
|
+
require('./chunk-6POKT4OO.js');
|
|
12
14
|
require('./chunk-GECE47HW.js');
|
|
13
|
-
require('./chunk-
|
|
14
|
-
require('./chunk-
|
|
15
|
+
require('./chunk-Y4DKEF7Y.js');
|
|
16
|
+
require('./chunk-MCYTJUDG.js');
|
|
15
17
|
require('./chunk-ZTX624YO.js');
|
|
16
18
|
require('./chunk-XWGECIXI.js');
|
|
17
19
|
require('./chunk-WHGYMK5B.js');
|
|
@@ -19,36 +21,34 @@ require('./chunk-Y3JC4WGW.js');
|
|
|
19
21
|
require('./chunk-WDYPMEZB.js');
|
|
20
22
|
require('./chunk-3FNLFVV2.js');
|
|
21
23
|
require('./chunk-EMTW3H54.js');
|
|
24
|
+
require('./chunk-TVD4SWH7.js');
|
|
22
25
|
require('./chunk-VXPCUDBI.js');
|
|
23
26
|
require('./chunk-N6MAO223.js');
|
|
24
27
|
require('./chunk-TZB4LBT7.js');
|
|
25
|
-
require('./chunk-
|
|
28
|
+
require('./chunk-IDGD7TZ7.js');
|
|
26
29
|
require('./chunk-XKJHFUHE.js');
|
|
27
|
-
require('./chunk-
|
|
30
|
+
require('./chunk-DTDYOBCI.js');
|
|
28
31
|
require('./chunk-DR6Y7IVX.js');
|
|
29
|
-
require('./chunk-
|
|
30
|
-
require('./chunk-
|
|
31
|
-
require('./chunk-RD7GQCPL.js');
|
|
32
|
+
require('./chunk-ZWN4SO2V.js');
|
|
33
|
+
require('./chunk-CKRORVDW.js');
|
|
32
34
|
require('./chunk-265BMFM5.js');
|
|
33
35
|
require('./chunk-MJHR5RTY.js');
|
|
34
36
|
require('./chunk-GMTKFAWO.js');
|
|
35
37
|
require('./chunk-RAMAN5RM.js');
|
|
36
|
-
require('./chunk-
|
|
38
|
+
require('./chunk-SB5EPHE3.js');
|
|
37
39
|
require('./chunk-VHJZERIC.js');
|
|
38
|
-
require('./chunk-
|
|
40
|
+
require('./chunk-WMLSD6B5.js');
|
|
39
41
|
require('./chunk-PZDTZGSI.js');
|
|
40
42
|
require('./chunk-LACTK6EO.js');
|
|
41
43
|
require('./chunk-2YE2P5BZ.js');
|
|
42
44
|
require('./chunk-LBC2OGSN.js');
|
|
43
45
|
require('./chunk-XAOCS6ZD.js');
|
|
44
|
-
require('./chunk-TVD4SWH7.js');
|
|
45
|
-
require('./chunk-55J6XMHW.js');
|
|
46
|
-
require('./chunk-2JTGBHPR.js');
|
|
47
46
|
require('./chunk-PHUTP7NB.js');
|
|
47
|
+
require('./chunk-55J6XMHW.js');
|
|
48
48
|
|
|
49
49
|
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
exports.TestEnvironment =
|
|
53
|
+
exports.TestEnvironment = _chunk2JAGD4N6js.environment_default; exports.default = _chunk2JAGD4N6js.environment_default; exports.getOptions = _chunkT2PHS5FYjs.getOptions; exports.installSnap = _chunkZ35PCKFDjs.installSnap;
|
|
54
54
|
//# sourceMappingURL=index.js.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
environment_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-X5IPMTHO.mjs";
|
|
4
|
+
import "./chunk-TGZ7WOTJ.mjs";
|
|
4
5
|
import {
|
|
5
6
|
installSnap
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EDEJD326.mjs";
|
|
7
8
|
import {
|
|
8
9
|
getOptions
|
|
9
10
|
} from "./chunk-B73P64TE.mjs";
|
|
10
11
|
import "./chunk-MF43OG3Z.mjs";
|
|
11
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-XK5HPZZC.mjs";
|
|
13
|
+
import "./chunk-PVMIH6OB.mjs";
|
|
12
14
|
import "./chunk-5ZFHFICZ.mjs";
|
|
13
|
-
import "./chunk-
|
|
14
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-I5P52IMF.mjs";
|
|
16
|
+
import "./chunk-VSUNWJMQ.mjs";
|
|
15
17
|
import "./chunk-ZG33OGC3.mjs";
|
|
16
18
|
import "./chunk-KNJNL723.mjs";
|
|
17
19
|
import "./chunk-6HHV6YFQ.mjs";
|
|
@@ -19,32 +21,30 @@ import "./chunk-Q2OQXAUM.mjs";
|
|
|
19
21
|
import "./chunk-VOYBI6T4.mjs";
|
|
20
22
|
import "./chunk-IXKO6X55.mjs";
|
|
21
23
|
import "./chunk-FP4H3ADT.mjs";
|
|
24
|
+
import "./chunk-TBDYQSRT.mjs";
|
|
22
25
|
import "./chunk-IH7UNS5A.mjs";
|
|
23
26
|
import "./chunk-SLU4FNKX.mjs";
|
|
24
27
|
import "./chunk-J4ZPUCLX.mjs";
|
|
25
|
-
import "./chunk-
|
|
28
|
+
import "./chunk-YEVKBYKO.mjs";
|
|
26
29
|
import "./chunk-6KXCBUNZ.mjs";
|
|
27
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-LG3VKXGH.mjs";
|
|
28
31
|
import "./chunk-NTOY6Y4Q.mjs";
|
|
29
|
-
import "./chunk-
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-2X23DUDP.mjs";
|
|
32
|
+
import "./chunk-TAIJXTLU.mjs";
|
|
33
|
+
import "./chunk-UDOXICJK.mjs";
|
|
32
34
|
import "./chunk-KSIBNOB2.mjs";
|
|
33
35
|
import "./chunk-WH5C5WIZ.mjs";
|
|
34
36
|
import "./chunk-ALRZENWP.mjs";
|
|
35
37
|
import "./chunk-ORO3T6BU.mjs";
|
|
36
|
-
import "./chunk-
|
|
38
|
+
import "./chunk-5U5WB3SM.mjs";
|
|
37
39
|
import "./chunk-RQKT6BQ2.mjs";
|
|
38
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-3M4GRUMH.mjs";
|
|
39
41
|
import "./chunk-74TIKA2T.mjs";
|
|
40
42
|
import "./chunk-H2464AXT.mjs";
|
|
41
43
|
import "./chunk-LB4R3BUA.mjs";
|
|
42
44
|
import "./chunk-MPZOXW6I.mjs";
|
|
43
45
|
import "./chunk-57SGDM5B.mjs";
|
|
44
|
-
import "./chunk-TBDYQSRT.mjs";
|
|
45
|
-
import "./chunk-KIQOUUEZ.mjs";
|
|
46
|
-
import "./chunk-XK5HPZZC.mjs";
|
|
47
46
|
import "./chunk-JMDSN227.mjs";
|
|
47
|
+
import "./chunk-KIQOUUEZ.mjs";
|
|
48
48
|
export {
|
|
49
49
|
environment_default as TestEnvironment,
|
|
50
50
|
environment_default as default,
|