@furo/open-models 1.16.3 → 1.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/custom-elements.json +7257 -3068
  2. package/dist/API_OPTIONS.d.ts +1 -1
  3. package/dist/API_OPTIONS.js +5 -4
  4. package/dist/API_OPTIONS.js.map +1 -1
  5. package/dist/CustomPrototypes.js.map +1 -1
  6. package/dist/Fetcher.d.ts +2 -1
  7. package/dist/Fetcher.js +5 -5
  8. package/dist/Fetcher.js.map +1 -1
  9. package/dist/FieldNode.d.ts +31 -1
  10. package/dist/FieldNode.js +98 -0
  11. package/dist/FieldNode.js.map +1 -1
  12. package/dist/Mapper.js +6 -8
  13. package/dist/Mapper.js.map +1 -1
  14. package/dist/OPEN_MODELS_OPTIONS.js +2 -2
  15. package/dist/OPEN_MODELS_OPTIONS.js.map +1 -1
  16. package/dist/StrictFetcher.d.ts +58 -0
  17. package/dist/StrictFetcher.js +420 -0
  18. package/dist/StrictFetcher.js.map +1 -0
  19. package/dist/Validator.d.ts +1 -1
  20. package/dist/Validator.js.map +1 -1
  21. package/dist/ValueState.js.map +1 -1
  22. package/dist/index.d.ts +49 -47
  23. package/dist/index.js +41 -40
  24. package/dist/index.js.map +1 -1
  25. package/dist/primitives/BOOLEAN.d.ts +1 -1
  26. package/dist/primitives/BOOLEAN.js +9 -13
  27. package/dist/primitives/BOOLEAN.js.map +1 -1
  28. package/dist/primitives/DOUBLE.d.ts +2 -2
  29. package/dist/primitives/DOUBLE.js +17 -24
  30. package/dist/primitives/DOUBLE.js.map +1 -1
  31. package/dist/primitives/ENUM.d.ts +1 -1
  32. package/dist/primitives/ENUM.js +6 -9
  33. package/dist/primitives/ENUM.js.map +1 -1
  34. package/dist/primitives/FLOAT.d.ts +2 -2
  35. package/dist/primitives/FLOAT.js +17 -24
  36. package/dist/primitives/FLOAT.js.map +1 -1
  37. package/dist/primitives/INT32.d.ts +2 -2
  38. package/dist/primitives/INT32.js +17 -18
  39. package/dist/primitives/INT32.js.map +1 -1
  40. package/dist/primitives/SINT32.d.ts +2 -2
  41. package/dist/primitives/SINT32.js +17 -18
  42. package/dist/primitives/SINT32.js.map +1 -1
  43. package/dist/primitives/UINT32.d.ts +2 -2
  44. package/dist/primitives/UINT32.js +17 -18
  45. package/dist/primitives/UINT32.js.map +1 -1
  46. package/dist/web-components/furo-type-renderer.d.ts +2 -2
  47. package/dist/web-components/furo-type-renderer.js +2 -2
  48. package/dist/web-components/furo-type-renderer.js.map +1 -1
  49. package/dist/web-components/impl/TypeRenderer/index.d.ts +2 -2
  50. package/dist/web-components/impl/TypeRenderer/index.js +2 -2
  51. package/dist/web-components/impl/TypeRenderer/index.js.map +1 -1
  52. package/dist/well_known/BoolValue.d.ts +2 -2
  53. package/dist/well_known/BoolValue.js +12 -16
  54. package/dist/well_known/BoolValue.js.map +1 -1
  55. package/dist/well_known/BytesValue.d.ts +2 -2
  56. package/dist/well_known/BytesValue.js +21 -25
  57. package/dist/well_known/BytesValue.js.map +1 -1
  58. package/dist/well_known/DoubleValue.d.ts +1 -1
  59. package/dist/well_known/DoubleValue.js +23 -37
  60. package/dist/well_known/DoubleValue.js.map +1 -1
  61. package/dist/well_known/Duration.d.ts +2 -2
  62. package/dist/well_known/Duration.js +15 -19
  63. package/dist/well_known/Duration.js.map +1 -1
  64. package/dist/well_known/FieldMask.d.ts +2 -2
  65. package/dist/well_known/FieldMask.js +15 -19
  66. package/dist/well_known/FieldMask.js.map +1 -1
  67. package/dist/well_known/FloatValue.d.ts +2 -2
  68. package/dist/well_known/FloatValue.js +4 -4
  69. package/dist/well_known/FloatValue.js.map +1 -1
  70. package/dist/well_known/Int32Value.d.ts +2 -2
  71. package/dist/well_known/Int32Value.js +23 -31
  72. package/dist/well_known/Int32Value.js.map +1 -1
  73. package/dist/well_known/Timestamp.d.ts +2 -2
  74. package/dist/well_known/Timestamp.js +15 -19
  75. package/dist/well_known/Timestamp.js.map +1 -1
  76. package/dist/well_known/UInt32Value.d.ts +2 -2
  77. package/dist/well_known/UInt32Value.js +23 -31
  78. package/dist/well_known/UInt32Value.js.map +1 -1
  79. package/dist/well_known/UInt64Value.d.ts +2 -2
  80. package/dist/well_known/UInt64Value.js +23 -34
  81. package/dist/well_known/UInt64Value.js.map +1 -1
  82. package/package.json +3 -13
  83. package/web-types.json +1 -1
@@ -0,0 +1,420 @@
1
+ import { FieldNode } from "./FieldNode.js";
2
+ export class StrictFetcher {
3
+ constructor(options, method, path, ReqType, ResType, bodyField) {
4
+ this.isLoading = false;
5
+ this.responseHandler = new Map();
6
+ this.API_OPTIONS = options;
7
+ this.path = path;
8
+ this.bodyField = bodyField;
9
+ this.method = method;
10
+ this.ReqType = ReqType;
11
+ this.ResType = ResType;
12
+ // Build the proto name map from the REQ type's field descriptors
13
+ this.reqProtoNameMap = new Map();
14
+ this.reqFieldConstructorMap = new Map();
15
+ const tempReq = new ReqType();
16
+ tempReq.__meta.nodeFields.forEach(field => {
17
+ this.reqProtoNameMap.set(field.fieldName, field.protoName);
18
+ this.reqFieldConstructorMap.set(field.fieldName, field.FieldConstructor);
19
+ });
20
+ this.abortController = new AbortController();
21
+ const { signal } = this.abortController;
22
+ this.requestInit = {
23
+ method: this.method,
24
+ signal,
25
+ headers: this.API_OPTIONS.headers,
26
+ redirect: "follow",
27
+ };
28
+ this.timeout = this.API_OPTIONS.timeout ?? 300000;
29
+ }
30
+ setRequestOptions(ri) {
31
+ const { signal } = this.abortController;
32
+ this.requestInit = {
33
+ method: this.method,
34
+ headers: this.API_OPTIONS.headers,
35
+ signal,
36
+ ...ri,
37
+ };
38
+ }
39
+ setHandlers(handlers) {
40
+ this.onResponse = handlers.onResponse;
41
+ this.onResponseError = handlers.onResponseError;
42
+ this.onRequestStarted = handlers.onRequestStarted;
43
+ this.onRequestFinished = handlers.onRequestFinished;
44
+ this.onRequestAborted = handlers.onRequestAborted;
45
+ this.onResponseRaw = handlers.onResponseRaw;
46
+ this.onResponseErrorRaw = handlers.onResponseErrorRaw;
47
+ this.onResponseParseError = handlers.onResponseParseError;
48
+ this.onResponseErrorParseError = handlers.onResponseErrorParseError;
49
+ this.onFatalError = handlers.onFatalError;
50
+ }
51
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
52
+ abortPendingRequest(reason) {
53
+ if (!this.isLoading) {
54
+ return;
55
+ }
56
+ clearTimeout(this.timeoutId);
57
+ this.isLoading = false;
58
+ this.abortController.abort(reason);
59
+ if (this.onRequestAborted) {
60
+ this.onRequestAborted(reason);
61
+ }
62
+ }
63
+ invoke(rqo, options) {
64
+ return new Promise((resolve, reject) => {
65
+ if (this.isLoading) {
66
+ this.abortPendingRequest("invoke triggered before response");
67
+ }
68
+ this.abortController = new AbortController();
69
+ const { signal } = this.abortController;
70
+ this.requestInit = {
71
+ method: this.method,
72
+ signal,
73
+ headers: this.API_OPTIONS.headers,
74
+ };
75
+ if (options) {
76
+ this.setRequestOptions(options);
77
+ }
78
+ this.isLoading = true;
79
+ const { evaluatedPath, evaluatedBody } = this.buildPathAndBodyfield(this.path, this.bodyField, rqo);
80
+ if (evaluatedBody) {
81
+ this.requestInit.body = evaluatedBody;
82
+ }
83
+ clearTimeout(this.timeoutId);
84
+ const request = new Request(evaluatedPath, this.requestInit);
85
+ this.timeoutId = setTimeout(() => {
86
+ this.abortController.abort(`Timeout of ${String(this.timeout)}ms reached`);
87
+ if (this.onRequestAborted) {
88
+ this.onRequestAborted(rqo);
89
+ }
90
+ console.error(`RequestService fetch aborted: Timeout of ${String(this.timeout)}ms reached`);
91
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
92
+ reject(rqo);
93
+ }, this.timeout);
94
+ if (this.onRequestStarted) {
95
+ this.onRequestStarted(rqo);
96
+ }
97
+ fetch(request)
98
+ .then(response => {
99
+ this._reworkRequest(response)
100
+ .then(data => {
101
+ resolve(data);
102
+ })
103
+ .catch(reject);
104
+ if (this.onRequestFinished) {
105
+ this.onRequestFinished(rqo);
106
+ }
107
+ })
108
+ .catch((err) => {
109
+ this.isLoading = false;
110
+ if (err instanceof Error && err.name === "AbortError") {
111
+ if (this.onRequestAborted) {
112
+ this.onRequestAborted(rqo);
113
+ }
114
+ if (this.onRequestFinished) {
115
+ this.onRequestFinished(rqo);
116
+ }
117
+ console.error("RequestService fetch aborted: ", err);
118
+ }
119
+ else {
120
+ if (this.onRequestFinished) {
121
+ this.onRequestFinished(rqo);
122
+ }
123
+ if (this.onFatalError) {
124
+ this.onFatalError(err);
125
+ }
126
+ }
127
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
128
+ reject(err);
129
+ });
130
+ });
131
+ }
132
+ _reworkRequest(response) {
133
+ return new Promise((resolve, reject) => {
134
+ this.isLoading = false;
135
+ clearTimeout(this.timeoutId);
136
+ const status = response.status;
137
+ if (status === 0 || (status >= 200 && status < 300)) {
138
+ this.lastResponse = response;
139
+ if (this.onResponseRaw) {
140
+ this.onResponseRaw(response);
141
+ }
142
+ this._parseResponse(response)
143
+ .then(r => {
144
+ resolve(r);
145
+ if (this.onResponse) {
146
+ this.onResponse(r, response);
147
+ }
148
+ })
149
+ .catch((error) => {
150
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
151
+ reject(error);
152
+ if (this.onResponseParseError) {
153
+ this.onResponseParseError(error, response);
154
+ }
155
+ });
156
+ }
157
+ else {
158
+ this.lastResponse = response;
159
+ if (this.onResponseErrorRaw) {
160
+ this.onResponseErrorRaw(response);
161
+ }
162
+ this._parseResponse(response)
163
+ .then(r => {
164
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
165
+ reject(r);
166
+ if (this.onResponseError) {
167
+ this.onResponseError(r, response);
168
+ }
169
+ })
170
+ .catch((error) => {
171
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
172
+ reject(error);
173
+ if (this.onResponseErrorParseError) {
174
+ this.onResponseErrorParseError(error, response);
175
+ }
176
+ });
177
+ }
178
+ });
179
+ }
180
+ _parseResponse(response) {
181
+ return new Promise((resolve, reject) => {
182
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)
183
+ if (response) {
184
+ this.responseHandler.set("text/plain", r => {
185
+ r.text()
186
+ .then(text => {
187
+ resolve(text);
188
+ })
189
+ .catch((err) => {
190
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
191
+ reject(err);
192
+ });
193
+ });
194
+ this.responseHandler.set("text/html", r => {
195
+ r.text()
196
+ .then(text => {
197
+ resolve(text);
198
+ })
199
+ .catch((err) => {
200
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
201
+ reject(err);
202
+ });
203
+ });
204
+ this.responseHandler.set("application/json", r => {
205
+ r.json()
206
+ .then(json => {
207
+ if (this.API_OPTIONS.UseProtoNames) {
208
+ // Use FieldNode-based conversion instead of generic Mapper
209
+ const resNode = new this.ResType();
210
+ resNode.__fromProtoNameJson(json);
211
+ resolve(resNode.__toLiteral());
212
+ }
213
+ else {
214
+ resolve(json);
215
+ }
216
+ })
217
+ .catch((err) => {
218
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
219
+ reject(err);
220
+ });
221
+ });
222
+ this.responseHandler.set("application/x-ndjson", r => {
223
+ const preserveProtoNames = this.API_OPTIONS.UseProtoNames;
224
+ const ResTypeCtor = this.ResType;
225
+ const reader = r.body?.getReader();
226
+ if (!reader) {
227
+ throw new Error("NDJSON response has no readable body");
228
+ }
229
+ const decoder = new TextDecoder();
230
+ let buffer = "";
231
+ const iterator = {
232
+ async *[Symbol.asyncIterator]() {
233
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- loop exits via break on done
234
+ while (true) {
235
+ const { done, value } = await reader.read();
236
+ if (done)
237
+ break;
238
+ buffer += decoder.decode(value, { stream: true });
239
+ const lines = buffer.split("\n");
240
+ buffer = lines.pop() ?? "";
241
+ for (const line of lines) {
242
+ const trimmed = line.trim();
243
+ if (trimmed === "") {
244
+ continue;
245
+ }
246
+ let parsed;
247
+ try {
248
+ parsed = JSON.parse(trimmed);
249
+ }
250
+ catch {
251
+ throw new Error(`Failed to parse NDJSON line: ${trimmed}`);
252
+ }
253
+ if (preserveProtoNames) {
254
+ const resNode = new ResTypeCtor();
255
+ resNode.__fromProtoNameJson(parsed);
256
+ yield resNode.__toLiteral();
257
+ }
258
+ else {
259
+ yield parsed;
260
+ }
261
+ }
262
+ }
263
+ if (buffer.trim() !== "") {
264
+ try {
265
+ const parsed = JSON.parse(buffer.trim());
266
+ if (preserveProtoNames) {
267
+ const resNode = new ResTypeCtor();
268
+ resNode.__fromProtoNameJson(parsed);
269
+ yield resNode.__toLiteral();
270
+ }
271
+ else {
272
+ yield parsed;
273
+ }
274
+ }
275
+ catch {
276
+ throw new Error(`Failed to parse final NDJSON line: ${buffer.trim()}`);
277
+ }
278
+ }
279
+ },
280
+ };
281
+ resolve(iterator);
282
+ });
283
+ this.responseHandler.set("application/octet-stream", r => {
284
+ r.arrayBuffer()
285
+ .then(buffer => {
286
+ resolve(buffer);
287
+ })
288
+ .catch((err) => {
289
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
290
+ reject(err);
291
+ });
292
+ });
293
+ this.responseHandler.set("application/pdf", r => {
294
+ r.blob()
295
+ .then(blob => {
296
+ resolve(blob);
297
+ })
298
+ .catch((err) => {
299
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
300
+ reject(err);
301
+ });
302
+ });
303
+ this.responseHandler.set("image/jpeg", r => {
304
+ r.blob()
305
+ .then(blob => {
306
+ resolve(blob);
307
+ })
308
+ .catch((err) => {
309
+ // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers
310
+ reject(err);
311
+ });
312
+ });
313
+ const contentType = response.headers.get("content-type");
314
+ let handler = contentType?.split(";")[0].trim();
315
+ handler ??= "application/json";
316
+ let typeHandler = this.responseHandler.get(handler);
317
+ if (typeHandler === undefined) {
318
+ console.error("No parser for", handler);
319
+ typeHandler = this.responseHandler.get("application/json");
320
+ }
321
+ if (typeHandler) {
322
+ typeHandler(response);
323
+ }
324
+ }
325
+ else {
326
+ reject(new Error("no response"));
327
+ }
328
+ });
329
+ }
330
+ buildPathAndBodyfield(path, bodyField, rqo) {
331
+ let evaluatedPath = path;
332
+ let evaluatedBody;
333
+ const keysForBodyOrQueryParams = new Map();
334
+ Object.keys(rqo).forEach(key => {
335
+ keysForBodyOrQueryParams.set(key, key);
336
+ });
337
+ // Build a reverse map: protoName → camelCase fieldName for path template resolution
338
+ const protoToFieldMap = new Map();
339
+ this.reqProtoNameMap.forEach((protoName, fieldName) => {
340
+ protoToFieldMap.set(protoName, fieldName);
341
+ });
342
+ const fields = [...path.matchAll(/\{([^}]+)}/g)];
343
+ // Replace URL templates with values: /v1/cube/{cube_id} => /v1/cube/12
344
+ // Path templates use proto names, but rqo uses camelCase keys
345
+ fields.forEach(field => {
346
+ const protoName = field[1];
347
+ const camelKey = (protoToFieldMap.get(protoName) ?? protoName);
348
+ const rqoValue = rqo[camelKey];
349
+ evaluatedPath = evaluatedPath.replace(field[0], String(rqoValue));
350
+ keysForBodyOrQueryParams.delete(camelKey);
351
+ });
352
+ if (bodyField === "*") {
353
+ // Use FieldNode serialization for body when UseProtoNames is true
354
+ if (this.API_OPTIONS.UseProtoNames) {
355
+ const reqNode = new this.ReqType();
356
+ // Build a literal from remaining keys
357
+ const literalBody = {};
358
+ keysForBodyOrQueryParams.forEach(key => {
359
+ literalBody[key] = rqo[key];
360
+ });
361
+ reqNode.__fromLiteral(literalBody);
362
+ evaluatedBody = JSON.stringify(reqNode.__toJson());
363
+ }
364
+ else {
365
+ const body = {};
366
+ keysForBodyOrQueryParams.forEach(key => {
367
+ body[key] = rqo[key];
368
+ });
369
+ evaluatedBody = JSON.stringify(body);
370
+ }
371
+ }
372
+ else {
373
+ // Build query params
374
+ const params = [];
375
+ if (bodyField !== undefined) {
376
+ keysForBodyOrQueryParams.delete(bodyField);
377
+ }
378
+ keysForBodyOrQueryParams.forEach(key => {
379
+ // Use the reqProtoNameMap for proto name lookup instead of generic conversion
380
+ const paramName = this.API_OPTIONS.UseProtoNamesForQueryParams ? (this.reqProtoNameMap.get(key) ?? key) : key;
381
+ if (Array.isArray(rqo[key])) {
382
+ rqo[key].forEach(e => {
383
+ params.push(`${paramName}=${String(e)}`);
384
+ });
385
+ }
386
+ else {
387
+ params.push(`${paramName}=${String(rqo[key])}`);
388
+ }
389
+ });
390
+ if (params.length) {
391
+ evaluatedPath = `${evaluatedPath}?${params.join("&")}`;
392
+ }
393
+ if (bodyField !== undefined) {
394
+ // Use FieldNode serialization for the named body field when UseProtoNames is true
395
+ if (this.API_OPTIONS.UseProtoNames) {
396
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FieldConstructor stored from meta is untyped
397
+ const FieldCtor = this.reqFieldConstructorMap.get(bodyField);
398
+ if (FieldCtor) {
399
+ // eslint-disable-next-line @typescript-eslint/no-unsafe-call -- FieldConstructor is dynamically resolved from meta
400
+ const fieldNode = new FieldCtor(undefined);
401
+ fieldNode.__fromLiteral(rqo[bodyField]);
402
+ evaluatedBody = JSON.stringify(fieldNode.__toJson());
403
+ }
404
+ else {
405
+ evaluatedBody = JSON.stringify(rqo[bodyField]);
406
+ }
407
+ }
408
+ else {
409
+ evaluatedBody = JSON.stringify(rqo[bodyField]);
410
+ }
411
+ }
412
+ }
413
+ evaluatedPath = `${this.API_OPTIONS.serverAddr}${this.API_OPTIONS.ApiBaseURL}${evaluatedPath}`;
414
+ return {
415
+ evaluatedPath,
416
+ evaluatedBody,
417
+ };
418
+ }
419
+ }
420
+ //# sourceMappingURL=StrictF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AC,CAAC;oBACjD,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;gBACjD,CAAC;YACH,CAAC;QACH,CAAC;QAED,aAAa,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,UAAU,GAAG,aAAa,EAAE,CAAC;QAE/F,OAAO;YACL,aAAa;YACb,aAAa;SACd,CAAC;IACJ,CAAC;CAYF","sourcesContent":["import { FieldNode } from \"./FieldNode\";\n\nexport interface IApiOptions {\n serverAddr: string;\n ApiBaseURL: string;\n headers?: Headers;\n timeout?: number;\n UseProtoNames: boolean;\n UseProtoNamesForQueryParams: boolean;\n}\n\ninterface Handlers<REQ, RES> {\n onResponse?: (response: RES, serverResponse: Response) => void;\n onResponseError?: (parsedResponse: unknown, serverResponse: Response) => void;\n onRequestStarted?: (req: REQ) => void;\n onRequestFinished?: (req: REQ) => void;\n onRequestAborted?: (req: REQ) => void;\n onResponseRaw?: (serverResponse: Response) => void;\n onResponseErrorRaw?: (serverResponse: Response) => void;\n onResponseParseError?: (error: unknown, serverResponse: Response) => void;\n onResponseErrorParseError?: (error: unknown, serverResponse: Response) => void;\n onFatalError?: (error: unknown) => void;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype FieldNodeConstructor = new (initData?: any, parent?: FieldNode, parentAttributeName?: string) => FieldNode;\n\nexport class StrictFetcher<REQ, RES> {\n public timeout: number;\n public lastResponse: Response | undefined;\n public isLoading = false;\n\n private path: string;\n private requestInit: RequestInit;\n private method: string;\n private responseHandler: Map<string, (r: Response) => void> = new Map<string, (r: Response) => void>();\n private abortController: AbortController;\n private timeoutId: ReturnType<typeof setTimeout> | number | undefined;\n private bodyField: keyof REQ | \"*\" | undefined;\n private API_OPTIONS: IApiOptions;\n\n private ReqType: FieldNodeConstructor;\n private ResType: FieldNodeConstructor;\n\n // Maps camelCase fieldName → protoName from the REQ type's field descriptors\n private reqProtoNameMap: Map<string, string>;\n // Maps camelCase fieldName → FieldConstructor from the REQ type's field descriptors\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n private reqFieldConstructorMap: Map<string, any>;\n\n constructor(options: IApiOptions, method: string, path: string, ReqType: FieldNodeConstructor, ResType: FieldNodeConstructor, bodyField?: keyof REQ | \"*\") {\n this.API_OPTIONS = options;\n this.path = path;\n this.bodyField = bodyField;\n this.method = method;\n this.ReqType = ReqType;\n this.ResType = ResType;\n\n // Build the proto name map from the REQ type's field descriptors\n this.reqProtoNameMap = new Map<string, string>();\n this.reqFieldConstructorMap = new Map<string, FieldNodeConstructor>();\n const tempReq = new ReqType();\n tempReq.__meta.nodeFields.forEach(field => {\n this.reqProtoNameMap.set(field.fieldName, field.protoName);\n this.reqFieldConstructorMap.set(field.fieldName, field.FieldConstructor as FieldNodeConstructor);\n });\n\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n this.requestInit = {\n method: this.method,\n signal,\n headers: this.API_OPTIONS.headers,\n redirect: \"follow\",\n };\n\n this.timeout = this.API_OPTIONS.timeout ?? 300000;\n }\n\n public setRequestOptions(ri: RequestInit) {\n const { signal } = this.abortController;\n this.requestInit = {\n method: this.method,\n headers: this.API_OPTIONS.headers,\n signal,\n ...ri,\n };\n }\n\n public setHandlers(handlers: Handlers<REQ, RES>) {\n this.onResponse = handlers.onResponse;\n this.onResponseError = handlers.onResponseError;\n this.onRequestStarted = handlers.onRequestStarted;\n this.onRequestFinished = handlers.onRequestFinished;\n this.onRequestAborted = handlers.onRequestAborted;\n this.onResponseRaw = handlers.onResponseRaw;\n this.onResponseErrorRaw = handlers.onResponseErrorRaw;\n this.onResponseParseError = handlers.onResponseParseError;\n this.onResponseErrorParseError = handlers.onResponseErrorParseError;\n this.onFatalError = handlers.onFatalError;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n public abortPendingRequest(reason: any): void {\n if (!this.isLoading) {\n return;\n }\n clearTimeout(this.timeoutId);\n this.isLoading = false;\n this.abortController.abort(reason);\n\n if (this.onRequestAborted) {\n this.onRequestAborted(reason as REQ);\n }\n }\n\n public invoke(rqo: REQ, options?: RequestInit): Promise<RES> {\n return new Promise((resolve, reject) => {\n if (this.isLoading) {\n this.abortPendingRequest(\"invoke triggered before response\");\n }\n\n this.abortController = new AbortController();\n const { signal } = this.abortController;\n\n this.requestInit = {\n method: this.method,\n signal,\n headers: this.API_OPTIONS.headers,\n };\n\n if (options) {\n this.setRequestOptions(options);\n }\n\n this.isLoading = true;\n\n const { evaluatedPath, evaluatedBody } = this.buildPathAndBodyfield(this.path, this.bodyField, rqo);\n if (evaluatedBody) {\n this.requestInit.body = evaluatedBody;\n }\n\n clearTimeout(this.timeoutId);\n const request = new Request(evaluatedPath, this.requestInit);\n this.timeoutId = setTimeout(() => {\n this.abortController.abort(`Timeout of ${String(this.timeout)}ms reached`);\n if (this.onRequestAborted) {\n this.onRequestAborted(rqo);\n }\n\n console.error(`RequestService fetch aborted: Timeout of ${String(this.timeout)}ms reached`);\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(rqo);\n }, this.timeout);\n\n if (this.onRequestStarted) {\n this.onRequestStarted(rqo);\n }\n\n fetch(request)\n .then(response => {\n this._reworkRequest(response)\n .then(data => {\n resolve(data);\n })\n .catch(reject);\n if (this.onRequestFinished) {\n this.onRequestFinished(rqo);\n }\n })\n .catch((err: unknown) => {\n this.isLoading = false;\n\n if (err instanceof Error && err.name === \"AbortError\") {\n if (this.onRequestAborted) {\n this.onRequestAborted(rqo);\n }\n if (this.onRequestFinished) {\n this.onRequestFinished(rqo);\n }\n\n console.error(\"RequestService fetch aborted: \", err);\n } else {\n if (this.onRequestFinished) {\n this.onRequestFinished(rqo);\n }\n\n if (this.onFatalError) {\n this.onFatalError(err);\n }\n }\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n }\n\n _reworkRequest(response: Response): Promise<RES> {\n return new Promise((resolve, reject) => {\n this.isLoading = false;\n clearTimeout(this.timeoutId);\n const status = response.status;\n\n if (status === 0 || (status >= 200 && status < 300)) {\n this.lastResponse = response;\n\n if (this.onResponseRaw) {\n this.onResponseRaw(response);\n }\n\n this._parseResponse(response)\n .then(r => {\n resolve(r as RES);\n if (this.onResponse) {\n this.onResponse(r as RES, response);\n }\n })\n .catch((error: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(error);\n if (this.onResponseParseError) {\n this.onResponseParseError(error, response);\n }\n });\n } else {\n this.lastResponse = response;\n if (this.onResponseErrorRaw) {\n this.onResponseErrorRaw(response);\n }\n\n this._parseResponse(response)\n .then(r => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(r);\n if (this.onResponseError) {\n this.onResponseError(r, response);\n }\n })\n .catch((error: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(error);\n if (this.onResponseErrorParseError) {\n this.onResponseErrorParseError(error, response);\n }\n });\n }\n });\n }\n\n _parseResponse(response: Response) {\n return new Promise((resolve, reject) => {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- runtime data may not match types (REST API input)\n if (response) {\n this.responseHandler.set(\"text/plain\", r => {\n r.text()\n .then(text => {\n resolve(text);\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n\n this.responseHandler.set(\"text/html\", r => {\n r.text()\n .then(text => {\n resolve(text);\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n\n this.responseHandler.set(\"application/json\", r => {\n r.json()\n .then(json => {\n if (this.API_OPTIONS.UseProtoNames) {\n // Use FieldNode-based conversion instead of generic Mapper\n const resNode = new this.ResType();\n resNode.__fromProtoNameJson(json);\n resolve(resNode.__toLiteral());\n } else {\n resolve(json);\n }\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n\n this.responseHandler.set(\"application/x-ndjson\", r => {\n const preserveProtoNames = this.API_OPTIONS.UseProtoNames;\n const ResTypeCtor = this.ResType;\n\n const reader = r.body?.getReader();\n if (!reader) {\n throw new Error(\"NDJSON response has no readable body\");\n }\n\n const decoder = new TextDecoder();\n let buffer = \"\";\n\n const iterator = {\n async *[Symbol.asyncIterator](): AsyncGenerator<RES> {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- loop exits via break on done\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n\n buffer += decoder.decode(value, { stream: true });\n\n const lines = buffer.split(\"\\n\");\n buffer = lines.pop() ?? \"\";\n\n for (const line of lines) {\n const trimmed = line.trim();\n if (trimmed === \"\") {\n continue;\n }\n\n let parsed: RES;\n try {\n parsed = JSON.parse(trimmed) as RES;\n } catch {\n throw new Error(`Failed to parse NDJSON line: ${trimmed}`);\n }\n\n if (preserveProtoNames) {\n const resNode = new ResTypeCtor();\n resNode.__fromProtoNameJson(parsed);\n yield resNode.__toLiteral() as RES;\n } else {\n yield parsed;\n }\n }\n }\n\n if (buffer.trim() !== \"\") {\n try {\n const parsed = JSON.parse(buffer.trim()) as RES;\n if (preserveProtoNames) {\n const resNode = new ResTypeCtor();\n resNode.__fromProtoNameJson(parsed);\n yield resNode.__toLiteral() as RES;\n } else {\n yield parsed;\n }\n } catch {\n throw new Error(`Failed to parse final NDJSON line: ${buffer.trim()}`);\n }\n }\n },\n };\n\n resolve(iterator);\n });\n\n this.responseHandler.set(\"application/octet-stream\", r => {\n r.arrayBuffer()\n .then(buffer => {\n resolve(buffer);\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n this.responseHandler.set(\"application/pdf\", r => {\n r.blob()\n .then(blob => {\n resolve(blob);\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n this.responseHandler.set(\"image/jpeg\", r => {\n r.blob()\n .then(blob => {\n resolve(blob);\n })\n .catch((err: unknown) => {\n // eslint-disable-next-line @typescript-eslint/prefer-promise-reject-errors -- changing rejection types would break downstream error handlers\n reject(err);\n });\n });\n\n const contentType = response.headers.get(\"content-type\");\n let handler = contentType?.split(\";\")[0].trim();\n handler ??= \"application/json\";\n let typeHandler = this.responseHandler.get(handler);\n\n if (typeHandler === undefined) {\n console.error(\"No parser for\", handler);\n typeHandler = this.responseHandler.get(\"application/json\");\n }\n\n if (typeHandler) {\n typeHandler(response);\n }\n } else {\n reject(new Error(\"no response\"));\n }\n });\n }\n\n private buildPathAndBodyfield(\n path: string,\n bodyField: keyof REQ | \"*\" | undefined,\n rqo: REQ\n ): {\n evaluatedPath: string;\n evaluatedBody: string | undefined;\n } {\n let evaluatedPath = path;\n let evaluatedBody;\n\n const keysForBodyOrQueryParams = new Map<string, keyof REQ>();\n Object.keys(rqo as object).forEach(key => {\n keysForBodyOrQueryParams.set(key, key as keyof REQ);\n });\n\n // Build a reverse map: protoName → camelCase fieldName for path template resolution\n const protoToFieldMap = new Map<string, string>();\n this.reqProtoNameMap.forEach((protoName, fieldName) => {\n protoToFieldMap.set(protoName, fieldName);\n });\n\n const fields = [...path.matchAll(/\\{([^}]+)}/g)];\n // Replace URL templates with values: /v1/cube/{cube_id} => /v1/cube/12\n // Path templates use proto names, but rqo uses camelCase keys\n fields.forEach(field => {\n const protoName = field[1];\n const camelKey = (protoToFieldMap.get(protoName) ?? protoName) as keyof REQ;\n const rqoValue = rqo[camelKey];\n evaluatedPath = evaluatedPath.replace(field[0], String(rqoValue));\n keysForBodyOrQueryParams.delete(camelKey as string);\n });\n\n if (bodyField === \"*\") {\n // Use FieldNode serialization for body when UseProtoNames is true\n if (this.API_OPTIONS.UseProtoNames) {\n const reqNode = new this.ReqType();\n // Build a literal from remaining keys\n const literalBody: Record<string, unknown> = {};\n keysForBodyOrQueryParams.forEach(key => {\n literalBody[key as string] = rqo[key];\n });\n reqNode.__fromLiteral(literalBody);\n evaluatedBody = JSON.stringify(reqNode.__toJson());\n } else {\n const body: Record<string, unknown> = {};\n keysForBodyOrQueryParams.forEach(key => {\n body[key as string] = rqo[key];\n });\n evaluatedBody = JSON.stringify(body);\n }\n } else {\n // Build query params\n const params: string[] = [];\n if (bodyField !== undefined) {\n keysForBodyOrQueryParams.delete(bodyField as string);\n }\n keysForBodyOrQueryParams.forEach(key => {\n // Use the reqProtoNameMap for proto name lookup instead of generic conversion\n const paramName = this.API_OPTIONS.UseProtoNamesForQueryParams ? (this.reqProtoNameMap.get(key as string) ?? (key as string)) : (key as string);\n if (Array.isArray(rqo[key])) {\n (rqo[key] as unknown[]).forEach(e => {\n params.push(`${paramName}=${String(e)}`);\n });\n } else {\n params.push(`${paramName}=${String(rqo[key])}`);\n }\n });\n if (params.length) {\n evaluatedPath = `${evaluatedPath}?${params.join(\"&\")}`;\n }\n\n if (bodyField !== undefined) {\n // Use FieldNode serialization for the named body field when UseProtoNames is true\n if (this.API_OPTIONS.UseProtoNames) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- FieldConstructor stored from meta is untyped\n const FieldCtor = this.reqFieldConstructorMap.get(bodyField as string);\n if (FieldCtor) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call -- FieldConstructor is dynamically resolved from meta\n const fieldNode = new FieldCtor(undefined) as FieldNode;\n fieldNode.__fromLiteral(rqo[bodyField]);\n evaluatedBody = JSON.stringify(fieldNode.__toJson());\n } else {\n evaluatedBody = JSON.stringify(rqo[bodyField]);\n }\n } else {\n evaluatedBody = JSON.stringify(rqo[bodyField]);\n }\n }\n }\n\n evaluatedPath = `${this.API_OPTIONS.serverAddr}${this.API_OPTIONS.ApiBaseURL}${evaluatedPath}`;\n\n return {\n evaluatedPath,\n evaluatedBody,\n };\n }\n\n onResponse?: (response: RES, serverResponse: Response) => void;\n onResponseError?: (parsedResponse: unknown, serverResponse: Response) => void;\n onRequestStarted?: (req: REQ) => void;\n onRequestFinished?: (req: REQ) => void;\n onRequestAborted?: (req: REQ) => void;\n onResponseRaw?: (serverResponse: Response) => void;\n onResponseErrorRaw?: (serverResponse: Response) => void;\n onResponseParseError?: (error: unknown, serverResponse: Response) => void;\n onResponseErrorParseError?: (error: unknown, serverResponse: Response) => void;\n onFatalError?: (error: unknown) => void;\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { FieldConstraints } from './FieldConstraints.js';
1
+ import type { FieldConstraints } from "./FieldConstraints.js";
2
2
  type typeName = string;
3
3
  type validationFunc = (node: any) => void;
4
4
  export declare const Validators: Map<typeName, validationFunc>;
@@ -1 +1 @@
1
- {"version":3,"file":"Validator.js","sourceRoot":"","sources":["../src/Validator.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,UAAU,GAAkC,IAAI,GAAG,EAG7D,CAAC;AAQJ,MAAM,CAAC,MAAM,iBAAiB,GAAkC,IAAI,GAAG,EAGpE,CAAC","sourcesContent":["// Full qualified type name\nimport type { FieldConstraints } from './FieldConstraints';\n\ntype typeName = string;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype validationFunc = (node: any) => void;\n\nexport const Validators: Map<typeName, validationFunc> = new Map<\n typeName,\n validationFunc\n>();\n\ntype constraintFunc = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: any,\n constraints?: FieldConstraints,\n) => string[] | undefined; // return undefined if everything is OK\n\nexport const CustomConstraints: Map<typeName, constraintFunc> = new Map<\n typeName,\n constraintFunc\n>();\n"]}
1
+ {"version":3,"file":"Validator.js","sourceRoot":"","sources":["../src/Validator.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,UAAU,GAAkC,IAAI,GAAG,EAA4B,CAAC;AAQ7F,MAAM,CAAC,MAAM,iBAAiB,GAAkC,IAAI,GAAG,EAA4B,CAAC","sourcesContent":["// Full qualified type name\nimport type { FieldConstraints } from \"./FieldConstraints\";\n\ntype typeName = string;\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype validationFunc = (node: any) => void;\n\nexport const Validators: Map<typeName, validationFunc> = new Map<typeName, validationFunc>();\n\ntype constraintFunc = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: any,\n constraints?: FieldConstraints\n) => string[] | undefined; // return undefined if everything is OK\n\nexport const CustomConstraints: Map<typeName, constraintFunc> = new Map<typeName, constraintFunc>();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ValueState.js","sourceRoot":"","sources":["../src/ValueState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAmCX;AAnCD,WAAY,UAAU;IACpB;;;;OAIG;IACH,2BAAa,CAAA;IAEb;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,yCAA2B,CAAA;AAC7B,CAAC,EAnCW,UAAU,KAAV,UAAU,QAmCrB","sourcesContent":["/**\n * Different types of ValueStates.\n * @readonly\n * @enum {string}\n */\nexport enum ValueState {\n /**\n *\n * @public\n * @typeName {None}\n */\n None = 'None',\n\n /**\n *\n * @public\n * @typeName {Positive}\n */\n Positive = 'Positive',\n\n /**\n *\n * @public\n * @typeName {Critical}\n */\n Critical = 'Critical',\n\n /**\n *\n * @public\n * @typeName {Negative}\n */\n Negative = 'Negative',\n\n /**\n *\n * @public\n * @typeName {Information}\n */\n Information = 'Information',\n}\n"]}
1
+ {"version":3,"file":"ValueState.js","sourceRoot":"","sources":["../src/ValueState.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAN,IAAY,UAmCX;AAnCD,WAAY,UAAU;IACpB;;;;OAIG;IACH,2BAAa,CAAA;IAEb;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,mCAAqB,CAAA;IAErB;;;;OAIG;IACH,yCAA2B,CAAA;AAC7B,CAAC,EAnCW,UAAU,KAAV,UAAU,QAmCrB","sourcesContent":["/**\n * Different types of ValueStates.\n * @readonly\n * @enum {string}\n */\nexport enum ValueState {\n /**\n *\n * @public\n * @typeName {None}\n */\n None = \"None\",\n\n /**\n *\n * @public\n * @typeName {Positive}\n */\n Positive = \"Positive\",\n\n /**\n *\n * @public\n * @typeName {Critical}\n */\n Critical = \"Critical\",\n\n /**\n *\n * @public\n * @typeName {Negative}\n */\n Negative = \"Negative\",\n\n /**\n *\n * @public\n * @typeName {Information}\n */\n Information = \"Information\",\n}\n"]}
package/dist/index.d.ts CHANGED
@@ -1,50 +1,52 @@
1
- export { FieldNode, type ValueStateSummary, type ModelEventType } from './FieldNode.js';
2
- export { Registry } from './Registry.js';
3
- export { ValueState } from './ValueState.js';
4
- export { OPEN_MODELS_OPTIONS } from './OPEN_MODELS_OPTIONS.js';
5
- export { ToString, ValueOf } from './CustomPrototypes.js';
6
- export type { FieldConstraints } from './FieldConstraints.js';
7
- export { BOOLEAN } from './primitives/BOOLEAN.js';
8
- export { ENUM } from './primitives/ENUM.js';
9
- export { INT32 } from './primitives/INT32.js';
10
- export { INT64 } from './primitives/INT64.js';
11
- export { SINT32 } from './primitives/SINT32.js';
12
- export { SINT64 } from './primitives/SINT64.js';
13
- export { UINT32 } from './primitives/UINT32.js';
14
- export { UINT64 } from './primitives/UINT64.js';
15
- export { STRING } from './primitives/STRING.js';
16
- export { BYTES } from './primitives/BYTES.js';
17
- export { DOUBLE } from './primitives/DOUBLE.js';
18
- export { FLOAT } from './primitives/FLOAT.js';
19
- export { EMPTY } from './well_known/EMPTY.js';
20
- export { ANY } from './well_known/ANY.js';
21
- export { Int32Value } from './well_known/Int32Value.js';
22
- export { Int64Value } from './well_known/Int64Value.js';
23
- export { UInt32Value } from './well_known/UInt32Value.js';
24
- export { UInt64Value } from './well_known/UInt64Value.js';
25
- export { DoubleValue } from './well_known/DoubleValue.js';
26
- export { FloatValue } from './well_known/FloatValue.js';
27
- export { BoolValue } from './well_known/BoolValue.js';
28
- export { BytesValue } from './well_known/BytesValue.js';
29
- export { StringValue } from './well_known/StringValue.js';
30
- export { Timestamp } from './well_known/Timestamp.js';
31
- export { Struct } from './well_known/Struct.js';
32
- export type { JSONValue } from './well_known/Struct.js';
33
- export type { JSONObject } from './well_known/Struct.js';
34
- export { Duration } from './well_known/Duration.js';
35
- export { FieldMask } from './well_known/FieldMask.js';
36
- export { ARRAY } from './proxies/ARRAY.js';
37
- export { MAP } from './proxies/MAP.js';
38
- export { RECURSION } from './proxies/RECURSION.js';
39
- export { ServiceBindings } from './decorators/ServiceDecorators.js';
40
- export { ModelBindings } from './decorators/ModelDecorators.js';
41
- export { fieldBindings } from './decorators/FieldBindings.js';
42
- export type { BindableComponent, FieldNodeLike } from './decorators/FieldBindings.js';
43
- export { SchemaBuilder } from './decorators/SchemaBuilder.js';
44
- export { DefaultServiceEventHandlers, CreateDispatch } from './decorators/DefaultServiceEventHandlers.js';
45
- export type { EntityServiceEventType, TypedEntityService } from './decorators/EntityServiceTypes.js';
46
- export type { EntityServiceEventMap } from './decorators/EntityServiceTypes.js';
1
+ export { FieldNode, type ValueStateSummary, type ModelEventType } from "./FieldNode.js";
2
+ export { Registry } from "./Registry.js";
3
+ export { ValueState } from "./ValueState.js";
4
+ export { OPEN_MODELS_OPTIONS } from "./OPEN_MODELS_OPTIONS.js";
5
+ export { ToString, ValueOf } from "./CustomPrototypes.js";
6
+ export type { FieldConstraints } from "./FieldConstraints.js";
7
+ export { BOOLEAN } from "./primitives/BOOLEAN.js";
8
+ export { ENUM } from "./primitives/ENUM.js";
9
+ export { INT32 } from "./primitives/INT32.js";
10
+ export { INT64 } from "./primitives/INT64.js";
11
+ export { SINT32 } from "./primitives/SINT32.js";
12
+ export { SINT64 } from "./primitives/SINT64.js";
13
+ export { UINT32 } from "./primitives/UINT32.js";
14
+ export { UINT64 } from "./primitives/UINT64.js";
15
+ export { STRING } from "./primitives/STRING.js";
16
+ export { BYTES } from "./primitives/BYTES.js";
17
+ export { DOUBLE } from "./primitives/DOUBLE.js";
18
+ export { FLOAT } from "./primitives/FLOAT.js";
19
+ export { EMPTY } from "./well_known/EMPTY.js";
20
+ export { ANY } from "./well_known/ANY.js";
21
+ export { Int32Value } from "./well_known/Int32Value.js";
22
+ export { Int64Value } from "./well_known/Int64Value.js";
23
+ export { UInt32Value } from "./well_known/UInt32Value.js";
24
+ export { UInt64Value } from "./well_known/UInt64Value.js";
25
+ export { DoubleValue } from "./well_known/DoubleValue.js";
26
+ export { FloatValue } from "./well_known/FloatValue.js";
27
+ export { BoolValue } from "./well_known/BoolValue.js";
28
+ export { BytesValue } from "./well_known/BytesValue.js";
29
+ export { StringValue } from "./well_known/StringValue.js";
30
+ export { Timestamp } from "./well_known/Timestamp.js";
31
+ export { Struct } from "./well_known/Struct.js";
32
+ export type { JSONValue } from "./well_known/Struct.js";
33
+ export type { JSONObject } from "./well_known/Struct.js";
34
+ export { Duration } from "./well_known/Duration.js";
35
+ export { FieldMask } from "./well_known/FieldMask.js";
36
+ export { ARRAY } from "./proxies/ARRAY.js";
37
+ export { MAP } from "./proxies/MAP.js";
38
+ export { RECURSION } from "./proxies/RECURSION.js";
39
+ export { ServiceBindings } from "./decorators/ServiceDecorators.js";
40
+ export { ModelBindings } from "./decorators/ModelDecorators.js";
41
+ export { fieldBindings } from "./decorators/FieldBindings.js";
42
+ export type { BindableComponent, FieldNodeLike } from "./decorators/FieldBindings.js";
43
+ export { SchemaBuilder } from "./decorators/SchemaBuilder.js";
44
+ export { DefaultServiceEventHandlers, CreateDispatch } from "./decorators/DefaultServiceEventHandlers.js";
45
+ export type { EntityServiceEventType, TypedEntityService } from "./decorators/EntityServiceTypes.js";
46
+ export type { EntityServiceEventMap } from "./decorators/EntityServiceTypes.js";
47
+ export { StrictFetcher } from "./StrictFetcher.js";
48
+ export type { IApiOptions as IStrictApiOptions } from "./StrictFetcher.js";
47
49
  export interface IAny {
48
- '@type': string;
50
+ "@type": string;
49
51
  [key: string]: unknown;
50
52
  }