space-data-module-sdk 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +174 -83
- package/bin/space-data-module.js +24 -0
- package/package.json +8 -3
- package/schemas/ModuleBundle.fbs +108 -0
- package/schemas/PluginManifest.fbs +26 -1
- package/src/bundle/codec.js +244 -0
- package/src/bundle/constants.js +8 -0
- package/src/bundle/index.js +3 -0
- package/src/bundle/wasm.js +447 -0
- package/src/compiler/compileModule.js +189 -41
- package/src/compliance/pluginCompliance.js +334 -0
- package/src/generated/orbpro/manifest/capability-kind.d.ts +27 -2
- package/src/generated/orbpro/manifest/capability-kind.js +26 -1
- package/src/generated/orbpro/manifest/capability-kind.ts +25 -0
- package/src/generated/orbpro/module/canonicalization-rule.d.ts +48 -0
- package/src/generated/orbpro/module/canonicalization-rule.js +95 -0
- package/src/generated/orbpro/module/canonicalization-rule.ts +142 -0
- package/src/generated/orbpro/module/module-bundle-entry-role.d.ts +11 -0
- package/src/generated/orbpro/module/module-bundle-entry-role.js +14 -0
- package/src/generated/orbpro/module/module-bundle-entry-role.ts +15 -0
- package/src/generated/orbpro/module/module-bundle-entry.d.ts +97 -0
- package/src/generated/orbpro/module/module-bundle-entry.js +219 -0
- package/src/generated/orbpro/module/module-bundle-entry.ts +287 -0
- package/src/generated/orbpro/module/module-bundle.d.ts +86 -0
- package/src/generated/orbpro/module/module-bundle.js +213 -0
- package/src/generated/orbpro/module/module-bundle.ts +277 -0
- package/src/generated/orbpro/module/module-payload-encoding.d.ts +9 -0
- package/src/generated/orbpro/module/module-payload-encoding.js +12 -0
- package/src/generated/orbpro/module/module-payload-encoding.ts +13 -0
- package/src/generated/orbpro/module.d.ts +5 -0
- package/src/generated/orbpro/module.js +7 -0
- package/src/generated/orbpro/module.ts +9 -0
- package/src/host/abi.js +282 -0
- package/src/host/cron.js +247 -0
- package/src/host/index.js +3 -0
- package/src/host/nodeHost.js +2165 -0
- package/src/index.d.ts +880 -0
- package/src/index.js +9 -2
- package/src/manifest/normalize.js +32 -1
- package/src/runtime/constants.js +18 -1
- package/src/transport/pki.js +0 -5
- package/src/utils/encoding.js +9 -1
- package/src/utils/wasmCrypto.js +49 -1
|
@@ -12,6 +12,31 @@ export declare enum CapabilityKind {
|
|
|
12
12
|
STORAGE_QUERY = 7,
|
|
13
13
|
SCENE_ACCESS = 8,
|
|
14
14
|
ENTITY_ACCESS = 9,
|
|
15
|
-
RENDER_HOOKS = 10
|
|
15
|
+
RENDER_HOOKS = 10,
|
|
16
|
+
HTTP = 11,
|
|
17
|
+
FILESYSTEM = 12,
|
|
18
|
+
PIPE = 13,
|
|
19
|
+
NETWORK = 14,
|
|
20
|
+
DATABASE = 15,
|
|
21
|
+
STORAGE_ADAPTER = 16,
|
|
22
|
+
STORAGE_WRITE = 17,
|
|
23
|
+
WALLET_SIGN = 18,
|
|
24
|
+
IPFS = 19,
|
|
25
|
+
TLS = 20,
|
|
26
|
+
MQTT = 21,
|
|
27
|
+
WEBSOCKET = 22,
|
|
28
|
+
TCP = 23,
|
|
29
|
+
UDP = 24,
|
|
30
|
+
PROCESS_EXEC = 25,
|
|
31
|
+
CONTEXT_READ = 26,
|
|
32
|
+
CONTEXT_WRITE = 27,
|
|
33
|
+
CRYPTO_HASH = 28,
|
|
34
|
+
CRYPTO_SIGN = 29,
|
|
35
|
+
CRYPTO_VERIFY = 30,
|
|
36
|
+
CRYPTO_ENCRYPT = 31,
|
|
37
|
+
CRYPTO_DECRYPT = 32,
|
|
38
|
+
CRYPTO_KEY_AGREEMENT = 33,
|
|
39
|
+
CRYPTO_KDF = 34,
|
|
40
|
+
SCHEDULE_CRON = 35
|
|
16
41
|
}
|
|
17
|
-
//# sourceMappingURL=capability-kind.d.ts.map
|
|
42
|
+
//# sourceMappingURL=capability-kind.d.ts.map
|
|
@@ -16,5 +16,30 @@ export var CapabilityKind;
|
|
|
16
16
|
CapabilityKind[CapabilityKind["SCENE_ACCESS"] = 8] = "SCENE_ACCESS";
|
|
17
17
|
CapabilityKind[CapabilityKind["ENTITY_ACCESS"] = 9] = "ENTITY_ACCESS";
|
|
18
18
|
CapabilityKind[CapabilityKind["RENDER_HOOKS"] = 10] = "RENDER_HOOKS";
|
|
19
|
+
CapabilityKind[CapabilityKind["HTTP"] = 11] = "HTTP";
|
|
20
|
+
CapabilityKind[CapabilityKind["FILESYSTEM"] = 12] = "FILESYSTEM";
|
|
21
|
+
CapabilityKind[CapabilityKind["PIPE"] = 13] = "PIPE";
|
|
22
|
+
CapabilityKind[CapabilityKind["NETWORK"] = 14] = "NETWORK";
|
|
23
|
+
CapabilityKind[CapabilityKind["DATABASE"] = 15] = "DATABASE";
|
|
24
|
+
CapabilityKind[CapabilityKind["STORAGE_ADAPTER"] = 16] = "STORAGE_ADAPTER";
|
|
25
|
+
CapabilityKind[CapabilityKind["STORAGE_WRITE"] = 17] = "STORAGE_WRITE";
|
|
26
|
+
CapabilityKind[CapabilityKind["WALLET_SIGN"] = 18] = "WALLET_SIGN";
|
|
27
|
+
CapabilityKind[CapabilityKind["IPFS"] = 19] = "IPFS";
|
|
28
|
+
CapabilityKind[CapabilityKind["TLS"] = 20] = "TLS";
|
|
29
|
+
CapabilityKind[CapabilityKind["MQTT"] = 21] = "MQTT";
|
|
30
|
+
CapabilityKind[CapabilityKind["WEBSOCKET"] = 22] = "WEBSOCKET";
|
|
31
|
+
CapabilityKind[CapabilityKind["TCP"] = 23] = "TCP";
|
|
32
|
+
CapabilityKind[CapabilityKind["UDP"] = 24] = "UDP";
|
|
33
|
+
CapabilityKind[CapabilityKind["PROCESS_EXEC"] = 25] = "PROCESS_EXEC";
|
|
34
|
+
CapabilityKind[CapabilityKind["CONTEXT_READ"] = 26] = "CONTEXT_READ";
|
|
35
|
+
CapabilityKind[CapabilityKind["CONTEXT_WRITE"] = 27] = "CONTEXT_WRITE";
|
|
36
|
+
CapabilityKind[CapabilityKind["CRYPTO_HASH"] = 28] = "CRYPTO_HASH";
|
|
37
|
+
CapabilityKind[CapabilityKind["CRYPTO_SIGN"] = 29] = "CRYPTO_SIGN";
|
|
38
|
+
CapabilityKind[CapabilityKind["CRYPTO_VERIFY"] = 30] = "CRYPTO_VERIFY";
|
|
39
|
+
CapabilityKind[CapabilityKind["CRYPTO_ENCRYPT"] = 31] = "CRYPTO_ENCRYPT";
|
|
40
|
+
CapabilityKind[CapabilityKind["CRYPTO_DECRYPT"] = 32] = "CRYPTO_DECRYPT";
|
|
41
|
+
CapabilityKind[CapabilityKind["CRYPTO_KEY_AGREEMENT"] = 33] = "CRYPTO_KEY_AGREEMENT";
|
|
42
|
+
CapabilityKind[CapabilityKind["CRYPTO_KDF"] = 34] = "CRYPTO_KDF";
|
|
43
|
+
CapabilityKind[CapabilityKind["SCHEDULE_CRON"] = 35] = "SCHEDULE_CRON";
|
|
19
44
|
})(CapabilityKind || (CapabilityKind = {}));
|
|
20
|
-
//# sourceMappingURL=capability-kind.js.map
|
|
45
|
+
//# sourceMappingURL=capability-kind.js.map
|
|
@@ -17,4 +17,29 @@ export enum CapabilityKind {
|
|
|
17
17
|
SCENE_ACCESS = 8,
|
|
18
18
|
ENTITY_ACCESS = 9,
|
|
19
19
|
RENDER_HOOKS = 10,
|
|
20
|
+
HTTP = 11,
|
|
21
|
+
FILESYSTEM = 12,
|
|
22
|
+
PIPE = 13,
|
|
23
|
+
NETWORK = 14,
|
|
24
|
+
DATABASE = 15,
|
|
25
|
+
STORAGE_ADAPTER = 16,
|
|
26
|
+
STORAGE_WRITE = 17,
|
|
27
|
+
WALLET_SIGN = 18,
|
|
28
|
+
IPFS = 19,
|
|
29
|
+
TLS = 20,
|
|
30
|
+
MQTT = 21,
|
|
31
|
+
WEBSOCKET = 22,
|
|
32
|
+
TCP = 23,
|
|
33
|
+
UDP = 24,
|
|
34
|
+
PROCESS_EXEC = 25,
|
|
35
|
+
CONTEXT_READ = 26,
|
|
36
|
+
CONTEXT_WRITE = 27,
|
|
37
|
+
CRYPTO_HASH = 28,
|
|
38
|
+
CRYPTO_SIGN = 29,
|
|
39
|
+
CRYPTO_VERIFY = 30,
|
|
40
|
+
CRYPTO_ENCRYPT = 31,
|
|
41
|
+
CRYPTO_DECRYPT = 32,
|
|
42
|
+
CRYPTO_KEY_AGREEMENT = 33,
|
|
43
|
+
CRYPTO_KDF = 34,
|
|
44
|
+
SCHEDULE_CRON = 35,
|
|
20
45
|
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
/**
|
|
3
|
+
* Canonicalization rule applied before hashing or signature verification.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CanonicalizationRule implements flatbuffers.IUnpackableObject<CanonicalizationRuleT> {
|
|
6
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
7
|
+
bb_pos: number;
|
|
8
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): CanonicalizationRule;
|
|
9
|
+
static getRootAsCanonicalizationRule(bb: flatbuffers.ByteBuffer, obj?: CanonicalizationRule): CanonicalizationRule;
|
|
10
|
+
static getSizePrefixedRootAsCanonicalizationRule(bb: flatbuffers.ByteBuffer, obj?: CanonicalizationRule): CanonicalizationRule;
|
|
11
|
+
/**
|
|
12
|
+
* Schema version for the canonicalization contract.
|
|
13
|
+
*/
|
|
14
|
+
version(): number;
|
|
15
|
+
/**
|
|
16
|
+
* Strip any custom section whose name starts with this prefix before
|
|
17
|
+
* hashing the module for signature verification.
|
|
18
|
+
*/
|
|
19
|
+
strippedCustomSectionPrefix(): string | null;
|
|
20
|
+
strippedCustomSectionPrefix(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
21
|
+
/**
|
|
22
|
+
* Name of the required root custom section carrying this bundle.
|
|
23
|
+
*/
|
|
24
|
+
bundleSectionName(): string | null;
|
|
25
|
+
bundleSectionName(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
26
|
+
/**
|
|
27
|
+
* Hash function identifier, for example `sha256`.
|
|
28
|
+
*/
|
|
29
|
+
hashAlgorithm(): string | null;
|
|
30
|
+
hashAlgorithm(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
31
|
+
static startCanonicalizationRule(builder: flatbuffers.Builder): void;
|
|
32
|
+
static addVersion(builder: flatbuffers.Builder, version: number): void;
|
|
33
|
+
static addStrippedCustomSectionPrefix(builder: flatbuffers.Builder, strippedCustomSectionPrefixOffset: flatbuffers.Offset): void;
|
|
34
|
+
static addBundleSectionName(builder: flatbuffers.Builder, bundleSectionNameOffset: flatbuffers.Offset): void;
|
|
35
|
+
static addHashAlgorithm(builder: flatbuffers.Builder, hashAlgorithmOffset: flatbuffers.Offset): void;
|
|
36
|
+
static endCanonicalizationRule(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
37
|
+
static createCanonicalizationRule(builder: flatbuffers.Builder, version: number, strippedCustomSectionPrefixOffset: flatbuffers.Offset, bundleSectionNameOffset: flatbuffers.Offset, hashAlgorithmOffset: flatbuffers.Offset): flatbuffers.Offset;
|
|
38
|
+
unpack(): CanonicalizationRuleT;
|
|
39
|
+
unpackTo(_o: CanonicalizationRuleT): void;
|
|
40
|
+
}
|
|
41
|
+
export declare class CanonicalizationRuleT implements flatbuffers.IGeneratedObject {
|
|
42
|
+
version: number;
|
|
43
|
+
strippedCustomSectionPrefix: string | Uint8Array | null;
|
|
44
|
+
bundleSectionName: string | Uint8Array | null;
|
|
45
|
+
hashAlgorithm: string | Uint8Array | null;
|
|
46
|
+
constructor(version?: number, strippedCustomSectionPrefix?: string | Uint8Array | null, bundleSectionName?: string | Uint8Array | null, hashAlgorithm?: string | Uint8Array | null);
|
|
47
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
48
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
3
|
+
import * as flatbuffers from 'flatbuffers';
|
|
4
|
+
/**
|
|
5
|
+
* Canonicalization rule applied before hashing or signature verification.
|
|
6
|
+
*/
|
|
7
|
+
export class CanonicalizationRule {
|
|
8
|
+
bb = null;
|
|
9
|
+
bb_pos = 0;
|
|
10
|
+
__init(i, bb) {
|
|
11
|
+
this.bb_pos = i;
|
|
12
|
+
this.bb = bb;
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
static getRootAsCanonicalizationRule(bb, obj) {
|
|
16
|
+
return (obj || new CanonicalizationRule()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
17
|
+
}
|
|
18
|
+
static getSizePrefixedRootAsCanonicalizationRule(bb, obj) {
|
|
19
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
20
|
+
return (obj || new CanonicalizationRule()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Schema version for the canonicalization contract.
|
|
24
|
+
*/
|
|
25
|
+
version() {
|
|
26
|
+
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
27
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 1;
|
|
28
|
+
}
|
|
29
|
+
strippedCustomSectionPrefix(optionalEncoding) {
|
|
30
|
+
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
31
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
32
|
+
}
|
|
33
|
+
bundleSectionName(optionalEncoding) {
|
|
34
|
+
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
35
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
36
|
+
}
|
|
37
|
+
hashAlgorithm(optionalEncoding) {
|
|
38
|
+
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
39
|
+
return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
40
|
+
}
|
|
41
|
+
static startCanonicalizationRule(builder) {
|
|
42
|
+
builder.startObject(4);
|
|
43
|
+
}
|
|
44
|
+
static addVersion(builder, version) {
|
|
45
|
+
builder.addFieldInt16(0, version, 1);
|
|
46
|
+
}
|
|
47
|
+
static addStrippedCustomSectionPrefix(builder, strippedCustomSectionPrefixOffset) {
|
|
48
|
+
builder.addFieldOffset(1, strippedCustomSectionPrefixOffset, 0);
|
|
49
|
+
}
|
|
50
|
+
static addBundleSectionName(builder, bundleSectionNameOffset) {
|
|
51
|
+
builder.addFieldOffset(2, bundleSectionNameOffset, 0);
|
|
52
|
+
}
|
|
53
|
+
static addHashAlgorithm(builder, hashAlgorithmOffset) {
|
|
54
|
+
builder.addFieldOffset(3, hashAlgorithmOffset, 0);
|
|
55
|
+
}
|
|
56
|
+
static endCanonicalizationRule(builder) {
|
|
57
|
+
const offset = builder.endObject();
|
|
58
|
+
return offset;
|
|
59
|
+
}
|
|
60
|
+
static createCanonicalizationRule(builder, version, strippedCustomSectionPrefixOffset, bundleSectionNameOffset, hashAlgorithmOffset) {
|
|
61
|
+
CanonicalizationRule.startCanonicalizationRule(builder);
|
|
62
|
+
CanonicalizationRule.addVersion(builder, version);
|
|
63
|
+
CanonicalizationRule.addStrippedCustomSectionPrefix(builder, strippedCustomSectionPrefixOffset);
|
|
64
|
+
CanonicalizationRule.addBundleSectionName(builder, bundleSectionNameOffset);
|
|
65
|
+
CanonicalizationRule.addHashAlgorithm(builder, hashAlgorithmOffset);
|
|
66
|
+
return CanonicalizationRule.endCanonicalizationRule(builder);
|
|
67
|
+
}
|
|
68
|
+
unpack() {
|
|
69
|
+
return new CanonicalizationRuleT(this.version(), this.strippedCustomSectionPrefix(), this.bundleSectionName(), this.hashAlgorithm());
|
|
70
|
+
}
|
|
71
|
+
unpackTo(_o) {
|
|
72
|
+
_o.version = this.version();
|
|
73
|
+
_o.strippedCustomSectionPrefix = this.strippedCustomSectionPrefix();
|
|
74
|
+
_o.bundleSectionName = this.bundleSectionName();
|
|
75
|
+
_o.hashAlgorithm = this.hashAlgorithm();
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
export class CanonicalizationRuleT {
|
|
79
|
+
version;
|
|
80
|
+
strippedCustomSectionPrefix;
|
|
81
|
+
bundleSectionName;
|
|
82
|
+
hashAlgorithm;
|
|
83
|
+
constructor(version = 1, strippedCustomSectionPrefix = null, bundleSectionName = null, hashAlgorithm = null) {
|
|
84
|
+
this.version = version;
|
|
85
|
+
this.strippedCustomSectionPrefix = strippedCustomSectionPrefix;
|
|
86
|
+
this.bundleSectionName = bundleSectionName;
|
|
87
|
+
this.hashAlgorithm = hashAlgorithm;
|
|
88
|
+
}
|
|
89
|
+
pack(builder) {
|
|
90
|
+
const strippedCustomSectionPrefix = (this.strippedCustomSectionPrefix !== null ? builder.createString(this.strippedCustomSectionPrefix) : 0);
|
|
91
|
+
const bundleSectionName = (this.bundleSectionName !== null ? builder.createString(this.bundleSectionName) : 0);
|
|
92
|
+
const hashAlgorithm = (this.hashAlgorithm !== null ? builder.createString(this.hashAlgorithm) : 0);
|
|
93
|
+
return CanonicalizationRule.createCanonicalizationRule(builder, this.version, strippedCustomSectionPrefix, bundleSectionName, hashAlgorithm);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
import * as flatbuffers from 'flatbuffers';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Canonicalization rule applied before hashing or signature verification.
|
|
11
|
+
*/
|
|
12
|
+
export class CanonicalizationRule implements flatbuffers.IUnpackableObject<CanonicalizationRuleT> {
|
|
13
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
14
|
+
bb_pos = 0;
|
|
15
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):CanonicalizationRule {
|
|
16
|
+
this.bb_pos = i;
|
|
17
|
+
this.bb = bb;
|
|
18
|
+
return this;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static getRootAsCanonicalizationRule(bb:flatbuffers.ByteBuffer, obj?:CanonicalizationRule):CanonicalizationRule {
|
|
22
|
+
return (obj || new CanonicalizationRule()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static getSizePrefixedRootAsCanonicalizationRule(bb:flatbuffers.ByteBuffer, obj?:CanonicalizationRule):CanonicalizationRule {
|
|
26
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
27
|
+
return (obj || new CanonicalizationRule()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Schema version for the canonicalization contract.
|
|
32
|
+
*/
|
|
33
|
+
version():number {
|
|
34
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
35
|
+
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 1;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Strip any custom section whose name starts with this prefix before
|
|
40
|
+
* hashing the module for signature verification.
|
|
41
|
+
*/
|
|
42
|
+
strippedCustomSectionPrefix():string|null
|
|
43
|
+
strippedCustomSectionPrefix(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
44
|
+
strippedCustomSectionPrefix(optionalEncoding?:any):string|Uint8Array|null {
|
|
45
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
46
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Name of the required root custom section carrying this bundle.
|
|
51
|
+
*/
|
|
52
|
+
bundleSectionName():string|null
|
|
53
|
+
bundleSectionName(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
54
|
+
bundleSectionName(optionalEncoding?:any):string|Uint8Array|null {
|
|
55
|
+
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
56
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Hash function identifier, for example `sha256`.
|
|
61
|
+
*/
|
|
62
|
+
hashAlgorithm():string|null
|
|
63
|
+
hashAlgorithm(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
64
|
+
hashAlgorithm(optionalEncoding?:any):string|Uint8Array|null {
|
|
65
|
+
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
66
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
static startCanonicalizationRule(builder:flatbuffers.Builder) {
|
|
70
|
+
builder.startObject(4);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
static addVersion(builder:flatbuffers.Builder, version:number) {
|
|
74
|
+
builder.addFieldInt16(0, version, 1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
static addStrippedCustomSectionPrefix(builder:flatbuffers.Builder, strippedCustomSectionPrefixOffset:flatbuffers.Offset) {
|
|
78
|
+
builder.addFieldOffset(1, strippedCustomSectionPrefixOffset, 0);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
static addBundleSectionName(builder:flatbuffers.Builder, bundleSectionNameOffset:flatbuffers.Offset) {
|
|
82
|
+
builder.addFieldOffset(2, bundleSectionNameOffset, 0);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
static addHashAlgorithm(builder:flatbuffers.Builder, hashAlgorithmOffset:flatbuffers.Offset) {
|
|
86
|
+
builder.addFieldOffset(3, hashAlgorithmOffset, 0);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
static endCanonicalizationRule(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
90
|
+
const offset = builder.endObject();
|
|
91
|
+
return offset;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
static createCanonicalizationRule(builder:flatbuffers.Builder, version:number, strippedCustomSectionPrefixOffset:flatbuffers.Offset, bundleSectionNameOffset:flatbuffers.Offset, hashAlgorithmOffset:flatbuffers.Offset):flatbuffers.Offset {
|
|
95
|
+
CanonicalizationRule.startCanonicalizationRule(builder);
|
|
96
|
+
CanonicalizationRule.addVersion(builder, version);
|
|
97
|
+
CanonicalizationRule.addStrippedCustomSectionPrefix(builder, strippedCustomSectionPrefixOffset);
|
|
98
|
+
CanonicalizationRule.addBundleSectionName(builder, bundleSectionNameOffset);
|
|
99
|
+
CanonicalizationRule.addHashAlgorithm(builder, hashAlgorithmOffset);
|
|
100
|
+
return CanonicalizationRule.endCanonicalizationRule(builder);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
unpack(): CanonicalizationRuleT {
|
|
104
|
+
return new CanonicalizationRuleT(
|
|
105
|
+
this.version(),
|
|
106
|
+
this.strippedCustomSectionPrefix(),
|
|
107
|
+
this.bundleSectionName(),
|
|
108
|
+
this.hashAlgorithm()
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
unpackTo(_o: CanonicalizationRuleT): void {
|
|
114
|
+
_o.version = this.version();
|
|
115
|
+
_o.strippedCustomSectionPrefix = this.strippedCustomSectionPrefix();
|
|
116
|
+
_o.bundleSectionName = this.bundleSectionName();
|
|
117
|
+
_o.hashAlgorithm = this.hashAlgorithm();
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export class CanonicalizationRuleT implements flatbuffers.IGeneratedObject {
|
|
122
|
+
constructor(
|
|
123
|
+
public version: number = 1,
|
|
124
|
+
public strippedCustomSectionPrefix: string|Uint8Array|null = null,
|
|
125
|
+
public bundleSectionName: string|Uint8Array|null = null,
|
|
126
|
+
public hashAlgorithm: string|Uint8Array|null = null
|
|
127
|
+
){}
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
131
|
+
const strippedCustomSectionPrefix = (this.strippedCustomSectionPrefix !== null ? builder.createString(this.strippedCustomSectionPrefix!) : 0);
|
|
132
|
+
const bundleSectionName = (this.bundleSectionName !== null ? builder.createString(this.bundleSectionName!) : 0);
|
|
133
|
+
const hashAlgorithm = (this.hashAlgorithm !== null ? builder.createString(this.hashAlgorithm!) : 0);
|
|
134
|
+
|
|
135
|
+
return CanonicalizationRule.createCanonicalizationRule(builder,
|
|
136
|
+
this.version,
|
|
137
|
+
strippedCustomSectionPrefix,
|
|
138
|
+
bundleSectionName,
|
|
139
|
+
hashAlgorithm
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
3
|
+
/**
|
|
4
|
+
* Logical role for one payload carried in the bundle.
|
|
5
|
+
*/
|
|
6
|
+
export var ModuleBundleEntryRole;
|
|
7
|
+
(function (ModuleBundleEntryRole) {
|
|
8
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["MANIFEST"] = 0] = "MANIFEST";
|
|
9
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["AUTHORIZATION"] = 1] = "AUTHORIZATION";
|
|
10
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["SIGNATURE"] = 2] = "SIGNATURE";
|
|
11
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["TRANSPORT"] = 3] = "TRANSPORT";
|
|
12
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["ATTESTATION"] = 4] = "ATTESTATION";
|
|
13
|
+
ModuleBundleEntryRole[ModuleBundleEntryRole["AUXILIARY"] = 5] = "AUXILIARY";
|
|
14
|
+
})(ModuleBundleEntryRole || (ModuleBundleEntryRole = {}));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
|
+
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Logical role for one payload carried in the bundle.
|
|
7
|
+
*/
|
|
8
|
+
export enum ModuleBundleEntryRole {
|
|
9
|
+
MANIFEST = 0,
|
|
10
|
+
AUTHORIZATION = 1,
|
|
11
|
+
SIGNATURE = 2,
|
|
12
|
+
TRANSPORT = 3,
|
|
13
|
+
ATTESTATION = 4,
|
|
14
|
+
AUXILIARY = 5
|
|
15
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import * as flatbuffers from 'flatbuffers';
|
|
2
|
+
import { ModuleBundleEntryRole } from '../../orbpro/module/module-bundle-entry-role.js';
|
|
3
|
+
import { ModulePayloadEncoding } from '../../orbpro/module/module-payload-encoding.js';
|
|
4
|
+
import { FlatBufferTypeRef, FlatBufferTypeRefT } from '../../orbpro/stream/flat-buffer-type-ref.js';
|
|
5
|
+
/**
|
|
6
|
+
* One payload carried inside the bundle.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ModuleBundleEntry implements flatbuffers.IUnpackableObject<ModuleBundleEntryT> {
|
|
9
|
+
bb: flatbuffers.ByteBuffer | null;
|
|
10
|
+
bb_pos: number;
|
|
11
|
+
__init(i: number, bb: flatbuffers.ByteBuffer): ModuleBundleEntry;
|
|
12
|
+
static getRootAsModuleBundleEntry(bb: flatbuffers.ByteBuffer, obj?: ModuleBundleEntry): ModuleBundleEntry;
|
|
13
|
+
static getSizePrefixedRootAsModuleBundleEntry(bb: flatbuffers.ByteBuffer, obj?: ModuleBundleEntry): ModuleBundleEntry;
|
|
14
|
+
/**
|
|
15
|
+
* Stable bundle-local identifier.
|
|
16
|
+
*/
|
|
17
|
+
entryId(): string | null;
|
|
18
|
+
entryId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
19
|
+
/**
|
|
20
|
+
* High-level semantic role of the payload.
|
|
21
|
+
*/
|
|
22
|
+
role(): ModuleBundleEntryRole;
|
|
23
|
+
/**
|
|
24
|
+
* Optional logical section name within the bundle, for example
|
|
25
|
+
* `sds.authorization`.
|
|
26
|
+
*/
|
|
27
|
+
sectionName(): string | null;
|
|
28
|
+
sectionName(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
29
|
+
/**
|
|
30
|
+
* SDS/shared-module schema identity when the payload is itself a
|
|
31
|
+
* FlatBuffer.
|
|
32
|
+
*/
|
|
33
|
+
typeRef(obj?: FlatBufferTypeRef): FlatBufferTypeRef | null;
|
|
34
|
+
/**
|
|
35
|
+
* Encoding used for `payload`.
|
|
36
|
+
*/
|
|
37
|
+
payloadEncoding(): ModulePayloadEncoding;
|
|
38
|
+
/**
|
|
39
|
+
* Optional media type for transitional payloads such as JSON envelopes.
|
|
40
|
+
*/
|
|
41
|
+
mediaType(): string | null;
|
|
42
|
+
mediaType(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
43
|
+
/**
|
|
44
|
+
* Implementation-defined bit flags for signed/encrypted/compressed state.
|
|
45
|
+
*/
|
|
46
|
+
flags(): number;
|
|
47
|
+
/**
|
|
48
|
+
* SHA-256 of the payload bytes.
|
|
49
|
+
*/
|
|
50
|
+
sha256(index: number): number | null;
|
|
51
|
+
sha256Length(): number;
|
|
52
|
+
sha256Array(): Uint8Array | null;
|
|
53
|
+
/**
|
|
54
|
+
* Embedded payload bytes. For single-file deployment this should be
|
|
55
|
+
* populated for every entry.
|
|
56
|
+
*/
|
|
57
|
+
payload(index: number): number | null;
|
|
58
|
+
payloadLength(): number;
|
|
59
|
+
payloadArray(): Uint8Array | null;
|
|
60
|
+
/**
|
|
61
|
+
* Human-readable description for tooling and diagnostics.
|
|
62
|
+
*/
|
|
63
|
+
description(): string | null;
|
|
64
|
+
description(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
65
|
+
static startModuleBundleEntry(builder: flatbuffers.Builder): void;
|
|
66
|
+
static addEntryId(builder: flatbuffers.Builder, entryIdOffset: flatbuffers.Offset): void;
|
|
67
|
+
static addRole(builder: flatbuffers.Builder, role: ModuleBundleEntryRole): void;
|
|
68
|
+
static addSectionName(builder: flatbuffers.Builder, sectionNameOffset: flatbuffers.Offset): void;
|
|
69
|
+
static addTypeRef(builder: flatbuffers.Builder, typeRefOffset: flatbuffers.Offset): void;
|
|
70
|
+
static addPayloadEncoding(builder: flatbuffers.Builder, payloadEncoding: ModulePayloadEncoding): void;
|
|
71
|
+
static addMediaType(builder: flatbuffers.Builder, mediaTypeOffset: flatbuffers.Offset): void;
|
|
72
|
+
static addFlags(builder: flatbuffers.Builder, flags: number): void;
|
|
73
|
+
static addSha256(builder: flatbuffers.Builder, sha256Offset: flatbuffers.Offset): void;
|
|
74
|
+
static createSha256Vector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
|
75
|
+
static startSha256Vector(builder: flatbuffers.Builder, numElems: number): void;
|
|
76
|
+
static addPayload(builder: flatbuffers.Builder, payloadOffset: flatbuffers.Offset): void;
|
|
77
|
+
static createPayloadVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
|
78
|
+
static startPayloadVector(builder: flatbuffers.Builder, numElems: number): void;
|
|
79
|
+
static addDescription(builder: flatbuffers.Builder, descriptionOffset: flatbuffers.Offset): void;
|
|
80
|
+
static endModuleBundleEntry(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
81
|
+
unpack(): ModuleBundleEntryT;
|
|
82
|
+
unpackTo(_o: ModuleBundleEntryT): void;
|
|
83
|
+
}
|
|
84
|
+
export declare class ModuleBundleEntryT implements flatbuffers.IGeneratedObject {
|
|
85
|
+
entryId: string | Uint8Array | null;
|
|
86
|
+
role: ModuleBundleEntryRole;
|
|
87
|
+
sectionName: string | Uint8Array | null;
|
|
88
|
+
typeRef: FlatBufferTypeRefT | null;
|
|
89
|
+
payloadEncoding: ModulePayloadEncoding;
|
|
90
|
+
mediaType: string | Uint8Array | null;
|
|
91
|
+
flags: number;
|
|
92
|
+
sha256: (number)[];
|
|
93
|
+
payload: (number)[];
|
|
94
|
+
description: string | Uint8Array | null;
|
|
95
|
+
constructor(entryId?: string | Uint8Array | null, role?: ModuleBundleEntryRole, sectionName?: string | Uint8Array | null, typeRef?: FlatBufferTypeRefT | null, payloadEncoding?: ModulePayloadEncoding, mediaType?: string | Uint8Array | null, flags?: number, sha256?: (number)[], payload?: (number)[], description?: string | Uint8Array | null);
|
|
96
|
+
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
97
|
+
}
|