@imbricate/core 1.9.0 → 1.12.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.
@@ -3,4 +3,4 @@
3
3
  * @namespace Definition
4
4
  * @description Promise
5
5
  */
6
- export type PromiseOr<T> = T | Promise<T>;
6
+ export type PromiseOr<T> = T | PromiseLike<T>;
@@ -3,6 +3,12 @@
3
3
  * @namespace Origin
4
4
  * @description Definition
5
5
  */
6
+ export declare enum IMBRICATE_DIGEST_ALGORITHM {
7
+ MD5 = "MD5",
8
+ SHA1 = "SHA1",
9
+ SHA256 = "SHA256"
10
+ }
6
11
  export type ImbricateOriginMetadata = {
7
12
  readonly type: string;
13
+ readonly digestAlgorithm: IMBRICATE_DIGEST_ALGORITHM;
8
14
  };
@@ -5,3 +5,10 @@
5
5
  * @description Definition
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
+ 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 = {}));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imbricate/core",
3
3
  "main": "index.js",
4
- "version": "1.9.0",
4
+ "version": "1.12.0",
5
5
  "description": "Core for Imbricate",
6
6
  "repository": {
7
7
  "type": "git",
@@ -11,8 +11,14 @@ export type ImbricatePageSnapshot = {
11
11
  readonly title: string;
12
12
  readonly identifier: string;
13
13
  };
14
+ export type ImbricatePageHistoryRecord = {
15
+ readonly updatedAt: Date;
16
+ readonly digest: string;
17
+ };
14
18
  export type ImbricatePageMetadata = {
15
19
  readonly createdAt: Date;
16
20
  readonly updatedAt: Date;
21
+ readonly digest: string;
22
+ readonly historyRecords: ImbricatePageHistoryRecord[];
17
23
  readonly description?: string;
18
24
  } & ImbricatePageSnapshot;
@@ -4,10 +4,12 @@
4
4
  * @description Interface
5
5
  */
6
6
  import { PromiseOr } from "../definition/promise";
7
- import { ImbricatePageAttributes } from "./definition";
7
+ import { ImbricatePageAttributes, ImbricatePageHistoryRecord } from "./definition";
8
8
  export interface IImbricatePage {
9
9
  readonly title: string;
10
10
  readonly identifier: string;
11
+ readonly digest: string;
12
+ readonly historyRecords: ImbricatePageHistoryRecord[];
11
13
  readonly description?: string;
12
14
  readonly createdAt: Date;
13
15
  readonly updatedAt: Date;
@@ -16,4 +18,6 @@ export interface IImbricatePage {
16
18
  readAttributes(): PromiseOr<ImbricatePageAttributes>;
17
19
  writeAttribute(key: string, value: string): PromiseOr<void>;
18
20
  refreshUpdatedAt(updatedAt: Date): PromiseOr<void>;
21
+ refreshDigest(digest: string): PromiseOr<void>;
22
+ addHistoryRecord(record: ImbricatePageHistoryRecord): PromiseOr<void>;
19
23
  }
@@ -11,8 +11,14 @@ export type ImbricateScriptSnapshot = {
11
11
  readonly scriptName: string;
12
12
  readonly identifier: string;
13
13
  };
14
+ export type ImbricateScriptHistoryRecord = {
15
+ readonly updatedAt: Date;
16
+ readonly digest: string;
17
+ };
14
18
  export type ImbricateScriptMetadata = {
15
19
  readonly createdAt: Date;
16
20
  readonly updatedAt: Date;
21
+ readonly digest: string;
22
+ readonly historyRecords: ImbricateScriptHistoryRecord[];
17
23
  readonly description?: string;
18
24
  } & ImbricateScriptSnapshot;
@@ -7,10 +7,12 @@ import { MarkedResult } from "@sudoo/marked";
7
7
  import { PromiseOr } from "../definition/promise";
8
8
  import { SandboxExecuteConfig, SandboxExecuteParameter } from "../sandbox/definition/config";
9
9
  import { SandboxFeature } from "../sandbox/feature/feature";
10
- import { ImbricateScriptAttributes } from "./definition";
10
+ import { ImbricateScriptAttributes, ImbricateScriptHistoryRecord } from "./definition";
11
11
  export interface IImbricateScript {
12
12
  readonly scriptName: string;
13
13
  readonly identifier: string;
14
+ readonly digest: string;
15
+ readonly historyRecords: ImbricateScriptHistoryRecord[];
14
16
  readonly description?: string;
15
17
  readonly createdAt: Date;
16
18
  readonly updatedAt: Date;
@@ -19,5 +21,7 @@ export interface IImbricateScript {
19
21
  readAttributes(): PromiseOr<ImbricateScriptAttributes>;
20
22
  writeAttribute(key: string, value: string): PromiseOr<void>;
21
23
  refreshUpdatedAt(updatedAt: Date): PromiseOr<void>;
24
+ refreshDigest(digest: string): PromiseOr<void>;
25
+ addHistoryRecord(record: ImbricateScriptHistoryRecord): PromiseOr<void>;
22
26
  execute(features: SandboxFeature[], config: SandboxExecuteConfig, parameter: SandboxExecuteParameter): PromiseOr<MarkedResult>;
23
27
  }