@imbricate/core 2.6.1 → 3.0.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/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 +26 -0
- package/database/manager.js +7 -0
- package/database/schema.d.ts +14 -0
- package/database/schema.js +7 -0
- package/document/definition.d.ts +30 -0
- package/document/definition.js +17 -0
- package/document/interface.d.ts +49 -0
- package/{trash → document}/interface.js +1 -1
- package/index.d.ts +13 -53
- package/index.js +13 -53
- package/loader/definition.d.ts +8 -0
- package/{query → loader}/definition.js +1 -1
- package/loader/origin-loader.d.ts +8 -0
- package/loader/origin-loader.js +66 -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/listable.js +0 -7
- 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/author/definition.d.ts
CHANGED
|
@@ -3,10 +3,7 @@
|
|
|
3
3
|
* @namespace Author
|
|
4
4
|
* @description Definition
|
|
5
5
|
*/
|
|
6
|
-
export type ImbricateAuthorAttributes = Record<string, string>;
|
|
7
6
|
export type ImbricateAuthor = {
|
|
8
|
-
readonly
|
|
9
|
-
readonly displayName?: string;
|
|
7
|
+
readonly category: string;
|
|
10
8
|
readonly identifier: string;
|
|
11
|
-
readonly attributes: ImbricateAuthorAttributes;
|
|
12
9
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Query of the document
|
|
8
|
+
*
|
|
9
|
+
* @param limit limit of the query
|
|
10
|
+
* @param skip skip of the query
|
|
11
|
+
*/
|
|
12
|
+
export type ImbricateDocumentQuery = {
|
|
13
|
+
readonly limit?: number;
|
|
14
|
+
readonly skip?: number;
|
|
15
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { DocumentProperties } from "../document/definition";
|
|
7
|
+
import { IImbricateDocument } from "../document/interface";
|
|
8
|
+
import { ImbricateDocumentQuery } from "./definition";
|
|
9
|
+
import { ImbricateDatabaseSchema } from "./schema";
|
|
10
|
+
export interface IImbricateDatabase {
|
|
11
|
+
/**
|
|
12
|
+
* Unique identifier of the database
|
|
13
|
+
*/
|
|
14
|
+
readonly uniqueIdentifier: string;
|
|
15
|
+
readonly databaseName: string;
|
|
16
|
+
readonly schema: ImbricateDatabaseSchema;
|
|
17
|
+
/**
|
|
18
|
+
* Create a new document in the database
|
|
19
|
+
*
|
|
20
|
+
* @param properties properties of the document
|
|
21
|
+
* @param uniqueIdentifier unique identifier of the document, optional
|
|
22
|
+
* if not provided, a unique identifier will be generated
|
|
23
|
+
*
|
|
24
|
+
* @returns a promise of the created document
|
|
25
|
+
*/
|
|
26
|
+
createDocument(properties: DocumentProperties, uniqueIdentifier?: string): PromiseLike<IImbricateDocument>;
|
|
27
|
+
/**
|
|
28
|
+
* Get one document from the database
|
|
29
|
+
*
|
|
30
|
+
* @returns a promise of the documents in the database, null if not found
|
|
31
|
+
*/
|
|
32
|
+
getDocument(uniqueIdentifier: string): PromiseLike<IImbricateDocument | null>;
|
|
33
|
+
/**
|
|
34
|
+
* Query documents from the database
|
|
35
|
+
*
|
|
36
|
+
* @param query query of the documents
|
|
37
|
+
*
|
|
38
|
+
* @returns a promise of the documents in the database
|
|
39
|
+
*/
|
|
40
|
+
queryDocuments(query: ImbricateDocumentQuery): PromiseLike<IImbricateDocument[]>;
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Manager
|
|
5
|
+
*/
|
|
6
|
+
import { IImbricateDatabase } from "./interface";
|
|
7
|
+
import { ImbricateDatabaseSchema } from "./schema";
|
|
8
|
+
export interface IImbricateDatabaseManager {
|
|
9
|
+
/**
|
|
10
|
+
* Get databases from the origin
|
|
11
|
+
*
|
|
12
|
+
* @returns a promise of the databases in the origin
|
|
13
|
+
*/
|
|
14
|
+
getDatabases(): PromiseLike<IImbricateDatabase[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new database
|
|
17
|
+
*
|
|
18
|
+
* @param databaseName name of the database
|
|
19
|
+
* @param schema schema of the database
|
|
20
|
+
* @param uniqueIdentifier unique identifier of the database, optional
|
|
21
|
+
* if not provided, a unique identifier will be generated
|
|
22
|
+
*
|
|
23
|
+
* @returns a promise of the created database
|
|
24
|
+
*/
|
|
25
|
+
createDatabase(databaseName: string, schema: ImbricateDatabaseSchema, uniqueIdentifier?: string): PromiseLike<IImbricateDatabase>;
|
|
26
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Database
|
|
4
|
+
* @description Schema
|
|
5
|
+
*/
|
|
6
|
+
import { IMBRICATE_PROPERTY_TYPE } from "../document/definition";
|
|
7
|
+
export type ImbricateDatabaseSchemaProperty = {
|
|
8
|
+
readonly propertyIdentifier: string;
|
|
9
|
+
readonly propertyName: string;
|
|
10
|
+
readonly propertyType: IMBRICATE_PROPERTY_TYPE;
|
|
11
|
+
};
|
|
12
|
+
export type ImbricateDatabaseSchema = {
|
|
13
|
+
readonly properties: ImbricateDatabaseSchemaProperty[];
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Document
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
import { ImbricateAuthor } from "../author/definition";
|
|
7
|
+
export declare enum IMBRICATE_PROPERTY_TYPE {
|
|
8
|
+
STRING = "STRING",
|
|
9
|
+
MARKDOWN = "MARKDOWN"
|
|
10
|
+
}
|
|
11
|
+
export type DocumentProperties = Record<DocumentPropertyKey, DocumentPropertyValue>;
|
|
12
|
+
export type DocumentPropertyKey = string;
|
|
13
|
+
export type DocumentPropertyValue = {
|
|
14
|
+
readonly type: IMBRICATE_PROPERTY_TYPE;
|
|
15
|
+
readonly value: any;
|
|
16
|
+
};
|
|
17
|
+
export declare enum IMBRICATE_DOCUMENT_EDIT_TYPE {
|
|
18
|
+
PUT = "PUT"
|
|
19
|
+
}
|
|
20
|
+
export type DocumentEditOperation = {
|
|
21
|
+
readonly key: DocumentPropertyKey;
|
|
22
|
+
readonly action: IMBRICATE_DOCUMENT_EDIT_TYPE;
|
|
23
|
+
readonly value: DocumentPropertyValue;
|
|
24
|
+
};
|
|
25
|
+
export type DocumentEditRecord = {
|
|
26
|
+
readonly uniqueIdentifier: string;
|
|
27
|
+
readonly editAt: Date;
|
|
28
|
+
readonly author: ImbricateAuthor;
|
|
29
|
+
readonly operations: DocumentEditOperation[];
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Document
|
|
5
|
+
* @description Definition
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IMBRICATE_DOCUMENT_EDIT_TYPE = exports.IMBRICATE_PROPERTY_TYPE = void 0;
|
|
9
|
+
var IMBRICATE_PROPERTY_TYPE;
|
|
10
|
+
(function (IMBRICATE_PROPERTY_TYPE) {
|
|
11
|
+
IMBRICATE_PROPERTY_TYPE["STRING"] = "STRING";
|
|
12
|
+
IMBRICATE_PROPERTY_TYPE["MARKDOWN"] = "MARKDOWN";
|
|
13
|
+
})(IMBRICATE_PROPERTY_TYPE || (exports.IMBRICATE_PROPERTY_TYPE = IMBRICATE_PROPERTY_TYPE = {}));
|
|
14
|
+
var IMBRICATE_DOCUMENT_EDIT_TYPE;
|
|
15
|
+
(function (IMBRICATE_DOCUMENT_EDIT_TYPE) {
|
|
16
|
+
IMBRICATE_DOCUMENT_EDIT_TYPE["PUT"] = "PUT";
|
|
17
|
+
})(IMBRICATE_DOCUMENT_EDIT_TYPE || (exports.IMBRICATE_DOCUMENT_EDIT_TYPE = IMBRICATE_DOCUMENT_EDIT_TYPE = {}));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Document
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { DocumentEditRecord, DocumentProperties, DocumentPropertyKey, DocumentPropertyValue } from "./definition";
|
|
7
|
+
export interface IImbricateDocument {
|
|
8
|
+
/**
|
|
9
|
+
* Unique identifier of the database
|
|
10
|
+
*/
|
|
11
|
+
readonly uniqueIdentifier: string;
|
|
12
|
+
/**
|
|
13
|
+
* Update a property from the document
|
|
14
|
+
*
|
|
15
|
+
* @param key key of the property
|
|
16
|
+
* @param value value of the property
|
|
17
|
+
*
|
|
18
|
+
* @returns a promise of the edit records of the document
|
|
19
|
+
* Note: the edit records will not be added to the document, the best practice is to call addEditRecords to add the edit records.
|
|
20
|
+
*/
|
|
21
|
+
putProperty(key: DocumentPropertyKey, value: DocumentPropertyValue): PromiseLike<DocumentEditRecord[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Put and replace all properties of the document
|
|
24
|
+
*
|
|
25
|
+
* @param properties properties of the document
|
|
26
|
+
*
|
|
27
|
+
* @returns a promise of the edit records of the document
|
|
28
|
+
* Note: the edit records will not be added to the document, the best practice is to call addEditRecords to add the edit records.
|
|
29
|
+
*/
|
|
30
|
+
putProperties(properties: DocumentProperties): PromiseLike<DocumentEditRecord[]>;
|
|
31
|
+
/**
|
|
32
|
+
* Get properties from the document
|
|
33
|
+
*
|
|
34
|
+
* @returns a promise of the properties of the document
|
|
35
|
+
*/
|
|
36
|
+
getProperties(): PromiseLike<DocumentProperties>;
|
|
37
|
+
/**
|
|
38
|
+
* Add edit records to the document
|
|
39
|
+
*
|
|
40
|
+
* @param records document edit records
|
|
41
|
+
*/
|
|
42
|
+
addEditRecords(records: DocumentEditRecord[]): PromiseLike<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Get edit records of the document
|
|
45
|
+
*
|
|
46
|
+
* @returns a promise of the edit records of the document
|
|
47
|
+
*/
|
|
48
|
+
getEditRecords(): PromiseLike<DocumentEditRecord[]>;
|
|
49
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -3,58 +3,18 @@
|
|
|
3
3
|
* @description Index
|
|
4
4
|
*/
|
|
5
5
|
export * from "./author/definition";
|
|
6
|
-
export * from "./
|
|
7
|
-
export * from "./
|
|
8
|
-
export * from "./
|
|
9
|
-
export * from "./
|
|
10
|
-
export * from "./
|
|
11
|
-
export * from "./
|
|
12
|
-
export * from "./
|
|
13
|
-
export * from "./
|
|
14
|
-
export * from "./
|
|
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";
|
|
19
|
-
export * from "./collection/base";
|
|
20
|
-
export * from "./collection/definition";
|
|
21
|
-
export * from "./collection/interface";
|
|
22
|
-
export * from "./collection/least-common-identifier";
|
|
23
|
-
export * from "./definition/listable";
|
|
24
|
-
export * from "./definition/promise";
|
|
25
|
-
export * from "./error/imbricate-error";
|
|
26
|
-
export * from "./error/not-implemented";
|
|
27
|
-
export * from "./executable-manager/base";
|
|
28
|
-
export * from "./executable-manager/definition";
|
|
29
|
-
export * from "./executable-manager/interface";
|
|
30
|
-
export * from "./execute/definition";
|
|
31
|
-
export * from "./function/base";
|
|
32
|
-
export * from "./function/definition";
|
|
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";
|
|
38
|
-
export * from "./origin/base";
|
|
6
|
+
export * from "./database/definition";
|
|
7
|
+
export * from "./database/interface";
|
|
8
|
+
export * from "./database/manager";
|
|
9
|
+
export * from "./database/schema";
|
|
10
|
+
export * from "./document/definition";
|
|
11
|
+
export * from "./document/interface";
|
|
12
|
+
export * from "./loader/definition";
|
|
13
|
+
export * from "./loader/origin-loader";
|
|
14
|
+
export * from "./loader/persistance";
|
|
39
15
|
export * from "./origin/definition";
|
|
40
16
|
export * from "./origin/interface";
|
|
41
|
-
export * from "./
|
|
42
|
-
export * from "./
|
|
43
|
-
export * from "./
|
|
44
|
-
export * from "./
|
|
45
|
-
export * from "./page/interface";
|
|
46
|
-
export * from "./query/definition";
|
|
47
|
-
export * from "./query/page";
|
|
48
|
-
export * from "./query/script";
|
|
49
|
-
export * from "./script-manager/base";
|
|
50
|
-
export * from "./script-manager/definition";
|
|
51
|
-
export * from "./script-manager/interface";
|
|
52
|
-
export * from "./script-variant/definition";
|
|
53
|
-
export * from "./script/base";
|
|
54
|
-
export * from "./script/definition";
|
|
55
|
-
export * from "./script/interface";
|
|
56
|
-
export * from "./search/prefix";
|
|
57
|
-
export * from "./search/snippet";
|
|
58
|
-
export * from "./trash/base";
|
|
59
|
-
export * from "./trash/definition";
|
|
60
|
-
export * from "./trash/interface";
|
|
17
|
+
export * from "./static/interface";
|
|
18
|
+
export * from "./static/manager";
|
|
19
|
+
export * from "./text/interface";
|
|
20
|
+
export * from "./text/manager";
|
package/index.js
CHANGED
|
@@ -19,58 +19,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
};
|
|
20
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
21
|
__exportStar(require("./author/definition"), exports);
|
|
22
|
-
__exportStar(require("./
|
|
23
|
-
__exportStar(require("./
|
|
24
|
-
__exportStar(require("./
|
|
25
|
-
__exportStar(require("./
|
|
26
|
-
__exportStar(require("./
|
|
27
|
-
__exportStar(require("./
|
|
28
|
-
__exportStar(require("./
|
|
29
|
-
__exportStar(require("./
|
|
30
|
-
__exportStar(require("./
|
|
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);
|
|
35
|
-
__exportStar(require("./collection/base"), exports);
|
|
36
|
-
__exportStar(require("./collection/definition"), exports);
|
|
37
|
-
__exportStar(require("./collection/interface"), exports);
|
|
38
|
-
__exportStar(require("./collection/least-common-identifier"), exports);
|
|
39
|
-
__exportStar(require("./definition/listable"), exports);
|
|
40
|
-
__exportStar(require("./definition/promise"), exports);
|
|
41
|
-
__exportStar(require("./error/imbricate-error"), exports);
|
|
42
|
-
__exportStar(require("./error/not-implemented"), exports);
|
|
43
|
-
__exportStar(require("./executable-manager/base"), exports);
|
|
44
|
-
__exportStar(require("./executable-manager/definition"), exports);
|
|
45
|
-
__exportStar(require("./executable-manager/interface"), exports);
|
|
46
|
-
__exportStar(require("./execute/definition"), exports);
|
|
47
|
-
__exportStar(require("./function/base"), exports);
|
|
48
|
-
__exportStar(require("./function/definition"), exports);
|
|
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);
|
|
54
|
-
__exportStar(require("./origin/base"), exports);
|
|
22
|
+
__exportStar(require("./database/definition"), exports);
|
|
23
|
+
__exportStar(require("./database/interface"), exports);
|
|
24
|
+
__exportStar(require("./database/manager"), exports);
|
|
25
|
+
__exportStar(require("./database/schema"), exports);
|
|
26
|
+
__exportStar(require("./document/definition"), exports);
|
|
27
|
+
__exportStar(require("./document/interface"), exports);
|
|
28
|
+
__exportStar(require("./loader/definition"), exports);
|
|
29
|
+
__exportStar(require("./loader/origin-loader"), exports);
|
|
30
|
+
__exportStar(require("./loader/persistance"), exports);
|
|
55
31
|
__exportStar(require("./origin/definition"), exports);
|
|
56
32
|
__exportStar(require("./origin/interface"), exports);
|
|
57
|
-
__exportStar(require("./
|
|
58
|
-
__exportStar(require("./
|
|
59
|
-
__exportStar(require("./
|
|
60
|
-
__exportStar(require("./
|
|
61
|
-
__exportStar(require("./page/interface"), exports);
|
|
62
|
-
__exportStar(require("./query/definition"), exports);
|
|
63
|
-
__exportStar(require("./query/page"), exports);
|
|
64
|
-
__exportStar(require("./query/script"), exports);
|
|
65
|
-
__exportStar(require("./script-manager/base"), exports);
|
|
66
|
-
__exportStar(require("./script-manager/definition"), exports);
|
|
67
|
-
__exportStar(require("./script-manager/interface"), exports);
|
|
68
|
-
__exportStar(require("./script-variant/definition"), exports);
|
|
69
|
-
__exportStar(require("./script/base"), exports);
|
|
70
|
-
__exportStar(require("./script/definition"), exports);
|
|
71
|
-
__exportStar(require("./script/interface"), exports);
|
|
72
|
-
__exportStar(require("./search/prefix"), exports);
|
|
73
|
-
__exportStar(require("./search/snippet"), exports);
|
|
74
|
-
__exportStar(require("./trash/base"), exports);
|
|
75
|
-
__exportStar(require("./trash/definition"), exports);
|
|
76
|
-
__exportStar(require("./trash/interface"), exports);
|
|
33
|
+
__exportStar(require("./static/interface"), exports);
|
|
34
|
+
__exportStar(require("./static/manager"), exports);
|
|
35
|
+
__exportStar(require("./text/interface"), exports);
|
|
36
|
+
__exportStar(require("./text/manager"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Loader
|
|
4
|
+
* @description Definition
|
|
5
|
+
*/
|
|
6
|
+
import { OriginPayload } from "../origin/definition";
|
|
7
|
+
import { IImbricateOrigin } from "../origin/interface";
|
|
8
|
+
export type ImbricateOriginLoader = (payload: OriginPayload) => IImbricateOrigin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Loader
|
|
4
|
+
* @description Origin Loader
|
|
5
|
+
*/
|
|
6
|
+
import { IImbricateOrigin } from "../origin/interface";
|
|
7
|
+
import { ImbricateOriginPersistance } from "./persistance";
|
|
8
|
+
export declare const loadImbricateOriginsFromPersistance: (persistance: ImbricateOriginPersistance) => Promise<IImbricateOrigin[]>;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Loader
|
|
5
|
+
* @description Origin Loader
|
|
6
|
+
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
10
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
11
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
12
|
+
}
|
|
13
|
+
Object.defineProperty(o, k2, desc);
|
|
14
|
+
}) : (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
o[k2] = m[k];
|
|
17
|
+
}));
|
|
18
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
19
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
20
|
+
}) : function(o, v) {
|
|
21
|
+
o["default"] = v;
|
|
22
|
+
});
|
|
23
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
24
|
+
if (mod && mod.__esModule) return mod;
|
|
25
|
+
var result = {};
|
|
26
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
27
|
+
__setModuleDefault(result, mod);
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
30
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.loadImbricateOriginsFromPersistance = void 0;
|
|
41
|
+
const persistance_1 = require("./persistance");
|
|
42
|
+
const loadImbricateOriginsFromPersistance = (persistance) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
const origins = [];
|
|
44
|
+
for (const origin of persistance.origins) {
|
|
45
|
+
switch (origin.originLoadType) {
|
|
46
|
+
case persistance_1.IMBRICATE_ORIGIN_LOAD_TYPE.NPM_PACKAGE: {
|
|
47
|
+
const originPackage = yield Promise.resolve(`${origin.originLoadValue}`).then(s => __importStar(require(s)));
|
|
48
|
+
if (typeof originPackage.default === "function") {
|
|
49
|
+
const initialized = originPackage.default.call(null, origin.originPayloads);
|
|
50
|
+
origins.push(initialized);
|
|
51
|
+
}
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case persistance_1.IMBRICATE_ORIGIN_LOAD_TYPE.FILE_SYSTEM: {
|
|
55
|
+
const originPackage = yield Promise.resolve(`${origin.originLoadValue}`).then(s => __importStar(require(s)));
|
|
56
|
+
if (typeof originPackage.default === "function") {
|
|
57
|
+
const initialized = originPackage.default.call(null, origin.originPayloads);
|
|
58
|
+
origins.push(initialized);
|
|
59
|
+
}
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return origins;
|
|
65
|
+
});
|
|
66
|
+
exports.loadImbricateOriginsFromPersistance = loadImbricateOriginsFromPersistance;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Loader
|
|
4
|
+
* @description Persistance
|
|
5
|
+
*/
|
|
6
|
+
import { OriginPayload } from "../origin/definition";
|
|
7
|
+
export declare enum IMBRICATE_ORIGIN_LOAD_TYPE {
|
|
8
|
+
NPM_PACKAGE = "NPM_PACKAGE",
|
|
9
|
+
FILE_SYSTEM = "FILE_SYSTEM"
|
|
10
|
+
}
|
|
11
|
+
export type ImbricateOriginPersistanceOrigin = {
|
|
12
|
+
readonly originLoadType: IMBRICATE_ORIGIN_LOAD_TYPE;
|
|
13
|
+
readonly originLoadValue: string;
|
|
14
|
+
readonly originName: string;
|
|
15
|
+
readonly originPayloads: OriginPayload;
|
|
16
|
+
};
|
|
17
|
+
export type ImbricateOriginPersistance = {
|
|
18
|
+
readonly origins: ImbricateOriginPersistanceOrigin[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Loader
|
|
5
|
+
* @description Persistance
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IMBRICATE_ORIGIN_LOAD_TYPE = void 0;
|
|
9
|
+
var IMBRICATE_ORIGIN_LOAD_TYPE;
|
|
10
|
+
(function (IMBRICATE_ORIGIN_LOAD_TYPE) {
|
|
11
|
+
IMBRICATE_ORIGIN_LOAD_TYPE["NPM_PACKAGE"] = "NPM_PACKAGE";
|
|
12
|
+
IMBRICATE_ORIGIN_LOAD_TYPE["FILE_SYSTEM"] = "FILE_SYSTEM";
|
|
13
|
+
})(IMBRICATE_ORIGIN_LOAD_TYPE || (exports.IMBRICATE_ORIGIN_LOAD_TYPE = IMBRICATE_ORIGIN_LOAD_TYPE = {}));
|
package/origin/definition.d.ts
CHANGED
|
@@ -3,22 +3,4 @@
|
|
|
3
3
|
* @namespace Origin
|
|
4
4
|
* @description Definition
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
export declare enum IMBRICATE_DIGEST_ALGORITHM {
|
|
8
|
-
MD5 = "MD5",
|
|
9
|
-
SHA1 = "SHA1",
|
|
10
|
-
SHA256 = "SHA256"
|
|
11
|
-
}
|
|
12
|
-
export type ImbricateOriginMetadata = {
|
|
13
|
-
readonly digestAlgorithm: IMBRICATE_DIGEST_ALGORITHM;
|
|
14
|
-
};
|
|
15
|
-
export type ImbricateOriginCapability = Record<IMBRICATE_ORIGIN_CAPABILITY_KEY, ImbricateCapability>;
|
|
16
|
-
export declare enum IMBRICATE_ORIGIN_CAPABILITY_KEY {
|
|
17
|
-
ORIGIN_FUNCTION = "imbricate.origin.function",
|
|
18
|
-
ORIGIN_BINARY_STORAGE = "imbricate.origin.binary-storage",
|
|
19
|
-
ORIGIN_TRASH_STASH = "imbricate.origin.trash-stash",
|
|
20
|
-
ORIGIN_SCRIPT_MANAGER = "imbricate.origin.script-manager",
|
|
21
|
-
ORIGIN_COLLECTION_MANAGER = "imbricate.origin.collection-manager",
|
|
22
|
-
ORIGIN_OPERATION_MANAGER = "imbricate.origin.operation-manager"
|
|
23
|
-
}
|
|
24
|
-
export declare const ImbricateOriginCapabilityList: IMBRICATE_ORIGIN_CAPABILITY_KEY[];
|
|
6
|
+
export type OriginPayload = Record<string, any>;
|
package/origin/definition.js
CHANGED
|
@@ -5,27 +5,3 @@
|
|
|
5
5
|
* @description Definition
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.ImbricateOriginCapabilityList = exports.IMBRICATE_ORIGIN_CAPABILITY_KEY = exports.IMBRICATE_DIGEST_ALGORITHM = void 0;
|
|
9
|
-
var IMBRICATE_DIGEST_ALGORITHM;
|
|
10
|
-
(function (IMBRICATE_DIGEST_ALGORITHM) {
|
|
11
|
-
IMBRICATE_DIGEST_ALGORITHM["MD5"] = "MD5";
|
|
12
|
-
IMBRICATE_DIGEST_ALGORITHM["SHA1"] = "SHA1";
|
|
13
|
-
IMBRICATE_DIGEST_ALGORITHM["SHA256"] = "SHA256";
|
|
14
|
-
})(IMBRICATE_DIGEST_ALGORITHM || (exports.IMBRICATE_DIGEST_ALGORITHM = IMBRICATE_DIGEST_ALGORITHM = {}));
|
|
15
|
-
var IMBRICATE_ORIGIN_CAPABILITY_KEY;
|
|
16
|
-
(function (IMBRICATE_ORIGIN_CAPABILITY_KEY) {
|
|
17
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_FUNCTION"] = "imbricate.origin.function";
|
|
18
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_BINARY_STORAGE"] = "imbricate.origin.binary-storage";
|
|
19
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_TRASH_STASH"] = "imbricate.origin.trash-stash";
|
|
20
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_SCRIPT_MANAGER"] = "imbricate.origin.script-manager";
|
|
21
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_COLLECTION_MANAGER"] = "imbricate.origin.collection-manager";
|
|
22
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY["ORIGIN_OPERATION_MANAGER"] = "imbricate.origin.operation-manager";
|
|
23
|
-
})(IMBRICATE_ORIGIN_CAPABILITY_KEY || (exports.IMBRICATE_ORIGIN_CAPABILITY_KEY = IMBRICATE_ORIGIN_CAPABILITY_KEY = {}));
|
|
24
|
-
exports.ImbricateOriginCapabilityList = [
|
|
25
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_FUNCTION,
|
|
26
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_BINARY_STORAGE,
|
|
27
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_TRASH_STASH,
|
|
28
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_SCRIPT_MANAGER,
|
|
29
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_COLLECTION_MANAGER,
|
|
30
|
-
IMBRICATE_ORIGIN_CAPABILITY_KEY.ORIGIN_OPERATION_MANAGER,
|
|
31
|
-
];
|