@sorisdk/matcher 0.1.0 → 0.1.2
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.
- package/LICENSE.md +50 -0
- package/README.md +27 -33
- package/dist/generated/core_bg.js +27 -27
- package/dist/generated/core_bg.wasm +0 -0
- package/package.json +4 -12
package/LICENSE.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Software Use License Agreement
|
|
2
|
+
|
|
3
|
+
Copyright (c) iPlateia Inc. All rights reserved.
|
|
4
|
+
|
|
5
|
+
This Software Use License Agreement ("Agreement") is a binding agreement between iPlateia Inc. ("Company") and the person or entity that installs, accesses, or uses this package ("Licensee").
|
|
6
|
+
|
|
7
|
+
By installing, copying, accessing, or using the package, Licensee agrees to be bound by this Agreement. If Licensee does not agree, Licensee must not install, access, or use the package.
|
|
8
|
+
|
|
9
|
+
1. Grant of License
|
|
10
|
+
|
|
11
|
+
Subject to Licensee's full compliance with this Agreement, the Company grants Licensee a limited, non-exclusive, non-transferable, non-sublicensable, revocable license to use the package in object code or compiled form solely for Licensee's internal business use or other use expressly authorized by the Company.
|
|
12
|
+
|
|
13
|
+
2. Restrictions
|
|
14
|
+
|
|
15
|
+
Licensee must not, and must not permit any third party to:
|
|
16
|
+
|
|
17
|
+
- modify, adapt, translate, alter, or create derivative works of the package;
|
|
18
|
+
- reverse engineer, decompile, disassemble, decode, or otherwise attempt to derive the source code, underlying ideas, algorithms, file formats, or trade secrets of the package, except to the limited extent such restriction is prohibited by mandatory law;
|
|
19
|
+
- copy, publish, distribute, transmit, disclose, sublicense, assign, sell, rent, lease, lend, transfer, pledge, or otherwise make the package available to any third party;
|
|
20
|
+
- remove, obscure, or alter any copyright, trademark, confidentiality, or proprietary notice contained in the package;
|
|
21
|
+
- use the package in violation of applicable law, public policy, or the Company's usage conditions;
|
|
22
|
+
- use the package to disclose survey content, logs, technical information, or other service-related information to any third party.
|
|
23
|
+
|
|
24
|
+
3. Ownership and Reservation of Rights
|
|
25
|
+
|
|
26
|
+
The package is licensed, not sold. The package, including all intellectual property rights in and to the package, remains the exclusive property of the Company and its licensors. No rights are granted except as expressly stated in this Agreement.
|
|
27
|
+
|
|
28
|
+
4. Confidentiality
|
|
29
|
+
|
|
30
|
+
Any non-public information obtained through access to or use of the package, including technical materials, performance information, documentation, data formats, and service-related content, is confidential. Licensee must keep such information strictly confidential and must not disclose it to any third party without the Company's prior written consent.
|
|
31
|
+
|
|
32
|
+
5. Changes, Suspension, and Termination
|
|
33
|
+
|
|
34
|
+
The Company may modify, suspend, restrict, or discontinue all or part of the package at any time if reasonably required for operational, technical, security, or business reasons. If Licensee breaches this Agreement, the Company may immediately suspend or terminate this Agreement and Licensee's right to use the package. Upon termination, Licensee must immediately stop using the package and delete all copies in Licensee's possession or control.
|
|
35
|
+
|
|
36
|
+
6. Disclaimer
|
|
37
|
+
|
|
38
|
+
To the maximum extent permitted by law, the package is provided on an "as is" and "as available" basis without warranties of any kind, whether express, implied, statutory, or otherwise, including any implied warranties of merchantability, fitness for a particular purpose, title, non-infringement, accuracy, availability, or uninterrupted operation.
|
|
39
|
+
|
|
40
|
+
7. Limitation of Liability
|
|
41
|
+
|
|
42
|
+
To the maximum extent permitted by law, the Company will not be liable for any indirect, incidental, special, consequential, exemplary, or punitive damages, or for any loss of profits, revenues, business, goodwill, data, or use, arising out of or related to this Agreement or the package, even if advised of the possibility of such damages.
|
|
43
|
+
|
|
44
|
+
8. Governing Law
|
|
45
|
+
|
|
46
|
+
This Agreement is governed by the laws of the Republic of Korea, without regard to conflict of laws principles.
|
|
47
|
+
|
|
48
|
+
9. Entire Agreement
|
|
49
|
+
|
|
50
|
+
This Agreement constitutes the entire agreement between Licensee and the Company regarding the package and supersedes all prior or contemporaneous understandings relating to the package.
|
package/README.md
CHANGED
|
@@ -1,23 +1,43 @@
|
|
|
1
1
|
# @sorisdk/matcher
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
WebAssembly package for matching fingerprint bytes against pack data in the browser.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Most web integrations should use `@sorisdk/web-audio` for a simpler end-to-end flow. This package is intended for lower-level cases where you want to control fingerprint generation and matching yourself.
|
|
6
|
+
|
|
7
|
+
Public integration guide: https://docs.soriapi.com/ko/integration/web
|
|
8
|
+
|
|
9
|
+
## Installation
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install @sorisdk/matcher
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Vite-based apps need `vite-plugin-wasm`.
|
|
16
|
+
|
|
17
|
+
## Minimal example
|
|
6
18
|
|
|
7
19
|
```ts
|
|
8
20
|
import { MatcherSession, AudioFingerprintType, initMatcher } from "@sorisdk/matcher";
|
|
9
21
|
|
|
10
22
|
await initMatcher();
|
|
23
|
+
|
|
11
24
|
const session = new MatcherSession();
|
|
12
25
|
await session.ready();
|
|
13
26
|
|
|
14
|
-
await session.addEntry(
|
|
15
|
-
|
|
27
|
+
await session.addEntry(
|
|
28
|
+
"demo-track",
|
|
29
|
+
AudioFingerprintType.Livestream,
|
|
30
|
+
new Uint8Array([1, 2, 3])
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
const result = await session.match(new Uint8Array([1, 2, 3]));
|
|
34
|
+
|
|
35
|
+
console.log(result.best);
|
|
16
36
|
```
|
|
17
37
|
|
|
18
|
-
|
|
38
|
+
## Pack loading
|
|
19
39
|
|
|
20
|
-
`loadPack` accepts:
|
|
40
|
+
`loadPack(...)` accepts:
|
|
21
41
|
|
|
22
42
|
- `Uint8Array`
|
|
23
43
|
- `ArrayBuffer`
|
|
@@ -27,30 +47,4 @@ const results = await session.match(new Uint8Array([1, 2, 3]));
|
|
|
27
47
|
- `string`
|
|
28
48
|
- `URL`
|
|
29
49
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
When you call `loadPack(...)`, the matcher package first performs an internal baseline-model load
|
|
33
|
-
step, then applies your account/material pack. This internal step is hidden from callers; the
|
|
34
|
-
public flow stays `initMatcher(...)` then `session.loadPack(yourPackSource)`.
|
|
35
|
-
|
|
36
|
-
### Events
|
|
37
|
-
|
|
38
|
-
- `ready`
|
|
39
|
-
- `packloadstart`
|
|
40
|
-
- `packload`
|
|
41
|
-
- `querystart`
|
|
42
|
-
- `match`
|
|
43
|
-
- `nomatch`
|
|
44
|
-
- `error`
|
|
45
|
-
- `destroy`
|
|
46
|
-
|
|
47
|
-
## Testing
|
|
48
|
-
|
|
49
|
-
```bash
|
|
50
|
-
pnpm --dir packages/matcher test
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
## Notes
|
|
54
|
-
|
|
55
|
-
- This package build emits wasm-bindgen output into `dist/generated/`.
|
|
56
|
-
- The same public API works on the main thread and in Dedicated Workers.
|
|
50
|
+
If you want campaign events and browser recognition flow on top of matching, use `@sorisdk/web-audio`.
|
|
@@ -149,11 +149,11 @@ if (Symbol.dispose) WasmMatcherEngine.prototype[Symbol.dispose] = WasmMatcherEng
|
|
|
149
149
|
export function init_matcher_wasm() {
|
|
150
150
|
wasm.init_matcher_wasm();
|
|
151
151
|
}
|
|
152
|
-
export function
|
|
152
|
+
export function __wbg_Error_2e59b1b37a9a34c3(arg0, arg1) {
|
|
153
153
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
154
154
|
return ret;
|
|
155
155
|
}
|
|
156
|
-
export function
|
|
156
|
+
export function __wbg_Number_e6ffdb596c888833(arg0) {
|
|
157
157
|
const ret = Number(arg0);
|
|
158
158
|
return ret;
|
|
159
159
|
}
|
|
@@ -164,46 +164,46 @@ export function __wbg_String_8564e559799eccda(arg0, arg1) {
|
|
|
164
164
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
165
165
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
166
166
|
}
|
|
167
|
-
export function
|
|
167
|
+
export function __wbg___wbindgen_boolean_get_a86c216575a75c30(arg0) {
|
|
168
168
|
const v = arg0;
|
|
169
169
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
170
170
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
171
171
|
}
|
|
172
|
-
export function
|
|
172
|
+
export function __wbg___wbindgen_debug_string_dd5d2d07ce9e6c57(arg0, arg1) {
|
|
173
173
|
const ret = debugString(arg1);
|
|
174
174
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
175
175
|
const len1 = WASM_VECTOR_LEN;
|
|
176
176
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
177
177
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
178
178
|
}
|
|
179
|
-
export function
|
|
179
|
+
export function __wbg___wbindgen_in_4bd7a57e54337366(arg0, arg1) {
|
|
180
180
|
const ret = arg0 in arg1;
|
|
181
181
|
return ret;
|
|
182
182
|
}
|
|
183
|
-
export function
|
|
183
|
+
export function __wbg___wbindgen_is_null_344c8750a8525473(arg0) {
|
|
184
184
|
const ret = arg0 === null;
|
|
185
185
|
return ret;
|
|
186
186
|
}
|
|
187
|
-
export function
|
|
187
|
+
export function __wbg___wbindgen_is_object_40c5a80572e8f9d3(arg0) {
|
|
188
188
|
const val = arg0;
|
|
189
189
|
const ret = typeof(val) === 'object' && val !== null;
|
|
190
190
|
return ret;
|
|
191
191
|
}
|
|
192
|
-
export function
|
|
192
|
+
export function __wbg___wbindgen_is_undefined_c0cca72b82b86f4d(arg0) {
|
|
193
193
|
const ret = arg0 === undefined;
|
|
194
194
|
return ret;
|
|
195
195
|
}
|
|
196
|
-
export function
|
|
196
|
+
export function __wbg___wbindgen_jsval_loose_eq_3a72ae764d46d944(arg0, arg1) {
|
|
197
197
|
const ret = arg0 == arg1;
|
|
198
198
|
return ret;
|
|
199
199
|
}
|
|
200
|
-
export function
|
|
200
|
+
export function __wbg___wbindgen_number_get_7579aab02a8a620c(arg0, arg1) {
|
|
201
201
|
const obj = arg1;
|
|
202
202
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
203
203
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
204
204
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
205
205
|
}
|
|
206
|
-
export function
|
|
206
|
+
export function __wbg___wbindgen_string_get_914df97fcfa788f2(arg0, arg1) {
|
|
207
207
|
const obj = arg1;
|
|
208
208
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
209
209
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -211,7 +211,7 @@ export function __wbg___wbindgen_string_get_395e606bd0ee4427(arg0, arg1) {
|
|
|
211
211
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
212
212
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
213
213
|
}
|
|
214
|
-
export function
|
|
214
|
+
export function __wbg___wbindgen_throw_81fc77679af83bc6(arg0, arg1) {
|
|
215
215
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
216
216
|
}
|
|
217
217
|
export function __wbg_error_a6fa202b58aa1cd3(arg0, arg1) {
|
|
@@ -229,7 +229,7 @@ export function __wbg_get_with_ref_key_6412cf3094599694(arg0, arg1) {
|
|
|
229
229
|
const ret = arg0[arg1];
|
|
230
230
|
return ret;
|
|
231
231
|
}
|
|
232
|
-
export function
|
|
232
|
+
export function __wbg_instanceof_ArrayBuffer_ff7c1337a5e3b33a(arg0) {
|
|
233
233
|
let result;
|
|
234
234
|
try {
|
|
235
235
|
result = arg0 instanceof ArrayBuffer;
|
|
@@ -239,7 +239,7 @@ export function __wbg_instanceof_ArrayBuffer_101e2bf31071a9f6(arg0) {
|
|
|
239
239
|
const ret = result;
|
|
240
240
|
return ret;
|
|
241
241
|
}
|
|
242
|
-
export function
|
|
242
|
+
export function __wbg_instanceof_Uint8Array_4b8da683deb25d72(arg0) {
|
|
243
243
|
let result;
|
|
244
244
|
try {
|
|
245
245
|
result = arg0 instanceof Uint8Array;
|
|
@@ -249,11 +249,11 @@ export function __wbg_instanceof_Uint8Array_740438561a5b956d(arg0) {
|
|
|
249
249
|
const ret = result;
|
|
250
250
|
return ret;
|
|
251
251
|
}
|
|
252
|
-
export function
|
|
252
|
+
export function __wbg_isSafeInteger_ea83862ba994770c(arg0) {
|
|
253
253
|
const ret = Number.isSafeInteger(arg0);
|
|
254
254
|
return ret;
|
|
255
255
|
}
|
|
256
|
-
export function
|
|
256
|
+
export function __wbg_length_0c32cb8543c8e4c8(arg0) {
|
|
257
257
|
const ret = arg0.length;
|
|
258
258
|
return ret;
|
|
259
259
|
}
|
|
@@ -261,31 +261,31 @@ export function __wbg_new_227d7c05414eb861() {
|
|
|
261
261
|
const ret = new Error();
|
|
262
262
|
return ret;
|
|
263
263
|
}
|
|
264
|
-
export function
|
|
265
|
-
const ret = new
|
|
264
|
+
export function __wbg_new_4f9fafbb3909af72() {
|
|
265
|
+
const ret = new Object();
|
|
266
266
|
return ret;
|
|
267
267
|
}
|
|
268
|
-
export function
|
|
269
|
-
const ret = new
|
|
268
|
+
export function __wbg_new_a560378ea1240b14(arg0) {
|
|
269
|
+
const ret = new Uint8Array(arg0);
|
|
270
270
|
return ret;
|
|
271
271
|
}
|
|
272
|
-
export function
|
|
273
|
-
const ret = new
|
|
272
|
+
export function __wbg_new_f3c9df4f38f3f798() {
|
|
273
|
+
const ret = new Array();
|
|
274
274
|
return ret;
|
|
275
275
|
}
|
|
276
|
-
export function
|
|
276
|
+
export function __wbg_now_88621c9c9a4f3ffc() {
|
|
277
277
|
const ret = Date.now();
|
|
278
278
|
return ret;
|
|
279
279
|
}
|
|
280
|
-
export function
|
|
280
|
+
export function __wbg_prototypesetcall_3e05eb9545565046(arg0, arg1, arg2) {
|
|
281
281
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
282
282
|
}
|
|
283
|
-
export function __wbg_set_282384002438957f(arg0, arg1, arg2) {
|
|
284
|
-
arg0[arg1 >>> 0] = arg2;
|
|
285
|
-
}
|
|
286
283
|
export function __wbg_set_6be42768c690e380(arg0, arg1, arg2) {
|
|
287
284
|
arg0[arg1] = arg2;
|
|
288
285
|
}
|
|
286
|
+
export function __wbg_set_6c60b2e8ad0e9383(arg0, arg1, arg2) {
|
|
287
|
+
arg0[arg1 >>> 0] = arg2;
|
|
288
|
+
}
|
|
289
289
|
export function __wbg_stack_3b0d974bbf31e44f(arg0, arg1) {
|
|
290
290
|
const ret = arg1.stack;
|
|
291
291
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sorisdk/matcher",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Browser
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Browser WASM SDK for audio fingerprint matching",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -30,16 +30,8 @@
|
|
|
30
30
|
"matcher"
|
|
31
31
|
],
|
|
32
32
|
"author": "comfuture",
|
|
33
|
-
"license": "
|
|
34
|
-
"
|
|
35
|
-
"type": "git",
|
|
36
|
-
"url": "git+https://github.com/iplateia/nada.git",
|
|
37
|
-
"directory": "packages/matcher"
|
|
38
|
-
},
|
|
39
|
-
"homepage": "https://github.com/iplateia/nada/tree/main/packages/matcher",
|
|
40
|
-
"bugs": {
|
|
41
|
-
"url": "https://github.com/iplateia/nada/issues"
|
|
42
|
-
},
|
|
33
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
34
|
+
"homepage": "https://docs.soriapi.com/ko/integration/web",
|
|
43
35
|
"devDependencies": {
|
|
44
36
|
"tsup": "^8.5.0",
|
|
45
37
|
"typescript": "^5.8.3",
|