@vltpkg/security-archive 1.0.10 → 1.1.1

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/dist/index.d.ts CHANGED
@@ -38,7 +38,6 @@ export type SecurityArchiveOptions = LRUCache.OptionsBase<DepID, PackageReportDa
38
38
  */
39
39
  retries?: number;
40
40
  };
41
- export declare const version: string;
42
41
  /**
43
42
  * A database of security information for given packages from a list of nodes.
44
43
  *
package/dist/index.js CHANGED
@@ -5,9 +5,9 @@ import { mkdirSync } from 'node:fs';
5
5
  import { dirname } from 'node:path';
6
6
  import { LRUCache } from 'lru-cache';
7
7
  import pRetry, { AbortError } from 'p-retry';
8
- import { loadPackageJson } from 'package-json-from-dist';
9
8
  import { asDepID, baseDepID } from '@vltpkg/dep-id';
10
9
  import { error } from '@vltpkg/error-cause';
10
+ import { userAgent } from '@vltpkg/user-agent';
11
11
  import { XDG } from '@vltpkg/xdg';
12
12
  import { asPackageReportData } from "./types.js";
13
13
  import { __CODE_SPLIT_SCRIPT_NAME } from "./update-expired.js";
@@ -16,8 +16,6 @@ export * from "./types.js";
16
16
  export { npmRegistryURL, usesNpmRegistry } from "./browser.js";
17
17
  const SOCKET_API_V0_URL = 'https://api.socket.dev/v0/purl?alerts=true';
18
18
  const SOCKET_PUBLIC_API_TOKEN = 'sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api';
19
- // Loads the version number to be used in the User-Agent header
20
- export const { version } = loadPackageJson(import.meta.filename, process.env.__VLT_INTERNAL_CLI_PACKAGE_JSON);
21
19
  /**
22
20
  * A database of security information for given packages from a list of nodes.
23
21
  *
@@ -243,7 +241,7 @@ export class SecurityArchive extends LRUCache {
243
241
  method: 'POST',
244
242
  headers: {
245
243
  Authorization: `Basic ${Buffer.from(`${SOCKET_PUBLIC_API_TOKEN}:`).toString('base64url')}`,
246
- 'User-Agent': `@vltpkg/security-archive/${version}`,
244
+ 'User-Agent': userAgent,
247
245
  },
248
246
  body: JSON.stringify({
249
247
  components: Array.from(queue),
@@ -1,7 +1,6 @@
1
1
  import type { DepID } from '@vltpkg/dep-id';
2
2
  import type EventEmitter from 'node:events';
3
3
  export declare const __CODE_SPLIT_SCRIPT_NAME: string;
4
- export declare const version: string;
5
4
  /**
6
5
  * Serialized payload sent to the detached process via stdin.
7
6
  */
@@ -5,12 +5,11 @@ import { pathToFileURL } from 'node:url';
5
5
  import pRetry, { AbortError } from 'p-retry';
6
6
  import { asDepID, baseDepID } from '@vltpkg/dep-id';
7
7
  import { error } from '@vltpkg/error-cause';
8
- import { loadPackageJson } from 'package-json-from-dist';
8
+ import { userAgent } from '@vltpkg/user-agent';
9
9
  import { asPackageReportData } from "./types.js";
10
10
  export const __CODE_SPLIT_SCRIPT_NAME = import.meta.filename;
11
11
  const SOCKET_API_V0_URL = 'https://api.socket.dev/v0/purl?alerts=true';
12
12
  const SOCKET_PUBLIC_API_TOKEN = 'sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api';
13
- export const { version } = loadPackageJson(import.meta.filename, process.env.__VLT_INTERNAL_CLI_PACKAGE_JSON);
14
13
  /* c8 ignore start */
15
14
  const isMain = (path) => path === __CODE_SPLIT_SCRIPT_NAME ||
16
15
  path === pathToFileURL(__CODE_SPLIT_SCRIPT_NAME).toString();
@@ -24,7 +23,7 @@ const retrieveRemoteData = async (queue, retries) => {
24
23
  method: 'POST',
25
24
  headers: {
26
25
  Authorization: `Basic ${Buffer.from(`${SOCKET_PUBLIC_API_TOKEN}:`).toString('base64url')}`,
27
- 'User-Agent': `@vltpkg/security-archive/${version}`,
26
+ 'User-Agent': userAgent,
28
27
  },
29
28
  body: JSON.stringify({
30
29
  components: Array.from(queue),
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vltpkg/security-archive",
3
3
  "description": "A database of security information of packages",
4
- "version": "1.0.10",
4
+ "version": "1.1.1",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/vltpkg/vltpkg.git",
@@ -13,14 +13,14 @@
13
13
  "url": "http://vlt.sh"
14
14
  },
15
15
  "dependencies": {
16
- "@vltpkg/dep-id": "1.0.10",
17
- "@vltpkg/error-cause": "1.0.10",
18
- "@vltpkg/spec": "1.0.10",
19
- "@vltpkg/types": "1.0.10",
20
- "@vltpkg/xdg": "1.0.10",
16
+ "@vltpkg/dep-id": "1.1.1",
17
+ "@vltpkg/error-cause": "1.1.1",
18
+ "@vltpkg/spec": "1.1.1",
19
+ "@vltpkg/types": "1.1.1",
20
+ "@vltpkg/user-agent": "1.1.1",
21
+ "@vltpkg/xdg": "1.1.1",
21
22
  "lru-cache": "^11.2.4",
22
- "p-retry": "^7.1.1",
23
- "package-json-from-dist": "^1.0.1"
23
+ "p-retry": "^7.1.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@eslint/js": "^9.39.1",