skedyul 0.3.1 → 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
@@ -0,0 +1,436 @@
1
+ export type PageType = 'INSTANCE' | 'LIST';
2
+ export type PageBlockType = 'form' | 'spreadsheet' | 'kanban' | 'calendar' | 'link' | 'list' | 'card';
3
+ export type PageFieldType = 'STRING' | 'FILE' | 'NUMBER' | 'DATE' | 'BOOLEAN' | 'SELECT' | 'FORM' | 'RELATIONSHIP';
4
+ export interface PageFieldSource {
5
+ model: string;
6
+ field: string;
7
+ }
8
+ export interface PageFormHeader {
9
+ title: string;
10
+ description?: string;
11
+ }
12
+ export interface PageActionDefinition {
13
+ handle: string;
14
+ /** Button label - supports Liquid templates e.g. "{{ compliance_records[0].status == 'APPROVED' ? 'Register' : 'Pending' }}" */
15
+ label: string;
16
+ handler: string;
17
+ icon?: string;
18
+ variant?: 'primary' | 'secondary' | 'destructive';
19
+ /** Whether the action is disabled - boolean or Liquid template string e.g. "{{ compliance_records[0].status != 'APPROVED' }}" */
20
+ isDisabled?: boolean | string;
21
+ /** Whether the action is hidden - boolean or Liquid template string */
22
+ isHidden?: boolean | string;
23
+ }
24
+ /** Base style props for FormV2 components */
25
+ export interface FormV2StyleProps {
26
+ id: string;
27
+ row: number;
28
+ col: number;
29
+ className?: string;
30
+ hidden?: boolean;
31
+ }
32
+ /** Button props for FieldSetting component */
33
+ export interface FieldSettingButtonProps {
34
+ label: string;
35
+ variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
36
+ size?: 'default' | 'sm' | 'lg' | 'icon';
37
+ isLoading?: boolean;
38
+ /** Can be boolean or Liquid template string that resolves to boolean */
39
+ isDisabled?: boolean | string;
40
+ leftIcon?: string;
41
+ }
42
+ /** Relationship extension for dynamic data loading */
43
+ export interface RelationshipExtension {
44
+ model: string;
45
+ }
46
+ /** Modal form definition for nested forms (handled by skedyul-web, not skedyul-ui) */
47
+ export interface ModalFormDefinition {
48
+ header: PageFormHeader;
49
+ handler: string;
50
+ /** Named dialog template to use instead of inline fields */
51
+ template?: string;
52
+ /** Template-specific params to pass to the dialog */
53
+ templateParams?: Record<string, unknown>;
54
+ /** Inline field definitions (used when template is not specified) */
55
+ fields?: FormV2ComponentDefinition[];
56
+ layout?: FormLayoutConfigDefinition;
57
+ actions?: PageActionDefinition[];
58
+ }
59
+ /** Input component definition */
60
+ export interface InputComponentDefinition extends FormV2StyleProps {
61
+ component: 'Input';
62
+ props: {
63
+ label?: string;
64
+ placeholder?: string;
65
+ helpText?: string;
66
+ type?: 'text' | 'number' | 'email' | 'password' | 'tel' | 'url' | 'hidden';
67
+ required?: boolean;
68
+ disabled?: boolean;
69
+ value?: string | number;
70
+ };
71
+ }
72
+ /** Textarea component definition */
73
+ export interface TextareaComponentDefinition extends FormV2StyleProps {
74
+ component: 'Textarea';
75
+ props: {
76
+ label?: string;
77
+ placeholder?: string;
78
+ helpText?: string;
79
+ required?: boolean;
80
+ disabled?: boolean;
81
+ value?: string;
82
+ };
83
+ }
84
+ /** Select component definition */
85
+ export interface SelectComponentDefinition extends FormV2StyleProps {
86
+ component: 'Select';
87
+ props: {
88
+ label?: string;
89
+ placeholder?: string;
90
+ helpText?: string;
91
+ /** Static items array (will be populated by iterable if using dynamic items) */
92
+ items?: Array<{
93
+ value: string;
94
+ label: string;
95
+ }> | string;
96
+ value?: string;
97
+ isDisabled?: boolean;
98
+ required?: boolean;
99
+ };
100
+ /** For relationship-based selects */
101
+ relationship?: RelationshipExtension;
102
+ /** For dynamic items using iterable pattern (e.g., 'system.models') */
103
+ iterable?: string;
104
+ /** Template for each item in the iterable */
105
+ itemTemplate?: {
106
+ value: string;
107
+ label: string;
108
+ };
109
+ }
110
+ /** Combobox component definition */
111
+ export interface ComboboxComponentDefinition extends FormV2StyleProps {
112
+ component: 'Combobox';
113
+ props: {
114
+ label?: string;
115
+ placeholder?: string;
116
+ helpText?: string;
117
+ items?: Array<{
118
+ value: string;
119
+ label: string;
120
+ }>;
121
+ value?: string;
122
+ };
123
+ /** For relationship-based comboboxes */
124
+ relationship?: RelationshipExtension;
125
+ }
126
+ /** Checkbox component definition */
127
+ export interface CheckboxComponentDefinition extends FormV2StyleProps {
128
+ component: 'Checkbox';
129
+ props: {
130
+ label?: string;
131
+ helpText?: string;
132
+ checked?: boolean;
133
+ disabled?: boolean;
134
+ };
135
+ }
136
+ /** DatePicker component definition */
137
+ export interface DatePickerComponentDefinition extends FormV2StyleProps {
138
+ component: 'DatePicker';
139
+ props: {
140
+ label?: string;
141
+ helpText?: string;
142
+ value?: string | Date;
143
+ disabled?: boolean;
144
+ };
145
+ }
146
+ /** TimePicker component definition */
147
+ export interface TimePickerComponentDefinition extends FormV2StyleProps {
148
+ component: 'TimePicker';
149
+ props: {
150
+ label?: string;
151
+ helpText?: string;
152
+ value?: string;
153
+ disabled?: boolean;
154
+ };
155
+ }
156
+ /** FieldSetting component definition (button that can open modal) */
157
+ export interface FieldSettingComponentDefinition extends FormV2StyleProps {
158
+ component: 'FieldSetting';
159
+ props: {
160
+ label: string;
161
+ description?: string;
162
+ helpText?: string;
163
+ mode?: 'field' | 'setting';
164
+ /** Status indicator: 'success', 'pending', 'error', 'warning' - can be Liquid template */
165
+ status?: 'success' | 'pending' | 'error' | 'warning' | string;
166
+ /** Text to display alongside status badge - can be Liquid template */
167
+ statusText?: string;
168
+ button: FieldSettingButtonProps;
169
+ };
170
+ /** Nested modal form (handled by skedyul-web) */
171
+ modalForm?: ModalFormDefinition;
172
+ }
173
+ /** ImageSetting component definition */
174
+ export interface ImageSettingComponentDefinition extends FormV2StyleProps {
175
+ component: 'ImageSetting';
176
+ props: {
177
+ label?: string;
178
+ description?: string;
179
+ helpText?: string;
180
+ accept?: string;
181
+ };
182
+ }
183
+ /** FileSetting component definition for file uploads */
184
+ export interface FileSettingComponentDefinition extends FormV2StyleProps {
185
+ component: 'FileSetting';
186
+ props: {
187
+ label?: string;
188
+ description?: string;
189
+ helpText?: string;
190
+ accept?: string;
191
+ required?: boolean;
192
+ button?: {
193
+ label?: string;
194
+ variant?: 'default' | 'outline' | 'ghost' | 'link';
195
+ size?: 'sm' | 'md' | 'lg';
196
+ };
197
+ };
198
+ }
199
+ /** Item template for server-side iterable rendering */
200
+ export interface ListItemTemplate {
201
+ component: string;
202
+ span?: number;
203
+ mdSpan?: number;
204
+ lgSpan?: number;
205
+ props: Record<string, unknown>;
206
+ }
207
+ /** List component definition */
208
+ export interface ListComponentDefinition extends FormV2StyleProps {
209
+ component: 'List';
210
+ props: {
211
+ title?: string;
212
+ items?: Array<{
213
+ id: string;
214
+ label: string;
215
+ description?: string;
216
+ }>;
217
+ emptyMessage?: string;
218
+ };
219
+ /** Model to fetch list items from (legacy) */
220
+ model?: string;
221
+ labelField?: string;
222
+ descriptionField?: string;
223
+ icon?: string;
224
+ /** Context variable name to iterate over (e.g., 'phone_numbers') */
225
+ iterable?: string;
226
+ /** Template for each item - use {{ item.xyz }} for field values */
227
+ itemTemplate?: ListItemTemplate;
228
+ }
229
+ /** EmptyForm component definition */
230
+ export interface EmptyFormComponentDefinition extends FormV2StyleProps {
231
+ component: 'EmptyForm';
232
+ props: {
233
+ title?: string;
234
+ description?: string;
235
+ icon?: string;
236
+ };
237
+ }
238
+ /** Alert component definition for display-only informational content */
239
+ export interface AlertComponentDefinition extends FormV2StyleProps {
240
+ component: 'Alert';
241
+ props: {
242
+ title: string;
243
+ description: string;
244
+ icon?: string;
245
+ variant?: 'default' | 'destructive';
246
+ };
247
+ }
248
+ /** Union of all FormV2 component definitions */
249
+ export type FormV2ComponentDefinition = InputComponentDefinition | TextareaComponentDefinition | SelectComponentDefinition | ComboboxComponentDefinition | CheckboxComponentDefinition | DatePickerComponentDefinition | TimePickerComponentDefinition | FieldSettingComponentDefinition | ImageSettingComponentDefinition | FileSettingComponentDefinition | ListComponentDefinition | EmptyFormComponentDefinition | AlertComponentDefinition;
250
+ /** Layout column definition */
251
+ export interface FormLayoutColumnDefinition {
252
+ field: string;
253
+ colSpan: number;
254
+ dataType?: string;
255
+ subQuery?: unknown;
256
+ }
257
+ /** Layout row definition */
258
+ export interface FormLayoutRowDefinition {
259
+ columns: FormLayoutColumnDefinition[];
260
+ }
261
+ /** FormLayoutConfig definition (mirrors skedyul-ui FormLayoutConfig) */
262
+ export interface FormLayoutConfigDefinition {
263
+ type: 'form';
264
+ rows: FormLayoutRowDefinition[];
265
+ }
266
+ /** FormV2 props definition */
267
+ export interface FormV2PropsDefinition {
268
+ formVersion: 'v2';
269
+ id?: string;
270
+ fields: FormV2ComponentDefinition[];
271
+ layout: FormLayoutConfigDefinition;
272
+ /** Optional actions that trigger MCP tool calls */
273
+ actions?: PageActionDefinition[];
274
+ }
275
+ /** Card block header definition */
276
+ export interface CardBlockHeader {
277
+ title: string;
278
+ description?: string;
279
+ descriptionHref?: string;
280
+ }
281
+ /** Card block definition (CardV2-aligned) */
282
+ export interface CardBlockDefinition {
283
+ type: 'card';
284
+ /** Disable drag-and-drop in the form */
285
+ restructurable?: boolean;
286
+ header?: CardBlockHeader;
287
+ form: FormV2PropsDefinition;
288
+ actions?: PageActionDefinition[];
289
+ secondaryActions?: PageActionDefinition[];
290
+ primaryActions?: PageActionDefinition[];
291
+ }
292
+ export interface PageFieldDefinition {
293
+ handle: string;
294
+ type: PageFieldType;
295
+ label: string;
296
+ description?: string;
297
+ required?: boolean;
298
+ handler?: string;
299
+ source?: PageFieldSource;
300
+ options?: Array<{
301
+ value: string;
302
+ label: string;
303
+ }>;
304
+ accept?: string;
305
+ header?: PageFormHeader;
306
+ fields?: PageFieldDefinition[];
307
+ actions?: PageActionDefinition[];
308
+ /** Target internal model handle for RELATIONSHIP type fields */
309
+ model?: string;
310
+ }
311
+ /** Legacy form block definition */
312
+ export interface LegacyFormBlockDefinition {
313
+ type: 'form' | 'spreadsheet' | 'kanban' | 'calendar' | 'link';
314
+ title?: string;
315
+ fields?: PageFieldDefinition[];
316
+ readonly?: boolean;
317
+ }
318
+ /** List block definition */
319
+ export interface ListBlockDefinition {
320
+ type: 'list';
321
+ title?: string;
322
+ /** Model handle to fetch instances from */
323
+ model: string;
324
+ /** Field to use as the tile label */
325
+ labelField?: string;
326
+ /** Field to use as the tile description */
327
+ descriptionField?: string;
328
+ /** Icon for each tile */
329
+ icon?: string;
330
+ /** Message when no items */
331
+ emptyMessage?: string;
332
+ }
333
+ /** Model mapper block definition - for mapping SHARED models to workspace models */
334
+ export interface ModelMapperBlockDefinition {
335
+ type: 'model-mapper';
336
+ /** The SHARED model handle from provision config (e.g., "client", "patient") */
337
+ model: string;
338
+ }
339
+ /** Union of all block types */
340
+ export type PageBlockDefinition = CardBlockDefinition | LegacyFormBlockDefinition | ListBlockDefinition | ModelMapperBlockDefinition;
341
+ /** Mode for context data fetching */
342
+ export type PageContextMode = 'first' | 'many' | 'count';
343
+ /**
344
+ * Page context filters using structured format.
345
+ * Format: { fieldHandle: { operator: value } }
346
+ * Values can be Liquid template strings, e.g., { id: { eq: '{{ path_params.id }}' } }
347
+ */
348
+ export type PageContextFilters = Record<string, Record<string, string | number | boolean | (string | number | boolean)[]>>;
349
+ /** Single context item definition (model-based) */
350
+ export interface PageContextItemDefinition {
351
+ /** Model handle to fetch data from */
352
+ model: string;
353
+ /** Fetch mode: 'first' returns single object, 'many' returns array, 'count' returns number */
354
+ mode: PageContextMode;
355
+ /**
356
+ * Optional filters. Supports:
357
+ * - Simple key-value with Liquid templates: { id: '{{ path_params.id }}' }
358
+ * - StructuredFilter format: { status: { eq: 'APPROVED' } }
359
+ */
360
+ filters?: PageContextFilters;
361
+ /** Optional limit for 'many' mode */
362
+ limit?: number;
363
+ }
364
+ /** Single context item definition (tool-based) */
365
+ export interface PageContextToolItemDefinition {
366
+ /** Tool name to invoke for fetching context data */
367
+ tool: string;
368
+ }
369
+ /** Context definition: variable name -> context item (model or tool-based) */
370
+ export type PageContextDefinition = Record<string, PageContextItemDefinition | PageContextToolItemDefinition>;
371
+ /** @deprecated Use PageContextDefinition instead */
372
+ export interface PageInstanceFilter {
373
+ model: string;
374
+ where?: Record<string, unknown>;
375
+ }
376
+ /** Navigation item for sidebar */
377
+ export interface NavigationItem {
378
+ /** Display label (supports Liquid templates) */
379
+ label: string;
380
+ /** URL href (supports Liquid templates with path_params and context) */
381
+ href: string;
382
+ /** Optional icon name */
383
+ icon?: string;
384
+ }
385
+ /** Navigation section with title and items */
386
+ export interface NavigationSection {
387
+ /** Section title (supports Liquid templates) */
388
+ title?: string;
389
+ /** Navigation items in this section */
390
+ items: NavigationItem[];
391
+ }
392
+ /** Sidebar navigation configuration */
393
+ export interface NavigationSidebar {
394
+ /** Sections to display in the sidebar */
395
+ sections: NavigationSection[];
396
+ }
397
+ /** Breadcrumb item */
398
+ export interface BreadcrumbItem {
399
+ /** Display label (supports Liquid templates) */
400
+ label: string;
401
+ /** Optional href - if not provided, item is not clickable */
402
+ href?: string;
403
+ }
404
+ /** Breadcrumb navigation configuration */
405
+ export interface NavigationBreadcrumb {
406
+ /** Breadcrumb items from left to right */
407
+ items: BreadcrumbItem[];
408
+ }
409
+ /** Full navigation configuration */
410
+ export interface NavigationConfig {
411
+ /** Sidebar navigation */
412
+ sidebar?: NavigationSidebar;
413
+ /** Breadcrumb navigation */
414
+ breadcrumb?: NavigationBreadcrumb;
415
+ }
416
+ export interface PageDefinition {
417
+ type: PageType;
418
+ title: string;
419
+ /** URL path for this page (e.g., '/phone-numbers' or '/phone-numbers/[id]' for dynamic segments) */
420
+ path: string;
421
+ /** When true, this page is the default landing page for the app installation */
422
+ default?: boolean;
423
+ /**
424
+ * Navigation configuration:
425
+ * - true/false: show/hide in auto-generated navigation
426
+ * - string: Liquid template that evaluates to true/false
427
+ * - NavigationConfig: full navigation override for this page (replaces base navigation)
428
+ */
429
+ navigation?: boolean | string | NavigationConfig;
430
+ blocks: PageBlockDefinition[];
431
+ actions?: PageActionDefinition[];
432
+ /** Context data to load for Liquid templates. appInstallationId filtering is automatic. */
433
+ context?: PageContextDefinition;
434
+ /** @deprecated Use context instead */
435
+ filter?: PageInstanceFilter;
436
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Page Definition
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,30 @@
1
+ /** Scope of a model: INTERNAL (app-owned) or SHARED (user-mapped) */
2
+ export type ResourceScope = 'INTERNAL' | 'SHARED';
3
+ /**
4
+ * Field-level data ownership.
5
+ * APP: App exclusively controls this data (e.g., status field set by webhook)
6
+ * WORKPLACE: User/organization provides this data (e.g., file upload)
7
+ * BOTH: Collaborative - either can update
8
+ */
9
+ export type FieldOwner = 'APP' | 'WORKPLACE' | 'BOTH';
10
+ /**
11
+ * StructuredFilter for conditional dependencies.
12
+ * Format: { fieldHandle: { operator: value | value[] } }
13
+ */
14
+ export type StructuredFilter = Record<string, Record<string, string | number | boolean | (string | number | boolean)[]>>;
15
+ /** Model dependency reference */
16
+ export interface ModelDependency {
17
+ model: string;
18
+ fields?: string[];
19
+ where?: StructuredFilter;
20
+ }
21
+ /** Channel dependency reference */
22
+ export interface ChannelDependency {
23
+ channel: string;
24
+ }
25
+ /** Workflow dependency reference */
26
+ export interface WorkflowDependency {
27
+ workflow: string;
28
+ }
29
+ /** Union of all resource dependency types */
30
+ export type ResourceDependency = ModelDependency | ChannelDependency | WorkflowDependency;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Resource Scope and Dependencies
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,35 @@
1
+ export type WebhookHttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
2
+ export interface WebhookRequest {
3
+ method: string;
4
+ url: string;
5
+ path: string;
6
+ headers: Record<string, string | string[] | undefined>;
7
+ query: Record<string, string>;
8
+ body: unknown;
9
+ rawBody?: Buffer;
10
+ }
11
+ export interface WebhookHandlerContext {
12
+ appInstallationId: string | null;
13
+ workplace: {
14
+ id: string;
15
+ subdomain: string | null;
16
+ } | null;
17
+ registration: Record<string, unknown>;
18
+ }
19
+ export interface WebhookHandlerResponse {
20
+ status: number;
21
+ body?: unknown;
22
+ headers?: Record<string, string>;
23
+ }
24
+ export type WebhookHandlerFn = (request: WebhookRequest, context: WebhookHandlerContext) => Promise<WebhookHandlerResponse>;
25
+ export interface WebhookHandlerDefinition {
26
+ description?: string;
27
+ methods?: WebhookHttpMethod[];
28
+ handler: WebhookHandlerFn;
29
+ }
30
+ export type Webhooks = Record<string, WebhookHandlerDefinition>;
31
+ export interface WebhookHandlerMetadata {
32
+ name: string;
33
+ description?: string;
34
+ methods?: WebhookHttpMethod[];
35
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ // ─────────────────────────────────────────────────────────────────────────────
3
+ // Webhook Handler Definitions
4
+ // ─────────────────────────────────────────────────────────────────────────────
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,24 @@
1
+ import type { ResourceDependency } from './resource';
2
+ export interface WorkflowActionInput {
3
+ key: string;
4
+ label: string;
5
+ fieldRef?: {
6
+ fieldHandle: string;
7
+ entityHandle: string;
8
+ };
9
+ template?: string;
10
+ }
11
+ export interface WorkflowAction {
12
+ label: string;
13
+ handle: string;
14
+ batch?: boolean;
15
+ entityHandle?: string;
16
+ inputs?: WorkflowActionInput[];
17
+ }
18
+ export interface WorkflowDefinition {
19
+ path: string;
20
+ label?: string;
21
+ handle?: string;
22
+ requires?: ResourceDependency[];
23
+ actions: WorkflowAction[];
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import type { SkedyulConfig } from './app-config';
2
+ /**
3
+ * Get all environment variable keys from the config.
4
+ * Returns separate arrays for global and install-level keys.
5
+ * Note: With the new config structure, all env is at provision level (global).
6
+ */
7
+ export declare function getAllEnvKeys(config: SkedyulConfig): {
8
+ global: string[];
9
+ install: string[];
10
+ };
11
+ /**
12
+ * Get required install-level environment variable keys.
13
+ * Note: With the new config structure, install-level env is deprecated.
14
+ * All required env vars are now at provision level.
15
+ */
16
+ export declare function getRequiredInstallEnvKeys(config: SkedyulConfig): string[];
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getAllEnvKeys = getAllEnvKeys;
4
+ exports.getRequiredInstallEnvKeys = getRequiredInstallEnvKeys;
5
+ /**
6
+ * Get all environment variable keys from the config.
7
+ * Returns separate arrays for global and install-level keys.
8
+ * Note: With the new config structure, all env is at provision level (global).
9
+ */
10
+ function getAllEnvKeys(config) {
11
+ // Resolve provision if it's already resolved (not a Promise)
12
+ const provision = config.provision && 'env' in config.provision
13
+ ? config.provision
14
+ : undefined;
15
+ const globalKeys = provision?.env ? Object.keys(provision.env) : [];
16
+ // Install-level env is deprecated in the new structure
17
+ return {
18
+ global: globalKeys,
19
+ install: [],
20
+ };
21
+ }
22
+ /**
23
+ * Get required install-level environment variable keys.
24
+ * Note: With the new config structure, install-level env is deprecated.
25
+ * All required env vars are now at provision level.
26
+ */
27
+ function getRequiredInstallEnvKeys(config) {
28
+ // Resolve provision if it's already resolved (not a Promise)
29
+ const provision = config.provision && 'env' in config.provision
30
+ ? config.provision
31
+ : undefined;
32
+ if (!provision?.env)
33
+ return [];
34
+ return Object.entries(provision.env)
35
+ .filter(([, def]) => def.required)
36
+ .map(([key]) => key);
37
+ }