@twin.org/immutable-proof-models 0.0.2-next.2 → 0.0.3-next.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/es/dataTypes/immutableProofDataTypes.js +23 -0
- package/dist/es/dataTypes/immutableProofDataTypes.js.map +1 -0
- package/dist/es/index.js +17 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IImmutableProof.js +2 -0
- package/dist/es/models/IImmutableProof.js.map +1 -0
- package/dist/es/models/IImmutableProofComponent.js +2 -0
- package/dist/es/models/IImmutableProofComponent.js.map +1 -0
- package/dist/es/models/IImmutableProofVerification.js +2 -0
- package/dist/es/models/IImmutableProofVerification.js.map +1 -0
- package/dist/es/models/api/IImmutableProofCreateRequest.js +2 -0
- package/dist/es/models/api/IImmutableProofCreateRequest.js.map +1 -0
- package/dist/es/models/api/IImmutableProofGetRequest.js +2 -0
- package/dist/es/models/api/IImmutableProofGetRequest.js.map +1 -0
- package/dist/es/models/api/IImmutableProofGetResponse.js +2 -0
- package/dist/es/models/api/IImmutableProofGetResponse.js.map +1 -0
- package/dist/es/models/api/IImmutableProofVerifyRequest.js +2 -0
- package/dist/es/models/api/IImmutableProofVerifyRequest.js.map +1 -0
- package/dist/es/models/api/IImmutableProofVerifyResponse.js +2 -0
- package/dist/es/models/api/IImmutableProofVerifyResponse.js.map +1 -0
- package/dist/es/models/eventBus/IImmutableProofEventBusProofCreated.js +4 -0
- package/dist/es/models/eventBus/IImmutableProofEventBusProofCreated.js.map +1 -0
- package/dist/es/models/immutableProofContexts.js +17 -0
- package/dist/es/models/immutableProofContexts.js.map +1 -0
- package/dist/es/models/immutableProofFailure.js +29 -0
- package/dist/es/models/immutableProofFailure.js.map +1 -0
- package/dist/es/models/immutableProofTopics.js +13 -0
- package/dist/es/models/immutableProofTopics.js.map +1 -0
- package/dist/es/models/immutableProofTypes.js +17 -0
- package/dist/es/models/immutableProofTypes.js.map +1 -0
- package/dist/es/schemas/ImmutableProof.json +62 -0
- package/dist/types/index.d.ts +14 -14
- package/dist/types/models/IImmutableProof.d.ts +2 -10
- package/dist/types/models/IImmutableProofComponent.d.ts +4 -7
- package/dist/types/models/IImmutableProofVerification.d.ts +3 -3
- package/dist/types/models/api/IImmutableProofGetResponse.d.ts +1 -1
- package/dist/types/models/api/IImmutableProofVerifyResponse.d.ts +1 -1
- package/docs/changelog.md +27 -0
- package/docs/reference/interfaces/IImmutableProof.md +0 -16
- package/docs/reference/interfaces/IImmutableProofComponent.md +2 -20
- package/package.json +21 -8
- package/dist/cjs/index.cjs +0 -184
- package/dist/esm/index.mjs +0 -178
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { DataTypeHandlerFactory } from "@twin.org/data-core";
|
|
4
|
+
import { ImmutableProofContexts } from "../models/immutableProofContexts.js";
|
|
5
|
+
import { ImmutableProofTypes } from "../models/immutableProofTypes.js";
|
|
6
|
+
import ImmutableProofSchema from "../schemas/ImmutableProof.json" with { type: "json" };
|
|
7
|
+
/**
|
|
8
|
+
* Handle all the data types for immutable proof.
|
|
9
|
+
*/
|
|
10
|
+
export class ImmutableProofDataTypes {
|
|
11
|
+
/**
|
|
12
|
+
* Register all the data types.
|
|
13
|
+
*/
|
|
14
|
+
static registerTypes() {
|
|
15
|
+
DataTypeHandlerFactory.register(`${ImmutableProofContexts.ContextRoot}${ImmutableProofTypes.ImmutableProof}`, () => ({
|
|
16
|
+
context: ImmutableProofContexts.ContextRoot,
|
|
17
|
+
type: ImmutableProofTypes.ImmutableProof,
|
|
18
|
+
defaultValue: {},
|
|
19
|
+
jsonSchema: async () => ImmutableProofSchema
|
|
20
|
+
}));
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=immutableProofDataTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutableProofDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/immutableProofDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,oBAAoB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAExF;;GAEG;AACH,MAAM,OAAO,uBAAuB;IACnC;;OAEG;IACI,MAAM,CAAC,aAAa;QAC1B,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,sBAAsB,CAAC,WAAW,GAAG,mBAAmB,CAAC,cAAc,EAAE,EAC5E,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,sBAAsB,CAAC,WAAW;YAC3C,IAAI,EAAE,mBAAmB,CAAC,cAAc;YACxC,YAAY,EAAE,EAAE;YAChB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,oBAAmC;SAC3D,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { ImmutableProofContexts } from \"../models/immutableProofContexts.js\";\nimport { ImmutableProofTypes } from \"../models/immutableProofTypes.js\";\nimport ImmutableProofSchema from \"../schemas/ImmutableProof.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for immutable proof.\n */\nexport class ImmutableProofDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${ImmutableProofContexts.ContextRoot}${ImmutableProofTypes.ImmutableProof}`,\n\t\t\t() => ({\n\t\t\t\tcontext: ImmutableProofContexts.ContextRoot,\n\t\t\t\ttype: ImmutableProofTypes.ImmutableProof,\n\t\t\t\tdefaultValue: {},\n\t\t\t\tjsonSchema: async () => ImmutableProofSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
|
package/dist/es/index.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
export * from "./dataTypes/immutableProofDataTypes.js";
|
|
4
|
+
export * from "./models/api/IImmutableProofCreateRequest.js";
|
|
5
|
+
export * from "./models/api/IImmutableProofGetRequest.js";
|
|
6
|
+
export * from "./models/api/IImmutableProofGetResponse.js";
|
|
7
|
+
export * from "./models/api/IImmutableProofVerifyRequest.js";
|
|
8
|
+
export * from "./models/api/IImmutableProofVerifyResponse.js";
|
|
9
|
+
export * from "./models/eventBus/IImmutableProofEventBusProofCreated.js";
|
|
10
|
+
export * from "./models/IImmutableProof.js";
|
|
11
|
+
export * from "./models/IImmutableProofComponent.js";
|
|
12
|
+
export * from "./models/IImmutableProofVerification.js";
|
|
13
|
+
export * from "./models/immutableProofContexts.js";
|
|
14
|
+
export * from "./models/immutableProofFailure.js";
|
|
15
|
+
export * from "./models/immutableProofTopics.js";
|
|
16
|
+
export * from "./models/immutableProofTypes.js";
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,cAAc,wCAAwC,CAAC;AACvD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0DAA0D,CAAC;AACzE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,yCAAyC,CAAC;AACxD,cAAc,oCAAoC,CAAC;AACnD,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nexport * from \"./dataTypes/immutableProofDataTypes.js\";\nexport * from \"./models/api/IImmutableProofCreateRequest.js\";\nexport * from \"./models/api/IImmutableProofGetRequest.js\";\nexport * from \"./models/api/IImmutableProofGetResponse.js\";\nexport * from \"./models/api/IImmutableProofVerifyRequest.js\";\nexport * from \"./models/api/IImmutableProofVerifyResponse.js\";\nexport * from \"./models/eventBus/IImmutableProofEventBusProofCreated.js\";\nexport * from \"./models/IImmutableProof.js\";\nexport * from \"./models/IImmutableProofComponent.js\";\nexport * from \"./models/IImmutableProofVerification.js\";\nexport * from \"./models/immutableProofContexts.js\";\nexport * from \"./models/immutableProofFailure.js\";\nexport * from \"./models/immutableProofTopics.js\";\nexport * from \"./models/immutableProofTypes.js\";\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProof.js","sourceRoot":"","sources":["../../../src/models/IImmutableProof.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { IDataIntegrityProof } from \"@twin.org/standards-w3c-did\";\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof state.\n */\nexport interface IImmutableProof {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": [\n\t\ttypeof ImmutableProofContexts.ContextRoot,\n\t\ttypeof ImmutableProofContexts.ContextRootCommon,\n\t\t...IJsonLdContextDefinitionElement[]\n\t];\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProof;\n\n\t/**\n\t * The id of the proof.\n\t */\n\tid: string;\n\n\t/**\n\t * The id of the object associated with the proof.\n\t */\n\tproofObjectId?: string;\n\n\t/**\n\t * The hash of the object associated with the proof.\n\t */\n\tproofObjectHash: string;\n\n\t/**\n\t * The verifiable storage id for where the proof is stored.\n\t */\n\tverifiableStorageId?: string;\n\n\t/**\n\t * The proof which can be undefined if it has not yet been issued.\n\t */\n\tproof?: IDataIntegrityProof;\n\n\t/**\n\t * The immutable receipt detail for where the proof is stored.\n\t */\n\timmutableReceipt?: IJsonLdNodeObject;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofComponent.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofComponent.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IComponent } from \"@twin.org/core\";\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\nimport type { IImmutableProof } from \"./IImmutableProof.js\";\nimport type { IImmutableProofVerification } from \"./IImmutableProofVerification.js\";\n\n/**\n * Interface describing an immutable proof contract.\n */\nexport interface IImmutableProofComponent extends IComponent {\n\t/**\n\t * Create a new proof.\n\t * @param document The document to create the proof for.\n\t * @returns The id of the new proof.\n\t */\n\tcreate(document: IJsonLdNodeObject): Promise<string>;\n\n\t/**\n\t * Get a proof.\n\t * @param id The id of the proof to get.\n\t * @returns The proof.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tget(id: string): Promise<IImmutableProof>;\n\n\t/**\n\t * Verify a proof.\n\t * @param id The id of the proof to verify.\n\t * @returns The result of the verification and any failures.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tverify(id: string): Promise<IImmutableProofVerification>;\n\n\t/**\n\t * Remove the verifiable storage for the proof.\n\t * @param id The id of the proof to remove the storage from.\n\t * @returns Nothing.\n\t * @throws NotFoundError if the proof is not found.\n\t */\n\tremoveVerifiable(id: string): Promise<void>;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofVerification.js","sourceRoot":"","sources":["../../../src/models/IImmutableProofVerification.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { ImmutableProofContexts } from \"./immutableProofContexts.js\";\nimport type { ImmutableProofFailure } from \"./immutableProofFailure.js\";\nimport type { ImmutableProofTypes } from \"./immutableProofTypes.js\";\n\n/**\n * Interface describing an immutable proof verification.\n */\nexport interface IImmutableProofVerification {\n\t/**\n\t * JSON-LD Context.\n\t */\n\t\"@context\": typeof ImmutableProofContexts.ContextRoot;\n\n\t/**\n\t * JSON-LD Type.\n\t */\n\ttype: typeof ImmutableProofTypes.ImmutableProofVerification;\n\n\t/**\n\t * Was the verification successful.\n\t */\n\tverified: boolean;\n\n\t/**\n\t * If the verification was unsuccessful the failure reason.\n\t */\n\tfailure?: ImmutableProofFailure;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofCreateRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofCreateRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdNodeObject } from \"@twin.org/data-json-ld\";\n\n/**\n * Create a proof.\n */\nexport interface IImmutableProofCreateRequest {\n\t/**\n\t * The parameters from the body.\n\t */\n\tbody: {\n\t\t/**\n\t\t * The document to create the proof for.\n\t\t */\n\t\tdocument: IJsonLdNodeObject;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofGetRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofGetRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Get a proof.\n */\nexport interface IImmutableProofGetRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The parameters from the path.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the immutable proof to get.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofGetResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofGetResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IImmutableProof } from \"../IImmutableProof.js\";\n\n/**\n * Response to getting an immutable proof.\n */\nexport interface IImmutableProofGetResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The response body.\n\t */\n\tbody: IImmutableProof;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofVerifyRequest.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofVerifyRequest.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\n\n/**\n * Verify a proof.\n */\nexport interface IImmutableProofVerifyRequest {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.Accept]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The parameters from the path.\n\t */\n\tpathParams: {\n\t\t/**\n\t\t * The id of the immutable proof to verify.\n\t\t */\n\t\tid: string;\n\t};\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofVerifyResponse.js","sourceRoot":"","sources":["../../../../src/models/api/IImmutableProofVerifyResponse.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { HeaderTypes, MimeTypes } from \"@twin.org/web\";\nimport type { IImmutableProofVerification } from \"../IImmutableProofVerification.js\";\n\n/**\n * Response to verifying an immutable proof.\n */\nexport interface IImmutableProofVerifyResponse {\n\t/**\n\t * The headers which can be used to determine the response data type.\n\t */\n\theaders?: {\n\t\t[HeaderTypes.ContentType]: typeof MimeTypes.Json | typeof MimeTypes.JsonLd;\n\t};\n\n\t/**\n\t * The response body.\n\t */\n\tbody: IImmutableProofVerification;\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IImmutableProofEventBusProofCreated.js","sourceRoot":"","sources":["../../../../src/models/eventBus/IImmutableProofEventBusProofCreated.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * Event bus payload for proof created.\n */\nexport interface IImmutableProofEventBusProofCreated {\n\t/**\n\t * The id of the proof created.\n\t */\n\tid: string;\n}\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The contexts of immutable proof data.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const ImmutableProofContexts = {
|
|
8
|
+
/**
|
|
9
|
+
* The context root for the immutable proof types.
|
|
10
|
+
*/
|
|
11
|
+
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
12
|
+
/**
|
|
13
|
+
* The context root for the common types.
|
|
14
|
+
*/
|
|
15
|
+
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=immutableProofContexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutableProofContexts.js","sourceRoot":"","sources":["../../../src/models/immutableProofContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACrC;;OAEG;IACH,WAAW,EAAE,6CAA6C;IAE1D;;OAEG;IACH,iBAAiB,EAAE,oCAAoC;CAC9C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of immutable proof data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofContexts = {\n\t/**\n\t * The context root for the immutable proof types.\n\t */\n\tContextRoot: \"https://schema.twindev.org/immutable-proof/\",\n\n\t/**\n\t * The context root for the common types.\n\t */\n\tContextRootCommon: \"https://schema.twindev.org/common/\"\n} as const;\n\n/**\n * The contexts of immutable proof data.\n */\nexport type ImmutableProofContexts =\n\t(typeof ImmutableProofContexts)[keyof typeof ImmutableProofContexts];\n"]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The failure reason of the proof.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const ImmutableProofFailure = {
|
|
8
|
+
/**
|
|
9
|
+
* Proof not yet issued.
|
|
10
|
+
*/
|
|
11
|
+
NotIssued: "notIssued",
|
|
12
|
+
/**
|
|
13
|
+
* Proof missing.
|
|
14
|
+
*/
|
|
15
|
+
ProofMissing: "proofMissing",
|
|
16
|
+
/**
|
|
17
|
+
* Crypto suite mismatch.
|
|
18
|
+
*/
|
|
19
|
+
CryptoSuiteMismatch: "cryptoSuiteMismatch",
|
|
20
|
+
/**
|
|
21
|
+
* Proof type.
|
|
22
|
+
*/
|
|
23
|
+
ProofTypeMismatch: "proofTypeMismatch",
|
|
24
|
+
/**
|
|
25
|
+
* Signature mismatch.
|
|
26
|
+
*/
|
|
27
|
+
SignatureMismatch: "signatureMismatch"
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=immutableProofFailure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutableProofFailure.js","sourceRoot":"","sources":["../../../src/models/immutableProofFailure.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACpC;;OAEG;IACH,SAAS,EAAE,WAAW;IAEtB;;OAEG;IACH,YAAY,EAAE,cAAc;IAE5B;;OAEG;IACH,mBAAmB,EAAE,qBAAqB;IAE1C;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;IAEtC;;OAEG;IACH,iBAAiB,EAAE,mBAAmB;CAC7B,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The failure reason of the proof.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofFailure = {\n\t/**\n\t * Proof not yet issued.\n\t */\n\tNotIssued: \"notIssued\",\n\n\t/**\n\t * Proof missing.\n\t */\n\tProofMissing: \"proofMissing\",\n\n\t/**\n\t * Crypto suite mismatch.\n\t */\n\tCryptoSuiteMismatch: \"cryptoSuiteMismatch\",\n\n\t/**\n\t * Proof type.\n\t */\n\tProofTypeMismatch: \"proofTypeMismatch\",\n\n\t/**\n\t * Signature mismatch.\n\t */\n\tSignatureMismatch: \"signatureMismatch\"\n} as const;\n\n/**\n * The failure reason of the proof.\n */\nexport type ImmutableProofFailure =\n\t(typeof ImmutableProofFailure)[keyof typeof ImmutableProofFailure];\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The topics for immutable proof event bus notifications.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const ImmutableProofTopics = {
|
|
8
|
+
/**
|
|
9
|
+
* A proof was created.
|
|
10
|
+
*/
|
|
11
|
+
ProofCreated: "immutable-proof:proof-created"
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=immutableProofTopics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutableProofTopics.js","sourceRoot":"","sources":["../../../src/models/immutableProofTopics.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC;;OAEG;IACH,YAAY,EAAE,+BAA+B;CACpC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The topics for immutable proof event bus notifications.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofTopics = {\n\t/**\n\t * A proof was created.\n\t */\n\tProofCreated: \"immutable-proof:proof-created\"\n} as const;\n\n/**\n * The topics for immutable proof event bus notifications.\n */\nexport type ImmutableProofTopics = (typeof ImmutableProofTopics)[keyof typeof ImmutableProofTopics];\n"]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
/**
|
|
4
|
+
* The types of immutable proof data.
|
|
5
|
+
*/
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
|
+
export const ImmutableProofTypes = {
|
|
8
|
+
/**
|
|
9
|
+
* Represents Immutable Proof.
|
|
10
|
+
*/
|
|
11
|
+
ImmutableProof: "ImmutableProof",
|
|
12
|
+
/**
|
|
13
|
+
* Represents Immutable Proof Verification.
|
|
14
|
+
*/
|
|
15
|
+
ImmutableProofVerification: "ImmutableProofVerification"
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=immutableProofTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"immutableProofTypes.js","sourceRoot":"","sources":["../../../src/models/immutableProofTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,mBAAmB,GAAG;IAClC;;OAEG;IACH,cAAc,EAAE,gBAAgB;IAEhC;;OAEG;IACH,0BAA0B,EAAE,4BAA4B;CAC/C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of immutable proof data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const ImmutableProofTypes = {\n\t/**\n\t * Represents Immutable Proof.\n\t */\n\tImmutableProof: \"ImmutableProof\",\n\n\t/**\n\t * Represents Immutable Proof Verification.\n\t */\n\tImmutableProofVerification: \"ImmutableProofVerification\"\n} as const;\n\n/**\n * The types of immutable proof data.\n */\nexport type ImmutableProofTypes = (typeof ImmutableProofTypes)[keyof typeof ImmutableProofTypes];\n"]}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://schema.twindev.org/immutable-proof/ImmutableProof",
|
|
4
|
+
"description": "Interface describing an immutable proof state.",
|
|
5
|
+
"type": "object",
|
|
6
|
+
"properties": {
|
|
7
|
+
"@context": {
|
|
8
|
+
"type": "array",
|
|
9
|
+
"minItems": 2,
|
|
10
|
+
"description": "JSON-LD Context.",
|
|
11
|
+
"prefixItems": [
|
|
12
|
+
{
|
|
13
|
+
"type": "string",
|
|
14
|
+
"const": "https://schema.twindev.org/immutable-proof/"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "https://schema.twindev.org/common/"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"items": {
|
|
22
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"type": {
|
|
26
|
+
"type": "string",
|
|
27
|
+
"const": "ImmutableProof",
|
|
28
|
+
"description": "JSON-LD Type."
|
|
29
|
+
},
|
|
30
|
+
"id": {
|
|
31
|
+
"type": "string",
|
|
32
|
+
"description": "The id of the proof."
|
|
33
|
+
},
|
|
34
|
+
"proofObjectId": {
|
|
35
|
+
"type": "string",
|
|
36
|
+
"description": "The id of the object associated with the proof."
|
|
37
|
+
},
|
|
38
|
+
"proofObjectHash": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "The hash of the object associated with the proof."
|
|
41
|
+
},
|
|
42
|
+
"verifiableStorageId": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "The verifiable storage id for where the proof is stored."
|
|
45
|
+
},
|
|
46
|
+
"proof": {
|
|
47
|
+
"$ref": "https://schema.twindev.org/w3c-did/DataIntegrityProof",
|
|
48
|
+
"description": "The proof which can be undefined if it has not yet been issued."
|
|
49
|
+
},
|
|
50
|
+
"immutableReceipt": {
|
|
51
|
+
"$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
52
|
+
"description": "The immutable receipt detail for where the proof is stored."
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"required": [
|
|
56
|
+
"@context",
|
|
57
|
+
"type",
|
|
58
|
+
"id",
|
|
59
|
+
"proofObjectHash"
|
|
60
|
+
],
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export * from "./dataTypes/immutableProofDataTypes";
|
|
2
|
-
export * from "./models/api/IImmutableProofCreateRequest";
|
|
3
|
-
export * from "./models/api/IImmutableProofGetRequest";
|
|
4
|
-
export * from "./models/api/IImmutableProofGetResponse";
|
|
5
|
-
export * from "./models/api/IImmutableProofVerifyRequest";
|
|
6
|
-
export * from "./models/api/IImmutableProofVerifyResponse";
|
|
7
|
-
export * from "./models/eventBus/IImmutableProofEventBusProofCreated";
|
|
8
|
-
export * from "./models/IImmutableProof";
|
|
9
|
-
export * from "./models/IImmutableProofComponent";
|
|
10
|
-
export * from "./models/IImmutableProofVerification";
|
|
11
|
-
export * from "./models/immutableProofContexts";
|
|
12
|
-
export * from "./models/immutableProofFailure";
|
|
13
|
-
export * from "./models/immutableProofTopics";
|
|
14
|
-
export * from "./models/immutableProofTypes";
|
|
1
|
+
export * from "./dataTypes/immutableProofDataTypes.js";
|
|
2
|
+
export * from "./models/api/IImmutableProofCreateRequest.js";
|
|
3
|
+
export * from "./models/api/IImmutableProofGetRequest.js";
|
|
4
|
+
export * from "./models/api/IImmutableProofGetResponse.js";
|
|
5
|
+
export * from "./models/api/IImmutableProofVerifyRequest.js";
|
|
6
|
+
export * from "./models/api/IImmutableProofVerifyResponse.js";
|
|
7
|
+
export * from "./models/eventBus/IImmutableProofEventBusProofCreated.js";
|
|
8
|
+
export * from "./models/IImmutableProof.js";
|
|
9
|
+
export * from "./models/IImmutableProofComponent.js";
|
|
10
|
+
export * from "./models/IImmutableProofVerification.js";
|
|
11
|
+
export * from "./models/immutableProofContexts.js";
|
|
12
|
+
export * from "./models/immutableProofFailure.js";
|
|
13
|
+
export * from "./models/immutableProofTopics.js";
|
|
14
|
+
export * from "./models/immutableProofTypes.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IJsonLdContextDefinitionElement, IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
2
2
|
import type { IDataIntegrityProof } from "@twin.org/standards-w3c-did";
|
|
3
|
-
import type { ImmutableProofContexts } from "./immutableProofContexts";
|
|
4
|
-
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
3
|
+
import type { ImmutableProofContexts } from "./immutableProofContexts.js";
|
|
4
|
+
import type { ImmutableProofTypes } from "./immutableProofTypes.js";
|
|
5
5
|
/**
|
|
6
6
|
* Interface describing an immutable proof state.
|
|
7
7
|
*/
|
|
@@ -22,14 +22,6 @@ export interface IImmutableProof {
|
|
|
22
22
|
* The id of the proof.
|
|
23
23
|
*/
|
|
24
24
|
id: string;
|
|
25
|
-
/**
|
|
26
|
-
* The id of the node who created the proof.
|
|
27
|
-
*/
|
|
28
|
-
nodeIdentity: string;
|
|
29
|
-
/**
|
|
30
|
-
* The id of the user who created the proof.
|
|
31
|
-
*/
|
|
32
|
-
userIdentity: string;
|
|
33
25
|
/**
|
|
34
26
|
* The id of the object associated with the proof.
|
|
35
27
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IComponent } from "@twin.org/core";
|
|
2
2
|
import type { IJsonLdNodeObject } from "@twin.org/data-json-ld";
|
|
3
|
-
import type { IImmutableProof } from "./IImmutableProof";
|
|
4
|
-
import type { IImmutableProofVerification } from "./IImmutableProofVerification";
|
|
3
|
+
import type { IImmutableProof } from "./IImmutableProof.js";
|
|
4
|
+
import type { IImmutableProofVerification } from "./IImmutableProofVerification.js";
|
|
5
5
|
/**
|
|
6
6
|
* Interface describing an immutable proof contract.
|
|
7
7
|
*/
|
|
@@ -9,11 +9,9 @@ export interface IImmutableProofComponent extends IComponent {
|
|
|
9
9
|
/**
|
|
10
10
|
* Create a new proof.
|
|
11
11
|
* @param document The document to create the proof for.
|
|
12
|
-
* @param userIdentity The identity to create the immutable proof operation with.
|
|
13
|
-
* @param nodeIdentity The node identity to use for vault operations.
|
|
14
12
|
* @returns The id of the new proof.
|
|
15
13
|
*/
|
|
16
|
-
create(document: IJsonLdNodeObject
|
|
14
|
+
create(document: IJsonLdNodeObject): Promise<string>;
|
|
17
15
|
/**
|
|
18
16
|
* Get a proof.
|
|
19
17
|
* @param id The id of the proof to get.
|
|
@@ -31,9 +29,8 @@ export interface IImmutableProofComponent extends IComponent {
|
|
|
31
29
|
/**
|
|
32
30
|
* Remove the verifiable storage for the proof.
|
|
33
31
|
* @param id The id of the proof to remove the storage from.
|
|
34
|
-
* @param nodeIdentity The node identity to use for vault operations.
|
|
35
32
|
* @returns Nothing.
|
|
36
33
|
* @throws NotFoundError if the proof is not found.
|
|
37
34
|
*/
|
|
38
|
-
removeVerifiable(id: string
|
|
35
|
+
removeVerifiable(id: string): Promise<void>;
|
|
39
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ImmutableProofContexts } from "./immutableProofContexts";
|
|
2
|
-
import type { ImmutableProofFailure } from "./immutableProofFailure";
|
|
3
|
-
import type { ImmutableProofTypes } from "./immutableProofTypes";
|
|
1
|
+
import type { ImmutableProofContexts } from "./immutableProofContexts.js";
|
|
2
|
+
import type { ImmutableProofFailure } from "./immutableProofFailure.js";
|
|
3
|
+
import type { ImmutableProofTypes } from "./immutableProofTypes.js";
|
|
4
4
|
/**
|
|
5
5
|
* Interface describing an immutable proof verification.
|
|
6
6
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HeaderTypes, MimeTypes } from "@twin.org/web";
|
|
2
|
-
import type { IImmutableProofVerification } from "../IImmutableProofVerification";
|
|
2
|
+
import type { IImmutableProofVerification } from "../IImmutableProofVerification.js";
|
|
3
3
|
/**
|
|
4
4
|
* Response to verifying an immutable proof.
|
|
5
5
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,32 @@
|
|
|
1
1
|
# @twin.org/immutable-proof-models - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.3-next.0...immutable-proof-models-v0.0.3-next.1) (2025-11-12)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add context id features ([#14](https://github.com/twinfoundation/immutable-proof/issues/14)) ([ed5a594](https://github.com/twinfoundation/immutable-proof/commit/ed5a594eaa7d50f74b1c09a7a560d48b33a4ecd1))
|
|
9
|
+
* add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
10
|
+
* eslint migration to flat config ([c8536f2](https://github.com/twinfoundation/immutable-proof/commit/c8536f219c7709c6c08b9266e537831f9054dda9))
|
|
11
|
+
* update data types to use fully qualified names ([e94d0f5](https://github.com/twinfoundation/immutable-proof/commit/e94d0f5db93856b5b59cfd34e55252fa13a7f4e0))
|
|
12
|
+
* update dependencies ([7d6b321](https://github.com/twinfoundation/immutable-proof/commit/7d6b321928ca0434ee530816b1440f1687b94a6e))
|
|
13
|
+
* update framework core ([e708d4d](https://github.com/twinfoundation/immutable-proof/commit/e708d4dd3febcfbcd64663d5be004eab1d26c0fb))
|
|
14
|
+
* update ts-to-schema generation ([c4fc864](https://github.com/twinfoundation/immutable-proof/commit/c4fc8646e7b8ee040d356f7f0f3b2d6f4ac63e40))
|
|
15
|
+
* update twindev schemas ([d2bb94b](https://github.com/twinfoundation/immutable-proof/commit/d2bb94b31e61f899e41dbca1b1aeb2b3bb70b229))
|
|
16
|
+
* use shared store mechanism ([#3](https://github.com/twinfoundation/immutable-proof/issues/3)) ([7042a40](https://github.com/twinfoundation/immutable-proof/commit/7042a40f0ef8b01463f07aeb1efae4f417162fa1))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Bug Fixes
|
|
20
|
+
|
|
21
|
+
* Missing user and node identity on create ([#1](https://github.com/twinfoundation/immutable-proof/issues/1)) ([80ea2f9](https://github.com/twinfoundation/immutable-proof/commit/80ea2f901afc7531f4a522227a61e6fa1482484d))
|
|
22
|
+
|
|
23
|
+
## [0.0.2-next.3](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.2-next.2...immutable-proof-models-v0.0.2-next.3) (2025-10-09)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* add validate-locales ([d6a7c07](https://github.com/twinfoundation/immutable-proof/commit/d6a7c0794a1922981a42f56cc24724d7cee727f6))
|
|
29
|
+
|
|
3
30
|
## [0.0.2-next.2](https://github.com/twinfoundation/immutable-proof/compare/immutable-proof-models-v0.0.2-next.1...immutable-proof-models-v0.0.2-next.2) (2025-08-29)
|
|
4
31
|
|
|
5
32
|
|
|
@@ -28,22 +28,6 @@ The id of the proof.
|
|
|
28
28
|
|
|
29
29
|
***
|
|
30
30
|
|
|
31
|
-
### nodeIdentity
|
|
32
|
-
|
|
33
|
-
> **nodeIdentity**: `string`
|
|
34
|
-
|
|
35
|
-
The id of the node who created the proof.
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
|
-
### userIdentity
|
|
40
|
-
|
|
41
|
-
> **userIdentity**: `string`
|
|
42
|
-
|
|
43
|
-
The id of the user who created the proof.
|
|
44
|
-
|
|
45
|
-
***
|
|
46
|
-
|
|
47
31
|
### proofObjectId?
|
|
48
32
|
|
|
49
33
|
> `optional` **proofObjectId**: `string`
|
|
@@ -10,7 +10,7 @@ Interface describing an immutable proof contract.
|
|
|
10
10
|
|
|
11
11
|
### create()
|
|
12
12
|
|
|
13
|
-
> **create**(`document
|
|
13
|
+
> **create**(`document`): `Promise`\<`string`\>
|
|
14
14
|
|
|
15
15
|
Create a new proof.
|
|
16
16
|
|
|
@@ -22,18 +22,6 @@ Create a new proof.
|
|
|
22
22
|
|
|
23
23
|
The document to create the proof for.
|
|
24
24
|
|
|
25
|
-
##### userIdentity?
|
|
26
|
-
|
|
27
|
-
`string`
|
|
28
|
-
|
|
29
|
-
The identity to create the immutable proof operation with.
|
|
30
|
-
|
|
31
|
-
##### nodeIdentity?
|
|
32
|
-
|
|
33
|
-
`string`
|
|
34
|
-
|
|
35
|
-
The node identity to use for vault operations.
|
|
36
|
-
|
|
37
25
|
#### Returns
|
|
38
26
|
|
|
39
27
|
`Promise`\<`string`\>
|
|
@@ -96,7 +84,7 @@ NotFoundError if the proof is not found.
|
|
|
96
84
|
|
|
97
85
|
### removeVerifiable()
|
|
98
86
|
|
|
99
|
-
> **removeVerifiable**(`id
|
|
87
|
+
> **removeVerifiable**(`id`): `Promise`\<`void`\>
|
|
100
88
|
|
|
101
89
|
Remove the verifiable storage for the proof.
|
|
102
90
|
|
|
@@ -108,12 +96,6 @@ Remove the verifiable storage for the proof.
|
|
|
108
96
|
|
|
109
97
|
The id of the proof to remove the storage from.
|
|
110
98
|
|
|
111
|
-
##### nodeIdentity?
|
|
112
|
-
|
|
113
|
-
`string`
|
|
114
|
-
|
|
115
|
-
The node identity to use for vault operations.
|
|
116
|
-
|
|
117
99
|
#### Returns
|
|
118
100
|
|
|
119
101
|
`Promise`\<`void`\>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/immutable-proof-models",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-next.1",
|
|
4
4
|
"description": "Models which define the structure of the immutable proof connectors and services",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,22 +22,35 @@
|
|
|
22
22
|
"@twin.org/standards-w3c-did": "next",
|
|
23
23
|
"@twin.org/web": "next"
|
|
24
24
|
},
|
|
25
|
-
"main": "./dist/
|
|
26
|
-
"module": "./dist/esm/index.mjs",
|
|
25
|
+
"main": "./dist/es/index.js",
|
|
27
26
|
"types": "./dist/types/index.d.ts",
|
|
28
27
|
"exports": {
|
|
29
28
|
".": {
|
|
30
29
|
"types": "./dist/types/index.d.ts",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
30
|
+
"import": "./dist/es/index.js",
|
|
31
|
+
"default": "./dist/es/index.js"
|
|
33
32
|
},
|
|
34
33
|
"./locales/*.json": "./locales/*.json"
|
|
35
34
|
},
|
|
36
35
|
"files": [
|
|
37
|
-
"dist/
|
|
38
|
-
"dist/esm",
|
|
36
|
+
"dist/es",
|
|
39
37
|
"dist/types",
|
|
40
38
|
"locales",
|
|
41
39
|
"docs"
|
|
42
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"immutable-proof",
|
|
48
|
+
"models",
|
|
49
|
+
"types",
|
|
50
|
+
"schemas"
|
|
51
|
+
],
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "git+https://github.com/twinfoundation/immutable-proof/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://twindev.org"
|
|
43
56
|
}
|
package/dist/cjs/index.cjs
DELETED
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var dataCore = require('@twin.org/data-core');
|
|
4
|
-
|
|
5
|
-
// Copyright 2024 IOTA Stiftung.
|
|
6
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
7
|
-
/**
|
|
8
|
-
* The contexts of immutable proof data.
|
|
9
|
-
*/
|
|
10
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
-
const ImmutableProofContexts = {
|
|
12
|
-
/**
|
|
13
|
-
* The context root for the immutable proof types.
|
|
14
|
-
*/
|
|
15
|
-
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
16
|
-
/**
|
|
17
|
-
* The context root for the common types.
|
|
18
|
-
*/
|
|
19
|
-
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
// Copyright 2024 IOTA Stiftung.
|
|
23
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
24
|
-
/**
|
|
25
|
-
* The types of immutable proof data.
|
|
26
|
-
*/
|
|
27
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
28
|
-
const ImmutableProofTypes = {
|
|
29
|
-
/**
|
|
30
|
-
* Represents Immutable Proof.
|
|
31
|
-
*/
|
|
32
|
-
ImmutableProof: "ImmutableProof",
|
|
33
|
-
/**
|
|
34
|
-
* Represents Immutable Proof Verification.
|
|
35
|
-
*/
|
|
36
|
-
ImmutableProofVerification: "ImmutableProofVerification"
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var $schema = "https://json-schema.org/draft/2020-12/schema";
|
|
40
|
-
var $id = "https://schema.twindev.org/immutable-proof/ImmutableProof";
|
|
41
|
-
var description = "Interface describing an immutable proof state.";
|
|
42
|
-
var type = "object";
|
|
43
|
-
var properties = {
|
|
44
|
-
"@context": {
|
|
45
|
-
type: "array",
|
|
46
|
-
minItems: 2,
|
|
47
|
-
items: {
|
|
48
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
49
|
-
},
|
|
50
|
-
description: "JSON-LD Context.",
|
|
51
|
-
prefixItems: [
|
|
52
|
-
{
|
|
53
|
-
type: "string",
|
|
54
|
-
"const": "https://schema.twindev.org/immutable-proof/"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
type: "string",
|
|
58
|
-
"const": "https://schema.twindev.org/common/"
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
},
|
|
62
|
-
type: {
|
|
63
|
-
type: "string",
|
|
64
|
-
"const": "ImmutableProof",
|
|
65
|
-
description: "JSON-LD Type."
|
|
66
|
-
},
|
|
67
|
-
id: {
|
|
68
|
-
type: "string",
|
|
69
|
-
description: "The id of the proof."
|
|
70
|
-
},
|
|
71
|
-
nodeIdentity: {
|
|
72
|
-
type: "string",
|
|
73
|
-
description: "The id of the node who created the proof."
|
|
74
|
-
},
|
|
75
|
-
userIdentity: {
|
|
76
|
-
type: "string",
|
|
77
|
-
description: "The id of the user who created the proof."
|
|
78
|
-
},
|
|
79
|
-
proofObjectId: {
|
|
80
|
-
type: "string",
|
|
81
|
-
description: "The id of the object associated with the proof."
|
|
82
|
-
},
|
|
83
|
-
proofObjectHash: {
|
|
84
|
-
type: "string",
|
|
85
|
-
description: "The hash of the object associated with the proof."
|
|
86
|
-
},
|
|
87
|
-
verifiableStorageId: {
|
|
88
|
-
type: "string",
|
|
89
|
-
description: "The verifiable storage id for where the proof is stored."
|
|
90
|
-
},
|
|
91
|
-
proof: {
|
|
92
|
-
$ref: "https://schema.twindev.org/w3c-did/DataIntegrityProof",
|
|
93
|
-
description: "The proof which can be undefined if it has not yet been issued."
|
|
94
|
-
},
|
|
95
|
-
immutableReceipt: {
|
|
96
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
97
|
-
description: "The immutable receipt detail for where the proof is stored."
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
var required = [
|
|
101
|
-
"@context",
|
|
102
|
-
"type",
|
|
103
|
-
"id",
|
|
104
|
-
"nodeIdentity",
|
|
105
|
-
"userIdentity",
|
|
106
|
-
"proofObjectHash"
|
|
107
|
-
];
|
|
108
|
-
var additionalProperties = false;
|
|
109
|
-
var ImmutableProofSchema = {
|
|
110
|
-
$schema: $schema,
|
|
111
|
-
$id: $id,
|
|
112
|
-
description: description,
|
|
113
|
-
type: type,
|
|
114
|
-
properties: properties,
|
|
115
|
-
required: required,
|
|
116
|
-
additionalProperties: additionalProperties
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
// Copyright 2024 IOTA Stiftung.
|
|
120
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
121
|
-
/**
|
|
122
|
-
* Handle all the data types for immutable proof.
|
|
123
|
-
*/
|
|
124
|
-
class ImmutableProofDataTypes {
|
|
125
|
-
/**
|
|
126
|
-
* Register all the data types.
|
|
127
|
-
*/
|
|
128
|
-
static registerTypes() {
|
|
129
|
-
dataCore.DataTypeHandlerFactory.register(`${ImmutableProofContexts.ContextRoot}${ImmutableProofTypes.ImmutableProof}`, () => ({
|
|
130
|
-
context: ImmutableProofContexts.ContextRoot,
|
|
131
|
-
type: ImmutableProofTypes.ImmutableProof,
|
|
132
|
-
defaultValue: {},
|
|
133
|
-
jsonSchema: async () => ImmutableProofSchema
|
|
134
|
-
}));
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// Copyright 2024 IOTA Stiftung.
|
|
139
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
140
|
-
/**
|
|
141
|
-
* The failure reason of the proof.
|
|
142
|
-
*/
|
|
143
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
144
|
-
const ImmutableProofFailure = {
|
|
145
|
-
/**
|
|
146
|
-
* Proof not yet issued.
|
|
147
|
-
*/
|
|
148
|
-
NotIssued: "notIssued",
|
|
149
|
-
/**
|
|
150
|
-
* Proof missing.
|
|
151
|
-
*/
|
|
152
|
-
ProofMissing: "proofMissing",
|
|
153
|
-
/**
|
|
154
|
-
* Crypto suite mismatch.
|
|
155
|
-
*/
|
|
156
|
-
CryptoSuiteMismatch: "cryptoSuiteMismatch",
|
|
157
|
-
/**
|
|
158
|
-
* Proof type.
|
|
159
|
-
*/
|
|
160
|
-
ProofTypeMismatch: "proofTypeMismatch",
|
|
161
|
-
/**
|
|
162
|
-
* Signature mismatch.
|
|
163
|
-
*/
|
|
164
|
-
SignatureMismatch: "signatureMismatch"
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
// Copyright 2024 IOTA Stiftung.
|
|
168
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
169
|
-
/**
|
|
170
|
-
* The topics for immutable proof event bus notifications.
|
|
171
|
-
*/
|
|
172
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
173
|
-
const ImmutableProofTopics = {
|
|
174
|
-
/**
|
|
175
|
-
* A proof was created.
|
|
176
|
-
*/
|
|
177
|
-
ProofCreated: "immutable-proof:proof-created"
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
exports.ImmutableProofContexts = ImmutableProofContexts;
|
|
181
|
-
exports.ImmutableProofDataTypes = ImmutableProofDataTypes;
|
|
182
|
-
exports.ImmutableProofFailure = ImmutableProofFailure;
|
|
183
|
-
exports.ImmutableProofTopics = ImmutableProofTopics;
|
|
184
|
-
exports.ImmutableProofTypes = ImmutableProofTypes;
|
package/dist/esm/index.mjs
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { DataTypeHandlerFactory } from '@twin.org/data-core';
|
|
2
|
-
|
|
3
|
-
// Copyright 2024 IOTA Stiftung.
|
|
4
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
5
|
-
/**
|
|
6
|
-
* The contexts of immutable proof data.
|
|
7
|
-
*/
|
|
8
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
9
|
-
const ImmutableProofContexts = {
|
|
10
|
-
/**
|
|
11
|
-
* The context root for the immutable proof types.
|
|
12
|
-
*/
|
|
13
|
-
ContextRoot: "https://schema.twindev.org/immutable-proof/",
|
|
14
|
-
/**
|
|
15
|
-
* The context root for the common types.
|
|
16
|
-
*/
|
|
17
|
-
ContextRootCommon: "https://schema.twindev.org/common/"
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
// Copyright 2024 IOTA Stiftung.
|
|
21
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
22
|
-
/**
|
|
23
|
-
* The types of immutable proof data.
|
|
24
|
-
*/
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
26
|
-
const ImmutableProofTypes = {
|
|
27
|
-
/**
|
|
28
|
-
* Represents Immutable Proof.
|
|
29
|
-
*/
|
|
30
|
-
ImmutableProof: "ImmutableProof",
|
|
31
|
-
/**
|
|
32
|
-
* Represents Immutable Proof Verification.
|
|
33
|
-
*/
|
|
34
|
-
ImmutableProofVerification: "ImmutableProofVerification"
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var $schema = "https://json-schema.org/draft/2020-12/schema";
|
|
38
|
-
var $id = "https://schema.twindev.org/immutable-proof/ImmutableProof";
|
|
39
|
-
var description = "Interface describing an immutable proof state.";
|
|
40
|
-
var type = "object";
|
|
41
|
-
var properties = {
|
|
42
|
-
"@context": {
|
|
43
|
-
type: "array",
|
|
44
|
-
minItems: 2,
|
|
45
|
-
items: {
|
|
46
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
47
|
-
},
|
|
48
|
-
description: "JSON-LD Context.",
|
|
49
|
-
prefixItems: [
|
|
50
|
-
{
|
|
51
|
-
type: "string",
|
|
52
|
-
"const": "https://schema.twindev.org/immutable-proof/"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
type: "string",
|
|
56
|
-
"const": "https://schema.twindev.org/common/"
|
|
57
|
-
}
|
|
58
|
-
]
|
|
59
|
-
},
|
|
60
|
-
type: {
|
|
61
|
-
type: "string",
|
|
62
|
-
"const": "ImmutableProof",
|
|
63
|
-
description: "JSON-LD Type."
|
|
64
|
-
},
|
|
65
|
-
id: {
|
|
66
|
-
type: "string",
|
|
67
|
-
description: "The id of the proof."
|
|
68
|
-
},
|
|
69
|
-
nodeIdentity: {
|
|
70
|
-
type: "string",
|
|
71
|
-
description: "The id of the node who created the proof."
|
|
72
|
-
},
|
|
73
|
-
userIdentity: {
|
|
74
|
-
type: "string",
|
|
75
|
-
description: "The id of the user who created the proof."
|
|
76
|
-
},
|
|
77
|
-
proofObjectId: {
|
|
78
|
-
type: "string",
|
|
79
|
-
description: "The id of the object associated with the proof."
|
|
80
|
-
},
|
|
81
|
-
proofObjectHash: {
|
|
82
|
-
type: "string",
|
|
83
|
-
description: "The hash of the object associated with the proof."
|
|
84
|
-
},
|
|
85
|
-
verifiableStorageId: {
|
|
86
|
-
type: "string",
|
|
87
|
-
description: "The verifiable storage id for where the proof is stored."
|
|
88
|
-
},
|
|
89
|
-
proof: {
|
|
90
|
-
$ref: "https://schema.twindev.org/w3c-did/DataIntegrityProof",
|
|
91
|
-
description: "The proof which can be undefined if it has not yet been issued."
|
|
92
|
-
},
|
|
93
|
-
immutableReceipt: {
|
|
94
|
-
$ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
|
|
95
|
-
description: "The immutable receipt detail for where the proof is stored."
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
var required = [
|
|
99
|
-
"@context",
|
|
100
|
-
"type",
|
|
101
|
-
"id",
|
|
102
|
-
"nodeIdentity",
|
|
103
|
-
"userIdentity",
|
|
104
|
-
"proofObjectHash"
|
|
105
|
-
];
|
|
106
|
-
var additionalProperties = false;
|
|
107
|
-
var ImmutableProofSchema = {
|
|
108
|
-
$schema: $schema,
|
|
109
|
-
$id: $id,
|
|
110
|
-
description: description,
|
|
111
|
-
type: type,
|
|
112
|
-
properties: properties,
|
|
113
|
-
required: required,
|
|
114
|
-
additionalProperties: additionalProperties
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// Copyright 2024 IOTA Stiftung.
|
|
118
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
119
|
-
/**
|
|
120
|
-
* Handle all the data types for immutable proof.
|
|
121
|
-
*/
|
|
122
|
-
class ImmutableProofDataTypes {
|
|
123
|
-
/**
|
|
124
|
-
* Register all the data types.
|
|
125
|
-
*/
|
|
126
|
-
static registerTypes() {
|
|
127
|
-
DataTypeHandlerFactory.register(`${ImmutableProofContexts.ContextRoot}${ImmutableProofTypes.ImmutableProof}`, () => ({
|
|
128
|
-
context: ImmutableProofContexts.ContextRoot,
|
|
129
|
-
type: ImmutableProofTypes.ImmutableProof,
|
|
130
|
-
defaultValue: {},
|
|
131
|
-
jsonSchema: async () => ImmutableProofSchema
|
|
132
|
-
}));
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
// Copyright 2024 IOTA Stiftung.
|
|
137
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
138
|
-
/**
|
|
139
|
-
* The failure reason of the proof.
|
|
140
|
-
*/
|
|
141
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
142
|
-
const ImmutableProofFailure = {
|
|
143
|
-
/**
|
|
144
|
-
* Proof not yet issued.
|
|
145
|
-
*/
|
|
146
|
-
NotIssued: "notIssued",
|
|
147
|
-
/**
|
|
148
|
-
* Proof missing.
|
|
149
|
-
*/
|
|
150
|
-
ProofMissing: "proofMissing",
|
|
151
|
-
/**
|
|
152
|
-
* Crypto suite mismatch.
|
|
153
|
-
*/
|
|
154
|
-
CryptoSuiteMismatch: "cryptoSuiteMismatch",
|
|
155
|
-
/**
|
|
156
|
-
* Proof type.
|
|
157
|
-
*/
|
|
158
|
-
ProofTypeMismatch: "proofTypeMismatch",
|
|
159
|
-
/**
|
|
160
|
-
* Signature mismatch.
|
|
161
|
-
*/
|
|
162
|
-
SignatureMismatch: "signatureMismatch"
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
// Copyright 2024 IOTA Stiftung.
|
|
166
|
-
// SPDX-License-Identifier: Apache-2.0.
|
|
167
|
-
/**
|
|
168
|
-
* The topics for immutable proof event bus notifications.
|
|
169
|
-
*/
|
|
170
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
171
|
-
const ImmutableProofTopics = {
|
|
172
|
-
/**
|
|
173
|
-
* A proof was created.
|
|
174
|
-
*/
|
|
175
|
-
ProofCreated: "immutable-proof:proof-created"
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export { ImmutableProofContexts, ImmutableProofDataTypes, ImmutableProofFailure, ImmutableProofTopics, ImmutableProofTypes };
|