@imbricate/core 1.0.2 → 1.2.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.
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Origin_Collection
4
+ * @description Interface
5
+ */
6
+ import { PromiseOr } from "../definition/promise";
7
+ import { ImbricatePageSnapshot } from "../page/definition";
8
+ import { IMBRICATE_SEARCH_SNIPPET_TYPE, ImbricateSearchSnippet } from "../search/snippet";
9
+ export type ImbricatePageSearchSnippet = ImbricateSearchSnippet<IMBRICATE_SEARCH_SNIPPET_TYPE.PAGE>;
10
+ export interface IImbricateOriginCollection {
11
+ readonly collectionName: string;
12
+ readonly description?: string;
13
+ findScripts(...onActivities: string[]): PromiseOr<void>;
14
+ listPages(): PromiseOr<ImbricatePageSnapshot[]>;
15
+ createPage(title: string, initialContent?: string): PromiseOr<ImbricatePageSnapshot>;
16
+ deletePage(identifier: string, title: string): PromiseOr<void>;
17
+ hasPage(title: string): PromiseOr<boolean>;
18
+ readPage(identifier: string): PromiseOr<string | null>;
19
+ writePage(identifier: string, content: string): PromiseOr<void>;
20
+ searchPages(keyword: string): PromiseOr<ImbricatePageSearchSnippet[]>;
21
+ }
package/index.d.ts CHANGED
@@ -2,17 +2,18 @@
2
2
  * @author WMXPY
3
3
  * @description Index
4
4
  */
5
+ export * from "./collection/interface";
6
+ export * from "./collection/least-common-identifier";
5
7
  export * from "./definition/listable";
6
8
  export * from "./definition/promise";
7
- export * from "./definition/script";
8
- export * from "./origin/collection/interface";
9
- export * from "./origin/collection/least-common-identifier";
10
9
  export * from "./origin/interface";
10
+ export * from "./page/definition";
11
11
  export * from "./sandbox/definition/config";
12
12
  export * from "./sandbox/definition/environment";
13
13
  export * from "./sandbox/definition/implementation";
14
14
  export * from "./sandbox/feature/builder";
15
15
  export * from "./sandbox/feature/feature";
16
16
  export * from "./sandbox/sandbox";
17
+ export * from "./script/definition";
17
18
  export * from "./search/prefix";
18
19
  export * from "./search/snippet";
package/index.js CHANGED
@@ -18,17 +18,18 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
18
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
19
  };
20
20
  Object.defineProperty(exports, "__esModule", { value: true });
21
+ __exportStar(require("./collection/interface"), exports);
22
+ __exportStar(require("./collection/least-common-identifier"), exports);
21
23
  __exportStar(require("./definition/listable"), exports);
22
24
  __exportStar(require("./definition/promise"), exports);
23
- __exportStar(require("./definition/script"), exports);
24
- __exportStar(require("./origin/collection/interface"), exports);
25
- __exportStar(require("./origin/collection/least-common-identifier"), exports);
26
25
  __exportStar(require("./origin/interface"), exports);
26
+ __exportStar(require("./page/definition"), exports);
27
27
  __exportStar(require("./sandbox/definition/config"), exports);
28
28
  __exportStar(require("./sandbox/definition/environment"), exports);
29
29
  __exportStar(require("./sandbox/definition/implementation"), exports);
30
30
  __exportStar(require("./sandbox/feature/builder"), exports);
31
31
  __exportStar(require("./sandbox/feature/feature"), exports);
32
32
  __exportStar(require("./sandbox/sandbox"), exports);
33
+ __exportStar(require("./script/definition"), exports);
33
34
  __exportStar(require("./search/prefix"), exports);
34
35
  __exportStar(require("./search/snippet"), exports);
@@ -4,10 +4,10 @@
4
4
  * @description Interface
5
5
  */
6
6
  import { MarkedResult } from "@sudoo/marked";
7
+ import { IImbricateOriginCollection } from "../collection/interface";
7
8
  import { PromiseOr } from "../definition/promise";
8
- import { ImbricateScriptMetadata } from "../definition/script";
9
9
  import { SandboxExecuteConfig } from "../sandbox/definition/config";
10
- import { IImbricateOriginCollection } from "./collection/interface";
10
+ import { ImbricateScriptSnapshot } from "../script/definition";
11
11
  export type ImbricateOriginMetadata = {
12
12
  readonly type: string;
13
13
  };
@@ -19,11 +19,11 @@ export interface IImbricateOrigin {
19
19
  getCollection(collectionName: string): PromiseOr<IImbricateOriginCollection | null>;
20
20
  listCollections(): PromiseOr<IImbricateOriginCollection[]>;
21
21
  removeCollection(): PromiseOr<void>;
22
- createScript(scriptName: string, description?: string): PromiseOr<ImbricateScriptMetadata>;
22
+ createScript(scriptName: string, description?: string): PromiseOr<ImbricateScriptSnapshot>;
23
+ deleteScript(identifier: string, scriptName: string): PromiseOr<void>;
23
24
  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>;
25
+ readScript(identifier: string): PromiseOr<string | null>;
26
+ writeScript(identifier: string, content: string): PromiseOr<string>;
27
+ listScripts(): PromiseOr<ImbricateScriptSnapshot[]>;
28
+ executeScript(identifier: string, config: SandboxExecuteConfig): PromiseOr<MarkedResult | null>;
29
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.2",
4
+ "version": "1.2.0",
5
5
  "description": "Core for Imbricate",
6
6
  "repository": {
7
7
  "type": "git",
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Origin_Page
4
+ * @description Definition
5
+ */
6
+ export type ImbricatePageSnapshot = {
7
+ readonly title: string;
8
+ readonly identifier: string;
9
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Origin_Page
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * @author WMXPY
3
- * @namespace Definition
4
- * @description Script
3
+ * @namespace Script
4
+ * @description Definition
5
5
  */
6
- export type ImbricateScriptMetadata = {
6
+ export type ImbricateScriptSnapshot = {
7
7
  readonly scriptName: string;
8
8
  readonly identifier: string;
9
9
  };
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @author WMXPY
4
- * @namespace Definition
5
- * @description Script
4
+ * @namespace Script
5
+ * @description Definition
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,22 +0,0 @@
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
- }
File without changes