@imbricate/core 2.6.2 → 3.0.1
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/author/definition.d.ts +1 -4
- package/database/definition.d.ts +15 -0
- package/{definition/promise.js → database/definition.js} +2 -2
- package/database/interface.d.ts +41 -0
- package/{function → database}/interface.js +1 -1
- package/database/manager.d.ts +34 -0
- package/database/manager.js +7 -0
- package/database/schema.d.ts +37 -0
- package/database/schema.js +56 -0
- package/document/definition.d.ts +18 -0
- package/{definition/listable.js → document/definition.js} +2 -2
- package/document/interface.d.ts +50 -0
- package/{trash → document}/interface.js +1 -1
- package/document/property.d.ts +18 -0
- package/document/property.js +17 -0
- package/document/validate.d.ts +17 -0
- package/document/validate.js +55 -0
- package/index.d.ts +15 -53
- package/index.js +15 -53
- package/loader/definition.d.ts +8 -0
- package/{query → loader}/definition.js +1 -1
- package/loader/origin-loader.d.ts +9 -0
- package/loader/origin-loader.js +74 -0
- package/loader/persistance.d.ts +19 -0
- package/loader/persistance.js +13 -0
- package/origin/definition.d.ts +1 -19
- package/origin/definition.js +0 -24
- package/origin/interface.d.ts +18 -43
- package/package.json +1 -1
- package/static/interface.d.ts +17 -0
- package/{script → static}/interface.js +1 -1
- package/static/manager.d.ts +26 -0
- package/{query/script.js → static/manager.js} +2 -2
- package/text/interface.d.ts +17 -0
- package/{page → text}/interface.js +1 -1
- package/text/manager.d.ts +26 -0
- package/{query/page.js → text/manager.js} +2 -2
- package/binary-storage/base.d.ts +0 -18
- package/binary-storage/base.js +0 -30
- package/binary-storage/definition.d.ts +0 -11
- package/binary-storage/definition.js +0 -15
- package/binary-storage/interface.d.ts +0 -26
- package/binary-storage/interface.js +0 -7
- package/capability/builder.d.ts +0 -15
- package/capability/builder.js +0 -37
- package/capability/create.d.ts +0 -7
- package/capability/create.js +0 -16
- package/capability/definition.d.ts +0 -16
- package/capability/definition.js +0 -25
- package/capability/validate.d.ts +0 -19
- package/capability/validate.js +0 -36
- package/collection/base.d.ts +0 -36
- package/collection/base.js +0 -60
- package/collection/definition.d.ts +0 -18
- package/collection/definition.js +0 -29
- package/collection/interface.d.ts +0 -43
- package/collection/interface.js +0 -7
- package/collection/least-common-identifier.d.ts +0 -10
- package/collection/least-common-identifier.js +0 -54
- package/collection-manager/base.d.ts +0 -26
- package/collection-manager/base.js +0 -59
- package/collection-manager/definition.d.ts +0 -15
- package/collection-manager/definition.js +0 -23
- package/collection-manager/interface.d.ts +0 -38
- package/collection-manager/interface.js +0 -7
- package/collection-operation-manager/base.d.ts +0 -18
- package/collection-operation-manager/base.js +0 -43
- package/collection-operation-manager/definition.d.ts +0 -12
- package/collection-operation-manager/definition.js +0 -17
- package/collection-operation-manager/interface.d.ts +0 -34
- package/collection-operation-manager/interface.js +0 -7
- package/definition/listable.d.ts +0 -6
- package/definition/promise.d.ts +0 -6
- package/error/imbricate-error.d.ts +0 -15
- package/error/imbricate-error.js +0 -30
- package/error/not-implemented.d.ts +0 -10
- package/error/not-implemented.js +0 -19
- package/executable-manager/base.d.ts +0 -21
- package/executable-manager/base.js +0 -44
- package/executable-manager/definition.d.ts +0 -12
- package/executable-manager/definition.js +0 -17
- package/executable-manager/interface.d.ts +0 -44
- package/executable-manager/interface.js +0 -7
- package/execute/definition.d.ts +0 -17
- package/execute/definition.js +0 -16
- package/function/base.d.ts +0 -19
- package/function/base.js +0 -30
- package/function/definition.d.ts +0 -18
- package/function/definition.js +0 -15
- package/function/interface.d.ts +0 -26
- package/operation/definition.d.ts +0 -28
- package/operation/definition.js +0 -14
- package/origin/base.d.ts +0 -29
- package/origin/base.js +0 -39
- package/origin-operation-manager/base.d.ts +0 -18
- package/origin-operation-manager/base.js +0 -43
- package/origin-operation-manager/definition.d.ts +0 -12
- package/origin-operation-manager/definition.js +0 -17
- package/origin-operation-manager/interface.d.ts +0 -34
- package/origin-operation-manager/interface.js +0 -7
- package/page/base.d.ts +0 -35
- package/page/base.js +0 -48
- package/page/definition.d.ts +0 -41
- package/page/definition.js +0 -25
- package/page/interface.d.ts +0 -55
- package/page-variant/definition.d.ts +0 -16
- package/page-variant/definition.js +0 -33
- package/page-variant/extension.d.ts +0 -7
- package/page-variant/extension.js +0 -24
- package/query/definition.d.ts +0 -14
- package/query/page.d.ts +0 -21
- package/query/script.d.ts +0 -21
- package/script/base.d.ts +0 -34
- package/script/base.js +0 -48
- package/script/definition.d.ts +0 -41
- package/script/definition.js +0 -27
- package/script/interface.d.ts +0 -54
- package/script-manager/base.d.ts +0 -31
- package/script-manager/base.js +0 -54
- package/script-manager/definition.d.ts +0 -18
- package/script-manager/definition.js +0 -29
- package/script-manager/interface.d.ts +0 -47
- package/script-manager/interface.js +0 -7
- package/script-variant/definition.d.ts +0 -22
- package/script-variant/definition.js +0 -39
- package/script-variant/extension.d.ts +0 -7
- package/script-variant/extension.js +0 -23
- package/search/prefix.d.ts +0 -7
- package/search/prefix.js +0 -37
- package/search/snippet.d.ts +0 -38
- package/search/snippet.js +0 -23
- package/trash/base.d.ts +0 -20
- package/trash/base.js +0 -36
- package/trash/definition.d.ts +0 -25
- package/trash/definition.js +0 -21
- package/trash/interface.d.ts +0 -17
package/page/base.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Page
|
|
4
|
-
* @description Base
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
8
|
-
import { ImbricateCapability } from "../capability/definition";
|
|
9
|
-
import type { PromiseOr } from "../definition/promise";
|
|
10
|
-
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
11
|
-
import { IMBRICATE_PAGE_CAPABILITY_KEY, ImbricatePageCapability, ImbricatePageHistoryRecord } from "./definition";
|
|
12
|
-
import type { IImbricatePage } from "./interface";
|
|
13
|
-
export declare abstract class ImbricatePageBase implements IImbricatePage {
|
|
14
|
-
static buildCapability(initial?: ImbricateCapability): ImbricateCapabilityBuilder<IMBRICATE_PAGE_CAPABILITY_KEY>;
|
|
15
|
-
static allAllowCapability(): ImbricatePageCapability;
|
|
16
|
-
static allDenyCapability(): ImbricatePageCapability;
|
|
17
|
-
abstract readonly title: string;
|
|
18
|
-
abstract readonly directories: string[];
|
|
19
|
-
abstract readonly identifier: string;
|
|
20
|
-
abstract readonly variant: ImbricatePageVariant;
|
|
21
|
-
abstract readonly digest: string;
|
|
22
|
-
abstract readonly historyRecords: ImbricatePageHistoryRecord[];
|
|
23
|
-
abstract readonly description?: string;
|
|
24
|
-
abstract readonly createdAt: Date;
|
|
25
|
-
abstract readonly updatedAt: Date;
|
|
26
|
-
abstract readonly capabilities: ImbricatePageCapability;
|
|
27
|
-
readContent(): PromiseOr<string>;
|
|
28
|
-
writeContent(_content: string): PromiseOr<void>;
|
|
29
|
-
readAttributes(): PromiseOr<Record<string, string>>;
|
|
30
|
-
writeAttribute(_key: string, _value: string): PromiseOr<void>;
|
|
31
|
-
refreshUpdateMetadata(_updatedAt: Date, _digest: string, _author: ImbricateAuthor): PromiseOr<void>;
|
|
32
|
-
refreshUpdatedAt(_updatedAt: Date): PromiseOr<void>;
|
|
33
|
-
refreshDigest(_digest: string): PromiseOr<void>;
|
|
34
|
-
addHistoryRecord(_record: ImbricatePageHistoryRecord): PromiseOr<void>;
|
|
35
|
-
}
|
package/page/base.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace Page
|
|
5
|
-
* @description Base
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricatePageBase = void 0;
|
|
9
|
-
const builder_1 = require("../capability/builder");
|
|
10
|
-
const definition_1 = require("../capability/definition");
|
|
11
|
-
const not_implemented_1 = require("../error/not-implemented");
|
|
12
|
-
const definition_2 = require("./definition");
|
|
13
|
-
class ImbricatePageBase {
|
|
14
|
-
static buildCapability(initial = (0, definition_1.createDenyImbricateCapability)()) {
|
|
15
|
-
return builder_1.ImbricateCapabilityBuilder.create(definition_2.ImbricatePageCapabilityList, initial);
|
|
16
|
-
}
|
|
17
|
-
static allAllowCapability() {
|
|
18
|
-
return this.buildCapability((0, definition_1.createAllowImbricateCapability)()).build();
|
|
19
|
-
}
|
|
20
|
-
static allDenyCapability() {
|
|
21
|
-
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
22
|
-
}
|
|
23
|
-
readContent() {
|
|
24
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ReadContent", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.READ);
|
|
25
|
-
}
|
|
26
|
-
writeContent(_content) {
|
|
27
|
-
throw not_implemented_1.ImbricateNotImplemented.create("WriteContent", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.WRITE);
|
|
28
|
-
}
|
|
29
|
-
readAttributes() {
|
|
30
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ReadAttributes", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.READ_ATTRIBUTE);
|
|
31
|
-
}
|
|
32
|
-
writeAttribute(_key, _value) {
|
|
33
|
-
throw not_implemented_1.ImbricateNotImplemented.create("WriteAttribute", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.WRITE_ATTRIBUTE);
|
|
34
|
-
}
|
|
35
|
-
refreshUpdateMetadata(_updatedAt, _digest, _author) {
|
|
36
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdateMetadata", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_METADATA);
|
|
37
|
-
}
|
|
38
|
-
refreshUpdatedAt(_updatedAt) {
|
|
39
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdatedAt", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_METADATA);
|
|
40
|
-
}
|
|
41
|
-
refreshDigest(_digest) {
|
|
42
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshDigest", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_METADATA);
|
|
43
|
-
}
|
|
44
|
-
addHistoryRecord(_record) {
|
|
45
|
-
throw not_implemented_1.ImbricateNotImplemented.create("AddHistoryRecord", definition_2.IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_HISTORY_RECORD);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ImbricatePageBase = ImbricatePageBase;
|
package/page/definition.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Page
|
|
4
|
-
* @description Definition
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { ImbricateCapability } from "../capability/definition";
|
|
8
|
-
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
9
|
-
import { IMBRICATE_SEARCH_RESULT_TYPE, ImbricateSearchResult, ImbricateSearchSnippet } from "../search/snippet";
|
|
10
|
-
export type ImbricatePageAttributes = Record<string, string>;
|
|
11
|
-
export type ImbricatePageSearchResult = ImbricateSearchResult<IMBRICATE_SEARCH_RESULT_TYPE.PAGE>;
|
|
12
|
-
export type ImbricatePageSearchSnippet = ImbricateSearchSnippet<IMBRICATE_SEARCH_RESULT_TYPE.PAGE>;
|
|
13
|
-
export type ImbricatePageSnapshot = {
|
|
14
|
-
readonly title: string;
|
|
15
|
-
readonly directories: string[];
|
|
16
|
-
readonly identifier: string;
|
|
17
|
-
readonly variant: ImbricatePageVariant;
|
|
18
|
-
};
|
|
19
|
-
export type ImbricatePageHistoryRecord = {
|
|
20
|
-
readonly author: ImbricateAuthor;
|
|
21
|
-
readonly digest: string;
|
|
22
|
-
readonly updatedAt: Date;
|
|
23
|
-
};
|
|
24
|
-
export type ImbricatePageMetadata = {
|
|
25
|
-
readonly createdAt: Date;
|
|
26
|
-
readonly digest: string;
|
|
27
|
-
readonly updatedAt: Date;
|
|
28
|
-
readonly attributes: ImbricatePageAttributes;
|
|
29
|
-
readonly historyRecords: ImbricatePageHistoryRecord[];
|
|
30
|
-
readonly description?: string;
|
|
31
|
-
} & ImbricatePageSnapshot;
|
|
32
|
-
export type ImbricatePageCapability = Record<IMBRICATE_PAGE_CAPABILITY_KEY, ImbricateCapability>;
|
|
33
|
-
export declare enum IMBRICATE_PAGE_CAPABILITY_KEY {
|
|
34
|
-
READ = "imbricate.page.read",
|
|
35
|
-
WRITE = "imbricate.page.write",
|
|
36
|
-
READ_ATTRIBUTE = "imbricate.page.attribute.read",
|
|
37
|
-
WRITE_ATTRIBUTE = "imbricate.page.attribute.write",
|
|
38
|
-
UPDATE_METADATA = "imbricate.page.metadata.update",
|
|
39
|
-
UPDATE_HISTORY_RECORD = "imbricate.page.history.update"
|
|
40
|
-
}
|
|
41
|
-
export declare const ImbricatePageCapabilityList: IMBRICATE_PAGE_CAPABILITY_KEY[];
|
package/page/definition.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace Page
|
|
5
|
-
* @description Definition
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricatePageCapabilityList = exports.IMBRICATE_PAGE_CAPABILITY_KEY = void 0;
|
|
9
|
-
var IMBRICATE_PAGE_CAPABILITY_KEY;
|
|
10
|
-
(function (IMBRICATE_PAGE_CAPABILITY_KEY) {
|
|
11
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["READ"] = "imbricate.page.read";
|
|
12
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["WRITE"] = "imbricate.page.write";
|
|
13
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["READ_ATTRIBUTE"] = "imbricate.page.attribute.read";
|
|
14
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["WRITE_ATTRIBUTE"] = "imbricate.page.attribute.write";
|
|
15
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["UPDATE_METADATA"] = "imbricate.page.metadata.update";
|
|
16
|
-
IMBRICATE_PAGE_CAPABILITY_KEY["UPDATE_HISTORY_RECORD"] = "imbricate.page.history.update";
|
|
17
|
-
})(IMBRICATE_PAGE_CAPABILITY_KEY || (exports.IMBRICATE_PAGE_CAPABILITY_KEY = IMBRICATE_PAGE_CAPABILITY_KEY = {}));
|
|
18
|
-
exports.ImbricatePageCapabilityList = [
|
|
19
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.READ,
|
|
20
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.WRITE,
|
|
21
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.READ_ATTRIBUTE,
|
|
22
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.WRITE_ATTRIBUTE,
|
|
23
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_METADATA,
|
|
24
|
-
IMBRICATE_PAGE_CAPABILITY_KEY.UPDATE_HISTORY_RECORD,
|
|
25
|
-
];
|
package/page/interface.d.ts
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Page
|
|
4
|
-
* @description Interface
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { PromiseOr } from "../definition/promise";
|
|
8
|
-
import { ImbricatePageVariant } from "../page-variant/definition";
|
|
9
|
-
import { ImbricatePageAttributes, ImbricatePageCapability, ImbricatePageHistoryRecord } from "./definition";
|
|
10
|
-
export interface IImbricatePage {
|
|
11
|
-
readonly title: string;
|
|
12
|
-
readonly directories: string[];
|
|
13
|
-
readonly identifier: string;
|
|
14
|
-
readonly variant: ImbricatePageVariant;
|
|
15
|
-
readonly digest: string;
|
|
16
|
-
readonly historyRecords: ImbricatePageHistoryRecord[];
|
|
17
|
-
readonly description?: string;
|
|
18
|
-
readonly createdAt: Date;
|
|
19
|
-
readonly updatedAt: Date;
|
|
20
|
-
readonly capabilities: ImbricatePageCapability;
|
|
21
|
-
readContent(): PromiseOr<string>;
|
|
22
|
-
writeContent(content: string): PromiseOr<void>;
|
|
23
|
-
readAttributes(): PromiseOr<ImbricatePageAttributes>;
|
|
24
|
-
writeAttribute(key: string, value: string): PromiseOr<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Refresh Updated At and Digest, and add a history record
|
|
27
|
-
* Recommended to use this method when updating the page
|
|
28
|
-
*
|
|
29
|
-
* @param updatedAt Updated At
|
|
30
|
-
* @param digest Content Digest
|
|
31
|
-
* @param author Author
|
|
32
|
-
*/
|
|
33
|
-
refreshUpdateMetadata(updatedAt: Date, digest: string, author: ImbricateAuthor): PromiseOr<void>;
|
|
34
|
-
/**
|
|
35
|
-
* Refresh Updated At
|
|
36
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
37
|
-
*
|
|
38
|
-
* @param updatedAt Updated At
|
|
39
|
-
*/
|
|
40
|
-
refreshUpdatedAt(updatedAt: Date): PromiseOr<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Refresh Digest
|
|
43
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
44
|
-
*
|
|
45
|
-
* @param digest Content Digest
|
|
46
|
-
*/
|
|
47
|
-
refreshDigest(digest: string): PromiseOr<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Add a history record
|
|
50
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
51
|
-
*
|
|
52
|
-
* @param record History Record
|
|
53
|
-
*/
|
|
54
|
-
addHistoryRecord(record: ImbricatePageHistoryRecord): PromiseOr<void>;
|
|
55
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace PageVariant
|
|
4
|
-
* @description Definition
|
|
5
|
-
*/
|
|
6
|
-
export declare enum IMBRICATE_PAGE_VARIANT_LANGUAGE {
|
|
7
|
-
TEXT = "text",
|
|
8
|
-
MARKDOWN = "markdown",
|
|
9
|
-
LATEX = "latex"
|
|
10
|
-
}
|
|
11
|
-
export declare const IMBRICATE_PAGE_VARIANT_LANGUAGE_LIST: IMBRICATE_PAGE_VARIANT_LANGUAGE[];
|
|
12
|
-
export declare const isValidImbricatePageVariantLanguage: (language: unknown) => language is IMBRICATE_PAGE_VARIANT_LANGUAGE;
|
|
13
|
-
export type ImbricatePageVariant = {
|
|
14
|
-
readonly language: IMBRICATE_PAGE_VARIANT_LANGUAGE;
|
|
15
|
-
};
|
|
16
|
-
export declare const isImbricatePageVariant: (variant: unknown) => variant is ImbricatePageVariant;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace PageVariant
|
|
5
|
-
* @description Definition
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.isImbricatePageVariant = exports.isValidImbricatePageVariantLanguage = exports.IMBRICATE_PAGE_VARIANT_LANGUAGE_LIST = exports.IMBRICATE_PAGE_VARIANT_LANGUAGE = void 0;
|
|
9
|
-
var IMBRICATE_PAGE_VARIANT_LANGUAGE;
|
|
10
|
-
(function (IMBRICATE_PAGE_VARIANT_LANGUAGE) {
|
|
11
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE["TEXT"] = "text";
|
|
12
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE["MARKDOWN"] = "markdown";
|
|
13
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE["LATEX"] = "latex";
|
|
14
|
-
})(IMBRICATE_PAGE_VARIANT_LANGUAGE || (exports.IMBRICATE_PAGE_VARIANT_LANGUAGE = IMBRICATE_PAGE_VARIANT_LANGUAGE = {}));
|
|
15
|
-
exports.IMBRICATE_PAGE_VARIANT_LANGUAGE_LIST = [
|
|
16
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE.TEXT,
|
|
17
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE.MARKDOWN,
|
|
18
|
-
IMBRICATE_PAGE_VARIANT_LANGUAGE.LATEX,
|
|
19
|
-
];
|
|
20
|
-
const isValidImbricatePageVariantLanguage = (language) => {
|
|
21
|
-
return exports.IMBRICATE_PAGE_VARIANT_LANGUAGE_LIST.includes(language);
|
|
22
|
-
};
|
|
23
|
-
exports.isValidImbricatePageVariantLanguage = isValidImbricatePageVariantLanguage;
|
|
24
|
-
const isImbricatePageVariant = (variant) => {
|
|
25
|
-
if (typeof variant !== "object") {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
if (!(0, exports.isValidImbricatePageVariantLanguage)(variant.language)) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
return true;
|
|
32
|
-
};
|
|
33
|
-
exports.isImbricatePageVariant = isImbricatePageVariant;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace PageVariant
|
|
4
|
-
* @description Extension
|
|
5
|
-
*/
|
|
6
|
-
import { IMBRICATE_PAGE_VARIANT_LANGUAGE } from "./definition";
|
|
7
|
-
export declare const getImbricatePageVariantLanguageExtension: (language: IMBRICATE_PAGE_VARIANT_LANGUAGE, withDot?: boolean) => string;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace PageVariant
|
|
5
|
-
* @description Extension
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.getImbricatePageVariantLanguageExtension = void 0;
|
|
9
|
-
const definition_1 = require("./definition");
|
|
10
|
-
const fixExtension = (extension, withDot) => {
|
|
11
|
-
if (withDot) {
|
|
12
|
-
return `.${extension}`;
|
|
13
|
-
}
|
|
14
|
-
return extension;
|
|
15
|
-
};
|
|
16
|
-
const getImbricatePageVariantLanguageExtension = (language, withDot = true) => {
|
|
17
|
-
switch (language) {
|
|
18
|
-
case definition_1.IMBRICATE_PAGE_VARIANT_LANGUAGE.TEXT: return fixExtension("txt", withDot);
|
|
19
|
-
case definition_1.IMBRICATE_PAGE_VARIANT_LANGUAGE.MARKDOWN: return fixExtension("md", withDot);
|
|
20
|
-
case definition_1.IMBRICATE_PAGE_VARIANT_LANGUAGE.LATEX: return fixExtension("tex", withDot);
|
|
21
|
-
}
|
|
22
|
-
return fixExtension("unknown", withDot);
|
|
23
|
-
};
|
|
24
|
-
exports.getImbricatePageVariantLanguageExtension = getImbricatePageVariantLanguageExtension;
|
package/query/definition.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Query
|
|
4
|
-
* @description Definition
|
|
5
|
-
*/
|
|
6
|
-
export type ImbricateQueryTime = {
|
|
7
|
-
readonly before?: Date;
|
|
8
|
-
readonly after?: Date;
|
|
9
|
-
};
|
|
10
|
-
export type ImbricateQueryString = {
|
|
11
|
-
readonly equal?: string;
|
|
12
|
-
readonly include?: string[];
|
|
13
|
-
readonly exclude?: string[];
|
|
14
|
-
};
|
package/query/page.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Query
|
|
4
|
-
* @description Page
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateQueryString, ImbricateQueryTime } from "./definition";
|
|
7
|
-
export type ImbricatePageQuery = {
|
|
8
|
-
readonly title?: ImbricateQueryString;
|
|
9
|
-
readonly attributes?: Record<string, ImbricateQueryString>;
|
|
10
|
-
readonly createdAt?: ImbricateQueryTime;
|
|
11
|
-
readonly updatedAt?: ImbricateQueryTime;
|
|
12
|
-
};
|
|
13
|
-
export type ImbricateSearchPageConfig = {
|
|
14
|
-
readonly exact?: boolean;
|
|
15
|
-
readonly itemLimit?: number;
|
|
16
|
-
readonly snippetLimit?: number;
|
|
17
|
-
};
|
|
18
|
-
export type ImbricatePageQueryConfig = {
|
|
19
|
-
readonly limit?: number;
|
|
20
|
-
readonly skip?: number;
|
|
21
|
-
};
|
package/query/script.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Query
|
|
4
|
-
* @description Script
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateQueryString, ImbricateQueryTime } from "./definition";
|
|
7
|
-
export type ImbricateScriptQuery = {
|
|
8
|
-
readonly scriptName?: ImbricateQueryString;
|
|
9
|
-
readonly attributes?: Record<string, ImbricateQueryString>;
|
|
10
|
-
readonly createdAt?: ImbricateQueryTime;
|
|
11
|
-
readonly updatedAt?: ImbricateQueryTime;
|
|
12
|
-
};
|
|
13
|
-
export type ImbricateSearchScriptConfig = {
|
|
14
|
-
readonly exact?: boolean;
|
|
15
|
-
readonly itemLimit?: number;
|
|
16
|
-
readonly snippetLimit?: number;
|
|
17
|
-
};
|
|
18
|
-
export type ImbricateScriptQueryConfig = {
|
|
19
|
-
readonly limit?: number;
|
|
20
|
-
readonly skip?: number;
|
|
21
|
-
};
|
package/script/base.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Script
|
|
4
|
-
* @description Base
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
8
|
-
import { ImbricateCapability } from "../capability/definition";
|
|
9
|
-
import type { PromiseOr } from "../definition/promise";
|
|
10
|
-
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
11
|
-
import { IMBRICATE_SCRIPT_CAPABILITY_KEY, ImbricateScriptAttributes, ImbricateScriptCapability, ImbricateScriptHistoryRecord } from "./definition";
|
|
12
|
-
import type { IImbricateScript } from "./interface";
|
|
13
|
-
export declare abstract class ImbricateScriptBase implements IImbricateScript {
|
|
14
|
-
static buildCapability(initial?: ImbricateCapability): ImbricateCapabilityBuilder<IMBRICATE_SCRIPT_CAPABILITY_KEY>;
|
|
15
|
-
static allAllowCapability(): ImbricateScriptCapability;
|
|
16
|
-
static allDenyCapability(): ImbricateScriptCapability;
|
|
17
|
-
abstract readonly scriptName: string;
|
|
18
|
-
abstract readonly identifier: string;
|
|
19
|
-
abstract readonly variant: ImbricateScriptVariant;
|
|
20
|
-
abstract readonly digest: string;
|
|
21
|
-
abstract readonly historyRecords: ImbricateScriptHistoryRecord[];
|
|
22
|
-
abstract readonly description?: string;
|
|
23
|
-
abstract readonly createdAt: Date;
|
|
24
|
-
abstract readonly updatedAt: Date;
|
|
25
|
-
abstract readonly capabilities: ImbricateScriptCapability;
|
|
26
|
-
readScript(): PromiseOr<string>;
|
|
27
|
-
writeScript(_script: string): PromiseOr<void>;
|
|
28
|
-
readAttributes(): PromiseOr<ImbricateScriptAttributes>;
|
|
29
|
-
writeAttribute(_key: string, _value: string): PromiseOr<void>;
|
|
30
|
-
refreshUpdateMetadata(_updatedAt: Date, _digest: string, _author: ImbricateAuthor): PromiseOr<void>;
|
|
31
|
-
refreshUpdatedAt(_updatedAt: Date): PromiseOr<void>;
|
|
32
|
-
refreshDigest(_digest: string): PromiseOr<void>;
|
|
33
|
-
addHistoryRecord(_record: ImbricateScriptHistoryRecord): PromiseOr<void>;
|
|
34
|
-
}
|
package/script/base.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace Script
|
|
5
|
-
* @description Base
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricateScriptBase = void 0;
|
|
9
|
-
const builder_1 = require("../capability/builder");
|
|
10
|
-
const definition_1 = require("../capability/definition");
|
|
11
|
-
const not_implemented_1 = require("../error/not-implemented");
|
|
12
|
-
const definition_2 = require("./definition");
|
|
13
|
-
class ImbricateScriptBase {
|
|
14
|
-
static buildCapability(initial = (0, definition_1.createDenyImbricateCapability)()) {
|
|
15
|
-
return builder_1.ImbricateCapabilityBuilder.create(definition_2.ImbricateScriptCapabilityList, initial);
|
|
16
|
-
}
|
|
17
|
-
static allAllowCapability() {
|
|
18
|
-
return this.buildCapability((0, definition_1.createAllowImbricateCapability)()).build();
|
|
19
|
-
}
|
|
20
|
-
static allDenyCapability() {
|
|
21
|
-
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
22
|
-
}
|
|
23
|
-
readScript() {
|
|
24
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ReadScript", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.READ);
|
|
25
|
-
}
|
|
26
|
-
writeScript(_script) {
|
|
27
|
-
throw not_implemented_1.ImbricateNotImplemented.create("WriteScript", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.WRITE);
|
|
28
|
-
}
|
|
29
|
-
readAttributes() {
|
|
30
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ReadAttributes", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.READ_ATTRIBUTE);
|
|
31
|
-
}
|
|
32
|
-
writeAttribute(_key, _value) {
|
|
33
|
-
throw not_implemented_1.ImbricateNotImplemented.create("WriteAttribute", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.WRITE_ATTRIBUTE);
|
|
34
|
-
}
|
|
35
|
-
refreshUpdateMetadata(_updatedAt, _digest, _author) {
|
|
36
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdateMetadata", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_METADATA);
|
|
37
|
-
}
|
|
38
|
-
refreshUpdatedAt(_updatedAt) {
|
|
39
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshUpdatedAt", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_METADATA);
|
|
40
|
-
}
|
|
41
|
-
refreshDigest(_digest) {
|
|
42
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RefreshDigest", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_METADATA);
|
|
43
|
-
}
|
|
44
|
-
addHistoryRecord(_record) {
|
|
45
|
-
throw not_implemented_1.ImbricateNotImplemented.create("AddHistoryRecord", definition_2.IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_HISTORY_RECORD);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
exports.ImbricateScriptBase = ImbricateScriptBase;
|
package/script/definition.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Script
|
|
4
|
-
* @description Definition
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { ImbricateCapability } from "../capability/definition";
|
|
8
|
-
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
9
|
-
import { IMBRICATE_SEARCH_RESULT_TYPE, ImbricateSearchResult, ImbricateSearchSnippet } from "../search/snippet";
|
|
10
|
-
export type ImbricateScriptAttributes = Record<string, string>;
|
|
11
|
-
export type ImbricateScriptSearchResult = ImbricateSearchResult<IMBRICATE_SEARCH_RESULT_TYPE.SCRIPT>;
|
|
12
|
-
export type ImbricateScriptSearchSnippet = ImbricateSearchSnippet<IMBRICATE_SEARCH_RESULT_TYPE.SCRIPT>;
|
|
13
|
-
export type ImbricateScriptSnapshot = {
|
|
14
|
-
readonly scriptName: string;
|
|
15
|
-
readonly identifier: string;
|
|
16
|
-
readonly variant: ImbricateScriptVariant;
|
|
17
|
-
};
|
|
18
|
-
export type ImbricateScriptHistoryRecord = {
|
|
19
|
-
readonly author: ImbricateAuthor;
|
|
20
|
-
readonly digest: string;
|
|
21
|
-
readonly updatedAt: Date;
|
|
22
|
-
};
|
|
23
|
-
export type ImbricateScriptMetadata = {
|
|
24
|
-
readonly createdAt: Date;
|
|
25
|
-
readonly digest: string;
|
|
26
|
-
readonly updatedAt: Date;
|
|
27
|
-
readonly attributes: ImbricateScriptAttributes;
|
|
28
|
-
readonly historyRecords: ImbricateScriptHistoryRecord[];
|
|
29
|
-
readonly description?: string;
|
|
30
|
-
} & ImbricateScriptSnapshot;
|
|
31
|
-
export type ImbricateScriptCapability = Record<IMBRICATE_SCRIPT_CAPABILITY_KEY, ImbricateCapability>;
|
|
32
|
-
export declare enum IMBRICATE_SCRIPT_CAPABILITY_KEY {
|
|
33
|
-
READ = "imbricate.script.read",
|
|
34
|
-
WRITE = "imbricate.script.write",
|
|
35
|
-
READ_ATTRIBUTE = "imbricate.script.attribute.read",
|
|
36
|
-
WRITE_ATTRIBUTE = "imbricate.script.attribute.write",
|
|
37
|
-
UPDATE_METADATA = "imbricate.script.metadata.update",
|
|
38
|
-
UPDATE_HISTORY_RECORD = "imbricate.script.history.update",
|
|
39
|
-
EXECUTE = "imbricate.script.execute"
|
|
40
|
-
}
|
|
41
|
-
export declare const ImbricateScriptCapabilityList: IMBRICATE_SCRIPT_CAPABILITY_KEY[];
|
package/script/definition.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace Script
|
|
5
|
-
* @description Definition
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricateScriptCapabilityList = exports.IMBRICATE_SCRIPT_CAPABILITY_KEY = void 0;
|
|
9
|
-
var IMBRICATE_SCRIPT_CAPABILITY_KEY;
|
|
10
|
-
(function (IMBRICATE_SCRIPT_CAPABILITY_KEY) {
|
|
11
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["READ"] = "imbricate.script.read";
|
|
12
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["WRITE"] = "imbricate.script.write";
|
|
13
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["READ_ATTRIBUTE"] = "imbricate.script.attribute.read";
|
|
14
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["WRITE_ATTRIBUTE"] = "imbricate.script.attribute.write";
|
|
15
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["UPDATE_METADATA"] = "imbricate.script.metadata.update";
|
|
16
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["UPDATE_HISTORY_RECORD"] = "imbricate.script.history.update";
|
|
17
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY["EXECUTE"] = "imbricate.script.execute";
|
|
18
|
-
})(IMBRICATE_SCRIPT_CAPABILITY_KEY || (exports.IMBRICATE_SCRIPT_CAPABILITY_KEY = IMBRICATE_SCRIPT_CAPABILITY_KEY = {}));
|
|
19
|
-
exports.ImbricateScriptCapabilityList = [
|
|
20
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.READ,
|
|
21
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.WRITE,
|
|
22
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.READ_ATTRIBUTE,
|
|
23
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.WRITE_ATTRIBUTE,
|
|
24
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_METADATA,
|
|
25
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.UPDATE_HISTORY_RECORD,
|
|
26
|
-
IMBRICATE_SCRIPT_CAPABILITY_KEY.EXECUTE,
|
|
27
|
-
];
|
package/script/interface.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Script
|
|
4
|
-
* @description Interface
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { PromiseOr } from "../definition/promise";
|
|
8
|
-
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
9
|
-
import { ImbricateScriptAttributes, ImbricateScriptCapability, ImbricateScriptHistoryRecord } from "./definition";
|
|
10
|
-
export interface IImbricateScript {
|
|
11
|
-
readonly scriptName: string;
|
|
12
|
-
readonly identifier: string;
|
|
13
|
-
readonly variant: ImbricateScriptVariant;
|
|
14
|
-
readonly digest: string;
|
|
15
|
-
readonly historyRecords: ImbricateScriptHistoryRecord[];
|
|
16
|
-
readonly description?: string;
|
|
17
|
-
readonly createdAt: Date;
|
|
18
|
-
readonly updatedAt: Date;
|
|
19
|
-
readonly capabilities: ImbricateScriptCapability;
|
|
20
|
-
readScript(): PromiseOr<string>;
|
|
21
|
-
writeScript(script: string): PromiseOr<void>;
|
|
22
|
-
readAttributes(): PromiseOr<ImbricateScriptAttributes>;
|
|
23
|
-
writeAttribute(key: string, value: string): PromiseOr<void>;
|
|
24
|
-
/**
|
|
25
|
-
* Refresh Updated At and Digest, and add a history record
|
|
26
|
-
* Recommended to use this method when updating the script
|
|
27
|
-
*
|
|
28
|
-
* @param updatedAt Updated At
|
|
29
|
-
* @param digest Content Digest
|
|
30
|
-
* @param author Author
|
|
31
|
-
*/
|
|
32
|
-
refreshUpdateMetadata(updatedAt: Date, digest: string, author: ImbricateAuthor): PromiseOr<void>;
|
|
33
|
-
/**
|
|
34
|
-
* Refresh Updated At
|
|
35
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
36
|
-
*
|
|
37
|
-
* @param updatedAt Updated At
|
|
38
|
-
*/
|
|
39
|
-
refreshUpdatedAt(updatedAt: Date): PromiseOr<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Refresh Digest
|
|
42
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
43
|
-
*
|
|
44
|
-
* @param digest Content Digest
|
|
45
|
-
*/
|
|
46
|
-
refreshDigest(digest: string): PromiseOr<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Add a history record
|
|
49
|
-
* Prefer `refreshUpdateMetadata` in most cases
|
|
50
|
-
*
|
|
51
|
-
* @param record History Record
|
|
52
|
-
*/
|
|
53
|
-
addHistoryRecord(record: ImbricateScriptHistoryRecord): PromiseOr<void>;
|
|
54
|
-
}
|
package/script-manager/base.d.ts
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace ScriptManager
|
|
4
|
-
* @description Base
|
|
5
|
-
*/
|
|
6
|
-
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
-
import { ImbricateCapabilityBuilder } from "../capability/builder";
|
|
8
|
-
import { ImbricateCapability } from "../capability/definition";
|
|
9
|
-
import type { PromiseOr } from "../definition/promise";
|
|
10
|
-
import { ImbricateScriptQuery, ImbricateScriptQueryConfig, ImbricateSearchScriptConfig } from "../query/script";
|
|
11
|
-
import { IImbricateScriptManager } from "../script-manager/interface";
|
|
12
|
-
import { ImbricateScriptVariant } from "../script-variant/definition";
|
|
13
|
-
import { ImbricateScriptMetadata, ImbricateScriptSearchResult, ImbricateScriptSnapshot } from "../script/definition";
|
|
14
|
-
import { IImbricateScript } from "../script/interface";
|
|
15
|
-
import { IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY, ImbricateScriptManagerCapability } from "./definition";
|
|
16
|
-
export declare abstract class ImbricateScriptManagerBase implements IImbricateScriptManager {
|
|
17
|
-
static buildCapability(initial?: ImbricateCapability): ImbricateCapabilityBuilder<IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY>;
|
|
18
|
-
static allAllowCapability(): ImbricateScriptManagerCapability;
|
|
19
|
-
static allDenyCapability(): ImbricateScriptManagerCapability;
|
|
20
|
-
abstract readonly capabilities: ImbricateScriptManagerCapability;
|
|
21
|
-
createScript(_scriptName: string, _variant: ImbricateScriptVariant, _author: ImbricateAuthor, _initialScript: string, _description?: string): PromiseOr<IImbricateScript>;
|
|
22
|
-
putScript(_scriptMetadata: ImbricateScriptMetadata, _script: string): PromiseOr<IImbricateScript>;
|
|
23
|
-
renameScript(_identifier: string, _newScriptName: string): PromiseOr<void>;
|
|
24
|
-
deleteScript(_identifier: string): PromiseOr<void>;
|
|
25
|
-
hasScript(_scriptName: string): PromiseOr<boolean>;
|
|
26
|
-
getScript(_identifier: string): PromiseOr<IImbricateScript | null>;
|
|
27
|
-
listScripts(): PromiseOr<ImbricateScriptSnapshot[]>;
|
|
28
|
-
searchScripts(_keyword: string, _config: ImbricateSearchScriptConfig): PromiseOr<ImbricateScriptSearchResult[]>;
|
|
29
|
-
queryScripts(_query: ImbricateScriptQuery, _config: ImbricateScriptQueryConfig): PromiseOr<IImbricateScript[]>;
|
|
30
|
-
listSupportedVariants(): Promise<ImbricateScriptVariant[]>;
|
|
31
|
-
}
|
package/script-manager/base.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace ScriptManager
|
|
5
|
-
* @description Base
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricateScriptManagerBase = void 0;
|
|
9
|
-
const builder_1 = require("../capability/builder");
|
|
10
|
-
const definition_1 = require("../capability/definition");
|
|
11
|
-
const not_implemented_1 = require("../error/not-implemented");
|
|
12
|
-
const definition_2 = require("./definition");
|
|
13
|
-
class ImbricateScriptManagerBase {
|
|
14
|
-
static buildCapability(initial = (0, definition_1.createDenyImbricateCapability)()) {
|
|
15
|
-
return builder_1.ImbricateCapabilityBuilder.create(definition_2.ImbricateScriptManagerCapabilityList, initial);
|
|
16
|
-
}
|
|
17
|
-
static allAllowCapability() {
|
|
18
|
-
return this.buildCapability((0, definition_1.createAllowImbricateCapability)()).build();
|
|
19
|
-
}
|
|
20
|
-
static allDenyCapability() {
|
|
21
|
-
return this.buildCapability((0, definition_1.createDenyImbricateCapability)()).build();
|
|
22
|
-
}
|
|
23
|
-
createScript(_scriptName, _variant, _author, _initialScript, _description) {
|
|
24
|
-
throw not_implemented_1.ImbricateNotImplemented.create("CreateScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.CREATE_SCRIPT);
|
|
25
|
-
}
|
|
26
|
-
putScript(_scriptMetadata, _script) {
|
|
27
|
-
throw not_implemented_1.ImbricateNotImplemented.create("PutScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.PUT_SCRIPT);
|
|
28
|
-
}
|
|
29
|
-
renameScript(_identifier, _newScriptName) {
|
|
30
|
-
throw not_implemented_1.ImbricateNotImplemented.create("RenameScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.RENAME_SCRIPT);
|
|
31
|
-
}
|
|
32
|
-
deleteScript(_identifier) {
|
|
33
|
-
throw not_implemented_1.ImbricateNotImplemented.create("DeleteScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.DELETE_SCRIPT);
|
|
34
|
-
}
|
|
35
|
-
hasScript(_scriptName) {
|
|
36
|
-
throw not_implemented_1.ImbricateNotImplemented.create("HasScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.LIST_SCRIPTS);
|
|
37
|
-
}
|
|
38
|
-
getScript(_identifier) {
|
|
39
|
-
throw not_implemented_1.ImbricateNotImplemented.create("GetScript", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.GET_SCRIPT);
|
|
40
|
-
}
|
|
41
|
-
listScripts() {
|
|
42
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ListScripts", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.LIST_SCRIPTS);
|
|
43
|
-
}
|
|
44
|
-
searchScripts(_keyword, _config) {
|
|
45
|
-
throw not_implemented_1.ImbricateNotImplemented.create("SearchScripts", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.LIST_SCRIPTS);
|
|
46
|
-
}
|
|
47
|
-
queryScripts(_query, _config) {
|
|
48
|
-
throw not_implemented_1.ImbricateNotImplemented.create("QueryScripts", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.LIST_SCRIPTS);
|
|
49
|
-
}
|
|
50
|
-
listSupportedVariants() {
|
|
51
|
-
throw not_implemented_1.ImbricateNotImplemented.create("ListSupportedVariants", definition_2.IMBRICATE_SCRIPT_MANAGER_CAPABILITY_KEY.LIST_SUPPORTED_VARIANTS);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
exports.ImbricateScriptManagerBase = ImbricateScriptManagerBase;
|