@vendure/core 3.6.0-minor-202603280303 → 3.6.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/config/api-key-strategy/api-key-strategy.d.ts +9 -2
- package/dist/config/api-key-strategy/api-key-strategy.js +6 -1
- package/dist/config/api-key-strategy/api-key-strategy.js.map +1 -1
- package/dist/config/api-key-strategy/random-bytes-api-key-strategy.d.ts +1 -0
- package/dist/config/api-key-strategy/random-bytes-api-key-strategy.js +1 -0
- package/dist/config/api-key-strategy/random-bytes-api-key-strategy.js.map +1 -1
- package/dist/config/auth/default-entity-access-control-strategy.d.ts +1 -0
- package/dist/config/auth/default-entity-access-control-strategy.js +1 -0
- package/dist/config/auth/default-entity-access-control-strategy.js.map +1 -1
- package/dist/config/auth/entity-access-control-strategy.d.ts +2 -0
- package/dist/event-bus/index.d.ts +4 -2
- package/dist/event-bus/index.js +4 -2
- package/dist/event-bus/index.js.map +1 -1
- package/dist/migration-utils/index.d.ts +1 -0
- package/dist/migration-utils/index.js +3 -1
- package/dist/migration-utils/index.js.map +1 -1
- package/dist/migration-utils/v3_6_asset_translations.d.ts +37 -0
- package/dist/migration-utils/v3_6_asset_translations.js +63 -0
- package/dist/migration-utils/v3_6_asset_translations.js.map +1 -0
- package/dist/service/helpers/utils/move-to-index.js +8 -6
- package/dist/service/helpers/utils/move-to-index.js.map +1 -1
- package/dist/telemetry/collectors/plugin.collector.js +6 -8
- package/dist/telemetry/collectors/plugin.collector.js.map +1 -1
- package/package.json +5 -5
|
@@ -40,6 +40,8 @@ export type ApiKeyStrategyParseResult = null | {
|
|
|
40
40
|
* :::
|
|
41
41
|
*
|
|
42
42
|
* @docsCategory auth
|
|
43
|
+
* @docsPage ApiKeyStrategy
|
|
44
|
+
* @docsWeight 0
|
|
43
45
|
* @since 3.6.0
|
|
44
46
|
*/
|
|
45
47
|
export interface ApiKeyStrategy extends InjectableStrategy {
|
|
@@ -68,7 +70,7 @@ export interface ApiKeyStrategy extends InjectableStrategy {
|
|
|
68
70
|
* @description
|
|
69
71
|
* Defines a custom strategy for how API-Keys get hashed and checked.
|
|
70
72
|
*
|
|
71
|
-
* :::
|
|
73
|
+
* :::caution[Performance Consideration]
|
|
72
74
|
*
|
|
73
75
|
* Vendure does not store API-Keys in plain text, but rather a hashed version of the key,
|
|
74
76
|
* similar to how passwords are handled. This means that when a request comes in with an API-Key,
|
|
@@ -148,8 +150,13 @@ export interface ApiKeyStrategy extends InjectableStrategy {
|
|
|
148
150
|
lastUsedAtUpdateInterval: number | string;
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
153
|
+
* @description
|
|
151
154
|
* Intended to be extended by consumers of the {@link ApiKeyStrategy} if they do not
|
|
152
|
-
* require their own construction/parsing logic.
|
|
155
|
+
* require their own construction/parsing logic. Provides default implementations of
|
|
156
|
+
* `constructApiKey`, `parse`, `delimiter`, and `lastUsedAtUpdateInterval`.
|
|
157
|
+
*
|
|
158
|
+
* @docsCategory auth
|
|
159
|
+
* @docsPage ApiKeyStrategy
|
|
153
160
|
*/
|
|
154
161
|
export declare abstract class BaseApiKeyStrategy implements ApiKeyStrategy {
|
|
155
162
|
abstract hashingStrategy: PasswordHashingStrategy;
|
|
@@ -20,8 +20,13 @@ exports.API_KEY_AUTH_STRATEGY_NAME = 'apikey';
|
|
|
20
20
|
*/
|
|
21
21
|
exports.API_KEY_AUTH_STRATEGY_DEFAULT_DURATION_MS = (0, ms_1.default)('100y');
|
|
22
22
|
/**
|
|
23
|
+
* @description
|
|
23
24
|
* Intended to be extended by consumers of the {@link ApiKeyStrategy} if they do not
|
|
24
|
-
* require their own construction/parsing logic.
|
|
25
|
+
* require their own construction/parsing logic. Provides default implementations of
|
|
26
|
+
* `constructApiKey`, `parse`, `delimiter`, and `lastUsedAtUpdateInterval`.
|
|
27
|
+
*
|
|
28
|
+
* @docsCategory auth
|
|
29
|
+
* @docsPage ApiKeyStrategy
|
|
25
30
|
*/
|
|
26
31
|
class BaseApiKeyStrategy {
|
|
27
32
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key-strategy.js","sourceRoot":"","sources":["../../../src/config/api-key-strategy/api-key-strategy.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAOpB;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,QAAQ,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,yCAAyC,GAAG,IAAA,YAAE,EAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"api-key-strategy.js","sourceRoot":"","sources":["../../../src/config/api-key-strategy/api-key-strategy.ts"],"names":[],"mappings":";;;;;;AAAA,4CAAoB;AAOpB;;;;GAIG;AACU,QAAA,0BAA0B,GAAG,QAAQ,CAAC;AAEnD;;;;;;GAMG;AACU,QAAA,yCAAyC,GAAG,IAAA,YAAE,EAAC,MAAM,CAAC,CAAC;AAgJpE;;;;;;;;GAQG;AACH,MAAsB,kBAAkB;IAAxC;QAII,cAAS,GAAG,GAAG,CAAC;QAChB,6BAAwB,GAA+C,CAAC,CAAC;IAmB7E,CAAC;IAjBG,eAAe,CAAC,QAAgB,EAAE,MAAc;QAC5C,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,SAAS,GAAG,MAAM,EAAE,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,KAAa;QACf,IAAI,CAAC,KAAK,EAAE,CAAC;YACT,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QAE1D,IAAI,CAAC,QAAQ,IAAI,CAAC,MAAM,EAAE,CAAC;YACvB,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC;IAChC,CAAC;CACJ;AAxBD,gDAwBC"}
|
|
@@ -67,6 +67,7 @@ export interface RandomBytesApiKeyStrategyOptions {
|
|
|
67
67
|
* Note the colon `':'` delimiter between the lookup ID and the api key.
|
|
68
68
|
*
|
|
69
69
|
* @docsCategory auth
|
|
70
|
+
* @docsPage ApiKeyStrategy
|
|
70
71
|
* @since 3.6.0
|
|
71
72
|
*/
|
|
72
73
|
export declare class RandomBytesApiKeyStrategy extends BaseApiKeyStrategy {
|
|
@@ -20,6 +20,7 @@ exports.DEFAULT_LAST_USED_AT_UPDATE_INTERVAL = 0;
|
|
|
20
20
|
* Note the colon `':'` delimiter between the lookup ID and the api key.
|
|
21
21
|
*
|
|
22
22
|
* @docsCategory auth
|
|
23
|
+
* @docsPage ApiKeyStrategy
|
|
23
24
|
* @since 3.6.0
|
|
24
25
|
*/
|
|
25
26
|
class RandomBytesApiKeyStrategy extends api_key_strategy_1.BaseApiKeyStrategy {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"random-bytes-api-key-strategy.js","sourceRoot":"","sources":["../../../src/config/api-key-strategy/random-bytes-api-key-strategy.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAG1C,+FAAyF;AAGzF,yDAAwE;AAE3D,QAAA,gCAAgC,GAAG,EAAE,CAAC;AACtC,QAAA,gCAAgC,GAAG,EAAE,CAAC;AACtC,QAAA,oCAAoC,GAAG,CAAC,CAAC;AAqDtD
|
|
1
|
+
{"version":3,"file":"random-bytes-api-key-strategy.js","sourceRoot":"","sources":["../../../src/config/api-key-strategy/random-bytes-api-key-strategy.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAG1C,+FAAyF;AAGzF,yDAAwE;AAE3D,QAAA,gCAAgC,GAAG,EAAE,CAAC;AACtC,QAAA,gCAAgC,GAAG,EAAE,CAAC;AACtC,QAAA,oCAAoC,GAAG,CAAC,CAAC;AAqDtD;;;;;;;;;;;;;;;GAeG;AACH,MAAa,yBAA0B,SAAQ,qCAAkB;IAK7D,YAAY,KAAwC;;QAChD,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,mCAAI,wCAAgC,CAAC;QACxE,IAAI,CAAC,UAAU,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,UAAU,mCAAI,wCAAgC,CAAC;QACxE,IAAI,CAAC,wBAAwB;YACzB,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,wBAAwB,mCAAI,4CAAoC,CAAC;QAC5E,IAAI,CAAC,eAAe,GAAG,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,eAAe,mCAAI,IAAI,gEAA6B,EAAE,CAAC;IACzF,CAAC;IAED,cAAc,CAAC,GAAmB;QAC9B,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAED,gBAAgB,CAAC,GAAmB;QAChC,OAAO,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAEO,oBAAoB,CAAC,IAAY;QACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACnC,IAAA,yBAAW,EAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBAC3B,IAAI,GAAG,EAAE,CAAC;oBACN,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChB,CAAC;qBAAM,CAAC;oBACJ,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;gBACjC,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AAjCD,8DAiCC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-entity-access-control-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/default-entity-access-control-strategy.ts"],"names":[],"mappings":";;;AAAA,yEAAiE;AAMjE
|
|
1
|
+
{"version":3,"file":"default-entity-access-control-strategy.js","sourceRoot":"","sources":["../../../src/config/auth/default-entity-access-control-strategy.ts"],"names":[],"mappings":";;;AAAA,yEAAiE;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAa,kCAAkC;IAC3C;;;;;;OAMG;IACH,KAAK,CAAC,SAAS,CAAC,GAAmB,EAAE,WAAyB;QAC1D,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAC3B,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,WAAW,CAAC,QAAQ,CAAC,4BAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,GAAG,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,GAAG,CAAC,qBAAqB,CAAC;IAC5E,CAAC;CAIJ;AApBD,gFAoBC"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
export * from './event-bus';
|
|
2
2
|
export * from './event-bus.module';
|
|
3
|
-
export * from './vendure-event';
|
|
4
3
|
export * from './vendure-entity-event';
|
|
4
|
+
export * from './vendure-event';
|
|
5
5
|
export * from './events/account-registration-event';
|
|
6
6
|
export * from './events/account-verified-event';
|
|
7
7
|
export * from './events/administrator-event';
|
|
8
|
+
export * from './events/api-key-event';
|
|
8
9
|
export * from './events/asset-channel-event';
|
|
9
10
|
export * from './events/asset-event';
|
|
10
11
|
export * from './events/attempted-login-event';
|
|
12
|
+
export * from './events/bootstrapped-event';
|
|
11
13
|
export * from './events/change-channel-event';
|
|
12
14
|
export * from './events/channel-event';
|
|
13
15
|
export * from './events/collection-event';
|
|
@@ -16,8 +18,8 @@ export * from './events/country-event';
|
|
|
16
18
|
export * from './events/coupon-code-event';
|
|
17
19
|
export * from './events/customer-address-event';
|
|
18
20
|
export * from './events/customer-event';
|
|
19
|
-
export * from './events/customer-group-event';
|
|
20
21
|
export * from './events/customer-group-change-event';
|
|
22
|
+
export * from './events/customer-group-event';
|
|
21
23
|
export * from './events/facet-event';
|
|
22
24
|
export * from './events/facet-value-event';
|
|
23
25
|
export * from './events/fulfillment-event';
|
package/dist/event-bus/index.js
CHANGED
|
@@ -16,14 +16,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./event-bus"), exports);
|
|
18
18
|
__exportStar(require("./event-bus.module"), exports);
|
|
19
|
-
__exportStar(require("./vendure-event"), exports);
|
|
20
19
|
__exportStar(require("./vendure-entity-event"), exports);
|
|
20
|
+
__exportStar(require("./vendure-event"), exports);
|
|
21
21
|
__exportStar(require("./events/account-registration-event"), exports);
|
|
22
22
|
__exportStar(require("./events/account-verified-event"), exports);
|
|
23
23
|
__exportStar(require("./events/administrator-event"), exports);
|
|
24
|
+
__exportStar(require("./events/api-key-event"), exports);
|
|
24
25
|
__exportStar(require("./events/asset-channel-event"), exports);
|
|
25
26
|
__exportStar(require("./events/asset-event"), exports);
|
|
26
27
|
__exportStar(require("./events/attempted-login-event"), exports);
|
|
28
|
+
__exportStar(require("./events/bootstrapped-event"), exports);
|
|
27
29
|
__exportStar(require("./events/change-channel-event"), exports);
|
|
28
30
|
__exportStar(require("./events/channel-event"), exports);
|
|
29
31
|
__exportStar(require("./events/collection-event"), exports);
|
|
@@ -32,8 +34,8 @@ __exportStar(require("./events/country-event"), exports);
|
|
|
32
34
|
__exportStar(require("./events/coupon-code-event"), exports);
|
|
33
35
|
__exportStar(require("./events/customer-address-event"), exports);
|
|
34
36
|
__exportStar(require("./events/customer-event"), exports);
|
|
35
|
-
__exportStar(require("./events/customer-group-event"), exports);
|
|
36
37
|
__exportStar(require("./events/customer-group-change-event"), exports);
|
|
38
|
+
__exportStar(require("./events/customer-group-event"), exports);
|
|
37
39
|
__exportStar(require("./events/facet-event"), exports);
|
|
38
40
|
__exportStar(require("./events/facet-value-event"), exports);
|
|
39
41
|
__exportStar(require("./events/fulfillment-event"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/event-bus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,qDAAmC;AACnC,yDAAuC;AACvC,kDAAgC;AAEhC,sEAAoD;AACpD,kEAAgD;AAChD,+DAA6C;AAC7C,yDAAuC;AACvC,+DAA6C;AAC7C,uDAAqC;AACrC,iEAA+C;AAC/C,8DAA4C;AAC5C,gEAA8C;AAC9C,yDAAuC;AACvC,4DAA0C;AAC1C,yEAAuD;AACvD,yDAAuC;AACvC,6DAA2C;AAC3C,kEAAgD;AAChD,0DAAwC;AACxC,uEAAqD;AACrD,gEAA8C;AAC9C,uDAAqC;AACrC,6DAA2C;AAC3C,6DAA2C;AAC3C,8EAA4D;AAC5D,iEAA+C;AAC/C,+DAA6C;AAC7C,mEAAiD;AACjD,2EAAyD;AACzD,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,uDAAqC;AACrC,4DAA0C;AAC1C,8DAA4C;AAC5C,wEAAsD;AACtD,gEAA8C;AAC9C,yEAAuD;AACvD,gEAA8C;AAC9C,0EAAwD;AACxD,iEAA+C;AAC/C,yDAAuC;AACvC,gEAA8C;AAC9C,6EAA2D;AAC3D,sEAAoD;AACpD,yEAAuD;AACvD,iEAA+C;AAC/C,uEAAqD;AACrD,2DAAyC;AACzC,wDAAsC;AACtC,yEAAuD;AACvD,6DAA2C;AAC3C,sDAAoC;AACpC,wDAAsC;AACtC,wDAAsC;AACtC,iEAA+C;AAC/C,gEAA8C;AAC9C,gEAA8C;AAC9C,8DAA4C;AAC5C,0DAAwC;AACxC,uEAAqD;AACrD,sDAAoC;AACpC,8DAA4C"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.migrateProductOptionGroupData = void 0;
|
|
3
|
+
exports.migrateProductOptionGroupData = exports.migrateAssetTranslationData = void 0;
|
|
4
|
+
var v3_6_asset_translations_1 = require("./v3_6_asset_translations");
|
|
5
|
+
Object.defineProperty(exports, "migrateAssetTranslationData", { enumerable: true, get: function () { return v3_6_asset_translations_1.migrateAssetTranslationData; } });
|
|
4
6
|
var v3_6_shared_option_groups_1 = require("./v3_6_shared_option_groups");
|
|
5
7
|
Object.defineProperty(exports, "migrateProductOptionGroupData", { enumerable: true, get: function () { return v3_6_shared_option_groups_1.migrateProductOptionGroupData; } });
|
|
6
8
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migration-utils/index.ts"],"names":[],"mappings":";;;AAAA,yEAA4E;AAAnE,0IAAA,6BAA6B,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/migration-utils/index.ts"],"names":[],"mappings":";;;AAAA,qEAAwE;AAA/D,sIAAA,2BAA2B,OAAA;AACpC,yEAA4E;AAAnE,0IAAA,6BAA6B,OAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { QueryRunner } from 'typeorm';
|
|
2
|
+
/**
|
|
3
|
+
* @description
|
|
4
|
+
* Populates the new `asset_translation` table with data from the existing `name`
|
|
5
|
+
* column on `asset`, using the default channel's language code.
|
|
6
|
+
*
|
|
7
|
+
* Call this from your migration's `up()` method **after** the `asset_translation`
|
|
8
|
+
* table has been created and **before** the `name` column is dropped from `asset`.
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
12
|
+
* import { migrateAssetTranslationData } from '\@vendure/core';
|
|
13
|
+
*
|
|
14
|
+
* export class V36Migration1234567890 implements MigrationInterface {
|
|
15
|
+
* public async up(queryRunner: QueryRunner): Promise<any> {
|
|
16
|
+
* // --- Auto-generated DDL starts here ---
|
|
17
|
+
* // (Create asset_translation table)
|
|
18
|
+
* // ...
|
|
19
|
+
*
|
|
20
|
+
* // --- Populate new table with existing data ---
|
|
21
|
+
* await migrateAssetTranslationData(queryRunner);
|
|
22
|
+
*
|
|
23
|
+
* // --- Auto-generated DDL continues ---
|
|
24
|
+
* // (Drop name column from asset)
|
|
25
|
+
* // ...
|
|
26
|
+
* }
|
|
27
|
+
*
|
|
28
|
+
* public async down(queryRunner: QueryRunner): Promise<any> {
|
|
29
|
+
* // Auto-generated reverse DDL
|
|
30
|
+
* }
|
|
31
|
+
* }
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @since 3.6.0
|
|
35
|
+
* @docsCategory migration
|
|
36
|
+
*/
|
|
37
|
+
export declare function migrateAssetTranslationData(queryRunner: QueryRunner): Promise<void>;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.migrateAssetTranslationData = migrateAssetTranslationData;
|
|
4
|
+
/**
|
|
5
|
+
* @description
|
|
6
|
+
* Populates the new `asset_translation` table with data from the existing `name`
|
|
7
|
+
* column on `asset`, using the default channel's language code.
|
|
8
|
+
*
|
|
9
|
+
* Call this from your migration's `up()` method **after** the `asset_translation`
|
|
10
|
+
* table has been created and **before** the `name` column is dropped from `asset`.
|
|
11
|
+
*
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
14
|
+
* import { migrateAssetTranslationData } from '\@vendure/core';
|
|
15
|
+
*
|
|
16
|
+
* export class V36Migration1234567890 implements MigrationInterface {
|
|
17
|
+
* public async up(queryRunner: QueryRunner): Promise<any> {
|
|
18
|
+
* // --- Auto-generated DDL starts here ---
|
|
19
|
+
* // (Create asset_translation table)
|
|
20
|
+
* // ...
|
|
21
|
+
*
|
|
22
|
+
* // --- Populate new table with existing data ---
|
|
23
|
+
* await migrateAssetTranslationData(queryRunner);
|
|
24
|
+
*
|
|
25
|
+
* // --- Auto-generated DDL continues ---
|
|
26
|
+
* // (Drop name column from asset)
|
|
27
|
+
* // ...
|
|
28
|
+
* }
|
|
29
|
+
*
|
|
30
|
+
* public async down(queryRunner: QueryRunner): Promise<any> {
|
|
31
|
+
* // Auto-generated reverse DDL
|
|
32
|
+
* }
|
|
33
|
+
* }
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @since 3.6.0
|
|
37
|
+
* @docsCategory migration
|
|
38
|
+
*/
|
|
39
|
+
async function migrateAssetTranslationData(queryRunner) {
|
|
40
|
+
const hasName = await queryRunner.hasColumn('asset', 'name');
|
|
41
|
+
if (!hasName) {
|
|
42
|
+
console.log('The name column on asset does not exist. ' + 'Skipping data migration (already completed?).');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const esc = (name) => queryRunner.connection.driver.escape(name);
|
|
46
|
+
// 1. Get the default language code from the default channel
|
|
47
|
+
const rows = await queryRunner.query(`SELECT ${esc('defaultLanguageCode')} FROM ${esc('channel')} WHERE ${esc('code')} = '__default_channel__'`);
|
|
48
|
+
if (!(rows === null || rows === void 0 ? void 0 : rows.length)) {
|
|
49
|
+
throw new Error('Could not find the default channel. The __default_channel__ must exist before running this migration.');
|
|
50
|
+
}
|
|
51
|
+
const defaultLanguageCode = rows[0].defaultLanguageCode;
|
|
52
|
+
// 2. Copy asset names into the asset_translation table
|
|
53
|
+
await queryRunner.query(`INSERT INTO ${esc('asset_translation')} (${esc('createdAt')}, ${esc('updatedAt')}, ${esc('languageCode')}, ${esc('name')}, ${esc('baseId')})
|
|
54
|
+
SELECT a.${esc('createdAt')}, a.${esc('updatedAt')}, '${defaultLanguageCode}', a.${esc('name')}, a.${esc('id')}
|
|
55
|
+
FROM ${esc('asset')} a
|
|
56
|
+
WHERE a.${esc('name')} IS NOT NULL
|
|
57
|
+
AND NOT EXISTS (
|
|
58
|
+
SELECT 1 FROM ${esc('asset_translation')} t
|
|
59
|
+
WHERE t.${esc('baseId')} = a.${esc('id')}
|
|
60
|
+
)`);
|
|
61
|
+
console.log('Successfully migrated Asset name data to asset_translation table.');
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=v3_6_asset_translations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"v3_6_asset_translations.js","sourceRoot":"","sources":["../../src/migration-utils/v3_6_asset_translations.ts"],"names":[],"mappings":";;AAwCA,kEAmCC;AAtED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACI,KAAK,UAAU,2BAA2B,CAAC,WAAwB;IACtE,MAAM,OAAO,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CACP,2CAA2C,GAAG,+CAA+C,CAChG,CAAC;QACF,OAAO;IACX,CAAC;IAED,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAEzE,4DAA4D;IAC5D,MAAM,IAAI,GAA2C,MAAM,WAAW,CAAC,KAAK,CACxE,UAAU,GAAG,CAAC,qBAAqB,CAAC,SAAS,GAAG,CAAC,SAAS,CAAC,UAAU,GAAG,CAAC,MAAM,CAAC,0BAA0B,CAC7G,CAAC;IACF,IAAI,CAAC,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAM,CAAA,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CACX,uGAAuG,CAC1G,CAAC;IACN,CAAC;IACD,MAAM,mBAAmB,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,mBAAmB,CAAC;IAExD,uDAAuD;IACvD,MAAM,WAAW,CAAC,KAAK,CACnB,eAAe,GAAG,CAAC,mBAAmB,CAAC,KAAK,GAAG,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,WAAW,CAAC,KAAK,GAAG,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,QAAQ,CAAC;oBAC/H,GAAG,CAAC,WAAW,CAAC,OAAO,GAAG,CAAC,WAAW,CAAC,MAAM,mBAAmB,QAAQ,GAAG,CAAC,MAAM,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC;gBACvG,GAAG,CAAC,OAAO,CAAC;mBACT,GAAG,CAAC,MAAM,CAAC;;6BAED,GAAG,CAAC,mBAAmB,CAAC;uBAC9B,GAAG,CAAC,QAAQ,CAAC,QAAQ,GAAG,CAAC,IAAI,CAAC;WAC1C,CACN,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,mEAAmE,CAAC,CAAC;AACrF,CAAC"}
|
|
@@ -15,13 +15,15 @@ function moveToIndex(index, target, siblings) {
|
|
|
15
15
|
currentIndex = siblingsWithTarget.findIndex(sibling => (0, utils_1.idsAreEqual)(sibling.id, target.id));
|
|
16
16
|
if (currentIndex !== normalizedIndex) {
|
|
17
17
|
siblingsWithTarget.splice(normalizedIndex, 0, siblingsWithTarget.splice(currentIndex, 1)[0]);
|
|
18
|
-
siblingsWithTarget.forEach((collection, i) => {
|
|
19
|
-
collection.position = i;
|
|
20
|
-
if (target.id === collection.id) {
|
|
21
|
-
target.position = i;
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
18
|
}
|
|
19
|
+
// Always reassign positions to ensure consistency — the target item
|
|
20
|
+
// may carry a stale position value from a different parent.
|
|
21
|
+
siblingsWithTarget.forEach((collection, i) => {
|
|
22
|
+
collection.position = i;
|
|
23
|
+
if (target.id === collection.id) {
|
|
24
|
+
target.position = i;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
25
27
|
return siblingsWithTarget;
|
|
26
28
|
}
|
|
27
29
|
//# sourceMappingURL=move-to-index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"move-to-index.js","sourceRoot":"","sources":["../../../../src/service/helpers/utils/move-to-index.ts"],"names":[],"mappings":";;AASA,
|
|
1
|
+
{"version":3,"file":"move-to-index.js","sourceRoot":"","sources":["../../../../src/service/helpers/utils/move-to-index.ts"],"names":[],"mappings":";;AASA,kCAsBC;AA9BD,iDAAoD;AAGpD;;;;GAIG;AACH,SAAgB,WAAW,CACvB,KAAa,EACb,MAAS,EACT,QAAa;IAEb,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACtE,IAAI,YAAY,GAAG,QAAQ,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAA,mBAAW,EAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IACrF,MAAM,eAAe,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACzF,MAAM,kBAAkB,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,eAAe,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC;IAClG,YAAY,GAAG,kBAAkB,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,IAAA,mBAAW,EAAC,OAAO,CAAC,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;IAC3F,IAAI,YAAY,KAAK,eAAe,EAAE,CAAC;QACnC,kBAAkB,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,EAAE,kBAAkB,CAAC,MAAM,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACjG,CAAC;IACD,oEAAoE;IACpE,4DAA4D;IAC5D,kBAAkB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC,EAAE,EAAE;QACzC,UAAU,CAAC,QAAQ,GAAG,CAAC,CAAC;QACxB,IAAI,MAAM,CAAC,EAAE,KAAK,UAAU,CAAC,EAAE,EAAE,CAAC;YAC9B,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC;QACxB,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,kBAAkB,CAAC;AAC9B,CAAC"}
|
|
@@ -32,18 +32,16 @@ const KNOWN_VENDURE_PLUGINS = {
|
|
|
32
32
|
DashboardPlugin: '@vendure/dashboard',
|
|
33
33
|
// @vendure/job-queue-plugin
|
|
34
34
|
BullMQJobQueuePlugin: '@vendure/job-queue-plugin',
|
|
35
|
-
// @vendure/elasticsearch-plugin
|
|
36
|
-
ElasticsearchPlugin: '@vendure/elasticsearch-plugin',
|
|
37
35
|
// @vendure/graphiql-plugin
|
|
38
36
|
GraphiqlPlugin: '@vendure/graphiql-plugin',
|
|
39
37
|
// @vendure/harden-plugin
|
|
40
38
|
HardenPlugin: '@vendure/harden-plugin',
|
|
41
|
-
// @vendure
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
StripePlugin: '@vendure/
|
|
45
|
-
MolliePlugin: '@vendure/
|
|
46
|
-
BraintreePlugin: '@vendure/
|
|
39
|
+
// Community plugins (moved to @vendure-community/*)
|
|
40
|
+
ElasticsearchPlugin: '@vendure-community/elasticsearch-plugin',
|
|
41
|
+
SentryPlugin: '@vendure-community/sentry-plugin',
|
|
42
|
+
StripePlugin: '@vendure-community/stripe-plugin',
|
|
43
|
+
MolliePlugin: '@vendure-community/mollie-plugin',
|
|
44
|
+
BraintreePlugin: '@vendure-community/braintree-plugin',
|
|
47
45
|
};
|
|
48
46
|
/**
|
|
49
47
|
* Collects information about plugins used in the Vendure installation.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.collector.js","sourceRoot":"","sources":["../../../src/telemetry/collectors/plugin.collector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gEAA4D;AAC5D,kEAA+D;AAG/D;;;GAGG;AACH,MAAM,qBAAqB,GAA2B;IAClD,gBAAgB;IAChB,mBAAmB,EAAE,eAAe;IACpC,qBAAqB,EAAE,eAAe;IACtC,sBAAsB,EAAE,eAAe;IACvC,+BAA+B;IAC/B,iBAAiB,EAAE,8BAA8B;IACjD,wBAAwB;IACxB,WAAW,EAAE,uBAAuB;IACpC,2BAA2B;IAC3B,aAAa,EAAE,0BAA0B;IACzC,qBAAqB;IACrB,eAAe,EAAE,oBAAoB;IACrC,4BAA4B;IAC5B,oBAAoB,EAAE,2BAA2B;IACjD,
|
|
1
|
+
{"version":3,"file":"plugin.collector.js","sourceRoot":"","sources":["../../../src/telemetry/collectors/plugin.collector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAiE;AAEjE,gEAA4D;AAC5D,kEAA+D;AAG/D;;;GAGG;AACH,MAAM,qBAAqB,GAA2B;IAClD,gBAAgB;IAChB,mBAAmB,EAAE,eAAe;IACpC,qBAAqB,EAAE,eAAe;IACtC,sBAAsB,EAAE,eAAe;IACvC,+BAA+B;IAC/B,iBAAiB,EAAE,8BAA8B;IACjD,wBAAwB;IACxB,WAAW,EAAE,uBAAuB;IACpC,2BAA2B;IAC3B,aAAa,EAAE,0BAA0B;IACzC,qBAAqB;IACrB,eAAe,EAAE,oBAAoB;IACrC,4BAA4B;IAC5B,oBAAoB,EAAE,2BAA2B;IACjD,2BAA2B;IAC3B,cAAc,EAAE,0BAA0B;IAC1C,yBAAyB;IACzB,YAAY,EAAE,wBAAwB;IACtC,oDAAoD;IACpD,mBAAmB,EAAE,yCAAyC;IAC9D,YAAY,EAAE,kCAAkC;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BAC5C,IAAI,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;4BACrC,OAAO,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;wBAC/C,CAAC;oBACL,CAAC;gBACL,CAAC;gBAAC,WAAM,CAAC;oBACL,wCAAwC;oBACxC,SAAS;gBACb,CAAC;YACL,CAAC;QACL,CAAC;QAAC,WAAM,CAAC;YACL,wCAAwC;QAC5C,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;OAGG;IACK,kBAAkB,CAAC,UAAkB;QACzC,MAAM,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;QAChE,IAAI,gBAAgB,KAAK,CAAC,CAAC,EAAE,CAAC;YAC1B,OAAO,SAAS,CAAC;QACrB,CAAC;QAED,MAAM,oBAAoB,GAAG,UAAU,CAAC,KAAK,CAAC,gBAAgB,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;QACzF,MAAM,KAAK,GAAG,oBAAoB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YAC3B,iCAAiC;YACjC,OAAO,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QACrC,CAAC;QACD,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;CACJ,CAAA;AAnHY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,mBAAU,GAAE;qCAEmC,8BAAa;GADhD,eAAe,CAmH3B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vendure/core",
|
|
3
|
-
"version": "3.6.0
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "A modern, headless ecommerce framework",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@nestjs/platform-express": "^11.0.12",
|
|
50
50
|
"@nestjs/terminus": "^11.0.0",
|
|
51
51
|
"@nestjs/typeorm": "^11.0.0",
|
|
52
|
-
"@vendure/common": "
|
|
52
|
+
"@vendure/common": "3.6.0",
|
|
53
53
|
"bcrypt": "^6.0.0",
|
|
54
54
|
"body-parser": "^1.20.2",
|
|
55
55
|
"cookie-session": "^2.1.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"graphql-tag": "^2.12.6",
|
|
66
66
|
"graphql-upload": "^17.0.0",
|
|
67
67
|
"http-proxy-middleware": "^3.0.3",
|
|
68
|
-
"i18next": "^
|
|
68
|
+
"i18next": "^26.0.2",
|
|
69
69
|
"i18next-fs-backend": "^2.6.0",
|
|
70
70
|
"i18next-http-middleware": "^3.7.2",
|
|
71
71
|
"i18next-icu": "^2.3.0",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@types/progress": "^2.0.7",
|
|
96
96
|
"@types/prompts": "^2.4.9",
|
|
97
97
|
"@types/semver": "^7.5.8",
|
|
98
|
-
"better-sqlite3": "^
|
|
98
|
+
"better-sqlite3": "^11.6.0",
|
|
99
99
|
"chokidar": "^3.6.0",
|
|
100
100
|
"fs-extra": "^11.2.0",
|
|
101
101
|
"glob": "^10.3.10",
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
"mysql2": "^3.15.0",
|
|
104
104
|
"pg": "^8.13.1",
|
|
105
105
|
"rimraf": "^5.0.5",
|
|
106
|
-
"sql.js": "1.
|
|
106
|
+
"sql.js": "1.13.0",
|
|
107
107
|
"sqlite3": "^5.1.7",
|
|
108
108
|
"typescript": "5.8.2"
|
|
109
109
|
},
|