@imbricate/core 3.11.0 → 3.14.0

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 (158) hide show
  1. package/author/export.d.ts +6 -0
  2. package/author/export.js +22 -0
  3. package/database/base-class/essential-readonly.d.ts +18 -0
  4. package/database/base-class/essential-readonly.js +29 -0
  5. package/database/base-class/essential.d.ts +18 -0
  6. package/database/base-class/essential.js +36 -0
  7. package/database/base-class/exclude-annotation.d.ts +16 -0
  8. package/database/base-class/exclude-annotation.js +32 -0
  9. package/database/base-class/exclude-edit-records.d.ts +15 -0
  10. package/database/base-class/exclude-edit-records.js +31 -0
  11. package/database/base-class/full-feature-readonly.d.ts +21 -0
  12. package/database/base-class/full-feature-readonly.js +39 -0
  13. package/database/base-class/full-feature.d.ts +29 -0
  14. package/database/base-class/full-feature.js +24 -0
  15. package/database/export.d.ts +16 -0
  16. package/database/export.js +32 -0
  17. package/database/feature.d.ts +2 -7
  18. package/database/feature.js +3 -38
  19. package/database/interface.d.ts +41 -32
  20. package/database/outcome.d.ts +58 -0
  21. package/database/outcome.js +28 -0
  22. package/database-manager/base-class/full-feature.d.ts +17 -0
  23. package/database-manager/base-class/full-feature.js +19 -0
  24. package/database-manager/base-class/readonly.d.ts +16 -0
  25. package/database-manager/base-class/readonly.js +26 -0
  26. package/database-manager/database-manager.d.ts +52 -0
  27. package/{static/manager.js → database-manager/database-manager.js} +2 -2
  28. package/database-manager/export.d.ts +10 -0
  29. package/database-manager/export.js +26 -0
  30. package/database-manager/feature.d.ts +11 -0
  31. package/database-manager/feature.js +18 -0
  32. package/database-manager/outcome.d.ts +26 -0
  33. package/database-manager/outcome.js +16 -0
  34. package/document/base-class/essential-readonly.d.ts +17 -0
  35. package/document/base-class/essential-readonly.js +25 -0
  36. package/document/base-class/essential.d.ts +18 -0
  37. package/document/base-class/essential.js +33 -0
  38. package/document/base-class/exclude-annotation.d.ts +16 -0
  39. package/document/base-class/exclude-annotation.js +29 -0
  40. package/document/base-class/exclude-edit-records.d.ts +15 -0
  41. package/document/base-class/exclude-edit-records.js +28 -0
  42. package/document/base-class/full-feature-readonly.d.ts +19 -0
  43. package/document/base-class/full-feature-readonly.js +35 -0
  44. package/document/base-class/full-feature.d.ts +23 -0
  45. package/document/base-class/full-feature.js +21 -0
  46. package/document/export.d.ts +22 -0
  47. package/document/export.js +38 -0
  48. package/document/feature.d.ts +1 -5
  49. package/document/feature.js +2 -24
  50. package/document/interface.d.ts +23 -21
  51. package/document/outcome.d.ts +32 -0
  52. package/document/outcome.js +19 -0
  53. package/error/database/database-error.d.ts +9 -0
  54. package/error/database/database-error.js +16 -0
  55. package/error/database/feature-not-supported.d.ts +12 -0
  56. package/error/database/feature-not-supported.js +19 -0
  57. package/error/database-manager/database-manager-error.d.ts +9 -0
  58. package/error/database-manager/database-manager-error.js +16 -0
  59. package/error/database-manager/feature-not-supported.d.ts +12 -0
  60. package/error/database-manager/feature-not-supported.js +19 -0
  61. package/error/document/document-error.d.ts +9 -0
  62. package/error/document/document-error.js +16 -0
  63. package/error/document/feature-not-supported.d.ts +12 -0
  64. package/error/document/feature-not-supported.js +20 -0
  65. package/error/export.d.ts +22 -0
  66. package/error/export.js +38 -0
  67. package/error/imbricate-error.d.ts +14 -0
  68. package/error/imbricate-error.js +27 -0
  69. package/error/origin/feature-not-supported.d.ts +12 -0
  70. package/error/origin/feature-not-supported.js +20 -0
  71. package/error/origin/origin-error.d.ts +9 -0
  72. package/error/origin/origin-error.js +16 -0
  73. package/error/static/feature-not-supported.d.ts +12 -0
  74. package/error/static/feature-not-supported.js +19 -0
  75. package/error/static/static-error.d.ts +9 -0
  76. package/error/static/static-error.js +16 -0
  77. package/error/static-manager/feature-not-supported.d.ts +12 -0
  78. package/error/static-manager/feature-not-supported.js +19 -0
  79. package/error/static-manager/static-manager-error.d.ts +9 -0
  80. package/error/static-manager/static-manager-error.js +16 -0
  81. package/error/text/feature-not-supported.d.ts +12 -0
  82. package/error/text/feature-not-supported.js +19 -0
  83. package/error/text/text-error.d.ts +9 -0
  84. package/error/text/text-error.js +16 -0
  85. package/error/text-manager/feature-not-supported.d.ts +12 -0
  86. package/error/text-manager/feature-not-supported.js +19 -0
  87. package/error/text-manager/text-manager-error.d.ts +9 -0
  88. package/error/text-manager/text-manager-error.js +16 -0
  89. package/index.d.ts +11 -29
  90. package/index.js +11 -29
  91. package/loader/export.d.ts +8 -0
  92. package/loader/export.js +24 -0
  93. package/origin/base-class/essential.d.ts +15 -0
  94. package/origin/base-class/essential.js +27 -0
  95. package/origin/base-class/exclude-static.d.ts +13 -0
  96. package/origin/base-class/exclude-static.js +25 -0
  97. package/origin/base-class/full-feature.d.ts +21 -0
  98. package/origin/base-class/full-feature.js +20 -0
  99. package/origin/export.d.ts +12 -0
  100. package/origin/export.js +28 -0
  101. package/origin/feature.d.ts +12 -0
  102. package/origin/feature.js +19 -0
  103. package/origin/interface.d.ts +12 -5
  104. package/origin/outcome.d.ts +11 -0
  105. package/origin/outcome.js +10 -0
  106. package/origin/search.d.ts +0 -3
  107. package/package.json +1 -1
  108. package/static/base-class/author-only.d.ts +13 -0
  109. package/static/base-class/author-only.js +23 -0
  110. package/static/base-class/content-only.d.ts +12 -0
  111. package/static/base-class/content-only.js +23 -0
  112. package/static/base-class/full-feature.d.ts +15 -0
  113. package/static/base-class/full-feature.js +18 -0
  114. package/static/export.d.ts +12 -0
  115. package/static/export.js +28 -0
  116. package/static/feature.d.ts +10 -0
  117. package/static/feature.js +17 -0
  118. package/static/interface.d.ts +9 -2
  119. package/static/outcome.d.ts +10 -0
  120. package/static/outcome.js +10 -0
  121. package/static-manager/base-class/full-feature.d.ts +14 -0
  122. package/static-manager/base-class/full-feature.js +18 -0
  123. package/static-manager/base-class/readonly.d.ts +14 -0
  124. package/static-manager/base-class/readonly.js +23 -0
  125. package/static-manager/export.d.ts +10 -0
  126. package/static-manager/export.js +26 -0
  127. package/static-manager/feature.d.ts +10 -0
  128. package/static-manager/feature.js +17 -0
  129. package/static-manager/outcome.d.ts +16 -0
  130. package/static-manager/outcome.js +12 -0
  131. package/{static/manager.d.ts → static-manager/static-manager.d.ts} +8 -6
  132. package/{database/manager.js → static-manager/static-manager.js} +2 -2
  133. package/text/base-class/author-only.d.ts +13 -0
  134. package/text/base-class/author-only.js +23 -0
  135. package/text/base-class/content-only.d.ts +12 -0
  136. package/text/base-class/content-only.js +23 -0
  137. package/text/base-class/full-feature.d.ts +15 -0
  138. package/text/base-class/full-feature.js +18 -0
  139. package/text/export.d.ts +12 -0
  140. package/text/export.js +28 -0
  141. package/text/feature.d.ts +10 -0
  142. package/text/feature.js +17 -0
  143. package/text/interface.d.ts +9 -2
  144. package/text/outcome.d.ts +10 -0
  145. package/text/outcome.js +10 -0
  146. package/text-manager/base-class/full-feature.d.ts +14 -0
  147. package/text-manager/base-class/full-feature.js +18 -0
  148. package/text-manager/base-class/readonly.d.ts +14 -0
  149. package/text-manager/base-class/readonly.js +23 -0
  150. package/text-manager/export.d.ts +10 -0
  151. package/text-manager/export.js +26 -0
  152. package/text-manager/feature.d.ts +10 -0
  153. package/text-manager/feature.js +17 -0
  154. package/text-manager/outcome.d.ts +16 -0
  155. package/text-manager/outcome.js +12 -0
  156. package/{text/manager.d.ts → text-manager/text-manager.d.ts} +8 -6
  157. package/{text/manager.js → text-manager/text-manager.js} +2 -2
  158. package/database/manager.d.ts +0 -41
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Exclude Annotation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDocumentExcludeAnnotationBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/document/feature-not-supported");
10
+ const feature_1 = require("../feature");
11
+ const full_feature_1 = require("./full-feature");
12
+ class ImbricateDocumentExcludeAnnotationBase extends full_feature_1.ImbricateDocumentFullFeatureBase {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.annotations = {};
16
+ this.supportedFeatures = [
17
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
18
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD,
19
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
20
+ ];
21
+ }
22
+ putAnnotation(_namespace, _identifier, _value, _auditOptions) {
23
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION);
24
+ }
25
+ deleteAnnotation(_namespace, _identifier, _auditOptions) {
26
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_DELETE_ANNOTATION);
27
+ }
28
+ }
29
+ exports.ImbricateDocumentExcludeAnnotationBase = ImbricateDocumentExcludeAnnotationBase;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Exclude Edit Records
5
+ */
6
+ import { DocumentEditRecord } from "../definition";
7
+ import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
+ import { IImbricateDocument } from "../interface";
9
+ import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentGetEditRecordsOutcome } from "../outcome";
10
+ import { ImbricateDocumentFullFeatureBase } from "./full-feature";
11
+ export declare abstract class ImbricateDocumentExcludeEditRecordsBase extends ImbricateDocumentFullFeatureBase implements IImbricateDocument {
12
+ readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
13
+ addEditRecords(_records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
14
+ getEditRecords(): Promise<ImbricateDocumentGetEditRecordsOutcome>;
15
+ }
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Exclude Edit Records
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDocumentExcludeEditRecordsBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/document/feature-not-supported");
10
+ const feature_1 = require("../feature");
11
+ const full_feature_1 = require("./full-feature");
12
+ class ImbricateDocumentExcludeEditRecordsBase extends full_feature_1.ImbricateDocumentFullFeatureBase {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.supportedFeatures = [
16
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
17
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION,
18
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_DELETE_ANNOTATION,
19
+ ];
20
+ }
21
+ addEditRecords(_records) {
22
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD);
23
+ }
24
+ getEditRecords() {
25
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD);
26
+ }
27
+ }
28
+ exports.ImbricateDocumentExcludeEditRecordsBase = ImbricateDocumentExcludeEditRecordsBase;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Full Feature Readonly
5
+ */
6
+ import { DocumentAnnotationValue, DocumentEditRecord, ImbricateDocumentAuditOptions } from "../definition";
7
+ import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
+ import { IImbricateDocument } from "../interface";
9
+ import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "../outcome";
10
+ import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "../property";
11
+ import { ImbricateDocumentFullFeatureBase } from "./full-feature";
12
+ export declare abstract class ImbricateDocumentFullFeatureReadonlyBase extends ImbricateDocumentFullFeatureBase implements IImbricateDocument {
13
+ readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
14
+ putProperty(_key: DocumentPropertyKey, _value: DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
15
+ putProperties(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
16
+ putAnnotation(_namespace: string, _identifier: string, _value: DocumentAnnotationValue, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
17
+ deleteAnnotation(_namespace: string, _identifier: string, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
18
+ addEditRecords(_records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
19
+ }
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Full Feature Readonly
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDocumentFullFeatureReadonlyBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/document/feature-not-supported");
10
+ const feature_1 = require("../feature");
11
+ const full_feature_1 = require("./full-feature");
12
+ class ImbricateDocumentFullFeatureReadonlyBase extends full_feature_1.ImbricateDocumentFullFeatureBase {
13
+ constructor() {
14
+ super(...arguments);
15
+ this.supportedFeatures = [
16
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
17
+ ];
18
+ }
19
+ putProperty(_key, _value, _auditOptions) {
20
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
21
+ }
22
+ putProperties(_properties, _auditOptions) {
23
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
24
+ }
25
+ putAnnotation(_namespace, _identifier, _value, _auditOptions) {
26
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION);
27
+ }
28
+ deleteAnnotation(_namespace, _identifier, _auditOptions) {
29
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_DELETE_ANNOTATION);
30
+ }
31
+ addEditRecords(_records) {
32
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD);
33
+ }
34
+ }
35
+ exports.ImbricateDocumentFullFeatureReadonlyBase = ImbricateDocumentFullFeatureReadonlyBase;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Full Feature
5
+ */
6
+ import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "../definition";
7
+ import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
+ import { IImbricateDocument } from "../interface";
9
+ import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentGetEditRecordsOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "../outcome";
10
+ import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "../property";
11
+ export declare abstract class ImbricateDocumentFullFeatureBase implements IImbricateDocument {
12
+ abstract readonly uniqueIdentifier: string;
13
+ abstract readonly documentVersion: string;
14
+ abstract readonly properties: DocumentProperties;
15
+ abstract readonly annotations: DocumentAnnotations;
16
+ readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
17
+ abstract putProperty(key: DocumentPropertyKey, value: DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
18
+ abstract putProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
19
+ abstract putAnnotation(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
20
+ abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
21
+ abstract addEditRecords(records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
22
+ abstract getEditRecords(): Promise<ImbricateDocumentGetEditRecordsOutcome>;
23
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Full Feature
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDocumentFullFeatureBase = void 0;
9
+ const feature_1 = require("../feature");
10
+ class ImbricateDocumentFullFeatureBase {
11
+ constructor() {
12
+ this.supportedFeatures = [
13
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
14
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION,
15
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_DELETE_ANNOTATION,
16
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD,
17
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
18
+ ];
19
+ }
20
+ }
21
+ exports.ImbricateDocumentFullFeatureBase = ImbricateDocumentFullFeatureBase;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Export
5
+ */
6
+ export * from "./base-class/essential";
7
+ export * from "./base-class/essential-readonly";
8
+ export * from "./base-class/exclude-annotation";
9
+ export * from "./base-class/exclude-edit-records";
10
+ export * from "./base-class/full-feature";
11
+ export * from "./base-class/full-feature-readonly";
12
+ export * from "./definition";
13
+ export * from "./feature";
14
+ export * from "./interface";
15
+ export * from "./outcome";
16
+ export * from "./property";
17
+ export * from "./property/default-value";
18
+ export * from "./property/definition";
19
+ export * from "./property/primary";
20
+ export * from "./property/triage";
21
+ export * from "./property/triage-manager";
22
+ export * from "./validate";
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Export
6
+ */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
20
+ };
21
+ Object.defineProperty(exports, "__esModule", { value: true });
22
+ __exportStar(require("./base-class/essential"), exports);
23
+ __exportStar(require("./base-class/essential-readonly"), exports);
24
+ __exportStar(require("./base-class/exclude-annotation"), exports);
25
+ __exportStar(require("./base-class/exclude-edit-records"), exports);
26
+ __exportStar(require("./base-class/full-feature"), exports);
27
+ __exportStar(require("./base-class/full-feature-readonly"), exports);
28
+ __exportStar(require("./definition"), exports);
29
+ __exportStar(require("./feature"), exports);
30
+ __exportStar(require("./interface"), exports);
31
+ __exportStar(require("./outcome"), exports);
32
+ __exportStar(require("./property"), exports);
33
+ __exportStar(require("./property/default-value"), exports);
34
+ __exportStar(require("./property/definition"), exports);
35
+ __exportStar(require("./property/primary"), exports);
36
+ __exportStar(require("./property/triage"), exports);
37
+ __exportStar(require("./property/triage-manager"), exports);
38
+ __exportStar(require("./validate"), exports);
@@ -6,12 +6,8 @@
6
6
  export declare enum IMBRICATE_DOCUMENT_FEATURE {
7
7
  DOCUMENT_PUT_PROPERTY = "DOCUMENT_PUT_PROPERTY",
8
8
  DOCUMENT_PUT_ANNOTATION = "DOCUMENT_PUT_ANNOTATION",
9
- DOCUMENT_REMOVE_ANNOTATION = "DOCUMENT_REMOVE_ANNOTATION",
9
+ DOCUMENT_DELETE_ANNOTATION = "DOCUMENT_DELETE_ANNOTATION",
10
10
  DOCUMENT_PUT_EDIT_RECORD = "DOCUMENT_PUT_EDIT_RECORD",
11
11
  DOCUMENT_GET_EDIT_RECORD = "DOCUMENT_GET_EDIT_RECORD"
12
12
  }
13
- export declare const fullSupportedDocumentFeatures: IMBRICATE_DOCUMENT_FEATURE[];
14
- export declare const annotationExcludedDocumentFeatures: IMBRICATE_DOCUMENT_FEATURE[];
15
- export declare const editRecordExcludedDocumentFeatures: IMBRICATE_DOCUMENT_FEATURE[];
16
- export declare const IMBRICATE_DOCUMENT_PRESET_FEATURES: Record<string, IMBRICATE_DOCUMENT_FEATURE[]>;
17
13
  export declare const checkImbricateDocumentFeatureSupported: (features: IMBRICATE_DOCUMENT_FEATURE[], feature: IMBRICATE_DOCUMENT_FEATURE) => boolean;
@@ -5,37 +5,15 @@
5
5
  * @description Feature
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.checkImbricateDocumentFeatureSupported = exports.IMBRICATE_DOCUMENT_PRESET_FEATURES = exports.editRecordExcludedDocumentFeatures = exports.annotationExcludedDocumentFeatures = exports.fullSupportedDocumentFeatures = exports.IMBRICATE_DOCUMENT_FEATURE = void 0;
8
+ exports.checkImbricateDocumentFeatureSupported = exports.IMBRICATE_DOCUMENT_FEATURE = void 0;
9
9
  var IMBRICATE_DOCUMENT_FEATURE;
10
10
  (function (IMBRICATE_DOCUMENT_FEATURE) {
11
11
  IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_PUT_PROPERTY"] = "DOCUMENT_PUT_PROPERTY";
12
12
  IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_PUT_ANNOTATION"] = "DOCUMENT_PUT_ANNOTATION";
13
- IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_REMOVE_ANNOTATION"] = "DOCUMENT_REMOVE_ANNOTATION";
13
+ IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_DELETE_ANNOTATION"] = "DOCUMENT_DELETE_ANNOTATION";
14
14
  IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_PUT_EDIT_RECORD"] = "DOCUMENT_PUT_EDIT_RECORD";
15
15
  IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_GET_EDIT_RECORD"] = "DOCUMENT_GET_EDIT_RECORD";
16
16
  })(IMBRICATE_DOCUMENT_FEATURE || (exports.IMBRICATE_DOCUMENT_FEATURE = IMBRICATE_DOCUMENT_FEATURE = {}));
17
- exports.fullSupportedDocumentFeatures = [
18
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
19
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION,
20
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_REMOVE_ANNOTATION,
21
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD,
22
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
23
- ];
24
- exports.annotationExcludedDocumentFeatures = [
25
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
26
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_EDIT_RECORD,
27
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
28
- ];
29
- exports.editRecordExcludedDocumentFeatures = [
30
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
31
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION,
32
- IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_REMOVE_ANNOTATION,
33
- ];
34
- exports.IMBRICATE_DOCUMENT_PRESET_FEATURES = {
35
- FULL_SUPPORTED_FEATURES: exports.fullSupportedDocumentFeatures,
36
- ANNOTATION_EXCLUDED_FEATURES: exports.annotationExcludedDocumentFeatures,
37
- EDIT_RECORD_EXCLUDED_FEATURES: exports.editRecordExcludedDocumentFeatures,
38
- };
39
17
  const checkImbricateDocumentFeatureSupported = (features, feature) => {
40
18
  return features.includes(feature);
41
19
  };
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "./definition";
7
7
  import { IMBRICATE_DOCUMENT_FEATURE } from "./feature";
8
+ import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentGetEditRecordsOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "./outcome";
8
9
  import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "./property";
9
10
  export interface IImbricateDocument {
10
11
  /**
@@ -14,7 +15,7 @@ export interface IImbricateDocument {
14
15
  /**
15
16
  * Version of the document draft
16
17
  */
17
- readonly documentVersion: number;
18
+ readonly documentVersion: string;
18
19
  /**
19
20
  * Properties of the document
20
21
  */
@@ -36,11 +37,10 @@ export interface IImbricateDocument {
36
37
  * @param value value of the property
37
38
  * @param auditOptions audit options of the document
38
39
  *
39
- * @returns a promise of the edit records of the document
40
- * Note: the edit records will not be added to the document if `noEditRecord` is true,
41
- * Call `addEditRecords` to add the edit records manually.
40
+ * @returns a promise of the outcome of the put property
41
+ * Symbol: S_Document_PutProperty_InvalidKey - if the key is invalid
42
42
  */
43
- putProperty(key: DocumentPropertyKey, value: DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<DocumentEditRecord[]>;
43
+ putProperty(key: DocumentPropertyKey, value: DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
44
44
  /**
45
45
  * Put and replace all properties of the document, optional
46
46
  *
@@ -49,11 +49,10 @@ export interface IImbricateDocument {
49
49
  * @param properties properties of the document
50
50
  * @param auditOptions audit options of the document
51
51
  *
52
- * @returns a promise of the edit records of the document
53
- * Note: the edit records will not be added to the document if `noEditRecord` is true,
54
- * Call `addEditRecords` to add the edit records manually.
52
+ * @returns a promise of the outcome of the put properties
53
+ * Symbol: S_Document_PutProperty_InvalidKey - if the key is invalid
55
54
  */
56
- putProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<DocumentEditRecord[]>;
55
+ putProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
57
56
  /**
58
57
  * Put annotation to the document, optional
59
58
  *
@@ -64,25 +63,24 @@ export interface IImbricateDocument {
64
63
  * @param value value of the annotation
65
64
  * @param auditOptions audit options of the document
66
65
  *
67
- * @returns a promise of the edit records of the document
68
- * Note: if the origin supports Document Edit Record, the edit record will be added by default
69
- * If you do not want to add the edit record, set `noEditRecord` to true in audit options
66
+ * @returns a promise of the outcome of the put annotation
67
+ * Symbol: S_Document_PutAnnotation_InvalidNamespace - if the namespace is invalid
68
+ * Symbol: S_Document_PutAnnotation_InvalidIdentifier - if the identifier is invalid
70
69
  */
71
- putAnnotation?(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<DocumentEditRecord[]>;
70
+ putAnnotation(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutAnnotationOutcome>;
72
71
  /**
73
72
  * Delete annotation from the document
74
73
  *
75
- * RequireFeature: DOCUMENT_REMOVE_ANNOTATION
74
+ * RequireFeature: DOCUMENT_DELETE_ANNOTATION
76
75
  *
77
76
  * @param namespace namespace of the annotation
78
77
  * @param identifier identifier of the annotation
79
78
  * @param auditOptions audit options of the document
80
79
  *
81
- * @returns a promise of the edit records of the document
82
- * Note: if the origin supports Document Edit Record, the edit record will be added by default
83
- * If you do not want to add the edit record, set `noEditRecord` to true in audit options
80
+ * @returns a promise of the outcome of the delete annotation
81
+ * Symbol: S_Document_DeleteAnnotation_NotFound - if the annotation is not found
84
82
  */
85
- deleteAnnotation?(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<DocumentEditRecord[]>;
83
+ deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentDeleteAnnotationOutcome>;
86
84
  /**
87
85
  * Add edit records to the document, optional
88
86
  * This method is optional, if not implemented, means the origin
@@ -92,8 +90,11 @@ export interface IImbricateDocument {
92
90
  * RequireFeature: DOCUMENT_PUT_EDIT_RECORD
93
91
  *
94
92
  * @param records document edit records
93
+ *
94
+ * @returns a promise of the outcome of the add edit records
95
+ * Symbol: S_Document_AddEditRecords_InvalidRecord - if the record is invalid
95
96
  */
96
- addEditRecords?(records: DocumentEditRecord[]): PromiseLike<void>;
97
+ addEditRecords(records: DocumentEditRecord[]): PromiseLike<ImbricateDocumentAddEditRecordsOutcome>;
97
98
  /**
98
99
  * Get edit records of the document, optional
99
100
  * This method is optional, if not implemented, means the origin
@@ -102,7 +103,8 @@ export interface IImbricateDocument {
102
103
  *
103
104
  * RequireFeature: DOCUMENT_GET_EDIT_RECORD
104
105
  *
105
- * @returns a promise of the edit records of the document
106
+ * @returns a promise of the outcome of the get edit records
107
+ * Symbol: S_Document_GetEditRecords_NotFound - if the edit records are not found
106
108
  */
107
- getEditRecords?(): PromiseLike<DocumentEditRecord[]>;
109
+ getEditRecords(): PromiseLike<ImbricateDocumentGetEditRecordsOutcome>;
108
110
  }
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Outcome
5
+ */
6
+ import { DocumentEditRecord } from "./definition";
7
+ export declare const S_Document_PutProperty_InvalidKey: unique symbol;
8
+ export type ImbricateDocumentPutPropertyOutcomeSymbol = typeof S_Document_PutProperty_InvalidKey;
9
+ export type ImbricateDocumentPutPropertyOutcome = {
10
+ readonly editRecords: DocumentEditRecord[];
11
+ } | ImbricateDocumentPutPropertyOutcomeSymbol;
12
+ export declare const S_Document_PutAnnotation_InvalidNamespace: unique symbol;
13
+ export declare const S_Document_PutAnnotation_InvalidIdentifier: unique symbol;
14
+ export type ImbricateDocumentPutAnnotationOutcomeSymbol = typeof S_Document_PutAnnotation_InvalidNamespace | typeof S_Document_PutAnnotation_InvalidIdentifier;
15
+ export type ImbricateDocumentPutAnnotationOutcome = {
16
+ readonly editRecords: DocumentEditRecord[];
17
+ } | ImbricateDocumentPutAnnotationOutcomeSymbol;
18
+ export declare const S_Document_DeleteAnnotation_NotFound: unique symbol;
19
+ export type ImbricateDocumentDeleteAnnotationOutcomeSymbol = typeof S_Document_DeleteAnnotation_NotFound;
20
+ export type ImbricateDocumentDeleteAnnotationOutcome = {
21
+ readonly editRecords: DocumentEditRecord[];
22
+ } | ImbricateDocumentDeleteAnnotationOutcomeSymbol;
23
+ export declare const S_Document_AddEditRecords_InvalidRecord: unique symbol;
24
+ export type ImbricateDocumentAddEditRecordsOutcomeSymbol = typeof S_Document_AddEditRecords_InvalidRecord;
25
+ export type ImbricateDocumentAddEditRecordsOutcome = {
26
+ readonly editRecords: DocumentEditRecord[];
27
+ } | ImbricateDocumentAddEditRecordsOutcomeSymbol;
28
+ export declare const S_Document_GetEditRecords_NotFound: unique symbol;
29
+ export type ImbricateDocumentGetEditRecordsOutcomeSymbol = typeof S_Document_GetEditRecords_NotFound;
30
+ export type ImbricateDocumentGetEditRecordsOutcome = {
31
+ readonly editRecords: DocumentEditRecord[];
32
+ } | ImbricateDocumentGetEditRecordsOutcomeSymbol;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Outcome
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.S_Document_GetEditRecords_NotFound = exports.S_Document_AddEditRecords_InvalidRecord = exports.S_Document_DeleteAnnotation_NotFound = exports.S_Document_PutAnnotation_InvalidIdentifier = exports.S_Document_PutAnnotation_InvalidNamespace = exports.S_Document_PutProperty_InvalidKey = void 0;
9
+ // Put Property
10
+ exports.S_Document_PutProperty_InvalidKey = Symbol("Document_PutProperty_InvalidKey");
11
+ // Put Annotation
12
+ exports.S_Document_PutAnnotation_InvalidNamespace = Symbol("Document_PutAnnotation_InvalidNamespace");
13
+ exports.S_Document_PutAnnotation_InvalidIdentifier = Symbol("Document_PutAnnotation_InvalidIdentifier");
14
+ // Delete Annotation
15
+ exports.S_Document_DeleteAnnotation_NotFound = Symbol("Document_DeleteAnnotation_NotFound");
16
+ // Add Edit Records
17
+ exports.S_Document_AddEditRecords_InvalidRecord = Symbol("Document_AddEditRecords_InvalidRecord");
18
+ // Get Edit Records
19
+ exports.S_Document_GetEditRecords_NotFound = Symbol("Document_GetEditRecords_NotFound");
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Database Error
5
+ */
6
+ import { ImbricateError } from "../imbricate-error";
7
+ export declare class ImbricateDatabaseError extends ImbricateError {
8
+ protected constructor(message: string, type: string, reason?: any);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error
5
+ * @description Database Error
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDatabaseError = void 0;
9
+ const imbricate_error_1 = require("../imbricate-error");
10
+ class ImbricateDatabaseError extends imbricate_error_1.ImbricateError {
11
+ constructor(message, type, reason) {
12
+ super(message, type, reason);
13
+ Object.setPrototypeOf(this, ImbricateDatabaseError.prototype);
14
+ }
15
+ }
16
+ exports.ImbricateDatabaseError = ImbricateDatabaseError;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Feature Not Supported
5
+ */
6
+ import { IMBRICATE_DATABASE_FEATURE } from "../../database/feature";
7
+ import { ImbricateDatabaseError } from "./database-error";
8
+ export declare class ImbricateDatabaseFeatureNotSupportedError extends ImbricateDatabaseError {
9
+ static withFeature(feature: IMBRICATE_DATABASE_FEATURE): ImbricateDatabaseFeatureNotSupportedError;
10
+ static readonly TYPE: string;
11
+ protected constructor(message: string, reason?: any);
12
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error
5
+ * @description Feature Not Supported
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDatabaseFeatureNotSupportedError = void 0;
9
+ const database_error_1 = require("./database-error");
10
+ class ImbricateDatabaseFeatureNotSupportedError extends database_error_1.ImbricateDatabaseError {
11
+ static withFeature(feature) {
12
+ return new ImbricateDatabaseFeatureNotSupportedError(`Feature ${feature} is not supported`, feature);
13
+ }
14
+ constructor(message, reason) {
15
+ super(message, ImbricateDatabaseFeatureNotSupportedError.TYPE, reason);
16
+ }
17
+ }
18
+ exports.ImbricateDatabaseFeatureNotSupportedError = ImbricateDatabaseFeatureNotSupportedError;
19
+ ImbricateDatabaseFeatureNotSupportedError.TYPE = "IMBRICATE_DATABASE_FEATURE_NOT_SUPPORTED";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Database Manager Error
5
+ */
6
+ import { ImbricateError } from "../imbricate-error";
7
+ export declare class ImbricateDatabaseManagerError extends ImbricateError {
8
+ protected constructor(message: string, type: string, reason?: any);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error
5
+ * @description Database Manager Error
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDatabaseManagerError = void 0;
9
+ const imbricate_error_1 = require("../imbricate-error");
10
+ class ImbricateDatabaseManagerError extends imbricate_error_1.ImbricateError {
11
+ constructor(message, type, reason) {
12
+ super(message, type, reason);
13
+ Object.setPrototypeOf(this, ImbricateDatabaseManagerError.prototype);
14
+ }
15
+ }
16
+ exports.ImbricateDatabaseManagerError = ImbricateDatabaseManagerError;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Feature Not Supported
5
+ */
6
+ import { IMBRICATE_DATABASE_MANAGER_FEATURE } from "../../database-manager/feature";
7
+ import { ImbricateDatabaseManagerError } from "./database-manager-error";
8
+ export declare class ImbricateDatabaseManagerFeatureNotSupportedError extends ImbricateDatabaseManagerError {
9
+ static withFeature(feature: IMBRICATE_DATABASE_MANAGER_FEATURE): ImbricateDatabaseManagerFeatureNotSupportedError;
10
+ static readonly TYPE: string;
11
+ protected constructor(message: string, reason?: any);
12
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error
5
+ * @description Feature Not Supported
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDatabaseManagerFeatureNotSupportedError = void 0;
9
+ const database_manager_error_1 = require("./database-manager-error");
10
+ class ImbricateDatabaseManagerFeatureNotSupportedError extends database_manager_error_1.ImbricateDatabaseManagerError {
11
+ static withFeature(feature) {
12
+ return new ImbricateDatabaseManagerFeatureNotSupportedError(`Feature ${feature} is not supported`, feature);
13
+ }
14
+ constructor(message, reason) {
15
+ super(message, ImbricateDatabaseManagerFeatureNotSupportedError.TYPE, reason);
16
+ }
17
+ }
18
+ exports.ImbricateDatabaseManagerFeatureNotSupportedError = ImbricateDatabaseManagerFeatureNotSupportedError;
19
+ ImbricateDatabaseManagerFeatureNotSupportedError.TYPE = "IMBRICATE_DATABASE_MANAGER_FEATURE_NOT_SUPPORTED";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error_Document
4
+ * @description Document Error
5
+ */
6
+ import { ImbricateError } from "../imbricate-error";
7
+ export declare class DocumentError extends ImbricateError {
8
+ protected constructor(message: string, type: string, reason?: any);
9
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error_Document
5
+ * @description Document Error
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.DocumentError = void 0;
9
+ const imbricate_error_1 = require("../imbricate-error");
10
+ class DocumentError extends imbricate_error_1.ImbricateError {
11
+ constructor(message, type, reason) {
12
+ super(message, type, reason);
13
+ Object.setPrototypeOf(this, DocumentError.prototype);
14
+ }
15
+ }
16
+ exports.DocumentError = DocumentError;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Feature Not Supported
5
+ */
6
+ import { IMBRICATE_DOCUMENT_FEATURE } from "../../document/feature";
7
+ import { DocumentError } from "./document-error";
8
+ export declare class ImbricateDocumentFeatureNotSupportedError extends DocumentError {
9
+ static withFeature(feature: IMBRICATE_DOCUMENT_FEATURE): ImbricateDocumentFeatureNotSupportedError;
10
+ static readonly TYPE: string;
11
+ protected constructor(message: string, reason?: any);
12
+ }