@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.
Files changed (84) hide show
  1. package/{src/author/definition.ts → author/definition.d.ts} +0 -4
  2. package/author/definition.js +7 -0
  3. package/{src/database/definition.ts → database/definition.d.ts} +15 -51
  4. package/database/definition.js +31 -0
  5. package/{src/database/interface.ts → database/interface.d.ts} +27 -69
  6. package/database/interface.js +7 -0
  7. package/{src/database/manager.ts → database/manager.d.ts} +9 -24
  8. package/database/manager.js +7 -0
  9. package/database/schema.d.ts +70 -0
  10. package/database/schema.js +78 -0
  11. package/database/validate.d.ts +15 -0
  12. package/database/validate.js +73 -0
  13. package/{src/document/definition.ts → document/definition.d.ts} +3 -31
  14. package/document/definition.js +17 -0
  15. package/{src/document/interface.ts → document/interface.d.ts} +15 -44
  16. package/document/interface.js +7 -0
  17. package/document/property/default-value.d.ts +7 -0
  18. package/document/property/default-value.js +25 -0
  19. package/{src/document/property/definition.ts → document/property/definition.d.ts} +1 -6
  20. package/document/property/definition.js +7 -0
  21. package/document/property/primary.d.ts +8 -0
  22. package/document/property/primary.js +20 -0
  23. package/document/property/triage-base.d.ts +31 -0
  24. package/document/property/triage-base.js +85 -0
  25. package/document/property/triage-manager.d.ts +30 -0
  26. package/document/property/triage-manager.js +50 -0
  27. package/document/property/triage.d.ts +8 -0
  28. package/document/property/triage.js +13 -0
  29. package/{src/document/property.ts → document/property.d.ts} +4 -23
  30. package/document/property.js +54 -0
  31. package/document/validate.d.ts +18 -0
  32. package/{src/document/validate.ts → document/validate.js} +21 -33
  33. package/{src/index.ts → index.d.ts} +0 -2
  34. package/index.js +47 -0
  35. package/{src/loader/definition.ts → loader/definition.d.ts} +1 -5
  36. package/loader/definition.js +7 -0
  37. package/loader/origin-loader.d.ts +29 -0
  38. package/loader/origin-loader.js +104 -0
  39. package/{src/loader/persistence.ts → loader/persistence.d.ts} +3 -12
  40. package/loader/persistence.js +19 -0
  41. package/{src/origin/definition.ts → origin/definition.d.ts} +0 -1
  42. package/origin/definition.js +7 -0
  43. package/{src/origin/interface.ts → origin/interface.d.ts} +7 -18
  44. package/origin/interface.js +7 -0
  45. package/{src/origin/search.ts → origin/search.d.ts} +13 -29
  46. package/origin/search.js +14 -0
  47. package/package.json +3 -27
  48. package/{src/static/definition.ts → static/definition.d.ts} +0 -3
  49. package/static/definition.js +7 -0
  50. package/{src/static/interface.ts → static/interface.d.ts} +1 -6
  51. package/static/interface.js +7 -0
  52. package/{src/static/manager.ts → static/manager.d.ts} +4 -11
  53. package/static/manager.js +7 -0
  54. package/{src/text/definition.ts → text/definition.d.ts} +0 -3
  55. package/text/definition.js +7 -0
  56. package/{src/text/interface.ts → text/interface.d.ts} +1 -6
  57. package/text/interface.js +7 -0
  58. package/{src/text/manager.ts → text/manager.d.ts} +4 -11
  59. package/text/manager.js +7 -0
  60. package/.editorconfig +0 -10
  61. package/.gitattributes +0 -4
  62. package/.github/dependabot.yml +0 -8
  63. package/.github/workflows/ci.yml +0 -48
  64. package/.vscode/settings.json +0 -8
  65. package/.yarn/releases/yarn-4.4.0.cjs +0 -925
  66. package/.yarnrc.yml +0 -3
  67. package/babel.config.js +0 -14
  68. package/docs/README.md +0 -70
  69. package/eslint.config.mjs +0 -64
  70. package/jest.config.ts +0 -14
  71. package/src/database/schema.ts +0 -165
  72. package/src/database/validate.ts +0 -77
  73. package/src/document/property/default-value.ts +0 -26
  74. package/src/document/property/primary.ts +0 -29
  75. package/src/document/property/triage-base.ts +0 -138
  76. package/src/document/property/triage-manager.ts +0 -68
  77. package/src/document/property/triage.ts +0 -15
  78. package/src/loader/origin-loader.ts +0 -88
  79. package/test/unit/database/schema.test.ts +0 -95
  80. package/test/unit/document/property/primary.test.ts +0 -87
  81. package/test/unit/document/property/triage.test.ts +0 -64
  82. package/test/unit/document/validate.test.ts +0 -138
  83. package/test/unit/loader/definition.test.ts +0 -55
  84. 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
- export type ImbricateSearchTargetSwitch<T extends IMBRICATE_SEARCH_TARGET_TYPE> =
15
- T extends IMBRICATE_SEARCH_TARGET_TYPE.DATABASE ? {
16
- databaseUniqueIdentifier: string;
17
- } :
18
- T extends IMBRICATE_SEARCH_TARGET_TYPE.DOCUMENT ? {
19
- databaseUniqueIdentifier: string;
20
- documentUniqueIdentifier: string;
21
- } :
22
- T extends IMBRICATE_SEARCH_TARGET_TYPE.MARKDOWN ? {
23
- databaseUniqueIdentifier: string;
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
  };
@@ -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
- "packageManager": "yarn@4.4.0",
4
- "version": "3.8.0",
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,11 +3,8 @@
3
3
  * @namespace Static
4
4
  * @description Definition
5
5
  */
6
-
7
6
  import { ImbricateAuthor } from "../author/definition";
8
-
9
7
  export type ImbricateStaticAuditOptions = {
10
-
11
8
  /**
12
9
  * Static author, this is controlled an function may vary by origin
13
10
  */
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Static
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Static
5
+ * @description Interface
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Static
5
+ * @description Manager
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -3,11 +3,8 @@
3
3
  * @namespace Text
4
4
  * @description Definition
5
5
  */
6
-
7
6
  import { ImbricateAuthor } from "../author/definition";
8
-
9
7
  export type ImbricateTextAuditOptions = {
10
-
11
8
  /**
12
9
  * Text author, this is controlled an function may vary by origin
13
10
  */
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Text
5
+ * @description Definition
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Text
5
+ * @description Interface
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * @author WMXPY
4
+ * @namespace Text
5
+ * @description Manager
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
package/.editorconfig DELETED
@@ -1,10 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- end_of_line = lf
5
- insert_final_newline = true
6
-
7
- [*.{js,json,yml}]
8
- charset = utf-8
9
- indent_style = space
10
- indent_size = 2
package/.gitattributes DELETED
@@ -1,4 +0,0 @@
1
- /.yarn/** linguist-vendored
2
- /.yarn/releases/* binary
3
- /.yarn/plugins/**/* binary
4
- /.pnp.* binary linguist-generated
@@ -1,8 +0,0 @@
1
- version: 2
2
- updates:
3
- - package-ecosystem: npm
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- open-pull-requests-limit: 10
8
- versioning-strategy: increase
@@ -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 }}
@@ -1,8 +0,0 @@
1
- {
2
- "cSpell.words": [
3
- "codecov",
4
- "IMBRISCRIPT",
5
- "sudoo",
6
- "WMXPY"
7
- ]
8
- }