@imbricate/core 3.11.0 → 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.
- package/database/base-class/essential-readonly.d.ts +18 -0
- package/database/base-class/essential-readonly.js +29 -0
- package/database/base-class/essential.d.ts +18 -0
- package/database/base-class/essential.js +36 -0
- package/database/base-class/exclude-annotation.d.ts +16 -0
- package/database/base-class/exclude-annotation.js +32 -0
- package/database/base-class/exclude-edit-records.d.ts +15 -0
- package/database/base-class/exclude-edit-records.js +31 -0
- package/database/base-class/full-feature-readonly.d.ts +21 -0
- package/database/base-class/full-feature-readonly.js +39 -0
- package/database/base-class/full-feature.d.ts +29 -0
- package/database/base-class/full-feature.js +24 -0
- package/database/feature.d.ts +2 -7
- package/database/feature.js +3 -38
- package/database/interface.d.ts +41 -32
- package/database/outcome.d.ts +58 -0
- package/database/outcome.js +28 -0
- package/document/base-class/essential-readonly.d.ts +17 -0
- package/document/base-class/essential-readonly.js +25 -0
- package/document/base-class/essential.d.ts +18 -0
- package/document/base-class/essential.js +33 -0
- package/document/base-class/exclude-annotation.d.ts +16 -0
- package/document/base-class/exclude-annotation.js +29 -0
- package/document/base-class/exclude-edit-records.d.ts +15 -0
- package/document/base-class/exclude-edit-records.js +28 -0
- package/document/base-class/full-feature-readonly.d.ts +19 -0
- package/document/base-class/full-feature-readonly.js +35 -0
- package/document/base-class/full-feature.d.ts +23 -0
- package/document/base-class/full-feature.js +21 -0
- package/document/feature.d.ts +1 -5
- package/document/feature.js +2 -24
- package/document/interface.d.ts +23 -21
- package/document/outcome.d.ts +32 -0
- package/document/outcome.js +19 -0
- package/error/database/database-error.d.ts +9 -0
- package/error/database/database-error.js +16 -0
- package/error/database/feature-not-supported.d.ts +12 -0
- package/error/database/feature-not-supported.js +19 -0
- package/error/document/document-error.d.ts +9 -0
- package/error/document/document-error.js +16 -0
- package/error/document/feature-not-supported.d.ts +12 -0
- package/error/document/feature-not-supported.js +20 -0
- package/error/imbricate-error.d.ts +14 -0
- package/error/imbricate-error.js +27 -0
- package/index.d.ts +13 -0
- package/index.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Essential Readonly
|
|
5
|
+
*/
|
|
6
|
+
import { DocumentProperties } from "../../document/property";
|
|
7
|
+
import { ImbricateDatabaseAuditOptions } from "../definition";
|
|
8
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
9
|
+
import { IImbricateDatabase } from "../interface";
|
|
10
|
+
import { ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "../outcome";
|
|
11
|
+
import { ImbricateDatabaseSchema } from "../schema";
|
|
12
|
+
import { ImbricateDatabaseEssentialBase } from "./essential";
|
|
13
|
+
export declare abstract class ImbricateDatabaseEssentialReadOnlyBase extends ImbricateDatabaseEssentialBase implements IImbricateDatabase {
|
|
14
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
15
|
+
putSchema(_schema: ImbricateDatabaseSchema, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutSchemaOutcome>;
|
|
16
|
+
createDocument(_properties: DocumentProperties, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseCreateDocumentOutcome>;
|
|
17
|
+
removeDocument(_uniqueIdentifier: string, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseRemoveDocumentOutcome>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database
|
|
5
|
+
* @description Essential Readonly
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseEssentialReadOnlyBase = void 0;
|
|
9
|
+
const feature_not_supported_1 = require("../../error/database/feature-not-supported");
|
|
10
|
+
const feature_1 = require("../feature");
|
|
11
|
+
const essential_1 = require("./essential");
|
|
12
|
+
class ImbricateDatabaseEssentialReadOnlyBase extends essential_1.ImbricateDatabaseEssentialBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.supportedFeatures = [
|
|
16
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
|
|
17
|
+
];
|
|
18
|
+
}
|
|
19
|
+
putSchema(_schema, _auditOptions) {
|
|
20
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA);
|
|
21
|
+
}
|
|
22
|
+
createDocument(_properties, _auditOptions) {
|
|
23
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT);
|
|
24
|
+
}
|
|
25
|
+
removeDocument(_uniqueIdentifier, _auditOptions) {
|
|
26
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.ImbricateDatabaseEssentialReadOnlyBase = ImbricateDatabaseEssentialReadOnlyBase;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Essential
|
|
5
|
+
*/
|
|
6
|
+
import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions } from "../definition";
|
|
7
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
8
|
+
import { IImbricateDatabase } from "../interface";
|
|
9
|
+
import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabaseGetEditRecordsOutcome, ImbricateDatabasePutAnnotationOutcome } from "../outcome";
|
|
10
|
+
import { ImbricateDatabaseFullFeatureBase } from "./full-feature";
|
|
11
|
+
export declare abstract class ImbricateDatabaseEssentialBase extends ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
|
|
12
|
+
readonly annotations: DatabaseAnnotations;
|
|
13
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
14
|
+
putAnnotation(_namespace: string, _identifier: string, _value: DatabaseAnnotationValue, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
|
|
15
|
+
deleteAnnotation(_namespace: string, _identifier: string, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
|
|
16
|
+
addEditRecords(_records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
|
|
17
|
+
getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database
|
|
5
|
+
* @description Essential
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseEssentialBase = void 0;
|
|
9
|
+
const feature_not_supported_1 = require("../../error/database/feature-not-supported");
|
|
10
|
+
const feature_1 = require("../feature");
|
|
11
|
+
const full_feature_1 = require("./full-feature");
|
|
12
|
+
class ImbricateDatabaseEssentialBase extends full_feature_1.ImbricateDatabaseFullFeatureBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.annotations = {};
|
|
16
|
+
this.supportedFeatures = [
|
|
17
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
18
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
19
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
20
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
putAnnotation(_namespace, _identifier, _value, _auditOptions) {
|
|
24
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION);
|
|
25
|
+
}
|
|
26
|
+
deleteAnnotation(_namespace, _identifier, _auditOptions) {
|
|
27
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_ANNOTATION);
|
|
28
|
+
}
|
|
29
|
+
addEditRecords(_records) {
|
|
30
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD);
|
|
31
|
+
}
|
|
32
|
+
getEditRecords() {
|
|
33
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.ImbricateDatabaseEssentialBase = ImbricateDatabaseEssentialBase;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Exclude Annotation
|
|
5
|
+
*/
|
|
6
|
+
import { DatabaseAnnotationValue, DatabaseAnnotations, ImbricateDatabaseAuditOptions } from "../definition";
|
|
7
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
8
|
+
import { IImbricateDatabase } from "../interface";
|
|
9
|
+
import { ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabasePutAnnotationOutcome } from "../outcome";
|
|
10
|
+
import { ImbricateDatabaseFullFeatureBase } from "./full-feature";
|
|
11
|
+
export declare abstract class ImbricateDatabaseExcludeAnnotationBase extends ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
|
|
12
|
+
readonly annotations: DatabaseAnnotations;
|
|
13
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
14
|
+
putAnnotation(_namespace: string, _identifier: string, _value: DatabaseAnnotationValue, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
|
|
15
|
+
deleteAnnotation(_namespace: string, _identifier: string, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database
|
|
5
|
+
* @description Exclude Annotation
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseExcludeAnnotationBase = void 0;
|
|
9
|
+
const feature_not_supported_1 = require("../../error/database/feature-not-supported");
|
|
10
|
+
const feature_1 = require("../feature");
|
|
11
|
+
const full_feature_1 = require("./full-feature");
|
|
12
|
+
class ImbricateDatabaseExcludeAnnotationBase extends full_feature_1.ImbricateDatabaseFullFeatureBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.annotations = {};
|
|
16
|
+
this.supportedFeatures = [
|
|
17
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
18
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
19
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
20
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
|
|
21
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD,
|
|
22
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
|
|
23
|
+
];
|
|
24
|
+
}
|
|
25
|
+
putAnnotation(_namespace, _identifier, _value, _auditOptions) {
|
|
26
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION);
|
|
27
|
+
}
|
|
28
|
+
deleteAnnotation(_namespace, _identifier, _auditOptions) {
|
|
29
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_ANNOTATION);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.ImbricateDatabaseExcludeAnnotationBase = ImbricateDatabaseExcludeAnnotationBase;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Exclude Edit Records
|
|
5
|
+
*/
|
|
6
|
+
import { DatabaseEditRecord } from "../definition";
|
|
7
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
8
|
+
import { IImbricateDatabase } from "../interface";
|
|
9
|
+
import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseGetEditRecordsOutcome } from "../outcome";
|
|
10
|
+
import { ImbricateDatabaseFullFeatureBase } from "./full-feature";
|
|
11
|
+
export declare abstract class ImbricateDatabaseExcludeEditRecordsBase extends ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
|
|
12
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
13
|
+
addEditRecords(_records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
|
|
14
|
+
getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database
|
|
5
|
+
* @description Exclude Edit Records
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseExcludeEditRecordsBase = void 0;
|
|
9
|
+
const feature_not_supported_1 = require("../../error/database/feature-not-supported");
|
|
10
|
+
const feature_1 = require("../feature");
|
|
11
|
+
const full_feature_1 = require("./full-feature");
|
|
12
|
+
class ImbricateDatabaseExcludeEditRecordsBase extends full_feature_1.ImbricateDatabaseFullFeatureBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.supportedFeatures = [
|
|
16
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
17
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
18
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
19
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
|
|
20
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION,
|
|
21
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_ANNOTATION,
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
addEditRecords(_records) {
|
|
25
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD);
|
|
26
|
+
}
|
|
27
|
+
getEditRecords() {
|
|
28
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
exports.ImbricateDatabaseExcludeEditRecordsBase = ImbricateDatabaseExcludeEditRecordsBase;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database_BaseClass
|
|
4
|
+
* @description Full Feature Readonly
|
|
5
|
+
*/
|
|
6
|
+
import { DocumentProperties } from "../../document/property";
|
|
7
|
+
import { DatabaseAnnotationValue, DatabaseEditRecord, ImbricateDatabaseAuditOptions } from "../definition";
|
|
8
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
9
|
+
import { IImbricateDatabase } from "../interface";
|
|
10
|
+
import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabasePutAnnotationOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "../outcome";
|
|
11
|
+
import { ImbricateDatabaseSchema } from "../schema";
|
|
12
|
+
import { ImbricateDatabaseFullFeatureBase } from "./full-feature";
|
|
13
|
+
export declare abstract class ImbricateDatabaseFullFeatureReadOnlyBase extends ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
|
|
14
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
15
|
+
putSchema(_schema: ImbricateDatabaseSchema, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutSchemaOutcome>;
|
|
16
|
+
createDocument(_properties: DocumentProperties, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseCreateDocumentOutcome>;
|
|
17
|
+
removeDocument(_uniqueIdentifier: string, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseRemoveDocumentOutcome>;
|
|
18
|
+
putAnnotation(_namespace: string, _identifier: string, _value: DatabaseAnnotationValue, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
|
|
19
|
+
deleteAnnotation(_namespace: string, _identifier: string, _auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
|
|
20
|
+
addEditRecords(_records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database_BaseClass
|
|
5
|
+
* @description Full Feature Readonly
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseFullFeatureReadOnlyBase = void 0;
|
|
9
|
+
const feature_not_supported_1 = require("../../error/database/feature-not-supported");
|
|
10
|
+
const feature_1 = require("../feature");
|
|
11
|
+
const full_feature_1 = require("./full-feature");
|
|
12
|
+
class ImbricateDatabaseFullFeatureReadOnlyBase extends full_feature_1.ImbricateDatabaseFullFeatureBase {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.supportedFeatures = [
|
|
16
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_DOCUMENT,
|
|
17
|
+
feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
|
|
18
|
+
];
|
|
19
|
+
}
|
|
20
|
+
putSchema(_schema, _auditOptions) {
|
|
21
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA);
|
|
22
|
+
}
|
|
23
|
+
createDocument(_properties, _auditOptions) {
|
|
24
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT);
|
|
25
|
+
}
|
|
26
|
+
removeDocument(_uniqueIdentifier, _auditOptions) {
|
|
27
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT);
|
|
28
|
+
}
|
|
29
|
+
putAnnotation(_namespace, _identifier, _value, _auditOptions) {
|
|
30
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION);
|
|
31
|
+
}
|
|
32
|
+
deleteAnnotation(_namespace, _identifier, _auditOptions) {
|
|
33
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_ANNOTATION);
|
|
34
|
+
}
|
|
35
|
+
addEditRecords(_records) {
|
|
36
|
+
throw feature_not_supported_1.ImbricateDatabaseFeatureNotSupportedError.withFeature(feature_1.IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ImbricateDatabaseFullFeatureReadOnlyBase = ImbricateDatabaseFullFeatureReadOnlyBase;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database_BaseClass
|
|
4
|
+
* @description Full Feature
|
|
5
|
+
*/
|
|
6
|
+
import { DocumentProperties } from "../../document/property";
|
|
7
|
+
import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "../definition";
|
|
8
|
+
import { IMBRICATE_DATABASE_FEATURE } from "../feature";
|
|
9
|
+
import { IImbricateDatabase } from "../interface";
|
|
10
|
+
import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseCountDocumentsOutcome, ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabaseGetDocumentOutcome, ImbricateDatabaseGetEditRecordsOutcome, ImbricateDatabasePutAnnotationOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseQueryDocumentsOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "../outcome";
|
|
11
|
+
import { ImbricateDatabaseSchema } from "../schema";
|
|
12
|
+
export declare abstract class ImbricateDatabaseFullFeatureBase implements IImbricateDatabase {
|
|
13
|
+
abstract readonly uniqueIdentifier: string;
|
|
14
|
+
abstract readonly databaseName: string;
|
|
15
|
+
abstract readonly databaseVersion: string;
|
|
16
|
+
abstract readonly schema: ImbricateDatabaseSchema;
|
|
17
|
+
abstract readonly annotations: DatabaseAnnotations;
|
|
18
|
+
readonly supportedFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
19
|
+
abstract putSchema(schema: ImbricateDatabaseSchema, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutSchemaOutcome>;
|
|
20
|
+
abstract createDocument(properties: DocumentProperties, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseCreateDocumentOutcome>;
|
|
21
|
+
abstract getDocument(uniqueIdentifier: string): PromiseLike<ImbricateDatabaseGetDocumentOutcome>;
|
|
22
|
+
abstract queryDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseQueryDocumentsOutcome>;
|
|
23
|
+
abstract countDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseCountDocumentsOutcome>;
|
|
24
|
+
abstract removeDocument(uniqueIdentifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseRemoveDocumentOutcome>;
|
|
25
|
+
abstract putAnnotation(namespace: string, identifier: string, value: DatabaseAnnotationValue, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
|
|
26
|
+
abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
|
|
27
|
+
abstract addEditRecords(records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
|
|
28
|
+
abstract getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Database_BaseClass
|
|
5
|
+
* @description Full Feature
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateDatabaseFullFeatureBase = void 0;
|
|
9
|
+
const feature_1 = require("../feature");
|
|
10
|
+
class ImbricateDatabaseFullFeatureBase {
|
|
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
|
+
];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.ImbricateDatabaseFullFeatureBase = ImbricateDatabaseFullFeatureBase;
|
package/database/feature.d.ts
CHANGED
|
@@ -6,16 +6,11 @@
|
|
|
6
6
|
export declare enum IMBRICATE_DATABASE_FEATURE {
|
|
7
7
|
DATABASE_PUT_SCHEMA = "DATABASE_PUT_SCHEMA",
|
|
8
8
|
DATABASE_CREATE_DOCUMENT = "DATABASE_CREATE_DOCUMENT",
|
|
9
|
-
DATABASE_UPDATE_DOCUMENT = "DATABASE_UPDATE_DOCUMENT",
|
|
10
9
|
DATABASE_DELETE_DOCUMENT = "DATABASE_DELETE_DOCUMENT",
|
|
10
|
+
DATABASE_GET_DOCUMENT = "DATABASE_GET_DOCUMENT",
|
|
11
11
|
DATABASE_PUT_ANNOTATION = "DATABASE_PUT_ANNOTATION",
|
|
12
|
-
|
|
13
|
-
DATABASE_QUERY_DOCUMENT = "DATABASE_QUERY_DOCUMENT",
|
|
12
|
+
DATABASE_DELETE_ANNOTATION = "DATABASE_DELETE_ANNOTATION",
|
|
14
13
|
DATABASE_PUT_EDIT_RECORD = "DATABASE_PUT_EDIT_RECORD",
|
|
15
14
|
DATABASE_GET_EDIT_RECORD = "DATABASE_GET_EDIT_RECORD"
|
|
16
15
|
}
|
|
17
|
-
export declare const fullSupportedDatabaseFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
18
|
-
export declare const editRecordExcludedDatabaseFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
19
|
-
export declare const annotationExcludedDatabaseFeatures: IMBRICATE_DATABASE_FEATURE[];
|
|
20
|
-
export declare const IMBRICATE_DATABASE_PRESET_FEATURES: Record<string, IMBRICATE_DATABASE_FEATURE[]>;
|
|
21
16
|
export declare const checkImbricateDatabaseFeatureSupported: (features: IMBRICATE_DATABASE_FEATURE[], feature: IMBRICATE_DATABASE_FEATURE) => boolean;
|
package/database/feature.js
CHANGED
|
@@ -5,53 +5,18 @@
|
|
|
5
5
|
* @description Feature
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.checkImbricateDatabaseFeatureSupported = exports.
|
|
8
|
+
exports.checkImbricateDatabaseFeatureSupported = exports.IMBRICATE_DATABASE_FEATURE = void 0;
|
|
9
9
|
var IMBRICATE_DATABASE_FEATURE;
|
|
10
10
|
(function (IMBRICATE_DATABASE_FEATURE) {
|
|
11
11
|
IMBRICATE_DATABASE_FEATURE["DATABASE_PUT_SCHEMA"] = "DATABASE_PUT_SCHEMA";
|
|
12
12
|
IMBRICATE_DATABASE_FEATURE["DATABASE_CREATE_DOCUMENT"] = "DATABASE_CREATE_DOCUMENT";
|
|
13
|
-
IMBRICATE_DATABASE_FEATURE["DATABASE_UPDATE_DOCUMENT"] = "DATABASE_UPDATE_DOCUMENT";
|
|
14
13
|
IMBRICATE_DATABASE_FEATURE["DATABASE_DELETE_DOCUMENT"] = "DATABASE_DELETE_DOCUMENT";
|
|
14
|
+
IMBRICATE_DATABASE_FEATURE["DATABASE_GET_DOCUMENT"] = "DATABASE_GET_DOCUMENT";
|
|
15
15
|
IMBRICATE_DATABASE_FEATURE["DATABASE_PUT_ANNOTATION"] = "DATABASE_PUT_ANNOTATION";
|
|
16
|
-
IMBRICATE_DATABASE_FEATURE["
|
|
17
|
-
IMBRICATE_DATABASE_FEATURE["DATABASE_QUERY_DOCUMENT"] = "DATABASE_QUERY_DOCUMENT";
|
|
16
|
+
IMBRICATE_DATABASE_FEATURE["DATABASE_DELETE_ANNOTATION"] = "DATABASE_DELETE_ANNOTATION";
|
|
18
17
|
IMBRICATE_DATABASE_FEATURE["DATABASE_PUT_EDIT_RECORD"] = "DATABASE_PUT_EDIT_RECORD";
|
|
19
18
|
IMBRICATE_DATABASE_FEATURE["DATABASE_GET_EDIT_RECORD"] = "DATABASE_GET_EDIT_RECORD";
|
|
20
19
|
})(IMBRICATE_DATABASE_FEATURE || (exports.IMBRICATE_DATABASE_FEATURE = IMBRICATE_DATABASE_FEATURE = {}));
|
|
21
|
-
exports.fullSupportedDatabaseFeatures = [
|
|
22
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
23
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
24
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_UPDATE_DOCUMENT,
|
|
25
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
26
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION,
|
|
27
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_REMOVE_ANNOTATION,
|
|
28
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_QUERY_DOCUMENT,
|
|
29
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD,
|
|
30
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
|
|
31
|
-
];
|
|
32
|
-
exports.editRecordExcludedDatabaseFeatures = [
|
|
33
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
34
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
35
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_UPDATE_DOCUMENT,
|
|
36
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
37
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_ANNOTATION,
|
|
38
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_REMOVE_ANNOTATION,
|
|
39
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_QUERY_DOCUMENT,
|
|
40
|
-
];
|
|
41
|
-
exports.annotationExcludedDatabaseFeatures = [
|
|
42
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_SCHEMA,
|
|
43
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_CREATE_DOCUMENT,
|
|
44
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_UPDATE_DOCUMENT,
|
|
45
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_DELETE_DOCUMENT,
|
|
46
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_PUT_EDIT_RECORD,
|
|
47
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_GET_EDIT_RECORD,
|
|
48
|
-
IMBRICATE_DATABASE_FEATURE.DATABASE_QUERY_DOCUMENT,
|
|
49
|
-
];
|
|
50
|
-
exports.IMBRICATE_DATABASE_PRESET_FEATURES = {
|
|
51
|
-
FULL_SUPPORTED_FEATURES: exports.fullSupportedDatabaseFeatures,
|
|
52
|
-
EDIT_RECORD_EXCLUDED_FEATURES: exports.editRecordExcludedDatabaseFeatures,
|
|
53
|
-
ANNOTATION_EXCLUDED_FEATURES: exports.annotationExcludedDatabaseFeatures,
|
|
54
|
-
};
|
|
55
20
|
const checkImbricateDatabaseFeatureSupported = (features, feature) => {
|
|
56
21
|
return features.includes(feature);
|
|
57
22
|
};
|
package/database/interface.d.ts
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
* @namespace Database
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
-
import { IImbricateDocument } from "../document/interface";
|
|
7
6
|
import { DocumentProperties } from "../document/property";
|
|
8
7
|
import { DatabaseAnnotationValue, DatabaseAnnotations, DatabaseEditRecord, ImbricateDatabaseAuditOptions, ImbricateDocumentQuery } from "./definition";
|
|
9
8
|
import { IMBRICATE_DATABASE_FEATURE } from "./feature";
|
|
9
|
+
import { ImbricateDatabaseAddEditRecordsOutcome, ImbricateDatabaseCountDocumentsOutcome, ImbricateDatabaseCreateDocumentOutcome, ImbricateDatabaseDeleteAnnotationOutcome, ImbricateDatabaseGetDocumentOutcome, ImbricateDatabaseGetEditRecordsOutcome, ImbricateDatabasePutAnnotationOutcome, ImbricateDatabasePutSchemaOutcome, ImbricateDatabaseQueryDocumentsOutcome, ImbricateDatabaseRemoveDocumentOutcome } from "./outcome";
|
|
10
10
|
import { ImbricateDatabaseSchema } from "./schema";
|
|
11
11
|
export interface IImbricateDatabase {
|
|
12
12
|
/**
|
|
@@ -18,9 +18,9 @@ export interface IImbricateDatabase {
|
|
|
18
18
|
*/
|
|
19
19
|
readonly databaseName: string;
|
|
20
20
|
/**
|
|
21
|
-
* Version of the database
|
|
21
|
+
* Version of the database
|
|
22
22
|
*/
|
|
23
|
-
readonly databaseVersion:
|
|
23
|
+
readonly databaseVersion: string;
|
|
24
24
|
/**
|
|
25
25
|
* Schema of the database
|
|
26
26
|
*/
|
|
@@ -42,11 +42,10 @@ export interface IImbricateDatabase {
|
|
|
42
42
|
* @param schema schema of the database
|
|
43
43
|
* @param auditOptions audit options of the database
|
|
44
44
|
*
|
|
45
|
-
* @returns a promise of the
|
|
46
|
-
*
|
|
47
|
-
* If you do not want to add the edit record, set `noEditRecord` to true
|
|
45
|
+
* @returns a promise of the outcome of the put schema
|
|
46
|
+
* Symbol: S_PutSchema_VersionConflict - if the version conflict
|
|
48
47
|
*/
|
|
49
|
-
putSchema(schema: ImbricateDatabaseSchema, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<
|
|
48
|
+
putSchema(schema: ImbricateDatabaseSchema, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutSchemaOutcome>;
|
|
50
49
|
/**
|
|
51
50
|
* Create a new document in the database
|
|
52
51
|
* If origin supports Document Edit Record, the edit record will be added by default
|
|
@@ -56,9 +55,10 @@ export interface IImbricateDatabase {
|
|
|
56
55
|
* @param properties properties of the document
|
|
57
56
|
* @param auditOptions audit options of the document
|
|
58
57
|
*
|
|
59
|
-
* @returns a promise of the
|
|
58
|
+
* @returns a promise of the outcome of the create document
|
|
59
|
+
* Symbol: S_CreateDocument_IdentifierDuplicated - if the identifier is duplicated
|
|
60
60
|
*/
|
|
61
|
-
createDocument(properties: DocumentProperties, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<
|
|
61
|
+
createDocument(properties: DocumentProperties, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseCreateDocumentOutcome>;
|
|
62
62
|
/**
|
|
63
63
|
* Get one document from the database
|
|
64
64
|
*
|
|
@@ -66,9 +66,10 @@ export interface IImbricateDatabase {
|
|
|
66
66
|
*
|
|
67
67
|
* @param uniqueIdentifier unique identifier of the document
|
|
68
68
|
*
|
|
69
|
-
* @returns a promise of the
|
|
69
|
+
* @returns a promise of the outcome of the get document
|
|
70
|
+
* Symbol: S_GetDocument_NotFound - if the document is not found
|
|
70
71
|
*/
|
|
71
|
-
getDocument(uniqueIdentifier: string): PromiseLike<
|
|
72
|
+
getDocument(uniqueIdentifier: string): PromiseLike<ImbricateDatabaseGetDocumentOutcome>;
|
|
72
73
|
/**
|
|
73
74
|
* Query documents from the database
|
|
74
75
|
*
|
|
@@ -76,9 +77,10 @@ export interface IImbricateDatabase {
|
|
|
76
77
|
*
|
|
77
78
|
* @param query query of the documents
|
|
78
79
|
*
|
|
79
|
-
* @returns a promise of the
|
|
80
|
+
* @returns a promise of the outcome of the query documents
|
|
81
|
+
* Symbol: S_QueryDocuments_Stale - if the documents are stale
|
|
80
82
|
*/
|
|
81
|
-
queryDocuments(query: ImbricateDocumentQuery): PromiseLike<
|
|
83
|
+
queryDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseQueryDocumentsOutcome>;
|
|
82
84
|
/**
|
|
83
85
|
* Count documents in the database
|
|
84
86
|
*
|
|
@@ -86,9 +88,10 @@ export interface IImbricateDatabase {
|
|
|
86
88
|
*
|
|
87
89
|
* @param query query of the documents
|
|
88
90
|
*
|
|
89
|
-
* @returns a promise of the
|
|
91
|
+
* @returns a promise of the outcome of the count documents
|
|
92
|
+
* Symbol: S_CountDocuments_Stale - if the documents are stale
|
|
90
93
|
*/
|
|
91
|
-
countDocuments(query: ImbricateDocumentQuery): PromiseLike<
|
|
94
|
+
countDocuments(query: ImbricateDocumentQuery): PromiseLike<ImbricateDatabaseCountDocumentsOutcome>;
|
|
92
95
|
/**
|
|
93
96
|
* Remove a document from the database
|
|
94
97
|
*
|
|
@@ -96,10 +99,13 @@ export interface IImbricateDatabase {
|
|
|
96
99
|
*
|
|
97
100
|
* @param uniqueIdentifier unique identifier of the document
|
|
98
101
|
* @param auditOptions audit options of the document
|
|
102
|
+
*
|
|
103
|
+
* @returns a promise of the outcome of the remove document
|
|
104
|
+
* Symbol: S_RemoveDocument_NotFound - if the document is not found
|
|
99
105
|
*/
|
|
100
|
-
removeDocument(uniqueIdentifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<
|
|
106
|
+
removeDocument(uniqueIdentifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseRemoveDocumentOutcome>;
|
|
101
107
|
/**
|
|
102
|
-
* Put annotation to the database
|
|
108
|
+
* Put annotation to the database
|
|
103
109
|
*
|
|
104
110
|
* RequireFeature: DATABASE_PUT_ANNOTATION
|
|
105
111
|
*
|
|
@@ -108,27 +114,26 @@ export interface IImbricateDatabase {
|
|
|
108
114
|
* @param value value of the annotation
|
|
109
115
|
* @param auditOptions audit options of the database
|
|
110
116
|
*
|
|
111
|
-
* @returns a promise of the
|
|
112
|
-
*
|
|
113
|
-
*
|
|
117
|
+
* @returns a promise of the outcome of the put annotation
|
|
118
|
+
* Symbol: S_PutAnnotation_InvalidNamespace - if the namespace is invalid
|
|
119
|
+
* Symbol: S_PutAnnotation_InvalidIdentifier - if the identifier is invalid
|
|
114
120
|
*/
|
|
115
|
-
putAnnotation
|
|
121
|
+
putAnnotation(namespace: string, identifier: string, value: DatabaseAnnotationValue, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabasePutAnnotationOutcome>;
|
|
116
122
|
/**
|
|
117
|
-
* Delete annotation from the database
|
|
123
|
+
* Delete annotation from the database
|
|
118
124
|
*
|
|
119
|
-
* RequireFeature:
|
|
125
|
+
* RequireFeature: DATABASE_DELETE_ANNOTATION
|
|
120
126
|
*
|
|
121
127
|
* @param namespace namespace of the annotation
|
|
122
128
|
* @param identifier identifier of the annotation
|
|
123
129
|
* @param auditOptions audit options of the database
|
|
124
130
|
*
|
|
125
|
-
* @returns a promise of the
|
|
126
|
-
*
|
|
127
|
-
* If you do not want to add the edit record, set `noEditRecord` to true in audit options
|
|
131
|
+
* @returns a promise of the outcome of the delete annotation
|
|
132
|
+
* Symbol: S_DeleteAnnotation_NotFound - if the annotation is not found
|
|
128
133
|
*/
|
|
129
|
-
deleteAnnotation
|
|
134
|
+
deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDatabaseAuditOptions): PromiseLike<ImbricateDatabaseDeleteAnnotationOutcome>;
|
|
130
135
|
/**
|
|
131
|
-
* Add edit records to the database
|
|
136
|
+
* Add edit records to the database
|
|
132
137
|
* This method is optional, if not implemented, means the origin
|
|
133
138
|
* 1. The origin does not support edit records
|
|
134
139
|
* 2. The origin force to add edit records when put properties
|
|
@@ -136,17 +141,21 @@ export interface IImbricateDatabase {
|
|
|
136
141
|
* RequireFeature: DATABASE_PUT_EDIT_RECORD
|
|
137
142
|
*
|
|
138
143
|
* @param records database edit records
|
|
144
|
+
*
|
|
145
|
+
* @returns a promise of the outcome of the add edit records
|
|
146
|
+
* Symbol: S_AddEditRecords_InvalidEditRecord - if the edit record is invalid
|
|
139
147
|
*/
|
|
140
|
-
addEditRecords
|
|
148
|
+
addEditRecords(records: DatabaseEditRecord[]): PromiseLike<ImbricateDatabaseAddEditRecordsOutcome>;
|
|
141
149
|
/**
|
|
142
|
-
* Get edit records of the database
|
|
150
|
+
* Get edit records of the database
|
|
143
151
|
* This method is optional, if not implemented, means the origin
|
|
144
152
|
* 1. The origin does not support edit records
|
|
145
153
|
* 2. The origin force to add edit records when put properties
|
|
146
154
|
*
|
|
147
155
|
* RequireFeature: DATABASE_GET_EDIT_RECORD
|
|
148
156
|
*
|
|
149
|
-
* @returns a promise of the
|
|
157
|
+
* @returns a promise of the outcome of the get edit records
|
|
158
|
+
* Symbol: S_GetEditRecords_NotFound - if the edit records are not found
|
|
150
159
|
*/
|
|
151
|
-
getEditRecords
|
|
160
|
+
getEditRecords(): PromiseLike<ImbricateDatabaseGetEditRecordsOutcome>;
|
|
152
161
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Outcome
|
|
5
|
+
*/
|
|
6
|
+
import { IImbricateDocument } from "../document/interface";
|
|
7
|
+
import { DatabaseEditRecord } from "./definition";
|
|
8
|
+
export declare const S_Database_PutSchema_VersionConflict: unique symbol;
|
|
9
|
+
export type ImbricateDatabasePutSchemaOutcomeSymbol = typeof S_Database_PutSchema_VersionConflict;
|
|
10
|
+
export type ImbricateDatabasePutSchemaOutcome = {
|
|
11
|
+
readonly editRecords: DatabaseEditRecord[];
|
|
12
|
+
} | ImbricateDatabasePutSchemaOutcomeSymbol;
|
|
13
|
+
export declare const S_Database_CreateDocument_IdentifierDuplicated: unique symbol;
|
|
14
|
+
export type ImbricateDatabaseCreateDocumentOutcomeSymbol = typeof S_Database_CreateDocument_IdentifierDuplicated;
|
|
15
|
+
export type ImbricateDatabaseCreateDocumentOutcome = {
|
|
16
|
+
readonly document: IImbricateDocument;
|
|
17
|
+
} | ImbricateDatabaseCreateDocumentOutcomeSymbol;
|
|
18
|
+
export declare const S_Database_GetDocument_NotFound: unique symbol;
|
|
19
|
+
export type ImbricateDatabaseGetDocumentOutcomeSymbol = typeof S_Database_GetDocument_NotFound;
|
|
20
|
+
export type ImbricateDatabaseGetDocumentOutcome = {
|
|
21
|
+
readonly document: IImbricateDocument;
|
|
22
|
+
} | ImbricateDatabaseGetDocumentOutcomeSymbol;
|
|
23
|
+
export declare const S_Database_QueryDocuments_Stale: unique symbol;
|
|
24
|
+
export type ImbricateDatabaseQueryDocumentsOutcomeSymbol = typeof S_Database_QueryDocuments_Stale;
|
|
25
|
+
export type ImbricateDatabaseQueryDocumentsOutcome = {
|
|
26
|
+
readonly documents: IImbricateDocument[];
|
|
27
|
+
} | ImbricateDatabaseQueryDocumentsOutcomeSymbol;
|
|
28
|
+
export declare const S_Database_CountDocuments_Stale: unique symbol;
|
|
29
|
+
export type ImbricateDatabaseCountDocumentsOutcomeSymbol = typeof S_Database_CountDocuments_Stale;
|
|
30
|
+
export type ImbricateDatabaseCountDocumentsOutcome = {
|
|
31
|
+
readonly count: number;
|
|
32
|
+
} | ImbricateDatabaseCountDocumentsOutcomeSymbol;
|
|
33
|
+
export declare const S_Database_RemoveDocument_NotFound: unique symbol;
|
|
34
|
+
export type ImbricateDatabaseRemoveDocumentOutcomeSymbol = typeof S_Database_RemoveDocument_NotFound;
|
|
35
|
+
export type ImbricateDatabaseRemoveDocumentOutcome = {
|
|
36
|
+
readonly success: boolean;
|
|
37
|
+
} | ImbricateDatabaseRemoveDocumentOutcomeSymbol;
|
|
38
|
+
export declare const S_Database_PutAnnotation_InvalidNamespace: unique symbol;
|
|
39
|
+
export declare const S_Database_PutAnnotation_InvalidIdentifier: unique symbol;
|
|
40
|
+
export type ImbricateDatabasePutAnnotationOutcomeSymbol = typeof S_Database_PutAnnotation_InvalidNamespace | typeof S_Database_PutAnnotation_InvalidIdentifier;
|
|
41
|
+
export type ImbricateDatabasePutAnnotationOutcome = {
|
|
42
|
+
readonly editRecords: DatabaseEditRecord[];
|
|
43
|
+
} | ImbricateDatabasePutAnnotationOutcomeSymbol;
|
|
44
|
+
export declare const S_Database_DeleteAnnotation_NotFound: unique symbol;
|
|
45
|
+
export type ImbricateDatabaseDeleteAnnotationOutcomeSymbol = typeof S_Database_DeleteAnnotation_NotFound;
|
|
46
|
+
export type ImbricateDatabaseDeleteAnnotationOutcome = {
|
|
47
|
+
readonly editRecords: DatabaseEditRecord[];
|
|
48
|
+
} | ImbricateDatabaseDeleteAnnotationOutcomeSymbol;
|
|
49
|
+
export declare const S_Database_AddEditRecords_InvalidEditRecord: unique symbol;
|
|
50
|
+
export type ImbricateDatabaseAddEditRecordsOutcomeSymbol = typeof S_Database_AddEditRecords_InvalidEditRecord;
|
|
51
|
+
export type ImbricateDatabaseAddEditRecordsOutcome = {
|
|
52
|
+
readonly editRecords: DatabaseEditRecord[];
|
|
53
|
+
} | ImbricateDatabaseAddEditRecordsOutcomeSymbol;
|
|
54
|
+
export declare const S_Database_GetEditRecords_NotFound: unique symbol;
|
|
55
|
+
export type ImbricateDatabaseGetEditRecordsOutcomeSymbol = typeof S_Database_GetEditRecords_NotFound;
|
|
56
|
+
export type ImbricateDatabaseGetEditRecordsOutcome = {
|
|
57
|
+
readonly editRecords: DatabaseEditRecord[];
|
|
58
|
+
} | ImbricateDatabaseGetEditRecordsOutcomeSymbol;
|