@base44-preview/cli 0.0.1-pr.9.9888a05 → 0.0.2-pr.23.6657a26

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 (147) hide show
  1. package/README.md +121 -24
  2. package/dist/cli/index.js +19302 -14
  3. package/dist/cli/templates/backend-and-client/README.md +41 -0
  4. package/dist/cli/templates/backend-and-client/base44/config.jsonc.ejs +17 -0
  5. package/dist/cli/templates/backend-and-client/base44/entities/task.jsonc +16 -0
  6. package/dist/cli/templates/backend-and-client/components.json +16 -0
  7. package/dist/cli/templates/backend-and-client/index.html +13 -0
  8. package/dist/cli/templates/backend-and-client/jsconfig.json +13 -0
  9. package/dist/cli/templates/backend-and-client/package.json +24 -0
  10. package/dist/cli/templates/backend-and-client/postcss.config.js +6 -0
  11. package/dist/cli/templates/backend-and-client/src/App.jsx +148 -0
  12. package/dist/cli/templates/backend-and-client/src/api/base44Client.js.ejs +5 -0
  13. package/dist/cli/templates/backend-and-client/src/components/Base44Logo.jsx +15 -0
  14. package/dist/cli/templates/backend-and-client/src/components/ui/button.jsx +23 -0
  15. package/dist/cli/templates/backend-and-client/src/components/ui/checkbox.jsx +20 -0
  16. package/dist/cli/templates/backend-and-client/src/components/ui/input.jsx +13 -0
  17. package/dist/cli/templates/backend-and-client/src/index.css +37 -0
  18. package/dist/cli/templates/backend-and-client/src/main.jsx +6 -0
  19. package/dist/cli/templates/backend-and-client/tailwind.config.js +41 -0
  20. package/dist/cli/templates/backend-and-client/vite.config.js +12 -0
  21. package/dist/cli/templates/backend-only/base44/.env.local.ejs +6 -0
  22. package/dist/cli/templates/backend-only/base44/config.jsonc.ejs +17 -0
  23. package/dist/cli/templates/templates.json +16 -0
  24. package/package.json +19 -18
  25. package/dist/cli/commands/auth/login.d.ts +0 -3
  26. package/dist/cli/commands/auth/login.d.ts.map +0 -1
  27. package/dist/cli/commands/auth/login.js +0 -66
  28. package/dist/cli/commands/auth/login.js.map +0 -1
  29. package/dist/cli/commands/auth/logout.d.ts +0 -3
  30. package/dist/cli/commands/auth/logout.d.ts.map +0 -1
  31. package/dist/cli/commands/auth/logout.js +0 -14
  32. package/dist/cli/commands/auth/logout.js.map +0 -1
  33. package/dist/cli/commands/auth/whoami.d.ts +0 -3
  34. package/dist/cli/commands/auth/whoami.d.ts.map +0 -1
  35. package/dist/cli/commands/auth/whoami.js +0 -14
  36. package/dist/cli/commands/auth/whoami.js.map +0 -1
  37. package/dist/cli/commands/project/show-project.d.ts +0 -3
  38. package/dist/cli/commands/project/show-project.d.ts.map +0 -1
  39. package/dist/cli/commands/project/show-project.js +0 -20
  40. package/dist/cli/commands/project/show-project.js.map +0 -1
  41. package/dist/cli/index.d.ts +0 -3
  42. package/dist/cli/index.d.ts.map +0 -1
  43. package/dist/cli/index.js.map +0 -1
  44. package/dist/cli/utils/index.d.ts +0 -4
  45. package/dist/cli/utils/index.d.ts.map +0 -1
  46. package/dist/cli/utils/index.js +0 -4
  47. package/dist/cli/utils/index.js.map +0 -1
  48. package/dist/cli/utils/packageVersion.d.ts +0 -2
  49. package/dist/cli/utils/packageVersion.d.ts.map +0 -1
  50. package/dist/cli/utils/packageVersion.js +0 -12
  51. package/dist/cli/utils/packageVersion.js.map +0 -1
  52. package/dist/cli/utils/runCommand.d.ts +0 -8
  53. package/dist/cli/utils/runCommand.d.ts.map +0 -1
  54. package/dist/cli/utils/runCommand.js +0 -30
  55. package/dist/cli/utils/runCommand.js.map +0 -1
  56. package/dist/cli/utils/runTask.d.ts +0 -14
  57. package/dist/cli/utils/runTask.d.ts.map +0 -1
  58. package/dist/cli/utils/runTask.js +0 -24
  59. package/dist/cli/utils/runTask.js.map +0 -1
  60. package/dist/core/auth/api.d.ts +0 -4
  61. package/dist/core/auth/api.d.ts.map +0 -1
  62. package/dist/core/auth/api.js +0 -70
  63. package/dist/core/auth/api.js.map +0 -1
  64. package/dist/core/auth/config.d.ts +0 -5
  65. package/dist/core/auth/config.d.ts.map +0 -1
  66. package/dist/core/auth/config.js +0 -47
  67. package/dist/core/auth/config.js.map +0 -1
  68. package/dist/core/auth/index.d.ts +0 -4
  69. package/dist/core/auth/index.d.ts.map +0 -1
  70. package/dist/core/auth/index.js +0 -4
  71. package/dist/core/auth/index.js.map +0 -1
  72. package/dist/core/auth/schema.d.ts +0 -21
  73. package/dist/core/auth/schema.d.ts.map +0 -1
  74. package/dist/core/auth/schema.js +0 -20
  75. package/dist/core/auth/schema.js.map +0 -1
  76. package/dist/core/config/app.d.ts +0 -22
  77. package/dist/core/config/app.d.ts.map +0 -1
  78. package/dist/core/config/app.js +0 -14
  79. package/dist/core/config/app.js.map +0 -1
  80. package/dist/core/config/index.d.ts +0 -4
  81. package/dist/core/config/index.d.ts.map +0 -1
  82. package/dist/core/config/index.js +0 -3
  83. package/dist/core/config/index.js.map +0 -1
  84. package/dist/core/config/project.d.ts +0 -25
  85. package/dist/core/config/project.d.ts.map +0 -1
  86. package/dist/core/config/project.js +0 -62
  87. package/dist/core/config/project.js.map +0 -1
  88. package/dist/core/config/resource.d.ts +0 -4
  89. package/dist/core/config/resource.d.ts.map +0 -1
  90. package/dist/core/config/resource.js +0 -2
  91. package/dist/core/config/resource.js.map +0 -1
  92. package/dist/core/consts.d.ts +0 -6
  93. package/dist/core/consts.d.ts.map +0 -1
  94. package/dist/core/consts.js +0 -19
  95. package/dist/core/consts.js.map +0 -1
  96. package/dist/core/errors.d.ts +0 -15
  97. package/dist/core/errors.d.ts.map +0 -1
  98. package/dist/core/errors.js +0 -17
  99. package/dist/core/errors.js.map +0 -1
  100. package/dist/core/index.d.ts +0 -6
  101. package/dist/core/index.d.ts.map +0 -1
  102. package/dist/core/index.js +0 -6
  103. package/dist/core/index.js.map +0 -1
  104. package/dist/core/resources/entity/config.d.ts +0 -3
  105. package/dist/core/resources/entity/config.d.ts.map +0 -1
  106. package/dist/core/resources/entity/config.js +0 -25
  107. package/dist/core/resources/entity/config.js.map +0 -1
  108. package/dist/core/resources/entity/index.d.ts +0 -4
  109. package/dist/core/resources/entity/index.d.ts.map +0 -1
  110. package/dist/core/resources/entity/index.js +0 -4
  111. package/dist/core/resources/entity/index.js.map +0 -1
  112. package/dist/core/resources/entity/resource.d.ts +0 -4
  113. package/dist/core/resources/entity/resource.d.ts.map +0 -1
  114. package/dist/core/resources/entity/resource.js +0 -5
  115. package/dist/core/resources/entity/resource.js.map +0 -1
  116. package/dist/core/resources/entity/schema.d.ts +0 -47
  117. package/dist/core/resources/entity/schema.d.ts.map +0 -1
  118. package/dist/core/resources/entity/schema.js +0 -29
  119. package/dist/core/resources/entity/schema.js.map +0 -1
  120. package/dist/core/resources/function/config.d.ts +0 -4
  121. package/dist/core/resources/function/config.d.ts.map +0 -1
  122. package/dist/core/resources/function/config.js +0 -26
  123. package/dist/core/resources/function/config.js.map +0 -1
  124. package/dist/core/resources/function/index.d.ts +0 -4
  125. package/dist/core/resources/function/index.d.ts.map +0 -1
  126. package/dist/core/resources/function/index.js +0 -4
  127. package/dist/core/resources/function/index.js.map +0 -1
  128. package/dist/core/resources/function/resource.d.ts +0 -4
  129. package/dist/core/resources/function/resource.d.ts.map +0 -1
  130. package/dist/core/resources/function/resource.js +0 -5
  131. package/dist/core/resources/function/resource.js.map +0 -1
  132. package/dist/core/resources/function/schema.d.ts +0 -91
  133. package/dist/core/resources/function/schema.d.ts.map +0 -1
  134. package/dist/core/resources/function/schema.js +0 -36
  135. package/dist/core/resources/function/schema.js.map +0 -1
  136. package/dist/core/resources/index.d.ts +0 -3
  137. package/dist/core/resources/index.d.ts.map +0 -1
  138. package/dist/core/resources/index.js +0 -3
  139. package/dist/core/resources/index.js.map +0 -1
  140. package/dist/core/utils/fs.d.ts +0 -5
  141. package/dist/core/utils/fs.d.ts.map +0 -1
  142. package/dist/core/utils/fs.js +0 -56
  143. package/dist/core/utils/fs.js.map +0 -1
  144. package/dist/core/utils/index.d.ts +0 -2
  145. package/dist/core/utils/index.d.ts.map +0 -1
  146. package/dist/core/utils/index.js +0 -2
  147. package/dist/core/utils/index.js.map +0 -1
@@ -1,25 +0,0 @@
1
- import { z } from "zod";
2
- import type { Entity } from "../resources/entity/index.js";
3
- import type { FunctionConfig } from "../resources/function/index.js";
4
- export declare const ProjectConfigSchema: z.ZodObject<{
5
- name: z.ZodString;
6
- entitySrc: z.ZodDefault<z.ZodString>;
7
- functionSrc: z.ZodDefault<z.ZodString>;
8
- }, z.core.$loose>;
9
- export type ProjectConfig = z.infer<typeof ProjectConfigSchema>;
10
- export interface ProjectWithPaths extends ProjectConfig {
11
- root: string;
12
- configPath: string;
13
- }
14
- export interface ProjectRoot {
15
- root: string;
16
- configPath: string;
17
- }
18
- export interface ProjectData {
19
- project: ProjectWithPaths;
20
- entities: Entity[];
21
- functions: FunctionConfig[];
22
- }
23
- export declare function findProjectRoot(startPath?: string): Promise<ProjectRoot | null>;
24
- export declare function readProjectConfig(projectRoot?: string): Promise<ProjectData>;
25
- //# sourceMappingURL=project.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../../../src/core/config/project.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AAE3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAErE,eAAO,MAAM,mBAAmB;;;;iBAI9B,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,gBAAgB,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAUD,wBAAsB,eAAe,CACnC,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAY7B;AAED,wBAAsB,iBAAiB,CACrC,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,WAAW,CAAC,CAuCtB"}
@@ -1,62 +0,0 @@
1
- import { join, dirname } from "node:path";
2
- import { z } from "zod";
3
- import { globby } from "globby";
4
- import { getProjectConfigPatterns, PROJECT_SUBDIR } from "../consts.js";
5
- import { readJsonFile } from "../utils/fs.js";
6
- import { entityResource } from "../resources/entity/index.js";
7
- import { functionResource } from "../resources/function/index.js";
8
- export const ProjectConfigSchema = z.looseObject({
9
- name: z.string().min(1, "Project name cannot be empty"),
10
- entitySrc: z.string().default("./entities"),
11
- functionSrc: z.string().default("./functions"),
12
- });
13
- async function findConfigInDir(dir) {
14
- const files = await globby(getProjectConfigPatterns(), {
15
- cwd: dir,
16
- absolute: true,
17
- });
18
- return files[0] ?? null;
19
- }
20
- export async function findProjectRoot(startPath) {
21
- let current = startPath || process.cwd();
22
- while (current !== dirname(current)) {
23
- const configPath = await findConfigInDir(current);
24
- if (configPath) {
25
- return { root: current, configPath };
26
- }
27
- current = dirname(current);
28
- }
29
- return null;
30
- }
31
- export async function readProjectConfig(projectRoot) {
32
- let found;
33
- if (projectRoot) {
34
- const configPath = await findConfigInDir(projectRoot);
35
- found = configPath ? { root: projectRoot, configPath } : null;
36
- }
37
- else {
38
- found = await findProjectRoot();
39
- }
40
- if (!found) {
41
- throw new Error(`Project root not found. Please ensure config.jsonc or config.json exists in the project directory or ${PROJECT_SUBDIR}/ subdirectory.`);
42
- }
43
- const { root, configPath } = found;
44
- const parsed = await readJsonFile(configPath);
45
- const result = ProjectConfigSchema.safeParse(parsed);
46
- if (!result.success) {
47
- const errors = result.error.issues.map((e) => e.message).join(", ");
48
- throw new Error(`Invalid project configuration: ${errors}`);
49
- }
50
- const project = result.data;
51
- const configDir = dirname(configPath);
52
- const [entities, functions] = await Promise.all([
53
- entityResource.readAll(join(configDir, project.entitySrc)),
54
- functionResource.readAll(join(configDir, project.functionSrc)),
55
- ]);
56
- return {
57
- project: { ...project, root, configPath },
58
- entities,
59
- functions,
60
- };
61
- }
62
- //# sourceMappingURL=project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../src/core/config/project.ts"],"names":[],"mappings":"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"}
@@ -1,4 +0,0 @@
1
- export interface Resource<T> {
2
- readAll: (dir: string) => Promise<T[]>;
3
- }
4
- //# sourceMappingURL=resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../src/core/config/resource.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;CACxC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../src/core/config/resource.ts"],"names":[],"mappings":""}
@@ -1,6 +0,0 @@
1
- export declare const PROJECT_SUBDIR = "base44";
2
- export declare const FUNCTION_CONFIG_FILE = "function.jsonc";
3
- export declare function getBase44Dir(): string;
4
- export declare function getAuthFilePath(): string;
5
- export declare function getProjectConfigPatterns(): string[];
6
- //# sourceMappingURL=consts.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../../src/core/consts.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,eAAO,MAAM,oBAAoB,mBAAmB,CAAC;AAErD,wBAAgB,YAAY,WAE3B;AAED,wBAAgB,eAAe,WAE9B;AAED,wBAAgB,wBAAwB,aAOvC"}
@@ -1,19 +0,0 @@
1
- import { join } from "node:path";
2
- import { homedir } from "node:os";
3
- export const PROJECT_SUBDIR = "base44";
4
- export const FUNCTION_CONFIG_FILE = "function.jsonc";
5
- export function getBase44Dir() {
6
- return join(homedir(), ".base44");
7
- }
8
- export function getAuthFilePath() {
9
- return join(getBase44Dir(), "auth", "auth.json");
10
- }
11
- export function getProjectConfigPatterns() {
12
- return [
13
- `${PROJECT_SUBDIR}/config.jsonc`,
14
- `${PROJECT_SUBDIR}/config.json`,
15
- "config.jsonc",
16
- "config.json",
17
- ];
18
- }
19
- //# sourceMappingURL=consts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../../src/core/consts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAElC,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC;AAErD,MAAM,UAAU,YAAY;IAC1B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,OAAO,IAAI,CAAC,YAAY,EAAE,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;AACnD,CAAC;AAED,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,GAAG,cAAc,eAAe;QAChC,GAAG,cAAc,cAAc;QAC/B,cAAc;QACd,aAAa;KACd,CAAC;AACJ,CAAC"}
@@ -1,15 +0,0 @@
1
- export declare class AuthApiError extends Error {
2
- readonly cause?: unknown | undefined;
3
- constructor(message: string, cause?: unknown | undefined);
4
- }
5
- export declare class AuthValidationError extends Error {
6
- readonly issues: Array<{
7
- message: string;
8
- path: string[];
9
- }>;
10
- constructor(message: string, issues: Array<{
11
- message: string;
12
- path: string[];
13
- }>);
14
- }
15
- //# sourceMappingURL=errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,YAAa,SAAQ,KAAK;aACQ,KAAK,CAAC,EAAE,OAAO;gBAAhD,OAAO,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,OAAO,YAAA;CAI7D;AAED,qBAAa,mBAAoB,SAAQ,KAAK;aAG1B,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;gBADlE,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAKrE"}
@@ -1,17 +0,0 @@
1
- export class AuthApiError extends Error {
2
- cause;
3
- constructor(message, cause) {
4
- super(message);
5
- this.cause = cause;
6
- this.name = "AuthApiError";
7
- }
8
- }
9
- export class AuthValidationError extends Error {
10
- issues;
11
- constructor(message, issues) {
12
- super(message);
13
- this.issues = issues;
14
- this.name = "AuthValidationError";
15
- }
16
- }
17
- //# sourceMappingURL=errors.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/core/errors.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,YAAa,SAAQ,KAAK;IACQ;IAA7C,YAAY,OAAe,EAAkB,KAAe;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QAD4B,UAAK,GAAL,KAAK,CAAU;QAE1D,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,KAAK;IAG1B;IAFlB,YACE,OAAe,EACC,MAAkD;QAElE,KAAK,CAAC,OAAO,CAAC,CAAC;QAFC,WAAM,GAAN,MAAM,CAA4C;QAGlE,IAAI,CAAC,IAAI,GAAG,qBAAqB,CAAC;IACpC,CAAC;CACF"}
@@ -1,6 +0,0 @@
1
- export * from "./auth/index.js";
2
- export * from "./resources/index.js";
3
- export * from "./config/index.js";
4
- export * from "./utils/index.js";
5
- export * from "./errors.js";
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
@@ -1,6 +0,0 @@
1
- export * from "./auth/index.js";
2
- export * from "./resources/index.js";
3
- export * from "./config/index.js";
4
- export * from "./utils/index.js";
5
- export * from "./errors.js";
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC"}
@@ -1,3 +0,0 @@
1
- import type { Entity } from "./schema.js";
2
- export declare function readAllEntities(entitiesDir: string): Promise<Entity[]>;
3
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/entity/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAiB1C,wBAAsB,eAAe,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAe5E"}
@@ -1,25 +0,0 @@
1
- import { globby } from "globby";
2
- import { readJsonFile, pathExists } from "../../utils/fs.js";
3
- import { EntitySchema } from "./schema.js";
4
- async function readEntityFile(entityPath) {
5
- const parsed = await readJsonFile(entityPath);
6
- const result = EntitySchema.safeParse(parsed);
7
- if (!result.success) {
8
- throw new Error(`Invalid entity configuration in ${entityPath}: ${result.error.issues
9
- .map((e) => e.message)
10
- .join(", ")}`);
11
- }
12
- return result.data;
13
- }
14
- export async function readAllEntities(entitiesDir) {
15
- if (!(await pathExists(entitiesDir))) {
16
- return [];
17
- }
18
- const files = await globby("*.{json,jsonc}", {
19
- cwd: entitiesDir,
20
- absolute: true,
21
- });
22
- const entities = await Promise.all(files.map((filePath) => readEntityFile(filePath)));
23
- return entities;
24
- }
25
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/core/resources/entity/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG3C,KAAK,UAAU,cAAc,CAAC,UAAkB;IAC9C,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,YAAY,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAE9C,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,mCAAmC,UAAU,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM;aAClE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;aACrB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,WAAmB;IACvD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC;QACrC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,gBAAgB,EAAE;QAC3C,GAAG,EAAE,WAAW;QAChB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,GAAG,CAChC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC,CAClD,CAAC;IAEF,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./schema.js";
2
- export * from "./config.js";
3
- export * from "./resource.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./schema.js";
2
- export * from "./config.js";
3
- export * from "./resource.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/resources/entity/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { Resource } from "../../config/resource.js";
2
- import type { Entity } from "./schema.js";
3
- export declare const entityResource: Resource<Entity>;
4
- //# sourceMappingURL=resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/entity/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAE3C,CAAC"}
@@ -1,5 +0,0 @@
1
- import { readAllEntities } from "./config.js";
2
- export const entityResource = {
3
- readAll: readAllEntities,
4
- };
5
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../../src/core/resources/entity/resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C,OAAO,EAAE,eAAe;CACzB,CAAC"}
@@ -1,47 +0,0 @@
1
- import { z } from "zod";
2
- declare const EntityPropertySchema: z.ZodObject<{
3
- type: z.ZodString;
4
- description: z.ZodOptional<z.ZodString>;
5
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
- default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
7
- format: z.ZodOptional<z.ZodString>;
8
- items: z.ZodOptional<z.ZodAny>;
9
- relation: z.ZodOptional<z.ZodObject<{
10
- entity: z.ZodString;
11
- type: z.ZodString;
12
- }, z.core.$strip>>;
13
- }, z.core.$strip>;
14
- declare const EntityPoliciesSchema: z.ZodObject<{
15
- read: z.ZodOptional<z.ZodString>;
16
- create: z.ZodOptional<z.ZodString>;
17
- update: z.ZodOptional<z.ZodString>;
18
- delete: z.ZodOptional<z.ZodString>;
19
- }, z.core.$strip>;
20
- export declare const EntitySchema: z.ZodObject<{
21
- name: z.ZodString;
22
- type: z.ZodLiteral<"object">;
23
- properties: z.ZodRecord<z.ZodString, z.ZodObject<{
24
- type: z.ZodString;
25
- description: z.ZodOptional<z.ZodString>;
26
- enum: z.ZodOptional<z.ZodArray<z.ZodString>>;
27
- default: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
28
- format: z.ZodOptional<z.ZodString>;
29
- items: z.ZodOptional<z.ZodAny>;
30
- relation: z.ZodOptional<z.ZodObject<{
31
- entity: z.ZodString;
32
- type: z.ZodString;
33
- }, z.core.$strip>>;
34
- }, z.core.$strip>>;
35
- required: z.ZodOptional<z.ZodArray<z.ZodString>>;
36
- policies: z.ZodOptional<z.ZodObject<{
37
- read: z.ZodOptional<z.ZodString>;
38
- create: z.ZodOptional<z.ZodString>;
39
- update: z.ZodOptional<z.ZodString>;
40
- delete: z.ZodOptional<z.ZodString>;
41
- }, z.core.$strip>>;
42
- }, z.core.$strip>;
43
- export type EntityProperty = z.infer<typeof EntityPropertySchema>;
44
- export type EntityPolicies = z.infer<typeof EntityPoliciesSchema>;
45
- export type Entity = z.infer<typeof EntitySchema>;
46
- export {};
47
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/entity/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,oBAAoB;;;;;;;;;;;iBAaxB,CAAC;AAEH,QAAA,MAAM,oBAAoB;;;;;iBAKxB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;iBAMvB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC"}
@@ -1,29 +0,0 @@
1
- import { z } from "zod";
2
- const EntityPropertySchema = z.object({
3
- type: z.string(),
4
- description: z.string().optional(),
5
- enum: z.array(z.string()).optional(),
6
- default: z.union([z.string(), z.number(), z.boolean()]).optional(),
7
- format: z.string().optional(),
8
- items: z.any().optional(),
9
- relation: z
10
- .object({
11
- entity: z.string(),
12
- type: z.string(),
13
- })
14
- .optional(),
15
- });
16
- const EntityPoliciesSchema = z.object({
17
- read: z.string().optional(),
18
- create: z.string().optional(),
19
- update: z.string().optional(),
20
- delete: z.string().optional(),
21
- });
22
- export const EntitySchema = z.object({
23
- name: z.string().min(1, "Entity name cannot be empty"),
24
- type: z.literal("object"),
25
- properties: z.record(z.string(), EntityPropertySchema),
26
- required: z.array(z.string()).optional(),
27
- policies: EntityPoliciesSchema.optional(),
28
- });
29
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/core/resources/entity/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACpC,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE;IAClE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,KAAK,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzB,QAAQ,EAAE,CAAC;SACR,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;KACjB,CAAC;SACD,QAAQ,EAAE;CACd,CAAC,CAAC;AAEH,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACpC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,6BAA6B,CAAC;IACtD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IACzB,UAAU,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,oBAAoB,CAAC;IACtD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACxC,QAAQ,EAAE,oBAAoB,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { FunctionConfig } from "./schema.js";
2
- export declare function readFunctionConfig(configPath: string): Promise<FunctionConfig>;
3
- export declare function readAllFunctions(functionsDir: string): Promise<FunctionConfig[]>;
4
- //# sourceMappingURL=config.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/function/config.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,cAAc,CAAC,CAazB;AAED,wBAAsB,gBAAgB,CACpC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,cAAc,EAAE,CAAC,CAe3B"}
@@ -1,26 +0,0 @@
1
- import { globby } from "globby";
2
- import { FUNCTION_CONFIG_FILE } from "../../consts.js";
3
- import { readJsonFile, pathExists } from "../../utils/fs.js";
4
- import { FunctionConfigSchema } from "./schema.js";
5
- export async function readFunctionConfig(configPath) {
6
- const parsed = await readJsonFile(configPath);
7
- const result = FunctionConfigSchema.safeParse(parsed);
8
- if (!result.success) {
9
- throw new Error(`Invalid function configuration in ${configPath}: ${result.error.issues
10
- .map((e) => e.message)
11
- .join(", ")}`);
12
- }
13
- return result.data;
14
- }
15
- export async function readAllFunctions(functionsDir) {
16
- if (!(await pathExists(functionsDir))) {
17
- return [];
18
- }
19
- const configFiles = await globby(`*/${FUNCTION_CONFIG_FILE}`, {
20
- cwd: functionsDir,
21
- absolute: true,
22
- });
23
- const functionConfigs = await Promise.all(configFiles.map((configPath) => readFunctionConfig(configPath)));
24
- return functionConfigs;
25
- }
26
- //# sourceMappingURL=config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/core/resources/function/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGnD,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,UAAkB;IAElB,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,UAAU,CAAC,CAAC;IAC9C,MAAM,MAAM,GAAG,oBAAoB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IAEtD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CACb,qCAAqC,UAAU,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM;aACpE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;aACrB,IAAI,CAAC,IAAI,CAAC,EAAE,CAChB,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,YAAoB;IAEpB,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,MAAM,CAAC,KAAK,oBAAoB,EAAE,EAAE;QAC5D,GAAG,EAAE,YAAY;QACjB,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,eAAe,GAAG,MAAM,OAAO,CAAC,GAAG,CACvC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAChE,CAAC;IAEF,OAAO,eAAe,CAAC;AACzB,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./schema.js";
2
- export * from "./config.js";
3
- export * from "./resource.js";
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- export * from "./schema.js";
2
- export * from "./config.js";
3
- export * from "./resource.js";
4
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/resources/function/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { Resource } from "../../config/resource.js";
2
- import type { FunctionConfig } from "./schema.js";
3
- export declare const functionResource: Resource<FunctionConfig>;
4
- //# sourceMappingURL=resource.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/function/resource.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGlD,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,cAAc,CAErD,CAAC"}
@@ -1,5 +0,0 @@
1
- import { readAllFunctions } from "./config.js";
2
- export const functionResource = {
3
- readAll: readAllFunctions,
4
- };
5
- //# sourceMappingURL=resource.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resource.js","sourceRoot":"","sources":["../../../../src/core/resources/function/resource.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,OAAO,EAAE,gBAAgB;CAC1B,CAAC"}
@@ -1,91 +0,0 @@
1
- import { z } from "zod";
2
- declare const HttpTriggerSchema: z.ZodObject<{
3
- id: z.ZodOptional<z.ZodString>;
4
- name: z.ZodOptional<z.ZodString>;
5
- description: z.ZodOptional<z.ZodString>;
6
- type: z.ZodLiteral<"http">;
7
- path: z.ZodString;
8
- }, z.core.$strip>;
9
- declare const ScheduleTriggerSchema: z.ZodObject<{
10
- id: z.ZodOptional<z.ZodString>;
11
- name: z.ZodOptional<z.ZodString>;
12
- description: z.ZodOptional<z.ZodString>;
13
- type: z.ZodLiteral<"schedule">;
14
- scheduleMode: z.ZodOptional<z.ZodEnum<{
15
- recurring: "recurring";
16
- once: "once";
17
- }>>;
18
- cron: z.ZodString;
19
- isActive: z.ZodOptional<z.ZodBoolean>;
20
- timezone: z.ZodOptional<z.ZodString>;
21
- }, z.core.$strip>;
22
- declare const EventTriggerSchema: z.ZodObject<{
23
- id: z.ZodOptional<z.ZodString>;
24
- name: z.ZodOptional<z.ZodString>;
25
- description: z.ZodOptional<z.ZodString>;
26
- type: z.ZodLiteral<"event">;
27
- entity: z.ZodString;
28
- event: z.ZodString;
29
- }, z.core.$strip>;
30
- declare const TriggerSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
31
- id: z.ZodOptional<z.ZodString>;
32
- name: z.ZodOptional<z.ZodString>;
33
- description: z.ZodOptional<z.ZodString>;
34
- type: z.ZodLiteral<"http">;
35
- path: z.ZodString;
36
- }, z.core.$strip>, z.ZodObject<{
37
- id: z.ZodOptional<z.ZodString>;
38
- name: z.ZodOptional<z.ZodString>;
39
- description: z.ZodOptional<z.ZodString>;
40
- type: z.ZodLiteral<"schedule">;
41
- scheduleMode: z.ZodOptional<z.ZodEnum<{
42
- recurring: "recurring";
43
- once: "once";
44
- }>>;
45
- cron: z.ZodString;
46
- isActive: z.ZodOptional<z.ZodBoolean>;
47
- timezone: z.ZodOptional<z.ZodString>;
48
- }, z.core.$strip>, z.ZodObject<{
49
- id: z.ZodOptional<z.ZodString>;
50
- name: z.ZodOptional<z.ZodString>;
51
- description: z.ZodOptional<z.ZodString>;
52
- type: z.ZodLiteral<"event">;
53
- entity: z.ZodString;
54
- event: z.ZodString;
55
- }, z.core.$strip>], "type">;
56
- export declare const FunctionConfigSchema: z.ZodObject<{
57
- entry: z.ZodString;
58
- triggers: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
59
- id: z.ZodOptional<z.ZodString>;
60
- name: z.ZodOptional<z.ZodString>;
61
- description: z.ZodOptional<z.ZodString>;
62
- type: z.ZodLiteral<"http">;
63
- path: z.ZodString;
64
- }, z.core.$strip>, z.ZodObject<{
65
- id: z.ZodOptional<z.ZodString>;
66
- name: z.ZodOptional<z.ZodString>;
67
- description: z.ZodOptional<z.ZodString>;
68
- type: z.ZodLiteral<"schedule">;
69
- scheduleMode: z.ZodOptional<z.ZodEnum<{
70
- recurring: "recurring";
71
- once: "once";
72
- }>>;
73
- cron: z.ZodString;
74
- isActive: z.ZodOptional<z.ZodBoolean>;
75
- timezone: z.ZodOptional<z.ZodString>;
76
- }, z.core.$strip>, z.ZodObject<{
77
- id: z.ZodOptional<z.ZodString>;
78
- name: z.ZodOptional<z.ZodString>;
79
- description: z.ZodOptional<z.ZodString>;
80
- type: z.ZodLiteral<"event">;
81
- entity: z.ZodString;
82
- event: z.ZodString;
83
- }, z.core.$strip>], "type">>>;
84
- }, z.core.$strip>;
85
- export type HttpTrigger = z.infer<typeof HttpTriggerSchema>;
86
- export type ScheduleTrigger = z.infer<typeof ScheduleTriggerSchema>;
87
- export type EventTrigger = z.infer<typeof EventTriggerSchema>;
88
- export type Trigger = z.infer<typeof TriggerSchema>;
89
- export type FunctionConfig = z.infer<typeof FunctionConfigSchema>;
90
- export {};
91
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/core/resources/function/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,iBAAiB;;;;;;iBAMrB,CAAC;AAEH,QAAA,MAAM,qBAAqB;;;;;;;;;;;;iBASzB,CAAC;AAEH,QAAA,MAAM,kBAAkB;;;;;;;iBAOtB,CAAC;AAEH,QAAA,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;2BAIjB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAG/B,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -1,36 +0,0 @@
1
- import { z } from "zod";
2
- const HttpTriggerSchema = z.object({
3
- id: z.string().optional(),
4
- name: z.string().optional(),
5
- description: z.string().optional(),
6
- type: z.literal("http"),
7
- path: z.string().min(1, "Path cannot be empty"),
8
- });
9
- const ScheduleTriggerSchema = z.object({
10
- id: z.string().optional(),
11
- name: z.string().optional(),
12
- description: z.string().optional(),
13
- type: z.literal("schedule"),
14
- scheduleMode: z.enum(["recurring", "once"]).optional(),
15
- cron: z.string().min(1, "Cron expression cannot be empty"),
16
- isActive: z.boolean().optional(),
17
- timezone: z.string().optional(),
18
- });
19
- const EventTriggerSchema = z.object({
20
- id: z.string().optional(),
21
- name: z.string().optional(),
22
- description: z.string().optional(),
23
- type: z.literal("event"),
24
- entity: z.string().min(1, "Entity name cannot be empty"),
25
- event: z.string().min(1, "Event type cannot be empty"),
26
- });
27
- const TriggerSchema = z.discriminatedUnion("type", [
28
- HttpTriggerSchema,
29
- ScheduleTriggerSchema,
30
- EventTriggerSchema,
31
- ]);
32
- export const FunctionConfigSchema = z.object({
33
- entry: z.string().min(1, "Entry point cannot be empty"),
34
- triggers: z.array(TriggerSchema).optional(),
35
- });
36
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/core/resources/function/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC3B,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE;IACtD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,iCAAiC,CAAC;IAC1D,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEH,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IAClC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACzB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,6BAA6B,CAAC;IACxD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,4BAA4B,CAAC;CACvD,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IACjD,iBAAiB;IACjB,qBAAqB;IACrB,kBAAkB;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,6BAA6B,CAAC;IACvD,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./entity/index.js";
2
- export * from "./function/index.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from "./entity/index.js";
2
- export * from "./function/index.js";
3
- //# sourceMappingURL=index.js.map