space-data-module-sdk 0.2.6 → 0.2.7
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/README.md +59 -0
- package/package.json +5 -1
- package/schemas/PluginManifest.fbs +9 -0
- package/src/bundle/constants.js +4 -1
- package/src/bundle/wasm.js +30 -2
- package/src/compliance/pluginCompliance.js +306 -1
- package/src/deployment/index.d.ts +224 -0
- package/src/deployment/index.js +1552 -0
- package/src/generated/orbpro/manifest/protocol-spec.d.ts +35 -3
- package/src/generated/orbpro/manifest/protocol-spec.js +120 -6
- package/src/generated/orbpro/manifest/protocol-spec.ts +191 -1
- package/src/index.d.ts +136 -3
- package/src/index.js +4 -0
- package/src/manifest/index.js +7 -0
- package/src/manifest/normalize.js +75 -5
- package/src/manifest/typeRefs.js +143 -0
- package/src/runtime/constants.js +13 -0
- package/src/runtime/index.d.ts +2 -0
- package/src/testing/index.d.ts +84 -0
- package/src/testing/index.js +414 -0
|
@@ -18,14 +18,37 @@ export declare class ProtocolSpec implements flatbuffers.IUnpackableObject<Proto
|
|
|
18
18
|
outputPortId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
19
19
|
description(): string | null;
|
|
20
20
|
description(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
21
|
+
wireId(): string | null;
|
|
22
|
+
wireId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
23
|
+
transportKind(): string | null;
|
|
24
|
+
transportKind(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
25
|
+
role(): string | null;
|
|
26
|
+
role(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
27
|
+
specUri(): string | null;
|
|
28
|
+
specUri(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
29
|
+
autoInstall(): boolean;
|
|
30
|
+
advertise(): boolean;
|
|
31
|
+
discoveryKey(): string | null;
|
|
32
|
+
discoveryKey(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
33
|
+
defaultPort(): number;
|
|
34
|
+
requireSecureTransport(): boolean;
|
|
21
35
|
static startProtocolSpec(builder: flatbuffers.Builder): void;
|
|
22
36
|
static addProtocolId(builder: flatbuffers.Builder, protocolIdOffset: flatbuffers.Offset): void;
|
|
23
37
|
static addMethodId(builder: flatbuffers.Builder, methodIdOffset: flatbuffers.Offset): void;
|
|
24
38
|
static addInputPortId(builder: flatbuffers.Builder, inputPortIdOffset: flatbuffers.Offset): void;
|
|
25
39
|
static addOutputPortId(builder: flatbuffers.Builder, outputPortIdOffset: flatbuffers.Offset): void;
|
|
26
40
|
static addDescription(builder: flatbuffers.Builder, descriptionOffset: flatbuffers.Offset): void;
|
|
41
|
+
static addWireId(builder: flatbuffers.Builder, wireIdOffset: flatbuffers.Offset): void;
|
|
42
|
+
static addTransportKind(builder: flatbuffers.Builder, transportKindOffset: flatbuffers.Offset): void;
|
|
43
|
+
static addRole(builder: flatbuffers.Builder, roleOffset: flatbuffers.Offset): void;
|
|
44
|
+
static addSpecUri(builder: flatbuffers.Builder, specUriOffset: flatbuffers.Offset): void;
|
|
45
|
+
static addAutoInstall(builder: flatbuffers.Builder, autoInstall: boolean): void;
|
|
46
|
+
static addAdvertise(builder: flatbuffers.Builder, advertise: boolean): void;
|
|
47
|
+
static addDiscoveryKey(builder: flatbuffers.Builder, discoveryKeyOffset: flatbuffers.Offset): void;
|
|
48
|
+
static addDefaultPort(builder: flatbuffers.Builder, defaultPort: number): void;
|
|
49
|
+
static addRequireSecureTransport(builder: flatbuffers.Builder, requireSecureTransport: boolean): void;
|
|
27
50
|
static endProtocolSpec(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
28
|
-
static createProtocolSpec(builder: flatbuffers.Builder, protocolIdOffset: flatbuffers.Offset, methodIdOffset: flatbuffers.Offset, inputPortIdOffset: flatbuffers.Offset, outputPortIdOffset: flatbuffers.Offset, descriptionOffset: flatbuffers.Offset): flatbuffers.Offset;
|
|
51
|
+
static createProtocolSpec(builder: flatbuffers.Builder, protocolIdOffset: flatbuffers.Offset, methodIdOffset: flatbuffers.Offset, inputPortIdOffset: flatbuffers.Offset, outputPortIdOffset: flatbuffers.Offset, descriptionOffset: flatbuffers.Offset, wireIdOffset: flatbuffers.Offset, transportKindOffset: flatbuffers.Offset, roleOffset: flatbuffers.Offset, specUriOffset: flatbuffers.Offset, autoInstall: boolean, advertise: boolean, discoveryKeyOffset: flatbuffers.Offset, defaultPort: number, requireSecureTransport: boolean): flatbuffers.Offset;
|
|
29
52
|
unpack(): ProtocolSpecT;
|
|
30
53
|
unpackTo(_o: ProtocolSpecT): void;
|
|
31
54
|
}
|
|
@@ -35,7 +58,16 @@ export declare class ProtocolSpecT implements flatbuffers.IGeneratedObject {
|
|
|
35
58
|
inputPortId: string | Uint8Array | null;
|
|
36
59
|
outputPortId: string | Uint8Array | null;
|
|
37
60
|
description: string | Uint8Array | null;
|
|
38
|
-
|
|
61
|
+
wireId: string | Uint8Array | null;
|
|
62
|
+
transportKind: string | Uint8Array | null;
|
|
63
|
+
role: string | Uint8Array | null;
|
|
64
|
+
specUri: string | Uint8Array | null;
|
|
65
|
+
autoInstall: boolean;
|
|
66
|
+
advertise: boolean;
|
|
67
|
+
discoveryKey: string | Uint8Array | null;
|
|
68
|
+
defaultPort: number;
|
|
69
|
+
requireSecureTransport: boolean;
|
|
70
|
+
constructor(protocolId?: string | Uint8Array | null, methodId?: string | Uint8Array | null, inputPortId?: string | Uint8Array | null, outputPortId?: string | Uint8Array | null, description?: string | Uint8Array | null, wireId?: string | Uint8Array | null, transportKind?: string | Uint8Array | null, role?: string | Uint8Array | null, specUri?: string | Uint8Array | null, autoInstall?: boolean, advertise?: boolean, discoveryKey?: string | Uint8Array | null, defaultPort?: number, requireSecureTransport?: boolean);
|
|
39
71
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset;
|
|
40
72
|
}
|
|
41
|
-
//# sourceMappingURL=protocol-spec.d.ts.map
|
|
73
|
+
//# sourceMappingURL=protocol-spec.d.ts.map
|
|
@@ -49,8 +49,54 @@ export class ProtocolSpec {
|
|
|
49
49
|
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
50
50
|
: null;
|
|
51
51
|
}
|
|
52
|
+
wireId(optionalEncoding) {
|
|
53
|
+
const offset = this.bb.__offset(this.bb_pos, 14);
|
|
54
|
+
return offset
|
|
55
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
56
|
+
: null;
|
|
57
|
+
}
|
|
58
|
+
transportKind(optionalEncoding) {
|
|
59
|
+
const offset = this.bb.__offset(this.bb_pos, 16);
|
|
60
|
+
return offset
|
|
61
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
62
|
+
: null;
|
|
63
|
+
}
|
|
64
|
+
role(optionalEncoding) {
|
|
65
|
+
const offset = this.bb.__offset(this.bb_pos, 18);
|
|
66
|
+
return offset
|
|
67
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
68
|
+
: null;
|
|
69
|
+
}
|
|
70
|
+
specUri(optionalEncoding) {
|
|
71
|
+
const offset = this.bb.__offset(this.bb_pos, 20);
|
|
72
|
+
return offset
|
|
73
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
74
|
+
: null;
|
|
75
|
+
}
|
|
76
|
+
autoInstall() {
|
|
77
|
+
const offset = this.bb.__offset(this.bb_pos, 22);
|
|
78
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : true;
|
|
79
|
+
}
|
|
80
|
+
advertise() {
|
|
81
|
+
const offset = this.bb.__offset(this.bb_pos, 24);
|
|
82
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
83
|
+
}
|
|
84
|
+
discoveryKey(optionalEncoding) {
|
|
85
|
+
const offset = this.bb.__offset(this.bb_pos, 26);
|
|
86
|
+
return offset
|
|
87
|
+
? this.bb.__string(this.bb_pos + offset, optionalEncoding)
|
|
88
|
+
: null;
|
|
89
|
+
}
|
|
90
|
+
defaultPort() {
|
|
91
|
+
const offset = this.bb.__offset(this.bb_pos, 28);
|
|
92
|
+
return offset ? this.bb.readUint16(this.bb_pos + offset) : 0;
|
|
93
|
+
}
|
|
94
|
+
requireSecureTransport() {
|
|
95
|
+
const offset = this.bb.__offset(this.bb_pos, 30);
|
|
96
|
+
return offset ? !!this.bb.readInt8(this.bb_pos + offset) : false;
|
|
97
|
+
}
|
|
52
98
|
static startProtocolSpec(builder) {
|
|
53
|
-
builder.startObject(
|
|
99
|
+
builder.startObject(14);
|
|
54
100
|
}
|
|
55
101
|
static addProtocolId(builder, protocolIdOffset) {
|
|
56
102
|
builder.addFieldOffset(0, protocolIdOffset, 0);
|
|
@@ -67,23 +113,59 @@ export class ProtocolSpec {
|
|
|
67
113
|
static addDescription(builder, descriptionOffset) {
|
|
68
114
|
builder.addFieldOffset(4, descriptionOffset, 0);
|
|
69
115
|
}
|
|
116
|
+
static addWireId(builder, wireIdOffset) {
|
|
117
|
+
builder.addFieldOffset(5, wireIdOffset, 0);
|
|
118
|
+
}
|
|
119
|
+
static addTransportKind(builder, transportKindOffset) {
|
|
120
|
+
builder.addFieldOffset(6, transportKindOffset, 0);
|
|
121
|
+
}
|
|
122
|
+
static addRole(builder, roleOffset) {
|
|
123
|
+
builder.addFieldOffset(7, roleOffset, 0);
|
|
124
|
+
}
|
|
125
|
+
static addSpecUri(builder, specUriOffset) {
|
|
126
|
+
builder.addFieldOffset(8, specUriOffset, 0);
|
|
127
|
+
}
|
|
128
|
+
static addAutoInstall(builder, autoInstall) {
|
|
129
|
+
builder.addFieldInt8(9, +autoInstall, +true);
|
|
130
|
+
}
|
|
131
|
+
static addAdvertise(builder, advertise) {
|
|
132
|
+
builder.addFieldInt8(10, +advertise, +false);
|
|
133
|
+
}
|
|
134
|
+
static addDiscoveryKey(builder, discoveryKeyOffset) {
|
|
135
|
+
builder.addFieldOffset(11, discoveryKeyOffset, 0);
|
|
136
|
+
}
|
|
137
|
+
static addDefaultPort(builder, defaultPort) {
|
|
138
|
+
builder.addFieldInt16(12, defaultPort, 0);
|
|
139
|
+
}
|
|
140
|
+
static addRequireSecureTransport(builder, requireSecureTransport) {
|
|
141
|
+
builder.addFieldInt8(13, +requireSecureTransport, +false);
|
|
142
|
+
}
|
|
70
143
|
static endProtocolSpec(builder) {
|
|
71
144
|
const offset = builder.endObject();
|
|
72
145
|
builder.requiredField(offset, 4); // protocol_id
|
|
73
146
|
builder.requiredField(offset, 6); // method_id
|
|
74
147
|
return offset;
|
|
75
148
|
}
|
|
76
|
-
static createProtocolSpec(builder, protocolIdOffset, methodIdOffset, inputPortIdOffset, outputPortIdOffset, descriptionOffset) {
|
|
149
|
+
static createProtocolSpec(builder, protocolIdOffset, methodIdOffset, inputPortIdOffset, outputPortIdOffset, descriptionOffset, wireIdOffset, transportKindOffset, roleOffset, specUriOffset, autoInstall, advertise, discoveryKeyOffset, defaultPort, requireSecureTransport) {
|
|
77
150
|
ProtocolSpec.startProtocolSpec(builder);
|
|
78
151
|
ProtocolSpec.addProtocolId(builder, protocolIdOffset);
|
|
79
152
|
ProtocolSpec.addMethodId(builder, methodIdOffset);
|
|
80
153
|
ProtocolSpec.addInputPortId(builder, inputPortIdOffset);
|
|
81
154
|
ProtocolSpec.addOutputPortId(builder, outputPortIdOffset);
|
|
82
155
|
ProtocolSpec.addDescription(builder, descriptionOffset);
|
|
156
|
+
ProtocolSpec.addWireId(builder, wireIdOffset);
|
|
157
|
+
ProtocolSpec.addTransportKind(builder, transportKindOffset);
|
|
158
|
+
ProtocolSpec.addRole(builder, roleOffset);
|
|
159
|
+
ProtocolSpec.addSpecUri(builder, specUriOffset);
|
|
160
|
+
ProtocolSpec.addAutoInstall(builder, autoInstall);
|
|
161
|
+
ProtocolSpec.addAdvertise(builder, advertise);
|
|
162
|
+
ProtocolSpec.addDiscoveryKey(builder, discoveryKeyOffset);
|
|
163
|
+
ProtocolSpec.addDefaultPort(builder, defaultPort);
|
|
164
|
+
ProtocolSpec.addRequireSecureTransport(builder, requireSecureTransport);
|
|
83
165
|
return ProtocolSpec.endProtocolSpec(builder);
|
|
84
166
|
}
|
|
85
167
|
unpack() {
|
|
86
|
-
return new ProtocolSpecT(this.protocolId(), this.methodId(), this.inputPortId(), this.outputPortId(), this.description());
|
|
168
|
+
return new ProtocolSpecT(this.protocolId(), this.methodId(), this.inputPortId(), this.outputPortId(), this.description(), this.wireId(), this.transportKind(), this.role(), this.specUri(), this.autoInstall(), this.advertise(), this.discoveryKey(), this.defaultPort(), this.requireSecureTransport());
|
|
87
169
|
}
|
|
88
170
|
unpackTo(_o) {
|
|
89
171
|
_o.protocolId = this.protocolId();
|
|
@@ -91,6 +173,15 @@ export class ProtocolSpec {
|
|
|
91
173
|
_o.inputPortId = this.inputPortId();
|
|
92
174
|
_o.outputPortId = this.outputPortId();
|
|
93
175
|
_o.description = this.description();
|
|
176
|
+
_o.wireId = this.wireId();
|
|
177
|
+
_o.transportKind = this.transportKind();
|
|
178
|
+
_o.role = this.role();
|
|
179
|
+
_o.specUri = this.specUri();
|
|
180
|
+
_o.autoInstall = this.autoInstall();
|
|
181
|
+
_o.advertise = this.advertise();
|
|
182
|
+
_o.discoveryKey = this.discoveryKey();
|
|
183
|
+
_o.defaultPort = this.defaultPort();
|
|
184
|
+
_o.requireSecureTransport = this.requireSecureTransport();
|
|
94
185
|
}
|
|
95
186
|
}
|
|
96
187
|
export class ProtocolSpecT {
|
|
@@ -99,12 +190,30 @@ export class ProtocolSpecT {
|
|
|
99
190
|
inputPortId;
|
|
100
191
|
outputPortId;
|
|
101
192
|
description;
|
|
102
|
-
|
|
193
|
+
wireId;
|
|
194
|
+
transportKind;
|
|
195
|
+
role;
|
|
196
|
+
specUri;
|
|
197
|
+
autoInstall;
|
|
198
|
+
advertise;
|
|
199
|
+
discoveryKey;
|
|
200
|
+
defaultPort;
|
|
201
|
+
requireSecureTransport;
|
|
202
|
+
constructor(protocolId = null, methodId = null, inputPortId = null, outputPortId = null, description = null, wireId = null, transportKind = null, role = null, specUri = null, autoInstall = true, advertise = false, discoveryKey = null, defaultPort = 0, requireSecureTransport = false) {
|
|
103
203
|
this.protocolId = protocolId;
|
|
104
204
|
this.methodId = methodId;
|
|
105
205
|
this.inputPortId = inputPortId;
|
|
106
206
|
this.outputPortId = outputPortId;
|
|
107
207
|
this.description = description;
|
|
208
|
+
this.wireId = wireId;
|
|
209
|
+
this.transportKind = transportKind;
|
|
210
|
+
this.role = role;
|
|
211
|
+
this.specUri = specUri;
|
|
212
|
+
this.autoInstall = autoInstall;
|
|
213
|
+
this.advertise = advertise;
|
|
214
|
+
this.discoveryKey = discoveryKey;
|
|
215
|
+
this.defaultPort = defaultPort;
|
|
216
|
+
this.requireSecureTransport = requireSecureTransport;
|
|
108
217
|
}
|
|
109
218
|
pack(builder) {
|
|
110
219
|
const protocolId = this.protocolId !== null ? builder.createString(this.protocolId) : 0;
|
|
@@ -112,7 +221,12 @@ export class ProtocolSpecT {
|
|
|
112
221
|
const inputPortId = this.inputPortId !== null ? builder.createString(this.inputPortId) : 0;
|
|
113
222
|
const outputPortId = this.outputPortId !== null ? builder.createString(this.outputPortId) : 0;
|
|
114
223
|
const description = this.description !== null ? builder.createString(this.description) : 0;
|
|
115
|
-
|
|
224
|
+
const wireId = this.wireId !== null ? builder.createString(this.wireId) : 0;
|
|
225
|
+
const transportKind = this.transportKind !== null ? builder.createString(this.transportKind) : 0;
|
|
226
|
+
const role = this.role !== null ? builder.createString(this.role) : 0;
|
|
227
|
+
const specUri = this.specUri !== null ? builder.createString(this.specUri) : 0;
|
|
228
|
+
const discoveryKey = this.discoveryKey !== null ? builder.createString(this.discoveryKey) : 0;
|
|
229
|
+
return ProtocolSpec.createProtocolSpec(builder, protocolId, methodId, inputPortId, outputPortId, description, wireId, transportKind, role, specUri, this.autoInstall, this.advertise, discoveryKey, this.defaultPort, this.requireSecureTransport);
|
|
116
230
|
}
|
|
117
231
|
}
|
|
118
|
-
//# sourceMappingURL=protocol-spec.js.map
|
|
232
|
+
//# sourceMappingURL=protocol-spec.js.map
|
|
@@ -90,8 +90,77 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
90
90
|
: null;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
wireId(): string | null;
|
|
94
|
+
wireId(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
95
|
+
wireId(optionalEncoding?: any): string | Uint8Array | null {
|
|
96
|
+
const offset = this.bb!.__offset(this.bb_pos, 14);
|
|
97
|
+
return offset
|
|
98
|
+
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
|
99
|
+
: null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
transportKind(): string | null;
|
|
103
|
+
transportKind(
|
|
104
|
+
optionalEncoding: flatbuffers.Encoding,
|
|
105
|
+
): string | Uint8Array | null;
|
|
106
|
+
transportKind(optionalEncoding?: any): string | Uint8Array | null {
|
|
107
|
+
const offset = this.bb!.__offset(this.bb_pos, 16);
|
|
108
|
+
return offset
|
|
109
|
+
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
|
110
|
+
: null;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
role(): string | null;
|
|
114
|
+
role(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
115
|
+
role(optionalEncoding?: any): string | Uint8Array | null {
|
|
116
|
+
const offset = this.bb!.__offset(this.bb_pos, 18);
|
|
117
|
+
return offset
|
|
118
|
+
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
|
119
|
+
: null;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
specUri(): string | null;
|
|
123
|
+
specUri(optionalEncoding: flatbuffers.Encoding): string | Uint8Array | null;
|
|
124
|
+
specUri(optionalEncoding?: any): string | Uint8Array | null {
|
|
125
|
+
const offset = this.bb!.__offset(this.bb_pos, 20);
|
|
126
|
+
return offset
|
|
127
|
+
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
|
128
|
+
: null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
autoInstall(): boolean {
|
|
132
|
+
const offset = this.bb!.__offset(this.bb_pos, 22);
|
|
133
|
+
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : true;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
advertise(): boolean {
|
|
137
|
+
const offset = this.bb!.__offset(this.bb_pos, 24);
|
|
138
|
+
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
discoveryKey(): string | null;
|
|
142
|
+
discoveryKey(
|
|
143
|
+
optionalEncoding: flatbuffers.Encoding,
|
|
144
|
+
): string | Uint8Array | null;
|
|
145
|
+
discoveryKey(optionalEncoding?: any): string | Uint8Array | null {
|
|
146
|
+
const offset = this.bb!.__offset(this.bb_pos, 26);
|
|
147
|
+
return offset
|
|
148
|
+
? this.bb!.__string(this.bb_pos + offset, optionalEncoding)
|
|
149
|
+
: null;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
defaultPort(): number {
|
|
153
|
+
const offset = this.bb!.__offset(this.bb_pos, 28);
|
|
154
|
+
return offset ? this.bb!.readUint16(this.bb_pos + offset) : 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
requireSecureTransport(): boolean {
|
|
158
|
+
const offset = this.bb!.__offset(this.bb_pos, 30);
|
|
159
|
+
return offset ? !!this.bb!.readInt8(this.bb_pos + offset) : false;
|
|
160
|
+
}
|
|
161
|
+
|
|
93
162
|
static startProtocolSpec(builder: flatbuffers.Builder) {
|
|
94
|
-
builder.startObject(
|
|
163
|
+
builder.startObject(14);
|
|
95
164
|
}
|
|
96
165
|
|
|
97
166
|
static addProtocolId(
|
|
@@ -129,6 +198,60 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
129
198
|
builder.addFieldOffset(4, descriptionOffset, 0);
|
|
130
199
|
}
|
|
131
200
|
|
|
201
|
+
static addWireId(
|
|
202
|
+
builder: flatbuffers.Builder,
|
|
203
|
+
wireIdOffset: flatbuffers.Offset,
|
|
204
|
+
) {
|
|
205
|
+
builder.addFieldOffset(5, wireIdOffset, 0);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
static addTransportKind(
|
|
209
|
+
builder: flatbuffers.Builder,
|
|
210
|
+
transportKindOffset: flatbuffers.Offset,
|
|
211
|
+
) {
|
|
212
|
+
builder.addFieldOffset(6, transportKindOffset, 0);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
static addRole(builder: flatbuffers.Builder, roleOffset: flatbuffers.Offset) {
|
|
216
|
+
builder.addFieldOffset(7, roleOffset, 0);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
static addSpecUri(
|
|
220
|
+
builder: flatbuffers.Builder,
|
|
221
|
+
specUriOffset: flatbuffers.Offset,
|
|
222
|
+
) {
|
|
223
|
+
builder.addFieldOffset(8, specUriOffset, 0);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
static addAutoInstall(
|
|
227
|
+
builder: flatbuffers.Builder,
|
|
228
|
+
autoInstall: boolean,
|
|
229
|
+
) {
|
|
230
|
+
builder.addFieldInt8(9, +autoInstall, +true);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
static addAdvertise(builder: flatbuffers.Builder, advertise: boolean) {
|
|
234
|
+
builder.addFieldInt8(10, +advertise, +false);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
static addDiscoveryKey(
|
|
238
|
+
builder: flatbuffers.Builder,
|
|
239
|
+
discoveryKeyOffset: flatbuffers.Offset,
|
|
240
|
+
) {
|
|
241
|
+
builder.addFieldOffset(11, discoveryKeyOffset, 0);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
static addDefaultPort(builder: flatbuffers.Builder, defaultPort: number) {
|
|
245
|
+
builder.addFieldInt16(12, defaultPort, 0);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
static addRequireSecureTransport(
|
|
249
|
+
builder: flatbuffers.Builder,
|
|
250
|
+
requireSecureTransport: boolean,
|
|
251
|
+
) {
|
|
252
|
+
builder.addFieldInt8(13, +requireSecureTransport, +false);
|
|
253
|
+
}
|
|
254
|
+
|
|
132
255
|
static endProtocolSpec(builder: flatbuffers.Builder): flatbuffers.Offset {
|
|
133
256
|
const offset = builder.endObject();
|
|
134
257
|
builder.requiredField(offset, 4); // protocol_id
|
|
@@ -143,6 +266,15 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
143
266
|
inputPortIdOffset: flatbuffers.Offset,
|
|
144
267
|
outputPortIdOffset: flatbuffers.Offset,
|
|
145
268
|
descriptionOffset: flatbuffers.Offset,
|
|
269
|
+
wireIdOffset: flatbuffers.Offset,
|
|
270
|
+
transportKindOffset: flatbuffers.Offset,
|
|
271
|
+
roleOffset: flatbuffers.Offset,
|
|
272
|
+
specUriOffset: flatbuffers.Offset,
|
|
273
|
+
autoInstall: boolean,
|
|
274
|
+
advertise: boolean,
|
|
275
|
+
discoveryKeyOffset: flatbuffers.Offset,
|
|
276
|
+
defaultPort: number,
|
|
277
|
+
requireSecureTransport: boolean,
|
|
146
278
|
): flatbuffers.Offset {
|
|
147
279
|
ProtocolSpec.startProtocolSpec(builder);
|
|
148
280
|
ProtocolSpec.addProtocolId(builder, protocolIdOffset);
|
|
@@ -150,6 +282,15 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
150
282
|
ProtocolSpec.addInputPortId(builder, inputPortIdOffset);
|
|
151
283
|
ProtocolSpec.addOutputPortId(builder, outputPortIdOffset);
|
|
152
284
|
ProtocolSpec.addDescription(builder, descriptionOffset);
|
|
285
|
+
ProtocolSpec.addWireId(builder, wireIdOffset);
|
|
286
|
+
ProtocolSpec.addTransportKind(builder, transportKindOffset);
|
|
287
|
+
ProtocolSpec.addRole(builder, roleOffset);
|
|
288
|
+
ProtocolSpec.addSpecUri(builder, specUriOffset);
|
|
289
|
+
ProtocolSpec.addAutoInstall(builder, autoInstall);
|
|
290
|
+
ProtocolSpec.addAdvertise(builder, advertise);
|
|
291
|
+
ProtocolSpec.addDiscoveryKey(builder, discoveryKeyOffset);
|
|
292
|
+
ProtocolSpec.addDefaultPort(builder, defaultPort);
|
|
293
|
+
ProtocolSpec.addRequireSecureTransport(builder, requireSecureTransport);
|
|
153
294
|
return ProtocolSpec.endProtocolSpec(builder);
|
|
154
295
|
}
|
|
155
296
|
|
|
@@ -160,6 +301,15 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
160
301
|
this.inputPortId(),
|
|
161
302
|
this.outputPortId(),
|
|
162
303
|
this.description(),
|
|
304
|
+
this.wireId(),
|
|
305
|
+
this.transportKind(),
|
|
306
|
+
this.role(),
|
|
307
|
+
this.specUri(),
|
|
308
|
+
this.autoInstall(),
|
|
309
|
+
this.advertise(),
|
|
310
|
+
this.discoveryKey(),
|
|
311
|
+
this.defaultPort(),
|
|
312
|
+
this.requireSecureTransport(),
|
|
163
313
|
);
|
|
164
314
|
}
|
|
165
315
|
|
|
@@ -169,6 +319,15 @@ export class ProtocolSpec implements flatbuffers.IUnpackableObject<ProtocolSpecT
|
|
|
169
319
|
_o.inputPortId = this.inputPortId();
|
|
170
320
|
_o.outputPortId = this.outputPortId();
|
|
171
321
|
_o.description = this.description();
|
|
322
|
+
_o.wireId = this.wireId();
|
|
323
|
+
_o.transportKind = this.transportKind();
|
|
324
|
+
_o.role = this.role();
|
|
325
|
+
_o.specUri = this.specUri();
|
|
326
|
+
_o.autoInstall = this.autoInstall();
|
|
327
|
+
_o.advertise = this.advertise();
|
|
328
|
+
_o.discoveryKey = this.discoveryKey();
|
|
329
|
+
_o.defaultPort = this.defaultPort();
|
|
330
|
+
_o.requireSecureTransport = this.requireSecureTransport();
|
|
172
331
|
}
|
|
173
332
|
}
|
|
174
333
|
|
|
@@ -179,6 +338,15 @@ export class ProtocolSpecT implements flatbuffers.IGeneratedObject {
|
|
|
179
338
|
public inputPortId: string | Uint8Array | null = null,
|
|
180
339
|
public outputPortId: string | Uint8Array | null = null,
|
|
181
340
|
public description: string | Uint8Array | null = null,
|
|
341
|
+
public wireId: string | Uint8Array | null = null,
|
|
342
|
+
public transportKind: string | Uint8Array | null = null,
|
|
343
|
+
public role: string | Uint8Array | null = null,
|
|
344
|
+
public specUri: string | Uint8Array | null = null,
|
|
345
|
+
public autoInstall: boolean = true,
|
|
346
|
+
public advertise: boolean = false,
|
|
347
|
+
public discoveryKey: string | Uint8Array | null = null,
|
|
348
|
+
public defaultPort: number = 0,
|
|
349
|
+
public requireSecureTransport: boolean = false,
|
|
182
350
|
) {}
|
|
183
351
|
|
|
184
352
|
pack(builder: flatbuffers.Builder): flatbuffers.Offset {
|
|
@@ -192,6 +360,19 @@ export class ProtocolSpecT implements flatbuffers.IGeneratedObject {
|
|
|
192
360
|
this.outputPortId !== null ? builder.createString(this.outputPortId!) : 0;
|
|
193
361
|
const description =
|
|
194
362
|
this.description !== null ? builder.createString(this.description!) : 0;
|
|
363
|
+
const wireId =
|
|
364
|
+
this.wireId !== null ? builder.createString(this.wireId!) : 0;
|
|
365
|
+
const transportKind =
|
|
366
|
+
this.transportKind !== null
|
|
367
|
+
? builder.createString(this.transportKind!)
|
|
368
|
+
: 0;
|
|
369
|
+
const role = this.role !== null ? builder.createString(this.role!) : 0;
|
|
370
|
+
const specUri =
|
|
371
|
+
this.specUri !== null ? builder.createString(this.specUri!) : 0;
|
|
372
|
+
const discoveryKey =
|
|
373
|
+
this.discoveryKey !== null
|
|
374
|
+
? builder.createString(this.discoveryKey!)
|
|
375
|
+
: 0;
|
|
195
376
|
|
|
196
377
|
return ProtocolSpec.createProtocolSpec(
|
|
197
378
|
builder,
|
|
@@ -200,6 +381,15 @@ export class ProtocolSpecT implements flatbuffers.IGeneratedObject {
|
|
|
200
381
|
inputPortId,
|
|
201
382
|
outputPortId,
|
|
202
383
|
description,
|
|
384
|
+
wireId,
|
|
385
|
+
transportKind,
|
|
386
|
+
role,
|
|
387
|
+
specUri,
|
|
388
|
+
this.autoInstall,
|
|
389
|
+
this.advertise,
|
|
390
|
+
discoveryKey,
|
|
391
|
+
this.defaultPort,
|
|
392
|
+
this.requireSecureTransport,
|
|
203
393
|
);
|
|
204
394
|
}
|
|
205
395
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
export type PayloadWireFormat = "flatbuffer" | "aligned-binary";
|
|
4
4
|
export type InvokeSurface = "direct" | "command";
|
|
5
|
+
export type ProtocolTransportKindName =
|
|
6
|
+
| "libp2p"
|
|
7
|
+
| "http"
|
|
8
|
+
| "ws"
|
|
9
|
+
| "wasi-pipe";
|
|
10
|
+
export type ProtocolRoleName = "handle" | "dial" | "both";
|
|
5
11
|
|
|
6
12
|
export interface PayloadTypeRef {
|
|
7
13
|
schemaName?: string;
|
|
@@ -15,6 +21,28 @@ export interface PayloadTypeRef {
|
|
|
15
21
|
requiredAlignment?: number;
|
|
16
22
|
}
|
|
17
23
|
|
|
24
|
+
export function clonePayloadTypeRef(
|
|
25
|
+
value?: PayloadTypeRef | null | Record<string, unknown>,
|
|
26
|
+
): PayloadTypeRef;
|
|
27
|
+
|
|
28
|
+
export function normalizePayloadWireFormatName(
|
|
29
|
+
value?: PayloadWireFormat | string | null,
|
|
30
|
+
): PayloadWireFormat | null;
|
|
31
|
+
|
|
32
|
+
export function getPayloadTypeWireFormat(
|
|
33
|
+
typeRef?: PayloadTypeRef | null,
|
|
34
|
+
): PayloadWireFormat;
|
|
35
|
+
|
|
36
|
+
export function payloadTypeRefsMatch(
|
|
37
|
+
expectedTypeRef?: PayloadTypeRef | null,
|
|
38
|
+
actualTypeRef?: PayloadTypeRef | null,
|
|
39
|
+
): boolean;
|
|
40
|
+
|
|
41
|
+
export function selectPreferredPayloadTypeRef(
|
|
42
|
+
port?: { acceptedTypeSets?: Array<{ allowedTypes?: PayloadTypeRef[] }> } | null,
|
|
43
|
+
options?: { preferredWireFormat?: PayloadWireFormat | string | null },
|
|
44
|
+
): PayloadTypeRef;
|
|
45
|
+
|
|
18
46
|
export type AllowedType = PayloadTypeRef;
|
|
19
47
|
|
|
20
48
|
export interface AcceptedTypeSet {
|
|
@@ -46,17 +74,61 @@ export interface ExternalInterface {
|
|
|
46
74
|
capability?: string;
|
|
47
75
|
}
|
|
48
76
|
|
|
77
|
+
export interface HostCapabilityManifest {
|
|
78
|
+
capability: string;
|
|
79
|
+
scope?: string;
|
|
80
|
+
required?: boolean;
|
|
81
|
+
description?: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface TimerSpec {
|
|
85
|
+
timerId: string;
|
|
86
|
+
methodId: string;
|
|
87
|
+
inputPortId?: string | null;
|
|
88
|
+
defaultIntervalMs?: number | bigint;
|
|
89
|
+
description?: string | null;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface ProtocolSpec {
|
|
93
|
+
protocolId: string;
|
|
94
|
+
methodId: string;
|
|
95
|
+
inputPortId?: string | null;
|
|
96
|
+
outputPortId?: string | null;
|
|
97
|
+
description?: string | null;
|
|
98
|
+
wireId?: string | null;
|
|
99
|
+
transportKind?: ProtocolTransportKindName | string | null;
|
|
100
|
+
role?: ProtocolRoleName | string | null;
|
|
101
|
+
specUri?: string | null;
|
|
102
|
+
autoInstall?: boolean;
|
|
103
|
+
advertise?: boolean;
|
|
104
|
+
discoveryKey?: string | null;
|
|
105
|
+
defaultPort?: number;
|
|
106
|
+
requireSecureTransport?: boolean;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface BuildArtifact {
|
|
110
|
+
artifactId: string;
|
|
111
|
+
kind?: string | null;
|
|
112
|
+
path: string;
|
|
113
|
+
target?: string | null;
|
|
114
|
+
entrySymbol?: string | null;
|
|
115
|
+
}
|
|
116
|
+
|
|
49
117
|
export interface PluginManifest {
|
|
50
118
|
pluginId: string;
|
|
51
119
|
name: string;
|
|
52
120
|
version: string;
|
|
53
121
|
pluginFamily: string;
|
|
54
|
-
capabilities?: string
|
|
122
|
+
capabilities?: Array<string | HostCapabilityManifest>;
|
|
55
123
|
invokeSurfaces?: InvokeSurface[];
|
|
56
124
|
runtimeTargets?: string[];
|
|
57
125
|
externalInterfaces?: ExternalInterface[];
|
|
58
126
|
methods: MethodManifest[];
|
|
127
|
+
timers?: TimerSpec[];
|
|
128
|
+
protocols?: ProtocolSpec[];
|
|
59
129
|
schemasUsed?: PayloadTypeRef[];
|
|
130
|
+
buildArtifacts?: BuildArtifact[];
|
|
131
|
+
abiVersion?: number;
|
|
60
132
|
}
|
|
61
133
|
|
|
62
134
|
export function encodePluginManifest(manifest: PluginManifest): Uint8Array;
|
|
@@ -421,6 +493,53 @@ export {
|
|
|
421
493
|
withSharedEmception,
|
|
422
494
|
} from "./compiler/emception.js";
|
|
423
495
|
|
|
496
|
+
export type {
|
|
497
|
+
CapabilityRuntimeSurface,
|
|
498
|
+
HarnessInputFrame,
|
|
499
|
+
HarnessInvokeScenario,
|
|
500
|
+
HarnessRawScenario,
|
|
501
|
+
ManifestHarnessPlan,
|
|
502
|
+
} from "./testing/index.js";
|
|
503
|
+
|
|
504
|
+
export {
|
|
505
|
+
describeCapabilityRuntimeSurface,
|
|
506
|
+
generateManifestHarnessPlan,
|
|
507
|
+
materializeHarnessScenario,
|
|
508
|
+
serializeHarnessPlan,
|
|
509
|
+
} from "./testing/index.js";
|
|
510
|
+
|
|
511
|
+
export type {
|
|
512
|
+
AuthPolicy,
|
|
513
|
+
DeploymentPlanIssue,
|
|
514
|
+
DeploymentPlanValidationReport,
|
|
515
|
+
DeploymentBindingModeName,
|
|
516
|
+
InputBinding,
|
|
517
|
+
InputBindingSourceKindName,
|
|
518
|
+
ModuleDeploymentPlan,
|
|
519
|
+
PublicationBinding,
|
|
520
|
+
ResolvedProtocolInstallation,
|
|
521
|
+
ScheduleBinding,
|
|
522
|
+
ScheduleBindingKindName,
|
|
523
|
+
ServiceBinding,
|
|
524
|
+
} from "./deployment/index.js";
|
|
525
|
+
|
|
526
|
+
export {
|
|
527
|
+
DEPLOYMENT_PLAN_FORMAT_VERSION,
|
|
528
|
+
DeploymentBindingMode,
|
|
529
|
+
InputBindingSourceKind,
|
|
530
|
+
ScheduleBindingKind,
|
|
531
|
+
createDeploymentPlanBundleEntry,
|
|
532
|
+
findDeploymentPlanEntry,
|
|
533
|
+
normalizeDeploymentBindingModeName,
|
|
534
|
+
normalizeDeploymentPlan,
|
|
535
|
+
normalizeInputBindingSourceKindName,
|
|
536
|
+
normalizeProtocolRoleName,
|
|
537
|
+
normalizeProtocolTransportKindName,
|
|
538
|
+
normalizeScheduleBindingKindName,
|
|
539
|
+
readDeploymentPlanFromBundle,
|
|
540
|
+
validateDeploymentPlan,
|
|
541
|
+
} from "./deployment/index.js";
|
|
542
|
+
|
|
424
543
|
// --- Standards ---
|
|
425
544
|
|
|
426
545
|
export interface StandardsEntry {
|
|
@@ -451,9 +570,10 @@ export const DEFAULT_HASH_ALGORITHM: string;
|
|
|
451
570
|
export function createSingleFileBundle(options: {
|
|
452
571
|
wasmBytes: Uint8Array;
|
|
453
572
|
manifest: PluginManifest;
|
|
454
|
-
authorization
|
|
573
|
+
authorization?: SignedEnvelope | unknown;
|
|
455
574
|
transportEnvelope?: EncryptedEnvelope | null;
|
|
456
|
-
|
|
575
|
+
deploymentPlan?: ModuleDeploymentPlan;
|
|
576
|
+
entries?: Array<Record<string, unknown>>;
|
|
457
577
|
}): Promise<{ wasmBytes: Uint8Array }>;
|
|
458
578
|
|
|
459
579
|
export function parseSingleFileBundle(
|
|
@@ -961,6 +1081,19 @@ export const InvokeSurface: {
|
|
|
961
1081
|
COMMAND: string;
|
|
962
1082
|
};
|
|
963
1083
|
|
|
1084
|
+
export const ProtocolTransportKind: {
|
|
1085
|
+
LIBP2P: ProtocolTransportKindName;
|
|
1086
|
+
HTTP: ProtocolTransportKindName;
|
|
1087
|
+
WS: ProtocolTransportKindName;
|
|
1088
|
+
WASI_PIPE: ProtocolTransportKindName;
|
|
1089
|
+
};
|
|
1090
|
+
|
|
1091
|
+
export const ProtocolRole: {
|
|
1092
|
+
HANDLE: ProtocolRoleName;
|
|
1093
|
+
DIAL: ProtocolRoleName;
|
|
1094
|
+
BOTH: ProtocolRoleName;
|
|
1095
|
+
};
|
|
1096
|
+
|
|
964
1097
|
export const RuntimeTarget: {
|
|
965
1098
|
NODE: string;
|
|
966
1099
|
BROWSER: string;
|
package/src/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export * from "./bundle/index.js";
|
|
|
7
7
|
export * from "./standards/index.js";
|
|
8
8
|
export * from "./host/index.js";
|
|
9
9
|
export * from "./invoke/index.js";
|
|
10
|
+
export * from "./testing/index.js";
|
|
11
|
+
export * from "./deployment/index.js";
|
|
10
12
|
export {
|
|
11
13
|
DefaultInvokeExports,
|
|
12
14
|
DefaultManifestExports,
|
|
@@ -14,5 +16,7 @@ export {
|
|
|
14
16
|
ExternalInterfaceDirection,
|
|
15
17
|
ExternalInterfaceKind,
|
|
16
18
|
InvokeSurface,
|
|
19
|
+
ProtocolRole,
|
|
20
|
+
ProtocolTransportKind,
|
|
17
21
|
RuntimeTarget,
|
|
18
22
|
} from "./runtime/constants.js";
|