@tailor-platform/sdk 1.17.1 → 1.18.0
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/CHANGELOG.md +16 -0
- package/dist/application-Csj7Ow5Q.mjs +8 -0
- package/dist/{application-BMDE8KqK.mjs → application-gWUyKuzv.mjs} +120 -1618
- package/dist/application-gWUyKuzv.mjs.map +1 -0
- package/dist/brand-BZJCv6UY.mjs +28 -0
- package/dist/brand-BZJCv6UY.mjs.map +1 -0
- package/dist/cli/index.mjs +38 -20
- package/dist/cli/index.mjs.map +1 -1
- package/dist/cli/lib.d.mts +10 -33
- package/dist/cli/lib.mjs +10 -5
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/configure/index.d.mts +4 -4
- package/dist/configure/index.mjs +10 -19
- package/dist/configure/index.mjs.map +1 -1
- package/dist/enum-constants-Cwd4qdpa.mjs +115 -0
- package/dist/enum-constants-Cwd4qdpa.mjs.map +1 -0
- package/dist/file-utils-cqcpFk87.mjs +139 -0
- package/dist/file-utils-cqcpFk87.mjs.map +1 -0
- package/dist/index-BKXch-td.d.mts +18 -0
- package/dist/index-C3Ib7pFc.d.mts +18 -0
- package/dist/{index-CVcYqZSf.d.mts → index-DP8EB9FK.d.mts} +12 -5
- package/dist/index-SqWgrTnF.d.mts +20 -0
- package/dist/index-sSDpuVQY.d.mts +18 -0
- package/dist/{jiti-BrELlEYT.mjs → jiti-DHlauMCo.mjs} +2 -2
- package/dist/{jiti-BrELlEYT.mjs.map → jiti-DHlauMCo.mjs.map} +1 -1
- package/dist/{job-CULA2Pvf.mjs → job-2Q82qQ6N.mjs} +27 -5
- package/dist/job-2Q82qQ6N.mjs.map +1 -0
- package/dist/kysely-type-DtUUoAi3.mjs +259 -0
- package/dist/kysely-type-DtUUoAi3.mjs.map +1 -0
- package/dist/plugin/builtin/enum-constants/index.d.mts +4 -0
- package/dist/plugin/builtin/enum-constants/index.mjs +3 -0
- package/dist/plugin/builtin/file-utils/index.d.mts +4 -0
- package/dist/plugin/builtin/file-utils/index.mjs +3 -0
- package/dist/plugin/builtin/kysely-type/index.d.mts +4 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +3 -0
- package/dist/plugin/builtin/seed/index.d.mts +4 -0
- package/dist/plugin/builtin/seed/index.mjs +3 -0
- package/dist/plugin/index.d.mts +3 -3
- package/dist/plugin/index.mjs +11 -11
- package/dist/plugin/index.mjs.map +1 -1
- package/dist/{schema-R5TxC5Pn.mjs → schema-WDvc7Zel.mjs} +4 -3
- package/dist/schema-WDvc7Zel.mjs.map +1 -0
- package/dist/seed-Dm7lrGZ3.mjs +1050 -0
- package/dist/seed-Dm7lrGZ3.mjs.map +1 -0
- package/dist/{src-DMROgdcL.mjs → src-i4uqS1G4.mjs} +2 -2
- package/dist/{src-DMROgdcL.mjs.map → src-i4uqS1G4.mjs.map} +1 -1
- package/dist/types-Bhl_wAM2.d.mts +151 -0
- package/dist/{types-b-ig8nW_.mjs → types-ClK_HJ0G.mjs} +1 -1
- package/dist/{types-b-ig8nW_.mjs.map → types-ClK_HJ0G.mjs.map} +1 -1
- package/dist/{types-CZZBCaxB.d.mts → types-DdvTxFiD.d.mts} +1324 -988
- package/dist/{update-CUBVjZbL.mjs → update-BoNKMti-.mjs} +268 -97
- package/dist/update-BoNKMti-.mjs.map +1 -0
- package/dist/utils/test/index.d.mts +4 -4
- package/dist/utils/test/index.mjs +3 -2
- package/dist/utils/test/index.mjs.map +1 -1
- package/docs/cli/application.md +106 -14
- package/docs/cli/auth.md +92 -12
- package/docs/cli/completion.md +18 -2
- package/docs/cli/executor.md +122 -14
- package/docs/cli/function.md +32 -4
- package/docs/cli/secret.md +134 -18
- package/docs/cli/staticwebsite.md +60 -8
- package/docs/cli/tailordb.md +148 -20
- package/docs/cli/user.md +154 -22
- package/docs/cli/workflow.md +100 -12
- package/docs/cli/workspace.md +274 -38
- package/docs/generator/custom.md +2 -2
- package/docs/plugin/custom.md +270 -163
- package/docs/plugin/index.md +48 -2
- package/package.json +22 -2
- package/dist/application-BMDE8KqK.mjs.map +0 -1
- package/dist/application-Dni_W16P.mjs +0 -4
- package/dist/job-CULA2Pvf.mjs.map +0 -1
- package/dist/schema-R5TxC5Pn.mjs.map +0 -1
- package/dist/types-DthzUFfx.d.mts +0 -372
- package/dist/update-CUBVjZbL.mjs.map +0 -1
- /package/dist/{chunk-GMkBE123.mjs → chunk-CqAI0b6X.mjs} +0 -0
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//#region src/plugin/builtin/enum-constants/generate-enum-constants.ts
|
|
2
|
+
/**
|
|
3
|
+
* Generate enum constant definitions from collected metadata.
|
|
4
|
+
* @param allEnums - All collected enum definitions
|
|
5
|
+
* @returns Generated enum constant definitions
|
|
6
|
+
*/
|
|
7
|
+
function generateUnifiedEnumConstants(allEnums) {
|
|
8
|
+
if (allEnums.length === 0) return "";
|
|
9
|
+
const enumMap = /* @__PURE__ */ new Map();
|
|
10
|
+
for (const enumDef of allEnums) enumMap.set(enumDef.name, enumDef);
|
|
11
|
+
const enumDefs = Array.from(enumMap.values()).map((e) => {
|
|
12
|
+
const members = e.values.map((v) => {
|
|
13
|
+
return ` "${v.value.replace(/[-\s]/g, "_")}": "${v.value}"`;
|
|
14
|
+
}).join(",\n");
|
|
15
|
+
const hasDescriptions = e.values.some((v) => v.description);
|
|
16
|
+
let jsDoc = "";
|
|
17
|
+
if (e.fieldDescription || hasDescriptions) {
|
|
18
|
+
const lines = [];
|
|
19
|
+
if (e.fieldDescription) {
|
|
20
|
+
lines.push(` * ${e.fieldDescription}`);
|
|
21
|
+
if (hasDescriptions) lines.push(" *");
|
|
22
|
+
}
|
|
23
|
+
if (hasDescriptions) {
|
|
24
|
+
const propertyDocs = e.values.map((v) => {
|
|
25
|
+
return ` * @property ${[v.value.replace(/[-\s]/g, "_"), v.description].filter(Boolean).join(" - ")}`;
|
|
26
|
+
});
|
|
27
|
+
lines.push(...propertyDocs);
|
|
28
|
+
}
|
|
29
|
+
if (lines.length > 0) jsDoc = `/**\n${lines.join("\n")}\n */\n`;
|
|
30
|
+
}
|
|
31
|
+
return `${`${jsDoc}export const ${e.name} = {\n${members}\n} as const;`}\n${`export type ${e.name} = (typeof ${e.name})[keyof typeof ${e.name}];`}`;
|
|
32
|
+
}).join("\n\n");
|
|
33
|
+
if (!enumDefs) return "";
|
|
34
|
+
return enumDefs + "\n";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
//#region src/plugin/builtin/enum-constants/process-enum-type.ts
|
|
39
|
+
function capitalizeFirst(str) {
|
|
40
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
41
|
+
}
|
|
42
|
+
function collectEnums(type) {
|
|
43
|
+
const enums = [];
|
|
44
|
+
for (const [fieldName, parsedField] of Object.entries(type.fields)) {
|
|
45
|
+
if (parsedField.config.type === "enum" && parsedField.config.allowedValues) {
|
|
46
|
+
const enumTypeName = `${type.name}${capitalizeFirst(fieldName)}`;
|
|
47
|
+
enums.push({
|
|
48
|
+
name: enumTypeName,
|
|
49
|
+
values: parsedField.config.allowedValues,
|
|
50
|
+
fieldDescription: parsedField.config.description
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
if (parsedField.config.type === "nested" && parsedField.config.fields) {
|
|
54
|
+
for (const [nestedFieldName, nestedFieldConfig] of Object.entries(parsedField.config.fields)) if (nestedFieldConfig.type === "enum" && nestedFieldConfig.allowedValues) {
|
|
55
|
+
const fullFieldName = `${fieldName}${capitalizeFirst(nestedFieldName)}`;
|
|
56
|
+
const enumTypeName = `${type.name}${capitalizeFirst(fullFieldName)}`;
|
|
57
|
+
enums.push({
|
|
58
|
+
name: enumTypeName,
|
|
59
|
+
values: nestedFieldConfig.allowedValues,
|
|
60
|
+
fieldDescription: nestedFieldConfig.description
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return enums;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Process a TailorDB type and extract enum metadata.
|
|
69
|
+
* @param type - The parsed TailorDB type to process
|
|
70
|
+
* @returns Enum constant metadata for the type
|
|
71
|
+
*/
|
|
72
|
+
async function processEnumType(type) {
|
|
73
|
+
const enums = collectEnums(type);
|
|
74
|
+
return {
|
|
75
|
+
name: type.name,
|
|
76
|
+
enums
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
//#endregion
|
|
81
|
+
//#region src/plugin/builtin/enum-constants/index.ts
|
|
82
|
+
const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
83
|
+
/**
|
|
84
|
+
* Plugin that generates enum constants from TailorDB type definitions.
|
|
85
|
+
* @param options - Plugin options
|
|
86
|
+
* @param options.distPath - Output file path for generated constants
|
|
87
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
88
|
+
*/
|
|
89
|
+
function enumConstantsPlugin(options) {
|
|
90
|
+
return {
|
|
91
|
+
id: EnumConstantsGeneratorID,
|
|
92
|
+
description: "Generates enum constants from TailorDB type definitions",
|
|
93
|
+
pluginConfig: options,
|
|
94
|
+
async onTailorDBReady(ctx) {
|
|
95
|
+
const allEnums = [];
|
|
96
|
+
for (const ns of ctx.tailordb) for (const type of Object.values(ns.types)) {
|
|
97
|
+
const metadata = await processEnumType(type);
|
|
98
|
+
allEnums.push(...metadata.enums);
|
|
99
|
+
}
|
|
100
|
+
const files = [];
|
|
101
|
+
if (allEnums.length > 0) {
|
|
102
|
+
const content = generateUnifiedEnumConstants(allEnums);
|
|
103
|
+
files.push({
|
|
104
|
+
path: ctx.pluginConfig.distPath,
|
|
105
|
+
content
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
return { files };
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
|
|
115
|
+
//# sourceMappingURL=enum-constants-Cwd4qdpa.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enum-constants-Cwd4qdpa.mjs","names":[],"sources":["../src/plugin/builtin/enum-constants/generate-enum-constants.ts","../src/plugin/builtin/enum-constants/process-enum-type.ts","../src/plugin/builtin/enum-constants/index.ts"],"sourcesContent":["import type { EnumDefinition } from \"./types\";\n\n/**\n * Generate enum constant definitions from collected metadata.\n * @param allEnums - All collected enum definitions\n * @returns Generated enum constant definitions\n */\nexport function generateUnifiedEnumConstants(allEnums: EnumDefinition[]): string {\n if (allEnums.length === 0) {\n return \"\";\n }\n\n const enumMap = new Map<string, EnumDefinition>();\n for (const enumDef of allEnums) {\n enumMap.set(enumDef.name, enumDef);\n }\n\n const enumDefs = Array.from(enumMap.values())\n .map((e) => {\n const members = e.values\n .map((v) => {\n const key = v.value.replace(/[-\\s]/g, \"_\");\n return ` \"${key}\": \"${v.value}\"`;\n })\n .join(\",\\n\");\n\n const hasDescriptions = e.values.some((v) => v.description);\n let jsDoc = \"\";\n if (e.fieldDescription || hasDescriptions) {\n const lines: string[] = [];\n\n if (e.fieldDescription) {\n lines.push(` * ${e.fieldDescription}`);\n if (hasDescriptions) {\n lines.push(\" *\");\n }\n }\n\n if (hasDescriptions) {\n const propertyDocs = e.values.map((v) => {\n const key = v.value.replace(/[-\\s]/g, \"_\");\n return ` * @property ${[key, v.description].filter(Boolean).join(\" - \")}`;\n });\n lines.push(...propertyDocs);\n }\n\n if (lines.length > 0) {\n jsDoc = `/**\\n${lines.join(\"\\n\")}\\n */\\n`;\n }\n }\n\n const constDef = `${jsDoc}export const ${e.name} = {\\n${members}\\n} as const;`;\n const typeDef = `export type ${e.name} = (typeof ${e.name})[keyof typeof ${e.name}];`;\n return `${constDef}\\n${typeDef}`;\n })\n .join(\"\\n\\n\");\n\n if (!enumDefs) {\n return \"\";\n }\n\n return enumDefs + \"\\n\";\n}\n","import type { EnumConstantMetadata } from \"./types\";\nimport type { TailorDBType } from \"@/parser/service/tailordb/types\";\n\nfunction capitalizeFirst(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n\nfunction collectEnums(type: TailorDBType): EnumConstantMetadata[\"enums\"] {\n const enums: EnumConstantMetadata[\"enums\"] = [];\n\n for (const [fieldName, parsedField] of Object.entries(type.fields)) {\n if (parsedField.config.type === \"enum\" && parsedField.config.allowedValues) {\n const enumTypeName = `${type.name}${capitalizeFirst(fieldName)}`;\n enums.push({\n name: enumTypeName,\n values: parsedField.config.allowedValues,\n fieldDescription: parsedField.config.description,\n });\n }\n\n // Process nested fields\n if (parsedField.config.type === \"nested\" && parsedField.config.fields) {\n for (const [nestedFieldName, nestedFieldConfig] of Object.entries(\n parsedField.config.fields,\n )) {\n if (nestedFieldConfig.type === \"enum\" && nestedFieldConfig.allowedValues) {\n const fullFieldName = `${fieldName}${capitalizeFirst(nestedFieldName)}`;\n const enumTypeName = `${type.name}${capitalizeFirst(fullFieldName)}`;\n enums.push({\n name: enumTypeName,\n values: nestedFieldConfig.allowedValues,\n fieldDescription: nestedFieldConfig.description,\n });\n }\n }\n }\n }\n\n return enums;\n}\n\n/**\n * Process a TailorDB type and extract enum metadata.\n * @param type - The parsed TailorDB type to process\n * @returns Enum constant metadata for the type\n */\nexport async function processEnumType(type: TailorDBType): Promise<EnumConstantMetadata> {\n const enums = collectEnums(type);\n\n return {\n name: type.name,\n enums,\n };\n}\n","import { generateUnifiedEnumConstants } from \"./generate-enum-constants\";\nimport { processEnumType } from \"./process-enum-type\";\nimport type { EnumDefinition } from \"./types\";\nimport type {\n GeneratorResult,\n TailorDBReadyContext,\n} from \"@/parser/plugin-config/generation-types\";\nimport type { Plugin } from \"@/parser/plugin-config/types\";\n\nexport const EnumConstantsGeneratorID = \"@tailor-platform/enum-constants\";\n\ntype EnumConstantsPluginOptions = {\n distPath: string;\n};\n\n/**\n * Plugin that generates enum constants from TailorDB type definitions.\n * @param options - Plugin options\n * @param options.distPath - Output file path for generated constants\n * @returns Plugin instance with onTailorDBReady hook\n */\nexport function enumConstantsPlugin(\n options: EnumConstantsPluginOptions,\n): Plugin<unknown, EnumConstantsPluginOptions> {\n return {\n id: EnumConstantsGeneratorID,\n description: \"Generates enum constants from TailorDB type definitions\",\n pluginConfig: options,\n\n async onTailorDBReady(\n ctx: TailorDBReadyContext<EnumConstantsPluginOptions>,\n ): Promise<GeneratorResult> {\n const allEnums: EnumDefinition[] = [];\n\n for (const ns of ctx.tailordb) {\n for (const type of Object.values(ns.types)) {\n const metadata = await processEnumType(type);\n allEnums.push(...metadata.enums);\n }\n }\n\n const files: GeneratorResult[\"files\"] = [];\n if (allEnums.length > 0) {\n const content = generateUnifiedEnumConstants(allEnums);\n files.push({\n path: ctx.pluginConfig.distPath,\n content,\n });\n }\n\n return { files };\n },\n };\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import ml from "multiline-ts";
|
|
2
|
+
|
|
3
|
+
//#region src/plugin/builtin/file-utils/generate-file-utils.ts
|
|
4
|
+
/**
|
|
5
|
+
* Generate unified file utility functions from collected metadata.
|
|
6
|
+
* @param namespaceData - Namespace data with file utility metadata
|
|
7
|
+
* @returns Generated file utility code
|
|
8
|
+
*/
|
|
9
|
+
function generateUnifiedFileUtils(namespaceData) {
|
|
10
|
+
if (namespaceData.length === 0) return "";
|
|
11
|
+
const typeNamespaceMap = /* @__PURE__ */ new Map();
|
|
12
|
+
const typeFieldsMap = /* @__PURE__ */ new Map();
|
|
13
|
+
for (const { namespace, types } of namespaceData) for (const type of types) {
|
|
14
|
+
typeNamespaceMap.set(type.name, namespace);
|
|
15
|
+
typeFieldsMap.set(type.name, type.fileFields);
|
|
16
|
+
}
|
|
17
|
+
if (typeNamespaceMap.size === 0) return "";
|
|
18
|
+
return [
|
|
19
|
+
ml`
|
|
20
|
+
export interface TypeWithFiles {
|
|
21
|
+
${Array.from(typeFieldsMap.entries()).map(([typeName, fields]) => {
|
|
22
|
+
return ` ${typeName}: {\n fields: ${fields.map((field) => `"${field}"`).join(" | ")};\n };`;
|
|
23
|
+
}).join("\n")}
|
|
24
|
+
}
|
|
25
|
+
` + "\n",
|
|
26
|
+
ml`
|
|
27
|
+
const namespaces: Record<keyof TypeWithFiles, string> = {
|
|
28
|
+
${Array.from(typeNamespaceMap.entries()).map(([typeName, namespace]) => ` ${typeName}: "${namespace}"`).join(",\n")},
|
|
29
|
+
};
|
|
30
|
+
` + "\n",
|
|
31
|
+
ml`
|
|
32
|
+
export async function downloadFile<T extends keyof TypeWithFiles>(
|
|
33
|
+
type: T,
|
|
34
|
+
field: TypeWithFiles[T]["fields"],
|
|
35
|
+
recordId: string,
|
|
36
|
+
) {
|
|
37
|
+
return await tailordb.file.download(namespaces[type], type, field, recordId);
|
|
38
|
+
}
|
|
39
|
+
` + "\n",
|
|
40
|
+
ml`
|
|
41
|
+
export async function uploadFile<T extends keyof TypeWithFiles>(
|
|
42
|
+
type: T,
|
|
43
|
+
field: TypeWithFiles[T]["fields"],
|
|
44
|
+
recordId: string,
|
|
45
|
+
data: string | ArrayBuffer | Uint8Array<ArrayBufferLike> | number[],
|
|
46
|
+
options?: FileUploadOptions,
|
|
47
|
+
): Promise<FileUploadResponse> {
|
|
48
|
+
return await tailordb.file.upload(namespaces[type], type, field, recordId, data, options);
|
|
49
|
+
}
|
|
50
|
+
` + "\n",
|
|
51
|
+
ml`
|
|
52
|
+
export async function deleteFile<T extends keyof TypeWithFiles>(
|
|
53
|
+
type: T,
|
|
54
|
+
field: TypeWithFiles[T]["fields"],
|
|
55
|
+
recordId: string,
|
|
56
|
+
): Promise<void> {
|
|
57
|
+
return await tailordb.file.delete(namespaces[type], type, field, recordId);
|
|
58
|
+
}
|
|
59
|
+
` + "\n",
|
|
60
|
+
ml`
|
|
61
|
+
export async function getFileMetadata<T extends keyof TypeWithFiles>(
|
|
62
|
+
type: T,
|
|
63
|
+
field: TypeWithFiles[T]["fields"],
|
|
64
|
+
recordId: string,
|
|
65
|
+
): Promise<FileMetadata> {
|
|
66
|
+
return await tailordb.file.getMetadata(namespaces[type], type, field, recordId);
|
|
67
|
+
}
|
|
68
|
+
` + "\n",
|
|
69
|
+
ml`
|
|
70
|
+
export async function openFileDownloadStream<T extends keyof TypeWithFiles>(
|
|
71
|
+
type: T,
|
|
72
|
+
field: TypeWithFiles[T]["fields"],
|
|
73
|
+
recordId: string,
|
|
74
|
+
): Promise<FileStreamIterator> {
|
|
75
|
+
return await tailordb.file.openDownloadStream(namespaces[type], type, field, recordId);
|
|
76
|
+
}
|
|
77
|
+
` + "\n"
|
|
78
|
+
].join("\n");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
//#region src/plugin/builtin/file-utils/process-file-type.ts
|
|
83
|
+
/**
|
|
84
|
+
* Process a TailorDB type and extract file field metadata.
|
|
85
|
+
* @param type - The parsed TailorDB type to process
|
|
86
|
+
* @returns File utility metadata for the type
|
|
87
|
+
*/
|
|
88
|
+
async function processFileType(type) {
|
|
89
|
+
const fileFields = [];
|
|
90
|
+
if (type.files) for (const fileFieldName of Object.keys(type.files)) fileFields.push(fileFieldName);
|
|
91
|
+
return {
|
|
92
|
+
name: type.name,
|
|
93
|
+
fileFields
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/plugin/builtin/file-utils/index.ts
|
|
99
|
+
const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
100
|
+
/**
|
|
101
|
+
* Plugin that generates TypeWithFiles interface from TailorDB type definitions.
|
|
102
|
+
* @param options - Plugin options
|
|
103
|
+
* @param options.distPath - Output file path for generated file utilities
|
|
104
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
105
|
+
*/
|
|
106
|
+
function fileUtilsPlugin(options) {
|
|
107
|
+
return {
|
|
108
|
+
id: FileUtilsGeneratorID,
|
|
109
|
+
description: "Generates TypeWithFiles interface from TailorDB type definitions",
|
|
110
|
+
pluginConfig: options,
|
|
111
|
+
async onTailorDBReady(ctx) {
|
|
112
|
+
const namespaceData = [];
|
|
113
|
+
for (const ns of ctx.tailordb) {
|
|
114
|
+
const typesWithFiles = [];
|
|
115
|
+
for (const type of Object.values(ns.types)) {
|
|
116
|
+
const metadata = await processFileType(type);
|
|
117
|
+
if (metadata.fileFields.length > 0) typesWithFiles.push(metadata);
|
|
118
|
+
}
|
|
119
|
+
if (typesWithFiles.length > 0) namespaceData.push({
|
|
120
|
+
namespace: ns.namespace,
|
|
121
|
+
types: typesWithFiles
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
const files = [];
|
|
125
|
+
if (namespaceData.length > 0) {
|
|
126
|
+
const content = generateUnifiedFileUtils(namespaceData);
|
|
127
|
+
if (content) files.push({
|
|
128
|
+
path: ctx.pluginConfig.distPath,
|
|
129
|
+
content
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return { files };
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
//#endregion
|
|
138
|
+
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
139
|
+
//# sourceMappingURL=file-utils-cqcpFk87.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file-utils-cqcpFk87.mjs","names":[],"sources":["../src/plugin/builtin/file-utils/generate-file-utils.ts","../src/plugin/builtin/file-utils/process-file-type.ts","../src/plugin/builtin/file-utils/index.ts"],"sourcesContent":["import multiline from \"multiline-ts\";\nimport type { FileUtilMetadata } from \"./types\";\n\n/**\n * Generate unified file utility functions from collected metadata.\n * @param namespaceData - Namespace data with file utility metadata\n * @returns Generated file utility code\n */\nexport function generateUnifiedFileUtils(\n namespaceData: { namespace: string; types: FileUtilMetadata[] }[],\n): string {\n if (namespaceData.length === 0) {\n return \"\";\n }\n\n // Collect all types with their namespace\n const typeNamespaceMap = new Map<string, string>();\n const typeFieldsMap = new Map<string, string[]>();\n\n for (const { namespace, types } of namespaceData) {\n for (const type of types) {\n typeNamespaceMap.set(type.name, namespace);\n typeFieldsMap.set(type.name, type.fileFields);\n }\n }\n\n if (typeNamespaceMap.size === 0) {\n return \"\";\n }\n\n // Generate interface fields\n const interfaceFields = Array.from(typeFieldsMap.entries())\n .map(([typeName, fields]) => {\n const fieldNamesUnion = fields.map((field) => `\"${field}\"`).join(\" | \");\n return ` ${typeName}: {\\n fields: ${fieldNamesUnion};\\n };`;\n })\n .join(\"\\n\");\n\n const interfaceDefinition =\n multiline /* ts */ `\n export interface TypeWithFiles {\n ${interfaceFields}\n }\n ` + \"\\n\";\n\n // Generate namespaces object\n const namespaceEntries = Array.from(typeNamespaceMap.entries())\n .map(([typeName, namespace]) => ` ${typeName}: \"${namespace}\"`)\n .join(\",\\n\");\n\n const namespacesDefinition =\n multiline /* ts */ `\n const namespaces: Record<keyof TypeWithFiles, string> = {\n ${namespaceEntries},\n };\n ` + \"\\n\";\n\n // Generate downloadFile helper function\n const downloadFunction =\n multiline /* ts */ `\n export async function downloadFile<T extends keyof TypeWithFiles>(\n type: T,\n field: TypeWithFiles[T][\"fields\"],\n recordId: string,\n ) {\n return await tailordb.file.download(namespaces[type], type, field, recordId);\n }\n ` + \"\\n\";\n\n // Generate uploadFile helper function\n const uploadFunction =\n multiline /* ts */ `\n export async function uploadFile<T extends keyof TypeWithFiles>(\n type: T,\n field: TypeWithFiles[T][\"fields\"],\n recordId: string,\n data: string | ArrayBuffer | Uint8Array<ArrayBufferLike> | number[],\n options?: FileUploadOptions,\n ): Promise<FileUploadResponse> {\n return await tailordb.file.upload(namespaces[type], type, field, recordId, data, options);\n }\n ` + \"\\n\";\n\n // Generate deleteFile helper function\n const deleteFunction =\n multiline /* ts */ `\n export async function deleteFile<T extends keyof TypeWithFiles>(\n type: T,\n field: TypeWithFiles[T][\"fields\"],\n recordId: string,\n ): Promise<void> {\n return await tailordb.file.delete(namespaces[type], type, field, recordId);\n }\n ` + \"\\n\";\n\n // Generate getFileMetadata helper function\n const getMetadataFunction =\n multiline /* ts */ `\n export async function getFileMetadata<T extends keyof TypeWithFiles>(\n type: T,\n field: TypeWithFiles[T][\"fields\"],\n recordId: string,\n ): Promise<FileMetadata> {\n return await tailordb.file.getMetadata(namespaces[type], type, field, recordId);\n }\n ` + \"\\n\";\n\n // Generate openFileDownloadStream helper function\n const openDownloadStreamFunction =\n multiline /* ts */ `\n export async function openFileDownloadStream<T extends keyof TypeWithFiles>(\n type: T,\n field: TypeWithFiles[T][\"fields\"],\n recordId: string,\n ): Promise<FileStreamIterator> {\n return await tailordb.file.openDownloadStream(namespaces[type], type, field, recordId);\n }\n ` + \"\\n\";\n\n return [\n interfaceDefinition,\n namespacesDefinition,\n downloadFunction,\n uploadFunction,\n deleteFunction,\n getMetadataFunction,\n openDownloadStreamFunction,\n ].join(\"\\n\");\n}\n","import type { FileUtilMetadata } from \"./types\";\nimport type { TailorDBType } from \"@/parser/service/tailordb/types\";\n\n/**\n * Process a TailorDB type and extract file field metadata.\n * @param type - The parsed TailorDB type to process\n * @returns File utility metadata for the type\n */\nexport async function processFileType(type: TailorDBType): Promise<FileUtilMetadata> {\n const fileFields: string[] = [];\n\n if (type.files) {\n for (const fileFieldName of Object.keys(type.files)) {\n fileFields.push(fileFieldName);\n }\n }\n\n return {\n name: type.name,\n fileFields,\n };\n}\n","import { generateUnifiedFileUtils } from \"./generate-file-utils\";\nimport { processFileType } from \"./process-file-type\";\nimport type { FileUtilMetadata } from \"./types\";\nimport type {\n GeneratorResult,\n TailorDBReadyContext,\n} from \"@/parser/plugin-config/generation-types\";\nimport type { Plugin } from \"@/parser/plugin-config/types\";\n\nexport const FileUtilsGeneratorID = \"@tailor-platform/file-utils\";\n\ntype FileUtilsPluginOptions = {\n distPath: string;\n};\n\n/**\n * Plugin that generates TypeWithFiles interface from TailorDB type definitions.\n * @param options - Plugin options\n * @param options.distPath - Output file path for generated file utilities\n * @returns Plugin instance with onTailorDBReady hook\n */\nexport function fileUtilsPlugin(\n options: FileUtilsPluginOptions,\n): Plugin<unknown, FileUtilsPluginOptions> {\n return {\n id: FileUtilsGeneratorID,\n description: \"Generates TypeWithFiles interface from TailorDB type definitions\",\n pluginConfig: options,\n\n async onTailorDBReady(\n ctx: TailorDBReadyContext<FileUtilsPluginOptions>,\n ): Promise<GeneratorResult> {\n const namespaceData: { namespace: string; types: FileUtilMetadata[] }[] = [];\n\n for (const ns of ctx.tailordb) {\n const typesWithFiles: FileUtilMetadata[] = [];\n\n for (const type of Object.values(ns.types)) {\n const metadata = await processFileType(type);\n if (metadata.fileFields.length > 0) {\n typesWithFiles.push(metadata);\n }\n }\n\n if (typesWithFiles.length > 0) {\n namespaceData.push({\n namespace: ns.namespace,\n types: typesWithFiles,\n });\n }\n }\n\n const files: GeneratorResult[\"files\"] = [];\n if (namespaceData.length > 0) {\n const content = generateUnifiedFileUtils(namespaceData);\n if (content) {\n files.push({\n path: ctx.pluginConfig.distPath,\n content,\n });\n }\n }\n\n return { files };\n },\n };\n}\n"],"mappings":";;;;;;;;AAQA,SAAgB,yBACd,eACQ;AACR,KAAI,cAAc,WAAW,EAC3B,QAAO;CAIT,MAAM,mCAAmB,IAAI,KAAqB;CAClD,MAAM,gCAAgB,IAAI,KAAuB;AAEjD,MAAK,MAAM,EAAE,WAAW,WAAW,cACjC,MAAK,MAAM,QAAQ,OAAO;AACxB,mBAAiB,IAAI,KAAK,MAAM,UAAU;AAC1C,gBAAc,IAAI,KAAK,MAAM,KAAK,WAAW;;AAIjD,KAAI,iBAAiB,SAAS,EAC5B,QAAO;AA4FT,QAAO;EAhFL,EAAmB;;QARG,MAAM,KAAK,cAAc,SAAS,CAAC,CACxD,KAAK,CAAC,UAAU,YAAY;AAE3B,UAAO,KAAK,SAAS,mBADG,OAAO,KAAK,UAAU,IAAI,MAAM,GAAG,CAAC,KAAK,MAAM,CACf;IACxD,CACD,KAAK,KAAK,CAKS;;QAEhB;EAQJ,EAAmB;;QALI,MAAM,KAAK,iBAAiB,SAAS,CAAC,CAC5D,KAAK,CAAC,UAAU,eAAe,KAAK,SAAS,KAAK,UAAU,GAAG,CAC/D,KAAK,MAAM,CAKS;;QAEjB;EAIJ,EAAmB;;;;;;;;QAQf;EAIJ,EAAmB;;;;;;;;;;QAUf;EAIJ,EAAmB;;;;;;;;QAQf;EAIJ,EAAmB;;;;;;;;QAQf;EAIJ,EAAmB;;;;;;;;QAQf;EAUL,CAAC,KAAK,KAAK;;;;;;;;;;ACvHd,eAAsB,gBAAgB,MAA+C;CACnF,MAAM,aAAuB,EAAE;AAE/B,KAAI,KAAK,MACP,MAAK,MAAM,iBAAiB,OAAO,KAAK,KAAK,MAAM,CACjD,YAAW,KAAK,cAAc;AAIlC,QAAO;EACL,MAAM,KAAK;EACX;EACD;;;;;ACXH,MAAa,uBAAuB;;;;;;;AAYpC,SAAgB,gBACd,SACyC;AACzC,QAAO;EACL,IAAI;EACJ,aAAa;EACb,cAAc;EAEd,MAAM,gBACJ,KAC0B;GAC1B,MAAM,gBAAoE,EAAE;AAE5E,QAAK,MAAM,MAAM,IAAI,UAAU;IAC7B,MAAM,iBAAqC,EAAE;AAE7C,SAAK,MAAM,QAAQ,OAAO,OAAO,GAAG,MAAM,EAAE;KAC1C,MAAM,WAAW,MAAM,gBAAgB,KAAK;AAC5C,SAAI,SAAS,WAAW,SAAS,EAC/B,gBAAe,KAAK,SAAS;;AAIjC,QAAI,eAAe,SAAS,EAC1B,eAAc,KAAK;KACjB,WAAW,GAAG;KACd,OAAO;KACR,CAAC;;GAIN,MAAM,QAAkC,EAAE;AAC1C,OAAI,cAAc,SAAS,GAAG;IAC5B,MAAM,UAAU,yBAAyB,cAAc;AACvD,QAAI,QACF,OAAM,KAAK;KACT,MAAM,IAAI,aAAa;KACvB;KACD,CAAC;;AAIN,UAAO,EAAE,OAAO;;EAEnB"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
|
+
import { u as Plugin } from "./types-DdvTxFiD.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/builtin/kysely-type/index.d.ts
|
|
5
|
+
declare const KyselyGeneratorID = "@tailor-platform/kysely-type";
|
|
6
|
+
type KyselyTypePluginOptions = {
|
|
7
|
+
distPath: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Plugin that generates Kysely type definitions for TailorDB types.
|
|
11
|
+
* @param options - Plugin options
|
|
12
|
+
* @param options.distPath - Output file path for generated types
|
|
13
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
14
|
+
*/
|
|
15
|
+
declare function kyselyTypePlugin(options: KyselyTypePluginOptions): Plugin<unknown, KyselyTypePluginOptions>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { kyselyTypePlugin as n, KyselyGeneratorID as t };
|
|
18
|
+
//# sourceMappingURL=index-BKXch-td.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
|
+
import { u as Plugin } from "./types-DdvTxFiD.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/builtin/file-utils/index.d.ts
|
|
5
|
+
declare const FileUtilsGeneratorID = "@tailor-platform/file-utils";
|
|
6
|
+
type FileUtilsPluginOptions = {
|
|
7
|
+
distPath: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Plugin that generates TypeWithFiles interface from TailorDB type definitions.
|
|
11
|
+
* @param options - Plugin options
|
|
12
|
+
* @param options.distPath - Output file path for generated file utilities
|
|
13
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
14
|
+
*/
|
|
15
|
+
declare function fileUtilsPlugin(options: FileUtilsPluginOptions): Plugin<unknown, FileUtilsPluginOptions>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { fileUtilsPlugin as n, FileUtilsGeneratorID as t };
|
|
18
|
+
//# sourceMappingURL=index-C3Ib7pFc.d.mts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference path="./user-defined.d.ts" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { A as AuthAccessTokenTrigger$1, B as ResolverExecutedTrigger$1, Bt as TailorActor, Ct as FieldMetadata, Dt as TailorAnyField, Et as TailorFieldType, F as FunctionOperation$1, Ft as InferFieldsOutput, Gt as AllowedValues, H as WebhookOperation$1, I as GqlOperation$1, It as JsonCompatible, J as AuthServiceInput, K as AuthInvoker$1, Kt as AllowedValuesOutput, L as IdpUserTrigger$1, Lt as output$1, M as ExecutorInput, Mt as ResolverInput, Ot as TailorField, R as IncomingWebhookTrigger$1, St as DefinedFieldMetadata, Tt as FieldOutput, U as WorkflowOperation$1, Ut as TailorUser, V as ScheduleTriggerInput, X as DefinedAuth, dt as UserAttributeListKey, ft as UserAttributeMap, ht as GeneratorConfig, o as TailorDBInstance, s as TailorDBType, u as Plugin, wt as FieldOptions, xt as ArrayFieldOutput, z as RecordTrigger$1, zt as TailorEnv } from "./types-DdvTxFiD.mjs";
|
|
3
|
+
import { a as IdpDefinitionBrand, i as IdPInput, t as AppConfig } from "./types-Bhl_wAM2.mjs";
|
|
4
4
|
import * as zod0 from "zod";
|
|
5
5
|
import { JsonPrimitive, Jsonifiable, Jsonify } from "type-fest";
|
|
6
6
|
import { Client } from "@urql/core";
|
|
@@ -110,6 +110,7 @@ type ResolverConfig = ReturnType<typeof createResolver<any, any>>;
|
|
|
110
110
|
*/
|
|
111
111
|
type WorkflowJobContext = {
|
|
112
112
|
env: TailorEnv;
|
|
113
|
+
user: TailorUser;
|
|
113
114
|
};
|
|
114
115
|
/**
|
|
115
116
|
* Allowed output types for workflow job body functions.
|
|
@@ -213,6 +214,11 @@ type WorkflowJobBody<I, O> = IsValidInput<I> extends true ? IsValidOutput<O> ext
|
|
|
213
214
|
* Contains JSON-serialized TailorEnv object.
|
|
214
215
|
*/
|
|
215
216
|
declare const WORKFLOW_TEST_ENV_KEY = "TAILOR_TEST_WORKFLOW_ENV";
|
|
217
|
+
/**
|
|
218
|
+
* Environment variable key for workflow user testing.
|
|
219
|
+
* Contains JSON-serialized TailorUser object.
|
|
220
|
+
*/
|
|
221
|
+
declare const WORKFLOW_TEST_USER_KEY = "TAILOR_TEST_WORKFLOW_USER";
|
|
216
222
|
/**
|
|
217
223
|
* Create a workflow job definition.
|
|
218
224
|
*
|
|
@@ -627,6 +633,7 @@ declare function defineIdp<const TClients extends string[]>(name: string, config
|
|
|
627
633
|
declare function defineConfig<const Config extends AppConfig & Record<Exclude<keyof Config, keyof AppConfig>, never>>(config: Config): Config;
|
|
628
634
|
/**
|
|
629
635
|
* Define generators to be used with the Tailor SDK.
|
|
636
|
+
* @deprecated Use definePlugins() with generation hooks (onTypeLoaded, generate, etc.) instead.
|
|
630
637
|
* @param configs - Generator configurations
|
|
631
638
|
* @returns Generator configurations as given
|
|
632
639
|
*/
|
|
@@ -657,7 +664,7 @@ declare function defineGenerators(...configs: GeneratorConfig[]): (["@tailor-pla
|
|
|
657
664
|
* @param configs - Plugin configurations
|
|
658
665
|
* @returns Plugin configurations as given
|
|
659
666
|
*/
|
|
660
|
-
declare function definePlugins(...configs: Plugin[]): Plugin<
|
|
667
|
+
declare function definePlugins(...configs: Plugin<any, any>[]): Plugin<any, any>[];
|
|
661
668
|
//#endregion
|
|
662
669
|
//#region src/configure/index.d.ts
|
|
663
670
|
type TailorOutput<T> = output$1<T>;
|
|
@@ -730,5 +737,5 @@ declare namespace t {
|
|
|
730
737
|
type infer<T> = TailorOutput<T>;
|
|
731
738
|
}
|
|
732
739
|
//#endregion
|
|
733
|
-
export {
|
|
734
|
-
//# sourceMappingURL=index-
|
|
740
|
+
export { AuthInvoker as $, idpUserCreatedTrigger as A, WebhookOperation as B, RecordTrigger as C, authAccessTokenIssuedTrigger as D, ResolverExecutedTrigger as E, recordUpdatedTrigger as F, WORKFLOW_TEST_ENV_KEY as G, Workflow as H, resolverExecutedTrigger as I, WorkflowJobContext as J, WORKFLOW_TEST_USER_KEY as K, FunctionOperation as L, idpUserUpdatedTrigger as M, recordCreatedTrigger as N, authAccessTokenRefreshedTrigger as O, recordDeletedTrigger as P, createResolver as Q, GqlOperation as R, RecordDeletedArgs as S, ResolverExecutedArgs as T, WorkflowConfig as U, WorkflowOperation as V, createWorkflow as W, WorkflowJobOutput as X, WorkflowJobInput as Y, createWorkflowJob as Z, AuthAccessTokenArgs as _, defineGenerators as a, IdpUserTrigger as b, createExecutor as c, IncomingWebhookRequest as d, defineAuth as et, IncomingWebhookTrigger as f, scheduleTrigger as g, ScheduleTrigger as h, defineConfig as i, idpUserDeletedTrigger as j, authAccessTokenRevokedTrigger as k, Trigger as l, ScheduleArgs as m, output as n, definePlugins as o, incomingWebhookTrigger as p, WorkflowJob as q, t as r, defineIdp as s, infer as t, IncomingWebhookArgs as u, AuthAccessTokenTrigger as v, RecordUpdatedArgs as w, RecordCreatedArgs as x, IdpUserArgs as y, Operation as z };
|
|
741
|
+
//# sourceMappingURL=index-DP8EB9FK.d.mts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
|
+
import { u as Plugin } from "./types-DdvTxFiD.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/builtin/seed/index.d.ts
|
|
5
|
+
declare const SeedGeneratorID = "@tailor-platform/seed";
|
|
6
|
+
type SeedPluginOptions = {
|
|
7
|
+
distPath: string;
|
|
8
|
+
machineUserName?: string;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Plugin that generates seed data files with Kysely batch insert and tailor.idp.Client for _User.
|
|
12
|
+
* @param options - Plugin options
|
|
13
|
+
* @param options.distPath - Output directory path for generated seed files
|
|
14
|
+
* @param options.machineUserName - Default machine user name for authentication
|
|
15
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
16
|
+
*/
|
|
17
|
+
declare function seedPlugin(options: SeedPluginOptions): Plugin<unknown, SeedPluginOptions>;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { seedPlugin as n, SeedGeneratorID as t };
|
|
20
|
+
//# sourceMappingURL=index-SqWgrTnF.d.mts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference path="./user-defined.d.ts" />
|
|
2
|
+
import { u as Plugin } from "./types-DdvTxFiD.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/plugin/builtin/enum-constants/index.d.ts
|
|
5
|
+
declare const EnumConstantsGeneratorID = "@tailor-platform/enum-constants";
|
|
6
|
+
type EnumConstantsPluginOptions = {
|
|
7
|
+
distPath: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Plugin that generates enum constants from TailorDB type definitions.
|
|
11
|
+
* @param options - Plugin options
|
|
12
|
+
* @param options.distPath - Output file path for generated constants
|
|
13
|
+
* @returns Plugin instance with onTailorDBReady hook
|
|
14
|
+
*/
|
|
15
|
+
declare function enumConstantsPlugin(options: EnumConstantsPluginOptions): Plugin<unknown, EnumConstantsPluginOptions>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { enumConstantsPlugin as n, EnumConstantsGeneratorID as t };
|
|
18
|
+
//# sourceMappingURL=index-sSDpuVQY.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as __require, n as __esmMin, o as __toESM, t as __commonJSMin } from "./chunk-
|
|
1
|
+
import { i as __require, n as __esmMin, o as __toESM, t as __commonJSMin } from "./chunk-CqAI0b6X.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
|
|
4
4
|
//#region ../../node_modules/jiti/dist/jiti.cjs
|
|
@@ -4479,4 +4479,4 @@ var init_jiti = __esmMin((() => {
|
|
|
4479
4479
|
//#endregion
|
|
4480
4480
|
init_jiti();
|
|
4481
4481
|
export { createJiti };
|
|
4482
|
-
//# sourceMappingURL=jiti-
|
|
4482
|
+
//# sourceMappingURL=jiti-DHlauMCo.mjs.map
|