Skip to content

Commit

Permalink
Merge branch 'main' into feat/native-fetch-support
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed Jul 28, 2024
2 parents c787cd1 + 97a4172 commit 3875633
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 24 deletions.
17 changes: 2 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@
"oas": "^20.10.2",
"ssri": "^10.0.1",
"timeout-signal": "^1.1.0",
"type-is": "^1.6.18",
"uuid": "^9.0.0"
"type-is": "^1.6.18"
},
"devDependencies": {
"@readme/eslint-config": "^14.0.0",
Expand All @@ -48,7 +47,6 @@
"@types/ssri": "^7.1.1",
"@types/supertest": "^2.0.12",
"@types/type-is": "^1.6.3",
"@types/uuid": "^9.0.2",
"@vitest/coverage-v8": "^2.0.4",
"eslint": "^8.34.0",
"express": "^4.18.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/lib/construct-payload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import type { UUID } from 'node:crypto';
import type { IncomingMessage, ServerResponse } from 'node:http';
import type { TLSSocket } from 'tls';

import { randomUUID } from 'node:crypto';
import os from 'os';
import { URL } from 'url';

import ssri from 'ssri';
import { v4 as uuidv4 } from 'uuid';

import { version } from '../../package.json';

Expand Down Expand Up @@ -142,7 +142,7 @@ export function constructPayload(
const serverTime = payloadData.responseEndDateTime.getTime() - payloadData.startedDateTime.getTime();

return {
_id: payloadData.logId || (uuidv4() as UUID),
_id: payloadData.logId || randomUUID(),
_version: 3,
group: {
id: mask(payloadData.apiKey),
Expand Down
5 changes: 2 additions & 3 deletions packages/node/src/lib/log.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { LogOptions } from './construct-payload';
import type { GroupingObject, OutgoingLogBody } from './metrics-log';
import type { UUID } from 'node:crypto';
import type { IncomingMessage, ServerResponse } from 'node:http';

import { randomUUID } from 'node:crypto';
import * as url from 'url';

import clamp from 'lodash/clamp';
import { v4 as uuidv4 } from 'uuid';

import config from '../config';

Expand Down Expand Up @@ -108,7 +107,7 @@ export function log(
const bufferLength = clamp(options.bufferLength || config.bufferLength, 1, 30);

const startedDateTime = new Date();
const logId = uuidv4() as UUID;
const logId = randomUUID();

// baseLogUrl can be provided, but if it isn't then we
// attempt to fetch it from the ReadMe API
Expand Down
2 changes: 1 addition & 1 deletion packages/node/src/lib/metrics-log.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Options } from './log';
import type { UUID } from 'crypto';
import type { Har } from 'har-format';
import type { UUID } from 'node:crypto';

import timeoutSignal from 'timeout-signal';

Expand Down

0 comments on commit 3875633

Please sign in to comment.