skedyul 0.3.0 → 0.3.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.
Files changed (77) hide show
  1. package/dist/.build-stamp +1 -1
  2. package/dist/config/app-config.d.ts +73 -0
  3. package/dist/config/app-config.js +12 -0
  4. package/dist/config/index.d.ts +9 -0
  5. package/dist/config/index.js +33 -0
  6. package/dist/config/loader.d.ts +7 -0
  7. package/dist/config/loader.js +119 -0
  8. package/dist/config/types/agent.d.ts +29 -0
  9. package/dist/config/types/agent.js +5 -0
  10. package/dist/config/types/channel.d.ts +46 -0
  11. package/dist/config/types/channel.js +2 -0
  12. package/dist/config/types/compute.d.ts +1 -0
  13. package/dist/config/types/compute.js +5 -0
  14. package/dist/config/types/env.d.ts +16 -0
  15. package/dist/config/types/env.js +5 -0
  16. package/dist/config/types/index.d.ts +9 -0
  17. package/dist/config/types/index.js +26 -0
  18. package/dist/config/types/model.d.ts +62 -0
  19. package/dist/config/types/model.js +2 -0
  20. package/dist/config/types/page.d.ts +436 -0
  21. package/dist/config/types/page.js +5 -0
  22. package/dist/config/types/resource.d.ts +30 -0
  23. package/dist/config/types/resource.js +5 -0
  24. package/dist/config/types/webhook.d.ts +35 -0
  25. package/dist/config/types/webhook.js +5 -0
  26. package/dist/config/types/workflow.d.ts +24 -0
  27. package/dist/config/types/workflow.js +2 -0
  28. package/dist/config/utils.d.ts +16 -0
  29. package/dist/config/utils.js +37 -0
  30. package/dist/config.d.ts +5 -767
  31. package/dist/config.js +11 -151
  32. package/dist/schemas.d.ts +43 -43
  33. package/dist/server/core-api-handler.d.ts +8 -0
  34. package/dist/server/core-api-handler.js +148 -0
  35. package/dist/server/dedicated.d.ts +7 -0
  36. package/dist/server/dedicated.js +610 -0
  37. package/dist/server/handler-helpers.d.ts +24 -0
  38. package/dist/server/handler-helpers.js +75 -0
  39. package/dist/server/index.d.ts +19 -0
  40. package/dist/server/index.js +196 -0
  41. package/dist/server/serverless.d.ts +7 -0
  42. package/dist/server/serverless.js +629 -0
  43. package/dist/server/startup-logger.d.ts +9 -0
  44. package/dist/server/startup-logger.js +113 -0
  45. package/dist/server/tool-handler.d.ts +14 -0
  46. package/dist/server/tool-handler.js +189 -0
  47. package/dist/server/types.d.ts +22 -0
  48. package/dist/server/types.js +2 -0
  49. package/dist/server/utils/env.d.ts +12 -0
  50. package/dist/server/utils/env.js +38 -0
  51. package/dist/server/utils/http.d.ts +30 -0
  52. package/dist/server/utils/http.js +81 -0
  53. package/dist/server/utils/index.d.ts +3 -0
  54. package/dist/server/utils/index.js +24 -0
  55. package/dist/server/utils/schema.d.ts +22 -0
  56. package/dist/server/utils/schema.js +102 -0
  57. package/dist/server.d.ts +7 -11
  58. package/dist/server.js +39 -2026
  59. package/dist/types/aws.d.ts +15 -0
  60. package/dist/types/aws.js +5 -0
  61. package/dist/types/handlers.d.ts +122 -0
  62. package/dist/types/handlers.js +2 -0
  63. package/dist/types/index.d.ts +16 -0
  64. package/dist/types/index.js +16 -0
  65. package/dist/types/server.d.ts +43 -0
  66. package/dist/types/server.js +2 -0
  67. package/dist/types/shared.d.ts +16 -0
  68. package/dist/types/shared.js +5 -0
  69. package/dist/types/tool-context.d.ts +64 -0
  70. package/dist/types/tool-context.js +12 -0
  71. package/dist/types/tool.d.ts +96 -0
  72. package/dist/types/tool.js +19 -0
  73. package/dist/types/webhook.d.ts +116 -0
  74. package/dist/types/webhook.js +7 -0
  75. package/dist/types.d.ts +4 -461
  76. package/dist/types.js +21 -31
  77. package/package.json +2 -2
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1771192319210
1
+ 1771312334989
@@ -0,0 +1,73 @@
1
+ import type { ToolRegistry, WebhookRegistry, ToolMetadata, WebhookMetadata } from '../types';
2
+ import type { EnvSchema, ComputeLayerType, ModelDefinition, RelationshipDefinition, ChannelDefinition, WorkflowDefinition, PageDefinition, NavigationConfig, AgentDefinition } from './types';
3
+ export type { InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, } from '../types';
4
+ /**
5
+ * Install configuration - defines per-install env vars.
6
+ */
7
+ export interface InstallConfig {
8
+ /** Per-install environment variables (collected from user during install, passed at runtime) */
9
+ env?: EnvSchema;
10
+ }
11
+ /** Provision-level configuration - auto-synced when app version is deployed */
12
+ export interface ProvisionConfig {
13
+ /** Global environment variables (developer-level, shared across all installs) */
14
+ env?: EnvSchema;
15
+ /** Model definitions (INTERNAL + SHARED) */
16
+ models?: ModelDefinition[];
17
+ /** Relationship definitions between models */
18
+ relationships?: RelationshipDefinition[];
19
+ /** Communication channel definitions */
20
+ channels?: ChannelDefinition[];
21
+ /** Workflow definitions */
22
+ workflows?: WorkflowDefinition[];
23
+ /** Base navigation configuration for all pages (can be overridden per page) */
24
+ navigation?: NavigationConfig;
25
+ /** Page definitions for app UI */
26
+ pages?: PageDefinition[];
27
+ }
28
+ export interface SkedyulConfig {
29
+ /** App name */
30
+ name: string;
31
+ /** App version (semver) */
32
+ version?: string;
33
+ /** App description */
34
+ description?: string;
35
+ /** Compute layer: 'serverless' (Lambda) or 'dedicated' (ECS/Docker) */
36
+ computeLayer?: ComputeLayerType;
37
+ /** Tool registry - direct object or dynamic import */
38
+ tools?: ToolRegistry | Promise<{
39
+ toolRegistry: ToolRegistry;
40
+ }>;
41
+ /** Webhook registry - direct object or dynamic import */
42
+ webhooks?: WebhookRegistry | Promise<{
43
+ webhookRegistry: WebhookRegistry;
44
+ }>;
45
+ /** Provision configuration - direct object or dynamic import */
46
+ provision?: ProvisionConfig | Promise<{
47
+ default: ProvisionConfig;
48
+ }>;
49
+ /** Install configuration - hooks for install/uninstall lifecycle */
50
+ install?: InstallConfig | Promise<{
51
+ default: InstallConfig;
52
+ }>;
53
+ /** Agent definitions - multi-tenant agents with tool bindings */
54
+ agents?: AgentDefinition[];
55
+ }
56
+ export interface SerializableSkedyulConfig {
57
+ name: string;
58
+ version?: string;
59
+ description?: string;
60
+ computeLayer?: ComputeLayerType;
61
+ /** Tool metadata (serialized from ToolRegistry) */
62
+ tools?: ToolMetadata[];
63
+ /** Webhook metadata (serialized from WebhookRegistry) */
64
+ webhooks?: WebhookMetadata[];
65
+ /** Provision config (fully resolved) */
66
+ provision?: ProvisionConfig;
67
+ /** Agent definitions (stored as-is) */
68
+ agents?: AgentDefinition[];
69
+ }
70
+ /**
71
+ * Define a Skedyul app configuration with full type safety.
72
+ */
73
+ export declare function defineConfig(config: SkedyulConfig): SkedyulConfig;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineConfig = defineConfig;
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ // Helper Function
6
+ // ─────────────────────────────────────────────────────────────────────────────
7
+ /**
8
+ * Define a Skedyul app configuration with full type safety.
9
+ */
10
+ function defineConfig(config) {
11
+ return config;
12
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Config module - re-exports all config types and utilities
3
+ */
4
+ export * from './types';
5
+ export type { InstallConfig, ProvisionConfig, SkedyulConfig, SerializableSkedyulConfig, } from './app-config';
6
+ export { defineConfig } from './app-config';
7
+ export type { InstallHandlerContext, InstallHandlerResult, InstallHandler, InstallHandlerResponseOAuth, InstallHandlerResponseStandard, HasOAuthCallback, ServerHooksWithOAuth, ServerHooksWithoutOAuth, ProvisionHandlerContext, ProvisionHandlerResult, ProvisionHandler, ServerHooks, } from './app-config';
8
+ export { CONFIG_FILE_NAMES, loadConfig, validateConfig } from './loader';
9
+ export { getAllEnvKeys, getRequiredInstallEnvKeys } from './utils';
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ /**
3
+ * Config module - re-exports all config types and utilities
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
17
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
18
+ };
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.getRequiredInstallEnvKeys = exports.getAllEnvKeys = exports.validateConfig = exports.loadConfig = exports.CONFIG_FILE_NAMES = exports.defineConfig = void 0;
21
+ // Re-export all types
22
+ __exportStar(require("./types"), exports);
23
+ var app_config_1 = require("./app-config");
24
+ Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return app_config_1.defineConfig; } });
25
+ // Re-export loader utilities
26
+ var loader_1 = require("./loader");
27
+ Object.defineProperty(exports, "CONFIG_FILE_NAMES", { enumerable: true, get: function () { return loader_1.CONFIG_FILE_NAMES; } });
28
+ Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return loader_1.loadConfig; } });
29
+ Object.defineProperty(exports, "validateConfig", { enumerable: true, get: function () { return loader_1.validateConfig; } });
30
+ // Re-export helper utilities
31
+ var utils_1 = require("./utils");
32
+ Object.defineProperty(exports, "getAllEnvKeys", { enumerable: true, get: function () { return utils_1.getAllEnvKeys; } });
33
+ Object.defineProperty(exports, "getRequiredInstallEnvKeys", { enumerable: true, get: function () { return utils_1.getRequiredInstallEnvKeys; } });
@@ -0,0 +1,7 @@
1
+ import type { SkedyulConfig } from './app-config';
2
+ export declare const CONFIG_FILE_NAMES: string[];
3
+ export declare function loadConfig(configPath: string): Promise<SkedyulConfig>;
4
+ export declare function validateConfig(config: SkedyulConfig): {
5
+ valid: boolean;
6
+ errors: string[];
7
+ };
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.CONFIG_FILE_NAMES = void 0;
37
+ exports.loadConfig = loadConfig;
38
+ exports.validateConfig = validateConfig;
39
+ const fs = __importStar(require("fs"));
40
+ const path = __importStar(require("path"));
41
+ const os = __importStar(require("os"));
42
+ // ─────────────────────────────────────────────────────────────────────────────
43
+ // Config Loading Utilities
44
+ // ─────────────────────────────────────────────────────────────────────────────
45
+ exports.CONFIG_FILE_NAMES = [
46
+ 'skedyul.config.ts',
47
+ 'skedyul.config.js',
48
+ 'skedyul.config.mjs',
49
+ 'skedyul.config.cjs',
50
+ ];
51
+ async function transpileTypeScript(filePath) {
52
+ const content = fs.readFileSync(filePath, 'utf-8');
53
+ let transpiled = content
54
+ .replace(/import\s+type\s+\{[^}]+\}\s+from\s+['"][^'"]+['"]\s*;?\n?/g, '')
55
+ .replace(/import\s+\{\s*defineConfig\s*\}\s+from\s+['"]skedyul['"]\s*;?\n?/g, '')
56
+ .replace(/:\s*SkedyulConfig/g, '')
57
+ .replace(/export\s+default\s+/, 'module.exports = ')
58
+ .replace(/defineConfig\s*\(\s*\{/, '{')
59
+ .replace(/\}\s*\)\s*;?\s*$/, '}');
60
+ return transpiled;
61
+ }
62
+ async function loadConfig(configPath) {
63
+ const absolutePath = path.resolve(configPath);
64
+ if (!fs.existsSync(absolutePath)) {
65
+ throw new Error(`Config file not found: ${absolutePath}`);
66
+ }
67
+ const isTypeScript = absolutePath.endsWith('.ts');
68
+ try {
69
+ let moduleToLoad = absolutePath;
70
+ if (isTypeScript) {
71
+ const transpiled = await transpileTypeScript(absolutePath);
72
+ const tempDir = os.tmpdir();
73
+ const tempFile = path.join(tempDir, `skedyul-config-${Date.now()}.js`);
74
+ fs.writeFileSync(tempFile, transpiled);
75
+ moduleToLoad = tempFile;
76
+ try {
77
+ const module = require(moduleToLoad);
78
+ const config = module.default || module;
79
+ if (!config || typeof config !== 'object') {
80
+ throw new Error('Config file must export a configuration object');
81
+ }
82
+ if (!config.name || typeof config.name !== 'string') {
83
+ throw new Error('Config must have a "name" property');
84
+ }
85
+ return config;
86
+ }
87
+ finally {
88
+ try {
89
+ fs.unlinkSync(tempFile);
90
+ }
91
+ catch {
92
+ // Ignore cleanup errors
93
+ }
94
+ }
95
+ }
96
+ const module = await Promise.resolve(`${moduleToLoad}`).then(s => __importStar(require(s)));
97
+ const config = module.default || module;
98
+ if (!config || typeof config !== 'object') {
99
+ throw new Error('Config file must export a configuration object');
100
+ }
101
+ if (!config.name || typeof config.name !== 'string') {
102
+ throw new Error('Config must have a "name" property');
103
+ }
104
+ return config;
105
+ }
106
+ catch (error) {
107
+ throw new Error(`Failed to load config from ${configPath}: ${error instanceof Error ? error.message : String(error)}`);
108
+ }
109
+ }
110
+ function validateConfig(config) {
111
+ const errors = [];
112
+ if (!config.name) {
113
+ errors.push('Missing required field: name');
114
+ }
115
+ if (config.computeLayer && !['serverless', 'dedicated'].includes(config.computeLayer)) {
116
+ errors.push(`Invalid computeLayer: ${config.computeLayer}. Must be 'serverless' or 'dedicated'`);
117
+ }
118
+ return { valid: errors.length === 0, errors };
119
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Definition for an app-provided agent.
3
+ * Agents are created globally during provisioning and become available
4
+ * to workplaces that install the app.
5
+ */
6
+ export interface AgentDefinition {
7
+ /** Unique identifier within the app (used for upserts) */
8
+ handle: string;
9
+ /** Display name */
10
+ name: string;
11
+ /** Description of what the agent does */
12
+ description: string;
13
+ /** System prompt (static, no templating) */
14
+ system: string;
15
+ /** Tool names to bind (must exist in this app's tools) */
16
+ tools: string[];
17
+ /** Optional LLM model override (defaults to workspace default) */
18
+ llmModelId?: string;
19
+ /**
20
+ * Parent agent that can call this agent.
21
+ * Creates an AGENT-type tool and binds it to the parent.
22
+ *
23
+ * Values:
24
+ * - 'composer' - Bind to the workspace's Composer agent
25
+ * - '<handle>' - Bind to another agent in this app (by handle)
26
+ * - undefined - Standalone agent (not callable by other agents)
27
+ */
28
+ parentAgent?: string;
29
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Agent Definition
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,46 @@
1
+ import type { AppFieldVisibility } from './model';
2
+ /** Standard capability types for communication channels */
3
+ export type ChannelCapabilityType = 'messaging' | 'voice' | 'video';
4
+ /** Capability definition with display info and handler references */
5
+ export interface ChannelCapability {
6
+ /** Display name: "SMS", "WhatsApp Messages" */
7
+ name: string;
8
+ /** Lucide icon name */
9
+ icon?: string;
10
+ /** Inbound webhook handler */
11
+ receive?: string;
12
+ /** Outbound tool handle */
13
+ send?: string;
14
+ }
15
+ export interface ChannelFieldPermissions {
16
+ read?: boolean;
17
+ write?: boolean;
18
+ }
19
+ /**
20
+ * Field definition for channel field mappings.
21
+ * One field should have identifier: true to mark it as the channel identifier.
22
+ */
23
+ export interface ChannelFieldDefinition {
24
+ handle: string;
25
+ label: string;
26
+ definition: {
27
+ handle: string;
28
+ };
29
+ /** Marks this field as the identifier field for the channel */
30
+ identifier?: boolean;
31
+ required?: boolean;
32
+ defaultValue?: {
33
+ value: unknown;
34
+ };
35
+ visibility?: AppFieldVisibility;
36
+ permissions?: ChannelFieldPermissions;
37
+ }
38
+ export interface ChannelDefinition {
39
+ handle: string;
40
+ name: string;
41
+ icon?: string;
42
+ /** Field definitions for channel. One field must have identifier: true. */
43
+ fields: ChannelFieldDefinition[];
44
+ /** Capabilities keyed by standard type (messaging, voice, video) */
45
+ capabilities: Partial<Record<ChannelCapabilityType, ChannelCapability>>;
46
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1 @@
1
+ export type ComputeLayerType = 'serverless' | 'dedicated';
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Compute Layer
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ export type EnvVisibility = 'visible' | 'encrypted';
2
+ export interface EnvVariableDefinition {
3
+ /** Human-readable label for the variable */
4
+ label: string;
5
+ /** Whether this variable is required */
6
+ required?: boolean;
7
+ /** Visibility setting (encrypted values are hidden in UI) */
8
+ visibility?: EnvVisibility;
9
+ /** Default value if not provided */
10
+ default?: string;
11
+ /** Description/help text */
12
+ description?: string;
13
+ /** Placeholder text for input fields */
14
+ placeholder?: string;
15
+ }
16
+ export type EnvSchema = Record<string, EnvVariableDefinition>;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Env Variable Definition
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ export * from './env';
2
+ export * from './compute';
3
+ export * from './resource';
4
+ export * from './model';
5
+ export * from './channel';
6
+ export * from './workflow';
7
+ export * from './page';
8
+ export * from './webhook';
9
+ export * from './agent';
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ // Re-export all config types
18
+ __exportStar(require("./env"), exports);
19
+ __exportStar(require("./compute"), exports);
20
+ __exportStar(require("./resource"), exports);
21
+ __exportStar(require("./model"), exports);
22
+ __exportStar(require("./channel"), exports);
23
+ __exportStar(require("./workflow"), exports);
24
+ __exportStar(require("./page"), exports);
25
+ __exportStar(require("./webhook"), exports);
26
+ __exportStar(require("./agent"), exports);
@@ -0,0 +1,62 @@
1
+ import type { ResourceScope, FieldOwner, ResourceDependency } from './resource';
2
+ export type InternalFieldDataType = 'LONG_STRING' | 'STRING' | 'NUMBER' | 'BOOLEAN' | 'DATE' | 'DATE_TIME' | 'TIME' | 'FILE' | 'IMAGE' | 'RELATION' | 'OBJECT';
3
+ export interface FieldOption {
4
+ label: string;
5
+ value: string;
6
+ color?: string;
7
+ }
8
+ export interface InlineFieldDefinition {
9
+ limitChoices?: number;
10
+ options?: FieldOption[];
11
+ minLength?: number;
12
+ maxLength?: number;
13
+ min?: number;
14
+ max?: number;
15
+ relatedModel?: string;
16
+ pattern?: string;
17
+ }
18
+ export interface AppFieldVisibility {
19
+ data?: boolean;
20
+ list?: boolean;
21
+ filters?: boolean;
22
+ }
23
+ export interface ModelFieldDefinition {
24
+ handle: string;
25
+ label: string;
26
+ type?: InternalFieldDataType;
27
+ definitionHandle?: string;
28
+ definition?: InlineFieldDefinition;
29
+ required?: boolean;
30
+ unique?: boolean;
31
+ system?: boolean;
32
+ isList?: boolean;
33
+ defaultValue?: {
34
+ value: unknown;
35
+ };
36
+ description?: string;
37
+ visibility?: AppFieldVisibility;
38
+ owner?: FieldOwner;
39
+ }
40
+ export interface ModelDefinition {
41
+ handle: string;
42
+ name: string;
43
+ namePlural?: string;
44
+ scope: ResourceScope;
45
+ labelTemplate?: string;
46
+ description?: string;
47
+ fields: ModelFieldDefinition[];
48
+ requires?: ResourceDependency[];
49
+ }
50
+ export type RelationshipCardinality = 'ONE_TO_ONE' | 'ONE_TO_MANY' | 'MANY_TO_ONE' | 'MANY_TO_MANY';
51
+ export type OnDeleteBehavior = 'NONE' | 'CASCADE' | 'RESTRICT';
52
+ export interface RelationshipLink {
53
+ model: string;
54
+ field: string;
55
+ label: string;
56
+ cardinality: RelationshipCardinality;
57
+ onDelete?: OnDeleteBehavior;
58
+ }
59
+ export interface RelationshipDefinition {
60
+ source: RelationshipLink;
61
+ target: RelationshipLink;
62
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });