@sales-planner/shared 0.1.0 → 0.3.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/README.md CHANGED
@@ -1,103 +1,79 @@
1
1
  # @sales-planner/shared
2
2
 
3
- Shared TypeScript types for the Sales Planner platform.
3
+ Shared types and DTOs for the Sales Planner API.
4
+
5
+ > **Note**: For the HTTP client, use `@sales-planner/http-client` instead.
4
6
 
5
7
  ## Installation
6
8
 
7
9
  ```bash
10
+ npm install @sales-planner/shared
11
+ # or
8
12
  pnpm add @sales-planner/shared
9
13
  ```
10
14
 
11
15
  ## Usage
12
16
 
17
+ This package provides TypeScript types only (no runtime code).
18
+
13
19
  ```typescript
14
- import type {
15
- User,
16
- Tenant,
17
- Shop,
18
- Sku,
19
- SalesHistory,
20
- CreateUserDto,
21
- CreateTenantDto,
22
- UserWithRolesAndTenants,
20
+ import type {
21
+ // Entities
22
+ User, Tenant, Shop, Sku, SalesHistory,
23
+ Role, UserRole, ApiKey, Marketplace,
24
+
25
+ // DTOs
26
+ CreateUserDto, CreateTenantDto, CreateShopDto,
27
+ CreateSkuDto, UpdateSkuDto, ImportSkuItem,
28
+ CreateSalesHistoryDto, UpdateSalesHistoryDto, ImportSalesHistoryItem,
29
+ CreateApiKeyDto, CreateRoleDto, CreateUserRoleDto, CreateMarketplaceDto,
30
+
31
+ // Query types
32
+ ShopContextParams, PeriodQuery,
33
+
34
+ // Response types
35
+ UserWithRolesAndTenants, TenantWithShopAndApiKey,
36
+ ImportResult, DeleteDataResult,
37
+ SkuExportItem, SalesHistoryExportItem
23
38
  } from '@sales-planner/shared';
24
39
  ```
25
40
 
26
- ## Types
41
+ ## Types Reference
27
42
 
28
43
  ### Entities
29
44
 
30
- Core database entities:
31
-
32
45
  | Type | Description |
33
46
  |------|-------------|
34
47
  | `User` | User account |
35
- | `Tenant` | Tenant (organization) |
36
- | `Shop` | Shop within a tenant |
37
- | `Sku` | SKU (product) in a shop |
38
- | `SalesHistory` | Monthly sales data for a SKU |
39
- | `Role` | Role definition (viewer, editor, etc.) |
40
- | `ApiKey` | API key for authentication |
41
- | `Marketplace` | Marketplace reference |
42
-
43
- ### DTOs (Data Transfer Objects)
48
+ | `Tenant` | Organization/company |
49
+ | `Shop` | Store within a tenant |
50
+ | `Sku` | Stock keeping unit |
51
+ | `SalesHistory` | Sales record for a period |
52
+ | `Role` | Access role |
53
+ | `UserRole` | User-role assignment |
54
+ | `ApiKey` | API authentication key |
55
+ | `Marketplace` | E-commerce platform |
44
56
 
45
- Request payloads for creating/updating entities:
57
+ ### Query Types
46
58
 
47
59
  | Type | Description |
48
60
  |------|-------------|
49
- | `CreateUserDto` | Create a new user |
50
- | `CreateTenantDto` | Create a new tenant |
51
- | `CreateTenantWithShopDto` | Create tenant with shop and API key |
52
- | `CreateShopDto` | Create a new shop |
53
- | `CreateSkuDto` | Create a new SKU |
54
- | `UpdateSkuDto` | Update a SKU |
55
- | `CreateSalesHistoryDto` | Create sales history entry |
56
- | `UpdateSalesHistoryDto` | Update sales history |
57
- | `CreateRoleDto` | Create a new role |
58
- | `CreateApiKeyDto` | Create a new API key |
59
- | `CreateUserRoleDto` | Assign role to user |
60
- | `ImportSkuItem` | SKU item for bulk import |
61
- | `ImportSalesHistoryItem` | Sales history item for bulk import |
61
+ | `ShopContextParams` | `{ shop_id: number; tenant_id: number }` |
62
+ | `PeriodQuery` | `{ period_from?: string; period_to?: string }` |
62
63
 
63
64
  ### Response Types
64
65
 
65
- API response structures:
66
-
67
- | Type | Description |
68
- |------|-------------|
69
- | `UserWithRolesAndTenants` | User with their roles and tenant access |
70
- | `UserRole` | Role assignment with role details |
71
- | `TenantInfo` | Tenant info with shops |
72
- | `ShopInfo` | Shop info with user's role |
73
- | `TenantWithShopAndApiKey` | Result of tenant creation with shop |
74
- | `ImportResult` | Bulk import result (created/updated counts) |
75
- | `DeleteDataResult` | Data deletion result |
76
- | `SkuExportItem` | SKU export format |
77
- | `SalesHistoryExportItem` | Sales history export format |
78
-
79
- ### Query Types
80
-
81
- Request parameters:
82
-
83
66
  | Type | Description |
84
67
  |------|-------------|
85
- | `ShopContextParams` | Shop context (`tenant_id`, `shop_id`) |
86
- | `PeriodQuery` | Period filter (`periodFrom`, `periodTo`) |
68
+ | `UserWithRolesAndTenants` | User with their roles and tenants |
69
+ | `TenantWithShopAndApiKey` | Created tenant with shop and API key |
70
+ | `ImportResult` | `{ created: number; updated: number; errors: string[] }` |
71
+ | `DeleteDataResult` | `{ deletedSkus: number; deletedSalesHistory: number }` |
87
72
 
88
- ## Package Structure
73
+ ## Related Packages
89
74
 
90
- ```
91
- src/
92
- ├── entities.ts # Core entity types
93
- ├── dto.ts # Data transfer objects
94
- ├── responses.ts # API response types
95
- ├── query.ts # Query parameter types
96
- └── index.ts # Re-exports all types
97
- ```
75
+ - `@sales-planner/http-client` - HTTP client for the API (includes this package)
98
76
 
99
- ## Design Principles
77
+ ## License
100
78
 
101
- - **Types only** - No runtime code, fully tree-shakeable
102
- - **Single source of truth** - Used by both API and client packages
103
- - **ESM** - Native ES modules with `.js` extensions
79
+ MIT
@@ -0,0 +1,78 @@
1
+ import type { ApiKey, Marketplace, Role, SalesHistory, Shop, Sku, Tenant, User } from './entities.js';
2
+ import type { CreateApiKeyDto, CreateMarketplaceDto, CreateRoleDto, CreateSalesHistoryDto, CreateShopDto, CreateSkuDto, CreateTenantDto, CreateTenantWithShopDto, CreateUserDto, CreateUserRoleDto, ImportSalesHistoryItem, ImportSkuItem, UpdateSalesHistoryDto, UpdateSkuDto } from './dto.js';
3
+ import type { DeleteDataResult, ImportResult, SalesHistoryExportItem, SkuExportItem, TenantWithShopAndApiKey, UserWithRolesAndTenants } from './responses.js';
4
+ import type { PeriodQuery, ShopContextParams } from './query.js';
5
+ export interface ClientConfig {
6
+ baseUrl: string;
7
+ apiKey: string;
8
+ }
9
+ export declare class SalesPlannerClient {
10
+ private baseUrl;
11
+ private apiKey;
12
+ constructor(config: ClientConfig);
13
+ private handleErrorResponse;
14
+ private request;
15
+ private requestText;
16
+ private uploadCsv;
17
+ private requestPublic;
18
+ private requestTextPublic;
19
+ getMe(): Promise<UserWithRolesAndTenants>;
20
+ getUsers(): Promise<User[]>;
21
+ getUser(id: number): Promise<User>;
22
+ createUser(dto: CreateUserDto): Promise<User>;
23
+ deleteUser(id: number): Promise<void>;
24
+ getTenants(): Promise<Tenant[]>;
25
+ getTenant(id: number): Promise<Tenant>;
26
+ createTenant(dto: CreateTenantDto): Promise<Tenant>;
27
+ createTenantWithShopAndUser(dto: CreateTenantWithShopDto): Promise<TenantWithShopAndApiKey>;
28
+ updateTenant(id: number, dto: Partial<CreateTenantDto>): Promise<Tenant>;
29
+ deleteTenant(id: number): Promise<void>;
30
+ getShops(tenantId?: number): Promise<Shop[]>;
31
+ getShop(id: number): Promise<Shop>;
32
+ createShop(dto: CreateShopDto): Promise<Shop>;
33
+ updateShop(id: number, dto: Partial<CreateShopDto>): Promise<Shop>;
34
+ deleteShop(id: number): Promise<void>;
35
+ deleteShopData(id: number): Promise<DeleteDataResult>;
36
+ getSkus(ctx: ShopContextParams): Promise<Sku[]>;
37
+ getSku(id: number, ctx: ShopContextParams): Promise<Sku>;
38
+ createSku(dto: Omit<CreateSkuDto, 'shop_id' | 'tenant_id'>, ctx: ShopContextParams): Promise<Sku>;
39
+ updateSku(id: number, dto: UpdateSkuDto, ctx: ShopContextParams): Promise<Sku>;
40
+ deleteSku(id: number, ctx: ShopContextParams): Promise<void>;
41
+ importSkusJson(items: ImportSkuItem[], ctx: ShopContextParams): Promise<ImportResult>;
42
+ importSkusCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
43
+ exportSkusJson(ctx: ShopContextParams): Promise<SkuExportItem[]>;
44
+ exportSkusCsv(ctx: ShopContextParams): Promise<string>;
45
+ getSkusExampleJson(): Promise<ImportSkuItem[]>;
46
+ getSkusExampleCsv(): Promise<string>;
47
+ getSalesHistory(ctx: ShopContextParams, query?: PeriodQuery): Promise<SalesHistory[]>;
48
+ getSalesHistoryItem(id: number, ctx: ShopContextParams): Promise<SalesHistory>;
49
+ createSalesHistory(dto: Omit<CreateSalesHistoryDto, 'shop_id' | 'tenant_id'>, ctx: ShopContextParams): Promise<SalesHistory>;
50
+ updateSalesHistory(id: number, dto: UpdateSalesHistoryDto, ctx: ShopContextParams): Promise<SalesHistory>;
51
+ deleteSalesHistory(id: number, ctx: ShopContextParams): Promise<void>;
52
+ importSalesHistoryJson(items: ImportSalesHistoryItem[], ctx: ShopContextParams): Promise<ImportResult>;
53
+ importSalesHistoryCsv(csvContent: string, ctx: ShopContextParams): Promise<ImportResult>;
54
+ exportSalesHistoryJson(ctx: ShopContextParams, query?: PeriodQuery): Promise<SalesHistoryExportItem[]>;
55
+ exportSalesHistoryCsv(ctx: ShopContextParams, query?: PeriodQuery): Promise<string>;
56
+ getSalesHistoryExampleJson(): Promise<ImportSalesHistoryItem[]>;
57
+ getSalesHistoryExampleCsv(): Promise<string>;
58
+ getRoles(): Promise<Role[]>;
59
+ getRole(id: number): Promise<Role>;
60
+ createRole(dto: CreateRoleDto): Promise<Role>;
61
+ updateRole(id: number, dto: Partial<CreateRoleDto>): Promise<Role>;
62
+ deleteRole(id: number): Promise<void>;
63
+ createUserRole(dto: CreateUserRoleDto): Promise<void>;
64
+ deleteUserRole(id: number): Promise<void>;
65
+ getApiKeys(): Promise<ApiKey[]>;
66
+ createApiKey(dto: CreateApiKeyDto): Promise<ApiKey>;
67
+ deleteApiKey(id: number): Promise<void>;
68
+ getMarketplaces(): Promise<Marketplace[]>;
69
+ getMarketplace(id: string): Promise<Marketplace>;
70
+ createMarketplace(dto: CreateMarketplaceDto): Promise<Marketplace>;
71
+ updateMarketplace(id: string, dto: Partial<CreateMarketplaceDto>): Promise<Marketplace>;
72
+ deleteMarketplace(id: string): Promise<void>;
73
+ }
74
+ export declare class ApiError extends Error {
75
+ status: number;
76
+ constructor(status: number, message: string);
77
+ }
78
+ //# sourceMappingURL=client.d.ts.map
@@ -0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IhD,iBAAiB,CAAC,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC;IAIlE,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,oBAAoB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC;IAIvF,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnD;AAED,qBAAa,QAAS,SAAQ,KAAK;IAExB,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM;CAKlB"}
package/dist/client.js ADDED
@@ -0,0 +1,315 @@
1
+ export class SalesPlannerClient {
2
+ baseUrl;
3
+ apiKey;
4
+ constructor(config) {
5
+ this.baseUrl = config.baseUrl.replace(/\/$/, '');
6
+ this.apiKey = config.apiKey;
7
+ }
8
+ async handleErrorResponse(response) {
9
+ const text = await response.text();
10
+ let message = response.statusText;
11
+ if (text) {
12
+ try {
13
+ const error = JSON.parse(text);
14
+ message = error.message || message;
15
+ }
16
+ catch {
17
+ message = text;
18
+ }
19
+ }
20
+ throw new ApiError(response.status, message || 'Request failed');
21
+ }
22
+ async request(method, path, options) {
23
+ const url = new URL(this.baseUrl + path);
24
+ if (options?.params) {
25
+ for (const [key, value] of Object.entries(options.params)) {
26
+ if (value !== undefined) {
27
+ url.searchParams.set(key, String(value));
28
+ }
29
+ }
30
+ }
31
+ const response = await fetch(url.toString(), {
32
+ method,
33
+ headers: {
34
+ 'Content-Type': 'application/json',
35
+ 'X-API-Key': this.apiKey,
36
+ },
37
+ body: options?.body ? JSON.stringify(options.body) : undefined,
38
+ });
39
+ if (!response.ok) {
40
+ await this.handleErrorResponse(response);
41
+ }
42
+ if (response.status === 204) {
43
+ return undefined;
44
+ }
45
+ // Handle empty response body (e.g., void return type from NestJS)
46
+ const text = await response.text();
47
+ if (!text) {
48
+ return undefined;
49
+ }
50
+ return JSON.parse(text);
51
+ }
52
+ async requestText(method, path, options) {
53
+ const url = new URL(this.baseUrl + path);
54
+ if (options?.params) {
55
+ for (const [key, value] of Object.entries(options.params)) {
56
+ if (value !== undefined) {
57
+ url.searchParams.set(key, String(value));
58
+ }
59
+ }
60
+ }
61
+ const response = await fetch(url.toString(), {
62
+ method,
63
+ headers: {
64
+ 'X-API-Key': this.apiKey,
65
+ },
66
+ });
67
+ if (!response.ok) {
68
+ await this.handleErrorResponse(response);
69
+ }
70
+ return response.text();
71
+ }
72
+ async uploadCsv(path, csvContent, params) {
73
+ const url = new URL(this.baseUrl + path);
74
+ for (const [key, value] of Object.entries(params)) {
75
+ if (value !== undefined) {
76
+ url.searchParams.set(key, String(value));
77
+ }
78
+ }
79
+ const formData = new FormData();
80
+ const blob = new Blob([csvContent], { type: 'text/csv' });
81
+ formData.append('file', blob, 'upload.csv');
82
+ const response = await fetch(url.toString(), {
83
+ method: 'POST',
84
+ headers: {
85
+ 'X-API-Key': this.apiKey,
86
+ },
87
+ body: formData,
88
+ });
89
+ if (!response.ok) {
90
+ await this.handleErrorResponse(response);
91
+ }
92
+ return response.json();
93
+ }
94
+ async requestPublic(method, path) {
95
+ const url = new URL(this.baseUrl + path);
96
+ const response = await fetch(url.toString(), {
97
+ method,
98
+ headers: {
99
+ 'Content-Type': 'application/json',
100
+ },
101
+ });
102
+ if (!response.ok) {
103
+ await this.handleErrorResponse(response);
104
+ }
105
+ return response.json();
106
+ }
107
+ async requestTextPublic(method, path) {
108
+ const url = new URL(this.baseUrl + path);
109
+ const response = await fetch(url.toString(), { method });
110
+ if (!response.ok) {
111
+ await this.handleErrorResponse(response);
112
+ }
113
+ return response.text();
114
+ }
115
+ // ============================================================
116
+ // Me
117
+ // ============================================================
118
+ async getMe() {
119
+ return this.request('GET', '/me');
120
+ }
121
+ // ============================================================
122
+ // Users
123
+ // ============================================================
124
+ async getUsers() {
125
+ return this.request('GET', '/users');
126
+ }
127
+ async getUser(id) {
128
+ return this.request('GET', `/users/${id}`);
129
+ }
130
+ async createUser(dto) {
131
+ return this.request('POST', '/users', { body: dto });
132
+ }
133
+ async deleteUser(id) {
134
+ return this.request('DELETE', `/users/${id}`);
135
+ }
136
+ // ============================================================
137
+ // Tenants
138
+ // ============================================================
139
+ async getTenants() {
140
+ return this.request('GET', '/tenants');
141
+ }
142
+ async getTenant(id) {
143
+ return this.request('GET', `/tenants/${id}`);
144
+ }
145
+ async createTenant(dto) {
146
+ return this.request('POST', '/tenants', { body: dto });
147
+ }
148
+ async createTenantWithShopAndUser(dto) {
149
+ return this.request('POST', '/tenants/with-shop-and-user', { body: dto });
150
+ }
151
+ async updateTenant(id, dto) {
152
+ return this.request('PUT', `/tenants/${id}`, { body: dto });
153
+ }
154
+ async deleteTenant(id) {
155
+ return this.request('DELETE', `/tenants/${id}`);
156
+ }
157
+ // ============================================================
158
+ // Shops
159
+ // ============================================================
160
+ async getShops(tenantId) {
161
+ return this.request('GET', '/shops', { params: { tenantId } });
162
+ }
163
+ async getShop(id) {
164
+ return this.request('GET', `/shops/${id}`);
165
+ }
166
+ async createShop(dto) {
167
+ return this.request('POST', '/shops', { body: dto });
168
+ }
169
+ async updateShop(id, dto) {
170
+ return this.request('PUT', `/shops/${id}`, { body: dto });
171
+ }
172
+ async deleteShop(id) {
173
+ return this.request('DELETE', `/shops/${id}`);
174
+ }
175
+ async deleteShopData(id) {
176
+ return this.request('DELETE', `/shops/${id}/data`);
177
+ }
178
+ // ============================================================
179
+ // SKUs
180
+ // ============================================================
181
+ async getSkus(ctx) {
182
+ return this.request('GET', '/skus', { params: ctx });
183
+ }
184
+ async getSku(id, ctx) {
185
+ return this.request('GET', `/skus/${id}`, { params: ctx });
186
+ }
187
+ async createSku(dto, ctx) {
188
+ return this.request('POST', '/skus', { body: dto, params: ctx });
189
+ }
190
+ async updateSku(id, dto, ctx) {
191
+ return this.request('PUT', `/skus/${id}`, { body: dto, params: ctx });
192
+ }
193
+ async deleteSku(id, ctx) {
194
+ return this.request('DELETE', `/skus/${id}`, { params: ctx });
195
+ }
196
+ async importSkusJson(items, ctx) {
197
+ return this.request('POST', '/skus/import/json', { body: items, params: ctx });
198
+ }
199
+ async importSkusCsv(csvContent, ctx) {
200
+ return this.uploadCsv('/skus/import/csv', csvContent, ctx);
201
+ }
202
+ async exportSkusJson(ctx) {
203
+ return this.request('GET', '/skus/export/json', { params: ctx });
204
+ }
205
+ async exportSkusCsv(ctx) {
206
+ return this.requestText('GET', '/skus/export/csv', { params: ctx });
207
+ }
208
+ async getSkusExampleJson() {
209
+ return this.requestPublic('GET', '/skus/examples/json');
210
+ }
211
+ async getSkusExampleCsv() {
212
+ return this.requestTextPublic('GET', '/skus/examples/csv');
213
+ }
214
+ // ============================================================
215
+ // Sales History
216
+ // ============================================================
217
+ async getSalesHistory(ctx, query) {
218
+ return this.request('GET', '/sales-history', { params: { ...ctx, ...query } });
219
+ }
220
+ async getSalesHistoryItem(id, ctx) {
221
+ return this.request('GET', `/sales-history/${id}`, { params: ctx });
222
+ }
223
+ async createSalesHistory(dto, ctx) {
224
+ return this.request('POST', '/sales-history', { body: dto, params: ctx });
225
+ }
226
+ async updateSalesHistory(id, dto, ctx) {
227
+ return this.request('PUT', `/sales-history/${id}`, { body: dto, params: ctx });
228
+ }
229
+ async deleteSalesHistory(id, ctx) {
230
+ return this.request('DELETE', `/sales-history/${id}`, { params: ctx });
231
+ }
232
+ async importSalesHistoryJson(items, ctx) {
233
+ return this.request('POST', '/sales-history/import/json', { body: items, params: ctx });
234
+ }
235
+ async importSalesHistoryCsv(csvContent, ctx) {
236
+ return this.uploadCsv('/sales-history/import/csv', csvContent, ctx);
237
+ }
238
+ async exportSalesHistoryJson(ctx, query) {
239
+ return this.request('GET', '/sales-history/export/json', { params: { ...ctx, ...query } });
240
+ }
241
+ async exportSalesHistoryCsv(ctx, query) {
242
+ return this.requestText('GET', '/sales-history/export/csv', { params: { ...ctx, ...query } });
243
+ }
244
+ async getSalesHistoryExampleJson() {
245
+ return this.requestPublic('GET', '/sales-history/examples/json');
246
+ }
247
+ async getSalesHistoryExampleCsv() {
248
+ return this.requestTextPublic('GET', '/sales-history/examples/csv');
249
+ }
250
+ // ============================================================
251
+ // Roles
252
+ // ============================================================
253
+ async getRoles() {
254
+ return this.request('GET', '/roles');
255
+ }
256
+ async getRole(id) {
257
+ return this.request('GET', `/roles/${id}`);
258
+ }
259
+ async createRole(dto) {
260
+ return this.request('POST', '/roles', { body: dto });
261
+ }
262
+ async updateRole(id, dto) {
263
+ return this.request('PUT', `/roles/${id}`, { body: dto });
264
+ }
265
+ async deleteRole(id) {
266
+ return this.request('DELETE', `/roles/${id}`);
267
+ }
268
+ // ============================================================
269
+ // User Roles
270
+ // ============================================================
271
+ async createUserRole(dto) {
272
+ return this.request('POST', '/user-roles', { body: dto });
273
+ }
274
+ async deleteUserRole(id) {
275
+ return this.request('DELETE', `/user-roles/${id}`);
276
+ }
277
+ // ============================================================
278
+ // API Keys
279
+ // ============================================================
280
+ async getApiKeys() {
281
+ return this.request('GET', '/api-keys');
282
+ }
283
+ async createApiKey(dto) {
284
+ return this.request('POST', '/api-keys', { body: dto });
285
+ }
286
+ async deleteApiKey(id) {
287
+ return this.request('DELETE', `/api-keys/${id}`);
288
+ }
289
+ // ============================================================
290
+ // Marketplaces
291
+ // ============================================================
292
+ async getMarketplaces() {
293
+ return this.request('GET', '/marketplaces');
294
+ }
295
+ async getMarketplace(id) {
296
+ return this.request('GET', `/marketplaces/${id}`);
297
+ }
298
+ async createMarketplace(dto) {
299
+ return this.request('POST', '/marketplaces', { body: dto });
300
+ }
301
+ async updateMarketplace(id, dto) {
302
+ return this.request('PUT', `/marketplaces/${id}`, { body: dto });
303
+ }
304
+ async deleteMarketplace(id) {
305
+ return this.request('DELETE', `/marketplaces/${id}`);
306
+ }
307
+ }
308
+ export class ApiError extends Error {
309
+ status;
310
+ constructor(status, message) {
311
+ super(message);
312
+ this.status = status;
313
+ this.name = 'ApiError';
314
+ }
315
+ }
package/dist/dto.d.ts CHANGED
@@ -65,4 +65,8 @@ export interface CreateUserRoleDto {
65
65
  tenant_id?: number;
66
66
  shop_id?: number;
67
67
  }
68
+ export interface CreateMarketplaceDto {
69
+ id: string;
70
+ title: string;
71
+ }
68
72
  //# sourceMappingURL=dto.d.ts.map
package/dist/dto.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../src/dto.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,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id: number;
40
40
  tenant_id: number;
41
- period: string;
41
+ period: Date;
42
42
  quantity: number;
43
43
  created_at: Date;
44
44
  updated_at: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,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;AAED,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;AAED,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;AAED,MAAM,WAAW,GAAG;IAClB,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;AAED,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,MAA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M,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CAClB"}
package/package.json CHANGED
@@ -1,9 +1,14 @@
1
1
  {
2
2
  "name": "@sales-planner/shared",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "description": "Shared types and DTOs for Sales Planner API",
5
5
  "author": "Damir Manapov",
6
6
  "license": "MIT",
7
+ "keywords": [
8
+ "sales-planner",
9
+ "api-client",
10
+ "typescript"
11
+ ],
7
12
  "type": "module",
8
13
  "main": "./dist/index.js",
9
14
  "types": "./dist/index.d.ts",
@@ -17,13 +22,10 @@
17
22
  "dist",
18
23
  "README.md"
19
24
  ],
20
- "publishConfig": {
21
- "access": "public"
22
- },
23
25
  "scripts": {
24
26
  "build": "tsc",
25
27
  "typecheck": "tsc --noEmit",
26
- "prepublishOnly": "pnpm run build"
28
+ "lint": "biome lint ."
27
29
  },
28
30
  "devDependencies": {
29
31
  "typescript": "^5.7.3"