@imbricate/core 3.8.0 → 3.8.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/{src/author/definition.ts → author/definition.d.ts} +0 -4
- package/author/definition.js +7 -0
- package/{src/database/definition.ts → database/definition.d.ts} +15 -51
- package/database/definition.js +31 -0
- package/{src/database/interface.ts → database/interface.d.ts} +27 -69
- package/database/interface.js +7 -0
- package/{src/database/manager.ts → database/manager.d.ts} +9 -24
- package/database/manager.js +7 -0
- package/database/schema.d.ts +70 -0
- package/database/schema.js +78 -0
- package/database/validate.d.ts +15 -0
- package/database/validate.js +73 -0
- package/{src/document/definition.ts → document/definition.d.ts} +3 -31
- package/document/definition.js +17 -0
- package/{src/document/interface.ts → document/interface.d.ts} +15 -44
- package/document/interface.js +7 -0
- package/document/property/default-value.d.ts +7 -0
- package/document/property/default-value.js +25 -0
- package/{src/document/property/definition.ts → document/property/definition.d.ts} +1 -6
- package/document/property/definition.js +7 -0
- package/document/property/primary.d.ts +8 -0
- package/document/property/primary.js +20 -0
- package/document/property/triage-base.d.ts +31 -0
- package/document/property/triage-base.js +85 -0
- package/document/property/triage-manager.d.ts +30 -0
- package/document/property/triage-manager.js +50 -0
- package/document/property/triage.d.ts +8 -0
- package/document/property/triage.js +13 -0
- package/{src/document/property.ts → document/property.d.ts} +4 -23
- package/document/property.js +54 -0
- package/document/validate.d.ts +18 -0
- package/{src/document/validate.ts → document/validate.js} +21 -33
- package/{src/index.ts → index.d.ts} +0 -2
- package/index.js +47 -0
- package/{src/loader/definition.ts → loader/definition.d.ts} +1 -5
- package/loader/definition.js +7 -0
- package/loader/origin-loader.d.ts +29 -0
- package/loader/origin-loader.js +104 -0
- package/{src/loader/persistence.ts → loader/persistence.d.ts} +3 -12
- package/loader/persistence.js +19 -0
- package/{src/origin/definition.ts → origin/definition.d.ts} +0 -1
- package/origin/definition.js +7 -0
- package/{src/origin/interface.ts → origin/interface.d.ts} +7 -18
- package/origin/interface.js +7 -0
- package/{src/origin/search.ts → origin/search.d.ts} +13 -29
- package/origin/search.js +14 -0
- package/package.json +3 -27
- package/{src/static/definition.ts → static/definition.d.ts} +0 -3
- package/static/definition.js +7 -0
- package/{src/static/interface.ts → static/interface.d.ts} +1 -6
- package/static/interface.js +7 -0
- package/{src/static/manager.ts → static/manager.d.ts} +4 -11
- package/static/manager.js +7 -0
- package/{src/text/definition.ts → text/definition.d.ts} +0 -3
- package/text/definition.js +7 -0
- package/{src/text/interface.ts → text/interface.d.ts} +1 -6
- package/text/interface.js +7 -0
- package/{src/text/manager.ts → text/manager.d.ts} +4 -11
- package/text/manager.js +7 -0
- package/.editorconfig +0 -10
- package/.gitattributes +0 -4
- package/.github/dependabot.yml +0 -8
- package/.github/workflows/ci.yml +0 -48
- package/.vscode/settings.json +0 -8
- package/.yarn/releases/yarn-4.4.0.cjs +0 -925
- package/.yarnrc.yml +0 -3
- package/babel.config.js +0 -14
- package/docs/README.md +0 -70
- package/eslint.config.mjs +0 -64
- package/jest.config.ts +0 -14
- package/src/database/schema.ts +0 -165
- package/src/database/validate.ts +0 -77
- package/src/document/property/default-value.ts +0 -26
- package/src/document/property/primary.ts +0 -29
- package/src/document/property/triage-base.ts +0 -138
- package/src/document/property/triage-manager.ts +0 -68
- package/src/document/property/triage.ts +0 -15
- package/src/loader/origin-loader.ts +0 -88
- package/test/unit/database/schema.test.ts +0 -95
- package/test/unit/document/property/primary.test.ts +0 -87
- package/test/unit/document/property/triage.test.ts +0 -64
- package/test/unit/document/validate.test.ts +0 -138
- package/test/unit/loader/definition.test.ts +0 -55
- package/typescript/tsconfig.build.json +0 -23
|
@@ -3,48 +3,34 @@
|
|
|
3
3
|
* @namespace Origin
|
|
4
4
|
* @description Search
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
|
-
export enum IMBRICATE_SEARCH_TARGET_TYPE {
|
|
8
|
-
|
|
6
|
+
export declare enum IMBRICATE_SEARCH_TARGET_TYPE {
|
|
9
7
|
DATABASE = "DATABASE",
|
|
10
8
|
DOCUMENT = "DOCUMENT",
|
|
11
|
-
MARKDOWN = "MARKDOWN"
|
|
9
|
+
MARKDOWN = "MARKDOWN"
|
|
12
10
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
documentUniqueIdentifier: string;
|
|
25
|
-
propertyUniqueIdentifier: string;
|
|
26
|
-
lineNumber: number;
|
|
27
|
-
} :
|
|
28
|
-
never;
|
|
29
|
-
|
|
11
|
+
export type ImbricateSearchTargetSwitch<T extends IMBRICATE_SEARCH_TARGET_TYPE> = T extends IMBRICATE_SEARCH_TARGET_TYPE.DATABASE ? {
|
|
12
|
+
databaseUniqueIdentifier: string;
|
|
13
|
+
} : T extends IMBRICATE_SEARCH_TARGET_TYPE.DOCUMENT ? {
|
|
14
|
+
databaseUniqueIdentifier: string;
|
|
15
|
+
documentUniqueIdentifier: string;
|
|
16
|
+
} : T extends IMBRICATE_SEARCH_TARGET_TYPE.MARKDOWN ? {
|
|
17
|
+
databaseUniqueIdentifier: string;
|
|
18
|
+
documentUniqueIdentifier: string;
|
|
19
|
+
propertyUniqueIdentifier: string;
|
|
20
|
+
lineNumber: number;
|
|
21
|
+
} : never;
|
|
30
22
|
export type ImbricateSearchTarget<T extends IMBRICATE_SEARCH_TARGET_TYPE> = {
|
|
31
|
-
|
|
32
23
|
readonly type: T;
|
|
33
24
|
readonly target: ImbricateSearchTargetSwitch<T>;
|
|
34
25
|
};
|
|
35
|
-
|
|
36
26
|
export type ImbricateSearchItem = {
|
|
37
|
-
|
|
38
27
|
readonly target: ImbricateSearchTarget<IMBRICATE_SEARCH_TARGET_TYPE>;
|
|
39
|
-
|
|
40
28
|
readonly primary: string;
|
|
41
|
-
|
|
42
29
|
/**
|
|
43
30
|
* @description Source are optional, use for source context
|
|
44
31
|
*/
|
|
45
32
|
readonly sourceDatabaseName?: string;
|
|
46
33
|
readonly sourceDocumentPrimaryKey?: string;
|
|
47
|
-
|
|
48
34
|
/**
|
|
49
35
|
* @description Previous are optional, use for previous context on the secondary object
|
|
50
36
|
*/
|
|
@@ -55,8 +41,6 @@ export type ImbricateSearchItem = {
|
|
|
55
41
|
*/
|
|
56
42
|
readonly secondaryNext?: string[];
|
|
57
43
|
};
|
|
58
|
-
|
|
59
44
|
export type ImbricateSearchResult = {
|
|
60
|
-
|
|
61
45
|
readonly items: ImbricateSearchItem[];
|
|
62
46
|
};
|
package/origin/search.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @author WMXPY
|
|
4
|
+
* @namespace Origin
|
|
5
|
+
* @description Search
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
exports.IMBRICATE_SEARCH_TARGET_TYPE = void 0;
|
|
9
|
+
var IMBRICATE_SEARCH_TARGET_TYPE;
|
|
10
|
+
(function (IMBRICATE_SEARCH_TARGET_TYPE) {
|
|
11
|
+
IMBRICATE_SEARCH_TARGET_TYPE["DATABASE"] = "DATABASE";
|
|
12
|
+
IMBRICATE_SEARCH_TARGET_TYPE["DOCUMENT"] = "DOCUMENT";
|
|
13
|
+
IMBRICATE_SEARCH_TARGET_TYPE["MARKDOWN"] = "MARKDOWN";
|
|
14
|
+
})(IMBRICATE_SEARCH_TARGET_TYPE || (exports.IMBRICATE_SEARCH_TARGET_TYPE = IMBRICATE_SEARCH_TARGET_TYPE = {}));
|
package/package.json
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imbricate/core",
|
|
3
|
-
"
|
|
4
|
-
"version": "3.8.
|
|
3
|
+
"main": "index.js",
|
|
4
|
+
"version": "3.8.2",
|
|
5
5
|
"description": "Imbricate Core, Notebook for Engineers",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"clean": "rm -rf app",
|
|
8
|
-
"test": "jest",
|
|
9
|
-
"coverage": "jest --coverage",
|
|
10
|
-
"lint": "eslint src",
|
|
11
|
-
"build": "tsc --project typescript/tsconfig.build.json",
|
|
12
|
-
"license": "sdb license",
|
|
13
|
-
"release": "yarn lint && yarn test && yarn license && yarn build",
|
|
14
|
-
"publish-dry-run": "yarn release && sdb --only publish-dry-run",
|
|
15
|
-
"publish": "yarn release && sdb --only publish"
|
|
16
|
-
},
|
|
17
6
|
"repository": {
|
|
18
7
|
"type": "git",
|
|
19
8
|
"url": "git+https://github.com/Imbricate/Imbricate.git"
|
|
@@ -28,18 +17,5 @@
|
|
|
28
17
|
"bugs": {
|
|
29
18
|
"url": "https://github.com/Imbricate/Imbricate/issues"
|
|
30
19
|
},
|
|
31
|
-
"homepage": "https://imbricate.io"
|
|
32
|
-
"devDependencies": {
|
|
33
|
-
"@babel/core": "^7.26.0",
|
|
34
|
-
"@babel/preset-env": "^7.26.0",
|
|
35
|
-
"@babel/preset-typescript": "^7.26.0",
|
|
36
|
-
"@types/jest": "^29.5.14",
|
|
37
|
-
"@typescript-eslint/eslint-plugin": "^8.16.0",
|
|
38
|
-
"@typescript-eslint/parser": "^8.16.0",
|
|
39
|
-
"babel-jest": "^29.7.0",
|
|
40
|
-
"eslint": "^9.15.0",
|
|
41
|
-
"jest": "^29.7.0",
|
|
42
|
-
"ts-node": "^10.9.2",
|
|
43
|
-
"typescript": "^5.7.2"
|
|
44
|
-
}
|
|
20
|
+
"homepage": "https://imbricate.io"
|
|
45
21
|
}
|
|
@@ -3,24 +3,19 @@
|
|
|
3
3
|
* @namespace Static
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
import { ImbricateAuthor } from "../author/definition";
|
|
8
|
-
|
|
9
7
|
export interface IImbricateStatic {
|
|
10
|
-
|
|
11
8
|
/**
|
|
12
9
|
* Unique identifier of the static object
|
|
13
10
|
*/
|
|
14
11
|
readonly uniqueIdentifier: string;
|
|
15
|
-
|
|
16
12
|
/**
|
|
17
13
|
* Author of the text object
|
|
18
14
|
*/
|
|
19
15
|
readonly author?: ImbricateAuthor;
|
|
20
|
-
|
|
21
16
|
/**
|
|
22
17
|
* Get the content of the static object
|
|
23
|
-
*
|
|
18
|
+
*
|
|
24
19
|
* @returns a promise of the content of the text, encoded in base64
|
|
25
20
|
*/
|
|
26
21
|
getContentInBase64(): PromiseLike<string>;
|
|
@@ -3,31 +3,24 @@
|
|
|
3
3
|
* @namespace Static
|
|
4
4
|
* @description Manager
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
import { ImbricateStaticAuditOptions } from "./definition";
|
|
8
7
|
import { IImbricateStatic } from "./interface";
|
|
9
|
-
|
|
10
8
|
export interface IImbricateStaticManager {
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Get the static object from the origin
|
|
14
|
-
*
|
|
11
|
+
*
|
|
15
12
|
* @returns a promise of the static object, null if not found
|
|
16
13
|
*/
|
|
17
14
|
getStatic(uniqueIdentifier: string): PromiseLike<IImbricateStatic | null>;
|
|
18
|
-
|
|
19
15
|
/**
|
|
20
16
|
* Create a new static object in the origin, encoded in base64
|
|
21
17
|
* Static object is immutable, once created, it cannot be changed
|
|
22
18
|
* Patch a new static object if you want to change the content
|
|
23
|
-
*
|
|
19
|
+
*
|
|
24
20
|
* @param content content of the static object, encoded in base64
|
|
25
21
|
* @param auditOptions audit options of the static object
|
|
26
|
-
*
|
|
22
|
+
*
|
|
27
23
|
* @returns a promise of the created static object
|
|
28
24
|
*/
|
|
29
|
-
createInBase64(
|
|
30
|
-
content: string,
|
|
31
|
-
auditOptions?: ImbricateStaticAuditOptions,
|
|
32
|
-
): PromiseLike<IImbricateStatic>;
|
|
25
|
+
createInBase64(content: string, auditOptions?: ImbricateStaticAuditOptions): PromiseLike<IImbricateStatic>;
|
|
33
26
|
}
|
|
@@ -3,24 +3,19 @@
|
|
|
3
3
|
* @namespace Text
|
|
4
4
|
* @description Interface
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
import { ImbricateAuthor } from "../author/definition";
|
|
8
|
-
|
|
9
7
|
export interface IImbricateText {
|
|
10
|
-
|
|
11
8
|
/**
|
|
12
9
|
* Unique identifier of the text object
|
|
13
10
|
*/
|
|
14
11
|
readonly uniqueIdentifier: string;
|
|
15
|
-
|
|
16
12
|
/**
|
|
17
13
|
* Author of the text object
|
|
18
14
|
*/
|
|
19
15
|
readonly author?: ImbricateAuthor;
|
|
20
|
-
|
|
21
16
|
/**
|
|
22
17
|
* Get the content of the text object
|
|
23
|
-
*
|
|
18
|
+
*
|
|
24
19
|
* @returns a promise of the content of the text object
|
|
25
20
|
*/
|
|
26
21
|
getContent(): PromiseLike<string>;
|
|
@@ -3,31 +3,24 @@
|
|
|
3
3
|
* @namespace Text
|
|
4
4
|
* @description Manager
|
|
5
5
|
*/
|
|
6
|
-
|
|
7
6
|
import { ImbricateTextAuditOptions } from "./definition";
|
|
8
7
|
import { IImbricateText } from "./interface";
|
|
9
|
-
|
|
10
8
|
export interface IImbricateTextManager {
|
|
11
|
-
|
|
12
9
|
/**
|
|
13
10
|
* Get the text object from the origin
|
|
14
|
-
*
|
|
11
|
+
*
|
|
15
12
|
* @returns a promise of the text object, null if not found
|
|
16
13
|
*/
|
|
17
14
|
getText(uniqueIdentifier: string): PromiseLike<IImbricateText | null>;
|
|
18
|
-
|
|
19
15
|
/**
|
|
20
16
|
* Create a new text object in the origin
|
|
21
17
|
* Text object is immutable, once created, it cannot be changed
|
|
22
18
|
* Patch a new text object if you want to change the content
|
|
23
|
-
*
|
|
19
|
+
*
|
|
24
20
|
* @param content content of the text
|
|
25
21
|
* @param auditOptions audit options of the text
|
|
26
|
-
*
|
|
22
|
+
*
|
|
27
23
|
* @returns a promise of the text object
|
|
28
24
|
*/
|
|
29
|
-
createText(
|
|
30
|
-
content: string,
|
|
31
|
-
auditOptions?: ImbricateTextAuditOptions,
|
|
32
|
-
): PromiseLike<IImbricateText>;
|
|
25
|
+
createText(content: string, auditOptions?: ImbricateTextAuditOptions): PromiseLike<IImbricateText>;
|
|
33
26
|
}
|
package/text/manager.js
ADDED
package/.editorconfig
DELETED
package/.gitattributes
DELETED
package/.github/dependabot.yml
DELETED
package/.github/workflows/ci.yml
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
name: Continuous Integration
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
pull_request:
|
|
8
|
-
branches:
|
|
9
|
-
- main
|
|
10
|
-
|
|
11
|
-
jobs:
|
|
12
|
-
build:
|
|
13
|
-
runs-on: ${{ matrix.os }}
|
|
14
|
-
strategy:
|
|
15
|
-
matrix:
|
|
16
|
-
os:
|
|
17
|
-
- ubuntu-latest
|
|
18
|
-
- windows-latest
|
|
19
|
-
- macos-latest
|
|
20
|
-
node-version:
|
|
21
|
-
- 18
|
|
22
|
-
- 20
|
|
23
|
-
architecture:
|
|
24
|
-
- x64
|
|
25
|
-
steps:
|
|
26
|
-
- uses: actions/checkout@v4
|
|
27
|
-
- name: Use Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
|
|
28
|
-
uses: actions/setup-node@v4
|
|
29
|
-
with:
|
|
30
|
-
node-version: ${{ matrix.node-version }}
|
|
31
|
-
architecture: ${{ matrix.architecture }}
|
|
32
|
-
cache: yarn
|
|
33
|
-
- name: Install Dependencies
|
|
34
|
-
run: |
|
|
35
|
-
yarn
|
|
36
|
-
- name: Lint
|
|
37
|
-
run: |
|
|
38
|
-
yarn lint
|
|
39
|
-
- name: Build
|
|
40
|
-
run: |
|
|
41
|
-
yarn build
|
|
42
|
-
- name: Test
|
|
43
|
-
run: |
|
|
44
|
-
yarn coverage
|
|
45
|
-
- name: Codecov
|
|
46
|
-
uses: codecov/codecov-action@v4
|
|
47
|
-
with:
|
|
48
|
-
token: ${{ secrets.CODECOV_TOKEN }}
|