@twin.org/document-management-models 0.0.2-next.4 → 0.0.3-next.2

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.
Files changed (53) hide show
  1. package/dist/es/dataTypes/documentManagementDataTypes.js +29 -0
  2. package/dist/es/dataTypes/documentManagementDataTypes.js.map +1 -0
  3. package/dist/es/index.js +19 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IDocument.js +2 -0
  6. package/dist/es/models/IDocument.js.map +1 -0
  7. package/dist/es/models/IDocumentAttestation.js +2 -0
  8. package/dist/es/models/IDocumentAttestation.js.map +1 -0
  9. package/dist/es/models/IDocumentList.js +2 -0
  10. package/dist/es/models/IDocumentList.js.map +1 -0
  11. package/dist/es/models/IDocumentManagementComponent.js +2 -0
  12. package/dist/es/models/IDocumentManagementComponent.js.map +1 -0
  13. package/dist/es/models/api/IDocumentManagementCreateRequest.js +2 -0
  14. package/dist/es/models/api/IDocumentManagementCreateRequest.js.map +1 -0
  15. package/dist/es/models/api/IDocumentManagementGetRequest.js +2 -0
  16. package/dist/es/models/api/IDocumentManagementGetRequest.js.map +1 -0
  17. package/dist/es/models/api/IDocumentManagementGetResponse.js +2 -0
  18. package/dist/es/models/api/IDocumentManagementGetResponse.js.map +1 -0
  19. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js +2 -0
  20. package/dist/es/models/api/IDocumentManagementGetRevisionRequest.js.map +1 -0
  21. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js +2 -0
  22. package/dist/es/models/api/IDocumentManagementGetRevisionResponse.js.map +1 -0
  23. package/dist/es/models/api/IDocumentManagementQueryRequest.js +2 -0
  24. package/dist/es/models/api/IDocumentManagementQueryRequest.js.map +1 -0
  25. package/dist/es/models/api/IDocumentManagementQueryResponse.js +2 -0
  26. package/dist/es/models/api/IDocumentManagementQueryResponse.js.map +1 -0
  27. package/dist/es/models/api/IDocumentManagementRemoveRequest.js +4 -0
  28. package/dist/es/models/api/IDocumentManagementRemoveRequest.js.map +1 -0
  29. package/dist/es/models/api/IDocumentManagementUpdateRequest.js +2 -0
  30. package/dist/es/models/api/IDocumentManagementUpdateRequest.js.map +1 -0
  31. package/dist/es/models/documentContexts.js +17 -0
  32. package/dist/es/models/documentContexts.js.map +1 -0
  33. package/dist/es/models/documentTypes.js +17 -0
  34. package/dist/es/models/documentTypes.js.map +1 -0
  35. package/dist/es/schemas/Document.json +114 -0
  36. package/dist/types/index.d.ts +16 -16
  37. package/dist/types/models/IDocument.d.ts +5 -5
  38. package/dist/types/models/IDocumentAttestation.d.ts +2 -2
  39. package/dist/types/models/IDocumentList.d.ts +2 -2
  40. package/dist/types/models/IDocumentManagementComponent.d.ts +8 -20
  41. package/dist/types/models/api/IDocumentManagementGetRequest.d.ts +4 -4
  42. package/dist/types/models/api/IDocumentManagementGetResponse.d.ts +1 -1
  43. package/dist/types/models/api/IDocumentManagementGetRevisionRequest.d.ts +3 -3
  44. package/dist/types/models/api/IDocumentManagementGetRevisionResponse.d.ts +1 -1
  45. package/docs/changelog.md +31 -0
  46. package/docs/reference/interfaces/IDocument.md +5 -5
  47. package/docs/reference/interfaces/IDocumentManagementComponent.md +7 -87
  48. package/docs/reference/interfaces/IDocumentManagementCreateRequest.md +1 -1
  49. package/docs/reference/interfaces/IDocumentManagementGetRequest.md +4 -4
  50. package/docs/reference/interfaces/IDocumentManagementGetRevisionRequest.md +3 -3
  51. package/package.json +5 -7
  52. package/dist/cjs/index.cjs +0 -190
  53. package/dist/esm/index.mjs +0 -186
@@ -1,186 +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 document management objects.
7
- */
8
- // eslint-disable-next-line @typescript-eslint/naming-convention
9
- const DocumentContexts = {
10
- /**
11
- * The context root for the document types.
12
- */
13
- ContextRoot: "https://schema.twindev.org/documents/",
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 document management objects.
24
- */
25
- // eslint-disable-next-line @typescript-eslint/naming-convention
26
- const DocumentTypes = {
27
- /**
28
- * Represents a document.
29
- */
30
- Document: "Document",
31
- /**
32
- * Represents a document attestation.
33
- */
34
- DocumentAttestation: "DocumentAttestation"
35
- };
36
-
37
- var $schema = "https://json-schema.org/draft/2020-12/schema";
38
- var $id = "https://schema.twindev.org/documents/Document";
39
- var description = "Interface describing a document.";
40
- var type = "object";
41
- var properties = {
42
- "@context": {
43
- type: "array",
44
- minItems: 3,
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/documents/"
53
- },
54
- {
55
- type: "string",
56
- "const": "https://schema.twindev.org/common/"
57
- },
58
- {
59
- type: "string",
60
- "const": "https://schema.org"
61
- }
62
- ]
63
- },
64
- type: {
65
- type: "string",
66
- "const": "Document",
67
- description: "JSON-LD Type."
68
- },
69
- id: {
70
- type: "string",
71
- description: "The full id of the document."
72
- },
73
- documentId: {
74
- type: "string",
75
- description: "The id of the document."
76
- },
77
- documentIdFormat: {
78
- type: "string",
79
- description: "The format of the document id."
80
- },
81
- documentCode: {
82
- $ref: "https://vocabulary.uncefact.org/DocumentCodeList",
83
- description: "The code for the document type."
84
- },
85
- documentRevision: {
86
- type: "number",
87
- description: "The revision of the document as a 0 based index."
88
- },
89
- annotationObject: {
90
- $ref: "https://schema.twindev.org/json-ld/JsonLdNodeObject",
91
- description: "Additional annotation information for the document."
92
- },
93
- blobStorageId: {
94
- type: "string",
95
- description: "The blob storage id for the document."
96
- },
97
- blobHash: {
98
- type: "string",
99
- description: "The hash of the blob data."
100
- },
101
- blobStorageEntry: {
102
- $ref: "https://schema.twindev.org/blob-storage/BlobStorageEntry",
103
- description: "The additional JSON-LD for blob storage if it was requested."
104
- },
105
- extractedData: {
106
- description: "The data extracted from the document using data extraction services."
107
- },
108
- attestationId: {
109
- type: "string",
110
- description: "The attestation for the document if one was created."
111
- },
112
- attestationInformation: {
113
- $ref: "https://schema.twindev.org/attestation/AttestationInformation",
114
- description: "The additional JSON-LD for attestation storage if it was requested."
115
- },
116
- dateCreated: {
117
- type: "string",
118
- description: "The date/time of when the document was created."
119
- },
120
- dateModified: {
121
- type: "string",
122
- description: "The date/time of when the document was modified."
123
- },
124
- dateDeleted: {
125
- type: "string",
126
- description: "The date/time of when the document was deleted, as we never actually remove items."
127
- },
128
- nodeIdentity: {
129
- type: "string",
130
- description: "The node which added the document to the graph."
131
- },
132
- userIdentity: {
133
- type: "string",
134
- description: "The user who added the document to the graph."
135
- }
136
- };
137
- var required = [
138
- "@context",
139
- "type",
140
- "id",
141
- "documentId",
142
- "documentCode",
143
- "documentRevision",
144
- "blobStorageId",
145
- "blobHash",
146
- "dateCreated",
147
- "nodeIdentity",
148
- "userIdentity"
149
- ];
150
- var additionalProperties = false;
151
- var DocumentSchema = {
152
- $schema: $schema,
153
- $id: $id,
154
- description: description,
155
- type: type,
156
- properties: properties,
157
- required: required,
158
- additionalProperties: additionalProperties
159
- };
160
-
161
- // Copyright 2024 IOTA Stiftung.
162
- // SPDX-License-Identifier: Apache-2.0.
163
- /**
164
- * Handle all the data types for document management.
165
- */
166
- class DocumentManagementDataTypes {
167
- /**
168
- * Register all the data types.
169
- */
170
- static registerTypes() {
171
- DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.Document}`, () => ({
172
- context: DocumentContexts.ContextRoot,
173
- type: DocumentTypes.Document,
174
- defaultValue: {},
175
- jsonSchema: async () => DocumentSchema
176
- }));
177
- DataTypeHandlerFactory.register(`${DocumentContexts.ContextRoot}${DocumentTypes.DocumentAttestation}`, () => ({
178
- context: DocumentContexts.ContextRoot,
179
- type: DocumentTypes.DocumentAttestation,
180
- defaultValue: {},
181
- jsonSchema: async () => DocumentSchema
182
- }));
183
- }
184
- }
185
-
186
- export { DocumentContexts, DocumentManagementDataTypes, DocumentTypes };