Skip to content

Commit

Permalink
use browser friendly crypto
Browse files Browse the repository at this point in the history
  • Loading branch information
angusfretwell committed Feb 28, 2024
1 parent 4eaf4f6 commit 72ff6c3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/request.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { randomUUID } from "crypto";
import { isEmpty } from "lodash-es";

import { RequestParams } from "./types";
Expand All @@ -11,7 +10,7 @@ export async function request(
[entity, action, params, index]: RequestParams,
{ headers, ...requestInit }: RequestInit = {},
) {
const requestId = randomUUID();
const requestId = crypto.randomUUID();

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > makes a request

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > sets request headers

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > accepts request options

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > accepts additional headers

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > accepts params

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > requests a single resource

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > makes chained requests

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > makes nested chained requests

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

Check failure on line 13 in src/request.ts

View workflow job for this annotation

GitHub Actions / build (18.x)

test/index.test.ts > request methods > makes a get request

ReferenceError: crypto is not defined ❯ Object.request src/request.ts:13:21 ❯ RequestBuilder.request src/index.ts:20:26 ❯ RequestBuilder.getInnerPromise src/request-builder.ts:107:32 ❯ RequestBuilder.then src/request-builder.ts:102:17

const url = new URL(`civicrm/ajax/api4/${entity}/${action}`, this.baseUrl);

Expand Down

0 comments on commit 72ff6c3

Please sign in to comment.