@imbricate/core 3.10.1 → 3.12.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 (51) hide show
  1. package/database/base-class/essential-readonly.d.ts +18 -0
  2. package/database/base-class/essential-readonly.js +29 -0
  3. package/database/base-class/essential.d.ts +18 -0
  4. package/database/base-class/essential.js +36 -0
  5. package/database/base-class/exclude-annotation.d.ts +16 -0
  6. package/database/base-class/exclude-annotation.js +32 -0
  7. package/database/base-class/exclude-edit-records.d.ts +15 -0
  8. package/database/base-class/exclude-edit-records.js +31 -0
  9. package/database/base-class/full-feature-readonly.d.ts +21 -0
  10. package/database/base-class/full-feature-readonly.js +39 -0
  11. package/database/base-class/full-feature.d.ts +29 -0
  12. package/database/base-class/full-feature.js +24 -0
  13. package/database/definition.d.ts +15 -0
  14. package/database/feature.d.ts +16 -0
  15. package/database/feature.js +23 -0
  16. package/database/interface.d.ts +64 -30
  17. package/database/outcome.d.ts +58 -0
  18. package/database/outcome.js +28 -0
  19. package/document/base-class/essential-readonly.d.ts +17 -0
  20. package/document/base-class/essential-readonly.js +25 -0
  21. package/document/base-class/essential.d.ts +18 -0
  22. package/document/base-class/essential.js +33 -0
  23. package/document/base-class/exclude-annotation.d.ts +16 -0
  24. package/document/base-class/exclude-annotation.js +29 -0
  25. package/document/base-class/exclude-edit-records.d.ts +15 -0
  26. package/document/base-class/exclude-edit-records.js +28 -0
  27. package/document/base-class/full-feature-readonly.d.ts +19 -0
  28. package/document/base-class/full-feature-readonly.js +35 -0
  29. package/document/base-class/full-feature.d.ts +23 -0
  30. package/document/base-class/full-feature.js +21 -0
  31. package/document/feature.d.ts +13 -0
  32. package/document/feature.js +20 -0
  33. package/document/interface.d.ts +41 -22
  34. package/document/outcome.d.ts +32 -0
  35. package/document/outcome.js +19 -0
  36. package/document/property/default-value.js +3 -3
  37. package/document/property.d.ts +1 -1
  38. package/document/validate.js +21 -6
  39. package/error/database/database-error.d.ts +9 -0
  40. package/error/database/database-error.js +16 -0
  41. package/error/database/feature-not-supported.d.ts +12 -0
  42. package/error/database/feature-not-supported.js +19 -0
  43. package/error/document/document-error.d.ts +9 -0
  44. package/error/document/document-error.js +16 -0
  45. package/error/document/feature-not-supported.d.ts +12 -0
  46. package/error/document/feature-not-supported.js +20 -0
  47. package/error/imbricate-error.d.ts +14 -0
  48. package/error/imbricate-error.js +27 -0
  49. package/index.d.ts +15 -0
  50. package/index.js +15 -0
  51. package/package.json +1 -1
@@ -60,20 +60,35 @@ const validateImbricateProperties = (properties, schema, allowExtraProperties =
60
60
  break;
61
61
  }
62
62
  case property_1.IMBRICATE_PROPERTY_TYPE.MARKDOWN: {
63
- if (typeof value.value !== "string") {
64
- return `Property ${key} value must be a string of text object reference`;
63
+ if (!Array.isArray(value.value)) {
64
+ return `Property ${key} value must be an array of string`;
65
+ }
66
+ for (const markdown of value.value) {
67
+ if (typeof markdown !== "string") {
68
+ return `Property ${key} markdown must be a string`;
69
+ }
65
70
  }
66
71
  break;
67
72
  }
68
73
  case property_1.IMBRICATE_PROPERTY_TYPE.JSON: {
69
- if (typeof value.value !== "string") {
70
- return `Property ${key} value must be a string of text object reference`;
74
+ if (!Array.isArray(value.value)) {
75
+ return `Property ${key} value must be an array of string`;
76
+ }
77
+ for (const json of value.value) {
78
+ if (typeof json !== "string") {
79
+ return `Property ${key} json must be a string`;
80
+ }
71
81
  }
72
82
  break;
73
83
  }
74
84
  case property_1.IMBRICATE_PROPERTY_TYPE.IMBRISCRIPT: {
75
- if (typeof value.value !== "string") {
76
- return `Property ${key} value must be a string of text object reference`;
85
+ if (!Array.isArray(value.value)) {
86
+ return `Property ${key} value must be an array of string`;
87
+ }
88
+ for (const imbriscript of value.value) {
89
+ if (typeof imbriscript !== "string") {
90
+ return `Property ${key} imbriscript must be a string`;
91
+ }
77
92
  }
78
93
  break;
79
94
  }
@@ -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_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
+ }
@@ -0,0 +1,20 @@
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.ImbricateDocumentFeatureNotSupportedError = void 0;
9
+ const document_error_1 = require("./document-error");
10
+ class ImbricateDocumentFeatureNotSupportedError extends document_error_1.DocumentError {
11
+ static withFeature(feature) {
12
+ return new ImbricateDocumentFeatureNotSupportedError(`Feature ${feature} is not supported`, feature);
13
+ }
14
+ constructor(message, reason) {
15
+ super(message, ImbricateDocumentFeatureNotSupportedError.TYPE, reason);
16
+ Object.setPrototypeOf(this, ImbricateDocumentFeatureNotSupportedError.prototype);
17
+ }
18
+ }
19
+ exports.ImbricateDocumentFeatureNotSupportedError = ImbricateDocumentFeatureNotSupportedError;
20
+ ImbricateDocumentFeatureNotSupportedError.TYPE = "IMBRICATE_DOCUMENT_FEATURE_NOT_SUPPORTED";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Error
4
+ * @description Imbricate Error
5
+ */
6
+ export declare class ImbricateError extends Error {
7
+ private readonly _type;
8
+ private readonly _message;
9
+ private readonly _reason;
10
+ protected constructor(message: string, type: string, reason?: any);
11
+ get message(): string;
12
+ get reason(): any | undefined;
13
+ toString(): string;
14
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Error
5
+ * @description Imbricate Error
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateError = void 0;
9
+ class ImbricateError extends Error {
10
+ constructor(message, type, reason) {
11
+ super(message);
12
+ this._type = type;
13
+ this._message = message;
14
+ this._reason = reason;
15
+ Object.setPrototypeOf(this, ImbricateError.prototype);
16
+ }
17
+ get message() {
18
+ return this._message;
19
+ }
20
+ get reason() {
21
+ return this._reason;
22
+ }
23
+ toString() {
24
+ return `[${this._type}] ${this.message}`;
25
+ }
26
+ }
27
+ exports.ImbricateError = ImbricateError;
package/index.d.ts CHANGED
@@ -3,13 +3,28 @@
3
3
  * @description Index
4
4
  */
5
5
  export * from "./author/definition";
6
+ export * from "./database/base-class/essential";
7
+ export * from "./database/base-class/essential-readonly";
8
+ export * from "./database/base-class/exclude-annotation";
9
+ export * from "./database/base-class/full-feature";
10
+ export * from "./database/base-class/full-feature-readonly";
6
11
  export * from "./database/definition";
12
+ export * from "./database/feature";
7
13
  export * from "./database/interface";
8
14
  export * from "./database/manager";
15
+ export * from "./database/outcome";
9
16
  export * from "./database/schema";
10
17
  export * from "./database/validate";
18
+ export * from "./document/base-class/essential";
19
+ export * from "./document/base-class/essential-readonly";
20
+ export * from "./document/base-class/exclude-annotation";
21
+ export * from "./document/base-class/exclude-edit-records";
22
+ export * from "./document/base-class/full-feature";
23
+ export * from "./document/base-class/full-feature-readonly";
11
24
  export * from "./document/definition";
25
+ export * from "./document/feature";
12
26
  export * from "./document/interface";
27
+ export * from "./document/outcome";
13
28
  export * from "./document/property";
14
29
  export * from "./document/property/default-value";
15
30
  export * from "./document/property/definition";
package/index.js CHANGED
@@ -19,13 +19,28 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  __exportStar(require("./author/definition"), exports);
22
+ __exportStar(require("./database/base-class/essential"), exports);
23
+ __exportStar(require("./database/base-class/essential-readonly"), exports);
24
+ __exportStar(require("./database/base-class/exclude-annotation"), exports);
25
+ __exportStar(require("./database/base-class/full-feature"), exports);
26
+ __exportStar(require("./database/base-class/full-feature-readonly"), exports);
22
27
  __exportStar(require("./database/definition"), exports);
28
+ __exportStar(require("./database/feature"), exports);
23
29
  __exportStar(require("./database/interface"), exports);
24
30
  __exportStar(require("./database/manager"), exports);
31
+ __exportStar(require("./database/outcome"), exports);
25
32
  __exportStar(require("./database/schema"), exports);
26
33
  __exportStar(require("./database/validate"), exports);
34
+ __exportStar(require("./document/base-class/essential"), exports);
35
+ __exportStar(require("./document/base-class/essential-readonly"), exports);
36
+ __exportStar(require("./document/base-class/exclude-annotation"), exports);
37
+ __exportStar(require("./document/base-class/exclude-edit-records"), exports);
38
+ __exportStar(require("./document/base-class/full-feature"), exports);
39
+ __exportStar(require("./document/base-class/full-feature-readonly"), exports);
27
40
  __exportStar(require("./document/definition"), exports);
41
+ __exportStar(require("./document/feature"), exports);
28
42
  __exportStar(require("./document/interface"), exports);
43
+ __exportStar(require("./document/outcome"), exports);
29
44
  __exportStar(require("./document/property"), exports);
30
45
  __exportStar(require("./document/property/default-value"), exports);
31
46
  __exportStar(require("./document/property/definition"), exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imbricate/core",
3
3
  "main": "index.js",
4
- "version": "3.10.1",
4
+ "version": "3.12.0",
5
5
  "description": "Imbricate Core, Notebook for Engineers",
6
6
  "repository": {
7
7
  "type": "git",