@imbricate/core 1.0.0 → 1.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/definition/listable.d.ts +6 -0
- package/definition/promise.d.ts +6 -0
- package/definition/script.d.ts +9 -0
- package/index.d.ts +15 -0
- package/origin/collection/interface.d.ts +22 -0
- package/origin/collection/least-common-identifier.d.ts +10 -0
- package/origin/interface.d.ts +29 -0
- package/package.json +2 -4
- package/sandbox/definition/config.d.ts +6 -0
- package/sandbox/definition/environment.d.ts +11 -0
- package/sandbox/definition/implementation.d.ts +6 -0
- package/sandbox/feature/builder.d.ts +18 -0
- package/sandbox/feature/feature.d.ts +16 -0
- package/sandbox/provide/feature.d.ts +8 -0
- package/sandbox/sandbox.d.ts +11 -0
- package/search/prefix.d.ts +7 -0
- package/search/snippet.d.ts +22 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @description Index
|
|
4
|
+
*/
|
|
5
|
+
export * from "./definition/listable";
|
|
6
|
+
export * from "./definition/promise";
|
|
7
|
+
export * from "./definition/script";
|
|
8
|
+
export * from "./origin/collection/interface";
|
|
9
|
+
export * from "./origin/collection/least-common-identifier";
|
|
10
|
+
export * from "./origin/interface";
|
|
11
|
+
export * from "./sandbox/feature/builder";
|
|
12
|
+
export * from "./sandbox/feature/feature";
|
|
13
|
+
export * from "./sandbox/sandbox";
|
|
14
|
+
export * from "./search/prefix";
|
|
15
|
+
export * from "./search/snippet";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Origin_Collection
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { IMBRICATE_SEARCH_SNIPPET_TYPE, ImbricateSearchSnippet } from "../../search/snippet";
|
|
7
|
+
export type ImbricateOriginCollectionListPagesResponse = {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly identifier: string;
|
|
10
|
+
};
|
|
11
|
+
export interface IImbricateOriginCollection {
|
|
12
|
+
readonly collectionName: string;
|
|
13
|
+
readonly description?: string;
|
|
14
|
+
findScripts(...onActivities: string[]): Promise<void>;
|
|
15
|
+
listPages(): Promise<ImbricateOriginCollectionListPagesResponse[]>;
|
|
16
|
+
createPage(title: string, initialContent?: string): Promise<ImbricateOriginCollectionListPagesResponse>;
|
|
17
|
+
deletePage(identifier: string, title: string): Promise<void>;
|
|
18
|
+
openPage(title: string): Promise<void>;
|
|
19
|
+
readPage(identifier: string): Promise<string>;
|
|
20
|
+
hasPage(title: string): Promise<boolean>;
|
|
21
|
+
searchPages(keyword: string): Promise<Array<ImbricateSearchSnippet<IMBRICATE_SEARCH_SNIPPET_TYPE.PAGE>>>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Origin_Collection
|
|
4
|
+
* @description Least Common Identifier
|
|
5
|
+
*/
|
|
6
|
+
export type LeastCommonIdentifierItem = {
|
|
7
|
+
readonly key: string;
|
|
8
|
+
readonly identifier: string;
|
|
9
|
+
};
|
|
10
|
+
export declare const mapLeastCommonIdentifier: (identifiers: LeastCommonIdentifierItem[]) => Record<string, string>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Origin
|
|
4
|
+
* @description Interface
|
|
5
|
+
*/
|
|
6
|
+
import { MarkedResult } from "@sudoo/marked";
|
|
7
|
+
import { PromiseOr } from "../definition/promise";
|
|
8
|
+
import { ImbricateScriptMetadata } from "../definition/script";
|
|
9
|
+
import { SandboxExecuteConfig } from "../sandbox/definition/config";
|
|
10
|
+
import { IImbricateOriginCollection } from "./collection/interface";
|
|
11
|
+
export type ImbricateOriginMetadata = {
|
|
12
|
+
readonly type: string;
|
|
13
|
+
};
|
|
14
|
+
export interface IImbricateOrigin {
|
|
15
|
+
readonly metadata: ImbricateOriginMetadata;
|
|
16
|
+
readonly payloads: Record<string, any>;
|
|
17
|
+
createCollection(collectionName: string, description?: string): PromiseOr<void>;
|
|
18
|
+
hasCollection(collectionName: string): PromiseOr<boolean>;
|
|
19
|
+
getCollection(collectionName: string): PromiseOr<IImbricateOriginCollection | null>;
|
|
20
|
+
listCollections(): PromiseOr<IImbricateOriginCollection[]>;
|
|
21
|
+
removeCollection(): PromiseOr<void>;
|
|
22
|
+
createScript(scriptName: string, description?: string): PromiseOr<ImbricateScriptMetadata>;
|
|
23
|
+
hasScript(scriptName: string): PromiseOr<boolean>;
|
|
24
|
+
getScript(scriptIdentifier: string): PromiseOr<string | null>;
|
|
25
|
+
openScript(scriptIdentifier: string): PromiseOr<string>;
|
|
26
|
+
listScripts(): PromiseOr<ImbricateScriptMetadata[]>;
|
|
27
|
+
removeScript(scriptIdentifier: string, scriptName: string): PromiseOr<void>;
|
|
28
|
+
executeScript(scriptIdentifier: string, config: SandboxExecuteConfig): PromiseOr<MarkedResult | null>;
|
|
29
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imbricate/core",
|
|
3
3
|
"main": "index.js",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.1",
|
|
5
5
|
"description": "Core for Imbricate",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -17,13 +17,11 @@
|
|
|
17
17
|
},
|
|
18
18
|
"homepage": "https://imbricate.io",
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@sudoo/io": "^1.8.0",
|
|
21
20
|
"@sudoo/marked": "^3.21.4",
|
|
22
21
|
"@sudoo/marked-mixin-date": "^1.0.0",
|
|
23
22
|
"@sudoo/marked-mixin-json": "^1.0.0",
|
|
24
23
|
"@sudoo/marked-mixin-math": "^1.4.0",
|
|
25
24
|
"@sudoo/marked-mixin-object": "^1.3.0",
|
|
26
|
-
"@sudoo/marked-mixin-parse": "^1.0.0"
|
|
27
|
-
"@sudoo/uuid": "^1.1.0"
|
|
25
|
+
"@sudoo/marked-mixin-parse": "^1.0.0"
|
|
28
26
|
}
|
|
29
27
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Sandbox_Feature
|
|
4
|
+
* @description Builder
|
|
5
|
+
*/
|
|
6
|
+
import { SandboxImplementation } from "../definition/implementation";
|
|
7
|
+
import { SandboxFeature } from "./feature";
|
|
8
|
+
export declare class SandboxFeatureBuilder {
|
|
9
|
+
static fromScratch(): SandboxFeatureBuilder;
|
|
10
|
+
private _packageName;
|
|
11
|
+
private _methodName;
|
|
12
|
+
private _implementation;
|
|
13
|
+
private constructor();
|
|
14
|
+
withPackageName(packageName: string): this;
|
|
15
|
+
withMethodName(methodName: string): this;
|
|
16
|
+
withImplementation(implementation: SandboxImplementation): this;
|
|
17
|
+
build(): SandboxFeature;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Sandbox_Feature
|
|
4
|
+
* @description Feature
|
|
5
|
+
*/
|
|
6
|
+
import { SandboxImplementation } from "../definition/implementation";
|
|
7
|
+
export declare class SandboxFeature {
|
|
8
|
+
static create(packageName: string, methodName: string, implementation: SandboxImplementation): SandboxFeature;
|
|
9
|
+
private readonly _packageName;
|
|
10
|
+
private readonly _methodName;
|
|
11
|
+
private readonly _implementation;
|
|
12
|
+
private constructor();
|
|
13
|
+
get packageName(): string;
|
|
14
|
+
get methodName(): string;
|
|
15
|
+
get implementation(): SandboxImplementation;
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Sandbox_Provide
|
|
4
|
+
* @description Feature
|
|
5
|
+
*/
|
|
6
|
+
import { Sandbox } from "@sudoo/marked";
|
|
7
|
+
import { SandboxFeature } from "../feature/feature";
|
|
8
|
+
export declare const sandboxProvideFeatures: (sandbox: Sandbox, features: SandboxFeature[]) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Sandbox
|
|
4
|
+
* @description Sandbox
|
|
5
|
+
*/
|
|
6
|
+
import { MarkedResult, Sandbox } from "@sudoo/marked";
|
|
7
|
+
import { SandboxExecuteConfig } from "./definition/config";
|
|
8
|
+
import { SandboxEnvironment } from "./definition/environment";
|
|
9
|
+
import { SandboxFeature } from "./feature/feature";
|
|
10
|
+
export declare const createSandbox: (features: SandboxFeature[]) => Sandbox;
|
|
11
|
+
export declare const executeSandboxScript: (script: string, features: SandboxFeature[], environment: SandboxEnvironment, config: SandboxExecuteConfig) => Promise<MarkedResult>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Search
|
|
4
|
+
* @description Prefix
|
|
5
|
+
*/
|
|
6
|
+
import { IMBRICATE_SEARCH_SNIPPET_TYPE, ImbricateSearchSnippet } from "./snippet";
|
|
7
|
+
export declare const getShortPrefixOfSnippet: (snippet: ImbricateSearchSnippet<IMBRICATE_SEARCH_SNIPPET_TYPE>) => string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author WMXPY
|
|
3
|
+
* @namespace Search
|
|
4
|
+
* @description Snippet
|
|
5
|
+
*/
|
|
6
|
+
export declare enum IMBRICATE_SEARCH_SNIPPET_TYPE {
|
|
7
|
+
PAGE = "PAGE"
|
|
8
|
+
}
|
|
9
|
+
export declare enum IMBRICATE_SEARCH_SNIPPET_PAGE_SNIPPET_SOURCE {
|
|
10
|
+
TITLE = "TITLE",
|
|
11
|
+
CONTENT = "CONTENT"
|
|
12
|
+
}
|
|
13
|
+
type IMBRICATE_SEARCH_SNIPPET_SNIPPET_SOURCE<T extends IMBRICATE_SEARCH_SNIPPET_TYPE> = T extends IMBRICATE_SEARCH_SNIPPET_TYPE.PAGE ? IMBRICATE_SEARCH_SNIPPET_PAGE_SNIPPET_SOURCE : never;
|
|
14
|
+
export type ImbricateSearchSnippet<T extends IMBRICATE_SEARCH_SNIPPET_TYPE> = {
|
|
15
|
+
readonly type: T;
|
|
16
|
+
readonly scope: string;
|
|
17
|
+
readonly identifier: string;
|
|
18
|
+
readonly headline: string;
|
|
19
|
+
readonly source: IMBRICATE_SEARCH_SNIPPET_SNIPPET_SOURCE<T>;
|
|
20
|
+
readonly snippet: string;
|
|
21
|
+
};
|
|
22
|
+
export {};
|