swallowkit 1.0.0-beta.2 โ†’ 1.0.0-beta.20

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 (191) hide show
  1. package/LICENSE +21 -21
  2. package/README.ja.md +312 -215
  3. package/README.md +369 -216
  4. package/dist/__tests__/fixtures.d.ts +22 -0
  5. package/dist/__tests__/fixtures.d.ts.map +1 -0
  6. package/dist/__tests__/fixtures.js +146 -0
  7. package/dist/__tests__/fixtures.js.map +1 -0
  8. package/dist/cli/commands/add-auth.d.ts +10 -0
  9. package/dist/cli/commands/add-auth.d.ts.map +1 -0
  10. package/dist/cli/commands/add-auth.js +444 -0
  11. package/dist/cli/commands/add-auth.js.map +1 -0
  12. package/dist/cli/commands/add-connector.d.ts +20 -0
  13. package/dist/cli/commands/add-connector.d.ts.map +1 -0
  14. package/dist/cli/commands/add-connector.js +163 -0
  15. package/dist/cli/commands/add-connector.js.map +1 -0
  16. package/dist/cli/commands/create-model.d.ts +1 -4
  17. package/dist/cli/commands/create-model.d.ts.map +1 -1
  18. package/dist/cli/commands/create-model.js +21 -82
  19. package/dist/cli/commands/create-model.js.map +1 -1
  20. package/dist/cli/commands/dev-seeds.d.ts +35 -0
  21. package/dist/cli/commands/dev-seeds.d.ts.map +1 -0
  22. package/dist/cli/commands/dev-seeds.js +292 -0
  23. package/dist/cli/commands/dev-seeds.js.map +1 -0
  24. package/dist/cli/commands/dev.d.ts +19 -0
  25. package/dist/cli/commands/dev.d.ts.map +1 -1
  26. package/dist/cli/commands/dev.js +476 -117
  27. package/dist/cli/commands/dev.js.map +1 -1
  28. package/dist/cli/commands/index.d.ts +1 -0
  29. package/dist/cli/commands/index.d.ts.map +1 -1
  30. package/dist/cli/commands/index.js +3 -1
  31. package/dist/cli/commands/index.js.map +1 -1
  32. package/dist/cli/commands/init.d.ts +13 -0
  33. package/dist/cli/commands/init.d.ts.map +1 -1
  34. package/dist/cli/commands/init.js +2627 -1708
  35. package/dist/cli/commands/init.js.map +1 -1
  36. package/dist/cli/commands/scaffold.d.ts +3 -0
  37. package/dist/cli/commands/scaffold.d.ts.map +1 -1
  38. package/dist/cli/commands/scaffold.js +617 -129
  39. package/dist/cli/commands/scaffold.js.map +1 -1
  40. package/dist/cli/index.d.ts +4 -1
  41. package/dist/cli/index.d.ts.map +1 -1
  42. package/dist/cli/index.js +162 -42
  43. package/dist/cli/index.js.map +1 -1
  44. package/dist/core/config.d.ts +8 -2
  45. package/dist/core/config.d.ts.map +1 -1
  46. package/dist/core/config.js +90 -4
  47. package/dist/core/config.js.map +1 -1
  48. package/dist/core/mock/connector-mock-server.d.ts +101 -0
  49. package/dist/core/mock/connector-mock-server.d.ts.map +1 -0
  50. package/dist/core/mock/connector-mock-server.js +480 -0
  51. package/dist/core/mock/connector-mock-server.js.map +1 -0
  52. package/dist/core/mock/zod-mock-generator.d.ts +14 -0
  53. package/dist/core/mock/zod-mock-generator.d.ts.map +1 -0
  54. package/dist/core/mock/zod-mock-generator.js +163 -0
  55. package/dist/core/mock/zod-mock-generator.js.map +1 -0
  56. package/dist/core/operations/create-model.d.ts +15 -0
  57. package/dist/core/operations/create-model.d.ts.map +1 -0
  58. package/dist/core/operations/create-model.js +171 -0
  59. package/dist/core/operations/create-model.js.map +1 -0
  60. package/dist/core/operations/runtime.d.ts +32 -0
  61. package/dist/core/operations/runtime.d.ts.map +1 -0
  62. package/dist/core/operations/runtime.js +225 -0
  63. package/dist/core/operations/runtime.js.map +1 -0
  64. package/dist/core/operations/scaffold-machine.d.ts +16 -0
  65. package/dist/core/operations/scaffold-machine.d.ts.map +1 -0
  66. package/dist/core/operations/scaffold-machine.js +63 -0
  67. package/dist/core/operations/scaffold-machine.js.map +1 -0
  68. package/dist/core/project/manifest.d.ts +92 -0
  69. package/dist/core/project/manifest.d.ts.map +1 -0
  70. package/dist/core/project/manifest.js +321 -0
  71. package/dist/core/project/manifest.js.map +1 -0
  72. package/dist/core/project/validation.d.ts +20 -0
  73. package/dist/core/project/validation.d.ts.map +1 -0
  74. package/dist/core/project/validation.js +204 -0
  75. package/dist/core/project/validation.js.map +1 -0
  76. package/dist/core/scaffold/auth-generator.d.ts +38 -0
  77. package/dist/core/scaffold/auth-generator.d.ts.map +1 -0
  78. package/dist/core/scaffold/auth-generator.js +1244 -0
  79. package/dist/core/scaffold/auth-generator.js.map +1 -0
  80. package/dist/core/scaffold/connector-functions-generator.d.ts +41 -0
  81. package/dist/core/scaffold/connector-functions-generator.d.ts.map +1 -0
  82. package/dist/core/scaffold/connector-functions-generator.js +1027 -0
  83. package/dist/core/scaffold/connector-functions-generator.js.map +1 -0
  84. package/dist/core/scaffold/functions-generator.d.ts +7 -1
  85. package/dist/core/scaffold/functions-generator.d.ts.map +1 -1
  86. package/dist/core/scaffold/functions-generator.js +920 -213
  87. package/dist/core/scaffold/functions-generator.js.map +1 -1
  88. package/dist/core/scaffold/model-parser.d.ts +20 -1
  89. package/dist/core/scaffold/model-parser.d.ts.map +1 -1
  90. package/dist/core/scaffold/model-parser.js +329 -135
  91. package/dist/core/scaffold/model-parser.js.map +1 -1
  92. package/dist/core/scaffold/nextjs-generator.d.ts +8 -0
  93. package/dist/core/scaffold/nextjs-generator.d.ts.map +1 -1
  94. package/dist/core/scaffold/nextjs-generator.js +314 -182
  95. package/dist/core/scaffold/nextjs-generator.js.map +1 -1
  96. package/dist/core/scaffold/openapi-generator.d.ts +3 -0
  97. package/dist/core/scaffold/openapi-generator.d.ts.map +1 -0
  98. package/dist/core/scaffold/openapi-generator.js +190 -0
  99. package/dist/core/scaffold/openapi-generator.js.map +1 -0
  100. package/dist/core/scaffold/ui-generator.d.ts +10 -4
  101. package/dist/core/scaffold/ui-generator.d.ts.map +1 -1
  102. package/dist/core/scaffold/ui-generator.js +768 -663
  103. package/dist/core/scaffold/ui-generator.js.map +1 -1
  104. package/dist/database/base-model.d.ts +3 -3
  105. package/dist/database/base-model.js +3 -3
  106. package/dist/index.d.ts +2 -2
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +2 -1
  109. package/dist/index.js.map +1 -1
  110. package/dist/machine/contracts.d.ts +16 -0
  111. package/dist/machine/contracts.d.ts.map +1 -0
  112. package/dist/machine/contracts.js +3 -0
  113. package/dist/machine/contracts.js.map +1 -0
  114. package/dist/machine/errors.d.ts +11 -0
  115. package/dist/machine/errors.d.ts.map +1 -0
  116. package/dist/machine/errors.js +34 -0
  117. package/dist/machine/errors.js.map +1 -0
  118. package/dist/machine/index.d.ts +3 -0
  119. package/dist/machine/index.d.ts.map +1 -0
  120. package/dist/machine/index.js +156 -0
  121. package/dist/machine/index.js.map +1 -0
  122. package/dist/mcp/index.d.ts +25 -0
  123. package/dist/mcp/index.d.ts.map +1 -0
  124. package/dist/mcp/index.js +184 -0
  125. package/dist/mcp/index.js.map +1 -0
  126. package/dist/types/index.d.ts +65 -0
  127. package/dist/types/index.d.ts.map +1 -1
  128. package/dist/utils/package-manager.d.ts +109 -0
  129. package/dist/utils/package-manager.d.ts.map +1 -0
  130. package/dist/utils/package-manager.js +215 -0
  131. package/dist/utils/package-manager.js.map +1 -0
  132. package/package.json +85 -73
  133. package/src/__tests__/__snapshots__/functions-generator.test.ts.snap +1139 -0
  134. package/src/__tests__/__snapshots__/nextjs-generator.test.ts.snap +194 -0
  135. package/src/__tests__/__snapshots__/ui-generator.test.ts.snap +532 -0
  136. package/src/__tests__/auth.test.ts +654 -0
  137. package/src/__tests__/config.test.ts +263 -0
  138. package/src/__tests__/connector-functions-generator.test.ts +288 -0
  139. package/src/__tests__/connector-mock-server.test.ts +439 -0
  140. package/src/__tests__/connector-model-bff.test.ts +162 -0
  141. package/src/__tests__/dev-seeds.test.ts +112 -0
  142. package/src/__tests__/dev.test.ts +148 -0
  143. package/src/__tests__/fixtures.ts +144 -0
  144. package/src/__tests__/functions-generator.test.ts +237 -0
  145. package/src/__tests__/init.test.ts +80 -0
  146. package/src/__tests__/machine.test.ts +212 -0
  147. package/src/__tests__/mcp.test.ts +56 -0
  148. package/src/__tests__/model-parser.test.ts +72 -0
  149. package/src/__tests__/nextjs-generator.test.ts +97 -0
  150. package/src/__tests__/openapi-generator.test.ts +43 -0
  151. package/src/__tests__/package-manager.test.ts +189 -0
  152. package/src/__tests__/scaffold.test.ts +39 -0
  153. package/src/__tests__/string-utils.test.ts +75 -0
  154. package/src/__tests__/ui-generator.test.ts +144 -0
  155. package/src/__tests__/zod-mock-generator.test.ts +132 -0
  156. package/src/cli/commands/add-auth.ts +500 -0
  157. package/src/cli/commands/add-connector.ts +158 -0
  158. package/src/cli/commands/create-model.ts +62 -0
  159. package/src/cli/commands/dev-seeds.ts +358 -0
  160. package/src/cli/commands/dev.ts +962 -0
  161. package/src/cli/commands/index.ts +9 -0
  162. package/src/cli/commands/init.ts +3371 -0
  163. package/src/cli/commands/provision.ts +193 -0
  164. package/src/cli/commands/scaffold.ts +1211 -0
  165. package/src/cli/index.ts +191 -0
  166. package/src/core/config.ts +308 -0
  167. package/src/core/mock/connector-mock-server.ts +555 -0
  168. package/src/core/mock/zod-mock-generator.ts +205 -0
  169. package/src/core/operations/create-model.ts +174 -0
  170. package/src/core/operations/runtime.ts +235 -0
  171. package/src/core/operations/scaffold-machine.ts +91 -0
  172. package/src/core/project/manifest.ts +402 -0
  173. package/src/core/project/validation.ts +221 -0
  174. package/src/core/scaffold/auth-generator.ts +1284 -0
  175. package/src/core/scaffold/connector-functions-generator.ts +1128 -0
  176. package/src/core/scaffold/functions-generator.ts +970 -0
  177. package/src/core/scaffold/model-parser.ts +841 -0
  178. package/src/core/scaffold/nextjs-generator.ts +370 -0
  179. package/src/core/scaffold/openapi-generator.ts +212 -0
  180. package/src/core/scaffold/ui-generator.ts +1061 -0
  181. package/src/database/base-model.ts +184 -0
  182. package/src/database/client.ts +140 -0
  183. package/src/database/repository.ts +104 -0
  184. package/src/database/runtime-check.ts +25 -0
  185. package/src/index.ts +27 -0
  186. package/src/machine/contracts.ts +17 -0
  187. package/src/machine/errors.ts +34 -0
  188. package/src/machine/index.ts +173 -0
  189. package/src/mcp/index.ts +185 -0
  190. package/src/types/index.ts +134 -0
  191. package/src/utils/package-manager.ts +229 -0
package/README.md CHANGED
@@ -1,216 +1,369 @@
1
- # SwallowKit
2
-
3
- [![npm version](https://img.shields.io/npm/v/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
4
- [![npm downloads](https://img.shields.io/npm/dm/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
5
- [![license](https://img.shields.io/npm/l/swallowkit.svg)](./LICENSE)
6
-
7
- English | [ๆ—ฅๆœฌ่ชž](./README.ja.md)
8
-
9
- **Type-safe schema-driven development toolkit for Next.js applications on Azure**
10
-
11
- SwallowKit enables developers to build full-stack Next.js applications with external Azure Functions backends while maintaining end-to-end type safety through shared Zod schemas.
12
-
13
- Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
14
-
15
- Next.js API routes are restricted to use only as BFF (Backend For Frontend), offloading business logic to Azure Functions to provide clear separation between client and server.
16
-
17
- Featuring Scaffold functionality to automatically generate CRUD operations from Zod schemas, achieving type-safe integration with Cosmos DB and consistent type definitions and validation.
18
-
19
- > **Note**: This project is in active development. APIs may change in future versions.
20
-
21
- ## โœจ Key Features
22
-
23
- - **๐Ÿ”„ Zod Schema Sharing** - Same schema across frontend, BFF, Azure Functions, and Cosmos DB
24
- - **โšก CRUD Code Generation** - Auto-generate Azure Functions + Next.js code with `swallowkit scaffold`
25
- - **๐Ÿ›ก๏ธ Full Type Safety** - End-to-end TypeScript from client to database
26
- - **๐ŸŽฏ BFF Pattern** - Next.js API Routes as BFF layer with auto-validation and resource inference
27
- - **โ˜๏ธ Azure Optimized** - Minimal-cost architecture with Static Web Apps + Functions + Cosmos DB
28
- - **๐Ÿš€ Easy Deployment** - Auto-generated Bicep IaC + CI/CD workflows
29
-
30
- ## ๐Ÿ“š Documentation
31
-
32
- - **[CLI Reference](./docs/cli-reference.md)** - All commands in detail
33
- - **[Scaffold Guide](./docs/scaffold-guide.md)** - CRUD code generation
34
- - **[Zod Schema Sharing Guide](./docs/zod-schema-sharing-guide.md)** - Schema design
35
- - **[Deployment Guide](./docs/deployment-guide.md)** - Deploy to Azure
36
-
37
- ## ๐Ÿš€ Quick Start
38
-
39
- ### 1. Create Project
40
-
41
- ```bash
42
- npx swallowkit init my-app
43
- cd my-app
44
- ```
45
-
46
- ### 2. Create Models
47
-
48
- You can create multiple models at once:
49
-
50
- ```bash
51
- npx swallowkit create-model category todo
52
- ```
53
-
54
- This generates `shared/models/category.ts` and `shared/models/todo.ts`. Customize them by adding your required fields:
55
-
56
- ```typescript
57
- // shared/models/category.ts
58
- import { z } from 'zod';
59
-
60
- export const category = z.object({
61
- id: z.string(),
62
- name: z.string().min(1).max(50),
63
- createdAt: z.string().optional(),
64
- updatedAt: z.string().optional(),
65
- });
66
-
67
- export type Category = z.infer<typeof category>;
68
- ```
69
-
70
- For parent-child relationships, use **nested schemas** instead of ID references:
71
-
72
- ```typescript
73
- // shared/models/todo.ts
74
- import { z } from 'zod';
75
- import { category } from './category';
76
-
77
- export const todo = z.object({
78
- id: z.string(),
79
- text: z.string().min(1).max(200),
80
- completed: z.boolean().default(false),
81
- category: category.optional(), // Nested object (not categoryId)
82
- createdAt: z.string().optional(),
83
- updatedAt: z.string().optional(),
84
- });
85
-
86
- export type Todo = z.infer<typeof todo>;
87
- ```
88
-
89
- > **Tip**: Nesting preserves type safety and stores related data together in the document, which is natural for Cosmos DB's document model.
90
-
91
- ### 3. Generate CRUD Code
92
-
93
- ```bash
94
- npx swallowkit scaffold shared/models/todo.ts
95
- ```
96
-
97
- This auto-generates:
98
- - โœ… Azure Functions (CRUD endpoints + Cosmos DB bindings)
99
- - โœ… Next.js BFF API Routes (auto-validation + resource inference)
100
- - โœ… React Components (type-safe forms)
101
-
102
- ### 4. Start Development Server
103
-
104
- ```bash
105
- npx swallowkit dev
106
- ```
107
-
108
- - Next.js: http://localhost:3000
109
- - Azure Functions: http://localhost:7071
110
-
111
- ### 5. Use from Frontend
112
-
113
- ```typescript
114
- import { api } from '@/lib/api/backend';
115
- import type { Todo } from '@/shared/models/todo';
116
-
117
- // Get all - call BFF endpoint
118
- const todos = await api.get<Todo[]>('/api/todos');
119
-
120
- // Create - validated by backend
121
- const created = await api.post<Todo>('/api/todos', {
122
- text: 'Buy milk',
123
- completed: false
124
- });
125
-
126
- // Update - validated by backend
127
- const updated = await api.put<Todo>('/api/todos/123', { completed: true });
128
-
129
- // Delete
130
- await api.delete('/api/todos/123');
131
- ```
132
-
133
- ## ๐Ÿ—๏ธ Architecture
134
-
135
- ```
136
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
137
- โ”‚ Frontend (React) โ”‚
138
- โ”‚ - Client Components โ”‚
139
- โ”‚ - Server Components (SSR) โ”‚
140
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
141
- โ”‚ api.post('/api/todos', data)
142
- โ–ผ
143
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
144
- โ”‚ BFF Layer (Next.js API Routes) โ”‚
145
- โ”‚ - Auto Schema Validation (Zod) โ”‚
146
- โ”‚ - Error Handling โ”‚
147
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
148
- โ”‚ HTTP Request
149
- โ–ผ
150
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
151
- โ”‚ Azure Functions (Backend) โ”‚
152
- โ”‚ - HTTP Triggers (CRUD) โ”‚
153
- โ”‚ - Zod Validation (Re-check) โ”‚
154
- โ”‚ - Business Logic โ”‚
155
- โ”‚ - Cosmos DB Bindings โ”‚
156
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
157
- โ”‚
158
- โ–ผ
159
- โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
160
- โ”‚ Azure Cosmos DB โ”‚
161
- โ”‚ - NoSQL Database โ”‚
162
- โ”‚ - Zod Schema Validation โ”‚
163
- โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
164
- ```
165
-
166
- **Key Patterns:**
167
- - **BFF (Backend For Frontend)**: Next.js API Routes proxy to Azure Functions
168
- - **Shared Schemas**: Zod schemas used across frontend, BFF, Functions, and DB
169
- - **Type Safety**: TypeScript types auto-inferred from Zod
170
- - **Managed Identity**: Secure service connections (no connection strings)
171
-
172
- ## ๐Ÿ“ฆ Prerequisites
173
-
174
- - Node.js 22.x
175
- - Azure Cosmos DB Emulator (local development)
176
- - [Official documentation (vNext recommended)](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux)
177
- - Windows: [Download](https://aka.ms/cosmosdb-emulator)
178
- - Docker: `docker run -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator`
179
-
180
- ## ๐Ÿš€ Deploy to Azure
181
-
182
- Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
183
-
184
- **1. Provision resources (Bicep IaC)**
185
-
186
- ```bash
187
- npx swallowkit provision --resource-group my-app-rg --location japaneast
188
- ```
189
-
190
- After provisioning, the required CI/CD secret values are displayed in the terminal. Copy them.
191
-
192
- **2. Push code**
193
-
194
- ```bash
195
- git push origin main
196
- ```
197
-
198
- **3. Cancel the auto-triggered CI/CD run** โ€” it will fail because secrets are not registered yet.
199
-
200
- **4. Register the displayed secret values** in GitHub (Settings โ†’ Secrets) or Azure DevOps (Pipelines โ†’ Library).
201
-
202
- **5. Manually re-run the CI/CD workflow.**
203
-
204
- See **[Deployment Guide](./docs/deployment-guide.md)** for details.
205
-
206
- ## License
207
-
208
- MIT
209
-
210
- ## ๐Ÿ”— Related Links
211
-
212
- - [Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/)
213
- - [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/)
214
- - [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/)
215
- - [Next.js](https://nextjs.org/)
216
- - [Zod](https://zod.dev/)
1
+ # SwallowKit
2
+
3
+ [![npm version](https://img.shields.io/npm/v/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
4
+ [![npm downloads](https://img.shields.io/npm/dm/swallowkit.svg)](https://www.npmjs.com/package/swallowkit)
5
+ [![VS Code Marketplace](https://img.shields.io/visual-studio-marketplace/v/himanago.swallowkit-vscode?label=VS%20Code%20Extension)](https://marketplace.visualstudio.com/items?itemName=himanago.swallowkit-vscode)
6
+ [![license](https://img.shields.io/npm/l/swallowkit.svg)](./LICENSE)
7
+
8
+ English | [ๆ—ฅๆœฌ่ชž](./README.ja.md)
9
+
10
+ **Type-safe schema-driven development toolkit for Next.js applications on Azure**
11
+
12
+ SwallowKit enables developers to build full-stack Next.js applications with external Azure Functions backends while maintaining end-to-end type safety through shared Zod schemas.
13
+
14
+ Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
15
+
16
+ Next.js API routes are restricted to use only as BFF (Backend For Frontend), offloading business logic to Azure Functions to provide clear separation between client and server.
17
+
18
+ Featuring Scaffold functionality to automatically generate CRUD operations from Zod schemas, achieving type-safe integration with Cosmos DB and consistent type definitions and validation.
19
+
20
+ > **Note**: This project is in active development. APIs may change in future versions.
21
+
22
+ ## โœจ Key Features
23
+
24
+ - **๐Ÿ”„ Zod Schema Sharing** - Keep Zod as the source of truth across frontend, BFF, Azure Functions, and Cosmos DB
25
+ - **โšก CRUD Code Generation** - Auto-generate Azure Functions + Next.js code with `swallowkit scaffold`
26
+ - **๐ŸŒ Multi-language Functions Backends** - Choose TypeScript, C#, or Python for Azure Functions during `init`
27
+ - **๐Ÿงฌ OpenAPI Schema Bridge** - For C#/Python backends, `scaffold` exports OpenAPI from Zod and generates backend schema assets
28
+ - **๐Ÿ›ก๏ธ Contract Safety** - Keep frontend/BFF contracts aligned with backend implementations through shared Zod or generated OpenAPI-derived models
29
+ - **๐ŸŽฏ BFF Pattern** - Next.js API Routes as BFF layer with auto-validation and resource inference
30
+ - **โ˜๏ธ Azure Optimized** - Minimal-cost architecture with Static Web Apps + Functions + Cosmos DB
31
+ - **๐Ÿš€ Easy Deployment** - Auto-generated Bicep IaC + CI/CD workflows
32
+ - **๐Ÿค– AI-Friendly** - Auto-generated instruction files (`AGENTS.md`, `CLAUDE.md`, `.github/copilot-instructions.md`) and layer-specific rules help GitHub Copilot, Claude Code, and OpenAI Codex follow project conventions
33
+ - **๐Ÿง  MCP + Machine Interface** - `swallowkit machine ...` exposes deterministic JSON inspection / validation / generation commands, and `swallowkit-mcp` exposes the same capabilities over MCP stdio
34
+ - **๐Ÿ”Œ External Data Connectors** - Integrate MySQL, PostgreSQL, REST APIs, and other external data sources alongside Cosmos DB โ€” same Zod-driven scaffold workflow with full type safety
35
+ - **๐Ÿ” Authentication & Authorization** - Built-in support for custom JWT auth (with external RDB user stores) and role-based access control per model โ€” with planned Static Web Apps auth integration
36
+ - **๐Ÿงฉ [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=himanago.swallowkit-vscode)** - GUI wizard for init/scaffold/dev, right-click model scaffolding, dev server status bar, and TypeScript snippets
37
+
38
+ ## ๐Ÿ“š Documentation
39
+
40
+ Visit the **[SwallowKit Documentation](https://himanago.github.io/swallowkit/)** for the full docs (also available in [ๆ—ฅๆœฌ่ชž](https://himanago.github.io/swallowkit/ja/)).
41
+
42
+ - **[CLI Reference](https://himanago.github.io/swallowkit/en/cli-reference)** - All commands in detail
43
+ - **[Scaffold Guide](https://himanago.github.io/swallowkit/en/scaffold-guide)** - CRUD code generation
44
+ - **[Connector Guide](https://himanago.github.io/swallowkit/en/connector-guide)** - External data source integration
45
+ - **[Authentication Guide](https://himanago.github.io/swallowkit/en/auth-guide)** - Authentication and role-based access control
46
+ - **[Zod Schema Sharing Guide](https://himanago.github.io/swallowkit/en/zod-schema-sharing-guide)** - Schema design
47
+ - **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** - Deploy to Azure
48
+
49
+ ## ๐Ÿš€ Quick Start
50
+
51
+ ### 1. Create Project
52
+
53
+ ```bash
54
+ npx swallowkit init my-app
55
+ # or
56
+ pnpm dlx swallowkit init my-app
57
+ cd my-app
58
+ ```
59
+
60
+ The interactive prompts ask for CI/CD provider, Azure Functions backend language, Cosmos DB mode, and network settings. You can also specify them as flags to skip prompts entirely:
61
+
62
+ ```bash
63
+ # Non-interactive mode (useful for VS Code extensions or automation)
64
+ npx swallowkit init my-app --cicd github --backend-language python --cosmos-db-mode serverless --vnet outbound
65
+ ```
66
+
67
+ | Flag | Values | Description |
68
+ |------|--------|-------------|
69
+ | `--cicd <provider>` | `github`, `azure`, `skip` | CI/CD provider |
70
+ | `--backend-language <language>` | `typescript`, `csharp`, `python` | Azure Functions backend language |
71
+ | `--cosmos-db-mode <mode>` | `freetier`, `serverless` | Cosmos DB pricing mode |
72
+ | `--vnet <option>` | `outbound`, `none` | Network security |
73
+
74
+ Omit any flag to be prompted for that value interactively.
75
+
76
+ ### 2. Create Models
77
+
78
+ You can create multiple models at once:
79
+
80
+ ```bash
81
+ npx swallowkit create-model category todo
82
+ # or
83
+ pnpm dlx swallowkit create-model category todo
84
+ ```
85
+
86
+ This generates `shared/models/category.ts` and `shared/models/todo.ts`. Customize them by adding your required fields:
87
+
88
+ ```typescript
89
+ // shared/models/category.ts
90
+ import { z } from 'zod';
91
+
92
+ export const category = z.object({
93
+ id: z.string(),
94
+ name: z.string().min(1).max(50),
95
+ createdAt: z.string().optional(),
96
+ updatedAt: z.string().optional(),
97
+ });
98
+
99
+ export type Category = z.infer<typeof category>;
100
+ ```
101
+
102
+ For parent-child relationships, use **nested schemas** instead of ID references:
103
+
104
+ ```typescript
105
+ // shared/models/todo.ts
106
+ import { z } from 'zod';
107
+ import { category } from './category';
108
+
109
+ export const todo = z.object({
110
+ id: z.string(),
111
+ text: z.string().min(1).max(200),
112
+ completed: z.boolean().default(false),
113
+ category: category.optional(), // Nested object (not categoryId)
114
+ createdAt: z.string().optional(),
115
+ updatedAt: z.string().optional(),
116
+ });
117
+
118
+ export type Todo = z.infer<typeof todo>;
119
+ ```
120
+
121
+ > **Tip**: Nesting preserves type safety and stores related data together in the document, which is natural for Cosmos DB's document model.
122
+
123
+ ### 3. Generate CRUD Code
124
+
125
+ ```bash
126
+ npx swallowkit scaffold shared/models/todo.ts
127
+ # or
128
+ pnpm dlx swallowkit scaffold shared/models/todo.ts
129
+ ```
130
+
131
+ This auto-generates:
132
+ - โœ… Azure Functions (CRUD endpoints + Cosmos DB bindings)
133
+ - โœ… Next.js BFF API Routes (auto-validation + resource inference)
134
+ - โœ… React Components (type-safe forms)
135
+
136
+ If you selected `csharp` or `python` at `init` time, `swallowkit scaffold` also writes an OpenAPI document under `functions/openapi/` and generates backend schema assets under `functions/generated/`.
137
+
138
+ ### 4. Start Development Server
139
+
140
+ ```bash
141
+ npx swallowkit dev
142
+ # or
143
+ pnpm dlx swallowkit dev
144
+ ```
145
+
146
+ - Next.js: http://localhost:3000
147
+ - Azure Functions: http://localhost:7071
148
+
149
+ If you want to replace Cosmos DB Emulator data before startup, generate an environment template and then launch `dev` with that environment:
150
+
151
+ ```bash
152
+ npx swallowkit create-dev-seeds local
153
+ # edit dev-seeds/local/*.json
154
+ npx swallowkit dev --seed-env local
155
+ ```
156
+
157
+ This workflow is designed for local debugging against the Cosmos DB Emulator:
158
+
159
+ - `create-dev-seeds <environment>` generates one JSON template per schema under `dev-seeds/<environment>/`
160
+ - each file name maps to a schema/container, for example `shared/models/todo.ts` -> `dev-seeds/local/todo.json` -> `Todos`
161
+ - when you start `dev --seed-env <environment>`, SwallowKit replaces the existing data for each matching container with the JSON documents from that environment
162
+ - containers without a matching JSON file are left untouched
163
+ - if `--seed-env` is omitted, or `dev-seeds/<environment>/` does not exist, current emulator data is preserved
164
+
165
+ Example file layout:
166
+
167
+ ```text
168
+ dev-seeds/
169
+ local/
170
+ todo.json
171
+ category.json
172
+ staging-debug/
173
+ todo.json
174
+ ```
175
+
176
+ Each `{schema}.json` file can contain either a single JSON object or an array of JSON objects. Every document must include an `id`:
177
+
178
+ ```json
179
+ [
180
+ {
181
+ "id": "seed-todo-001",
182
+ "name": "Seed todo one",
183
+ "createdAt": "2026-03-21T00:00:00.000Z",
184
+ "updatedAt": "2026-03-21T00:00:00.000Z"
185
+ },
186
+ {
187
+ "id": "seed-todo-002",
188
+ "name": "Seed todo two",
189
+ "createdAt": "2026-03-21T00:00:01.000Z",
190
+ "updatedAt": "2026-03-21T00:00:01.000Z"
191
+ }
192
+ ]
193
+ ```
194
+
195
+ Recommended workflow:
196
+
197
+ ```bash
198
+ npx swallowkit create-model todo
199
+ npx swallowkit scaffold shared/models/todo.ts
200
+ npx swallowkit create-dev-seeds local
201
+ # edit dev-seeds/local/todo.json
202
+ npx swallowkit dev --seed-env local
203
+ ```
204
+
205
+ ### 5. Use from Frontend
206
+
207
+ ```typescript
208
+ import { api } from '@/lib/api/backend';
209
+ import type { Todo } from '@/shared/models/todo';
210
+
211
+ // Get all - call BFF endpoint
212
+ const todos = await api.get<Todo[]>('/api/todos');
213
+
214
+ // Create - validated by backend
215
+ const created = await api.post<Todo>('/api/todos', {
216
+ text: 'Buy milk',
217
+ completed: false
218
+ });
219
+
220
+ // Update - validated by backend
221
+ const updated = await api.put<Todo>('/api/todos/123', { completed: true });
222
+
223
+ // Delete
224
+ await api.delete('/api/todos/123');
225
+ ```
226
+
227
+ ### 6. Connect External Data Sources (Optional)
228
+
229
+ SwallowKit supports **connectors** for integrating external RDB databases and REST APIs alongside Cosmos DB, using the same Zod-driven workflow:
230
+
231
+ ```bash
232
+ # Register a connector
233
+ npx swallowkit add-connector mysql --type rdb --provider mysql --connection-env MYSQL_CONNECTION_STRING
234
+
235
+ # Create a connector-aware model
236
+ npx swallowkit create-model user --connector mysql
237
+ # edit shared/models/user.ts (customize schema + connectorConfig)
238
+
239
+ # Scaffold generates connector-specific Functions code
240
+ npx swallowkit scaffold shared/models/user.ts
241
+
242
+ # Develop locally with mock data (no real MySQL needed)
243
+ npx swallowkit dev --mock-connectors
244
+ ```
245
+
246
+ The frontend and BFF layer are completely transparent to data source differences โ€” `callFunction()` works identically for Cosmos DB and connector models. See the **[Connector Guide](https://himanago.github.io/swallowkit/en/connector-guide)** for details.
247
+
248
+ ## ๐Ÿค– AI / MCP Integration
249
+
250
+ SwallowKit provides a machine-readable CLI surface for coding agents and MCP adapters. Instead of letting AI guess raw filesystem changes, it can go through SwallowKit's official generators, inspectors, and validators.
251
+
252
+ ```bash
253
+ # Inspect framework-owned project metadata
254
+ npx swallowkit machine inspect project
255
+
256
+ # Validate SwallowKit conventions and generated artifacts
257
+ npx swallowkit machine validate project
258
+
259
+ # Generate through the official machine interface
260
+ npx swallowkit machine generate model todo --overwrite never
261
+ npx swallowkit machine generate scaffold todo --api-only
262
+ ```
263
+
264
+ `swallowkit machine` is:
265
+
266
+ - non-interactive
267
+ - deterministic
268
+ - JSON-only on stdout
269
+ - structured on success and failure
270
+
271
+ For MCP clients, use the bundled stdio server:
272
+
273
+ ```bash
274
+ npx swallowkit-mcp
275
+ ```
276
+
277
+ The MCP server is intentionally a thin adapter with explicit tools only. It delegates real work to the machine CLI.
278
+
279
+ ## ๐Ÿ—๏ธ Architecture
280
+
281
+ ```
282
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
283
+ โ”‚ Frontend (React) โ”‚
284
+ โ”‚ - Client Components โ”‚
285
+ โ”‚ - Server Components (SSR) โ”‚
286
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
287
+ โ”‚ api.post('/api/todos', data)
288
+ โ–ผ
289
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
290
+ โ”‚ BFF Layer (Next.js API Routes) โ”‚
291
+ โ”‚ - Auto Schema Validation (Zod) โ”‚
292
+ โ”‚ - Error Handling โ”‚
293
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
294
+ โ”‚ HTTP Request
295
+ โ–ผ
296
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
297
+ โ”‚ Azure Functions (Backend) โ”‚
298
+ โ”‚ - HTTP Triggers (CRUD) โ”‚
299
+ โ”‚ - Zod Validation (Re-check) โ”‚
300
+ โ”‚ - Business Logic โ”‚
301
+ โ”‚ - Data Source Bindings โ”‚
302
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
303
+ โ”‚ โ”‚ โ”‚
304
+ โ–ผ โ–ผ โ–ผ
305
+ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
306
+ โ”‚ Azure Cosmos โ”‚ โ”‚ External โ”‚ โ”‚ External SaaS โ”‚
307
+ โ”‚ DB (Default) โ”‚ โ”‚ RDB (MySQL โ”‚ โ”‚ APIs (REST) โ”‚
308
+ โ”‚ โ”‚ โ”‚ PostgreSQL) โ”‚ โ”‚ โ”‚
309
+ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
310
+ ```
311
+
312
+ **Key Patterns:**
313
+ - **BFF (Backend For Frontend)**: Next.js API Routes proxy to Azure Functions
314
+ - **Shared Schemas**: Zod schemas stay in `shared/models/` as the source of truth
315
+ - **OpenAPI Bridge for C#/Python**: Non-TypeScript Functions consume generated assets under `functions/generated/`
316
+ - **External Connectors**: MySQL, PostgreSQL, REST APIs โ€” scaffold-generated Functions with the same BFF pattern
317
+ - **Contract Safety**: BFF and backend stay aligned through shared Zod or generated backend models
318
+ - **Managed Identity**: Secure service connections (no connection strings)
319
+
320
+ ## ๐Ÿ“ฆ Prerequisites
321
+
322
+ - Node.js 22.x
323
+ - **pnpm** (recommended): `corepack enable` or `npm install -g pnpm`
324
+ - npm also works โ€” SwallowKit auto-detects the package manager (if pnpm is installed, it is always preferred)
325
+ - Azure Cosmos DB Emulator (local development)
326
+ - [Official documentation (vNext recommended)](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux)
327
+ - Windows: [Download](https://aka.ms/cosmosdb-emulator)
328
+ - Docker: `docker run -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator`
329
+
330
+ ## ๐Ÿš€ Deploy to Azure
331
+
332
+ Deploy your Next.js app to Azure Static Web Apps using standalone mode, and connect to independent Azure Functions for backend operations.
333
+
334
+ **1. Provision resources (Bicep IaC)**
335
+
336
+ ```bash
337
+ npx swallowkit provision --resource-group my-app-rg
338
+ # or
339
+ pnpm dlx swallowkit provision --resource-group my-app-rg
340
+ ```
341
+
342
+ The command prompts you to choose the primary region and the Static Web App region. After provisioning, the terminal displays the CI/CD values you need for setup. Copy them.
343
+
344
+ **2. Push code**
345
+
346
+ ```bash
347
+ git push origin main
348
+ ```
349
+
350
+ **3. Cancel the auto-triggered CI/CD run** โ€” it will fail because secrets are not registered yet.
351
+
352
+ **4. Register the displayed secrets / variables** in GitHub (Settings โ†’ Secrets) or Azure DevOps (Pipelines โ†’ Library).
353
+
354
+ **5. Manually re-run the CI/CD workflow.**
355
+
356
+ See **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** for details.
357
+
358
+ ## License
359
+
360
+ MIT
361
+
362
+ ## ๐Ÿ”— Related Links
363
+
364
+ - [SwallowKit VS Code Extension](https://marketplace.visualstudio.com/items?itemName=himanago.swallowkit-vscode)
365
+ - [Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/)
366
+ - [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/)
367
+ - [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/)
368
+ - [Next.js](https://nextjs.org/)
369
+ - [Zod](https://zod.dev/)
@@ -0,0 +1,22 @@
1
+ import { ModelInfo } from "../core/scaffold/model-parser";
2
+ /**
3
+ * ใƒ†ใ‚นใƒˆ็”จใฎๅŸบๆœฌ็š„ใช ModelInfo ใƒ•ใ‚ฃใ‚ฏใ‚นใƒใƒฃ
4
+ */
5
+ export declare function createBasicModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
6
+ /**
7
+ * RDB ใ‚ณใƒใ‚ฏใ‚ฟ (read-only) ไป˜ใใฎ ModelInfo ใƒ•ใ‚ฃใ‚ฏใ‚นใƒใƒฃ
8
+ */
9
+ export declare function createRdbConnectorModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
10
+ /**
11
+ * API ใ‚ณใƒใ‚ฏใ‚ฟ (read-write) ไป˜ใใฎ ModelInfo ใƒ•ใ‚ฃใ‚ฏใ‚นใƒใƒฃ
12
+ */
13
+ export declare function createApiConnectorModelInfo(overrides?: Partial<ModelInfo>): ModelInfo;
14
+ /**
15
+ * ๅค–้ƒจใ‚ญใƒผใ‚’ๅซใ‚€ ModelInfo ใƒ•ใ‚ฃใ‚ฏใ‚นใƒใƒฃ
16
+ */
17
+ export declare function createModelInfoWithForeignKey(): ModelInfo;
18
+ /**
19
+ * enum ใƒ•ใ‚ฃใƒผใƒซใƒ‰ใ‚’ๅซใ‚€ ModelInfo ใƒ•ใ‚ฃใ‚ฏใ‚นใƒใƒฃ
20
+ */
21
+ export declare function createModelInfoWithEnum(): ModelInfo;
22
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAqB9E;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CAuBrF;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,SAAS,CA2BrF;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,SAAS,CAqBzD;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CA0BnD"}