@sales-planner/shared 0.8.1 → 0.8.3

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.
Files changed (52) hide show
  1. package/dist/entities/api-keys.d.ts +11 -0
  2. package/dist/entities/api-keys.d.ts.map +1 -0
  3. package/dist/entities/api-keys.js +1 -0
  4. package/dist/entities/base.d.ts +14 -0
  5. package/dist/entities/base.d.ts.map +1 -0
  6. package/dist/entities/base.js +1 -0
  7. package/dist/entities/brands.d.ts +4 -0
  8. package/dist/entities/brands.d.ts.map +1 -0
  9. package/dist/entities/brands.js +1 -0
  10. package/dist/entities/index.d.ts +14 -0
  11. package/dist/entities/index.d.ts.map +1 -0
  12. package/dist/entities/index.js +13 -0
  13. package/dist/entities/marketplaces.d.ts +10 -0
  14. package/dist/entities/marketplaces.d.ts.map +1 -0
  15. package/dist/entities/marketplaces.js +1 -0
  16. package/dist/entities/roles.d.ts +8 -0
  17. package/dist/entities/roles.d.ts.map +1 -0
  18. package/dist/entities/roles.js +1 -0
  19. package/dist/entities/sales-history.d.ts +12 -0
  20. package/dist/entities/sales-history.d.ts.map +1 -0
  21. package/dist/entities/sales-history.js +1 -0
  22. package/dist/entities/shops.d.ts +8 -0
  23. package/dist/entities/shops.d.ts.map +1 -0
  24. package/dist/entities/shops.js +1 -0
  25. package/dist/entities/skus.d.ts +4 -0
  26. package/dist/entities/skus.d.ts.map +1 -0
  27. package/dist/entities/skus.js +1 -0
  28. package/dist/entities/tenants.d.ts +9 -0
  29. package/dist/entities/tenants.d.ts.map +1 -0
  30. package/dist/entities/tenants.js +1 -0
  31. package/dist/entities/users.d.ts +9 -0
  32. package/dist/entities/users.d.ts.map +1 -0
  33. package/dist/entities/users.js +1 -0
  34. package/dist/index.d.ts +2 -2
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -2
  37. package/dist/responses/export.d.ts +19 -0
  38. package/dist/responses/export.d.ts.map +1 -0
  39. package/dist/responses/export.js +1 -0
  40. package/dist/responses/import.d.ts +13 -0
  41. package/dist/responses/import.d.ts.map +1 -0
  42. package/dist/responses/import.js +1 -0
  43. package/dist/responses/index.d.ts +8 -0
  44. package/dist/responses/index.d.ts.map +1 -0
  45. package/dist/responses/index.js +7 -0
  46. package/dist/responses/tenants.d.ts +16 -0
  47. package/dist/responses/tenants.d.ts.map +1 -0
  48. package/dist/responses/tenants.js +1 -0
  49. package/dist/responses/users.d.ts +24 -0
  50. package/dist/responses/users.d.ts.map +1 -0
  51. package/dist/responses/users.js +1 -0
  52. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ export interface ApiKey {
2
+ id: number;
3
+ user_id: number;
4
+ key: string;
5
+ name: string | null;
6
+ expires_at: Date | null;
7
+ last_used_at: Date | null;
8
+ created_at: Date;
9
+ updated_at: Date;
10
+ }
11
+ //# sourceMappingURL=api-keys.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,4 @@
1
+ import type { ShopScopedEntity } from './base.js';
2
+ export interface Brand extends ShopScopedEntity {
3
+ }
4
+ //# sourceMappingURL=brands.d.ts.map
@@ -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,10 @@
1
+ export interface Marketplace {
2
+ id: number;
3
+ code: string;
4
+ title: string;
5
+ shop_id: number;
6
+ tenant_id: number;
7
+ created_at: Date;
8
+ updated_at: Date;
9
+ }
10
+ //# sourceMappingURL=marketplaces.d.ts.map
@@ -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,8 @@
1
+ export interface Role {
2
+ id: number;
3
+ name: string;
4
+ description: string | null;
5
+ created_at: Date;
6
+ updated_at: Date;
7
+ }
8
+ //# sourceMappingURL=roles.d.ts.map
@@ -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,8 @@
1
+ export interface Shop {
2
+ id: number;
3
+ title: string;
4
+ tenant_id: number;
5
+ created_at: Date;
6
+ updated_at: Date;
7
+ }
8
+ //# sourceMappingURL=shops.d.ts.map
@@ -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,4 @@
1
+ import type { ShopScopedEntity } from './base.js';
2
+ export interface Sku extends ShopScopedEntity {
3
+ }
4
+ //# sourceMappingURL=skus.d.ts.map
@@ -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,9 @@
1
+ export interface Tenant {
2
+ id: number;
3
+ title: string;
4
+ owner_id: number | null;
5
+ created_by: number;
6
+ created_at: Date;
7
+ updated_at: Date;
8
+ }
9
+ //# sourceMappingURL=tenants.d.ts.map
@@ -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,9 @@
1
+ export interface User {
2
+ id: number;
3
+ email: string;
4
+ name: string;
5
+ default_shop_id: number | null;
6
+ created_at: Date;
7
+ updated_at: Date;
8
+ }
9
+ //# sourceMappingURL=users.d.ts.map
@@ -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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
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
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAC;AAG9B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,gBAAgB,CAAC;AAG/B,cAAc,YAAY,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"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
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';
@@ -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,8 @@
1
+ /**
2
+ * API response types
3
+ */
4
+ export * from './users.js';
5
+ export * from './tenants.js';
6
+ export * from './import.js';
7
+ export * from './export.js';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -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,7 @@
1
+ /**
2
+ * API response types
3
+ */
4
+ export * from './users.js';
5
+ export * from './tenants.js';
6
+ export * from './import.js';
7
+ export * from './export.js';
@@ -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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sales-planner/shared",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "description": "Shared types and DTOs for Sales Planner API",
5
5
  "author": "Damir Manapov",
6
6
  "license": "MIT",