@luzzle/core 0.0.37 → 0.0.39
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/README.md +9 -36
- package/dist/src/database/migrations/2026-02-11T23:03:45Z-clear-pieces-cache.d.ts +3 -0
- package/dist/src/database/migrations/2026-02-11T23:03:45Z-clear-pieces-cache.js +8 -0
- package/dist/src/database/migrations/2026-02-11T23:03:45Z-clear-pieces-cache.js.map +1 -0
- package/dist/src/lib/ajv.test.js +1 -1
- package/dist/src/lib/ajv.test.js.map +1 -1
- package/dist/src/llm/google.d.ts +1 -1
- package/dist/src/pieces/Piece.d.ts +2 -2
- package/dist/src/pieces/Piece.fixtures.d.ts +21 -27
- package/dist/src/pieces/Piece.fixtures.js +34 -21
- package/dist/src/pieces/Piece.fixtures.js.map +1 -1
- package/dist/src/pieces/Piece.js +45 -42
- package/dist/src/pieces/Piece.js.map +1 -1
- package/dist/src/pieces/Piece.test.js +487 -739
- package/dist/src/pieces/Piece.test.js.map +1 -1
- package/dist/src/pieces/index.d.ts +1 -0
- package/dist/src/pieces/index.js +1 -0
- package/dist/src/pieces/index.js.map +1 -1
- package/dist/src/pieces/item.js +29 -17
- package/dist/src/pieces/item.js.map +1 -1
- package/dist/src/pieces/item.test.js +141 -113
- package/dist/src/pieces/item.test.js.map +1 -1
- package/dist/src/pieces/manager.test.js +1 -1
- package/dist/src/pieces/manager.test.js.map +1 -1
- package/dist/src/pieces/utils/frontmatter.d.ts +42 -10
- package/dist/src/pieces/utils/frontmatter.js +112 -44
- package/dist/src/pieces/utils/frontmatter.js.map +1 -1
- package/dist/src/pieces/utils/frontmatter.path.d.ts +5 -0
- package/dist/src/pieces/utils/frontmatter.path.js +95 -0
- package/dist/src/pieces/utils/frontmatter.path.js.map +1 -0
- package/dist/src/pieces/utils/frontmatter.path.test.d.ts +1 -0
- package/dist/src/pieces/utils/frontmatter.path.test.js +126 -0
- package/dist/src/pieces/utils/frontmatter.path.test.js.map +1 -0
- package/dist/src/pieces/utils/frontmatter.test.js +266 -169
- package/dist/src/pieces/utils/frontmatter.test.js.map +1 -1
- package/dist/src/pieces/utils/piece.js +3 -2
- package/dist/src/pieces/utils/piece.js.map +1 -1
- package/dist/src/pieces/utils/piece.test.js +1 -1
- package/dist/src/pieces/utils/piece.test.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/pieces/utils/piece.fixtures.d.ts +0 -19
- package/dist/src/pieces/utils/piece.fixtures.js +0 -39
- package/dist/src/pieces/utils/piece.fixtures.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { JSONSchemaType, ValidateFunction } from 'ajv';
|
|
2
|
-
import { PieceMarkdown } from './markdown.js';
|
|
3
|
-
import { PieceFrontmatter } from './frontmatter.js';
|
|
4
|
-
import { PiecesItemsSelectable } from '../../database/tables/pieces_items.schema.js';
|
|
5
|
-
type PieceValidator = ValidateFunction<PieceFrontmatter>;
|
|
6
|
-
export declare function makeValidator(): PieceValidator;
|
|
7
|
-
export declare function makeSchema(properties?: {
|
|
8
|
-
[key: string]: {
|
|
9
|
-
type?: string;
|
|
10
|
-
nullable?: boolean;
|
|
11
|
-
items?: object;
|
|
12
|
-
format?: string;
|
|
13
|
-
pattern?: string;
|
|
14
|
-
enum?: string[] | number[];
|
|
15
|
-
};
|
|
16
|
-
}): JSONSchemaType<PieceFrontmatter>;
|
|
17
|
-
export declare function makeMarkdownSample<F extends PieceFrontmatter>(filePath: string | undefined, piece: string | undefined, note: string | undefined, frontmatter: F): PieceMarkdown<F>;
|
|
18
|
-
export declare function makeSample(): PiecesItemsSelectable;
|
|
19
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
const sample = {
|
|
2
|
-
id: '1',
|
|
3
|
-
file_path: 'samplePath',
|
|
4
|
-
note_markdown: 'note',
|
|
5
|
-
type: 'books',
|
|
6
|
-
date_added: new Date().getTime(),
|
|
7
|
-
date_updated: new Date().getTime(),
|
|
8
|
-
frontmatter_json: JSON.stringify({ title: 'title' }),
|
|
9
|
-
assets_json_array: JSON.stringify([]),
|
|
10
|
-
};
|
|
11
|
-
export function makeValidator() {
|
|
12
|
-
const validate = () => true;
|
|
13
|
-
return validate;
|
|
14
|
-
}
|
|
15
|
-
export function makeSchema(properties) {
|
|
16
|
-
return {
|
|
17
|
-
type: 'object',
|
|
18
|
-
properties: {
|
|
19
|
-
title: { type: 'string', examples: ['title'] },
|
|
20
|
-
keywords: { type: 'string', examples: ['keyword1'], nullable: true },
|
|
21
|
-
subtitle: { type: 'string', examples: ['subtitle'], nullable: true },
|
|
22
|
-
...properties,
|
|
23
|
-
},
|
|
24
|
-
required: ['title'],
|
|
25
|
-
additionalProperties: true,
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
export function makeMarkdownSample(filePath = sample.file_path, piece = sample.type, note = sample.note_markdown, frontmatter) {
|
|
29
|
-
return {
|
|
30
|
-
filePath,
|
|
31
|
-
piece,
|
|
32
|
-
note,
|
|
33
|
-
frontmatter,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export function makeSample() {
|
|
37
|
-
return sample;
|
|
38
|
-
}
|
|
39
|
-
//# sourceMappingURL=piece.fixtures.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"piece.fixtures.js","sourceRoot":"","sources":["../../../../src/pieces/utils/piece.fixtures.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,GAA0B;IACrC,EAAE,EAAE,GAAG;IACP,SAAS,EAAE,YAAY;IACvB,aAAa,EAAE,MAAM;IACrB,IAAI,EAAE,OAAO;IACb,UAAU,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;IAChC,YAAY,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;IAClC,gBAAgB,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;IACpD,i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