Skip to content

Commit cb45b21

Browse files
committed
deps: npm update
1 parent 1f60a7e commit cb45b21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+1921
-1718
lines changed

DEPENDENCIES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -764,7 +764,8 @@ graph LR;
764764
tar-->mkdirp;
765765
tar-->yallist;
766766
tuf-js-->make-fetch-happen;
767-
tuf-js-->minimatch;
767+
tuf-js-->tufjs-models["@tufjs/models"];
768+
tufjs-models-->minimatch;
768769
unique-filename-->unique-slug;
769770
unique-slug-->imurmurhash;
770771
validate-npm-package-license-->spdx-correct;

node_modules/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@
3232
!/@tootallnate/
3333
/@tootallnate/*
3434
!/@tootallnate/once
35+
!/@tufjs/
36+
/@tufjs/*
37+
!/@tufjs/models
3538
!/abbrev
3639
!/abort-controller
3740
!/agent-base

node_modules/@tufjs/models/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 GitHub and the TUF Contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

node_modules/tuf-js/dist/models/base.d.ts renamed to node_modules/@tufjs/models/dist/base.d.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { JSONObject, JSONValue } from '../utils/types';
21
import { Signature } from './signature';
2+
import { JSONObject, JSONValue } from './utils';
33
export interface Signable {
44
signatures: Record<string, Signature>;
55
signed: Signed;
@@ -10,6 +10,13 @@ export interface SignedOptions {
1010
expires?: string;
1111
unrecognizedFields?: Record<string, JSONValue>;
1212
}
13+
export declare enum MetadataKind {
14+
Root = "root",
15+
Timestamp = "timestamp",
16+
Snapshot = "snapshot",
17+
Targets = "targets"
18+
}
19+
export declare function isMetadataKind(value: unknown): value is MetadataKind;
1320
/***
1421
* A base class for the signed part of TUF metadata.
1522
*

node_modules/tuf-js/dist/models/base.js renamed to node_modules/@tufjs/models/dist/base.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
33
return (mod && mod.__esModule) ? mod : { "default": mod };
44
};
55
Object.defineProperty(exports, "__esModule", { value: true });
6-
exports.Signed = void 0;
6+
exports.Signed = exports.isMetadataKind = exports.MetadataKind = void 0;
77
const util_1 = __importDefault(require("util"));
8-
const error_1 = require("../error");
9-
const utils_1 = require("../utils");
8+
const error_1 = require("./error");
9+
const utils_1 = require("./utils");
1010
const SPECIFICATION_VERSION = ['1', '0', '31'];
11+
var MetadataKind;
12+
(function (MetadataKind) {
13+
MetadataKind["Root"] = "root";
14+
MetadataKind["Timestamp"] = "timestamp";
15+
MetadataKind["Snapshot"] = "snapshot";
16+
MetadataKind["Targets"] = "targets";
17+
})(MetadataKind = exports.MetadataKind || (exports.MetadataKind = {}));
18+
function isMetadataKind(value) {
19+
return (typeof value === 'string' &&
20+
Object.values(MetadataKind).includes(value));
21+
}
22+
exports.isMetadataKind = isMetadataKind;
1123
/***
1224
* A base class for the signed part of TUF metadata.
1325
*

node_modules/tuf-js/dist/models/delegations.d.ts renamed to node_modules/@tufjs/models/dist/delegations.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { JSONObject, JSONValue } from '../utils/types';
21
import { Key } from './key';
32
import { DelegatedRole, SuccinctRoles } from './role';
3+
import { JSONObject, JSONValue } from './utils';
44
type DelegatedRoleMap = Record<string, DelegatedRole>;
55
type KeyMap = Record<string, Key>;
66
interface DelegationsOptions {

node_modules/tuf-js/dist/models/delegations.js renamed to node_modules/@tufjs/models/dist/delegations.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
55
Object.defineProperty(exports, "__esModule", { value: true });
66
exports.Delegations = void 0;
77
const util_1 = __importDefault(require("util"));
8-
const error_1 = require("../error");
9-
const guard_1 = require("../utils/guard");
8+
const error_1 = require("./error");
109
const key_1 = require("./key");
1110
const role_1 = require("./role");
11+
const utils_1 = require("./utils");
1212
/**
1313
* A container object storing information about all delegations.
1414
*
@@ -67,7 +67,7 @@ class Delegations {
6767
static fromJSON(data) {
6868
const { keys, roles, succinct_roles, ...unrecognizedFields } = data;
6969
let succinctRoles;
70-
if ((0, guard_1.isObject)(succinct_roles)) {
70+
if (utils_1.guard.isObject(succinct_roles)) {
7171
succinctRoles = role_1.SuccinctRoles.fromJSON(succinct_roles);
7272
}
7373
return new Delegations({
@@ -89,7 +89,7 @@ function rolesToJSON(roles) {
8989
return Object.values(roles).map((role) => role.toJSON());
9090
}
9191
function keysFromJSON(data) {
92-
if (!(0, guard_1.isObjectRecord)(data)) {
92+
if (!utils_1.guard.isObjectRecord(data)) {
9393
throw new TypeError('keys is malformed');
9494
}
9595
return Object.entries(data).reduce((acc, [keyID, keyData]) => ({
@@ -99,8 +99,8 @@ function keysFromJSON(data) {
9999
}
100100
function rolesFromJSON(data) {
101101
let roleMap;
102-
if ((0, guard_1.isDefined)(data)) {
103-
if (!(0, guard_1.isObjectArray)(data)) {
102+
if (utils_1.guard.isDefined(data)) {
103+
if (!utils_1.guard.isObjectArray(data)) {
104104
throw new TypeError('roles is malformed');
105105
}
106106
roleMap = data.reduce((acc, role) => {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
export declare class ValueError extends Error {
2+
}
3+
export declare class RepositoryError extends Error {
4+
}
5+
export declare class UnsignedMetadataError extends RepositoryError {
6+
}
7+
export declare class LengthOrHashMismatchError extends RepositoryError {
8+
}
9+
export declare class CryptoError extends Error {
10+
}
11+
export declare class UnsupportedAlgorithmError extends CryptoError {
12+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.UnsupportedAlgorithmError = exports.CryptoError = exports.LengthOrHashMismatchError = exports.UnsignedMetadataError = exports.RepositoryError = exports.ValueError = void 0;
4+
// An error about insufficient values
5+
class ValueError extends Error {
6+
}
7+
exports.ValueError = ValueError;
8+
// An error with a repository's state, such as a missing file.
9+
// It covers all exceptions that come from the repository side when
10+
// looking from the perspective of users of metadata API or ngclient.
11+
class RepositoryError extends Error {
12+
}
13+
exports.RepositoryError = RepositoryError;
14+
// An error about metadata object with insufficient threshold of signatures.
15+
class UnsignedMetadataError extends RepositoryError {
16+
}
17+
exports.UnsignedMetadataError = UnsignedMetadataError;
18+
// An error while checking the length and hash values of an object.
19+
class LengthOrHashMismatchError extends RepositoryError {
20+
}
21+
exports.LengthOrHashMismatchError = LengthOrHashMismatchError;
22+
class CryptoError extends Error {
23+
}
24+
exports.CryptoError = CryptoError;
25+
class UnsupportedAlgorithmError extends CryptoError {
26+
}
27+
exports.UnsupportedAlgorithmError = UnsupportedAlgorithmError;

node_modules/tuf-js/dist/models/file.d.ts renamed to node_modules/@tufjs/models/dist/file.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference types="node" />
22
/// <reference types="node" />
33
import { Readable } from 'stream';
4-
import { JSONObject, JSONValue } from '../utils/types';
4+
import { JSONObject, JSONValue } from './utils';
55
interface MetaFileOptions {
66
version: number;
77
length?: number;

0 commit comments

Comments
 (0)