@imbricate/core 2.4.0 → 2.6.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/collection/base.d.ts +4 -1
- package/collection/base.js +4 -1
- package/collection/definition.d.ts +2 -1
- package/collection/definition.js +2 -0
- package/collection/interface.d.ts +16 -1
- package/collection-operation-manager/base.d.ts +18 -0
- package/collection-operation-manager/base.js +43 -0
- package/collection-operation-manager/definition.d.ts +12 -0
- package/collection-operation-manager/definition.js +17 -0
- package/collection-operation-manager/interface.d.ts +34 -0
- package/collection-operation-manager/interface.js +7 -0
- package/index.d.ts +7 -0
- package/index.js +7 -0
- package/operation/definition.d.ts +28 -0
- package/operation/definition.js +14 -0
- package/origin/base.d.ts +2 -0
- package/origin/base.js +3 -0
- package/origin/definition.d.ts +2 -1
- package/origin/definition.js +2 -0
- package/origin/interface.d.ts +7 -0
- package/origin-operation-manager/base.d.ts +18 -0
- package/origin-operation-manager/base.js +43 -0
- package/origin-operation-manager/definition.d.ts +12 -0
- package/origin-operation-manager/definition.js +17 -0
- package/origin-operation-manager/interface.d.ts +34 -0
- package/origin-operation-manager/interface.js +7 -0
- package/package.json +1 -1
- package/page/base.d.ts +2 -1
- package/page/base.js +1 -1
- package/page/interface.d.ts +3 -1
- package/script/base.d.ts +2 -1
- package/script/base.js +1 -1
- package/script/interface.d.ts +3 -1
- package/script-manager/base.d.ts +2 -1
- package/script-manager/base.js +1 -1
- package/script-manager/interface.d.ts +4 -1
package/collection/base.d.ts
CHANGED
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* @namespace Collection
|
|
4
4
|
* @description Base
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
8
|
import { ImbricateCapability } from "../capability/definition";
|
|
9
|
+
import { IImbricateCollectionOperationManager } from "../collection-operation-manager/interface";
|
|
8
10
|
import type { PromiseOr } from "../definition/promise";
|
|
9
11
|
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
10
12
|
import type { ImbricatePageMetadata, ImbricatePageSearchResult, ImbricatePageSnapshot } from "../page/definition";
|
|
@@ -19,7 +21,7 @@ export declare abstract class ImbricateCollectionBase implements IImbricateColle
|
|
|
19
21
|
abstract readonly collectionName: string;
|
|
20
22
|
abstract readonly uniqueIdentifier: string;
|
|
21
23
|
abstract readonly capabilities: ImbricateCollectionCapability;
|
|
22
|
-
createPage(_directories: string[], _title: string, _variant: ImbricatePageVariant, _initialContent: string, _description?: string): PromiseOr<IImbricatePage>;
|
|
24
|
+
createPage(_directories: string[], _title: string, _variant: ImbricatePageVariant, _author: ImbricateAuthor, _initialContent: string, _description?: string): PromiseOr<IImbricatePage>;
|
|
23
25
|
putPage(_pageMetadata: ImbricatePageMetadata, _content: string): PromiseOr<IImbricatePage>;
|
|
24
26
|
retitlePage(_identifier: string, _newTitle: string): PromiseOr<void>;
|
|
25
27
|
deletePage(_identifier: string): PromiseOr<void>;
|
|
@@ -30,4 +32,5 @@ export declare abstract class ImbricateCollectionBase implements IImbricateColle
|
|
|
30
32
|
searchPages(_keyword: string, _config: ImbricateSearchPageConfig): PromiseOr<ImbricatePageSearchResult[]>;
|
|
31
33
|
queryPages(_query: ImbricatePageQuery, _config: ImbricatePageQueryConfig): PromiseOr<IImbricatePage[]>;
|
|
32
34
|
listSupportedVariants(): Promise<ImbricatePageVariant[]>;
|
|
35
|
+
getOperationManager(): IImbricateCollectionOperationManager;
|
|
33
36
|
}
|
package/collection/base.js
CHANGED
|
@@ -20,7 +20,7 @@ class ImbricateCollectionBase {
|
|
|
20
20
|
static allDenyCapability() {
|
|
21
21
|
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
22
22
|
}
|
|
23
|
-
createPage(_directories, _title, _variant, _initialContent, _description) {
|
|
23
|
+
createPage(_directories, _title, _variant, _author, _initialContent, _description) {
|
|
24
24
|
throw not_implemented_1.ImbricateNotImplemented.create("CreatePage", definition_2.IMBRICATE_COLLECTION_CAPABILITY_KEY.CREATE_PAGE);
|
|
25
25
|
}
|
|
26
26
|
putPage(_pageMetadata, _content) {
|
|
@@ -53,5 +53,8 @@ class ImbricateCollectionBase {
|
|
|
53
53
|
listSupportedVariants() {
|
|
54
54
|
throw not_implemented_1.ImbricateNotImplemented.create("ListSupportedVariants", definition_2.IMBRICATE_COLLECTION_CAPABILITY_KEY.LIST_SUPPORTED_VARIANTS);
|
|
55
55
|
}
|
|
56
|
+
getOperationManager() {
|
|
57
|
+
throw not_implemented_1.ImbricateNotImplemented.create("GetOperationManager", definition_2.IMBRICATE_COLLECTION_CAPABILITY_KEY.COLLECTION_OPERATION_MANAGER);
|
|
58
|
+
}
|
|
56
59
|
}
|
|
57
60
|
exports.ImbricateCollectionBase = ImbricateCollectionBase;
|
|
@@ -12,6 +12,7 @@ export declare enum IMBRICATE_COLLECTION_CAPABILITY_KEY {
|
|
|
12
12
|
DELETE_PAGE = "imbricate.collection.page.delete",
|
|
13
13
|
GET_PAGE = "imbricate.collection.page.get",
|
|
14
14
|
LIST_PAGES = "imbricate.collection.page.list",
|
|
15
|
-
LIST_SUPPORTED_VARIANTS = "imbricate.collection.page.list-supported-variants"
|
|
15
|
+
LIST_SUPPORTED_VARIANTS = "imbricate.collection.page.list-supported-variants",
|
|
16
|
+
COLLECTION_OPERATION_MANAGER = "imbricate.collection.operation-manager"
|
|
16
17
|
}
|
|
17
18
|
export declare const ImbricateCollectionCapabilityList: IMBRICATE_COLLECTION_CAPABILITY_KEY[];
|
package/collection/definition.js
CHANGED
|
@@ -15,6 +15,7 @@ var IMBRICATE_COLLECTION_CAPABILITY_KEY;
|
|
|
15
15
|
IMBRICATE_COLLECTION_CAPABILITY_KEY["GET_PAGE"] = "imbricate.collection.page.get";
|
|
16
16
|
IMBRICATE_COLLECTION_CAPABILITY_KEY["LIST_PAGES"] = "imbricate.collection.page.list";
|
|
17
17
|
IMBRICATE_COLLECTION_CAPABILITY_KEY["LIST_SUPPORTED_VARIANTS"] = "imbricate.collection.page.list-supported-variants";
|
|
18
|
+
IMBRICATE_COLLECTION_CAPABILITY_KEY["COLLECTION_OPERATION_MANAGER"] = "imbricate.collection.operation-manager";
|
|
18
19
|
})(IMBRICATE_COLLECTION_CAPABILITY_KEY || (exports.IMBRICATE_COLLECTION_CAPABILITY_KEY = IMBRICATE_COLLECTION_CAPABILITY_KEY = {}));
|
|
19
20
|
exports.ImbricateCollectionCapabilityList = [
|
|
20
21
|
IMBRICATE_COLLECTION_CAPABILITY_KEY.CREATE_PAGE,
|
|
@@ -24,4 +25,5 @@ exports.ImbricateCollectionCapabilityList = [
|
|
|
24
25
|
IMBRICATE_COLLECTION_CAPABILITY_KEY.GET_PAGE,
|
|
25
26
|
IMBRICATE_COLLECTION_CAPABILITY_KEY.LIST_PAGES,
|
|
26
27
|
IMBRICATE_COLLECTION_CAPABILITY_KEY.LIST_SUPPORTED_VARIANTS,
|
|
28
|
+
IMBRICATE_COLLECTION_CAPABILITY_KEY.COLLECTION_OPERATION_MANAGER,
|
|
27
29
|
];
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* @namespace Collection
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
+
import { IImbricateCollectionOperationManager } from "../collection-operation-manager/interface";
|
|
6
8
|
import type { PromiseOr } from "../definition/promise";
|
|
7
9
|
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
8
10
|
import type { ImbricatePageMetadata, ImbricatePageSearchResult, ImbricatePageSnapshot } from "../page/definition";
|
|
@@ -14,7 +16,19 @@ export interface IImbricateCollection {
|
|
|
14
16
|
readonly uniqueIdentifier: string;
|
|
15
17
|
readonly description?: string;
|
|
16
18
|
readonly capabilities: ImbricateCollectionCapability;
|
|
17
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Create a page
|
|
21
|
+
*
|
|
22
|
+
* @param directories Directories
|
|
23
|
+
* @param title Title
|
|
24
|
+
* @param variant Variant
|
|
25
|
+
* @param author Author
|
|
26
|
+
* @param initialContent Initial content
|
|
27
|
+
* @param description Description
|
|
28
|
+
*
|
|
29
|
+
* @returns Created page
|
|
30
|
+
*/
|
|
31
|
+
createPage(directories: string[], title: string, variant: ImbricatePageVariant, author: ImbricateAuthor, initialContent: string, description?: string): PromiseOr<IImbricatePage>;
|
|
18
32
|
putPage(pageMetadata: ImbricatePageMetadata, content: string): PromiseOr<IImbricatePage>;
|
|
19
33
|
retitlePage(identifier: string, newTitle: string): PromiseOr<void>;
|
|
20
34
|
deletePage(identifier: string): PromiseOr<void>;
|
|
@@ -25,4 +39,5 @@ export interface IImbricateCollection {
|
|
|
25
39
|
searchPages(keyword: string, config: ImbricateSearchPageConfig): PromiseOr<ImbricatePageSearchResult[]>;
|
|
26
40
|
queryPages(query: ImbricatePageQuery, config: ImbricatePageQueryConfig): PromiseOr<IImbricatePage[]>;
|
|
27
41
|
listSupportedVariants(): PromiseOr<ImbricatePageVariant[]>;
|
|
42
|
+
getOperationManager(): IImbricateCollectionOperationManager;
|
|
28
43
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace CollectionOperationManager
|
|
4
|
+
* @description Base
|
|
5
|
+
*/
|
|
6
|
+
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
|
+
import { ImbricateCapability } from "../capability/definition";
|
|
8
|
+
import { IMBRICATE_OPERATION_SCOPE, ImbricateOperation } from "../operation/definition";
|
|
9
|
+
import { IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY, ImbricateCollectionOperationManagerCapability } from "./definition";
|
|
10
|
+
import { IImbricateCollectionOperationManager } from "./interface";
|
|
11
|
+
export declare abstract class ImbricateCollectionOperationManagerBase implements IImbricateCollectionOperationManager {
|
|
12
|
+
static buildCapability(initial?: ImbricateCapability): ImbricateCapabilityBuilder<IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY>;
|
|
13
|
+
static allAllowCapability(): ImbricateCollectionOperationManagerCapability;
|
|
14
|
+
static allDenyCapability(): ImbricateCollectionOperationManagerCapability;
|
|
15
|
+
abstract readonly capabilities: ImbricateCollectionOperationManagerCapability;
|
|
16
|
+
listOperations(_scope?: IMBRICATE_OPERATION_SCOPE): Promise<Array<ImbricateOperation<IMBRICATE_OPERATION_SCOPE>>>;
|
|
17
|
+
executeOperation(_operationIdentifier: string, _parameter: unknown): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace CollectionOperationManager
|
|
5
|
+
* @description Base
|
|
6
|
+
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ImbricateCollectionOperationManagerBase = void 0;
|
|
18
|
+
const builder_1 = require("../capability/builder");
|
|
19
|
+
const definition_1 = require("../capability/definition");
|
|
20
|
+
const not_implemented_1 = require("../error/not-implemented");
|
|
21
|
+
const definition_2 = require("./definition");
|
|
22
|
+
class ImbricateCollectionOperationManagerBase {
|
|
23
|
+
static buildCapability(initial = (0, definition_1.createDenyImbricateCapability)()) {
|
|
24
|
+
return builder_1.ImbricateCapabilityBuilder.create(definition_2.ImbricateCollectionOperationManagerCapabilityList, initial);
|
|
25
|
+
}
|
|
26
|
+
static allAllowCapability() {
|
|
27
|
+
return this.buildCapability((0, definition_1.createAllowImbricateCapability)()).build();
|
|
28
|
+
}
|
|
29
|
+
static allDenyCapability() {
|
|
30
|
+
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
31
|
+
}
|
|
32
|
+
listOperations(_scope) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
throw not_implemented_1.ImbricateNotImplemented.create("ListOperations", definition_2.IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY.LIST_OPERATIONS);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
executeOperation(_operationIdentifier, _parameter) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
throw not_implemented_1.ImbricateNotImplemented.create("ExecuteOperation", definition_2.IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY.EXECUTE_OPERATION);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ImbricateCollectionOperationManagerBase = ImbricateCollectionOperationManagerBase;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace CollectionOperationManager
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
import { ImbricateCapability } from "../capability/definition";
|
|
7
|
+
export type ImbricateCollectionOperationManagerCapability = Record<IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY, ImbricateCapability>;
|
|
8
|
+
export declare enum IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY {
|
|
9
|
+
LIST_OPERATIONS = "imbricate.collection-operation.list",
|
|
10
|
+
EXECUTE_OPERATION = "imbricate.collection-operation.execute"
|
|
11
|
+
}
|
|
12
|
+
export declare const ImbricateCollectionOperationManagerCapabilityList: IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace CollectionOperationManager
|
|
5
|
+
* @description Definition
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateCollectionOperationManagerCapabilityList = exports.IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY = void 0;
|
|
9
|
+
var IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY;
|
|
10
|
+
(function (IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY) {
|
|
11
|
+
IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY["LIST_OPERATIONS"] = "imbricate.collection-operation.list";
|
|
12
|
+
IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY["EXECUTE_OPERATION"] = "imbricate.collection-operation.execute";
|
|
13
|
+
})(IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY || (exports.IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY = IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY = {}));
|
|
14
|
+
exports.ImbricateCollectionOperationManagerCapabilityList = [
|
|
15
|
+
IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY.LIST_OPERATIONS,
|
|
16
|
+
IMBRICATE_COLLECTION_OPERATION_MANAGER_CAPABILITY_KEY.EXECUTE_OPERATION,
|
|
17
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace CollectionOperationManager
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { PromiseOr } from "../definition/promise";
|
|
7
|
+
import { IMBRICATE_OPERATION_SCOPE, ImbricateOperation, ImbricateOperationParameter } from "../operation/definition";
|
|
8
|
+
import { ImbricateCollectionOperationManagerCapability } from "./definition";
|
|
9
|
+
export interface IImbricateCollectionOperationManager {
|
|
10
|
+
/**
|
|
11
|
+
* Capabilities of the origin operation manager
|
|
12
|
+
*/
|
|
13
|
+
readonly capabilities: ImbricateCollectionOperationManagerCapability;
|
|
14
|
+
/**
|
|
15
|
+
* List all operations
|
|
16
|
+
*
|
|
17
|
+
* @returns all operations
|
|
18
|
+
*/
|
|
19
|
+
listOperations(): PromiseOr<Array<ImbricateOperation<IMBRICATE_OPERATION_SCOPE>>>;
|
|
20
|
+
/**
|
|
21
|
+
* List operations by scope
|
|
22
|
+
*
|
|
23
|
+
* @param scope the scope of the operation
|
|
24
|
+
* @returns all operations
|
|
25
|
+
*/
|
|
26
|
+
listOperations<T extends IMBRICATE_OPERATION_SCOPE>(scope: IMBRICATE_OPERATION_SCOPE): PromiseOr<Array<ImbricateOperation<T>>>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute operation by identifier
|
|
29
|
+
*
|
|
30
|
+
* @param operationIdentifier the identifier of the operation
|
|
31
|
+
* @param parameter the parameter of the operation
|
|
32
|
+
*/
|
|
33
|
+
executeOperation<T extends IMBRICATE_OPERATION_SCOPE>(operationIdentifier: string, parameter: ImbricateOperationParameter<T>): PromiseOr<void>;
|
|
34
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -13,6 +13,9 @@ export * from "./capability/validate";
|
|
|
13
13
|
export * from "./collection-manager/base";
|
|
14
14
|
export * from "./collection-manager/definition";
|
|
15
15
|
export * from "./collection-manager/interface";
|
|
16
|
+
export * from "./collection-operation-manager/base";
|
|
17
|
+
export * from "./collection-operation-manager/definition";
|
|
18
|
+
export * from "./collection-operation-manager/interface";
|
|
16
19
|
export * from "./collection/base";
|
|
17
20
|
export * from "./collection/definition";
|
|
18
21
|
export * from "./collection/interface";
|
|
@@ -28,6 +31,10 @@ export * from "./execute/definition";
|
|
|
28
31
|
export * from "./function/base";
|
|
29
32
|
export * from "./function/definition";
|
|
30
33
|
export * from "./function/interface";
|
|
34
|
+
export * from "./operation/definition";
|
|
35
|
+
export * from "./origin-operation-manager/base";
|
|
36
|
+
export * from "./origin-operation-manager/definition";
|
|
37
|
+
export * from "./origin-operation-manager/interface";
|
|
31
38
|
export * from "./origin/base";
|
|
32
39
|
export * from "./origin/definition";
|
|
33
40
|
export * from "./origin/interface";
|
package/index.js
CHANGED
|
@@ -29,6 +29,9 @@ __exportStar(require("./capability/validate"), exports);
|
|
|
29
29
|
__exportStar(require("./collection-manager/base"), exports);
|
|
30
30
|
__exportStar(require("./collection-manager/definition"), exports);
|
|
31
31
|
__exportStar(require("./collection-manager/interface"), exports);
|
|
32
|
+
__exportStar(require("./collection-operation-manager/base"), exports);
|
|
33
|
+
__exportStar(require("./collection-operation-manager/definition"), exports);
|
|
34
|
+
__exportStar(require("./collection-operation-manager/interface"), exports);
|
|
32
35
|
__exportStar(require("./collection/base"), exports);
|
|
33
36
|
__exportStar(require("./collection/definition"), exports);
|
|
34
37
|
__exportStar(require("./collection/interface"), exports);
|
|
@@ -44,6 +47,10 @@ __exportStar(require("./execute/definition"), exports);
|
|
|
44
47
|
__exportStar(require("./function/base"), exports);
|
|
45
48
|
__exportStar(require("./function/definition"), exports);
|
|
46
49
|
__exportStar(require("./function/interface"), exports);
|
|
50
|
+
__exportStar(require("./operation/definition"), exports);
|
|
51
|
+
__exportStar(require("./origin-operation-manager/base"), exports);
|
|
52
|
+
__exportStar(require("./origin-operation-manager/definition"), exports);
|
|
53
|
+
__exportStar(require("./origin-operation-manager/interface"), exports);
|
|
47
54
|
__exportStar(require("./origin/base"), exports);
|
|
48
55
|
__exportStar(require("./origin/definition"), exports);
|
|
49
56
|
__exportStar(require("./origin/interface"), exports);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Operation
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
import { PromiseOr } from "../definition/promise";
|
|
7
|
+
export declare enum IMBRICATE_OPERATION_SCOPE {
|
|
8
|
+
ORIGIN = "imbricate.origin",
|
|
9
|
+
COLLECTION = "imbricate.collection",
|
|
10
|
+
PAGE = "imbricate.page"
|
|
11
|
+
}
|
|
12
|
+
export type ImbricateOperation<T extends IMBRICATE_OPERATION_SCOPE> = {
|
|
13
|
+
readonly operationIdentifier: string;
|
|
14
|
+
readonly operationDisplayName?: string;
|
|
15
|
+
readonly operationDescription?: string;
|
|
16
|
+
readonly scope: T;
|
|
17
|
+
readonly operation: (parameter: ImbricateOperationParameter<T>) => PromiseOr<void>;
|
|
18
|
+
};
|
|
19
|
+
export type ImbricateOperationParameter<T extends IMBRICATE_OPERATION_SCOPE> = T extends IMBRICATE_OPERATION_SCOPE.ORIGIN ? {
|
|
20
|
+
readonly originUniqueIdentifier: string;
|
|
21
|
+
} : T extends IMBRICATE_OPERATION_SCOPE.COLLECTION ? {
|
|
22
|
+
readonly originUniqueIdentifier: string;
|
|
23
|
+
readonly collectionUniqueIdentifier: string;
|
|
24
|
+
} : T extends IMBRICATE_OPERATION_SCOPE.PAGE ? {
|
|
25
|
+
readonly originUniqueIdentifier: string;
|
|
26
|
+
readonly collectionUniqueIdentifier: string;
|
|
27
|
+
readonly pageIdentifier: string;
|
|
28
|
+
} : unknown;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Operation
|
|
5
|
+
* @description Definition
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IMBRICATE_OPERATION_SCOPE = void 0;
|
|
9
|
+
var IMBRICATE_OPERATION_SCOPE;
|
|
10
|
+
(function (IMBRICATE_OPERATION_SCOPE) {
|
|
11
|
+
IMBRICATE_OPERATION_SCOPE["ORIGIN"] = "imbricate.origin";
|
|
12
|
+
IMBRICATE_OPERATION_SCOPE["COLLECTION"] = "imbricate.collection";
|
|
13
|
+
IMBRICATE_OPERATION_SCOPE["PAGE"] = "imbricate.page";
|
|
14
|
+
})(IMBRICATE_OPERATION_SCOPE || (exports.IMBRICATE_OPERATION_SCOPE = IMBRICATE_OPERATION_SCOPE = {}));
|
package/origin/base.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
|
8
8
|
import { ImbricateCapability } from "../capability/definition";
|
|
9
9
|
import { IImbricateCollectionManager } from "../collection-manager/interface";
|
|
10
10
|
import type { IImbricateFunctionManager } from "../function/interface";
|
|
11
|
+
import { IImbricateOriginOperationManager } from "../origin-operation-manager/interface";
|
|
11
12
|
import type { IImbricateOrigin } from "../origin/interface";
|
|
12
13
|
import { IImbricateScriptManager } from "../script-manager/interface";
|
|
13
14
|
import { IMBRICATE_ORIGIN_CAPABILITY_KEY, ImbricateOriginCapability, ImbricateOriginMetadata } from "./definition";
|
|
@@ -24,4 +25,5 @@ export declare abstract class ImbricateOriginBase implements IImbricateOrigin {
|
|
|
24
25
|
getBinaryStorage(): IImbricateBinaryStorage;
|
|
25
26
|
getScriptManager(): IImbricateScriptManager;
|
|
26
27
|
getCollectionManager(): IImbricateCollectionManager;
|
|
28
|
+
getOperationManager(): IImbricateOriginOperationManager;
|
|
27
29
|
}
|
package/origin/base.js
CHANGED
|
@@ -32,5 +32,8 @@ class ImbricateOriginBase {
|
|
|
32
32
|
getCollectionManager() {
|
|
33
33
|
throw not_implemented_1.ImbricateNotImplemented.create("GetCollectionManager", definition_2.IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_COLLECTION_MANAGER);
|
|
34
34
|
}
|
|
35
|
+
getOperationManager() {
|
|
36
|
+
throw not_implemented_1.ImbricateNotImplemented.create("GetOperationManager", definition_2.IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_OPERATION_MANAGER);
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
exports.ImbricateOriginBase = ImbricateOriginBase;
|
package/origin/definition.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export declare enum IMBRICATE_ORIGIN_CAPABILITY_KEY {
|
|
|
18
18
|
ORIGIN_BINARY_STORAGE = "imbricate.origin.binary-storage",
|
|
19
19
|
ORIGIN_TRASH_STASH = "imbricate.origin.trash-stash",
|
|
20
20
|
ORIGIN_SCRIPT_MANAGER = "imbricate.origin.script-manager",
|
|
21
|
-
ORIGIN_COLLECTION_MANAGER = "imbricate.origin.collection-manager"
|
|
21
|
+
ORIGIN_COLLECTION_MANAGER = "imbricate.origin.collection-manager",
|
|
22
|
+
ORIGIN_OPERATION_MANAGER = "imbricate.origin.operation-manager"
|
|
22
23
|
}
|
|
23
24
|
export declare const ImbricateOriginCapabilityList: IMBRICATE_ORIGIN_CAPABILITY_KEY[];
|
package/origin/definition.js
CHANGED
|
@@ -19,6 +19,7 @@ var IMBRICATE_ORIGIN_CAPABILITY_KEY;
|
|
|
19
19
|
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_TRASH_STASH"] = "imbricate.origin.trash-stash";
|
|
20
20
|
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_SCRIPT_MANAGER"] = "imbricate.origin.script-manager";
|
|
21
21
|
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_COLLECTION_MANAGER"] = "imbricate.origin.collection-manager";
|
|
22
|
+
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_OPERATION_MANAGER"] = "imbricate.origin.operation-manager";
|
|
22
23
|
})(IMBRICATE_ORIGIN_CAPABILITY_KEY || (exports.IMBRICATE_ORIGIN_CAPABILITY_KEY = IMBRICATE_ORIGIN_CAPABILITY_KEY = {}));
|
|
23
24
|
exports.ImbricateOriginCapabilityList = [
|
|
24
25
|
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_FUNCTION,
|
|
@@ -26,4 +27,5 @@ exports.ImbricateOriginCapabilityList = [
|
|
|
26
27
|
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_TRASH_STASH,
|
|
27
28
|
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_SCRIPT_MANAGER,
|
|
28
29
|
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_COLLECTION_MANAGER,
|
|
30
|
+
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_OPERATION_MANAGER,
|
|
29
31
|
];
|
package/origin/interface.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { IImbricateBinaryStorage } from "../binary-storage/interface";
|
|
|
7
7
|
import { IImbricateCollectionManager } from "../collection-manager/interface";
|
|
8
8
|
import { PromiseOr } from "../definition/promise";
|
|
9
9
|
import { IImbricateFunctionManager } from "../function/interface";
|
|
10
|
+
import { IImbricateOriginOperationManager } from "../origin-operation-manager/interface";
|
|
10
11
|
import { IImbricateScriptManager } from "../script-manager/interface";
|
|
11
12
|
import { ImbricateOriginCapability, ImbricateOriginMetadata } from "./definition";
|
|
12
13
|
export interface IImbricateOrigin {
|
|
@@ -54,6 +55,12 @@ export interface IImbricateOrigin {
|
|
|
54
55
|
* @returns Collection manager
|
|
55
56
|
*/
|
|
56
57
|
getCollectionManager(): IImbricateCollectionManager;
|
|
58
|
+
/**
|
|
59
|
+
* Get operation manager
|
|
60
|
+
*
|
|
61
|
+
* @returns Operation manager
|
|
62
|
+
*/
|
|
63
|
+
getOperationManager(): IImbricateOriginOperationManager;
|
|
57
64
|
/**
|
|
58
65
|
* Dispose the origin, optional
|
|
59
66
|
* This method will be called when the origin is no longer needed
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace OriginOperationManager
|
|
4
|
+
* @description Base
|
|
5
|
+
*/
|
|
6
|
+
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
|
+
import { ImbricateCapability } from "../capability/definition";
|
|
8
|
+
import { IMBRICATE_OPERATION_SCOPE, ImbricateOperation } from "../operation/definition";
|
|
9
|
+
import { IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY, ImbricateOriginOperationManagerCapability } from "./definition";
|
|
10
|
+
import { IImbricateOriginOperationManager } from "./interface";
|
|
11
|
+
export declare abstract class ImbricateOriginOperationManagerBase implements IImbricateOriginOperationManager {
|
|
12
|
+
static buildCapability(initial?: ImbricateCapability): ImbricateCapabilityBuilder<IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY>;
|
|
13
|
+
static allAllowCapability(): ImbricateOriginOperationManagerCapability;
|
|
14
|
+
static allDenyCapability(): ImbricateOriginOperationManagerCapability;
|
|
15
|
+
abstract readonly capabilities: ImbricateOriginOperationManagerCapability;
|
|
16
|
+
listOperations(_scope?: IMBRICATE_OPERATION_SCOPE): Promise<Array<ImbricateOperation<IMBRICATE_OPERATION_SCOPE>>>;
|
|
17
|
+
executeOperation(_operationIdentifier: string, _parameter: unknown): Promise<void>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace OriginOperationManager
|
|
5
|
+
* @description Base
|
|
6
|
+
*/
|
|
7
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
8
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
9
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
10
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
11
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
12
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
13
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.ImbricateOriginOperationManagerBase = void 0;
|
|
18
|
+
const builder_1 = require("../capability/builder");
|
|
19
|
+
const definition_1 = require("../capability/definition");
|
|
20
|
+
const not_implemented_1 = require("../error/not-implemented");
|
|
21
|
+
const definition_2 = require("./definition");
|
|
22
|
+
class ImbricateOriginOperationManagerBase {
|
|
23
|
+
static buildCapability(initial = (0, definition_1.createDenyImbricateCapability)()) {
|
|
24
|
+
return builder_1.ImbricateCapabilityBuilder.create(definition_2.ImbricateOriginOperationManagerCapabilityList, initial);
|
|
25
|
+
}
|
|
26
|
+
static allAllowCapability() {
|
|
27
|
+
return this.buildCapability((0, definition_1.createAllowImbricateCapability)()).build();
|
|
28
|
+
}
|
|
29
|
+
static allDenyCapability() {
|
|
30
|
+
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
31
|
+
}
|
|
32
|
+
listOperations(_scope) {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
throw not_implemented_1.ImbricateNotImplemented.create("ListOperations", definition_2.IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY.LIST_OPERATIONS);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
executeOperation(_operationIdentifier, _parameter) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
throw not_implemented_1.ImbricateNotImplemented.create("ExecuteOperation", definition_2.IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY.EXECUTE_OPERATION);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.ImbricateOriginOperationManagerBase = ImbricateOriginOperationManagerBase;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace OriginOperationManager
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
import { ImbricateCapability } from "../capability/definition";
|
|
7
|
+
export type ImbricateOriginOperationManagerCapability = Record<IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY, ImbricateCapability>;
|
|
8
|
+
export declare enum IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY {
|
|
9
|
+
LIST_OPERATIONS = "imbricate.origin-operation.list",
|
|
10
|
+
EXECUTE_OPERATION = "imbricate.origin-operation.execute"
|
|
11
|
+
}
|
|
12
|
+
export declare const ImbricateOriginOperationManagerCapabilityList: IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace OriginOperationManager
|
|
5
|
+
* @description Definition
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.ImbricateOriginOperationManagerCapabilityList = exports.IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY = void 0;
|
|
9
|
+
var IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY;
|
|
10
|
+
(function (IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY) {
|
|
11
|
+
IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY["LIST_OPERATIONS"] = "imbricate.origin-operation.list";
|
|
12
|
+
IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY["EXECUTE_OPERATION"] = "imbricate.origin-operation.execute";
|
|
13
|
+
})(IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY || (exports.IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY = IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY = {}));
|
|
14
|
+
exports.ImbricateOriginOperationManagerCapabilityList = [
|
|
15
|
+
IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY.LIST_OPERATIONS,
|
|
16
|
+
IMBRICATE_ORIGIN_OPERATION_MANAGER_CAPABILITY_KEY.EXECUTE_OPERATION,
|
|
17
|
+
];
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace OriginOperationManager
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { PromiseOr } from "../definition/promise";
|
|
7
|
+
import { IMBRICATE_OPERATION_SCOPE, ImbricateOperation, ImbricateOperationParameter } from "../operation/definition";
|
|
8
|
+
import { ImbricateOriginOperationManagerCapability } from "./definition";
|
|
9
|
+
export interface IImbricateOriginOperationManager {
|
|
10
|
+
/**
|
|
11
|
+
* Capabilities of the origin operation manager
|
|
12
|
+
*/
|
|
13
|
+
readonly capabilities: ImbricateOriginOperationManagerCapability;
|
|
14
|
+
/**
|
|
15
|
+
* List all operations
|
|
16
|
+
*
|
|
17
|
+
* @returns all operations
|
|
18
|
+
*/
|
|
19
|
+
listOperations(): PromiseOr<Array<ImbricateOperation<IMBRICATE_OPERATION_SCOPE>>>;
|
|
20
|
+
/**
|
|
21
|
+
* List operations by scope
|
|
22
|
+
*
|
|
23
|
+
* @param scope the scope of the operation
|
|
24
|
+
* @returns all operations
|
|
25
|
+
*/
|
|
26
|
+
listOperations<T extends IMBRICATE_OPERATION_SCOPE>(scope: IMBRICATE_OPERATION_SCOPE): PromiseOr<Array<ImbricateOperation<T>>>;
|
|
27
|
+
/**
|
|
28
|
+
* Execute operation by identifier
|
|
29
|
+
*
|
|
30
|
+
* @param operationIdentifier the identifier of the operation
|
|
31
|
+
* @param parameter the parameter of the operation
|
|
32
|
+
*/
|
|
33
|
+
executeOperation<T extends IMBRICATE_OPERATION_SCOPE>(operationIdentifier: string, parameter: ImbricateOperationParameter<T>): PromiseOr<void>;
|
|
34
|
+
}
|
package/package.json
CHANGED
package/page/base.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace Page
|
|
4
4
|
* @description Base
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
8
|
import { ImbricateCapability } from "../capability/definition";
|
|
8
9
|
import type { PromiseOr } from "../definition/promise";
|
|
@@ -27,7 +28,7 @@ export declare abstract class ImbricatePageBase implements IImbricatePage {
|
|
|
27
28
|
writeContent(_content: string): PromiseOr<void>;
|
|
28
29
|
readAttributes(): PromiseOr<Record<string, string>>;
|
|
29
30
|
writeAttribute(_key: string, _value: string): PromiseOr<void>;
|
|
30
|
-
refreshUpdateMetadata(_updatedAt: Date, _digest: string): PromiseOr<void>;
|
|
31
|
+
refreshUpdateMetadata(_updatedAt: Date, _digest: string, _author: ImbricateAuthor): PromiseOr<void>;
|
|
31
32
|
refreshUpdatedAt(_updatedAt: Date): PromiseOr<void>;
|
|
32
33
|
refreshDigest(_digest: string): PromiseOr<void>;
|
|
33
34
|
addHistoryRecord(_record: ImbricatePageHistoryRecord): PromiseOr<void>;
|
package/page/base.js
CHANGED
|
@@ -32,7 +32,7 @@ class ImbricatePageBase {
|
|
|
32
32
|
writeAttribute(_key, _value) {
|
|
33
33
|
throw not_implemented_1.ImbricateNotImplemented.create("WriteAttribute", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.WRITE_ATTRIBUTE);
|
|
34
34
|
}
|
|
35
|
-
refreshUpdateMetadata(_updatedAt, _digest) {
|
|
35
|
+
refreshUpdateMetadata(_updatedAt, _digest, _author) {
|
|
36
36
|
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdateMetadata", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_METADATA);
|
|
37
37
|
}
|
|
38
38
|
refreshUpdatedAt(_updatedAt) {
|
package/page/interface.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace Page
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { PromiseOr } from "../definition/promise";
|
|
7
8
|
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
8
9
|
import { ImbricatePageAttributes, ImbricatePageCapability, ImbricatePageHistoryRecord } from "./definition";
|
|
@@ -27,8 +28,9 @@ export interface IImbricatePage {
|
|
|
27
28
|
*
|
|
28
29
|
* @param updatedAt Updated At
|
|
29
30
|
* @param digest Content Digest
|
|
31
|
+
* @param author Author
|
|
30
32
|
*/
|
|
31
|
-
refreshUpdateMetadata(updatedAt: Date, digest: string): PromiseOr<void>;
|
|
33
|
+
refreshUpdateMetadata(updatedAt: Date, digest: string, author: ImbricateAuthor): PromiseOr<void>;
|
|
32
34
|
/**
|
|
33
35
|
* Refresh Updated At
|
|
34
36
|
* Prefer `refreshUpdateMetadata` in most cases
|
package/script/base.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace Script
|
|
4
4
|
* @description Base
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
8
|
import { ImbricateCapability } from "../capability/definition";
|
|
8
9
|
import type { PromiseOr } from "../definition/promise";
|
|
@@ -26,7 +27,7 @@ export declare abstract class ImbricateScriptBase implements IImbricateScript {
|
|
|
26
27
|
writeScript(_script: string): PromiseOr<void>;
|
|
27
28
|
readAttributes(): PromiseOr<ImbricateScriptAttributes>;
|
|
28
29
|
writeAttribute(_key: string, _value: string): PromiseOr<void>;
|
|
29
|
-
refreshUpdateMetadata(_updatedAt: Date, _digest: string): PromiseOr<void>;
|
|
30
|
+
refreshUpdateMetadata(_updatedAt: Date, _digest: string, _author: ImbricateAuthor): PromiseOr<void>;
|
|
30
31
|
refreshUpdatedAt(_updatedAt: Date): PromiseOr<void>;
|
|
31
32
|
refreshDigest(_digest: string): PromiseOr<void>;
|
|
32
33
|
addHistoryRecord(_record: ImbricateScriptHistoryRecord): PromiseOr<void>;
|
package/script/base.js
CHANGED
|
@@ -32,7 +32,7 @@ class ImbricateScriptBase {
|
|
|
32
32
|
writeAttribute(_key, _value) {
|
|
33
33
|
throw not_implemented_1.ImbricateNotImplemented.create("WriteAttribute", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.WRITE_ATTRIBUTE);
|
|
34
34
|
}
|
|
35
|
-
refreshUpdateMetadata(_updatedAt, _digest) {
|
|
35
|
+
refreshUpdateMetadata(_updatedAt, _digest, _author) {
|
|
36
36
|
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdateMetadata", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_METADATA);
|
|
37
37
|
}
|
|
38
38
|
refreshUpdatedAt(_updatedAt) {
|
package/script/interface.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace Script
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { PromiseOr } from "../definition/promise";
|
|
7
8
|
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
8
9
|
import { ImbricateScriptAttributes, ImbricateScriptCapability, ImbricateScriptHistoryRecord } from "./definition";
|
|
@@ -26,8 +27,9 @@ export interface IImbricateScript {
|
|
|
26
27
|
*
|
|
27
28
|
* @param updatedAt Updated At
|
|
28
29
|
* @param digest Content Digest
|
|
30
|
+
* @param author Author
|
|
29
31
|
*/
|
|
30
|
-
refreshUpdateMetadata(updatedAt: Date, digest: string): PromiseOr<void>;
|
|
32
|
+
refreshUpdateMetadata(updatedAt: Date, digest: string, author: ImbricateAuthor): PromiseOr<void>;
|
|
31
33
|
/**
|
|
32
34
|
* Refresh Updated At
|
|
33
35
|
* Prefer `refreshUpdateMetadata` in most cases
|
package/script-manager/base.d.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace ScriptManager
|
|
4
4
|
* @description Base
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
7
8
|
import { ImbricateCapability } from "../capability/definition";
|
|
8
9
|
import type { PromiseOr } from "../definition/promise";
|
|
@@ -17,7 +18,7 @@ export declare abstract class ImbricateScriptManagerBase implements IImbricateSc
|
|
|
17
18
|
static allAllowCapability(): ImbricateScriptManagerCapability;
|
|
18
19
|
static allDenyCapability(): ImbricateScriptManagerCapability;
|
|
19
20
|
abstract readonly capabilities: ImbricateScriptManagerCapability;
|
|
20
|
-
createScript(_scriptName: string, _variant: ImbricateScriptVariant, _initialScript: string, _description?: string): PromiseOr<IImbricateScript>;
|
|
21
|
+
createScript(_scriptName: string, _variant: ImbricateScriptVariant, _author: ImbricateAuthor, _initialScript: string, _description?: string): PromiseOr<IImbricateScript>;
|
|
21
22
|
putScript(_scriptMetadata: ImbricateScriptMetadata, _script: string): PromiseOr<IImbricateScript>;
|
|
22
23
|
renameScript(_identifier: string, _newScriptName: string): PromiseOr<void>;
|
|
23
24
|
deleteScript(_identifier: string): PromiseOr<void>;
|
package/script-manager/base.js
CHANGED
|
@@ -20,7 +20,7 @@ class ImbricateScriptManagerBase {
|
|
|
20
20
|
static allDenyCapability() {
|
|
21
21
|
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
22
22
|
}
|
|
23
|
-
createScript(_scriptName, _variant, _initialScript, _description) {
|
|
23
|
+
createScript(_scriptName, _variant, _author, _initialScript, _description) {
|
|
24
24
|
throw not_implemented_1.ImbricateNotImplemented.create("CreateScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.CREATE_SCRIPT);
|
|
25
25
|
}
|
|
26
26
|
putScript(_scriptMetadata, _script) {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @namespace ScriptManager
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
6
7
|
import { PromiseOr } from "../definition/promise";
|
|
7
8
|
import { ImbricateScriptQuery, ImbricateScriptQueryConfig, ImbricateSearchScriptConfig } from "../query/script";
|
|
8
9
|
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
@@ -18,12 +19,14 @@ export interface IImbricateScriptManager {
|
|
|
18
19
|
* Create a script
|
|
19
20
|
*
|
|
20
21
|
* @param scriptName Script name
|
|
22
|
+
* @param variant Script variant
|
|
23
|
+
* @param author Author
|
|
21
24
|
* @param initialScript Initial script content
|
|
22
25
|
* @param description Script description
|
|
23
26
|
*
|
|
24
27
|
* @returns Created script
|
|
25
28
|
*/
|
|
26
|
-
createScript(scriptName: string, variant: ImbricateScriptVariant, initialScript: string, description?: string): PromiseOr<IImbricateScript>;
|
|
29
|
+
createScript(scriptName: string, variant: ImbricateScriptVariant, author: ImbricateAuthor, initialScript: string, description?: string): PromiseOr<IImbricateScript>;
|
|
27
30
|
/**
|
|
28
31
|
* Put a script
|
|
29
32
|
*
|