space-data-module-sdk 0.1.0 → 0.2.5
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 +236 -73
- package/bin/space-data-module.js +24 -0
- package/package.json +16 -4
- package/schemas/ModuleBundle.fbs +108 -0
- package/schemas/PluginInvokeRequest.fbs +18 -0
- package/schemas/PluginInvokeResponse.fbs +30 -0
- package/schemas/PluginManifest.fbs +33 -1
- package/schemas/TypedArenaBuffer.fbs +23 -2
- package/src/bundle/codec.js +268 -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 +353 -37
- package/src/compiler/emceptionNode.js +217 -0
- package/src/compiler/flatcSupport.js +66 -0
- package/src/compiler/invokeGlue.js +884 -0
- package/src/compliance/pluginCompliance.js +575 -1
- package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts +51 -0
- package/src/generated/orbpro/invoke/plugin-invoke-request.d.ts.map +1 -0
- package/src/generated/orbpro/invoke/plugin-invoke-request.js +131 -0
- package/src/generated/orbpro/invoke/plugin-invoke-request.js.map +1 -0
- package/src/generated/orbpro/invoke/plugin-invoke-request.ts +173 -0
- package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts +76 -0
- package/src/generated/orbpro/invoke/plugin-invoke-response.d.ts.map +1 -0
- package/src/generated/orbpro/invoke/plugin-invoke-response.js +184 -0
- package/src/generated/orbpro/invoke/plugin-invoke-response.js.map +1 -0
- package/src/generated/orbpro/invoke/plugin-invoke-response.ts +243 -0
- package/src/generated/orbpro/invoke.d.ts +3 -0
- package/src/generated/orbpro/invoke.d.ts.map +1 -0
- package/src/generated/orbpro/invoke.js +5 -0
- package/src/generated/orbpro/invoke.js.map +1 -0
- package/src/generated/orbpro/invoke.ts +6 -0
- package/src/generated/orbpro/manifest/accepted-type-set.d.ts +4 -4
- package/src/generated/orbpro/manifest/accepted-type-set.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/accepted-type-set.js +18 -11
- package/src/generated/orbpro/manifest/accepted-type-set.js.map +1 -1
- package/src/generated/orbpro/manifest/build-artifact.d.ts +1 -1
- package/src/generated/orbpro/manifest/build-artifact.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/build-artifact.js +28 -15
- package/src/generated/orbpro/manifest/build-artifact.js.map +1 -1
- package/src/generated/orbpro/manifest/capability-kind.d.ts +26 -1
- package/src/generated/orbpro/manifest/capability-kind.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/capability-kind.js +25 -0
- package/src/generated/orbpro/manifest/capability-kind.js.map +1 -1
- package/src/generated/orbpro/manifest/capability-kind.ts +25 -0
- package/src/generated/orbpro/manifest/drain-policy.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/drain-policy.js.map +1 -1
- package/src/generated/orbpro/manifest/host-capability.d.ts +2 -2
- package/src/generated/orbpro/manifest/host-capability.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/host-capability.js +19 -11
- package/src/generated/orbpro/manifest/host-capability.js.map +1 -1
- package/src/generated/orbpro/manifest/invoke-surface.d.ts +8 -0
- package/src/generated/orbpro/manifest/invoke-surface.d.ts.map +1 -0
- package/src/generated/orbpro/manifest/invoke-surface.js +11 -0
- package/src/generated/orbpro/manifest/invoke-surface.js.map +1 -0
- package/src/generated/orbpro/manifest/invoke-surface.ts +11 -0
- package/src/generated/orbpro/manifest/method-manifest.d.ts +6 -6
- package/src/generated/orbpro/manifest/method-manifest.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/method-manifest.js +33 -16
- package/src/generated/orbpro/manifest/method-manifest.js.map +1 -1
- package/src/generated/orbpro/manifest/plugin-family.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/plugin-family.js.map +1 -1
- package/src/generated/orbpro/manifest/plugin-manifest.d.ts +10 -2
- package/src/generated/orbpro/manifest/plugin-manifest.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/plugin-manifest.js +48 -9
- package/src/generated/orbpro/manifest/plugin-manifest.js.map +1 -1
- package/src/generated/orbpro/manifest/plugin-manifest.ts +322 -491
- package/src/generated/orbpro/manifest/port-manifest.d.ts +4 -4
- package/src/generated/orbpro/manifest/port-manifest.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/port-manifest.js +26 -13
- package/src/generated/orbpro/manifest/port-manifest.js.map +1 -1
- package/src/generated/orbpro/manifest/protocol-spec.d.ts +1 -1
- package/src/generated/orbpro/manifest/protocol-spec.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/protocol-spec.js +28 -15
- package/src/generated/orbpro/manifest/protocol-spec.js.map +1 -1
- package/src/generated/orbpro/manifest/timer-spec.d.ts +1 -1
- package/src/generated/orbpro/manifest/timer-spec.d.ts.map +1 -1
- package/src/generated/orbpro/manifest/timer-spec.js +27 -16
- package/src/generated/orbpro/manifest/timer-spec.js.map +1 -1
- package/src/generated/orbpro/manifest.d.ts +13 -0
- package/src/generated/orbpro/manifest.d.ts.map +1 -0
- package/src/generated/orbpro/manifest.js +1 -0
- package/src/generated/orbpro/manifest.js.map +1 -0
- package/src/generated/orbpro/manifest.ts +16 -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/generated/orbpro/stream/buffer-mutability.d.ts.map +1 -1
- package/src/generated/orbpro/stream/buffer-mutability.js.map +1 -1
- package/src/generated/orbpro/stream/buffer-ownership.d.ts.map +1 -1
- package/src/generated/orbpro/stream/buffer-ownership.js.map +1 -1
- package/src/generated/orbpro/stream/flat-buffer-type-ref.d.ts +22 -5
- package/src/generated/orbpro/stream/flat-buffer-type-ref.d.ts.map +1 -1
- package/src/generated/orbpro/stream/flat-buffer-type-ref.js +107 -17
- package/src/generated/orbpro/stream/flat-buffer-type-ref.js.map +1 -1
- package/src/generated/orbpro/stream/flat-buffer-type-ref.ts +126 -2
- package/src/generated/orbpro/stream/payload-wire-format.d.ts +8 -0
- package/src/generated/orbpro/stream/payload-wire-format.d.ts.map +1 -0
- package/src/generated/orbpro/stream/payload-wire-format.js +11 -0
- package/src/generated/orbpro/stream/payload-wire-format.js.map +1 -0
- package/src/generated/orbpro/stream/payload-wire-format.ts +11 -0
- package/src/generated/orbpro/stream/typed-arena-buffer.d.ts +4 -4
- package/src/generated/orbpro/stream/typed-arena-buffer.d.ts.map +1 -1
- package/src/generated/orbpro/stream/typed-arena-buffer.js +42 -24
- package/src/generated/orbpro/stream/typed-arena-buffer.js.map +1 -1
- 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 +958 -0
- package/src/index.js +12 -2
- package/src/invoke/codec.js +278 -0
- package/src/invoke/index.js +9 -0
- package/src/manifest/codec.js +10 -2
- package/src/manifest/index.js +5 -2
- package/src/manifest/normalize.js +90 -1
- package/src/runtime/constants.js +29 -0
- package/src/transport/pki.js +0 -5
- package/src/utils/encoding.js +9 -1
- package/src/utils/wasmCrypto.js +49 -1
|
@@ -0,0 +1,277 @@
|
|
|
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
|
+
import { CanonicalizationRule, CanonicalizationRuleT } from '../../orbpro/module/canonicalization-rule.js';
|
|
8
|
+
import { ModuleBundleEntry, ModuleBundleEntryT } from '../../orbpro/module/module-bundle-entry.js';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Metadata stored in the required `sds.bundle` custom section.
|
|
13
|
+
*/
|
|
14
|
+
export class ModuleBundle implements flatbuffers.IUnpackableObject<ModuleBundleT> {
|
|
15
|
+
bb: flatbuffers.ByteBuffer|null = null;
|
|
16
|
+
bb_pos = 0;
|
|
17
|
+
__init(i:number, bb:flatbuffers.ByteBuffer):ModuleBundle {
|
|
18
|
+
this.bb_pos = i;
|
|
19
|
+
this.bb = bb;
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
static getRootAsModuleBundle(bb:flatbuffers.ByteBuffer, obj?:ModuleBundle):ModuleBundle {
|
|
24
|
+
return (obj || new ModuleBundle()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static getSizePrefixedRootAsModuleBundle(bb:flatbuffers.ByteBuffer, obj?:ModuleBundle):ModuleBundle {
|
|
28
|
+
bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
|
|
29
|
+
return (obj || new ModuleBundle()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
|
|
33
|
+
return bb.__has_identifier('SMDB');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Bundle schema version.
|
|
38
|
+
*/
|
|
39
|
+
bundleVersion():number {
|
|
40
|
+
const offset = this.bb!.__offset(this.bb_pos, 4);
|
|
41
|
+
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Human-readable package format label.
|
|
46
|
+
*/
|
|
47
|
+
moduleFormat():string|null
|
|
48
|
+
moduleFormat(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
49
|
+
moduleFormat(optionalEncoding?:any):string|Uint8Array|null {
|
|
50
|
+
const offset = this.bb!.__offset(this.bb_pos, 6);
|
|
51
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Canonicalization rule used to compute module hashes.
|
|
56
|
+
*/
|
|
57
|
+
canonicalization(obj?:CanonicalizationRule):CanonicalizationRule|null {
|
|
58
|
+
const offset = this.bb!.__offset(this.bb_pos, 8);
|
|
59
|
+
return offset ? (obj || new CanonicalizationRule()).__init(this.bb!.__indirect(this.bb_pos + offset), this.bb!) : null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* SHA-256 of the wasm module after stripping `sds.*` custom sections.
|
|
64
|
+
*/
|
|
65
|
+
canonicalModuleHash(index: number):number|null {
|
|
66
|
+
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
67
|
+
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
canonicalModuleHashLength():number {
|
|
71
|
+
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
72
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
canonicalModuleHashArray():Uint8Array|null {
|
|
76
|
+
const offset = this.bb!.__offset(this.bb_pos, 10);
|
|
77
|
+
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* SHA-256 of the canonical plugin manifest bytes.
|
|
82
|
+
*/
|
|
83
|
+
manifestHash(index: number):number|null {
|
|
84
|
+
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
85
|
+
return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
manifestHashLength():number {
|
|
89
|
+
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
90
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
manifestHashArray():Uint8Array|null {
|
|
94
|
+
const offset = this.bb!.__offset(this.bb_pos, 12);
|
|
95
|
+
return offset ? new Uint8Array(this.bb!.bytes().buffer, this.bb!.bytes().byteOffset + this.bb!.__vector(this.bb_pos + offset), this.bb!.__vector_len(this.bb_pos + offset)) : null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Legacy ABI export retained for backward compatibility.
|
|
100
|
+
*/
|
|
101
|
+
manifestExportSymbol():string|null
|
|
102
|
+
manifestExportSymbol(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
103
|
+
manifestExportSymbol(optionalEncoding?:any):string|Uint8Array|null {
|
|
104
|
+
const offset = this.bb!.__offset(this.bb_pos, 14);
|
|
105
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Legacy ABI export retained for backward compatibility.
|
|
110
|
+
*/
|
|
111
|
+
manifestSizeSymbol():string|null
|
|
112
|
+
manifestSizeSymbol(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
|
|
113
|
+
manifestSizeSymbol(optionalEncoding?:any):string|Uint8Array|null {
|
|
114
|
+
const offset = this.bb!.__offset(this.bb_pos, 16);
|
|
115
|
+
return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Payloads embedded in the bundle.
|
|
120
|
+
*/
|
|
121
|
+
entries(index: number, obj?:ModuleBundleEntry):ModuleBundleEntry|null {
|
|
122
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
123
|
+
return offset ? (obj || new ModuleBundleEntry()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
entriesLength():number {
|
|
127
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
128
|
+
return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
static startModuleBundle(builder:flatbuffers.Builder) {
|
|
132
|
+
builder.startObject(8);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
static addBundleVersion(builder:flatbuffers.Builder, bundleVersion:number) {
|
|
136
|
+
builder.addFieldInt16(0, bundleVersion, 1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
static addModuleFormat(builder:flatbuffers.Builder, moduleFormatOffset:flatbuffers.Offset) {
|
|
140
|
+
builder.addFieldOffset(1, moduleFormatOffset, 0);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
static addCanonicalization(builder:flatbuffers.Builder, canonicalizationOffset:flatbuffers.Offset) {
|
|
144
|
+
builder.addFieldOffset(2, canonicalizationOffset, 0);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
static addCanonicalModuleHash(builder:flatbuffers.Builder, canonicalModuleHashOffset:flatbuffers.Offset) {
|
|
148
|
+
builder.addFieldOffset(3, canonicalModuleHashOffset, 0);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
static createCanonicalModuleHashVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
|
|
152
|
+
builder.startVector(1, data.length, 1);
|
|
153
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
154
|
+
builder.addInt8(data[i]!);
|
|
155
|
+
}
|
|
156
|
+
return builder.endVector();
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
static startCanonicalModuleHashVector(builder:flatbuffers.Builder, numElems:number) {
|
|
160
|
+
builder.startVector(1, numElems, 1);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
static addManifestHash(builder:flatbuffers.Builder, manifestHashOffset:flatbuffers.Offset) {
|
|
164
|
+
builder.addFieldOffset(4, manifestHashOffset, 0);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
static createManifestHashVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
|
|
168
|
+
builder.startVector(1, data.length, 1);
|
|
169
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
170
|
+
builder.addInt8(data[i]!);
|
|
171
|
+
}
|
|
172
|
+
return builder.endVector();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
static startManifestHashVector(builder:flatbuffers.Builder, numElems:number) {
|
|
176
|
+
builder.startVector(1, numElems, 1);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
static addManifestExportSymbol(builder:flatbuffers.Builder, manifestExportSymbolOffset:flatbuffers.Offset) {
|
|
180
|
+
builder.addFieldOffset(5, manifestExportSymbolOffset, 0);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
static addManifestSizeSymbol(builder:flatbuffers.Builder, manifestSizeSymbolOffset:flatbuffers.Offset) {
|
|
184
|
+
builder.addFieldOffset(6, manifestSizeSymbolOffset, 0);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
static addEntries(builder:flatbuffers.Builder, entriesOffset:flatbuffers.Offset) {
|
|
188
|
+
builder.addFieldOffset(7, entriesOffset, 0);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
static createEntriesVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
|
|
192
|
+
builder.startVector(4, data.length, 4);
|
|
193
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
|
194
|
+
builder.addOffset(data[i]!);
|
|
195
|
+
}
|
|
196
|
+
return builder.endVector();
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
static startEntriesVector(builder:flatbuffers.Builder, numElems:number) {
|
|
200
|
+
builder.startVector(4, numElems, 4);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
static endModuleBundle(builder:flatbuffers.Builder):flatbuffers.Offset {
|
|
204
|
+
const offset = builder.endObject();
|
|
205
|
+
return offset;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static finishModuleBundleBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
|
209
|
+
builder.finish(offset, 'SMDB');
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
static finishSizePrefixedModuleBundleBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
|
|
213
|
+
builder.finish(offset, 'SMDB', true);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
|
|
217
|
+
unpack(): ModuleBundleT {
|
|
218
|
+
return new ModuleBundleT(
|
|
219
|
+
this.bundleVersion(),
|
|
220
|
+
this.moduleFormat(),
|
|
221
|
+
(this.canonicalization() !== null ? this.canonicalization()!.unpack() : null),
|
|
222
|
+
this.bb!.createScalarList<number>(this.canonicalModuleHash.bind(this), this.canonicalModuleHashLength()),
|
|
223
|
+
this.bb!.createScalarList<number>(this.manifestHash.bind(this), this.manifestHashLength()),
|
|
224
|
+
this.manifestExportSymbol(),
|
|
225
|
+
this.manifestSizeSymbol(),
|
|
226
|
+
this.bb!.createObjList<ModuleBundleEntry, ModuleBundleEntryT>(this.entries.bind(this), this.entriesLength())
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
unpackTo(_o: ModuleBundleT): void {
|
|
232
|
+
_o.bundleVersion = this.bundleVersion();
|
|
233
|
+
_o.moduleFormat = this.moduleFormat();
|
|
234
|
+
_o.canonicalization = (this.canonicalization() !== null ? this.canonicalization()!.unpack() : null);
|
|
235
|
+
_o.canonicalModuleHash = this.bb!.createScalarList<number>(this.canonicalModuleHash.bind(this), this.canonicalModuleHashLength());
|
|
236
|
+
_o.manifestHash = this.bb!.createScalarList<number>(this.manifestHash.bind(this), this.manifestHashLength());
|
|
237
|
+
_o.manifestExportSymbol = this.manifestExportSymbol();
|
|
238
|
+
_o.manifestSizeSymbol = this.manifestSizeSymbol();
|
|
239
|
+
_o.entries = this.bb!.createObjList<ModuleBundleEntry, ModuleBundleEntryT>(this.entries.bind(this), this.entriesLength());
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export class ModuleBundleT implements flatbuffers.IGeneratedObject {
|
|
244
|
+
constructor(
|
|
245
|
+
public bundleVersion: number = 1,
|
|
246
|
+
public moduleFormat: string|Uint8Array|null = null,
|
|
247
|
+
public canonicalization: CanonicalizationRuleT|null = null,
|
|
248
|
+
public canonicalModuleHash: (number)[] = [],
|
|
249
|
+
public manifestHash: (number)[] = [],
|
|
250
|
+
public manifestExportSymbol: string|Uint8Array|null = null,
|
|
251
|
+
public manifestSizeSymbol: string|Uint8Array|null = null,
|
|
252
|
+
public entries: (ModuleBundleEntryT)[] = []
|
|
253
|
+
){}
|
|
254
|
+
|
|
255
|
+
|
|
256
|
+
pack(builder:flatbuffers.Builder): flatbuffers.Offset {
|
|
257
|
+
const moduleFormat = (this.moduleFormat !== null ? builder.createString(this.moduleFormat!) : 0);
|
|
258
|
+
const canonicalization = (this.canonicalization !== null ? this.canonicalization!.pack(builder) : 0);
|
|
259
|
+
const canonicalModuleHash = ModuleBundle.createCanonicalModuleHashVector(builder, this.canonicalModuleHash);
|
|
260
|
+
const manifestHash = ModuleBundle.createManifestHashVector(builder, this.manifestHash);
|
|
261
|
+
const manifestExportSymbol = (this.manifestExportSymbol !== null ? builder.createString(this.manifestExportSymbol!) : 0);
|
|
262
|
+
const manifestSizeSymbol = (this.manifestSizeSymbol !== null ? builder.createString(this.manifestSizeSymbol!) : 0);
|
|
263
|
+
const entries = ModuleBundle.createEntriesVector(builder, builder.createObjectOffsetList(this.entries));
|
|
264
|
+
|
|
265
|
+
ModuleBundle.startModuleBundle(builder);
|
|
266
|
+
ModuleBundle.addBundleVersion(builder, this.bundleVersion);
|
|
267
|
+
ModuleBundle.addModuleFormat(builder, moduleFormat);
|
|
268
|
+
ModuleBundle.addCanonicalization(builder, canonicalization);
|
|
269
|
+
ModuleBundle.addCanonicalModuleHash(builder, canonicalModuleHash);
|
|
270
|
+
ModuleBundle.addManifestHash(builder, manifestHash);
|
|
271
|
+
ModuleBundle.addManifestExportSymbol(builder, manifestExportSymbol);
|
|
272
|
+
ModuleBundle.addManifestSizeSymbol(builder, manifestSizeSymbol);
|
|
273
|
+
ModuleBundle.addEntries(builder, entries);
|
|
274
|
+
|
|
275
|
+
return ModuleBundle.endModuleBundle(builder);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
* Serialization format used by an entry payload.
|
|
5
|
+
*/
|
|
6
|
+
export var ModulePayloadEncoding;
|
|
7
|
+
(function (ModulePayloadEncoding) {
|
|
8
|
+
ModulePayloadEncoding[ModulePayloadEncoding["RAW_BYTES"] = 0] = "RAW_BYTES";
|
|
9
|
+
ModulePayloadEncoding[ModulePayloadEncoding["FLATBUFFER"] = 1] = "FLATBUFFER";
|
|
10
|
+
ModulePayloadEncoding[ModulePayloadEncoding["JSON_UTF8"] = 2] = "JSON_UTF8";
|
|
11
|
+
ModulePayloadEncoding[ModulePayloadEncoding["CBOR"] = 3] = "CBOR";
|
|
12
|
+
})(ModulePayloadEncoding || (ModulePayloadEncoding = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
* Serialization format used by an entry payload.
|
|
7
|
+
*/
|
|
8
|
+
export enum ModulePayloadEncoding {
|
|
9
|
+
RAW_BYTES = 0,
|
|
10
|
+
FLATBUFFER = 1,
|
|
11
|
+
JSON_UTF8 = 2,
|
|
12
|
+
CBOR = 3
|
|
13
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { CanonicalizationRule, CanonicalizationRuleT } from './module/canonicalization-rule.js';
|
|
2
|
+
export { ModuleBundle, ModuleBundleT } from './module/module-bundle.js';
|
|
3
|
+
export { ModuleBundleEntry, ModuleBundleEntryT } from './module/module-bundle-entry.js';
|
|
4
|
+
export { ModuleBundleEntryRole } from './module/module-bundle-entry-role.js';
|
|
5
|
+
export { ModulePayloadEncoding } from './module/module-payload-encoding.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
+
export { CanonicalizationRule, CanonicalizationRuleT } from './module/canonicalization-rule.js';
|
|
4
|
+
export { ModuleBundle, ModuleBundleT } from './module/module-bundle.js';
|
|
5
|
+
export { ModuleBundleEntry, ModuleBundleEntryT } from './module/module-bundle-entry.js';
|
|
6
|
+
export { ModuleBundleEntryRole } from './module/module-bundle-entry-role.js';
|
|
7
|
+
export { ModulePayloadEncoding } from './module/module-payload-encoding.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
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
|
+
export { CanonicalizationRule, CanonicalizationRuleT } from './module/canonicalization-rule.js';
|
|
6
|
+
export { ModuleBundle, ModuleBundleT } from './module/module-bundle.js';
|
|
7
|
+
export { ModuleBundleEntry, ModuleBundleEntryT } from './module/module-bundle-entry.js';
|
|
8
|
+
export { ModuleBundleEntryRole } from './module/module-bundle-entry-role.js';
|
|
9
|
+
export { ModulePayloadEncoding } from './module/module-payload-encoding.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-mutability.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"buffer-mutability.d.ts","sourceRoot":"","sources":["buffer-mutability.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,oBAAY,gBAAgB;IAC1B,SAAS,IAAI;IACb,WAAW,IAAI;IACf,OAAO,IAAI;CACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-mutability.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"buffer-mutability.js","sourceRoot":"","sources":["buffer-mutability.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,oIAAoI;AAEpI;;GAEG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iEAAa,CAAA;IACb,qEAAe,CAAA;IACf,6DAAW,CAAA;AACb,CAAC,EAJW,gBAAgB,KAAhB,gBAAgB,QAI3B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-ownership.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"buffer-ownership.d.ts","sourceRoot":"","sources":["buffer-ownership.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,oBAAY,eAAe;IACzB,QAAQ,IAAI;IACZ,cAAc,IAAI;IAClB,UAAU,IAAI;IACd,MAAM,IAAI;CACX"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buffer-ownership.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"buffer-ownership.js","sourceRoot":"","sources":["buffer-ownership.ts"],"names":[],"mappings":"AAAA,qEAAqE;AAErE,oIAAoI;AAEpI;;GAEG;AACH,MAAM,CAAN,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,6DAAY,CAAA;IACZ,yEAAkB,CAAA;IAClB,iEAAc,CAAA;IACd,yDAAU,CAAA;AACZ,CAAC,EALW,eAAe,KAAf,eAAe,QAK1B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import * as flatbuffers from
|
|
1
|
+
import * as flatbuffers from "flatbuffers";
|
|
2
|
+
import { PayloadWireFormat } from "../../orbpro/stream/payload-wire-format.js";
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* Payload schema identity for a stream frame or accepted port type.
|
|
4
5
|
*/
|
|
5
6
|
export declare class FlatBufferTypeRef implements flatbuffers.IUnpackableObject<FlatBufferTypeRefT> {
|
|
6
7
|
bb: flatbuffers.ByteBuffer | null;
|
|
@@ -28,6 +29,12 @@ export declare class FlatBufferTypeRef implements flatbuffers.IUnpackableObject<
|
|
|
28
29
|
* True when this port/type set accepts any FlatBuffer frame.
|
|
29
30
|
*/
|
|
30
31
|
acceptsAnyFlatbuffer(): boolean;
|
|
32
|
+
wireFormat(): PayloadWireFormat;
|
|
33
|
+
rootTypeName(): string | null;
|
|
34
|
+
rootTypeName(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
35
|
+
fixedStringLength(): number;
|
|
36
|
+
byteLength(): number;
|
|
37
|
+
requiredAlignment(): number;
|
|
31
38
|
static startFlatBufferTypeRef(builder: flatbuffers.Builder): void;
|
|
32
39
|
static addSchemaName(builder: flatbuffers.Builder, schemaNameOffset: flatbuffers.Offset): void;
|
|
33
40
|
static addFileIdentifier(builder: flatbuffers.Builder, fileIdentifierOffset: flatbuffers.Offset): void;
|
|
@@ -35,17 +42,27 @@ export declare class FlatBufferTypeRef implements flatbuffers.IUnpackableObject<
|
|
|
35
42
|
static createSchemaHashVector(builder: flatbuffers.Builder, data: number[] | Uint8Array): flatbuffers.Offset;
|
|
36
43
|
static startSchemaHashVector(builder: flatbuffers.Builder, numElems: number): void;
|
|
37
44
|
static addAcceptsAnyFlatbuffer(builder: flatbuffers.Builder, acceptsAnyFlatbuffer: boolean): void;
|
|
45
|
+
static addWireFormat(builder: flatbuffers.Builder, wireFormat: PayloadWireFormat): void;
|
|
46
|
+
static addRootTypeName(builder: flatbuffers.Builder, rootTypeNameOffset: flatbuffers.Offset): void;
|
|
47
|
+
static addFixedStringLength(builder: flatbuffers.Builder, fixedStringLength: number): void;
|
|
48
|
+
static addByteLength(builder: flatbuffers.Builder, byteLength: number): void;
|
|
49
|
+
static addRequiredAlignment(builder: flatbuffers.Builder, requiredAlignment: number): void;
|
|
38
50
|
static endFlatBufferTypeRef(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
39
|
-
static createFlatBufferTypeRef(builder: flatbuffers.Builder, schemaNameOffset: flatbuffers.Offset, fileIdentifierOffset: flatbuffers.Offset, schemaHashOffset: flatbuffers.Offset, acceptsAnyFlatbuffer: boolean): flatbuffers.Offset;
|
|
51
|
+
static createFlatBufferTypeRef(builder: flatbuffers.Builder, schemaNameOffset: flatbuffers.Offset, fileIdentifierOffset: flatbuffers.Offset, schemaHashOffset: flatbuffers.Offset, acceptsAnyFlatbuffer: boolean, wireFormat: PayloadWireFormat, rootTypeNameOffset: flatbuffers.Offset, fixedStringLength: number, byteLength: number, requiredAlignment: number): flatbuffers.Offset;
|
|
40
52
|
unpack(): FlatBufferTypeRefT;
|
|
41
53
|
unpackTo(_o: FlatBufferTypeRefT): void;
|
|
42
54
|
}
|
|
43
55
|
export declare class FlatBufferTypeRefT implements flatbuffers.IGeneratedObject {
|
|
44
56
|
schemaName: string | Uint8Array | null;
|
|
45
57
|
fileIdentifier: string | Uint8Array | null;
|
|
46
|
-
schemaHash:
|
|
58
|
+
schemaHash: number[];
|
|
47
59
|
acceptsAnyFlatbuffer: boolean;
|
|
48
|
-
|
|
60
|
+
wireFormat: PayloadWireFormat | "flatbuffer" | "aligned-binary";
|
|
61
|
+
rootTypeName: string | Uint8Array | null;
|
|
62
|
+
fixedStringLength: number;
|
|
63
|
+
byteLength: number;
|
|
64
|
+
requiredAlignment: number;
|
|
65
|
+
constructor(schemaName?: string | Uint8Array | null, fileIdentifier?: string | Uint8Array | null, schemaHash?: number[], acceptsAnyFlatbuffer?: boolean, wireFormat?: PayloadWireFormat | "flatbuffer" | "aligned-binary", rootTypeName?: string | Uint8Array | null, fixedStringLength?: number, byteLength?: number, requiredAlignment?: number);
|
|
49
66
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
50
67
|
}
|
|
51
68
|
//# sourceMappingURL=flat-buffer-type-ref.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flat-buffer-type-ref.d.ts","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"flat-buffer-type-ref.d.ts","sourceRoot":"","sources":["flat-buffer-type-ref.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,14 +1,30 @@
|
|
|
1
1
|
// automatically generated by the FlatBuffers compiler, do not modify
|
|
2
2
|
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any, @typescript-eslint/no-non-null-assertion */
|
|
3
|
-
import * as flatbuffers from
|
|
3
|
+
import * as flatbuffers from "flatbuffers";
|
|
4
|
+
import { PayloadWireFormat } from "../../orbpro/stream/payload-wire-format.js";
|
|
5
|
+
function normalizePayloadWireFormat(value) {
|
|
6
|
+
if (value === PayloadWireFormat.ALIGNED_BINARY) {
|
|
7
|
+
return PayloadWireFormat.ALIGNED_BINARY;
|
|
8
|
+
}
|
|
9
|
+
const normalized = String(value ?? "")
|
|
10
|
+
.trim()
|
|
11
|
+
.toLowerCase()
|
|
12
|
+
.replace(/_/g, "-");
|
|
13
|
+
return normalized === "aligned-binary"
|
|
14
|
+
? PayloadWireFormat.ALIGNED_BINARY
|
|
15
|
+
: PayloadWireFormat.FLATBUFFER;
|
|
16
|
+
}
|
|
17
|
+
function payloadWireFormatToName(value) {
|
|
18
|
+
return normalizePayloadWireFormat(value) === PayloadWireFormat.ALIGNED_BINARY
|
|
19
|
+
? "aligned-binary"
|
|
20
|
+
: "flatbuffer";
|
|
21
|
+
}
|
|
4
22
|
/**
|
|
5
|
-
*
|
|
23
|
+
* Payload schema identity for a stream frame or accepted port type.
|
|
6
24
|
*/
|
|
7
25
|
export class FlatBufferTypeRef {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
this.bb_pos = 0;
|
|
11
|
-
}
|
|
26
|
+
bb = null;
|
|
27
|
+
bb_pos = 0;
|
|
12
28
|
__init(i, bb) {
|
|
13
29
|
this.bb_pos = i;
|
|
14
30
|
this.bb = bb;
|
|
@@ -23,18 +39,24 @@ export class FlatBufferTypeRef {
|
|
|
23
39
|
}
|
|
24
40
|
schemaName(optionalEncoding) {
|
|
25
41
|
const offset = this.bb.__offset(this.bb_pos, 4);
|
|
26
|
-
return offset
|
|
42
|
+
return offset
|
|
43
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
44
|
+
: null;
|
|
27
45
|
}
|
|
28
46
|
fileIdentifier(optionalEncoding) {
|
|
29
47
|
const offset = this.bb.__offset(this.bb_pos, 6);
|
|
30
|
-
return offset
|
|
48
|
+
return offset
|
|
49
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
50
|
+
: null;
|
|
31
51
|
}
|
|
32
52
|
/**
|
|
33
53
|
* Optional schema hash bytes for stronger compatibility checks.
|
|
34
54
|
*/
|
|
35
55
|
schemaHash(index) {
|
|
36
56
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
37
|
-
return offset
|
|
57
|
+
return offset
|
|
58
|
+
? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index)
|
|
59
|
+
: 0;
|
|
38
60
|
}
|
|
39
61
|
schemaHashLength() {
|
|
40
62
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
@@ -42,7 +64,9 @@ export class FlatBufferTypeRef {
|
|
|
42
64
|
}
|
|
43
65
|
schemaHashArray() {
|
|
44
66
|
const offset = this.bb.__offset(this.bb_pos, 8);
|
|
45
|
-
return offset
|
|
67
|
+
return offset
|
|
68
|
+
? new Uint8Array(this.bb.bytes().buffer, this.bb.bytes().byteOffset + this.bb.__vector(this.bb_pos + offset), this.bb.__vector_len(this.bb_pos + offset))
|
|
69
|
+
: null;
|
|
46
70
|
}
|
|
47
71
|
/**
|
|
48
72
|
* True when this port/type set accepts any FlatBuffer frame.
|
|
@@ -51,8 +75,32 @@ export class FlatBufferTypeRef {
|
|
|
51
75
|
const offset = this.bb.__offset(this.bb_pos, 10);
|
|
52
76
|
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
53
77
|
}
|
|
78
|
+
wireFormat() {
|
|
79
|
+
const offset = this.bb.__offset(this.bb_pos, 12);
|
|
80
|
+
return offset
|
|
81
|
+
? this.bb.readUint8(this.bb_pos + offset)
|
|
82
|
+
: PayloadWireFormat.FLATBUFFER;
|
|
83
|
+
}
|
|
84
|
+
rootTypeName(optionalEncoding) {
|
|
85
|
+
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
86
|
+
return offset
|
|
87
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
88
|
+
: null;
|
|
89
|
+
}
|
|
90
|
+
fixedStringLength() {
|
|
91
|
+
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
92
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
93
|
+
}
|
|
94
|
+
byteLength() {
|
|
95
|
+
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
96
|
+
return offset ? this.bb.readUint32(this.bb_pos + offset) : 0;
|
|
97
|
+
}
|
|
98
|
+
requiredAlignment() {
|
|
99
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
100
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
101
|
+
}
|
|
54
102
|
static startFlatBufferTypeRef(builder) {
|
|
55
|
-
builder.startObject(
|
|
103
|
+
builder.startObject(9);
|
|
56
104
|
}
|
|
57
105
|
static addSchemaName(builder, schemaNameOffset) {
|
|
58
106
|
builder.addFieldOffset(0, schemaNameOffset, 0);
|
|
@@ -76,40 +124,82 @@ export class FlatBufferTypeRef {
|
|
|
76
124
|
static addAcceptsAnyFlatbuffer(builder, acceptsAnyFlatbuffer) {
|
|
77
125
|
builder.addFieldInt8(3, +acceptsAnyFlatbuffer, +false);
|
|
78
126
|
}
|
|
127
|
+
static addWireFormat(builder, wireFormat) {
|
|
128
|
+
builder.addFieldInt8(4, wireFormat, PayloadWireFormat.FLATBUFFER);
|
|
129
|
+
}
|
|
130
|
+
static addRootTypeName(builder, rootTypeNameOffset) {
|
|
131
|
+
builder.addFieldOffset(5, rootTypeNameOffset, 0);
|
|
132
|
+
}
|
|
133
|
+
static addFixedStringLength(builder, fixedStringLength) {
|
|
134
|
+
builder.addFieldInt16(6, fixedStringLength, 0);
|
|
135
|
+
}
|
|
136
|
+
static addByteLength(builder, byteLength) {
|
|
137
|
+
builder.addFieldInt32(7, byteLength, 0);
|
|
138
|
+
}
|
|
139
|
+
static addRequiredAlignment(builder, requiredAlignment) {
|
|
140
|
+
builder.addFieldInt16(8, requiredAlignment, 0);
|
|
141
|
+
}
|
|
79
142
|
static endFlatBufferTypeRef(builder) {
|
|
80
143
|
const offset = builder.endObject();
|
|
81
144
|
return offset;
|
|
82
145
|
}
|
|
83
|
-
static createFlatBufferTypeRef(builder, schemaNameOffset, fileIdentifierOffset, schemaHashOffset, acceptsAnyFlatbuffer) {
|
|
146
|
+
static createFlatBufferTypeRef(builder, schemaNameOffset, fileIdentifierOffset, schemaHashOffset, acceptsAnyFlatbuffer, wireFormat, rootTypeNameOffset, fixedStringLength, byteLength, requiredAlignment) {
|
|
84
147
|
FlatBufferTypeRef.startFlatBufferTypeRef(builder);
|
|
85
148
|
FlatBufferTypeRef.addSchemaName(builder, schemaNameOffset);
|
|
86
149
|
FlatBufferTypeRef.addFileIdentifier(builder, fileIdentifierOffset);
|
|
87
150
|
FlatBufferTypeRef.addSchemaHash(builder, schemaHashOffset);
|
|
88
151
|
FlatBufferTypeRef.addAcceptsAnyFlatbuffer(builder, acceptsAnyFlatbuffer);
|
|
152
|
+
FlatBufferTypeRef.addWireFormat(builder, wireFormat);
|
|
153
|
+
FlatBufferTypeRef.addRootTypeName(builder, rootTypeNameOffset);
|
|
154
|
+
FlatBufferTypeRef.addFixedStringLength(builder, fixedStringLength);
|
|
155
|
+
FlatBufferTypeRef.addByteLength(builder, byteLength);
|
|
156
|
+
FlatBufferTypeRef.addRequiredAlignment(builder, requiredAlignment);
|
|
89
157
|
return FlatBufferTypeRef.endFlatBufferTypeRef(builder);
|
|
90
158
|
}
|
|
91
159
|
unpack() {
|
|
92
|
-
return new FlatBufferTypeRefT(this.schemaName(), this.fileIdentifier(), this.bb.createScalarList(this.schemaHash.bind(this), this.schemaHashLength()), this.acceptsAnyFlatbuffer());
|
|
160
|
+
return new FlatBufferTypeRefT(this.schemaName(), this.fileIdentifier(), this.bb.createScalarList(this.schemaHash.bind(this), this.schemaHashLength()), this.acceptsAnyFlatbuffer(), payloadWireFormatToName(this.wireFormat()), this.rootTypeName(), this.fixedStringLength(), this.byteLength(), this.requiredAlignment());
|
|
93
161
|
}
|
|
94
162
|
unpackTo(_o) {
|
|
95
163
|
_o.schemaName = this.schemaName();
|
|
96
164
|
_o.fileIdentifier = this.fileIdentifier();
|
|
97
165
|
_o.schemaHash = this.bb.createScalarList(this.schemaHash.bind(this), this.schemaHashLength());
|
|
98
166
|
_o.acceptsAnyFlatbuffer = this.acceptsAnyFlatbuffer();
|
|
167
|
+
_o.wireFormat = payloadWireFormatToName(this.wireFormat());
|
|
168
|
+
_o.rootTypeName = this.rootTypeName();
|
|
169
|
+
_o.fixedStringLength = this.fixedStringLength();
|
|
170
|
+
_o.byteLength = this.byteLength();
|
|
171
|
+
_o.requiredAlignment = this.requiredAlignment();
|
|
99
172
|
}
|
|
100
173
|
}
|
|
101
174
|
export class FlatBufferTypeRefT {
|
|
102
|
-
|
|
175
|
+
schemaName;
|
|
176
|
+
fileIdentifier;
|
|
177
|
+
schemaHash;
|
|
178
|
+
acceptsAnyFlatbuffer;
|
|
179
|
+
wireFormat;
|
|
180
|
+
rootTypeName;
|
|
181
|
+
fixedStringLength;
|
|
182
|
+
byteLength;
|
|
183
|
+
requiredAlignment;
|
|
184
|
+
constructor(schemaName = null, fileIdentifier = null, schemaHash = [], acceptsAnyFlatbuffer = false, wireFormat = "flatbuffer", rootTypeName = null, fixedStringLength = 0, byteLength = 0, requiredAlignment = 0) {
|
|
103
185
|
this.schemaName = schemaName;
|
|
104
186
|
this.fileIdentifier = fileIdentifier;
|
|
105
187
|
this.schemaHash = schemaHash;
|
|
106
188
|
this.acceptsAnyFlatbuffer = acceptsAnyFlatbuffer;
|
|
189
|
+
this.wireFormat = wireFormat;
|
|
190
|
+
this.rootTypeName = rootTypeName;
|
|
191
|
+
this.fixedStringLength = fixedStringLength;
|
|
192
|
+
this.byteLength = byteLength;
|
|
193
|
+
this.requiredAlignment = requiredAlignment;
|
|
107
194
|
}
|
|
108
195
|
pack(builder) {
|
|
109
|
-
const schemaName =
|
|
110
|
-
const fileIdentifier =
|
|
196
|
+
const schemaName = this.schemaName !== null ? builder.createString(this.schemaName) : 0;
|
|
197
|
+
const fileIdentifier = this.fileIdentifier !== null
|
|
198
|
+
? builder.createString(this.fileIdentifier)
|
|
199
|
+
: 0;
|
|
111
200
|
const schemaHash = FlatBufferTypeRef.createSchemaHashVector(builder, this.schemaHash);
|
|
112
|
-
|
|
201
|
+
const rootTypeName = this.rootTypeName !== null ? builder.createString(this.rootTypeName) : 0;
|
|
202
|
+
return FlatBufferTypeRef.createFlatBufferTypeRef(builder, schemaName, fileIdentifier, schemaHash, this.acceptsAnyFlatbuffer, normalizePayloadWireFormat(this.wireFormat), rootTypeName, this.fixedStringLength, this.byteLength, this.requiredAlignment);
|
|
113
203
|
}
|
|
114
204
|
}
|
|
115
205
|
//# sourceMappingURL=flat-buffer-type-ref.js.map
|