space-data-module-sdk 0.8.27 → 0.9.1

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.
Files changed (121) hide show
  1. package/README.md +5 -4
  2. package/docs/assembly.js +0 -18
  3. package/docs/assets/ai-credits/ai-credits.js +116 -0
  4. package/docs/assets/sdn-chrome/sdn-chrome.css +434 -0
  5. package/docs/assets/sdn-chrome/sdn-chrome.js +236 -0
  6. package/docs/browser-wasmedge-isomorphic.html +29 -41
  7. package/docs/byo-wasm-quickstart.html +29 -41
  8. package/docs/conformance.html +29 -41
  9. package/docs/events-abi.html +29 -41
  10. package/docs/families/analytics.html +29 -41
  11. package/docs/families/attitude.html +29 -41
  12. package/docs/families/behavior.html +29 -41
  13. package/docs/families/breakup.html +29 -41
  14. package/docs/families/conjunction.html +29 -41
  15. package/docs/families/data-source.html +29 -41
  16. package/docs/families/effects.html +29 -41
  17. package/docs/families/environment.html +29 -41
  18. package/docs/families/estimation.html +29 -41
  19. package/docs/families/gnc.html +29 -41
  20. package/docs/families/maneuver.html +29 -41
  21. package/docs/families/obstruction.html +29 -41
  22. package/docs/families/propagator.html +29 -41
  23. package/docs/families/propulsion.html +29 -41
  24. package/docs/families/reentry.html +29 -41
  25. package/docs/families/rf.html +29 -41
  26. package/docs/families/scheduler.html +29 -41
  27. package/docs/families/sensor.html +29 -41
  28. package/docs/families/signature.html +29 -41
  29. package/docs/flatsql-host-contract.html +29 -41
  30. package/docs/flatsql-streaming-standard.html +29 -41
  31. package/docs/gpu-module-abi.html +29 -41
  32. package/docs/index.html +43 -47
  33. package/docs/isomorphic-pthreads.html +29 -41
  34. package/docs/isomorphic-sdn-runtime-plan.html +29 -41
  35. package/docs/language-runtime-matrix.html +29 -41
  36. package/docs/media/module-sdk-reel-poster.webp +0 -0
  37. package/docs/media/module-sdk-reel.mp4 +0 -0
  38. package/docs/media/module-sdk-reel.webm +0 -0
  39. package/docs/media/reel/reel.css +53 -0
  40. package/docs/media/reel/reel.js +272 -0
  41. package/docs/module-bundle-runtime-plan.html +29 -41
  42. package/docs/module-publication-standard.html +29 -41
  43. package/docs/node-red-default-node-parity.html +29 -41
  44. package/docs/protect-and-sign.html +29 -41
  45. package/docs/protocol-installation.html +29 -41
  46. package/docs/publication-submission.html +29 -41
  47. package/docs/secrets-capability.html +29 -41
  48. package/docs/styles.css +89 -157
  49. package/docs/testing-harness.html +29 -41
  50. package/docs/tri-runtime-parity-gate.html +29 -41
  51. package/docs/tri-runtime-parity.html +29 -41
  52. package/package.json +5 -3
  53. package/schemas/runtime/FlowNotice.fbs +39 -0
  54. package/schemas/runtime/HostOps.fbs +455 -0
  55. package/schemas/runtime/HttpRequest.fbs +25 -0
  56. package/schemas/runtime/HttpResponse.fbs +24 -0
  57. package/schemas/runtime/IngestRequest.fbs +61 -0
  58. package/schemas/runtime/IngestResult.fbs +23 -0
  59. package/schemas/runtime/ModuleConfig.fbs +41 -0
  60. package/schemas/runtime/RuntimeCommon.fbs +33 -0
  61. package/schemas/runtime/TimerTick.fbs +18 -0
  62. package/src/capabilities.js +3 -0
  63. package/src/compiler/compileModule.js +20 -2
  64. package/src/generated/runtime/aligned/HostOps_aligned.js +3913 -0
  65. package/src/generated/runtime/aligned/HostOps_aligned.ts +4605 -0
  66. package/src/generated/runtime/aligned/HostOps_enums.js +12 -0
  67. package/src/generated/runtime/aligned/HostOps_enums.ts +6 -0
  68. package/src/generated/runtime/cpp/FlowNotice_generated.h +367 -0
  69. package/src/generated/runtime/cpp/HostOps_aligned.h +3540 -0
  70. package/src/generated/runtime/cpp/HttpRequest_generated.h +317 -0
  71. package/src/generated/runtime/cpp/HttpResponse_generated.h +315 -0
  72. package/src/generated/runtime/cpp/IngestRequest_generated.h +829 -0
  73. package/src/generated/runtime/cpp/IngestResult_generated.h +319 -0
  74. package/src/generated/runtime/cpp/ModuleConfig_generated.h +604 -0
  75. package/src/generated/runtime/cpp/RuntimeCommon_generated.h +410 -0
  76. package/src/generated/runtime/cpp/TimerTick_generated.h +229 -0
  77. package/src/generated/runtime/sdn/runtime/ArchiveTarget.js +78 -0
  78. package/src/generated/runtime/sdn/runtime/ArchiveTarget.ts +104 -0
  79. package/src/generated/runtime/sdn/runtime/ConfigEntry.js +202 -0
  80. package/src/generated/runtime/sdn/runtime/ConfigEntry.ts +251 -0
  81. package/src/generated/runtime/sdn/runtime/ConfigTable.js +80 -0
  82. package/src/generated/runtime/sdn/runtime/ConfigTable.ts +97 -0
  83. package/src/generated/runtime/sdn/runtime/FlowNotice.js +196 -0
  84. package/src/generated/runtime/sdn/runtime/FlowNotice.ts +254 -0
  85. package/src/generated/runtime/sdn/runtime/Header.js +79 -0
  86. package/src/generated/runtime/sdn/runtime/Header.ts +100 -0
  87. package/src/generated/runtime/sdn/runtime/HttpRequest.js +216 -0
  88. package/src/generated/runtime/sdn/runtime/HttpRequest.ts +265 -0
  89. package/src/generated/runtime/sdn/runtime/HttpResponse.js +216 -0
  90. package/src/generated/runtime/sdn/runtime/HttpResponse.ts +267 -0
  91. package/src/generated/runtime/sdn/runtime/IngestRequest.js +121 -0
  92. package/src/generated/runtime/sdn/runtime/IngestRequest.ts +155 -0
  93. package/src/generated/runtime/sdn/runtime/IngestResult.js +184 -0
  94. package/src/generated/runtime/sdn/runtime/IngestResult.ts +235 -0
  95. package/src/generated/runtime/sdn/runtime/ModuleConfig.js +92 -0
  96. package/src/generated/runtime/sdn/runtime/ModuleConfig.ts +114 -0
  97. package/src/generated/runtime/sdn/runtime/Provenance.js +320 -0
  98. package/src/generated/runtime/sdn/runtime/Provenance.ts +405 -0
  99. package/src/generated/runtime/sdn/runtime/SourceTags.js +181 -0
  100. package/src/generated/runtime/sdn/runtime/SourceTags.ts +253 -0
  101. package/src/generated/runtime/sdn/runtime/TimerTick.js +119 -0
  102. package/src/generated/runtime/sdn/runtime/TimerTick.ts +148 -0
  103. package/src/generated/runtime/sdn/runtime/configValueKind.js +12 -0
  104. package/src/generated/runtime/sdn/runtime/configValueKind.ts +19 -0
  105. package/src/generated/runtime/sdn/runtime/flowNoticeKind.js +11 -0
  106. package/src/generated/runtime/sdn/runtime/flowNoticeKind.ts +34 -0
  107. package/src/generated/runtime/sdn/runtime/reconcileMode.js +9 -0
  108. package/src/generated/runtime/sdn/runtime/reconcileMode.ts +23 -0
  109. package/src/generated/runtime/sdn/runtime.js +16 -0
  110. package/src/generated/runtime/sdn/runtime.ts +17 -0
  111. package/src/host/abi.js +32 -6
  112. package/src/host/adapterOperations.js +79 -0
  113. package/src/host/browserHost.js +65 -2
  114. package/src/host/cpp/typedHostcall.hpp +252 -0
  115. package/src/host/hostWorkerBundleSources.js +3 -3
  116. package/src/host/nodeHost.js +50 -0
  117. package/src/host/typedDispatch.js +582 -0
  118. package/src/index.d.ts +25 -2
  119. package/src/invoke/codec.js +3 -2
  120. package/src/standards/runtimeContracts.js +596 -0
  121. package/src/standards/sharedCatalog.js +27 -0
@@ -0,0 +1,216 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import * as flatbuffers from "flatbuffers";
5
+ import { Header } from "./Header.js";
6
+ class HttpResponse {
7
+ constructor() {
8
+ __publicField(this, "bb", null);
9
+ __publicField(this, "bb_pos", 0);
10
+ }
11
+ __init(i, bb) {
12
+ this.bb_pos = i;
13
+ this.bb = bb;
14
+ return this;
15
+ }
16
+ static getRootAsHttpResponse(bb, obj) {
17
+ return (obj || new HttpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
18
+ }
19
+ static getSizePrefixedRootAsHttpResponse(bb, obj) {
20
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
21
+ return (obj || new HttpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
22
+ }
23
+ static bufferHasIdentifier(bb) {
24
+ return bb.__has_identifier("HRSP");
25
+ }
26
+ URL(optionalEncoding) {
27
+ const offset = this.bb.__offset(this.bb_pos, 4);
28
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
29
+ }
30
+ /**
31
+ * HTTP status; 0 when the request failed before a status (ERROR says why).
32
+ */
33
+ STATUS() {
34
+ const offset = this.bb.__offset(this.bb_pos, 6);
35
+ return offset ? this.bb.readInt32(this.bb_pos + offset) : 0;
36
+ }
37
+ /**
38
+ * Response headers, sorted by NAME.
39
+ */
40
+ HEADERS(index, obj) {
41
+ const offset = this.bb.__offset(this.bb_pos, 8);
42
+ return offset ? (obj || new Header()).__init(this.bb.__indirect(this.bb.__vector(this.bb_pos + offset) + index * 4), this.bb) : null;
43
+ }
44
+ headersLength() {
45
+ const offset = this.bb.__offset(this.bb_pos, 8);
46
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
47
+ }
48
+ /**
49
+ * The body verbatim (never re-encoded).
50
+ */
51
+ BODY(index) {
52
+ const offset = this.bb.__offset(this.bb_pos, 10);
53
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
54
+ }
55
+ bodyLength() {
56
+ const offset = this.bb.__offset(this.bb_pos, 10);
57
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
58
+ }
59
+ bodyArray() {
60
+ const offset = this.bb.__offset(this.bb_pos, 10);
61
+ 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;
62
+ }
63
+ /**
64
+ * The request's CONTEXT, verbatim.
65
+ */
66
+ CONTEXT(index) {
67
+ const offset = this.bb.__offset(this.bb_pos, 12);
68
+ return offset ? this.bb.readUint8(this.bb.__vector(this.bb_pos + offset) + index) : 0;
69
+ }
70
+ contextLength() {
71
+ const offset = this.bb.__offset(this.bb_pos, 12);
72
+ return offset ? this.bb.__vector_len(this.bb_pos + offset) : 0;
73
+ }
74
+ contextArray() {
75
+ const offset = this.bb.__offset(this.bb_pos, 12);
76
+ 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;
77
+ }
78
+ ERROR(optionalEncoding) {
79
+ const offset = this.bb.__offset(this.bb_pos, 14);
80
+ return offset ? this.bb.__string(this.bb_pos + offset, optionalEncoding) : null;
81
+ }
82
+ /**
83
+ * When the body was received, Unix milliseconds UTC.
84
+ */
85
+ RETRIEVED_MS() {
86
+ const offset = this.bb.__offset(this.bb_pos, 16);
87
+ return offset ? this.bb.readUint64(this.bb_pos + offset) : BigInt("0");
88
+ }
89
+ static startHttpResponse(builder) {
90
+ builder.startObject(7);
91
+ }
92
+ static addUrl(builder, URLOffset) {
93
+ builder.addFieldOffset(0, URLOffset, 0);
94
+ }
95
+ static addStatus(builder, STATUS) {
96
+ builder.addFieldInt32(1, STATUS, 0);
97
+ }
98
+ static addHeaders(builder, HEADERSOffset) {
99
+ builder.addFieldOffset(2, HEADERSOffset, 0);
100
+ }
101
+ static createHeadersVector(builder, data) {
102
+ builder.startVector(4, data.length, 4);
103
+ for (let i = data.length - 1; i >= 0; i--) {
104
+ builder.addOffset(data[i]);
105
+ }
106
+ return builder.endVector();
107
+ }
108
+ static startHeadersVector(builder, numElems) {
109
+ builder.startVector(4, numElems, 4);
110
+ }
111
+ static addBody(builder, BODYOffset) {
112
+ builder.addFieldOffset(3, BODYOffset, 0);
113
+ }
114
+ static createBodyVector(builder, data) {
115
+ builder.startVector(1, data.length, 1);
116
+ for (let i = data.length - 1; i >= 0; i--) {
117
+ builder.addInt8(data[i]);
118
+ }
119
+ return builder.endVector();
120
+ }
121
+ static startBodyVector(builder, numElems) {
122
+ builder.startVector(1, numElems, 1);
123
+ }
124
+ static addContext(builder, CONTEXTOffset) {
125
+ builder.addFieldOffset(4, CONTEXTOffset, 0);
126
+ }
127
+ static createContextVector(builder, data) {
128
+ builder.startVector(1, data.length, 1);
129
+ for (let i = data.length - 1; i >= 0; i--) {
130
+ builder.addInt8(data[i]);
131
+ }
132
+ return builder.endVector();
133
+ }
134
+ static startContextVector(builder, numElems) {
135
+ builder.startVector(1, numElems, 1);
136
+ }
137
+ static addError(builder, ERROROffset) {
138
+ builder.addFieldOffset(5, ERROROffset, 0);
139
+ }
140
+ static addRetrievedMs(builder, RETRIEVED_MS) {
141
+ builder.addFieldInt64(6, RETRIEVED_MS, BigInt("0"));
142
+ }
143
+ static endHttpResponse(builder) {
144
+ const offset = builder.endObject();
145
+ return offset;
146
+ }
147
+ static finishHttpResponseBuffer(builder, offset) {
148
+ builder.finish(offset, "HRSP");
149
+ }
150
+ static finishSizePrefixedHttpResponseBuffer(builder, offset) {
151
+ builder.finish(offset, "HRSP", true);
152
+ }
153
+ static createHttpResponse(builder, URLOffset, STATUS, HEADERSOffset, BODYOffset, CONTEXTOffset, ERROROffset, RETRIEVED_MS) {
154
+ HttpResponse.startHttpResponse(builder);
155
+ HttpResponse.addUrl(builder, URLOffset);
156
+ HttpResponse.addStatus(builder, STATUS);
157
+ HttpResponse.addHeaders(builder, HEADERSOffset);
158
+ HttpResponse.addBody(builder, BODYOffset);
159
+ HttpResponse.addContext(builder, CONTEXTOffset);
160
+ HttpResponse.addError(builder, ERROROffset);
161
+ HttpResponse.addRetrievedMs(builder, RETRIEVED_MS);
162
+ return HttpResponse.endHttpResponse(builder);
163
+ }
164
+ unpack() {
165
+ return new HttpResponseT(
166
+ this.URL(),
167
+ this.STATUS(),
168
+ this.bb.createObjList(this.HEADERS.bind(this), this.headersLength()),
169
+ this.bb.createScalarList(this.BODY.bind(this), this.bodyLength()),
170
+ this.bb.createScalarList(this.CONTEXT.bind(this), this.contextLength()),
171
+ this.ERROR(),
172
+ this.RETRIEVED_MS()
173
+ );
174
+ }
175
+ unpackTo(_o) {
176
+ _o.URL = this.URL();
177
+ _o.STATUS = this.STATUS();
178
+ _o.HEADERS = this.bb.createObjList(this.HEADERS.bind(this), this.headersLength());
179
+ _o.BODY = this.bb.createScalarList(this.BODY.bind(this), this.bodyLength());
180
+ _o.CONTEXT = this.bb.createScalarList(this.CONTEXT.bind(this), this.contextLength());
181
+ _o.ERROR = this.ERROR();
182
+ _o.RETRIEVED_MS = this.RETRIEVED_MS();
183
+ }
184
+ }
185
+ class HttpResponseT {
186
+ constructor(URL = null, STATUS = 0, HEADERS = [], BODY = [], CONTEXT = [], ERROR = null, RETRIEVED_MS = BigInt("0")) {
187
+ __publicField(this, "URL", URL);
188
+ __publicField(this, "STATUS", STATUS);
189
+ __publicField(this, "HEADERS", HEADERS);
190
+ __publicField(this, "BODY", BODY);
191
+ __publicField(this, "CONTEXT", CONTEXT);
192
+ __publicField(this, "ERROR", ERROR);
193
+ __publicField(this, "RETRIEVED_MS", RETRIEVED_MS);
194
+ }
195
+ pack(builder) {
196
+ const URL = this.URL !== null ? builder.createString(this.URL) : 0;
197
+ const HEADERS = HttpResponse.createHeadersVector(builder, builder.createObjectOffsetList(this.HEADERS));
198
+ const BODY = HttpResponse.createBodyVector(builder, this.BODY);
199
+ const CONTEXT = HttpResponse.createContextVector(builder, this.CONTEXT);
200
+ const ERROR = this.ERROR !== null ? builder.createString(this.ERROR) : 0;
201
+ return HttpResponse.createHttpResponse(
202
+ builder,
203
+ URL,
204
+ this.STATUS,
205
+ HEADERS,
206
+ BODY,
207
+ CONTEXT,
208
+ ERROR,
209
+ this.RETRIEVED_MS
210
+ );
211
+ }
212
+ }
213
+ export {
214
+ HttpResponse,
215
+ HttpResponseT
216
+ };
@@ -0,0 +1,267 @@
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 { Header, HeaderT } from './Header.js';
8
+
9
+
10
+ /**
11
+ * The host's answer to one HttpRequest. Replaces the hostcap/http-request JSON response and the $HRB raw-body
12
+ * frame. A 304 means the host presented validators and the publisher has nothing new.
13
+ */
14
+ export class HttpResponse implements flatbuffers.IUnpackableObject<HttpResponseT> {
15
+ bb: flatbuffers.ByteBuffer|null = null;
16
+ bb_pos = 0;
17
+ __init(i:number, bb:flatbuffers.ByteBuffer):HttpResponse {
18
+ this.bb_pos = i;
19
+ this.bb = bb;
20
+ return this;
21
+ }
22
+
23
+ static getRootAsHttpResponse(bb:flatbuffers.ByteBuffer, obj?:HttpResponse):HttpResponse {
24
+ return (obj || new HttpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25
+ }
26
+
27
+ static getSizePrefixedRootAsHttpResponse(bb:flatbuffers.ByteBuffer, obj?:HttpResponse):HttpResponse {
28
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
29
+ return (obj || new HttpResponse()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
30
+ }
31
+
32
+ static bufferHasIdentifier(bb:flatbuffers.ByteBuffer):boolean {
33
+ return bb.__has_identifier('HRSP');
34
+ }
35
+
36
+ /**
37
+ * The URL answered (after redirects).
38
+ */
39
+ URL():string|null
40
+ URL(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
41
+ URL(optionalEncoding?:any):string|Uint8Array|null {
42
+ const offset = this.bb!.__offset(this.bb_pos, 4);
43
+ return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
44
+ }
45
+
46
+ /**
47
+ * HTTP status; 0 when the request failed before a status (ERROR says why).
48
+ */
49
+ STATUS():number {
50
+ const offset = this.bb!.__offset(this.bb_pos, 6);
51
+ return offset ? this.bb!.readInt32(this.bb_pos + offset) : 0;
52
+ }
53
+
54
+ /**
55
+ * Response headers, sorted by NAME.
56
+ */
57
+ HEADERS(index: number, obj?:Header):Header|null {
58
+ const offset = this.bb!.__offset(this.bb_pos, 8);
59
+ return offset ? (obj || new Header()).__init(this.bb!.__indirect(this.bb!.__vector(this.bb_pos + offset) + index * 4), this.bb!) : null;
60
+ }
61
+
62
+ headersLength():number {
63
+ const offset = this.bb!.__offset(this.bb_pos, 8);
64
+ return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
65
+ }
66
+
67
+ /**
68
+ * The body verbatim (never re-encoded).
69
+ */
70
+ BODY(index: number):number|null {
71
+ const offset = this.bb!.__offset(this.bb_pos, 10);
72
+ return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
73
+ }
74
+
75
+ bodyLength():number {
76
+ const offset = this.bb!.__offset(this.bb_pos, 10);
77
+ return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
78
+ }
79
+
80
+ bodyArray():Uint8Array|null {
81
+ const offset = this.bb!.__offset(this.bb_pos, 10);
82
+ 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;
83
+ }
84
+
85
+ /**
86
+ * The request's CONTEXT, verbatim.
87
+ */
88
+ CONTEXT(index: number):number|null {
89
+ const offset = this.bb!.__offset(this.bb_pos, 12);
90
+ return offset ? this.bb!.readUint8(this.bb!.__vector(this.bb_pos + offset) + index) : 0;
91
+ }
92
+
93
+ contextLength():number {
94
+ const offset = this.bb!.__offset(this.bb_pos, 12);
95
+ return offset ? this.bb!.__vector_len(this.bb_pos + offset) : 0;
96
+ }
97
+
98
+ contextArray():Uint8Array|null {
99
+ const offset = this.bb!.__offset(this.bb_pos, 12);
100
+ 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;
101
+ }
102
+
103
+ /**
104
+ * Why the exchange failed (timeout, budget exceeded, refused by policy); empty on an answered request.
105
+ */
106
+ ERROR():string|null
107
+ ERROR(optionalEncoding:flatbuffers.Encoding):string|Uint8Array|null
108
+ ERROR(optionalEncoding?:any):string|Uint8Array|null {
109
+ const offset = this.bb!.__offset(this.bb_pos, 14);
110
+ return offset ? this.bb!.__string(this.bb_pos + offset, optionalEncoding) : null;
111
+ }
112
+
113
+ /**
114
+ * When the body was received, Unix milliseconds UTC.
115
+ */
116
+ RETRIEVED_MS():bigint {
117
+ const offset = this.bb!.__offset(this.bb_pos, 16);
118
+ return offset ? this.bb!.readUint64(this.bb_pos + offset) : BigInt('0');
119
+ }
120
+
121
+ static startHttpResponse(builder:flatbuffers.Builder) {
122
+ builder.startObject(7);
123
+ }
124
+
125
+ static addUrl(builder:flatbuffers.Builder, URLOffset:flatbuffers.Offset) {
126
+ builder.addFieldOffset(0, URLOffset, 0);
127
+ }
128
+
129
+ static addStatus(builder:flatbuffers.Builder, STATUS:number) {
130
+ builder.addFieldInt32(1, STATUS, 0);
131
+ }
132
+
133
+ static addHeaders(builder:flatbuffers.Builder, HEADERSOffset:flatbuffers.Offset) {
134
+ builder.addFieldOffset(2, HEADERSOffset, 0);
135
+ }
136
+
137
+ static createHeadersVector(builder:flatbuffers.Builder, data:flatbuffers.Offset[]):flatbuffers.Offset {
138
+ builder.startVector(4, data.length, 4);
139
+ for (let i = data.length - 1; i >= 0; i--) {
140
+ builder.addOffset(data[i]!);
141
+ }
142
+ return builder.endVector();
143
+ }
144
+
145
+ static startHeadersVector(builder:flatbuffers.Builder, numElems:number) {
146
+ builder.startVector(4, numElems, 4);
147
+ }
148
+
149
+ static addBody(builder:flatbuffers.Builder, BODYOffset:flatbuffers.Offset) {
150
+ builder.addFieldOffset(3, BODYOffset, 0);
151
+ }
152
+
153
+ static createBodyVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
154
+ builder.startVector(1, data.length, 1);
155
+ for (let i = data.length - 1; i >= 0; i--) {
156
+ builder.addInt8(data[i]!);
157
+ }
158
+ return builder.endVector();
159
+ }
160
+
161
+ static startBodyVector(builder:flatbuffers.Builder, numElems:number) {
162
+ builder.startVector(1, numElems, 1);
163
+ }
164
+
165
+ static addContext(builder:flatbuffers.Builder, CONTEXTOffset:flatbuffers.Offset) {
166
+ builder.addFieldOffset(4, CONTEXTOffset, 0);
167
+ }
168
+
169
+ static createContextVector(builder:flatbuffers.Builder, data:number[]|Uint8Array):flatbuffers.Offset {
170
+ builder.startVector(1, data.length, 1);
171
+ for (let i = data.length - 1; i >= 0; i--) {
172
+ builder.addInt8(data[i]!);
173
+ }
174
+ return builder.endVector();
175
+ }
176
+
177
+ static startContextVector(builder:flatbuffers.Builder, numElems:number) {
178
+ builder.startVector(1, numElems, 1);
179
+ }
180
+
181
+ static addError(builder:flatbuffers.Builder, ERROROffset:flatbuffers.Offset) {
182
+ builder.addFieldOffset(5, ERROROffset, 0);
183
+ }
184
+
185
+ static addRetrievedMs(builder:flatbuffers.Builder, RETRIEVED_MS:bigint) {
186
+ builder.addFieldInt64(6, RETRIEVED_MS, BigInt('0'));
187
+ }
188
+
189
+ static endHttpResponse(builder:flatbuffers.Builder):flatbuffers.Offset {
190
+ const offset = builder.endObject();
191
+ return offset;
192
+ }
193
+
194
+ static finishHttpResponseBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
195
+ builder.finish(offset, 'HRSP');
196
+ }
197
+
198
+ static finishSizePrefixedHttpResponseBuffer(builder:flatbuffers.Builder, offset:flatbuffers.Offset) {
199
+ builder.finish(offset, 'HRSP', true);
200
+ }
201
+
202
+ static createHttpResponse(builder:flatbuffers.Builder, URLOffset:flatbuffers.Offset, STATUS:number, HEADERSOffset:flatbuffers.Offset, BODYOffset:flatbuffers.Offset, CONTEXTOffset:flatbuffers.Offset, ERROROffset:flatbuffers.Offset, RETRIEVED_MS:bigint):flatbuffers.Offset {
203
+ HttpResponse.startHttpResponse(builder);
204
+ HttpResponse.addUrl(builder, URLOffset);
205
+ HttpResponse.addStatus(builder, STATUS);
206
+ HttpResponse.addHeaders(builder, HEADERSOffset);
207
+ HttpResponse.addBody(builder, BODYOffset);
208
+ HttpResponse.addContext(builder, CONTEXTOffset);
209
+ HttpResponse.addError(builder, ERROROffset);
210
+ HttpResponse.addRetrievedMs(builder, RETRIEVED_MS);
211
+ return HttpResponse.endHttpResponse(builder);
212
+ }
213
+
214
+ unpack(): HttpResponseT {
215
+ return new HttpResponseT(
216
+ this.URL(),
217
+ this.STATUS(),
218
+ this.bb!.createObjList<Header, HeaderT>(this.HEADERS.bind(this), this.headersLength()),
219
+ this.bb!.createScalarList<number>(this.BODY.bind(this), this.bodyLength()),
220
+ this.bb!.createScalarList<number>(this.CONTEXT.bind(this), this.contextLength()),
221
+ this.ERROR(),
222
+ this.RETRIEVED_MS()
223
+ );
224
+ }
225
+
226
+
227
+ unpackTo(_o: HttpResponseT): void {
228
+ _o.URL = this.URL();
229
+ _o.STATUS = this.STATUS();
230
+ _o.HEADERS = this.bb!.createObjList<Header, HeaderT>(this.HEADERS.bind(this), this.headersLength());
231
+ _o.BODY = this.bb!.createScalarList<number>(this.BODY.bind(this), this.bodyLength());
232
+ _o.CONTEXT = this.bb!.createScalarList<number>(this.CONTEXT.bind(this), this.contextLength());
233
+ _o.ERROR = this.ERROR();
234
+ _o.RETRIEVED_MS = this.RETRIEVED_MS();
235
+ }
236
+ }
237
+
238
+ export class HttpResponseT implements flatbuffers.IGeneratedObject {
239
+ constructor(
240
+ public URL: string|Uint8Array|null = null,
241
+ public STATUS: number = 0,
242
+ public HEADERS: (HeaderT)[] = [],
243
+ public BODY: (number)[] = [],
244
+ public CONTEXT: (number)[] = [],
245
+ public ERROR: string|Uint8Array|null = null,
246
+ public RETRIEVED_MS: bigint = BigInt('0')
247
+ ){}
248
+
249
+
250
+ pack(builder:flatbuffers.Builder): flatbuffers.Offset {
251
+ const URL = (this.URL !== null ? builder.createString(this.URL!) : 0);
252
+ const HEADERS = HttpResponse.createHeadersVector(builder, builder.createObjectOffsetList(this.HEADERS));
253
+ const BODY = HttpResponse.createBodyVector(builder, this.BODY);
254
+ const CONTEXT = HttpResponse.createContextVector(builder, this.CONTEXT);
255
+ const ERROR = (this.ERROR !== null ? builder.createString(this.ERROR!) : 0);
256
+
257
+ return HttpResponse.createHttpResponse(builder,
258
+ URL,
259
+ this.STATUS,
260
+ HEADERS,
261
+ BODY,
262
+ CONTEXT,
263
+ ERROR,
264
+ this.RETRIEVED_MS
265
+ );
266
+ }
267
+ }
@@ -0,0 +1,121 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+ import * as flatbuffers from "flatbuffers";
5
+ import { ArchiveTarget } from "./ArchiveTarget.js";
6
+ import { Provenance } from "./Provenance.js";
7
+ import { SourceTags } from "./SourceTags.js";
8
+ import { reconcileMode } from "./reconcileMode.js";
9
+ class IngestRequest {
10
+ constructor() {
11
+ __publicField(this, "bb", null);
12
+ __publicField(this, "bb_pos", 0);
13
+ }
14
+ __init(i, bb) {
15
+ this.bb_pos = i;
16
+ this.bb = bb;
17
+ return this;
18
+ }
19
+ static getRootAsIngestRequest(bb, obj) {
20
+ return (obj || new IngestRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
21
+ }
22
+ static getSizePrefixedRootAsIngestRequest(bb, obj) {
23
+ bb.setPosition(bb.position() + flatbuffers.SIZE_PREFIX_LENGTH);
24
+ return (obj || new IngestRequest()).__init(bb.readInt32(bb.position()) + bb.position(), bb);
25
+ }
26
+ static bufferHasIdentifier(bb) {
27
+ return bb.__has_identifier("INGQ");
28
+ }
29
+ SCHEMA(optionalEncoding) {
30
+ const offset = this.bb.__offset(this.bb_pos, 4);
31
+ return this.bb.__string(this.bb_pos + offset, optionalEncoding);
32
+ }
33
+ TAGS(obj) {
34
+ const offset = this.bb.__offset(this.bb_pos, 6);
35
+ return offset ? (obj || new SourceTags()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
36
+ }
37
+ RECONCILE() {
38
+ const offset = this.bb.__offset(this.bb_pos, 8);
39
+ return offset ? this.bb.readUint8(this.bb_pos + offset) : reconcileMode.Duplicates;
40
+ }
41
+ ARCHIVE(obj) {
42
+ const offset = this.bb.__offset(this.bb_pos, 10);
43
+ return offset ? (obj || new ArchiveTarget()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
44
+ }
45
+ PROVENANCE(obj) {
46
+ const offset = this.bb.__offset(this.bb_pos, 12);
47
+ return offset ? (obj || new Provenance()).__init(this.bb.__indirect(this.bb_pos + offset), this.bb) : null;
48
+ }
49
+ static startIngestRequest(builder) {
50
+ builder.startObject(5);
51
+ }
52
+ static addSchema(builder, SCHEMAOffset) {
53
+ builder.addFieldOffset(0, SCHEMAOffset, 0);
54
+ }
55
+ static addTags(builder, TAGSOffset) {
56
+ builder.addFieldOffset(1, TAGSOffset, 0);
57
+ }
58
+ static addReconcile(builder, RECONCILE) {
59
+ builder.addFieldInt8(2, RECONCILE, reconcileMode.Duplicates);
60
+ }
61
+ static addArchive(builder, ARCHIVEOffset) {
62
+ builder.addFieldOffset(3, ARCHIVEOffset, 0);
63
+ }
64
+ static addProvenance(builder, PROVENANCEOffset) {
65
+ builder.addFieldOffset(4, PROVENANCEOffset, 0);
66
+ }
67
+ static endIngestRequest(builder) {
68
+ const offset = builder.endObject();
69
+ builder.requiredField(offset, 4);
70
+ builder.requiredField(offset, 6);
71
+ return offset;
72
+ }
73
+ static finishIngestRequestBuffer(builder, offset) {
74
+ builder.finish(offset, "INGQ");
75
+ }
76
+ static finishSizePrefixedIngestRequestBuffer(builder, offset) {
77
+ builder.finish(offset, "INGQ", true);
78
+ }
79
+ unpack() {
80
+ return new IngestRequestT(
81
+ this.SCHEMA(),
82
+ this.TAGS() !== null ? this.TAGS().unpack() : null,
83
+ this.RECONCILE(),
84
+ this.ARCHIVE() !== null ? this.ARCHIVE().unpack() : null,
85
+ this.PROVENANCE() !== null ? this.PROVENANCE().unpack() : null
86
+ );
87
+ }
88
+ unpackTo(_o) {
89
+ _o.SCHEMA = this.SCHEMA();
90
+ _o.TAGS = this.TAGS() !== null ? this.TAGS().unpack() : null;
91
+ _o.RECONCILE = this.RECONCILE();
92
+ _o.ARCHIVE = this.ARCHIVE() !== null ? this.ARCHIVE().unpack() : null;
93
+ _o.PROVENANCE = this.PROVENANCE() !== null ? this.PROVENANCE().unpack() : null;
94
+ }
95
+ }
96
+ class IngestRequestT {
97
+ constructor(SCHEMA = null, TAGS = null, RECONCILE = reconcileMode.Duplicates, ARCHIVE = null, PROVENANCE = null) {
98
+ __publicField(this, "SCHEMA", SCHEMA);
99
+ __publicField(this, "TAGS", TAGS);
100
+ __publicField(this, "RECONCILE", RECONCILE);
101
+ __publicField(this, "ARCHIVE", ARCHIVE);
102
+ __publicField(this, "PROVENANCE", PROVENANCE);
103
+ }
104
+ pack(builder) {
105
+ const SCHEMA = this.SCHEMA !== null ? builder.createString(this.SCHEMA) : 0;
106
+ const TAGS = this.TAGS !== null ? this.TAGS.pack(builder) : 0;
107
+ const ARCHIVE = this.ARCHIVE !== null ? this.ARCHIVE.pack(builder) : 0;
108
+ const PROVENANCE = this.PROVENANCE !== null ? this.PROVENANCE.pack(builder) : 0;
109
+ IngestRequest.startIngestRequest(builder);
110
+ IngestRequest.addSchema(builder, SCHEMA);
111
+ IngestRequest.addTags(builder, TAGS);
112
+ IngestRequest.addReconcile(builder, this.RECONCILE);
113
+ IngestRequest.addArchive(builder, ARCHIVE);
114
+ IngestRequest.addProvenance(builder, PROVENANCE);
115
+ return IngestRequest.endIngestRequest(builder);
116
+ }
117
+ }
118
+ export {
119
+ IngestRequest,
120
+ IngestRequestT
121
+ };