@hed-hog/catalog 0.0.292 → 0.0.293
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/hedhog/data/menu.yaml +233 -233
- package/hedhog/data/role.yaml +7 -7
- package/hedhog/data/route.yaml +56 -56
- package/hedhog/table/catalog_affiliate_program.yaml +41 -41
- package/hedhog/table/catalog_attribute.yaml +53 -53
- package/hedhog/table/catalog_attribute_group.yaml +18 -18
- package/hedhog/table/catalog_brand.yaml +34 -34
- package/hedhog/table/catalog_category_attribute.yaml +36 -36
- package/hedhog/table/catalog_click_event.yaml +50 -50
- package/hedhog/table/catalog_comparison.yaml +65 -65
- package/hedhog/table/catalog_comparison_highlight.yaml +39 -39
- package/hedhog/table/catalog_comparison_item.yaml +30 -30
- package/hedhog/table/catalog_content_relation.yaml +42 -42
- package/hedhog/table/catalog_import_run.yaml +33 -33
- package/hedhog/table/catalog_import_source.yaml +24 -24
- package/hedhog/table/catalog_merchant.yaml +29 -29
- package/hedhog/table/catalog_offer.yaml +83 -83
- package/hedhog/table/catalog_price_history.yaml +34 -34
- package/hedhog/table/catalog_product.yaml +76 -76
- package/hedhog/table/catalog_product_attribute_value.yaml +60 -60
- package/hedhog/table/catalog_product_category.yaml +26 -26
- package/hedhog/table/catalog_product_image.yaml +34 -34
- package/hedhog/table/catalog_product_score.yaml +38 -38
- package/hedhog/table/catalog_product_site.yaml +47 -47
- package/hedhog/table/catalog_product_tag.yaml +19 -19
- package/hedhog/table/catalog_score_criterion.yaml +37 -37
- package/hedhog/table/catalog_seo_page_rule.yaml +51 -51
- package/hedhog/table/catalog_similarity_rule.yaml +28 -28
- package/hedhog/table/catalog_site.yaml +40 -40
- package/hedhog/table/catalog_site_category.yaml +26 -26
- package/package.json +5 -5
- package/src/catalog.controller.ts +82 -82
- package/src/catalog.module.ts +12 -12
- package/src/index.ts +1 -1
- package/src/language/en.json +4 -4
- package/src/language/pt.json +4 -4
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: slug
|
|
4
|
-
type: varchar
|
|
5
|
-
length: 255
|
|
6
|
-
- name: name
|
|
7
|
-
type: varchar
|
|
8
|
-
length: 255
|
|
9
|
-
- name: domain
|
|
10
|
-
type: varchar
|
|
11
|
-
length: 255
|
|
12
|
-
- name: status
|
|
13
|
-
type: enum
|
|
14
|
-
values: [active, inactive]
|
|
15
|
-
default: active
|
|
16
|
-
- name: site_type
|
|
17
|
-
type: enum
|
|
18
|
-
values: [portal, niche, tenant]
|
|
19
|
-
default: portal
|
|
20
|
-
- name: default_locale_id
|
|
21
|
-
type: fk
|
|
22
|
-
references:
|
|
23
|
-
table: locale
|
|
24
|
-
column: id
|
|
25
|
-
onDelete: RESTRICT
|
|
26
|
-
- name: theme_settings_json
|
|
27
|
-
type: json
|
|
28
|
-
isNullable: true
|
|
29
|
-
- name: seo_defaults_json
|
|
30
|
-
type: json
|
|
31
|
-
isNullable: true
|
|
32
|
-
- type: created_at
|
|
33
|
-
- type: updated_at
|
|
34
|
-
indices:
|
|
35
|
-
- columns: [slug]
|
|
36
|
-
isUnique: true
|
|
37
|
-
- columns: [domain]
|
|
38
|
-
isUnique: true
|
|
39
|
-
- columns: [status]
|
|
40
|
-
- columns: [default_locale_id]
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: slug
|
|
4
|
+
type: varchar
|
|
5
|
+
length: 255
|
|
6
|
+
- name: name
|
|
7
|
+
type: varchar
|
|
8
|
+
length: 255
|
|
9
|
+
- name: domain
|
|
10
|
+
type: varchar
|
|
11
|
+
length: 255
|
|
12
|
+
- name: status
|
|
13
|
+
type: enum
|
|
14
|
+
values: [active, inactive]
|
|
15
|
+
default: active
|
|
16
|
+
- name: site_type
|
|
17
|
+
type: enum
|
|
18
|
+
values: [portal, niche, tenant]
|
|
19
|
+
default: portal
|
|
20
|
+
- name: default_locale_id
|
|
21
|
+
type: fk
|
|
22
|
+
references:
|
|
23
|
+
table: locale
|
|
24
|
+
column: id
|
|
25
|
+
onDelete: RESTRICT
|
|
26
|
+
- name: theme_settings_json
|
|
27
|
+
type: json
|
|
28
|
+
isNullable: true
|
|
29
|
+
- name: seo_defaults_json
|
|
30
|
+
type: json
|
|
31
|
+
isNullable: true
|
|
32
|
+
- type: created_at
|
|
33
|
+
- type: updated_at
|
|
34
|
+
indices:
|
|
35
|
+
- columns: [slug]
|
|
36
|
+
isUnique: true
|
|
37
|
+
- columns: [domain]
|
|
38
|
+
isUnique: true
|
|
39
|
+
- columns: [status]
|
|
40
|
+
- columns: [default_locale_id]
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
columns:
|
|
2
|
-
- type: pk
|
|
3
|
-
- name: site_id
|
|
4
|
-
type: fk
|
|
5
|
-
references:
|
|
6
|
-
table: catalog_site
|
|
7
|
-
column: id
|
|
8
|
-
onDelete: CASCADE
|
|
9
|
-
- name: category_id
|
|
10
|
-
type: fk
|
|
11
|
-
references:
|
|
12
|
-
table: category
|
|
13
|
-
column: id
|
|
14
|
-
onDelete: CASCADE
|
|
15
|
-
- name: is_primary
|
|
16
|
-
type: boolean
|
|
17
|
-
default: false
|
|
18
|
-
- name: visibility_status
|
|
19
|
-
type: enum
|
|
20
|
-
values: [visible, hidden]
|
|
21
|
-
default: visible
|
|
22
|
-
- type: created_at
|
|
23
|
-
- type: updated_at
|
|
24
|
-
indices:
|
|
25
|
-
- columns: [site_id, category_id]
|
|
26
|
-
isUnique: true
|
|
1
|
+
columns:
|
|
2
|
+
- type: pk
|
|
3
|
+
- name: site_id
|
|
4
|
+
type: fk
|
|
5
|
+
references:
|
|
6
|
+
table: catalog_site
|
|
7
|
+
column: id
|
|
8
|
+
onDelete: CASCADE
|
|
9
|
+
- name: category_id
|
|
10
|
+
type: fk
|
|
11
|
+
references:
|
|
12
|
+
table: category
|
|
13
|
+
column: id
|
|
14
|
+
onDelete: CASCADE
|
|
15
|
+
- name: is_primary
|
|
16
|
+
type: boolean
|
|
17
|
+
default: false
|
|
18
|
+
- name: visibility_status
|
|
19
|
+
type: enum
|
|
20
|
+
values: [visible, hidden]
|
|
21
|
+
default: visible
|
|
22
|
+
- type: created_at
|
|
23
|
+
- type: updated_at
|
|
24
|
+
indices:
|
|
25
|
+
- columns: [site_id, category_id]
|
|
26
|
+
isUnique: true
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hed-hog/catalog",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.293",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"@nestjs/jwt": "^11",
|
|
11
11
|
"@nestjs/mapped-types": "*",
|
|
12
12
|
"@hed-hog/api": "0.0.4",
|
|
13
|
+
"@hed-hog/core": "0.0.293",
|
|
13
14
|
"@hed-hog/api-locale": "0.0.13",
|
|
14
15
|
"@hed-hog/api-pagination": "0.0.6",
|
|
15
|
-
"@hed-hog/category": "0.0.292",
|
|
16
16
|
"@hed-hog/api-prisma": "0.0.5",
|
|
17
|
-
"@hed-hog/
|
|
18
|
-
"@hed-hog/
|
|
19
|
-
"@hed-hog/
|
|
17
|
+
"@hed-hog/category": "0.0.293",
|
|
18
|
+
"@hed-hog/tag": "0.0.293",
|
|
19
|
+
"@hed-hog/content": "0.0.293"
|
|
20
20
|
},
|
|
21
21
|
"exports": {
|
|
22
22
|
".": {
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
import { Role } from '@hed-hog/api';
|
|
2
|
-
import { Locale } from '@hed-hog/api-locale';
|
|
3
|
-
import { Pagination } from '@hed-hog/api-pagination';
|
|
4
|
-
import {
|
|
5
|
-
Body,
|
|
6
|
-
Controller,
|
|
7
|
-
Delete,
|
|
8
|
-
Get,
|
|
9
|
-
Param,
|
|
10
|
-
ParseIntPipe,
|
|
11
|
-
Patch,
|
|
12
|
-
Post,
|
|
13
|
-
Query,
|
|
14
|
-
} from '@nestjs/common';
|
|
15
|
-
import { CatalogService } from './catalog.service';
|
|
16
|
-
|
|
17
|
-
@Role()
|
|
18
|
-
@Controller('catalog')
|
|
19
|
-
export class CatalogController {
|
|
20
|
-
constructor(private readonly catalogService: CatalogService) {}
|
|
21
|
-
|
|
22
|
-
@Get('products/:id/images')
|
|
23
|
-
async listProductImages(
|
|
24
|
-
@Param('id', ParseIntPipe) id: number,
|
|
25
|
-
@Pagination() paginationParams,
|
|
26
|
-
@Locale() locale: string,
|
|
27
|
-
) {
|
|
28
|
-
return this.catalogService.listProductImages(id, locale, paginationParams);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@Get(':resource/stats')
|
|
32
|
-
async stats(@Param('resource') resource: string, @Locale() locale: string) {
|
|
33
|
-
return this.catalogService.stats(resource, locale);
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@Get(':resource/:id')
|
|
37
|
-
async getById(
|
|
38
|
-
@Param('resource') resource: string,
|
|
39
|
-
@Param('id', ParseIntPipe) id: number,
|
|
40
|
-
@Locale() locale: string,
|
|
41
|
-
) {
|
|
42
|
-
return this.catalogService.getById(resource, id, locale);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
@Patch(':resource/:id')
|
|
46
|
-
async update(
|
|
47
|
-
@Param('resource') resource: string,
|
|
48
|
-
@Param('id', ParseIntPipe) id: number,
|
|
49
|
-
@Body() body: Record<string, unknown>,
|
|
50
|
-
@Locale() locale: string,
|
|
51
|
-
) {
|
|
52
|
-
return this.catalogService.update(resource, id, body, locale);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
@Delete(':resource/:id')
|
|
56
|
-
async delete(
|
|
57
|
-
@Param('resource') resource: string,
|
|
58
|
-
@Param('id', ParseIntPipe) id: number,
|
|
59
|
-
@Locale() locale: string,
|
|
60
|
-
) {
|
|
61
|
-
return this.catalogService.delete(resource, id, locale);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
@Get(':resource')
|
|
65
|
-
async list(
|
|
66
|
-
@Param('resource') resource: string,
|
|
67
|
-
@Pagination() paginationParams,
|
|
68
|
-
@Query() query: Record<string, unknown>,
|
|
69
|
-
@Locale() locale: string,
|
|
70
|
-
) {
|
|
71
|
-
return this.catalogService.list(resource, locale, paginationParams, query);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@Post(':resource')
|
|
75
|
-
async create(
|
|
76
|
-
@Param('resource') resource: string,
|
|
77
|
-
@Body() body: Record<string, unknown>,
|
|
78
|
-
@Locale() locale: string,
|
|
79
|
-
) {
|
|
80
|
-
return this.catalogService.create(resource, body, locale);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
1
|
+
import { Role } from '@hed-hog/api';
|
|
2
|
+
import { Locale } from '@hed-hog/api-locale';
|
|
3
|
+
import { Pagination } from '@hed-hog/api-pagination';
|
|
4
|
+
import {
|
|
5
|
+
Body,
|
|
6
|
+
Controller,
|
|
7
|
+
Delete,
|
|
8
|
+
Get,
|
|
9
|
+
Param,
|
|
10
|
+
ParseIntPipe,
|
|
11
|
+
Patch,
|
|
12
|
+
Post,
|
|
13
|
+
Query,
|
|
14
|
+
} from '@nestjs/common';
|
|
15
|
+
import { CatalogService } from './catalog.service';
|
|
16
|
+
|
|
17
|
+
@Role()
|
|
18
|
+
@Controller('catalog')
|
|
19
|
+
export class CatalogController {
|
|
20
|
+
constructor(private readonly catalogService: CatalogService) {}
|
|
21
|
+
|
|
22
|
+
@Get('products/:id/images')
|
|
23
|
+
async listProductImages(
|
|
24
|
+
@Param('id', ParseIntPipe) id: number,
|
|
25
|
+
@Pagination() paginationParams,
|
|
26
|
+
@Locale() locale: string,
|
|
27
|
+
) {
|
|
28
|
+
return this.catalogService.listProductImages(id, locale, paginationParams);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
@Get(':resource/stats')
|
|
32
|
+
async stats(@Param('resource') resource: string, @Locale() locale: string) {
|
|
33
|
+
return this.catalogService.stats(resource, locale);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@Get(':resource/:id')
|
|
37
|
+
async getById(
|
|
38
|
+
@Param('resource') resource: string,
|
|
39
|
+
@Param('id', ParseIntPipe) id: number,
|
|
40
|
+
@Locale() locale: string,
|
|
41
|
+
) {
|
|
42
|
+
return this.catalogService.getById(resource, id, locale);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
@Patch(':resource/:id')
|
|
46
|
+
async update(
|
|
47
|
+
@Param('resource') resource: string,
|
|
48
|
+
@Param('id', ParseIntPipe) id: number,
|
|
49
|
+
@Body() body: Record<string, unknown>,
|
|
50
|
+
@Locale() locale: string,
|
|
51
|
+
) {
|
|
52
|
+
return this.catalogService.update(resource, id, body, locale);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@Delete(':resource/:id')
|
|
56
|
+
async delete(
|
|
57
|
+
@Param('resource') resource: string,
|
|
58
|
+
@Param('id', ParseIntPipe) id: number,
|
|
59
|
+
@Locale() locale: string,
|
|
60
|
+
) {
|
|
61
|
+
return this.catalogService.delete(resource, id, locale);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@Get(':resource')
|
|
65
|
+
async list(
|
|
66
|
+
@Param('resource') resource: string,
|
|
67
|
+
@Pagination() paginationParams,
|
|
68
|
+
@Query() query: Record<string, unknown>,
|
|
69
|
+
@Locale() locale: string,
|
|
70
|
+
) {
|
|
71
|
+
return this.catalogService.list(resource, locale, paginationParams, query);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@Post(':resource')
|
|
75
|
+
async create(
|
|
76
|
+
@Param('resource') resource: string,
|
|
77
|
+
@Body() body: Record<string, unknown>,
|
|
78
|
+
@Locale() locale: string,
|
|
79
|
+
) {
|
|
80
|
+
return this.catalogService.create(resource, body, locale);
|
|
81
|
+
}
|
|
82
|
+
}
|
package/src/catalog.module.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { PaginationModule } from '@hed-hog/api-pagination';
|
|
2
|
-
import { Module, forwardRef } from '@nestjs/common';
|
|
3
|
-
import { CatalogController } from './catalog.controller';
|
|
4
|
-
import { CatalogService } from './catalog.service';
|
|
5
|
-
|
|
6
|
-
@Module({
|
|
7
|
-
imports: [forwardRef(() => PaginationModule)],
|
|
8
|
-
controllers: [CatalogController],
|
|
9
|
-
providers: [CatalogService],
|
|
10
|
-
exports: [CatalogService],
|
|
11
|
-
})
|
|
12
|
-
export class CatalogModule {}
|
|
1
|
+
import { PaginationModule } from '@hed-hog/api-pagination';
|
|
2
|
+
import { Module, forwardRef } from '@nestjs/common';
|
|
3
|
+
import { CatalogController } from './catalog.controller';
|
|
4
|
+
import { CatalogService } from './catalog.service';
|
|
5
|
+
|
|
6
|
+
@Module({
|
|
7
|
+
imports: [forwardRef(() => PaginationModule)],
|
|
8
|
+
controllers: [CatalogController],
|
|
9
|
+
providers: [CatalogService],
|
|
10
|
+
exports: [CatalogService],
|
|
11
|
+
})
|
|
12
|
+
export class CatalogModule {}
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './catalog.module';
|
|
1
|
+
export * from './catalog.module';
|
package/src/language/en.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"resourceNotSupported": "Catalog resource is not supported.",
|
|
3
|
-
"resourceNotFound": "Catalog resource not found."
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"resourceNotSupported": "Catalog resource is not supported.",
|
|
3
|
+
"resourceNotFound": "Catalog resource not found."
|
|
4
|
+
}
|
package/src/language/pt.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"resourceNotSupported": "Recurso do catálogo não é suportado.",
|
|
3
|
-
"resourceNotFound": "Recurso do catálogo não foi encontrado."
|
|
4
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"resourceNotSupported": "Recurso do catálogo não é suportado.",
|
|
3
|
+
"resourceNotFound": "Recurso do catálogo não foi encontrado."
|
|
4
|
+
}
|