polyv-live-cli 1.1.12 → 1.2.6

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 (112) hide show
  1. package/dist/commands/coupon.commands.d.ts +8 -0
  2. package/dist/commands/coupon.commands.d.ts.map +1 -0
  3. package/dist/commands/coupon.commands.js +258 -0
  4. package/dist/commands/coupon.commands.js.map +1 -0
  5. package/dist/commands/index.d.ts +1 -0
  6. package/dist/commands/index.d.ts.map +1 -1
  7. package/dist/commands/index.js +3 -1
  8. package/dist/commands/index.js.map +1 -1
  9. package/dist/commands/product.commands.d.ts +10 -0
  10. package/dist/commands/product.commands.d.ts.map +1 -0
  11. package/dist/commands/product.commands.js +398 -0
  12. package/dist/commands/product.commands.js.map +1 -0
  13. package/dist/commands/setup.commands.d.ts +4 -0
  14. package/dist/commands/setup.commands.d.ts.map +1 -0
  15. package/dist/commands/setup.commands.js +132 -0
  16. package/dist/commands/setup.commands.js.map +1 -0
  17. package/dist/commands/stream.commands.d.ts.map +1 -1
  18. package/dist/commands/stream.commands.js +7 -15
  19. package/dist/commands/stream.commands.js.map +1 -1
  20. package/dist/config/auth-source-manager.d.ts +8 -0
  21. package/dist/config/auth-source-manager.d.ts.map +1 -1
  22. package/dist/config/auth-source-manager.js +76 -1
  23. package/dist/config/auth-source-manager.js.map +1 -1
  24. package/dist/handlers/channel.handler.d.ts.map +1 -1
  25. package/dist/handlers/channel.handler.js +2 -2
  26. package/dist/handlers/channel.handler.js.map +1 -1
  27. package/dist/handlers/coupon.handler.d.ts +54 -0
  28. package/dist/handlers/coupon.handler.d.ts.map +1 -0
  29. package/dist/handlers/coupon.handler.js +258 -0
  30. package/dist/handlers/coupon.handler.js.map +1 -0
  31. package/dist/handlers/product.handler.d.ts +28 -0
  32. package/dist/handlers/product.handler.d.ts.map +1 -0
  33. package/dist/handlers/product.handler.js +182 -0
  34. package/dist/handlers/product.handler.js.map +1 -0
  35. package/dist/handlers/setup.handler.d.ts +30 -0
  36. package/dist/handlers/setup.handler.d.ts.map +1 -0
  37. package/dist/handlers/setup.handler.js +160 -0
  38. package/dist/handlers/setup.handler.js.map +1 -0
  39. package/dist/handlers/stream.handler.d.ts +3 -2
  40. package/dist/handlers/stream.handler.d.ts.map +1 -1
  41. package/dist/handlers/stream.handler.js +3 -2
  42. package/dist/handlers/stream.handler.js.map +1 -1
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +20 -4
  45. package/dist/index.js.map +1 -1
  46. package/dist/sdk/client.d.ts +8 -0
  47. package/dist/sdk/client.d.ts.map +1 -0
  48. package/dist/sdk/client.js +37 -0
  49. package/dist/sdk/client.js.map +1 -0
  50. package/dist/sdk/index.d.ts +3 -0
  51. package/dist/sdk/index.d.ts.map +1 -0
  52. package/dist/sdk/index.js +12 -0
  53. package/dist/sdk/index.js.map +1 -0
  54. package/dist/services/{channel.service.d.ts → channel.service.sdk.d.ts} +6 -8
  55. package/dist/services/channel.service.sdk.d.ts.map +1 -0
  56. package/dist/services/channel.service.sdk.js +265 -0
  57. package/dist/services/channel.service.sdk.js.map +1 -0
  58. package/dist/services/index.d.ts +4 -3
  59. package/dist/services/index.d.ts.map +1 -1
  60. package/dist/services/index.js +7 -5
  61. package/dist/services/index.js.map +1 -1
  62. package/dist/services/product.service.sdk.d.ts +22 -0
  63. package/dist/services/product.service.sdk.d.ts.map +1 -0
  64. package/dist/services/product.service.sdk.js +242 -0
  65. package/dist/services/product.service.sdk.js.map +1 -0
  66. package/dist/services/{stream.service.d.ts → stream.service.sdk.d.ts} +4 -12
  67. package/dist/services/stream.service.sdk.d.ts.map +1 -0
  68. package/dist/services/stream.service.sdk.js +265 -0
  69. package/dist/services/stream.service.sdk.js.map +1 -0
  70. package/dist/setup/output-renderer.d.ts +39 -0
  71. package/dist/setup/output-renderer.d.ts.map +1 -0
  72. package/dist/setup/output-renderer.js +151 -0
  73. package/dist/setup/output-renderer.js.map +1 -0
  74. package/dist/setup/resource-handlers.d.ts +13 -0
  75. package/dist/setup/resource-handlers.d.ts.map +1 -0
  76. package/dist/setup/resource-handlers.js +136 -0
  77. package/dist/setup/resource-handlers.js.map +1 -0
  78. package/dist/setup/scene-config-loader.d.ts +52 -0
  79. package/dist/setup/scene-config-loader.d.ts.map +1 -0
  80. package/dist/setup/scene-config-loader.js +275 -0
  81. package/dist/setup/scene-config-loader.js.map +1 -0
  82. package/dist/setup/scene-executor.d.ts +44 -0
  83. package/dist/setup/scene-executor.d.ts.map +1 -0
  84. package/dist/setup/scene-executor.js +162 -0
  85. package/dist/setup/scene-executor.js.map +1 -0
  86. package/dist/setup/variable-resolver.d.ts +16 -0
  87. package/dist/setup/variable-resolver.d.ts.map +1 -0
  88. package/dist/setup/variable-resolver.js +176 -0
  89. package/dist/setup/variable-resolver.js.map +1 -0
  90. package/dist/setup-scenes/e-commerce.yaml +123 -0
  91. package/dist/types/auth-source.types.d.ts +7 -6
  92. package/dist/types/auth-source.types.d.ts.map +1 -1
  93. package/dist/types/auth-source.types.js +8 -5
  94. package/dist/types/auth-source.types.js.map +1 -1
  95. package/dist/types/index.d.ts +1 -0
  96. package/dist/types/index.d.ts.map +1 -1
  97. package/dist/types/index.js +1 -0
  98. package/dist/types/index.js.map +1 -1
  99. package/dist/types/product.d.ts +135 -0
  100. package/dist/types/product.d.ts.map +1 -0
  101. package/dist/types/product.js +3 -0
  102. package/dist/types/product.js.map +1 -0
  103. package/dist/utils/data-manager.d.ts +3 -3
  104. package/dist/utils/data-manager.d.ts.map +1 -1
  105. package/dist/utils/data-manager.js.map +1 -1
  106. package/package.json +33 -32
  107. package/dist/services/channel.service.d.ts.map +0 -1
  108. package/dist/services/channel.service.js +0 -672
  109. package/dist/services/channel.service.js.map +0 -1
  110. package/dist/services/stream.service.d.ts.map +0 -1
  111. package/dist/services/stream.service.js +0 -489
  112. package/dist/services/stream.service.js.map +0 -1
@@ -1,7 +1,6 @@
1
1
  import { ChannelCreateRequest, ChannelModel, ChannelServiceConfig, ChannelListRequest, ChannelListItem, ChannelDetailRequest, ChannelDetailModel, ChannelUpdateRequest, ChannelUpdateResponse, ChannelDeleteResponse, ChannelBatchDeleteRequest, ChannelBatchDeleteResponse } from '../types/channel';
2
2
  import { AuthConfig } from '../types/auth';
3
- export declare class ChannelService {
4
- private readonly httpClient;
3
+ export declare class ChannelServiceSdk {
5
4
  private readonly config;
6
5
  private readonly authConfig;
7
6
  constructor(authConfig: AuthConfig, serviceConfig: ChannelServiceConfig);
@@ -11,15 +10,14 @@ export declare class ChannelService {
11
10
  updateChannel(request: ChannelUpdateRequest): Promise<ChannelUpdateResponse>;
12
11
  deleteChannel(channelId: string): Promise<ChannelDeleteResponse>;
13
12
  batchDeleteChannels(request: ChannelBatchDeleteRequest): Promise<ChannelBatchDeleteResponse>;
13
+ private validateCreateRequest;
14
14
  private validateListRequest;
15
15
  private validateChannelDetailRequest;
16
16
  private validateChannelUpdateRequest;
17
17
  private validateChannelId;
18
18
  private validateBatchDeleteRequest;
19
- private createHttpClient;
20
- private validateCreateRequest;
21
- private transformToChannelModel;
22
- private transformAxiosError;
23
- private sanitizeRequest;
19
+ private mapWatchStatus;
20
+ private mapBasicSetting;
21
+ private handleError;
24
22
  }
25
- //# sourceMappingURL=channel.service.d.ts.map
23
+ //# sourceMappingURL=channel.service.sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.service.sdk.d.ts","sourceRoot":"","sources":["../../src/services/channel.service.sdk.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,oBAAoB,EACpB,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAE3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAqB3C,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAO5B,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB;IAUjE,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,YAAY,CAAC;IA2CnE,YAAY,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA+C1E,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAsB5E,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IA8B5E,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAwBhE,mBAAmB,CAAC,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAoBlG,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,mBAAmB;IAqB3B,OAAO,CAAC,4BAA4B;IAWpC,OAAO,CAAC,4BAA4B;IAqBpC,OAAO,CAAC,iBAAiB;IAWzB,OAAO,CAAC,0BAA0B;IAalC,OAAO,CAAC,cAAc;IAYtB,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,WAAW;CAuCpB"}
@@ -0,0 +1,265 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChannelServiceSdk = void 0;
4
+ const errors_1 = require("../utils/errors");
5
+ const sdk_1 = require("../sdk");
6
+ const SCENE_MAP = {
7
+ 'topclass': 'topclass',
8
+ 'cloudclass': 'seminar',
9
+ 'telecast': 'double',
10
+ 'akt': 'guide',
11
+ };
12
+ const TEMPLATE_MAP = {
13
+ 'ppt': 'ppt',
14
+ 'video': 'alone',
15
+ };
16
+ class ChannelServiceSdk {
17
+ constructor(authConfig, serviceConfig) {
18
+ this.authConfig = authConfig;
19
+ this.config = serviceConfig;
20
+ }
21
+ async createChannel(request) {
22
+ try {
23
+ this.validateCreateRequest(request);
24
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
25
+ const sdkScene = SCENE_MAP[request.newScene] || 'topclass';
26
+ const sdkTemplate = TEMPLATE_MAP[request.template] || 'ppt';
27
+ const createParams = {
28
+ name: request.name,
29
+ newScene: sdkScene,
30
+ template: sdkTemplate,
31
+ channelPasswd: request.channelPasswd,
32
+ linkMicLimit: request.linkMicLimit,
33
+ startTime: request.startTime,
34
+ endTime: request.endTime,
35
+ };
36
+ const result = await client.v4Channel.create(createParams);
37
+ return {
38
+ channelId: String(result.channelId),
39
+ name: request.name,
40
+ userId: result.userId || this.authConfig.userId || '',
41
+ channelPasswd: request.channelPasswd || '',
42
+ newScene: request.newScene,
43
+ template: request.template,
44
+ status: 'waiting',
45
+ createdAt: new Date(),
46
+ };
47
+ }
48
+ catch (error) {
49
+ throw this.handleError(error, 'createChannel');
50
+ }
51
+ }
52
+ async listChannels(request = {}) {
53
+ try {
54
+ this.validateListRequest(request);
55
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
56
+ const pageNumber = request.page ?? 1;
57
+ const pageSize = request.limit ?? 20;
58
+ const result = await client.v4Channel.channelDetailList({
59
+ pageNumber,
60
+ pageSize,
61
+ });
62
+ if (!result?.contents || result.contents.length === 0) {
63
+ return [];
64
+ }
65
+ let channels = result.contents;
66
+ if (request.keyword) {
67
+ channels = channels.filter((ch) => ch.name?.toLowerCase().includes(request.keyword.toLowerCase()));
68
+ }
69
+ return channels.map((channel) => ({
70
+ channelId: String(channel.channelId),
71
+ name: channel.name,
72
+ status: this.mapWatchStatus(channel.watchStatus),
73
+ createdAt: new Date(channel.startTime || Date.now()),
74
+ scene: channel.newScene || channel.scene,
75
+ template: channel.template,
76
+ description: '',
77
+ ...(channel.maxViewer && channel.maxViewer > 0 && { maxViewers: channel.maxViewer }),
78
+ }));
79
+ }
80
+ catch (error) {
81
+ throw this.handleError(error, 'listChannels');
82
+ }
83
+ }
84
+ async getChannelDetail(request) {
85
+ try {
86
+ this.validateChannelDetailRequest(request);
87
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
88
+ const result = await client.v4Channel.getChannel({
89
+ channelId: request.channelId,
90
+ });
91
+ return result;
92
+ }
93
+ catch (error) {
94
+ throw this.handleError(error, 'getChannelDetail');
95
+ }
96
+ }
97
+ async updateChannel(request) {
98
+ try {
99
+ this.validateChannelUpdateRequest(request);
100
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
101
+ if (request.basicSetting) {
102
+ await client.channel.updateChannel(request.channelId, this.mapBasicSetting(request.basicSetting));
103
+ }
104
+ return {
105
+ code: 200,
106
+ status: 'success',
107
+ success: true,
108
+ data: null,
109
+ };
110
+ }
111
+ catch (error) {
112
+ throw this.handleError(error, 'updateChannel');
113
+ }
114
+ }
115
+ async deleteChannel(channelId) {
116
+ try {
117
+ this.validateChannelId(channelId);
118
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
119
+ await client.channel.batchDeleteChannels([channelId]);
120
+ return {
121
+ code: 200,
122
+ status: 'success',
123
+ data: true,
124
+ };
125
+ }
126
+ catch (error) {
127
+ throw this.handleError(error, 'deleteChannel');
128
+ }
129
+ }
130
+ async batchDeleteChannels(request) {
131
+ try {
132
+ this.validateBatchDeleteRequest(request);
133
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
134
+ await client.channel.batchDeleteChannels(request.channelIds);
135
+ return {
136
+ code: 200,
137
+ status: 'success',
138
+ data: true,
139
+ };
140
+ }
141
+ catch (error) {
142
+ throw this.handleError(error, 'batchDeleteChannels');
143
+ }
144
+ }
145
+ validateCreateRequest(request) {
146
+ const errors = [];
147
+ if (!request.name || typeof request.name !== 'string') {
148
+ errors.push('Channel name is required and must be a string');
149
+ }
150
+ else if (request.name.length === 0) {
151
+ errors.push('Channel name cannot be empty');
152
+ }
153
+ else if (request.name.length > 100) {
154
+ errors.push('Channel name cannot exceed 100 characters');
155
+ }
156
+ if (!request.newScene || !['topclass', 'cloudclass', 'telecast', 'akt'].includes(request.newScene)) {
157
+ errors.push('newScene must be one of: topclass, cloudclass, telecast, akt');
158
+ }
159
+ if (!request.template || !['ppt', 'video'].includes(request.template)) {
160
+ errors.push('template must be one of: ppt, video');
161
+ }
162
+ if (errors.length > 0) {
163
+ throw new errors_1.PolyVValidationError(`Channel creation request validation failed: ${errors.join(', ')}`, 'request', request, 'validation_failed');
164
+ }
165
+ }
166
+ validateListRequest(request) {
167
+ const errors = [];
168
+ if (request.page !== undefined && (typeof request.page !== 'number' || request.page < 1)) {
169
+ errors.push('page must be a positive integer (minimum 1)');
170
+ }
171
+ if (request.limit !== undefined && (typeof request.limit !== 'number' || request.limit < 1 || request.limit > 100)) {
172
+ errors.push('limit must be an integer between 1 and 100');
173
+ }
174
+ if (errors.length > 0) {
175
+ throw new errors_1.PolyVValidationError(`Channel list request validation failed: ${errors.join(', ')}`, 'request', request, 'validation_failed');
176
+ }
177
+ }
178
+ validateChannelDetailRequest(request) {
179
+ if (!request.channelId || typeof request.channelId !== 'string') {
180
+ throw new errors_1.PolyVValidationError('channelId is required and must be a string', 'channelId', request, 'validation_failed');
181
+ }
182
+ }
183
+ validateChannelUpdateRequest(request) {
184
+ const errors = [];
185
+ if (!request.channelId || typeof request.channelId !== 'string') {
186
+ errors.push('channelId is required and must be a string');
187
+ }
188
+ if (!request.basicSetting && !request.authSettings) {
189
+ errors.push('at least one update field must be provided');
190
+ }
191
+ if (errors.length > 0) {
192
+ throw new errors_1.PolyVValidationError(`Channel update request validation failed: ${errors.join(', ')}`, 'request', request, 'validation_failed');
193
+ }
194
+ }
195
+ validateChannelId(channelId) {
196
+ if (!channelId || typeof channelId !== 'string') {
197
+ throw new errors_1.PolyVValidationError('channelId is required and must be a string', 'channelId', channelId, 'validation_failed');
198
+ }
199
+ }
200
+ validateBatchDeleteRequest(request) {
201
+ if (!request.channelIds || !Array.isArray(request.channelIds) || request.channelIds.length === 0) {
202
+ throw new errors_1.PolyVValidationError('channelIds is required and must be a non-empty array', 'channelIds', request, 'validation_failed');
203
+ }
204
+ }
205
+ mapWatchStatus(status) {
206
+ const statusMap = {
207
+ 'waiting': 'waiting',
208
+ 'living': 'live',
209
+ 'live': 'live',
210
+ 'end': 'end',
211
+ 'ended': 'end',
212
+ 'unStart': 'unStart',
213
+ };
214
+ return statusMap[status] || 'waiting';
215
+ }
216
+ mapBasicSetting(setting) {
217
+ const result = {};
218
+ if ('name' in setting && setting.name !== undefined)
219
+ result['name'] = setting['name'];
220
+ if ('channelPasswd' in setting && setting['channelPasswd'] !== undefined)
221
+ result['channelPasswd'] = setting['channelPasswd'];
222
+ if ('publisher' in setting && setting['publisher'] !== undefined)
223
+ result['publisher'] = setting['publisher'];
224
+ if ('desc' in setting && setting['desc'] !== undefined)
225
+ result['desc'] = setting['desc'];
226
+ if ('startTime' in setting && setting['startTime'] !== undefined)
227
+ result['startTime'] = setting['startTime'];
228
+ if ('endTime' in setting && setting['endTime'] !== undefined)
229
+ result['endTime'] = setting['endTime'];
230
+ if ('pageView' in setting && setting['pageView'] !== undefined)
231
+ result['pageView'] = setting['pageView'];
232
+ if ('likes' in setting && setting['likes'] !== undefined)
233
+ result['likes'] = setting['likes'];
234
+ if ('coverImg' in setting && setting['coverImg'] !== undefined)
235
+ result['coverImg'] = setting['coverImg'];
236
+ if ('splashImg' in setting && setting['splashImg'] !== undefined)
237
+ result['splashImg'] = setting['splashImg'];
238
+ if ('maxViewer' in setting && setting['maxViewer'] !== undefined)
239
+ result['maxViewer'] = setting['maxViewer'];
240
+ if ('maxViewerRestrict' in setting && setting['maxViewerRestrict'] !== undefined)
241
+ result['maxViewerRestrict'] = setting['maxViewerRestrict'];
242
+ return result;
243
+ }
244
+ handleError(error, operation) {
245
+ if (this.config.debug) {
246
+ console.error(`[ChannelServiceSdk] Error in ${operation}:`, error);
247
+ }
248
+ if (error instanceof errors_1.PolyVError || error instanceof errors_1.PolyVAPIError || error instanceof errors_1.PolyVValidationError) {
249
+ return error;
250
+ }
251
+ if (error instanceof Error) {
252
+ const anyError = error;
253
+ if (anyError.polyvCode || anyError.code) {
254
+ return new errors_1.PolyVAPIError(error.message, anyError.code || 'API_ERROR', anyError.status || 500, {
255
+ polyvCode: anyError.polyvCode,
256
+ polyvMessage: anyError.polyvMessage || error.message,
257
+ });
258
+ }
259
+ return new errors_1.PolyVError(`Failed to ${operation}: ${error.message}`, 'CHANNEL_SERVICE_ERROR', 500, { originalError: error.message });
260
+ }
261
+ return new errors_1.PolyVError(`Failed to ${operation}: Unknown error`, 'UNKNOWN_ERROR', 500, { originalError: String(error) });
262
+ }
263
+ }
264
+ exports.ChannelServiceSdk = ChannelServiceSdk;
265
+ //# sourceMappingURL=channel.service.sdk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"channel.service.sdk.js","sourceRoot":"","sources":["../../src/services/channel.service.sdk.ts"],"names":[],"mappings":";;;AAsBA,4CAAkF;AAClF,gCAAyC;AAGzC,MAAM,SAAS,GAA2B;IACxC,UAAU,EAAE,UAAU;IACtB,YAAY,EAAE,SAAS;IACvB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,OAAO;CACf,CAAC;AAGF,MAAM,YAAY,GAA2B;IAC3C,KAAK,EAAE,KAAK;IACZ,OAAO,EAAE,OAAO;CACjB,CAAC;AAKF,MAAa,iBAAiB;IAS5B,YAAY,UAAsB,EAAE,aAAmC;QACrE,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,MAAM,GAAG,aAAa,CAAC;IAC9B,CAAC;IAOD,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,IAAI,CAAC;YACH,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;YAEpC,MAAM,MAAM,GAAG,IAAA,qBAAe,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;YAGrE,MAAM,Q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J,CAAC;CACF;AA7XD,8CA6XC"}
@@ -1,6 +1,7 @@
1
- export { ChannelService } from './channel.service';
2
- export { StreamService } from './stream.service';
3
- export type { StreamServiceConfig } from './stream.service';
1
+ export { ChannelServiceSdk } from './channel.service.sdk';
2
+ export { StreamServiceSdk } from './stream.service.sdk';
3
+ export type { StreamServiceConfig } from './stream.service.sdk';
4
+ export { ProductServiceSdk } from './product.service.sdk';
4
5
  export { SystemResourceService } from './system-resource.service';
5
6
  export type { SystemResourcesDetailed, NetworkInterface } from './system-resource.service';
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAGnD,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,YAAY,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAClE,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SystemResourceService = exports.StreamService = exports.ChannelService = void 0;
4
- var channel_service_1 = require("./channel.service");
5
- Object.defineProperty(exports, "ChannelService", { enumerable: true, get: function () { return channel_service_1.ChannelService; } });
6
- var stream_service_1 = require("./stream.service");
7
- Object.defineProperty(exports, "StreamService", { enumerable: true, get: function () { return stream_service_1.StreamService; } });
3
+ exports.SystemResourceService = exports.ProductServiceSdk = exports.StreamServiceSdk = exports.ChannelServiceSdk = void 0;
4
+ var channel_service_sdk_1 = require("./channel.service.sdk");
5
+ Object.defineProperty(exports, "ChannelServiceSdk", { enumerable: true, get: function () { return channel_service_sdk_1.ChannelServiceSdk; } });
6
+ var stream_service_sdk_1 = require("./stream.service.sdk");
7
+ Object.defineProperty(exports, "StreamServiceSdk", { enumerable: true, get: function () { return stream_service_sdk_1.StreamServiceSdk; } });
8
+ var product_service_sdk_1 = require("./product.service.sdk");
9
+ Object.defineProperty(exports, "ProductServiceSdk", { enumerable: true, get: function () { return product_service_sdk_1.ProductServiceSdk; } });
8
10
  var system_resource_service_1 = require("./system-resource.service");
9
11
  Object.defineProperty(exports, "SystemResourceService", { enumerable: true, get: function () { return system_resource_service_1.SystemResourceService; } });
10
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAOA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAGvB,mDAAiD;AAAxC,+GAAA,aAAa,OAAA;AAItB,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":";;;AAOA,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAG1B,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AAIzB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAG1B,qEAAkE;AAAzD,gIAAA,qBAAqB,OAAA"}
@@ -0,0 +1,22 @@
1
+ import { ProductListRequest, ProductListItem, ProductAddOptions, ProductAddResult, ProductUpdateOptions, ProductDeleteOptions } from '../types/product';
2
+ import { AuthConfig } from '../types/auth';
3
+ export interface ProductServiceConfig {
4
+ baseUrl: string;
5
+ timeout: number;
6
+ debug: boolean;
7
+ }
8
+ export declare class ProductServiceSdk {
9
+ private readonly config;
10
+ private readonly authConfig;
11
+ constructor(authConfig: AuthConfig, serviceConfig: ProductServiceConfig);
12
+ listProducts(request?: ProductListRequest): Promise<ProductListItem[]>;
13
+ addProduct(options: ProductAddOptions): Promise<ProductAddResult>;
14
+ updateProduct(options: ProductUpdateOptions): Promise<boolean>;
15
+ deleteProduct(options: ProductDeleteOptions): Promise<boolean>;
16
+ private validateListRequest;
17
+ private validateAddOptions;
18
+ private validateUpdateOptions;
19
+ private validateDeleteOptions;
20
+ private handleError;
21
+ }
22
+ //# sourceMappingURL=product.service.sdk.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"product.service.sdk.d.ts","sourceRoot":"","sources":["../../src/services/product.service.sdk.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAW3C,MAAM,WAAW,oBAAoB;IAEnC,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,MAAM,CAAC;IAEhB,KAAK,EAAE,OAAO,CAAC;CAChB;AAKD,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuB;IAC9C,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAa;gBAO5B,UAAU,EAAE,UAAU,EAAE,aAAa,EAAE,oBAAoB;IAUjE,YAAY,CAAC,OAAO,GAAE,kBAAuB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA+C1E,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA0DjE,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiD9D,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,OAAO,CAAC;IAiBpE,OAAO,CAAC,mBAAmB;IA6B3B,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,qBAAqB;IA6B7B,OAAO,CAAC,qBAAqB;IAsB7B,OAAO,CAAC,WAAW;CAsCpB"}
@@ -0,0 +1,242 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProductServiceSdk = void 0;
4
+ const errors_1 = require("../utils/errors");
5
+ const sdk_1 = require("../sdk");
6
+ class ProductServiceSdk {
7
+ constructor(authConfig, serviceConfig) {
8
+ this.authConfig = authConfig;
9
+ this.config = serviceConfig;
10
+ }
11
+ async listProducts(request = {}) {
12
+ try {
13
+ this.validateListRequest(request);
14
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
15
+ const pageNumber = request.page ?? 1;
16
+ const pageSize = request.size ?? 20;
17
+ const result = await client.v4User.listProducts({
18
+ pageNumber,
19
+ pageSize,
20
+ });
21
+ if (!result?.contents || result.contents.length === 0) {
22
+ return [];
23
+ }
24
+ let products = result.contents;
25
+ if (request.channelId) {
26
+ products = products.filter((p) => String(p.channelId) === request.channelId);
27
+ }
28
+ return products.map((product) => ({
29
+ productId: String(product.productId),
30
+ channelId: String(product.channelId || ''),
31
+ name: product.name,
32
+ productType: product.productType,
33
+ status: product.status,
34
+ ...(product.price && { price: product.price }),
35
+ ...(product.realPrice && { realPrice: product.realPrice }),
36
+ createdAt: product.createdTime ? new Date(product.createdTime) : new Date(0),
37
+ updatedAt: product.updatedTime ? new Date(product.updatedTime) : new Date(0)
38
+ }));
39
+ }
40
+ catch (error) {
41
+ throw this.handleError(error, 'listProducts');
42
+ }
43
+ }
44
+ async addProduct(options) {
45
+ try {
46
+ this.validateAddOptions(options);
47
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
48
+ const params = {
49
+ channelId: options.channelId,
50
+ name: options.name,
51
+ status: options.status,
52
+ linkType: options.linkType,
53
+ ...(options.productType && { productType: options.productType }),
54
+ ...(options.cover && { cover: options.cover }),
55
+ ...(options.link && { link: options.link }),
56
+ ...(options.pcLink && { pcLink: options.pcLink }),
57
+ ...(options.mobileLink && { mobileLink: options.mobileLink }),
58
+ ...(options.wxMiniprogramLink && { wxMiniprogramLink: options.wxMiniprogramLink }),
59
+ ...(options.wxMiniprogramOriginalId && { wxMiniprogramOriginalId: options.wxMiniprogramOriginalId }),
60
+ ...(options.mobileAppLink && { mobileAppLink: options.mobileAppLink }),
61
+ ...(options.androidLink && { androidLink: options.androidLink }),
62
+ ...(options.iosLink && { iosLink: options.iosLink }),
63
+ ...(options.params && { params: options.params }),
64
+ ...(options.productDesc && { productDesc: options.productDesc }),
65
+ ...(options.features && { features: options.features }),
66
+ ...(options.btnShow && { btnShow: options.btnShow }),
67
+ ...(options.yield && { yield: options.yield }),
68
+ ...(options.originId && { originId: options.originId }),
69
+ ...(options.strategy && { strategy: options.strategy }),
70
+ ...(options.productDetail && { productDetail: options.productDetail }),
71
+ ...(options.ext && { ext: options.ext }),
72
+ ...(options.tagIds && { tagIds: options.tagIds }),
73
+ ...(options.priceType && { priceType: options.priceType }),
74
+ ...(options.realPrice !== undefined && { realPrice: options.realPrice }),
75
+ ...(options.customPrice && { customPrice: options.customPrice }),
76
+ ...(options.originalPriceType && { originalPriceType: options.originalPriceType }),
77
+ ...(options.price !== undefined && { price: options.price }),
78
+ ...(options.customOrignalPrice && { customOrignalPrice: options.customOrignalPrice }),
79
+ };
80
+ const result = await client.channel.addChannelProduct(params);
81
+ return {
82
+ productId: result.productId,
83
+ name: result.name,
84
+ channelId: result.channelId,
85
+ createdTime: result.createdTime
86
+ };
87
+ }
88
+ catch (error) {
89
+ throw this.handleError(error, 'addProduct');
90
+ }
91
+ }
92
+ async updateProduct(options) {
93
+ try {
94
+ this.validateUpdateOptions(options);
95
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
96
+ const params = {
97
+ channelId: options.channelId,
98
+ productId: options.productId,
99
+ name: options.name,
100
+ status: options.status,
101
+ linkType: options.linkType,
102
+ ...(options.cover && { cover: options.cover }),
103
+ ...(options.link && { link: options.link }),
104
+ ...(options.pcLink && { pcLink: options.pcLink }),
105
+ ...(options.mobileLink && { mobileLink: options.mobileLink }),
106
+ ...(options.wxMiniprogramLink && { wxMiniprogramLink: options.wxMiniprogramLink }),
107
+ ...(options.wxMiniprogramOriginalId && { wxMiniprogramOriginalId: options.wxMiniprogramOriginalId }),
108
+ ...(options.mobileAppLink && { mobileAppLink: options.mobileAppLink }),
109
+ ...(options.androidLink && { androidLink: options.androidLink }),
110
+ ...(options.iosLink && { iosLink: options.iosLink }),
111
+ ...(options.params && { params: options.params }),
112
+ ...(options.productDesc && { productDesc: options.productDesc }),
113
+ ...(options.features && { features: options.features }),
114
+ ...(options.btnShow && { btnShow: options.btnShow }),
115
+ ...(options.yield && { yield: options.yield }),
116
+ ...(options.productDetail && { productDetail: options.productDetail }),
117
+ ...(options.ext && { ext: options.ext }),
118
+ ...(options.tagIds && { tagIds: options.tagIds }),
119
+ ...(options.priceType && { priceType: options.priceType }),
120
+ ...(options.realPrice !== undefined && { realPrice: options.realPrice }),
121
+ ...(options.customPrice && { customPrice: options.customPrice }),
122
+ ...(options.originalPriceType && { originalPriceType: options.originalPriceType }),
123
+ ...(options.price !== undefined && { price: options.price }),
124
+ ...(options.customOrignalPrice && { customOrignalPrice: options.customOrignalPrice }),
125
+ };
126
+ return await client.channel.updateChannelProduct(params);
127
+ }
128
+ catch (error) {
129
+ throw this.handleError(error, 'updateProduct');
130
+ }
131
+ }
132
+ async deleteProduct(options) {
133
+ try {
134
+ this.validateDeleteOptions(options);
135
+ const client = (0, sdk_1.createSdkClient)(this.authConfig, this.config.baseUrl);
136
+ return await client.channel.deleteChannelProduct({
137
+ channelId: options.channelId,
138
+ productId: options.productId
139
+ });
140
+ }
141
+ catch (error) {
142
+ throw this.handleError(error, 'deleteProduct');
143
+ }
144
+ }
145
+ validateListRequest(request) {
146
+ const errors = [];
147
+ if (request.page !== undefined) {
148
+ if (typeof request.page !== 'number' || !Number.isInteger(request.page) || request.page < 1) {
149
+ errors.push('page must be a positive integer (minimum 1)');
150
+ }
151
+ }
152
+ if (request.size !== undefined) {
153
+ if (typeof request.size !== 'number' || !Number.isInteger(request.size) || request.size < 1 || request.size > 100) {
154
+ errors.push('size must be an integer between 1 and 100');
155
+ }
156
+ }
157
+ if (request.channelId !== undefined && (typeof request.channelId !== 'string' || request.channelId.trim().length === 0)) {
158
+ errors.push('channelId must be a non-empty string');
159
+ }
160
+ if (errors.length > 0) {
161
+ throw new errors_1.PolyVValidationError(`Product list request validation failed: ${errors.join(', ')}`, 'request', request, 'validation_failed');
162
+ }
163
+ }
164
+ validateAddOptions(options) {
165
+ const errors = [];
166
+ if (!options.channelId || options.channelId.trim() === '') {
167
+ errors.push('channelId is required');
168
+ }
169
+ if (!options.name || options.name.trim() === '') {
170
+ errors.push('name is required');
171
+ }
172
+ if (options.status === undefined) {
173
+ errors.push('status is required (1 for on-shelf, 2 for off-shelf)');
174
+ }
175
+ else if (![1, 2].includes(options.status)) {
176
+ errors.push('status must be 1 (on-shelf) or 2 (off-shelf)');
177
+ }
178
+ if (options.linkType === undefined) {
179
+ errors.push('linkType is required (10 for universal, 11 for multi-platform)');
180
+ }
181
+ else if (![10, 11].includes(options.linkType)) {
182
+ errors.push('linkType must be 10 (universal) or 11 (multi-platform)');
183
+ }
184
+ if (options.linkType === 10 && (!options.link || options.link.trim() === '')) {
185
+ errors.push('link is required when linkType is 10');
186
+ }
187
+ if (errors.length > 0) {
188
+ throw new errors_1.PolyVValidationError(`Product add options validation failed: ${errors.join(', ')}`, 'options', options, 'validation_failed');
189
+ }
190
+ }
191
+ validateUpdateOptions(options) {
192
+ const errors = [];
193
+ if (!options.channelId || options.channelId.trim() === '') {
194
+ errors.push('channelId is required');
195
+ }
196
+ if (options.productId === undefined) {
197
+ errors.push('productId is required');
198
+ }
199
+ if (options.status !== undefined && ![1, 2].includes(options.status)) {
200
+ errors.push('status must be 1 or 2');
201
+ }
202
+ if (options.linkType !== undefined && ![10, 11].includes(options.linkType)) {
203
+ errors.push('linkType must be 10 or 11');
204
+ }
205
+ if (errors.length > 0) {
206
+ throw new errors_1.PolyVValidationError(`Product update options validation failed: ${errors.join(', ')}`, 'options', options, 'validation_failed');
207
+ }
208
+ }
209
+ validateDeleteOptions(options) {
210
+ const errors = [];
211
+ if (!options.channelId || options.channelId.trim() === '') {
212
+ errors.push('channelId is required');
213
+ }
214
+ if (options.productId === undefined) {
215
+ errors.push('productId is required');
216
+ }
217
+ if (errors.length > 0) {
218
+ throw new errors_1.PolyVValidationError(`Product delete options validation failed: ${errors.join(', ')}`, 'options', options, 'validation_failed');
219
+ }
220
+ }
221
+ handleError(error, operation) {
222
+ if (this.config.debug) {
223
+ console.error(`[ProductServiceSdk] Error in ${operation}:`, error);
224
+ }
225
+ if (error instanceof errors_1.PolyVError || error instanceof errors_1.PolyVAPIError || error instanceof errors_1.PolyVValidationError) {
226
+ return error;
227
+ }
228
+ if (error instanceof Error) {
229
+ const anyError = error;
230
+ if (anyError.polyvCode || anyError.code) {
231
+ return new errors_1.PolyVAPIError(error.message, anyError.code || 'API_ERROR', anyError.status || 500, {
232
+ polyvCode: anyError.polyvCode,
233
+ polyvMessage: anyError.polyvMessage || error.message,
234
+ });
235
+ }
236
+ return new errors_1.PolyVError(`Failed to ${operation}: ${error.message}`, 'PRODUCT_SERVICE_ERROR', 500, { originalError: error.message });
237
+ }
238
+ return new errors_1.PolyVError(`Failed to ${operation}: Unknown error`, 'UNKNOWN_ERROR', 500, { originalError: String(error) });
239
+ }
240
+ }
241
+ exports.ProductServiceSdk = ProductServiceSdk;
242
+ //# sourceMappingURL=product.service.sdk.js.map