skedyul 0.3.19 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  The official Node.js SDK for building Skedyul integration apps. This package provides everything you need to create MCP (Model Context Protocol) servers, handle webhooks, manage lifecycle events, and interact with the Skedyul platform.
4
4
 
5
+ ## Version 1.0.0
6
+
7
+ This release introduces a modular, file-based configuration system with improved type safety and developer experience.
8
+
5
9
  ## Features
6
10
 
7
11
  - **MCP Server**: Build tools that AI agents can invoke via the Model Context Protocol
@@ -9,6 +13,7 @@ The official Node.js SDK for building Skedyul integration apps. This package pro
9
13
  - **Lifecycle Hooks**: Handle app installation, provisioning, and cleanup
10
14
  - **Core API Client**: Interact with Skedyul resources (workplaces, channels, instances)
11
15
  - **CLI**: Develop and test locally with hot-reload and tunneling
16
+ - **Modular Config**: File-based configuration with auto-discovery patterns
12
17
 
13
18
  ## Installation
14
19
 
@@ -25,17 +30,76 @@ pnpm add skedyul
25
30
  ```ts
26
31
  // skedyul.config.ts
27
32
  import { defineConfig } from 'skedyul'
33
+ import pkg from './package.json'
28
34
 
29
35
  export default defineConfig({
30
- name: 'my-integration',
31
- version: '1.0.0',
36
+ name: 'My Integration',
37
+ version: pkg.version,
38
+ description: 'Description of what this app does',
32
39
  computeLayer: 'serverless',
33
- tools: import('./src/tools/registry'),
34
- webhooks: import('./src/webhooks/registry'),
40
+
41
+ tools: import('./src/registries'),
42
+ webhooks: import('./src/registries'),
43
+ provision: import('./provision'),
35
44
  })
36
45
  ```
37
46
 
38
- ### 2. Define a tool
47
+ ### 2. Define your provision config
48
+
49
+ ```ts
50
+ // provision.ts
51
+ import type { ProvisionConfig } from 'skedyul'
52
+
53
+ import env from './env'
54
+ import { models, relationships } from './crm'
55
+ import * as channels from './channels'
56
+ import * as pages from './pages'
57
+ import navigation from './pages/navigation'
58
+
59
+ const config: ProvisionConfig = {
60
+ env,
61
+ navigation,
62
+ models: Object.values(models),
63
+ channels: Object.values(channels),
64
+ pages: Object.values(pages),
65
+ relationships,
66
+ }
67
+
68
+ export default config
69
+ ```
70
+
71
+ ### 3. Define a model
72
+
73
+ ```ts
74
+ // crm/models/contact.ts
75
+ import { defineModel } from 'skedyul'
76
+
77
+ export default defineModel({
78
+ handle: 'contact',
79
+ label: 'Contact',
80
+ labelPlural: 'Contacts',
81
+ scope: 'shared',
82
+
83
+ fields: [
84
+ {
85
+ handle: 'name',
86
+ label: 'Name',
87
+ type: 'string',
88
+ required: true,
89
+ owner: 'workplace',
90
+ },
91
+ {
92
+ handle: 'email',
93
+ label: 'Email',
94
+ type: 'string',
95
+ required: false,
96
+ owner: 'workplace',
97
+ },
98
+ ],
99
+ })
100
+ ```
101
+
102
+ ### 4. Define a tool
39
103
 
40
104
  ```ts
41
105
  // src/tools/hello.ts
@@ -65,7 +129,7 @@ export const helloTool: ToolDefinition<Input, Output> = {
65
129
  }
66
130
  ```
67
131
 
68
- ### 3. Start the server
132
+ ### 5. Start the server
69
133
 
70
134
  ```ts
71
135
  // src/server.ts
@@ -95,6 +159,33 @@ await mcpServer.listen(3000)
95
159
  | [Configuration](./docs/configuration.md) | skedyul.config.ts reference |
96
160
  | [Errors](./docs/errors.md) | Error types and handling patterns |
97
161
 
162
+ ## Project Structure
163
+
164
+ The recommended project structure uses modular, file-based configuration:
165
+
166
+ ```
167
+ my-app/
168
+ ├── skedyul.config.ts # App metadata + imports
169
+ ├── provision.ts # Aggregates all modular configs
170
+ ├── env.ts # Environment variables
171
+ ├── crm/
172
+ │ ├── index.ts # Re-exports models + relationships
173
+ │ ├── relationships.ts # Model relationships
174
+ │ └── models/
175
+ │ ├── index.ts
176
+ │ └── contact.ts
177
+ ├── channels/
178
+ │ ├── index.ts
179
+ │ └── phone.ts
180
+ ├── pages/
181
+ │ ├── index.ts
182
+ │ ├── navigation.ts # Root navigation
183
+ │ └── settings/
184
+ │ └── page.ts
185
+ └── src/
186
+ └── registries.ts # Tools and webhooks
187
+ ```
188
+
98
189
  ## Server Modes
99
190
 
100
191
  ### Dedicated (Docker/ECS)
package/dist/.build-stamp CHANGED
@@ -1 +1 @@
1
- 1771899916059
1
+ 1771903579449
@@ -2,7 +2,7 @@
2
2
  * Config module - re-exports all config types and utilities.
3
3
  *
4
4
  * NAMING CONVENTIONS:
5
- * - All type literals use lowercase (e.g., 'string', 'internal', 'one-to-many')
5
+ * - All type literals use lowercase (e.g., 'string', 'internal', 'one_to_many')
6
6
  * - Use `handle` for unique identifiers (snake_case)
7
7
  * - Use `label` for display names (human-readable)
8
8
  * - Use `description` for optional explanatory text
@@ -3,7 +3,7 @@
3
3
  * Config module - re-exports all config types and utilities.
4
4
  *
5
5
  * NAMING CONVENTIONS:
6
- * - All type literals use lowercase (e.g., 'string', 'internal', 'one-to-many')
6
+ * - All type literals use lowercase (e.g., 'string', 'internal', 'one_to_many')
7
7
  * - Use `handle` for unique identifiers (snake_case)
8
8
  * - Use `label` for display names (human-readable)
9
9
  * - Use `description` for optional explanatory text
@@ -4,7 +4,7 @@
4
4
  * ## NAMING CONVENTIONS
5
5
  *
6
6
  * ### Type Literals
7
- * All type literals use **lowercase** (e.g., 'string', 'internal', 'one-to-many').
7
+ * All type literals use **lowercase** (e.g., 'string', 'internal', 'one_to_many').
8
8
  * This is more modern, aligns with TypeScript conventions, and is easier to type.
9
9
  *
10
10
  * ### Identifiers
@@ -5,7 +5,7 @@
5
5
  * ## NAMING CONVENTIONS
6
6
  *
7
7
  * ### Type Literals
8
- * All type literals use **lowercase** (e.g., 'string', 'internal', 'one-to-many').
8
+ * All type literals use **lowercase** (e.g., 'string', 'internal', 'one_to_many').
9
9
  * This is more modern, aligns with TypeScript conventions, and is easier to type.
10
10
  *
11
11
  * ### Identifiers
@@ -351,7 +351,7 @@ export interface ListBlock {
351
351
  * Model mapper block definition - for mapping SHARED models to workspace models.
352
352
  */
353
353
  export interface ModelMapperBlock {
354
- type: 'model-mapper';
354
+ type: 'model_mapper';
355
355
  /** The SHARED model handle from provision config */
356
356
  model: string;
357
357
  }
@@ -25,7 +25,7 @@ export type FieldType = 'string' | 'text' | 'number' | 'boolean' | 'date' | 'dat
25
25
  /**
26
26
  * Relationship cardinality between models.
27
27
  */
28
- export type Cardinality = 'one-to-one' | 'one-to-many' | 'many-to-one' | 'many-to-many';
28
+ export type Cardinality = 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
29
29
  /**
30
30
  * Behavior when a related record is deleted.
31
31
  * - 'none': No action (orphan the reference)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skedyul",
3
- "version": "0.3.19",
3
+ "version": "1.0.1",
4
4
  "description": "The Skedyul SDK for Node.js",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",