From e5da23326641b83b084802ccad07241d904422af Mon Sep 17 00:00:00 2001 From: Angus Fretwell Date: Thu, 29 Feb 2024 01:34:36 +1100 Subject: [PATCH] use browser friendly crypto --- .github/workflows/test.yml | 8 ++------ src/request.ts | 3 +-- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5115c52..56df8bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,15 +9,11 @@ on: jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [18.x, 20.x] steps: - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node-version }} + node-version: 20.x cache: "npm" - run: npm ci - run: npm run build --if-present diff --git a/src/request.ts b/src/request.ts index 262625e..6014a45 100644 --- a/src/request.ts +++ b/src/request.ts @@ -1,4 +1,3 @@ -import { randomUUID } from "crypto"; import { isEmpty } from "lodash-es"; import { RequestParams } from "./types"; @@ -11,7 +10,7 @@ export async function request( [entity, action, params, index]: RequestParams, { headers, ...requestInit }: RequestInit = {}, ) { - const requestId = randomUUID(); + const requestId = crypto.randomUUID(); const url = new URL(`civicrm/ajax/api4/${entity}/${action}`, this.baseUrl);