@medusajs/product 0.3.2 → 0.3.3-next-20231109084604
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/migrations/Migration20230719100648.js +35 -27
- package/dist/migrations/Migration20230908084537.d.ts +1 -1
- package/dist/migrations/Migration20230908084537.js +6 -6
- package/dist/repositories/product-collection.js +2 -4
- package/dist/repositories/product-option.d.ts +1 -0
- package/dist/repositories/product-option.js +39 -0
- package/dist/repositories/product-tag.js +9 -7
- package/dist/repositories/product-type.js +9 -7
- package/dist/repositories/product.js +1 -1
- package/dist/scripts/bin/run-migration-down.js +0 -0
- package/dist/scripts/bin/run-migration-up.js +0 -0
- package/dist/scripts/bin/run-seed.js +0 -0
- package/dist/scripts/migration-up.js +1 -1
- package/dist/services/product-category.js +3 -4
- package/dist/services/product-collection.js +3 -4
- package/dist/services/product-image.js +1 -2
- package/dist/services/product-module-service.d.ts +1 -0
- package/dist/services/product-module-service.js +53 -35
- package/dist/services/product-option.d.ts +1 -0
- package/dist/services/product-option.js +14 -4
- package/dist/services/product-tag.d.ts +1 -1
- package/dist/services/product-tag.js +4 -5
- package/dist/services/product-type.d.ts +1 -1
- package/dist/services/product-type.js +4 -5
- package/dist/services/product-variant.js +5 -6
- package/dist/services/product.js +5 -6
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +2 -3
- package/package.json +4 -4
|
@@ -4,40 +4,48 @@ exports.Migration20230719100648 = void 0;
|
|
|
4
4
|
const migrations_1 = require("@mikro-orm/migrations");
|
|
5
5
|
class Migration20230719100648 extends migrations_1.Migration {
|
|
6
6
|
async up() {
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
try {
|
|
8
|
+
// Prevent from crashing if for some reason the migration is re run (example, typeorm and mikro orm does not have the same migration table)
|
|
9
|
+
await this.execute('SELECT 1 FROM "product" LIMIT 1;');
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
// noop
|
|
14
|
+
}
|
|
15
|
+
this.addSql('create table IF NOT EXISTS "product_category" ("id" text not null, "name" text not null, "description" text not null default \'\', "handle" text not null, "mpath" text not null, "is_active" boolean not null default false, "is_internal" boolean not null default false, "rank" numeric not null default 0, "parent_category_id" text null, "created_at" timestamptz not null, "updated_at" timestamptz not null, constraint "product_category_pkey" primary key ("id"));');
|
|
16
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_category_path" on "product_category" ("mpath");');
|
|
9
17
|
this.addSql('alter table "product_category" add constraint "IDX_product_category_handle" unique ("handle");');
|
|
10
|
-
this.addSql('create table "product_collection" ("id" text not null, "title" text not null, "handle" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_collection_pkey" primary key ("id"));');
|
|
11
|
-
this.addSql('create index "IDX_product_collection_deleted_at" on "product_collection" ("deleted_at");');
|
|
18
|
+
this.addSql('create table IF NOT EXISTS "product_collection" ("id" text not null, "title" text not null, "handle" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_collection_pkey" primary key ("id"));');
|
|
19
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_collection_deleted_at" on "product_collection" ("deleted_at");');
|
|
12
20
|
this.addSql('alter table "product_collection" add constraint "IDX_product_collection_handle_unique" unique ("handle");');
|
|
13
|
-
this.addSql('create table "image" ("id" text not null, "url" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "image_pkey" primary key ("id"));');
|
|
14
|
-
this.addSql('create index "IDX_product_image_url" on "image" ("url");');
|
|
15
|
-
this.addSql('create index "IDX_product_image_deleted_at" on "image" ("deleted_at");');
|
|
16
|
-
this.addSql('create table "product_tag" ("id" text not null, "value" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_tag_pkey" primary key ("id"));');
|
|
17
|
-
this.addSql('create index "IDX_product_tag_deleted_at" on "product_tag" ("deleted_at");');
|
|
18
|
-
this.addSql('create table "product_type" ("id" text not null, "value" text not null, "metadata" json null, "deleted_at" timestamptz null, constraint "product_type_pkey" primary key ("id"));');
|
|
19
|
-
this.addSql('create index "IDX_product_type_deleted_at" on "product_type" ("deleted_at");');
|
|
20
|
-
this.addSql('create table "product" ("id" text not null, "title" text not null, "handle" text not null, "subtitle" text null, "description" text null, "is_giftcard" boolean not null default false, "status" text check ("status" in (\'draft\', \'proposed\', \'published\', \'rejected\')) not null, "thumbnail" text null, "weight" text null, "length" text null, "height" text null, "width" text null, "origin_country" text null, "hs_code" text null, "mid_code" text null, "material" text null, "collection_id" text null, "type_id" text null, "discountable" boolean not null default true, "external_id" text null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, "metadata" jsonb null, constraint "product_pkey" primary key ("id"));');
|
|
21
|
-
this.addSql('create index "IDX_product_type_id" on "product" ("type_id");');
|
|
22
|
-
this.addSql('create index "IDX_product_deleted_at" on "product" ("deleted_at");');
|
|
21
|
+
this.addSql('create table IF NOT EXISTS "image" ("id" text not null, "url" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "image_pkey" primary key ("id"));');
|
|
22
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_image_url" on "image" ("url");');
|
|
23
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_image_deleted_at" on "image" ("deleted_at");');
|
|
24
|
+
this.addSql('create table IF NOT EXISTS "product_tag" ("id" text not null, "value" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_tag_pkey" primary key ("id"));');
|
|
25
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_tag_deleted_at" on "product_tag" ("deleted_at");');
|
|
26
|
+
this.addSql('create table IF NOT EXISTS "product_type" ("id" text not null, "value" text not null, "metadata" json null, "deleted_at" timestamptz null, constraint "product_type_pkey" primary key ("id"));');
|
|
27
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_type_deleted_at" on "product_type" ("deleted_at");');
|
|
28
|
+
this.addSql('create table IF NOT EXISTS "product" ("id" text not null, "title" text not null, "handle" text not null, "subtitle" text null, "description" text null, "is_giftcard" boolean not null default false, "status" text check ("status" in (\'draft\', \'proposed\', \'published\', \'rejected\')) not null, "thumbnail" text null, "weight" text null, "length" text null, "height" text null, "width" text null, "origin_country" text null, "hs_code" text null, "mid_code" text null, "material" text null, "collection_id" text null, "type_id" text null, "discountable" boolean not null default true, "external_id" text null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, "metadata" jsonb null, constraint "product_pkey" primary key ("id"));');
|
|
29
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_type_id" on "product" ("type_id");');
|
|
30
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_deleted_at" on "product" ("deleted_at");');
|
|
23
31
|
this.addSql('alter table "product" add constraint "IDX_product_handle_unique" unique ("handle");');
|
|
24
|
-
this.addSql('create table "product_option" ("id" text not null, "title" text not null, "product_id" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_option_pkey" primary key ("id"));');
|
|
25
|
-
this.addSql('create index "IDX_product_option_product_id" on "product_option" ("product_id");');
|
|
26
|
-
this.addSql('create index "IDX_product_option_deleted_at" on "product_option" ("deleted_at");');
|
|
27
|
-
this.addSql('create table "product_tags" ("product_id" text not null, "product_tag_id" text not null, constraint "product_tags_pkey" primary key ("product_id", "product_tag_id"));');
|
|
28
|
-
this.addSql('create table "product_images" ("product_id" text not null, "image_id" text not null, constraint "product_images_pkey" primary key ("product_id", "image_id"));');
|
|
29
|
-
this.addSql('create table "product_category_product" ("product_id" text not null, "product_category_id" text not null, constraint "product_category_product_pkey" primary key ("product_id", "product_category_id"));');
|
|
30
|
-
this.addSql('create table "product_variant" ("id" text not null, "title" text not null, "sku" text null, "barcode" text null, "ean" text null, "upc" text null, "inventory_quantity" numeric not null default 100, "allow_backorder" boolean not null default false, "manage_inventory" boolean not null default true, "hs_code" text null, "origin_country" text null, "mid_code" text null, "material" text null, "weight" numeric null, "length" numeric null, "height" numeric null, "width" numeric null, "metadata" jsonb null, "variant_rank" numeric null default 0, "product_id" text not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "product_variant_pkey" primary key ("id"));');
|
|
31
|
-
this.addSql('create index "IDX_product_variant_deleted_at" on "product_variant" ("deleted_at");');
|
|
32
|
-
this.addSql('create index "IDX_product_variant_product_id" on "product_variant" ("product_id");');
|
|
32
|
+
this.addSql('create table IF NOT EXISTS "product_option" ("id" text not null, "title" text not null, "product_id" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_option_pkey" primary key ("id"));');
|
|
33
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_option_product_id" on "product_option" ("product_id");');
|
|
34
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_option_deleted_at" on "product_option" ("deleted_at");');
|
|
35
|
+
this.addSql('create table IF NOT EXISTS "product_tags" ("product_id" text not null, "product_tag_id" text not null, constraint "product_tags_pkey" primary key ("product_id", "product_tag_id"));');
|
|
36
|
+
this.addSql('create table IF NOT EXISTS "product_images" ("product_id" text not null, "image_id" text not null, constraint "product_images_pkey" primary key ("product_id", "image_id"));');
|
|
37
|
+
this.addSql('create table IF NOT EXISTS "product_category_product" ("product_id" text not null, "product_category_id" text not null, constraint "product_category_product_pkey" primary key ("product_id", "product_category_id"));');
|
|
38
|
+
this.addSql('create table IF NOT EXISTS "product_variant" ("id" text not null, "title" text not null, "sku" text null, "barcode" text null, "ean" text null, "upc" text null, "inventory_quantity" numeric not null default 100, "allow_backorder" boolean not null default false, "manage_inventory" boolean not null default true, "hs_code" text null, "origin_country" text null, "mid_code" text null, "material" text null, "weight" numeric null, "length" numeric null, "height" numeric null, "width" numeric null, "metadata" jsonb null, "variant_rank" numeric null default 0, "product_id" text not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "product_variant_pkey" primary key ("id"));');
|
|
39
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_variant_deleted_at" on "product_variant" ("deleted_at");');
|
|
40
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_variant_product_id" on "product_variant" ("product_id");');
|
|
33
41
|
this.addSql('alter table "product_variant" add constraint "IDX_product_variant_sku_unique" unique ("sku");');
|
|
34
42
|
this.addSql('alter table "product_variant" add constraint "IDX_product_variant_barcode_unique" unique ("barcode");');
|
|
35
43
|
this.addSql('alter table "product_variant" add constraint "IDX_product_variant_ean_unique" unique ("ean");');
|
|
36
44
|
this.addSql('alter table "product_variant" add constraint "IDX_product_variant_upc_unique" unique ("upc");');
|
|
37
|
-
this.addSql('create table "product_option_value" ("id" text not null, "value" text not null, "option_id" text not null, "variant_id" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_option_value_pkey" primary key ("id"));');
|
|
38
|
-
this.addSql('create index "IDX_product_option_value_option_id" on "product_option_value" ("option_id");');
|
|
39
|
-
this.addSql('create index "IDX_product_option_value_variant_id" on "product_option_value" ("variant_id");');
|
|
40
|
-
this.addSql('create index "IDX_product_option_value_deleted_at" on "product_option_value" ("deleted_at");');
|
|
45
|
+
this.addSql('create table IF NOT EXISTS "product_option_value" ("id" text not null, "value" text not null, "option_id" text not null, "variant_id" text not null, "metadata" jsonb null, "deleted_at" timestamptz null, constraint "product_option_value_pkey" primary key ("id"));');
|
|
46
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_option_value_option_id" on "product_option_value" ("option_id");');
|
|
47
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_option_value_variant_id" on "product_option_value" ("variant_id");');
|
|
48
|
+
this.addSql('create index IF NOT EXISTS "IDX_product_option_value_deleted_at" on "product_option_value" ("deleted_at");');
|
|
41
49
|
this.addSql('alter table "product_category" add constraint "product_category_parent_category_id_foreign" foreign key ("parent_category_id") references "product_category" ("id") on update cascade on delete set null;');
|
|
42
50
|
this.addSql('alter table "product" add constraint "product_collection_id_foreign" foreign key ("collection_id") references "product_collection" ("id") on update cascade on delete set null;');
|
|
43
51
|
this.addSql('alter table "product" add constraint "product_type_id_foreign" foreign key ("type_id") references "product_type" ("id") on update cascade on delete set null;');
|
|
@@ -8,20 +8,20 @@ class Migration20230908084537 extends migrations_1.Migration {
|
|
|
8
8
|
this.addSql('alter table "product_category" alter column "created_at" set default now();');
|
|
9
9
|
this.addSql('alter table "product_category" alter column "updated_at" type timestamptz using ("updated_at"::timestamptz);');
|
|
10
10
|
this.addSql('alter table "product_category" alter column "updated_at" set default now();');
|
|
11
|
-
this.addSql('alter table "product_collection" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
12
|
-
this.addSql('alter table "image" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
13
|
-
this.addSql('alter table "product_tag" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
14
|
-
this.addSql('alter table "product_type" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
11
|
+
this.addSql('alter table "product_collection" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
12
|
+
this.addSql('alter table "image" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
13
|
+
this.addSql('alter table "product_tag" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
14
|
+
this.addSql('alter table "product_type" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
15
15
|
this.addSql('alter table "product" alter column "created_at" type timestamptz using ("created_at"::timestamptz);');
|
|
16
16
|
this.addSql('alter table "product" alter column "created_at" set default now();');
|
|
17
17
|
this.addSql('alter table "product" alter column "updated_at" type timestamptz using ("updated_at"::timestamptz);');
|
|
18
18
|
this.addSql('alter table "product" alter column "updated_at" set default now();');
|
|
19
|
-
this.addSql('alter table "product_option" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
19
|
+
this.addSql('alter table "product_option" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
20
20
|
this.addSql('alter table "product_variant" alter column "created_at" type timestamptz using ("created_at"::timestamptz);');
|
|
21
21
|
this.addSql('alter table "product_variant" alter column "created_at" set default now();');
|
|
22
22
|
this.addSql('alter table "product_variant" alter column "updated_at" type timestamptz using ("updated_at"::timestamptz);');
|
|
23
23
|
this.addSql('alter table "product_variant" alter column "updated_at" set default now();');
|
|
24
|
-
this.addSql('alter table "product_option_value" add column "created_at" timestamptz not null default now(), add column "updated_at" timestamptz not null default now();');
|
|
24
|
+
this.addSql('alter table "product_option_value" add column IF NOT EXISTS "created_at" timestamptz not null default now(), add column IF NOT EXISTS "updated_at" timestamptz not null default now();');
|
|
25
25
|
}
|
|
26
26
|
async down() {
|
|
27
27
|
this.addSql('alter table "product_category" alter column "created_at" drop default;');
|
|
@@ -13,8 +13,7 @@ class ProductCollectionRepository extends utils_1.DALUtils.MikroOrmBaseRepositor
|
|
|
13
13
|
this.manager_ = manager;
|
|
14
14
|
}
|
|
15
15
|
async find(findOptions = { where: {} }, context = {}) {
|
|
16
|
-
const manager = (context
|
|
17
|
-
this.manager_);
|
|
16
|
+
const manager = this.getActiveManager(context);
|
|
18
17
|
const findOptions_ = { ...findOptions };
|
|
19
18
|
findOptions_.options ?? (findOptions_.options = {});
|
|
20
19
|
Object.assign(findOptions_.options, {
|
|
@@ -23,8 +22,7 @@ class ProductCollectionRepository extends utils_1.DALUtils.MikroOrmBaseRepositor
|
|
|
23
22
|
return await manager.find(_models_1.ProductCollection, findOptions_.where, findOptions_.options);
|
|
24
23
|
}
|
|
25
24
|
async findAndCount(findOptions = { where: {} }, context = {}) {
|
|
26
|
-
const manager = (context
|
|
27
|
-
this.manager_);
|
|
25
|
+
const manager = this.getActiveManager(context);
|
|
28
26
|
const findOptions_ = { ...findOptions };
|
|
29
27
|
findOptions_.options ?? (findOptions_.options = {});
|
|
30
28
|
Object.assign(findOptions_.options, {
|
|
@@ -12,4 +12,5 @@ export declare class ProductOptionRepository extends DALUtils.MikroOrmAbstractBa
|
|
|
12
12
|
delete(ids: string[], context?: Context): Promise<void>;
|
|
13
13
|
create(data: ProductTypes.CreateProductOptionDTO[], context?: Context): Promise<ProductOption[]>;
|
|
14
14
|
update(data: ProductTypes.UpdateProductOptionDTO[], context?: Context): Promise<ProductOption[]>;
|
|
15
|
+
upsert(data: ProductTypes.CreateProductOptionDTO[] | ProductTypes.UpdateProductOptionDTO[], context?: Context): Promise<ProductOption[]>;
|
|
15
16
|
}
|
|
@@ -81,5 +81,44 @@ class ProductOptionRepository extends utils_1.DALUtils.MikroOrmAbstractBaseRepos
|
|
|
81
81
|
manager.persist(productOptions);
|
|
82
82
|
return productOptions;
|
|
83
83
|
}
|
|
84
|
+
async upsert(data, context = {}) {
|
|
85
|
+
const manager = this.getActiveManager(context);
|
|
86
|
+
const optionIds = data.map((optionData) => optionData.id).filter((o) => o);
|
|
87
|
+
let existingOptions;
|
|
88
|
+
let existingOptionsMap = new Map();
|
|
89
|
+
if (optionIds.length) {
|
|
90
|
+
existingOptions = await this.find({
|
|
91
|
+
where: {
|
|
92
|
+
id: {
|
|
93
|
+
$in: optionIds,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
}, context);
|
|
97
|
+
existingOptionsMap = new Map(existingOptions.map((option) => [option.id, option]));
|
|
98
|
+
}
|
|
99
|
+
const upsertedOptions = [];
|
|
100
|
+
const optionsToCreate = [];
|
|
101
|
+
const optionsToUpdate = [];
|
|
102
|
+
data.forEach((option) => {
|
|
103
|
+
const existingOption = existingOptionsMap.get(option.id);
|
|
104
|
+
if (existingOption) {
|
|
105
|
+
const updatedOption = manager.assign(existingOption, option);
|
|
106
|
+
optionsToUpdate.push(updatedOption);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
const newOption = manager.create(_models_1.ProductOption, option);
|
|
110
|
+
optionsToCreate.push(newOption);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
if (optionsToCreate.length) {
|
|
114
|
+
manager.persist(optionsToCreate);
|
|
115
|
+
upsertedOptions.push(...optionsToCreate);
|
|
116
|
+
}
|
|
117
|
+
if (optionsToUpdate.length) {
|
|
118
|
+
manager.persist(optionsToUpdate);
|
|
119
|
+
upsertedOptions.push(...optionsToUpdate);
|
|
120
|
+
}
|
|
121
|
+
return upsertedOptions;
|
|
122
|
+
}
|
|
84
123
|
}
|
|
85
124
|
exports.ProductOptionRepository = ProductOptionRepository;
|
|
@@ -71,10 +71,12 @@ class ProductTagRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
|
71
71
|
const existingTagsMap = new Map(existingTags.map((tag) => [tag.value, tag]));
|
|
72
72
|
const upsertedTags = [];
|
|
73
73
|
const tagsToCreate = [];
|
|
74
|
+
const tagsToUpdate = [];
|
|
74
75
|
tags.forEach((tag) => {
|
|
75
76
|
const aTag = existingTagsMap.get(tag.value);
|
|
76
77
|
if (aTag) {
|
|
77
|
-
|
|
78
|
+
const updatedTag = manager.assign(aTag, tag);
|
|
79
|
+
tagsToUpdate.push(updatedTag);
|
|
78
80
|
}
|
|
79
81
|
else {
|
|
80
82
|
const newTag = manager.create(_models_1.ProductTag, tag);
|
|
@@ -82,12 +84,12 @@ class ProductTagRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
|
82
84
|
}
|
|
83
85
|
});
|
|
84
86
|
if (tagsToCreate.length) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
manager.persist(
|
|
90
|
-
upsertedTags.push(...
|
|
87
|
+
manager.persist(tagsToCreate);
|
|
88
|
+
upsertedTags.push(...tagsToCreate);
|
|
89
|
+
}
|
|
90
|
+
if (tagsToUpdate.length) {
|
|
91
|
+
manager.persist(tagsToUpdate);
|
|
92
|
+
upsertedTags.push(...tagsToUpdate);
|
|
91
93
|
}
|
|
92
94
|
return upsertedTags;
|
|
93
95
|
}
|
|
@@ -42,10 +42,12 @@ class ProductTypeRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
|
42
42
|
const existingTypesMap = new Map(existingTypes.map((type) => [type.value, type]));
|
|
43
43
|
const upsertedTypes = [];
|
|
44
44
|
const typesToCreate = [];
|
|
45
|
+
const typesToUpdate = [];
|
|
45
46
|
types.forEach((type) => {
|
|
46
47
|
const aType = existingTypesMap.get(type.value);
|
|
47
48
|
if (aType) {
|
|
48
|
-
|
|
49
|
+
const updatedType = manager.assign(aType, type);
|
|
50
|
+
typesToUpdate.push(updatedType);
|
|
49
51
|
}
|
|
50
52
|
else {
|
|
51
53
|
const newType = manager.create(_models_1.ProductType, type);
|
|
@@ -53,12 +55,12 @@ class ProductTypeRepository extends utils_1.DALUtils.MikroOrmBaseRepository {
|
|
|
53
55
|
}
|
|
54
56
|
});
|
|
55
57
|
if (typesToCreate.length) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
manager.persist(
|
|
61
|
-
upsertedTypes.push(...
|
|
58
|
+
manager.persist(typesToCreate);
|
|
59
|
+
upsertedTypes.push(...typesToCreate);
|
|
60
|
+
}
|
|
61
|
+
if (typesToUpdate.length) {
|
|
62
|
+
manager.persist(typesToUpdate);
|
|
63
|
+
upsertedTypes.push(...typesToUpdate);
|
|
62
64
|
}
|
|
63
65
|
return upsertedTypes;
|
|
64
66
|
}
|
|
@@ -119,7 +119,7 @@ class ProductRepository extends utils_1.DALUtils.MikroOrmAbstractBaseRepository
|
|
|
119
119
|
const collectionsToAssignMap = new Map(collectionsToAssign.map((collection) => [collection.id, collection]));
|
|
120
120
|
const typesToAssignMap = new Map(typesToAssign.map((type) => [type.id, type]));
|
|
121
121
|
const productsToUpdateMap = new Map(productsToUpdate.map((product) => [product.id, product]));
|
|
122
|
-
const products = await
|
|
122
|
+
const products = await (0, utils_1.promiseAll)(data.map(async (updateData) => {
|
|
123
123
|
const product = productsToUpdateMap.get(updateData.id);
|
|
124
124
|
if (!product) {
|
|
125
125
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `Product with id "${updateData.id}" not found`);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -42,7 +42,7 @@ async function runMigrations({ options, logger, } = {}) {
|
|
|
42
42
|
try {
|
|
43
43
|
const migrator = orm.getMigrator();
|
|
44
44
|
const pendingMigrations = await migrator.getPendingMigrations();
|
|
45
|
-
logger.info(`Running pending migrations: ${pendingMigrations}`);
|
|
45
|
+
logger.info(`Running pending migrations: ${JSON.stringify(pendingMigrations, null, 2)}`);
|
|
46
46
|
await migrator.up({
|
|
47
47
|
migrations: pendingMigrations.map((m) => m.name),
|
|
48
48
|
});
|
|
@@ -14,7 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const types_1 = require("@medusajs/types");
|
|
16
16
|
const utils_1 = require("@medusajs/utils");
|
|
17
|
-
const utils_2 = require("../utils");
|
|
18
17
|
const types_2 = require("../types");
|
|
19
18
|
class ProductCategoryService {
|
|
20
19
|
constructor({ productCategoryRepository }) {
|
|
@@ -87,21 +86,21 @@ __decorate([
|
|
|
87
86
|
__metadata("design:returntype", Promise)
|
|
88
87
|
], ProductCategoryService.prototype, "listAndCount", null);
|
|
89
88
|
__decorate([
|
|
90
|
-
(0, utils_1.InjectTransactionManager)(
|
|
89
|
+
(0, utils_1.InjectTransactionManager)("productCategoryRepository_"),
|
|
91
90
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
92
91
|
__metadata("design:type", Function),
|
|
93
92
|
__metadata("design:paramtypes", [Object, Object]),
|
|
94
93
|
__metadata("design:returntype", Promise)
|
|
95
94
|
], ProductCategoryService.prototype, "create", null);
|
|
96
95
|
__decorate([
|
|
97
|
-
(0, utils_1.InjectTransactionManager)(
|
|
96
|
+
(0, utils_1.InjectTransactionManager)("productCategoryRepository_"),
|
|
98
97
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
99
98
|
__metadata("design:type", Function),
|
|
100
99
|
__metadata("design:paramtypes", [String, Object, Object]),
|
|
101
100
|
__metadata("design:returntype", Promise)
|
|
102
101
|
], ProductCategoryService.prototype, "update", null);
|
|
103
102
|
__decorate([
|
|
104
|
-
(0, utils_1.InjectTransactionManager)(
|
|
103
|
+
(0, utils_1.InjectTransactionManager)("productCategoryRepository_"),
|
|
105
104
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
106
105
|
__metadata("design:type", Function),
|
|
107
106
|
__metadata("design:paramtypes", [String, Object]),
|
|
@@ -14,7 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const types_1 = require("@medusajs/types");
|
|
16
16
|
const utils_1 = require("@medusajs/utils");
|
|
17
|
-
const utils_2 = require("../utils");
|
|
18
17
|
const _models_1 = require("../models");
|
|
19
18
|
class ProductCollectionService {
|
|
20
19
|
constructor({ productCollectionRepository }) {
|
|
@@ -76,21 +75,21 @@ __decorate([
|
|
|
76
75
|
__metadata("design:returntype", Promise)
|
|
77
76
|
], ProductCollectionService.prototype, "listAndCount", null);
|
|
78
77
|
__decorate([
|
|
79
|
-
(0, utils_1.InjectTransactionManager)(
|
|
78
|
+
(0, utils_1.InjectTransactionManager)("productCollectionRepository_"),
|
|
80
79
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
81
80
|
__metadata("design:type", Function),
|
|
82
81
|
__metadata("design:paramtypes", [Array, Object]),
|
|
83
82
|
__metadata("design:returntype", Promise)
|
|
84
83
|
], ProductCollectionService.prototype, "create", null);
|
|
85
84
|
__decorate([
|
|
86
|
-
(0, utils_1.InjectTransactionManager)(
|
|
85
|
+
(0, utils_1.InjectTransactionManager)("productCollectionRepository_"),
|
|
87
86
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
88
87
|
__metadata("design:type", Function),
|
|
89
88
|
__metadata("design:paramtypes", [Array, Object]),
|
|
90
89
|
__metadata("design:returntype", Promise)
|
|
91
90
|
], ProductCollectionService.prototype, "update", null);
|
|
92
91
|
__decorate([
|
|
93
|
-
(0, utils_1.InjectTransactionManager)(
|
|
92
|
+
(0, utils_1.InjectTransactionManager)("productCollectionRepository_"),
|
|
94
93
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
95
94
|
__metadata("design:type", Function),
|
|
96
95
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -13,7 +13,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const utils_1 = require("@medusajs/utils");
|
|
16
|
-
const utils_2 = require("../utils");
|
|
17
16
|
class ProductImageService {
|
|
18
17
|
constructor({ productImageRepository }) {
|
|
19
18
|
this.productImageRepository_ = productImageRepository;
|
|
@@ -25,7 +24,7 @@ class ProductImageService {
|
|
|
25
24
|
}
|
|
26
25
|
exports.default = ProductImageService;
|
|
27
26
|
__decorate([
|
|
28
|
-
(0, utils_1.InjectTransactionManager)(
|
|
27
|
+
(0, utils_1.InjectTransactionManager)("productImageRepository_"),
|
|
29
28
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
30
29
|
__metadata("design:type", Function),
|
|
31
30
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -70,6 +70,7 @@ export default class ProductModuleService<TProduct extends Product = Product, TP
|
|
|
70
70
|
update(data: ProductTypes.UpdateProductDTO[], sharedContext?: Context): Promise<ProductTypes.ProductDTO[]>;
|
|
71
71
|
protected create_(data: ProductTypes.CreateProductDTO[], sharedContext?: Context): Promise<TProduct[]>;
|
|
72
72
|
protected update_(data: ProductTypes.UpdateProductDTO[], sharedContext?: Context): Promise<TProduct[]>;
|
|
73
|
+
protected upsertAndAssignOptionsToProductData(productData: ProductTypes.CreateProductDTO | ProductTypes.UpdateProductDTO, sharedContext?: Context): Promise<void>;
|
|
73
74
|
protected upsertAndAssignImagesToProductData(productData: ProductTypes.CreateProductDTO | ProductTypes.UpdateProductDTO, sharedContext?: Context): Promise<void>;
|
|
74
75
|
protected upsertAndAssignProductTagsToProductData(productData: ProductTypes.CreateProductDTO | ProductTypes.UpdateProductDTO, sharedContext?: Context): Promise<void>;
|
|
75
76
|
protected upsertAndAssignProductTypeToProductData(productData: ProductTypes.CreateProductDTO | ProductTypes.UpdateProductDTO, sharedContext?: Context): Promise<void>;
|
|
@@ -17,7 +17,6 @@ const product_category_1 = require("../types/services/product-category");
|
|
|
17
17
|
const product_collection_1 = require("../types/services/product-collection");
|
|
18
18
|
const product_1 = require("../types/services/product");
|
|
19
19
|
const utils_1 = require("@medusajs/utils");
|
|
20
|
-
const utils_2 = require("../utils");
|
|
21
20
|
const joiner_config_1 = require("./../joiner-config");
|
|
22
21
|
class ProductModuleService {
|
|
23
22
|
constructor({ baseRepository, productService, productVariantService, productTagService, productCategoryService, productCollectionService, productImageService, productTypeService, productOptionService, eventBusModuleService, }, moduleDeclaration) {
|
|
@@ -219,7 +218,7 @@ class ProductModuleService {
|
|
|
219
218
|
async create_(data, sharedContext = {}) {
|
|
220
219
|
const productVariantsMap = new Map();
|
|
221
220
|
const productOptionsMap = new Map();
|
|
222
|
-
const productsData = await
|
|
221
|
+
const productsData = await (0, utils_1.promiseAll)(data.map(async (product) => {
|
|
223
222
|
const productData = { ...product };
|
|
224
223
|
if (!productData.handle) {
|
|
225
224
|
productData.handle = (0, utils_1.kebabCase)(product.title);
|
|
@@ -270,7 +269,7 @@ class ProductModuleService {
|
|
|
270
269
|
});
|
|
271
270
|
});
|
|
272
271
|
}
|
|
273
|
-
await
|
|
272
|
+
await (0, utils_1.promiseAll)([...productVariantsMap].map(async ([handle, variants]) => {
|
|
274
273
|
return await this.productVariantService_.create(productByHandleMap.get(handle), variants, sharedContext);
|
|
275
274
|
}));
|
|
276
275
|
return products;
|
|
@@ -284,30 +283,24 @@ class ProductModuleService {
|
|
|
284
283
|
}));
|
|
285
284
|
const productVariantsMap = new Map();
|
|
286
285
|
const productOptionsMap = new Map();
|
|
287
|
-
const productsData = await
|
|
288
|
-
const { variants,
|
|
286
|
+
const productsData = await (0, utils_1.promiseAll)(data.map(async (product) => {
|
|
287
|
+
const { variants, ...productData } = product;
|
|
289
288
|
if (!(0, utils_1.isDefined)(productData.id)) {
|
|
290
289
|
throw new utils_1.MedusaError(utils_1.MedusaError.Types.NOT_FOUND, `Cannot update product without id`);
|
|
291
290
|
}
|
|
292
291
|
productVariantsMap.set(productData.id, variants ?? []);
|
|
293
|
-
productOptionsMap.set(productData.id, options ?? []);
|
|
294
292
|
if (productData.is_giftcard) {
|
|
295
293
|
productData.discountable = false;
|
|
296
294
|
}
|
|
297
295
|
await this.upsertAndAssignImagesToProductData(productData, sharedContext);
|
|
298
296
|
await this.upsertAndAssignProductTagsToProductData(productData, sharedContext);
|
|
299
297
|
await this.upsertAndAssignProductTypeToProductData(productData, sharedContext);
|
|
298
|
+
await this.upsertAndAssignOptionsToProductData(productData, sharedContext);
|
|
299
|
+
productOptionsMap.set(productData.id, (productData.options ?? []));
|
|
300
300
|
return productData;
|
|
301
301
|
}));
|
|
302
302
|
const products = await this.productService_.update(productsData, sharedContext);
|
|
303
303
|
const productByIdMap = new Map(products.map((product) => [product.id, product]));
|
|
304
|
-
const productOptionsData = [...productOptionsMap]
|
|
305
|
-
.map(([id, options]) => options.map((option) => ({
|
|
306
|
-
...option,
|
|
307
|
-
product: productByIdMap.get(id),
|
|
308
|
-
})))
|
|
309
|
-
.flat();
|
|
310
|
-
const productOptions = await this.productOptionService_.create(productOptionsData, sharedContext);
|
|
311
304
|
const productVariantIdsToDelete = [];
|
|
312
305
|
const productVariantsToCreateMap = new Map();
|
|
313
306
|
const productVariantsToUpdateMap = new Map();
|
|
@@ -315,6 +308,7 @@ class ProductModuleService {
|
|
|
315
308
|
const variantsToCreate = [];
|
|
316
309
|
const variantsToUpdate = [];
|
|
317
310
|
const existingVariants = existingProductVariantsMap.get(productId);
|
|
311
|
+
const productOptions = productOptionsMap.get(productId);
|
|
318
312
|
variants.forEach((variant) => {
|
|
319
313
|
const isVariantIdDefined = "id" in variant && (0, utils_1.isDefined)(variant.id);
|
|
320
314
|
if (isVariantIdDefined) {
|
|
@@ -330,7 +324,7 @@ class ProductModuleService {
|
|
|
330
324
|
value: option.value,
|
|
331
325
|
};
|
|
332
326
|
});
|
|
333
|
-
if (variantOptions) {
|
|
327
|
+
if (variantOptions?.length) {
|
|
334
328
|
variant.options = variantOptions;
|
|
335
329
|
}
|
|
336
330
|
});
|
|
@@ -351,9 +345,14 @@ class ProductModuleService {
|
|
|
351
345
|
if (productVariantIdsToDelete.length) {
|
|
352
346
|
promises.push(this.productVariantService_.softDelete(productVariantIdsToDelete, sharedContext));
|
|
353
347
|
}
|
|
354
|
-
await
|
|
348
|
+
await (0, utils_1.promiseAll)(promises);
|
|
355
349
|
return products;
|
|
356
350
|
}
|
|
351
|
+
async upsertAndAssignOptionsToProductData(productData, sharedContext = {}) {
|
|
352
|
+
if (productData.options?.length) {
|
|
353
|
+
productData.options = await this.productOptionService_.upsert(productData.options, sharedContext);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
357
356
|
async upsertAndAssignImagesToProductData(productData, sharedContext = {}) {
|
|
358
357
|
if (!productData.thumbnail && productData.images?.length) {
|
|
359
358
|
productData.thumbnail = (0, utils_1.isString)(productData.images[0])
|
|
@@ -502,21 +501,21 @@ __decorate([
|
|
|
502
501
|
__metadata("design:returntype", Promise)
|
|
503
502
|
], ProductModuleService.prototype, "listAndCountTags", null);
|
|
504
503
|
__decorate([
|
|
505
|
-
(0, utils_1.InjectTransactionManager)(
|
|
504
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
506
505
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
507
506
|
__metadata("design:type", Function),
|
|
508
507
|
__metadata("design:paramtypes", [Array, Object]),
|
|
509
508
|
__metadata("design:returntype", Promise)
|
|
510
509
|
], ProductModuleService.prototype, "createTags", null);
|
|
511
510
|
__decorate([
|
|
512
|
-
(0, utils_1.InjectTransactionManager)(
|
|
511
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
513
512
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
514
513
|
__metadata("design:type", Function),
|
|
515
514
|
__metadata("design:paramtypes", [Array, Object]),
|
|
516
515
|
__metadata("design:returntype", Promise)
|
|
517
516
|
], ProductModuleService.prototype, "updateTags", null);
|
|
518
517
|
__decorate([
|
|
519
|
-
(0, utils_1.InjectTransactionManager)(
|
|
518
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
520
519
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
521
520
|
__metadata("design:type", Function),
|
|
522
521
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -544,21 +543,21 @@ __decorate([
|
|
|
544
543
|
__metadata("design:returntype", Promise)
|
|
545
544
|
], ProductModuleService.prototype, "listAndCountTypes", null);
|
|
546
545
|
__decorate([
|
|
547
|
-
(0, utils_1.InjectTransactionManager)(
|
|
546
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
548
547
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
549
548
|
__metadata("design:type", Function),
|
|
550
549
|
__metadata("design:paramtypes", [Array, Object]),
|
|
551
550
|
__metadata("design:returntype", Promise)
|
|
552
551
|
], ProductModuleService.prototype, "createTypes", null);
|
|
553
552
|
__decorate([
|
|
554
|
-
(0, utils_1.InjectTransactionManager)(
|
|
553
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
555
554
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
556
555
|
__metadata("design:type", Function),
|
|
557
556
|
__metadata("design:paramtypes", [Array, Object]),
|
|
558
557
|
__metadata("design:returntype", Promise)
|
|
559
558
|
], ProductModuleService.prototype, "updateTypes", null);
|
|
560
559
|
__decorate([
|
|
561
|
-
(0, utils_1.InjectTransactionManager)(
|
|
560
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
562
561
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
563
562
|
__metadata("design:type", Function),
|
|
564
563
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -586,21 +585,21 @@ __decorate([
|
|
|
586
585
|
__metadata("design:returntype", Promise)
|
|
587
586
|
], ProductModuleService.prototype, "listAndCountOptions", null);
|
|
588
587
|
__decorate([
|
|
589
|
-
(0, utils_1.InjectTransactionManager)(
|
|
588
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
590
589
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
591
590
|
__metadata("design:type", Function),
|
|
592
591
|
__metadata("design:paramtypes", [Array, Object]),
|
|
593
592
|
__metadata("design:returntype", Promise)
|
|
594
593
|
], ProductModuleService.prototype, "createOptions", null);
|
|
595
594
|
__decorate([
|
|
596
|
-
(0, utils_1.InjectTransactionManager)(
|
|
595
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
597
596
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
598
597
|
__metadata("design:type", Function),
|
|
599
598
|
__metadata("design:paramtypes", [Array, Object]),
|
|
600
599
|
__metadata("design:returntype", Promise)
|
|
601
600
|
], ProductModuleService.prototype, "updateOptions", null);
|
|
602
601
|
__decorate([
|
|
603
|
-
(0, utils_1.InjectTransactionManager)(
|
|
602
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
604
603
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
605
604
|
__metadata("design:type", Function),
|
|
606
605
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -628,21 +627,21 @@ __decorate([
|
|
|
628
627
|
__metadata("design:returntype", Promise)
|
|
629
628
|
], ProductModuleService.prototype, "listAndCountCollections", null);
|
|
630
629
|
__decorate([
|
|
631
|
-
(0, utils_1.InjectTransactionManager)(
|
|
630
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
632
631
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
633
632
|
__metadata("design:type", Function),
|
|
634
633
|
__metadata("design:paramtypes", [Array, Object]),
|
|
635
634
|
__metadata("design:returntype", Promise)
|
|
636
635
|
], ProductModuleService.prototype, "createCollections", null);
|
|
637
636
|
__decorate([
|
|
638
|
-
(0, utils_1.InjectTransactionManager)(
|
|
637
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
639
638
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
640
639
|
__metadata("design:type", Function),
|
|
641
640
|
__metadata("design:paramtypes", [Array, Object]),
|
|
642
641
|
__metadata("design:returntype", Promise)
|
|
643
642
|
], ProductModuleService.prototype, "updateCollections", null);
|
|
644
643
|
__decorate([
|
|
645
|
-
(0, utils_1.InjectTransactionManager)(
|
|
644
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
646
645
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
647
646
|
__metadata("design:type", Function),
|
|
648
647
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -663,21 +662,21 @@ __decorate([
|
|
|
663
662
|
__metadata("design:returntype", Promise)
|
|
664
663
|
], ProductModuleService.prototype, "listCategories", null);
|
|
665
664
|
__decorate([
|
|
666
|
-
(0, utils_1.InjectTransactionManager)(
|
|
665
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
667
666
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
668
667
|
__metadata("design:type", Function),
|
|
669
668
|
__metadata("design:paramtypes", [Object, Object]),
|
|
670
669
|
__metadata("design:returntype", Promise)
|
|
671
670
|
], ProductModuleService.prototype, "createCategory", null);
|
|
672
671
|
__decorate([
|
|
673
|
-
(0, utils_1.InjectTransactionManager)(
|
|
672
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
674
673
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
675
674
|
__metadata("design:type", Function),
|
|
676
675
|
__metadata("design:paramtypes", [String, Object, Object]),
|
|
677
676
|
__metadata("design:returntype", Promise)
|
|
678
677
|
], ProductModuleService.prototype, "updateCategory", null);
|
|
679
678
|
__decorate([
|
|
680
|
-
(0, utils_1.InjectTransactionManager)(
|
|
679
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
681
680
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
682
681
|
__metadata("design:type", Function),
|
|
683
682
|
__metadata("design:paramtypes", [String, Object]),
|
|
@@ -691,34 +690,47 @@ __decorate([
|
|
|
691
690
|
__metadata("design:returntype", Promise)
|
|
692
691
|
], ProductModuleService.prototype, "listAndCountCategories", null);
|
|
693
692
|
__decorate([
|
|
693
|
+
(0, utils_1.InjectManager)("baseRepository_"),
|
|
694
|
+
__metadata("design:type", Function),
|
|
695
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
696
|
+
__metadata("design:returntype", Promise)
|
|
697
|
+
], ProductModuleService.prototype, "create", null);
|
|
698
|
+
__decorate([
|
|
699
|
+
(0, utils_1.InjectManager)("baseRepository_"),
|
|
694
700
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
695
701
|
__metadata("design:type", Function),
|
|
696
702
|
__metadata("design:paramtypes", [Array, Object]),
|
|
697
703
|
__metadata("design:returntype", Promise)
|
|
698
704
|
], ProductModuleService.prototype, "update", null);
|
|
699
705
|
__decorate([
|
|
700
|
-
(0, utils_1.InjectTransactionManager)(
|
|
706
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
701
707
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
702
708
|
__metadata("design:type", Function),
|
|
703
709
|
__metadata("design:paramtypes", [Array, Object]),
|
|
704
710
|
__metadata("design:returntype", Promise)
|
|
705
711
|
], ProductModuleService.prototype, "create_", null);
|
|
706
712
|
__decorate([
|
|
707
|
-
(0, utils_1.InjectTransactionManager)(
|
|
713
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
708
714
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
709
715
|
__metadata("design:type", Function),
|
|
710
716
|
__metadata("design:paramtypes", [Array, Object]),
|
|
711
717
|
__metadata("design:returntype", Promise)
|
|
712
718
|
], ProductModuleService.prototype, "update_", null);
|
|
713
719
|
__decorate([
|
|
714
|
-
(0, utils_1.InjectTransactionManager)(
|
|
720
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
715
721
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
716
722
|
__metadata("design:type", Function),
|
|
717
723
|
__metadata("design:paramtypes", [Array, Object]),
|
|
718
724
|
__metadata("design:returntype", Promise)
|
|
719
725
|
], ProductModuleService.prototype, "delete", null);
|
|
720
726
|
__decorate([
|
|
721
|
-
(0, utils_1.
|
|
727
|
+
(0, utils_1.InjectManager)("baseRepository_"),
|
|
728
|
+
__metadata("design:type", Function),
|
|
729
|
+
__metadata("design:paramtypes", [Array, Object, Object]),
|
|
730
|
+
__metadata("design:returntype", Promise)
|
|
731
|
+
], ProductModuleService.prototype, "softDelete", null);
|
|
732
|
+
__decorate([
|
|
733
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
722
734
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
723
735
|
__metadata("design:type", Function),
|
|
724
736
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -726,13 +738,19 @@ __decorate([
|
|
|
726
738
|
], ProductModuleService.prototype, "softDelete_", null);
|
|
727
739
|
__decorate([
|
|
728
740
|
(0, utils_1.InjectManager)("baseRepository_"),
|
|
741
|
+
__metadata("design:type", Function),
|
|
742
|
+
__metadata("design:paramtypes", [Array, Object, Object]),
|
|
743
|
+
__metadata("design:returntype", Promise)
|
|
744
|
+
], ProductModuleService.prototype, "restore", null);
|
|
745
|
+
__decorate([
|
|
746
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
729
747
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
730
748
|
__metadata("design:type", Function),
|
|
731
749
|
__metadata("design:paramtypes", [Array, Object, Object]),
|
|
732
750
|
__metadata("design:returntype", Promise)
|
|
733
751
|
], ProductModuleService.prototype, "restoreVariants", null);
|
|
734
752
|
__decorate([
|
|
735
|
-
(0, utils_1.InjectTransactionManager)(
|
|
753
|
+
(0, utils_1.InjectTransactionManager)("baseRepository_"),
|
|
736
754
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
737
755
|
__metadata("design:type", Function),
|
|
738
756
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -13,5 +13,6 @@ export default class ProductOptionService<TEntity extends ProductOption = Produc
|
|
|
13
13
|
create(data: ProductTypes.CreateProductOptionOnlyDTO[], sharedContext?: Context): Promise<TEntity[]>;
|
|
14
14
|
update(data: ProductTypes.UpdateProductOptionDTO[], sharedContext?: Context): Promise<TEntity[]>;
|
|
15
15
|
delete(ids: string[], sharedContext?: Context): Promise<void>;
|
|
16
|
+
upsert(data: ProductTypes.CreateProductOptionDTO[] | ProductTypes.UpdateProductOptionDTO[], sharedContext?: Context): Promise<TEntity[]>;
|
|
16
17
|
}
|
|
17
18
|
export {};
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const _models_1 = require("../models");
|
|
16
16
|
const types_1 = require("@medusajs/types");
|
|
17
17
|
const utils_1 = require("@medusajs/utils");
|
|
18
|
-
const utils_2 = require("../utils");
|
|
19
18
|
class ProductOptionService {
|
|
20
19
|
constructor({ productOptionRepository }) {
|
|
21
20
|
this.productOptionRepository_ =
|
|
@@ -54,6 +53,10 @@ class ProductOptionService {
|
|
|
54
53
|
async delete(ids, sharedContext = {}) {
|
|
55
54
|
return await this.productOptionRepository_.delete(ids, sharedContext);
|
|
56
55
|
}
|
|
56
|
+
async upsert(data, sharedContext = {}) {
|
|
57
|
+
return (await this.productOptionRepository_
|
|
58
|
+
.upsert(data, sharedContext));
|
|
59
|
+
}
|
|
57
60
|
}
|
|
58
61
|
exports.default = ProductOptionService;
|
|
59
62
|
__decorate([
|
|
@@ -78,23 +81,30 @@ __decorate([
|
|
|
78
81
|
__metadata("design:returntype", Promise)
|
|
79
82
|
], ProductOptionService.prototype, "listAndCount", null);
|
|
80
83
|
__decorate([
|
|
81
|
-
(0, utils_1.InjectTransactionManager)(
|
|
84
|
+
(0, utils_1.InjectTransactionManager)("productOptionRepository_"),
|
|
82
85
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
83
86
|
__metadata("design:type", Function),
|
|
84
87
|
__metadata("design:paramtypes", [Array, Object]),
|
|
85
88
|
__metadata("design:returntype", Promise)
|
|
86
89
|
], ProductOptionService.prototype, "create", null);
|
|
87
90
|
__decorate([
|
|
88
|
-
(0, utils_1.InjectTransactionManager)(
|
|
91
|
+
(0, utils_1.InjectTransactionManager)("productOptionRepository_"),
|
|
89
92
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
90
93
|
__metadata("design:type", Function),
|
|
91
94
|
__metadata("design:paramtypes", [Array, Object]),
|
|
92
95
|
__metadata("design:returntype", Promise)
|
|
93
96
|
], ProductOptionService.prototype, "update", null);
|
|
94
97
|
__decorate([
|
|
95
|
-
(0, utils_1.InjectTransactionManager)(
|
|
98
|
+
(0, utils_1.InjectTransactionManager)("productOptionRepository_"),
|
|
96
99
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
97
100
|
__metadata("design:type", Function),
|
|
98
101
|
__metadata("design:paramtypes", [Array, Object]),
|
|
99
102
|
__metadata("design:returntype", Promise)
|
|
100
103
|
], ProductOptionService.prototype, "delete", null);
|
|
104
|
+
__decorate([
|
|
105
|
+
(0, utils_1.InjectTransactionManager)("productOptionRepository_"),
|
|
106
|
+
__param(1, (0, utils_1.MedusaContext)()),
|
|
107
|
+
__metadata("design:type", Function),
|
|
108
|
+
__metadata("design:paramtypes", [Array, Object]),
|
|
109
|
+
__metadata("design:returntype", Promise)
|
|
110
|
+
], ProductOptionService.prototype, "upsert", null);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProductTag } from "../models";
|
|
2
|
-
import { Context, CreateProductTagDTO,
|
|
2
|
+
import { Context, CreateProductTagDTO, DAL, FindConfig, ProductTypes, UpdateProductTagDTO, UpsertProductTagDTO } from "@medusajs/types";
|
|
3
3
|
type InjectedDependencies = {
|
|
4
4
|
productTagRepository: DAL.RepositoryService;
|
|
5
5
|
};
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const _models_1 = require("../models");
|
|
16
16
|
const types_1 = require("@medusajs/types");
|
|
17
17
|
const utils_1 = require("@medusajs/utils");
|
|
18
|
-
const utils_2 = require("../utils");
|
|
19
18
|
class ProductTagService {
|
|
20
19
|
constructor({ productTagRepository }) {
|
|
21
20
|
this.productTagRepository_ = productTagRepository;
|
|
@@ -78,28 +77,28 @@ __decorate([
|
|
|
78
77
|
__metadata("design:returntype", Promise)
|
|
79
78
|
], ProductTagService.prototype, "listAndCount", null);
|
|
80
79
|
__decorate([
|
|
81
|
-
(0, utils_1.InjectTransactionManager)(
|
|
80
|
+
(0, utils_1.InjectTransactionManager)("productTagRepository_"),
|
|
82
81
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
83
82
|
__metadata("design:type", Function),
|
|
84
83
|
__metadata("design:paramtypes", [Array, Object]),
|
|
85
84
|
__metadata("design:returntype", Promise)
|
|
86
85
|
], ProductTagService.prototype, "create", null);
|
|
87
86
|
__decorate([
|
|
88
|
-
(0, utils_1.InjectTransactionManager)(
|
|
87
|
+
(0, utils_1.InjectTransactionManager)("productTagRepository_"),
|
|
89
88
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
90
89
|
__metadata("design:type", Function),
|
|
91
90
|
__metadata("design:paramtypes", [Array, Object]),
|
|
92
91
|
__metadata("design:returntype", Promise)
|
|
93
92
|
], ProductTagService.prototype, "update", null);
|
|
94
93
|
__decorate([
|
|
95
|
-
(0, utils_1.InjectTransactionManager)(
|
|
94
|
+
(0, utils_1.InjectTransactionManager)("productTagRepository_"),
|
|
96
95
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
97
96
|
__metadata("design:type", Function),
|
|
98
97
|
__metadata("design:paramtypes", [Array, Object]),
|
|
99
98
|
__metadata("design:returntype", Promise)
|
|
100
99
|
], ProductTagService.prototype, "delete", null);
|
|
101
100
|
__decorate([
|
|
102
|
-
(0, utils_1.InjectTransactionManager)(
|
|
101
|
+
(0, utils_1.InjectTransactionManager)("productTagRepository_"),
|
|
103
102
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
104
103
|
__metadata("design:type", Function),
|
|
105
104
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ProductType } from "../models";
|
|
2
|
-
import { Context, CreateProductTypeDTO,
|
|
2
|
+
import { Context, CreateProductTypeDTO, DAL, FindConfig, ProductTypes, UpdateProductTypeDTO, UpsertProductTypeDTO } from "@medusajs/types";
|
|
3
3
|
type InjectedDependencies = {
|
|
4
4
|
productTypeRepository: DAL.RepositoryService;
|
|
5
5
|
};
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const _models_1 = require("../models");
|
|
16
16
|
const types_1 = require("@medusajs/types");
|
|
17
17
|
const utils_1 = require("@medusajs/utils");
|
|
18
|
-
const utils_2 = require("../utils");
|
|
19
18
|
class ProductTypeService {
|
|
20
19
|
constructor({ productTypeRepository }) {
|
|
21
20
|
this.productTypeRepository_ = productTypeRepository;
|
|
@@ -79,28 +78,28 @@ __decorate([
|
|
|
79
78
|
__metadata("design:returntype", Promise)
|
|
80
79
|
], ProductTypeService.prototype, "listAndCount", null);
|
|
81
80
|
__decorate([
|
|
82
|
-
(0, utils_1.InjectTransactionManager)(
|
|
81
|
+
(0, utils_1.InjectTransactionManager)("productTypeRepository_"),
|
|
83
82
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
84
83
|
__metadata("design:type", Function),
|
|
85
84
|
__metadata("design:paramtypes", [Array, Object]),
|
|
86
85
|
__metadata("design:returntype", Promise)
|
|
87
86
|
], ProductTypeService.prototype, "upsert", null);
|
|
88
87
|
__decorate([
|
|
89
|
-
(0, utils_1.InjectTransactionManager)(
|
|
88
|
+
(0, utils_1.InjectTransactionManager)("productTypeRepository_"),
|
|
90
89
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
91
90
|
__metadata("design:type", Function),
|
|
92
91
|
__metadata("design:paramtypes", [Array, Object]),
|
|
93
92
|
__metadata("design:returntype", Promise)
|
|
94
93
|
], ProductTypeService.prototype, "create", null);
|
|
95
94
|
__decorate([
|
|
96
|
-
(0, utils_1.InjectTransactionManager)(
|
|
95
|
+
(0, utils_1.InjectTransactionManager)("productTypeRepository_"),
|
|
97
96
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
98
97
|
__metadata("design:type", Function),
|
|
99
98
|
__metadata("design:paramtypes", [Array, Object]),
|
|
100
99
|
__metadata("design:returntype", Promise)
|
|
101
100
|
], ProductTypeService.prototype, "update", null);
|
|
102
101
|
__decorate([
|
|
103
|
-
(0, utils_1.InjectTransactionManager)(
|
|
102
|
+
(0, utils_1.InjectTransactionManager)("productTypeRepository_"),
|
|
104
103
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
105
104
|
__metadata("design:type", Function),
|
|
106
105
|
__metadata("design:paramtypes", [Array, Object]),
|
|
@@ -15,7 +15,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
const _models_1 = require("../models");
|
|
16
16
|
const types_1 = require("@medusajs/types");
|
|
17
17
|
const utils_1 = require("@medusajs/utils");
|
|
18
|
-
const utils_2 = require("../utils");
|
|
19
18
|
class ProductVariantService {
|
|
20
19
|
constructor({ productVariantRepository, productService, }) {
|
|
21
20
|
this.productVariantRepository_ = productVariantRepository;
|
|
@@ -105,35 +104,35 @@ __decorate([
|
|
|
105
104
|
__metadata("design:returntype", Promise)
|
|
106
105
|
], ProductVariantService.prototype, "listAndCount", null);
|
|
107
106
|
__decorate([
|
|
108
|
-
(0, utils_1.InjectTransactionManager)(
|
|
107
|
+
(0, utils_1.InjectTransactionManager)("productVariantRepository_"),
|
|
109
108
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
110
109
|
__metadata("design:type", Function),
|
|
111
110
|
__metadata("design:paramtypes", [Object, Array, Object]),
|
|
112
111
|
__metadata("design:returntype", Promise)
|
|
113
112
|
], ProductVariantService.prototype, "create", null);
|
|
114
113
|
__decorate([
|
|
115
|
-
(0, utils_1.InjectTransactionManager)(
|
|
114
|
+
(0, utils_1.InjectTransactionManager)("productVariantRepository_"),
|
|
116
115
|
__param(2, (0, utils_1.MedusaContext)()),
|
|
117
116
|
__metadata("design:type", Function),
|
|
118
117
|
__metadata("design:paramtypes", [Object, Array, Object]),
|
|
119
118
|
__metadata("design:returntype", Promise)
|
|
120
119
|
], ProductVariantService.prototype, "update", null);
|
|
121
120
|
__decorate([
|
|
122
|
-
(0, utils_1.InjectTransactionManager)(
|
|
121
|
+
(0, utils_1.InjectTransactionManager)("productVariantRepository_"),
|
|
123
122
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
124
123
|
__metadata("design:type", Function),
|
|
125
124
|
__metadata("design:paramtypes", [Array, Object]),
|
|
126
125
|
__metadata("design:returntype", Promise)
|
|
127
126
|
], ProductVariantService.prototype, "delete", null);
|
|
128
127
|
__decorate([
|
|
129
|
-
(0, utils_1.InjectTransactionManager)(
|
|
128
|
+
(0, utils_1.InjectTransactionManager)("productVariantRepository_"),
|
|
130
129
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
131
130
|
__metadata("design:type", Function),
|
|
132
131
|
__metadata("design:paramtypes", [Array, Object]),
|
|
133
132
|
__metadata("design:returntype", Promise)
|
|
134
133
|
], ProductVariantService.prototype, "softDelete", null);
|
|
135
134
|
__decorate([
|
|
136
|
-
(0, utils_1.InjectTransactionManager)(
|
|
135
|
+
(0, utils_1.InjectTransactionManager)("productVariantRepository_"),
|
|
137
136
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
138
137
|
__metadata("design:type", Function),
|
|
139
138
|
__metadata("design:paramtypes", [Array, Object]),
|
package/dist/services/product.js
CHANGED
|
@@ -14,7 +14,6 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const types_1 = require("@medusajs/types");
|
|
16
16
|
const utils_1 = require("@medusajs/utils");
|
|
17
|
-
const utils_2 = require("../utils");
|
|
18
17
|
class ProductService {
|
|
19
18
|
constructor({ productRepository }) {
|
|
20
19
|
this.productRepository_ = productRepository;
|
|
@@ -118,35 +117,35 @@ __decorate([
|
|
|
118
117
|
__metadata("design:returntype", Promise)
|
|
119
118
|
], ProductService.prototype, "listAndCount", null);
|
|
120
119
|
__decorate([
|
|
121
|
-
(0, utils_1.InjectTransactionManager)(
|
|
120
|
+
(0, utils_1.InjectTransactionManager)("productRepository_"),
|
|
122
121
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
123
122
|
__metadata("design:type", Function),
|
|
124
123
|
__metadata("design:paramtypes", [Array, Object]),
|
|
125
124
|
__metadata("design:returntype", Promise)
|
|
126
125
|
], ProductService.prototype, "create", null);
|
|
127
126
|
__decorate([
|
|
128
|
-
(0, utils_1.InjectTransactionManager)(
|
|
127
|
+
(0, utils_1.InjectTransactionManager)("productRepository_"),
|
|
129
128
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
130
129
|
__metadata("design:type", Function),
|
|
131
130
|
__metadata("design:paramtypes", [Array, Object]),
|
|
132
131
|
__metadata("design:returntype", Promise)
|
|
133
132
|
], ProductService.prototype, "update", null);
|
|
134
133
|
__decorate([
|
|
135
|
-
(0, utils_1.InjectTransactionManager)(
|
|
134
|
+
(0, utils_1.InjectTransactionManager)("productRepository_"),
|
|
136
135
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
137
136
|
__metadata("design:type", Function),
|
|
138
137
|
__metadata("design:paramtypes", [Array, Object]),
|
|
139
138
|
__metadata("design:returntype", Promise)
|
|
140
139
|
], ProductService.prototype, "delete", null);
|
|
141
140
|
__decorate([
|
|
142
|
-
(0, utils_1.InjectTransactionManager)(
|
|
141
|
+
(0, utils_1.InjectTransactionManager)("productRepository_"),
|
|
143
142
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
144
143
|
__metadata("design:type", Function),
|
|
145
144
|
__metadata("design:paramtypes", [Array, Object]),
|
|
146
145
|
__metadata("design:returntype", Promise)
|
|
147
146
|
], ProductService.prototype, "softDelete", null);
|
|
148
147
|
__decorate([
|
|
149
|
-
(0, utils_1.InjectTransactionManager)(
|
|
148
|
+
(0, utils_1.InjectTransactionManager)("productRepository_"),
|
|
150
149
|
__param(1, (0, utils_1.MedusaContext)()),
|
|
151
150
|
__metadata("design:type", Function),
|
|
152
151
|
__metadata("design:paramtypes", [Array, Object]),
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function shouldForceTransaction(
|
|
1
|
+
export declare function shouldForceTransaction(): boolean;
|
|
2
2
|
export declare function doNotForceTransaction(): boolean;
|
package/dist/utils/index.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.doNotForceTransaction = exports.shouldForceTransaction = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return target.moduleDeclaration?.resources === types_1.MODULE_RESOURCE_TYPE.ISOLATED;
|
|
4
|
+
function shouldForceTransaction() {
|
|
5
|
+
return true;
|
|
7
6
|
}
|
|
8
7
|
exports.shouldForceTransaction = shouldForceTransaction;
|
|
9
8
|
function doNotForceTransaction() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medusajs/product",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3-next-20231109084604",
|
|
4
4
|
"description": "Medusa Product module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"typescript": "^5.1.6"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@medusajs/modules-sdk": "
|
|
53
|
-
"@medusajs/types": "
|
|
54
|
-
"@medusajs/utils": "
|
|
52
|
+
"@medusajs/modules-sdk": "1.12.3-next-20231109084604",
|
|
53
|
+
"@medusajs/types": "1.11.6-next-20231109084604",
|
|
54
|
+
"@medusajs/utils": "1.10.5-next-20231109084604",
|
|
55
55
|
"@mikro-orm/core": "5.7.12",
|
|
56
56
|
"@mikro-orm/migrations": "5.7.12",
|
|
57
57
|
"@mikro-orm/postgresql": "5.7.12",
|