create-qpq-app 0.1.5
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 +33 -0
- package/lib/commonjs/bin/createQpqApp.d.ts +2 -0
- package/lib/commonjs/bin/createQpqApp.js +9 -0
- package/lib/commonjs/bin/createQpqApp.js.map +1 -0
- package/lib/commonjs/cli/runCreateQpqApp.d.ts +1 -0
- package/lib/commonjs/cli/runCreateQpqApp.js +75 -0
- package/lib/commonjs/cli/runCreateQpqApp.js.map +1 -0
- package/lib/commonjs/index.d.ts +3 -0
- package/lib/commonjs/index.js +20 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/lib/args.d.ts +2 -0
- package/lib/commonjs/lib/args.js +21 -0
- package/lib/commonjs/lib/args.js.map +1 -0
- package/lib/commonjs/lib/files.d.ts +5 -0
- package/lib/commonjs/lib/files.js +65 -0
- package/lib/commonjs/lib/files.js.map +1 -0
- package/lib/commonjs/lib/packageRoot.d.ts +2 -0
- package/lib/commonjs/lib/packageRoot.js +26 -0
- package/lib/commonjs/lib/packageRoot.js.map +1 -0
- package/lib/commonjs/lib/prompts.d.ts +1 -0
- package/lib/commonjs/lib/prompts.js +53 -0
- package/lib/commonjs/lib/prompts.js.map +1 -0
- package/lib/commonjs/lib/runCommand.d.ts +4 -0
- package/lib/commonjs/lib/runCommand.js +24 -0
- package/lib/commonjs/lib/runCommand.js.map +1 -0
- package/lib/commonjs/steps/001_preflight.d.ts +2 -0
- package/lib/commonjs/steps/001_preflight.js +36 -0
- package/lib/commonjs/steps/001_preflight.js.map +1 -0
- package/lib/commonjs/steps/002_copyTemplate.d.ts +2 -0
- package/lib/commonjs/steps/002_copyTemplate.js +29 -0
- package/lib/commonjs/steps/002_copyTemplate.js.map +1 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.d.ts +2 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.js +32 -0
- package/lib/commonjs/steps/003_deleteDocusaurus.js.map +1 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.d.ts +2 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.js +26 -0
- package/lib/commonjs/steps/004_deleteQpqjsApp.js.map +1 -0
- package/lib/commonjs/steps/005_applyAppIdentity.d.ts +2 -0
- package/lib/commonjs/steps/005_applyAppIdentity.js +51 -0
- package/lib/commonjs/steps/005_applyAppIdentity.js.map +1 -0
- package/lib/commonjs/steps/006_applyDomain.d.ts +2 -0
- package/lib/commonjs/steps/006_applyDomain.js +31 -0
- package/lib/commonjs/steps/006_applyDomain.js.map +1 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.d.ts +2 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.js +37 -0
- package/lib/commonjs/steps/007_pinRegistryVersions.js.map +1 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.d.ts +2 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.js +24 -0
- package/lib/commonjs/steps/008_transpileToJavaScript.js.map +1 -0
- package/lib/commonjs/steps/009_restoreGitignore.d.ts +2 -0
- package/lib/commonjs/steps/009_restoreGitignore.js +31 -0
- package/lib/commonjs/steps/009_restoreGitignore.js.map +1 -0
- package/lib/commonjs/steps/010_gitInit.d.ts +2 -0
- package/lib/commonjs/steps/010_gitInit.js +30 -0
- package/lib/commonjs/steps/010_gitInit.js.map +1 -0
- package/lib/commonjs/steps/011_npmInstall.d.ts +2 -0
- package/lib/commonjs/steps/011_npmInstall.js +21 -0
- package/lib/commonjs/steps/011_npmInstall.js.map +1 -0
- package/lib/commonjs/steps/012_buildWorkspaces.d.ts +2 -0
- package/lib/commonjs/steps/012_buildWorkspaces.js +24 -0
- package/lib/commonjs/steps/012_buildWorkspaces.js.map +1 -0
- package/lib/commonjs/steps/013_printNextSteps.d.ts +2 -0
- package/lib/commonjs/steps/013_printNextSteps.js +33 -0
- package/lib/commonjs/steps/013_printNextSteps.js.map +1 -0
- package/lib/commonjs/steps/index.d.ts +16 -0
- package/lib/commonjs/steps/index.js +48 -0
- package/lib/commonjs/steps/index.js.map +1 -0
- package/lib/commonjs/types.d.ts +22 -0
- package/lib/commonjs/types.js +9 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/esm/bin/createQpqApp.d.ts +2 -0
- package/lib/esm/bin/createQpqApp.js +7 -0
- package/lib/esm/bin/createQpqApp.js.map +1 -0
- package/lib/esm/cli/runCreateQpqApp.d.ts +1 -0
- package/lib/esm/cli/runCreateQpqApp.js +57 -0
- package/lib/esm/cli/runCreateQpqApp.js.map +1 -0
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.js +4 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/lib/args.d.ts +2 -0
- package/lib/esm/lib/args.js +16 -0
- package/lib/esm/lib/args.js.map +1 -0
- package/lib/esm/lib/files.d.ts +5 -0
- package/lib/esm/lib/files.js +54 -0
- package/lib/esm/lib/files.js.map +1 -0
- package/lib/esm/lib/packageRoot.d.ts +2 -0
- package/lib/esm/lib/packageRoot.js +18 -0
- package/lib/esm/lib/packageRoot.js.map +1 -0
- package/lib/esm/lib/prompts.d.ts +1 -0
- package/lib/esm/lib/prompts.js +7 -0
- package/lib/esm/lib/prompts.js.map +1 -0
- package/lib/esm/lib/runCommand.d.ts +4 -0
- package/lib/esm/lib/runCommand.js +19 -0
- package/lib/esm/lib/runCommand.js.map +1 -0
- package/lib/esm/steps/001_preflight.d.ts +2 -0
- package/lib/esm/steps/001_preflight.js +21 -0
- package/lib/esm/steps/001_preflight.js.map +1 -0
- package/lib/esm/steps/002_copyTemplate.d.ts +2 -0
- package/lib/esm/steps/002_copyTemplate.js +14 -0
- package/lib/esm/steps/002_copyTemplate.js.map +1 -0
- package/lib/esm/steps/003_deleteDocusaurus.d.ts +2 -0
- package/lib/esm/steps/003_deleteDocusaurus.js +16 -0
- package/lib/esm/steps/003_deleteDocusaurus.js.map +1 -0
- package/lib/esm/steps/004_deleteQpqjsApp.d.ts +2 -0
- package/lib/esm/steps/004_deleteQpqjsApp.js +11 -0
- package/lib/esm/steps/004_deleteQpqjsApp.js.map +1 -0
- package/lib/esm/steps/005_applyAppIdentity.d.ts +2 -0
- package/lib/esm/steps/005_applyAppIdentity.js +36 -0
- package/lib/esm/steps/005_applyAppIdentity.js.map +1 -0
- package/lib/esm/steps/006_applyDomain.d.ts +2 -0
- package/lib/esm/steps/006_applyDomain.js +16 -0
- package/lib/esm/steps/006_applyDomain.js.map +1 -0
- package/lib/esm/steps/007_pinRegistryVersions.d.ts +2 -0
- package/lib/esm/steps/007_pinRegistryVersions.js +22 -0
- package/lib/esm/steps/007_pinRegistryVersions.js.map +1 -0
- package/lib/esm/steps/008_transpileToJavaScript.d.ts +2 -0
- package/lib/esm/steps/008_transpileToJavaScript.js +12 -0
- package/lib/esm/steps/008_transpileToJavaScript.js.map +1 -0
- package/lib/esm/steps/009_restoreGitignore.d.ts +2 -0
- package/lib/esm/steps/009_restoreGitignore.js +16 -0
- package/lib/esm/steps/009_restoreGitignore.js.map +1 -0
- package/lib/esm/steps/010_gitInit.d.ts +2 -0
- package/lib/esm/steps/010_gitInit.js +18 -0
- package/lib/esm/steps/010_gitInit.js.map +1 -0
- package/lib/esm/steps/011_npmInstall.d.ts +2 -0
- package/lib/esm/steps/011_npmInstall.js +9 -0
- package/lib/esm/steps/011_npmInstall.js.map +1 -0
- package/lib/esm/steps/012_buildWorkspaces.d.ts +2 -0
- package/lib/esm/steps/012_buildWorkspaces.js +12 -0
- package/lib/esm/steps/012_buildWorkspaces.js.map +1 -0
- package/lib/esm/steps/013_printNextSteps.d.ts +2 -0
- package/lib/esm/steps/013_printNextSteps.js +21 -0
- package/lib/esm/steps/013_printNextSteps.js.map +1 -0
- package/lib/esm/steps/index.d.ts +16 -0
- package/lib/esm/steps/index.js +33 -0
- package/lib/esm/steps/index.js.map +1 -0
- package/lib/esm/types.d.ts +22 -0
- package/lib/esm/types.js +6 -0
- package/lib/esm/types.js.map +1 -0
- package/package.json +57 -0
- package/template/.nvmrc +1 -0
- package/template/.prettierignore +4 -0
- package/template/.prettierrc +4 -0
- package/template/.vscode/extensions.json +3 -0
- package/template/.vscode/settings.json +14 -0
- package/template/README.md +150 -0
- package/template/apps/qpqjs/account.qpq.ts +39 -0
- package/template/apps/qpqjs/bootstrap.qpq.ts +36 -0
- package/template/apps/qpqjs/deploy.config.json +24 -0
- package/template/apps/qpqjs/packages/config/package.json +22 -0
- package/template/apps/qpqjs/packages/config/src/index.ts +2 -0
- package/template/apps/qpqjs/packages/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/packages/constants/package.json +22 -0
- package/template/apps/qpqjs/packages/constants/src/QpqjsServiceEnum.ts +11 -0
- package/template/apps/qpqjs/packages/constants/src/domain.ts +1 -0
- package/template/apps/qpqjs/packages/constants/src/index.ts +3 -0
- package/template/apps/qpqjs/packages/constants/src/userDirectory.ts +3 -0
- package/template/apps/qpqjs/packages/constants/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/constants/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/packages/service-utils/package.json +24 -0
- package/template/apps/qpqjs/packages/service-utils/src/defineQpqjsService.ts +148 -0
- package/template/apps/qpqjs/packages/service-utils/src/index.ts +1 -0
- package/template/apps/qpqjs/packages/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/packages/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/config/package.json +22 -0
- package/template/apps/qpqjs/services/admin/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/models/package.json +22 -0
- package/template/apps/qpqjs/services/admin/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/service/package.json +9 -0
- package/template/apps/qpqjs/services/admin/service/src/infrastructure.ts +15 -0
- package/template/apps/qpqjs/services/admin/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/admin/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/admin/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/admin/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/admin/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/views/package.json +8 -0
- package/template/apps/qpqjs/services/admin/views/src/app/app.tsx +39 -0
- package/template/apps/qpqjs/services/admin/views/src/assets/.gitkeep +0 -0
- package/template/apps/qpqjs/services/admin/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/AdminGrid.tsx +80 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/styles.ts +41 -0
- package/template/apps/qpqjs/services/admin/views/src/components/AdminGrid/types/AdminGridProps.ts +6 -0
- package/template/apps/qpqjs/services/admin/views/src/components/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/favicon.ico +0 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/index.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/logic/getBaseUrlFromAdminWebHost.ts +7 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/types/AdminNetworkRequestPayload.ts +10 -0
- package/template/apps/qpqjs/services/admin/views/src/hooks/useAdminNetworkRequest/useAdminNetworkRequest.ts +18 -0
- package/template/apps/qpqjs/services/admin/views/src/index.html +23 -0
- package/template/apps/qpqjs/services/admin/views/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/admin/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/admin/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/admin/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/admin/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/admin/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/admin/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/admin/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/config/package.json +22 -0
- package/template/apps/qpqjs/services/design/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/models/package.json +22 -0
- package/template/apps/qpqjs/services/design/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/service/package.json +9 -0
- package/template/apps/qpqjs/services/design/service/src/infrastructure.ts +15 -0
- package/template/apps/qpqjs/services/design/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/design/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/design/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/design/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/design/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/views/package.json +8 -0
- package/template/apps/qpqjs/services/design/views/src/app.tsx +7 -0
- package/template/apps/qpqjs/services/design/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/LandingPage.tsx +20 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/CodeWindow.tsx +77 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Features.tsx +83 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Footer.tsx +45 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Hero.tsx +60 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/InstallChip.tsx +27 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/NavBar.tsx +72 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Packages.tsx +63 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/Pipeline.tsx +58 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/TronGrid.tsx +587 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/components/YieldLoop.tsx +361 -0
- package/template/apps/qpqjs/services/design/views/src/components/LandingPage/landing.css +1170 -0
- package/template/apps/qpqjs/services/design/views/src/components/WelcomeScreen/WelcomeScreen.tsx +85 -0
- package/template/apps/qpqjs/services/design/views/src/index.html +12 -0
- package/template/apps/qpqjs/services/design/views/src/index.ts +1 -0
- package/template/apps/qpqjs/services/design/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/design/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/design/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/design/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/design/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/design/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/design/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/design/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/config/package.json +22 -0
- package/template/apps/qpqjs/services/shell/config/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/config/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/config/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/models/package.json +22 -0
- package/template/apps/qpqjs/services/shell/models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/service/package.json +9 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/health/health.ts +21 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/health/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/service/src/entry/controller/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/service/src/infrastructure.ts +91 -0
- package/template/apps/qpqjs/services/shell/service/tsconfig.app.json +17 -0
- package/template/apps/qpqjs/services/shell/service/tsconfig.json +8 -0
- package/template/apps/qpqjs/services/shell/service-utils/package.json +22 -0
- package/template/apps/qpqjs/services/shell/service-utils/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/service-utils/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/shared-logic/package.json +22 -0
- package/template/apps/qpqjs/services/shell/shared-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/shared-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/views/package.json +8 -0
- package/template/apps/qpqjs/services/shell/views/src/app.tsx +6 -0
- package/template/apps/qpqjs/services/shell/views/src/bootstrap.tsx +14 -0
- package/template/apps/qpqjs/services/shell/views/src/index.html +25 -0
- package/template/apps/qpqjs/services/shell/views/src/index.ts +1 -0
- package/template/apps/qpqjs/services/shell/views/src/main.ts +1 -0
- package/template/apps/qpqjs/services/shell/views/tsconfig.app.json +20 -0
- package/template/apps/qpqjs/services/shell/views/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-logic/package.json +22 -0
- package/template/apps/qpqjs/services/shell/x-logic/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/x-logic/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/services/shell/x-models/package.json +22 -0
- package/template/apps/qpqjs/services/shell/x-models/src/index.ts +2 -0
- package/template/apps/qpqjs/services/shell/x-models/tsconfig.json +18 -0
- package/template/apps/qpqjs/services/shell/x-models/tsconfig.lib.json +19 -0
- package/template/apps/qpqjs/tsconfig.federated.json +13 -0
- package/template/apps/todo/deploy.config.json +12 -0
- package/template/apps/todo/packages/config/package.json +22 -0
- package/template/apps/todo/packages/config/src/index.ts +2 -0
- package/template/apps/todo/packages/config/tsconfig.json +18 -0
- package/template/apps/todo/packages/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/packages/constants/package.json +22 -0
- package/template/apps/todo/packages/constants/src/TodoServiceEnum.ts +12 -0
- package/template/apps/todo/packages/constants/src/domain.ts +1 -0
- package/template/apps/todo/packages/constants/src/index.ts +3 -0
- package/template/apps/todo/packages/constants/src/userDirectory.ts +3 -0
- package/template/apps/todo/packages/constants/tsconfig.json +18 -0
- package/template/apps/todo/packages/constants/tsconfig.lib.json +19 -0
- package/template/apps/todo/packages/service-utils/package.json +24 -0
- package/template/apps/todo/packages/service-utils/src/defineTodoService.ts +128 -0
- package/template/apps/todo/packages/service-utils/src/index.ts +1 -0
- package/template/apps/todo/packages/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/packages/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/config/package.json +22 -0
- package/template/apps/todo/services/admin/config/src/index.ts +2 -0
- package/template/apps/todo/services/admin/config/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/models/package.json +22 -0
- package/template/apps/todo/services/admin/models/src/index.ts +2 -0
- package/template/apps/todo/services/admin/models/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/service/package.json +9 -0
- package/template/apps/todo/services/admin/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/admin/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/admin/service/tsconfig.json +8 -0
- package/template/apps/todo/services/admin/service-utils/package.json +22 -0
- package/template/apps/todo/services/admin/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/admin/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/shared-logic/package.json +22 -0
- package/template/apps/todo/services/admin/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/admin/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/views/package.json +8 -0
- package/template/apps/todo/services/admin/views/src/app/app.tsx +39 -0
- package/template/apps/todo/services/admin/views/src/assets/.gitkeep +0 -0
- package/template/apps/todo/services/admin/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/AdminGrid.tsx +80 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/styles.ts +41 -0
- package/template/apps/todo/services/admin/views/src/components/AdminGrid/types/AdminGridProps.ts +6 -0
- package/template/apps/todo/services/admin/views/src/components/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/favicon.ico +0 -0
- package/template/apps/todo/services/admin/views/src/hooks/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/index.ts +1 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/logic/getBaseUrlFromAdminWebHost.ts +7 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/types/AdminNetworkRequestPayload.ts +10 -0
- package/template/apps/todo/services/admin/views/src/hooks/useAdminNetworkRequest/useAdminNetworkRequest.ts +18 -0
- package/template/apps/todo/services/admin/views/src/index.html +23 -0
- package/template/apps/todo/services/admin/views/src/index.ts +2 -0
- package/template/apps/todo/services/admin/views/src/main.ts +1 -0
- package/template/apps/todo/services/admin/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/admin/views/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-logic/package.json +22 -0
- package/template/apps/todo/services/admin/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/admin/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/admin/x-models/package.json +22 -0
- package/template/apps/todo/services/admin/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/admin/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/admin/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/config/package.json +22 -0
- package/template/apps/todo/services/auth/config/src/index.ts +2 -0
- package/template/apps/todo/services/auth/config/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/models/package.json +22 -0
- package/template/apps/todo/services/auth/models/src/index.ts +2 -0
- package/template/apps/todo/services/auth/models/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/service/package.json +9 -0
- package/template/apps/todo/services/auth/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/auth/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/auth/service/tsconfig.json +8 -0
- package/template/apps/todo/services/auth/service-utils/package.json +22 -0
- package/template/apps/todo/services/auth/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/auth/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/shared-logic/package.json +22 -0
- package/template/apps/todo/services/auth/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/auth/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/x-logic/package.json +22 -0
- package/template/apps/todo/services/auth/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/auth/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/auth/x-models/package.json +22 -0
- package/template/apps/todo/services/auth/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/auth/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/auth/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/config/package.json +22 -0
- package/template/apps/todo/services/design/config/src/index.ts +2 -0
- package/template/apps/todo/services/design/config/tsconfig.json +18 -0
- package/template/apps/todo/services/design/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/models/package.json +22 -0
- package/template/apps/todo/services/design/models/src/index.ts +2 -0
- package/template/apps/todo/services/design/models/tsconfig.json +18 -0
- package/template/apps/todo/services/design/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/service/package.json +9 -0
- package/template/apps/todo/services/design/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/design/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/design/service/tsconfig.json +8 -0
- package/template/apps/todo/services/design/service-utils/package.json +22 -0
- package/template/apps/todo/services/design/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/design/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/design/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/shared-logic/package.json +22 -0
- package/template/apps/todo/services/design/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/design/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/design/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/views/package.json +8 -0
- package/template/apps/todo/services/design/views/src/app.tsx +7 -0
- package/template/apps/todo/services/design/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/design/views/src/components/WelcomeScreen/WelcomeScreen.tsx +85 -0
- package/template/apps/todo/services/design/views/src/index.html +12 -0
- package/template/apps/todo/services/design/views/src/index.ts +1 -0
- package/template/apps/todo/services/design/views/src/main.ts +1 -0
- package/template/apps/todo/services/design/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/design/views/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-logic/package.json +22 -0
- package/template/apps/todo/services/design/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/design/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/design/x-models/package.json +22 -0
- package/template/apps/todo/services/design/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/design/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/design/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/config/package.json +22 -0
- package/template/apps/todo/services/shell/config/src/index.ts +2 -0
- package/template/apps/todo/services/shell/config/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/models/package.json +22 -0
- package/template/apps/todo/services/shell/models/src/index.ts +2 -0
- package/template/apps/todo/services/shell/models/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/service/package.json +9 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/health/health.ts +21 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/health/index.ts +1 -0
- package/template/apps/todo/services/shell/service/src/entry/controller/index.ts +1 -0
- package/template/apps/todo/services/shell/service/src/infrastructure.ts +75 -0
- package/template/apps/todo/services/shell/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/shell/service/tsconfig.json +8 -0
- package/template/apps/todo/services/shell/service-utils/package.json +22 -0
- package/template/apps/todo/services/shell/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/shell/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/shared-logic/package.json +22 -0
- package/template/apps/todo/services/shell/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/shell/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/views/package.json +8 -0
- package/template/apps/todo/services/shell/views/src/app.tsx +6 -0
- package/template/apps/todo/services/shell/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/shell/views/src/index.html +19 -0
- package/template/apps/todo/services/shell/views/src/index.ts +1 -0
- package/template/apps/todo/services/shell/views/src/main.ts +1 -0
- package/template/apps/todo/services/shell/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/shell/views/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-logic/package.json +22 -0
- package/template/apps/todo/services/shell/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/shell/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/shell/x-models/package.json +22 -0
- package/template/apps/todo/services/shell/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/shell/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/shell/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/config/package.json +22 -0
- package/template/apps/todo/services/todo/config/src/index.ts +2 -0
- package/template/apps/todo/services/todo/config/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/config/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/models/package.json +22 -0
- package/template/apps/todo/services/todo/models/src/index.ts +2 -0
- package/template/apps/todo/services/todo/models/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/models/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/service/package.json +9 -0
- package/template/apps/todo/services/todo/service/src/infrastructure.ts +15 -0
- package/template/apps/todo/services/todo/service/tsconfig.app.json +17 -0
- package/template/apps/todo/services/todo/service/tsconfig.json +8 -0
- package/template/apps/todo/services/todo/service-utils/package.json +22 -0
- package/template/apps/todo/services/todo/service-utils/src/index.ts +2 -0
- package/template/apps/todo/services/todo/service-utils/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/service-utils/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/shared-logic/package.json +22 -0
- package/template/apps/todo/services/todo/shared-logic/src/index.ts +2 -0
- package/template/apps/todo/services/todo/shared-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/shared-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/views/package.json +8 -0
- package/template/apps/todo/services/todo/views/src/app.tsx +7 -0
- package/template/apps/todo/services/todo/views/src/bootstrap.tsx +14 -0
- package/template/apps/todo/services/todo/views/src/components/TodoList/TodoList.tsx +132 -0
- package/template/apps/todo/services/todo/views/src/index.html +11 -0
- package/template/apps/todo/services/todo/views/src/index.ts +1 -0
- package/template/apps/todo/services/todo/views/src/main.ts +1 -0
- package/template/apps/todo/services/todo/views/tsconfig.app.json +20 -0
- package/template/apps/todo/services/todo/views/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-logic/package.json +22 -0
- package/template/apps/todo/services/todo/x-logic/src/index.ts +2 -0
- package/template/apps/todo/services/todo/x-logic/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-logic/tsconfig.lib.json +19 -0
- package/template/apps/todo/services/todo/x-models/package.json +22 -0
- package/template/apps/todo/services/todo/x-models/src/index.ts +2 -0
- package/template/apps/todo/services/todo/x-models/tsconfig.json +18 -0
- package/template/apps/todo/services/todo/x-models/tsconfig.lib.json +19 -0
- package/template/apps/todo/tsconfig.federated.json +13 -0
- package/template/docusaurus/DOCUMENTATION_CHECKLIST.md +499 -0
- package/template/docusaurus/README.md +41 -0
- package/template/docusaurus/blog/2019-05-28-first-blog-post.md +12 -0
- package/template/docusaurus/blog/2019-05-29-long-blog-post.md +44 -0
- package/template/docusaurus/blog/2021-08-01-mdx-blog-post.mdx +24 -0
- package/template/docusaurus/blog/2021-08-26-welcome/docusaurus-plushie-banner.jpeg +0 -0
- package/template/docusaurus/blog/2021-08-26-welcome/index.md +29 -0
- package/template/docusaurus/blog/authors.yml +25 -0
- package/template/docusaurus/blog/tags.yml +19 -0
- package/template/docusaurus/docs/actions/core/_category_.json +8 -0
- package/template/docusaurus/docs/actions/core/ai/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt-stream.md +96 -0
- package/template/docusaurus/docs/actions/core/ai/ask-ai-prompt.md +121 -0
- package/template/docusaurus/docs/actions/core/array/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/array/ask-array-some.md +54 -0
- package/template/docusaurus/docs/actions/core/array/ask-filter.md +54 -0
- package/template/docusaurus/docs/actions/core/array/ask-flat-map-parallel-batch.md +68 -0
- package/template/docusaurus/docs/actions/core/array/ask-flat-map.md +56 -0
- package/template/docusaurus/docs/actions/core/array/ask-map-parallel-batch.md +67 -0
- package/template/docusaurus/docs/actions/core/array/ask-map-parallel.md +57 -0
- package/template/docusaurus/docs/actions/core/array/ask-map.md +58 -0
- package/template/docusaurus/docs/actions/core/array/ask-reduce.md +57 -0
- package/template/docusaurus/docs/actions/core/binary-data/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/binary-data/ask-create-text-qpq-binary-data.md +86 -0
- package/template/docusaurus/docs/actions/core/claude-ai/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/claude-ai/ask-claude-ai-messages-api.md +70 -0
- package/template/docusaurus/docs/actions/core/config/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-application-info.md +42 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-global.md +52 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-parameter.md +52 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-parameters.md +49 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-get-secret.md +54 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-list-parameters.md +46 -0
- package/template/docusaurus/docs/actions/core/config/ask-config-set-parameter.md +51 -0
- package/template/docusaurus/docs/actions/core/config/ask-get-application-version.md +39 -0
- package/template/docusaurus/docs/actions/core/context/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/context/ask-context-provide-value.md +78 -0
- package/template/docusaurus/docs/actions/core/context/ask-context-read.md +96 -0
- package/template/docusaurus/docs/actions/core/date/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/date/ask-date-now.md +50 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-current-epoch-ms.md +45 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-current-epoch.md +45 -0
- package/template/docusaurus/docs/actions/core/date/ask-get-epoch-start-time.md +40 -0
- package/template/docusaurus/docs/actions/core/date/ask-seconds-elapsed-from.md +52 -0
- package/template/docusaurus/docs/actions/core/date/date-time-math.md +112 -0
- package/template/docusaurus/docs/actions/core/error/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/error/ask-throw-error.md +115 -0
- package/template/docusaurus/docs/actions/core/event/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/event/ask-process-event.md +77 -0
- package/template/docusaurus/docs/actions/core/event-bus/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/event-bus/ask-event-bus-send-messages.md +104 -0
- package/template/docusaurus/docs/actions/core/file/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-delete.md +69 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-exists.md +68 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-secure-url.md +75 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-generate-temporary-upload-secure-url.md +91 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-is-cold-storage.md +72 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-list-directory.md +97 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-binary-contents.md +78 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-object-json.md +72 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-read-text-contents.md +69 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-stream-open.md +102 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-binary-contents.md +98 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-object-json.md +83 -0
- package/template/docusaurus/docs/actions/core/file/ask-file-write-text-contents.md +69 -0
- package/template/docusaurus/docs/actions/core/graph-database/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/graph-database/ask-graph-database-execute-open-cypher-query.md +164 -0
- package/template/docusaurus/docs/actions/core/graph-database/ask-graph-database-internal-field-names.md +64 -0
- package/template/docusaurus/docs/actions/core/guid/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/guid/ask-new-guid.md +45 -0
- package/template/docusaurus/docs/actions/core/guid/ask-new-sortable-guid.md +49 -0
- package/template/docusaurus/docs/actions/core/inline-function/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/inline-function/ask-inline-function-execute.md +66 -0
- package/template/docusaurus/docs/actions/core/json/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/json/ask-decode-json.md +76 -0
- package/template/docusaurus/docs/actions/core/key-value-store/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-delete.md +57 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get-all.md +60 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-get.md +73 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query-all.md +58 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query-single.md +62 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-query.md +129 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan-all.md +56 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-scan.md +71 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update-partial-properties.md +75 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-update.md +106 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert-with-retry.md +65 -0
- package/template/docusaurus/docs/actions/core/key-value-store/ask-key-value-store-upsert.md +71 -0
- package/template/docusaurus/docs/actions/core/log/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-create.md +64 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-disable-event-history.md +53 -0
- package/template/docusaurus/docs/actions/core/log/ask-log-template-literal.md +55 -0
- package/template/docusaurus/docs/actions/core/math/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/math/ask-random-number.md +46 -0
- package/template/docusaurus/docs/actions/core/metric/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/metric/ask-metric-put.md +67 -0
- package/template/docusaurus/docs/actions/core/network/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/network/ask-network-request.md +95 -0
- package/template/docusaurus/docs/actions/core/platform/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/platform/ask-delay.md +48 -0
- package/template/docusaurus/docs/actions/core/queue/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/queue/ask-queue-send-messages.md +89 -0
- package/template/docusaurus/docs/actions/core/state/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/state/ask-reduce-state.md +160 -0
- package/template/docusaurus/docs/actions/core/state/ask-state-dispatch.md +87 -0
- package/template/docusaurus/docs/actions/core/state/ask-state-read.md +45 -0
- package/template/docusaurus/docs/actions/core/stream/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-close.md +56 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-map.md +73 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-process.md +57 -0
- package/template/docusaurus/docs/actions/core/stream/ask-stream-read.md +140 -0
- package/template/docusaurus/docs/actions/core/system/_category_.json +7 -0
- package/template/docusaurus/docs/actions/core/system/ask-batch.md +55 -0
- package/template/docusaurus/docs/actions/core/system/ask-catch.md +85 -0
- package/template/docusaurus/docs/actions/core/system/ask-execute-if.md +51 -0
- package/template/docusaurus/docs/actions/core/system/ask-execute-story.md +56 -0
- package/template/docusaurus/docs/actions/core/system/ask-get-runtime-correlation.md +46 -0
- package/template/docusaurus/docs/actions/core/system/ask-override-actions.md +76 -0
- package/template/docusaurus/docs/actions/core/system/ask-parallel-deprecated.md +55 -0
- package/template/docusaurus/docs/actions/core/system/ask-retry.md +72 -0
- package/template/docusaurus/docs/actions/core/system/ask-run-parallel.md +62 -0
- package/template/docusaurus/docs/actions/core/user-directory/_category_.json +1 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-associate-software-token.md +73 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-authenticate-user.md +124 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-change-password.md +55 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-confirm-email-verification.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-confirm-forgot-password.md +58 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-create-user.md +72 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-decode-access-token.md +73 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-forgot-password.md +66 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-user-attributes-by-user-id.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-user-attributes.md +78 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-users-by-attribute.md +59 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-get-users.md +71 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-read-access-token.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-refresh-token.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-request-email-verification.md +53 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-respond-to-auth-challenge.md +124 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-access-token.md +52 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-password.md +55 -0
- package/template/docusaurus/docs/actions/core/user-directory/ask-user-directory-set-user-attributes.md +60 -0
- package/template/docusaurus/docs/actions/features/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-append-server-event.md +65 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-create.md +112 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-append.md +97 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-list.md +116 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-event-write.md +50 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-generate-asset-upload-url.md +127 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-by-code.md +97 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-by-id.md +121 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-get-draft.md +109 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-list.md +53 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-provide-store.md +160 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-resolve-actor.md +107 -0
- package/template/docusaurus/docs/actions/features/event-doc/ask-event-doc-soft-delete.md +69 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/active-chat-state.md +153 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-attachments-validate.md +63 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-history-load.md +95 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-list.md +91 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-chat-requests.md +93 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-context-read.md +84 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-load-chats.md +37 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-new-chat.md +43 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-process-send.md +70 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-select-chat.md +42 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-send-message.md +52 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/ask-event-doc-ai-service-request.md +53 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/chat-list-state.md +179 -0
- package/template/docusaurus/docs/actions/features/event-doc-ai/streaming-and-status-state.md +168 -0
- package/template/docusaurus/docs/actions/features/validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/features/validation/ask-validate-model-or-throw-error.md +73 -0
- package/template/docusaurus/docs/actions/webserver/_category_.json +8 -0
- package/template/docusaurus/docs/actions/webserver/admin/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log-metadata-children.md +62 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log-metadata.md +67 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-log.md +84 -0
- package/template/docusaurus/docs/actions/webserver/admin/ask-admin-get-logs.md +96 -0
- package/template/docusaurus/docs/actions/webserver/api-key-validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/api-key-validation/ask-api-key-validation-validate.md +63 -0
- package/template/docusaurus/docs/actions/webserver/dns/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/dns/ask-dns-list.md +37 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-put-generic-data-resource.md +48 -0
- package/template/docusaurus/docs/actions/webserver/generic-data-resource/ask-scan-generic-data-resource.md +49 -0
- package/template/docusaurus/docs/actions/webserver/open-api-spec/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/open-api-spec/ask-get-open-api-spec.md +43 -0
- package/template/docusaurus/docs/actions/webserver/route-auth-validation/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/route-auth-validation/ask-route-auth-validation-decode.md +65 -0
- package/template/docusaurus/docs/actions/webserver/service/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/service/ask-service-request.md +69 -0
- package/template/docusaurus/docs/actions/webserver/service-function/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/service-function/ask-service-function-execute.md +58 -0
- package/template/docusaurus/docs/actions/webserver/web-entry/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/web-entry/ask-web-entry-invalidate-cache.md +53 -0
- package/template/docusaurus/docs/actions/webserver/websocket/_category_.json +1 -0
- package/template/docusaurus/docs/actions/webserver/websocket/ask-websocket-send-message.md +71 -0
- package/template/docusaurus/docs/actions/xstate/_category_.json +1 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-create.md +60 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-get-state.md +65 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-get.md +57 -0
- package/template/docusaurus/docs/actions/xstate/ask-state-machine-send-event.md +69 -0
- package/template/docusaurus/docs/api/index.md +17 -0
- package/template/docusaurus/docs/architecture-overview.md +690 -0
- package/template/docusaurus/docs/config/config-aws/_category_.json +1 -0
- package/template/docusaurus/docs/config/config-aws/account-budget.md +117 -0
- package/template/docusaurus/docs/config/config-aws/account-cloud-trail.md +75 -0
- package/template/docusaurus/docs/config/config-aws/account-security-services.md +91 -0
- package/template/docusaurus/docs/config/config-aws/aws-alarm.md +142 -0
- package/template/docusaurus/docs/config/config-aws/aws-data-store-removal-policy.md +68 -0
- package/template/docusaurus/docs/config/config-aws/aws-dyanmo-override-for-kvs.md +70 -0
- package/template/docusaurus/docs/config/config-aws/aws-kms-key.md +100 -0
- package/template/docusaurus/docs/config/config-aws/aws-service-account-info.md +114 -0
- package/template/docusaurus/docs/config/config-aws/aws-service-dashboard.md +61 -0
- package/template/docusaurus/docs/config/config-aws/aws-virtual-network-settings.md +88 -0
- package/template/docusaurus/docs/config/config-aws/bootstrap-aws-organization.md +80 -0
- package/template/docusaurus/docs/config/config-aws/bootstrap-waf.md +106 -0
- package/template/docusaurus/docs/config/config-aws/domain-certificate.md +69 -0
- package/template/docusaurus/docs/config/config-aws/event-bus-quick-subscription.md +84 -0
- package/template/docusaurus/docs/config/config-aws/waf-protection.md +45 -0
- package/template/docusaurus/docs/config/core/_category_.json +8 -0
- package/template/docusaurus/docs/config/core/action-processors.md +65 -0
- package/template/docusaurus/docs/config/core/ai.md +80 -0
- package/template/docusaurus/docs/config/core/api-build-path.md +40 -0
- package/template/docusaurus/docs/config/core/application-module.md +58 -0
- package/template/docusaurus/docs/config/core/application-name.md +66 -0
- package/template/docusaurus/docs/config/core/application-version.md +58 -0
- package/template/docusaurus/docs/config/core/claude-ai.md +52 -0
- package/template/docusaurus/docs/config/core/config-value.md +38 -0
- package/template/docusaurus/docs/config/core/deploy-event.md +94 -0
- package/template/docusaurus/docs/config/core/environment-settings.md +67 -0
- package/template/docusaurus/docs/config/core/event-bus.md +88 -0
- package/template/docusaurus/docs/config/core/federated-module-store.md +61 -0
- package/template/docusaurus/docs/config/core/global.md +43 -0
- package/template/docusaurus/docs/config/core/graph-database.md +72 -0
- package/template/docusaurus/docs/config/core/inline-function.md +61 -0
- package/template/docusaurus/docs/config/core/javascript-runtime.md +79 -0
- package/template/docusaurus/docs/config/core/key-value-store.md +135 -0
- package/template/docusaurus/docs/config/core/module-name.md +46 -0
- package/template/docusaurus/docs/config/core/notify-error.md +97 -0
- package/template/docusaurus/docs/config/core/parameter.md +53 -0
- package/template/docusaurus/docs/config/core/promise-mode.md +39 -0
- package/template/docusaurus/docs/config/core/queue.md +112 -0
- package/template/docusaurus/docs/config/core/recurring-schedule.md +117 -0
- package/template/docusaurus/docs/config/core/secret.md +51 -0
- package/template/docusaurus/docs/config/core/service-settings.md +49 -0
- package/template/docusaurus/docs/config/core/storage-drive.md +142 -0
- package/template/docusaurus/docs/config/core/user-directory.md +189 -0
- package/template/docusaurus/docs/config/core/virtual-network.md +60 -0
- package/template/docusaurus/docs/config/features/_category_.json +1 -0
- package/template/docusaurus/docs/config/features/admin-session-event-doc.md +47 -0
- package/template/docusaurus/docs/config/features/admin-settings.md +106 -0
- package/template/docusaurus/docs/config/features/admin-user-directory.md +57 -0
- package/template/docusaurus/docs/config/features/event-doc-ai.md +104 -0
- package/template/docusaurus/docs/config/features/event-doc-routes.md +100 -0
- package/template/docusaurus/docs/config/features/event-doc-summary.md +59 -0
- package/template/docusaurus/docs/config/features/event-doc.md +75 -0
- package/template/docusaurus/docs/config/features/versioned-route.md +85 -0
- package/template/docusaurus/docs/config/neo4j/_category_.json +1 -0
- package/template/docusaurus/docs/config/neo4j/graph-database-neo4j.md +122 -0
- package/template/docusaurus/docs/config/webserver/_category_.json +8 -0
- package/template/docusaurus/docs/config/webserver/api-key.md +87 -0
- package/template/docusaurus/docs/config/webserver/api.md +75 -0
- package/template/docusaurus/docs/config/webserver/auth-system.md +110 -0
- package/template/docusaurus/docs/config/webserver/cache.md +94 -0
- package/template/docusaurus/docs/config/webserver/certificate.md +64 -0
- package/template/docusaurus/docs/config/webserver/default-route-options.md +77 -0
- package/template/docusaurus/docs/config/webserver/dns.md +57 -0
- package/template/docusaurus/docs/config/webserver/domain-proxy.md +109 -0
- package/template/docusaurus/docs/config/webserver/file-upload-settings.md +63 -0
- package/template/docusaurus/docs/config/webserver/migration.md +83 -0
- package/template/docusaurus/docs/config/webserver/open-api.md +36 -0
- package/template/docusaurus/docs/config/webserver/route.md +109 -0
- package/template/docusaurus/docs/config/webserver/seed.md +61 -0
- package/template/docusaurus/docs/config/webserver/seo.md +72 -0
- package/template/docusaurus/docs/config/webserver/service-function.md +69 -0
- package/template/docusaurus/docs/config/webserver/state-dispatch-over-websockets.md +42 -0
- package/template/docusaurus/docs/config/webserver/storage-drive-cors-settings.md +73 -0
- package/template/docusaurus/docs/config/webserver/subdomain-redirect.md +80 -0
- package/template/docusaurus/docs/config/webserver/web-entry.md +150 -0
- package/template/docusaurus/docs/config/webserver/web-socket-queue.md +88 -0
- package/template/docusaurus/docs/config/webserver/websocket.md +110 -0
- package/template/docusaurus/docs/config/xstate/_category_.json +1 -0
- package/template/docusaurus/docs/config/xstate/state-machine.md +201 -0
- package/template/docusaurus/docs/core-concepts.md +23 -0
- package/template/docusaurus/docs/getting-started.md +806 -0
- package/template/docusaurus/docs/index.md +211 -0
- package/template/docusaurus/docs/intro.md +47 -0
- package/template/docusaurus/docs/tutorial-basics/_category_.json +8 -0
- package/template/docusaurus/docs/tutorial-basics/congratulations.md +23 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-blog-post.md +34 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-document.md +57 -0
- package/template/docusaurus/docs/tutorial-basics/create-a-page.md +43 -0
- package/template/docusaurus/docs/tutorial-basics/deploy-your-site.md +31 -0
- package/template/docusaurus/docs/tutorial-basics/markdown-features.mdx +152 -0
- package/template/docusaurus/docs/tutorial-extras/_category_.json +7 -0
- package/template/docusaurus/docs/tutorial-extras/img/docsVersionDropdown.png +0 -0
- package/template/docusaurus/docs/tutorial-extras/img/localeDropdown.png +0 -0
- package/template/docusaurus/docs/tutorial-extras/manage-docs-versions.md +55 -0
- package/template/docusaurus/docs/tutorial-extras/translate-your-site.md +88 -0
- package/template/docusaurus/docs/use-cases.md +455 -0
- package/template/docusaurus/docusaurus.config.ts +181 -0
- package/template/docusaurus/gitignore +20 -0
- package/template/docusaurus/package.json +49 -0
- package/template/docusaurus/sidebars.ts +27 -0
- package/template/docusaurus/src/components/HomepageFeatures/index.tsx +72 -0
- package/template/docusaurus/src/components/HomepageFeatures/styles.module.css +11 -0
- package/template/docusaurus/src/css/custom.css +423 -0
- package/template/docusaurus/src/pages/index.module.css +23 -0
- package/template/docusaurus/static/.nojekyll +0 -0
- package/template/docusaurus/static/img/docusaurus-social-card.jpg +0 -0
- package/template/docusaurus/static/img/docusaurus.png +0 -0
- package/template/docusaurus/static/img/favicon.ico +0 -0
- package/template/docusaurus/static/img/favicon.svg +4 -0
- package/template/docusaurus/static/img/logo.svg +1 -0
- package/template/docusaurus/static/img/qpq-logo.svg +4 -0
- package/template/docusaurus/static/img/undraw_docusaurus_mountain.svg +171 -0
- package/template/docusaurus/static/img/undraw_docusaurus_react.svg +170 -0
- package/template/docusaurus/static/img/undraw_docusaurus_tree.svg +40 -0
- package/template/docusaurus/tsconfig.json +8 -0
- package/template/eslint.config.mjs +3 -0
- package/template/gitignore +116 -0
- package/template/package.json +126 -0
- package/template/tsconfig.base.json +23 -0
- package/template/tsconfig.json +16 -0
- package/template/types/assets.d.ts +3 -0
|
@@ -0,0 +1,806 @@
|
|
|
1
|
+
---
|
|
2
|
+
sidebar_position: 1
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Getting Started
|
|
6
|
+
|
|
7
|
+
Get up and running with Quidproquo in minutes. This guide will walk you through installation, creating your first story, building an API, and deploying your application.
|
|
8
|
+
|
|
9
|
+
## Prerequisites
|
|
10
|
+
|
|
11
|
+
Before you begin, ensure you have:
|
|
12
|
+
- Node.js 18+ installed
|
|
13
|
+
- npm or yarn package manager
|
|
14
|
+
- Basic knowledge of JavaScript/TypeScript
|
|
15
|
+
- Familiarity with generator functions (we'll explain the basics)
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
### Create a New Project
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# Create a new directory
|
|
23
|
+
mkdir my-qpq-app
|
|
24
|
+
cd my-qpq-app
|
|
25
|
+
|
|
26
|
+
# Initialize package.json
|
|
27
|
+
npm init -y
|
|
28
|
+
|
|
29
|
+
# Install TypeScript (recommended)
|
|
30
|
+
npm install --save-dev typescript @types/node
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Install Quidproquo Packages
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Core package (required)
|
|
37
|
+
npm install quidproquo-core
|
|
38
|
+
|
|
39
|
+
# Web server package (for APIs)
|
|
40
|
+
npm install quidproquo-webserver
|
|
41
|
+
|
|
42
|
+
# Development server (for local development)
|
|
43
|
+
npm install --save-dev quidproquo-dev-server
|
|
44
|
+
|
|
45
|
+
# Platform-specific processors (choose based on deployment target)
|
|
46
|
+
npm install quidproquo-actionprocessor-node # For Node.js
|
|
47
|
+
# OR
|
|
48
|
+
npm install quidproquo-actionprocessor-awslambda # For AWS
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### TypeScript Configuration
|
|
52
|
+
|
|
53
|
+
Create a `tsconfig.json`:
|
|
54
|
+
|
|
55
|
+
```json
|
|
56
|
+
{
|
|
57
|
+
"compilerOptions": {
|
|
58
|
+
"target": "ES2020",
|
|
59
|
+
"module": "commonjs",
|
|
60
|
+
"lib": ["ES2020"],
|
|
61
|
+
"outDir": "./dist",
|
|
62
|
+
"rootDir": "./src",
|
|
63
|
+
"strict": true,
|
|
64
|
+
"esModuleInterop": true,
|
|
65
|
+
"skipLibCheck": true,
|
|
66
|
+
"forceConsistentCasingInFileNames": true,
|
|
67
|
+
"resolveJsonModule": true,
|
|
68
|
+
"declaration": true,
|
|
69
|
+
"declarationMap": true
|
|
70
|
+
},
|
|
71
|
+
"include": ["src/**/*"],
|
|
72
|
+
"exclude": ["node_modules", "dist"]
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Your First Story
|
|
77
|
+
|
|
78
|
+
Let's create a simple "Hello World" story to understand the basics.
|
|
79
|
+
|
|
80
|
+
### Understanding Generator Functions
|
|
81
|
+
|
|
82
|
+
Generator functions (marked with `*`) can pause and resume execution:
|
|
83
|
+
|
|
84
|
+
```typescript
|
|
85
|
+
// src/stories/hello.ts
|
|
86
|
+
import { askDateNow, askLogCreate } from 'quidproquo-core';
|
|
87
|
+
|
|
88
|
+
export function* helloWorldStory(name: string) {
|
|
89
|
+
// Log the start
|
|
90
|
+
yield* askLogCreate('INFO', `Starting hello for ${name}`);
|
|
91
|
+
|
|
92
|
+
// Get current time
|
|
93
|
+
const currentTime = yield* askDateNow();
|
|
94
|
+
|
|
95
|
+
// Return greeting
|
|
96
|
+
return `Hello ${name}! The time is ${currentTime}`;
|
|
97
|
+
}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
**Key concepts:**
|
|
101
|
+
- `function*` declares a generator function
|
|
102
|
+
- `yield*` pauses execution and delegates to another generator
|
|
103
|
+
- Each `ask*` function returns a generator that yields an action
|
|
104
|
+
- The runtime processes each action and returns the result
|
|
105
|
+
|
|
106
|
+
### Creating Actions
|
|
107
|
+
|
|
108
|
+
Actions describe what you want to do:
|
|
109
|
+
|
|
110
|
+
```typescript
|
|
111
|
+
// src/stories/user.ts
|
|
112
|
+
import {
|
|
113
|
+
askKeyValueStoreGet,
|
|
114
|
+
askKeyValueStoreUpsert,
|
|
115
|
+
askGuidNew,
|
|
116
|
+
askDateNow,
|
|
117
|
+
askThrowError
|
|
118
|
+
} from 'quidproquo-core';
|
|
119
|
+
|
|
120
|
+
export function* createUserStory(email: string, name: string) {
|
|
121
|
+
// Check if user exists
|
|
122
|
+
const existingUser = yield* askKeyValueStoreGet('users', email);
|
|
123
|
+
|
|
124
|
+
if (existingUser) {
|
|
125
|
+
// Throw an error if user exists
|
|
126
|
+
yield* askThrowError('USER_EXISTS', `User with email ${email} already exists`);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// Generate a new ID
|
|
130
|
+
const userId = yield* askGuidNew();
|
|
131
|
+
|
|
132
|
+
// Get current timestamp
|
|
133
|
+
const createdAt = yield* askDateNow();
|
|
134
|
+
|
|
135
|
+
// Create user object
|
|
136
|
+
const user = {
|
|
137
|
+
id: userId,
|
|
138
|
+
email,
|
|
139
|
+
name,
|
|
140
|
+
createdAt
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
// Store the user
|
|
144
|
+
yield* askKeyValueStoreUpsert('users', user);
|
|
145
|
+
|
|
146
|
+
return user;
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Building Your First API
|
|
151
|
+
|
|
152
|
+
Now let's create a REST API using Quidproquo.
|
|
153
|
+
|
|
154
|
+
### Define Routes
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
// src/api/index.ts
|
|
158
|
+
import { HTTPMethod, HTTPResponse } from 'quidproquo-webserver';
|
|
159
|
+
import { createUserStory } from '../stories/user';
|
|
160
|
+
import { askCatch } from 'quidproquo-core';
|
|
161
|
+
|
|
162
|
+
export function* handleCreateUser(request: any): Generator<any, HTTPResponse, any> {
|
|
163
|
+
const { email, name } = JSON.parse(request.body);
|
|
164
|
+
|
|
165
|
+
// Validate input
|
|
166
|
+
if (!email || !name) {
|
|
167
|
+
return {
|
|
168
|
+
statusCode: 400,
|
|
169
|
+
headers: { 'Content-Type': 'application/json' },
|
|
170
|
+
body: JSON.stringify({ error: 'Email and name are required' })
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
// Try to create user
|
|
175
|
+
const result = yield* askCatch(createUserStory(email, name));
|
|
176
|
+
|
|
177
|
+
if (result.success) {
|
|
178
|
+
return {
|
|
179
|
+
statusCode: 201,
|
|
180
|
+
headers: { 'Content-Type': 'application/json' },
|
|
181
|
+
body: JSON.stringify(result.result)
|
|
182
|
+
};
|
|
183
|
+
} else {
|
|
184
|
+
return {
|
|
185
|
+
statusCode: 400,
|
|
186
|
+
headers: { 'Content-Type': 'application/json' },
|
|
187
|
+
body: JSON.stringify({ error: result.error.errorText })
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
### Configure the API
|
|
194
|
+
|
|
195
|
+
```typescript
|
|
196
|
+
// src/config.ts
|
|
197
|
+
import { defineRoute, defineApi, defineService } from 'quidproquo-webserver';
|
|
198
|
+
import { defineKeyValueStore } from 'quidproquo-core';
|
|
199
|
+
import { handleCreateUser } from './api';
|
|
200
|
+
|
|
201
|
+
export default [
|
|
202
|
+
// Define a key-value store for users
|
|
203
|
+
defineKeyValueStore('users', {
|
|
204
|
+
partitionKey: 'email',
|
|
205
|
+
indexes: []
|
|
206
|
+
}),
|
|
207
|
+
|
|
208
|
+
// Define API routes
|
|
209
|
+
defineApi('main', {
|
|
210
|
+
routes: [
|
|
211
|
+
defineRoute(HTTPMethod.POST, '/users', handleCreateUser),
|
|
212
|
+
defineRoute(HTTPMethod.GET, '/health', function* () {
|
|
213
|
+
return {
|
|
214
|
+
statusCode: 200,
|
|
215
|
+
body: JSON.stringify({ status: 'healthy' })
|
|
216
|
+
};
|
|
217
|
+
})
|
|
218
|
+
]
|
|
219
|
+
}),
|
|
220
|
+
|
|
221
|
+
// Define the service
|
|
222
|
+
defineService('my-app', {
|
|
223
|
+
apis: ['main']
|
|
224
|
+
})
|
|
225
|
+
];
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Running Locally
|
|
229
|
+
|
|
230
|
+
The development server simulates cloud services locally.
|
|
231
|
+
|
|
232
|
+
### Create Dev Server Entry
|
|
233
|
+
|
|
234
|
+
```typescript
|
|
235
|
+
// src/dev.ts
|
|
236
|
+
import { createDevServer } from 'quidproquo-dev-server';
|
|
237
|
+
import config from './config';
|
|
238
|
+
|
|
239
|
+
const server = createDevServer({
|
|
240
|
+
config,
|
|
241
|
+
port: 3000,
|
|
242
|
+
watch: true
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
server.start().then(() => {
|
|
246
|
+
console.log('Dev server running on http://localhost:3000');
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### Add Scripts to package.json
|
|
251
|
+
|
|
252
|
+
```json
|
|
253
|
+
{
|
|
254
|
+
"scripts": {
|
|
255
|
+
"dev": "ts-node src/dev.ts",
|
|
256
|
+
"build": "tsc",
|
|
257
|
+
"start": "node dist/dev.js"
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
### Start the Dev Server
|
|
263
|
+
|
|
264
|
+
```bash
|
|
265
|
+
npm run dev
|
|
266
|
+
```
|
|
267
|
+
|
|
268
|
+
Your API is now running! Test it:
|
|
269
|
+
|
|
270
|
+
```bash
|
|
271
|
+
# Create a user
|
|
272
|
+
curl -X POST http://localhost:3000/users \
|
|
273
|
+
-H "Content-Type: application/json" \
|
|
274
|
+
-d '{"email": "alice@example.com", "name": "Alice"}'
|
|
275
|
+
|
|
276
|
+
# Check health
|
|
277
|
+
curl http://localhost:3000/health
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## Complete Example: Todo API
|
|
281
|
+
|
|
282
|
+
Let's build a more complete example - a Todo API with CRUD operations.
|
|
283
|
+
|
|
284
|
+
### Define Todo Stories
|
|
285
|
+
|
|
286
|
+
```typescript
|
|
287
|
+
// src/stories/todo.ts
|
|
288
|
+
import {
|
|
289
|
+
askKeyValueStoreGet,
|
|
290
|
+
askKeyValueStoreUpsert,
|
|
291
|
+
askKeyValueStoreDelete,
|
|
292
|
+
askKeyValueStoreQuery,
|
|
293
|
+
askGuidNew,
|
|
294
|
+
askDateNow,
|
|
295
|
+
askThrowError
|
|
296
|
+
} from 'quidproquo-core';
|
|
297
|
+
|
|
298
|
+
interface Todo {
|
|
299
|
+
id: string;
|
|
300
|
+
userId: string;
|
|
301
|
+
title: string;
|
|
302
|
+
completed: boolean;
|
|
303
|
+
createdAt: string;
|
|
304
|
+
updatedAt: string;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export function* createTodoStory(userId: string, title: string) {
|
|
308
|
+
const todoId = yield* askGuidNew();
|
|
309
|
+
const now = yield* askDateNow();
|
|
310
|
+
|
|
311
|
+
const todo: Todo = {
|
|
312
|
+
id: todoId,
|
|
313
|
+
userId,
|
|
314
|
+
title,
|
|
315
|
+
completed: false,
|
|
316
|
+
createdAt: now,
|
|
317
|
+
updatedAt: now
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
yield* askKeyValueStoreUpsert('todos', todo);
|
|
321
|
+
return todo;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export function* getTodoStory(todoId: string, userId: string) {
|
|
325
|
+
const todo = yield* askKeyValueStoreGet('todos', todoId);
|
|
326
|
+
|
|
327
|
+
if (!todo) {
|
|
328
|
+
yield* askThrowError('NOT_FOUND', 'Todo not found');
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
if (todo.userId !== userId) {
|
|
332
|
+
yield* askThrowError('FORBIDDEN', 'Access denied');
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
return todo;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
export function* updateTodoStory(
|
|
339
|
+
todoId: string,
|
|
340
|
+
userId: string,
|
|
341
|
+
updates: Partial<Pick<Todo, 'title' | 'completed'>>
|
|
342
|
+
) {
|
|
343
|
+
// Get existing todo
|
|
344
|
+
const todo = yield* getTodoStory(todoId, userId);
|
|
345
|
+
|
|
346
|
+
// Update fields
|
|
347
|
+
const updatedTodo = {
|
|
348
|
+
...todo,
|
|
349
|
+
...updates,
|
|
350
|
+
updatedAt: yield* askDateNow()
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
yield* askKeyValueStoreUpsert('todos', updatedTodo);
|
|
354
|
+
return updatedTodo;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
export function* deleteTodoStory(todoId: string, userId: string) {
|
|
358
|
+
// Verify ownership
|
|
359
|
+
yield* getTodoStory(todoId, userId);
|
|
360
|
+
|
|
361
|
+
// Delete
|
|
362
|
+
yield* askKeyValueStoreDelete('todos', todoId);
|
|
363
|
+
return { success: true };
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
export function* listTodosStory(userId: string) {
|
|
367
|
+
const todos = yield* askKeyValueStoreQuery('todos', {
|
|
368
|
+
index: 'byUser',
|
|
369
|
+
keyCondition: {
|
|
370
|
+
userId: { '=': userId }
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
|
|
374
|
+
return todos;
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
### Create API Handlers
|
|
379
|
+
|
|
380
|
+
```typescript
|
|
381
|
+
// src/api/todos.ts
|
|
382
|
+
import { HTTPRequest, HTTPResponse } from 'quidproquo-webserver';
|
|
383
|
+
import { askCatch } from 'quidproquo-core';
|
|
384
|
+
import * as todoStories from '../stories/todo';
|
|
385
|
+
|
|
386
|
+
export function* createTodo(request: HTTPRequest): Generator<any, HTTPResponse, any> {
|
|
387
|
+
const { title } = JSON.parse(request.body);
|
|
388
|
+
const userId = request.headers['x-user-id']; // Simplified auth
|
|
389
|
+
|
|
390
|
+
if (!title) {
|
|
391
|
+
return { statusCode: 400, body: JSON.stringify({ error: 'Title required' }) };
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
const todo = yield* todoStories.createTodoStory(userId, title);
|
|
395
|
+
return { statusCode: 201, body: JSON.stringify(todo) };
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
export function* getTodo(request: HTTPRequest): Generator<any, HTTPResponse, any> {
|
|
399
|
+
const todoId = request.pathParameters.id;
|
|
400
|
+
const userId = request.headers['x-user-id'];
|
|
401
|
+
|
|
402
|
+
const result = yield* askCatch(todoStories.getTodoStory(todoId, userId));
|
|
403
|
+
|
|
404
|
+
if (!result.success) {
|
|
405
|
+
const statusCode = result.error.errorType === 'NOT_FOUND' ? 404 : 403;
|
|
406
|
+
return { statusCode, body: JSON.stringify({ error: result.error.errorText }) };
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
return { statusCode: 200, body: JSON.stringify(result.result) };
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export function* updateTodo(request: HTTPRequest): Generator<any, HTTPResponse, any> {
|
|
413
|
+
const todoId = request.pathParameters.id;
|
|
414
|
+
const userId = request.headers['x-user-id'];
|
|
415
|
+
const updates = JSON.parse(request.body);
|
|
416
|
+
|
|
417
|
+
const result = yield* askCatch(
|
|
418
|
+
todoStories.updateTodoStory(todoId, userId, updates)
|
|
419
|
+
);
|
|
420
|
+
|
|
421
|
+
if (!result.success) {
|
|
422
|
+
return { statusCode: 400, body: JSON.stringify({ error: result.error.errorText }) };
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
return { statusCode: 200, body: JSON.stringify(result.result) };
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
export function* deleteTodo(request: HTTPRequest): Generator<any, HTTPResponse, any> {
|
|
429
|
+
const todoId = request.pathParameters.id;
|
|
430
|
+
const userId = request.headers['x-user-id'];
|
|
431
|
+
|
|
432
|
+
const result = yield* askCatch(todoStories.deleteTodoStory(todoId, userId));
|
|
433
|
+
|
|
434
|
+
if (!result.success) {
|
|
435
|
+
return { statusCode: 400, body: JSON.stringify({ error: result.error.errorText }) };
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
return { statusCode: 204, body: '' };
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export function* listTodos(request: HTTPRequest): Generator<any, HTTPResponse, any> {
|
|
442
|
+
const userId = request.headers['x-user-id'];
|
|
443
|
+
const todos = yield* todoStories.listTodosStory(userId);
|
|
444
|
+
return { statusCode: 200, body: JSON.stringify(todos) };
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
### Configure Complete API
|
|
449
|
+
|
|
450
|
+
```typescript
|
|
451
|
+
// src/config/todos.ts
|
|
452
|
+
import { defineRoute, defineApi, HTTPMethod } from 'quidproquo-webserver';
|
|
453
|
+
import { defineKeyValueStore } from 'quidproquo-core';
|
|
454
|
+
import * as todoHandlers from '../api/todos';
|
|
455
|
+
|
|
456
|
+
export default [
|
|
457
|
+
// Define storage
|
|
458
|
+
defineKeyValueStore('todos', {
|
|
459
|
+
partitionKey: 'id',
|
|
460
|
+
indexes: [
|
|
461
|
+
{
|
|
462
|
+
name: 'byUser',
|
|
463
|
+
partitionKey: 'userId',
|
|
464
|
+
sortKey: 'createdAt'
|
|
465
|
+
}
|
|
466
|
+
]
|
|
467
|
+
}),
|
|
468
|
+
|
|
469
|
+
// Define API
|
|
470
|
+
defineApi('todos', {
|
|
471
|
+
routes: [
|
|
472
|
+
defineRoute(HTTPMethod.POST, '/todos', todoHandlers.createTodo),
|
|
473
|
+
defineRoute(HTTPMethod.GET, '/todos', todoHandlers.listTodos),
|
|
474
|
+
defineRoute(HTTPMethod.GET, '/todos/:id', todoHandlers.getTodo),
|
|
475
|
+
defineRoute(HTTPMethod.PUT, '/todos/:id', todoHandlers.updateTodo),
|
|
476
|
+
defineRoute(HTTPMethod.DELETE, '/todos/:id', todoHandlers.deleteTodo),
|
|
477
|
+
]
|
|
478
|
+
})
|
|
479
|
+
];
|
|
480
|
+
```
|
|
481
|
+
|
|
482
|
+
## Deployment Options
|
|
483
|
+
|
|
484
|
+
Quidproquo supports multiple deployment targets. Here's how to deploy to common platforms.
|
|
485
|
+
|
|
486
|
+
### Deploy to AWS Lambda
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
# Install AWS CDK and QPQ deploy package
|
|
490
|
+
npm install --save-dev aws-cdk quidproquo-deploy-awscdk
|
|
491
|
+
npm install quidproquo-actionprocessor-awslambda
|
|
492
|
+
|
|
493
|
+
# Create CDK app
|
|
494
|
+
mkdir cdk
|
|
495
|
+
cd cdk
|
|
496
|
+
cdk init app --language typescript
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
Create CDK stack:
|
|
500
|
+
|
|
501
|
+
```typescript
|
|
502
|
+
// cdk/lib/my-app-stack.ts
|
|
503
|
+
import * as cdk from 'aws-cdk-lib';
|
|
504
|
+
import { QPQApp } from 'quidproquo-deploy-awscdk';
|
|
505
|
+
import config from '../../src/config';
|
|
506
|
+
|
|
507
|
+
export class MyAppStack extends cdk.Stack {
|
|
508
|
+
constructor(scope: Construct, id: string, props?: cdk.StackProps) {
|
|
509
|
+
super(scope, id, props);
|
|
510
|
+
|
|
511
|
+
new QPQApp(this, 'MyQPQApp', {
|
|
512
|
+
qpqConfig: config,
|
|
513
|
+
environment: 'production'
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
```
|
|
518
|
+
|
|
519
|
+
Deploy:
|
|
520
|
+
|
|
521
|
+
```bash
|
|
522
|
+
cdk deploy
|
|
523
|
+
```
|
|
524
|
+
|
|
525
|
+
### Deploy to Node.js Server
|
|
526
|
+
|
|
527
|
+
```typescript
|
|
528
|
+
// src/server.ts
|
|
529
|
+
import express from 'express';
|
|
530
|
+
import { createNodeRuntime } from 'quidproquo-actionprocessor-node';
|
|
531
|
+
import config from './config';
|
|
532
|
+
|
|
533
|
+
const app = express();
|
|
534
|
+
const runtime = createNodeRuntime(config);
|
|
535
|
+
|
|
536
|
+
app.use(express.json());
|
|
537
|
+
app.all('*', async (req, res) => {
|
|
538
|
+
const result = await runtime.handleHTTPRequest({
|
|
539
|
+
method: req.method,
|
|
540
|
+
path: req.path,
|
|
541
|
+
headers: req.headers,
|
|
542
|
+
body: JSON.stringify(req.body),
|
|
543
|
+
query: req.query
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
res.status(result.statusCode).json(JSON.parse(result.body));
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
app.listen(3000, () => {
|
|
550
|
+
console.log('Server running on port 3000');
|
|
551
|
+
});
|
|
552
|
+
```
|
|
553
|
+
|
|
554
|
+
### Deploy to Docker
|
|
555
|
+
|
|
556
|
+
Create a Dockerfile:
|
|
557
|
+
|
|
558
|
+
```dockerfile
|
|
559
|
+
FROM node:18-alpine
|
|
560
|
+
|
|
561
|
+
WORKDIR /app
|
|
562
|
+
|
|
563
|
+
COPY package*.json ./
|
|
564
|
+
RUN npm ci --production
|
|
565
|
+
|
|
566
|
+
COPY dist ./dist
|
|
567
|
+
COPY config ./config
|
|
568
|
+
|
|
569
|
+
CMD ["node", "dist/server.js"]
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
Build and run:
|
|
573
|
+
|
|
574
|
+
```bash
|
|
575
|
+
npm run build
|
|
576
|
+
docker build -t my-qpq-app .
|
|
577
|
+
docker run -p 3000:3000 my-qpq-app
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
## Testing Your Application
|
|
581
|
+
|
|
582
|
+
Quidproquo's architecture makes testing straightforward.
|
|
583
|
+
|
|
584
|
+
### Unit Testing Stories
|
|
585
|
+
|
|
586
|
+
```typescript
|
|
587
|
+
// src/stories/todo.test.ts
|
|
588
|
+
import { createTodoStory } from './todo';
|
|
589
|
+
|
|
590
|
+
test('creates todo with correct fields', () => {
|
|
591
|
+
const story = createTodoStory('user-123', 'Buy milk');
|
|
592
|
+
|
|
593
|
+
// First yield: Generate ID
|
|
594
|
+
const { value: guidAction } = story.next();
|
|
595
|
+
expect(guidAction.type).toBe('Guid::New');
|
|
596
|
+
|
|
597
|
+
// Provide mock ID
|
|
598
|
+
const { value: dateAction } = story.next('todo-456');
|
|
599
|
+
expect(dateAction.type).toBe('Date::Now');
|
|
600
|
+
|
|
601
|
+
// Provide mock date
|
|
602
|
+
const { value: storeAction } = story.next('2024-01-01T00:00:00Z');
|
|
603
|
+
expect(storeAction.type).toBe('KeyValueStore::Upsert');
|
|
604
|
+
expect(storeAction.payload.item).toEqual({
|
|
605
|
+
id: 'todo-456',
|
|
606
|
+
userId: 'user-123',
|
|
607
|
+
title: 'Buy milk',
|
|
608
|
+
completed: false,
|
|
609
|
+
createdAt: '2024-01-01T00:00:00Z',
|
|
610
|
+
updatedAt: '2024-01-01T00:00:00Z'
|
|
611
|
+
});
|
|
612
|
+
|
|
613
|
+
// Complete story
|
|
614
|
+
const { value: result } = story.next();
|
|
615
|
+
expect(result.id).toBe('todo-456');
|
|
616
|
+
});
|
|
617
|
+
```
|
|
618
|
+
|
|
619
|
+
### Integration Testing
|
|
620
|
+
|
|
621
|
+
```typescript
|
|
622
|
+
// src/api/todos.test.ts
|
|
623
|
+
import { createTestRuntime } from 'quidproquo-testing';
|
|
624
|
+
import { createTodo } from './todos';
|
|
625
|
+
|
|
626
|
+
test('creates todo via API', async () => {
|
|
627
|
+
const runtime = createTestRuntime({
|
|
628
|
+
stores: {
|
|
629
|
+
todos: new Map()
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
const request = {
|
|
634
|
+
body: JSON.stringify({ title: 'Test todo' }),
|
|
635
|
+
headers: { 'x-user-id': 'user-123' }
|
|
636
|
+
};
|
|
637
|
+
|
|
638
|
+
const response = await runtime.execute(createTodo, request);
|
|
639
|
+
|
|
640
|
+
expect(response.statusCode).toBe(201);
|
|
641
|
+
const todo = JSON.parse(response.body);
|
|
642
|
+
expect(todo.title).toBe('Test todo');
|
|
643
|
+
expect(todo.userId).toBe('user-123');
|
|
644
|
+
});
|
|
645
|
+
```
|
|
646
|
+
|
|
647
|
+
## Debugging
|
|
648
|
+
|
|
649
|
+
Quidproquo provides excellent debugging capabilities.
|
|
650
|
+
|
|
651
|
+
### Enable Debug Logging
|
|
652
|
+
|
|
653
|
+
```typescript
|
|
654
|
+
// Set environment variable
|
|
655
|
+
process.env.QPQ_LOG_LEVEL = 'DEBUG';
|
|
656
|
+
|
|
657
|
+
// Or in config
|
|
658
|
+
import { defineLogging } from 'quidproquo-core';
|
|
659
|
+
|
|
660
|
+
export default [
|
|
661
|
+
defineLogging({
|
|
662
|
+
level: 'DEBUG',
|
|
663
|
+
pretty: true
|
|
664
|
+
}),
|
|
665
|
+
// ... other config
|
|
666
|
+
];
|
|
667
|
+
```
|
|
668
|
+
|
|
669
|
+
### View Execution Logs
|
|
670
|
+
|
|
671
|
+
```typescript
|
|
672
|
+
// src/debug.ts
|
|
673
|
+
import { createDevServer } from 'quidproquo-dev-server';
|
|
674
|
+
|
|
675
|
+
const server = createDevServer({
|
|
676
|
+
config,
|
|
677
|
+
port: 3000,
|
|
678
|
+
debug: {
|
|
679
|
+
logActions: true, // Log all actions
|
|
680
|
+
logResults: true, // Log action results
|
|
681
|
+
logDuration: true, // Log execution time
|
|
682
|
+
slowThreshold: 100, // Warn if action takes > 100ms
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
### Replay Executions
|
|
688
|
+
|
|
689
|
+
```typescript
|
|
690
|
+
// Capture execution
|
|
691
|
+
const execution = await runtime.execute(myStory, args, {
|
|
692
|
+
capture: true
|
|
693
|
+
});
|
|
694
|
+
|
|
695
|
+
// Save for debugging
|
|
696
|
+
fs.writeFileSync('execution.json', JSON.stringify(execution));
|
|
697
|
+
|
|
698
|
+
// Replay later
|
|
699
|
+
const executionLog = JSON.parse(fs.readFileSync('execution.json'));
|
|
700
|
+
const result = await qpqExecuteLog(executionLog, myStory);
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
## Best Practices
|
|
704
|
+
|
|
705
|
+
### 1. Keep Stories Pure
|
|
706
|
+
|
|
707
|
+
```typescript
|
|
708
|
+
// Good: Pure story with no side effects
|
|
709
|
+
function* calculatePrice(items: Item[]) {
|
|
710
|
+
const subtotal = items.reduce((sum, item) => sum + item.price, 0);
|
|
711
|
+
const tax = subtotal * 0.1;
|
|
712
|
+
return subtotal + tax;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// Bad: Side effects in story
|
|
716
|
+
function* calculatePrice(items: Item[]) {
|
|
717
|
+
console.log('Calculating...'); // Side effect!
|
|
718
|
+
const subtotal = items.reduce((sum, item) => sum + item.price, 0);
|
|
719
|
+
fs.writeFileSync('log.txt', `Subtotal: ${subtotal}`); // Side effect!
|
|
720
|
+
return subtotal * 1.1;
|
|
721
|
+
}
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### 2. Use Composition
|
|
725
|
+
|
|
726
|
+
```typescript
|
|
727
|
+
// Compose smaller stories
|
|
728
|
+
function* validateEmail(email: string) {
|
|
729
|
+
if (!email.includes('@')) {
|
|
730
|
+
yield* askThrowError('INVALID_EMAIL', 'Invalid email format');
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
function* createUser(email: string, name: string) {
|
|
735
|
+
yield* validateEmail(email); // Reuse validation
|
|
736
|
+
// ... rest of creation logic
|
|
737
|
+
}
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
### 3. Handle Errors Gracefully
|
|
741
|
+
|
|
742
|
+
```typescript
|
|
743
|
+
function* safeOperation() {
|
|
744
|
+
const result = yield* askCatch(riskyOperation());
|
|
745
|
+
|
|
746
|
+
if (!result.success) {
|
|
747
|
+
// Log error
|
|
748
|
+
yield* askLogCreate('ERROR', result.error.errorText);
|
|
749
|
+
// Return default
|
|
750
|
+
return defaultValue;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
return result.result;
|
|
754
|
+
}
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
### 4. Use TypeScript
|
|
758
|
+
|
|
759
|
+
```typescript
|
|
760
|
+
// Define types for your domain
|
|
761
|
+
interface User {
|
|
762
|
+
id: string;
|
|
763
|
+
email: string;
|
|
764
|
+
name: string;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
// Type your stories
|
|
768
|
+
function* getUser(userId: string): Generator<any, User, any> {
|
|
769
|
+
const user = yield* askKeyValueStoreGet<User>('users', userId);
|
|
770
|
+
if (!user) {
|
|
771
|
+
yield* askThrowError('NOT_FOUND', 'User not found');
|
|
772
|
+
}
|
|
773
|
+
return user;
|
|
774
|
+
}
|
|
775
|
+
```
|
|
776
|
+
|
|
777
|
+
## Next Steps
|
|
778
|
+
|
|
779
|
+
Now that you have the basics, explore:
|
|
780
|
+
|
|
781
|
+
- [Core Concepts](./core-concepts.md) - Deep dive into the architecture
|
|
782
|
+
- [API Reference](./api/index.md) - Complete action reference
|
|
783
|
+
- [Use Cases](./use-cases.md) - Real-world examples
|
|
784
|
+
- [Architecture Overview](./architecture-overview.md) - Understanding the internals
|
|
785
|
+
|
|
786
|
+
## Getting Help
|
|
787
|
+
|
|
788
|
+
- **Documentation**: This site contains comprehensive documentation
|
|
789
|
+
- **GitHub Issues**: Report bugs or request features
|
|
790
|
+
- **Examples**: Check the examples directory in the repository
|
|
791
|
+
- **Community**: Join our Discord server (coming soon)
|
|
792
|
+
|
|
793
|
+
## Summary
|
|
794
|
+
|
|
795
|
+
You've learned how to:
|
|
796
|
+
- ✅ Install Quidproquo
|
|
797
|
+
- ✅ Create your first story
|
|
798
|
+
- ✅ Build a REST API
|
|
799
|
+
- ✅ Run locally with the dev server
|
|
800
|
+
- ✅ Deploy to various platforms
|
|
801
|
+
- ✅ Test your application
|
|
802
|
+
- ✅ Debug issues
|
|
803
|
+
|
|
804
|
+
Quidproquo provides a powerful, flexible foundation for building modern web applications. Its unique architecture enables you to write business logic once and deploy anywhere, with complete observability and testing capabilities built in.
|
|
805
|
+
|
|
806
|
+
Start building with Quidproquo today and experience the benefits of true platform independence!
|