diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58b413cf..51cf1f96 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -312,10 +312,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Set up Node.JS 16.x + - name: Set up Node.JS 18.x uses: actions/setup-node@v3 with: - node-version: 16.x + node-version: 18.x - name: Fetch library artifacts uses: actions/download-artifact@v3 diff --git a/wrappers/javascript/aries-askar-nodejs/README.md b/wrappers/javascript/aries-askar-nodejs/README.md index 6b4753f2..daae85ef 100644 --- a/wrappers/javascript/aries-askar-nodejs/README.md +++ b/wrappers/javascript/aries-askar-nodejs/README.md @@ -4,8 +4,7 @@ Wrapper for Nodejs around Aries Askar ## Requirements -This has been tested extensively with Nodejs version `16.11.0` and `16.15.0`. -Older and newer versions might also work, but they have not been tested. +This library requires (and has been tested extensively with) Node.js version `18.x`. Newer versions might also work, but they have not been tested. ## Installation diff --git a/wrappers/javascript/aries-askar-nodejs/package.json b/wrappers/javascript/aries-askar-nodejs/package.json index ad037fca..37808cb8 100644 --- a/wrappers/javascript/aries-askar-nodejs/package.json +++ b/wrappers/javascript/aries-askar-nodejs/package.json @@ -34,7 +34,8 @@ "install": "node-pre-gyp install --target_arch=$(node scripts/arch.js) --target_platform=$(node scripts/platform.js)" }, "devDependencies": { - "@types/ffi-napi": "^4.0.5", + "@types/2060.io__ffi-napi": "npm:@types/ffi-napi", + "@types/2060.io__ref-napi": "npm:@types/ref-napi", "@types/jest": "^27.4.1", "@types/node": "^17.0.31", "@types/ref-array-di": "^1.2.3", @@ -49,10 +50,10 @@ "dependencies": { "@hyperledger/aries-askar-shared": "0.1.1", "@mapbox/node-pre-gyp": "^1.0.10", - "ffi-napi": "^4.0.3", + "@2060.io/ffi-napi": "4.0.5", + "@2060.io/ref-napi": "3.0.4", "node-cache": "^5.1.2", "ref-array-di": "^1.2.2", - "ref-napi": "^3.0.3", "ref-struct-di": "^1.1.1" }, "binary": { @@ -61,5 +62,8 @@ "remote_path": "v0.2.9", "host": "https://github.com/hyperledger/aries-askar/releases/download/", "package_name": "library-{platform}-{arch}.tar.gz" + }, + "engines": { + "node": ">= 18" } } diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/alloc.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/alloc.ts index b74a616b..415760c4 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/alloc.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/alloc.ts @@ -1,4 +1,4 @@ -import { alloc } from 'ref-napi' +import { alloc } from '@2060.io/ref-napi' import { FFI_POINTER, FFI_STRING, FFI_INT32, FFI_INT8 } from './primitives' import { SecretBufferStruct, EncryptedBufferStruct, AeadParamsStruct } from './structures' diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/callback.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/callback.ts index 8dda5714..0feea6b7 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/callback.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/callback.ts @@ -1,5 +1,5 @@ -import { Callback } from 'ffi-napi' -import { refType } from 'ref-napi' +import { Callback } from '@2060.io/ffi-napi' +import { refType } from '@2060.io/ref-napi' import { allocateCallbackBuffer } from './alloc' import { FFI_VOID, FFI_CALLBACK_ID, FFI_ERROR_CODE, FFI_STRING, FFI_INT32 } from './primitives' diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/conversion.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/conversion.ts index 6d669368..2e26df32 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/conversion.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/conversion.ts @@ -1,9 +1,9 @@ import type { ByteBufferType, EncryptedBufferType } from './structures' +import type { Pointer } from '@2060.io/ref-napi' import type { TypedArray } from 'ref-array-di' -import type { Pointer } from 'ref-napi' +import { reinterpret } from '@2060.io/ref-napi' import { EncryptedBuffer } from '@hyperledger/aries-askar-shared' -import { reinterpret } from 'ref-napi' import { ByteBufferStruct } from './structures' diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/primitives.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/primitives.ts index aa297ba3..32c8fbba 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/primitives.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/primitives.ts @@ -1,4 +1,4 @@ -import { refType } from 'ref-napi' +import { refType } from '@2060.io/ref-napi' // Primitives diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/serialize.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/serialize.ts index 86439c7d..a1a53a13 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/serialize.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/serialize.ts @@ -1,7 +1,7 @@ import type { ByteBufferStruct, SecretBufferStruct } from './structures' +import { NULL } from '@2060.io/ref-napi' import { Key, ArcHandle, StoreHandle, SessionHandle, ScanHandle, Jwk } from '@hyperledger/aries-askar-shared' -import { NULL } from 'ref-napi' import { uint8arrayToByteBufferStruct } from './conversion' diff --git a/wrappers/javascript/aries-askar-nodejs/src/ffi/structures.ts b/wrappers/javascript/aries-askar-nodejs/src/ffi/structures.ts index 41ef0551..b225f95e 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/ffi/structures.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/ffi/structures.ts @@ -1,5 +1,5 @@ +import { default as ref, refType } from '@2060.io/ref-napi' import refArray from 'ref-array-di' -import { default as ref, refType } from 'ref-napi' import refStruct from 'ref-struct-di' import { FFI_INT32, FFI_INT64, FFI_UINT8 } from './primitives' diff --git a/wrappers/javascript/aries-askar-nodejs/src/library/bindings.ts b/wrappers/javascript/aries-askar-nodejs/src/library/bindings.ts index 65259aa8..bf2bcbb0 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/library/bindings.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/library/bindings.ts @@ -1,4 +1,4 @@ -import { refType } from 'ref-napi' +import { refType } from '@2060.io/ref-napi' import { FFI_CALLBACK_ID, diff --git a/wrappers/javascript/aries-askar-nodejs/src/library/register.ts b/wrappers/javascript/aries-askar-nodejs/src/library/register.ts index 0fd6fc59..4408af75 100644 --- a/wrappers/javascript/aries-askar-nodejs/src/library/register.ts +++ b/wrappers/javascript/aries-askar-nodejs/src/library/register.ts @@ -1,6 +1,6 @@ import type { NativeMethods } from './NativeBindingInterface' -import { Library } from 'ffi-napi' +import { Library } from '@2060.io/ffi-napi' import fs from 'fs' import os from 'os' import path from 'path' diff --git a/wrappers/javascript/package.json b/wrappers/javascript/package.json index 506232d1..b8317329 100644 --- a/wrappers/javascript/package.json +++ b/wrappers/javascript/package.json @@ -46,8 +46,5 @@ "prettier": "^2.5.1", "ts-jest": "^29.0.5", "typescript": "^4.5.5" - }, - "engines": { - "node": ">= 12" } } diff --git a/wrappers/javascript/yarn.lock b/wrappers/javascript/yarn.lock index dfbc398a..222e3fa6 100644 --- a/wrappers/javascript/yarn.lock +++ b/wrappers/javascript/yarn.lock @@ -2,6 +2,28 @@ # yarn lockfile v1 +"@2060.io/ffi-napi@4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@2060.io/ffi-napi/-/ffi-napi-4.0.5.tgz#52fd369f25cba85319eb5625e2d598925a1713ce" + integrity sha512-CdV4y/gXYI7yzSiSHWvY/JdW06Li57Gdc3ZKzNesXrCQg4IoHL0S+zIxEr6Mbr0fCNVvj1GNSh8Uz9vSQkCXYA== + dependencies: + "@2060.io/ref-napi" "3.0.4" + debug "^4.1.1" + get-uv-event-loop-napi-h "^1.0.5" + node-addon-api "^3.0.0" + node-gyp-build "^4.2.1" + ref-struct-di "^1.1.0" + +"@2060.io/ref-napi@3.0.4": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@2060.io/ref-napi/-/ref-napi-3.0.4.tgz#6a78093b36e8f4ffeb750f706433869382e73eb1" + integrity sha512-Aqf699E+DKs2xANx8bSkuzXyG9gcZ2iFkAk1kUTA8KbV5BSPQtIcBJexzohSRi9QWDhP4X54NLm7xwGA0UNCdQ== + dependencies: + debug "^4.1.1" + get-symbol-from-current-process-h "^1.0.2" + node-addon-api "^3.0.0" + node-gyp-build "^4.2.1" + "@ampproject/remapping@^2.2.0": version "2.2.1" resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" @@ -1935,6 +1957,22 @@ "@tufjs/canonical-json" "1.0.0" minimatch "^9.0.0" +"@types/2060.io__ffi-napi@npm:@types/ffi-napi": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/ffi-napi/-/ffi-napi-4.0.7.tgz#b3a9beeae160c74adca801ca1c9defb1ec0a1a32" + integrity sha512-2CvLfgxCUUSj7qVab6/uFLyVpgVd2gEV4H/TQEHHn6kZTV8iTesz9uo0bckhwzsh71atutOv8P3JmvRX2ZvpZg== + dependencies: + "@types/node" "*" + "@types/ref-napi" "*" + "@types/ref-struct-di" "*" + +"@types/2060.io__ref-napi@npm:@types/ref-napi", "@types/ref-napi@*": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@types/ref-napi/-/ref-napi-3.0.7.tgz#20adc93a7a2f9f992dfb17409fd748e6f4bf403d" + integrity sha512-CzPwr36VkezSpaJGdQX/UrczMSDsDgsWQQFEfQkS799Ft7n/s183a53lsql7RwVq+Ik4yLEgI84pRnLC0XXRlA== + dependencies: + "@types/node" "*" + "@types/babel__core@^7.1.14": version "7.20.1" resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.1.tgz#916ecea274b0c776fec721e333e55762d3a9614b" @@ -1986,15 +2024,6 @@ resolved "https://registry.yarnpkg.com/@types/fast-text-encoding/-/fast-text-encoding-1.0.1.tgz#7a9e6d8dd2ac1fa70772b500a307c2620cec1fe3" integrity sha512-DRFqoqjXfvuX3f5jIQKAQr/QzuFdNoHOtou0KQ9bzUJOreCciO7T/kFJHgEote7QusmgE1fTxsQSqNvXVR0GBw== -"@types/ffi-napi@^4.0.5": - version "4.0.7" - resolved "https://registry.yarnpkg.com/@types/ffi-napi/-/ffi-napi-4.0.7.tgz#b3a9beeae160c74adca801ca1c9defb1ec0a1a32" - integrity sha512-2CvLfgxCUUSj7qVab6/uFLyVpgVd2gEV4H/TQEHHn6kZTV8iTesz9uo0bckhwzsh71atutOv8P3JmvRX2ZvpZg== - dependencies: - "@types/node" "*" - "@types/ref-napi" "*" - "@types/ref-struct-di" "*" - "@types/graceful-fs@^4.1.2", "@types/graceful-fs@^4.1.3": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" @@ -4421,18 +4450,6 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -ffi-napi@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/ffi-napi/-/ffi-napi-4.0.3.tgz#27a8d42a8ea938457154895c59761fbf1a10f441" - integrity sha512-PMdLCIvDY9mS32RxZ0XGb95sonPRal8aqRhLbeEtWKZTe2A87qRFG9HjOhvG8EX2UmQw5XNRMIOT+1MYlWmdeg== - dependencies: - debug "^4.1.1" - get-uv-event-loop-napi-h "^1.0.5" - node-addon-api "^3.0.0" - node-gyp-build "^4.2.1" - ref-napi "^2.0.1 || ^3.0.2" - ref-struct-di "^1.1.0" - figures@3.2.0, figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" @@ -8735,16 +8752,6 @@ ref-array-di@^1.2.2: array-index "^1.0.0" debug "^3.1.0" -"ref-napi@^2.0.1 || ^3.0.2", ref-napi@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/ref-napi/-/ref-napi-3.0.3.tgz#e259bfc2bbafb3e169e8cd9ba49037dd00396b22" - integrity sha512-LiMq/XDGcgodTYOMppikEtJelWsKQERbLQsYm0IOOnzhwE9xYZC7x8txNnFC9wJNOkPferQI4vD4ZkC0mDyrOA== - dependencies: - debug "^4.1.1" - get-symbol-from-current-process-h "^1.0.2" - node-addon-api "^3.0.0" - node-gyp-build "^4.2.1" - ref-struct-di@^1.1.0, ref-struct-di@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ref-struct-di/-/ref-struct-di-1.1.1.tgz#5827b1d3b32372058f177547093db1fe1602dc10"