crudjt 1.0.0-beta.0
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/.github/FUNDING.yml +15 -0
- package/.github/workflows/build.yml +42 -0
- package/CHANGELOG.md +12 -0
- package/Cache.js +82 -0
- package/Cargo.lock +176 -0
- package/Cargo.toml +16 -0
- package/LICENSE.txt +21 -0
- package/README.md +215 -0
- package/cargo.log +30 -0
- package/crudjt-1.0.0-beta.0.tgz +0 -0
- package/errors/internal_error.js +12 -0
- package/errors/invalid_state.js +12 -0
- package/errors.js +13 -0
- package/index.js +440 -0
- package/index.node +0 -0
- package/logos/buy_me_a_coffee_orange.svg +1 -0
- package/logos/crud_jt_logo.png +0 -0
- package/logos/crud_jt_logo_black.png +0 -0
- package/logos/crud_jt_logo_favicon_black.png +0 -0
- package/logos/crud_jt_logo_favicon_black_160.png +0 -0
- package/logos/crud_jt_logo_favicon_white.png +0 -0
- package/logos/crud_jt_logo_favicon_white_160.png +0 -0
- package/logos/crudjt_favicon_160x160_dark_on_white.svg +18 -0
- package/logos/crudjt_favicon_160x160_white.png +0 -0
- package/logos/crudjt_favicon_160x160_white_on_dark.svg +18 -0
- package/logos/crudjt_favicon_white_on_dark.png +0 -0
- package/logos/crudjt_logo_dark.png +0 -0
- package/logos/crudjt_logo_dark_on_white.svg +19 -0
- package/logos/crudjt_logo_white_on_dark.svg +26 -0
- package/native/linux/store_jt_arm64.so +0 -0
- package/native/linux/store_jt_x86_64.so +0 -0
- package/native/macos/store_jt_arm64.dylib +0 -0
- package/native/macos/store_jt_x86_64.dylib +0 -0
- package/native/windows/store_jt_arm64.dll +0 -0
- package/native/windows/store_jt_x86_64.dll +0 -0
- package/package/.github/workflows/build.yml +43 -0
- package/package/Cache.js +78 -0
- package/package/Cargo.lock +217 -0
- package/package/Cargo.toml +16 -0
- package/package/README.md +90 -0
- package/package/Validation.js +26 -0
- package/package/cargo.log +24 -0
- package/package/index.js +197 -0
- package/package/index.node +0 -0
- package/package/native/linux/store_jt_arm64.so +0 -0
- package/package/native/linux/store_jt_x86_64.so +0 -0
- package/package/native/macos/store_jt_arm64.dylib +0 -0
- package/package/native/macos/store_jt_x86_64.dylib +0 -0
- package/package/native/windows/store_jt_arm64.dll +0 -0
- package/package/native/windows/store_jt_x86_64.dll +0 -0
- package/package/package.json +26 -0
- package/package/src/lib.rs +190 -0
- package/package/test-neon-package/package-lock.json +942 -0
- package/package/test-neon-package/package.json +15 -0
- package/package/test-neon-package/test.js +178 -0
- package/package/test.js +202 -0
- package/package.json +41 -0
- package/src/lib.rs +288 -0
- package/test-neon-package/package-lock.json +1135 -0
- package/test-neon-package/package.json +15 -0
- package/test-neon-package/test.js +198 -0
- package/token_service.proto +47 -0
- package/token_service_client.js +33 -0
- package/validation.js +72 -0
package/cargo.log
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.103","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.103/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.103/build.rs","edition":"2021","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","proc-macro"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/proc-macro2-d1ff144aa80a17a8/build-script-build"],"executable":null,"fresh":true}
|
|
2
|
+
{"reason":"build-script-executed","package_id":"registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.103","linked_libs":[],"linked_paths":[],"cfgs":["wrap_proc_macro","proc_macro_span_location","proc_macro_span_file"],"env":[],"out_dir":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/proc-macro2-1d9ce708f00c16ea/out"}
|
|
3
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#unicode-ident@1.0.20","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-ident-1.0.20/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"unicode_ident","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/unicode-ident-1.0.20/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libunicode_ident-ae5c216883792e03.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libunicode_ident-ae5c216883792e03.rmeta"],"executable":null,"fresh":true}
|
|
4
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#quote@1.0.41","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.41/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.41/build.rs","edition":"2018","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","proc-macro"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/quote-cde3c9731b3119d5/build-script-build"],"executable":null,"fresh":true}
|
|
5
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme-impl@0.3.35","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-impl-0.3.35/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-impl-0.3.35/build.rs","edition":"2021","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/linkme-impl-58272cac9498bbcc/build-script-build"],"executable":null,"fresh":true}
|
|
6
|
+
{"reason":"build-script-executed","package_id":"registry+https://github.com/rust-lang/crates.io-index#quote@1.0.41","linked_libs":[],"linked_paths":[],"cfgs":[],"env":[],"out_dir":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/quote-bd3a967f0baa82ba/out"}
|
|
7
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#proc-macro2@1.0.103","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.103/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"proc_macro2","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/proc-macro2-1.0.103/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","proc-macro"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libproc_macro2-dd37530cb3be9c89.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libproc_macro2-dd37530cb3be9c89.rmeta"],"executable":null,"fresh":true}
|
|
8
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#libc@0.2.177","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/build.rs","edition":"2021","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/libc-449339277732fa5e/build-script-build"],"executable":null,"fresh":true}
|
|
9
|
+
{"reason":"build-script-executed","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme-impl@0.3.35","linked_libs":[],"linked_paths":[],"cfgs":[],"env":[],"out_dir":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/linkme-impl-3a226ee4acf194bc/out"}
|
|
10
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#quote@1.0.41","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.41/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"quote","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quote-1.0.41/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","proc-macro"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libquote-50bb41f3479641c7.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libquote-50bb41f3479641c7.rmeta"],"executable":null,"fresh":true}
|
|
11
|
+
{"reason":"build-script-executed","package_id":"registry+https://github.com/rust-lang/crates.io-index#libc@0.2.177","linked_libs":[],"linked_paths":[],"cfgs":["freebsd12"],"env":[],"out_dir":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/libc-232c4bf20ef68523/out"}
|
|
12
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme@0.3.35","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-0.3.35/Cargo.toml","target":{"kind":["custom-build"],"crate_types":["bin"],"name":"build-script-build","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-0.3.35/build.rs","edition":"2021","doc":false,"doctest":false,"test":false},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/linkme-b4eff1fe7607c227/build-script-build"],"executable":null,"fresh":true}
|
|
13
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#cfg-if@1.0.4","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cfg-if-1.0.4/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"cfg_if","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/cfg-if-1.0.4/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libcfg_if-a9ac86f51d75c7b7.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libcfg_if-a9ac86f51d75c7b7.rmeta"],"executable":null,"fresh":true}
|
|
14
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#syn@2.0.108","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/syn-2.0.108/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"syn","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/syn-2.0.108/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["clone-impls","default","derive","full","parsing","printing","proc-macro"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsyn-e300859bd66c50f8.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsyn-e300859bd66c50f8.rmeta"],"executable":null,"fresh":true}
|
|
15
|
+
{"reason":"build-script-executed","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme@0.3.35","linked_libs":[],"linked_paths":[],"cfgs":[],"env":[],"out_dir":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/build/linkme-5a4aae03df21ddde/out"}
|
|
16
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#libc@0.2.177","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"libc","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libc-0.2.177/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblibc-07ae242917b17fac.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblibc-07ae242917b17fac.rmeta"],"executable":null,"fresh":true}
|
|
17
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#libloading@0.8.9","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libloading-0.8.9/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"libloading","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/libloading-0.8.9/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblibloading-85bc05f161ed2d0d.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblibloading-85bc05f161ed2d0d.rmeta"],"executable":null,"fresh":true}
|
|
18
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme-impl@0.3.35","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-impl-0.3.35/Cargo.toml","target":{"kind":["proc-macro"],"crate_types":["proc-macro"],"name":"linkme_impl","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-impl-0.3.35/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblinkme_impl-1faa8bd9689bf04c.dylib"],"executable":null,"fresh":true}
|
|
19
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#getrandom@0.2.16","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.2.16/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"getrandom","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/getrandom-0.2.16/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libgetrandom-0854d8558a7b9b91.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libgetrandom-0854d8558a7b9b91.rmeta"],"executable":null,"fresh":true}
|
|
20
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#neon-macros@1.1.1","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/neon-macros-1.1.1/Cargo.toml","target":{"kind":["proc-macro"],"crate_types":["proc-macro"],"name":"neon_macros","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/neon-macros-1.1.1/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"0","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libneon_macros-b6b0d1522ede1979.dylib"],"executable":null,"fresh":true}
|
|
21
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#once_cell@1.21.3","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/once_cell-1.21.3/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"once_cell","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/once_cell-1.21.3/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["alloc","default","race","std"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libonce_cell-9261810396c152fd.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libonce_cell-9261810396c152fd.rmeta"],"executable":null,"fresh":true}
|
|
22
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#linkme@0.3.35","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-0.3.35/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"linkme","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/linkme-0.3.35/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblinkme-2161f2ede2e0e014.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblinkme-2161f2ede2e0e014.rmeta"],"executable":null,"fresh":true}
|
|
23
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#smallvec@1.15.1","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/smallvec-1.15.1/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"smallvec","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/smallvec-1.15.1/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsmallvec-09ab51cc35cf2235.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsmallvec-09ab51cc35cf2235.rmeta"],"executable":null,"fresh":true}
|
|
24
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#either@1.15.0","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/either-1.15.0/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"either","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/either-1.15.0/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","std"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libeither-1067ad403bee5403.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libeither-1067ad403bee5403.rmeta"],"executable":null,"fresh":true}
|
|
25
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#send_wrapper@0.6.0","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/send_wrapper-0.6.0/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"send_wrapper","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/send_wrapper-0.6.0/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsend_wrapper-caacde244ac44d1b.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsend_wrapper-caacde244ac44d1b.rmeta"],"executable":null,"fresh":true}
|
|
26
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#semver@1.0.27","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/semver-1.0.27/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"semver","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/semver-1.0.27/src/lib.rs","edition":"2018","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","std"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsemver-a5f5009652d36de5.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libsemver-a5f5009652d36de5.rmeta"],"executable":null,"fresh":true}
|
|
27
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#lazy_static@1.5.0","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lazy_static-1.5.0/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"lazy_static","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/lazy_static-1.5.0/src/lib.rs","edition":"2015","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblazy_static-eb4498fce09ac4c0.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/liblazy_static-eb4498fce09ac4c0.rmeta"],"executable":null,"fresh":true}
|
|
28
|
+
{"reason":"compiler-artifact","package_id":"registry+https://github.com/rust-lang/crates.io-index#neon@1.1.1","manifest_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/neon-1.1.1/Cargo.toml","target":{"kind":["lib"],"crate_types":["lib"],"name":"neon","src_path":"/Users/macintosh/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/neon-1.1.1/src/lib.rs","edition":"2021","doc":true,"doctest":true,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":["default","getrandom","napi-1","napi-2","napi-3","napi-4","napi-5","napi-6","napi-7","napi-8"],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libneon-a08196da9d45e183.rlib","/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/deps/libneon-a08196da9d45e183.rmeta"],"executable":null,"fresh":true}
|
|
29
|
+
{"reason":"compiler-artifact","package_id":"path+file:///Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript#crudjt@1.0.0-beta.0","manifest_path":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/Cargo.toml","target":{"kind":["cdylib"],"crate_types":["cdylib"],"name":"crudjt","src_path":"/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/src/lib.rs","edition":"2021","doc":true,"doctest":false,"test":true},"profile":{"opt_level":"3","debuginfo":0,"debug_assertions":false,"overflow_checks":false,"test":false},"features":[],"filenames":["/Users/macintosh/Applications/crud_jt-libs/javascript/crudjt-javascript/target/release/libcrudjt.dylib"],"executable":null,"fresh":false}
|
|
30
|
+
{"reason":"build-finished","success":true}
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This binding was generated automatically to ensure consistency across languages
|
|
2
|
+
// Generated using ChatGPT (GPT-5) from the canonical Ruby SDK
|
|
3
|
+
// API is stable and production-ready
|
|
4
|
+
|
|
5
|
+
class InternalError extends Error {
|
|
6
|
+
constructor(message = 'Internal Error') {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = 'InternalError';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = InternalError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// This binding was generated automatically to ensure consistency across languages
|
|
2
|
+
// Generated using ChatGPT (GPT-5) from the canonical Ruby SDK
|
|
3
|
+
// API is stable and production-ready
|
|
4
|
+
|
|
5
|
+
class InvalidState extends Error {
|
|
6
|
+
constructor(message = 'Invalid State') {
|
|
7
|
+
super(message);
|
|
8
|
+
this.name = 'InvalidState';
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
module.exports = InvalidState;
|
package/errors.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This binding was generated automatically to ensure consistency across languages
|
|
2
|
+
// Generated using ChatGPT (GPT-5) from the canonical Ruby SDK
|
|
3
|
+
// API is stable and production-ready
|
|
4
|
+
|
|
5
|
+
const InvalidState = require('./errors/invalid_state');
|
|
6
|
+
const InternalError = require('./errors/internal_error');
|
|
7
|
+
|
|
8
|
+
const ERRORS = {
|
|
9
|
+
'55JT01': InvalidState,
|
|
10
|
+
'XX000': InternalError
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
module.exports = ERRORS;
|
package/index.js
ADDED
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
// This binding was generated automatically to ensure consistency across languages
|
|
2
|
+
// Generated using ChatGPT (GPT-5) from the canonical Ruby SDK
|
|
3
|
+
// API is stable and production-ready
|
|
4
|
+
|
|
5
|
+
module.exports = require('./index.node');
|
|
6
|
+
|
|
7
|
+
const { createStub } = require('./token_service_client');
|
|
8
|
+
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
const { promisify } = require('util');
|
|
11
|
+
const sleep = promisify(setTimeout);
|
|
12
|
+
|
|
13
|
+
const os = require('os');
|
|
14
|
+
const path = require('path');
|
|
15
|
+
|
|
16
|
+
const platform = os.platform(); // 'darwin', 'linux', 'win32'
|
|
17
|
+
const arch = os.arch(); // 'x64', 'arm64', 'ia32', etc
|
|
18
|
+
|
|
19
|
+
const CRUDJT_ERRORS = require('./errors');
|
|
20
|
+
|
|
21
|
+
function getSourcePath() {
|
|
22
|
+
let archDir;
|
|
23
|
+
let platformDir;
|
|
24
|
+
|
|
25
|
+
switch (arch) {
|
|
26
|
+
case 'x64':
|
|
27
|
+
archDir = 'x86_64';
|
|
28
|
+
break;
|
|
29
|
+
case 'arm64':
|
|
30
|
+
archDir = 'arm64';
|
|
31
|
+
break;
|
|
32
|
+
default:
|
|
33
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
switch (platform) {
|
|
37
|
+
case 'darwin':
|
|
38
|
+
platformDir = 'macos';
|
|
39
|
+
break;
|
|
40
|
+
case 'linux':
|
|
41
|
+
platformDir = 'linux';
|
|
42
|
+
break;
|
|
43
|
+
case 'win32':
|
|
44
|
+
platformDir = 'windows';
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return path.join(__dirname, 'native', platformDir, archDir, 'libstore_jt.dylib');
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function getTargetPath() {
|
|
54
|
+
let systemLibDir;
|
|
55
|
+
let libName;
|
|
56
|
+
|
|
57
|
+
switch (platform) {
|
|
58
|
+
case 'darwin':
|
|
59
|
+
systemLibDir = '/usr/local/lib';
|
|
60
|
+
libName = 'libstore_jt.dylib';
|
|
61
|
+
break;
|
|
62
|
+
case 'linux':
|
|
63
|
+
systemLibDir = '/usr/lib';
|
|
64
|
+
libName = 'libstore_jt.so';
|
|
65
|
+
break;
|
|
66
|
+
case 'win32':
|
|
67
|
+
systemLibDir = 'C:\\Windows\\System32';
|
|
68
|
+
libName = 'libstore_jt.dll';
|
|
69
|
+
break;
|
|
70
|
+
default:
|
|
71
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return path.join(systemLibDir, libName);
|
|
75
|
+
}
|
|
76
|
+
///
|
|
77
|
+
|
|
78
|
+
const native = require('.'); // Require the compiled native module
|
|
79
|
+
const msgpack = require('msgpack-lite');
|
|
80
|
+
const { Buffer } = require('buffer');
|
|
81
|
+
const CRUDJT_LRUCache = require('./Cache');
|
|
82
|
+
const CRUDJT_Validation = require('./Validation');
|
|
83
|
+
|
|
84
|
+
const lruCache = new CRUDJT_LRUCache((value) => native.read(value));
|
|
85
|
+
|
|
86
|
+
function original_create(hash, ttl = null, silence_read = null) {
|
|
87
|
+
if (!Config.wasStarted()) {
|
|
88
|
+
throw new Error(CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_NOT_STARTED));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
CRUDJT_Validation.validateInsertion(hash, ttl, silence_read);
|
|
92
|
+
|
|
93
|
+
ttl = ttl || -1;
|
|
94
|
+
silence_read = silence_read || -1;
|
|
95
|
+
|
|
96
|
+
// Serialize hash into the format Msgpack
|
|
97
|
+
const packedData = msgpack.encode(hash);
|
|
98
|
+
CRUDJT_Validation.validateHashBytesize(packedData.length);
|
|
99
|
+
|
|
100
|
+
// Call native function create, passing it a pointer and the size of the data
|
|
101
|
+
let token = native.create(packedData, packedData.length, ttl, silence_read);
|
|
102
|
+
if (!token) {
|
|
103
|
+
throw new CRUDJT.Errors.InternalError('Something went wrong. Ups');
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
lruCache.insert(token, hash, ttl, silence_read);
|
|
107
|
+
|
|
108
|
+
return token;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
async function create(hash, ttl = null, silence_read = null) {
|
|
112
|
+
ttl = ttl || -1;
|
|
113
|
+
silence_read = silence_read || -1;
|
|
114
|
+
|
|
115
|
+
if (CRUDJT.Config.master()) {
|
|
116
|
+
return original_create(hash, ttl, silence_read);
|
|
117
|
+
} else {
|
|
118
|
+
const packed_data = msgpack.encode(hash);
|
|
119
|
+
const response = await new Promise((resolve, reject) => {
|
|
120
|
+
CRUDJT.Config.stub().CreateToken(
|
|
121
|
+
{ packed_data, ttl, silence_read },
|
|
122
|
+
(err, response) => {
|
|
123
|
+
if (err) reject(err);
|
|
124
|
+
else resolve(response);
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
});
|
|
128
|
+
return response.token;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function original_read(token) {
|
|
133
|
+
if (!Config.wasStarted()) {
|
|
134
|
+
throw new Error(CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_NOT_STARTED));
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
CRUDJT_Validation.validateToken(token);
|
|
138
|
+
|
|
139
|
+
let output = lruCache.get(token);
|
|
140
|
+
if (output) {
|
|
141
|
+
return output
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
let result_str = native.read(token);
|
|
145
|
+
|
|
146
|
+
const result = JSON.parse(result_str);
|
|
147
|
+
|
|
148
|
+
if (!result.ok) {
|
|
149
|
+
throw new CRUDJT_ERRORS[result.code]();
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (result.data == null) {
|
|
153
|
+
return null;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const data = JSON.parse(result.data);
|
|
157
|
+
lruCache.forceInsert(token, data);
|
|
158
|
+
|
|
159
|
+
return data;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
async function read(token) {
|
|
163
|
+
if (CRUDJT.Config.master()) {
|
|
164
|
+
return original_read(token);
|
|
165
|
+
} else {
|
|
166
|
+
const response = await new Promise((resolve, reject) => {
|
|
167
|
+
CRUDJT.Config.stub().ReadToken(
|
|
168
|
+
{ token },
|
|
169
|
+
(err, response) => {
|
|
170
|
+
if (err) reject(err);
|
|
171
|
+
else resolve(response);
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
return msgpack.decode(response.packed_data);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
function original_update(token, hash, ttl = null, silence_read = null) {
|
|
181
|
+
if (!Config.wasStarted()) {
|
|
182
|
+
throw new Error(CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_NOT_STARTED));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
CRUDJT_Validation.validateToken(token);
|
|
186
|
+
CRUDJT_Validation.validateInsertion(hash, ttl, silence_read);
|
|
187
|
+
|
|
188
|
+
ttl = ttl || -1;
|
|
189
|
+
silence_read = silence_read || -1;
|
|
190
|
+
|
|
191
|
+
// Serialize hash into the format Msgpack
|
|
192
|
+
const packedData = msgpack.encode(hash);
|
|
193
|
+
CRUDJT_Validation.validateHashBytesize(packedData.length);
|
|
194
|
+
|
|
195
|
+
// Call native function update, passing it a pointer and the size of the data
|
|
196
|
+
let result = native.update(token, packedData, packedData.length, ttl, silence_read);
|
|
197
|
+
if (result) {
|
|
198
|
+
lruCache.insert(token, hash, ttl, silence_read)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return result;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async function update(token, hash, ttl = null, silence_read = null) {
|
|
205
|
+
ttl = ttl || -1;
|
|
206
|
+
silence_read = silence_read || -1;
|
|
207
|
+
|
|
208
|
+
if (CRUDJT.Config.master()) {
|
|
209
|
+
return original_update(token, hash, ttl, silence_read);
|
|
210
|
+
} else {
|
|
211
|
+
const packed_data = msgpack.encode(hash);
|
|
212
|
+
const response = await new Promise((resolve, reject) => {
|
|
213
|
+
CRUDJT.Config.stub().UpdateToken(
|
|
214
|
+
{ token, packed_data, ttl, silence_read },
|
|
215
|
+
(err, response) => {
|
|
216
|
+
if (err) reject(err);
|
|
217
|
+
else resolve(response);
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
});
|
|
221
|
+
return response.result;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function original_delete(token) {
|
|
226
|
+
if (!Config.wasStarted()) {
|
|
227
|
+
throw new Error(CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_NOT_STARTED));
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
CRUDJT_Validation.validateToken(token);
|
|
231
|
+
|
|
232
|
+
lruCache.delete(token);
|
|
233
|
+
|
|
234
|
+
return native.delete(token);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
async function __delete(token) {
|
|
238
|
+
if (CRUDJT.Config.master()) {
|
|
239
|
+
return original_delete(token);
|
|
240
|
+
} else {
|
|
241
|
+
const response = await new Promise((resolve, reject) => {
|
|
242
|
+
CRUDJT.Config.stub().DeleteToken(
|
|
243
|
+
{ token },
|
|
244
|
+
(err, response) => {
|
|
245
|
+
if (err) reject(err);
|
|
246
|
+
else resolve(response);
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
return response.result;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// ---- Start gRPC interface -----
|
|
256
|
+
const grpc = require('@grpc/grpc-js');
|
|
257
|
+
const protoLoader = require('@grpc/proto-loader');
|
|
258
|
+
const PROTO_PATH = path.join(__dirname, 'token_service.proto');
|
|
259
|
+
|
|
260
|
+
const packageDefinition = protoLoader.loadSync(PROTO_PATH, {
|
|
261
|
+
keepCase: true,
|
|
262
|
+
longs: Number,
|
|
263
|
+
enums: String,
|
|
264
|
+
defaults: true,
|
|
265
|
+
oneofs: true,
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
const tokenProto = grpc.loadPackageDefinition(packageDefinition).token;
|
|
269
|
+
|
|
270
|
+
async function startServer(address) {
|
|
271
|
+
const server = new grpc.Server();
|
|
272
|
+
|
|
273
|
+
server.addService(tokenProto.TokenService.service, {
|
|
274
|
+
CreateToken: createToken,
|
|
275
|
+
ReadToken: readToken,
|
|
276
|
+
UpdateToken: updateToken,
|
|
277
|
+
DeleteToken: deleteToken
|
|
278
|
+
});
|
|
279
|
+
|
|
280
|
+
await new Promise((resolve, reject) => {
|
|
281
|
+
server.bindAsync(
|
|
282
|
+
address,
|
|
283
|
+
grpc.ServerCredentials.createInsecure(),
|
|
284
|
+
err => {
|
|
285
|
+
if (err) return reject(err);
|
|
286
|
+
resolve();
|
|
287
|
+
}
|
|
288
|
+
);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
return server;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
function createToken(call, callback) {
|
|
296
|
+
const hash = msgpack.decode(call.request.packed_data);
|
|
297
|
+
const token = original_create(hash, call.request.ttl, call.request.silence_read);
|
|
298
|
+
|
|
299
|
+
callback(null, {
|
|
300
|
+
token: token
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function readToken(call, callback) {
|
|
305
|
+
const hash = original_read(call.request.token);
|
|
306
|
+
|
|
307
|
+
let packedData = msgpack.encode(hash);
|
|
308
|
+
|
|
309
|
+
callback(null, {
|
|
310
|
+
packed_data: packedData,
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function updateToken(call, callback) {
|
|
315
|
+
const hash = msgpack.decode(call.request.packed_data);
|
|
316
|
+
const result = original_update(call.request.token, hash, call.request.ttl, call.request.silence_read);
|
|
317
|
+
|
|
318
|
+
callback(null, {
|
|
319
|
+
result: result
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function deleteToken(call, callback) {
|
|
324
|
+
const result = original_delete(call.request.token);
|
|
325
|
+
|
|
326
|
+
callback(null, {
|
|
327
|
+
result: result
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
// ---- End gRPC interface
|
|
331
|
+
|
|
332
|
+
const settings = {};
|
|
333
|
+
let wasStarted = false;
|
|
334
|
+
let server = false;
|
|
335
|
+
|
|
336
|
+
const Config = {
|
|
337
|
+
_stub: null,
|
|
338
|
+
GRPC_HOST: '127.0.0.1',
|
|
339
|
+
GRPC_PORT: 50051,
|
|
340
|
+
|
|
341
|
+
wasStarted() {
|
|
342
|
+
return wasStarted;
|
|
343
|
+
},
|
|
344
|
+
|
|
345
|
+
master() {
|
|
346
|
+
return master;
|
|
347
|
+
},
|
|
348
|
+
|
|
349
|
+
async shutdownServer() {
|
|
350
|
+
if (!server) {
|
|
351
|
+
throw new Error('gRPC server is not started');
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
await new Promise(resolve => {
|
|
355
|
+
server.tryShutdown(resolve);
|
|
356
|
+
});
|
|
357
|
+
},
|
|
358
|
+
|
|
359
|
+
async startMaster(options = {}) {
|
|
360
|
+
if (!options.secret_key) {
|
|
361
|
+
throw new CRUDJT_ERRORS[CRUDJT_Validation.ERROR_SECRET_KEY_NOT_SET](
|
|
362
|
+
CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_SECRET_KEY_NOT_SET)
|
|
363
|
+
);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (wasStarted) {
|
|
367
|
+
throw new CRUDJT_ERRORS[CRUDJT_Validation.ERROR_ALREADY_STARTED](
|
|
368
|
+
CRUDJT_Validation.errorMessage(CRUDJT_Validation.ERROR_ALREADY_STARTED)
|
|
369
|
+
);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
CRUDJT_Validation.validateSecretKey(options.secret_key);
|
|
373
|
+
|
|
374
|
+
const {
|
|
375
|
+
store_jt_path,
|
|
376
|
+
grpc_host = Config.GRPC_HOST,
|
|
377
|
+
grpc_port = Config.GRPC_PORT
|
|
378
|
+
} = options;
|
|
379
|
+
|
|
380
|
+
this.settings = {
|
|
381
|
+
store_jt_path,
|
|
382
|
+
grpc_host,
|
|
383
|
+
grpc_port
|
|
384
|
+
};
|
|
385
|
+
|
|
386
|
+
const address = `${grpc_host}:${grpc_port}`;
|
|
387
|
+
|
|
388
|
+
server = await startServer(address);
|
|
389
|
+
|
|
390
|
+
const result = JSON.parse(
|
|
391
|
+
native.start_store_jt(options.secret_key, this.settings.store_jt_path)
|
|
392
|
+
);
|
|
393
|
+
|
|
394
|
+
if (!result.ok) {
|
|
395
|
+
const ErrorClass = CRUDJT_ERRORS[result.code] || Error;
|
|
396
|
+
await CRUDJT.Config.shutdownServer();
|
|
397
|
+
throw new ErrorClass(result.error_message || 'Unknown error');
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
master = true;
|
|
401
|
+
wasStarted = true;
|
|
402
|
+
},
|
|
403
|
+
|
|
404
|
+
connectToMaster(options = {}) {
|
|
405
|
+
const {
|
|
406
|
+
grpc_host = Config.GRPC_HOST,
|
|
407
|
+
grpc_port = Config.GRPC_PORT
|
|
408
|
+
} = options;
|
|
409
|
+
|
|
410
|
+
this.settings = {
|
|
411
|
+
grpc_host,
|
|
412
|
+
grpc_port
|
|
413
|
+
};
|
|
414
|
+
|
|
415
|
+
const address = `${grpc_host}:${grpc_port}`;
|
|
416
|
+
|
|
417
|
+
this._stub = createStub(address);
|
|
418
|
+
|
|
419
|
+
master = false;
|
|
420
|
+
wasStarted = true;
|
|
421
|
+
},
|
|
422
|
+
|
|
423
|
+
stub() {
|
|
424
|
+
if (!this._stub) {
|
|
425
|
+
throw new Error('Config.connectToMaster() was not called');
|
|
426
|
+
}
|
|
427
|
+
return this._stub;
|
|
428
|
+
}
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
const CRUDJT = {
|
|
432
|
+
create,
|
|
433
|
+
read,
|
|
434
|
+
update,
|
|
435
|
+
delete: __delete,
|
|
436
|
+
|
|
437
|
+
Config
|
|
438
|
+
};
|
|
439
|
+
|
|
440
|
+
module.exports = CRUDJT;
|
package/index.node
ADDED
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="122" height="20" role="img" aria-label="Buy Me a Coffee: ☕"><title>Buy Me a Coffee: ☕</title><linearGradient id="s" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="r"><rect width="122" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#r)"><rect width="101" height="20" fill="#555"/><rect x="101" width="21" height="20" fill="#fe7d37"/><rect width="122" height="20" fill="url(#s)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="515" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="910">Buy Me a Coffee</text><text x="515" y="140" transform="scale(.1)" fill="#fff" textLength="910">Buy Me a Coffee</text><text aria-hidden="true" x="1105" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="110">☕</text><text x="1105" y="140" transform="scale(.1)" fill="#fff" textLength="110">☕</text></g></svg>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #fff;
|
|
7
|
+
}
|
|
8
|
+
</style>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect class="cls-1" width="160" height="160"/>
|
|
11
|
+
<g>
|
|
12
|
+
<path d="M84.86,68.24c-1.69-2.83-2.61-6.1-2.61-9.57h-4.51c0,3.47-.92,6.74-2.61,9.57-1.65,2.86-4.01,5.25-6.87,6.9-2.8,1.65-6.1,2.61-9.6,2.61v4.51c3.5,0,6.8.95,9.6,2.58,2.86,1.69,5.21,4.04,6.87,6.9,1.69,2.83,2.61,6.1,2.61,9.6h4.51c0-3.5.92-6.77,2.61-9.6,1.65-2.86,4.01-5.21,6.87-6.9,2.8-1.62,6.1-2.58,9.6-2.58v-4.51c-3.5,0-6.8-.95-9.6-2.61-2.86-1.65-5.21-4.04-6.87-6.9Z"/>
|
|
13
|
+
<path d="M17.27,58.67h13.46c.7,0,1.27-.57,1.27-1.27v-25.42h25.39c.7,0,1.27-.57,1.27-1.27v-13.44c0-.7-.57-1.27-1.27-1.27h0c-22.86,0-41.4,18.53-41.4,41.4h0c0,.7.57,1.27,1.27,1.27Z"/>
|
|
14
|
+
<path d="M102.6,16h0c-.7,0-1.27.57-1.27,1.27v13.44c0,.7.57,1.27,1.27,1.27h25.39v25.42c0,.7.57,1.27,1.27,1.27h13.46c.7,0,1.27-.57,1.27-1.27h0c0-22.86-18.53-41.4-41.4-41.4Z"/>
|
|
15
|
+
<path d="M57.4,128.02h-25.39v-25.42c0-.7-.57-1.27-1.27-1.27h-13.46c-.7,0-1.27.57-1.27,1.27h0c0,22.86,18.54,41.4,41.4,41.4h0c.7,0,1.27-.57,1.27-1.27v-13.44c0-.7-.57-1.27-1.27-1.27Z"/>
|
|
16
|
+
<path d="M142.73,101.33h-13.46c-.7,0-1.27.57-1.27,1.27v25.42h-25.39c-.7,0-1.27.57-1.27,1.27v13.44c0,.7.57,1.27,1.27,1.27h0c22.86,0,41.4-18.53,41.4-41.4h0c0-.7-.57-1.27-1.27-1.27Z"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 160 160">
|
|
3
|
+
<defs>
|
|
4
|
+
<style>
|
|
5
|
+
.cls-1 {
|
|
6
|
+
fill: #fff;
|
|
7
|
+
}
|
|
8
|
+
</style>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect width="160" height="160" fill="#0D1117"/>
|
|
11
|
+
<g>
|
|
12
|
+
<path class="cls-1" d="M84.86,68.24c-1.69-2.83-2.61-6.1-2.61-9.57h-4.51c0,3.47-.92,6.74-2.61,9.57-1.65,2.86-4.01,5.25-6.87,6.9-2.8,1.65-6.1,2.61-9.6,2.61v4.51c3.5,0,6.8.95,9.6,2.58,2.86,1.69,5.21,4.04,6.87,6.9,1.69,2.83,2.61,6.1,2.61,9.6h4.51c0-3.5.92-6.77,2.61-9.6,1.65-2.86,4.01-5.21,6.87-6.9,2.8-1.62,6.1-2.58,9.6-2.58v-4.51c-3.5,0-6.8-.95-9.6-2.61-2.86-1.65-5.21-4.04-6.87-6.9Z"/>
|
|
13
|
+
<path class="cls-1" d="M17.27,58.67h13.46c.7,0,1.27-.57,1.27-1.27v-25.42h25.39c.7,0,1.27-.57,1.27-1.27v-13.44c0-.7-.57-1.27-1.27-1.27h0c-22.86,0-41.4,18.53-41.4,41.4h0c0,.7.57,1.27,1.27,1.27Z"/>
|
|
14
|
+
<path class="cls-1" d="M102.6,16h0c-.7,0-1.27.57-1.27,1.27v13.44c0,.7.57,1.27,1.27,1.27h25.39v25.42c0,.7.57,1.27,1.27,1.27h13.46c.7,0,1.27-.57,1.27-1.27h0c0-22.86-18.53-41.4-41.4-41.4Z"/>
|
|
15
|
+
<path class="cls-1" d="M57.4,128.02h-25.39v-25.42c0-.7-.57-1.27-1.27-1.27h-13.46c-.7,0-1.27.57-1.27,1.27h0c0,22.86,18.54,41.4,41.4,41.4h0c.7,0,1.27-.57,1.27-1.27v-13.44c0-.7-.57-1.27-1.27-1.27Z"/>
|
|
16
|
+
<path class="cls-1" d="M142.73,101.33h-13.46c-.7,0-1.27.57-1.27,1.27v25.42h-25.39c-.7,0-1.27.57-1.27,1.27v13.44c0,.7.57,1.27,1.27,1.27h0c22.86,0,41.4-18.53,41.4-41.4h0c0-.7-.57-1.27-1.27-1.27Z"/>
|
|
17
|
+
</g>
|
|
18
|
+
</svg>
|
|
Binary file
|
|
Binary file
|