@hartl-services/medusa-base 3.0.0 → 4.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/.medusa/server/src/admin/admin-components/features/plugin-features/components/PluginActionsSection.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/components/PluginFeaturesCard.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/components/PluginHubCard.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/components/PluginSettingsForm.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/components/PluginStatusChips.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/components/ShopMasterDataBanner.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/hooks/usePluginFeatureEnabled.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/hooks/usePluginSettingsForm.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/hooks/usePluginSwitch.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/action-runs.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/plugin-features-admin-client.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/plugin-features-admin-client.js +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/plugin-view.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/settings-draft.d.ts +1 -1
- package/.medusa/server/src/admin/admin-components/features/plugin-features/lib/settings-layout.d.ts +1 -1
- package/.medusa/server/src/admin/index.js +43 -43
- package/.medusa/server/src/admin/index.mjs +43 -43
- package/.medusa/server/src/api/admin/draft-orders/[id]/order-confirmation/route.js +2 -2
- package/.medusa/server/src/api/admin/email/attachments/[id]/mail-kinds/route.js +2 -2
- package/.medusa/server/src/api/admin/email/attachments/[id]/route.js +2 -2
- package/.medusa/server/src/api/admin/email/attachments/[id]/versions/route.js +2 -2
- package/.medusa/server/src/api/admin/email/attachments/route.js +2 -2
- package/.medusa/server/src/api/admin/email/messages/[id]/resends/route.js +2 -2
- package/.medusa/server/src/api/admin/email/messages/[id]/route.js +2 -2
- package/.medusa/server/src/api/admin/email/messages/route.js +2 -2
- package/.medusa/server/src/api/admin/email/templates/[kind]/preview/route.js +2 -2
- package/.medusa/server/src/api/admin/email/templates/[kind]/route.js +2 -2
- package/.medusa/server/src/api/admin/email/templates/[kind]/send-test/route.js +2 -2
- package/.medusa/server/src/api/admin/email/templates/[kind]/test-sources/route.js +2 -2
- package/.medusa/server/src/api/admin/email/templates/route.js +2 -2
- package/.medusa/server/src/api/admin/plugin-features/[plugin_key]/actions/[action_key]/route.js +2 -2
- package/.medusa/server/src/api/admin/plugin-features/[plugin_key]/actions/[action_key]/runs/route.js +2 -2
- package/.medusa/server/src/api/admin/plugin-features/[plugin_key]/route.js +2 -2
- package/.medusa/server/src/api/admin/plugin-features/[plugin_key]/settings/route.js +2 -2
- package/.medusa/server/src/api/admin/plugin-features/route.js +2 -2
- package/.medusa/server/src/api/admin-first-login-password-policy.js +2 -2
- package/.medusa/server/src/api/answer-code-provider-route-not-found.js +2 -2
- package/.medusa/server/src/api/check-customer-address-tax-identification.js +3 -3
- package/.medusa/server/src/api/code-account-password-routes.js +2 -2
- package/.medusa/server/src/api/middlewares.js +9 -9
- package/.medusa/server/src/api/password-policy.js +2 -2
- package/.medusa/server/src/api/plugin-actions.js +2 -2
- package/.medusa/server/src/api/plugin-features-http.js +2 -2
- package/.medusa/server/src/api/require-login-code-customer-email.js +2 -2
- package/.medusa/server/src/api/store/carts/[id]/completion-check/route.js +2 -2
- package/.medusa/server/src/api/store/carts/[id]/tax-identification/route.js +2 -2
- package/.medusa/server/src/api/store/customer-auth/password-policy/route.js +2 -2
- package/.medusa/server/src/api/store/plugin-features/[plugin_key]/route.js +2 -2
- package/.medusa/server/src/api/store/plugin-features/route.js +2 -2
- package/.medusa/server/src/customer-auth/application/prepare-code-account-password-reset.js +2 -2
- package/.medusa/server/src/customer-auth/application/request-login-code.js +2 -2
- package/.medusa/server/src/customer-auth/customer-password-policy.js +2 -2
- package/.medusa/server/src/customer-auth/domain/auth-methods.js +2 -2
- package/.medusa/server/src/customer-auth/domain/login-code.js +2 -2
- package/.medusa/server/src/customer-auth/login-code-state.js +2 -2
- package/.medusa/server/src/customer-auth/plugin-features.js +2 -2
- package/.medusa/server/src/documents/paths/documents.js +2 -2
- package/.medusa/server/src/documents/schemas/documents.js +2 -2
- package/.medusa/server/src/email/application/deliver-login-code.js +2 -2
- package/.medusa/server/src/email/domain/business-keys.js +2 -2
- package/.medusa/server/src/email/templates/blocks/render-document.js +2 -2
- package/.medusa/server/src/email/templates/render.js +2 -2
- package/.medusa/server/src/email/templates/validate.js +2 -2
- package/.medusa/server/src/email/types/template-data.js +2 -2
- package/.medusa/server/src/modules/documents/service.js +2 -2
- package/.medusa/server/src/modules/email/domain/attachment.js +2 -2
- package/.medusa/server/src/modules/email/service.js +3 -3
- package/.medusa/server/src/modules/tax-compliance/service.js +2 -2
- package/.medusa/server/src/providers/email-otp/service.js +2 -2
- package/.medusa/server/src/public/shop-config.js +6 -6
- package/.medusa/server/src/shop-config/{build-food-shop-config.js → build-shop-config.js} +10 -10
- package/.medusa/server/src/shop-config/options.js +4 -4
- package/.medusa/server/src/subscribers/affiliate-application-submitted.js +2 -2
- package/.medusa/server/src/subscribers/affiliate-consignment-reminder-due.js +2 -2
- package/.medusa/server/src/subscribers/documents-order-cancellation-ready.js +2 -2
- package/.medusa/server/src/subscribers/documents-refund-ready.js +2 -2
- package/.medusa/server/src/subscribers/documents-shipment-invoice-assignment-decided.js +2 -2
- package/.medusa/server/src/subscribers/packing-list-allocation-revised.js +2 -2
- package/.medusa/server/src/subscribers/tax-compliance-plugin-features-updated.js +2 -2
- package/.medusa/server/src/tax-compliance/lib/tax-compliance-state.js +2 -2
- package/.medusa/server/src/tax-compliance/plugin-features.js +2 -2
- package/README.md +55 -45
- package/dist/customer-auth/domain/auth-methods.js +1 -1
- package/dist/customer-auth/plugin-features.js +1 -1
- package/dist/documents/types/admin-api.d.ts +1 -1
- package/dist/documents/types/document-summary.d.ts +1 -1
- package/dist/documents/types/store-api.d.ts +1 -1
- package/dist/email/types/template-data.js +1 -1
- package/dist/public/shop-config.d.ts +4 -4
- package/dist/public/shop-config.js +5 -5
- package/dist/shop-config/{build-food-shop-config.d.ts → build-shop-config.d.ts} +10 -10
- package/dist/shop-config/{build-food-shop-config.js → build-shop-config.js} +9 -9
- package/dist/shop-config/options.d.ts +3 -3
- package/dist/shop-config/options.js +3 -3
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from "@hartl-services/medusa-
|
|
1
|
+
export type * from "@hartl-services/medusa-contracts/types/documents-admin";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type { StoreDocument as DocumentSummary } from "@hartl-services/medusa-
|
|
1
|
+
export type { StoreDocument as DocumentSummary } from "@hartl-services/medusa-contracts/types/documents-store";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export type * from "@hartl-services/medusa-
|
|
1
|
+
export type * from "@hartl-services/medusa-contracts/types/documents-store";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EmailRenderDataSchemas = exports.EmailPersistedDataSchemas = exports.RefundSummarySchema = exports.ReturnReceivedSummarySchema = exports.ReturnSummarySchema = exports.ShipmentSummarySchema = exports.OrderSummarySchema = void 0;
|
|
4
4
|
const zod_1 = require("@medusajs/framework/zod");
|
|
5
|
-
const affiliate_1 = require("@hartl-services/medusa-
|
|
5
|
+
const affiliate_1 = require("@hartl-services/medusa-contracts/schemas/affiliate");
|
|
6
6
|
const NonEmptyStringSchema = zod_1.z.string().trim().min(1);
|
|
7
7
|
const NullableLocaleSchema = NonEmptyStringSchema.max(35).nullable();
|
|
8
8
|
const DocumentsFactFingerprintSchema = zod_1.z
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Entry of `@hartl-services/medusa-base/shop-config`: the turnkey
|
|
3
|
-
* `medusa-config.ts` of a
|
|
3
|
+
* `medusa-config.ts` of a shop. Separate from `./config` because it loads
|
|
4
4
|
* the Sentry logger wrapper and with it `@sentry/node`.
|
|
5
5
|
*/
|
|
6
|
-
export {
|
|
7
|
-
export type {
|
|
8
|
-
export type {
|
|
6
|
+
export { buildShopConfig, defineShopConfig, } from "../shop-config/build-shop-config";
|
|
7
|
+
export type { ShopConfigInput, ShopModule, ShopPlugin, } from "../shop-config/build-shop-config";
|
|
8
|
+
export type { ShopConfigOptions } from "../shop-config/options";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.defineShopConfig = exports.buildShopConfig = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Entry of `@hartl-services/medusa-base/shop-config`: the turnkey
|
|
6
|
-
* `medusa-config.ts` of a
|
|
6
|
+
* `medusa-config.ts` of a shop. Separate from `./config` because it loads
|
|
7
7
|
* the Sentry logger wrapper and with it `@sentry/node`.
|
|
8
8
|
*/
|
|
9
|
-
var
|
|
10
|
-
Object.defineProperty(exports, "
|
|
11
|
-
Object.defineProperty(exports, "
|
|
9
|
+
var build_shop_config_1 = require("../shop-config/build-shop-config");
|
|
10
|
+
Object.defineProperty(exports, "buildShopConfig", { enumerable: true, get: function () { return build_shop_config_1.buildShopConfig; } });
|
|
11
|
+
Object.defineProperty(exports, "defineShopConfig", { enumerable: true, get: function () { return build_shop_config_1.defineShopConfig; } });
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { defineConfig } from "@medusajs/framework/utils";
|
|
2
2
|
import { withSentryErrorReporting } from "../public/sentry-logger";
|
|
3
|
-
import { type
|
|
3
|
+
import { type ShopConfigOptions } from "./options";
|
|
4
4
|
type ConfigInput = Parameters<typeof defineConfig>[0];
|
|
5
5
|
type ProjectConfigInput = NonNullable<Extract<NonNullable<ConfigInput>, {
|
|
6
6
|
projectConfig?: unknown;
|
|
7
7
|
}>["projectConfig"]>;
|
|
8
8
|
/** A plugin registration of the returned configuration. */
|
|
9
|
-
export type
|
|
9
|
+
export type ShopPlugin = {
|
|
10
10
|
resolve: string;
|
|
11
11
|
options: Record<string, unknown>;
|
|
12
12
|
};
|
|
13
13
|
/** A module registration of the returned configuration. */
|
|
14
|
-
export type
|
|
14
|
+
export type ShopModule = {
|
|
15
15
|
key?: string;
|
|
16
16
|
resolve: string;
|
|
17
17
|
options?: Record<string, unknown>;
|
|
@@ -20,17 +20,17 @@ export type FoodShopModule = {
|
|
|
20
20
|
* The configuration input before `defineConfig`. `modules` and `plugins` are
|
|
21
21
|
* plain arrays so a caller (for example a test harness) can adjust them.
|
|
22
22
|
*/
|
|
23
|
-
export type
|
|
23
|
+
export type ShopConfigInput = {
|
|
24
24
|
admin: {
|
|
25
25
|
path: `/${string}`;
|
|
26
26
|
};
|
|
27
27
|
logger: ReturnType<typeof withSentryErrorReporting>;
|
|
28
28
|
projectConfig: ProjectConfigInput;
|
|
29
|
-
modules:
|
|
30
|
-
plugins:
|
|
29
|
+
modules: ShopModule[];
|
|
30
|
+
plugins: ShopPlugin[];
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
|
-
* Builds the plain `medusa-config.ts` input of a
|
|
33
|
+
* Builds the plain `medusa-config.ts` input of a shop: Medusa core
|
|
34
34
|
* settings, the Redis event bus, the mail provider (set up in the Admin), S3 file storage, tax and
|
|
35
35
|
* Stripe payment providers, and the Hartl Services plugins (the base plugin
|
|
36
36
|
* with its E-Mail, Documents, Steuer-Compliance and file storage modules plus
|
|
@@ -38,7 +38,7 @@ export type FoodShopConfigInput = {
|
|
|
38
38
|
* values are read and validated from `environment`; a missing or invalid one
|
|
39
39
|
* fails with its name.
|
|
40
40
|
*/
|
|
41
|
-
export declare function
|
|
42
|
-
/** `defineConfig(
|
|
43
|
-
export declare function
|
|
41
|
+
export declare function buildShopConfig(options: ShopConfigOptions, environment?: NodeJS.ProcessEnv): ShopConfigInput;
|
|
42
|
+
/** `defineConfig(buildShopConfig(options))` for `module.exports`. */
|
|
43
|
+
export declare function defineShopConfig(options: ShopConfigOptions, environment?: NodeJS.ProcessEnv): ReturnType<typeof defineConfig>;
|
|
44
44
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.buildShopConfig = buildShopConfig;
|
|
4
|
+
exports.defineShopConfig = defineShopConfig;
|
|
5
5
|
const logger_1 = require("@medusajs/framework/logger");
|
|
6
|
-
const customer_auth_1 = require("@hartl-services/medusa-
|
|
6
|
+
const customer_auth_1 = require("@hartl-services/medusa-contracts/schemas/customer-auth");
|
|
7
7
|
const utils_1 = require("@medusajs/framework/utils");
|
|
8
8
|
const config_1 = require("../public/config");
|
|
9
9
|
const customer_auth_methods_snapshot_1 = require("../customer-auth/customer-auth-methods-snapshot");
|
|
@@ -11,7 +11,7 @@ const customer_verification_snapshot_1 = require("../email/customer-verification
|
|
|
11
11
|
const sentry_logger_1 = require("../public/sentry-logger");
|
|
12
12
|
const options_1 = require("./options");
|
|
13
13
|
/**
|
|
14
|
-
* Builds the plain `medusa-config.ts` input of a
|
|
14
|
+
* Builds the plain `medusa-config.ts` input of a shop: Medusa core
|
|
15
15
|
* settings, the Redis event bus, the mail provider (set up in the Admin), S3 file storage, tax and
|
|
16
16
|
* Stripe payment providers, and the Hartl Services plugins (the base plugin
|
|
17
17
|
* with its E-Mail, Documents, Steuer-Compliance and file storage modules plus
|
|
@@ -19,8 +19,8 @@ const options_1 = require("./options");
|
|
|
19
19
|
* values are read and validated from `environment`; a missing or invalid one
|
|
20
20
|
* fails with its name.
|
|
21
21
|
*/
|
|
22
|
-
function
|
|
23
|
-
(0, options_1.
|
|
22
|
+
function buildShopConfig(options, environment = process.env) {
|
|
23
|
+
(0, options_1.assertShopConfigOptions)(options);
|
|
24
24
|
if (options.loadEnvFile !== false) {
|
|
25
25
|
(0, utils_1.loadEnv)(process.env.NODE_ENV || "development", process.cwd());
|
|
26
26
|
}
|
|
@@ -296,7 +296,7 @@ function buildFoodShopConfig(options, environment = process.env) {
|
|
|
296
296
|
plugins,
|
|
297
297
|
};
|
|
298
298
|
}
|
|
299
|
-
/** `defineConfig(
|
|
300
|
-
function
|
|
301
|
-
return (0, utils_1.defineConfig)(
|
|
299
|
+
/** `defineConfig(buildShopConfig(options))` for `module.exports`. */
|
|
300
|
+
function defineShopConfig(options, environment = process.env) {
|
|
301
|
+
return (0, utils_1.defineConfig)(buildShopConfig(options, environment));
|
|
302
302
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { DocumentHtmlFactory } from "../documents/types";
|
|
2
2
|
/**
|
|
3
|
-
* The shop-specific facts of a
|
|
3
|
+
* The shop-specific facts of a shop. Deployment values and secrets are
|
|
4
4
|
* not options: they come from the environment (see the README).
|
|
5
5
|
*/
|
|
6
|
-
export type
|
|
6
|
+
export type ShopConfigOptions = Readonly<{
|
|
7
7
|
/**
|
|
8
8
|
* Shop name in the branding of the default e-mail templates (and the store
|
|
9
9
|
* name of a shop's initial seed). Company name, address and UID are not
|
|
@@ -43,4 +43,4 @@ export type FoodShopConfigOptions = Readonly<{
|
|
|
43
43
|
* Throws a `TypeError` naming the first invalid option, so a misconfigured
|
|
44
44
|
* shop fails at boot.
|
|
45
45
|
*/
|
|
46
|
-
export declare function
|
|
46
|
+
export declare function assertShopConfigOptions(options: unknown): asserts options is ShopConfigOptions;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.assertShopConfigOptions = assertShopConfigOptions;
|
|
4
4
|
const lib_1 = require("../shared/lib");
|
|
5
5
|
const fail = (name, expectation) => {
|
|
6
|
-
throw new TypeError(`
|
|
6
|
+
throw new TypeError(`Shop option "${name}" must be ${expectation}.`);
|
|
7
7
|
};
|
|
8
8
|
const requireText = (value, name) => {
|
|
9
9
|
if (typeof value !== "string" || value.trim() === "") {
|
|
@@ -41,7 +41,7 @@ const requireObject = (value, name) => {
|
|
|
41
41
|
* Throws a `TypeError` naming the first invalid option, so a misconfigured
|
|
42
42
|
* shop fails at boot.
|
|
43
43
|
*/
|
|
44
|
-
function
|
|
44
|
+
function assertShopConfigOptions(options) {
|
|
45
45
|
const candidate = requireObject(options, "options");
|
|
46
46
|
requireText(candidate.displayName, "displayName");
|
|
47
47
|
requireEmail(candidate.orderNotificationEmail, "orderNotificationEmail");
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hartl-services/medusa-base",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Base plugin for Hartl Services Medusa shops: per-plugin feature toggles with a generic Admin settings page, a Store endpoint for storefronts, enforcement helpers, the complete-cart hook composition, the root redirect, cart-promotion link repair, the built-in E-Mail, Documents, Steuer-Compliance (UID check, Tax provider) and S3 file storage modules, config helpers with the turnkey
|
|
3
|
+
"version": "4.0.0",
|
|
4
|
+
"description": "Base plugin for Hartl Services Medusa shops: per-plugin feature toggles with a generic Admin settings page, a Store endpoint for storefronts, enforcement helpers, the complete-cart hook composition, the root redirect, cart-promotion link repair, the built-in E-Mail, Documents, Steuer-Compliance (UID check, Tax provider) and S3 file storage modules, config helpers with the turnkey shop-config preset, and the Sentry logger wrapper and instrumentation.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"files": [
|
|
7
7
|
".medusa/server",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
],
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "git+https://gitlab.com/hartl-services-gmbh/services/
|
|
14
|
+
"url": "git+https://gitlab.com/hartl-services-gmbh/services/medusa-plugins.git",
|
|
15
15
|
"directory": "plugins/base"
|
|
16
16
|
},
|
|
17
17
|
"publishConfig": {
|
|
@@ -102,7 +102,7 @@
|
|
|
102
102
|
"mime-types": "3.0.1",
|
|
103
103
|
"nodemailer": "6.10.1",
|
|
104
104
|
"ulid": "^2.4.0",
|
|
105
|
-
"@hartl-services/medusa-
|
|
105
|
+
"@hartl-services/medusa-contracts": "^1.0.0"
|
|
106
106
|
},
|
|
107
107
|
"devDependencies": {
|
|
108
108
|
"@medusajs/admin-sdk": "2.19.0",
|
|
@@ -153,9 +153,9 @@
|
|
|
153
153
|
"build": "medusa plugin:build && tsc -p tsconfig.public.json && tsc -p tsconfig.admin-components.json",
|
|
154
154
|
"dev": "medusa plugin:develop",
|
|
155
155
|
"typecheck": "tsc --noEmit && tsc -p tsconfig.type-tests.json --noEmit && tsc -p tsconfig.component-tests.json",
|
|
156
|
-
"pretest:unit": "pnpm --filter @hartl-services/medusa-
|
|
156
|
+
"pretest:unit": "pnpm --filter @hartl-services/medusa-contracts build",
|
|
157
157
|
"test:unit": "sh ../../scripts/dev-capped.sh jest",
|
|
158
|
-
"pretest:contract": "pnpm --filter @hartl-services/medusa-
|
|
158
|
+
"pretest:contract": "pnpm --filter @hartl-services/medusa-contracts build",
|
|
159
159
|
"test:contract": "jest --config jest.contract.config.js --runInBand",
|
|
160
160
|
"test:integration:modules": "TEST_TYPE=integration:modules NODE_OPTIONS=--experimental-vm-modules jest --config jest.integration.config.js --silent=false --runInBand --forceExit"
|
|
161
161
|
}
|