@imbricate/core 1.14.4 → 1.15.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.
@@ -10,13 +10,13 @@ import { ImbricatePageQuery, ImbricatePageQueryConfig, ImbricateSearchPageConfig
10
10
  export interface IImbricateOriginCollection {
11
11
  readonly collectionName: string;
12
12
  readonly description?: string;
13
- createPage(directories: string[], title: string, initialContent?: string): PromiseOr<IImbricatePage>;
13
+ createPage(directories: string[], title: string, initialContent: string): PromiseOr<IImbricatePage>;
14
14
  putPage(pageMetadata: ImbricatePageMetadata, content: string): PromiseOr<IImbricatePage>;
15
15
  retitlePage(identifier: string, newTitle: string): PromiseOr<void>;
16
16
  deletePage(identifier: string): PromiseOr<void>;
17
17
  hasPage(directories: string[], title: string): PromiseOr<boolean>;
18
18
  getPage(identifier: string): PromiseOr<IImbricatePage | null>;
19
- listPages(directories: string[]): PromiseOr<ImbricatePageSnapshot[]>;
19
+ listPages(directories: string[], recursive: boolean): PromiseOr<ImbricatePageSnapshot[]>;
20
20
  listDirectories(directories: string[]): PromiseOr<string[]>;
21
21
  searchPages(keyword: string, config: ImbricateSearchPageConfig): PromiseOr<ImbricatePageSearchResult[]>;
22
22
  queryPages(query: ImbricatePageQuery, config: ImbricatePageQueryConfig): PromiseOr<IImbricatePage[]>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Function
4
+ * @description Definition
5
+ */
6
+ import { PromiseOr } from "../definition/promise";
7
+ export type ImbricateFunction<Target> = {
8
+ readonly title: string;
9
+ readonly description?: string;
10
+ readonly execute: ImbricateFunctionExecute<Target>;
11
+ };
12
+ export type ImbricateFunctionExecute<Target> = (target: Target) => PromiseOr<void>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Function
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @author WMXPY
3
+ * @namespace Function
4
+ * @description Interface
5
+ */
6
+ import { PromiseOr } from "../definition/promise";
7
+ import { IImbricateOrigin } from "../origin/interface";
8
+ import { ImbricateFunction } from "./definition";
9
+ export interface IImbricateFunctionManager {
10
+ findSynchronousOriginFunctions(): Array<ImbricateFunction<IImbricateOrigin>>;
11
+ findAllOriginFunctions(): PromiseOr<Array<ImbricateFunction<IImbricateOrigin>>>;
12
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Function
5
+ * @description Interface
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.d.ts CHANGED
@@ -6,6 +6,8 @@ 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 "./function/definition";
10
+ export * from "./function/interface";
9
11
  export * from "./origin/definition";
10
12
  export * from "./origin/interface";
11
13
  export * from "./page/definition";
package/index.js CHANGED
@@ -22,6 +22,8 @@ __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("./function/definition"), exports);
26
+ __exportStar(require("./function/interface"), exports);
25
27
  __exportStar(require("./origin/definition"), exports);
26
28
  __exportStar(require("./origin/interface"), exports);
27
29
  __exportStar(require("./page/definition"), exports);
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import { IImbricateOriginCollection } from "../collection/interface";
7
7
  import { PromiseOr } from "../definition/promise";
8
+ import { IImbricateFunctionManager } from "../function/interface";
8
9
  import { ImbricateScriptQuery, ImbricateScriptQueryConfig, ImbricateSearchScriptConfig } from "../query/script";
9
10
  import { ImbricateScriptMetadata, ImbricateScriptSearchResult, ImbricateScriptSnapshot } from "../script/definition";
10
11
  import { IImbricateScript } from "../script/interface";
@@ -12,6 +13,7 @@ import { ImbricateOriginMetadata } from "./definition";
12
13
  export interface IImbricateOrigin {
13
14
  readonly metadata: ImbricateOriginMetadata;
14
15
  readonly payloads: Record<string, any>;
16
+ getFunctionManger(): IImbricateFunctionManager;
15
17
  createCollection(collectionName: string, description?: string, initialScript?: string): PromiseOr<void>;
16
18
  renameCollection(collectionName: string, newCollectionName: string): PromiseOr<void>;
17
19
  deleteCollection(collectionName: string): PromiseOr<void>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imbricate/core",
3
3
  "main": "index.js",
4
- "version": "1.14.4",
4
+ "version": "1.15.0",
5
5
  "description": "Core for Imbricate",
6
6
  "repository": {
7
7
  "type": "git",