@ariestools/sdk 7.0.3

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 (409) hide show
  1. package/LICENSE +165 -0
  2. package/README.md +45 -0
  3. package/dist/_pkg/api/neutral/ApiClient.d.ts +10 -0
  4. package/dist/_pkg/api/neutral/ApiConfig.d.ts +9 -0
  5. package/dist/_pkg/api/neutral/ApiEndpoint.d.ts +19 -0
  6. package/dist/_pkg/api/neutral/ApiStage.d.ts +11 -0
  7. package/dist/_pkg/api/neutral/getApiStage.d.ts +8 -0
  8. package/dist/_pkg/api/neutral/index.d.ts +6 -0
  9. package/dist/_pkg/api/neutral/index.mjs +78 -0
  10. package/dist/_pkg/api/neutral/model.d.ts +3 -0
  11. package/dist/_pkg/api/neutral/model.mjs +1 -0
  12. package/dist/_pkg/array/neutral/containsAll.d.ts +8 -0
  13. package/dist/_pkg/array/neutral/distinct.d.ts +6 -0
  14. package/dist/_pkg/array/neutral/filterAs.d.ts +8 -0
  15. package/dist/_pkg/array/neutral/filterAsync.d.ts +9 -0
  16. package/dist/_pkg/array/neutral/findAs.d.ts +15 -0
  17. package/dist/_pkg/array/neutral/flatten.d.ts +8 -0
  18. package/dist/_pkg/array/neutral/index.d.ts +8 -0
  19. package/dist/_pkg/array/neutral/index.mjs +80 -0
  20. package/dist/_pkg/array/neutral/uniq.d.ts +14 -0
  21. package/dist/_pkg/arraybuffer/neutral/equalArrayBuffers.d.ts +8 -0
  22. package/dist/_pkg/arraybuffer/neutral/index.d.ts +5 -0
  23. package/dist/_pkg/arraybuffer/neutral/index.mjs +74 -0
  24. package/dist/_pkg/arraybuffer/neutral/isArrayBuffer.d.ts +7 -0
  25. package/dist/_pkg/arraybuffer/neutral/toArrayBuffer.d.ts +11 -0
  26. package/dist/_pkg/arraybuffer/neutral/toUint8Array.d.ts +11 -0
  27. package/dist/_pkg/assert/neutral/assertDefinedEx.d.ts +41 -0
  28. package/dist/_pkg/assert/neutral/assertEx.d.ts +41 -0
  29. package/dist/_pkg/assert/neutral/index.d.ts +4 -0
  30. package/dist/_pkg/assert/neutral/index.mjs +30 -0
  31. package/dist/_pkg/assert/neutral/model.d.ts +2 -0
  32. package/dist/_pkg/assert/neutral/model.mjs +1 -0
  33. package/dist/_pkg/assert/neutral/types.d.ts +36 -0
  34. package/dist/_pkg/base/neutral/Base.d.ts +53 -0
  35. package/dist/_pkg/base/neutral/UniqueBase.d.ts +10 -0
  36. package/dist/_pkg/base/neutral/globallyUnique.d.ts +21 -0
  37. package/dist/_pkg/base/neutral/index.d.ts +4 -0
  38. package/dist/_pkg/base/neutral/index.mjs +164 -0
  39. package/dist/_pkg/base/neutral/model.d.ts +2 -0
  40. package/dist/_pkg/base/neutral/model.mjs +1 -0
  41. package/dist/_pkg/creatable/neutral/AbstractCreatable.d.ts +123 -0
  42. package/dist/_pkg/creatable/neutral/Creatable.d.ts +49 -0
  43. package/dist/_pkg/creatable/neutral/Factory.d.ts +28 -0
  44. package/dist/_pkg/creatable/neutral/index.d.ts +5 -0
  45. package/dist/_pkg/creatable/neutral/index.mjs +396 -0
  46. package/dist/_pkg/creatable/neutral/lib/getFunctionName.d.ts +7 -0
  47. package/dist/_pkg/creatable/neutral/lib/getRootFunction.d.ts +8 -0
  48. package/dist/_pkg/creatable/neutral/lib/index.d.ts +3 -0
  49. package/dist/_pkg/creatable/neutral/model/CreatableInstance.d.ts +16 -0
  50. package/dist/_pkg/creatable/neutral/model/CreatableParams.d.ts +16 -0
  51. package/dist/_pkg/creatable/neutral/model/CreatableStatusReporter.d.ts +15 -0
  52. package/dist/_pkg/creatable/neutral/model/Labels.d.ts +24 -0
  53. package/dist/_pkg/creatable/neutral/model/index.d.ts +5 -0
  54. package/dist/_pkg/creatable/neutral/model.d.ts +3 -0
  55. package/dist/_pkg/creatable/neutral/model.mjs +1 -0
  56. package/dist/_pkg/decimal-precision/neutral/fromFixedPoint.d.ts +8 -0
  57. package/dist/_pkg/decimal-precision/neutral/index.d.ts +4 -0
  58. package/dist/_pkg/decimal-precision/neutral/index.mjs +39 -0
  59. package/dist/_pkg/decimal-precision/neutral/toDecimalPrecision.d.ts +8 -0
  60. package/dist/_pkg/decimal-precision/neutral/toFixedPoint.d.ts +8 -0
  61. package/dist/_pkg/delay/neutral/delay.d.ts +7 -0
  62. package/dist/_pkg/delay/neutral/index.d.ts +2 -0
  63. package/dist/_pkg/delay/neutral/index.mjs +9 -0
  64. package/dist/_pkg/ellipsize/neutral/index.d.ts +8 -0
  65. package/dist/_pkg/ellipsize/neutral/index.mjs +10 -0
  66. package/dist/_pkg/enum/neutral/Enum.d.ts +88 -0
  67. package/dist/_pkg/enum/neutral/index.d.ts +2 -0
  68. package/dist/_pkg/enum/neutral/index.mjs +8 -0
  69. package/dist/_pkg/enum/neutral/model.d.ts +2 -0
  70. package/dist/_pkg/enum/neutral/model.mjs +1 -0
  71. package/dist/_pkg/error/neutral/assert.d.ts +12 -0
  72. package/dist/_pkg/error/neutral/handleError.d.ts +15 -0
  73. package/dist/_pkg/error/neutral/index.d.ts +3 -0
  74. package/dist/_pkg/error/neutral/index.mjs +32 -0
  75. package/dist/_pkg/error/neutral/model.d.ts +2 -0
  76. package/dist/_pkg/error/neutral/model.mjs +1 -0
  77. package/dist/_pkg/events/neutral/BaseEmitter.d.ts +74 -0
  78. package/dist/_pkg/events/neutral/Events/Events.d.ts +132 -0
  79. package/dist/_pkg/events/neutral/Events/index.d.ts +2 -0
  80. package/dist/_pkg/events/neutral/index.d.ts +4 -0
  81. package/dist/_pkg/events/neutral/index.mjs +415 -0
  82. package/dist/_pkg/events/neutral/model/Event.d.ts +21 -0
  83. package/dist/_pkg/events/neutral/model/EventEmitter.d.ts +25 -0
  84. package/dist/_pkg/events/neutral/model/index.d.ts +3 -0
  85. package/dist/_pkg/events/neutral/model.d.ts +3 -0
  86. package/dist/_pkg/events/neutral/model.mjs +1 -0
  87. package/dist/_pkg/exists/neutral/index.d.ts +10 -0
  88. package/dist/_pkg/exists/neutral/index.mjs +8 -0
  89. package/dist/_pkg/fetch/neutral/FetchClient.d.ts +46 -0
  90. package/dist/_pkg/fetch/neutral/FetchError.d.ts +80 -0
  91. package/dist/_pkg/fetch/neutral/FetchJsonClient.d.ts +19 -0
  92. package/dist/_pkg/fetch/neutral/fetchCompress.d.ts +12 -0
  93. package/dist/_pkg/fetch/neutral/fetchJson.d.ts +7 -0
  94. package/dist/_pkg/fetch/neutral/index.d.ts +11 -0
  95. package/dist/_pkg/fetch/neutral/index.mjs +365 -0
  96. package/dist/_pkg/fetch/neutral/methods.d.ts +12 -0
  97. package/dist/_pkg/fetch/neutral/model.d.ts +5 -0
  98. package/dist/_pkg/fetch/neutral/model.mjs +1 -0
  99. package/dist/_pkg/fetch/neutral/parseJson.d.ts +16 -0
  100. package/dist/_pkg/fetch/neutral/types.d.ts +12 -0
  101. package/dist/_pkg/forget/neutral/ForgetConfig.d.ts +21 -0
  102. package/dist/_pkg/forget/neutral/ForgetNodeConfig.d.ts +13 -0
  103. package/dist/_pkg/forget/neutral/ForgetPromise.d.ts +49 -0
  104. package/dist/_pkg/forget/neutral/ForgetPromiseNode.d.ts +15 -0
  105. package/dist/_pkg/forget/neutral/forget.d.ts +10 -0
  106. package/dist/_pkg/forget/neutral/forgetNode.d.ts +9 -0
  107. package/dist/_pkg/forget/neutral/index.d.ts +2 -0
  108. package/dist/_pkg/forget/neutral/index.mjs +162 -0
  109. package/dist/_pkg/forget/neutral/model.d.ts +3 -0
  110. package/dist/_pkg/forget/neutral/model.mjs +1 -0
  111. package/dist/_pkg/forget/neutral/neutral/index.d.ts +4 -0
  112. package/dist/_pkg/forget/neutral/node/index.d.ts +4 -0
  113. package/dist/_pkg/function-name/neutral/functionName.d.ts +7 -0
  114. package/dist/_pkg/function-name/neutral/index.d.ts +2 -0
  115. package/dist/_pkg/function-name/neutral/index.mjs +27 -0
  116. package/dist/_pkg/hex/neutral/HexRegEx.d.ts +19 -0
  117. package/dist/_pkg/hex/neutral/address/AddressTransformZod.d.ts +10 -0
  118. package/dist/_pkg/hex/neutral/address/AddressValidationZod.d.ts +10 -0
  119. package/dist/_pkg/hex/neutral/address/address.d.ts +18 -0
  120. package/dist/_pkg/hex/neutral/address/as.d.ts +13 -0
  121. package/dist/_pkg/hex/neutral/address/index.d.ts +7 -0
  122. package/dist/_pkg/hex/neutral/address/is.d.ts +12 -0
  123. package/dist/_pkg/hex/neutral/address/to.d.ts +12 -0
  124. package/dist/_pkg/hex/neutral/ethAddress.d.ts +45 -0
  125. package/dist/_pkg/hex/neutral/hash/as.d.ts +11 -0
  126. package/dist/_pkg/hex/neutral/hash/hash.d.ts +28 -0
  127. package/dist/_pkg/hex/neutral/hash/index.d.ts +5 -0
  128. package/dist/_pkg/hex/neutral/hash/is.d.ts +9 -0
  129. package/dist/_pkg/hex/neutral/hash/zod.d.ts +6 -0
  130. package/dist/_pkg/hex/neutral/hex/as.d.ts +11 -0
  131. package/dist/_pkg/hex/neutral/hex/from/from.d.ts +8 -0
  132. package/dist/_pkg/hex/neutral/hex/from/fromArrayBuffer.d.ts +8 -0
  133. package/dist/_pkg/hex/neutral/hex/from/fromBigInt.d.ts +8 -0
  134. package/dist/_pkg/hex/neutral/hex/from/fromHexString.d.ts +9 -0
  135. package/dist/_pkg/hex/neutral/hex/from/fromNumber.d.ts +9 -0
  136. package/dist/_pkg/hex/neutral/hex/from/index.d.ts +6 -0
  137. package/dist/_pkg/hex/neutral/hex/hex.d.ts +17 -0
  138. package/dist/_pkg/hex/neutral/hex/index.d.ts +9 -0
  139. package/dist/_pkg/hex/neutral/hex/is.d.ts +9 -0
  140. package/dist/_pkg/hex/neutral/hex/isHexZero.d.ts +7 -0
  141. package/dist/_pkg/hex/neutral/hex/legacy.d.ts +7 -0
  142. package/dist/_pkg/hex/neutral/hex/nibble.d.ts +13 -0
  143. package/dist/_pkg/hex/neutral/hex/to.d.ts +8 -0
  144. package/dist/_pkg/hex/neutral/hexToBigInt.d.ts +8 -0
  145. package/dist/_pkg/hex/neutral/index.d.ts +8 -0
  146. package/dist/_pkg/hex/neutral/index.mjs +381 -0
  147. package/dist/_pkg/hex/neutral/model.d.ts +3 -0
  148. package/dist/_pkg/hex/neutral/model.mjs +1 -0
  149. package/dist/_pkg/hex/neutral/zod.d.ts +6 -0
  150. package/dist/_pkg/logger/neutral/ConsoleLogger.d.ts +7 -0
  151. package/dist/_pkg/logger/neutral/IdLogger.d.ts +19 -0
  152. package/dist/_pkg/logger/neutral/LevelLogger.d.ts +47 -0
  153. package/dist/_pkg/logger/neutral/NoOpLogFunction.d.ts +3 -0
  154. package/dist/_pkg/logger/neutral/SilentLogger.d.ts +17 -0
  155. package/dist/_pkg/logger/neutral/getFunctionName.d.ts +7 -0
  156. package/dist/_pkg/logger/neutral/index.d.ts +7 -0
  157. package/dist/_pkg/logger/neutral/index.mjs +126 -0
  158. package/dist/_pkg/object/neutral/AsObjectFactory.d.ts +8 -0
  159. package/dist/_pkg/object/neutral/AsTypeFactory.d.ts +11 -0
  160. package/dist/_pkg/object/neutral/EmptyObject.d.ts +2 -0
  161. package/dist/_pkg/object/neutral/IsObjectFactory.d.ts +16 -0
  162. package/dist/_pkg/object/neutral/JsonObject.d.ts +49 -0
  163. package/dist/_pkg/object/neutral/ObjectWrapper.d.ts +9 -0
  164. package/dist/_pkg/object/neutral/OmitStartsWith.d.ts +18 -0
  165. package/dist/_pkg/object/neutral/Optional.d.ts +3 -0
  166. package/dist/_pkg/object/neutral/Override.d.ts +4 -0
  167. package/dist/_pkg/object/neutral/PartialRecord.d.ts +3 -0
  168. package/dist/_pkg/object/neutral/PickStartsWith.d.ts +9 -0
  169. package/dist/_pkg/object/neutral/Simplify.d.ts +5 -0
  170. package/dist/_pkg/object/neutral/StringKeyObject.d.ts +3 -0
  171. package/dist/_pkg/object/neutral/Validator.d.ts +13 -0
  172. package/dist/_pkg/object/neutral/WithAdditional.d.ts +4 -0
  173. package/dist/_pkg/object/neutral/asObject.d.ts +4 -0
  174. package/dist/_pkg/object/neutral/deepMerge.d.ts +49 -0
  175. package/dist/_pkg/object/neutral/index-deprecated.d.ts +2 -0
  176. package/dist/_pkg/object/neutral/index-un-deprecated.d.ts +22 -0
  177. package/dist/_pkg/object/neutral/index-un-deprecated.mjs +320 -0
  178. package/dist/_pkg/object/neutral/index.d.ts +3 -0
  179. package/dist/_pkg/object/neutral/index.mjs +435 -0
  180. package/dist/_pkg/object/neutral/isType.d.ts +4 -0
  181. package/dist/_pkg/object/neutral/model.d.ts +14 -0
  182. package/dist/_pkg/object/neutral/model.mjs +1 -0
  183. package/dist/_pkg/object/neutral/omitBy.d.ts +21 -0
  184. package/dist/_pkg/object/neutral/pickBy.d.ts +21 -0
  185. package/dist/_pkg/object/neutral/removeFields.d.ts +9 -0
  186. package/dist/_pkg/object/neutral/toSafeJson.d.ts +41 -0
  187. package/dist/_pkg/object-model/neutral/AnyObject.d.ts +8 -0
  188. package/dist/_pkg/object-model/neutral/AsTypeFactory.d.ts +12 -0
  189. package/dist/_pkg/object-model/neutral/AsTypeFunction.d.ts +14 -0
  190. package/dist/_pkg/object-model/neutral/Compare.d.ts +3 -0
  191. package/dist/_pkg/object-model/neutral/EmptyObject.d.ts +8 -0
  192. package/dist/_pkg/object-model/neutral/index.d.ts +6 -0
  193. package/dist/_pkg/object-model/neutral/index.mjs +1 -0
  194. package/dist/_pkg/object-model/neutral/model.d.ts +6 -0
  195. package/dist/_pkg/object-model/neutral/model.mjs +1 -0
  196. package/dist/_pkg/object-model/neutral/types.d.ts +25 -0
  197. package/dist/_pkg/platform/browser/browser/index.d.ts +9 -0
  198. package/dist/_pkg/platform/browser/index-browser.d.ts +2 -0
  199. package/dist/_pkg/platform/browser/index-browser.mjs +18 -0
  200. package/dist/_pkg/platform/browser/index-node.d.ts +2 -0
  201. package/dist/_pkg/platform/browser/node/index.d.ts +9 -0
  202. package/dist/_pkg/platform/node/browser/index.d.ts +9 -0
  203. package/dist/_pkg/platform/node/index-browser.d.ts +2 -0
  204. package/dist/_pkg/platform/node/index-node.d.ts +2 -0
  205. package/dist/_pkg/platform/node/index-node.mjs +18 -0
  206. package/dist/_pkg/platform/node/node/index.d.ts +9 -0
  207. package/dist/_pkg/profile/neutral/index.d.ts +2 -0
  208. package/dist/_pkg/profile/neutral/index.mjs +37 -0
  209. package/dist/_pkg/profile/neutral/model.d.ts +2 -0
  210. package/dist/_pkg/profile/neutral/model.mjs +1 -0
  211. package/dist/_pkg/profile/neutral/profiler.d.ts +17 -0
  212. package/dist/_pkg/promise/neutral/PromiseEx.d.ts +24 -0
  213. package/dist/_pkg/promise/neutral/fulfilled.d.ts +7 -0
  214. package/dist/_pkg/promise/neutral/fulfilledValues.d.ts +20 -0
  215. package/dist/_pkg/promise/neutral/index.d.ts +7 -0
  216. package/dist/_pkg/promise/neutral/index.mjs +57 -0
  217. package/dist/_pkg/promise/neutral/model.d.ts +3 -0
  218. package/dist/_pkg/promise/neutral/model.mjs +1 -0
  219. package/dist/_pkg/promise/neutral/rejected.d.ts +7 -0
  220. package/dist/_pkg/promise/neutral/toPromise.d.ts +8 -0
  221. package/dist/_pkg/promise/neutral/types.d.ts +23 -0
  222. package/dist/_pkg/retry/neutral/index.d.ts +2 -0
  223. package/dist/_pkg/retry/neutral/index.mjs +28 -0
  224. package/dist/_pkg/retry/neutral/model.d.ts +2 -0
  225. package/dist/_pkg/retry/neutral/model.mjs +1 -0
  226. package/dist/_pkg/retry/neutral/retry.d.ts +23 -0
  227. package/dist/_pkg/set/neutral/index.d.ts +2 -0
  228. package/dist/_pkg/set/neutral/index.mjs +20 -0
  229. package/dist/_pkg/set/neutral/lib/difference.d.ts +8 -0
  230. package/dist/_pkg/set/neutral/lib/index.d.ts +4 -0
  231. package/dist/_pkg/set/neutral/lib/intersection.d.ts +8 -0
  232. package/dist/_pkg/set/neutral/lib/union.d.ts +8 -0
  233. package/dist/_pkg/static-implements/neutral/index.d.ts +2 -0
  234. package/dist/_pkg/static-implements/neutral/index.mjs +10 -0
  235. package/dist/_pkg/static-implements/neutral/staticImplements.d.ts +7 -0
  236. package/dist/_pkg/storage/neutral/KeyValueStore.d.ts +34 -0
  237. package/dist/_pkg/storage/neutral/index.d.ts +2 -0
  238. package/dist/_pkg/storage/neutral/index.mjs +1 -0
  239. package/dist/_pkg/storage/neutral/model.d.ts +2 -0
  240. package/dist/_pkg/storage/neutral/model.mjs +1 -0
  241. package/dist/_pkg/telemetry/neutral/index.d.ts +3 -0
  242. package/dist/_pkg/telemetry/neutral/index.mjs +152 -0
  243. package/dist/_pkg/telemetry/neutral/model.d.ts +2 -0
  244. package/dist/_pkg/telemetry/neutral/model.mjs +1 -0
  245. package/dist/_pkg/telemetry/neutral/span.d.ts +51 -0
  246. package/dist/_pkg/telemetry/neutral/timeBudget.d.ts +12 -0
  247. package/dist/_pkg/telemetry-exporter/neutral/XyConsoleSpanExporter.d.ts +40 -0
  248. package/dist/_pkg/telemetry-exporter/neutral/index.d.ts +2 -0
  249. package/dist/_pkg/telemetry-exporter/neutral/index.mjs +88 -0
  250. package/dist/_pkg/timer/neutral/index.d.ts +2 -0
  251. package/dist/_pkg/timer/neutral/index.mjs +75 -0
  252. package/dist/_pkg/timer/neutral/setTimeoutEx.d.ts +37 -0
  253. package/dist/_pkg/typeof/neutral/Brand.d.ts +5 -0
  254. package/dist/_pkg/typeof/neutral/IdentityFunction.d.ts +3 -0
  255. package/dist/_pkg/typeof/neutral/ObjectTypeShape.d.ts +5 -0
  256. package/dist/_pkg/typeof/neutral/TypeOfTypes.d.ts +3 -0
  257. package/dist/_pkg/typeof/neutral/Typed.d.ts +41 -0
  258. package/dist/_pkg/typeof/neutral/ifDefined.d.ts +8 -0
  259. package/dist/_pkg/typeof/neutral/ifTypeOf.d.ts +11 -0
  260. package/dist/_pkg/typeof/neutral/index.d.ts +12 -0
  261. package/dist/_pkg/typeof/neutral/index.mjs +255 -0
  262. package/dist/_pkg/typeof/neutral/is.d.ts +116 -0
  263. package/dist/_pkg/typeof/neutral/isType.d.ts +9 -0
  264. package/dist/_pkg/typeof/neutral/model.d.ts +7 -0
  265. package/dist/_pkg/typeof/neutral/model.mjs +1 -0
  266. package/dist/_pkg/typeof/neutral/typeOf.d.ts +8 -0
  267. package/dist/_pkg/typeof/neutral/validateType.d.ts +10 -0
  268. package/dist/_pkg/url/browser/index-browser.d.ts +12 -0
  269. package/dist/_pkg/url/browser/index-browser.mjs +12 -0
  270. package/dist/_pkg/url/browser/index-neutral.d.ts +12 -0
  271. package/dist/_pkg/url/browser/index-node.d.ts +13 -0
  272. package/dist/_pkg/url/browser/lib/index.d.ts +2 -0
  273. package/dist/_pkg/url/browser/lib/isLocalhost.d.ts +7 -0
  274. package/dist/_pkg/url/neutral/index-browser.d.ts +12 -0
  275. package/dist/_pkg/url/neutral/index-neutral.d.ts +12 -0
  276. package/dist/_pkg/url/neutral/index-neutral.mjs +12 -0
  277. package/dist/_pkg/url/neutral/index-node.d.ts +13 -0
  278. package/dist/_pkg/url/neutral/lib/index.d.ts +2 -0
  279. package/dist/_pkg/url/neutral/lib/isLocalhost.d.ts +7 -0
  280. package/dist/_pkg/url/node/index-browser.d.ts +12 -0
  281. package/dist/_pkg/url/node/index-neutral.d.ts +12 -0
  282. package/dist/_pkg/url/node/index-node.d.ts +13 -0
  283. package/dist/_pkg/url/node/index-node.mjs +15 -0
  284. package/dist/_pkg/url/node/lib/index.d.ts +2 -0
  285. package/dist/_pkg/url/node/lib/isLocalhost.d.ts +7 -0
  286. package/dist/_pkg/zod/neutral/Config.d.ts +8 -0
  287. package/dist/_pkg/zod/neutral/index.d.ts +8 -0
  288. package/dist/_pkg/zod/neutral/index.mjs +127 -0
  289. package/dist/_pkg/zod/neutral/model.d.ts +2 -0
  290. package/dist/_pkg/zod/neutral/model.mjs +1 -0
  291. package/dist/_pkg/zod/neutral/zodAllFactory.d.ts +20 -0
  292. package/dist/_pkg/zod/neutral/zodAsAsyncFactory.d.ts +14 -0
  293. package/dist/_pkg/zod/neutral/zodAsFactory.d.ts +14 -0
  294. package/dist/_pkg/zod/neutral/zodIsFactory.d.ts +8 -0
  295. package/dist/_pkg/zod/neutral/zodToAsyncFactory.d.ts +14 -0
  296. package/dist/_pkg/zod/neutral/zodToFactory.d.ts +14 -0
  297. package/dist/browser/index.d.ts +32 -0
  298. package/dist/browser/index.mjs +32 -0
  299. package/dist/browser/platform.d.ts +1 -0
  300. package/dist/browser/platform.mjs +1 -0
  301. package/dist/browser/url.d.ts +1 -0
  302. package/dist/browser/url.mjs +1 -0
  303. package/dist/neutral/api.d.ts +1 -0
  304. package/dist/neutral/api.mjs +1 -0
  305. package/dist/neutral/api.model.d.ts +1 -0
  306. package/dist/neutral/api.model.mjs +1 -0
  307. package/dist/neutral/array.d.ts +1 -0
  308. package/dist/neutral/array.mjs +1 -0
  309. package/dist/neutral/arraybuffer.d.ts +1 -0
  310. package/dist/neutral/arraybuffer.mjs +1 -0
  311. package/dist/neutral/assert.d.ts +1 -0
  312. package/dist/neutral/assert.mjs +1 -0
  313. package/dist/neutral/assert.model.d.ts +1 -0
  314. package/dist/neutral/assert.model.mjs +1 -0
  315. package/dist/neutral/base.d.ts +1 -0
  316. package/dist/neutral/base.mjs +1 -0
  317. package/dist/neutral/base.model.d.ts +1 -0
  318. package/dist/neutral/base.model.mjs +1 -0
  319. package/dist/neutral/creatable.d.ts +1 -0
  320. package/dist/neutral/creatable.mjs +1 -0
  321. package/dist/neutral/creatable.model.d.ts +1 -0
  322. package/dist/neutral/creatable.model.mjs +1 -0
  323. package/dist/neutral/decimal-precision.d.ts +1 -0
  324. package/dist/neutral/decimal-precision.mjs +1 -0
  325. package/dist/neutral/delay.d.ts +1 -0
  326. package/dist/neutral/delay.mjs +1 -0
  327. package/dist/neutral/ellipsize.d.ts +1 -0
  328. package/dist/neutral/ellipsize.mjs +1 -0
  329. package/dist/neutral/enum.d.ts +1 -0
  330. package/dist/neutral/enum.mjs +1 -0
  331. package/dist/neutral/enum.model.d.ts +1 -0
  332. package/dist/neutral/enum.model.mjs +1 -0
  333. package/dist/neutral/error.d.ts +1 -0
  334. package/dist/neutral/error.mjs +1 -0
  335. package/dist/neutral/error.model.d.ts +1 -0
  336. package/dist/neutral/error.model.mjs +1 -0
  337. package/dist/neutral/events.d.ts +1 -0
  338. package/dist/neutral/events.mjs +1 -0
  339. package/dist/neutral/events.model.d.ts +1 -0
  340. package/dist/neutral/events.model.mjs +1 -0
  341. package/dist/neutral/exists.d.ts +1 -0
  342. package/dist/neutral/exists.mjs +1 -0
  343. package/dist/neutral/fetch.d.ts +1 -0
  344. package/dist/neutral/fetch.mjs +1 -0
  345. package/dist/neutral/fetch.model.d.ts +1 -0
  346. package/dist/neutral/fetch.model.mjs +1 -0
  347. package/dist/neutral/forget.d.ts +1 -0
  348. package/dist/neutral/forget.mjs +1 -0
  349. package/dist/neutral/forget.model.d.ts +1 -0
  350. package/dist/neutral/forget.model.mjs +1 -0
  351. package/dist/neutral/function-name.d.ts +1 -0
  352. package/dist/neutral/function-name.mjs +1 -0
  353. package/dist/neutral/hex.d.ts +1 -0
  354. package/dist/neutral/hex.mjs +1 -0
  355. package/dist/neutral/hex.model.d.ts +1 -0
  356. package/dist/neutral/hex.model.mjs +1 -0
  357. package/dist/neutral/logger.d.ts +1 -0
  358. package/dist/neutral/logger.mjs +1 -0
  359. package/dist/neutral/model.d.ts +18 -0
  360. package/dist/neutral/model.mjs +18 -0
  361. package/dist/neutral/object.d.ts +1 -0
  362. package/dist/neutral/object.mjs +1 -0
  363. package/dist/neutral/object.model.d.ts +1 -0
  364. package/dist/neutral/object.model.mjs +1 -0
  365. package/dist/neutral/profile.d.ts +1 -0
  366. package/dist/neutral/profile.mjs +1 -0
  367. package/dist/neutral/profile.model.d.ts +1 -0
  368. package/dist/neutral/profile.model.mjs +1 -0
  369. package/dist/neutral/promise.d.ts +1 -0
  370. package/dist/neutral/promise.mjs +1 -0
  371. package/dist/neutral/promise.model.d.ts +1 -0
  372. package/dist/neutral/promise.model.mjs +1 -0
  373. package/dist/neutral/retry.d.ts +1 -0
  374. package/dist/neutral/retry.mjs +1 -0
  375. package/dist/neutral/retry.model.d.ts +1 -0
  376. package/dist/neutral/retry.model.mjs +1 -0
  377. package/dist/neutral/set.d.ts +1 -0
  378. package/dist/neutral/set.mjs +1 -0
  379. package/dist/neutral/static-implements.d.ts +1 -0
  380. package/dist/neutral/static-implements.mjs +1 -0
  381. package/dist/neutral/storage.d.ts +1 -0
  382. package/dist/neutral/storage.mjs +1 -0
  383. package/dist/neutral/storage.model.d.ts +1 -0
  384. package/dist/neutral/storage.model.mjs +1 -0
  385. package/dist/neutral/telemetry-exporter.d.ts +1 -0
  386. package/dist/neutral/telemetry-exporter.mjs +1 -0
  387. package/dist/neutral/telemetry.d.ts +1 -0
  388. package/dist/neutral/telemetry.mjs +1 -0
  389. package/dist/neutral/telemetry.model.d.ts +1 -0
  390. package/dist/neutral/telemetry.model.mjs +1 -0
  391. package/dist/neutral/timer.d.ts +1 -0
  392. package/dist/neutral/timer.mjs +1 -0
  393. package/dist/neutral/typeof.d.ts +1 -0
  394. package/dist/neutral/typeof.mjs +1 -0
  395. package/dist/neutral/typeof.model.d.ts +1 -0
  396. package/dist/neutral/typeof.model.mjs +1 -0
  397. package/dist/neutral/url.d.ts +1 -0
  398. package/dist/neutral/url.mjs +1 -0
  399. package/dist/neutral/zod.d.ts +1 -0
  400. package/dist/neutral/zod.mjs +1 -0
  401. package/dist/neutral/zod.model.d.ts +1 -0
  402. package/dist/neutral/zod.model.mjs +1 -0
  403. package/dist/node/index.d.ts +32 -0
  404. package/dist/node/index.mjs +32 -0
  405. package/dist/node/platform.d.ts +1 -0
  406. package/dist/node/platform.mjs +1 -0
  407. package/dist/node/url.d.ts +1 -0
  408. package/dist/node/url.mjs +1 -0
  409. package/package.json +339 -0
package/LICENSE ADDED
@@ -0,0 +1,165 @@
1
+ GNU LESSER GENERAL PUBLIC LICENSE
2
+ Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+ This version of the GNU Lesser General Public License incorporates
10
+ the terms and conditions of version 3 of the GNU General Public
11
+ License, supplemented by the additional permissions listed below.
12
+
13
+ 0. Additional Definitions.
14
+
15
+ As used herein, "this License" refers to version 3 of the GNU Lesser
16
+ General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+ General Public License.
18
+
19
+ "The Library" refers to a covered work governed by this License,
20
+ other than an Application or a Combined Work as defined below.
21
+
22
+ An "Application" is any work that makes use of an interface provided
23
+ by the Library, but which is not otherwise based on the Library.
24
+ Defining a subclass of a class defined by the Library is deemed a mode
25
+ of using an interface provided by the Library.
26
+
27
+ A "Combined Work" is a work produced by combining or linking an
28
+ Application with the Library. The particular version of the Library
29
+ with which the Combined Work was made is also called the "Linked
30
+ Version".
31
+
32
+ The "Minimal Corresponding Source" for a Combined Work means the
33
+ Corresponding Source for the Combined Work, excluding any source code
34
+ for portions of the Combined Work that, considered in isolation, are
35
+ based on the Application, and not on the Linked Version.
36
+
37
+ The "Corresponding Application Code" for a Combined Work means the
38
+ object code and/or source code for the Application, including any data
39
+ and utility programs needed for reproducing the Combined Work from the
40
+ Application, but excluding the System Libraries of the Combined Work.
41
+
42
+ 1. Exception to Section 3 of the GNU GPL.
43
+
44
+ You may convey a covered work under sections 3 and 4 of this License
45
+ without being bound by section 3 of the GNU GPL.
46
+
47
+ 2. Conveying Modified Versions.
48
+
49
+ If you modify a copy of the Library, and, in your modifications, a
50
+ facility refers to a function or data to be supplied by an Application
51
+ that uses the facility (other than as an argument passed when the
52
+ facility is invoked), then you may convey a copy of the modified
53
+ version:
54
+
55
+ a) under this License, provided that you make a good faith effort to
56
+ ensure that, in the event an Application does not supply the
57
+ function or data, the facility still operates, and performs
58
+ whatever part of its purpose remains meaningful, or
59
+
60
+ b) under the GNU GPL, with none of the additional permissions of
61
+ this License applicable to that copy.
62
+
63
+ 3. Object Code Incorporating Material from Library Header Files.
64
+
65
+ The object code form of an Application may incorporate material from
66
+ a header file that is part of the Library. You may convey such object
67
+ code under terms of your choice, provided that, if the incorporated
68
+ material is not limited to numerical parameters, data structure
69
+ layouts and accessors, or small macros, inline functions and templates
70
+ (ten or fewer lines in length), you do both of the following:
71
+
72
+ a) Give prominent notice with each copy of the object code that the
73
+ Library is used in it and that the Library and its use are
74
+ covered by this License.
75
+
76
+ b) Accompany the object code with a copy of the GNU GPL and this license
77
+ document.
78
+
79
+ 4. Combined Works.
80
+
81
+ You may convey a Combined Work under terms of your choice that,
82
+ taken together, effectively do not restrict modification of the
83
+ portions of the Library contained in the Combined Work and reverse
84
+ engineering for debugging such modifications, if you also do each of
85
+ the following:
86
+
87
+ a) Give prominent notice with each copy of the Combined Work that
88
+ the Library is used in it and that the Library and its use are
89
+ covered by this License.
90
+
91
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+ document.
93
+
94
+ c) For a Combined Work that displays copyright notices during
95
+ execution, include the copyright notice for the Library among
96
+ these notices, as well as a reference directing the user to the
97
+ copies of the GNU GPL and this license document.
98
+
99
+ d) Do one of the following:
100
+
101
+ 0) Convey the Minimal Corresponding Source under the terms of this
102
+ License, and the Corresponding Application Code in a form
103
+ suitable for, and under terms that permit, the user to
104
+ recombine or relink the Application with a modified version of
105
+ the Linked Version to produce a modified Combined Work, in the
106
+ manner specified by section 6 of the GNU GPL for conveying
107
+ Corresponding Source.
108
+
109
+ 1) Use a suitable shared library mechanism for linking with the
110
+ Library. A suitable mechanism is one that (a) uses at run time
111
+ a copy of the Library already present on the user's computer
112
+ system, and (b) will operate properly with a modified version
113
+ of the Library that is interface-compatible with the Linked
114
+ Version.
115
+
116
+ e) Provide Installation Information, but only if you would otherwise
117
+ be required to provide such information under section 6 of the
118
+ GNU GPL, and only to the extent that such information is
119
+ necessary to install and execute a modified version of the
120
+ Combined Work produced by recombining or relinking the
121
+ Application with a modified version of the Linked Version. (If
122
+ you use option 4d0, the Installation Information must accompany
123
+ the Minimal Corresponding Source and Corresponding Application
124
+ Code. If you use option 4d1, you must provide the Installation
125
+ Information in the manner specified by section 6 of the GNU GPL
126
+ for conveying Corresponding Source.)
127
+
128
+ 5. Combined Libraries.
129
+
130
+ You may place library facilities that are a work based on the
131
+ Library side by side in a single library together with other library
132
+ facilities that are not Applications and are not covered by this
133
+ License, and convey such a combined library under terms of your
134
+ choice, if you do both of the following:
135
+
136
+ a) Accompany the combined library with a copy of the same work based
137
+ on the Library, uncombined with any other library facilities,
138
+ conveyed under the terms of this License.
139
+
140
+ b) Give prominent notice with the combined library that part of it
141
+ is a work based on the Library, and explaining where to find the
142
+ accompanying uncombined form of the same work.
143
+
144
+ 6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+ The Free Software Foundation may publish revised and/or new versions
147
+ of the GNU Lesser General Public License from time to time. Such new
148
+ versions will be similar in spirit to the present version, but may
149
+ differ in detail to address new problems or concerns.
150
+
151
+ Each version is given a distinguishing version number. If the
152
+ Library as you received it specifies that a certain numbered version
153
+ of the GNU Lesser General Public License "or any later version"
154
+ applies to it, you have the option of following the terms and
155
+ conditions either of that published version or of any later version
156
+ published by the Free Software Foundation. If the Library as you
157
+ received it does not specify a version number of the GNU Lesser
158
+ General Public License, you may choose any version of the GNU Lesser
159
+ General Public License ever published by the Free Software Foundation.
160
+
161
+ If the Library as you received it specifies that a proxy can decide
162
+ whether future versions of the GNU Lesser General Public License shall
163
+ apply, that proxy's public statement of acceptance of any version is
164
+ permanent authorization for you to choose that version for the
165
+ Library.
package/README.md ADDED
@@ -0,0 +1,45 @@
1
+ # @ariestools/sdk
2
+
3
+ All-in-one umbrella for the Aries Tools TypeScript/JavaScript utility libraries.
4
+
5
+ Import the whole SDK:
6
+
7
+ ```ts
8
+ import { fetchJson } from '@ariestools/sdk'
9
+ ```
10
+
11
+ …or a single slice via a subpath export (tree-shaking-friendly — you only pay for what
12
+ you import):
13
+
14
+ ```ts
15
+ import { fetchJson } from '@ariestools/sdk/fetch'
16
+ import { assertEx } from '@ariestools/sdk/assert'
17
+ import type { ApiConfig } from '@ariestools/sdk/api/model'
18
+ ```
19
+
20
+ `@xylabs/sdk` remains published as a backward-compatibility re-export shim of this package.
21
+
22
+ ## Self-contained build
23
+
24
+ `@ariestools/sdk` is **self-contained**: its published `dist/` vendors the compiled output of
25
+ each barreled package (under `dist/_pkg/`), with cross-package `@xylabs/*` imports rewritten
26
+ to relative paths. At runtime it depends only on the real externals
27
+ (`async-mutex`, `zod`, `@opentelemetry/*`), declared as `peerDependencies`. The individual
28
+ `@xylabs/*` packages are build-time inputs only (`devDependencies`).
29
+
30
+ The vendoring is performed by [`scripts/populate-dist.mjs`](scripts/populate-dist.mjs),
31
+ wired into the toolchain via a local **`package-compile`** script in `package.json`. The
32
+ `xy` CLI defers to a package's own `package-compile` script during the compile **emit**
33
+ phase (the built-in still runs the `--validate-only` tsc pre-pass over `src/`). Because the
34
+ emit phase runs topologically over dependencies, every barreled package's `dist/` is built
35
+ before this package vendors it. So the normal commands just work — no manual step:
36
+
37
+ ```sh
38
+ pnpm xy build # compiles all packages, then vendors @ariestools/sdk
39
+ pnpm xy build @ariestools/sdk # vendors using the already-compiled sub-package dist
40
+ ```
41
+
42
+ To run the toolchain's built-in compile instead of this override (e.g. for debugging), pass
43
+ `--no-defer`. This mechanism is a local prototype; it is intended to move into
44
+ `@xylabs/toolchain` as a first-class compile mode (so the `package-compile` shim is no longer
45
+ needed).
@@ -0,0 +1,10 @@
1
+ import { ApiStage } from './ApiStage.ts';
2
+ /** Abstract base class for API clients that provides stage and token configuration. */
3
+ declare abstract class ApiClient {
4
+ protected stage?: ApiStage;
5
+ protected token?: string | null;
6
+ constructor(token?: string | null, stage?: ApiStage);
7
+ abstract endPoint(): string;
8
+ }
9
+ export { ApiClient };
10
+ //# sourceMappingURL=ApiClient.d.ts.map
@@ -0,0 +1,9 @@
1
+ /** Configuration for connecting to an API, including domain, authentication, and user identification. */
2
+ interface ApiConfig {
3
+ apiDomain: string;
4
+ apiKey?: string;
5
+ jwtToken?: string;
6
+ userid?: string;
7
+ }
8
+ export type { ApiConfig };
9
+ //# sourceMappingURL=ApiConfig.d.ts.map
@@ -0,0 +1,19 @@
1
+ import type { ApiConfig } from './ApiConfig.ts';
2
+ /**
3
+ * Generic REST API endpoint wrapper that supports fetching and inserting typed data.
4
+ * @typeParam T - The type of data returned by the endpoint
5
+ */
6
+ declare class ApiEndpoint<T> {
7
+ private _value?;
8
+ private config;
9
+ private path;
10
+ constructor(config: ApiConfig, path: string);
11
+ get value(): T | undefined;
12
+ private get headers();
13
+ private get url();
14
+ fetch(): Promise<T | undefined>;
15
+ get(): Promise<T | NonNullable<T> | undefined>;
16
+ insert(value: T): Promise<T | undefined>;
17
+ }
18
+ export { ApiEndpoint };
19
+ //# sourceMappingURL=ApiEndpoint.d.ts.map
@@ -0,0 +1,11 @@
1
+ import type { EnumValue } from '../../enum/neutral/index.ts';
2
+ import { Enum } from '../../enum/neutral/index.ts';
3
+ /** Deployment stage identifiers for API environments. */
4
+ export declare const ApiStage: Enum<{
5
+ Beta: "beta";
6
+ Local: "local";
7
+ Prod: "prod";
8
+ }>;
9
+ /** A valid API stage value ('prod', 'beta', or 'local'). */
10
+ export type ApiStage = EnumValue<typeof ApiStage>;
11
+ //# sourceMappingURL=ApiStage.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Determines the API stage based on the hostname.
3
+ * @param hostname - The hostname to evaluate
4
+ * @returns The corresponding ApiStage (Local, Beta, or Prod)
5
+ */
6
+ declare const getApiStage: (hostname: string) => "beta" | "local" | "prod";
7
+ export { getApiStage };
8
+ //# sourceMappingURL=getApiStage.d.ts.map
@@ -0,0 +1,6 @@
1
+ export * from './ApiClient.ts';
2
+ export * from './ApiConfig.ts';
3
+ export * from './ApiEndpoint.ts';
4
+ export * from './ApiStage.ts';
5
+ export * from './getApiStage.ts';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,78 @@
1
+ // src/ApiStage.ts
2
+ import { Enum } from "../../enum/neutral/index.mjs";
3
+ var ApiStage = Enum({
4
+ Beta: "beta",
5
+ Local: "local",
6
+ Prod: "prod"
7
+ });
8
+
9
+ // src/ApiClient.ts
10
+ var ApiClient = class {
11
+ stage;
12
+ token;
13
+ constructor(token, stage) {
14
+ this.stage = stage ?? ApiStage.Prod;
15
+ this.token = token;
16
+ }
17
+ };
18
+
19
+ // src/ApiEndpoint.ts
20
+ import { fetchJsonGet, fetchJsonPost } from "../../fetch/neutral/index.mjs";
21
+ import { isUndefined } from "../../typeof/neutral/index.mjs";
22
+ var ApiEndpoint = class {
23
+ _value;
24
+ config;
25
+ path;
26
+ constructor(config, path) {
27
+ this.config = config;
28
+ this.path = path;
29
+ }
30
+ get value() {
31
+ return this._value;
32
+ }
33
+ get headers() {
34
+ return isUndefined(this.config.jwtToken) ? void 0 : { Authorization: this.config.jwtToken };
35
+ }
36
+ get url() {
37
+ return `${this.config.apiDomain}/${this.path}`;
38
+ }
39
+ async fetch() {
40
+ const response = await fetchJsonGet(this.url, { headers: this.headers });
41
+ if (response.status === 200) {
42
+ this._value = response.data ?? void 0;
43
+ } else {
44
+ throw new Error("Unexpected Status Code");
45
+ }
46
+ return this._value;
47
+ }
48
+ async get() {
49
+ return this._value ?? await this.fetch();
50
+ }
51
+ async insert(value) {
52
+ const response = await fetchJsonPost(this.url, value, { headers: this.headers });
53
+ if (response.status === 200) {
54
+ this._value = response.data ?? void 0;
55
+ } else {
56
+ throw new Error("Unexpected Status Code");
57
+ }
58
+ return this._value;
59
+ }
60
+ };
61
+
62
+ // src/getApiStage.ts
63
+ var getApiStage = (hostname) => {
64
+ if (hostname.startsWith("localhost")) {
65
+ return ApiStage.Local;
66
+ }
67
+ if (hostname.startsWith("beta.")) {
68
+ return ApiStage.Beta;
69
+ }
70
+ return ApiStage.Prod;
71
+ };
72
+ export {
73
+ ApiClient,
74
+ ApiEndpoint,
75
+ ApiStage,
76
+ getApiStage
77
+ };
78
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,3 @@
1
+ export type * from './ApiConfig.ts';
2
+ export type { ApiStage } from './ApiStage.ts';
3
+ //# sourceMappingURL=model.d.ts.map
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=model.mjs.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Checks whether the source array contains every element in the target array.
3
+ * @param source - The array to search within
4
+ * @param target - The elements that must all be present
5
+ * @returns True if every target element exists in source
6
+ */
7
+ export declare const containsAll: <T>(source: T[], target: T[]) => boolean;
8
+ //# sourceMappingURL=containsAll.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Array filter callback that removes duplicate values, with correct NaN handling.
3
+ * Use with `array.filter(distinct)`.
4
+ */
5
+ export declare const distinct: <T>(value: T, index: number, array: T[]) => boolean;
6
+ //# sourceMappingURL=distinct.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Maps each element using the predicate and filters out nullish results.
3
+ * @param x - The input array
4
+ * @param predicate - Transform function applied to each element
5
+ * @returns Array of non-nullish transformed values
6
+ */
7
+ export declare const filterAs: <In, Out>(x: In[], predicate: (a: In) => Out) => NonNullable<Out>[];
8
+ //# sourceMappingURL=filterAs.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Returns the elements of an array that meet the condition specified in a callback function.
3
+ * @param array The array to filter.
4
+ * @param predicate A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array.
5
+ * @param concurrency Maximum number of predicates to run in parallel.
6
+ * @returns The elements of an array that meet the condition specified in a callback function.
7
+ */
8
+ export declare const filterAsync: <T>(array: T[], predicate: (value: T, index: number, array: T[]) => Promise<boolean>, concurrency?: number) => Promise<T[]>;
9
+ //# sourceMappingURL=filterAsync.d.ts.map
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Maps each element using the predicate and returns the first non-nullish result.
3
+ * @param x - The input array
4
+ * @param predicate - Transform function applied to each element
5
+ * @returns The first non-nullish transformed value, or undefined
6
+ */
7
+ export declare const findAs: <In, Out>(x: In[], predicate: (a: In) => Out) => NonNullable<Out> | undefined;
8
+ /**
9
+ * Maps each element using the predicate and returns the last non-nullish result.
10
+ * @param x - The input array
11
+ * @param predicate - Transform function applied to each element
12
+ * @returns The last non-nullish transformed value, or undefined
13
+ */
14
+ export declare const findLastAs: <In, Out>(x: In[], predicate: (a: In) => Out) => NonNullable<Out> | undefined;
15
+ //# sourceMappingURL=findAs.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Concatenates two values or arrays into a single flat array, filtering out nullish entries.
3
+ * @param a - First value or array
4
+ * @param b - Second value or array
5
+ * @returns A flat array of non-nullish elements
6
+ */
7
+ export declare const flatten: <T>(a?: T | ConcatArray<T>, b?: T | ConcatArray<T>) => T[];
8
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1,8 @@
1
+ export * from './containsAll.ts';
2
+ export * from './distinct.ts';
3
+ export * from './filterAs.ts';
4
+ export * from './filterAsync.ts';
5
+ export * from './findAs.ts';
6
+ export * from './flatten.ts';
7
+ export * from './uniq.ts';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,80 @@
1
+ // src/containsAll.ts
2
+ var containsAll = (source, target) => target.every((i) => source.includes(i));
3
+
4
+ // src/distinct.ts
5
+ var distinct = (value, index, array) => {
6
+ if (Number.isNaN(value)) {
7
+ return array.findIndex((item) => Number.isNaN(item)) === index;
8
+ }
9
+ return array.indexOf(value) === index;
10
+ };
11
+
12
+ // src/filterAs.ts
13
+ import { exists } from "../../exists/neutral/index.mjs";
14
+ var filterAs = (x, predicate) => {
15
+ return x.map(predicate).filter(exists);
16
+ };
17
+
18
+ // src/filterAsync.ts
19
+ var filterAsync = async (array, predicate, concurrency = 16) => {
20
+ if (array.length === 0) {
21
+ return [];
22
+ }
23
+ const results = Array.from({ length: array.length });
24
+ let nextIndex = 0;
25
+ const limit = Math.max(1, concurrency);
26
+ const worker = async () => {
27
+ while (true) {
28
+ const index = nextIndex++;
29
+ if (index >= array.length) {
30
+ return;
31
+ }
32
+ results[index] = await predicate(array[index], index, array);
33
+ }
34
+ };
35
+ await Promise.all(Array.from({ length: Math.min(limit, array.length) }, () => worker()));
36
+ return array.filter((_, index) => results[index]);
37
+ };
38
+
39
+ // src/findAs.ts
40
+ import { exists as exists2 } from "../../exists/neutral/index.mjs";
41
+ var findAs = (x, predicate) => {
42
+ return x.map(predicate).find(exists2);
43
+ };
44
+ var findLastAs = (x, predicate) => {
45
+ return x.map(predicate).findLast(exists2);
46
+ };
47
+
48
+ // src/flatten.ts
49
+ import { exists as exists3 } from "../../exists/neutral/index.mjs";
50
+ var flatten = (a, b) => {
51
+ return [].concat(a).concat(b).filter(exists3);
52
+ };
53
+
54
+ // src/uniq.ts
55
+ var uniq = (arr) => {
56
+ return [...new Set(arr)];
57
+ };
58
+ var uniqBy = (arr, iteratee) => {
59
+ const seen = /* @__PURE__ */ new Set();
60
+ return arr.filter((item) => {
61
+ const key = iteratee(item);
62
+ if (!seen.has(key)) {
63
+ seen.add(key);
64
+ return true;
65
+ }
66
+ return false;
67
+ });
68
+ };
69
+ export {
70
+ containsAll,
71
+ distinct,
72
+ filterAs,
73
+ filterAsync,
74
+ findAs,
75
+ findLastAs,
76
+ flatten,
77
+ uniq,
78
+ uniqBy
79
+ };
80
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns a new array with duplicate values removed.
3
+ * @param arr - The input array
4
+ * @returns A deduplicated array
5
+ */
6
+ export declare const uniq: <T>(arr: T[]) => T[];
7
+ /**
8
+ * Returns a new array with duplicates removed, using a key function for comparison.
9
+ * @param arr - The input array
10
+ * @param iteratee - Function that returns the key to compare by
11
+ * @returns A deduplicated array keeping the first occurrence of each key
12
+ */
13
+ export declare const uniqBy: <T, I>(arr: T[], iteratee: (item: T) => I) => T[];
14
+ //# sourceMappingURL=uniq.d.ts.map
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Compares two ArrayBuffers for byte-level equality.
3
+ * @param a1 - First buffer
4
+ * @param a2 - Second buffer
5
+ * @returns True if the buffers have the same length and identical bytes
6
+ */
7
+ export declare const equalArrayBuffers: (a1: ArrayBufferLike, a2: ArrayBufferLike) => boolean;
8
+ //# sourceMappingURL=equalArrayBuffers.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './equalArrayBuffers.ts';
2
+ export * from './isArrayBuffer.ts';
3
+ export * from './toArrayBuffer.ts';
4
+ export * from './toUint8Array.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,74 @@
1
+ // src/equalArrayBuffers.ts
2
+ var equalArrayBuffers = (a1, a2) => {
3
+ const u1 = new Uint8Array(a1);
4
+ const u2 = new Uint8Array(a2);
5
+ if (u1.byteLength !== u2.byteLength) return false;
6
+ for (let i = 0; i < u1.byteLength; i++) {
7
+ if (u1[i] !== u2[i]) return false;
8
+ }
9
+ return true;
10
+ };
11
+
12
+ // src/isArrayBuffer.ts
13
+ function isArrayBuffer(value) {
14
+ return value instanceof ArrayBuffer;
15
+ }
16
+ function isArrayBufferLike(value) {
17
+ return value !== null && typeof value === "object" && "byteLength" in value && typeof value.byteLength === "number" && "slice" in value && typeof value.slice === "function";
18
+ }
19
+
20
+ // src/toArrayBuffer.ts
21
+ import { assertEx } from "../../assert/neutral/index.mjs";
22
+ import { toHex } from "../../hex/neutral/index.mjs";
23
+ import { isUndefined } from "../../typeof/neutral/index.mjs";
24
+ function hexToArrayBuffer(value) {
25
+ if (value.length % 2 !== 0) {
26
+ throw new Error("Invalid hex value");
27
+ }
28
+ const length = value.length / 2;
29
+ const result = new Uint8Array(new ArrayBuffer(length));
30
+ for (let i = 0; i < length; i++) {
31
+ const byte = value.slice(i * 2, i * 2 + 2);
32
+ result[i] = Number.parseInt(byte, 16);
33
+ }
34
+ return result;
35
+ }
36
+ function stringToArrayBuffer(value, base = 16) {
37
+ switch (base) {
38
+ case 16: {
39
+ return hexToArrayBuffer(toHex((value.startsWith("0x") ? value.slice(2) : value).toUpperCase()));
40
+ }
41
+ default: {
42
+ throw new Error(`Unsupported base [${base}]`);
43
+ }
44
+ }
45
+ }
46
+ function toArrayBuffer(value, padLength = 0, base) {
47
+ if (isUndefined(value)) return void 0;
48
+ if (typeof value === "bigint" && value < 0) {
49
+ throw new Error(`negative bigint values are not supported: ${typeof value}`);
50
+ }
51
+ let result = typeof value === "string" ? stringToArrayBuffer(value, base) : typeof value === "bigint" ? stringToArrayBuffer(value.toString(16)) : new Uint8Array(value);
52
+ if (result === void 0) {
53
+ throw new Error(`toArrayBuffer - Unknown type: ${typeof value}`);
54
+ }
55
+ if (result.length < padLength) {
56
+ result = new Uint8Array([...new Uint8Array(padLength - result.length), ...result]);
57
+ assertEx(result?.length <= padLength, () => "Resulting length is greater than padLength");
58
+ }
59
+ return result.buffer;
60
+ }
61
+
62
+ // src/toUint8Array.ts
63
+ function toUint8Array(value, padLength, base) {
64
+ const arrayBuffer = toArrayBuffer(value, padLength, base);
65
+ return arrayBuffer ? new Uint8Array(arrayBuffer) : void 0;
66
+ }
67
+ export {
68
+ equalArrayBuffers,
69
+ isArrayBuffer,
70
+ isArrayBufferLike,
71
+ toArrayBuffer,
72
+ toUint8Array
73
+ };
74
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ /** Type guard that checks if a value is an ArrayBuffer instance. */
2
+ export declare function isArrayBuffer(value: unknown): value is ArrayBuffer;
3
+ export declare function isArrayBuffer<T extends ArrayBuffer>(value: T): value is Extract<T, ArrayBuffer>;
4
+ /** Type guard that checks if a value conforms to the ArrayBufferLike interface (has byteLength and slice). */
5
+ export declare function isArrayBufferLike(value: unknown): value is ArrayBufferLike;
6
+ export declare function isArrayBufferLike<T extends ArrayBufferLike>(value: T): value is Extract<T, ArrayBufferLike>;
7
+ //# sourceMappingURL=isArrayBuffer.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Converts a string, bigint, or ArrayBufferLike to an ArrayBufferLike, with optional zero-padding.
3
+ * @param value - The value to convert (hex string, bigint, or existing buffer)
4
+ * @param padLength - Minimum byte length, left-padded with zeros if needed
5
+ * @param base - Numeric base for string parsing (default 16)
6
+ * @returns The resulting ArrayBufferLike, or undefined if value is undefined
7
+ */
8
+ export declare function toArrayBuffer(value: undefined, padLength?: number, base?: number): undefined;
9
+ export declare function toArrayBuffer(value: ArrayBufferLike | bigint | string, padLength?: number, base?: number): ArrayBufferLike;
10
+ export declare function toArrayBuffer(value: ArrayBufferLike | bigint | string | undefined, padLength?: number, base?: number): ArrayBufferLike | undefined;
11
+ //# sourceMappingURL=toArrayBuffer.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Converts a string, bigint, or ArrayBufferLike to a Uint8Array, with optional zero-padding.
3
+ * @param value - The value to convert
4
+ * @param padLength - Minimum byte length, left-padded with zeros if needed
5
+ * @param base - Numeric base for string parsing (default 16)
6
+ * @returns The resulting Uint8Array, or undefined if value is undefined
7
+ */
8
+ export declare function toUint8Array(value: undefined, padLength?: number, base?: number): undefined;
9
+ export declare function toUint8Array(value: ArrayBufferLike | bigint | string, padLength?: number, base?: number): Uint8Array;
10
+ export declare function toUint8Array(value: ArrayBufferLike | bigint | string | undefined, padLength?: number, base?: number): Uint8Array | undefined;
11
+ //# sourceMappingURL=toUint8Array.d.ts.map