sonamu 0.7.4 → 0.7.6
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/dist/api/config.d.ts +1 -4
- package/dist/api/config.d.ts.map +1 -1
- package/dist/api/config.js +1 -1
- package/dist/api/sonamu.d.ts +2 -0
- package/dist/api/sonamu.d.ts.map +1 -1
- package/dist/api/sonamu.js +19 -47
- package/dist/bin/cli.js +6 -6
- package/dist/database/base-model.d.ts +1 -1
- package/dist/database/base-model.d.ts.map +1 -1
- package/dist/database/base-model.js +15 -4
- package/dist/database/code-generator.d.ts.map +1 -1
- package/dist/database/code-generator.js +3 -3
- package/dist/database/db.d.ts.map +1 -1
- package/dist/database/db.js +1 -1
- package/dist/database/puri-wrapper.d.ts +11 -11
- package/dist/database/puri-wrapper.d.ts.map +1 -1
- package/dist/database/puri-wrapper.js +7 -11
- package/dist/database/puri.d.ts +36 -17
- package/dist/database/puri.d.ts.map +1 -1
- package/dist/database/puri.js +54 -7
- package/dist/database/puri.types.d.ts +54 -17
- package/dist/database/puri.types.d.ts.map +1 -1
- package/dist/database/puri.types.js +2 -4
- package/dist/database/puri.types.test-d.js +129 -0
- package/dist/database/upsert-builder.d.ts +16 -10
- package/dist/database/upsert-builder.d.ts.map +1 -1
- package/dist/database/upsert-builder.js +10 -19
- package/dist/entity/entity-manager.d.ts +113 -22
- package/dist/entity/entity-manager.d.ts.map +1 -1
- package/dist/entity/entity-manager.js +1 -1
- package/dist/entity/entity.d.ts +34 -0
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +110 -37
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/migration/code-generation.d.ts.map +1 -1
- package/dist/migration/code-generation.js +341 -149
- package/dist/migration/migration-set.d.ts.map +1 -1
- package/dist/migration/migration-set.js +21 -5
- package/dist/migration/migrator.d.ts.map +1 -1
- package/dist/migration/migrator.js +7 -1
- package/dist/migration/postgresql-schema-reader.d.ts +11 -1
- package/dist/migration/postgresql-schema-reader.d.ts.map +1 -1
- package/dist/migration/postgresql-schema-reader.js +111 -10
- package/dist/syncer/syncer.d.ts.map +1 -1
- package/dist/syncer/syncer.js +7 -4
- package/dist/template/implementations/generated.template.d.ts.map +1 -1
- package/dist/template/implementations/generated.template.js +12 -2
- package/dist/template/implementations/generated_sso.template.d.ts +3 -3
- package/dist/template/implementations/generated_sso.template.d.ts.map +1 -1
- package/dist/template/implementations/generated_sso.template.js +50 -2
- package/dist/template/implementations/model.template.d.ts.map +1 -1
- package/dist/template/implementations/model.template.js +20 -15
- package/dist/template/implementations/model_test.template.js +4 -4
- package/dist/template/implementations/service.template.d.ts.map +1 -1
- package/dist/template/implementations/service.template.js +2 -2
- package/dist/template/implementations/view_enums_dropdown.template.js +2 -2
- package/dist/template/implementations/view_enums_select.template.js +2 -2
- package/dist/template/implementations/view_form.template.d.ts.map +1 -1
- package/dist/template/implementations/view_form.template.js +12 -9
- package/dist/template/implementations/view_id_async_select.template.js +4 -4
- package/dist/template/implementations/view_list.template.d.ts.map +1 -1
- package/dist/template/implementations/view_list.template.js +12 -9
- package/dist/template/implementations/view_search_input.template.js +2 -2
- package/dist/template/template.js +2 -2
- package/dist/template/zod-converter.d.ts.map +1 -1
- package/dist/template/zod-converter.js +17 -2
- package/dist/testing/fixture-manager.d.ts +2 -1
- package/dist/testing/fixture-manager.d.ts.map +1 -1
- package/dist/testing/fixture-manager.js +29 -29
- package/dist/types/types.d.ts +593 -68
- package/dist/types/types.d.ts.map +1 -1
- package/dist/types/types.js +113 -9
- package/dist/vector/chunking.d.ts +25 -0
- package/dist/vector/chunking.d.ts.map +1 -0
- package/dist/vector/chunking.js +97 -0
- package/dist/vector/config.d.ts +12 -0
- package/dist/vector/config.d.ts.map +1 -0
- package/dist/vector/config.js +83 -0
- package/dist/vector/embedding.d.ts +42 -0
- package/dist/vector/embedding.d.ts.map +1 -0
- package/dist/vector/embedding.js +147 -0
- package/dist/vector/types.d.ts +105 -0
- package/dist/vector/types.d.ts.map +1 -0
- package/dist/vector/types.js +5 -0
- package/dist/vector/vector-search.d.ts +47 -0
- package/dist/vector/vector-search.d.ts.map +1 -0
- package/dist/vector/vector-search.js +176 -0
- package/package.json +9 -8
- package/src/api/config.ts +0 -4
- package/src/api/sonamu.ts +21 -36
- package/src/bin/cli.ts +5 -5
- package/src/database/base-model.ts +20 -11
- package/src/database/code-generator.ts +6 -2
- package/src/database/db.ts +1 -0
- package/src/database/puri-wrapper.ts +22 -16
- package/src/database/puri.ts +150 -27
- package/src/database/puri.types.test-d.ts +457 -0
- package/src/database/puri.types.ts +231 -33
- package/src/database/upsert-builder.ts +43 -34
- package/src/entity/entity-manager.ts +2 -2
- package/src/entity/entity.ts +134 -44
- package/src/index.ts +6 -0
- package/src/migration/code-generation.ts +377 -174
- package/src/migration/migration-set.ts +22 -3
- package/src/migration/migrator.ts +6 -0
- package/src/migration/postgresql-schema-reader.ts +121 -21
- package/src/syncer/syncer.ts +6 -3
- package/src/template/implementations/generated.template.ts +51 -9
- package/src/template/implementations/generated_sso.template.ts +71 -2
- package/src/template/implementations/model.template.ts +25 -15
- package/src/template/implementations/model_test.template.ts +3 -3
- package/src/template/implementations/service.template.ts +5 -1
- package/src/template/implementations/view_enums_dropdown.template.ts +1 -1
- package/src/template/implementations/view_enums_select.template.ts +1 -1
- package/src/template/implementations/view_form.template.ts +11 -8
- package/src/template/implementations/view_id_async_select.template.ts +3 -3
- package/src/template/implementations/view_list.template.ts +11 -8
- package/src/template/implementations/view_search_input.template.ts +1 -1
- package/src/template/template.ts +1 -1
- package/src/template/zod-converter.ts +20 -0
- package/src/testing/fixture-manager.ts +31 -30
- package/src/types/types.ts +226 -48
- package/src/vector/chunking.ts +115 -0
- package/src/vector/config.ts +68 -0
- package/src/vector/embedding.ts +193 -0
- package/src/vector/types.ts +122 -0
- package/src/vector/vector-search.ts +261 -0
- package/dist/template/implementations/view_enums_buttonset.template.d.ts +0 -17
- package/dist/template/implementations/view_enums_buttonset.template.d.ts.map +0 -1
- package/dist/template/implementations/view_enums_buttonset.template.js +0 -31
- package/dist/template/implementations/view_list_columns.template.d.ts +0 -17
- package/dist/template/implementations/view_list_columns.template.d.ts.map +0 -1
- package/dist/template/implementations/view_list_columns.template.js +0 -49
- package/src/template/implementations/view_enums_buttonset.template.ts +0 -34
- package/src/template/implementations/view_list_columns.template.ts +0 -53
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { EntityManager } from "../../entity/entity-manager.js";
|
|
2
|
-
import { Template } from "../template.js";
|
|
3
|
-
export class Template__view_list_columns extends Template {
|
|
4
|
-
constructor(){
|
|
5
|
-
super("view_list_columns");
|
|
6
|
-
}
|
|
7
|
-
getTargetAndPath(names) {
|
|
8
|
-
return {
|
|
9
|
-
target: "web/src/pages/admin",
|
|
10
|
-
path: `${names.fsPlural}/_columns.tsx`
|
|
11
|
-
};
|
|
12
|
-
}
|
|
13
|
-
// 컬럼
|
|
14
|
-
render({ entityId, columns, columnImports }) {
|
|
15
|
-
const names = EntityManager.getNamesFromId(entityId);
|
|
16
|
-
return {
|
|
17
|
-
...this.getTargetAndPath(names),
|
|
18
|
-
body: `
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import {
|
|
21
|
-
Segment,
|
|
22
|
-
Table,
|
|
23
|
-
TableRow,
|
|
24
|
-
Button,
|
|
25
|
-
Label,
|
|
26
|
-
} from 'semantic-ui-react';
|
|
27
|
-
import { DateTime } from "luxon";
|
|
28
|
-
import { TFColumn } from "src/typeframe/iso-types";
|
|
29
|
-
import { ${names.capital}SubsetA } from "src/services/${names.fs}/${names.fs}.generated";
|
|
30
|
-
${columnImports}
|
|
31
|
-
|
|
32
|
-
const columns: { [key in Exclude<keyof ${names.capital}SubsetA, 'id'>]: TFColumn<${names.capital}SubsetA> } = {${columns.map((col)=>{
|
|
33
|
-
return [
|
|
34
|
-
`${col.name}: { label: "${col.label}",`,
|
|
35
|
-
`tc: ${col.tc}, `,
|
|
36
|
-
`collapsing: ${[
|
|
37
|
-
"Title",
|
|
38
|
-
"Name"
|
|
39
|
-
].includes(col.label) === false}, }`
|
|
40
|
-
].join("\n");
|
|
41
|
-
}).join(",\n")}};
|
|
42
|
-
export default columns;
|
|
43
|
-
`.trim(),
|
|
44
|
-
importKeys: []
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy90ZW1wbGF0ZS9pbXBsZW1lbnRhdGlvbnMvdmlld19saXN0X2NvbHVtbnMudGVtcGxhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRW50aXR5TWFuYWdlciwgdHlwZSBFbnRpdHlOYW1lc1JlY29yZCB9IGZyb20gXCIuLi8uLi9lbnRpdHkvZW50aXR5LW1hbmFnZXJcIjtcbmltcG9ydCB0eXBlIHsgVGVtcGxhdGVPcHRpb25zIH0gZnJvbSBcIi4uLy4uL3R5cGVzL3R5cGVzXCI7XG5pbXBvcnQgeyBUZW1wbGF0ZSB9IGZyb20gXCIuLi90ZW1wbGF0ZVwiO1xuXG5leHBvcnQgY2xhc3MgVGVtcGxhdGVfX3ZpZXdfbGlzdF9jb2x1bW5zIGV4dGVuZHMgVGVtcGxhdGUge1xuICBjb25zdHJ1Y3RvcigpIHtcbiAgICBzdXBlcihcInZpZXdfbGlzdF9jb2x1bW5zXCIpO1xuICB9XG5cbiAgZ2V0VGFyZ2V0QW5kUGF0aChuYW1lczogRW50aXR5TmFtZXNSZWNvcmQpIHtcbiAgICByZXR1cm4ge1xuICAgICAgdGFyZ2V0OiBcIndlYi9zcmMvcGFnZXMvYWRtaW5cIixcbiAgICAgIHBhdGg6IGAke25hbWVzLmZzUGx1cmFsfS9fY29sdW1ucy50c3hgLFxuICAgIH07XG4gIH1cblxuICAvLyDsu6zrn7xcbiAgcmVuZGV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yxFQUFFO1FBQ2pGLE1BQU1QLFFBQVFKLGNBQWNZLGNBQWMsQ0FBQ0g7UUFFM0MsT0FBTztZQUNMLEdBQUcsSUFBSSxDQUFDTixnQkFBZ0IsQ0FBQ0MsTUFBTTtZQUMvQlMsTUFBTSxDQUFDOzs7Ozs7Ozs7OztTQVdKLEVBQUVULE1BQU1VLE9BQU8sQ0FBQyw2QkFBNkIsRUFBRVYsTUFBTVcsRUFBRSxDQUFDLENBQUMsRUFBRVgsTUFBTVcsRUFBRSxDQUFDO0FBQzdFLEVBQUVKLGNBQWM7O3VDQUV1QixFQUMvQlAsTUFBTVUsT0FBTyxDQUNkLDBCQUEwQixFQUFFVixNQUFNVSxPQUFPLENBQUMsY0FBYyxFQUFFSixRQUN4RE0sR0FBRyxDQUFDLENBQUNDO2dCQUNKLE9BQU87b0JBQ0wsR0FBR0EsSUFBSUMsSUFBSSxDQUFDLFlBQVksRUFBRUQsSUFBSUUsS0FBSyxDQUFDLEVBQUUsQ0FBQztvQkFDdkMsQ0FBQyxJQUFJLEVBQUVGLElBQUlHLEVBQUUsQ0FBQyxFQUFFLENBQUM7b0JBQ2pCLENBQUMsWUFBWSxFQUFFO3dCQUFDO3dCQUFTO3FCQUFPLENBQUNDLFFBQVEsQ0FBQ0osSUFBSUUsS0FBSyxNQUFNLE1BQU0sR0FBRyxDQUFDO2lCQUNwRSxDQUFDRyxJQUFJLENBQUM7WUFDVCxHQUNDQSxJQUFJLENBQUMsT0FBTzs7TUFFZixDQUFDLENBQUNDLElBQUk7WUFDTkMsWUFBWSxFQUFFO1FBQ2hCO0lBQ0Y7QUFDRiJ9
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { EntityManager, type EntityNamesRecord } from "../../entity/entity-manager";
|
|
2
|
-
import type { TemplateOptions } from "../../types/types";
|
|
3
|
-
import { Template } from "../template";
|
|
4
|
-
|
|
5
|
-
export class Template__view_enums_buttonset extends Template {
|
|
6
|
-
constructor() {
|
|
7
|
-
super("view_enums_buttonset");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
getTargetAndPath(names: EntityNamesRecord, componentId: string) {
|
|
11
|
-
return {
|
|
12
|
-
target: "web/src/components",
|
|
13
|
-
path: `${names.fs}/${componentId}ButtonSet.tsx`,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
render({ entityId, enumId }: TemplateOptions["view_enums_buttonset"]) {
|
|
18
|
-
const names = EntityManager.getNamesFromId(entityId);
|
|
19
|
-
|
|
20
|
-
return {
|
|
21
|
-
...this.getTargetAndPath(names, enumId),
|
|
22
|
-
body: `
|
|
23
|
-
/*
|
|
24
|
-
view_enums_buttonset
|
|
25
|
-
${JSON.stringify({
|
|
26
|
-
key: this.key,
|
|
27
|
-
options: entityId,
|
|
28
|
-
})}
|
|
29
|
-
*/
|
|
30
|
-
`.trim(),
|
|
31
|
-
importKeys: [],
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { EntityManager, type EntityNamesRecord } from "../../entity/entity-manager";
|
|
2
|
-
import type { TemplateOptions } from "../../types/types";
|
|
3
|
-
import { Template } from "../template";
|
|
4
|
-
|
|
5
|
-
export class Template__view_list_columns extends Template {
|
|
6
|
-
constructor() {
|
|
7
|
-
super("view_list_columns");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
getTargetAndPath(names: EntityNamesRecord) {
|
|
11
|
-
return {
|
|
12
|
-
target: "web/src/pages/admin",
|
|
13
|
-
path: `${names.fsPlural}/_columns.tsx`,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
// 컬럼
|
|
18
|
-
render({ entityId, columns, columnImports }: TemplateOptions["view_list_columns"]) {
|
|
19
|
-
const names = EntityManager.getNamesFromId(entityId);
|
|
20
|
-
|
|
21
|
-
return {
|
|
22
|
-
...this.getTargetAndPath(names),
|
|
23
|
-
body: `
|
|
24
|
-
import React from 'react';
|
|
25
|
-
import {
|
|
26
|
-
Segment,
|
|
27
|
-
Table,
|
|
28
|
-
TableRow,
|
|
29
|
-
Button,
|
|
30
|
-
Label,
|
|
31
|
-
} from 'semantic-ui-react';
|
|
32
|
-
import { DateTime } from "luxon";
|
|
33
|
-
import { TFColumn } from "src/typeframe/iso-types";
|
|
34
|
-
import { ${names.capital}SubsetA } from "src/services/${names.fs}/${names.fs}.generated";
|
|
35
|
-
${columnImports}
|
|
36
|
-
|
|
37
|
-
const columns: { [key in Exclude<keyof ${
|
|
38
|
-
names.capital
|
|
39
|
-
}SubsetA, 'id'>]: TFColumn<${names.capital}SubsetA> } = {${columns
|
|
40
|
-
.map((col) => {
|
|
41
|
-
return [
|
|
42
|
-
`${col.name}: { label: "${col.label}",`,
|
|
43
|
-
`tc: ${col.tc}, `,
|
|
44
|
-
`collapsing: ${["Title", "Name"].includes(col.label) === false}, }`,
|
|
45
|
-
].join("\n");
|
|
46
|
-
})
|
|
47
|
-
.join(",\n")}};
|
|
48
|
-
export default columns;
|
|
49
|
-
`.trim(),
|
|
50
|
-
importKeys: [],
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|