@monolayer/sdk 1.3.0-canary.1 → 1.3.0-canary.3
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.
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
26
|
exports.dispatcherAdapterSymbol = void 0;
|
|
4
27
|
exports.dispatcher = dispatcher;
|
|
@@ -7,6 +30,15 @@ exports.dispatcherAdapterSymbol = Symbol.for("@monolayer/sdk-task-dispacher");
|
|
|
7
30
|
const TASK_DISPATCHER_SYMBOL = Symbol.for("@monolayer/sdk/task-dispatcher");
|
|
8
31
|
async function dispatcher() {
|
|
9
32
|
if (process.env.NODE_ENV === "production") {
|
|
33
|
+
try {
|
|
34
|
+
const adapter = "@monolayer/task-sqs-adapter";
|
|
35
|
+
const dispatcherModule = await Promise.resolve(`${adapter}`).then(s => __importStar(require(s)));
|
|
36
|
+
// @ts-expect-error defined at runtime
|
|
37
|
+
globalThis[TASK_DISPATCHER_SYMBOL] = dispatcherModule.dispatcher;
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Ignore if not present
|
|
41
|
+
}
|
|
10
42
|
// @ts-expect-error defined at runtime
|
|
11
43
|
const dispatcher = globalThis[TASK_DISPATCHER_SYMBOL];
|
|
12
44
|
if (dispatcher === undefined)
|
|
@@ -3,6 +3,15 @@ export const dispatcherAdapterSymbol = Symbol.for("@monolayer/sdk-task-dispacher
|
|
|
3
3
|
const TASK_DISPATCHER_SYMBOL = Symbol.for("@monolayer/sdk/task-dispatcher");
|
|
4
4
|
export async function dispatcher() {
|
|
5
5
|
if (process.env.NODE_ENV === "production") {
|
|
6
|
+
try {
|
|
7
|
+
const adapter = "@monolayer/task-sqs-adapter";
|
|
8
|
+
const dispatcherModule = await import(adapter);
|
|
9
|
+
// @ts-expect-error defined at runtime
|
|
10
|
+
globalThis[TASK_DISPATCHER_SYMBOL] = dispatcherModule.dispatcher;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// Ignore if not present
|
|
14
|
+
}
|
|
6
15
|
// @ts-expect-error defined at runtime
|
|
7
16
|
const dispatcher = globalThis[TASK_DISPATCHER_SYMBOL];
|
|
8
17
|
if (dispatcher === undefined)
|
package/package.json
CHANGED