@sales-planner/shared 0.8.2 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dto.d.ts +68 -68
- package/dist/entities/api-keys.d.ts +11 -0
- package/dist/entities/api-keys.d.ts.map +1 -0
- package/dist/entities/api-keys.js +1 -0
- package/dist/entities/base.d.ts +14 -0
- package/dist/entities/base.d.ts.map +1 -0
- package/dist/entities/base.js +1 -0
- package/dist/entities/brands.d.ts +4 -0
- package/dist/entities/brands.d.ts.map +1 -0
- package/dist/entities/brands.js +1 -0
- package/dist/entities/index.d.ts +14 -0
- package/dist/entities/index.d.ts.map +1 -0
- package/dist/entities/index.js +13 -0
- package/dist/entities/marketplaces.d.ts +10 -0
- package/dist/entities/marketplaces.d.ts.map +1 -0
- package/dist/entities/marketplaces.js +1 -0
- package/dist/entities/roles.d.ts +8 -0
- package/dist/entities/roles.d.ts.map +1 -0
- package/dist/entities/roles.js +1 -0
- package/dist/entities/sales-history.d.ts +12 -0
- package/dist/entities/sales-history.d.ts.map +1 -0
- package/dist/entities/sales-history.js +1 -0
- package/dist/entities/shops.d.ts +8 -0
- package/dist/entities/shops.d.ts.map +1 -0
- package/dist/entities/shops.js +1 -0
- package/dist/entities/skus.d.ts +4 -0
- package/dist/entities/skus.d.ts.map +1 -0
- package/dist/entities/skus.js +1 -0
- package/dist/entities/tenants.d.ts +9 -0
- package/dist/entities/tenants.d.ts.map +1 -0
- package/dist/entities/tenants.js +1 -0
- package/dist/entities/users.d.ts +9 -0
- package/dist/entities/users.d.ts.map +1 -0
- package/dist/entities/users.js +1 -0
- package/dist/entities.d.ts +56 -58
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -2
- package/dist/metadata.d.ts +21 -0
- package/dist/metadata.d.ts.map +1 -0
- package/dist/metadata.js +96 -0
- package/dist/responses/export.d.ts +19 -0
- package/dist/responses/export.d.ts.map +1 -0
- package/dist/responses/export.js +1 -0
- package/dist/responses/import.d.ts +13 -0
- package/dist/responses/import.d.ts.map +1 -0
- package/dist/responses/import.js +1 -0
- package/dist/responses/index.d.ts +8 -0
- package/dist/responses/index.d.ts.map +1 -0
- package/dist/responses/index.js +7 -0
- package/dist/responses/tenants.d.ts +16 -0
- package/dist/responses/tenants.d.ts.map +1 -0
- package/dist/responses/tenants.js +1 -0
- package/dist/responses/users.d.ts +24 -0
- package/dist/responses/users.d.ts.map +1 -0
- package/dist/responses/users.js +1 -0
- package/dist/responses.d.ts +45 -45
- package/package.json +1 -1
package/dist/dto.d.ts
CHANGED
|
@@ -8,133 +8,133 @@
|
|
|
8
8
|
* - UpdateXRequest: HTTP update request (typically same as DTO)
|
|
9
9
|
*/
|
|
10
10
|
export interface CreateUserDto {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
email: string;
|
|
12
|
+
name: string;
|
|
13
|
+
default_shop_id?: number;
|
|
14
14
|
}
|
|
15
15
|
export type CreateUserRequest = CreateUserDto;
|
|
16
16
|
export interface UpdateUserDto {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
email?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
default_shop_id?: number | null;
|
|
20
20
|
}
|
|
21
21
|
export type UpdateUserRequest = UpdateUserDto;
|
|
22
22
|
export interface CreateTenantDto {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
title: string;
|
|
24
|
+
owner_id?: number;
|
|
25
|
+
created_by?: number;
|
|
26
26
|
}
|
|
27
27
|
export interface CreateTenantRequest {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
title: string;
|
|
29
|
+
owner_id?: number;
|
|
30
30
|
}
|
|
31
31
|
export interface UpdateTenantDto {
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
title?: string;
|
|
33
|
+
owner_id?: number | null;
|
|
34
34
|
}
|
|
35
35
|
export type UpdateTenantRequest = UpdateTenantDto;
|
|
36
36
|
export interface CreateTenantWithShopDto {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
tenantTitle: string;
|
|
38
|
+
shopTitle?: string;
|
|
39
|
+
userEmail: string;
|
|
40
|
+
userName: string;
|
|
41
41
|
}
|
|
42
42
|
export interface CreateShopDto {
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
title: string;
|
|
44
|
+
tenant_id: number;
|
|
45
45
|
}
|
|
46
46
|
export type CreateShopRequest = CreateShopDto;
|
|
47
47
|
export interface UpdateShopDto {
|
|
48
|
-
|
|
48
|
+
title?: string;
|
|
49
49
|
}
|
|
50
50
|
export type UpdateShopRequest = UpdateShopDto;
|
|
51
51
|
export interface CreateSkuRequest {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
code: string;
|
|
53
|
+
title: string;
|
|
54
54
|
}
|
|
55
55
|
export interface CreateSkuDto {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
56
|
+
code: string;
|
|
57
|
+
title: string;
|
|
58
|
+
shop_id: number;
|
|
59
|
+
tenant_id: number;
|
|
60
60
|
}
|
|
61
61
|
export interface UpdateSkuDto {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
code?: string;
|
|
63
|
+
title?: string;
|
|
64
64
|
}
|
|
65
65
|
export type UpdateSkuRequest = UpdateSkuDto;
|
|
66
66
|
export interface CreateSalesHistoryRequest {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
sku_id: number;
|
|
68
|
+
period: string;
|
|
69
|
+
quantity: number;
|
|
70
|
+
marketplace_id: number;
|
|
71
71
|
}
|
|
72
72
|
export interface CreateSalesHistoryDto {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
sku_id: number;
|
|
74
|
+
shop_id: number;
|
|
75
|
+
tenant_id: number;
|
|
76
|
+
period: string;
|
|
77
|
+
quantity: number;
|
|
78
|
+
marketplace_id: number;
|
|
79
79
|
}
|
|
80
80
|
export interface UpdateSalesHistoryDto {
|
|
81
|
-
|
|
81
|
+
quantity?: number;
|
|
82
82
|
}
|
|
83
83
|
export type UpdateSalesHistoryRequest = UpdateSalesHistoryDto;
|
|
84
84
|
export interface CreateMarketplaceRequest {
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
id: string;
|
|
86
|
+
title: string;
|
|
87
87
|
}
|
|
88
88
|
export interface CreateMarketplaceDto {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
id: string;
|
|
90
|
+
title: string;
|
|
91
|
+
shop_id: number;
|
|
92
|
+
tenant_id: number;
|
|
93
93
|
}
|
|
94
94
|
export interface UpdateMarketplaceDto {
|
|
95
|
-
|
|
95
|
+
title?: string;
|
|
96
96
|
}
|
|
97
97
|
export type UpdateMarketplaceRequest = UpdateMarketplaceDto;
|
|
98
98
|
export interface CreateApiKeyDto {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
user_id: number;
|
|
100
|
+
name?: string;
|
|
101
|
+
expires_at?: string;
|
|
102
102
|
}
|
|
103
103
|
export type CreateApiKeyRequest = CreateApiKeyDto;
|
|
104
104
|
export interface UpdateApiKeyDto {
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
name?: string | null;
|
|
106
|
+
expires_at?: string | null;
|
|
107
107
|
}
|
|
108
108
|
export type UpdateApiKeyRequest = UpdateApiKeyDto;
|
|
109
109
|
export interface CreateRoleDto {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
name: string;
|
|
111
|
+
description?: string;
|
|
112
112
|
}
|
|
113
113
|
export type CreateRoleRequest = CreateRoleDto;
|
|
114
114
|
export interface UpdateRoleDto {
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
name?: string;
|
|
116
|
+
description?: string | null;
|
|
117
117
|
}
|
|
118
118
|
export type UpdateRoleRequest = UpdateRoleDto;
|
|
119
119
|
export interface CreateUserRoleDto {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
user_id: number;
|
|
121
|
+
role_id: number;
|
|
122
|
+
tenant_id?: number;
|
|
123
|
+
shop_id?: number;
|
|
124
124
|
}
|
|
125
125
|
export type CreateUserRoleRequest = CreateUserRoleDto;
|
|
126
126
|
export interface ImportSkuItem {
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
code: string;
|
|
128
|
+
title: string;
|
|
129
129
|
}
|
|
130
130
|
export interface ImportSalesHistoryItem {
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
131
|
+
sku_code: string;
|
|
132
|
+
period: string;
|
|
133
|
+
quantity: number;
|
|
134
|
+
marketplace: string;
|
|
135
135
|
}
|
|
136
136
|
export interface ImportMarketplaceItem {
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
id: string;
|
|
138
|
+
title: string;
|
|
139
139
|
}
|
|
140
|
-
//# sourceMappingURL=dto.d.ts.map
|
|
140
|
+
//# sourceMappingURL=dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/entities/api-keys.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base interface for entities scoped to both shop and tenant
|
|
3
|
+
* (e.g., SKUs, Brands, Marketplaces)
|
|
4
|
+
*/
|
|
5
|
+
export interface ShopScopedEntity {
|
|
6
|
+
id: number;
|
|
7
|
+
code: string;
|
|
8
|
+
title: string;
|
|
9
|
+
shop_id: number;
|
|
10
|
+
tenant_id: number;
|
|
11
|
+
created_at: Date;
|
|
12
|
+
updated_at: Date;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/entities/base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brands.d.ts","sourceRoot":"","sources":["../../src/entities/brands.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,KAAM,SAAQ,gBAAgB;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core database entities
|
|
3
|
+
*/
|
|
4
|
+
export * from './base.js';
|
|
5
|
+
export * from './users.js';
|
|
6
|
+
export * from './tenants.js';
|
|
7
|
+
export * from './shops.js';
|
|
8
|
+
export * from './skus.js';
|
|
9
|
+
export * from './brands.js';
|
|
10
|
+
export * from './marketplaces.js';
|
|
11
|
+
export * from './sales-history.js';
|
|
12
|
+
export * from './roles.js';
|
|
13
|
+
export * from './api-keys.js';
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core database entities
|
|
3
|
+
*/
|
|
4
|
+
export * from './base.js';
|
|
5
|
+
export * from './users.js';
|
|
6
|
+
export * from './tenants.js';
|
|
7
|
+
export * from './shops.js';
|
|
8
|
+
export * from './skus.js';
|
|
9
|
+
export * from './brands.js';
|
|
10
|
+
export * from './marketplaces.js';
|
|
11
|
+
export * from './sales-history.js';
|
|
12
|
+
export * from './roles.js';
|
|
13
|
+
export * from './api-keys.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marketplaces.d.ts","sourceRoot":"","sources":["../../src/entities/marketplaces.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/entities/roles.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface SalesHistory {
|
|
2
|
+
id: number;
|
|
3
|
+
sku_id: number;
|
|
4
|
+
shop_id: number;
|
|
5
|
+
tenant_id: number;
|
|
6
|
+
period: string;
|
|
7
|
+
quantity: number;
|
|
8
|
+
marketplace_id: number;
|
|
9
|
+
created_at: Date;
|
|
10
|
+
updated_at: Date;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=sales-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sales-history.d.ts","sourceRoot":"","sources":["../../src/entities/sales-history.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shops.d.ts","sourceRoot":"","sources":["../../src/entities/shops.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skus.d.ts","sourceRoot":"","sources":["../../src/entities/skus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAElD,MAAM,WAAW,GAAI,SAAQ,gBAAgB;CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../src/entities/tenants.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/entities/users.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/entities.d.ts
CHANGED
|
@@ -6,76 +6,74 @@
|
|
|
6
6
|
* (e.g., SKUs, Brands, Marketplaces)
|
|
7
7
|
*/
|
|
8
8
|
export interface ShopScopedEntity {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
id: number;
|
|
10
|
+
code: string;
|
|
11
|
+
title: string;
|
|
12
|
+
shop_id: number;
|
|
13
|
+
tenant_id: number;
|
|
14
|
+
created_at: Date;
|
|
15
|
+
updated_at: Date;
|
|
16
16
|
}
|
|
17
17
|
export interface User {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
id: number;
|
|
19
|
+
email: string;
|
|
20
|
+
name: string;
|
|
21
|
+
default_shop_id: number | null;
|
|
22
|
+
created_at: Date;
|
|
23
|
+
updated_at: Date;
|
|
24
24
|
}
|
|
25
25
|
export interface Tenant {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
id: number;
|
|
27
|
+
title: string;
|
|
28
|
+
owner_id: number | null;
|
|
29
|
+
created_by: number;
|
|
30
|
+
created_at: Date;
|
|
31
|
+
updated_at: Date;
|
|
32
32
|
}
|
|
33
33
|
export interface Shop {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
export interface Sku extends ShopScopedEntity {
|
|
41
|
-
}
|
|
42
|
-
export interface Brand extends ShopScopedEntity {
|
|
34
|
+
id: number;
|
|
35
|
+
title: string;
|
|
36
|
+
tenant_id: number;
|
|
37
|
+
created_at: Date;
|
|
38
|
+
updated_at: Date;
|
|
43
39
|
}
|
|
40
|
+
export interface Sku extends ShopScopedEntity {}
|
|
41
|
+
export interface Brand extends ShopScopedEntity {}
|
|
44
42
|
export interface SalesHistory {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
43
|
+
id: number;
|
|
44
|
+
sku_id: number;
|
|
45
|
+
shop_id: number;
|
|
46
|
+
tenant_id: number;
|
|
47
|
+
period: string;
|
|
48
|
+
quantity: number;
|
|
49
|
+
marketplace_id: number;
|
|
50
|
+
created_at: Date;
|
|
51
|
+
updated_at: Date;
|
|
54
52
|
}
|
|
55
53
|
export interface Role {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
id: number;
|
|
55
|
+
name: string;
|
|
56
|
+
description: string | null;
|
|
57
|
+
created_at: Date;
|
|
58
|
+
updated_at: Date;
|
|
61
59
|
}
|
|
62
60
|
export interface ApiKey {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
61
|
+
id: number;
|
|
62
|
+
user_id: number;
|
|
63
|
+
key: string;
|
|
64
|
+
name: string | null;
|
|
65
|
+
expires_at: Date | null;
|
|
66
|
+
last_used_at: Date | null;
|
|
67
|
+
created_at: Date;
|
|
68
|
+
updated_at: Date;
|
|
71
69
|
}
|
|
72
70
|
export interface Marketplace {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
id: number;
|
|
72
|
+
code: string;
|
|
73
|
+
title: string;
|
|
74
|
+
shop_id: number;
|
|
75
|
+
tenant_id: number;
|
|
76
|
+
created_at: Date;
|
|
77
|
+
updated_at: Date;
|
|
80
78
|
}
|
|
81
|
-
//# sourceMappingURL=entities.d.ts.map
|
|
79
|
+
//# sourceMappingURL=entities.d.ts.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './entities.js';
|
|
1
|
+
export * from './entities/index.js';
|
|
2
2
|
export * from './dto/index.js';
|
|
3
|
-
export * from './responses.js';
|
|
3
|
+
export * from './responses/index.js';
|
|
4
4
|
export * from './query.js';
|
|
5
|
+
export * from './metadata.js';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC;AAGpC,cAAc,gBAAgB,CAAC;AAG/B,cAAc,sBAAsB,CAAC;AAGrC,cAAc,YAAY,CAAC;AAG3B,cAAc,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
// Entities
|
|
2
|
-
export * from './entities.js';
|
|
2
|
+
export * from './entities/index.js';
|
|
3
3
|
// DTOs
|
|
4
4
|
export * from './dto/index.js';
|
|
5
5
|
// Response types
|
|
6
|
-
export * from './responses.js';
|
|
6
|
+
export * from './responses/index.js';
|
|
7
7
|
// Query types
|
|
8
8
|
export * from './query.js';
|
|
9
|
+
// Metadata
|
|
10
|
+
export * from './metadata.js';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type FieldType = 'string' | 'number' | 'date' | 'period';
|
|
2
|
+
export interface EntityFieldMetadata {
|
|
3
|
+
name: string;
|
|
4
|
+
type: FieldType;
|
|
5
|
+
description: string;
|
|
6
|
+
required: boolean;
|
|
7
|
+
example?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface EntityMetadata {
|
|
10
|
+
name: string;
|
|
11
|
+
description: string;
|
|
12
|
+
fields: EntityFieldMetadata[];
|
|
13
|
+
}
|
|
14
|
+
export interface EntitiesMetadata {
|
|
15
|
+
brands: EntityMetadata;
|
|
16
|
+
marketplaces: EntityMetadata;
|
|
17
|
+
skus: EntityMetadata;
|
|
18
|
+
salesHistory: EntityMetadata;
|
|
19
|
+
}
|
|
20
|
+
export declare const ENTITIES_METADATA: EntitiesMetadata;
|
|
21
|
+
//# sourceMappingURL=metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEhE,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,cAAc,CAAC;IACvB,YAAY,EAAE,cAAc,CAAC;IAC7B,IAAI,EAAE,cAAc,CAAC;IACrB,YAAY,EAAE,cAAc,CAAC;CAC9B;AAED,eAAO,MAAM,iBAAiB,EAAE,gBA+F/B,CAAC"}
|
package/dist/metadata.js
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export const ENTITIES_METADATA = {
|
|
2
|
+
brands: {
|
|
3
|
+
name: 'Brands',
|
|
4
|
+
description: 'Product brands managed by your shop',
|
|
5
|
+
fields: [
|
|
6
|
+
{
|
|
7
|
+
name: 'code',
|
|
8
|
+
type: 'string',
|
|
9
|
+
description: 'Unique brand identifier',
|
|
10
|
+
required: true,
|
|
11
|
+
example: 'apple',
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: 'title',
|
|
15
|
+
type: 'string',
|
|
16
|
+
description: 'Brand display name',
|
|
17
|
+
required: true,
|
|
18
|
+
example: 'Apple Inc.',
|
|
19
|
+
},
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
marketplaces: {
|
|
23
|
+
name: 'Marketplaces',
|
|
24
|
+
description: 'Sales channels where products are sold',
|
|
25
|
+
fields: [
|
|
26
|
+
{
|
|
27
|
+
name: 'code',
|
|
28
|
+
type: 'string',
|
|
29
|
+
description: 'Unique marketplace identifier',
|
|
30
|
+
required: true,
|
|
31
|
+
example: 'amazon',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'title',
|
|
35
|
+
type: 'string',
|
|
36
|
+
description: 'Marketplace display name',
|
|
37
|
+
required: true,
|
|
38
|
+
example: 'Amazon',
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
skus: {
|
|
43
|
+
name: 'Products',
|
|
44
|
+
description: 'Product catalog items (SKUs)',
|
|
45
|
+
fields: [
|
|
46
|
+
{
|
|
47
|
+
name: 'code',
|
|
48
|
+
type: 'string',
|
|
49
|
+
description: 'Unique product SKU code',
|
|
50
|
+
required: true,
|
|
51
|
+
example: 'IPHONE-15-PRO',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'title',
|
|
55
|
+
type: 'string',
|
|
56
|
+
description: 'Product display name',
|
|
57
|
+
required: true,
|
|
58
|
+
example: 'iPhone 15 Pro',
|
|
59
|
+
},
|
|
60
|
+
],
|
|
61
|
+
},
|
|
62
|
+
salesHistory: {
|
|
63
|
+
name: 'Sales History',
|
|
64
|
+
description: 'Historical sales data by SKU, period, and marketplace',
|
|
65
|
+
fields: [
|
|
66
|
+
{
|
|
67
|
+
name: 'sku_code',
|
|
68
|
+
type: 'string',
|
|
69
|
+
description: 'Product SKU code',
|
|
70
|
+
required: true,
|
|
71
|
+
example: 'IPHONE-15-PRO',
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'period',
|
|
75
|
+
type: 'period',
|
|
76
|
+
description: 'Sales period in YYYY-MM format',
|
|
77
|
+
required: true,
|
|
78
|
+
example: '2024-01',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'quantity',
|
|
82
|
+
type: 'number',
|
|
83
|
+
description: 'Number of units sold',
|
|
84
|
+
required: true,
|
|
85
|
+
example: '150',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: 'marketplace',
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'Marketplace code where sales occurred',
|
|
91
|
+
required: true,
|
|
92
|
+
example: 'amazon',
|
|
93
|
+
},
|
|
94
|
+
],
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface SkuExportItem {
|
|
2
|
+
code: string;
|
|
3
|
+
title: string;
|
|
4
|
+
}
|
|
5
|
+
export interface BrandExportItem {
|
|
6
|
+
code: string;
|
|
7
|
+
title: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MarketplaceExportItem {
|
|
10
|
+
code: string;
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SalesHistoryExportItem {
|
|
14
|
+
sku_code: string;
|
|
15
|
+
period: string;
|
|
16
|
+
quantity: number;
|
|
17
|
+
marketplace: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=export.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"export.d.ts","sourceRoot":"","sources":["../../src/responses/export.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface ImportResult {
|
|
2
|
+
created: number;
|
|
3
|
+
updated: number;
|
|
4
|
+
skus_created?: number;
|
|
5
|
+
marketplaces_created?: number;
|
|
6
|
+
errors: string[];
|
|
7
|
+
}
|
|
8
|
+
export interface DeleteDataResult {
|
|
9
|
+
skusDeleted: number;
|
|
10
|
+
salesHistoryDeleted: number;
|
|
11
|
+
marketplacesDeleted: number;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"import.d.ts","sourceRoot":"","sources":["../../src/responses/import.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,mBAAmB,EAAE,MAAM,CAAC;CAC7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/responses/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Tenant } from '../entities/tenants.js';
|
|
2
|
+
export interface TenantWithShopAndApiKey {
|
|
3
|
+
tenant: Tenant;
|
|
4
|
+
shop: {
|
|
5
|
+
id: number;
|
|
6
|
+
title: string;
|
|
7
|
+
tenant_id: number;
|
|
8
|
+
};
|
|
9
|
+
user: {
|
|
10
|
+
id: number;
|
|
11
|
+
email: string;
|
|
12
|
+
name: string;
|
|
13
|
+
};
|
|
14
|
+
apiKey: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=tenants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenants.d.ts","sourceRoot":"","sources":["../../src/responses/tenants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAErD,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { User } from '../entities/users.js';
|
|
2
|
+
export interface UserRole {
|
|
3
|
+
id: number;
|
|
4
|
+
role_name: string;
|
|
5
|
+
tenant_id: number | null;
|
|
6
|
+
tenant_title: string | null;
|
|
7
|
+
shop_id: number | null;
|
|
8
|
+
shop_title: string | null;
|
|
9
|
+
}
|
|
10
|
+
export interface ShopInfo {
|
|
11
|
+
id: number;
|
|
12
|
+
title: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TenantInfo {
|
|
15
|
+
id: number;
|
|
16
|
+
title: string;
|
|
17
|
+
is_owner: boolean;
|
|
18
|
+
shops: ShopInfo[];
|
|
19
|
+
}
|
|
20
|
+
export interface UserWithRolesAndTenants extends User {
|
|
21
|
+
roles: UserRole[];
|
|
22
|
+
tenants: TenantInfo[];
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/responses/users.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAEjD,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,uBAAwB,SAAQ,IAAI;IACnD,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/responses.d.ts
CHANGED
|
@@ -3,69 +3,69 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { Tenant, User } from './entities.js';
|
|
5
5
|
export interface UserRole {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
id: number;
|
|
7
|
+
role_name: string;
|
|
8
|
+
tenant_id: number | null;
|
|
9
|
+
tenant_title: string | null;
|
|
10
|
+
shop_id: number | null;
|
|
11
|
+
shop_title: string | null;
|
|
12
12
|
}
|
|
13
13
|
export interface ShopInfo {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
id: number;
|
|
15
|
+
title: string;
|
|
16
16
|
}
|
|
17
17
|
export interface TenantInfo {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
id: number;
|
|
19
|
+
title: string;
|
|
20
|
+
is_owner: boolean;
|
|
21
|
+
shops: ShopInfo[];
|
|
22
22
|
}
|
|
23
23
|
export interface UserWithRolesAndTenants extends User {
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
roles: UserRole[];
|
|
25
|
+
tenants: TenantInfo[];
|
|
26
26
|
}
|
|
27
27
|
export interface TenantWithShopAndApiKey {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
tenant: Tenant;
|
|
29
|
+
shop: {
|
|
30
|
+
id: number;
|
|
31
|
+
title: string;
|
|
32
|
+
tenant_id: number;
|
|
33
|
+
};
|
|
34
|
+
user: {
|
|
35
|
+
id: number;
|
|
36
|
+
email: string;
|
|
37
|
+
name: string;
|
|
38
|
+
};
|
|
39
|
+
apiKey: string;
|
|
40
40
|
}
|
|
41
41
|
export interface ImportResult {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
created: number;
|
|
43
|
+
updated: number;
|
|
44
|
+
skus_created?: number;
|
|
45
|
+
marketplaces_created?: number;
|
|
46
|
+
errors: string[];
|
|
47
47
|
}
|
|
48
48
|
export interface DeleteDataResult {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
skusDeleted: number;
|
|
50
|
+
salesHistoryDeleted: number;
|
|
51
|
+
marketplacesDeleted: number;
|
|
52
52
|
}
|
|
53
53
|
export interface SalesHistoryExportItem {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
sku_code: string;
|
|
55
|
+
period: string;
|
|
56
|
+
quantity: number;
|
|
57
|
+
marketplace: string;
|
|
58
58
|
}
|
|
59
59
|
export interface SkuExportItem {
|
|
60
|
-
|
|
61
|
-
|
|
60
|
+
code: string;
|
|
61
|
+
title: string;
|
|
62
62
|
}
|
|
63
63
|
export interface BrandExportItem {
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
code: string;
|
|
65
|
+
title: string;
|
|
66
66
|
}
|
|
67
67
|
export interface MarketplaceExportItem {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
code: string;
|
|
69
|
+
title: string;
|
|
70
70
|
}
|
|
71
|
-
//# sourceMappingURL=responses.d.ts.map
|
|
71
|
+
//# sourceMappingURL=responses.d.ts.map
|