@imbricate/core 3.16.0 → 3.18.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 (55) hide show
  1. package/common/action.d.ts +46 -0
  2. package/common/action.js +20 -0
  3. package/common/definition.d.ts +16 -0
  4. package/common/definition.js +22 -0
  5. package/common/export.d.ts +8 -0
  6. package/common/export.js +24 -0
  7. package/common/outcome.d.ts +4 -0
  8. package/common/outcome.js +7 -1
  9. package/database/base-class/full-feature-with-action.d.ts +32 -0
  10. package/database/base-class/full-feature-with-action.js +26 -0
  11. package/database/base-class/full-feature.d.ts +5 -1
  12. package/database/base-class/full-feature.js +10 -1
  13. package/database/definition.d.ts +2 -12
  14. package/database/definition.js +1 -15
  15. package/database/export.d.ts +1 -0
  16. package/database/export.js +1 -0
  17. package/database/feature.d.ts +3 -1
  18. package/database/feature.js +2 -0
  19. package/database/interface.d.ts +15 -0
  20. package/database/validate.js +1 -1
  21. package/database-manager/base-class/full-feature.d.ts +3 -3
  22. package/database-manager/database-manager.d.ts +3 -2
  23. package/database-manager/definition.d.ts +24 -0
  24. package/database-manager/definition.js +7 -0
  25. package/database-manager/export.d.ts +1 -0
  26. package/database-manager/export.js +1 -0
  27. package/database-manager/outcome.d.ts +7 -7
  28. package/database-manager/outcome.js +8 -8
  29. package/document/base-class/essential-readonly.d.ts +3 -3
  30. package/document/base-class/essential-readonly.js +2 -2
  31. package/document/base-class/full-feature-readonly.d.ts +3 -3
  32. package/document/base-class/full-feature-readonly.js +2 -2
  33. package/document/base-class/full-feature-with-action.d.ts +26 -0
  34. package/document/base-class/full-feature-with-action.js +23 -0
  35. package/document/base-class/full-feature.d.ts +8 -4
  36. package/document/base-class/full-feature.js +10 -1
  37. package/document/export.d.ts +1 -0
  38. package/document/export.js +1 -0
  39. package/document/feature.d.ts +3 -1
  40. package/document/feature.js +2 -0
  41. package/document/interface.d.ts +21 -7
  42. package/index.d.ts +1 -1
  43. package/index.js +1 -1
  44. package/origin/base-class/essential.js +3 -3
  45. package/origin/base-class/exclude-static.js +3 -3
  46. package/origin/base-class/full-feature-with-action.d.ts +24 -0
  47. package/origin/base-class/full-feature-with-action.js +22 -0
  48. package/origin/base-class/full-feature.d.ts +5 -10
  49. package/origin/base-class/full-feature.js +13 -4
  50. package/origin/export.d.ts +1 -0
  51. package/origin/export.js +1 -0
  52. package/origin/feature.d.ts +6 -4
  53. package/origin/feature.js +5 -3
  54. package/origin/interface.d.ts +15 -0
  55. package/package.json +6 -2
@@ -0,0 +1,46 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Common
4
+ * @description Action
5
+ */
6
+ import { IETF_LOCALE } from "@sudoo/locale";
7
+ import { HTTP_RESPONSE_CODE } from "@sudoo/magic";
8
+ import { CommonActionOutcomeSymbol, CommonOutcomeSymbol } from "./outcome";
9
+ export declare enum IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE {
10
+ STRING = "STRING"
11
+ }
12
+ export type ImbricateOriginActionParameterType = {
13
+ readonly type: IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE;
14
+ };
15
+ export type ImbricateOriginActionParameter = {
16
+ readonly parameterKey: string;
17
+ readonly getParameterName: (locale: IETF_LOCALE) => string;
18
+ readonly parameterType: ImbricateOriginActionParameterType;
19
+ };
20
+ export declare enum IMBRICATE_ORIGIN_ACTION_APPEARANCE {
21
+ DEFAULT = "DEFAULT",
22
+ IMPORTANT = "IMPORTANT",
23
+ SUCCESS = "SUCCESS",
24
+ WARNING = "WARNING",
25
+ DANGER = "DANGER"
26
+ }
27
+ export type ImbricateOriginAction = {
28
+ readonly actionIdentifier: string;
29
+ readonly getActionName: (locale: IETF_LOCALE) => string;
30
+ readonly parameters: ImbricateOriginActionParameter[];
31
+ readonly appearance?: IMBRICATE_ORIGIN_ACTION_APPEARANCE;
32
+ readonly disabled?: boolean;
33
+ };
34
+ export type ImbricateOriginActionInput = {
35
+ readonly actionIdentifier: string;
36
+ readonly parameters: Record<string, any>;
37
+ };
38
+ export type ImbricateOriginActionResultReference = {};
39
+ export type ImbricateOriginActionResultOutput = {
40
+ readonly content: string;
41
+ };
42
+ export type ImbricateOriginActionOutcome = {
43
+ readonly response: HTTP_RESPONSE_CODE;
44
+ readonly outputs: ImbricateOriginActionResultOutput[];
45
+ readonly references: ImbricateOriginActionResultReference[];
46
+ } | CommonOutcomeSymbol | CommonActionOutcomeSymbol;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Common
5
+ * @description Action
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.IMBRICATE_ORIGIN_ACTION_APPEARANCE = exports.IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE = void 0;
9
+ var IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE;
10
+ (function (IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE) {
11
+ IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE["STRING"] = "STRING";
12
+ })(IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE || (exports.IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE = IMBRICATE_ORIGIN_ACTION_PARAMETER_TYPE = {}));
13
+ var IMBRICATE_ORIGIN_ACTION_APPEARANCE;
14
+ (function (IMBRICATE_ORIGIN_ACTION_APPEARANCE) {
15
+ IMBRICATE_ORIGIN_ACTION_APPEARANCE["DEFAULT"] = "DEFAULT";
16
+ IMBRICATE_ORIGIN_ACTION_APPEARANCE["IMPORTANT"] = "IMPORTANT";
17
+ IMBRICATE_ORIGIN_ACTION_APPEARANCE["SUCCESS"] = "SUCCESS";
18
+ IMBRICATE_ORIGIN_ACTION_APPEARANCE["WARNING"] = "WARNING";
19
+ IMBRICATE_ORIGIN_ACTION_APPEARANCE["DANGER"] = "DANGER";
20
+ })(IMBRICATE_ORIGIN_ACTION_APPEARANCE || (exports.IMBRICATE_ORIGIN_ACTION_APPEARANCE = IMBRICATE_ORIGIN_ACTION_APPEARANCE = {}));
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Common
4
+ * @description Definition
5
+ */
6
+ export declare enum IMBRICATE_QUERY_COMPARE_CONDITION {
7
+ EQUAL = "EQUAL",
8
+ EXIST = "EXIST"
9
+ }
10
+ export declare enum IMBRICATE_QUERY_ATTRIBUTE {
11
+ VALUE = "VALUE"
12
+ }
13
+ export declare enum IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET {
14
+ PROPERTY_TYPE = "PROPERTY_TYPE",
15
+ PROPERTY_VALUE = "PROPERTY_VALUE"
16
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Common
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = exports.IMBRICATE_QUERY_ATTRIBUTE = exports.IMBRICATE_QUERY_COMPARE_CONDITION = void 0;
9
+ var IMBRICATE_QUERY_COMPARE_CONDITION;
10
+ (function (IMBRICATE_QUERY_COMPARE_CONDITION) {
11
+ IMBRICATE_QUERY_COMPARE_CONDITION["EQUAL"] = "EQUAL";
12
+ IMBRICATE_QUERY_COMPARE_CONDITION["EXIST"] = "EXIST";
13
+ })(IMBRICATE_QUERY_COMPARE_CONDITION || (exports.IMBRICATE_QUERY_COMPARE_CONDITION = IMBRICATE_QUERY_COMPARE_CONDITION = {}));
14
+ var IMBRICATE_QUERY_ATTRIBUTE;
15
+ (function (IMBRICATE_QUERY_ATTRIBUTE) {
16
+ IMBRICATE_QUERY_ATTRIBUTE["VALUE"] = "VALUE";
17
+ })(IMBRICATE_QUERY_ATTRIBUTE || (exports.IMBRICATE_QUERY_ATTRIBUTE = IMBRICATE_QUERY_ATTRIBUTE = {}));
18
+ var IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET;
19
+ (function (IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET) {
20
+ IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET["PROPERTY_TYPE"] = "PROPERTY_TYPE";
21
+ IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET["PROPERTY_VALUE"] = "PROPERTY_VALUE";
22
+ })(IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET || (exports.IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = {}));
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Common
4
+ * @description Export
5
+ */
6
+ export * from "./action";
7
+ export * from "./definition";
8
+ export * from "./outcome";
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Common
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("./action"), exports);
23
+ __exportStar(require("./definition"), exports);
24
+ __exportStar(require("./outcome"), exports);
@@ -8,3 +8,7 @@ export declare const S_Common_Origin_ConnectionTimeout: unique symbol;
8
8
  export declare const S_Common_Origin_NotAuthorized: unique symbol;
9
9
  export type CommonOutcomeSymbol = typeof S_Common_Origin_ConnectionFail | typeof S_Common_Origin_ConnectionTimeout | typeof S_Common_Origin_NotAuthorized;
10
10
  export declare const CommonOutcomeSymbolList: CommonOutcomeSymbol[];
11
+ export declare const S_Action_ActionNotFound: unique symbol;
12
+ export declare const S_Action_ActionParameterNotFound: unique symbol;
13
+ export type CommonActionOutcomeSymbol = typeof S_Action_ActionNotFound | typeof S_Action_ActionParameterNotFound;
14
+ export declare const CommonActionOutcomeSymbolList: CommonActionOutcomeSymbol[];
package/common/outcome.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @description Outcome
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.CommonOutcomeSymbolList = exports.S_Common_Origin_NotAuthorized = exports.S_Common_Origin_ConnectionTimeout = exports.S_Common_Origin_ConnectionFail = void 0;
8
+ exports.CommonActionOutcomeSymbolList = exports.S_Action_ActionParameterNotFound = exports.S_Action_ActionNotFound = exports.CommonOutcomeSymbolList = exports.S_Common_Origin_NotAuthorized = exports.S_Common_Origin_ConnectionTimeout = exports.S_Common_Origin_ConnectionFail = void 0;
9
9
  exports.S_Common_Origin_ConnectionFail = Symbol("Common_Origin_ConnectionFail");
10
10
  exports.S_Common_Origin_ConnectionTimeout = Symbol("Common_Origin_ConnectionTimeout");
11
11
  exports.S_Common_Origin_NotAuthorized = Symbol("Common_Origin_NotAuthorized");
@@ -14,3 +14,9 @@ exports.CommonOutcomeSymbolList = [
14
14
  exports.S_Common_Origin_ConnectionTimeout,
15
15
  exports.S_Common_Origin_NotAuthorized,
16
16
  ];
17
+ exports.S_Action_ActionNotFound = Symbol("Action_ActionNotFound");
18
+ exports.S_Action_ActionParameterNotFound = Symbol("Action_ActionParameterNotFound");
19
+ exports.CommonActionOutcomeSymbolList = [
20
+ exports.S_Action_ActionNotFound,
21
+ exports.S_Action_ActionParameterNotFound,
22
+ ];
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Database_BaseClass
4
+ * @description Full Feature With Action
5
+ */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
7
+ import { DocumentProperties } from "../../document/property";
8
+ import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "../definition";
9
+ import { IMBRICATE_DATABASE_FEATURE } from "../feature";
10
+ import { IImbricateDatabase } from "../interface";
11
+ import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseCountDocumentsOutcome, ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabaseGetDocumentOutcome, ImbricateDatabaseGetEditRecordsOutcome, ImbricateDatabasePutAnnotationOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseQueryDocumentsOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "../outcome";
12
+ import { ImbricateDatabaseSchema } from "../schema";
13
+ export declare abstract class ImbricateDatabaseFullFeatureWithActionBase implements IImbricateDatabase {
14
+ abstract readonly uniqueIdentifier: string;
15
+ abstract readonly databaseName: string;
16
+ abstract readonly databaseVersion: string;
17
+ abstract readonly schema: ImbricateDatabaseSchema;
18
+ abstract readonly annotations: DatabaseAnnotations;
19
+ readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
20
+ abstract putSchema(schema: ImbricateDatabaseSchema, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutSchemaOutcome>;
21
+ abstract createDocument(properties: DocumentProperties, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseCreateDocumentOutcome>;
22
+ abstract getDocument(uniqueIdentifier: string): PromiseLike<ImbricateDatabaseGetDocumentOutcome>;
23
+ abstract queryDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseQueryDocumentsOutcome>;
24
+ abstract countDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseCountDocumentsOutcome>;
25
+ abstract removeDocument(uniqueIdentifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseRemoveDocumentOutcome>;
26
+ abstract putAnnotation(namespace: string, identifier: string, value: DatabaseAnnotationValue, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
27
+ abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
28
+ abstract addEditRecords(records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
29
+ abstract getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
30
+ abstract getOriginActions(): ImbricateOriginAction[];
31
+ abstract executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
32
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Database_BaseClass
5
+ * @description Full Feature With Action
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDatabaseFullFeatureWithActionBase = void 0;
9
+ const feature_1 = require("../feature");
10
+ class ImbricateDatabaseFullFeatureWithActionBase {
11
+ constructor() {
12
+ this.supportedFeatures = [
13
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
14
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
15
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
16
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION,
17
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_ANNOTATION,
18
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
19
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD,
20
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
21
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_ORIGIN_ACTIONS,
22
+ feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_EXECUTE_ORIGIN_ACTION,
23
+ ];
24
+ }
25
+ }
26
+ exports.ImbricateDatabaseFullFeatureWithActionBase = ImbricateDatabaseFullFeatureWithActionBase;
@@ -3,13 +3,15 @@
3
3
  * @namespace Database_BaseClass
4
4
  * @description Full Feature
5
5
  */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
6
7
  import { DocumentProperties } from "../../document/property";
7
8
  import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "../definition";
8
9
  import { IMBRICATE_DATABASE_FEATURE } from "../feature";
9
10
  import { IImbricateDatabase } from "../interface";
10
11
  import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseCountDocumentsOutcome, ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabaseGetDocumentOutcome, ImbricateDatabaseGetEditRecordsOutcome, ImbricateDatabasePutAnnotationOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseQueryDocumentsOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "../outcome";
11
12
  import { ImbricateDatabaseSchema } from "../schema";
12
- export declare abstract class ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
13
+ import { ImbricateDatabaseFullFeatureWithActionBase } from "./full-feature-with-action";
14
+ export declare abstract class ImbricateDatabaseFullFeatureBase extends ImbricateDatabaseFullFeatureWithActionBase implements IImbricateDatabase {
13
15
  abstract readonly uniqueIdentifier: string;
14
16
  abstract readonly databaseName: string;
15
17
  abstract readonly databaseVersion: string;
@@ -26,4 +28,6 @@ export declare abstract class ImbricateDatabaseFullFeatureBase implements IImbri
26
28
  abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
27
29
  abstract addEditRecords(records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
28
30
  abstract getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
31
+ getOriginActions(): ImbricateOriginAction[];
32
+ executeOriginAction(_input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
29
33
  }
@@ -6,9 +6,12 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ImbricateDatabaseFullFeatureBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/database/feature-not-supported");
9
10
  const feature_1 = require("../feature");
10
- class ImbricateDatabaseFullFeatureBase {
11
+ const full_feature_with_action_1 = require("./full-feature-with-action");
12
+ class ImbricateDatabaseFullFeatureBase extends full_feature_with_action_1.ImbricateDatabaseFullFeatureWithActionBase {
11
13
  constructor() {
14
+ super(...arguments);
12
15
  this.supportedFeatures = [
13
16
  feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
14
17
  feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
@@ -20,5 +23,11 @@ class ImbricateDatabaseFullFeatureBase {
20
23
  feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
21
24
  ];
22
25
  }
26
+ getOriginActions() {
27
+ throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_ORIGIN_ACTIONS);
28
+ }
29
+ executeOriginAction(_input) {
30
+ throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_EXECUTE_ORIGIN_ACTION);
31
+ }
23
32
  }
24
33
  exports.ImbricateDatabaseFullFeatureBase = ImbricateDatabaseFullFeatureBase;
@@ -4,18 +4,8 @@
4
4
  * @description Definition
5
5
  */
6
6
  import { ImbricateAuthor } from "../author/definition";
7
+ import { IMBRICATE_QUERY_ATTRIBUTE, IMBRICATE_QUERY_COMPARE_CONDITION, IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET } from "../common/definition";
7
8
  import { ImbricateDatabaseSchema } from "./schema";
8
- export declare enum IMBRICATE_QUERY_COMPARE_CONDITION {
9
- EQUAL = "EQUAL",
10
- EXIST = "EXIST"
11
- }
12
- export declare enum IMBRICATE_QUERY_ATTRIBUTE {
13
- VALUE = "VALUE"
14
- }
15
- export declare enum IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET {
16
- PROPERTY_TYPE = "PROPERTY_TYPE",
17
- PROPERTY_VALUE = "PROPERTY_VALUE"
18
- }
19
9
  export type ImbricateDocumentQueryPropertyFilter = {
20
10
  readonly propertyIdentifier: string;
21
11
  readonly target: IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET;
@@ -61,7 +51,7 @@ export type DatabaseEditOperationDeleteAnnotation = {
61
51
  readonly annotationIdentifier: string;
62
52
  };
63
53
  export type DatabaseEditOperationResolveConflict = {
64
- readonly conflicetedEditRecords: string[];
54
+ readonly conflictedEditRecords: string[];
65
55
  };
66
56
  export type DatabaseEditOperationValue<T extends IMBRICATE_DATABASE_EDIT_TYPE> = T extends IMBRICATE_DATABASE_EDIT_TYPE.PUT_SCHEMA ? ImbricateDatabaseSchema : T extends IMBRICATE_DATABASE_EDIT_TYPE.PUT_ANNOTATION ? DatabaseEditOperationPutAnnotation : T extends IMBRICATE_DATABASE_EDIT_TYPE.DELETE_ANNOTATION ? DatabaseEditOperationDeleteAnnotation : T extends IMBRICATE_DATABASE_EDIT_TYPE.RESOLVE_CONFLICT ? DatabaseEditOperationResolveConflict : never;
67
57
  /**
@@ -5,21 +5,7 @@
5
5
  * @description Definition
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.IMBRICATE_DATABASE_EDIT_TYPE = exports.IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = exports.IMBRICATE_QUERY_ATTRIBUTE = exports.IMBRICATE_QUERY_COMPARE_CONDITION = void 0;
9
- var IMBRICATE_QUERY_COMPARE_CONDITION;
10
- (function (IMBRICATE_QUERY_COMPARE_CONDITION) {
11
- IMBRICATE_QUERY_COMPARE_CONDITION["EQUAL"] = "EQUAL";
12
- IMBRICATE_QUERY_COMPARE_CONDITION["EXIST"] = "EXIST";
13
- })(IMBRICATE_QUERY_COMPARE_CONDITION || (exports.IMBRICATE_QUERY_COMPARE_CONDITION = IMBRICATE_QUERY_COMPARE_CONDITION = {}));
14
- var IMBRICATE_QUERY_ATTRIBUTE;
15
- (function (IMBRICATE_QUERY_ATTRIBUTE) {
16
- IMBRICATE_QUERY_ATTRIBUTE["VALUE"] = "VALUE";
17
- })(IMBRICATE_QUERY_ATTRIBUTE || (exports.IMBRICATE_QUERY_ATTRIBUTE = IMBRICATE_QUERY_ATTRIBUTE = {}));
18
- var IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET;
19
- (function (IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET) {
20
- IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET["PROPERTY_TYPE"] = "PROPERTY_TYPE";
21
- IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET["PROPERTY_VALUE"] = "PROPERTY_VALUE";
22
- })(IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET || (exports.IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = IMBRICATE_QUERY_PROPERTY_CONDITION_TARGET = {}));
8
+ exports.IMBRICATE_DATABASE_EDIT_TYPE = void 0;
23
9
  /**
24
10
  * Edit record type of the document
25
11
  */
@@ -8,6 +8,7 @@ export * from "./base-class/essential-readonly";
8
8
  export * from "./base-class/exclude-annotation";
9
9
  export * from "./base-class/full-feature";
10
10
  export * from "./base-class/full-feature-readonly";
11
+ export * from "./base-class/full-feature-with-action";
11
12
  export * from "./definition";
12
13
  export * from "./feature";
13
14
  export * from "./interface";
@@ -24,6 +24,7 @@ __exportStar(require("./base-class/essential-readonly"), exports);
24
24
  __exportStar(require("./base-class/exclude-annotation"), exports);
25
25
  __exportStar(require("./base-class/full-feature"), exports);
26
26
  __exportStar(require("./base-class/full-feature-readonly"), exports);
27
+ __exportStar(require("./base-class/full-feature-with-action"), exports);
27
28
  __exportStar(require("./definition"), exports);
28
29
  __exportStar(require("./feature"), exports);
29
30
  __exportStar(require("./interface"), exports);
@@ -11,6 +11,8 @@ export declare enum IMBRICATE_DATABASE_FEATURE {
11
11
  DATABASE_PUT_ANNOTATION = "DATABASE_PUT_ANNOTATION",
12
12
  DATABASE_DELETE_ANNOTATION = "DATABASE_DELETE_ANNOTATION",
13
13
  DATABASE_PUT_EDIT_RECORD = "DATABASE_PUT_EDIT_RECORD",
14
- DATABASE_GET_EDIT_RECORD = "DATABASE_GET_EDIT_RECORD"
14
+ DATABASE_GET_EDIT_RECORD = "DATABASE_GET_EDIT_RECORD",
15
+ DATABASE_GET_ORIGIN_ACTIONS = "DATABASE_GET_ORIGIN_ACTIONS",
16
+ DATABASE_EXECUTE_ORIGIN_ACTION = "DATABASE_EXECUTE_ORIGIN_ACTION"
15
17
  }
16
18
  export declare const checkImbricateDatabaseFeatureSupported: (features: IMBRICATE_DATABASE_FEATURE[], feature: IMBRICATE_DATABASE_FEATURE) => boolean;
@@ -16,6 +16,8 @@ var IMBRICATE_DATABASE_FEATURE;
16
16
  IMBRICATE_DATABASE_FEATURE["DATABASE_DELETE_ANNOTATION"] = "DATABASE_DELETE_ANNOTATION";
17
17
  IMBRICATE_DATABASE_FEATURE["DATABASE_PUT_EDIT_RECORD"] = "DATABASE_PUT_EDIT_RECORD";
18
18
  IMBRICATE_DATABASE_FEATURE["DATABASE_GET_EDIT_RECORD"] = "DATABASE_GET_EDIT_RECORD";
19
+ IMBRICATE_DATABASE_FEATURE["DATABASE_GET_ORIGIN_ACTIONS"] = "DATABASE_GET_ORIGIN_ACTIONS";
20
+ IMBRICATE_DATABASE_FEATURE["DATABASE_EXECUTE_ORIGIN_ACTION"] = "DATABASE_EXECUTE_ORIGIN_ACTION";
19
21
  })(IMBRICATE_DATABASE_FEATURE || (exports.IMBRICATE_DATABASE_FEATURE = IMBRICATE_DATABASE_FEATURE = {}));
20
22
  const checkImbricateDatabaseFeatureSupported = (features, feature) => {
21
23
  return features.includes(feature);
@@ -3,6 +3,7 @@
3
3
  * @namespace Database
4
4
  * @description Interface
5
5
  */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../common/action";
6
7
  import { DocumentProperties } from "../document/property";
7
8
  import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "./definition";
8
9
  import { IMBRICATE_DATABASE_FEATURE } from "./feature";
@@ -158,4 +159,18 @@ export interface IImbricateDatabase {
158
159
  * Symbol: S_GetEditRecords_NotFound - if the edit records are not found
159
160
  */
160
161
  getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
162
+ /**
163
+ * Get the database actions
164
+ *
165
+ * @returns the database actions
166
+ */
167
+ getOriginActions(): ImbricateOriginAction[];
168
+ /**
169
+ * Execute the database action
170
+ *
171
+ * @param input the input of the action
172
+ *
173
+ * @returns the result of the action
174
+ */
175
+ executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
161
176
  }
@@ -6,7 +6,7 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.validateImbricateDocumentQuery = void 0;
9
- const definition_1 = require("./definition");
9
+ const definition_1 = require("../common/definition");
10
10
  /**
11
11
  * Validate imbricate document query
12
12
  *
@@ -3,14 +3,14 @@
3
3
  * @namespace DatabaseManager
4
4
  * @description Full Feature
5
5
  */
6
- import { ImbricateDatabaseAuditOptions } from "../../database/definition";
6
+ import { ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "../../database/definition";
7
7
  import { ImbricateDatabaseSchemaForCreation } from "../../database/schema";
8
8
  import { IImbricateDatabaseManager } from "../database-manager";
9
9
  import { IMBRICATE_DATABASE_MANAGER_FEATURE } from "../feature";
10
- import { ImbricateDatabaseManagerCreateDatabaseOutcome, ImbricateDatabaseManagerGetDatabaseOutcome, ImbricateDatabaseManagerListDatabasesOutcome, ImbricateDatabaseManagerRemoveDatabaseOutcome } from "../outcome";
10
+ import { ImbricateDatabaseManagerCreateDatabaseOutcome, ImbricateDatabaseManagerGetDatabaseOutcome, ImbricateDatabaseManagerQueryDatabasesOutcome, ImbricateDatabaseManagerRemoveDatabaseOutcome } from "../outcome";
11
11
  export declare abstract class ImbricateDatabaseManagerFullFeatureBase implements IImbricateDatabaseManager {
12
12
  readonly supportedFeatures: IMBRICATE_DATABASE_MANAGER_FEATURE[];
13
- abstract listDatabases(): PromiseLike<ImbricateDatabaseManagerListDatabasesOutcome>;
13
+ abstract queryDatabases(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseManagerQueryDatabasesOutcome>;
14
14
  abstract getDatabase(uniqueIdentifier: string): PromiseLike<ImbricateDatabaseManagerGetDatabaseOutcome>;
15
15
  abstract createDatabase(databaseName: string, schema: ImbricateDatabaseSchemaForCreation, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseManagerCreateDatabaseOutcome>;
16
16
  abstract removeDatabase(uniqueIdentifier: string): PromiseLike<ImbricateDatabaseManagerRemoveDatabaseOutcome>;
@@ -5,8 +5,9 @@
5
5
  */
6
6
  import { ImbricateDatabaseAuditOptions } from "../database/definition";
7
7
  import { ImbricateDatabaseSchemaForCreation } from "../database/schema";
8
+ import { ImbricateDatabaseQuery } from "./definition";
8
9
  import { IMBRICATE_DATABASE_MANAGER_FEATURE } from "./feature";
9
- import { ImbricateDatabaseManagerCreateDatabaseOutcome, ImbricateDatabaseManagerGetDatabaseOutcome, ImbricateDatabaseManagerListDatabasesOutcome, ImbricateDatabaseManagerRemoveDatabaseOutcome } from "./outcome";
10
+ import { ImbricateDatabaseManagerCreateDatabaseOutcome, ImbricateDatabaseManagerGetDatabaseOutcome, ImbricateDatabaseManagerQueryDatabasesOutcome, ImbricateDatabaseManagerRemoveDatabaseOutcome } from "./outcome";
10
11
  export interface IImbricateDatabaseManager {
11
12
  /**
12
13
  * Supported features of the database manager
@@ -18,7 +19,7 @@ export interface IImbricateDatabaseManager {
18
19
  * @returns a promise of the databases in the origin
19
20
  * Symbol: S_DatabaseManager_ListDatabases_Stale - if the databases are stale
20
21
  */
21
- listDatabases(): PromiseLike<ImbricateDatabaseManagerListDatabasesOutcome>;
22
+ queryDatabases(query: ImbricateDatabaseQuery): PromiseLike<ImbricateDatabaseManagerQueryDatabasesOutcome>;
22
23
  /**
23
24
  * Get one database from the origin
24
25
  *
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace DatabaseManager
4
+ * @description Definition
5
+ */
6
+ import { IMBRICATE_QUERY_ATTRIBUTE, IMBRICATE_QUERY_COMPARE_CONDITION } from "../common/definition";
7
+ export type ImbricateDatabaseQueryAnnotationFilter = {
8
+ readonly namespace: string;
9
+ readonly identifier: string;
10
+ readonly attribute: IMBRICATE_QUERY_ATTRIBUTE;
11
+ readonly condition: IMBRICATE_QUERY_COMPARE_CONDITION;
12
+ readonly value: any;
13
+ };
14
+ /**
15
+ * Query of the database
16
+ *
17
+ * @param limit limit of the query
18
+ * @param skip skip of the query
19
+ */
20
+ export type ImbricateDatabaseQuery = {
21
+ readonly limit?: number;
22
+ readonly skip?: number;
23
+ readonly annotationFilters?: ImbricateDatabaseQueryAnnotationFilter[];
24
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace DatabaseManager
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,5 +6,6 @@
6
6
  export * from "./base-class/full-feature";
7
7
  export * from "./base-class/readonly";
8
8
  export * from "./database-manager";
9
+ export * from "./definition";
9
10
  export * from "./feature";
10
11
  export * from "./outcome";
@@ -22,5 +22,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  __exportStar(require("./base-class/full-feature"), exports);
23
23
  __exportStar(require("./base-class/readonly"), exports);
24
24
  __exportStar(require("./database-manager"), exports);
25
+ __exportStar(require("./definition"), exports);
25
26
  __exportStar(require("./feature"), exports);
26
27
  __exportStar(require("./outcome"), exports);
@@ -5,14 +5,14 @@
5
5
  */
6
6
  import { CommonOutcomeSymbol } from "../common/outcome";
7
7
  import { IImbricateDatabase } from "../database/interface";
8
- export declare const S_DatabaseManager_ListDatabases_Stale: unique symbol;
9
- export declare const S_DatabaseManager_ListDatabases_Unknown: unique symbol;
10
- export type ImbricateDatabaseManagerListDatabasesOutcomeSymbol = typeof S_DatabaseManager_ListDatabases_Stale | typeof S_DatabaseManager_ListDatabases_Unknown;
11
- export declare const ImbricateDatabaseManagerListDatabasesOutcomeSymbolList: ImbricateDatabaseManagerListDatabasesOutcomeSymbol[];
12
- export declare const rebuildImbricateDatabaseManagerListDatabasesSymbol: (symbolDescription: string) => CommonOutcomeSymbol | ImbricateDatabaseManagerListDatabasesOutcomeSymbol;
13
- export type ImbricateDatabaseManagerListDatabasesOutcome = {
8
+ export declare const S_DatabaseManager_QueryDatabases_Stale: unique symbol;
9
+ export declare const S_DatabaseManager_QueryDatabases_Unknown: unique symbol;
10
+ export type ImbricateDatabaseManagerQueryDatabasesOutcomeSymbol = typeof S_DatabaseManager_QueryDatabases_Stale | typeof S_DatabaseManager_QueryDatabases_Unknown;
11
+ export declare const ImbricateDatabaseManagerQueryDatabasesOutcomeSymbolList: ImbricateDatabaseManagerQueryDatabasesOutcomeSymbol[];
12
+ export declare const rebuildImbricateDatabaseManagerQueryDatabasesSymbol: (symbolDescription: string) => CommonOutcomeSymbol | ImbricateDatabaseManagerQueryDatabasesOutcomeSymbol;
13
+ export type ImbricateDatabaseManagerQueryDatabasesOutcome = {
14
14
  readonly databases: IImbricateDatabase[];
15
- } | CommonOutcomeSymbol | ImbricateDatabaseManagerListDatabasesOutcomeSymbol;
15
+ } | CommonOutcomeSymbol | ImbricateDatabaseManagerQueryDatabasesOutcomeSymbol;
16
16
  export declare const S_DatabaseManager_GetDatabase_NotFound: unique symbol;
17
17
  export declare const S_DatabaseManager_GetDatabase_Unknown: unique symbol;
18
18
  export type ImbricateDatabaseManagerGetDatabaseOutcomeSymbol = typeof S_DatabaseManager_GetDatabase_NotFound | typeof S_DatabaseManager_GetDatabase_Unknown;
@@ -5,16 +5,16 @@
5
5
  * @description Outcome
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.rebuildImbricateDatabaseManagerRemoveDatabaseSymbol = exports.ImbricateDatabaseManagerRemoveDatabaseOutcomeSymbolList = exports.S_DatabaseManager_RemoveDatabase_Unknown = exports.S_DatabaseManager_RemoveDatabase_NotFound = exports.rebuildImbricateDatabaseManagerCreateDatabaseSymbol = exports.ImbricateDatabaseManagerCreateDatabaseOutcomeSymbolList = exports.S_DatabaseManager_CreateDatabase_Unknown = exports.S_DatabaseManager_CreateDatabase_InvalidSchema = exports.S_DatabaseManager_CreateDatabase_DatabaseNameDuplicated = exports.S_DatabaseManager_CreateDatabase_IdentifierDuplicated = exports.rebuildImbricateDatabaseManagerGetDatabaseSymbol = exports.ImbricateDatabaseManagerGetDatabaseOutcomeSymbolList = exports.S_DatabaseManager_GetDatabase_Unknown = exports.S_DatabaseManager_GetDatabase_NotFound = exports.rebuildImbricateDatabaseManagerListDatabasesSymbol = exports.ImbricateDatabaseManagerListDatabasesOutcomeSymbolList = exports.S_DatabaseManager_ListDatabases_Unknown = exports.S_DatabaseManager_ListDatabases_Stale = void 0;
8
+ exports.rebuildImbricateDatabaseManagerRemoveDatabaseSymbol = exports.ImbricateDatabaseManagerRemoveDatabaseOutcomeSymbolList = exports.S_DatabaseManager_RemoveDatabase_Unknown = exports.S_DatabaseManager_RemoveDatabase_NotFound = exports.rebuildImbricateDatabaseManagerCreateDatabaseSymbol = exports.ImbricateDatabaseManagerCreateDatabaseOutcomeSymbolList = exports.S_DatabaseManager_CreateDatabase_Unknown = exports.S_DatabaseManager_CreateDatabase_InvalidSchema = exports.S_DatabaseManager_CreateDatabase_DatabaseNameDuplicated = exports.S_DatabaseManager_CreateDatabase_IdentifierDuplicated = exports.rebuildImbricateDatabaseManagerGetDatabaseSymbol = exports.ImbricateDatabaseManagerGetDatabaseOutcomeSymbolList = exports.S_DatabaseManager_GetDatabase_Unknown = exports.S_DatabaseManager_GetDatabase_NotFound = exports.rebuildImbricateDatabaseManagerQueryDatabasesSymbol = exports.ImbricateDatabaseManagerQueryDatabasesOutcomeSymbolList = exports.S_DatabaseManager_QueryDatabases_Unknown = exports.S_DatabaseManager_QueryDatabases_Stale = void 0;
9
9
  const rebuild_symbol_1 = require("../util/rebuild-symbol");
10
- // Manager List Databases
11
- exports.S_DatabaseManager_ListDatabases_Stale = Symbol("DatabaseManager_ListDatabases_Stale");
12
- exports.S_DatabaseManager_ListDatabases_Unknown = Symbol("DatabaseManager_ListDatabases_Unknown");
13
- exports.ImbricateDatabaseManagerListDatabasesOutcomeSymbolList = [
14
- exports.S_DatabaseManager_ListDatabases_Stale,
15
- exports.S_DatabaseManager_ListDatabases_Unknown,
10
+ // Manager Query Databases
11
+ exports.S_DatabaseManager_QueryDatabases_Stale = Symbol("DatabaseManager_QueryDatabases_Stale");
12
+ exports.S_DatabaseManager_QueryDatabases_Unknown = Symbol("DatabaseManager_QueryDatabases_Unknown");
13
+ exports.ImbricateDatabaseManagerQueryDatabasesOutcomeSymbolList = [
14
+ exports.S_DatabaseManager_QueryDatabases_Stale,
15
+ exports.S_DatabaseManager_QueryDatabases_Unknown,
16
16
  ];
17
- exports.rebuildImbricateDatabaseManagerListDatabasesSymbol = (0, rebuild_symbol_1.createRebuildImbricateSymbolFunction)(exports.ImbricateDatabaseManagerListDatabasesOutcomeSymbolList, exports.S_DatabaseManager_ListDatabases_Unknown);
17
+ exports.rebuildImbricateDatabaseManagerQueryDatabasesSymbol = (0, rebuild_symbol_1.createRebuildImbricateSymbolFunction)(exports.ImbricateDatabaseManagerQueryDatabasesOutcomeSymbolList, exports.S_DatabaseManager_QueryDatabases_Unknown);
18
18
  // Manager Get Database
19
19
  exports.S_DatabaseManager_GetDatabase_NotFound = Symbol("DatabaseManager_GetDatabase_NotFound");
20
20
  exports.S_DatabaseManager_GetDatabase_Unknown = Symbol("DatabaseManager_GetDatabase_Unknown");
@@ -7,11 +7,11 @@ import { DocumentAnnotations, ImbricateDocumentAuditOptions } from "../definitio
7
7
  import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
8
  import { IImbricateDocument } from "../interface";
9
9
  import { ImbricateDocumentPutPropertyOutcome } from "../outcome";
10
- import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "../property";
10
+ import { DocumentProperties } from "../property";
11
11
  import { ImbricateDocumentEssentialBase } from "./essential";
12
12
  export declare abstract class ImbricateDocumentEssentialReadonlyBase extends ImbricateDocumentEssentialBase implements IImbricateDocument {
13
13
  readonly annotations: DocumentAnnotations;
14
14
  readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
15
- putProperty(_key: DocumentPropertyKey, _value: DocumentPropertyValue<IMBRICATE_PROPERTY_TYPE>, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
16
- putProperties(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
15
+ mergeProperty(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
16
+ replaceProperties(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
17
17
  }
@@ -15,10 +15,10 @@ class ImbricateDocumentEssentialReadonlyBase extends essential_1.ImbricateDocume
15
15
  this.annotations = {};
16
16
  this.supportedFeatures = [];
17
17
  }
18
- putProperty(_key, _value, _auditOptions) {
18
+ mergeProperty(_properties, _auditOptions) {
19
19
  throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
20
20
  }
21
- putProperties(_properties, _auditOptions) {
21
+ replaceProperties(_properties, _auditOptions) {
22
22
  throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
23
23
  }
24
24
  }
@@ -7,12 +7,12 @@ import { DocumentAnnotationValue, DocumentEditRecord, ImbricateDocumentAuditOpti
7
7
  import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
8
  import { IImbricateDocument } from "../interface";
9
9
  import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "../outcome";
10
- import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "../property";
10
+ import { DocumentProperties } from "../property";
11
11
  import { ImbricateDocumentFullFeatureBase } from "./full-feature";
12
12
  export declare abstract class ImbricateDocumentFullFeatureReadonlyBase extends ImbricateDocumentFullFeatureBase implements IImbricateDocument {
13
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>;
14
+ mergeProperties(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
15
+ replaceProperties(_properties: DocumentProperties, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
16
16
  putAnnotation(_namespace: string, _identifier: string, _value: DocumentAnnotationValue, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
17
17
  deleteAnnotation(_namespace: string, _identifier: string, _auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
18
18
  addEditRecords(_records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
@@ -16,10 +16,10 @@ class ImbricateDocumentFullFeatureReadonlyBase extends full_feature_1.ImbricateD
16
16
  feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
17
17
  ];
18
18
  }
19
- putProperty(_key, _value, _auditOptions) {
19
+ mergeProperties(_properties, _auditOptions) {
20
20
  throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
21
21
  }
22
- putProperties(_properties, _auditOptions) {
22
+ replaceProperties(_properties, _auditOptions) {
23
23
  throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY);
24
24
  }
25
25
  putAnnotation(_namespace, _identifier, _value, _auditOptions) {
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Document
4
+ * @description Full Feature
5
+ */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
7
+ import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "../definition";
8
+ import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
9
+ import { IImbricateDocument } from "../interface";
10
+ import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentGetEditRecordsOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "../outcome";
11
+ import { DocumentProperties } from "../property";
12
+ export declare abstract class ImbricateDocumentFullFeatureWithActionBase implements IImbricateDocument {
13
+ abstract readonly uniqueIdentifier: string;
14
+ abstract readonly documentVersion: string;
15
+ abstract readonly properties: DocumentProperties;
16
+ abstract readonly annotations: DocumentAnnotations;
17
+ readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
18
+ abstract mergeProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
19
+ abstract replaceProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
20
+ abstract putAnnotation(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
21
+ abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
22
+ abstract addEditRecords(records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
23
+ abstract getEditRecords(): Promise<ImbricateDocumentGetEditRecordsOutcome>;
24
+ abstract getOriginActions(): ImbricateOriginAction[];
25
+ abstract executeOriginAction(input: ImbricateOriginActionInput): Promise<ImbricateOriginActionOutcome>;
26
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Document
5
+ * @description Full Feature
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateDocumentFullFeatureWithActionBase = void 0;
9
+ const feature_1 = require("../feature");
10
+ class ImbricateDocumentFullFeatureWithActionBase {
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
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_ORIGIN_ACTIONS,
19
+ feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_EXECUTE_ORIGIN_ACTION,
20
+ ];
21
+ }
22
+ }
23
+ exports.ImbricateDocumentFullFeatureWithActionBase = ImbricateDocumentFullFeatureWithActionBase;
@@ -3,21 +3,25 @@
3
3
  * @namespace Document
4
4
  * @description Full Feature
5
5
  */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
6
7
  import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "../definition";
7
8
  import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
8
9
  import { IImbricateDocument } from "../interface";
9
10
  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 {
11
+ import { DocumentProperties } from "../property";
12
+ import { ImbricateDocumentFullFeatureWithActionBase } from "./full-feature-with-action";
13
+ export declare abstract class ImbricateDocumentFullFeatureBase extends ImbricateDocumentFullFeatureWithActionBase implements IImbricateDocument {
12
14
  abstract readonly uniqueIdentifier: string;
13
15
  abstract readonly documentVersion: string;
14
16
  abstract readonly properties: DocumentProperties;
15
17
  abstract readonly annotations: DocumentAnnotations;
16
18
  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 mergeProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
20
+ abstract replaceProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
19
21
  abstract putAnnotation(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
20
22
  abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
21
23
  abstract addEditRecords(records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
22
24
  abstract getEditRecords(): Promise<ImbricateDocumentGetEditRecordsOutcome>;
25
+ getOriginActions(): ImbricateOriginAction[];
26
+ executeOriginAction(_input: ImbricateOriginActionInput): Promise<ImbricateOriginActionOutcome>;
23
27
  }
@@ -6,9 +6,12 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ImbricateDocumentFullFeatureBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/document/feature-not-supported");
9
10
  const feature_1 = require("../feature");
10
- class ImbricateDocumentFullFeatureBase {
11
+ const full_feature_with_action_1 = require("./full-feature-with-action");
12
+ class ImbricateDocumentFullFeatureBase extends full_feature_with_action_1.ImbricateDocumentFullFeatureWithActionBase {
11
13
  constructor() {
14
+ super(...arguments);
12
15
  this.supportedFeatures = [
13
16
  feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_PROPERTY,
14
17
  feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_PUT_ANNOTATION,
@@ -17,5 +20,11 @@ class ImbricateDocumentFullFeatureBase {
17
20
  feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_EDIT_RECORD,
18
21
  ];
19
22
  }
23
+ getOriginActions() {
24
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_GET_ORIGIN_ACTIONS);
25
+ }
26
+ executeOriginAction(_input) {
27
+ throw feature_not_supported_1.ImbricateDocumentFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DOCUMENT_FEATURE.DOCUMENT_EXECUTE_ORIGIN_ACTION);
28
+ }
20
29
  }
21
30
  exports.ImbricateDocumentFullFeatureBase = ImbricateDocumentFullFeatureBase;
@@ -9,6 +9,7 @@ export * from "./base-class/exclude-annotation";
9
9
  export * from "./base-class/exclude-edit-records";
10
10
  export * from "./base-class/full-feature";
11
11
  export * from "./base-class/full-feature-readonly";
12
+ export * from "./base-class/full-feature-with-action";
12
13
  export * from "./definition";
13
14
  export * from "./feature";
14
15
  export * from "./interface";
@@ -25,6 +25,7 @@ __exportStar(require("./base-class/exclude-annotation"), exports);
25
25
  __exportStar(require("./base-class/exclude-edit-records"), exports);
26
26
  __exportStar(require("./base-class/full-feature"), exports);
27
27
  __exportStar(require("./base-class/full-feature-readonly"), exports);
28
+ __exportStar(require("./base-class/full-feature-with-action"), exports);
28
29
  __exportStar(require("./definition"), exports);
29
30
  __exportStar(require("./feature"), exports);
30
31
  __exportStar(require("./interface"), exports);
@@ -8,6 +8,8 @@ export declare enum IMBRICATE_DOCUMENT_FEATURE {
8
8
  DOCUMENT_PUT_ANNOTATION = "DOCUMENT_PUT_ANNOTATION",
9
9
  DOCUMENT_DELETE_ANNOTATION = "DOCUMENT_DELETE_ANNOTATION",
10
10
  DOCUMENT_PUT_EDIT_RECORD = "DOCUMENT_PUT_EDIT_RECORD",
11
- DOCUMENT_GET_EDIT_RECORD = "DOCUMENT_GET_EDIT_RECORD"
11
+ DOCUMENT_GET_EDIT_RECORD = "DOCUMENT_GET_EDIT_RECORD",
12
+ DOCUMENT_GET_ORIGIN_ACTIONS = "DOCUMENT_GET_ORIGIN_ACTIONS",
13
+ DOCUMENT_EXECUTE_ORIGIN_ACTION = "DOCUMENT_EXECUTE_ORIGIN_ACTION"
12
14
  }
13
15
  export declare const checkImbricateDocumentFeatureSupported: (features: IMBRICATE_DOCUMENT_FEATURE[], feature: IMBRICATE_DOCUMENT_FEATURE) => boolean;
@@ -13,6 +13,8 @@ var IMBRICATE_DOCUMENT_FEATURE;
13
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
+ IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_GET_ORIGIN_ACTIONS"] = "DOCUMENT_GET_ORIGIN_ACTIONS";
17
+ IMBRICATE_DOCUMENT_FEATURE["DOCUMENT_EXECUTE_ORIGIN_ACTION"] = "DOCUMENT_EXECUTE_ORIGIN_ACTION";
16
18
  })(IMBRICATE_DOCUMENT_FEATURE || (exports.IMBRICATE_DOCUMENT_FEATURE = IMBRICATE_DOCUMENT_FEATURE = {}));
17
19
  const checkImbricateDocumentFeatureSupported = (features, feature) => {
18
20
  return features.includes(feature);
@@ -3,10 +3,11 @@
3
3
  * @namespace Document
4
4
  * @description Interface
5
5
  */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../common/action";
6
7
  import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "./definition";
7
8
  import { IMBRICATE_DOCUMENT_FEATURE } from "./feature";
8
9
  import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentGetEditRecordsOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "./outcome";
9
- import { DocumentProperties, DocumentPropertyKey, DocumentPropertyValue, IMBRICATE_PROPERTY_TYPE } from "./property";
10
+ import { DocumentProperties } from "./property";
10
11
  export interface IImbricateDocument {
11
12
  /**
12
13
  * Unique identifier of the database
@@ -29,20 +30,19 @@ export interface IImbricateDocument {
29
30
  */
30
31
  readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
31
32
  /**
32
- * Update a property from the document
33
+ * Merge a property to the document
33
34
  *
34
35
  * RequireFeature: DOCUMENT_PUT_PROPERTY
35
36
  *
36
- * @param key key of the property
37
- * @param value value of the property
37
+ * @param properties properties of the document
38
38
  * @param auditOptions audit options of the document
39
39
  *
40
40
  * @returns a promise of the outcome of the put property
41
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<ImbricateDocumentPutPropertyOutcome>;
43
+ mergeProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
44
44
  /**
45
- * Put and replace all properties of the document, optional
45
+ * Replace all properties of the document
46
46
  *
47
47
  * RequireFeature: DOCUMENT_PUT_PROPERTIES
48
48
  *
@@ -52,7 +52,7 @@ export interface IImbricateDocument {
52
52
  * @returns a promise of the outcome of the put properties
53
53
  * Symbol: S_Document_PutProperty_InvalidKey - if the key is invalid
54
54
  */
55
- putProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
55
+ replaceProperties(properties: DocumentProperties, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
56
56
  /**
57
57
  * Put annotation to the document, optional
58
58
  *
@@ -107,4 +107,18 @@ export interface IImbricateDocument {
107
107
  * Symbol: S_Document_GetEditRecords_NotFound - if the edit records are not found
108
108
  */
109
109
  getEditRecords(): PromiseLike<ImbricateDocumentGetEditRecordsOutcome>;
110
+ /**
111
+ * Get the document actions
112
+ *
113
+ * @returns the document actions
114
+ */
115
+ getOriginActions(): ImbricateOriginAction[];
116
+ /**
117
+ * Execute the document action
118
+ *
119
+ * @param input the input of the action
120
+ *
121
+ * @returns the result of the action
122
+ */
123
+ executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
110
124
  }
package/index.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * @description Index
4
4
  */
5
5
  export * from "./author/export";
6
- export * from "./common/outcome";
6
+ export * from "./common/export";
7
7
  export * from "./database-manager/export";
8
8
  export * from "./database/export";
9
9
  export * from "./document/export";
package/index.js CHANGED
@@ -19,7 +19,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
21
  __exportStar(require("./author/export"), exports);
22
- __exportStar(require("./common/outcome"), exports);
22
+ __exportStar(require("./common/export"), exports);
23
23
  __exportStar(require("./database-manager/export"), exports);
24
24
  __exportStar(require("./database/export"), exports);
25
25
  __exportStar(require("./document/export"), exports);
@@ -13,12 +13,12 @@ class ImbricateOriginEssentialBase extends full_feature_1.ImbricateOriginFullFea
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.supportedFeatures = [
16
- feature_1.IMBRICATE_ORIGIN_FEATURE.DATABASE_MANAGER,
17
- feature_1.IMBRICATE_ORIGIN_FEATURE.TEXT_MANAGER,
16
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_DATABASE_MANAGER,
17
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_TEXT_MANAGER,
18
18
  ];
19
19
  }
20
20
  getStaticManager() {
21
- throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.STATIC_MANAGER);
21
+ throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_STATIC_MANAGER);
22
22
  }
23
23
  search(_keyword) {
24
24
  throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_SEARCH);
@@ -13,13 +13,13 @@ class ImbricateOriginExcludeStaticBase extends full_feature_1.ImbricateOriginFul
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.supportedFeatures = [
16
- feature_1.IMBRICATE_ORIGIN_FEATURE.DATABASE_MANAGER,
17
- feature_1.IMBRICATE_ORIGIN_FEATURE.TEXT_MANAGER,
16
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_DATABASE_MANAGER,
17
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_TEXT_MANAGER,
18
18
  feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_SEARCH,
19
19
  ];
20
20
  }
21
21
  getStaticManager() {
22
- throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.STATIC_MANAGER);
22
+ throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_STATIC_MANAGER);
23
23
  }
24
24
  }
25
25
  exports.ImbricateOriginExcludeStaticBase = ImbricateOriginExcludeStaticBase;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Origin
4
+ * @description Full Feature
5
+ */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
7
+ import { IImbricateDatabaseManager } from "../../database-manager/database-manager";
8
+ import { IImbricateStaticManager } from "../../static-manager/static-manager";
9
+ import { IImbricateTextManager } from "../../text-manager/text-manager";
10
+ import { OriginPayload } from "../definition";
11
+ import { IMBRICATE_ORIGIN_FEATURE } from "../feature";
12
+ import { IImbricateOrigin } from "../interface";
13
+ import { ImbricateOriginSearchOutcome } from "../outcome";
14
+ export declare abstract class ImbricateOriginFullFeatureWithActionBase implements IImbricateOrigin {
15
+ abstract readonly uniqueIdentifier: string;
16
+ abstract readonly payloads: OriginPayload;
17
+ readonly supportedFeatures: IMBRICATE_ORIGIN_FEATURE[];
18
+ abstract getDatabaseManager(): IImbricateDatabaseManager;
19
+ abstract getTextManager(): IImbricateTextManager;
20
+ abstract getStaticManager(): IImbricateStaticManager;
21
+ abstract search(keyword: string): PromiseLike<ImbricateOriginSearchOutcome>;
22
+ abstract getOriginActions(): ImbricateOriginAction[];
23
+ abstract executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
24
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Origin
5
+ * @description Full Feature
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ImbricateOriginFullFeatureWithActionBase = void 0;
9
+ const feature_1 = require("../feature");
10
+ class ImbricateOriginFullFeatureWithActionBase {
11
+ constructor() {
12
+ this.supportedFeatures = [
13
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_DATABASE_MANAGER,
14
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_TEXT_MANAGER,
15
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_STATIC_MANAGER,
16
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_SEARCH,
17
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_GET_ORIGIN_ACTIONS,
18
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_EXECUTE_ORIGIN_ACTION,
19
+ ];
20
+ }
21
+ }
22
+ exports.ImbricateOriginFullFeatureWithActionBase = ImbricateOriginFullFeatureWithActionBase;
@@ -3,19 +3,14 @@
3
3
  * @namespace Origin
4
4
  * @description Full Feature
5
5
  */
6
- import { IImbricateDatabaseManager } from "../../database-manager/database-manager";
7
- import { IImbricateStaticManager } from "../../static-manager/static-manager";
8
- import { IImbricateTextManager } from "../../text-manager/text-manager";
9
- import { OriginPayload } from "../definition";
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
10
7
  import { IMBRICATE_ORIGIN_FEATURE } from "../feature";
11
8
  import { IImbricateOrigin } from "../interface";
12
9
  import { ImbricateOriginSearchOutcome } from "../outcome";
13
- export declare abstract class ImbricateOriginFullFeatureBase implements IImbricateOrigin {
14
- abstract readonly uniqueIdentifier: string;
15
- abstract readonly payloads: OriginPayload;
10
+ import { ImbricateOriginFullFeatureWithActionBase } from "./full-feature-with-action";
11
+ export declare abstract class ImbricateOriginFullFeatureBase extends ImbricateOriginFullFeatureWithActionBase implements IImbricateOrigin {
16
12
  readonly supportedFeatures: IMBRICATE_ORIGIN_FEATURE[];
17
- abstract getDatabaseManager(): IImbricateDatabaseManager;
18
- abstract getTextManager(): IImbricateTextManager;
19
- abstract getStaticManager(): IImbricateStaticManager;
20
13
  abstract search(keyword: string): PromiseLike<ImbricateOriginSearchOutcome>;
14
+ getOriginActions(): ImbricateOriginAction[];
15
+ executeOriginAction(_input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
21
16
  }
@@ -6,15 +6,24 @@
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.ImbricateOriginFullFeatureBase = void 0;
9
+ const feature_not_supported_1 = require("../../error/origin/feature-not-supported");
9
10
  const feature_1 = require("../feature");
10
- class ImbricateOriginFullFeatureBase {
11
+ const full_feature_with_action_1 = require("./full-feature-with-action");
12
+ class ImbricateOriginFullFeatureBase extends full_feature_with_action_1.ImbricateOriginFullFeatureWithActionBase {
11
13
  constructor() {
14
+ super(...arguments);
12
15
  this.supportedFeatures = [
13
- feature_1.IMBRICATE_ORIGIN_FEATURE.DATABASE_MANAGER,
14
- feature_1.IMBRICATE_ORIGIN_FEATURE.TEXT_MANAGER,
15
- feature_1.IMBRICATE_ORIGIN_FEATURE.STATIC_MANAGER,
16
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_DATABASE_MANAGER,
17
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_TEXT_MANAGER,
18
+ feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_STATIC_MANAGER,
16
19
  feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_SEARCH,
17
20
  ];
18
21
  }
22
+ getOriginActions() {
23
+ throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_GET_ORIGIN_ACTIONS);
24
+ }
25
+ executeOriginAction(_input) {
26
+ throw feature_not_supported_1.ImbricateOriginFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_ORIGIN_FEATURE.ORIGIN_EXECUTE_ORIGIN_ACTION);
27
+ }
19
28
  }
20
29
  exports.ImbricateOriginFullFeatureBase = ImbricateOriginFullFeatureBase;
@@ -6,6 +6,7 @@
6
6
  export * from "./base-class/essential";
7
7
  export * from "./base-class/exclude-static";
8
8
  export * from "./base-class/full-feature";
9
+ export * from "./base-class/full-feature-with-action";
9
10
  export * from "./definition";
10
11
  export * from "./interface";
11
12
  export * from "./outcome";
package/origin/export.js CHANGED
@@ -22,6 +22,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
22
22
  __exportStar(require("./base-class/essential"), exports);
23
23
  __exportStar(require("./base-class/exclude-static"), exports);
24
24
  __exportStar(require("./base-class/full-feature"), exports);
25
+ __exportStar(require("./base-class/full-feature-with-action"), exports);
25
26
  __exportStar(require("./definition"), exports);
26
27
  __exportStar(require("./interface"), exports);
27
28
  __exportStar(require("./outcome"), exports);
@@ -4,9 +4,11 @@
4
4
  * @description Feature
5
5
  */
6
6
  export declare enum IMBRICATE_ORIGIN_FEATURE {
7
- DATABASE_MANAGER = "DATABASE_MANAGER",
8
- TEXT_MANAGER = "TEXT_MANAGER",
9
- STATIC_MANAGER = "STATIC_MANAGER",
10
- ORIGIN_SEARCH = "ORIGIN_SEARCH"
7
+ ORIGIN_DATABASE_MANAGER = "ORIGIN_DATABASE_MANAGER",
8
+ ORIGIN_TEXT_MANAGER = "ORIGIN_TEXT_MANAGER",
9
+ ORIGIN_STATIC_MANAGER = "ORIGIN_STATIC_MANAGER",
10
+ ORIGIN_SEARCH = "ORIGIN_SEARCH",
11
+ ORIGIN_GET_ORIGIN_ACTIONS = "ORIGIN_GET_ORIGIN_ACTIONS",
12
+ ORIGIN_EXECUTE_ORIGIN_ACTION = "ORIGIN_EXECUTE_ORIGIN_ACTION"
11
13
  }
12
14
  export declare const checkImbricateOriginFeatureSupported: (features: IMBRICATE_ORIGIN_FEATURE[], feature: IMBRICATE_ORIGIN_FEATURE) => boolean;
package/origin/feature.js CHANGED
@@ -8,10 +8,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  exports.checkImbricateOriginFeatureSupported = exports.IMBRICATE_ORIGIN_FEATURE = void 0;
9
9
  var IMBRICATE_ORIGIN_FEATURE;
10
10
  (function (IMBRICATE_ORIGIN_FEATURE) {
11
- IMBRICATE_ORIGIN_FEATURE["DATABASE_MANAGER"] = "DATABASE_MANAGER";
12
- IMBRICATE_ORIGIN_FEATURE["TEXT_MANAGER"] = "TEXT_MANAGER";
13
- IMBRICATE_ORIGIN_FEATURE["STATIC_MANAGER"] = "STATIC_MANAGER";
11
+ IMBRICATE_ORIGIN_FEATURE["ORIGIN_DATABASE_MANAGER"] = "ORIGIN_DATABASE_MANAGER";
12
+ IMBRICATE_ORIGIN_FEATURE["ORIGIN_TEXT_MANAGER"] = "ORIGIN_TEXT_MANAGER";
13
+ IMBRICATE_ORIGIN_FEATURE["ORIGIN_STATIC_MANAGER"] = "ORIGIN_STATIC_MANAGER";
14
14
  IMBRICATE_ORIGIN_FEATURE["ORIGIN_SEARCH"] = "ORIGIN_SEARCH";
15
+ IMBRICATE_ORIGIN_FEATURE["ORIGIN_GET_ORIGIN_ACTIONS"] = "ORIGIN_GET_ORIGIN_ACTIONS";
16
+ IMBRICATE_ORIGIN_FEATURE["ORIGIN_EXECUTE_ORIGIN_ACTION"] = "ORIGIN_EXECUTE_ORIGIN_ACTION";
15
17
  })(IMBRICATE_ORIGIN_FEATURE || (exports.IMBRICATE_ORIGIN_FEATURE = IMBRICATE_ORIGIN_FEATURE = {}));
16
18
  const checkImbricateOriginFeatureSupported = (features, feature) => {
17
19
  return features.includes(feature);
@@ -3,6 +3,7 @@
3
3
  * @namespace Origin
4
4
  * @description Interface
5
5
  */
6
+ import { ImbricateOriginAction, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../common/action";
6
7
  import { IImbricateDatabaseManager } from "../database-manager/database-manager";
7
8
  import { IImbricateStaticManager } from "../static-manager/static-manager";
8
9
  import { IImbricateTextManager } from "../text-manager/text-manager";
@@ -61,4 +62,18 @@ export interface IImbricateOrigin {
61
62
  * Symbol: S_Origin_Search_InvalidKeyword - if the keyword is invalid
62
63
  */
63
64
  search(keyword: string): PromiseLike<ImbricateOriginSearchOutcome>;
65
+ /**
66
+ * Get the origin actions
67
+ *
68
+ * @returns the origin actions
69
+ */
70
+ getOriginActions(): ImbricateOriginAction[];
71
+ /**
72
+ * Execute the origin action
73
+ *
74
+ * @param input the input of the action
75
+ *
76
+ * @returns the result of the action
77
+ */
78
+ executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
64
79
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imbricate/core",
3
3
  "main": "index.js",
4
- "version": "3.16.0",
4
+ "version": "3.18.0",
5
5
  "description": "Imbricate Core, Notebook for Engineers",
6
6
  "repository": {
7
7
  "type": "git",
@@ -17,5 +17,9 @@
17
17
  "bugs": {
18
18
  "url": "https://github.com/Imbricate/Imbricate/issues"
19
19
  },
20
- "homepage": "https://imbricate.io"
20
+ "homepage": "https://imbricate.io",
21
+ "dependencies": {
22
+ "@sudoo/locale": "^2.0.0",
23
+ "@sudoo/magic": "^1.9.0"
24
+ }
21
25
  }