From 98dd2b881361f7bf4dc322324c45ac75d046fbf1 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 14:51:25 +0200 Subject: [PATCH 1/7] added automatic typescript declarations --- .gitignore | 1 + CHANGELOG.md | 3 +++ package.json | 9 +++++++-- tsconfig.types.json | 12 ++++++++++++ 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 tsconfig.types.json diff --git a/.gitignore b/.gitignore index 26ab9964..698046b1 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ npm-debug.log package-lock.json .nyc_output dist +/types/ \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 2906d27a..c01c00bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # @digitalbazaar/vc ChangeLog +### Added +- Generated TypeScript declarations on install and publish + ## 7.0.0 - 2024-08-01 ### Added diff --git a/package.json b/package.json index 349b6f62..ceb34430 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "license": "BSD-3-Clause", "type": "module", "exports": "./lib/index.js", + "types": "./types/index.d.ts", "files": [ "lib/**/*.js" ], @@ -45,6 +46,7 @@ "@digitalbazaar/ed25519-verification-key-2018": "^4.0.0", "@digitalbazaar/multikey-context": "^2.0.1", "@digitalbazaar/odrl-context": "^1.0.0", + "@types/node": "^22.3.0", "c8": "^10.1.2", "chai": "^4.5.0", "cross-env": "^7.0.3", @@ -64,6 +66,7 @@ "klona": "^2.0.6", "mocha": "^10.7.0", "mocha-lcov-reporter": "^1.3.0", + "typescript": "^5.5.4", "uuid": "^10.0.0", "veres-one-context": "^12.0.0", "webpack": "^5.93.0" @@ -94,6 +97,8 @@ "lint": "eslint 'lib/**/*.js' 'test/**/*.js'", "coverage": "cross-env NODE_ENV=test c8 npm run test-node", "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", - "coverage-report": "c8 report" + "coverage-report": "c8 report", + "prepare": "npm run build-types", + "build-types": "tsc -p tsconfig.json" } -} +} \ No newline at end of file diff --git a/tsconfig.types.json b/tsconfig.types.json new file mode 100644 index 00000000..4354fd60 --- /dev/null +++ b/tsconfig.types.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "allowJs": true, + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "types", + "declarationMap": true + }, + "include": [ + "lib/**/*.js" + ] +} \ No newline at end of file From 251d772d9b57009d3d8b12c7c85a4f532d945717 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:06:46 +0200 Subject: [PATCH 2/7] bugfix tsconfig path --- .gitignore | 3 +-- package.json | 4 ++-- tsconfig.types.json | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 698046b1..4355a6a7 100644 --- a/.gitignore +++ b/.gitignore @@ -16,5 +16,4 @@ v8.log npm-debug.log package-lock.json .nyc_output -dist -/types/ \ No newline at end of file +dist \ No newline at end of file diff --git a/package.json b/package.json index ceb34430..68f5749b 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "license": "BSD-3-Clause", "type": "module", "exports": "./lib/index.js", - "types": "./types/index.d.ts", + "types": "./dist/types/index.d.ts", "files": [ "lib/**/*.js" ], @@ -99,6 +99,6 @@ "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", "coverage-report": "c8 report", "prepare": "npm run build-types", - "build-types": "tsc -p tsconfig.json" + "build-types": "tsc -p tsconfig.types.json" } } \ No newline at end of file diff --git a/tsconfig.types.json b/tsconfig.types.json index 4354fd60..7d571b4f 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -3,7 +3,7 @@ "allowJs": true, "declaration": true, "emitDeclarationOnly": true, - "outDir": "types", + "outDir": "dist/types", "declarationMap": true }, "include": [ From 74123b35510af5601e6515b42f7356f3073427c2 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:12:59 +0200 Subject: [PATCH 3/7] move build-types from prepare to prepack --- CHANGELOG.md | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c01c00bb..f9ff71e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # @digitalbazaar/vc ChangeLog ### Added -- Generated TypeScript declarations on install and publish +- Generate TypeScript declarations for published packages. ## 7.0.0 - 2024-08-01 diff --git a/package.json b/package.json index 68f5749b..7cc18ac6 100644 --- a/package.json +++ b/package.json @@ -98,7 +98,7 @@ "coverage": "cross-env NODE_ENV=test c8 npm run test-node", "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", "coverage-report": "c8 report", - "prepare": "npm run build-types", + "prepack": "npm run build-types", "build-types": "tsc -p tsconfig.types.json" } } \ No newline at end of file From 8196c9bb027ae3bf77279492265fe1e3bc2ef06f Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:18:26 +0200 Subject: [PATCH 4/7] added types for testing --- package.json | 6 +- tsconfig.types.json | 2 +- types/CredentialIssuancePurpose.d.ts | 52 +++++ types/CredentialIssuancePurpose.d.ts.map | 1 + types/contexts/index.d.ts | 2 + types/contexts/index.d.ts.map | 1 + types/documentLoader.d.ts | 6 + types/documentLoader.d.ts.map | 1 + types/helpers.d.ts | 54 +++++ types/helpers.d.ts.map | 1 + types/index.d.ts | 280 +++++++++++++++++++++++ types/index.d.ts.map | 1 + 12 files changed, 404 insertions(+), 3 deletions(-) create mode 100644 types/CredentialIssuancePurpose.d.ts create mode 100644 types/CredentialIssuancePurpose.d.ts.map create mode 100644 types/contexts/index.d.ts create mode 100644 types/contexts/index.d.ts.map create mode 100644 types/documentLoader.d.ts create mode 100644 types/documentLoader.d.ts.map create mode 100644 types/helpers.d.ts create mode 100644 types/helpers.d.ts.map create mode 100644 types/index.d.ts create mode 100644 types/index.d.ts.map diff --git a/package.json b/package.json index 7cc18ac6..3b93a241 100644 --- a/package.json +++ b/package.json @@ -24,9 +24,11 @@ "license": "BSD-3-Clause", "type": "module", "exports": "./lib/index.js", - "types": "./dist/types/index.d.ts", + "types": "./types/index.d.ts", "files": [ - "lib/**/*.js" + "lib/**/*.js", + "types/**/*.d.ts", + "types/**/*.d.ts.map" ], "dependencies": { "@digitalbazaar/credentials-context": "^3.1.0", diff --git a/tsconfig.types.json b/tsconfig.types.json index 7d571b4f..4354fd60 100644 --- a/tsconfig.types.json +++ b/tsconfig.types.json @@ -3,7 +3,7 @@ "allowJs": true, "declaration": true, "emitDeclarationOnly": true, - "outDir": "dist/types", + "outDir": "types", "declarationMap": true }, "include": [ diff --git a/types/CredentialIssuancePurpose.d.ts b/types/CredentialIssuancePurpose.d.ts new file mode 100644 index 00000000..6b997fe6 --- /dev/null +++ b/types/CredentialIssuancePurpose.d.ts @@ -0,0 +1,52 @@ +/** + * Creates a proof purpose that will validate whether or not the verification + * method in a proof was authorized by its declared controller for the + * proof's purpose. + */ +export class CredentialIssuancePurpose { + /** + * @param {object} options - The options to use. + * @param {object} [options.controller] - The description of the controller, + * if it is not to be dereferenced via a `documentLoader`. + * @param {string|Date|number} [options.date] - The expected date for + * the creation of the proof. + * @param {number} [options.maxTimestampDelta=Infinity] - A maximum number + * of seconds that the date on the signature can deviate from. + */ + constructor({ controller, date, maxTimestampDelta }?: { + controller?: object; + date?: string | Date | number; + maxTimestampDelta?: number; + }); + /** + * Validates the purpose of a proof. This method is called during + * proof verification, after the proof value has been checked against the + * given verification method (in the case of a digital signature, the + * signature has been cryptographically verified against the public key). + * + * @param {object} proof - The proof to validate. + * @param {object} options - The options to use. + * @param {object} options.document - The document whose signature is + * being verified. + * @param {object} options.suite - Signature suite used in + * the proof. + * @param {string} options.verificationMethod - Key id URL to the paired + * public key. + * @param {object} [options.documentLoader] - A document loader. + * + * @throws {Error} If verification method not authorized by controller. + * @throws {Error} If proof's created timestamp is out of range. + * + * @returns {Promise<{valid: boolean, error: Error}>} Resolves on completion. + */ + validate(proof: object, { document, suite, verificationMethod, documentLoader }: { + document: object; + suite: object; + verificationMethod: string; + documentLoader?: object; + }): Promise<{ + valid: boolean; + error: Error; + }>; +} +//# sourceMappingURL=CredentialIssuancePurpose.d.ts.map \ No newline at end of file diff --git a/types/CredentialIssuancePurpose.d.ts.map b/types/CredentialIssuancePurpose.d.ts.map new file mode 100644 index 00000000..ff5ea5ae --- /dev/null +++ b/types/CredentialIssuancePurpose.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"CredentialIssuancePurpose.d.ts","sourceRoot":"","sources":["../lib/CredentialIssuancePurpose.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH;IACE;;;;;;;;OAQG;IACH,sDAPG;QAAyB,UAAU,GAA3B,MAAM;QAEuB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAED,iBAAiB,GAAlC,MAAM;KAEhB,EAGA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,gBAfW,MAAM,2DAEd;QAAwB,QAAQ,EAAxB,MAAM;QAEU,KAAK,EAArB,MAAM;QAEU,kBAAkB,EAAlC,MAAM;QAEW,cAAc,GAA/B,MAAM;KAEd,GAGU,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,CAAC,CA+BnD;CACF"} \ No newline at end of file diff --git a/types/contexts/index.d.ts b/types/contexts/index.d.ts new file mode 100644 index 00000000..9a775811 --- /dev/null +++ b/types/contexts/index.d.ts @@ -0,0 +1,2 @@ +export const contexts: Map; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/contexts/index.d.ts.map b/types/contexts/index.d.ts.map new file mode 100644 index 00000000..64eb7357 --- /dev/null +++ b/types/contexts/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/contexts/index.js"],"names":[],"mappings":"AAOA,qCAEG"} \ No newline at end of file diff --git a/types/documentLoader.d.ts b/types/documentLoader.d.ts new file mode 100644 index 00000000..db41a52b --- /dev/null +++ b/types/documentLoader.d.ts @@ -0,0 +1,6 @@ +export function documentLoader(url: any): Promise<{ + contextUrl: any; + documentUrl: any; + document: any; +}>; +//# sourceMappingURL=documentLoader.d.ts.map \ No newline at end of file diff --git a/types/documentLoader.d.ts.map b/types/documentLoader.d.ts.map new file mode 100644 index 00000000..4084fef4 --- /dev/null +++ b/types/documentLoader.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"documentLoader.d.ts","sourceRoot":"","sources":["../lib/documentLoader.js"],"names":[],"mappings":"AAMA;;;;GAUC"} \ No newline at end of file diff --git a/types/helpers.d.ts b/types/helpers.d.ts new file mode 100644 index 00000000..5011585b --- /dev/null +++ b/types/helpers.d.ts @@ -0,0 +1,54 @@ +/** + * Asserts that a context array's first item is a credentials context. + * + * @param {object} options - Options. + * @param {Array} options.context - An array of contexts. + * + * @throws {Error} - Throws if the first context + * is not a credentials context. + * + * @returns {undefined} + */ +export function assertCredentialContext({ context }: { + context: any[]; +}): undefined; +/** + * Throws if a Date is not in the correct format. + * + * @param {object} options - Options. + * @param {object} options.credential - A VC. + * @param {string} options.prop - A prop in the object. + * + * @throws {Error} Throws if the date is not a proper date string. + * @returns {undefined} + */ +export function assertDateString({ credential, prop }: { + credential: object; + prop: string; +}): undefined; +/** + * Turns the first context in a VC into a numbered version. + * + * @param {object} options - Options. + * @param {number} options.version - A credentials context version. + * + * @returns {number} A number representing the version. + */ +export function getContextForVersion({ version }: { + version: number; +}): number; +/** + * Checks if a VC is using a specific context version. + * + * @param {object} options - Options. + * @param {object} options.credential - A VC. + * @param {number} options.version - A VC Context version + * + * @returns {boolean} If the first context matches the version. + */ +export function checkContextVersion({ credential, version }: { + credential: object; + version: number; +}): boolean; +export const dateRegex: RegExp; +//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/types/helpers.d.ts.map b/types/helpers.d.ts.map new file mode 100644 index 00000000..db8bbcac --- /dev/null +++ b/types/helpers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../lib/helpers.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AACH,qDAPG;IAAuB,OAAO;CAE9B,GAGU,SAAS,CAUrB;AAED;;;;;;;;;GASG;AACH,uDANG;IAAwB,UAAU,EAA1B,MAAM;IACU,IAAI,EAApB,MAAM;CAEd,GACU,SAAS,CAOrB;AAeD;;;;;;;GAOG;AACH,kDAJG;IAAwB,OAAO,EAAvB,MAAM;CAEd,GAAU,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,6DALG;IAAwB,UAAU,EAA1B,MAAM;IACU,OAAO,EAAvB,MAAM;CAEd,GAAU,OAAO,CAInB;AA9FD,+BAKoD"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts new file mode 100644 index 00000000..0b8a8b1f --- /dev/null +++ b/types/index.d.ts @@ -0,0 +1,280 @@ +/** + * @typedef {object} LinkedDataSignature + */ +/** + * @typedef {object} Presentation + */ +/** + * @typedef {object} ProofPurpose + */ +/** + * @typedef {object} VerifiableCredential + */ +/** + * @typedef {object} VerifiablePresentation + */ +/** + * @typedef {object} VerifyPresentationResult + * @property {boolean} verified - True if verified, false if not. + * @property {object} presentationResult + * @property {Array} credentialResults + * @property {object} error + */ +/** + * @typedef {object} VerifyCredentialResult + * @property {boolean} verified - True if verified, false if not. + * @property {object} statusResult + * @property {Array} results + * @property {object} error + */ +/** + * Issues a verifiable credential (by taking a base credential document, + * and adding a digital signature to it). + * + * @param {object} [options={}] - The options to use. + * + * @param {object} options.credential - Base credential document. + * @param {LinkedDataSignature} options.suite - Signature suite (with private + * key material or an API to use it), passed in to sign(). + * + * @param {ProofPurpose} [options.purpose] - A ProofPurpose. If not specified, + * a default purpose will be created. + * + * Other optional params passed to `sign()`: + * @param {object} [options.documentLoader] - A document loader. + * @param {string|Date} [options.now] - A string representing date time in + * ISO 8601 format or an instance of Date. Defaults to current date time. + * + * @throws {Error} If missing required properties. + * + * @returns {Promise} Resolves on completion. + */ +export function issue({ credential, suite, purpose, documentLoader, now }?: { + credential: object; + suite: LinkedDataSignature; + purpose?: ProofPurpose; + documentLoader?: object; + now?: string | Date; +}): Promise; +/** + * Derives a proof from the given verifiable credential, resulting in a new + * verifiable credential. This method is usually used to generate selective + * disclosure and / or unlinkable proofs. + * + * @param {object} [options={}] - The options to use. + * + * @param {object} options.verifiableCredential - The verifiable credential + * containing a base proof to derive another proof from. + * @param {LinkedDataSignature} options.suite - Derived proof signature suite. + * + * Other optional params passed to `derive()`: + * @param {object} [options.documentLoader] - A document loader. + * + * @throws {Error} If missing required properties. + * + * @returns {Promise} Resolves on completion. + */ +export function derive({ verifiableCredential, suite, documentLoader }?: { + verifiableCredential: object; + suite: LinkedDataSignature; + documentLoader?: object; +}): Promise; +/** + * Verifies a verifiable presentation: + * - Checks that the presentation is well-formed + * - Checks the proofs (for example, checks digital signatures against the + * provided public keys). + * + * @param {object} [options={}] - The options to use. + * + * @param {VerifiablePresentation} options.presentation - Verifiable + * presentation, signed or unsigned, that may contain within it a + * verifiable credential. + * + * @param {LinkedDataSignature|LinkedDataSignature[]} options.suite - One or + * more signature suites that are supported by the caller's use case. This is + * an explicit design decision -- the calling code must specify which + * signature types (ed25519, RSA, etc) are allowed. + * Although it is expected that the secure resolution/fetching of the public + * key material (to verify against) is to be handled by the documentLoader, + * the suite param can optionally include the key directly. + * + * @param {boolean} [options.unsignedPresentation=false] - By default, this + * function assumes that a presentation is signed (and will return an error if + * a `proof` section is missing). Set this to `true` if you're using an + * unsigned presentation. + * + * Either pass in a proof purpose, + * @param {AuthenticationProofPurpose} [options.presentationPurpose] - Optional + * proof purpose (a default one will be created if not passed in). + * + * or a default purpose will be created with params: + * @param {string} [options.challenge] - Required if purpose is not passed in. + * @param {string} [options.controller] - A controller. + * @param {string} [options.domain] - A domain. + * + * @param {Function} [options.documentLoader] - A document loader. + * @param {Function} [options.checkStatus] - Optional function for checking + * credential status if `credentialStatus` is present on the credential. + * @param {string|Date} [options.now] - A string representing date time in + * ISO 8601 format or an instance of Date. Defaults to current date time. + * + * @returns {Promise} The verification result. + */ +export function verify(options?: { + presentation: VerifiablePresentation; + suite: LinkedDataSignature | LinkedDataSignature[]; + unsignedPresentation?: boolean; + presentationPurpose?: any; + challenge?: string; + controller?: string; + domain?: string; + documentLoader?: Function; + checkStatus?: Function; + now?: string | Date; +}): Promise; +/** + * Verifies a verifiable credential: + * - Checks that the credential is well-formed + * - Checks the proofs (for example, checks digital signatures against the + * provided public keys). + * + * @param {object} [options={}] - The options. + * + * @param {object} options.credential - Verifiable credential. + * + * @param {LinkedDataSignature|LinkedDataSignature[]} options.suite - One or + * more signature suites that are supported by the caller's use case. This is + * an explicit design decision -- the calling code must specify which + * signature types (ed25519, RSA, etc) are allowed. + * Although it is expected that the secure resolution/fetching of the public + * key material (to verify against) is to be handled by the documentLoader, + * the suite param can optionally include the key directly. + * + * @param {CredentialIssuancePurpose} [options.purpose] - Optional + * proof purpose (a default one will be created if not passed in). + * @param {Function} [options.documentLoader] - A document loader. + * @param {Function} [options.checkStatus] - Optional function for checking + * credential status if `credentialStatus` is present on the credential. + * @param {string|Date} [options.now] - A string representing date time in + * ISO 8601 format or an instance of Date. Defaults to current date time. + * + * @returns {Promise} The verification result. + */ +export function verifyCredential(options?: { + credential: object; + suite: LinkedDataSignature | LinkedDataSignature[]; + purpose?: CredentialIssuancePurpose; + documentLoader?: Function; + checkStatus?: Function; + now?: string | Date; +}): Promise; +/** + * Creates an unsigned presentation from a given verifiable credential. + * + * @param {object} options - Options to use. + * @param {object|Array} [options.verifiableCredential] - One or more + * verifiable credential. + * @param {string} [options.id] - Optional VP id. + * @param {string} [options.holder] - Optional presentation holder url. + * @param {string|Date} [options.now] - A string representing date time in + * ISO 8601 format or an instance of Date. Defaults to current date time. + * @param {number} [options.version = 2.0] - The VC context version to use. + * + * @throws {TypeError} If verifiableCredential param is missing. + * @throws {Error} If the credential (or the presentation params) are missing + * required properties. + * + * @returns {Presentation} The credential wrapped inside of a + * VerifiablePresentation. + */ +export function createPresentation({ verifiableCredential, id, holder, now, version }?: { + verifiableCredential?: object | Array; + id?: string; + holder?: string; + now?: string | Date; + version?: number; +}): Presentation; +/** + * Signs a given presentation. + * + * @param {object} [options={}] - Options to use. + * + * Required: + * @param {Presentation} options.presentation - A presentation. + * @param {LinkedDataSignature} options.suite - passed in to sign() + * + * Either pass in a ProofPurpose, or a default one will be created with params: + * @param {ProofPurpose} [options.purpose] - A ProofPurpose. If not specified, + * a default purpose will be created with the domain and challenge options. + * + * @param {string} [options.domain] - A domain. + * @param {string} options.challenge - A required challenge. + * + * @param {Function} [options.documentLoader] - A document loader. + * + * @returns {Promise<{VerifiablePresentation}>} A VerifiablePresentation with + * a proof. + */ +export function signPresentation(options?: { + presentation: Presentation; + suite: LinkedDataSignature; + purpose?: ProofPurpose; + domain?: string; + challenge: string; + documentLoader?: Function; +}): Promise<{ + VerifiablePresentation: any; +}>; +/** + * @param {object} presentation - An object that could be a presentation. + * + * @throws {Error} + * @private + */ +export function _checkPresentation(presentation: object): void; +/** + * @param {object} options - The options. + * @param {object} options.credential - An object that could be a + * VerifiableCredential. + * @param {string|Date} [options.now] - A string representing date time in + * ISO 8601 format or an instance of Date. Defaults to current date time. + * @param {string} [options.mode] - The mode of operation for this + * validation function, either `issue` or `verify`. + * + * @throws {Error} + * @private + */ +export function _checkCredential({ credential, now, mode }?: { + credential: object; + now?: string | Date; + mode?: string; +}): void; +export { dateRegex } from "./helpers.js"; +export const defaultDocumentLoader: any; +export { CredentialIssuancePurpose }; +export type LinkedDataSignature = object; +export type Presentation = object; +export type ProofPurpose = object; +export type VerifiableCredential = object; +export type VerifiablePresentation = object; +export type VerifyPresentationResult = { + /** + * - True if verified, false if not. + */ + verified: boolean; + presentationResult: object; + credentialResults: any[]; + error: object; +}; +export type VerifyCredentialResult = { + /** + * - True if verified, false if not. + */ + verified: boolean; + statusResult: object; + results: any[]; + error: object; +}; +import { CredentialIssuancePurpose } from './CredentialIssuancePurpose.js'; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map new file mode 100644 index 00000000..89a6152e --- /dev/null +++ b/types/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":"AAoDA;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4EAhBG;IAAwB,UAAU,EAA1B,MAAM;IACuB,KAAK,EAAlC,mBAAmB;IAGI,OAAO,GAA9B,YAAY;IAIK,cAAc,GAA/B,MAAM;IACgB,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAEU,OAAO,CAAC,oBAAoB,CAAC,CAgCzC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,yEAXG;IAAwB,oBAAoB,EAApC,MAAM;IAEuB,KAAK,EAAlC,mBAAmB;IAGF,cAAc,GAA/B,MAAM;CAEd,GAEU,OAAO,CAAC,oBAAoB,CAAC,CAsBzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,iCAlCG;IAAwC,YAAY,EAA5C,sBAAsB;IAI6B,KAAK,EAAxD,mBAAmB,GAAC,mBAAmB,EAAE;IAQvB,oBAAoB,GAAtC,OAAO;IAM8B,mBAAmB;IAIvC,SAAS,GAA1B,MAAM;IACW,UAAU,GAA3B,MAAM;IACW,MAAM,GAAvB,MAAM;IAEa,cAAc;IACd,WAAW;IAER,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAAU,OAAO,CAAC,wBAAwB,CAAC,CAiB7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,2CApBG;IAAwB,UAAU,EAA1B,MAAM;IAE6C,KAAK,EAAxD,mBAAmB,GAAC,mBAAmB,EAAE;IAQL,OAAO,GAA3C,yBAAyB;IAEN,cAAc;IACd,WAAW;IAER,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAAU,OAAO,CAAC,sBAAsB,CAAC,CAiB3C;AA4DD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wFAfG;IAAuC,oBAAoB,GAAnD,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC;IAEH,EAAE,GAAnB,MAAM;IACW,MAAM,GAAvB,MAAM;IACgB,GAAG,GAAzB,MAAM,GAAC,IAAI;IAEM,OAAO,GAAxB,MAAM;CAEd,GAIU,YAAY,CA6BxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2CAfG;IAA8B,YAAY,EAAlC,YAAY;IACiB,KAAK,EAAlC,mBAAmB;IAGI,OAAO,GAA9B,YAAY;IAGK,MAAM,GAAvB,MAAM;IACU,SAAS,EAAzB,MAAM;IAEa,cAAc;CAEzC,GAAU,OAAO,CAAC;IAAC,sBAAsB,MAAA;CAAC,CAAC,CAa7C;AAmHD;;;;;GAKG;AACH,iDALW,MAAM,QAiBhB;AAYD;;;;;;;;;;;GAWG;AACH,6DAVG;IAAwB,UAAU,EAA1B,MAAM;IAEgB,GAAG,GAAzB,MAAM,GAAC,IAAI;IAEM,IAAI,GAArB,MAAM;CAGd,QAoIF;;AAnpBD,wCAAgF;;kCAInE,MAAM;2BAIN,MAAM;2BAIN,MAAM;mCAIN,MAAM;qCAIN,MAAM;;;;;cAKL,OAAO;wBACP,MAAM;;WAEN,MAAM;;;;;;cAKN,OAAO;kBACP,MAAM;;WAEN,MAAM;;0CA1CoB,gCAAgC"} \ No newline at end of file From 0c15cc80d06bb9d6a1f0cd96574466d7f2c83c91 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:26:25 +0200 Subject: [PATCH 5/7] change exports to main otherwise typescript would not pick up the types --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3b93a241..79bb778d 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ }, "license": "BSD-3-Clause", "type": "module", - "exports": "./lib/index.js", + "main": "./lib/index.js", "types": "./types/index.d.ts", "files": [ "lib/**/*.js", From 022e817a1a1a13b85412e4b327235cf011775224 Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:38:32 +0200 Subject: [PATCH 6/7] add rimraf and remove temporary types --- package.json | 3 +- types/CredentialIssuancePurpose.d.ts | 52 ----- types/CredentialIssuancePurpose.d.ts.map | 1 - types/contexts/index.d.ts | 2 - types/contexts/index.d.ts.map | 1 - types/documentLoader.d.ts | 6 - types/documentLoader.d.ts.map | 1 - types/helpers.d.ts | 54 ----- types/helpers.d.ts.map | 1 - types/index.d.ts | 280 ----------------------- types/index.d.ts.map | 1 - 11 files changed, 2 insertions(+), 400 deletions(-) delete mode 100644 types/CredentialIssuancePurpose.d.ts delete mode 100644 types/CredentialIssuancePurpose.d.ts.map delete mode 100644 types/contexts/index.d.ts delete mode 100644 types/contexts/index.d.ts.map delete mode 100644 types/documentLoader.d.ts delete mode 100644 types/documentLoader.d.ts.map delete mode 100644 types/helpers.d.ts delete mode 100644 types/helpers.d.ts.map delete mode 100644 types/index.d.ts delete mode 100644 types/index.d.ts.map diff --git a/package.json b/package.json index 79bb778d..6d569b0c 100644 --- a/package.json +++ b/package.json @@ -68,6 +68,7 @@ "klona": "^2.0.6", "mocha": "^10.7.0", "mocha-lcov-reporter": "^1.3.0", + "rimraf": "^6.0.1", "typescript": "^5.5.4", "uuid": "^10.0.0", "veres-one-context": "^12.0.0", @@ -101,6 +102,6 @@ "coverage-ci": "cross-env NODE_ENV=test c8 --reporter=lcovonly --reporter=text-summary --reporter=text npm run test-node", "coverage-report": "c8 report", "prepack": "npm run build-types", - "build-types": "tsc -p tsconfig.types.json" + "build-types": "rimraf types & tsc -p tsconfig.types.json" } } \ No newline at end of file diff --git a/types/CredentialIssuancePurpose.d.ts b/types/CredentialIssuancePurpose.d.ts deleted file mode 100644 index 6b997fe6..00000000 --- a/types/CredentialIssuancePurpose.d.ts +++ /dev/null @@ -1,52 +0,0 @@ -/** - * Creates a proof purpose that will validate whether or not the verification - * method in a proof was authorized by its declared controller for the - * proof's purpose. - */ -export class CredentialIssuancePurpose { - /** - * @param {object} options - The options to use. - * @param {object} [options.controller] - The description of the controller, - * if it is not to be dereferenced via a `documentLoader`. - * @param {string|Date|number} [options.date] - The expected date for - * the creation of the proof. - * @param {number} [options.maxTimestampDelta=Infinity] - A maximum number - * of seconds that the date on the signature can deviate from. - */ - constructor({ controller, date, maxTimestampDelta }?: { - controller?: object; - date?: string | Date | number; - maxTimestampDelta?: number; - }); - /** - * Validates the purpose of a proof. This method is called during - * proof verification, after the proof value has been checked against the - * given verification method (in the case of a digital signature, the - * signature has been cryptographically verified against the public key). - * - * @param {object} proof - The proof to validate. - * @param {object} options - The options to use. - * @param {object} options.document - The document whose signature is - * being verified. - * @param {object} options.suite - Signature suite used in - * the proof. - * @param {string} options.verificationMethod - Key id URL to the paired - * public key. - * @param {object} [options.documentLoader] - A document loader. - * - * @throws {Error} If verification method not authorized by controller. - * @throws {Error} If proof's created timestamp is out of range. - * - * @returns {Promise<{valid: boolean, error: Error}>} Resolves on completion. - */ - validate(proof: object, { document, suite, verificationMethod, documentLoader }: { - document: object; - suite: object; - verificationMethod: string; - documentLoader?: object; - }): Promise<{ - valid: boolean; - error: Error; - }>; -} -//# sourceMappingURL=CredentialIssuancePurpose.d.ts.map \ No newline at end of file diff --git a/types/CredentialIssuancePurpose.d.ts.map b/types/CredentialIssuancePurpose.d.ts.map deleted file mode 100644 index ff5ea5ae..00000000 --- a/types/CredentialIssuancePurpose.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"CredentialIssuancePurpose.d.ts","sourceRoot":"","sources":["../lib/CredentialIssuancePurpose.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH;IACE;;;;;;;;OAQG;IACH,sDAPG;QAAyB,UAAU,GAA3B,MAAM;QAEuB,IAAI,GAAjC,MAAM,GAAC,IAAI,GAAC,MAAM;QAED,iBAAiB,GAAlC,MAAM;KAEhB,EAGA;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,gBAfW,MAAM,2DAEd;QAAwB,QAAQ,EAAxB,MAAM;QAEU,KAAK,EAArB,MAAM;QAEU,kBAAkB,EAAlC,MAAM;QAEW,cAAc,GAA/B,MAAM;KAEd,GAGU,OAAO,CAAC;QAAC,KAAK,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAC,CAAC,CA+BnD;CACF"} \ No newline at end of file diff --git a/types/contexts/index.d.ts b/types/contexts/index.d.ts deleted file mode 100644 index 9a775811..00000000 --- a/types/contexts/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export const contexts: Map; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/contexts/index.d.ts.map b/types/contexts/index.d.ts.map deleted file mode 100644 index 64eb7357..00000000 --- a/types/contexts/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/contexts/index.js"],"names":[],"mappings":"AAOA,qCAEG"} \ No newline at end of file diff --git a/types/documentLoader.d.ts b/types/documentLoader.d.ts deleted file mode 100644 index db41a52b..00000000 --- a/types/documentLoader.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -export function documentLoader(url: any): Promise<{ - contextUrl: any; - documentUrl: any; - document: any; -}>; -//# sourceMappingURL=documentLoader.d.ts.map \ No newline at end of file diff --git a/types/documentLoader.d.ts.map b/types/documentLoader.d.ts.map deleted file mode 100644 index 4084fef4..00000000 --- a/types/documentLoader.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"documentLoader.d.ts","sourceRoot":"","sources":["../lib/documentLoader.js"],"names":[],"mappings":"AAMA;;;;GAUC"} \ No newline at end of file diff --git a/types/helpers.d.ts b/types/helpers.d.ts deleted file mode 100644 index 5011585b..00000000 --- a/types/helpers.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Asserts that a context array's first item is a credentials context. - * - * @param {object} options - Options. - * @param {Array} options.context - An array of contexts. - * - * @throws {Error} - Throws if the first context - * is not a credentials context. - * - * @returns {undefined} - */ -export function assertCredentialContext({ context }: { - context: any[]; -}): undefined; -/** - * Throws if a Date is not in the correct format. - * - * @param {object} options - Options. - * @param {object} options.credential - A VC. - * @param {string} options.prop - A prop in the object. - * - * @throws {Error} Throws if the date is not a proper date string. - * @returns {undefined} - */ -export function assertDateString({ credential, prop }: { - credential: object; - prop: string; -}): undefined; -/** - * Turns the first context in a VC into a numbered version. - * - * @param {object} options - Options. - * @param {number} options.version - A credentials context version. - * - * @returns {number} A number representing the version. - */ -export function getContextForVersion({ version }: { - version: number; -}): number; -/** - * Checks if a VC is using a specific context version. - * - * @param {object} options - Options. - * @param {object} options.credential - A VC. - * @param {number} options.version - A VC Context version - * - * @returns {boolean} If the first context matches the version. - */ -export function checkContextVersion({ credential, version }: { - credential: object; - version: number; -}): boolean; -export const dateRegex: RegExp; -//# sourceMappingURL=helpers.d.ts.map \ No newline at end of file diff --git a/types/helpers.d.ts.map b/types/helpers.d.ts.map deleted file mode 100644 index db8bbcac..00000000 --- a/types/helpers.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../lib/helpers.js"],"names":[],"mappings":"AA4BA;;;;;;;;;;GAUG;AACH,qDAPG;IAAuB,OAAO;CAE9B,GAGU,SAAS,CAUrB;AAED;;;;;;;;;GASG;AACH,uDANG;IAAwB,UAAU,EAA1B,MAAM;IACU,IAAI,EAApB,MAAM;CAEd,GACU,SAAS,CAOrB;AAeD;;;;;;;GAOG;AACH,kDAJG;IAAwB,OAAO,EAAvB,MAAM;CAEd,GAAU,MAAM,CAIlB;AAED;;;;;;;;GAQG;AACH,6DALG;IAAwB,UAAU,EAA1B,MAAM;IACU,OAAO,EAAvB,MAAM;CAEd,GAAU,OAAO,CAInB;AA9FD,+BAKoD"} \ No newline at end of file diff --git a/types/index.d.ts b/types/index.d.ts deleted file mode 100644 index 0b8a8b1f..00000000 --- a/types/index.d.ts +++ /dev/null @@ -1,280 +0,0 @@ -/** - * @typedef {object} LinkedDataSignature - */ -/** - * @typedef {object} Presentation - */ -/** - * @typedef {object} ProofPurpose - */ -/** - * @typedef {object} VerifiableCredential - */ -/** - * @typedef {object} VerifiablePresentation - */ -/** - * @typedef {object} VerifyPresentationResult - * @property {boolean} verified - True if verified, false if not. - * @property {object} presentationResult - * @property {Array} credentialResults - * @property {object} error - */ -/** - * @typedef {object} VerifyCredentialResult - * @property {boolean} verified - True if verified, false if not. - * @property {object} statusResult - * @property {Array} results - * @property {object} error - */ -/** - * Issues a verifiable credential (by taking a base credential document, - * and adding a digital signature to it). - * - * @param {object} [options={}] - The options to use. - * - * @param {object} options.credential - Base credential document. - * @param {LinkedDataSignature} options.suite - Signature suite (with private - * key material or an API to use it), passed in to sign(). - * - * @param {ProofPurpose} [options.purpose] - A ProofPurpose. If not specified, - * a default purpose will be created. - * - * Other optional params passed to `sign()`: - * @param {object} [options.documentLoader] - A document loader. - * @param {string|Date} [options.now] - A string representing date time in - * ISO 8601 format or an instance of Date. Defaults to current date time. - * - * @throws {Error} If missing required properties. - * - * @returns {Promise} Resolves on completion. - */ -export function issue({ credential, suite, purpose, documentLoader, now }?: { - credential: object; - suite: LinkedDataSignature; - purpose?: ProofPurpose; - documentLoader?: object; - now?: string | Date; -}): Promise; -/** - * Derives a proof from the given verifiable credential, resulting in a new - * verifiable credential. This method is usually used to generate selective - * disclosure and / or unlinkable proofs. - * - * @param {object} [options={}] - The options to use. - * - * @param {object} options.verifiableCredential - The verifiable credential - * containing a base proof to derive another proof from. - * @param {LinkedDataSignature} options.suite - Derived proof signature suite. - * - * Other optional params passed to `derive()`: - * @param {object} [options.documentLoader] - A document loader. - * - * @throws {Error} If missing required properties. - * - * @returns {Promise} Resolves on completion. - */ -export function derive({ verifiableCredential, suite, documentLoader }?: { - verifiableCredential: object; - suite: LinkedDataSignature; - documentLoader?: object; -}): Promise; -/** - * Verifies a verifiable presentation: - * - Checks that the presentation is well-formed - * - Checks the proofs (for example, checks digital signatures against the - * provided public keys). - * - * @param {object} [options={}] - The options to use. - * - * @param {VerifiablePresentation} options.presentation - Verifiable - * presentation, signed or unsigned, that may contain within it a - * verifiable credential. - * - * @param {LinkedDataSignature|LinkedDataSignature[]} options.suite - One or - * more signature suites that are supported by the caller's use case. This is - * an explicit design decision -- the calling code must specify which - * signature types (ed25519, RSA, etc) are allowed. - * Although it is expected that the secure resolution/fetching of the public - * key material (to verify against) is to be handled by the documentLoader, - * the suite param can optionally include the key directly. - * - * @param {boolean} [options.unsignedPresentation=false] - By default, this - * function assumes that a presentation is signed (and will return an error if - * a `proof` section is missing). Set this to `true` if you're using an - * unsigned presentation. - * - * Either pass in a proof purpose, - * @param {AuthenticationProofPurpose} [options.presentationPurpose] - Optional - * proof purpose (a default one will be created if not passed in). - * - * or a default purpose will be created with params: - * @param {string} [options.challenge] - Required if purpose is not passed in. - * @param {string} [options.controller] - A controller. - * @param {string} [options.domain] - A domain. - * - * @param {Function} [options.documentLoader] - A document loader. - * @param {Function} [options.checkStatus] - Optional function for checking - * credential status if `credentialStatus` is present on the credential. - * @param {string|Date} [options.now] - A string representing date time in - * ISO 8601 format or an instance of Date. Defaults to current date time. - * - * @returns {Promise} The verification result. - */ -export function verify(options?: { - presentation: VerifiablePresentation; - suite: LinkedDataSignature | LinkedDataSignature[]; - unsignedPresentation?: boolean; - presentationPurpose?: any; - challenge?: string; - controller?: string; - domain?: string; - documentLoader?: Function; - checkStatus?: Function; - now?: string | Date; -}): Promise; -/** - * Verifies a verifiable credential: - * - Checks that the credential is well-formed - * - Checks the proofs (for example, checks digital signatures against the - * provided public keys). - * - * @param {object} [options={}] - The options. - * - * @param {object} options.credential - Verifiable credential. - * - * @param {LinkedDataSignature|LinkedDataSignature[]} options.suite - One or - * more signature suites that are supported by the caller's use case. This is - * an explicit design decision -- the calling code must specify which - * signature types (ed25519, RSA, etc) are allowed. - * Although it is expected that the secure resolution/fetching of the public - * key material (to verify against) is to be handled by the documentLoader, - * the suite param can optionally include the key directly. - * - * @param {CredentialIssuancePurpose} [options.purpose] - Optional - * proof purpose (a default one will be created if not passed in). - * @param {Function} [options.documentLoader] - A document loader. - * @param {Function} [options.checkStatus] - Optional function for checking - * credential status if `credentialStatus` is present on the credential. - * @param {string|Date} [options.now] - A string representing date time in - * ISO 8601 format or an instance of Date. Defaults to current date time. - * - * @returns {Promise} The verification result. - */ -export function verifyCredential(options?: { - credential: object; - suite: LinkedDataSignature | LinkedDataSignature[]; - purpose?: CredentialIssuancePurpose; - documentLoader?: Function; - checkStatus?: Function; - now?: string | Date; -}): Promise; -/** - * Creates an unsigned presentation from a given verifiable credential. - * - * @param {object} options - Options to use. - * @param {object|Array} [options.verifiableCredential] - One or more - * verifiable credential. - * @param {string} [options.id] - Optional VP id. - * @param {string} [options.holder] - Optional presentation holder url. - * @param {string|Date} [options.now] - A string representing date time in - * ISO 8601 format or an instance of Date. Defaults to current date time. - * @param {number} [options.version = 2.0] - The VC context version to use. - * - * @throws {TypeError} If verifiableCredential param is missing. - * @throws {Error} If the credential (or the presentation params) are missing - * required properties. - * - * @returns {Presentation} The credential wrapped inside of a - * VerifiablePresentation. - */ -export function createPresentation({ verifiableCredential, id, holder, now, version }?: { - verifiableCredential?: object | Array; - id?: string; - holder?: string; - now?: string | Date; - version?: number; -}): Presentation; -/** - * Signs a given presentation. - * - * @param {object} [options={}] - Options to use. - * - * Required: - * @param {Presentation} options.presentation - A presentation. - * @param {LinkedDataSignature} options.suite - passed in to sign() - * - * Either pass in a ProofPurpose, or a default one will be created with params: - * @param {ProofPurpose} [options.purpose] - A ProofPurpose. If not specified, - * a default purpose will be created with the domain and challenge options. - * - * @param {string} [options.domain] - A domain. - * @param {string} options.challenge - A required challenge. - * - * @param {Function} [options.documentLoader] - A document loader. - * - * @returns {Promise<{VerifiablePresentation}>} A VerifiablePresentation with - * a proof. - */ -export function signPresentation(options?: { - presentation: Presentation; - suite: LinkedDataSignature; - purpose?: ProofPurpose; - domain?: string; - challenge: string; - documentLoader?: Function; -}): Promise<{ - VerifiablePresentation: any; -}>; -/** - * @param {object} presentation - An object that could be a presentation. - * - * @throws {Error} - * @private - */ -export function _checkPresentation(presentation: object): void; -/** - * @param {object} options - The options. - * @param {object} options.credential - An object that could be a - * VerifiableCredential. - * @param {string|Date} [options.now] - A string representing date time in - * ISO 8601 format or an instance of Date. Defaults to current date time. - * @param {string} [options.mode] - The mode of operation for this - * validation function, either `issue` or `verify`. - * - * @throws {Error} - * @private - */ -export function _checkCredential({ credential, now, mode }?: { - credential: object; - now?: string | Date; - mode?: string; -}): void; -export { dateRegex } from "./helpers.js"; -export const defaultDocumentLoader: any; -export { CredentialIssuancePurpose }; -export type LinkedDataSignature = object; -export type Presentation = object; -export type ProofPurpose = object; -export type VerifiableCredential = object; -export type VerifiablePresentation = object; -export type VerifyPresentationResult = { - /** - * - True if verified, false if not. - */ - verified: boolean; - presentationResult: object; - credentialResults: any[]; - error: object; -}; -export type VerifyCredentialResult = { - /** - * - True if verified, false if not. - */ - verified: boolean; - statusResult: object; - results: any[]; - error: object; -}; -import { CredentialIssuancePurpose } from './CredentialIssuancePurpose.js'; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/types/index.d.ts.map b/types/index.d.ts.map deleted file mode 100644 index 89a6152e..00000000 --- a/types/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.js"],"names":[],"mappings":"AAoDA;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;;GAMG;AAEH;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,4EAhBG;IAAwB,UAAU,EAA1B,MAAM;IACuB,KAAK,EAAlC,mBAAmB;IAGI,OAAO,GAA9B,YAAY;IAIK,cAAc,GAA/B,MAAM;IACgB,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAEU,OAAO,CAAC,oBAAoB,CAAC,CAgCzC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,yEAXG;IAAwB,oBAAoB,EAApC,MAAM;IAEuB,KAAK,EAAlC,mBAAmB;IAGF,cAAc,GAA/B,MAAM;CAEd,GAEU,OAAO,CAAC,oBAAoB,CAAC,CAsBzC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,iCAlCG;IAAwC,YAAY,EAA5C,sBAAsB;IAI6B,KAAK,EAAxD,mBAAmB,GAAC,mBAAmB,EAAE;IAQvB,oBAAoB,GAAtC,OAAO;IAM8B,mBAAmB;IAIvC,SAAS,GAA1B,MAAM;IACW,UAAU,GAA3B,MAAM;IACW,MAAM,GAAvB,MAAM;IAEa,cAAc;IACd,WAAW;IAER,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAAU,OAAO,CAAC,wBAAwB,CAAC,CAiB7C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,2CApBG;IAAwB,UAAU,EAA1B,MAAM;IAE6C,KAAK,EAAxD,mBAAmB,GAAC,mBAAmB,EAAE;IAQL,OAAO,GAA3C,yBAAyB;IAEN,cAAc;IACd,WAAW;IAER,GAAG,GAAzB,MAAM,GAAC,IAAI;CAGnB,GAAU,OAAO,CAAC,sBAAsB,CAAC,CAiB3C;AA4DD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wFAfG;IAAuC,oBAAoB,GAAnD,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC;IAEH,EAAE,GAAnB,MAAM;IACW,MAAM,GAAvB,MAAM;IACgB,GAAG,GAAzB,MAAM,GAAC,IAAI;IAEM,OAAO,GAAxB,MAAM;CAEd,GAIU,YAAY,CA6BxB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,2CAfG;IAA8B,YAAY,EAAlC,YAAY;IACiB,KAAK,EAAlC,mBAAmB;IAGI,OAAO,GAA9B,YAAY;IAGK,MAAM,GAAvB,MAAM;IACU,SAAS,EAAzB,MAAM;IAEa,cAAc;CAEzC,GAAU,OAAO,CAAC;IAAC,sBAAsB,MAAA;CAAC,CAAC,CAa7C;AAmHD;;;;;GAKG;AACH,iDALW,MAAM,QAiBhB;AAYD;;;;;;;;;;;GAWG;AACH,6DAVG;IAAwB,UAAU,EAA1B,MAAM;IAEgB,GAAG,GAAzB,MAAM,GAAC,IAAI;IAEM,IAAI,GAArB,MAAM;CAGd,QAoIF;;AAnpBD,wCAAgF;;kCAInE,MAAM;2BAIN,MAAM;2BAIN,MAAM;mCAIN,MAAM;qCAIN,MAAM;;;;;cAKL,OAAO;wBACP,MAAM;;WAEN,MAAM;;;;;;cAKN,OAAO;kBACP,MAAM;;WAEN,MAAM;;0CA1CoB,gCAAgC"} \ No newline at end of file From 33fc7acf31b2bf4aa7d3f748c9d89d52d664cc6d Mon Sep 17 00:00:00 2001 From: Simon Petrac Date: Thu, 15 Aug 2024 15:38:47 +0200 Subject: [PATCH 7/7] add types back to gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4355a6a7..698046b1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ v8.log npm-debug.log package-lock.json .nyc_output -dist \ No newline at end of file +dist +/types/ \ No newline at end of file