openchemlib-search-wasm 2.1.1 → 2.1.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 (78) hide show
  1. package/LICENSE +451 -25
  2. package/README.md +12 -5
  3. package/lib/functionKeys/index.d.ts +14 -80
  4. package/lib/functionKeys/index.js +3 -98
  5. package/lib/index.d.ts +118 -258
  6. package/lib/index.js +33 -327
  7. package/package.json +24 -32
  8. package/lib/functionKeys/dictionary.json +0 -72071
  9. package/lib/functionKeys/index.d.ts.map +0 -1
  10. package/lib/functionKeys/index.js.map +0 -1
  11. package/lib/functions.d.ts +0 -38
  12. package/lib/functions.d.ts.map +0 -1
  13. package/lib/functions.js +0 -54
  14. package/lib/functions.js.map +0 -1
  15. package/lib/hex.d.ts +0 -31
  16. package/lib/hex.d.ts.map +0 -1
  17. package/lib/hex.js +0 -41
  18. package/lib/hex.js.map +0 -1
  19. package/lib/index.d.ts.map +0 -1
  20. package/lib/index.js.map +0 -1
  21. package/lib/jpath.d.ts +0 -28
  22. package/lib/jpath.d.ts.map +0 -1
  23. package/lib/jpath.js +0 -73
  24. package/lib/jpath.js.map +0 -1
  25. package/lib/records.d.ts +0 -45
  26. package/lib/records.d.ts.map +0 -1
  27. package/lib/records.js +0 -96
  28. package/lib/records.js.map +0 -1
  29. package/lib/runSearch.d.ts +0 -41
  30. package/lib/runSearch.d.ts.map +0 -1
  31. package/lib/runSearch.js +0 -50
  32. package/lib/runSearch.js.map +0 -1
  33. package/lib/scan.d.ts +0 -159
  34. package/lib/scan.d.ts.map +0 -1
  35. package/lib/scan.js +0 -281
  36. package/lib/scan.js.map +0 -1
  37. package/lib/similaritySearch.d.ts +0 -28
  38. package/lib/similaritySearch.d.ts.map +0 -1
  39. package/lib/similaritySearch.js +0 -86
  40. package/lib/similaritySearch.js.map +0 -1
  41. package/lib/strongHash.d.ts +0 -9
  42. package/lib/strongHash.d.ts.map +0 -1
  43. package/lib/strongHash.js +0 -56
  44. package/lib/strongHash.js.map +0 -1
  45. package/lib/substructureSearch.d.ts +0 -29
  46. package/lib/substructureSearch.d.ts.map +0 -1
  47. package/lib/substructureSearch.js +0 -104
  48. package/lib/substructureSearch.js.map +0 -1
  49. package/lib/types.d.ts +0 -308
  50. package/lib/types.d.ts.map +0 -1
  51. package/lib/types.js +0 -52
  52. package/lib/types.js.map +0 -1
  53. package/lib/wasm/load.d.ts +0 -10
  54. package/lib/wasm/load.d.ts.map +0 -1
  55. package/lib/wasm/load.js +0 -50
  56. package/lib/wasm/load.js.map +0 -1
  57. package/lib/wasm/log.d.ts +0 -36
  58. package/lib/wasm/log.d.ts.map +0 -1
  59. package/lib/wasm/log.js +0 -52
  60. package/lib/wasm/log.js.map +0 -1
  61. package/src/functionKeys/index.ts +0 -181
  62. package/src/functions.ts +0 -56
  63. package/src/hex.ts +0 -43
  64. package/src/index.ts +0 -458
  65. package/src/jpath.ts +0 -77
  66. package/src/records.ts +0 -142
  67. package/src/runSearch.ts +0 -99
  68. package/src/scan.ts +0 -441
  69. package/src/similaritySearch.ts +0 -104
  70. package/src/strongHash.ts +0 -57
  71. package/src/substructureSearch.ts +0 -120
  72. package/src/types.ts +0 -403
  73. package/src/wasm/load.ts +0 -59
  74. package/src/wasm/log.ts +0 -66
  75. package/wasm/data.d.ts +0 -2
  76. package/wasm/data.js +0 -3
  77. package/wasm/runtime.d.ts +0 -31
  78. package/wasm/runtime.js +0 -30
package/LICENSE CHANGED
@@ -1,41 +1,467 @@
1
- BSD 3-Clause License
1
+ Copyright (c) 2026 Zakodium Sàrl
2
2
 
3
- Copyright (c) 2026 cheminfo
3
+ openchemlib-search-wasm is licensed under the Creative Commons
4
+ Attribution-NonCommercial-ShareAlike 4.0 International License
5
+ (CC BY-NC-SA 4.0), reproduced below, except for the third-party works listed at
6
+ the end of this file, which keep their own licences.
4
7
 
5
- Redistribution and use in source and binary forms, with or without
6
- modification, are permitted provided that the following conditions are met:
8
+ ================================================================================
7
9
 
8
- 1. Redistributions of source code must retain the above copyright notice, this
9
- list of conditions and the following disclaimer.
10
+ Attribution-NonCommercial-ShareAlike 4.0 International
11
+
12
+ =======================================================================
13
+
14
+ Creative Commons Corporation ("Creative Commons") is not a law firm and
15
+ does not provide legal services or legal advice. Distribution of
16
+ Creative Commons public licenses does not create a lawyer-client or
17
+ other relationship. Creative Commons makes its licenses and related
18
+ information available on an "as-is" basis. Creative Commons gives no
19
+ warranties regarding its licenses, any material licensed under their
20
+ terms and conditions, or any related information. Creative Commons
21
+ disclaims all liability for damages resulting from their use to the
22
+ fullest extent possible.
23
+
24
+ Using Creative Commons Public Licenses
25
+
26
+ Creative Commons public licenses provide a standard set of terms and
27
+ conditions that creators and other rights holders may use to share
28
+ original works of authorship and other material subject to copyright
29
+ and certain other rights specified in the public license below. The
30
+ following considerations are for informational purposes only, are not
31
+ exhaustive, and do not form part of our licenses.
32
+
33
+ Considerations for licensors: Our public licenses are
34
+ intended for use by those authorized to give the public
35
+ permission to use material in ways otherwise restricted by
36
+ copyright and certain other rights. Our licenses are
37
+ irrevocable. Licensors should read and understand the terms
38
+ and conditions of the license they choose before applying it.
39
+ Licensors should also secure all rights necessary before
40
+ applying our licenses so that the public can reuse the
41
+ material as expected. Licensors should clearly mark any
42
+ material not subject to the license. This includes other CC-
43
+ licensed material, or material used under an exception or
44
+ limitation to copyright. More considerations for licensors:
45
+ wiki.creativecommons.org/Considerations_for_licensors
46
+
47
+ Considerations for the public: By using one of our public
48
+ licenses, a licensor grants the public permission to use the
49
+ licensed material under specified terms and conditions. If
50
+ the licensor's permission is not necessary for any reason--for
51
+ example, because of any applicable exception or limitation to
52
+ copyright--then that use is not regulated by the license. Our
53
+ licenses grant only permissions under copyright and certain
54
+ other rights that a licensor has authority to grant. Use of
55
+ the licensed material may still be restricted for other
56
+ reasons, including because others have copyright or other
57
+ rights in the material. A licensor may make special requests,
58
+ such as asking that all changes be marked or described.
59
+ Although not required by our licenses, you are encouraged to
60
+ respect those requests where reasonable. More considerations
61
+ for the public:
62
+ wiki.creativecommons.org/Considerations_for_licensees
63
+
64
+ =======================================================================
65
+
66
+ Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International
67
+ Public License
68
+
69
+ By exercising the Licensed Rights (defined below), You accept and agree
70
+ to be bound by the terms and conditions of this Creative Commons
71
+ Attribution-NonCommercial-ShareAlike 4.0 International Public License
72
+ ("Public License"). To the extent this Public License may be
73
+ interpreted as a contract, You are granted the Licensed Rights in
74
+ consideration of Your acceptance of these terms and conditions, and the
75
+ Licensor grants You such rights in consideration of benefits the
76
+ Licensor receives from making the Licensed Material available under
77
+ these terms and conditions.
78
+
79
+
80
+ Section 1 -- Definitions.
81
+
82
+ a. Adapted Material means material subject to Copyright and Similar
83
+ Rights that is derived from or based upon the Licensed Material
84
+ and in which the Licensed Material is translated, altered,
85
+ arranged, transformed, or otherwise modified in a manner requiring
86
+ permission under the Copyright and Similar Rights held by the
87
+ Licensor. For purposes of this Public License, where the Licensed
88
+ Material is a musical work, performance, or sound recording,
89
+ Adapted Material is always produced where the Licensed Material is
90
+ synched in timed relation with a moving image.
91
+
92
+ b. Adapter's License means the license You apply to Your Copyright
93
+ and Similar Rights in Your contributions to Adapted Material in
94
+ accordance with the terms and conditions of this Public License.
95
+
96
+ c. BY-NC-SA Compatible License means a license listed at
97
+ creativecommons.org/compatiblelicenses, approved by Creative
98
+ Commons as essentially the equivalent of this Public License.
99
+
100
+ d. Copyright and Similar Rights means copyright and/or similar rights
101
+ closely related to copyright including, without limitation,
102
+ performance, broadcast, sound recording, and Sui Generis Database
103
+ Rights, without regard to how the rights are labeled or
104
+ categorized. For purposes of this Public License, the rights
105
+ specified in Section 2(b)(1)-(2) are not Copyright and Similar
106
+ Rights.
107
+
108
+ e. Effective Technological Measures means those measures that, in the
109
+ absence of proper authority, may not be circumvented under laws
110
+ fulfilling obligations under Article 11 of the WIPO Copyright
111
+ Treaty adopted on December 20, 1996, and/or similar international
112
+ agreements.
113
+
114
+ f. Exceptions and Limitations means fair use, fair dealing, and/or
115
+ any other exception or limitation to Copyright and Similar Rights
116
+ that applies to Your use of the Licensed Material.
117
+
118
+ g. License Elements means the license attributes listed in the name
119
+ of a Creative Commons Public License. The License Elements of this
120
+ Public License are Attribution, NonCommercial, and ShareAlike.
121
+
122
+ h. Licensed Material means the artistic or literary work, database,
123
+ or other material to which the Licensor applied this Public
124
+ License.
125
+
126
+ i. Licensed Rights means the rights granted to You subject to the
127
+ terms and conditions of this Public License, which are limited to
128
+ all Copyright and Similar Rights that apply to Your use of the
129
+ Licensed Material and that the Licensor has authority to license.
130
+
131
+ j. Licensor means the individual(s) or entity(ies) granting rights
132
+ under this Public License.
133
+
134
+ k. NonCommercial means not primarily intended for or directed towards
135
+ commercial advantage or monetary compensation. For purposes of
136
+ this Public License, the exchange of the Licensed Material for
137
+ other material subject to Copyright and Similar Rights by digital
138
+ file-sharing or similar means is NonCommercial provided there is
139
+ no payment of monetary compensation in connection with the
140
+ exchange.
141
+
142
+ l. Share means to provide material to the public by any means or
143
+ process that requires permission under the Licensed Rights, such
144
+ as reproduction, public display, public performance, distribution,
145
+ dissemination, communication, or importation, and to make material
146
+ available to the public including in ways that members of the
147
+ public may access the material from a place and at a time
148
+ individually chosen by them.
149
+
150
+ m. Sui Generis Database Rights means rights other than copyright
151
+ resulting from Directive 96/9/EC of the European Parliament and of
152
+ the Council of 11 March 1996 on the legal protection of databases,
153
+ as amended and/or succeeded, as well as other essentially
154
+ equivalent rights anywhere in the world.
155
+
156
+ n. You means the individual or entity exercising the Licensed Rights
157
+ under this Public License. Your has a corresponding meaning.
158
+
159
+
160
+ Section 2 -- Scope.
161
+
162
+ a. License grant.
163
+
164
+ 1. Subject to the terms and conditions of this Public License,
165
+ the Licensor hereby grants You a worldwide, royalty-free,
166
+ non-sublicensable, non-exclusive, irrevocable license to
167
+ exercise the Licensed Rights in the Licensed Material to:
168
+
169
+ a. reproduce and Share the Licensed Material, in whole or
170
+ in part, for NonCommercial purposes only; and
171
+
172
+ b. produce, reproduce, and Share Adapted Material for
173
+ NonCommercial purposes only.
174
+
175
+ 2. Exceptions and Limitations. For the avoidance of doubt, where
176
+ Exceptions and Limitations apply to Your use, this Public
177
+ License does not apply, and You do not need to comply with
178
+ its terms and conditions.
179
+
180
+ 3. Term. The term of this Public License is specified in Section
181
+ 6(a).
182
+
183
+ 4. Media and formats; technical modifications allowed. The
184
+ Licensor authorizes You to exercise the Licensed Rights in
185
+ all media and formats whether now known or hereafter created,
186
+ and to make technical modifications necessary to do so. The
187
+ Licensor waives and/or agrees not to assert any right or
188
+ authority to forbid You from making technical modifications
189
+ necessary to exercise the Licensed Rights, including
190
+ technical modifications necessary to circumvent Effective
191
+ Technological Measures. For purposes of this Public License,
192
+ simply making modifications authorized by this Section 2(a)
193
+ (4) never produces Adapted Material.
194
+
195
+ 5. Downstream recipients.
196
+
197
+ a. Offer from the Licensor -- Licensed Material. Every
198
+ recipient of the Licensed Material automatically
199
+ receives an offer from the Licensor to exercise the
200
+ Licensed Rights under the terms and conditions of this
201
+ Public License.
202
+
203
+ b. Additional offer from the Licensor -- Adapted Material.
204
+ Every recipient of Adapted Material from You
205
+ automatically receives an offer from the Licensor to
206
+ exercise the Licensed Rights in the Adapted Material
207
+ under the conditions of the Adapter's License You apply.
208
+
209
+ c. No downstream restrictions. You may not offer or impose
210
+ any additional or different terms or conditions on, or
211
+ apply any Effective Technological Measures to, the
212
+ Licensed Material if doing so restricts exercise of the
213
+ Licensed Rights by any recipient of the Licensed
214
+ Material.
215
+
216
+ 6. No endorsement. Nothing in this Public License constitutes or
217
+ may be construed as permission to assert or imply that You
218
+ are, or that Your use of the Licensed Material is, connected
219
+ with, or sponsored, endorsed, or granted official status by,
220
+ the Licensor or others designated to receive attribution as
221
+ provided in Section 3(a)(1)(A)(i).
222
+
223
+ b. Other rights.
224
+
225
+ 1. Moral rights, such as the right of integrity, are not
226
+ licensed under this Public License, nor are publicity,
227
+ privacy, and/or other similar personality rights; however, to
228
+ the extent possible, the Licensor waives and/or agrees not to
229
+ assert any such rights held by the Licensor to the limited
230
+ extent necessary to allow You to exercise the Licensed
231
+ Rights, but not otherwise.
232
+
233
+ 2. Patent and trademark rights are not licensed under this
234
+ Public License.
235
+
236
+ 3. To the extent possible, the Licensor waives any right to
237
+ collect royalties from You for the exercise of the Licensed
238
+ Rights, whether directly or through a collecting society
239
+ under any voluntary or waivable statutory or compulsory
240
+ licensing scheme. In all other cases the Licensor expressly
241
+ reserves any right to collect such royalties, including when
242
+ the Licensed Material is used other than for NonCommercial
243
+ purposes.
244
+
245
+
246
+ Section 3 -- License Conditions.
247
+
248
+ Your exercise of the Licensed Rights is expressly made subject to the
249
+ following conditions.
250
+
251
+ a. Attribution.
252
+
253
+ 1. If You Share the Licensed Material (including in modified
254
+ form), You must:
255
+
256
+ a. retain the following if it is supplied by the Licensor
257
+ with the Licensed Material:
258
+
259
+ i. identification of the creator(s) of the Licensed
260
+ Material and any others designated to receive
261
+ attribution, in any reasonable manner requested by
262
+ the Licensor (including by pseudonym if
263
+ designated);
264
+
265
+ ii. a copyright notice;
266
+
267
+ iii. a notice that refers to this Public License;
268
+
269
+ iv. a notice that refers to the disclaimer of
270
+ warranties;
271
+
272
+ v. a URI or hyperlink to the Licensed Material to the
273
+ extent reasonably practicable;
274
+
275
+ b. indicate if You modified the Licensed Material and
276
+ retain an indication of any previous modifications; and
277
+
278
+ c. indicate the Licensed Material is licensed under this
279
+ Public License, and include the text of, or the URI or
280
+ hyperlink to, this Public License.
281
+
282
+ 2. You may satisfy the conditions in Section 3(a)(1) in any
283
+ reasonable manner based on the medium, means, and context in
284
+ which You Share the Licensed Material. For example, it may be
285
+ reasonable to satisfy the conditions by providing a URI or
286
+ hyperlink to a resource that includes the required
287
+ information.
288
+ 3. If requested by the Licensor, You must remove any of the
289
+ information required by Section 3(a)(1)(A) to the extent
290
+ reasonably practicable.
291
+
292
+ b. ShareAlike.
10
293
 
11
- 2. Redistributions in binary form must reproduce the above copyright notice,
12
- this list of conditions and the following disclaimer in the documentation
13
- and/or other materials provided with the distribution.
294
+ In addition to the conditions in Section 3(a), if You Share
295
+ Adapted Material You produce, the following conditions also apply.
14
296
 
15
- 3. Neither the name of the copyright holder nor the names of its contributors
16
- may be used to endorse or promote products derived from this software
17
- without specific prior written permission.
297
+ 1. The Adapter's License You apply must be a Creative Commons
298
+ license with the same License Elements, this version or
299
+ later, or a BY-NC-SA Compatible License.
300
+
301
+ 2. You must include the text of, or the URI or hyperlink to, the
302
+ Adapter's License You apply. You may satisfy this condition
303
+ in any reasonable manner based on the medium, means, and
304
+ context in which You Share Adapted Material.
305
+
306
+ 3. You may not offer or impose any additional or different terms
307
+ or conditions on, or apply any Effective Technological
308
+ Measures to, Adapted Material that restrict exercise of the
309
+ rights granted under the Adapter's License You apply.
310
+
311
+
312
+ Section 4 -- Sui Generis Database Rights.
313
+
314
+ Where the Licensed Rights include Sui Generis Database Rights that
315
+ apply to Your use of the Licensed Material:
316
+
317
+ a. for the avoidance of doubt, Section 2(a)(1) grants You the right
318
+ to extract, reuse, reproduce, and Share all or a substantial
319
+ portion of the contents of the database for NonCommercial purposes
320
+ only;
321
+
322
+ b. if You include all or a substantial portion of the database
323
+ contents in a database in which You have Sui Generis Database
324
+ Rights, then the database in which You have Sui Generis Database
325
+ Rights (but not its individual contents) is Adapted Material,
326
+ including for purposes of Section 3(b); and
327
+
328
+ c. You must comply with the conditions in Section 3(a) if You Share
329
+ all or a substantial portion of the contents of the database.
330
+
331
+ For the avoidance of doubt, this Section 4 supplements and does not
332
+ replace Your obligations under this Public License where the Licensed
333
+ Rights include other Copyright and Similar Rights.
334
+
335
+
336
+ Section 5 -- Disclaimer of Warranties and Limitation of Liability.
337
+
338
+ a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
339
+ EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
340
+ AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
341
+ ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
342
+ IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
343
+ WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
344
+ PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
345
+ ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
346
+ KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
347
+ ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
348
+
349
+ b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
350
+ TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
351
+ NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
352
+ INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
353
+ COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
354
+ USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
355
+ ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
356
+ DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
357
+ IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
358
+
359
+ c. The disclaimer of warranties and limitation of liability provided
360
+ above shall be interpreted in a manner that, to the extent
361
+ possible, most closely approximates an absolute disclaimer and
362
+ waiver of all liability.
363
+
364
+
365
+ Section 6 -- Term and Termination.
366
+
367
+ a. This Public License applies for the term of the Copyright and
368
+ Similar Rights licensed here. However, if You fail to comply with
369
+ this Public License, then Your rights under this Public License
370
+ terminate automatically.
371
+
372
+ b. Where Your right to use the Licensed Material has terminated under
373
+ Section 6(a), it reinstates:
374
+
375
+ 1. automatically as of the date the violation is cured, provided
376
+ it is cured within 30 days of Your discovery of the
377
+ violation; or
378
+
379
+ 2. upon express reinstatement by the Licensor.
380
+
381
+ For the avoidance of doubt, this Section 6(b) does not affect any
382
+ right the Licensor may have to seek remedies for Your violations
383
+ of this Public License.
384
+
385
+ c. For the avoidance of doubt, the Licensor may also offer the
386
+ Licensed Material under separate terms or conditions or stop
387
+ distributing the Licensed Material at any time; however, doing so
388
+ will not terminate this Public License.
389
+
390
+ d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
391
+ License.
392
+
393
+
394
+ Section 7 -- Other Terms and Conditions.
395
+
396
+ a. The Licensor shall not be bound by any additional or different
397
+ terms or conditions communicated by You unless expressly agreed.
398
+
399
+ b. Any arrangements, understandings, or agreements regarding the
400
+ Licensed Material not stated herein are separate from and
401
+ independent of the terms and conditions of this Public License.
402
+
403
+
404
+ Section 8 -- Interpretation.
405
+
406
+ a. For the avoidance of doubt, this Public License does not, and
407
+ shall not be interpreted to, reduce, limit, restrict, or impose
408
+ conditions on any use of the Licensed Material that could lawfully
409
+ be made without permission under this Public License.
410
+
411
+ b. To the extent possible, if any provision of this Public License is
412
+ deemed unenforceable, it shall be automatically reformed to the
413
+ minimum extent necessary to make it enforceable. If the provision
414
+ cannot be reformed, it shall be severed from this Public License
415
+ without affecting the enforceability of the remaining terms and
416
+ conditions.
417
+
418
+ c. No term or condition of this Public License will be waived and no
419
+ failure to comply consented to unless expressly agreed to by the
420
+ Licensor.
421
+
422
+ d. Nothing in this Public License constitutes or may be interpreted
423
+ as a limitation upon, or waiver of, any privileges and immunities
424
+ that apply to the Licensor or You, including from the legal
425
+ processes of any jurisdiction or authority.
426
+
427
+ =======================================================================
428
+
429
+ Creative Commons is not a party to its public
430
+ licenses. Notwithstanding, Creative Commons may elect to apply one of
431
+ its public licenses to material it publishes and in those instances
432
+ will be considered the “Licensor.” The text of the Creative Commons
433
+ public licenses is dedicated to the public domain under the CC0 Public
434
+ Domain Dedication. Except for the limited purpose of indicating that
435
+ material is shared under a Creative Commons public license or as
436
+ otherwise permitted by the Creative Commons policies published at
437
+ creativecommons.org/policies, Creative Commons does not authorize the
438
+ use of the trademark "Creative Commons" or any other trademark or logo
439
+ of Creative Commons without its prior written consent including,
440
+ without limitation, in connection with any unauthorized modifications
441
+ to any of its public licenses or any other arrangements,
442
+ understandings, or agreements concerning use of licensed material. For
443
+ the avoidance of doubt, this paragraph does not form part of the
444
+ public licenses.
445
+
446
+ Creative Commons may be contacted at creativecommons.org.
18
447
 
19
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20
- ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21
- WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
- DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
- SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
- CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
- OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
- OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29
448
 
30
449
  ================================================================================
31
450
 
451
+ Third-party works
452
+
453
+ `java/overlay/` holds modified copies of OpenChemLib source files, which stay
454
+ under the OpenChemLib BSD 3-Clause License reproduced below.
455
+
32
456
  This package ships `wasm/data.js` and `wasm/runtime.js`, which are a binary
33
457
  distribution of two other works:
34
458
 
35
459
  * `wasm/data.js` is a WebAssembly module compiled from OpenChemLib
36
- (https://github.com/cheminfo/openchemlib) together with the parts of the
37
- TeaVM class library it reaches. OpenChemLib is distributed under the
38
- BSD 3-Clause License, reproduced below.
460
+ (https://github.com/cheminfo/openchemlib) and from the Java sources of
461
+ this package (`java/src`), together with the parts of the TeaVM class
462
+ library it reaches. The parts compiled from OpenChemLib are distributed
463
+ under the BSD 3-Clause License, and the parts from TeaVM under the Apache
464
+ License, Version 2.0, both reproduced below.
39
465
 
40
466
  * `wasm/runtime.js` is the TeaVM WebAssembly runtime
41
467
  (https://github.com/konsoletyper/teavm), version 0.14.1, copied verbatim
package/README.md CHANGED
@@ -3,6 +3,9 @@
3
3
  Batch substructure search, batch similarity search, FragFp fingerprints and identity hashes over
4
4
  arrays of OpenChemLib idcodes — with OpenChemLib compiled to WebAssembly.
5
5
 
6
+ > **Non-commercial use only.** This package is licensed under CC BY-NC-SA 4.0 and may
7
+ > not be used for commercial purposes. For a commercial licence, contact Zakodium Sàrl.
8
+
6
9
  ## Install
7
10
 
8
11
  ```sh
@@ -15,8 +18,8 @@ later, or a current browser; `SharedArrayBuffer` is needed only for the worker r
15
18
 
16
19
  Updating is a plain `npm update openchemlib-search-wasm` — a release carries its own OpenChemLib, so
17
20
  you never track one separately. **Building the module, and moving it to a newer OpenChemLib, is a
18
- maintainer job**: the `openchemlib` git submodule and the JDK it needs live in
19
- [CONTRIBUTING.md](CONTRIBUTING.md), not here.
21
+ maintainer job**: it needs the `openchemlib` git submodule and a JDK, neither of which ships in
22
+ this package.
20
23
 
21
24
  ## Use
22
25
 
@@ -506,8 +509,6 @@ only 1.7x faster; the graph match is 1.9x. Benchmarks that search molecules alre
506
509
  report 3–6x — this API is handed idcodes and pays the parse on every one. It is also **per core**:
507
510
  `openchemlib` parallelises across workers just as well.
508
511
 
509
- Full tables, and how each number was taken, in [benchmark/README.md](benchmark/README.md).
510
-
511
512
  ## When not to use it
512
513
 
513
514
  **You already store fingerprints.** `similaritySearch` builds the FragFp for every idcode, and that
@@ -519,7 +520,13 @@ anything is parsed, which is worth far more than 2x. Search the survivors, not t
519
520
 
520
521
  ## License
521
522
 
522
- BSD-3-Clause. The function-key dictionary adapts definitions from
523
+ © 2026 Zakodium Sàrl. This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike
524
+ 4.0 International License (CC BY-NC-SA 4.0), reproduced in the `LICENSE` file.
525
+
526
+ It may not be used for commercial purposes. For a commercial licence, contact Zakodium Sàrl.
527
+
528
+ The WebAssembly module includes OpenChemLib (BSD-3-Clause) and the TeaVM runtime (Apache-2.0), which
529
+ keep their own licences, given in `LICENSE`. The function-key dictionary adapts definitions from
523
530
  [ChemCaption](https://github.com/lamalab-org/chem-caption) (MIT),
524
531
  [AccFG](https://github.com/xuanliugit/AccFG) (MIT), [medchem](https://github.com/datamol-io/medchem)
525
532
  (Apache-2.0), [RDKit](https://github.com/rdkit/rdkit) (BSD-3-Clause) and
@@ -1,105 +1,39 @@
1
- /**
2
- * Where a key's answer comes from: one of the 512 function bits a record stores, a bit of the FragFp
3
- * or the screen that holds exactly the same molecules, or a substructure search run when asked.
4
- */
5
- export type FunctionKeyTier = 'stored' | 'existingPlane' | 'onDemand';
6
- /** One named function key: a functional group, a ring, a substituent, a natural product class. */
7
- export interface FunctionKey {
8
- /** Stable identifier. */
1
+ type FunctionKeyTier = 'stored' | 'existingPlane' | 'onDemand';
2
+ interface FunctionKey {
9
3
  id: string;
10
- /** The name to show. No other key carries it as name or synonym, case aside. */
11
4
  name: string;
12
- /** The other names it answers to, each also unique across the dictionary. */
13
5
  synonyms: string[];
14
- /** A key of {@link getFunctionCategories}. */
15
6
  category: string;
16
- /** A finer group within the category. */
17
7
  subcategory: string;
18
8
  tier: FunctionKeyTier;
19
- /** For a `stored` key: its bit in the function words, 0 to 511. */
20
9
  plane?: number;
21
- /** For an `existingPlane` key: the fingerprint holding its bit. */
22
10
  fingerprint?: 'fragFp' | 'screen';
23
- /** For an `existingPlane` key: its bit in that fingerprint, 0 to 511. */
24
11
  bit?: number;
25
- /** The share of the 1,034,054 PubChem molecules it was counted on that hold it. */
26
12
  prevalence: number;
27
- /** Where its definition comes from: keys of {@link getFunctionKeySources}. */
28
13
  sources: string[];
29
- /** The SMARTS it was compiled from, absent for a key given as an idcode. */
30
14
  smarts?: string;
31
- /**
32
- * Its query fragments, as idcodes: a molecule holds the key when it holds any of them, which is
33
- * what `substructureSearch(key.fragments, entries)` tests.
34
- */
35
15
  fragments: string[];
36
16
  }
37
- /** A source the dictionary's definitions come from, and the licence they are used under. */
38
- export interface FunctionKeySource {
17
+ interface FunctionKeySource {
39
18
  name: string;
40
19
  url: string;
41
20
  licence: string;
42
21
  }
43
- /** Where a key's bit sits in the 48-word record of `getMoleculeRecords`. */
44
- export interface RecordBit {
45
- /** The word of the record: FragFp words first, then the screen, then the function bits. */
22
+ interface RecordBit {
46
23
  word: number;
47
- /** The bit within that word. */
48
24
  mask: number;
49
25
  }
50
- /** What {@link searchFunctionKeys} takes. */
51
- export interface SearchFunctionKeysOptions {
52
- /**
53
- * Only the keys of this tier.
54
- * @default every tier
55
- */
26
+ interface SearchFunctionKeysOptions {
56
27
  tier?: FunctionKeyTier;
57
- /**
58
- * Only the keys of this category.
59
- * @default every category
60
- */
61
28
  category?: string;
62
- /**
63
- * The most keys to return.
64
- * @default no limit
65
- */
66
29
  limit?: number;
67
30
  }
68
- /**
69
- * Returns every function key: the 512 stored ones in bit order, then those equal to a FragFp or
70
- * screen bit, then those computed on demand, by category and prevalence.
71
- * @returns The keys. They are shared: do not modify them.
72
- */
73
- export declare function getFunctionKeys(): readonly FunctionKey[];
74
- /**
75
- * Finds a key by its id, its name or one of its synonyms, case aside.
76
- * @param nameOrId - What to look up, such as `thioether`, `Boc` or `pyridin_2_one`.
77
- * @returns The key, or undefined when nothing carries that name.
78
- */
79
- export declare function getFunctionKey(nameOrId: string): FunctionKey | undefined;
80
- /**
81
- * Finds the keys whose id, name or synonyms hold every word of a text, case aside: an exact name
82
- * first, then names starting with the text, then the rest, each by prevalence.
83
- * @param text - Words to look for, such as `aromatic amine` or `lactam`.
84
- * @param options - Narrows the result; see {@link SearchFunctionKeysOptions}.
85
- * @returns The matching keys, best first.
86
- */
87
- export declare function searchFunctionKeys(text: string, options?: SearchFunctionKeysOptions): FunctionKey[];
88
- /**
89
- * Returns the categories keys are grouped in, in display order.
90
- * @returns Category id to its title, such as `carbonyl` to `Carbonyl groups`.
91
- */
92
- export declare function getFunctionCategories(): Readonly<Record<string, string>>;
93
- /**
94
- * Returns the sources the definitions come from, with their licences, for attribution.
95
- * @returns Source id, as a key's `sources` names it, to its name, address and licence.
96
- */
97
- export declare function getFunctionKeySources(): Readonly<Record<string, FunctionKeySource>>;
98
- /**
99
- * Says where a key's answer sits in a record of `getMoleculeRecords`, so a stored record answers it
100
- * with one mask test: `(record[word] & mask) !== 0`.
101
- * @param key - The key.
102
- * @returns The word and mask, or undefined for a key computed on demand, which a record does not hold.
103
- */
104
- export declare function getRecordBit(key: FunctionKey): RecordBit | undefined;
105
- //# sourceMappingURL=index.d.ts.map
31
+ declare function getFunctionKeys(): readonly FunctionKey[];
32
+ declare function getFunctionKey(nameOrId: string): FunctionKey | undefined;
33
+ declare function searchFunctionKeys(text: string, options?: SearchFunctionKeysOptions): FunctionKey[];
34
+ declare function getFunctionCategories(): Readonly<Record<string, string>>;
35
+ declare function getFunctionKeySources(): Readonly<Record<string, FunctionKeySource>>;
36
+ declare function getRecordBit(key: FunctionKey): RecordBit | undefined;
37
+
38
+ export { getFunctionCategories, getFunctionKey, getFunctionKeySources, getFunctionKeys, getRecordBit, searchFunctionKeys };
39
+ export type { FunctionKey, FunctionKeySource, FunctionKeyTier, RecordBit, SearchFunctionKeysOptions };