@delali/narsil 0.3.1-next.143 → 0.3.1-next.145

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 (165) hide show
  1. package/dist/adapters/filesystem.d.ts +1 -1
  2. package/dist/adapters/filesystem.mjs +101 -13
  3. package/dist/adapters/gcs.d.ts +49 -0
  4. package/dist/adapters/gcs.mjs +213 -0
  5. package/dist/adapters/indexeddb.d.ts +1 -1
  6. package/dist/adapters/indexeddb.mjs +2 -7
  7. package/dist/adapters/memory.d.ts +1 -1
  8. package/dist/adapters/memory.mjs +5 -0
  9. package/dist/adapters/s3.d.ts +53 -0
  10. package/dist/adapters/s3.mjs +263 -0
  11. package/dist/{adapters-BQFQ4PRz.d.ts → adapters-pljAqmrC.d.ts} +33 -0
  12. package/dist/{analysis-change-HQUT2Z3I.mjs → analysis-change-D5APH4Z3.mjs} +24 -33
  13. package/dist/{browser/analysis-change-entry-7HR4LWL3.mjs → analysis-change-entry-V4SQQSXQ.mjs} +1 -1
  14. package/dist/browser/{analysis-change-JPV775LR.mjs → analysis-change-QTCQ5ETU.mjs} +5 -5
  15. package/dist/{analysis-change-entry-TZTG4AZB.mjs → browser/analysis-change-entry-KYEQSP3I.mjs} +1 -1
  16. package/dist/{chunk-46NZOPHS.mjs → browser/chunk-5WYWLTM5.mjs} +2 -2
  17. package/dist/browser/{chunk-ZEV26AQ6.mjs → chunk-6OFS7RUN.mjs} +1 -1
  18. package/dist/browser/{chunk-MZI3TEOW.mjs → chunk-75PMIFQA.mjs} +1 -1
  19. package/dist/browser/{chunk-R4WUDZQV.mjs → chunk-AOKLYVTT.mjs} +2 -2
  20. package/dist/browser/{chunk-LVY2LI35.mjs → chunk-BTMRV5MY.mjs} +2 -2
  21. package/dist/browser/{chunk-3ZBJYAS4.mjs → chunk-FHO5N7FD.mjs} +1 -1
  22. package/dist/browser/{chunk-KTOK275N.mjs → chunk-FXPMF65P.mjs} +12 -12
  23. package/dist/browser/{chunk-VFYMPCOV.mjs → chunk-GP4QLUQM.mjs} +5 -5
  24. package/dist/browser/{chunk-35B42UFM.mjs → chunk-IFGTRRPU.mjs} +9 -0
  25. package/dist/browser/{chunk-6RHTAVZX.mjs → chunk-K7UFXEJS.mjs} +31 -14
  26. package/dist/browser/{chunk-MVM33ZUL.mjs → chunk-LGJ6XMH5.mjs} +5 -5
  27. package/dist/{chunk-NN33CZRE.mjs → browser/chunk-PMBSBSCN.mjs} +2 -2
  28. package/dist/browser/{chunk-D33A5VMU.mjs → chunk-QNDWMPV2.mjs} +1 -1
  29. package/dist/browser/{chunk-HKX2G6WH.mjs → chunk-U77XQJOY.mjs} +3 -3
  30. package/dist/browser/{chunk-TCLEOZ4P.mjs → chunk-XIHLIMFX.mjs} +2 -2
  31. package/dist/browser/{chunk-WCFCHIBB.mjs → chunk-XWMEGKDC.mjs} +2 -2
  32. package/dist/browser/{chunk-5DB2VDGI.mjs → chunk-ZALEKEUH.mjs} +27 -27
  33. package/dist/browser/{chunk-MWUK3DA5.mjs → chunk-ZKVDQ5ZH.mjs} +8 -8
  34. package/dist/browser/{cold-module-MJMKNUYJ.mjs → cold-module-Y2IJAP7S.mjs} +14 -14
  35. package/dist/browser/{durability-wiring-SNOWIT6Z.mjs → durability-wiring-MLXZ5QQF.mjs} +78 -61
  36. package/dist/browser/import-FTMLTPGQ.mjs +9 -0
  37. package/dist/browser/{module-BUFNZMEU.mjs → module-5LMDGXQH.mjs} +10 -10
  38. package/dist/browser/{module-BVP4TKZU.mjs → module-Q6VFGLMG.mjs} +71 -11
  39. package/dist/browser/{phrase-module-HGVBO24W.mjs → phrase-module-KXNRTWCS.mjs} +1 -1
  40. package/dist/{restore-queue-FEYAC4SB.mjs → browser/restore-queue-SOAHKZSQ.mjs} +2 -2
  41. package/dist/browser/{runtime-VEUH674B.mjs → runtime-ZNEGK33G.mjs} +2 -2
  42. package/dist/browser/{snapshot-QXBKHJAG.mjs → snapshot-2EGS2FYU.mjs} +16 -15
  43. package/dist/browser/{write-WHFBDWQS.mjs → write-WMZA6NSF.mjs} +11 -11
  44. package/dist/{capabilities-BCdUwK_L.d.ts → capabilities-CNnzGtqP.d.ts} +3 -3
  45. package/dist/{chunk-ZMBFWQXN.mjs → chunk-2E2ZFOPT.mjs} +2 -2
  46. package/dist/{chunk-BOJZGUS6.mjs → chunk-5K2JHKM3.mjs} +1 -1
  47. package/dist/{chunk-YH5OIL7B.mjs → chunk-5QMHMELB.mjs} +6 -1
  48. package/dist/{browser/chunk-CCOAOO73.mjs → chunk-6FOJKNUR.mjs} +2 -2
  49. package/dist/{chunk-GLZHNSGB.mjs → chunk-6Z22L5RN.mjs} +1 -1
  50. package/dist/{chunk-AST3SHFA.mjs → chunk-7523VCM4.mjs} +2 -2
  51. package/dist/{chunk-KZL72VTC.mjs → chunk-7AJAW6NN.mjs} +11 -10
  52. package/dist/{chunk-DQNKVOJ2.mjs → chunk-BTARFTEN.mjs} +695 -8
  53. package/dist/{chunk-YLNSJQLX.mjs → chunk-DHEJAGVW.mjs} +5 -5
  54. package/dist/{chunk-Z4HFMYNX.mjs → chunk-DKMZ7JFW.mjs} +29 -12
  55. package/dist/{chunk-NRUXBYPH.mjs → chunk-F442VZUL.mjs} +5 -5
  56. package/dist/{chunk-O4LJQI4G.mjs → chunk-FRJ5RGX7.mjs} +126 -4
  57. package/dist/{chunk-L76W3IZJ.mjs → chunk-FTQLF5JI.mjs} +1 -1
  58. package/dist/{chunk-UIKN2OTQ.mjs → chunk-G6Q5DEF5.mjs} +37 -3
  59. package/dist/{chunk-DD2673TX.mjs → chunk-GRFXSEFF.mjs} +2 -2
  60. package/dist/{chunk-ZSWHPKGM.mjs → chunk-GVPYMSLO.mjs} +69 -2
  61. package/dist/{chunk-VEFN6X6Q.mjs → chunk-HOC5JP2H.mjs} +9 -10
  62. package/dist/{chunk-SRJBFG2T.mjs → chunk-HTMUGEFU.mjs} +6 -7
  63. package/dist/{chunk-J6YVB2XM.mjs → chunk-IJPK5PGM.mjs} +1 -1
  64. package/dist/{chunk-HNHCNTVG.mjs → chunk-IQHZMCLX.mjs} +9 -0
  65. package/dist/{chunk-C3YDYX6C.mjs → chunk-ISUOSACK.mjs} +1 -1
  66. package/dist/{chunk-YHUTF6EA.mjs → chunk-IV2XTSS2.mjs} +14 -14
  67. package/dist/chunk-K5HSUPYS.mjs +11 -0
  68. package/dist/{chunk-LA4WNDHL.mjs → chunk-KG5N7LE6.mjs} +12 -14
  69. package/dist/{chunk-NPNK57CA.mjs → chunk-LWFK3TC2.mjs} +1 -1
  70. package/dist/{chunk-RKAVHNRW.mjs → chunk-LYKUJNAV.mjs} +10 -5
  71. package/dist/{chunk-TNBIK2LQ.mjs → chunk-MJTEU2XK.mjs} +3 -4
  72. package/dist/chunk-NWTEJ2T7.mjs +100 -0
  73. package/dist/{chunk-WJGO5PGV.mjs → chunk-OH7SX5MY.mjs} +28 -16
  74. package/dist/{chunk-W2COJ5AH.mjs → chunk-ONDEEBTA.mjs} +2 -2
  75. package/dist/{chunk-PWIWSUCX.mjs → chunk-POUYICOU.mjs} +1 -1
  76. package/dist/chunk-PRID7CA6.mjs +104 -0
  77. package/dist/{chunk-ICW45TTU.mjs → chunk-QLDLQW36.mjs} +1 -1
  78. package/dist/{chunk-KEIYVZUX.mjs → chunk-QU2XF7VI.mjs} +3 -4
  79. package/dist/{chunk-74XB2SXI.mjs → chunk-QXH2CS4V.mjs} +35 -2
  80. package/dist/{chunk-ZPWS2SKJ.mjs → chunk-QYMAYU7M.mjs} +165 -11
  81. package/dist/{chunk-NJJCPFXN.mjs → chunk-RNUP6WZ6.mjs} +2 -2
  82. package/dist/{chunk-SBMAWTRG.mjs → chunk-RTVAWNUL.mjs} +80 -14
  83. package/dist/{chunk-7AUASRE7.mjs → chunk-RVBUQITB.mjs} +7 -7
  84. package/dist/{chunk-VJEGOELZ.mjs → chunk-SA52N7G3.mjs} +3 -3
  85. package/dist/{chunk-NOT5QOHU.mjs → chunk-SE7MKJVK.mjs} +1 -1
  86. package/dist/{chunk-BRUUBXCB.mjs → chunk-SNB4DYL3.mjs} +10 -38
  87. package/dist/chunk-SVO6NV4D.mjs +248 -0
  88. package/dist/{chunk-GWOS5DYC.mjs → chunk-UGQULMSU.mjs} +11 -13
  89. package/dist/{chunk-6SNBQESJ.mjs → chunk-UHVTEVF5.mjs} +5 -5
  90. package/dist/{chunk-HJJWY6PT.mjs → chunk-UQS5PAS5.mjs} +1 -1
  91. package/dist/{chunk-UUZCQQG2.mjs → chunk-W6M4RRAT.mjs} +3 -3
  92. package/dist/{browser/chunk-XNWPP5NS.mjs → chunk-WDEWU46C.mjs} +2 -2
  93. package/dist/{chunk-XZ3SRNDJ.mjs → chunk-WMIV7PJ7.mjs} +65 -5
  94. package/dist/{chunk-RHKRTYGO.mjs → chunk-X5SBWARI.mjs} +3 -3
  95. package/dist/{chunk-XS2VM7UE.mjs → chunk-XLAI4OIO.mjs} +2 -2
  96. package/dist/{chunk-IO5F7ZBE.mjs → chunk-YUCGFPMS.mjs} +454 -37
  97. package/dist/{client-B12YFALP.d.ts → client-DoYPHcUn.d.ts} +62 -5
  98. package/dist/client.d.ts +8 -8
  99. package/dist/client.mjs +44 -0
  100. package/dist/{cold-module-4X7WJCFM.mjs → cold-module-NUD332YD.mjs} +32 -41
  101. package/dist/{config-CIG5yDyg.d.ts → config-CuUfls_H.d.ts} +150 -3
  102. package/dist/{config-BhZxIeb1.d.ts → config-Dzs46im6.d.ts} +11 -2
  103. package/dist/direct-executor-FDQYQEJQ.mjs +22 -0
  104. package/dist/distribution/coordinator/etcd.d.ts +3 -3
  105. package/dist/distribution/coordinator/etcd.mjs +1 -1
  106. package/dist/distribution/coordinator/in-memory.d.ts +3 -3
  107. package/dist/distribution/transport/grpc.mjs +4 -4
  108. package/dist/distribution/transport/in-memory.mjs +2 -2
  109. package/dist/distribution/transport/tcp.mjs +3 -3
  110. package/dist/distribution.d.ts +8 -8
  111. package/dist/distribution.mjs +16219 -14535
  112. package/dist/{durability-wiring-324D2DDD.mjs → durability-wiring-K7RDXWL6.mjs} +103 -95
  113. package/dist/embeddings/openai.d.ts +1 -1
  114. package/dist/embeddings/openai.mjs +2 -2
  115. package/dist/{engine-CtzbHOmG.d.ts → engine-C0ifUEcm.d.ts} +3 -3
  116. package/dist/import-6KXFY6XI.mjs +35 -0
  117. package/dist/{index-DsEurhSl.d.ts → index-MsF7e5hL.d.ts} +2 -2
  118. package/dist/index.browser.mjs +4 -4
  119. package/dist/index.d.ts +7 -7
  120. package/dist/index.mjs +21 -30
  121. package/dist/invalidation/broadcast-channel.d.ts +1 -1
  122. package/dist/invalidation/filesystem.d.ts +1 -1
  123. package/dist/invalidation/filesystem.mjs +1 -1
  124. package/dist/invalidation/noop.d.ts +1 -1
  125. package/dist/{long-query-thread-4SW7RWDE.mjs → long-query-thread-FKVHRCHF.mjs} +18 -23
  126. package/dist/{module-DXSJ5LT2.mjs → module-GJUKW5VU.mjs} +14 -16
  127. package/dist/{module-IYPLWHGC.mjs → module-TMFIWOD2.mjs} +28 -37
  128. package/dist/{paged-partition-archive-HFP45PLU.mjs → paged-partition-archive-WNUEMYWM.mjs} +34 -39
  129. package/dist/partial-words.mjs +7 -9
  130. package/dist/pattern.mjs +4 -6
  131. package/dist/persistence/durability/checkpoint-worker.d.ts +2 -2
  132. package/dist/persistence/durability/checkpoint-worker.mjs +27 -36
  133. package/dist/{phrase-module-5QHBD2VJ.mjs → phrase-module-OMY3QQV7.mjs} +1 -1
  134. package/dist/react.d.ts +11 -11
  135. package/dist/react.mjs +9 -0
  136. package/dist/{rerank-KTLC3E6N.mjs → rerank-ZZ5CHKLW.mjs} +4 -4
  137. package/dist/rerankers/http.d.ts +1 -1
  138. package/dist/rerankers/http.mjs +2 -2
  139. package/dist/{browser/restore-queue-ONYNYUDE.mjs → restore-queue-UAVGBSJG.mjs} +2 -2
  140. package/dist/{runtime-DYV75DCB.mjs → runtime-RAOCKSYA.mjs} +5 -5
  141. package/dist/{schema-B-Runv0n.d.ts → schema-D33CyXCy.d.ts} +1 -1
  142. package/dist/server.d.ts +24 -12
  143. package/dist/server.mjs +153 -36
  144. package/dist/{snapshot-CGM65VCD.mjs → snapshot-DB5ZVCDN.mjs} +39 -48
  145. package/dist/synonyms.mjs +3 -4
  146. package/dist/{tasks-CjRJRGTb.d.ts → tasks-ChWp0wrF.d.ts} +59 -7
  147. package/dist/{thread-KGNAIKPD.mjs → thread-OV6T555H.mjs} +17 -22
  148. package/dist/vector/search-worker.d.ts +2 -2
  149. package/dist/vector/search-worker.mjs +5 -6
  150. package/dist/workers/entry.mjs +7 -7
  151. package/dist/{write-2DZPEQL2.mjs → write-KZVTLGCI.mjs} +28 -37
  152. package/openapi.json +349 -2
  153. package/package.json +27 -8
  154. package/dist/browser/import-TLB2A5LJ.mjs +0 -9
  155. package/dist/chunk-5WYVUPGD.mjs +0 -427
  156. package/dist/chunk-AV4IJKD2.mjs +0 -35
  157. package/dist/chunk-GES7U2PM.mjs +0 -68
  158. package/dist/chunk-KGOXHLLZ.mjs +0 -693
  159. package/dist/chunk-N37VMC62.mjs +0 -18
  160. package/dist/chunk-QSK35UC2.mjs +0 -35
  161. package/dist/chunk-WNBRW4Q2.mjs +0 -128
  162. package/dist/chunk-WQBCBKY3.mjs +0 -8
  163. package/dist/chunk-ZATRDAYU.mjs +0 -160
  164. package/dist/direct-executor-7XOQ7VQP.mjs +0 -28
  165. package/dist/import-OOBUW3RR.mjs +0 -44
@@ -1,693 +0,0 @@
1
- import { MAX_DOCUMENT_ENCODING_DEPTH, DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES, DOCUMENT_REPLY_ENVELOPE_DEPTH } from './chunk-U476IXKQ.mjs';
2
- import { EARLIER_RELEASE_MIN_M, MIN_M, MAX_M } from './chunk-VJS4JFBQ.mjs';
3
- import { isWordIndexedBase, parseFieldType } from './chunk-ZSWHPKGM.mjs';
4
- import { compareCodePoints, holdsUnpairedSurrogate, exceedsCodePoints } from './chunk-YTJCGKM4.mjs';
5
- import { DEFAULT_PATTERN_VALUE_LIMIT, isPlainObject, MAX_TEXT_FIELDS, MAX_VECTOR_DIMENSION, MAX_DOCUMENT_BYTES, MAX_NESTING_DEPTH, PROTOTYPE_POLLUTION_KEYS, FIELD_NAME_PATTERN, RESERVED_ROOT_FIELDS, MAX_DOCUMENT_NESTING_DEPTH, VECTOR_PATTERN } from './chunk-L5ORED7V.mjs';
6
- import { NarsilError, ErrorCodes } from './chunk-HNHCNTVG.mjs';
7
- import { Encoder, encode } from '@msgpack/msgpack';
8
-
9
- // src/schema/validator/schema.ts
10
- function validateSchemaFields(schema, depth, prefix) {
11
- if (depth > MAX_NESTING_DEPTH) {
12
- throw new NarsilError(
13
- ErrorCodes.SCHEMA_DEPTH_EXCEEDED,
14
- `Schema nesting exceeds the maximum depth of ${MAX_NESTING_DEPTH} at "${prefix}"`,
15
- { path: prefix, maxDepth: MAX_NESTING_DEPTH }
16
- );
17
- }
18
- let canonical = null;
19
- const replace = (field, value) => {
20
- if (canonical === null) canonical = { ...schema };
21
- canonical[field] = value;
22
- };
23
- for (const [field, type] of Object.entries(schema)) {
24
- const path = prefix ? `${prefix}.${field}` : field;
25
- if (PROTOTYPE_POLLUTION_KEYS.has(field)) {
26
- throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, `Field name "${field}" is not allowed in a schema`, {
27
- field,
28
- path
29
- });
30
- }
31
- if (!FIELD_NAME_PATTERN.test(field)) {
32
- throw new NarsilError(
33
- ErrorCodes.SCHEMA_INVALID_TYPE,
34
- `Field name "${field}" contains characters that are not allowed; use letters, digits, and underscores only`,
35
- { field, path }
36
- );
37
- }
38
- if (depth === 1 && RESERVED_ROOT_FIELDS.has(field)) {
39
- throw new NarsilError(
40
- ErrorCodes.SCHEMA_INVALID_TYPE,
41
- `Field "${field}" is reserved and cannot be defined in a schema`,
42
- { field, path }
43
- );
44
- }
45
- if (isPlainObject(type)) {
46
- const nested = validateSchemaFields(type, depth + 1, path);
47
- if (nested !== type) replace(field, nested);
48
- continue;
49
- }
50
- if (typeof type !== "string") {
51
- throw new NarsilError(
52
- ErrorCodes.SCHEMA_INVALID_TYPE,
53
- `Field "${path}" has an invalid type definition: ${String(type)}`,
54
- {
55
- field: path,
56
- type: String(type)
57
- }
58
- );
59
- }
60
- const parsed = parseFieldType(type, path);
61
- if (parsed.type !== type) replace(field, parsed.type);
62
- }
63
- return canonical ?? schema;
64
- }
65
- function validateSchema(schema) {
66
- if (!isPlainObject(schema)) {
67
- throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must be a plain object", {
68
- received: typeof schema
69
- });
70
- }
71
- if (Object.keys(schema).length === 0) {
72
- throw new NarsilError(ErrorCodes.SCHEMA_INVALID_TYPE, "Schema must define at least one field");
73
- }
74
- const validated = validateSchemaFields(schema, 1, "");
75
- requireTextFieldCount(schemaFieldsOf(validated).filter((field) => isWordIndexedBase(field.base)).length);
76
- return validated;
77
- }
78
- function requireTextFieldCount(count) {
79
- if (count <= MAX_TEXT_FIELDS) return;
80
- throw new NarsilError(
81
- ErrorCodes.SCHEMA_INVALID_TYPE,
82
- `The schema declares ${count} string and string[] fields, but a schema holds at most ${MAX_TEXT_FIELDS}`,
83
- { textFields: count, maximum: MAX_TEXT_FIELDS }
84
- );
85
- }
86
- function requireCreatableSchema(schema) {
87
- for (const field of schemaFieldsOf(schema)) {
88
- if (field.base !== "vector" || field.dimension <= MAX_VECTOR_DIMENSION) continue;
89
- throw new NarsilError(
90
- ErrorCodes.SCHEMA_INVALID_VECTOR_DIMENSION,
91
- `Vector field "${field.path}" has ${field.dimension} dimensions, but a new index takes at most ${MAX_VECTOR_DIMENSION}`,
92
- { field: field.path, dimension: field.dimension, maximum: MAX_VECTOR_DIMENSION }
93
- );
94
- }
95
- }
96
- function requireValidFieldTypes(flatSchema) {
97
- let textFields = 0;
98
- for (const [path, type] of Object.entries(flatSchema)) {
99
- if (typeof type !== "string") {
100
- throw new NarsilError(
101
- ErrorCodes.SCHEMA_INVALID_TYPE,
102
- `Field "${path}" has an invalid type definition: ${String(type)}`,
103
- { field: path, type: String(type) }
104
- );
105
- }
106
- if (isWordIndexedBase(parseFieldType(type, path).base)) textFields += 1;
107
- }
108
- requireTextFieldCount(textFields);
109
- }
110
- function flattenRecursive(schema, prefix, result) {
111
- for (const [field, type] of Object.entries(schema)) {
112
- const path = prefix ? `${prefix}.${field}` : field;
113
- if (isPlainObject(type)) {
114
- flattenRecursive(type, path, result);
115
- } else {
116
- result[path] = type;
117
- }
118
- }
119
- }
120
- var flattenedSchemas = /* @__PURE__ */ new WeakMap();
121
- function flattenSchema(schema) {
122
- const cached = flattenedSchemas.get(schema);
123
- if (cached !== void 0) return cached;
124
- const result = /* @__PURE__ */ Object.create(null);
125
- flattenRecursive(schema, "", result);
126
- flattenedSchemas.set(schema, Object.freeze(result));
127
- return result;
128
- }
129
- var parsedSchemas = /* @__PURE__ */ new WeakMap();
130
- function schemaFieldsOf(schema) {
131
- const cached = parsedSchemas.get(schema);
132
- if (cached !== void 0) return cached;
133
- const fields = [];
134
- for (const [path, type] of Object.entries(flattenSchema(schema))) {
135
- fields.push({ ...parseFieldType(type, path), path });
136
- }
137
- const frozen = Object.freeze(fields);
138
- parsedSchemas.set(schema, frozen);
139
- return frozen;
140
- }
141
- var partialFieldsBySchema = /* @__PURE__ */ new WeakMap();
142
- function partialFieldsOf(schema) {
143
- const cached = partialFieldsBySchema.get(schema);
144
- if (cached !== void 0) return cached;
145
- const paths = [];
146
- for (const field of schemaFieldsOf(schema)) {
147
- if (field.partial) paths.push(field.path);
148
- }
149
- const frozen = Object.freeze(paths.sort(compareCodePoints));
150
- partialFieldsBySchema.set(schema, frozen);
151
- return frozen;
152
- }
153
- function extractVectorFieldsFromSchema(schema) {
154
- const result = /* @__PURE__ */ new Map();
155
- for (const field of schemaFieldsOf(schema)) {
156
- if (field.base === "vector") result.set(field.path, field.dimension);
157
- }
158
- return result;
159
- }
160
-
161
- // src/geo/constants.ts
162
- var DEG_TO_RAD = Math.PI / 180;
163
- var MAX_LATITUDE_DEGREES = 90;
164
- var MAX_LONGITUDE_DEGREES = 180;
165
- var MIN_POLYGON_POINTS = 3;
166
- var ANTIMERIDIAN_SPAN_DEGREES = 180;
167
- var FULL_TURN_DEGREES = 360;
168
- var EARTH_RADIUS_METERS = 63710088e-1;
169
- var LOCATION_CODE_BITS_PER_AXIS = 26;
170
- var MAX_COVERING_CELLS = 16;
171
- var RADIUS_BOX_MARGIN_RATIO = 1.02;
172
- var RADIUS_BOX_MARGIN_RADIANS = 1e-9;
173
- var VINCENTY_MAX_ITERATIONS = 200;
174
- var VINCENTY_CONVERGENCE_THRESHOLD = 1e-12;
175
-
176
- // src/geo/coordinates.ts
177
- function isLatitude(value) {
178
- return value >= -MAX_LATITUDE_DEGREES && value <= MAX_LATITUDE_DEGREES;
179
- }
180
- function isLongitude(value) {
181
- return value >= -MAX_LONGITUDE_DEGREES && value <= MAX_LONGITUDE_DEGREES;
182
- }
183
-
184
- // src/schema/validator/field-values.ts
185
- function validateGeopoint(path, value) {
186
- if (!isPlainObject(value)) {
187
- throw new NarsilError(
188
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
189
- `Field "${path}" expected a geopoint object with lat and lon`,
190
- {
191
- field: path,
192
- received: Array.isArray(value) ? "array" : typeof value
193
- }
194
- );
195
- }
196
- if (typeof value.lat !== "number" || typeof value.lon !== "number" || Number.isNaN(value.lat) || Number.isNaN(value.lon)) {
197
- throw new NarsilError(ErrorCodes.SCHEMA_INVALID_GEOPOINT, `Field "${path}" geopoint requires numeric lat and lon`, {
198
- field: path,
199
- lat: Number.isNaN(value.lat) ? "NaN" : typeof value.lat,
200
- lon: Number.isNaN(value.lon) ? "NaN" : typeof value.lon
201
- });
202
- }
203
- if (!isLatitude(value.lat)) {
204
- throw new NarsilError(
205
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
206
- `Field "${path}" geopoint lat must be between -90 and 90`,
207
- {
208
- field: path,
209
- lat: value.lat
210
- }
211
- );
212
- }
213
- if (!isLongitude(value.lon)) {
214
- throw new NarsilError(
215
- ErrorCodes.SCHEMA_INVALID_GEOPOINT,
216
- `Field "${path}" geopoint lon must be between -180 and 180`,
217
- {
218
- field: path,
219
- lon: value.lon
220
- }
221
- );
222
- }
223
- }
224
- function validateVector(path, value, expectedDimension) {
225
- const isArray = Array.isArray(value);
226
- const isFloat32 = value instanceof Float32Array;
227
- if (!isArray && !isFloat32) {
228
- throw new NarsilError(
229
- ErrorCodes.DOC_VALIDATION_FAILED,
230
- `Field "${path}" expected a vector (Array or Float32Array)`,
231
- { field: path, received: typeof value }
232
- );
233
- }
234
- const arr = value;
235
- if (arr.length !== expectedDimension) {
236
- throw new NarsilError(
237
- ErrorCodes.DOC_VALIDATION_FAILED,
238
- `Field "${path}" expected vector of dimension ${expectedDimension}, got ${arr.length}`,
239
- { field: path, expected: expectedDimension, received: arr.length }
240
- );
241
- }
242
- for (let i = 0; i < arr.length; i++) {
243
- if (typeof arr[i] !== "number" || !Number.isFinite(arr[i])) {
244
- throw new NarsilError(
245
- ErrorCodes.DOC_VALIDATION_FAILED,
246
- `Field "${path}" vector element at index ${i} is not a valid number`,
247
- { field: path, index: i, value: arr[i] }
248
- );
249
- }
250
- }
251
- }
252
- function validateTypedArray(path, value, elementType) {
253
- if (!Array.isArray(value)) {
254
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an array`, {
255
- field: path,
256
- received: typeof value
257
- });
258
- }
259
- for (let i = 0; i < value.length; i++) {
260
- const el = value[i];
261
- if (typeof el !== elementType) {
262
- throw new NarsilError(
263
- ErrorCodes.DOC_VALIDATION_FAILED,
264
- `Field "${path}" array element at index ${i} expected ${elementType}, got ${typeof el}`,
265
- { field: path, index: i, expected: elementType, received: typeof el }
266
- );
267
- }
268
- if (elementType === "number" && !Number.isFinite(el)) {
269
- throw new NarsilError(
270
- ErrorCodes.DOC_VALIDATION_FAILED,
271
- `Field "${path}" array element at index ${i} is ${String(el)}, while a number field holds finite numbers alone`,
272
- { field: path, index: i }
273
- );
274
- }
275
- }
276
- }
277
- function validatePatternValue(path, value, patternValueLimit, index) {
278
- if (!exceedsCodePoints(value, patternValueLimit)) return;
279
- const subject = index === void 0 ? `The value of field "${path}"` : `Element ${index} of field "${path}"`;
280
- throw new NarsilError(
281
- ErrorCodes.DOC_VALIDATION_FAILED,
282
- `${subject} is longer than ${patternValueLimit} code points, which is the pattern value limit of this index`,
283
- { field: path, limit: patternValueLimit, ...index === void 0 ? {} : { index } }
284
- );
285
- }
286
- function validateFieldValue(path, value, type, patternValueLimit) {
287
- switch (type.base) {
288
- case "string":
289
- case "verbatim":
290
- if (typeof value !== "string") {
291
- throw new NarsilError(
292
- ErrorCodes.DOC_VALIDATION_FAILED,
293
- `Field "${path}" expected string, got ${typeof value}`,
294
- {
295
- field: path,
296
- expected: "string",
297
- received: typeof value
298
- }
299
- );
300
- }
301
- if (type.pattern) validatePatternValue(path, value, patternValueLimit);
302
- return;
303
- case "number":
304
- if (typeof value !== "number" || !Number.isFinite(value)) {
305
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected a finite number`, {
306
- field: path,
307
- expected: "number",
308
- received: typeof value === "number" ? String(value) : typeof value
309
- });
310
- }
311
- return;
312
- case "boolean":
313
- if (typeof value !== "boolean") {
314
- throw new NarsilError(
315
- ErrorCodes.DOC_VALIDATION_FAILED,
316
- `Field "${path}" expected boolean, got ${typeof value}`,
317
- {
318
- field: path,
319
- expected: "boolean",
320
- received: typeof value
321
- }
322
- );
323
- }
324
- return;
325
- case "enum":
326
- if (typeof value !== "string") {
327
- throw new NarsilError(
328
- ErrorCodes.DOC_VALIDATION_FAILED,
329
- `Field "${path}" expected enum (string), got ${typeof value}`,
330
- {
331
- field: path,
332
- expected: "enum",
333
- received: typeof value
334
- }
335
- );
336
- }
337
- return;
338
- case "geopoint":
339
- validateGeopoint(path, value);
340
- return;
341
- case "string[]":
342
- case "verbatim[]":
343
- validateTypedArray(path, value, "string");
344
- if (type.pattern) {
345
- const elements = value;
346
- for (let i = 0; i < elements.length; i++) validatePatternValue(path, elements[i], patternValueLimit, i);
347
- }
348
- return;
349
- case "number[]":
350
- validateTypedArray(path, value, "number");
351
- return;
352
- case "boolean[]":
353
- validateTypedArray(path, value, "boolean");
354
- return;
355
- case "enum[]":
356
- validateTypedArray(path, value, "string");
357
- return;
358
- case "vector":
359
- validateVector(path, value, type.dimension);
360
- return;
361
- }
362
- }
363
-
364
- // src/schema/validator/storable.ts
365
- var RESERVED_OBJECT_KEYS = /* @__PURE__ */ new Set(["__proto__", "constructor", "prototype"]);
366
- var UNPAIRED_SURROGATE_REASON = "holds an unpaired surrogate, the half of a character such as an emoji whose other half is missing, so the engine cannot store it as UTF-8";
367
- function reject(path, reason) {
368
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path === "" ? "(document)" : path}" ${reason}`, {
369
- field: path
370
- });
371
- }
372
- function isPlainObject2(value) {
373
- const proto = Object.getPrototypeOf(value);
374
- return proto === Object.prototype || proto === null;
375
- }
376
- function walkStorable(value, path, depth, ancestors, skip) {
377
- if (value === null || value === void 0) return;
378
- const kind = typeof value;
379
- if (kind === "string") {
380
- if (holdsUnpairedSurrogate(value)) reject(path, UNPAIRED_SURROGATE_REASON);
381
- return;
382
- }
383
- if (kind === "boolean" || kind === "number") return;
384
- if (kind === "bigint" || kind === "symbol" || kind === "function") {
385
- reject(path, `holds a ${kind}, which cannot be stored or recovered`);
386
- }
387
- const container = value;
388
- if (container instanceof Date) {
389
- if (Number.isNaN(container.getTime())) reject(path, "holds an invalid date, which the engine cannot store");
390
- return;
391
- }
392
- if (container instanceof Uint8Array) return;
393
- const isArray = Array.isArray(container);
394
- if (!isArray && !isPlainObject2(container)) {
395
- reject(
396
- path,
397
- "holds a value that does not survive storage; use plain objects, arrays, strings, numbers, booleans, dates, or Uint8Array bytes"
398
- );
399
- }
400
- if (depth >= MAX_DOCUMENT_NESTING_DEPTH) {
401
- reject(path, `nests deeper than ${MAX_DOCUMENT_NESTING_DEPTH} levels`);
402
- }
403
- if (ancestors.has(container)) {
404
- reject(path, "refers back to one of its own ancestors");
405
- }
406
- ancestors.add(container);
407
- if (isArray) {
408
- const items = container;
409
- for (let i = 0; i < items.length; i++) {
410
- walkStorable(items[i], `${path}[${i}]`, depth + 1, ancestors, skip);
411
- }
412
- } else {
413
- const record = container;
414
- for (const key of Object.keys(record)) {
415
- const keyPath = path === "" ? key : `${path}.${key}`;
416
- if (RESERVED_OBJECT_KEYS.has(key)) {
417
- reject(keyPath, "uses a reserved object key");
418
- }
419
- if (holdsUnpairedSurrogate(key)) reject(keyPath, `has a name that ${UNPAIRED_SURROGATE_REASON}`);
420
- if (skip.has(keyPath)) continue;
421
- walkStorable(record[key], keyPath, depth + 1, ancestors, skip);
422
- }
423
- }
424
- ancestors.delete(container);
425
- }
426
- function assertStorableDocument(document, skipFieldPaths) {
427
- walkStorable(document, "", 0, /* @__PURE__ */ new Set(), skipFieldPaths ?? /* @__PURE__ */ new Set());
428
- }
429
-
430
- // src/schema/validator/document.ts
431
- var vectorPathCache = /* @__PURE__ */ new WeakMap();
432
- function vectorFieldPaths(schema) {
433
- let paths = vectorPathCache.get(schema);
434
- if (paths !== void 0) return paths;
435
- paths = /* @__PURE__ */ new Set();
436
- const collect = (level, prefix) => {
437
- for (const [field, type] of Object.entries(level)) {
438
- const path = prefix === "" ? field : `${prefix}.${field}`;
439
- if (typeof type === "string" && VECTOR_PATTERN.test(type)) {
440
- paths?.add(path);
441
- } else if (isPlainObject(type)) {
442
- collect(type, path);
443
- }
444
- }
445
- };
446
- collect(schema, "");
447
- vectorPathCache.set(schema, paths);
448
- return paths;
449
- }
450
- var parsedLevelCache = /* @__PURE__ */ new WeakMap();
451
- function parsedLevel(schema, prefix) {
452
- let entries = parsedLevelCache.get(schema);
453
- if (entries !== void 0) return entries;
454
- entries = Object.entries(schema).map(([field, type]) => {
455
- if (isPlainObject(type)) return { field, nested: type, type: null };
456
- const path = prefix ? `${prefix}.${field}` : field;
457
- return { field, nested: null, type: parseFieldType(type, path) };
458
- });
459
- parsedLevelCache.set(schema, entries);
460
- return entries;
461
- }
462
- function validateDocumentFields(doc, schema, prefix, patternValueLimit) {
463
- for (const { field, nested, type } of parsedLevel(schema, prefix)) {
464
- const value = doc[field];
465
- if (value === void 0 || value === null) continue;
466
- const path = prefix ? `${prefix}.${field}` : field;
467
- if (nested !== null) {
468
- if (!isPlainObject(value)) {
469
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, `Field "${path}" expected an object`, {
470
- field: path,
471
- received: Array.isArray(value) ? "array" : typeof value
472
- });
473
- }
474
- validateDocumentFields(value, nested, path, patternValueLimit);
475
- continue;
476
- }
477
- if (type !== null) validateFieldValue(path, value, type, patternValueLimit);
478
- }
479
- }
480
- function validateDocument(document, schema, patternValueLimit = DEFAULT_PATTERN_VALUE_LIMIT) {
481
- if (!isPlainObject(document)) {
482
- throw new NarsilError(ErrorCodes.DOC_VALIDATION_FAILED, "Document must be a plain object", {
483
- received: typeof document
484
- });
485
- }
486
- requireIdFieldKey(document);
487
- assertStorableDocument(document, vectorFieldPaths(schema));
488
- validateDocumentFields(document, schema, "", patternValueLimit);
489
- }
490
- function requireIdFieldKey(document) {
491
- if (!Object.hasOwn(document, "id")) return;
492
- const id = document.id;
493
- if (typeof id === "string" && id.length > 0) return;
494
- throw new NarsilError(
495
- ErrorCodes.DOC_VALIDATION_FAILED,
496
- `Field "id" holds ${typeof id === "string" ? "an empty string" : id === null ? "null" : `a ${typeof id}`}, while the engine stores a document under its id field, so that field must hold a non-empty string`,
497
- { field: "id", received: id === null ? "null" : typeof id }
498
- );
499
- }
500
- function collectExtraFields(doc, schema, prefix, extras) {
501
- for (const key of Object.keys(doc)) {
502
- if (key === "id") continue;
503
- const path = prefix ? `${prefix}.${key}` : key;
504
- if (!Object.hasOwn(schema, key)) {
505
- extras.push(path);
506
- continue;
507
- }
508
- const schemaType = schema[key];
509
- if (isPlainObject(schemaType) && isPlainObject(doc[key])) {
510
- collectExtraFields(doc[key], schemaType, path, extras);
511
- }
512
- }
513
- }
514
- function validateDocumentStrict(document, schema) {
515
- const extras = [];
516
- collectExtraFields(document, schema, "", extras);
517
- if (extras.length > 0) {
518
- throw new NarsilError(
519
- ErrorCodes.DOC_VALIDATION_FAILED,
520
- `Document contains fields not defined in schema: ${extras.join(", ")}`,
521
- { extraFields: extras }
522
- );
523
- }
524
- }
525
- function resolveNestedValue(document, path) {
526
- if (!path.includes(".")) return document[path];
527
- const segments = path.split(".");
528
- let current = document;
529
- for (const segment of segments) {
530
- if (current === null || current === void 0 || typeof current !== "object") return void 0;
531
- current = current[segment];
532
- }
533
- return current;
534
- }
535
- function validateRequiredFields(document, required) {
536
- if (required.length === 0) return;
537
- for (const field of required) {
538
- const value = resolveNestedValue(document, field);
539
- if (value === void 0 || value === null) {
540
- throw new NarsilError(ErrorCodes.DOC_MISSING_REQUIRED_FIELD, `Document is missing required field "${field}"`, {
541
- field
542
- });
543
- }
544
- }
545
- }
546
- var INTEGER_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH };
547
- var FLOAT_ENCODING = { maxDepth: MAX_DOCUMENT_ENCODING_DEPTH, forceIntegerToFloat: true };
548
- var integerEncoder = new Encoder(INTEGER_ENCODING);
549
- var floatEncoder = new Encoder(FLOAT_ENCODING);
550
- function encodeExactly(document, forceIntegerToFloat) {
551
- const bytes = (forceIntegerToFloat ? floatEncoder : integerEncoder).encode(document);
552
- if (bytes.byteLength > DOCUMENT_ENCODER_RETAINED_BUFFER_BYTES) {
553
- if (forceIntegerToFloat) floatEncoder = new Encoder(FLOAT_ENCODING);
554
- else integerEncoder = new Encoder(INTEGER_ENCODING);
555
- }
556
- return bytes;
557
- }
558
- function holdsNegativeZero(value, depth) {
559
- if (typeof value === "number") return Object.is(value, -0);
560
- if (value === null || typeof value !== "object" || ArrayBuffer.isView(value) || depth > MAX_DOCUMENT_ENCODING_DEPTH) {
561
- return false;
562
- }
563
- for (const child of Array.isArray(value) ? value : Object.values(value)) {
564
- if (holdsNegativeZero(child, depth + 1)) return true;
565
- }
566
- return false;
567
- }
568
- function encodeDocumentReply(payload) {
569
- return encode(payload, { forceIntegerToFloat: holdsNegativeZero(payload, 1 - DOCUMENT_REPLY_ENVELOPE_DEPTH) });
570
- }
571
- function encodeDocument(document) {
572
- try {
573
- return encodeExactly(document, holdsNegativeZero(document, 1));
574
- } catch (error) {
575
- throw new NarsilError(
576
- ErrorCodes.DOC_VALIDATION_FAILED,
577
- `The document cannot be encoded as MessagePack: ${error instanceof Error ? error.message : String(error)}`
578
- );
579
- }
580
- }
581
-
582
- // src/schema/validator/document-size.ts
583
- var LARGEST_HEADER_BYTES = 5;
584
- var LARGEST_NUMBER_BYTES = 9;
585
- var LARGEST_TIMESTAMP_BYTES = 15;
586
- var LARGEST_UTF8_BYTES_PER_UNIT = 3;
587
- function upperBoundBytes(value, budget, depth) {
588
- if (value === null || value === void 0 || typeof value === "boolean") return 1;
589
- if (typeof value === "number") return LARGEST_NUMBER_BYTES;
590
- if (typeof value === "string") return LARGEST_HEADER_BYTES + value.length * LARGEST_UTF8_BYTES_PER_UNIT;
591
- if (value instanceof Date) return LARGEST_TIMESTAMP_BYTES;
592
- if (ArrayBuffer.isView(value)) return LARGEST_HEADER_BYTES + value.byteLength;
593
- if (typeof value !== "object" || depth > MAX_DOCUMENT_NESTING_DEPTH) return LARGEST_NUMBER_BYTES;
594
- let total = LARGEST_HEADER_BYTES;
595
- if (Array.isArray(value)) {
596
- for (const item of value) {
597
- total += upperBoundBytes(item, budget - total, depth + 1);
598
- if (total > budget) return total;
599
- }
600
- return total;
601
- }
602
- const record = value;
603
- for (const key of Object.keys(record)) {
604
- total += LARGEST_HEADER_BYTES + key.length * LARGEST_UTF8_BYTES_PER_UNIT;
605
- total += upperBoundBytes(record[key], budget - total, depth + 1);
606
- if (total > budget) return total;
607
- }
608
- return total;
609
- }
610
- function messagePackUpperBoundBytes(value) {
611
- return upperBoundBytes(value, Number.POSITIVE_INFINITY, 0);
612
- }
613
- function encodedBytesOf(document) {
614
- try {
615
- return encodeDocument(document).byteLength;
616
- } catch {
617
- return null;
618
- }
619
- }
620
- function requireDocumentWithinSizeLimit(document) {
621
- if (upperBoundBytes(document, MAX_DOCUMENT_BYTES, 0) <= MAX_DOCUMENT_BYTES) return;
622
- const encodedBytes = encodedBytesOf(document);
623
- if (encodedBytes === null || encodedBytes <= MAX_DOCUMENT_BYTES) return;
624
- throw new NarsilError(
625
- ErrorCodes.DOC_VALIDATION_FAILED,
626
- `The document takes ${encodedBytes} bytes as MessagePack, vector values included, but a document may take at most ${MAX_DOCUMENT_BYTES}`,
627
- { bytes: encodedBytes, maximum: MAX_DOCUMENT_BYTES }
628
- );
629
- }
630
-
631
- // src/schema/validator/vector-promotion.ts
632
- var QUANTIZATION_MODES = /* @__PURE__ */ new Set(["osq8", "osq4", "osq2", "osq1", "none"]);
633
- var STORAGE_MODES = /* @__PURE__ */ new Set(["memory", "disk"]);
634
- function fail(message, details) {
635
- throw new NarsilError(ErrorCodes.CONFIG_INVALID, message, details);
636
- }
637
- function isPositiveInteger(value) {
638
- return Number.isInteger(value) && value >= 1;
639
- }
640
- function isQuantizationMode(value) {
641
- return typeof value === "string" && QUANTIZATION_MODES.has(value);
642
- }
643
- function isStorageMode(value) {
644
- return typeof value === "string" && STORAGE_MODES.has(value);
645
- }
646
- function validateVectorStorage(config, filesystemDurability) {
647
- if (config?.storage === "disk" && !filesystemDurability) {
648
- fail("vectorPromotion.storage 'disk' needs filesystem durability, because a checkpoint file holds the vectors", {
649
- storage: config.storage
650
- });
651
- }
652
- }
653
- function validateTextStorage(textStorage, filesystemDurability) {
654
- if (textStorage === void 0 || textStorage === "memory" || textStorage === "disk" && filesystemDurability) return;
655
- fail("textStorage must be 'memory', or 'disk' with filesystem durability", { textStorage });
656
- }
657
- function raiseEarlierReleaseGraphSetting(config) {
658
- if (typeof config !== "object" || config === null) return config;
659
- const hnsw = config.hnswConfig;
660
- if (typeof hnsw !== "object" || hnsw === null) return config;
661
- if (hnsw.m !== EARLIER_RELEASE_MIN_M) return config;
662
- return { ...config, hnswConfig: { ...hnsw, m: MIN_M } };
663
- }
664
- function validateVectorPromotion(config) {
665
- if (config === void 0) return;
666
- if (config.threshold !== void 0 && !isPositiveInteger(config.threshold)) {
667
- fail("vectorPromotion.threshold must be a positive integer", { threshold: config.threshold });
668
- }
669
- const quantization = config.quantization;
670
- if (quantization !== void 0 && !isQuantizationMode(quantization)) {
671
- fail("vectorPromotion.quantization must be 'osq8', 'osq4', 'osq2', 'osq1', or 'none'", { quantization });
672
- }
673
- const storage = config.storage;
674
- if (storage !== void 0 && !isStorageMode(storage)) {
675
- fail("vectorPromotion.storage must be 'memory' or 'disk'", { storage });
676
- }
677
- const hnsw = config.hnswConfig;
678
- if (hnsw === void 0) return;
679
- if (hnsw.m !== void 0 && (!Number.isInteger(hnsw.m) || hnsw.m < MIN_M || hnsw.m > MAX_M)) {
680
- fail(`vectorPromotion.hnswConfig.m must be a whole number from ${MIN_M} to ${MAX_M}`, { m: hnsw.m });
681
- }
682
- if (hnsw.efConstruction !== void 0 && !isPositiveInteger(hnsw.efConstruction)) {
683
- fail("vectorPromotion.hnswConfig.efConstruction must be a positive integer", {
684
- efConstruction: hnsw.efConstruction
685
- });
686
- }
687
- const metric = hnsw.metric;
688
- if (metric !== void 0 && metric !== "cosine" && metric !== "dotProduct" && metric !== "euclidean") {
689
- fail("vectorPromotion.hnswConfig.metric must be 'cosine', 'dotProduct', or 'euclidean'", { metric });
690
- }
691
- }
692
-
693
- export { ANTIMERIDIAN_SPAN_DEGREES, DEG_TO_RAD, EARTH_RADIUS_METERS, FULL_TURN_DEGREES, LOCATION_CODE_BITS_PER_AXIS, MAX_COVERING_CELLS, MAX_LATITUDE_DEGREES, MAX_LONGITUDE_DEGREES, MIN_POLYGON_POINTS, RADIUS_BOX_MARGIN_RADIANS, RADIUS_BOX_MARGIN_RATIO, VINCENTY_CONVERGENCE_THRESHOLD, VINCENTY_MAX_ITERATIONS, encodeDocument, encodeDocumentReply, extractVectorFieldsFromSchema, flattenSchema, isLatitude, isLongitude, isQuantizationMode, isStorageMode, messagePackUpperBoundBytes, partialFieldsOf, raiseEarlierReleaseGraphSetting, requireCreatableSchema, requireDocumentWithinSizeLimit, requireValidFieldTypes, schemaFieldsOf, validateDocument, validateDocumentStrict, validateRequiredFields, validateSchema, validateTextStorage, validateVectorPromotion, validateVectorStorage };