@gorgo/medusa-integration 0.0.5 → 0.0.7
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/.medusa/server/src/admin/index.js +7 -16
- package/.medusa/server/src/admin/index.mjs +8 -17
- package/.medusa/server/src/index.d.ts +4 -0
- package/.medusa/server/src/index.js +10 -4
- package/.medusa/server/src/lib/__tests__/resolve-integration-options.unit.spec.d.ts +1 -0
- package/.medusa/server/src/lib/__tests__/resolve-integration-options.unit.spec.js +29 -0
- package/.medusa/server/src/lib/resolve-integration-options.d.ts +23 -0
- package/.medusa/server/src/lib/resolve-integration-options.js +23 -0
- package/.medusa/server/src/workflows/integration/steps/get-resolved-integration-options.d.ts +6 -0
- package/.medusa/server/src/workflows/integration/steps/get-resolved-integration-options.js +12 -0
- package/.medusa/server/src/workflows/integration/steps/index.d.ts +2 -0
- package/.medusa/server/src/workflows/integration/steps/index.js +5 -2
- package/.medusa/server/src/workflows/integration/workflows/get-resolved-integration-options.d.ts +6 -0
- package/.medusa/server/src/workflows/integration/workflows/get-resolved-integration-options.js +8 -0
- package/.medusa/server/src/workflows/integration/workflows/index.d.ts +2 -0
- package/.medusa/server/src/workflows/integration/workflows/index.js +4 -2
- package/README.md +0 -4
- package/README.ru.md +0 -4
- package/package.json +1 -2
- package/LICENSE +0 -21
|
@@ -39,24 +39,15 @@ const IntegrationIcon = ({
|
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
-
"
|
|
42
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: showImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
43
|
+
"img",
|
|
44
44
|
{
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
)
|
|
49
|
-
children: showImage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
50
|
-
"img",
|
|
51
|
-
{
|
|
52
|
-
src,
|
|
53
|
-
alt,
|
|
54
|
-
className: "h-full w-full object-cover",
|
|
55
|
-
onError: () => setErrored(true)
|
|
56
|
-
}
|
|
57
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(icons.PuzzleSolid, { className: "text-ui-fg-subtle" })
|
|
45
|
+
src,
|
|
46
|
+
alt,
|
|
47
|
+
className: "rounded-lg object-cover border shadow-xs w-12 h-12",
|
|
48
|
+
onError: () => setErrored(true)
|
|
58
49
|
}
|
|
59
|
-
);
|
|
50
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(icons.PuzzleSolid, { className: "text-ui-fg-subtle" }) });
|
|
60
51
|
};
|
|
61
52
|
const PAGE_SIZE = 20;
|
|
62
53
|
const DOCS_URL = "https://docs.gorgojs.com/ru/medusa-plugins/integration-module";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx,
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { defineRouteConfig } from "@medusajs/admin-sdk";
|
|
3
3
|
import { PuzzleSolid, CogSixTooth, Trash, Spinner, EllipsisHorizontal, PencilSquare, Plus } from "@medusajs/icons";
|
|
4
4
|
import { clx, createDataTableColumnHelper, usePrompt, toast, Text, Badge, useDataTable, Container, Heading, Button, DataTable, Tabs, StatusBadge, Label, Input, Select, Switch, Textarea, Drawer, DropdownMenu, IconButton, Copy } from "@medusajs/ui";
|
|
@@ -35,24 +35,15 @@ const IntegrationIcon = ({
|
|
|
35
35
|
}
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
|
-
return /* @__PURE__ */ jsx(
|
|
39
|
-
"
|
|
38
|
+
return /* @__PURE__ */ jsx(Fragment, { children: showImage ? /* @__PURE__ */ jsx(
|
|
39
|
+
"img",
|
|
40
40
|
{
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
children: showImage ? /* @__PURE__ */ jsx(
|
|
46
|
-
"img",
|
|
47
|
-
{
|
|
48
|
-
src,
|
|
49
|
-
alt,
|
|
50
|
-
className: "h-full w-full object-cover",
|
|
51
|
-
onError: () => setErrored(true)
|
|
52
|
-
}
|
|
53
|
-
) : /* @__PURE__ */ jsx(PuzzleSolid, { className: "text-ui-fg-subtle" })
|
|
41
|
+
src,
|
|
42
|
+
alt,
|
|
43
|
+
className: "rounded-lg object-cover border shadow-xs w-12 h-12",
|
|
44
|
+
onError: () => setErrored(true)
|
|
54
45
|
}
|
|
55
|
-
);
|
|
46
|
+
) : /* @__PURE__ */ jsx(PuzzleSolid, { className: "text-ui-fg-subtle" }) });
|
|
56
47
|
};
|
|
57
48
|
const PAGE_SIZE = 20;
|
|
58
49
|
const DOCS_URL = "https://docs.gorgojs.com/ru/medusa-plugins/integration-module";
|
|
@@ -4,6 +4,10 @@ export type { IntegrationDescriptor, IntegrationDescriptorInput, CategoryKind, O
|
|
|
4
4
|
export type { FieldControl, I18nKey } from "./modules/integration/descriptor/meta";
|
|
5
5
|
export { collectValidationIssues, isDescriptorComplete } from "./modules/integration/descriptor/validate";
|
|
6
6
|
export type { IntegrationSectionData } from "./types";
|
|
7
|
+
export { resolveIntegrationOptions } from "./lib/resolve-integration-options";
|
|
8
|
+
export type { ResolveIntegrationOptionsInput } from "./lib/resolve-integration-options";
|
|
9
|
+
export { getResolvedIntegrationOptionsWorkflow, getResolvedIntegrationOptionsStep, } from "./workflows/integration";
|
|
10
|
+
export type { GetResolvedIntegrationOptionsWorkflowInput, GetResolvedIntegrationOptionsStepInput, } from "./workflows/integration";
|
|
7
11
|
export { INTEGRATION_MODULE } from "./modules/integration";
|
|
8
12
|
export { default as IntegrationModuleService } from "./modules/integration/services/integration-module";
|
|
9
13
|
export type { ResolvedOptions } from "./modules/integration/services/integration-module";
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.IntegrationModuleService = exports.INTEGRATION_MODULE = exports.isDescriptorComplete = exports.collectValidationIssues = exports.AbstractIntegrationProvider = exports.z = exports.defineIntegration = void 0;
|
|
6
|
+
exports.IntegrationModuleService = exports.INTEGRATION_MODULE = exports.getResolvedIntegrationOptionsStep = exports.getResolvedIntegrationOptionsWorkflow = exports.resolveIntegrationOptions = exports.isDescriptorComplete = exports.collectValidationIssues = exports.AbstractIntegrationProvider = exports.z = exports.defineIntegration = void 0;
|
|
7
7
|
// ── For integration-provider authors ─────────────────────────────────────────
|
|
8
8
|
var define_1 = require("./modules/integration/descriptor/define");
|
|
9
9
|
Object.defineProperty(exports, "defineIntegration", { enumerable: true, get: function () { return define_1.defineIntegration; } });
|
|
@@ -14,9 +14,15 @@ Object.defineProperty(exports, "AbstractIntegrationProvider", { enumerable: true
|
|
|
14
14
|
var validate_1 = require("./modules/integration/descriptor/validate");
|
|
15
15
|
Object.defineProperty(exports, "collectValidationIssues", { enumerable: true, get: function () { return validate_1.collectValidationIssues; } });
|
|
16
16
|
Object.defineProperty(exports, "isDescriptorComplete", { enumerable: true, get: function () { return validate_1.isDescriptorComplete; } });
|
|
17
|
+
// Runtime options resolver — for providers reading their config from this module.
|
|
18
|
+
var resolve_integration_options_1 = require("./lib/resolve-integration-options");
|
|
19
|
+
Object.defineProperty(exports, "resolveIntegrationOptions", { enumerable: true, get: function () { return resolve_integration_options_1.resolveIntegrationOptions; } });
|
|
20
|
+
var integration_1 = require("./workflows/integration");
|
|
21
|
+
Object.defineProperty(exports, "getResolvedIntegrationOptionsWorkflow", { enumerable: true, get: function () { return integration_1.getResolvedIntegrationOptionsWorkflow; } });
|
|
22
|
+
Object.defineProperty(exports, "getResolvedIntegrationOptionsStep", { enumerable: true, get: function () { return integration_1.getResolvedIntegrationOptionsStep; } });
|
|
17
23
|
// ── For consumers of the integration module ──────────────────────────────────
|
|
18
|
-
var
|
|
19
|
-
Object.defineProperty(exports, "INTEGRATION_MODULE", { enumerable: true, get: function () { return
|
|
24
|
+
var integration_2 = require("./modules/integration");
|
|
25
|
+
Object.defineProperty(exports, "INTEGRATION_MODULE", { enumerable: true, get: function () { return integration_2.INTEGRATION_MODULE; } });
|
|
20
26
|
var integration_module_1 = require("./modules/integration/services/integration-module");
|
|
21
27
|
Object.defineProperty(exports, "IntegrationModuleService", { enumerable: true, get: function () { return __importDefault(integration_module_1).default; } });
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsZ0ZBQWdGO0FBQ2hGLGtFQUE4RTtBQUFyRSwyR0FBQSxpQkFBaUIsT0FBQTtBQUFFLDJGQUFBLENBQUMsT0FBQTtBQUM3QiwyR0FBdUc7QUFBOUYsNElBQUEsMkJBQTJCLE9BQUE7QUFZcEMsZ0ZBQWdGO0FBQ2hGLHNFQUF5RztBQUFoRyxtSEFBQSx1QkFBdUIsT0FBQTtBQUFFLGdIQUFBLG9CQUFvQixPQUFBO0FBSXRELGtGQUFrRjtBQUNsRixpRkFBNkU7QUFBcEUsd0lBQUEseUJBQXlCLE9BQUE7QUFFbEMsdURBR2dDO0FBRjlCLG9JQUFBLHFDQUFxQyxPQUFBO0FBQ3JDLGdJQUFBLGlDQUFpQyxPQUFBO0FBT25DLGdGQUFnRjtBQUNoRixxREFBMEQ7QUFBakQsaUhBQUEsa0JBQWtCLE9BQUE7QUFDM0Isd0ZBQXVHO0FBQTlGLCtJQUFBLE9BQU8sT0FBNEIifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
4
|
+
const resolve_integration_options_1 = require("../resolve-integration-options");
|
|
5
|
+
const resolved = {
|
|
6
|
+
options: { terminalKey: "tk", password: "pw" },
|
|
7
|
+
meta: { provider_id: "int_tkassa", category: "payment", is_enabled: true },
|
|
8
|
+
};
|
|
9
|
+
describe("unwrapResolvedOptions", () => {
|
|
10
|
+
it("returns the resolved options when present", () => {
|
|
11
|
+
const out = (0, resolve_integration_options_1.unwrapResolvedOptions)(resolved, "tkassa");
|
|
12
|
+
expect(out).toEqual({ terminalKey: "tk", password: "pw" });
|
|
13
|
+
});
|
|
14
|
+
it("throws a NOT_ALLOWED MedusaError naming the identifier when not configured", () => {
|
|
15
|
+
expect(() => (0, resolve_integration_options_1.unwrapResolvedOptions)(null, "tkassa")).toThrow(utils_1.MedusaError);
|
|
16
|
+
try {
|
|
17
|
+
(0, resolve_integration_options_1.unwrapResolvedOptions)(null, "tkassa");
|
|
18
|
+
throw new Error("expected to throw");
|
|
19
|
+
}
|
|
20
|
+
catch (e) {
|
|
21
|
+
expect(e.type).toBe(utils_1.MedusaError.Types.NOT_ALLOWED);
|
|
22
|
+
expect(e.message).toContain('"tkassa"');
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
it("returns null when not configured and optional is true", () => {
|
|
26
|
+
expect((0, resolve_integration_options_1.unwrapResolvedOptions)(null, "tkassa", true)).toBeNull();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZS1pbnRlZ3JhdGlvbi1vcHRpb25zLnVuaXQuc3BlYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvX190ZXN0c19fL3Jlc29sdmUtaW50ZWdyYXRpb24tb3B0aW9ucy51bml0LnNwZWMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxxREFBdUQ7QUFDdkQsZ0ZBQXNFO0FBR3RFLE1BQU0sUUFBUSxHQUFvQjtJQUNoQyxPQUFPLEVBQUUsRUFBRSxXQUFXLEVBQUUsSUFBSSxFQUFFLFFBQVEsRUFBRSxJQUFJLEVBQUU7SUFDOUMsSUFBSSxFQUFFLEVBQUUsV0FBVyxFQUFFLFlBQVksRUFBRSxRQUFRLEVBQUUsU0FBUyxFQUFFLFVBQVUsRUFBRSxJQUFJLEVBQUU7Q0FDM0UsQ0FBQTtBQUVELFFBQVEsQ0FBQyx1QkFBdUIsRUFBRSxHQUFHLEVBQUU7SUFDckMsRUFBRSxDQUFDLDJDQUEyQyxFQUFFLEdBQUcsRUFBRTtRQUNuRCxNQUFNLEdBQUcsR0FBRyxJQUFBLG1EQUFxQixFQUE0QyxRQUFRLEVBQUUsUUFBUSxDQUFDLENBQUE7UUFDaEcsTUFBTSxDQUFDLEdBQUcsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxFQUFFLFdBQVcsRUFBRSxJQUFJLEVBQUUsUUFBUSxFQUFFLElBQUksRUFBRSxDQUFDLENBQUE7SUFDNUQsQ0FBQyxDQUFDLENBQUE7SUFFRixFQUFFLENBQUMsNEVBQTRFLEVBQUUsR0FBRyxFQUFFO1FBQ3BGLE1BQU0sQ0FBQyxHQUFHLEVBQUUsQ0FBQyxJQUFBLG1EQUFxQixFQUFDLElBQUksRUFBRSxRQUFRLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FBQyxtQkFBVyxDQUFDLENBQUE7UUFDeEUsSUFBSSxDQUFDO1lBQ0gsSUFBQSxtREFBcUIsRUFBQyxJQUFJLEVBQUUsUUFBUSxDQUFDLENBQUE7WUFDckMsTUFBTSxJQUFJLEtBQUssQ0FBQyxtQkFBbUIsQ0FBQyxDQUFBO1FBQ3RDLENBQUM7UUFBQyxPQUFPLENBQU0sRUFBRSxDQUFDO1lBQ2hCLE1BQU0sQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsSUFBSSxDQUFDLG1CQUFXLENBQUMsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFBO1lBQ2xELE1BQU0sQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLENBQUMsU0FBUyxDQUFDLFVBQVUsQ0FBQyxDQUFBO1FBQ3pDLENBQUM7SUFDSCxDQUFDLENBQUMsQ0FBQTtJQUVGLEVBQUUsQ0FBQyx1REFBdUQsRUFBRSxHQUFHLEVBQUU7UUFDL0QsTUFBTSxDQUFDLElBQUEsbURBQXFCLEVBQUMsSUFBSSxFQUFFLFFBQVEsRUFBRSxJQUFJLENBQUMsQ0FBQyxDQUFDLFFBQVEsRUFBRSxDQUFBO0lBQ2hFLENBQUMsQ0FBQyxDQUFBO0FBQ0osQ0FBQyxDQUFDLENBQUEifQ==
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ResolvedOptions } from "../modules/integration/services/integration-module";
|
|
2
|
+
export type ResolveIntegrationOptionsInput = {
|
|
3
|
+
identifier: string;
|
|
4
|
+
instance_id?: string | null;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Apply the not-configured policy to a resolved-options result. Pure — the unit-tested core.
|
|
8
|
+
* `resolved === null` means the integration is not configured / disabled / incomplete.
|
|
9
|
+
*/
|
|
10
|
+
export declare function unwrapResolvedOptions<T = Record<string, unknown>>(resolved: ResolvedOptions | null, identifier: string, optional?: boolean): T | null;
|
|
11
|
+
/**
|
|
12
|
+
* Resolve an integration provider's decrypted options at runtime. Intended for payment/
|
|
13
|
+
* fulfillment/etc. providers that live in their own (isolated) module container and can't
|
|
14
|
+
* resolve the integration module directly — this runs the resolver workflow in the global
|
|
15
|
+
* app container. Throws MedusaError(NOT_ALLOWED) when not configured, unless `{ optional: true }`.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveIntegrationOptions<T = Record<string, unknown>>(input: ResolveIntegrationOptionsInput): Promise<T>;
|
|
18
|
+
export declare function resolveIntegrationOptions<T = Record<string, unknown>>(input: ResolveIntegrationOptionsInput, config: {
|
|
19
|
+
optional?: false;
|
|
20
|
+
}): Promise<T>;
|
|
21
|
+
export declare function resolveIntegrationOptions<T = Record<string, unknown>>(input: ResolveIntegrationOptionsInput, config: {
|
|
22
|
+
optional: true;
|
|
23
|
+
}): Promise<T | null>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.unwrapResolvedOptions = unwrapResolvedOptions;
|
|
4
|
+
exports.resolveIntegrationOptions = resolveIntegrationOptions;
|
|
5
|
+
const utils_1 = require("@medusajs/framework/utils");
|
|
6
|
+
const integration_1 = require("../workflows/integration");
|
|
7
|
+
/**
|
|
8
|
+
* Apply the not-configured policy to a resolved-options result. Pure — the unit-tested core.
|
|
9
|
+
* `resolved === null` means the integration is not configured / disabled / incomplete.
|
|
10
|
+
*/
|
|
11
|
+
function unwrapResolvedOptions(resolved, identifier, optional) {
|
|
12
|
+
if (!resolved) {
|
|
13
|
+
if (optional)
|
|
14
|
+
return null;
|
|
15
|
+
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_ALLOWED, `Integration provider "${identifier}" is not available: it is either not configured, disabled, or missing required options. Configure and enable it before use.`);
|
|
16
|
+
}
|
|
17
|
+
return resolved.options;
|
|
18
|
+
}
|
|
19
|
+
async function resolveIntegrationOptions(input, config) {
|
|
20
|
+
const { result } = await (0, integration_1.getResolvedIntegrationOptionsWorkflow)().run({ input });
|
|
21
|
+
return unwrapResolvedOptions(result, input.identifier, config?.optional);
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZS1pbnRlZ3JhdGlvbi1vcHRpb25zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9yZXNvbHZlLWludGVncmF0aW9uLW9wdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFhQSxzREFhQztBQW1CRCw4REFNQztBQW5ERCxxREFBdUQ7QUFDdkQsMERBQWdGO0FBUWhGOzs7R0FHRztBQUNILFNBQWdCLHFCQUFxQixDQUNuQyxRQUFnQyxFQUNoQyxVQUFrQixFQUNsQixRQUFrQjtJQUVsQixJQUFJLENBQUMsUUFBUSxFQUFFLENBQUM7UUFDZCxJQUFJLFFBQVE7WUFBRSxPQUFPLElBQUksQ0FBQTtRQUN6QixNQUFNLElBQUksbUJBQVcsQ0FDbkIsbUJBQVcsQ0FBQyxLQUFLLENBQUMsV0FBVyxFQUM3Qix5QkFBeUIsVUFBVSw2SEFBNkgsQ0FDakssQ0FBQTtJQUNILENBQUM7SUFDRCxPQUFPLFFBQVEsQ0FBQyxPQUFZLENBQUE7QUFDOUIsQ0FBQztBQW1CTSxLQUFLLFVBQVUseUJBQXlCLENBQzdDLEtBQXFDLEVBQ3JDLE1BQStCO0lBRS9CLE1BQU0sRUFBRSxNQUFNLEVBQUUsR0FBRyxNQUFNLElBQUEsbURBQXFDLEdBQUUsQ0FBQyxHQUFHLENBQUMsRUFBRSxLQUFLLEVBQUUsQ0FBQyxDQUFBO0lBQy9FLE9BQU8scUJBQXFCLENBQUksTUFBTSxFQUFFLEtBQUssQ0FBQyxVQUFVLEVBQUUsTUFBTSxFQUFFLFFBQVEsQ0FBQyxDQUFBO0FBQzdFLENBQUMifQ==
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type GetResolvedIntegrationOptionsStepInput = {
|
|
2
|
+
identifier: string;
|
|
3
|
+
instance_id?: string | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const getResolvedIntegrationOptionsStepId = "get-resolved-integration-options";
|
|
6
|
+
export declare const getResolvedIntegrationOptionsStep: import("@medusajs/framework/workflows-sdk").StepFunction<GetResolvedIntegrationOptionsStepInput, import("../../../modules/integration/services/integration-module").ResolvedOptions | null>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResolvedIntegrationOptionsStep = exports.getResolvedIntegrationOptionsStepId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const integration_1 = require("../../../modules/integration");
|
|
6
|
+
exports.getResolvedIntegrationOptionsStepId = "get-resolved-integration-options";
|
|
7
|
+
exports.getResolvedIntegrationOptionsStep = (0, workflows_sdk_1.createStep)(exports.getResolvedIntegrationOptionsStepId, async (input, { container }) => {
|
|
8
|
+
const service = container.resolve(integration_1.INTEGRATION_MODULE);
|
|
9
|
+
const resolved = await service.getResolvedOptions(input.identifier, input.instance_id);
|
|
10
|
+
return new workflows_sdk_1.StepResponse(resolved);
|
|
11
|
+
});
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXJlc29sdmVkLWludGVncmF0aW9uLW9wdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludGVncmF0aW9uL3N0ZXBzL2dldC1yZXNvbHZlZC1pbnRlZ3JhdGlvbi1vcHRpb25zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHFFQUE0RTtBQUM1RSw4REFBaUU7QUFRcEQsUUFBQSxtQ0FBbUMsR0FBRyxrQ0FBa0MsQ0FBQTtBQUV4RSxRQUFBLGlDQUFpQyxHQUFHLElBQUEsMEJBQVUsRUFDekQsMkNBQW1DLEVBQ25DLEtBQUssRUFBRSxLQUE2QyxFQUFFLEVBQUUsU0FBUyxFQUFFLEVBQUUsRUFBRTtJQUNyRSxNQUFNLE9BQU8sR0FBRyxTQUFTLENBQUMsT0FBTyxDQUFDLGdDQUFrQixDQUE2QixDQUFBO0lBQ2pGLE1BQU0sUUFBUSxHQUFHLE1BQU0sT0FBTyxDQUFDLGtCQUFrQixDQUFDLEtBQUssQ0FBQyxVQUFVLEVBQUUsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFBO0lBQ3RGLE9BQU8sSUFBSSw0QkFBWSxDQUFDLFFBQVEsQ0FBQyxDQUFBO0FBQ25DLENBQUMsQ0FDRixDQUFBIn0=
|
|
@@ -4,3 +4,5 @@ export { emitIntegrationEventStep } from "./emit-integration-event";
|
|
|
4
4
|
export { runTestConnectionStep } from "./run-test-connection";
|
|
5
5
|
export { setIntegrationEnabledStep } from "./set-integration-enabled";
|
|
6
6
|
export { upsertIntegrationRecordStep } from "./upsert-integration-record";
|
|
7
|
+
export { getResolvedIntegrationOptionsStep, getResolvedIntegrationOptionsStepId, } from "./get-resolved-integration-options";
|
|
8
|
+
export type { GetResolvedIntegrationOptionsStepInput } from "./get-resolved-integration-options";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upsertIntegrationRecordStep = exports.setIntegrationEnabledStep = exports.runTestConnectionStep = exports.emitIntegrationEventStep = exports.deleteIntegrationRecordStep = exports.applyIntegrationSectionStep = void 0;
|
|
3
|
+
exports.getResolvedIntegrationOptionsStepId = exports.getResolvedIntegrationOptionsStep = exports.upsertIntegrationRecordStep = exports.setIntegrationEnabledStep = exports.runTestConnectionStep = exports.emitIntegrationEventStep = exports.deleteIntegrationRecordStep = exports.applyIntegrationSectionStep = void 0;
|
|
4
4
|
var apply_integration_section_1 = require("./apply-integration-section");
|
|
5
5
|
Object.defineProperty(exports, "applyIntegrationSectionStep", { enumerable: true, get: function () { return apply_integration_section_1.applyIntegrationSectionStep; } });
|
|
6
6
|
var delete_integration_record_1 = require("./delete-integration-record");
|
|
@@ -13,4 +13,7 @@ var set_integration_enabled_1 = require("./set-integration-enabled");
|
|
|
13
13
|
Object.defineProperty(exports, "setIntegrationEnabledStep", { enumerable: true, get: function () { return set_integration_enabled_1.setIntegrationEnabledStep; } });
|
|
14
14
|
var upsert_integration_record_1 = require("./upsert-integration-record");
|
|
15
15
|
Object.defineProperty(exports, "upsertIntegrationRecordStep", { enumerable: true, get: function () { return upsert_integration_record_1.upsertIntegrationRecordStep; } });
|
|
16
|
-
|
|
16
|
+
var get_resolved_integration_options_1 = require("./get-resolved-integration-options");
|
|
17
|
+
Object.defineProperty(exports, "getResolvedIntegrationOptionsStep", { enumerable: true, get: function () { return get_resolved_integration_options_1.getResolvedIntegrationOptionsStep; } });
|
|
18
|
+
Object.defineProperty(exports, "getResolvedIntegrationOptionsStepId", { enumerable: true, get: function () { return get_resolved_integration_options_1.getResolvedIntegrationOptionsStepId; } });
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludGVncmF0aW9uL3N0ZXBzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLHlFQUF5RTtBQUFoRSx3SUFBQSwyQkFBMkIsT0FBQTtBQUNwQyx5RUFBeUU7QUFBaEUsd0lBQUEsMkJBQTJCLE9BQUE7QUFDcEMsbUVBQW1FO0FBQTFELGtJQUFBLHdCQUF3QixPQUFBO0FBQ2pDLDZEQUE2RDtBQUFwRCw0SEFBQSxxQkFBcUIsT0FBQTtBQUM5QixxRUFBcUU7QUFBNUQsb0lBQUEseUJBQXlCLE9BQUE7QUFDbEMseUVBQXlFO0FBQWhFLHdJQUFBLDJCQUEyQixPQUFBO0FBQ3BDLHVGQUcyQztBQUZ6QyxxSkFBQSxpQ0FBaUMsT0FBQTtBQUNqQyx1SkFBQSxtQ0FBbUMsT0FBQSJ9
|
package/.medusa/server/src/workflows/integration/workflows/get-resolved-integration-options.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type GetResolvedIntegrationOptionsWorkflowInput = {
|
|
2
|
+
identifier: string;
|
|
3
|
+
instance_id?: string | null;
|
|
4
|
+
};
|
|
5
|
+
export declare const getResolvedIntegrationOptionsWorkflowId = "get-resolved-integration-options";
|
|
6
|
+
export declare const getResolvedIntegrationOptionsWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<GetResolvedIntegrationOptionsWorkflowInput, import("../../..").ResolvedOptions | null, []>;
|
package/.medusa/server/src/workflows/integration/workflows/get-resolved-integration-options.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResolvedIntegrationOptionsWorkflow = exports.getResolvedIntegrationOptionsWorkflowId = void 0;
|
|
4
|
+
const workflows_sdk_1 = require("@medusajs/framework/workflows-sdk");
|
|
5
|
+
const steps_1 = require("../steps");
|
|
6
|
+
exports.getResolvedIntegrationOptionsWorkflowId = "get-resolved-integration-options";
|
|
7
|
+
exports.getResolvedIntegrationOptionsWorkflow = (0, workflows_sdk_1.createWorkflow)(exports.getResolvedIntegrationOptionsWorkflowId, (input) => new workflows_sdk_1.WorkflowResponse((0, steps_1.getResolvedIntegrationOptionsStep)(input)));
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXJlc29sdmVkLWludGVncmF0aW9uLW9wdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludGVncmF0aW9uL3dvcmtmbG93cy9nZXQtcmVzb2x2ZWQtaW50ZWdyYXRpb24tb3B0aW9ucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSxxRUFBb0Y7QUFDcEYsb0NBQTREO0FBTy9DLFFBQUEsdUNBQXVDLEdBQUcsa0NBQWtDLENBQUE7QUFFNUUsUUFBQSxxQ0FBcUMsR0FBRyxJQUFBLDhCQUFjLEVBQ2pFLCtDQUF1QyxFQUN2QyxDQUFDLEtBQWlELEVBQUUsRUFBRSxDQUNwRCxJQUFJLGdDQUFnQixDQUFDLElBQUEseUNBQWlDLEVBQUMsS0FBSyxDQUFDLENBQUMsQ0FDakUsQ0FBQSJ9
|
|
@@ -2,3 +2,5 @@ export { upsertIntegrationWorkflow } from "./upsert-integration";
|
|
|
2
2
|
export { deleteIntegrationWorkflow } from "./delete-integration";
|
|
3
3
|
export { testIntegrationConnectionWorkflow } from "./test-integration-connection";
|
|
4
4
|
export { setIntegrationEnabledWorkflow } from "./set-integration-enabled";
|
|
5
|
+
export { getResolvedIntegrationOptionsWorkflow } from "./get-resolved-integration-options";
|
|
6
|
+
export type { GetResolvedIntegrationOptionsWorkflowInput } from "./get-resolved-integration-options";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setIntegrationEnabledWorkflow = exports.testIntegrationConnectionWorkflow = exports.deleteIntegrationWorkflow = exports.upsertIntegrationWorkflow = void 0;
|
|
3
|
+
exports.getResolvedIntegrationOptionsWorkflow = exports.setIntegrationEnabledWorkflow = exports.testIntegrationConnectionWorkflow = exports.deleteIntegrationWorkflow = exports.upsertIntegrationWorkflow = void 0;
|
|
4
4
|
var upsert_integration_1 = require("./upsert-integration");
|
|
5
5
|
Object.defineProperty(exports, "upsertIntegrationWorkflow", { enumerable: true, get: function () { return upsert_integration_1.upsertIntegrationWorkflow; } });
|
|
6
6
|
var delete_integration_1 = require("./delete-integration");
|
|
@@ -9,4 +9,6 @@ var test_integration_connection_1 = require("./test-integration-connection");
|
|
|
9
9
|
Object.defineProperty(exports, "testIntegrationConnectionWorkflow", { enumerable: true, get: function () { return test_integration_connection_1.testIntegrationConnectionWorkflow; } });
|
|
10
10
|
var set_integration_enabled_1 = require("./set-integration-enabled");
|
|
11
11
|
Object.defineProperty(exports, "setIntegrationEnabledWorkflow", { enumerable: true, get: function () { return set_integration_enabled_1.setIntegrationEnabledWorkflow; } });
|
|
12
|
-
|
|
12
|
+
var get_resolved_integration_options_1 = require("./get-resolved-integration-options");
|
|
13
|
+
Object.defineProperty(exports, "getResolvedIntegrationOptionsWorkflow", { enumerable: true, get: function () { return get_resolved_integration_options_1.getResolvedIntegrationOptionsWorkflow; } });
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9zcmMvd29ya2Zsb3dzL2ludGVncmF0aW9uL3dvcmtmbG93cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSwyREFBZ0U7QUFBdkQsK0hBQUEseUJBQXlCLE9BQUE7QUFDbEMsMkRBQWdFO0FBQXZELCtIQUFBLHlCQUF5QixPQUFBO0FBQ2xDLDZFQUFpRjtBQUF4RSxnSkFBQSxpQ0FBaUMsT0FBQTtBQUMxQyxxRUFBeUU7QUFBaEUsd0lBQUEsNkJBQTZCLE9BQUE7QUFDdEMsdUZBQTBGO0FBQWpGLHlKQUFBLHFDQUFxQyxPQUFBIn0=
|
package/README.md
CHANGED
|
@@ -79,7 +79,3 @@ npm install @gorgo/medusa-integration
|
|
|
79
79
|
## Documentation
|
|
80
80
|
|
|
81
81
|
The complete installation, configuration, and usage guide is available on the [Gorgo documentation website](https://docs.gorgojs.com/integrations/integration).
|
|
82
|
-
|
|
83
|
-
## License
|
|
84
|
-
|
|
85
|
-
Licensed under the [MIT License](LICENSE).
|
package/README.ru.md
CHANGED
|
@@ -79,7 +79,3 @@ npm install @gorgo/medusa-integration
|
|
|
79
79
|
## Документация
|
|
80
80
|
|
|
81
81
|
Полное руководство по установке, настройке и использованию доступно на [сайте документации Gorgo](https://docs.gorgojs.ru/integrations/integration).
|
|
82
|
-
|
|
83
|
-
## Лицензия
|
|
84
|
-
|
|
85
|
-
Распространяется на условиях [лицензии MIT](LICENSE).
|
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gorgo/medusa-integration",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Integration module for Medusa",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gorgo",
|
|
7
7
|
"url": "https://gorgojs.com"
|
|
8
8
|
},
|
|
9
|
-
"license": "MIT",
|
|
10
9
|
"files": [
|
|
11
10
|
".medusa/server"
|
|
12
11
|
],
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License Copyright (c) 2025 Gorgo
|
|
2
|
-
|
|
3
|
-
Permission is hereby granted, free
|
|
4
|
-
of charge, to any person obtaining a copy of this software and associated
|
|
5
|
-
documentation files (the "Software"), to deal in the Software without
|
|
6
|
-
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
-
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
-
following conditions:
|
|
10
|
-
|
|
11
|
-
The above copyright notice and this permission notice
|
|
12
|
-
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
-
portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
-
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
-
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
-
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
-
THE SOFTWARE.
|