@neupgroup/mapper 1.2.0 → 1.2.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/README.md +705 -36
- package/dist/config-wrapper.d.ts +6 -0
- package/dist/config-wrapper.js +7 -0
- package/dist/config.d.ts +68 -0
- package/dist/config.js +234 -0
- package/dist/docs.d.ts +3 -0
- package/dist/docs.js +351 -0
- package/dist/env.d.ts +25 -0
- package/dist/env.js +88 -0
- package/dist/fluent-mapper.d.ts +80 -0
- package/dist/fluent-mapper.js +171 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +9 -0
- package/dist/mapper.d.ts +27 -0
- package/dist/mapper.js +144 -0
- package/dist/orm/index.d.ts +2 -2
- package/dist/orm/types.d.ts +1 -1
- package/package.json +5 -2
- package/dist/actions/ai-operation-suggestion.d.ts +0 -27
- package/dist/actions/ai-operation-suggestion.js +0 -46
- package/dist/actions/ai-schema-suggestion.d.ts +0 -24
- package/dist/actions/ai-schema-suggestion.js +0 -46
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { z } from 'genkit';
|
|
2
|
-
export declare const AISchemaSuggestionInputSchema: z.ZodObject<{
|
|
3
|
-
dataDescription: z.ZodString;
|
|
4
|
-
databaseType: z.ZodString;
|
|
5
|
-
}, "strip", z.ZodTypeAny, {
|
|
6
|
-
dataDescription: string;
|
|
7
|
-
databaseType: string;
|
|
8
|
-
}, {
|
|
9
|
-
dataDescription: string;
|
|
10
|
-
databaseType: string;
|
|
11
|
-
}>;
|
|
12
|
-
export type AISchemaSuggestionInput = z.infer<typeof AISchemaSuggestionInputSchema>;
|
|
13
|
-
export declare const AISchemaSuggestionOutputSchema: z.ZodObject<{
|
|
14
|
-
suggestedSchema: z.ZodString;
|
|
15
|
-
rationale: z.ZodString;
|
|
16
|
-
}, "strip", z.ZodTypeAny, {
|
|
17
|
-
suggestedSchema: string;
|
|
18
|
-
rationale: string;
|
|
19
|
-
}, {
|
|
20
|
-
suggestedSchema: string;
|
|
21
|
-
rationale: string;
|
|
22
|
-
}>;
|
|
23
|
-
export type AISchemaSuggestionOutput = z.infer<typeof AISchemaSuggestionOutputSchema>;
|
|
24
|
-
export declare function createSuggestSchema(ai: any): (input: AISchemaSuggestionInput) => Promise<any>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { z } from 'genkit';
|
|
2
|
-
export const AISchemaSuggestionInputSchema = z.object({
|
|
3
|
-
dataDescription: z
|
|
4
|
-
.string()
|
|
5
|
-
.describe('A detailed description of the data that the schema should represent.'),
|
|
6
|
-
databaseType: z
|
|
7
|
-
.string()
|
|
8
|
-
.describe('The type of database for which the schema is being created (e.g., MongoDB, Firestore, SQL).'),
|
|
9
|
-
});
|
|
10
|
-
export const AISchemaSuggestionOutputSchema = z.object({
|
|
11
|
-
suggestedSchema: z
|
|
12
|
-
.string()
|
|
13
|
-
.describe('The suggested schema structure, formatted as a JSON string, tailored for the specified database type.'),
|
|
14
|
-
rationale: z
|
|
15
|
-
.string()
|
|
16
|
-
.describe('Explanation of why the suggested schema is optimal for the given data description and database type.'),
|
|
17
|
-
});
|
|
18
|
-
export function createSuggestSchema(ai) {
|
|
19
|
-
const aiSchemaSuggestionPrompt = ai.definePrompt({
|
|
20
|
-
name: 'aiSchemaSuggestionPrompt',
|
|
21
|
-
input: { schema: AISchemaSuggestionInputSchema },
|
|
22
|
-
output: { schema: AISchemaSuggestionOutputSchema },
|
|
23
|
-
prompt: `You are an expert database architect. Given a description of data and a database type, you will suggest an optimal schema structure.
|
|
24
|
-
|
|
25
|
-
Data Description: {{{dataDescription}}}
|
|
26
|
-
Database Type: {{{databaseType}}}
|
|
27
|
-
|
|
28
|
-
Consider the characteristics and constraints of the specified database type when formulating the schema.
|
|
29
|
-
|
|
30
|
-
Return the suggested schema as a JSON string, and include a rationale explaining why the schema is optimal.
|
|
31
|
-
|
|
32
|
-
Ensure that the suggested schema is valid and can be directly used with the specified database.
|
|
33
|
-
`,
|
|
34
|
-
});
|
|
35
|
-
const aiSchemaSuggestionFlow = ai.defineFlow({
|
|
36
|
-
name: 'aiSchemaSuggestionFlow',
|
|
37
|
-
inputSchema: AISchemaSuggestionInputSchema,
|
|
38
|
-
outputSchema: AISchemaSuggestionOutputSchema,
|
|
39
|
-
}, async (input) => {
|
|
40
|
-
const { output } = await aiSchemaSuggestionPrompt(input);
|
|
41
|
-
return output;
|
|
42
|
-
});
|
|
43
|
-
return async function suggestSchema(input) {
|
|
44
|
-
return aiSchemaSuggestionFlow(input);
|
|
45
|
-
};
|
|
46
|
-
}
|