@imbricate/core 1.5.0 → 1.5.2
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/interface.d.ts +0 -5
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +1 -1
- package/sandbox/definition/config.d.ts +1 -0
- package/script/interface.d.ts +2 -2
- package/collection/definition.d.ts +0 -21
- package/collection/definition.js +0 -16
|
@@ -6,14 +6,9 @@
|
|
|
6
6
|
import { PromiseOr } from "../definition/promise";
|
|
7
7
|
import { ImbricatePageMetadata, ImbricatePageSearchSnippet, ImbricatePageSnapshot } from "../page/definition";
|
|
8
8
|
import { IImbricatePage } from "../page/interface";
|
|
9
|
-
import { IMBRICATE_COLLECTION_EVENT_TYPE, IMBRICATE_COLLECTION_TRIGGER_TYPE, ImbricateCollectionEvent } from "./definition";
|
|
10
9
|
export interface IImbricateOriginCollection {
|
|
11
10
|
readonly collectionName: string;
|
|
12
11
|
readonly description?: string;
|
|
13
|
-
readonly events: Array<ImbricateCollectionEvent<IMBRICATE_COLLECTION_TRIGGER_TYPE>>;
|
|
14
|
-
attachEvent(event: ImbricateCollectionEvent<IMBRICATE_COLLECTION_TRIGGER_TYPE>): PromiseOr<void>;
|
|
15
|
-
getEventsByEventType(eventType: IMBRICATE_COLLECTION_EVENT_TYPE): PromiseOr<Array<ImbricateCollectionEvent<IMBRICATE_COLLECTION_TRIGGER_TYPE>>>;
|
|
16
|
-
triggerEvent(eventType: IMBRICATE_COLLECTION_EVENT_TYPE, payload: any): PromiseOr<void>;
|
|
17
12
|
createPage(title: string, initialContent?: string): PromiseOr<IImbricatePage>;
|
|
18
13
|
putPage(pageMetadata: ImbricatePageMetadata, content: string): PromiseOr<IImbricatePage>;
|
|
19
14
|
retitlePage(identifier: string, newTitle: string): PromiseOr<void>;
|
package/index.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export * from "./collection/interface";
|
|
|
6
6
|
export * from "./collection/least-common-identifier";
|
|
7
7
|
export * from "./definition/listable";
|
|
8
8
|
export * from "./definition/promise";
|
|
9
|
+
export * from "./origin/definition";
|
|
9
10
|
export * from "./origin/interface";
|
|
10
11
|
export * from "./page/definition";
|
|
11
12
|
export * from "./page/interface";
|
package/index.js
CHANGED
|
@@ -22,6 +22,7 @@ __exportStar(require("./collection/interface"), exports);
|
|
|
22
22
|
__exportStar(require("./collection/least-common-identifier"), exports);
|
|
23
23
|
__exportStar(require("./definition/listable"), exports);
|
|
24
24
|
__exportStar(require("./definition/promise"), exports);
|
|
25
|
+
__exportStar(require("./origin/definition"), exports);
|
|
25
26
|
__exportStar(require("./origin/interface"), exports);
|
|
26
27
|
__exportStar(require("./page/definition"), exports);
|
|
27
28
|
__exportStar(require("./page/interface"), exports);
|
package/package.json
CHANGED
package/script/interface.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { MarkedResult } from "@sudoo/marked";
|
|
7
7
|
import { PromiseOr } from "../definition/promise";
|
|
8
|
-
import { SandboxExecuteConfig } from "../sandbox/definition/config";
|
|
8
|
+
import { SandboxExecuteConfig, SandboxExecuteParameter } from "../sandbox/definition/config";
|
|
9
9
|
export interface IImbricateScript {
|
|
10
10
|
readonly scriptName: string;
|
|
11
11
|
readonly identifier: string;
|
|
@@ -14,5 +14,5 @@ export interface IImbricateScript {
|
|
|
14
14
|
readScript(): PromiseOr<string>;
|
|
15
15
|
writeScript(script: string): PromiseOr<void>;
|
|
16
16
|
refreshUpdatedAt(updatedAt: Date): PromiseOr<void>;
|
|
17
|
-
execute(config: SandboxExecuteConfig): PromiseOr<MarkedResult>;
|
|
17
|
+
execute(config: SandboxExecuteConfig, parameter: SandboxExecuteParameter): PromiseOr<MarkedResult>;
|
|
18
18
|
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @author WMXPY
|
|
3
|
-
* @namespace Collection
|
|
4
|
-
* @description Definition
|
|
5
|
-
*/
|
|
6
|
-
export declare enum IMBRICATE_COLLECTION_EVENT_TYPE {
|
|
7
|
-
PAGE_CREATED = "PAGE_CREATED"
|
|
8
|
-
}
|
|
9
|
-
export declare enum IMBRICATE_COLLECTION_TRIGGER_TYPE {
|
|
10
|
-
SCRIPT = "SCRIPT"
|
|
11
|
-
}
|
|
12
|
-
export type ImbricateCollectionEventScriptPayload = {
|
|
13
|
-
readonly scriptIdentifier: string;
|
|
14
|
-
readonly fixedParameters: Record<string, any>;
|
|
15
|
-
};
|
|
16
|
-
export type ImbricateCollectionEventPayload<T extends IMBRICATE_COLLECTION_TRIGGER_TYPE> = T extends IMBRICATE_COLLECTION_TRIGGER_TYPE.SCRIPT ? ImbricateCollectionEventScriptPayload : never;
|
|
17
|
-
export type ImbricateCollectionEvent<T extends IMBRICATE_COLLECTION_TRIGGER_TYPE> = {
|
|
18
|
-
readonly eventType: IMBRICATE_COLLECTION_EVENT_TYPE;
|
|
19
|
-
readonly triggerType: T;
|
|
20
|
-
readonly payload: ImbricateCollectionEventPayload<T>;
|
|
21
|
-
};
|
package/collection/definition.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* @author WMXPY
|
|
4
|
-
* @namespace Collection
|
|
5
|
-
* @description Definition
|
|
6
|
-
*/
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.IMBRICATE_COLLECTION_TRIGGER_TYPE = exports.IMBRICATE_COLLECTION_EVENT_TYPE = void 0;
|
|
9
|
-
var IMBRICATE_COLLECTION_EVENT_TYPE;
|
|
10
|
-
(function (IMBRICATE_COLLECTION_EVENT_TYPE) {
|
|
11
|
-
IMBRICATE_COLLECTION_EVENT_TYPE["PAGE_CREATED"] = "PAGE_CREATED";
|
|
12
|
-
})(IMBRICATE_COLLECTION_EVENT_TYPE || (exports.IMBRICATE_COLLECTION_EVENT_TYPE = IMBRICATE_COLLECTION_EVENT_TYPE = {}));
|
|
13
|
-
var IMBRICATE_COLLECTION_TRIGGER_TYPE;
|
|
14
|
-
(function (IMBRICATE_COLLECTION_TRIGGER_TYPE) {
|
|
15
|
-
IMBRICATE_COLLECTION_TRIGGER_TYPE["SCRIPT"] = "SCRIPT";
|
|
16
|
-
})(IMBRICATE_COLLECTION_TRIGGER_TYPE || (exports.IMBRICATE_COLLECTION_TRIGGER_TYPE = IMBRICATE_COLLECTION_TRIGGER_TYPE = {}));
|