breaking: move shared HTTP utils to the framework (#9402)
Fixes: FRMW-2728, FRMW-2729 After this PR gets merged the following middleware will be exported from the `@medusajs/framework/http` import path. - applyParamsAsFilters - clearFiltersByKey - applyDefaultFilters - setContext - getQueryConfig - httpCompression - maybeApplyLinkFilter - refetchEntities - unlessPath - validateBody - validateQuery Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
This commit is contained in:
co-authored by
Adrien de Peretti
parent
193f93464f
commit
48e00169d2
@@ -1,7 +1,5 @@
|
||||
{
|
||||
"namespaces": [
|
||||
"public"
|
||||
],
|
||||
"namespaces": ["public"],
|
||||
"name": "public",
|
||||
"tables": [
|
||||
{
|
||||
@@ -128,9 +126,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_category_deleted_at",
|
||||
"primary": false,
|
||||
@@ -138,9 +134,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_category_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -150,13 +144,9 @@
|
||||
"foreignKeys": {
|
||||
"product_category_parent_category_id_foreign": {
|
||||
"constraintName": "product_category_parent_category_id_foreign",
|
||||
"columnNames": [
|
||||
"parent_category_id"
|
||||
],
|
||||
"columnNames": ["parent_category_id"],
|
||||
"localTableName": "public.product_category",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_category",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -238,9 +228,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_collection_deleted_at",
|
||||
"primary": false,
|
||||
@@ -248,9 +236,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_collection_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -325,9 +311,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_image_deleted_at",
|
||||
"primary": false,
|
||||
@@ -335,9 +319,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "image_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -412,9 +394,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_tag_deleted_at",
|
||||
"primary": false,
|
||||
@@ -422,9 +402,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_tag_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -499,9 +477,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_type_deleted_at",
|
||||
"primary": false,
|
||||
@@ -509,9 +485,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_type_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -584,12 +558,7 @@
|
||||
"autoincrement": false,
|
||||
"primary": false,
|
||||
"nullable": false,
|
||||
"enumItems": [
|
||||
"draft",
|
||||
"proposed",
|
||||
"published",
|
||||
"rejected"
|
||||
],
|
||||
"enumItems": ["draft", "proposed", "published", "rejected"],
|
||||
"mappedType": "enum"
|
||||
},
|
||||
"thumbnail": {
|
||||
@@ -756,9 +725,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_deleted_at",
|
||||
"primary": false,
|
||||
@@ -766,9 +733,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -778,26 +743,18 @@
|
||||
"foreignKeys": {
|
||||
"product_collection_id_foreign": {
|
||||
"constraintName": "product_collection_id_foreign",
|
||||
"columnNames": [
|
||||
"collection_id"
|
||||
],
|
||||
"columnNames": ["collection_id"],
|
||||
"localTableName": "public.product",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_collection",
|
||||
"deleteRule": "set null",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"product_type_id_foreign": {
|
||||
"constraintName": "product_type_id_foreign",
|
||||
"columnNames": [
|
||||
"type_id"
|
||||
],
|
||||
"columnNames": ["type_id"],
|
||||
"localTableName": "public.product",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_type",
|
||||
"deleteRule": "set null",
|
||||
"updateRule": "cascade"
|
||||
@@ -879,9 +836,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_option_deleted_at",
|
||||
"primary": false,
|
||||
@@ -889,9 +844,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_option_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -901,13 +854,9 @@
|
||||
"foreignKeys": {
|
||||
"product_option_product_id_foreign": {
|
||||
"constraintName": "product_option_product_id_foreign",
|
||||
"columnNames": [
|
||||
"product_id"
|
||||
],
|
||||
"columnNames": ["product_id"],
|
||||
"localTableName": "public.product_option",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -989,9 +938,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_option_value_deleted_at",
|
||||
"primary": false,
|
||||
@@ -999,9 +946,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_option_value_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1011,13 +956,9 @@
|
||||
"foreignKeys": {
|
||||
"product_option_value_option_id_foreign": {
|
||||
"constraintName": "product_option_value_option_id_foreign",
|
||||
"columnNames": [
|
||||
"option_id"
|
||||
],
|
||||
"columnNames": ["option_id"],
|
||||
"localTableName": "public.product_option_value",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_option",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -1050,10 +991,7 @@
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "product_tags_pkey",
|
||||
"columnNames": [
|
||||
"product_id",
|
||||
"product_tag_id"
|
||||
],
|
||||
"columnNames": ["product_id", "product_tag_id"],
|
||||
"composite": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1063,26 +1001,18 @@
|
||||
"foreignKeys": {
|
||||
"product_tags_product_id_foreign": {
|
||||
"constraintName": "product_tags_product_id_foreign",
|
||||
"columnNames": [
|
||||
"product_id"
|
||||
],
|
||||
"columnNames": ["product_id"],
|
||||
"localTableName": "public.product_tags",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"product_tags_product_tag_id_foreign": {
|
||||
"constraintName": "product_tags_product_tag_id_foreign",
|
||||
"columnNames": [
|
||||
"product_tag_id"
|
||||
],
|
||||
"columnNames": ["product_tag_id"],
|
||||
"localTableName": "public.product_tags",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_tag",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -1115,10 +1045,7 @@
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "product_images_pkey",
|
||||
"columnNames": [
|
||||
"product_id",
|
||||
"image_id"
|
||||
],
|
||||
"columnNames": ["product_id", "image_id"],
|
||||
"composite": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1128,26 +1055,18 @@
|
||||
"foreignKeys": {
|
||||
"product_images_product_id_foreign": {
|
||||
"constraintName": "product_images_product_id_foreign",
|
||||
"columnNames": [
|
||||
"product_id"
|
||||
],
|
||||
"columnNames": ["product_id"],
|
||||
"localTableName": "public.product_images",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"product_images_image_id_foreign": {
|
||||
"constraintName": "product_images_image_id_foreign",
|
||||
"columnNames": [
|
||||
"image_id"
|
||||
],
|
||||
"columnNames": ["image_id"],
|
||||
"localTableName": "public.product_images",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.image",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -1180,10 +1099,7 @@
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "product_category_product_pkey",
|
||||
"columnNames": [
|
||||
"product_id",
|
||||
"product_category_id"
|
||||
],
|
||||
"columnNames": ["product_id", "product_category_id"],
|
||||
"composite": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1193,26 +1109,18 @@
|
||||
"foreignKeys": {
|
||||
"product_category_product_product_id_foreign": {
|
||||
"constraintName": "product_category_product_product_id_foreign",
|
||||
"columnNames": [
|
||||
"product_id"
|
||||
],
|
||||
"columnNames": ["product_id"],
|
||||
"localTableName": "public.product_category_product",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"product_category_product_product_category_id_foreign": {
|
||||
"constraintName": "product_category_product_product_category_id_foreign",
|
||||
"columnNames": [
|
||||
"product_category_id"
|
||||
],
|
||||
"columnNames": ["product_category_id"],
|
||||
"localTableName": "public.product_category_product",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_category",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -1432,9 +1340,7 @@
|
||||
"schema": "public",
|
||||
"indexes": [
|
||||
{
|
||||
"columnNames": [
|
||||
"deleted_at"
|
||||
],
|
||||
"columnNames": ["deleted_at"],
|
||||
"composite": false,
|
||||
"keyName": "IDX_product_variant_deleted_at",
|
||||
"primary": false,
|
||||
@@ -1442,9 +1348,7 @@
|
||||
},
|
||||
{
|
||||
"keyName": "product_variant_pkey",
|
||||
"columnNames": [
|
||||
"id"
|
||||
],
|
||||
"columnNames": ["id"],
|
||||
"composite": false,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1454,13 +1358,9 @@
|
||||
"foreignKeys": {
|
||||
"product_variant_product_id_foreign": {
|
||||
"constraintName": "product_variant_product_id_foreign",
|
||||
"columnNames": [
|
||||
"product_id"
|
||||
],
|
||||
"columnNames": ["product_id"],
|
||||
"localTableName": "public.product_variant",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
@@ -1493,10 +1393,7 @@
|
||||
"indexes": [
|
||||
{
|
||||
"keyName": "product_variant_option_pkey",
|
||||
"columnNames": [
|
||||
"variant_id",
|
||||
"option_value_id"
|
||||
],
|
||||
"columnNames": ["variant_id", "option_value_id"],
|
||||
"composite": true,
|
||||
"primary": true,
|
||||
"unique": true
|
||||
@@ -1506,26 +1403,18 @@
|
||||
"foreignKeys": {
|
||||
"product_variant_option_variant_id_foreign": {
|
||||
"constraintName": "product_variant_option_variant_id_foreign",
|
||||
"columnNames": [
|
||||
"variant_id"
|
||||
],
|
||||
"columnNames": ["variant_id"],
|
||||
"localTableName": "public.product_variant_option",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_variant",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
},
|
||||
"product_variant_option_option_value_id_foreign": {
|
||||
"constraintName": "product_variant_option_option_value_id_foreign",
|
||||
"columnNames": [
|
||||
"option_value_id"
|
||||
],
|
||||
"columnNames": ["option_value_id"],
|
||||
"localTableName": "public.product_variant_option",
|
||||
"referencedColumnNames": [
|
||||
"id"
|
||||
],
|
||||
"referencedColumnNames": ["id"],
|
||||
"referencedTableName": "public.product_option_value",
|
||||
"deleteRule": "cascade",
|
||||
"updateRule": "cascade"
|
||||
|
||||
@@ -4,12 +4,12 @@ export class Migration202408271511 extends Migration {
|
||||
async up(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "product_category" add column if not exists "metadata" jsonb;'
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
async down(): Promise<void> {
|
||||
this.addSql(
|
||||
'alter table if exists "product_category" drop column if exists "metadata";'
|
||||
);
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user