@fairfox/polly 0.88.0 → 0.89.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/dist/cli/polly.js +4 -4
- package/dist/cli/polly.js.map +2 -2
- package/dist/gallery/gallery.css +51 -59
- package/dist/gallery/gallery.js +1155 -1047
- package/dist/src/actions/index.js +5 -78
- package/dist/src/actions/index.js.map +2 -2
- package/dist/src/background/index.js +126 -152
- package/dist/src/background/index.js.map +4 -4
- package/dist/src/background/message-router.js +126 -152
- package/dist/src/background/message-router.js.map +4 -4
- package/dist/src/client/index.js +186 -259
- package/dist/src/client/index.js.map +5 -5
- package/dist/src/elysia/index.js +21 -35
- package/dist/src/elysia/index.js.map +2 -2
- package/dist/src/index.js +218 -246
- package/dist/src/index.js.map +10 -10
- package/dist/src/mesh.js +49 -61
- package/dist/src/mesh.js.map +4 -4
- package/dist/src/peer.js +23 -52
- package/dist/src/peer.js.map +2 -2
- package/dist/src/polly-ui/Button.d.ts +7 -0
- package/dist/src/polly-ui/Collapsible.d.ts +3 -1
- package/dist/src/polly-ui/Layout.d.ts +16 -1
- package/dist/src/polly-ui/index.css +47 -59
- package/dist/src/polly-ui/index.js +112 -124
- package/dist/src/polly-ui/index.js.map +13 -13
- package/dist/src/polly-ui/markdown.js +72 -145
- package/dist/src/polly-ui/markdown.js.map +2 -2
- package/dist/src/polly-ui/styles.css +47 -59
- package/dist/src/polly-ui/theme.css +10 -0
- package/dist/src/shared/adapters/index.js +31 -44
- package/dist/src/shared/adapters/index.js.map +2 -2
- package/dist/src/shared/lib/context-helpers.js +126 -152
- package/dist/src/shared/lib/context-helpers.js.map +4 -4
- package/dist/src/shared/lib/errors.js +1 -74
- package/dist/src/shared/lib/errors.js.map +2 -2
- package/dist/src/shared/lib/guards.js +1 -74
- package/dist/src/shared/lib/guards.js.map +2 -2
- package/dist/src/shared/lib/message-bus.js +126 -152
- package/dist/src/shared/lib/message-bus.js.map +4 -4
- package/dist/src/shared/lib/resource.js +16 -27
- package/dist/src/shared/lib/resource.js.map +5 -5
- package/dist/src/shared/lib/state.js +13 -26
- package/dist/src/shared/lib/state.js.map +2 -2
- package/dist/src/shared/lib/test-helpers.js +1 -74
- package/dist/src/shared/lib/test-helpers.js.map +2 -2
- package/dist/src/shared/state/app-state.js +35 -46
- package/dist/src/shared/state/app-state.js.map +5 -5
- package/dist/src/shared/types/messages.js +1 -74
- package/dist/src/shared/types/messages.js.map +2 -2
- package/dist/tools/bdd/src/cli.js +11 -15
- package/dist/tools/bdd/src/cli.js.map +2 -2
- package/dist/tools/bdd/src/index.js +11 -19
- package/dist/tools/bdd/src/index.js.map +2 -2
- package/dist/tools/gallery/src/cli.js +1 -18
- package/dist/tools/gallery/src/cli.js.map +2 -2
- package/dist/tools/init/src/cli.js +1 -18
- package/dist/tools/init/src/cli.js.map +2 -2
- package/dist/tools/mutate/src/cli.js +8 -25
- package/dist/tools/mutate/src/cli.js.map +2 -2
- package/dist/tools/mutate/src/index.js +8 -26
- package/dist/tools/mutate/src/index.js.map +2 -2
- package/dist/tools/quality/src/cli.js +39 -46
- package/dist/tools/quality/src/cli.js.map +3 -3
- package/dist/tools/quality/src/css/check-layout.d.ts +5 -3
- package/dist/tools/quality/src/index.js +39 -47
- package/dist/tools/quality/src/index.js.map +3 -3
- package/dist/tools/test/src/adapters/index.js +4 -77
- package/dist/tools/test/src/adapters/index.js.map +2 -2
- package/dist/tools/test/src/browser/index.js +1 -74
- package/dist/tools/test/src/browser/index.js.map +2 -2
- package/dist/tools/test/src/browser/run.js +5 -22
- package/dist/tools/test/src/browser/run.js.map +2 -2
- package/dist/tools/test/src/contrast/index.js +1 -74
- package/dist/tools/test/src/contrast/index.js.map +2 -2
- package/dist/tools/test/src/coverage-policy/cli.js +13 -25
- package/dist/tools/test/src/coverage-policy/cli.js.map +2 -2
- package/dist/tools/test/src/coverage-policy/index.js +11 -23
- package/dist/tools/test/src/coverage-policy/index.js.map +2 -2
- package/dist/tools/test/src/e2e-mesh/index.js +18 -43
- package/dist/tools/test/src/e2e-mesh/index.js.map +2 -2
- package/dist/tools/test/src/e2e-relay/index.js +615 -623
- package/dist/tools/test/src/e2e-relay/index.js.map +2 -2
- package/dist/tools/test/src/index.js +30 -103
- package/dist/tools/test/src/index.js.map +5 -5
- package/dist/tools/test/src/test-utils.js +1 -74
- package/dist/tools/test/src/test-utils.js.map +2 -2
- package/dist/tools/test/src/tiers/cli.js +1 -18
- package/dist/tools/test/src/tiers/cli.js.map +2 -2
- package/dist/tools/test/src/tiers/worker.js +11 -15
- package/dist/tools/test/src/tiers/worker.js.map +2 -2
- package/dist/tools/test/src/visual/index.js +1112 -1134
- package/dist/tools/test/src/visual/index.js.map +3 -3
- package/dist/tools/verify/src/cli.js +103 -169
- package/dist/tools/verify/src/cli.js.map +2 -2
- package/dist/tools/verify/src/config.js +1 -74
- package/dist/tools/verify/src/config.js.map +2 -2
- package/dist/tools/verify/src/stryker/index.js +1 -19
- package/dist/tools/verify/src/stryker/index.js.map +2 -2
- package/dist/tools/visualize/src/cli.js +69 -85
- package/dist/tools/visualize/src/cli.js.map +2 -2
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
18
18
|
return cached;
|
|
19
19
|
}
|
|
20
20
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
21
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
21
|
+
const to = isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
22
22
|
if (mod && typeof mod === "object" || typeof mod === "function") {
|
|
23
23
|
for (let key of __getOwnPropNames(mod))
|
|
24
24
|
if (!__hasOwnProp.call(to, key))
|
|
@@ -62,14 +62,17 @@ var __export = (target, all) => {
|
|
|
62
62
|
set: __exportSetter.bind(all, name)
|
|
63
63
|
});
|
|
64
64
|
};
|
|
65
|
-
var __esm = (fn, res) => () =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
var __esm = (fn, res, err) => () => {
|
|
66
|
+
if (fn)
|
|
67
|
+
try {
|
|
68
|
+
res = fn(fn = 0);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
err = [e];
|
|
71
|
+
}
|
|
72
|
+
if (err)
|
|
73
|
+
throw err[0];
|
|
74
|
+
return res;
|
|
75
|
+
};
|
|
73
76
|
|
|
74
77
|
// src/shared/lib/idb-helpers.ts
|
|
75
78
|
function openIDB(options, openFn = defaultOpenFn) {
|
|
@@ -167,14 +170,6 @@ var init_idb_helpers = __esm(() => {
|
|
|
167
170
|
});
|
|
168
171
|
|
|
169
172
|
// src/shared/lib/storage-adapter.ts
|
|
170
|
-
var exports_storage_adapter = {};
|
|
171
|
-
__export(exports_storage_adapter, {
|
|
172
|
-
ChromeStorageAdapter: () => ChromeStorageAdapter2,
|
|
173
|
-
IndexedDBAdapter: () => IndexedDBAdapter,
|
|
174
|
-
MemoryStorageAdapter: () => MemoryStorageAdapter,
|
|
175
|
-
createStorageAdapter: () => createStorageAdapter
|
|
176
|
-
});
|
|
177
|
-
|
|
178
173
|
class IndexedDBAdapter {
|
|
179
174
|
dbName;
|
|
180
175
|
storeName = "state";
|
|
@@ -306,14 +301,6 @@ var init_storage_adapter = __esm(() => {
|
|
|
306
301
|
});
|
|
307
302
|
|
|
308
303
|
// src/shared/lib/sync-adapter.ts
|
|
309
|
-
var exports_sync_adapter = {};
|
|
310
|
-
__export(exports_sync_adapter, {
|
|
311
|
-
BroadcastChannelSyncAdapter: () => BroadcastChannelSyncAdapter,
|
|
312
|
-
ChromeRuntimeSyncAdapter: () => ChromeRuntimeSyncAdapter,
|
|
313
|
-
NoOpSyncAdapter: () => NoOpSyncAdapter,
|
|
314
|
-
createSyncAdapter: () => createSyncAdapter
|
|
315
|
-
});
|
|
316
|
-
|
|
317
304
|
class NoOpSyncAdapter {
|
|
318
305
|
broadcast(_message) {}
|
|
319
306
|
onMessage(_callback) {
|
|
@@ -442,16 +429,6 @@ function createSyncAdapter() {
|
|
|
442
429
|
}
|
|
443
430
|
|
|
444
431
|
// src/shared/lib/constraints.ts
|
|
445
|
-
var exports_constraints = {};
|
|
446
|
-
__export(exports_constraints, {
|
|
447
|
-
checkPostconditions: () => checkPostconditions,
|
|
448
|
-
checkPreconditions: () => checkPreconditions,
|
|
449
|
-
clearConstraints: () => clearConstraints,
|
|
450
|
-
getRegisteredConstraints: () => getRegisteredConstraints,
|
|
451
|
-
isRuntimeConstraintsEnabled: () => isRuntimeConstraintsEnabled,
|
|
452
|
-
registerConstraint: () => registerConstraint,
|
|
453
|
-
registerConstraints: () => registerConstraints
|
|
454
|
-
});
|
|
455
432
|
function registerConstraint(field, messageType, constraint) {
|
|
456
433
|
if (!registry.has(field)) {
|
|
457
434
|
registry.set(field, new Map);
|
|
@@ -508,9 +485,6 @@ function checkPostconditions(messageType, state) {
|
|
|
508
485
|
function clearConstraints() {
|
|
509
486
|
registry.clear();
|
|
510
487
|
}
|
|
511
|
-
function getRegisteredConstraints() {
|
|
512
|
-
return new Map(registry);
|
|
513
|
-
}
|
|
514
488
|
function isRuntimeConstraintsEnabled() {
|
|
515
489
|
if (typeof process !== "undefined" && process.env) {
|
|
516
490
|
return process.env["POLLY_RUNTIME_CONSTRAINTS"] === "true";
|
|
@@ -820,42 +794,42 @@ function createStateAdapters(options = {}) {
|
|
|
820
794
|
if (options.sync) {
|
|
821
795
|
sync = options.sync;
|
|
822
796
|
} else if (options.singleTab) {
|
|
823
|
-
|
|
824
|
-
sync = new
|
|
797
|
+
;
|
|
798
|
+
sync = new NoOpSyncAdapter;
|
|
825
799
|
} else {
|
|
826
800
|
sync = createSyncAdapter();
|
|
827
801
|
}
|
|
828
802
|
return { storage, sync };
|
|
829
803
|
}
|
|
830
804
|
function createChromeAdapters() {
|
|
831
|
-
|
|
832
|
-
|
|
805
|
+
init_storage_adapter();
|
|
806
|
+
;
|
|
833
807
|
return {
|
|
834
|
-
storage: new
|
|
835
|
-
sync: new
|
|
808
|
+
storage: new ChromeStorageAdapter2,
|
|
809
|
+
sync: new ChromeRuntimeSyncAdapter
|
|
836
810
|
};
|
|
837
811
|
}
|
|
838
812
|
function createWebAdapters(options = {}) {
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
const storage = new
|
|
842
|
-
const sync = options.singleTab ? new
|
|
813
|
+
init_storage_adapter();
|
|
814
|
+
;
|
|
815
|
+
const storage = new IndexedDBAdapter(options.dbName);
|
|
816
|
+
const sync = options.singleTab ? new NoOpSyncAdapter : new BroadcastChannelSyncAdapter(options.channelName);
|
|
843
817
|
return { storage, sync };
|
|
844
818
|
}
|
|
845
819
|
function createNodeAdapters() {
|
|
846
|
-
|
|
847
|
-
|
|
820
|
+
init_storage_adapter();
|
|
821
|
+
;
|
|
848
822
|
return {
|
|
849
|
-
storage: new
|
|
850
|
-
sync: new
|
|
823
|
+
storage: new MemoryStorageAdapter,
|
|
824
|
+
sync: new NoOpSyncAdapter
|
|
851
825
|
};
|
|
852
826
|
}
|
|
853
827
|
function createMockAdapters() {
|
|
854
|
-
|
|
855
|
-
|
|
828
|
+
init_storage_adapter();
|
|
829
|
+
;
|
|
856
830
|
return {
|
|
857
|
-
storage: new
|
|
858
|
-
sync: new
|
|
831
|
+
storage: new MemoryStorageAdapter,
|
|
832
|
+
sync: new NoOpSyncAdapter
|
|
859
833
|
};
|
|
860
834
|
}
|
|
861
835
|
|
|
@@ -898,89 +872,6 @@ var defaultSettings = {
|
|
|
898
872
|
refreshInterval: 60000
|
|
899
873
|
};
|
|
900
874
|
|
|
901
|
-
// src/shared/lib/errors.ts
|
|
902
|
-
class ExtensionError extends Error {
|
|
903
|
-
code;
|
|
904
|
-
context;
|
|
905
|
-
constructor(message, code, context) {
|
|
906
|
-
super(message);
|
|
907
|
-
this.code = code;
|
|
908
|
-
this.context = context;
|
|
909
|
-
this.name = this.constructor.name;
|
|
910
|
-
Error.captureStackTrace?.(this, this.constructor);
|
|
911
|
-
}
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
class TimeoutError extends ExtensionError {
|
|
915
|
-
timeoutMs;
|
|
916
|
-
constructor(message, timeoutMs, context) {
|
|
917
|
-
super(message, "TIMEOUT_ERROR", { ...context, timeoutMs });
|
|
918
|
-
this.timeoutMs = timeoutMs;
|
|
919
|
-
}
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
class ConnectionError extends ExtensionError {
|
|
923
|
-
constructor(message, context) {
|
|
924
|
-
super(message, "CONNECTION_ERROR", context);
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
class MessageRouterError extends ExtensionError {
|
|
929
|
-
constructor(message, context) {
|
|
930
|
-
super(message, "MESSAGE_ROUTER_ERROR", context);
|
|
931
|
-
}
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
class HandlerError extends ExtensionError {
|
|
935
|
-
messageType;
|
|
936
|
-
constructor(message, messageType, context) {
|
|
937
|
-
super(message, "HANDLER_ERROR", { ...context, messageType });
|
|
938
|
-
this.messageType = messageType;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
class APIError extends ExtensionError {
|
|
943
|
-
statusCode;
|
|
944
|
-
constructor(message, statusCode, context) {
|
|
945
|
-
super(message, "API_ERROR", { ...context, statusCode });
|
|
946
|
-
this.statusCode = statusCode;
|
|
947
|
-
}
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
class OffscreenError extends ExtensionError {
|
|
951
|
-
constructor(message, context) {
|
|
952
|
-
super(message, "OFFSCREEN_ERROR", context);
|
|
953
|
-
}
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
class ErrorHandler {
|
|
957
|
-
logger;
|
|
958
|
-
constructor(logger2) {
|
|
959
|
-
this.logger = logger2;
|
|
960
|
-
}
|
|
961
|
-
throw(error) {
|
|
962
|
-
this.logger.error(error.message, error, error.context);
|
|
963
|
-
throw error;
|
|
964
|
-
}
|
|
965
|
-
reject(error) {
|
|
966
|
-
this.logger.error(error.message, error, error.context);
|
|
967
|
-
return error;
|
|
968
|
-
}
|
|
969
|
-
wrap(error, message, code, context) {
|
|
970
|
-
const originalError = error instanceof Error ? error : new Error(String(error));
|
|
971
|
-
const wrappedError = new ExtensionError(`${message}: ${originalError.message}`, code, {
|
|
972
|
-
...context,
|
|
973
|
-
originalError: originalError.message,
|
|
974
|
-
originalStack: originalError.stack
|
|
975
|
-
});
|
|
976
|
-
if (originalError.stack) {
|
|
977
|
-
wrappedError.stack = originalError.stack;
|
|
978
|
-
}
|
|
979
|
-
this.logger.error(wrappedError.message, wrappedError, wrappedError.context);
|
|
980
|
-
return wrappedError;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
|
|
984
875
|
// src/shared/lib/context-specific-helpers.ts
|
|
985
876
|
function createContentScriptHelpers() {
|
|
986
877
|
return {
|
|
@@ -1083,8 +974,8 @@ function createDevToolsHelpers() {
|
|
|
1083
974
|
function createPopupHelpers(adapters) {
|
|
1084
975
|
return {
|
|
1085
976
|
async getCurrentTab() {
|
|
1086
|
-
const
|
|
1087
|
-
return
|
|
977
|
+
const tabs = await adapters.tabs.query({ active: true, currentWindow: true });
|
|
978
|
+
return tabs[0];
|
|
1088
979
|
},
|
|
1089
980
|
closePopup() {
|
|
1090
981
|
window.close();
|
|
@@ -1147,8 +1038,8 @@ function createOptionsHelpers(adapters) {
|
|
|
1147
1038
|
function createSidePanelHelpers(adapters) {
|
|
1148
1039
|
return {
|
|
1149
1040
|
async getCurrentTab() {
|
|
1150
|
-
const
|
|
1151
|
-
return
|
|
1041
|
+
const tabs = await adapters.tabs.query({ active: true, currentWindow: true });
|
|
1042
|
+
return tabs[0];
|
|
1152
1043
|
},
|
|
1153
1044
|
isVisible() {
|
|
1154
1045
|
return document.visibilityState === "visible";
|
|
@@ -1179,6 +1070,89 @@ function createBackgroundHelpers(adapters) {
|
|
|
1179
1070
|
};
|
|
1180
1071
|
}
|
|
1181
1072
|
|
|
1073
|
+
// src/shared/lib/errors.ts
|
|
1074
|
+
class ExtensionError extends Error {
|
|
1075
|
+
code;
|
|
1076
|
+
context;
|
|
1077
|
+
constructor(message, code, context) {
|
|
1078
|
+
super(message);
|
|
1079
|
+
this.code = code;
|
|
1080
|
+
this.context = context;
|
|
1081
|
+
this.name = this.constructor.name;
|
|
1082
|
+
Error.captureStackTrace?.(this, this.constructor);
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
class TimeoutError extends ExtensionError {
|
|
1087
|
+
timeoutMs;
|
|
1088
|
+
constructor(message, timeoutMs, context) {
|
|
1089
|
+
super(message, "TIMEOUT_ERROR", { ...context, timeoutMs });
|
|
1090
|
+
this.timeoutMs = timeoutMs;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
class ConnectionError extends ExtensionError {
|
|
1095
|
+
constructor(message, context) {
|
|
1096
|
+
super(message, "CONNECTION_ERROR", context);
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
class MessageRouterError extends ExtensionError {
|
|
1101
|
+
constructor(message, context) {
|
|
1102
|
+
super(message, "MESSAGE_ROUTER_ERROR", context);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
class HandlerError extends ExtensionError {
|
|
1107
|
+
messageType;
|
|
1108
|
+
constructor(message, messageType, context) {
|
|
1109
|
+
super(message, "HANDLER_ERROR", { ...context, messageType });
|
|
1110
|
+
this.messageType = messageType;
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
class APIError extends ExtensionError {
|
|
1115
|
+
statusCode;
|
|
1116
|
+
constructor(message, statusCode, context) {
|
|
1117
|
+
super(message, "API_ERROR", { ...context, statusCode });
|
|
1118
|
+
this.statusCode = statusCode;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1122
|
+
class OffscreenError extends ExtensionError {
|
|
1123
|
+
constructor(message, context) {
|
|
1124
|
+
super(message, "OFFSCREEN_ERROR", context);
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
class ErrorHandler {
|
|
1129
|
+
logger;
|
|
1130
|
+
constructor(logger) {
|
|
1131
|
+
this.logger = logger;
|
|
1132
|
+
}
|
|
1133
|
+
throw(error) {
|
|
1134
|
+
this.logger.error(error.message, error, error.context);
|
|
1135
|
+
throw error;
|
|
1136
|
+
}
|
|
1137
|
+
reject(error) {
|
|
1138
|
+
this.logger.error(error.message, error, error.context);
|
|
1139
|
+
return error;
|
|
1140
|
+
}
|
|
1141
|
+
wrap(error, message, code, context) {
|
|
1142
|
+
const originalError = error instanceof Error ? error : new Error(String(error));
|
|
1143
|
+
const wrappedError = new ExtensionError(`${message}: ${originalError.message}`, code, {
|
|
1144
|
+
...context,
|
|
1145
|
+
originalError: originalError.message,
|
|
1146
|
+
originalStack: originalError.stack
|
|
1147
|
+
});
|
|
1148
|
+
if (originalError.stack) {
|
|
1149
|
+
wrappedError.stack = originalError.stack;
|
|
1150
|
+
}
|
|
1151
|
+
this.logger.error(wrappedError.message, wrappedError, wrappedError.context);
|
|
1152
|
+
return wrappedError;
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1182
1156
|
// src/shared/lib/handler-execution-tracker.ts
|
|
1183
1157
|
class HandlerExecutionTracker {
|
|
1184
1158
|
executions = new Map;
|
|
@@ -1353,8 +1327,8 @@ class MessageBus {
|
|
|
1353
1327
|
return this.send(payload, { ...options, target: "content", tabId });
|
|
1354
1328
|
}
|
|
1355
1329
|
async sendToAllTabs(payload, options) {
|
|
1356
|
-
const
|
|
1357
|
-
return Promise.all(
|
|
1330
|
+
const tabs = await this.adapters.tabs.query({});
|
|
1331
|
+
return Promise.all(tabs.map((tab) => tab.id ? this.sendToContentScript(tab.id, payload, options) : Promise.resolve(undefined)));
|
|
1358
1332
|
}
|
|
1359
1333
|
async sendToPopup(payload, options) {
|
|
1360
1334
|
return this.send(payload, { ...options, target: "popup" });
|
|
@@ -1505,10 +1479,10 @@ class MessageBus {
|
|
|
1505
1479
|
globalExecutionTracker.track(message.id, message.payload.type);
|
|
1506
1480
|
if (this.stateAccessor) {
|
|
1507
1481
|
try {
|
|
1508
|
-
|
|
1509
|
-
if (
|
|
1482
|
+
await Promise.resolve().then(() => init_constraints());
|
|
1483
|
+
if (isRuntimeConstraintsEnabled()) {
|
|
1510
1484
|
const currentState = this.stateAccessor();
|
|
1511
|
-
|
|
1485
|
+
checkPreconditions(message.payload.type, currentState);
|
|
1512
1486
|
}
|
|
1513
1487
|
} catch (error) {
|
|
1514
1488
|
if (error instanceof Error) {
|
|
@@ -1526,10 +1500,10 @@ class MessageBus {
|
|
|
1526
1500
|
const data = await handler(message.payload, message);
|
|
1527
1501
|
if (this.stateAccessor) {
|
|
1528
1502
|
try {
|
|
1529
|
-
|
|
1530
|
-
if (
|
|
1503
|
+
await Promise.resolve().then(() => init_constraints());
|
|
1504
|
+
if (isRuntimeConstraintsEnabled()) {
|
|
1531
1505
|
const currentState = this.stateAccessor();
|
|
1532
|
-
|
|
1506
|
+
checkPostconditions(message.payload.type, currentState);
|
|
1533
1507
|
}
|
|
1534
1508
|
} catch (error) {
|
|
1535
1509
|
if (error instanceof Error && error.message.includes("Postcondition")) {
|
|
@@ -1650,4 +1624,4 @@ export {
|
|
|
1650
1624
|
isRoutedResponse
|
|
1651
1625
|
};
|
|
1652
1626
|
|
|
1653
|
-
//# debugId=
|
|
1627
|
+
//# debugId=74F15AFAAB5B5A2064756E2164756E21
|