swallowkit 1.0.0-beta.6 → 1.0.0-beta.60
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.ja.md +86 -177
- package/README.md +86 -178
- package/dist/__tests__/fixtures.d.ts +12 -0
- package/dist/__tests__/fixtures.d.ts.map +1 -1
- package/dist/__tests__/fixtures.js +101 -0
- package/dist/__tests__/fixtures.js.map +1 -1
- package/dist/cli/commands/add-auth.d.ts +15 -0
- package/dist/cli/commands/add-auth.d.ts.map +1 -0
- package/dist/cli/commands/add-auth.js +790 -0
- package/dist/cli/commands/add-auth.js.map +1 -0
- package/dist/cli/commands/add-connector.d.ts +20 -0
- package/dist/cli/commands/add-connector.d.ts.map +1 -0
- package/dist/cli/commands/add-connector.js +163 -0
- package/dist/cli/commands/add-connector.js.map +1 -0
- package/dist/cli/commands/cosmos-worktree-isolation.d.ts +25 -0
- package/dist/cli/commands/cosmos-worktree-isolation.d.ts.map +1 -0
- package/dist/cli/commands/cosmos-worktree-isolation.js +124 -0
- package/dist/cli/commands/cosmos-worktree-isolation.js.map +1 -0
- package/dist/cli/commands/create-model.d.ts +1 -4
- package/dist/cli/commands/create-model.d.ts.map +1 -1
- package/dist/cli/commands/create-model.js +19 -81
- package/dist/cli/commands/create-model.js.map +1 -1
- package/dist/cli/commands/dev-seeds.d.ts +62 -0
- package/dist/cli/commands/dev-seeds.d.ts.map +1 -0
- package/dist/cli/commands/dev-seeds.js +474 -0
- package/dist/cli/commands/dev-seeds.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +38 -0
- package/dist/cli/commands/dev.d.ts.map +1 -1
- package/dist/cli/commands/dev.js +733 -155
- package/dist/cli/commands/dev.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.d.ts.map +1 -1
- package/dist/cli/commands/index.js +3 -1
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +78 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +1453 -898
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/scaffold.d.ts +24 -0
- package/dist/cli/commands/scaffold.d.ts.map +1 -1
- package/dist/cli/commands/scaffold.js +473 -90
- package/dist/cli/commands/scaffold.js.map +1 -1
- package/dist/cli/index.d.ts +5 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +333 -55
- package/dist/cli/index.js.map +1 -1
- package/dist/core/config.d.ts +14 -3
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +179 -8
- package/dist/core/config.js.map +1 -1
- package/dist/core/mock/connector-mock-server.d.ts +101 -0
- package/dist/core/mock/connector-mock-server.d.ts.map +1 -0
- package/dist/core/mock/connector-mock-server.js +480 -0
- package/dist/core/mock/connector-mock-server.js.map +1 -0
- package/dist/core/mock/zod-mock-generator.d.ts +14 -0
- package/dist/core/mock/zod-mock-generator.d.ts.map +1 -0
- package/dist/core/mock/zod-mock-generator.js +163 -0
- package/dist/core/mock/zod-mock-generator.js.map +1 -0
- package/dist/core/operations/auth-operations.d.ts +61 -0
- package/dist/core/operations/auth-operations.d.ts.map +1 -0
- package/dist/core/operations/auth-operations.js +272 -0
- package/dist/core/operations/auth-operations.js.map +1 -0
- package/dist/core/operations/create-model.d.ts +15 -0
- package/dist/core/operations/create-model.d.ts.map +1 -0
- package/dist/core/operations/create-model.js +185 -0
- package/dist/core/operations/create-model.js.map +1 -0
- package/dist/core/operations/file-session.d.ts +56 -0
- package/dist/core/operations/file-session.d.ts.map +1 -0
- package/dist/core/operations/file-session.js +203 -0
- package/dist/core/operations/file-session.js.map +1 -0
- package/dist/core/operations/provision-operations.d.ts +52 -0
- package/dist/core/operations/provision-operations.d.ts.map +1 -0
- package/dist/core/operations/provision-operations.js +211 -0
- package/dist/core/operations/provision-operations.js.map +1 -0
- package/dist/core/operations/runtime.d.ts +37 -0
- package/dist/core/operations/runtime.d.ts.map +1 -0
- package/dist/core/operations/runtime.js +248 -0
- package/dist/core/operations/runtime.js.map +1 -0
- package/dist/core/operations/scaffold-apply.d.ts +21 -0
- package/dist/core/operations/scaffold-apply.d.ts.map +1 -0
- package/dist/core/operations/scaffold-apply.js +57 -0
- package/dist/core/operations/scaffold-apply.js.map +1 -0
- package/dist/core/operations/scaffold-machine.d.ts +16 -0
- package/dist/core/operations/scaffold-machine.d.ts.map +1 -0
- package/dist/core/operations/scaffold-machine.js +51 -0
- package/dist/core/operations/scaffold-machine.js.map +1 -0
- package/dist/core/operations/scaffold-plan.d.ts +43 -0
- package/dist/core/operations/scaffold-plan.d.ts.map +1 -0
- package/dist/core/operations/scaffold-plan.js +187 -0
- package/dist/core/operations/scaffold-plan.js.map +1 -0
- package/dist/core/project/agent-instructions.d.ts +29 -0
- package/dist/core/project/agent-instructions.d.ts.map +1 -0
- package/dist/core/project/agent-instructions.js +159 -0
- package/dist/core/project/agent-instructions.js.map +1 -0
- package/dist/core/project/artifacts.d.ts +58 -0
- package/dist/core/project/artifacts.d.ts.map +1 -0
- package/dist/core/project/artifacts.js +179 -0
- package/dist/core/project/artifacts.js.map +1 -0
- package/dist/core/project/boundaries.d.ts +50 -0
- package/dist/core/project/boundaries.d.ts.map +1 -0
- package/dist/core/project/boundaries.js +117 -0
- package/dist/core/project/boundaries.js.map +1 -0
- package/dist/core/project/capabilities.d.ts +58 -0
- package/dist/core/project/capabilities.d.ts.map +1 -0
- package/dist/core/project/capabilities.js +135 -0
- package/dist/core/project/capabilities.js.map +1 -0
- package/dist/core/project/drift.d.ts +29 -0
- package/dist/core/project/drift.d.ts.map +1 -0
- package/dist/core/project/drift.js +188 -0
- package/dist/core/project/drift.js.map +1 -0
- package/dist/core/project/infra.d.ts +49 -0
- package/dist/core/project/infra.d.ts.map +1 -0
- package/dist/core/project/infra.js +167 -0
- package/dist/core/project/infra.js.map +1 -0
- package/dist/core/project/manifest.d.ts +92 -0
- package/dist/core/project/manifest.d.ts.map +1 -0
- package/dist/core/project/manifest.js +321 -0
- package/dist/core/project/manifest.js.map +1 -0
- package/dist/core/project/state.d.ts +15 -0
- package/dist/core/project/state.d.ts.map +1 -0
- package/dist/core/project/state.js +106 -0
- package/dist/core/project/state.js.map +1 -0
- package/dist/core/project/validation.d.ts +20 -0
- package/dist/core/project/validation.d.ts.map +1 -0
- package/dist/core/project/validation.js +274 -0
- package/dist/core/project/validation.js.map +1 -0
- package/dist/core/project/workflows.d.ts +43 -0
- package/dist/core/project/workflows.d.ts.map +1 -0
- package/dist/core/project/workflows.js +299 -0
- package/dist/core/project/workflows.js.map +1 -0
- package/dist/core/scaffold/auth-generator.d.ts +63 -0
- package/dist/core/scaffold/auth-generator.d.ts.map +1 -0
- package/dist/core/scaffold/auth-generator.js +1774 -0
- package/dist/core/scaffold/auth-generator.js.map +1 -0
- package/dist/core/scaffold/connector-functions-generator.d.ts +41 -0
- package/dist/core/scaffold/connector-functions-generator.d.ts.map +1 -0
- package/dist/core/scaffold/connector-functions-generator.js +1029 -0
- package/dist/core/scaffold/connector-functions-generator.js.map +1 -0
- package/dist/core/scaffold/functions-generator.d.ts +7 -1
- package/dist/core/scaffold/functions-generator.d.ts.map +1 -1
- package/dist/core/scaffold/functions-generator.js +771 -69
- package/dist/core/scaffold/functions-generator.js.map +1 -1
- package/dist/core/scaffold/model-parser.d.ts +21 -1
- package/dist/core/scaffold/model-parser.d.ts.map +1 -1
- package/dist/core/scaffold/model-parser.js +243 -43
- package/dist/core/scaffold/model-parser.js.map +1 -1
- package/dist/core/scaffold/native-schema-generator.d.ts +19 -0
- package/dist/core/scaffold/native-schema-generator.d.ts.map +1 -0
- package/dist/core/scaffold/native-schema-generator.js +753 -0
- package/dist/core/scaffold/native-schema-generator.js.map +1 -0
- package/dist/core/scaffold/nextjs-generator.d.ts +8 -0
- package/dist/core/scaffold/nextjs-generator.d.ts.map +1 -1
- package/dist/core/scaffold/nextjs-generator.js +153 -9
- package/dist/core/scaffold/nextjs-generator.js.map +1 -1
- package/dist/core/scaffold/openapi-generator.d.ts +3 -0
- package/dist/core/scaffold/openapi-generator.d.ts.map +1 -0
- package/dist/core/scaffold/openapi-generator.js +190 -0
- package/dist/core/scaffold/openapi-generator.js.map +1 -0
- package/dist/core/scaffold/ui-generator.d.ts +17 -4
- package/dist/core/scaffold/ui-generator.d.ts.map +1 -1
- package/dist/core/scaffold/ui-generator.js +174 -34
- package/dist/core/scaffold/ui-generator.js.map +1 -1
- package/dist/core/verify/index.d.ts +69 -0
- package/dist/core/verify/index.d.ts.map +1 -0
- package/dist/core/verify/index.js +412 -0
- package/dist/core/verify/index.js.map +1 -0
- package/dist/database/base-model.d.ts +3 -3
- package/dist/database/base-model.js +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/machine/contracts.d.ts +24 -0
- package/dist/machine/contracts.d.ts.map +1 -0
- package/dist/machine/contracts.js +3 -0
- package/dist/machine/contracts.js.map +1 -0
- package/dist/machine/errors.d.ts +14 -0
- package/dist/machine/errors.d.ts.map +1 -0
- package/dist/machine/errors.js +42 -0
- package/dist/machine/errors.js.map +1 -0
- package/dist/machine/index.d.ts +3 -0
- package/dist/machine/index.d.ts.map +1 -0
- package/dist/machine/index.js +566 -0
- package/dist/machine/index.js.map +1 -0
- package/dist/mcp/index.d.ts +25 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +425 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/types/index.d.ts +109 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/package-manager.d.ts +5 -2
- package/dist/utils/package-manager.d.ts.map +1 -1
- package/dist/utils/package-manager.js +30 -9
- package/dist/utils/package-manager.js.map +1 -1
- package/dist/utils/python-uv.d.ts +21 -0
- package/dist/utils/python-uv.d.ts.map +1 -0
- package/dist/utils/python-uv.js +111 -0
- package/dist/utils/python-uv.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +49 -0
- package/dist/version.js.map +1 -0
- package/package.json +9 -5
- package/src/__tests__/__snapshots__/functions-generator.test.ts.snap +1139 -0
- package/src/__tests__/__snapshots__/nextjs-generator.test.ts.snap +206 -0
- package/src/__tests__/__snapshots__/ui-generator.test.ts.snap +532 -0
- package/src/__tests__/agent-instructions.test.ts +237 -0
- package/src/__tests__/agent-loop-phase34.test.ts +513 -0
- package/src/__tests__/auth.test.ts +770 -0
- package/src/__tests__/bff-swa-auth.test.ts +275 -0
- package/src/__tests__/config.test.ts +295 -0
- package/src/__tests__/connector-functions-generator.test.ts +288 -0
- package/src/__tests__/connector-mock-server.test.ts +439 -0
- package/src/__tests__/connector-model-bff.test.ts +162 -0
- package/src/__tests__/cosmos-worktree-isolation.test.ts +149 -0
- package/src/__tests__/dev-seeds.test.ts +236 -0
- package/src/__tests__/dev.test.ts +296 -0
- package/src/__tests__/file-session.test.ts +98 -0
- package/src/__tests__/fixtures.ts +184 -0
- package/src/__tests__/functions-generator.test.ts +237 -0
- package/src/__tests__/init.test.ts +411 -0
- package/src/__tests__/jest-globals.d.ts +8 -0
- package/src/__tests__/machine.test.ts +371 -0
- package/src/__tests__/mcp.test.ts +253 -0
- package/src/__tests__/model-parser.test.ts +81 -0
- package/src/__tests__/multi-auth.test.ts +160 -0
- package/src/__tests__/nextjs-generator.test.ts +105 -0
- package/src/__tests__/openapi-generator.test.ts +43 -0
- package/src/__tests__/package-manager.test.ts +227 -0
- package/src/__tests__/plan-apply.test.ts +499 -0
- package/src/__tests__/python-uv.test.ts +48 -0
- package/src/__tests__/scaffold.test.ts +302 -0
- package/src/__tests__/string-utils.test.ts +75 -0
- package/src/__tests__/tsconfig.json +15 -0
- package/src/__tests__/ui-generator.test.ts +248 -0
- package/src/__tests__/zod-mock-generator.test.ts +132 -0
- package/src/cli/commands/add-auth.ts +853 -0
- package/src/cli/commands/add-connector.ts +158 -0
- package/src/cli/commands/cosmos-worktree-isolation.ts +130 -0
- package/src/cli/commands/create-model.ts +62 -0
- package/src/cli/commands/dev-seeds.ts +629 -0
- package/src/cli/commands/dev.ts +1252 -0
- package/src/cli/commands/index.ts +9 -0
- package/src/cli/commands/init.ts +3541 -0
- package/src/cli/commands/provision.ts +193 -0
- package/src/cli/commands/scaffold.ts +1081 -0
- package/src/cli/index.ts +350 -0
- package/src/core/config.ts +380 -0
- package/src/core/mock/connector-mock-server.ts +555 -0
- package/src/core/mock/zod-mock-generator.ts +205 -0
- package/src/core/operations/auth-operations.ts +360 -0
- package/src/core/operations/create-model.ts +191 -0
- package/src/core/operations/file-session.ts +222 -0
- package/src/core/operations/provision-operations.ts +297 -0
- package/src/core/operations/runtime.ts +258 -0
- package/src/core/operations/scaffold-apply.ts +106 -0
- package/src/core/operations/scaffold-machine.ts +77 -0
- package/src/core/operations/scaffold-plan.ts +215 -0
- package/src/core/project/agent-instructions.ts +167 -0
- package/src/core/project/agent-templates/AGENTS.md +502 -0
- package/src/core/project/agent-templates/CLAUDE.md +31 -0
- package/src/core/project/agent-templates/azure-functions.instructions.md +22 -0
- package/src/core/project/agent-templates/bff-routes.instructions.md +18 -0
- package/src/core/project/agent-templates/copilot-instructions.md +27 -0
- package/src/core/project/agent-templates/shared-models.instructions.md +72 -0
- package/src/core/project/artifacts.ts +205 -0
- package/src/core/project/boundaries.ts +170 -0
- package/src/core/project/capabilities.ts +193 -0
- package/src/core/project/drift.ts +202 -0
- package/src/core/project/infra.ts +196 -0
- package/src/core/project/manifest.ts +402 -0
- package/src/core/project/state.ts +77 -0
- package/src/core/project/validation.ts +295 -0
- package/src/core/project/workflows.ts +295 -0
- package/src/core/scaffold/auth-generator.ts +1824 -0
- package/src/core/scaffold/connector-functions-generator.ts +1133 -0
- package/src/core/scaffold/functions-generator.ts +972 -0
- package/src/core/scaffold/model-parser.ts +854 -0
- package/src/core/scaffold/native-schema-generator.ts +904 -0
- package/src/core/scaffold/nextjs-generator.ts +382 -0
- package/src/core/scaffold/openapi-generator.ts +212 -0
- package/src/core/scaffold/ui-generator.ts +1100 -0
- package/src/core/verify/index.ts +468 -0
- package/src/database/base-model.ts +184 -0
- package/src/database/client.ts +140 -0
- package/src/database/repository.ts +104 -0
- package/src/database/runtime-check.ts +25 -0
- package/src/index.ts +27 -0
- package/src/machine/contracts.ts +33 -0
- package/src/machine/errors.ts +45 -0
- package/src/machine/index.ts +690 -0
- package/src/mcp/index.ts +423 -0
- package/src/types/index.ts +182 -0
- package/src/utils/package-manager.ts +246 -0
- package/src/utils/python-uv.ts +96 -0
- package/src/version.ts +13 -0
package/README.md
CHANGED
|
@@ -2,105 +2,112 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/swallowkit)
|
|
4
4
|
[](https://www.npmjs.com/package/swallowkit)
|
|
5
|
+
[](https://marketplace.visualstudio.com/items?itemName=himanago.swallowkit-vscode)
|
|
5
6
|
[](./LICENSE)
|
|
6
7
|
|
|
7
8
|
English | [日本語](./README.ja.md)
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
Schema-driven application scaffolding for Next.js and Azure.
|
|
10
11
|
|
|
11
|
-
SwallowKit
|
|
12
|
+
SwallowKit helps you build maintainable full-stack applications on Azure by using shared Zod schemas as the source of truth. From one schema definition, it can generate frontend forms, BFF routes, Azure Functions backends, OpenAPI contracts, infrastructure templates, and AI-agent-friendly project metadata.
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
It is designed for developers who want to build Next.js applications on Azure without letting the frontend, backend, database model, validation rules, and deployment configuration drift apart.
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
## 🎯 Why SwallowKit?
|
|
16
17
|
|
|
17
|
-
|
|
18
|
+
AI can generate application code quickly. Frameworks can hide complexity nicely. But production applications still need explicit architecture.
|
|
18
19
|
|
|
19
|
-
|
|
20
|
+
In a typical full-stack application, the same domain model is repeated across many places:
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
- frontend form types
|
|
23
|
+
- client-side validation
|
|
24
|
+
- BFF request and response models
|
|
25
|
+
- backend DTOs
|
|
26
|
+
- API contracts
|
|
27
|
+
- database entities
|
|
28
|
+
- seed data
|
|
29
|
+
- infrastructure and deployment configuration
|
|
22
30
|
|
|
23
|
-
|
|
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
|
-
- **🤖 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
|
|
31
|
+
As the application grows, these layers often drift apart. SwallowKit reduces that drift by making the schema explicit and using it to generate the surrounding application structure.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
**SwallowKit is not a full-stack framework that hides everything behind magic. It is a scaffolding toolkit that generates readable, editable, and replaceable code.**
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
## ✨ What it gives you
|
|
34
36
|
|
|
35
|
-
- **
|
|
36
|
-
- **
|
|
37
|
-
- **
|
|
38
|
-
- **
|
|
37
|
+
- **Shared Zod schemas** as the source of truth
|
|
38
|
+
- **CRUD scaffolding** for Next.js, BFF routes, Azure Functions, and UI components
|
|
39
|
+
- **Azure-ready infrastructure** using Bicep
|
|
40
|
+
- **Multi-language Azure Functions** backends (TypeScript, C#, Python)
|
|
41
|
+
- **Local development helpers** and seed data
|
|
42
|
+
- **AI/MCP-friendly** project metadata and commands
|
|
43
|
+
- **VS Code extension** support
|
|
39
44
|
|
|
40
|
-
##
|
|
45
|
+
## 🏗️ Typical architecture
|
|
41
46
|
|
|
42
|
-
|
|
47
|
+
SwallowKit is optimized for applications built with:
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
- Next.js
|
|
50
|
+
- Azure Static Web Apps
|
|
51
|
+
- Azure Functions
|
|
52
|
+
- Azure Cosmos DB
|
|
53
|
+
- Azure Bicep
|
|
54
|
+
- GitHub Actions or Azure Pipelines
|
|
50
55
|
|
|
51
|
-
The
|
|
56
|
+
The default architecture follows a BFF pattern:
|
|
52
57
|
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
|
|
58
|
+
```
|
|
59
|
+
Browser
|
|
60
|
+
|
|
|
61
|
+
Next.js frontend
|
|
62
|
+
|
|
|
63
|
+
Next.js BFF routes
|
|
64
|
+
|
|
|
65
|
+
Azure Functions API
|
|
66
|
+
|
|
|
67
|
+
Azure Cosmos DB
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
|
|
59
|
-
|------|--------|-------------|
|
|
60
|
-
| `--cicd <provider>` | `github`, `azure`, `skip` | CI/CD provider |
|
|
61
|
-
| `--cosmos-db-mode <mode>` | `freetier`, `serverless` | Cosmos DB pricing mode |
|
|
62
|
-
| `--vnet <option>` | `outbound`, `none` | Network security |
|
|
63
|
-
|
|
64
|
-
Omit any flag to be prompted for that value interactively.
|
|
70
|
+
The BFF layer keeps frontend code simple while allowing backend services, authentication, authorization, and cloud resources to evolve independently.
|
|
65
71
|
|
|
66
|
-
|
|
72
|
+
> **Note**: This project is in active development. APIs may change in future versions.
|
|
67
73
|
|
|
68
|
-
|
|
74
|
+
## 📚 Documentation
|
|
69
75
|
|
|
70
|
-
|
|
71
|
-
npx swallowkit create-model category todo
|
|
72
|
-
# or
|
|
73
|
-
pnpm dlx swallowkit create-model category todo
|
|
74
|
-
```
|
|
76
|
+
Visit the **[SwallowKit Documentation](https://himanago.github.io/swallowkit/)** for the full docs (also available in [日本語](https://himanago.github.io/swallowkit/ja/)).
|
|
75
77
|
|
|
76
|
-
|
|
78
|
+
- **[Getting Started](https://himanago.github.io/swallowkit/en/getting-started)** - First project setup
|
|
79
|
+
- **[Core Concepts](https://himanago.github.io/swallowkit/en/concepts)** - Schema-centric architecture
|
|
80
|
+
- **[Scaffold Guide](https://himanago.github.io/swallowkit/en/scaffold-guide)** - CRUD code generation
|
|
81
|
+
- **[Local Development](https://himanago.github.io/swallowkit/en/dev-guide)** - Dev server, seeds, mock connectors
|
|
82
|
+
- **[Deployment Guide](https://himanago.github.io/swallowkit/en/deployment-guide)** - Deploy to Azure
|
|
83
|
+
- **[AI / MCP Guide](https://himanago.github.io/swallowkit/en/ai-mcp-guide)** - AI-agent integration
|
|
84
|
+
- **[Coding Agent Guide](https://himanago.github.io/swallowkit/en/coding-agent-guide)** - Lifecycle integration, ownership, and external process composition
|
|
85
|
+
- **[Authentication](https://himanago.github.io/swallowkit/en/auth-guide)** - Auth and authorization
|
|
86
|
+
- **[Connectors](https://himanago.github.io/swallowkit/en/connector-guide)** - External data sources
|
|
77
87
|
|
|
78
|
-
|
|
79
|
-
// shared/models/category.ts
|
|
80
|
-
import { z } from 'zod';
|
|
88
|
+
## 🚀 Quick start
|
|
81
89
|
|
|
82
|
-
|
|
83
|
-
id: z.string(),
|
|
84
|
-
name: z.string().min(1).max(50),
|
|
85
|
-
createdAt: z.string().optional(),
|
|
86
|
-
updatedAt: z.string().optional(),
|
|
87
|
-
});
|
|
90
|
+
Create a new project:
|
|
88
91
|
|
|
89
|
-
|
|
92
|
+
```bash
|
|
93
|
+
npx swallowkit init my-app
|
|
94
|
+
cd my-app
|
|
90
95
|
```
|
|
91
96
|
|
|
92
|
-
|
|
97
|
+
Create a model and customize the schema:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npx swallowkit create-model todo
|
|
101
|
+
```
|
|
93
102
|
|
|
94
103
|
```typescript
|
|
95
104
|
// shared/models/todo.ts
|
|
96
105
|
import { z } from 'zod';
|
|
97
|
-
import { category } from './category';
|
|
98
106
|
|
|
99
107
|
export const todo = z.object({
|
|
100
108
|
id: z.string(),
|
|
101
109
|
text: z.string().min(1).max(200),
|
|
102
110
|
completed: z.boolean().default(false),
|
|
103
|
-
category: category.optional(), // Nested object (not categoryId)
|
|
104
111
|
createdAt: z.string().optional(),
|
|
105
112
|
updatedAt: z.string().optional(),
|
|
106
113
|
});
|
|
@@ -108,139 +115,40 @@ export const todo = z.object({
|
|
|
108
115
|
export type Todo = z.infer<typeof todo>;
|
|
109
116
|
```
|
|
110
117
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
### 3. Generate CRUD Code
|
|
114
|
-
|
|
115
|
-
```bash
|
|
116
|
-
npx swallowkit scaffold shared/models/todo.ts
|
|
117
|
-
# or
|
|
118
|
-
pnpm dlx swallowkit scaffold shared/models/todo.ts
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
This auto-generates:
|
|
122
|
-
- ✅ Azure Functions (CRUD endpoints + Cosmos DB bindings)
|
|
123
|
-
- ✅ Next.js BFF API Routes (auto-validation + resource inference)
|
|
124
|
-
- ✅ React Components (type-safe forms)
|
|
125
|
-
|
|
126
|
-
### 4. Start Development Server
|
|
118
|
+
Generate CRUD code and start the dev server:
|
|
127
119
|
|
|
128
120
|
```bash
|
|
121
|
+
npx swallowkit scaffold todo
|
|
129
122
|
npx swallowkit dev
|
|
130
|
-
# or
|
|
131
|
-
pnpm dlx swallowkit dev
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
- Next.js: http://localhost:3000
|
|
135
|
-
- Azure Functions: http://localhost:7071
|
|
136
|
-
|
|
137
|
-
### 5. Use from Frontend
|
|
138
|
-
|
|
139
|
-
```typescript
|
|
140
|
-
import { api } from '@/lib/api/backend';
|
|
141
|
-
import type { Todo } from '@/shared/models/todo';
|
|
142
|
-
|
|
143
|
-
// Get all - call BFF endpoint
|
|
144
|
-
const todos = await api.get<Todo[]>('/api/todos');
|
|
145
|
-
|
|
146
|
-
// Create - validated by backend
|
|
147
|
-
const created = await api.post<Todo>('/api/todos', {
|
|
148
|
-
text: 'Buy milk',
|
|
149
|
-
completed: false
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
// Update - validated by backend
|
|
153
|
-
const updated = await api.put<Todo>('/api/todos/123', { completed: true });
|
|
154
|
-
|
|
155
|
-
// Delete
|
|
156
|
-
await api.delete('/api/todos/123');
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
## 🏗️ Architecture
|
|
160
|
-
|
|
161
|
-
```
|
|
162
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
163
|
-
│ Frontend (React) │
|
|
164
|
-
│ - Client Components │
|
|
165
|
-
│ - Server Components (SSR) │
|
|
166
|
-
└──────────────────────────┬───────────────────────────────────┘
|
|
167
|
-
│ api.post('/api/todos', data)
|
|
168
|
-
▼
|
|
169
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
170
|
-
│ BFF Layer (Next.js API Routes) │
|
|
171
|
-
│ - Auto Schema Validation (Zod) │
|
|
172
|
-
│ - Error Handling │
|
|
173
|
-
└──────────────────────────┬───────────────────────────────────┘
|
|
174
|
-
│ HTTP Request
|
|
175
|
-
▼
|
|
176
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
177
|
-
│ Azure Functions (Backend) │
|
|
178
|
-
│ - HTTP Triggers (CRUD) │
|
|
179
|
-
│ - Zod Validation (Re-check) │
|
|
180
|
-
│ - Business Logic │
|
|
181
|
-
│ - Cosmos DB Bindings │
|
|
182
|
-
└──────────────────────────┬───────────────────────────────────┘
|
|
183
|
-
│
|
|
184
|
-
▼
|
|
185
|
-
┌─────────────────────────────────────────────────────────────┐
|
|
186
|
-
│ Azure Cosmos DB │
|
|
187
|
-
│ - NoSQL Database │
|
|
188
|
-
│ - Zod Schema Validation │
|
|
189
|
-
└─────────────────────────────────────────────────────────────┘
|
|
190
123
|
```
|
|
191
124
|
|
|
192
|
-
|
|
193
|
-
- **BFF (Backend For Frontend)**: Next.js API Routes proxy to Azure Functions
|
|
194
|
-
- **Shared Schemas**: Zod schemas used across frontend, BFF, Functions, and DB
|
|
195
|
-
- **Type Safety**: TypeScript types auto-inferred from Zod
|
|
196
|
-
- **Managed Identity**: Secure service connections (no connection strings)
|
|
125
|
+
This generates Azure Functions, Next.js BFF routes, and React UI components — all typed from the shared schema.
|
|
197
126
|
|
|
198
|
-
##
|
|
127
|
+
## 🤖 AI-agent-friendly development
|
|
199
128
|
|
|
200
|
-
-
|
|
201
|
-
- **pnpm** (recommended): `corepack enable` or `npm install -g pnpm`
|
|
202
|
-
- npm also works — SwallowKit auto-detects the package manager (if pnpm is installed, it is always preferred)
|
|
203
|
-
- Azure Cosmos DB Emulator (local development)
|
|
204
|
-
- [Official documentation (vNext recommended)](https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux)
|
|
205
|
-
- Windows: [Download](https://aka.ms/cosmosdb-emulator)
|
|
206
|
-
- Docker: `docker run -p 8081:8081 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator`
|
|
129
|
+
SwallowKit provides machine-readable project metadata and command interfaces so coding agents can inspect the project structure, generate code through official commands, and validate changes without directly rewriting unrelated files.
|
|
207
130
|
|
|
208
|
-
|
|
131
|
+
The goal is to make AI-assisted development safer by giving agents explicit architectural boundaries.
|
|
209
132
|
|
|
210
|
-
|
|
133
|
+
## 📦 Generated project structure
|
|
211
134
|
|
|
212
|
-
**1. Provision resources (Bicep IaC)**
|
|
213
|
-
|
|
214
|
-
```bash
|
|
215
|
-
npx swallowkit provision --resource-group my-app-rg --location japaneast
|
|
216
|
-
# or
|
|
217
|
-
pnpm dlx swallowkit provision --resource-group my-app-rg --location japaneast
|
|
218
135
|
```
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
136
|
+
.
|
|
137
|
+
├── app/ # Next.js pages and BFF API routes
|
|
138
|
+
├── shared/
|
|
139
|
+
│ └── models/ # Shared Zod schemas (source of truth)
|
|
140
|
+
├── functions/ # Azure Functions backend
|
|
141
|
+
├── infra/ # Bicep templates
|
|
142
|
+
├── lib/ # BFF helpers and scaffold config
|
|
143
|
+
└── .swallowkit/ # SwallowKit project metadata
|
|
226
144
|
```
|
|
227
145
|
|
|
228
|
-
|
|
146
|
+
## 🔗 Status
|
|
229
147
|
|
|
230
|
-
|
|
148
|
+
SwallowKit is under active development. The API, project structure, and generated output may change.
|
|
231
149
|
|
|
232
|
-
|
|
150
|
+
Feedback, issues, and small example use cases are welcome.
|
|
233
151
|
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
## License
|
|
152
|
+
## 📄 License
|
|
237
153
|
|
|
238
154
|
MIT
|
|
239
|
-
|
|
240
|
-
## 🔗 Related Links
|
|
241
|
-
|
|
242
|
-
- [Azure Static Web Apps](https://learn.microsoft.com/en-us/azure/static-web-apps/)
|
|
243
|
-
- [Azure Functions](https://learn.microsoft.com/en-us/azure/azure-functions/)
|
|
244
|
-
- [Azure Cosmos DB](https://learn.microsoft.com/en-us/azure/cosmos-db/)
|
|
245
|
-
- [Next.js](https://nextjs.org/)
|
|
246
|
-
- [Zod](https://zod.dev/)
|
|
@@ -3,10 +3,22 @@ import { ModelInfo } from "../core/scaffold/model-parser";
|
|
|
3
3
|
* テスト用の基本的な ModelInfo フィクスチャ
|
|
4
4
|
*/
|
|
5
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;
|
|
6
14
|
/**
|
|
7
15
|
* 外部キーを含む ModelInfo フィクスチャ
|
|
8
16
|
*/
|
|
9
17
|
export declare function createModelInfoWithForeignKey(): ModelInfo;
|
|
18
|
+
/**
|
|
19
|
+
* 必須・optional・nullable の外部キーを含む ModelInfo フィクスチャ
|
|
20
|
+
*/
|
|
21
|
+
export declare function createModelInfoWithNullableForeignKeys(): ModelInfo;
|
|
10
22
|
/**
|
|
11
23
|
* enum フィールドを含む ModelInfo フィクスチャ
|
|
12
24
|
*/
|
|
@@ -1 +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,
|
|
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,sCAAsC,IAAI,SAAS,CAmClE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,SAAS,CA0BnD"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createBasicModelInfo = createBasicModelInfo;
|
|
4
|
+
exports.createRdbConnectorModelInfo = createRdbConnectorModelInfo;
|
|
5
|
+
exports.createApiConnectorModelInfo = createApiConnectorModelInfo;
|
|
4
6
|
exports.createModelInfoWithForeignKey = createModelInfoWithForeignKey;
|
|
7
|
+
exports.createModelInfoWithNullableForeignKeys = createModelInfoWithNullableForeignKeys;
|
|
5
8
|
exports.createModelInfoWithEnum = createModelInfoWithEnum;
|
|
6
9
|
/**
|
|
7
10
|
* テスト用の基本的な ModelInfo フィクスチャ
|
|
@@ -24,9 +27,68 @@ function createBasicModelInfo(overrides) {
|
|
|
24
27
|
hasCreatedAt: true,
|
|
25
28
|
hasUpdatedAt: true,
|
|
26
29
|
nestedSchemaRefs: [],
|
|
30
|
+
partitionKey: '/id',
|
|
27
31
|
...overrides,
|
|
28
32
|
};
|
|
29
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* RDB コネクタ (read-only) 付きの ModelInfo フィクスチャ
|
|
36
|
+
*/
|
|
37
|
+
function createRdbConnectorModelInfo(overrides) {
|
|
38
|
+
return createBasicModelInfo({
|
|
39
|
+
name: "User",
|
|
40
|
+
displayName: "User",
|
|
41
|
+
schemaName: "userSchema",
|
|
42
|
+
filePath: "/models/user.ts",
|
|
43
|
+
fields: [
|
|
44
|
+
{ name: "id", type: "string", isOptional: false, isArray: false },
|
|
45
|
+
{ name: "employeeCode", type: "string", isOptional: false, isArray: false },
|
|
46
|
+
{ name: "name", type: "string", isOptional: false, isArray: false },
|
|
47
|
+
{ name: "email", type: "string", isOptional: false, isArray: false },
|
|
48
|
+
{ name: "department", type: "string", isOptional: true, isArray: false },
|
|
49
|
+
{ name: "createdAt", type: "string", isOptional: true, isArray: false },
|
|
50
|
+
{ name: "updatedAt", type: "string", isOptional: true, isArray: false },
|
|
51
|
+
],
|
|
52
|
+
connectorConfig: {
|
|
53
|
+
connector: "mysql",
|
|
54
|
+
operations: ["getAll", "getById"],
|
|
55
|
+
table: "users",
|
|
56
|
+
idColumn: "id",
|
|
57
|
+
},
|
|
58
|
+
...overrides,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* API コネクタ (read-write) 付きの ModelInfo フィクスチャ
|
|
63
|
+
*/
|
|
64
|
+
function createApiConnectorModelInfo(overrides) {
|
|
65
|
+
return createBasicModelInfo({
|
|
66
|
+
name: "BacklogIssue",
|
|
67
|
+
displayName: "BacklogIssue",
|
|
68
|
+
schemaName: "backlogIssueSchema",
|
|
69
|
+
filePath: "/models/backlog-issue.ts",
|
|
70
|
+
fields: [
|
|
71
|
+
{ name: "id", type: "string", isOptional: false, isArray: false },
|
|
72
|
+
{ name: "projectId", type: "string", isOptional: false, isArray: false },
|
|
73
|
+
{ name: "issueKey", type: "string", isOptional: false, isArray: false },
|
|
74
|
+
{ name: "summary", type: "string", isOptional: false, isArray: false },
|
|
75
|
+
{ name: "description", type: "string", isOptional: true, isArray: false },
|
|
76
|
+
{ name: "createdAt", type: "string", isOptional: true, isArray: false },
|
|
77
|
+
{ name: "updatedAt", type: "string", isOptional: true, isArray: false },
|
|
78
|
+
],
|
|
79
|
+
connectorConfig: {
|
|
80
|
+
connector: "backlog",
|
|
81
|
+
operations: ["getAll", "getById", "create", "update"],
|
|
82
|
+
endpoints: {
|
|
83
|
+
getAll: "GET /issues",
|
|
84
|
+
getById: "GET /issues/{id}",
|
|
85
|
+
create: "POST /issues",
|
|
86
|
+
update: "PATCH /issues/{id}",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
...overrides,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
30
92
|
/**
|
|
31
93
|
* 外部キーを含む ModelInfo フィクスチャ
|
|
32
94
|
*/
|
|
@@ -52,6 +114,45 @@ function createModelInfoWithForeignKey() {
|
|
|
52
114
|
],
|
|
53
115
|
});
|
|
54
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* 必須・optional・nullable の外部キーを含む ModelInfo フィクスチャ
|
|
119
|
+
*/
|
|
120
|
+
function createModelInfoWithNullableForeignKeys() {
|
|
121
|
+
return createBasicModelInfo({
|
|
122
|
+
name: "Coupon",
|
|
123
|
+
displayName: "Coupon",
|
|
124
|
+
schemaName: "couponSchema",
|
|
125
|
+
filePath: "/models/coupon.ts",
|
|
126
|
+
fields: [
|
|
127
|
+
{ name: "id", type: "string", isOptional: false, isArray: false },
|
|
128
|
+
{
|
|
129
|
+
name: "requiredUserId",
|
|
130
|
+
type: "string",
|
|
131
|
+
isOptional: false,
|
|
132
|
+
isArray: false,
|
|
133
|
+
isForeignKey: true,
|
|
134
|
+
referencedModel: "RequiredUser",
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
name: "optionalUserId",
|
|
138
|
+
type: "string",
|
|
139
|
+
isOptional: true,
|
|
140
|
+
isArray: false,
|
|
141
|
+
isForeignKey: true,
|
|
142
|
+
referencedModel: "OptionalUser",
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: "nullableUserId",
|
|
146
|
+
type: "string",
|
|
147
|
+
isOptional: false,
|
|
148
|
+
isNullable: true,
|
|
149
|
+
isArray: false,
|
|
150
|
+
isForeignKey: true,
|
|
151
|
+
referencedModel: "NullableUser",
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
});
|
|
155
|
+
}
|
|
55
156
|
/**
|
|
56
157
|
* enum フィールドを含む ModelInfo フィクスチャ
|
|
57
158
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":";;AAKA,
|
|
1
|
+
{"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/__tests__/fixtures.ts"],"names":[],"mappings":";;AAKA,oDAqBC;AAKD,kEAuBC;AAKD,kEA2BC;AAKD,sEAqBC;AAKD,wFAmCC;AAKD,0DA0BC;AArLD;;GAEG;AACH,SAAgB,oBAAoB,CAAC,SAA8B;IACjE,OAAO;QACL,IAAI,EAAE,MAAM;QACZ,WAAW,EAAE,MAAM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KACF,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB;IACrC,OAAO,oBAAoB,CAAC;QAC1B,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,OAAO;QACpB,UAAU,EAAE,aAAa;QACzB,QAAQ,EAAE,kBAAkB;QAC5B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;YACjE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;YACpE;gBACE,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,KAAK;gBACjB,OAAO,EAAE,KAAK;gBACd,UAAU,EAAE,CAAC,MAAM,EAAE,aAAa,EAAE,QAAQ,CAAC;aAC9C;YACD;gBACE,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,IAAI;gBAChB,OAAO,EAAE,KAAK;aACf;YACD,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;YACxE,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;SACzE;KACF,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SwallowKit Add-Auth コマンド
|
|
3
|
+
* 認証認可基盤ファイルを生成する
|
|
4
|
+
*/
|
|
5
|
+
interface AddAuthOptions {
|
|
6
|
+
provider?: string;
|
|
7
|
+
scheme?: string;
|
|
8
|
+
/** SWA の許可する identity provider (例: ['github'])。未指定時は ['aad']。 */
|
|
9
|
+
allowedProviders?: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare function generateSwaAuthContext(allowedProviders?: string[]): string;
|
|
12
|
+
export declare function addAuthProviderToRootLayout(layout: string): string;
|
|
13
|
+
export declare function addAuthCommand(options: AddAuthOptions): Promise<void>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=add-auth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-auth.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/add-auth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AA+CH,UAAU,cAAc;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC7B;AA8HD,wBAAgB,sBAAsB,CAAC,gBAAgB,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CA0C1E;AAED,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAclE;AAwBD,wBAAsB,cAAc,CAAC,OAAO,EAAE,cAAc,iBAoJ3D"}
|