@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
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductCodec = void 0;
|
|
4
|
-
const Product_1 = require("../../typedef/product/Product");
|
|
5
|
-
const DeviceType_1 = require("../../typedef/definition/urn/DeviceType");
|
|
6
|
-
const VersionWithLifecycleCodec_1 = require("../lifecycle/product/VersionWithLifecycleCodec");
|
|
7
|
-
class ProductCodec {
|
|
8
|
-
static decode(o) {
|
|
9
|
-
const x = new Product_1.Product();
|
|
10
|
-
x.id = o.id;
|
|
11
|
-
x.name = o.name;
|
|
12
|
-
x.icon = o.icon;
|
|
13
|
-
x.model = o.model;
|
|
14
|
-
x.template = new DeviceType_1.DeviceType(o.template);
|
|
15
|
-
x.organization = o.organization;
|
|
16
|
-
x.key = o.key;
|
|
17
|
-
x.cert = o.cert;
|
|
18
|
-
x.protocol = o.protocol;
|
|
19
|
-
x.createBy = o.createBy;
|
|
20
|
-
x.createAt = o.createAt;
|
|
21
|
-
x.updateBy = o.updateBy;
|
|
22
|
-
x.updateAt = o.updateAt;
|
|
23
|
-
if (o.versions && o.versions instanceof Array) {
|
|
24
|
-
x.versions = VersionWithLifecycleCodec_1.VersionWithLifecycleCodec.decodeArray(o.versions);
|
|
25
|
-
}
|
|
26
|
-
if (o.createAt !== undefined) {
|
|
27
|
-
x.createAt = new Date(o.createAt);
|
|
28
|
-
}
|
|
29
|
-
if (o.updateAt !== undefined) {
|
|
30
|
-
x.updateAt = new Date(o.updateAt);
|
|
31
|
-
}
|
|
32
|
-
return x;
|
|
33
|
-
}
|
|
34
|
-
static encode(x) {
|
|
35
|
-
let o = {
|
|
36
|
-
id: x.id,
|
|
37
|
-
name: x.name,
|
|
38
|
-
icon: x.icon,
|
|
39
|
-
model: x.model,
|
|
40
|
-
template: x.template.toString(),
|
|
41
|
-
organization: x.organization,
|
|
42
|
-
key: x.key,
|
|
43
|
-
cert: x.cert,
|
|
44
|
-
protocol: x.protocol,
|
|
45
|
-
createBy: x.createBy,
|
|
46
|
-
updateBy: x.updateBy,
|
|
47
|
-
versions: VersionWithLifecycleCodec_1.VersionWithLifecycleCodec.encodeArray(x.versions),
|
|
48
|
-
};
|
|
49
|
-
if (x.createAt !== undefined) {
|
|
50
|
-
o.createAt = x.createAt.getTime();
|
|
51
|
-
}
|
|
52
|
-
if (x.updateAt !== undefined) {
|
|
53
|
-
o.updateAt = x.updateAt.getTime();
|
|
54
|
-
}
|
|
55
|
-
return o;
|
|
56
|
-
}
|
|
57
|
-
static decodeArray(arr) {
|
|
58
|
-
const list = [];
|
|
59
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
60
|
-
for (const o of arr) {
|
|
61
|
-
list.push(this.decode(o));
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
return list;
|
|
65
|
-
}
|
|
66
|
-
static encodeArray(products) {
|
|
67
|
-
const arr = [];
|
|
68
|
-
if (products === null || products === void 0 ? void 0 : products.length) {
|
|
69
|
-
for (const p of products) {
|
|
70
|
-
arr.push(this.encode(p));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
return arr;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
exports.ProductCodec = ProductCodec;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProductVersion } from '../../typedef/product/ProductVersion';
|
|
2
|
-
export declare class ProductVersionCodec {
|
|
3
|
-
static encode(x: ProductVersion): any;
|
|
4
|
-
static decode(o: any): ProductVersion;
|
|
5
|
-
static encodeArray(arr: ProductVersion[]): any[];
|
|
6
|
-
static decodeArray(arr: any[]): ProductVersion[];
|
|
7
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductVersionCodec = void 0;
|
|
4
|
-
const ProductVersion_1 = require("../../typedef/product/ProductVersion");
|
|
5
|
-
const DeviceType_1 = require("../../typedef/definition/urn/DeviceType");
|
|
6
|
-
const DeviceInstanceCodec_1 = require("../instance/DeviceInstanceCodec");
|
|
7
|
-
const Lifecycle_1 = require("../../typedef/lifecycle/Lifecycle");
|
|
8
|
-
class ProductVersionCodec {
|
|
9
|
-
static encode(x) {
|
|
10
|
-
let o = {
|
|
11
|
-
lifecycle: x.lifecycle.toString(),
|
|
12
|
-
version: x.version,
|
|
13
|
-
productId: x.productId,
|
|
14
|
-
type: x.type.toString(),
|
|
15
|
-
ltpk: x.ltpk,
|
|
16
|
-
ltsk: x.ltsk,
|
|
17
|
-
seed: x.seed,
|
|
18
|
-
};
|
|
19
|
-
if (x.instance) {
|
|
20
|
-
o['instance'] = DeviceInstanceCodec_1.DeviceInstanceCodec.encode(x.instance);
|
|
21
|
-
}
|
|
22
|
-
if (x.createAt !== undefined) {
|
|
23
|
-
o.createAt = x.createAt.getTime();
|
|
24
|
-
}
|
|
25
|
-
if (x.updateAt !== undefined) {
|
|
26
|
-
o.updateAt = x.updateAt.getTime();
|
|
27
|
-
}
|
|
28
|
-
return o;
|
|
29
|
-
}
|
|
30
|
-
static decode(o) {
|
|
31
|
-
const version = new ProductVersion_1.ProductVersion();
|
|
32
|
-
version.lifecycle = (0, Lifecycle_1.LifeCycleFromString)(o.lifecycle || '');
|
|
33
|
-
version.version = o.version;
|
|
34
|
-
version.productId = o.productId;
|
|
35
|
-
version.type = DeviceType_1.DeviceType.parse(o.type);
|
|
36
|
-
version.ltpk = o.ltpk;
|
|
37
|
-
version.ltsk = o.ltsk;
|
|
38
|
-
version.seed = o.seed;
|
|
39
|
-
if (o.instance) {
|
|
40
|
-
version.instance = DeviceInstanceCodec_1.DeviceInstanceCodec.decode(o.instance);
|
|
41
|
-
}
|
|
42
|
-
if (o.createAt !== undefined) {
|
|
43
|
-
version.createAt = new Date(o.createAt);
|
|
44
|
-
}
|
|
45
|
-
if (o.updateAt !== undefined) {
|
|
46
|
-
version.updateAt = new Date(o.updateAt);
|
|
47
|
-
}
|
|
48
|
-
return version;
|
|
49
|
-
}
|
|
50
|
-
static encodeArray(arr) {
|
|
51
|
-
const list = [];
|
|
52
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
53
|
-
for (const o of arr) {
|
|
54
|
-
list.push(this.encode(o));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return list;
|
|
58
|
-
}
|
|
59
|
-
static decodeArray(arr) {
|
|
60
|
-
const instances = [];
|
|
61
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
62
|
-
for (const o of arr) {
|
|
63
|
-
instances.push(this.decode(o));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return instances;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.ProductVersionCodec = ProductVersionCodec;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProductResource } from "../../../typedef/product/resource/ProductResource";
|
|
2
|
-
export declare class ProductResourceCodec {
|
|
3
|
-
static encode(x: ProductResource): any;
|
|
4
|
-
static decode(o: any): ProductResource;
|
|
5
|
-
static encodeArray(arr: ProductResource[]): any[];
|
|
6
|
-
static decodeArray(arr: any[]): ProductResource[];
|
|
7
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductResourceCodec = void 0;
|
|
4
|
-
const ProductResource_1 = require("../../../typedef/product/resource/ProductResource");
|
|
5
|
-
const ResourceVersionCodec_1 = require("./ResourceVersionCodec");
|
|
6
|
-
const DescriptionCodec_1 = require("../../definition/DescriptionCodec");
|
|
7
|
-
class ProductResourceCodec {
|
|
8
|
-
static encode(x) {
|
|
9
|
-
return {
|
|
10
|
-
productId: x.productId,
|
|
11
|
-
name: x.name,
|
|
12
|
-
description: DescriptionCodec_1.DescriptionCodec.encode(x.description),
|
|
13
|
-
extra: x.extra,
|
|
14
|
-
versions: ResourceVersionCodec_1.ResourceVersionCodec.encodeArray(x.versions)
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
static decode(o) {
|
|
18
|
-
const x = new ProductResource_1.ProductResource();
|
|
19
|
-
x.productId = o.productId;
|
|
20
|
-
x.name = o.name;
|
|
21
|
-
x.description = DescriptionCodec_1.DescriptionCodec.decode(o.description);
|
|
22
|
-
x.extra = o.extra;
|
|
23
|
-
x.versions = ResourceVersionCodec_1.ResourceVersionCodec.decodeArray(o.versions);
|
|
24
|
-
return x;
|
|
25
|
-
}
|
|
26
|
-
static encodeArray(arr) {
|
|
27
|
-
const list = [];
|
|
28
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
29
|
-
for (const o of arr) {
|
|
30
|
-
list.push(this.encode(o));
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
return list;
|
|
34
|
-
}
|
|
35
|
-
static decodeArray(arr) {
|
|
36
|
-
const instances = [];
|
|
37
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
38
|
-
for (const o of arr) {
|
|
39
|
-
instances.push(this.decode(o));
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
return instances;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.ProductResourceCodec = ProductResourceCodec;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ProductResourceVersion } from "../../../typedef/product/resource/ProductResourceVersion";
|
|
2
|
-
export declare class ProductResourceVersionCodec {
|
|
3
|
-
static encode(x: ProductResourceVersion): any;
|
|
4
|
-
static decode(o: any): ProductResourceVersion;
|
|
5
|
-
static encodeArray(arr: ProductResourceVersion[]): any[];
|
|
6
|
-
static decodeArray(arr: any[]): ProductResourceVersion[];
|
|
7
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductResourceVersionCodec = void 0;
|
|
4
|
-
const ProductResourceVersion_1 = require("../../../typedef/product/resource/ProductResourceVersion");
|
|
5
|
-
const Version_1 = require("../../../typedef/version/Version");
|
|
6
|
-
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
7
|
-
const DescriptionCodec_1 = require("../../definition/DescriptionCodec");
|
|
8
|
-
class ProductResourceVersionCodec {
|
|
9
|
-
static encode(x) {
|
|
10
|
-
let o = {
|
|
11
|
-
productId: x.productId,
|
|
12
|
-
name: x.name,
|
|
13
|
-
version: x.version.toString(),
|
|
14
|
-
md5: x.md5,
|
|
15
|
-
description: DescriptionCodec_1.DescriptionCodec.encode(x.description),
|
|
16
|
-
size: x.size,
|
|
17
|
-
url: x.url,
|
|
18
|
-
lifecycle: x.lifecycle.toString(),
|
|
19
|
-
createBy: x.createBy,
|
|
20
|
-
updateBy: x.updateBy,
|
|
21
|
-
};
|
|
22
|
-
if (x.createAt !== undefined) {
|
|
23
|
-
o.createAt = x.createAt.getTime();
|
|
24
|
-
}
|
|
25
|
-
if (x.updateAt !== undefined) {
|
|
26
|
-
o.updateAt = x.updateAt.getTime();
|
|
27
|
-
}
|
|
28
|
-
return o;
|
|
29
|
-
}
|
|
30
|
-
static decode(o) {
|
|
31
|
-
const version = new ProductResourceVersion_1.ProductResourceVersion();
|
|
32
|
-
version.productId = o.productId;
|
|
33
|
-
version.name = o.name;
|
|
34
|
-
version.version = Version_1.Version.fromString(o.version);
|
|
35
|
-
version.md5 = o.md5;
|
|
36
|
-
version.description = DescriptionCodec_1.DescriptionCodec.decode(o.description);
|
|
37
|
-
version.size = o.size;
|
|
38
|
-
version.url = o.url;
|
|
39
|
-
version.lifecycle = (0, Lifecycle_1.LifeCycleFromString)(o.lifecycle || '');
|
|
40
|
-
version.createBy = o.createBy;
|
|
41
|
-
version.updateBy = o.updateBy;
|
|
42
|
-
if (o.createAt !== undefined) {
|
|
43
|
-
version.createAt = new Date(o.createAt);
|
|
44
|
-
}
|
|
45
|
-
if (o.updateAt !== undefined) {
|
|
46
|
-
version.updateAt = new Date(o.updateAt);
|
|
47
|
-
}
|
|
48
|
-
return version;
|
|
49
|
-
}
|
|
50
|
-
static encodeArray(arr) {
|
|
51
|
-
const list = [];
|
|
52
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
53
|
-
for (const o of arr) {
|
|
54
|
-
list.push(this.encode(o));
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return list;
|
|
58
|
-
}
|
|
59
|
-
static decodeArray(arr) {
|
|
60
|
-
const instances = [];
|
|
61
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
62
|
-
for (const o of arr) {
|
|
63
|
-
instances.push(this.decode(o));
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
return instances;
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
exports.ProductResourceVersionCodec = ProductResourceVersionCodec;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ResourceVersion } from "../../../typedef/product/resource/ResourceVersion";
|
|
2
|
-
export declare class ResourceVersionCodec {
|
|
3
|
-
static encode(x: ResourceVersion): any;
|
|
4
|
-
static decode(o: any): ResourceVersion;
|
|
5
|
-
static encodeArray(arr: ResourceVersion[]): any[];
|
|
6
|
-
static decodeArray(arr: any[]): ResourceVersion[];
|
|
7
|
-
}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResourceVersionCodec = void 0;
|
|
4
|
-
const ResourceVersion_1 = require("../../../typedef/product/resource/ResourceVersion");
|
|
5
|
-
const Lifecycle_1 = require("../../../typedef/lifecycle/Lifecycle");
|
|
6
|
-
const Version_1 = require("../../../typedef/version/Version");
|
|
7
|
-
const DescriptionCodec_1 = require("../../definition/DescriptionCodec");
|
|
8
|
-
class ResourceVersionCodec {
|
|
9
|
-
static encode(x) {
|
|
10
|
-
let o = {
|
|
11
|
-
version: x.version.toString(),
|
|
12
|
-
md5: x.md5,
|
|
13
|
-
description: DescriptionCodec_1.DescriptionCodec.encode(x.description),
|
|
14
|
-
size: x.size,
|
|
15
|
-
url: x.url,
|
|
16
|
-
lifecycle: x.lifecycle.toString(),
|
|
17
|
-
createBy: x.createBy,
|
|
18
|
-
updateBy: x.updateBy,
|
|
19
|
-
};
|
|
20
|
-
if (x.createAt !== undefined) {
|
|
21
|
-
o.createAt = x.createAt.getTime();
|
|
22
|
-
}
|
|
23
|
-
if (x.updateAt !== undefined) {
|
|
24
|
-
o.updateAt = x.updateAt.getTime();
|
|
25
|
-
}
|
|
26
|
-
return o;
|
|
27
|
-
}
|
|
28
|
-
static decode(o) {
|
|
29
|
-
const version = new ResourceVersion_1.ResourceVersion();
|
|
30
|
-
version.version = Version_1.Version.fromString(o.version);
|
|
31
|
-
version.md5 = o.md5;
|
|
32
|
-
version.description = DescriptionCodec_1.DescriptionCodec.decode(o.description);
|
|
33
|
-
version.size = o.size;
|
|
34
|
-
version.url = o.url;
|
|
35
|
-
version.lifecycle = (0, Lifecycle_1.LifeCycleFromString)(o.lifecycle || '');
|
|
36
|
-
version.createBy = o.createBy;
|
|
37
|
-
version.updateBy = o.updateBy;
|
|
38
|
-
if (o.createAt !== undefined) {
|
|
39
|
-
version.createAt = new Date(o.createAt);
|
|
40
|
-
}
|
|
41
|
-
if (o.updateAt !== undefined) {
|
|
42
|
-
version.updateAt = new Date(o.updateAt);
|
|
43
|
-
}
|
|
44
|
-
return version;
|
|
45
|
-
}
|
|
46
|
-
static encodeArray(arr) {
|
|
47
|
-
const list = [];
|
|
48
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
49
|
-
for (const o of arr) {
|
|
50
|
-
list.push(this.encode(o));
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return list;
|
|
54
|
-
}
|
|
55
|
-
static decodeArray(arr) {
|
|
56
|
-
const list = [];
|
|
57
|
-
if (arr === null || arr === void 0 ? void 0 : arr.length) {
|
|
58
|
-
for (const o of arr) {
|
|
59
|
-
list.push(this.decode(o));
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return list;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.ResourceVersionCodec = ResourceVersionCodec;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { Urn } from '../definition/urn/Urn';
|
|
2
|
-
import { ObjectWithLifecycle } from '../lifecycle/ObjectWithLifecycle';
|
|
3
|
-
export declare class Product {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
icon: string;
|
|
7
|
-
model: string;
|
|
8
|
-
template: Urn;
|
|
9
|
-
organization: string;
|
|
10
|
-
key: string;
|
|
11
|
-
cert: string;
|
|
12
|
-
protocol: string;
|
|
13
|
-
createBy: string;
|
|
14
|
-
createAt: Date;
|
|
15
|
-
updateBy: string;
|
|
16
|
-
updateAt: Date;
|
|
17
|
-
versions: Array<ObjectWithLifecycle<Number>>;
|
|
18
|
-
_currentVersion: number;
|
|
19
|
-
get currentVersion(): ObjectWithLifecycle<Number>;
|
|
20
|
-
createAtString(): string;
|
|
21
|
-
updateAtString(): string;
|
|
22
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Product = void 0;
|
|
4
|
-
class Product {
|
|
5
|
-
constructor() {
|
|
6
|
-
this._currentVersion = 1;
|
|
7
|
-
}
|
|
8
|
-
get currentVersion() {
|
|
9
|
-
let index = this.versions.findIndex(x => x.value == this._currentVersion);
|
|
10
|
-
return this.versions[index];
|
|
11
|
-
}
|
|
12
|
-
createAtString() {
|
|
13
|
-
if (this.createAt === undefined) {
|
|
14
|
-
return '';
|
|
15
|
-
}
|
|
16
|
-
return `${this.createAt.getFullYear()}-${this.createAt.getMonth() + 1}-${this.createAt.getDate()} ${this.createAt.getHours()}:${this.createAt.getMinutes()}`;
|
|
17
|
-
}
|
|
18
|
-
updateAtString() {
|
|
19
|
-
if (this.updateAt === undefined) {
|
|
20
|
-
return '';
|
|
21
|
-
}
|
|
22
|
-
return `${this.updateAt.getFullYear()}-${this.updateAt.getMonth() + 1}-${this.updateAt.getDate()} ${this.updateAt.getHours()}:${this.updateAt.getMinutes()}`;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.Product = Product;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { DeviceType } from '../definition/urn/DeviceType';
|
|
2
|
-
import { LifeCycle } from "../lifecycle/Lifecycle";
|
|
3
|
-
import { DeviceInstance } from "../instance/DeviceInstance";
|
|
4
|
-
export declare class ProductVersion {
|
|
5
|
-
version: number;
|
|
6
|
-
lifecycle: LifeCycle;
|
|
7
|
-
productId: string;
|
|
8
|
-
type: DeviceType;
|
|
9
|
-
instance: DeviceInstance;
|
|
10
|
-
ltpk: string;
|
|
11
|
-
ltsk: string;
|
|
12
|
-
seed: string;
|
|
13
|
-
createAt: Date;
|
|
14
|
-
updateAt: Date;
|
|
15
|
-
createAtString(): string;
|
|
16
|
-
updateAtString(): string;
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductVersion = void 0;
|
|
4
|
-
const Lifecycle_1 = require("../lifecycle/Lifecycle");
|
|
5
|
-
class ProductVersion {
|
|
6
|
-
constructor() {
|
|
7
|
-
this.version = 0;
|
|
8
|
-
this.lifecycle = Lifecycle_1.LifeCycle.DEVELOPMENT;
|
|
9
|
-
this.productId = '';
|
|
10
|
-
}
|
|
11
|
-
createAtString() {
|
|
12
|
-
if (this.createAt === undefined) {
|
|
13
|
-
return '';
|
|
14
|
-
}
|
|
15
|
-
return `${this.createAt.getFullYear()}-${this.createAt.getMonth() + 1}-${this.createAt.getDate()} ${this.createAt.getHours()}:${this.createAt.getMinutes()}`;
|
|
16
|
-
}
|
|
17
|
-
updateAtString() {
|
|
18
|
-
if (this.updateAt === undefined) {
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
return `${this.updateAt.getFullYear()}-${this.updateAt.getMonth() + 1}-${this.updateAt.getDate()} ${this.updateAt.getHours()}:${this.updateAt.getMinutes()}`;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
exports.ProductVersion = ProductVersion;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductResource = void 0;
|
|
4
|
-
class ProductResource {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.productId = '';
|
|
7
|
-
this.name = '';
|
|
8
|
-
this.description = new Map();
|
|
9
|
-
this.extra = new Map();
|
|
10
|
-
this.versions = [];
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
exports.ProductResource = ProductResource;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProductResourceVersion = void 0;
|
|
4
|
-
const ResourceVersion_1 = require("./ResourceVersion");
|
|
5
|
-
class ProductResourceVersion extends ResourceVersion_1.ResourceVersion {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.productId = '';
|
|
9
|
-
this.name = '';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
exports.ProductResourceVersion = ProductResourceVersion;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Version } from "../../version/Version";
|
|
2
|
-
import { LifeCycle } from "../../lifecycle/Lifecycle";
|
|
3
|
-
export declare class ResourceVersion {
|
|
4
|
-
version: Version;
|
|
5
|
-
description: Map<string, string>;
|
|
6
|
-
url: string;
|
|
7
|
-
size: number;
|
|
8
|
-
md5: string;
|
|
9
|
-
lifecycle: LifeCycle;
|
|
10
|
-
createBy: string;
|
|
11
|
-
updateBy: string;
|
|
12
|
-
createAt: Date;
|
|
13
|
-
updateAt: Date;
|
|
14
|
-
createAtString(): string;
|
|
15
|
-
updateAtString(): string;
|
|
16
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResourceVersion = void 0;
|
|
4
|
-
const Version_1 = require("../../version/Version");
|
|
5
|
-
const Lifecycle_1 = require("../../lifecycle/Lifecycle");
|
|
6
|
-
class ResourceVersion {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.version = new Version_1.Version(0, 0, 0);
|
|
9
|
-
this.description = new Map();
|
|
10
|
-
this.url = '';
|
|
11
|
-
this.size = 0;
|
|
12
|
-
this.md5 = '';
|
|
13
|
-
this.lifecycle = Lifecycle_1.LifeCycle.DEVELOPMENT;
|
|
14
|
-
this.createBy = '';
|
|
15
|
-
this.updateBy = '';
|
|
16
|
-
}
|
|
17
|
-
createAtString() {
|
|
18
|
-
if (this.createAt === undefined) {
|
|
19
|
-
return '';
|
|
20
|
-
}
|
|
21
|
-
return `${this.createAt.getFullYear()}-${this.createAt.getMonth() + 1}-${this.createAt.getDate()} ${this.createAt.getHours()}:${this.createAt.getMinutes()}`;
|
|
22
|
-
}
|
|
23
|
-
updateAtString() {
|
|
24
|
-
if (this.updateAt === undefined) {
|
|
25
|
-
return '';
|
|
26
|
-
}
|
|
27
|
-
return `${this.updateAt.getFullYear()}-${this.updateAt.getMonth() + 1}-${this.updateAt.getDate()} ${this.updateAt.getHours()}:${this.updateAt.getMinutes()}`;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
exports.ResourceVersion = ResourceVersion;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Version = void 0;
|
|
4
|
-
class Version {
|
|
5
|
-
constructor(major, minor, patch) {
|
|
6
|
-
this.major = major;
|
|
7
|
-
this.minor = minor;
|
|
8
|
-
this.patch = patch;
|
|
9
|
-
}
|
|
10
|
-
static fromString(version) {
|
|
11
|
-
const s = version.split('.');
|
|
12
|
-
const x = Number.parseInt(s[0]);
|
|
13
|
-
const y = Number.parseInt(s[1]);
|
|
14
|
-
const z = Number.parseInt(s[2]);
|
|
15
|
-
return new Version(x, y, z);
|
|
16
|
-
}
|
|
17
|
-
toString() {
|
|
18
|
-
return `${this.major}.${this.minor}.${this.patch}`;
|
|
19
|
-
}
|
|
20
|
-
greaterThan(other) {
|
|
21
|
-
if (this.major > other.major) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
else if (this.major === other.major) {
|
|
25
|
-
if (this.minor > other.minor) {
|
|
26
|
-
return true;
|
|
27
|
-
}
|
|
28
|
-
else if (this.minor === other.minor) {
|
|
29
|
-
return this.patch > other.patch;
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return false;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.Version = Version;
|