@openxiot/xiot-core-spec-ts 0.0.2 → 0.0.4
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/index.d.ts +20 -11
- package/dist/index.js +20 -11
- package/dist/xiot/core/spec/codec/by/CreatorCodec.d.ts +5 -0
- package/dist/xiot/core/spec/codec/by/CreatorCodec.js +20 -0
- package/dist/xiot/core/spec/codec/by/UpdaterCodec.d.ts +5 -0
- package/dist/xiot/core/spec/codec/by/UpdaterCodec.js +20 -0
- package/dist/xiot/core/spec/codec/product/basic/ProductBasicCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/basic/ProductBasicCodec.js +55 -0
- package/dist/xiot/core/spec/codec/product/firmware/ProductFirmwareCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/firmware/ProductFirmwareCodec.js +44 -0
- package/dist/xiot/core/spec/codec/product/firmware/ProductFirmwareInstanceCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/firmware/ProductFirmwareInstanceCodec.js +63 -0
- package/dist/xiot/core/spec/codec/product/instance/ProductInstanceCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/instance/ProductInstanceCodec.js +46 -0
- package/dist/xiot/core/spec/codec/product/manual/ProductManualCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/manual/ProductManualCodec.js +79 -0
- package/dist/xiot/core/spec/codec/product/panel/ProductPanelCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/panel/ProductPanelCodec.js +99 -0
- package/dist/xiot/core/spec/codec/product/wizard/ProductWizardCodec.d.ts +7 -0
- package/dist/xiot/core/spec/codec/product/wizard/ProductWizardCodec.js +88 -0
- package/dist/xiot/core/spec/codec/version/GenericVersionCodec.d.ts +5 -0
- package/dist/xiot/core/spec/codec/version/GenericVersionCodec.js +16 -0
- package/dist/xiot/core/spec/typedef/by/Creator.d.ts +6 -0
- package/dist/xiot/core/spec/typedef/by/Creator.js +11 -0
- package/dist/xiot/core/spec/typedef/by/Updater.d.ts +6 -0
- package/dist/xiot/core/spec/typedef/by/Updater.js +11 -0
- package/dist/xiot/core/spec/typedef/instance/Action.d.ts +8 -0
- package/dist/xiot/core/spec/typedef/instance/Action.js +104 -0
- package/dist/xiot/core/spec/typedef/product/basic/ProductBasic.d.ts +19 -0
- package/dist/xiot/core/spec/typedef/product/basic/ProductBasic.js +21 -0
- package/dist/xiot/core/spec/typedef/product/firmware/ProductFirmware.d.ts +10 -0
- package/dist/xiot/core/spec/typedef/product/firmware/ProductFirmware.js +13 -0
- package/dist/xiot/core/spec/typedef/product/firmware/ProductFirmwareInstance.d.ts +21 -0
- package/dist/xiot/core/spec/typedef/product/firmware/ProductFirmwareInstance.js +24 -0
- package/dist/xiot/core/spec/typedef/product/instance/ProductInstance.d.ts +11 -0
- package/dist/xiot/core/spec/typedef/product/instance/ProductInstance.js +13 -0
- package/dist/xiot/core/spec/typedef/product/manual/ProductManual.d.ts +15 -0
- package/dist/xiot/core/spec/typedef/product/manual/ProductManual.js +20 -0
- package/dist/xiot/core/spec/typedef/product/panel/ProductPanel.d.ts +27 -0
- package/dist/xiot/core/spec/typedef/product/panel/ProductPanel.js +32 -0
- package/dist/xiot/core/spec/typedef/product/wizard/ProductWizard.d.ts +16 -0
- package/dist/xiot/core/spec/typedef/product/wizard/ProductWizard.js +21 -0
- package/dist/xiot/core/spec/typedef/version/GenericVersion.d.ts +5 -0
- package/dist/xiot/core/spec/typedef/version/GenericVersion.js +10 -0
- package/dist/xiot/core/spec/typedef/version/{Version.d.ts → SemanticVersion.d.ts} +2 -3
- package/dist/xiot/core/spec/typedef/version/SemanticVersion.js +21 -0
- package/package.json +1 -1
- package/LICENSE +0 -21
- package/dist/xiot/core/spec/codec/product/ProductCodec.d.ts +0 -7
- package/dist/xiot/core/spec/codec/product/ProductCodec.js +0 -76
- package/dist/xiot/core/spec/codec/product/ProductVersionCodec.d.ts +0 -7
- package/dist/xiot/core/spec/codec/product/ProductVersionCodec.js +0 -69
- package/dist/xiot/core/spec/codec/product/resource/ProductResourceCodec.d.ts +0 -7
- package/dist/xiot/core/spec/codec/product/resource/ProductResourceCodec.js +0 -45
- package/dist/xiot/core/spec/codec/product/resource/ProductResourceVersionCodec.d.ts +0 -7
- package/dist/xiot/core/spec/codec/product/resource/ProductResourceVersionCodec.js +0 -69
- package/dist/xiot/core/spec/codec/product/resource/ResourceVersionCodec.d.ts +0 -7
- package/dist/xiot/core/spec/codec/product/resource/ResourceVersionCodec.js +0 -65
- package/dist/xiot/core/spec/typedef/product/Product.d.ts +0 -22
- package/dist/xiot/core/spec/typedef/product/Product.js +0 -25
- package/dist/xiot/core/spec/typedef/product/ProductVersion.d.ts +0 -17
- package/dist/xiot/core/spec/typedef/product/ProductVersion.js +0 -24
- package/dist/xiot/core/spec/typedef/product/resource/ProductResource.d.ts +0 -8
- package/dist/xiot/core/spec/typedef/product/resource/ProductResource.js +0 -13
- package/dist/xiot/core/spec/typedef/product/resource/ProductResourceVersion.d.ts +0 -5
- package/dist/xiot/core/spec/typedef/product/resource/ProductResourceVersion.js +0 -12
- package/dist/xiot/core/spec/typedef/product/resource/ResourceVersion.d.ts +0 -16
- package/dist/xiot/core/spec/typedef/product/resource/ResourceVersion.js +0 -30
- package/dist/xiot/core/spec/typedef/version/Version.js +0 -40
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export * from './xiot/core/spec/typedef/app/event/EventReceiverType';
|
|
|
9
9
|
export * from './xiot/core/spec/typedef/app/event/impl/EventReceiverEventbusImpl';
|
|
10
10
|
export * from './xiot/core/spec/typedef/app/event/impl/EventReceiverHttpImpl';
|
|
11
11
|
export * from './xiot/core/spec/typedef/app/event/impl/EventReceiverKafkaImpl';
|
|
12
|
+
export * from './xiot/core/spec/typedef/by/Creator';
|
|
13
|
+
export * from './xiot/core/spec/typedef/by/Updater';
|
|
12
14
|
export * from './xiot/core/spec/typedef/constant/Spec';
|
|
13
15
|
export * from './xiot/core/spec/typedef/definition/ActionDefinition';
|
|
14
16
|
export * from './xiot/core/spec/typedef/definition/ArgumentDefinition';
|
|
@@ -122,11 +124,14 @@ export * from './xiot/core/spec/typedef/operation/RuleOperation';
|
|
|
122
124
|
export * from './xiot/core/spec/typedef/operation/SleepOperation';
|
|
123
125
|
export * from './xiot/core/spec/typedef/ownership/Ownership';
|
|
124
126
|
export * from './xiot/core/spec/typedef/ownership/DeviceOwner';
|
|
125
|
-
export * from './xiot/core/spec/typedef/product/
|
|
126
|
-
export * from './xiot/core/spec/typedef/product/
|
|
127
|
-
export * from './xiot/core/spec/typedef/product/
|
|
128
|
-
export * from './xiot/core/spec/typedef/product/
|
|
129
|
-
export * from './xiot/core/spec/typedef/product/
|
|
127
|
+
export * from './xiot/core/spec/typedef/product/basic/ProductBasic';
|
|
128
|
+
export * from './xiot/core/spec/typedef/product/basic/ProductBasic';
|
|
129
|
+
export * from './xiot/core/spec/typedef/product/firmware/ProductFirmware';
|
|
130
|
+
export * from './xiot/core/spec/typedef/product/firmware/ProductFirmwareInstance';
|
|
131
|
+
export * from './xiot/core/spec/typedef/product/instance/ProductInstance';
|
|
132
|
+
export * from './xiot/core/spec/typedef/product/manual/ProductManual';
|
|
133
|
+
export * from './xiot/core/spec/typedef/product/panel/ProductPanel';
|
|
134
|
+
export * from './xiot/core/spec/typedef/product/wizard/ProductWizard';
|
|
130
135
|
export * from './xiot/core/spec/typedef/rbac/Permission';
|
|
131
136
|
export * from './xiot/core/spec/typedef/rbac/Role';
|
|
132
137
|
export * from './xiot/core/spec/typedef/rbac/account/Account';
|
|
@@ -181,7 +186,8 @@ export * from './xiot/core/spec/typedef/template/PropertyTemplate';
|
|
|
181
186
|
export * from './xiot/core/spec/typedef/template/ServiceTemplate';
|
|
182
187
|
export * from './xiot/core/spec/typedef/utils/TemplateHelper';
|
|
183
188
|
export * from './xiot/core/spec/typedef/utils/Stack';
|
|
184
|
-
export * from './xiot/core/spec/typedef/version/
|
|
189
|
+
export * from './xiot/core/spec/typedef/version/GenericVersion';
|
|
190
|
+
export * from './xiot/core/spec/typedef/version/SemanticVersion';
|
|
185
191
|
export * from './xiot/core/spec/typedef/somewhere/Somewhere';
|
|
186
192
|
export * from './xiot/core/spec/typedef/somewhere/Where';
|
|
187
193
|
export * from './xiot/core/spec/typedef/xid/ActionID';
|
|
@@ -272,11 +278,13 @@ export * from './xiot/core/spec/codec/operation/CombinationValueCodec';
|
|
|
272
278
|
export * from './xiot/core/spec/codec/operation/RuleOperationCodec';
|
|
273
279
|
export * from './xiot/core/spec/codec/ownership/OwnershipCodec';
|
|
274
280
|
export * from './xiot/core/spec/codec/ownership/DeviceOwnerCodec';
|
|
275
|
-
export * from './xiot/core/spec/codec/product/
|
|
276
|
-
export * from './xiot/core/spec/codec/product/
|
|
277
|
-
export * from './xiot/core/spec/codec/product/
|
|
278
|
-
export * from './xiot/core/spec/codec/product/
|
|
279
|
-
export * from './xiot/core/spec/codec/product/
|
|
281
|
+
export * from './xiot/core/spec/codec/product/basic/ProductBasicCodec';
|
|
282
|
+
export * from './xiot/core/spec/codec/product/firmware/ProductFirmwareCodec';
|
|
283
|
+
export * from './xiot/core/spec/codec/product/firmware/ProductFirmwareInstanceCodec';
|
|
284
|
+
export * from './xiot/core/spec/codec/product/instance/ProductInstanceCodec';
|
|
285
|
+
export * from './xiot/core/spec/codec/product/manual/ProductManualCodec';
|
|
286
|
+
export * from './xiot/core/spec/codec/product/panel/ProductPanelCodec';
|
|
287
|
+
export * from './xiot/core/spec/codec/product/wizard/ProductWizardCodec';
|
|
280
288
|
export * from './xiot/core/spec/codec/rbac/PermissionCodec';
|
|
281
289
|
export * from './xiot/core/spec/codec/rbac/RoleCodec';
|
|
282
290
|
export * from './xiot/core/spec/codec/rbac/account/AccountCodec';
|
|
@@ -288,6 +296,7 @@ export * from './xiot/core/spec/codec/shadow/DeviceShadowCodec';
|
|
|
288
296
|
export * from './xiot/core/spec/codec/space/SpaceCodec';
|
|
289
297
|
export * from './xiot/core/spec/codec/summary/SummaryCodec';
|
|
290
298
|
export * from './xiot/core/spec/codec/somewhere/SomewhereCodec';
|
|
299
|
+
export * from './xiot/core/spec/codec/version/GenericVersionCodec';
|
|
291
300
|
export * from './xiot/core/spec/codec/template/ActionTemplateCodec';
|
|
292
301
|
export * from './xiot/core/spec/codec/template/DeviceTemplateCodec';
|
|
293
302
|
export * from './xiot/core/spec/codec/template/ServiceTemplateCodec';
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,8 @@ __exportStar(require("./xiot/core/spec/typedef/app/event/EventReceiverType"), ex
|
|
|
25
25
|
__exportStar(require("./xiot/core/spec/typedef/app/event/impl/EventReceiverEventbusImpl"), exports);
|
|
26
26
|
__exportStar(require("./xiot/core/spec/typedef/app/event/impl/EventReceiverHttpImpl"), exports);
|
|
27
27
|
__exportStar(require("./xiot/core/spec/typedef/app/event/impl/EventReceiverKafkaImpl"), exports);
|
|
28
|
+
__exportStar(require("./xiot/core/spec/typedef/by/Creator"), exports);
|
|
29
|
+
__exportStar(require("./xiot/core/spec/typedef/by/Updater"), exports);
|
|
28
30
|
__exportStar(require("./xiot/core/spec/typedef/constant/Spec"), exports);
|
|
29
31
|
__exportStar(require("./xiot/core/spec/typedef/definition/ActionDefinition"), exports);
|
|
30
32
|
__exportStar(require("./xiot/core/spec/typedef/definition/ArgumentDefinition"), exports);
|
|
@@ -138,11 +140,14 @@ __exportStar(require("./xiot/core/spec/typedef/operation/RuleOperation"), export
|
|
|
138
140
|
__exportStar(require("./xiot/core/spec/typedef/operation/SleepOperation"), exports);
|
|
139
141
|
__exportStar(require("./xiot/core/spec/typedef/ownership/Ownership"), exports);
|
|
140
142
|
__exportStar(require("./xiot/core/spec/typedef/ownership/DeviceOwner"), exports);
|
|
141
|
-
__exportStar(require("./xiot/core/spec/typedef/product/
|
|
142
|
-
__exportStar(require("./xiot/core/spec/typedef/product/
|
|
143
|
-
__exportStar(require("./xiot/core/spec/typedef/product/
|
|
144
|
-
__exportStar(require("./xiot/core/spec/typedef/product/
|
|
145
|
-
__exportStar(require("./xiot/core/spec/typedef/product/
|
|
143
|
+
__exportStar(require("./xiot/core/spec/typedef/product/basic/ProductBasic"), exports);
|
|
144
|
+
__exportStar(require("./xiot/core/spec/typedef/product/basic/ProductBasic"), exports);
|
|
145
|
+
__exportStar(require("./xiot/core/spec/typedef/product/firmware/ProductFirmware"), exports);
|
|
146
|
+
__exportStar(require("./xiot/core/spec/typedef/product/firmware/ProductFirmwareInstance"), exports);
|
|
147
|
+
__exportStar(require("./xiot/core/spec/typedef/product/instance/ProductInstance"), exports);
|
|
148
|
+
__exportStar(require("./xiot/core/spec/typedef/product/manual/ProductManual"), exports);
|
|
149
|
+
__exportStar(require("./xiot/core/spec/typedef/product/panel/ProductPanel"), exports);
|
|
150
|
+
__exportStar(require("./xiot/core/spec/typedef/product/wizard/ProductWizard"), exports);
|
|
146
151
|
__exportStar(require("./xiot/core/spec/typedef/rbac/Permission"), exports);
|
|
147
152
|
__exportStar(require("./xiot/core/spec/typedef/rbac/Role"), exports);
|
|
148
153
|
__exportStar(require("./xiot/core/spec/typedef/rbac/account/Account"), exports);
|
|
@@ -197,7 +202,8 @@ __exportStar(require("./xiot/core/spec/typedef/template/PropertyTemplate"), expo
|
|
|
197
202
|
__exportStar(require("./xiot/core/spec/typedef/template/ServiceTemplate"), exports);
|
|
198
203
|
__exportStar(require("./xiot/core/spec/typedef/utils/TemplateHelper"), exports);
|
|
199
204
|
__exportStar(require("./xiot/core/spec/typedef/utils/Stack"), exports);
|
|
200
|
-
__exportStar(require("./xiot/core/spec/typedef/version/
|
|
205
|
+
__exportStar(require("./xiot/core/spec/typedef/version/GenericVersion"), exports);
|
|
206
|
+
__exportStar(require("./xiot/core/spec/typedef/version/SemanticVersion"), exports);
|
|
201
207
|
__exportStar(require("./xiot/core/spec/typedef/somewhere/Somewhere"), exports);
|
|
202
208
|
__exportStar(require("./xiot/core/spec/typedef/somewhere/Where"), exports);
|
|
203
209
|
__exportStar(require("./xiot/core/spec/typedef/xid/ActionID"), exports);
|
|
@@ -288,11 +294,13 @@ __exportStar(require("./xiot/core/spec/codec/operation/CombinationValueCodec"),
|
|
|
288
294
|
__exportStar(require("./xiot/core/spec/codec/operation/RuleOperationCodec"), exports);
|
|
289
295
|
__exportStar(require("./xiot/core/spec/codec/ownership/OwnershipCodec"), exports);
|
|
290
296
|
__exportStar(require("./xiot/core/spec/codec/ownership/DeviceOwnerCodec"), exports);
|
|
291
|
-
__exportStar(require("./xiot/core/spec/codec/product/
|
|
292
|
-
__exportStar(require("./xiot/core/spec/codec/product/
|
|
293
|
-
__exportStar(require("./xiot/core/spec/codec/product/
|
|
294
|
-
__exportStar(require("./xiot/core/spec/codec/product/
|
|
295
|
-
__exportStar(require("./xiot/core/spec/codec/product/
|
|
297
|
+
__exportStar(require("./xiot/core/spec/codec/product/basic/ProductBasicCodec"), exports);
|
|
298
|
+
__exportStar(require("./xiot/core/spec/codec/product/firmware/ProductFirmwareCodec"), exports);
|
|
299
|
+
__exportStar(require("./xiot/core/spec/codec/product/firmware/ProductFirmwareInstanceCodec"), exports);
|
|
300
|
+
__exportStar(require("./xiot/core/spec/codec/product/instance/ProductInstanceCodec"), exports);
|
|
301
|
+
__exportStar(require("./xiot/core/spec/codec/product/manual/ProductManualCodec"), exports);
|
|
302
|
+
__exportStar(require("./xiot/core/spec/codec/product/panel/ProductPanelCodec"), exports);
|
|
303
|
+
__exportStar(require("./xiot/core/spec/codec/product/wizard/ProductWizardCodec"), exports);
|
|
296
304
|
__exportStar(require("./xiot/core/spec/codec/rbac/PermissionCodec"), exports);
|
|
297
305
|
__exportStar(require("./xiot/core/spec/codec/rbac/RoleCodec"), exports);
|
|
298
306
|
__exportStar(require("./xiot/core/spec/codec/rbac/account/AccountCodec"), exports);
|
|
@@ -304,6 +312,7 @@ __exportStar(require("./xiot/core/spec/codec/shadow/DeviceShadowCodec"), exports
|
|
|
304
312
|
__exportStar(require("./xiot/core/spec/codec/space/SpaceCodec"), exports);
|
|
305
313
|
__exportStar(require("./xiot/core/spec/codec/summary/SummaryCodec"), exports);
|
|
306
314
|
__exportStar(require("./xiot/core/spec/codec/somewhere/SomewhereCodec"), exports);
|
|
315
|
+
__exportStar(require("./xiot/core/spec/codec/version/GenericVersionCodec"), exports);
|
|
307
316
|
__exportStar(require("./xiot/core/spec/codec/template/ActionTemplateCodec"), exports);
|
|
308
317
|
__exportStar(require("./xiot/core/spec/codec/template/DeviceTemplateCodec"), exports);
|
|
309
318
|
__exportStar(require("./xiot/core/spec/codec/template/ServiceTemplateCodec"), exports);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreatorCodec = void 0;
|
|
4
|
+
const Creator_1 = require("../../typedef/by/Creator");
|
|
5
|
+
class CreatorCodec {
|
|
6
|
+
static encode(x) {
|
|
7
|
+
return {
|
|
8
|
+
id: x.id,
|
|
9
|
+
name: x.name,
|
|
10
|
+
timestamp: x.timestamp
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static decode(o) {
|
|
14
|
+
if (o) {
|
|
15
|
+
return new Creator_1.Creator(o.id || '', o.name || '', o.timestamp || 0);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.CreatorCodec = CreatorCodec;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdaterCodec = void 0;
|
|
4
|
+
const Updater_1 = require("../../typedef/by/Updater");
|
|
5
|
+
class UpdaterCodec {
|
|
6
|
+
static encode(x) {
|
|
7
|
+
return {
|
|
8
|
+
id: x.id,
|
|
9
|
+
name: x.name,
|
|
10
|
+
timestamp: x.timestamp
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
static decode(o) {
|
|
14
|
+
if (o) {
|
|
15
|
+
return new Updater_1.Updater(o.id || '', o.name || '', o.timestamp || 0);
|
|
16
|
+
}
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.UpdaterCodec = UpdaterCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductBasic } from "../../../typedef/product/basic/ProductBasic";
|
|
2
|
+
export declare class ProductBasicCodec {
|
|
3
|
+
static decode(x: any): ProductBasic;
|
|
4
|
+
static encode(x: ProductBasic): any;
|
|
5
|
+
static decodeArray(arr: any[]): ProductBasic[];
|
|
6
|
+
static encodeArray(products: ProductBasic[]): any[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductBasicCodec = void 0;
|
|
4
|
+
const ProductBasic_1 = require("../../../typedef/product/basic/ProductBasic");
|
|
5
|
+
const DeviceType_1 = require("../../../typedef/definition/urn/DeviceType");
|
|
6
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
7
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
8
|
+
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
9
|
+
class ProductBasicCodec {
|
|
10
|
+
static decode(x) {
|
|
11
|
+
return new ProductBasic_1.ProductBasic(x.id, x.organization, x.model, DeviceType_1.DeviceType.parse(x.template), x.name, x.icon, x.upgrade, x.protocol, (0, Lifecycle_1.LifeCycleFromString)(x.lifecycle), x.naming, CreatorCodec_1.CreatorCodec.decode(x.creator), UpdaterCodec_1.UpdaterCodec.decode(x.updater));
|
|
12
|
+
}
|
|
13
|
+
static encode(x) {
|
|
14
|
+
let o = {
|
|
15
|
+
organization: x.organization,
|
|
16
|
+
model: x.model,
|
|
17
|
+
template: x.template.toString(),
|
|
18
|
+
icon: x.icon,
|
|
19
|
+
name: x.name,
|
|
20
|
+
upgrade: x.upgrade,
|
|
21
|
+
protocol: x.protocol,
|
|
22
|
+
lifecycle: x.lifecycle.toString(),
|
|
23
|
+
naming: x.naming
|
|
24
|
+
};
|
|
25
|
+
if (x.id > 0) {
|
|
26
|
+
o.id = x.id;
|
|
27
|
+
}
|
|
28
|
+
if (x.creator) {
|
|
29
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
30
|
+
}
|
|
31
|
+
if (x.updater) {
|
|
32
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
33
|
+
}
|
|
34
|
+
return o;
|
|
35
|
+
}
|
|
36
|
+
static decodeArray(arr) {
|
|
37
|
+
const list = [];
|
|
38
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
39
|
+
for (const o of arr) {
|
|
40
|
+
list.push(this.decode(o));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return list;
|
|
44
|
+
}
|
|
45
|
+
static encodeArray(products) {
|
|
46
|
+
const arr = [];
|
|
47
|
+
if (products === null || products === void 0 ? void 0 : products.length) {
|
|
48
|
+
for (const p of products) {
|
|
49
|
+
arr.push(this.encode(p));
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return arr;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.ProductBasicCodec = ProductBasicCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductFirmware } from "../../../typedef/product/firmware/ProductFirmware";
|
|
2
|
+
export declare class ProductFirmwareCodec {
|
|
3
|
+
static encode(x: ProductFirmware): any;
|
|
4
|
+
static decode(o: any): ProductFirmware;
|
|
5
|
+
static encodeArray(arr: ProductFirmware[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductFirmware[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductFirmwareCodec = void 0;
|
|
4
|
+
const ProductFirmware_1 = require("../../../typedef/product/firmware/ProductFirmware");
|
|
5
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
6
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
7
|
+
class ProductFirmwareCodec {
|
|
8
|
+
static encode(x) {
|
|
9
|
+
let o = {
|
|
10
|
+
name: x.name,
|
|
11
|
+
description: x.description,
|
|
12
|
+
type: x.type,
|
|
13
|
+
};
|
|
14
|
+
if (x.creator) {
|
|
15
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
16
|
+
}
|
|
17
|
+
if (x.updater) {
|
|
18
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
19
|
+
}
|
|
20
|
+
return o;
|
|
21
|
+
}
|
|
22
|
+
static decode(o) {
|
|
23
|
+
return new ProductFirmware_1.ProductFirmware(o.name, o.description, o.type, CreatorCodec_1.CreatorCodec.decode(o.creator), UpdaterCodec_1.UpdaterCodec.decode(o.updater));
|
|
24
|
+
}
|
|
25
|
+
static encodeArray(arr) {
|
|
26
|
+
const list = [];
|
|
27
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
28
|
+
for (const o of arr) {
|
|
29
|
+
list.push(this.encode(o));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
return list;
|
|
33
|
+
}
|
|
34
|
+
static decodeArray(arr) {
|
|
35
|
+
const instances = [];
|
|
36
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
37
|
+
for (const o of arr) {
|
|
38
|
+
instances.push(this.decode(o));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return instances;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.ProductFirmwareCodec = ProductFirmwareCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductFirmwareInstance } from "../../../typedef/product/firmware/ProductFirmwareInstance";
|
|
2
|
+
export declare class ProductFirmwareInstanceCodec {
|
|
3
|
+
static encode(x: ProductFirmwareInstance): any;
|
|
4
|
+
static decode(o: any): ProductFirmwareInstance;
|
|
5
|
+
static encodeArray(arr: ProductFirmwareInstance[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductFirmwareInstance[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductFirmwareInstanceCodec = void 0;
|
|
4
|
+
const ProductFirmwareInstance_1 = require("../../../typedef/product/firmware/ProductFirmwareInstance");
|
|
5
|
+
const GenericVersionCodec_1 = require("../../version/GenericVersionCodec");
|
|
6
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
7
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
8
|
+
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
9
|
+
class FirmwareSampleCodec {
|
|
10
|
+
static encode(x) {
|
|
11
|
+
return {
|
|
12
|
+
memo: x.memo,
|
|
13
|
+
url: x.url,
|
|
14
|
+
size: x.size,
|
|
15
|
+
md5: x.md5,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
static decode(o) {
|
|
19
|
+
return new ProductFirmwareInstance_1.FirmwareSample(o.memo, o.url, o.size, o.md5);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
class ProductFirmwareInstanceCodec {
|
|
23
|
+
static encode(x) {
|
|
24
|
+
let o = {
|
|
25
|
+
lifecycle: x.lifecycle.toString(),
|
|
26
|
+
version: GenericVersionCodec_1.GenericVersionCodec.encode(x.version),
|
|
27
|
+
minUpgradeVersionCode: x.minUpgradeVersionCode,
|
|
28
|
+
type: x.type,
|
|
29
|
+
};
|
|
30
|
+
if (x.simple) {
|
|
31
|
+
o.simple = FirmwareSampleCodec.encode(x.simple);
|
|
32
|
+
}
|
|
33
|
+
if (x.creator) {
|
|
34
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
35
|
+
}
|
|
36
|
+
if (x.updater) {
|
|
37
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
38
|
+
}
|
|
39
|
+
return o;
|
|
40
|
+
}
|
|
41
|
+
static decode(o) {
|
|
42
|
+
return new ProductFirmwareInstance_1.ProductFirmwareInstance((0, Lifecycle_1.LifeCycleFromString)(o.lifecycle), GenericVersionCodec_1.GenericVersionCodec.decode(o.version), o.minUpgradeVersionCode || 1, o.type, FirmwareSampleCodec.decode(o.simple), CreatorCodec_1.CreatorCodec.decode(o.creator), UpdaterCodec_1.UpdaterCodec.decode(o.updater));
|
|
43
|
+
}
|
|
44
|
+
static encodeArray(arr) {
|
|
45
|
+
const list = [];
|
|
46
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
47
|
+
for (const o of arr) {
|
|
48
|
+
list.push(this.encode(o));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return list;
|
|
52
|
+
}
|
|
53
|
+
static decodeArray(arr) {
|
|
54
|
+
const instances = [];
|
|
55
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
56
|
+
for (const o of arr) {
|
|
57
|
+
instances.push(this.decode(o));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return instances;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.ProductFirmwareInstanceCodec = ProductFirmwareInstanceCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductInstance } from '../../../typedef/product/instance/ProductInstance';
|
|
2
|
+
export declare class ProductInstanceCodec {
|
|
3
|
+
static encode(x: ProductInstance): any;
|
|
4
|
+
static decode(o: any): ProductInstance;
|
|
5
|
+
static encodeArray(arr: ProductInstance[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductInstance[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductInstanceCodec = void 0;
|
|
4
|
+
const ProductInstance_1 = require("../../../typedef/product/instance/ProductInstance");
|
|
5
|
+
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
6
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
7
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
8
|
+
const DeviceType_1 = require("../../../typedef/definition/urn/DeviceType");
|
|
9
|
+
class ProductInstanceCodec {
|
|
10
|
+
static encode(x) {
|
|
11
|
+
var _a;
|
|
12
|
+
let o = {
|
|
13
|
+
lifecycle: x.lifecycle.toString(),
|
|
14
|
+
type: (_a = x.type) === null || _a === void 0 ? void 0 : _a.toString(),
|
|
15
|
+
};
|
|
16
|
+
if (x.creator) {
|
|
17
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
18
|
+
}
|
|
19
|
+
if (x.updater) {
|
|
20
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
21
|
+
}
|
|
22
|
+
return o;
|
|
23
|
+
}
|
|
24
|
+
static decode(o) {
|
|
25
|
+
return new ProductInstance_1.ProductInstance((0, Lifecycle_1.LifeCycleFromString)(o.lifecycle), DeviceType_1.DeviceType.parse(o.type), CreatorCodec_1.CreatorCodec.decode(o.creator), UpdaterCodec_1.UpdaterCodec.decode(o.updater));
|
|
26
|
+
}
|
|
27
|
+
static encodeArray(arr) {
|
|
28
|
+
const list = [];
|
|
29
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
30
|
+
for (const o of arr) {
|
|
31
|
+
list.push(this.encode(o));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return list;
|
|
35
|
+
}
|
|
36
|
+
static decodeArray(arr) {
|
|
37
|
+
const instances = [];
|
|
38
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
39
|
+
for (const o of arr) {
|
|
40
|
+
instances.push(this.decode(o));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return instances;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.ProductInstanceCodec = ProductInstanceCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductManual } from '../../../typedef/product/manual/ProductManual';
|
|
2
|
+
export declare class ProductManualCodec {
|
|
3
|
+
static encode(x: ProductManual): any;
|
|
4
|
+
static decode(x: any): ProductManual;
|
|
5
|
+
static encodeArray(arr: ProductManual[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductManual[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductManualCodec = void 0;
|
|
4
|
+
const ProductManual_1 = require("../../../typedef/product/manual/ProductManual");
|
|
5
|
+
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
6
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
7
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
8
|
+
class ProductManualPageCodec {
|
|
9
|
+
static encode(x) {
|
|
10
|
+
return {
|
|
11
|
+
index: x.index,
|
|
12
|
+
url: x.url
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
static decode(x) {
|
|
16
|
+
if (x) {
|
|
17
|
+
return new ProductManual_1.ProductManualPage(x.index || 0, x.url || '');
|
|
18
|
+
}
|
|
19
|
+
return new ProductManual_1.ProductManualPage();
|
|
20
|
+
}
|
|
21
|
+
static encodeArray(arr) {
|
|
22
|
+
const list = [];
|
|
23
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
24
|
+
for (const o of arr) {
|
|
25
|
+
list.push(this.encode(o));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return list;
|
|
29
|
+
}
|
|
30
|
+
static decodeArray(arr) {
|
|
31
|
+
const list = [];
|
|
32
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
33
|
+
for (const o of arr) {
|
|
34
|
+
list.push(this.decode(o));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return list;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
class ProductManualCodec {
|
|
41
|
+
static encode(x) {
|
|
42
|
+
let o = {
|
|
43
|
+
pages: ProductManualPageCodec.decodeArray(x.pages),
|
|
44
|
+
lifecycle: x.lifecycle.toString(),
|
|
45
|
+
};
|
|
46
|
+
if (x.creator) {
|
|
47
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
48
|
+
}
|
|
49
|
+
if (x.updater) {
|
|
50
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
51
|
+
}
|
|
52
|
+
return o;
|
|
53
|
+
}
|
|
54
|
+
static decode(x) {
|
|
55
|
+
if (x) {
|
|
56
|
+
return new ProductManual_1.ProductManual(ProductManualPageCodec.decodeArray(x.pages), (0, Lifecycle_1.LifeCycleFromString)(x.lifecycle || Lifecycle_1.LifeCycle.DEVELOPMENT), CreatorCodec_1.CreatorCodec.decode(x.creator), UpdaterCodec_1.UpdaterCodec.decode(x.updater));
|
|
57
|
+
}
|
|
58
|
+
return new ProductManual_1.ProductManual();
|
|
59
|
+
}
|
|
60
|
+
static encodeArray(arr) {
|
|
61
|
+
const list = [];
|
|
62
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
63
|
+
for (const o of arr) {
|
|
64
|
+
list.push(this.encode(o));
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return list;
|
|
68
|
+
}
|
|
69
|
+
static decodeArray(arr) {
|
|
70
|
+
const instances = [];
|
|
71
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
72
|
+
for (const o of arr) {
|
|
73
|
+
instances.push(this.decode(o));
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return instances;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.ProductManualCodec = ProductManualCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductPanel } from '../../../typedef/product/panel/ProductPanel';
|
|
2
|
+
export declare class ProductPanelCodec {
|
|
3
|
+
static encode(x: ProductPanel): any;
|
|
4
|
+
static decode(o: any): ProductPanel;
|
|
5
|
+
static encodeArray(arr: ProductPanel[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductPanel[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProductPanelCodec = void 0;
|
|
4
|
+
const ProductPanel_1 = require("../../../typedef/product/panel/ProductPanel");
|
|
5
|
+
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
6
|
+
const GenericVersionCodec_1 = require("../../version/GenericVersionCodec");
|
|
7
|
+
const CreatorCodec_1 = require("../../by/CreatorCodec");
|
|
8
|
+
const UpdaterCodec_1 = require("../../by/UpdaterCodec");
|
|
9
|
+
const GenericVersion_1 = require("../../../typedef/version/GenericVersion");
|
|
10
|
+
const Urn_1 = require("../../../typedef/definition/urn/Urn");
|
|
11
|
+
const UrnType_1 = require("../../../typedef/definition/urn/UrnType");
|
|
12
|
+
const DeviceType_1 = require("../../../typedef/definition/urn/DeviceType");
|
|
13
|
+
class ProductPanelWebCodec {
|
|
14
|
+
static encode(x) {
|
|
15
|
+
if (x) {
|
|
16
|
+
return {
|
|
17
|
+
format: x.format,
|
|
18
|
+
url: x.url
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
static decode(o) {
|
|
24
|
+
if (o) {
|
|
25
|
+
return new ProductPanel_1.ProductPanelWeb(o.format || '', o.url || '');
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
class ProductPanelMiniAppCodec {
|
|
33
|
+
static encode(x) {
|
|
34
|
+
if (x) {
|
|
35
|
+
return {
|
|
36
|
+
appId: x.appId,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
static decode(o) {
|
|
42
|
+
if (o) {
|
|
43
|
+
return new ProductPanel_1.ProductPanelMiniApp(o.appId || '');
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
class ProductPanelCodec {
|
|
51
|
+
static encode(x) {
|
|
52
|
+
let o = {
|
|
53
|
+
status: x.status,
|
|
54
|
+
lifecycle: x.lifecycle.toString(),
|
|
55
|
+
category: x.category,
|
|
56
|
+
type: x.type,
|
|
57
|
+
version: GenericVersionCodec_1.GenericVersionCodec.encode(x.version),
|
|
58
|
+
instance: x.instance.toString(),
|
|
59
|
+
};
|
|
60
|
+
if (x.web) {
|
|
61
|
+
o.web = ProductPanelWebCodec.encode(x.web);
|
|
62
|
+
}
|
|
63
|
+
if (x.miniapp) {
|
|
64
|
+
o.miniapp = ProductPanelMiniAppCodec.encode(x.miniapp);
|
|
65
|
+
}
|
|
66
|
+
if (x.creator) {
|
|
67
|
+
o.creator = CreatorCodec_1.CreatorCodec.encode(x.creator);
|
|
68
|
+
}
|
|
69
|
+
if (x.updater) {
|
|
70
|
+
o.updater = UpdaterCodec_1.UpdaterCodec.encode(x.updater);
|
|
71
|
+
}
|
|
72
|
+
return o;
|
|
73
|
+
}
|
|
74
|
+
static decode(o) {
|
|
75
|
+
if (o) {
|
|
76
|
+
return new ProductPanel_1.ProductPanel(o.status || '', (0, Lifecycle_1.LifeCycleFromString)(o.lifecycle), o.category || 'mobile', o.type || 'web', ProductPanelWebCodec.decode(o.web), ProductPanelMiniAppCodec.decode(o.minapp), GenericVersionCodec_1.GenericVersionCodec.decode(o.version), DeviceType_1.DeviceType.parse(o.instance), CreatorCodec_1.CreatorCodec.decode(o.creator), UpdaterCodec_1.UpdaterCodec.decode(o.updater));
|
|
77
|
+
}
|
|
78
|
+
return new ProductPanel_1.ProductPanel('', Lifecycle_1.LifeCycle.DEVELOPMENT, '?', '?', null, null, new GenericVersion_1.GenericVersion('', 0), Urn_1.Urn.create('', UrnType_1.UrnType.DEVICE, '', '00000000'));
|
|
79
|
+
}
|
|
80
|
+
static encodeArray(arr) {
|
|
81
|
+
const list = [];
|
|
82
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
83
|
+
for (const o of arr) {
|
|
84
|
+
list.push(this.encode(o));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return list;
|
|
88
|
+
}
|
|
89
|
+
static decodeArray(arr) {
|
|
90
|
+
const instances = [];
|
|
91
|
+
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
92
|
+
for (const o of arr) {
|
|
93
|
+
instances.push(this.decode(o));
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return instances;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.ProductPanelCodec = ProductPanelCodec;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProductWizard } from '../../../typedef/product/wizard/ProductWizard';
|
|
2
|
+
export declare class ProductWizardCodec {
|
|
3
|
+
static encode(x: ProductWizard): any;
|
|
4
|
+
static decode(o: any): ProductWizard;
|
|
5
|
+
static encodeArray(arr: ProductWizard[]): any[];
|
|
6
|
+
static decodeArray(arr: any[]): ProductWizard[];
|
|
7
|
+
}
|