web-core-tcm 0.0.52 → 0.0.54

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 (113) hide show
  1. package/dist/node_modules/@alova/shared/dist/alova-shared.esm.js +249 -101
  2. package/dist/node_modules/@bufbuild/protobuf/dist/esm/clone.js +35 -0
  3. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/embed.js +109 -0
  4. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/enum.js +16 -0
  5. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/extension.js +9 -0
  6. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/file.js +9 -10
  7. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/index.js +28 -0
  8. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/scalar.js +48 -0
  9. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/service.js +8 -0
  10. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/symbols.js +49 -0
  11. package/dist/node_modules/@bufbuild/protobuf/dist/esm/codegenv2/types.js +1 -0
  12. package/dist/node_modules/@bufbuild/protobuf/dist/esm/equals.js +127 -0
  13. package/dist/node_modules/@bufbuild/protobuf/dist/esm/extensions.js +86 -0
  14. package/dist/node_modules/@bufbuild/protobuf/dist/esm/fields.js +11 -0
  15. package/dist/node_modules/@bufbuild/protobuf/dist/esm/from-binary.js +60 -56
  16. package/dist/node_modules/@bufbuild/protobuf/dist/esm/from-json.js +434 -0
  17. package/dist/node_modules/@bufbuild/protobuf/dist/esm/index.js +49 -0
  18. package/dist/node_modules/@bufbuild/protobuf/dist/esm/merge.js +33 -0
  19. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/error.js +12 -3
  20. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/guard.js +14 -10
  21. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/names.js +32 -12
  22. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/nested-types.js +42 -6
  23. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/reflect.js +58 -50
  24. package/dist/node_modules/@bufbuild/protobuf/dist/esm/reflect/scalar.js +26 -4
  25. package/dist/node_modules/@bufbuild/protobuf/dist/esm/registry.js +130 -99
  26. package/dist/node_modules/@bufbuild/protobuf/dist/esm/to-json.js +279 -0
  27. package/dist/node_modules/@bufbuild/protobuf/dist/esm/types.js +1 -0
  28. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/base64-encoding.js +48 -27
  29. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/index.js +24 -0
  30. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/size-delimited.js +123 -0
  31. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wire/text-encoding.js +9 -5
  32. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/any.js +40 -0
  33. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/duration.js +18 -0
  34. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/any_pb.js +7 -0
  35. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/api_pb.js +11 -0
  36. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/compiler/plugin_pb.js +19 -0
  37. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/cpp_features_pb.js +18 -0
  38. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/descriptor_pb.js +134 -60
  39. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/duration_pb.js +7 -0
  40. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/empty_pb.js +7 -0
  41. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/field_mask_pb.js +7 -0
  42. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/go_features_pb.js +25 -0
  43. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/java_features_pb.js +26 -0
  44. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/source_context_pb.js +7 -0
  45. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/struct_pb.js +17 -0
  46. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/timestamp_pb.js +7 -0
  47. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/type_pb.js +35 -0
  48. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/gen/google/protobuf/wrappers_pb.js +15 -0
  49. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/index.js +180 -0
  50. package/dist/node_modules/@bufbuild/protobuf/dist/esm/wkt/timestamp.js +29 -0
  51. package/dist/node_modules/alova/dist/adapter/fetch.esm.js +10 -10
  52. package/dist/node_modules/alova/dist/alova.esm.js +263 -211
  53. package/dist/node_modules/alova/dist/clienthook/index.esm.js +2110 -70
  54. package/dist/node_modules/builder-pattern/dist/index.js +25 -13
  55. package/dist/node_modules/pinyin/lib/esm/pinyin.js +2 -2
  56. package/dist/node_modules/punycode/punycode.es6.js +17 -17
  57. package/dist/src/api/algorithm/alova/implement/comprehensiveAlgorithm.js +4 -7
  58. package/dist/src/api/algorithm/alova/implement/index.js +12 -0
  59. package/dist/src/api/algorithm/alova/implement/inquiriesAlgorithm.js +4 -7
  60. package/dist/src/api/algorithm/alova/implement/inspectionsAlgorithm.js +7 -10
  61. package/dist/src/api/algorithm/alova/implement/lisemsAlgorithm.js +6 -9
  62. package/dist/src/api/algorithm/alova/implement/pulsationsAlgorithm.js +7 -10
  63. package/dist/src/api/algorithm/alova/index.js +11 -15
  64. package/dist/src/api/algorithm/comprehensiveAlgorithm.js +5 -6
  65. package/dist/src/api/authorization/alova/globals.js +1 -0
  66. package/dist/src/api/authorization/alova/implement/index.js +4 -0
  67. package/dist/src/api/authorization/alova/index.js +10 -8
  68. package/dist/src/api/check/alova/globals.js +1 -0
  69. package/dist/src/api/check/alova/implement/index.js +5 -0
  70. package/dist/src/api/check/alova/index.js +5 -6
  71. package/dist/src/api/check/check.js +2 -2
  72. package/dist/src/api/config/index.d.ts +1 -1
  73. package/dist/src/api/config/index.js +2 -2
  74. package/dist/src/api/core/index.js +9 -0
  75. package/dist/src/api/device/device.d.ts +4 -5
  76. package/dist/src/api/device/device.js +20 -29
  77. package/dist/src/api/doctor/alova/globals.js +1 -0
  78. package/dist/src/api/doctor/alova/implement/index.js +4 -0
  79. package/dist/src/api/doctor/alova/index.js +10 -9
  80. package/dist/src/api/index.d.ts +12 -11
  81. package/dist/src/api/index.js +28 -0
  82. package/dist/src/api/metric/alova/implement/index.js +4 -0
  83. package/dist/src/api/metric/alova/index.js +1 -0
  84. package/dist/src/api/metric/index.js +5 -4
  85. package/dist/src/api/oauth/alova/globals.js +1 -0
  86. package/dist/src/api/oauth/alova/implement/index.js +4 -0
  87. package/dist/src/api/oauth/alova/index.js +13 -11
  88. package/dist/src/api/outpatient/alova/globals.js +1 -0
  89. package/dist/src/api/outpatient/alova/implement/index.js +4 -0
  90. package/dist/src/api/outpatient/alova/index.js +5 -5
  91. package/dist/src/api/patient/alova/globals.js +1 -0
  92. package/dist/src/api/patient/alova/implement/index.js +16 -0
  93. package/dist/src/api/patient/alova/index.js +9 -12
  94. package/dist/src/api/patient/meta.js +1 -0
  95. package/dist/src/api/prescription/alova/globals.js +1 -0
  96. package/dist/src/api/prescription/alova/implement/index.js +6 -0
  97. package/dist/src/api/prescription/alova/index.js +8 -7
  98. package/dist/src/api/scientist/alova/globals.js +1 -0
  99. package/dist/src/api/scientist/alova/implement/index.js +4 -0
  100. package/dist/src/api/scientist/alova/index.js +5 -5
  101. package/dist/src/index.d.ts +0 -1
  102. package/dist/src/index.js +34 -32
  103. package/dist/src/proto/index.js +10 -0
  104. package/dist/src/proto/types/Images_pb.js +7 -6
  105. package/dist/src/proto/types/WaveMap_pb.js +4 -3
  106. package/dist/src/util/helper.js +38 -2
  107. package/dist/src/util/string.js +47 -5
  108. package/package.json +66 -14
  109. package/dist/node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js +0 -556
  110. package/dist/node_modules/@vue/runtime-core/dist/runtime-core.esm-bundler.js +0 -36
  111. package/dist/node_modules/@vue/shared/dist/shared.esm-bundler.js +0 -26
  112. package/dist/node_modules/quasar/src/composables/use-quasar/use-quasar.js +0 -8
  113. package/dist/node_modules/quasar/src/utils/private.symbols/symbols.js +0 -4
@@ -0,0 +1,434 @@
1
+ import { ScalarType as i } from "./descriptors.js";
2
+ import { protoInt64 as k } from "./proto-int64.js";
3
+ import { create as N } from "./create.js";
4
+ import { reflect as g } from "./reflect/reflect.js";
5
+ import { isFieldError as E, FieldError as l } from "./reflect/error.js";
6
+ import { formatVal as u } from "./reflect/reflect-check.js";
7
+ import { scalarZeroValue as x } from "./reflect/scalar.js";
8
+ import { base64Decode as D } from "./wire/base64-encoding.js";
9
+ import "./wkt/index.js";
10
+ import { createExtensionContainer as L, setExtension as K } from "./extensions.js";
11
+ import { isWrapperDesc as M } from "./wkt/wrappers.js";
12
+ import { anyPack as Z } from "./wkt/any.js";
13
+ import { ValueSchema as J, NullValue as _, ListValueSchema as C, StructSchema as W } from "./wkt/gen/google/protobuf/struct_pb.js";
14
+ const $ = {
15
+ ignoreUnknownFields: !1
16
+ };
17
+ function O(r) {
18
+ return r ? Object.assign(Object.assign({}, $), r) : $;
19
+ }
20
+ function pe(r, e, t) {
21
+ return R(r, I(e, r.typeName), t);
22
+ }
23
+ function Ne(r, e, t, n) {
24
+ return X(r, e, I(t, r.typeName), n);
25
+ }
26
+ function R(r, e, t) {
27
+ const n = g(r);
28
+ try {
29
+ d(n, e, O(t));
30
+ } catch (a) {
31
+ throw E(a) ? new Error(`cannot decode ${a.field()} from JSON: ${a.message}`, {
32
+ cause: a
33
+ }) : a;
34
+ }
35
+ return n.message;
36
+ }
37
+ function X(r, e, t, n) {
38
+ try {
39
+ d(g(r, e), t, O(n));
40
+ } catch (a) {
41
+ throw E(a) ? new Error(`cannot decode ${a.field()} from JSON: ${a.message}`, {
42
+ cause: a
43
+ }) : a;
44
+ }
45
+ return e;
46
+ }
47
+ function we(r, e) {
48
+ const t = w(r, e, !1, !1);
49
+ if (t === p)
50
+ throw new Error(`cannot decode ${r} from JSON: ${u(e)}`);
51
+ return t;
52
+ }
53
+ function ye(r, e) {
54
+ return r.values.find((t) => t.name === e) !== void 0;
55
+ }
56
+ function d(r, e, t) {
57
+ var n;
58
+ if (H(r, e, t))
59
+ return;
60
+ if (e == null || Array.isArray(e) || typeof e != "object")
61
+ throw new Error(`cannot decode ${r.desc} from JSON: ${u(e)}`);
62
+ const a = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
63
+ for (const o of r.desc.fields)
64
+ s.set(o.name, o).set(o.jsonName, o);
65
+ for (const [o, f] of Object.entries(e)) {
66
+ const c = s.get(o);
67
+ if (c) {
68
+ if (c.oneof) {
69
+ if (f === null && c.fieldKind == "scalar")
70
+ continue;
71
+ const m = a.get(c.oneof);
72
+ if (m !== void 0)
73
+ throw new l(c.oneof, `oneof set multiple times by ${m.name} and ${c.name}`);
74
+ a.set(c.oneof, c);
75
+ }
76
+ S(r, c, f, t);
77
+ } else {
78
+ let m;
79
+ if (o.startsWith("[") && o.endsWith("]") && // biome-ignore lint/suspicious/noAssignInExpressions: no
80
+ (m = (n = t.registry) === null || n === void 0 ? void 0 : n.getExtension(o.substring(1, o.length - 1))) && m.extendee.typeName === r.desc.typeName) {
81
+ const [T, V, U] = L(m);
82
+ S(T, V, f, t), K(r.message, m, U());
83
+ }
84
+ if (!m && !t.ignoreUnknownFields)
85
+ throw new Error(`cannot decode ${r.desc} from JSON: key "${o}" is unknown`);
86
+ }
87
+ }
88
+ }
89
+ function S(r, e, t, n) {
90
+ switch (e.fieldKind) {
91
+ case "scalar":
92
+ q(r, e, t);
93
+ break;
94
+ case "enum":
95
+ G(r, e, t, n);
96
+ break;
97
+ case "message":
98
+ Y(r, e, t, n);
99
+ break;
100
+ case "list":
101
+ P(r.get(e), t, n);
102
+ break;
103
+ case "map":
104
+ B(r.get(e), t, n);
105
+ break;
106
+ }
107
+ }
108
+ function B(r, e, t) {
109
+ if (e === null)
110
+ return;
111
+ const n = r.field();
112
+ if (typeof e != "object" || Array.isArray(e))
113
+ throw new l(n, "expected object, got " + u(e));
114
+ for (const [a, s] of Object.entries(e)) {
115
+ if (s === null)
116
+ throw new l(n, "map value must not be null");
117
+ let o;
118
+ switch (n.mapKind) {
119
+ case "message":
120
+ const c = g(n.message);
121
+ d(c, s, t), o = c;
122
+ break;
123
+ case "enum":
124
+ if (o = w(n.enum, s, t.ignoreUnknownFields, !0), o === p)
125
+ return;
126
+ break;
127
+ case "scalar":
128
+ o = b(n, s, !0);
129
+ break;
130
+ }
131
+ const f = z(n.mapKey, a);
132
+ r.set(f, o);
133
+ }
134
+ }
135
+ function P(r, e, t) {
136
+ if (e === null)
137
+ return;
138
+ const n = r.field();
139
+ if (!Array.isArray(e))
140
+ throw new l(n, "expected Array, got " + u(e));
141
+ for (const a of e) {
142
+ if (a === null)
143
+ throw new l(n, "list item must not be null");
144
+ switch (n.listKind) {
145
+ case "message":
146
+ const s = g(n.message);
147
+ d(s, a, t), r.add(s);
148
+ break;
149
+ case "enum":
150
+ const o = w(n.enum, a, t.ignoreUnknownFields, !0);
151
+ o !== p && r.add(o);
152
+ break;
153
+ case "scalar":
154
+ r.add(b(n, a, !0));
155
+ break;
156
+ }
157
+ }
158
+ }
159
+ function Y(r, e, t, n) {
160
+ if (t === null && e.message.typeName != "google.protobuf.Value") {
161
+ r.clear(e);
162
+ return;
163
+ }
164
+ const a = r.isSet(e) ? r.get(e) : g(e.message);
165
+ d(a, t, n), r.set(e, a);
166
+ }
167
+ function G(r, e, t, n) {
168
+ const a = w(e.enum, t, n.ignoreUnknownFields, !1);
169
+ a === y ? r.clear(e) : a !== p && r.set(e, a);
170
+ }
171
+ function q(r, e, t) {
172
+ const n = b(e, t, !1);
173
+ n === y ? r.clear(e) : r.set(e, n);
174
+ }
175
+ const p = Symbol();
176
+ function w(r, e, t, n) {
177
+ if (e === null)
178
+ return r.typeName == "google.protobuf.NullValue" ? 0 : n ? r.values[0].number : y;
179
+ switch (typeof e) {
180
+ case "number":
181
+ if (Number.isInteger(e))
182
+ return e;
183
+ break;
184
+ case "string":
185
+ const a = r.values.find((s) => s.name === e);
186
+ if (a !== void 0)
187
+ return a.number;
188
+ if (t)
189
+ return p;
190
+ break;
191
+ }
192
+ throw new Error(`cannot decode ${r} from JSON: ${u(e)}`);
193
+ }
194
+ const y = Symbol();
195
+ function b(r, e, t) {
196
+ if (e === null)
197
+ return t ? x(r.scalar, !1) : y;
198
+ switch (r.scalar) {
199
+ // float, double: JSON value will be a number or one of the special string values "NaN", "Infinity", and "-Infinity".
200
+ // Either numbers or strings are accepted. Exponent notation is also accepted.
201
+ case i.DOUBLE:
202
+ case i.FLOAT:
203
+ if (e === "NaN")
204
+ return NaN;
205
+ if (e === "Infinity")
206
+ return Number.POSITIVE_INFINITY;
207
+ if (e === "-Infinity")
208
+ return Number.NEGATIVE_INFINITY;
209
+ if (typeof e == "number") {
210
+ if (Number.isNaN(e))
211
+ throw new l(r, "unexpected NaN number");
212
+ if (!Number.isFinite(e))
213
+ throw new l(r, "unexpected infinite number");
214
+ break;
215
+ }
216
+ if (typeof e == "string") {
217
+ if (e === "" || e.trim().length !== e.length)
218
+ break;
219
+ const n = Number(e);
220
+ if (!Number.isFinite(n))
221
+ break;
222
+ return n;
223
+ }
224
+ break;
225
+ // int32, fixed32, uint32: JSON value will be a decimal number. Either numbers or strings are accepted.
226
+ case i.INT32:
227
+ case i.FIXED32:
228
+ case i.SFIXED32:
229
+ case i.SINT32:
230
+ case i.UINT32:
231
+ return F(e);
232
+ // bytes: JSON value will be the data encoded as a string using standard base64 encoding with paddings.
233
+ // Either standard or URL-safe base64 encoding with/without paddings are accepted.
234
+ case i.BYTES:
235
+ if (typeof e == "string") {
236
+ if (e === "")
237
+ return new Uint8Array(0);
238
+ try {
239
+ return D(e);
240
+ } catch (n) {
241
+ const a = n instanceof Error ? n.message : String(n);
242
+ throw new l(r, a);
243
+ }
244
+ }
245
+ break;
246
+ }
247
+ return e;
248
+ }
249
+ function z(r, e) {
250
+ switch (r) {
251
+ case i.BOOL:
252
+ switch (e) {
253
+ case "true":
254
+ return !0;
255
+ case "false":
256
+ return !1;
257
+ }
258
+ return e;
259
+ case i.INT32:
260
+ case i.FIXED32:
261
+ case i.UINT32:
262
+ case i.SFIXED32:
263
+ case i.SINT32:
264
+ return F(e);
265
+ default:
266
+ return e;
267
+ }
268
+ }
269
+ function F(r) {
270
+ if (typeof r == "string") {
271
+ if (r === "" || r.trim().length !== r.length)
272
+ return r;
273
+ const e = Number(r);
274
+ return Number.isNaN(e) ? r : e;
275
+ }
276
+ return r;
277
+ }
278
+ function I(r, e) {
279
+ try {
280
+ return JSON.parse(r);
281
+ } catch (t) {
282
+ const n = t instanceof Error ? t.message : String(t);
283
+ throw new Error(
284
+ `cannot decode message ${e} from JSON: ${n}`,
285
+ // @ts-expect-error we use the ES2022 error CTOR option "cause" for better stack traces
286
+ { cause: t }
287
+ );
288
+ }
289
+ }
290
+ function H(r, e, t) {
291
+ if (!r.desc.typeName.startsWith("google.protobuf."))
292
+ return !1;
293
+ switch (r.desc.typeName) {
294
+ case "google.protobuf.Any":
295
+ return Q(r.message, e, t), !0;
296
+ case "google.protobuf.Timestamp":
297
+ return j(r.message, e), !0;
298
+ case "google.protobuf.Duration":
299
+ return ee(r.message, e), !0;
300
+ case "google.protobuf.FieldMask":
301
+ return re(r.message, e), !0;
302
+ case "google.protobuf.Struct":
303
+ return v(r.message, e), !0;
304
+ case "google.protobuf.Value":
305
+ return h(r.message, e), !0;
306
+ case "google.protobuf.ListValue":
307
+ return A(r.message, e), !0;
308
+ default:
309
+ if (M(r.desc)) {
310
+ const n = r.desc.fields[0];
311
+ return e === null ? r.clear(n) : r.set(n, b(n, e, !0)), !0;
312
+ }
313
+ return !1;
314
+ }
315
+ }
316
+ function Q(r, e, t) {
317
+ var n;
318
+ if (e === null || Array.isArray(e) || typeof e != "object")
319
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: expected object but got ${u(e)}`);
320
+ if (Object.keys(e).length == 0)
321
+ return;
322
+ const a = e["@type"];
323
+ if (typeof a != "string" || a == "")
324
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: "@type" is empty`);
325
+ const s = a.includes("/") ? a.substring(a.lastIndexOf("/") + 1) : a;
326
+ if (!s.length)
327
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: "@type" is invalid`);
328
+ const o = (n = t.registry) === null || n === void 0 ? void 0 : n.getMessage(s);
329
+ if (!o)
330
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${a} is not in the type registry`);
331
+ const f = g(o);
332
+ if (s.startsWith("google.protobuf.") && Object.prototype.hasOwnProperty.call(e, "value")) {
333
+ const c = e.value;
334
+ d(f, c, t);
335
+ } else {
336
+ const c = Object.assign({}, e);
337
+ delete c["@type"], d(f, c, t);
338
+ }
339
+ Z(f.desc, f.message, r);
340
+ }
341
+ function j(r, e) {
342
+ if (typeof e != "string")
343
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${u(e)}`);
344
+ const t = e.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);
345
+ if (!t)
346
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: invalid RFC 3339 string`);
347
+ const n = Date.parse(
348
+ // biome-ignore format: want this to read well
349
+ t[1] + "-" + t[2] + "-" + t[3] + "T" + t[4] + ":" + t[5] + ":" + t[6] + (t[8] ? t[8] : "Z")
350
+ );
351
+ if (Number.isNaN(n))
352
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: invalid RFC 3339 string`);
353
+ if (n < Date.parse("0001-01-01T00:00:00Z") || n > Date.parse("9999-12-31T23:59:59Z"))
354
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);
355
+ r.seconds = k.parse(n / 1e3), r.nanos = 0, t[7] && (r.nanos = parseInt("1" + t[7] + "0".repeat(9 - t[7].length)) - 1e9);
356
+ }
357
+ function ee(r, e) {
358
+ if (typeof e != "string")
359
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${u(e)}`);
360
+ const t = e.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);
361
+ if (t === null)
362
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${u(e)}`);
363
+ const n = Number(t[1]);
364
+ if (n > 315576e6 || n < -315576e6)
365
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${u(e)}`);
366
+ if (r.seconds = k.parse(n), typeof t[2] != "string")
367
+ return;
368
+ const a = t[2] + "0".repeat(9 - t[2].length);
369
+ r.nanos = parseInt(a), (n < 0 || Object.is(n, -0)) && (r.nanos = -r.nanos);
370
+ }
371
+ function re(r, e) {
372
+ if (typeof e != "string")
373
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: ${u(e)}`);
374
+ if (e === "")
375
+ return;
376
+ function t(n) {
377
+ if (n.includes("_"))
378
+ throw new Error(`cannot decode message ${r.$typeName} from JSON: path names must be lowerCamelCase`);
379
+ const a = n.replace(/[A-Z]/g, (s) => "_" + s.toLowerCase());
380
+ return a[0] === "_" ? a.substring(1) : a;
381
+ }
382
+ r.paths = e.split(",").map(t);
383
+ }
384
+ function v(r, e) {
385
+ if (typeof e != "object" || e == null || Array.isArray(e))
386
+ throw new Error(`cannot decode message ${r.$typeName} from JSON ${u(e)}`);
387
+ for (const [t, n] of Object.entries(e)) {
388
+ const a = N(J);
389
+ h(a, n), r.fields[t] = a;
390
+ }
391
+ }
392
+ function h(r, e) {
393
+ switch (typeof e) {
394
+ case "number":
395
+ r.kind = { case: "numberValue", value: e };
396
+ break;
397
+ case "string":
398
+ r.kind = { case: "stringValue", value: e };
399
+ break;
400
+ case "boolean":
401
+ r.kind = { case: "boolValue", value: e };
402
+ break;
403
+ case "object":
404
+ if (e === null)
405
+ r.kind = { case: "nullValue", value: _.NULL_VALUE };
406
+ else if (Array.isArray(e)) {
407
+ const t = N(C);
408
+ A(t, e), r.kind = { case: "listValue", value: t };
409
+ } else {
410
+ const t = N(W);
411
+ v(t, e), r.kind = { case: "structValue", value: t };
412
+ }
413
+ break;
414
+ default:
415
+ throw new Error(`cannot decode message ${r.$typeName} from JSON ${u(e)}`);
416
+ }
417
+ return r;
418
+ }
419
+ function A(r, e) {
420
+ if (!Array.isArray(e))
421
+ throw new Error(`cannot decode message ${r.$typeName} from JSON ${u(e)}`);
422
+ for (const t of e) {
423
+ const n = N(J);
424
+ h(n, t), r.values.push(n);
425
+ }
426
+ }
427
+ export {
428
+ we as enumFromJson,
429
+ R as fromJson,
430
+ pe as fromJsonString,
431
+ ye as isEnumJson,
432
+ X as mergeFromJson,
433
+ Ne as mergeFromJsonString
434
+ };
@@ -0,0 +1,49 @@
1
+ import "./types.js";
2
+ import { isMessage as t } from "./is-message.js";
3
+ import { create as n } from "./create.js";
4
+ import { clone as s } from "./clone.js";
5
+ import { ScalarType as x } from "./descriptors.js";
6
+ import { equals as f } from "./equals.js";
7
+ import { clearField as l, isFieldSet as J } from "./fields.js";
8
+ import { createFileRegistry as u, createMutableRegistry as y, createRegistry as E, maximumEdition as F, minimumEdition as S } from "./registry.js";
9
+ import { toBinary as B } from "./to-binary.js";
10
+ import { fromBinary as h, mergeFromBinary as M } from "./from-binary.js";
11
+ import { enumToJson as T, toJson as b, toJsonString as q } from "./to-json.js";
12
+ import { enumFromJson as j, fromJson as k, fromJsonString as v, isEnumJson as w, mergeFromJson as z, mergeFromJsonString as A } from "./from-json.js";
13
+ import { merge as D } from "./merge.js";
14
+ import { clearExtension as H, getExtension as K, getOption as L, hasExtension as N, hasOption as P, setExtension as Q } from "./extensions.js";
15
+ import { protoInt64 as V } from "./proto-int64.js";
16
+ export {
17
+ x as ScalarType,
18
+ H as clearExtension,
19
+ l as clearField,
20
+ s as clone,
21
+ n as create,
22
+ u as createFileRegistry,
23
+ y as createMutableRegistry,
24
+ E as createRegistry,
25
+ j as enumFromJson,
26
+ T as enumToJson,
27
+ f as equals,
28
+ h as fromBinary,
29
+ k as fromJson,
30
+ v as fromJsonString,
31
+ K as getExtension,
32
+ L as getOption,
33
+ N as hasExtension,
34
+ P as hasOption,
35
+ w as isEnumJson,
36
+ J as isFieldSet,
37
+ t as isMessage,
38
+ F as maximumEdition,
39
+ D as merge,
40
+ M as mergeFromBinary,
41
+ z as mergeFromJson,
42
+ A as mergeFromJsonString,
43
+ S as minimumEdition,
44
+ V as protoInt64,
45
+ Q as setExtension,
46
+ B as toBinary,
47
+ b as toJson,
48
+ q as toJsonString
49
+ };
@@ -0,0 +1,33 @@
1
+ import { reflect as a } from "./reflect/reflect.js";
2
+ function g(n, s, o) {
3
+ c(a(n, s), a(n, o));
4
+ }
5
+ function c(n, s) {
6
+ var o, t;
7
+ const f = s.message.$unknown;
8
+ f !== void 0 && f.length > 0 && ((o = (t = n.message).$unknown) !== null && o !== void 0 || (t.$unknown = []), n.message.$unknown.push(...f));
9
+ for (const e of n.fields)
10
+ if (s.isSet(e))
11
+ switch (e.fieldKind) {
12
+ case "scalar":
13
+ case "enum":
14
+ n.set(e, s.get(e));
15
+ break;
16
+ case "message":
17
+ n.isSet(e) ? c(n.get(e), s.get(e)) : n.set(e, s.get(e));
18
+ break;
19
+ case "list":
20
+ const l = n.get(e);
21
+ for (const i of s.get(e))
22
+ l.add(i);
23
+ break;
24
+ case "map":
25
+ const k = n.get(e);
26
+ for (const [i, m] of s.get(e))
27
+ k.set(i, m);
28
+ break;
29
+ }
30
+ }
31
+ export {
32
+ g as merge
33
+ };
@@ -1,8 +1,17 @@
1
+ const o = [
2
+ "FieldValueInvalidError",
3
+ "FieldListRangeError",
4
+ "ForeignFieldError"
5
+ ];
1
6
  class l extends Error {
2
- constructor(r, e, s = "FieldValueInvalidError") {
3
- super(e), this.name = s, this.field = () => r;
7
+ constructor(e, i, n = "FieldValueInvalidError") {
8
+ super(i), this.name = n, this.field = () => e;
4
9
  }
5
10
  }
11
+ function d(r) {
12
+ return r instanceof Error && o.includes(r.name) && "field" in r && typeof r.field == "function";
13
+ }
6
14
  export {
7
- l as FieldError
15
+ l as FieldError,
16
+ d as isFieldError
8
17
  };
@@ -2,34 +2,38 @@ import { unsafeLocal as f } from "./unsafe.js";
2
2
  function s(e) {
3
3
  return e !== null && typeof e == "object" && !Array.isArray(e);
4
4
  }
5
- function c(e, t) {
6
- var d, l, o, u;
5
+ function a(e) {
6
+ return e !== null && typeof e == "object" && "case" in e && (typeof e.case == "string" && "value" in e && e.value != null || e.case === void 0 && (!("value" in e) || e.value === void 0));
7
+ }
8
+ function m(e, t) {
9
+ var d, u, l, o;
7
10
  if (s(e) && f in e && "add" in e && "field" in e && typeof e.field == "function") {
8
11
  if (t !== void 0) {
9
12
  const n = t, i = e.field();
10
- return n.listKind == i.listKind && n.scalar === i.scalar && ((d = n.message) === null || d === void 0 ? void 0 : d.typeName) === ((l = i.message) === null || l === void 0 ? void 0 : l.typeName) && ((o = n.enum) === null || o === void 0 ? void 0 : o.typeName) === ((u = i.enum) === null || u === void 0 ? void 0 : u.typeName);
13
+ return n.listKind == i.listKind && n.scalar === i.scalar && ((d = n.message) === null || d === void 0 ? void 0 : d.typeName) === ((u = i.message) === null || u === void 0 ? void 0 : u.typeName) && ((l = n.enum) === null || l === void 0 ? void 0 : l.typeName) === ((o = i.enum) === null || o === void 0 ? void 0 : o.typeName);
11
14
  }
12
15
  return !0;
13
16
  }
14
17
  return !1;
15
18
  }
16
- function m(e, t) {
17
- var d, l, o, u;
19
+ function p(e, t) {
20
+ var d, u, l, o;
18
21
  if (s(e) && f in e && "has" in e && "field" in e && typeof e.field == "function") {
19
22
  if (t !== void 0) {
20
23
  const n = t, i = e.field();
21
- return n.mapKey === i.mapKey && n.mapKind == i.mapKind && n.scalar === i.scalar && ((d = n.message) === null || d === void 0 ? void 0 : d.typeName) === ((l = i.message) === null || l === void 0 ? void 0 : l.typeName) && ((o = n.enum) === null || o === void 0 ? void 0 : o.typeName) === ((u = i.enum) === null || u === void 0 ? void 0 : u.typeName);
24
+ return n.mapKey === i.mapKey && n.mapKind == i.mapKind && n.scalar === i.scalar && ((d = n.message) === null || d === void 0 ? void 0 : d.typeName) === ((u = i.message) === null || u === void 0 ? void 0 : u.typeName) && ((l = n.enum) === null || l === void 0 ? void 0 : l.typeName) === ((o = i.enum) === null || o === void 0 ? void 0 : o.typeName);
22
25
  }
23
26
  return !0;
24
27
  }
25
28
  return !1;
26
29
  }
27
- function p(e, t) {
30
+ function v(e, t) {
28
31
  return s(e) && f in e && "desc" in e && s(e.desc) && e.desc.kind === "message" && (t === void 0 || e.desc.typeName == t.typeName);
29
32
  }
30
33
  export {
31
34
  s as isObject,
32
- c as isReflectList,
33
- m as isReflectMap,
34
- p as isReflectMessage
35
+ a as isOneofADT,
36
+ m as isReflectList,
37
+ p as isReflectMap,
38
+ v as isReflectMessage
35
39
  };
@@ -1,11 +1,30 @@
1
+ function c(e) {
2
+ switch (e.kind) {
3
+ case "field":
4
+ case "oneof":
5
+ case "rpc":
6
+ return e.parent.typeName + "." + e.name;
7
+ case "enum_value": {
8
+ const a = e.parent.parent ? e.parent.parent.typeName : e.parent.file.proto.package;
9
+ return a + (a.length > 0 ? "." : "") + e.name;
10
+ }
11
+ case "service":
12
+ case "message":
13
+ case "enum":
14
+ case "extension":
15
+ return e.typeName;
16
+ case "file":
17
+ return e.proto.name;
18
+ }
19
+ }
1
20
  function o(e) {
2
- let s = !1;
3
- const c = [];
4
- for (let a = 0; a < e.length; a++) {
5
- let t = e.charAt(a);
21
+ let a = !1;
22
+ const r = [];
23
+ for (let n = 0; n < e.length; n++) {
24
+ let t = e.charAt(n);
6
25
  switch (t) {
7
26
  case "_":
8
- s = !0;
27
+ a = !0;
9
28
  break;
10
29
  case "0":
11
30
  case "1":
@@ -17,26 +36,27 @@ function o(e) {
17
36
  case "7":
18
37
  case "8":
19
38
  case "9":
20
- c.push(t), s = !1;
39
+ r.push(t), a = !1;
21
40
  break;
22
41
  default:
23
- s && (s = !1, t = t.toUpperCase()), c.push(t);
42
+ a && (a = !1, t = t.toUpperCase()), r.push(t);
24
43
  break;
25
44
  }
26
45
  }
27
- return c.join("");
46
+ return r.join("");
28
47
  }
29
- const r = /* @__PURE__ */ new Set([
48
+ const s = /* @__PURE__ */ new Set([
30
49
  // names reserved by JavaScript
31
50
  "constructor",
32
51
  "toString",
33
52
  "toJSON",
34
53
  "valueOf"
35
54
  ]);
36
- function f(e) {
37
- return r.has(e) ? e + "$" : e;
55
+ function p(e) {
56
+ return s.has(e) ? e + "$" : e;
38
57
  }
39
58
  export {
40
59
  o as protoCamelCase,
41
- f as safeObjectProperty
60
+ c as qualifiedName,
61
+ p as safeObjectProperty
42
62
  };