insforge 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +58 -0
- package/.env.example +49 -0
- package/.github/ISSUE_TEMPLATE/bug_report.yml +83 -0
- package/.github/ISSUE_TEMPLATE/config.yml +11 -0
- package/.github/ISSUE_TEMPLATE/feature_request.yml +79 -0
- package/.github/copilot-instructions.md +147 -0
- package/.github/workflows/build-image.yml +65 -0
- package/.github/workflows/ci-premerge-check.yml +24 -0
- package/.github/workflows/deploy-aws.yml +130 -0
- package/.github/workflows/lint-and-format.yml +33 -0
- package/.prettierignore +65 -0
- package/.prettierrc +9 -0
- package/CHANGELOG.md +3 -0
- package/CONTRIBUTING.md +126 -0
- package/Dockerfile +27 -0
- package/GITHUB_OAUTH_SETUP.md +49 -0
- package/GOOGLE_OAUTH_SETUP.md +148 -0
- package/LICENSE +201 -0
- package/README.md +134 -0
- package/assets/Dark.svg +23 -0
- package/assets/archDiagram.png +0 -0
- package/assets/banner.png +0 -0
- package/assets/mcpInstallv2.png +0 -0
- package/assets/sampleResponse.png +0 -0
- package/assets/signin.png +0 -0
- package/assets/userflow.png +0 -0
- package/backend/migrations/000_create-base-tables.sql +142 -0
- package/backend/migrations/001_create-helper-functions.sql +41 -0
- package/backend/migrations/002_rename-auth-tables.sql +30 -0
- package/backend/migrations/003_create-users-table.sql +56 -0
- package/backend/migrations/004_add-reload-postgrest-func.sql +24 -0
- package/backend/migrations/005_enable-project-admin-modify-users.sql +30 -0
- package/backend/migrations/006_modify-ai-usage-table.sql +25 -0
- package/backend/migrations/007_drop-metadata-table.sql +2 -0
- package/backend/migrations/008_add-system-tables.sql +77 -0
- package/backend/migrations/009_add-function-secrets.sql +24 -0
- package/backend/migrations/010_modify-ai-config-modalities.sql +93 -0
- package/backend/migrations/011_refactor-secrets-table.sql +15 -0
- package/backend/migrations/012_add-storage-uploaded-by.sql +8 -0
- package/backend/package.json +75 -0
- package/backend/src/api/middleware/auth.ts +240 -0
- package/backend/src/api/middleware/error.ts +231 -0
- package/backend/src/api/middleware/upload.ts +59 -0
- package/backend/src/api/routes/agent.ts +29 -0
- package/backend/src/api/routes/ai.ts +472 -0
- package/backend/src/api/routes/auth.oauth.ts +482 -0
- package/backend/src/api/routes/auth.ts +386 -0
- package/backend/src/api/routes/database.advance.ts +275 -0
- package/backend/src/api/routes/database.records.ts +246 -0
- package/backend/src/api/routes/database.tables.ts +161 -0
- package/backend/src/api/routes/docs.ts +66 -0
- package/backend/src/api/routes/functions.ts +183 -0
- package/backend/src/api/routes/logs.ts +150 -0
- package/backend/src/api/routes/metadata.ts +160 -0
- package/backend/src/api/routes/openapi.ts +82 -0
- package/backend/src/api/routes/secrets.ts +199 -0
- package/backend/src/api/routes/storage.ts +547 -0
- package/backend/src/api/routes/usage.ts +96 -0
- package/backend/src/core/ai/chat.ts +207 -0
- package/backend/src/core/ai/client.ts +242 -0
- package/backend/src/core/ai/config.ts +187 -0
- package/backend/src/core/ai/image.ts +156 -0
- package/backend/src/core/ai/model.ts +117 -0
- package/backend/src/core/ai/usage.ts +290 -0
- package/backend/src/core/auth/auth.ts +781 -0
- package/backend/src/core/auth/oauth.ts +398 -0
- package/backend/src/core/database/advance.ts +1074 -0
- package/backend/src/core/database/manager.ts +178 -0
- package/backend/src/core/database/table.ts +772 -0
- package/backend/src/core/documentation/agent.ts +689 -0
- package/backend/src/core/documentation/openapi.ts +856 -0
- package/backend/src/core/functions/functions.ts +310 -0
- package/backend/src/core/logs/analytics.ts +76 -0
- package/backend/src/core/logs/audit.ts +255 -0
- package/backend/src/core/logs/providers/base.provider.ts +83 -0
- package/backend/src/core/logs/providers/cloudwatch.provider.ts +510 -0
- package/backend/src/core/logs/providers/localdb.provider.ts +246 -0
- package/backend/src/core/secrets/encryption.ts +58 -0
- package/backend/src/core/secrets/secrets.ts +410 -0
- package/backend/src/core/socket/socket.ts +388 -0
- package/backend/src/core/socket/types.ts +79 -0
- package/backend/src/core/storage/storage.ts +923 -0
- package/backend/src/server.ts +288 -0
- package/backend/src/types/ai.ts +46 -0
- package/backend/src/types/auth.ts +90 -0
- package/backend/src/types/database.ts +136 -0
- package/backend/src/types/error-constants.ts +86 -0
- package/backend/src/types/logs.ts +47 -0
- package/backend/src/types/profile.ts +55 -0
- package/backend/src/types/storage.ts +23 -0
- package/backend/src/utils/cloud-token.ts +39 -0
- package/backend/src/utils/constants.ts +1 -0
- package/backend/src/utils/environment.ts +35 -0
- package/backend/src/utils/helpers.ts +49 -0
- package/backend/src/utils/logger.ts +13 -0
- package/backend/src/utils/response.ts +62 -0
- package/backend/src/utils/seed.ts +205 -0
- package/backend/src/utils/sql-parser.ts +63 -0
- package/backend/src/utils/uuid.ts +9 -0
- package/backend/src/utils/validations.ts +129 -0
- package/backend/tests/README.md +134 -0
- package/backend/tests/cleanup-all-test-data.sh +231 -0
- package/backend/tests/cloud/test-s3-multitenant.sh +132 -0
- package/backend/tests/local/comprehensive-curl-tests.sh +156 -0
- package/backend/tests/local/test-auth-router.sh +144 -0
- package/backend/tests/local/test-database-router.sh +222 -0
- package/backend/tests/local/test-e2e.sh +241 -0
- package/backend/tests/local/test-fk-errors.sh +97 -0
- package/backend/tests/local/test-id-field.sh +201 -0
- package/backend/tests/local/test-public-bucket.sh +265 -0
- package/backend/tests/local/test-secrets.sh +248 -0
- package/backend/tests/local/test-serverless-functions.sh.disabled +325 -0
- package/backend/tests/local/test-traditional-rest.sh +209 -0
- package/backend/tests/manual/README.md +51 -0
- package/backend/tests/manual/create-large-table-simple.sql +11 -0
- package/backend/tests/manual/seed-large-table.sql +101 -0
- package/backend/tests/manual/setup-large-table-extras.sql +34 -0
- package/backend/tests/manual/test-better-auth.sh +303 -0
- package/backend/tests/manual/test-bulk-upsert.sh +410 -0
- package/backend/tests/manual/test-database-advance.sh +297 -0
- package/backend/tests/manual/test-postgrest-stability.sh +192 -0
- package/backend/tests/manual/test-rawsql-export-import.sh +412 -0
- package/backend/tests/manual/test-universal-storage.sh +264 -0
- package/backend/tests/manual/test-users.sql +18 -0
- package/backend/tests/run-all-tests.sh +140 -0
- package/backend/tests/setup.ts +22 -0
- package/backend/tests/test-config.sh +303 -0
- package/backend/tsconfig.json +23 -0
- package/backend/tsup.config.ts +18 -0
- package/backend/vitest.config.ts +22 -0
- package/docker-compose.prod.yml +145 -0
- package/docker-compose.yml +167 -0
- package/docker-init/db/db-init.sql +125 -0
- package/docker-init/db/jwt.sql +5 -0
- package/docker-init/db/logs.sql +9 -0
- package/docker-init/db/postgresql.conf +17 -0
- package/docs/deprecated/insforge-auth-api.md +215 -0
- package/docs/deprecated/insforge-auth-sdk.md +100 -0
- package/docs/deprecated/insforge-db-api.md +359 -0
- package/docs/deprecated/insforge-db-sdk.md +140 -0
- package/docs/deprecated/insforge-debug-sdk.md +157 -0
- package/docs/deprecated/insforge-debug.md +65 -0
- package/docs/deprecated/insforge-instructions.md +124 -0
- package/docs/deprecated/insforge-project.md +118 -0
- package/docs/deprecated/insforge-storage-api.md +279 -0
- package/docs/deprecated/insforge-storage-sdk.md +159 -0
- package/docs/insforge-instructions-sdk.md +407 -0
- package/eslint.config.js +317 -0
- package/examples/oauth/frontend-oauth-example.html +251 -0
- package/examples/response-examples.md +444 -0
- package/frontend/README.md +112 -0
- package/frontend/components.json +17 -0
- package/frontend/index.html +13 -0
- package/frontend/package.json +63 -0
- package/frontend/public/favicon.ico +0 -0
- package/frontend/src/App.tsx +106 -0
- package/frontend/src/assets/icons/checkbox_checked.svg +6 -0
- package/frontend/src/assets/icons/checkbox_undetermined.svg +6 -0
- package/frontend/src/assets/icons/checked.svg +3 -0
- package/frontend/src/assets/icons/error.svg +3 -0
- package/frontend/src/assets/icons/pencil.svg +4 -0
- package/frontend/src/assets/icons/refresh.svg +4 -0
- package/frontend/src/assets/icons/step_active.svg +3 -0
- package/frontend/src/assets/icons/step_inactive.svg +11 -0
- package/frontend/src/assets/icons/warning.svg +3 -0
- package/frontend/src/assets/logos/amazon.svg +1 -0
- package/frontend/src/assets/logos/claude_code.svg +3 -0
- package/frontend/src/assets/logos/cline.svg +6 -0
- package/frontend/src/assets/logos/cursor.svg +20 -0
- package/frontend/src/assets/logos/discord.svg +9 -0
- package/frontend/src/assets/logos/gemini.svg +19 -0
- package/frontend/src/assets/logos/github.svg +5 -0
- package/frontend/src/assets/logos/google.svg +13 -0
- package/frontend/src/assets/logos/grok.svg +10 -0
- package/frontend/src/assets/logos/insforge_dark.svg +15 -0
- package/frontend/src/assets/logos/insforge_light.svg +15 -0
- package/frontend/src/assets/logos/openai.svg +10 -0
- package/frontend/src/assets/logos/roo_code.svg +9 -0
- package/frontend/src/assets/logos/trae.svg +3 -0
- package/frontend/src/assets/logos/windsurf.svg +10 -0
- package/frontend/src/components/ButtonWithLoading.tsx +27 -0
- package/frontend/src/components/Checkbox.tsx +61 -0
- package/frontend/src/components/CodeBlock.tsx +32 -0
- package/frontend/src/components/ConfirmDialog.tsx +96 -0
- package/frontend/src/components/CopyButton.tsx +69 -0
- package/frontend/src/components/DeleteActionButton.tsx +42 -0
- package/frontend/src/components/EmptyState.tsx +41 -0
- package/frontend/src/components/ErrorState.tsx +35 -0
- package/frontend/src/components/FeatureSidebar.tsx +126 -0
- package/frontend/src/components/FeatureSidebarItem.tsx +101 -0
- package/frontend/src/components/JsonHighlight.tsx +61 -0
- package/frontend/src/components/LoadingState.tsx +16 -0
- package/frontend/src/components/PaginationControls.tsx +54 -0
- package/frontend/src/components/PromptDialog.tsx +68 -0
- package/frontend/src/components/SearchInput.tsx +90 -0
- package/frontend/src/components/SelectionClearButton.tsx +26 -0
- package/frontend/src/components/Stepper.tsx +139 -0
- package/frontend/src/components/ThemeToggle.tsx +58 -0
- package/frontend/src/components/TypeBadge.tsx +20 -0
- package/frontend/src/components/datagrid/DataGrid.tsx +264 -0
- package/frontend/src/components/datagrid/DefaultCellRenderer.tsx +114 -0
- package/frontend/src/components/datagrid/IdCell.tsx +44 -0
- package/frontend/src/components/datagrid/SortableHeader.tsx +74 -0
- package/frontend/src/components/datagrid/cell-editors/BooleanCellEditor.tsx +54 -0
- package/frontend/src/components/datagrid/cell-editors/DateCellEditor.tsx +483 -0
- package/frontend/src/components/datagrid/cell-editors/JsonCellEditor.tsx +362 -0
- package/frontend/src/components/datagrid/cell-editors/TextCellEditor.tsx +38 -0
- package/frontend/src/components/datagrid/cell-editors/index.ts +14 -0
- package/frontend/src/components/datagrid/cell-editors/types.ts +43 -0
- package/frontend/src/components/datagrid/datagridTypes.tsx +72 -0
- package/frontend/src/components/datagrid/index.tsx +20 -0
- package/frontend/src/components/index.ts +39 -0
- package/frontend/src/components/layout/AppHeader.tsx +146 -0
- package/frontend/src/components/layout/AppSidebar.tsx +190 -0
- package/frontend/src/components/layout/CloudLayout.tsx +95 -0
- package/frontend/src/components/layout/Layout.tsx +43 -0
- package/frontend/src/components/radix/Alert.tsx +45 -0
- package/frontend/src/components/radix/AlertDialog.tsx +115 -0
- package/frontend/src/components/radix/Avatar.tsx +45 -0
- package/frontend/src/components/radix/Badge.tsx +33 -0
- package/frontend/src/components/radix/Button.tsx +50 -0
- package/frontend/src/components/radix/Card.tsx +58 -0
- package/frontend/src/components/radix/Dialog.tsx +98 -0
- package/frontend/src/components/radix/DropdownMenu.tsx +185 -0
- package/frontend/src/components/radix/Form.tsx +167 -0
- package/frontend/src/components/radix/Input.tsx +22 -0
- package/frontend/src/components/radix/Label.tsx +19 -0
- package/frontend/src/components/radix/Popover.tsx +29 -0
- package/frontend/src/components/radix/ScrollArea.tsx +44 -0
- package/frontend/src/components/radix/Select.tsx +151 -0
- package/frontend/src/components/radix/Separator.tsx +26 -0
- package/frontend/src/components/radix/Sheet.tsx +119 -0
- package/frontend/src/components/radix/Skeleton.tsx +7 -0
- package/frontend/src/components/radix/Switch.tsx +29 -0
- package/frontend/src/components/radix/Tabs.tsx +50 -0
- package/frontend/src/components/radix/Textarea.tsx +21 -0
- package/frontend/src/components/radix/Tooltip.tsx +28 -0
- package/frontend/src/features/ai/components/AIConfigCard.tsx +154 -0
- package/frontend/src/features/ai/components/AIConfigDialog.tsx +76 -0
- package/frontend/src/features/ai/components/AIConfigForm.tsx +222 -0
- package/frontend/src/features/ai/components/AIEmptyState.tsx +18 -0
- package/frontend/src/features/ai/components/fields/ModalityField.tsx +87 -0
- package/frontend/src/features/ai/components/fields/ModelSelectionField.tsx +134 -0
- package/frontend/src/features/ai/components/fields/SystemPromptField.tsx +33 -0
- package/frontend/src/features/ai/helpers.ts +155 -0
- package/frontend/src/features/ai/hooks/useAIConfigs.ts +221 -0
- package/frontend/src/features/ai/hooks/useAIUsage.ts +77 -0
- package/frontend/src/features/ai/page/AIPage.tsx +178 -0
- package/frontend/src/features/ai/services/ai.service.ts +148 -0
- package/frontend/src/features/auth/components/AddOAuthDialog.tsx +106 -0
- package/frontend/src/features/auth/components/AuthMethodTab.tsx +238 -0
- package/frontend/src/features/auth/components/OAuthConfigDialog.tsx +303 -0
- package/frontend/src/features/auth/components/OAuthEmptyState.tsx +15 -0
- package/frontend/src/features/auth/components/UserFormDialog.tsx +248 -0
- package/frontend/src/features/auth/components/UsersDataGrid.tsx +183 -0
- package/frontend/src/features/auth/components/UsersTab.tsx +114 -0
- package/frontend/src/features/auth/hooks/useOAuthConfig.ts +129 -0
- package/frontend/src/features/auth/hooks/useUsers.ts +57 -0
- package/frontend/src/features/auth/index.ts +9 -0
- package/frontend/src/features/auth/page/AuthenticationPage.tsx +169 -0
- package/frontend/src/features/auth/services/auth.service.ts +112 -0
- package/frontend/src/features/auth/services/oauth.service.ts +49 -0
- package/frontend/src/features/dashboard/page/DashboardPage.tsx +194 -0
- package/frontend/src/features/database/components/ColumnTypeSelect.tsx +64 -0
- package/frontend/src/features/database/components/DatabaseDataGrid.tsx +282 -0
- package/frontend/src/features/database/components/ForeignKeyCell.tsx +187 -0
- package/frontend/src/features/database/components/ForeignKeyPopover.tsx +378 -0
- package/frontend/src/features/database/components/LinkRecordModal.tsx +288 -0
- package/frontend/src/features/database/components/RecordFormDialog.tsx +164 -0
- package/frontend/src/features/database/components/RecordFormField.tsx +568 -0
- package/frontend/src/features/database/components/TableEmptyState.tsx +21 -0
- package/frontend/src/features/database/components/TableForm.tsx +656 -0
- package/frontend/src/features/database/components/TableFormColumn.tsx +137 -0
- package/frontend/src/features/database/components/TableListSkeleton.tsx +9 -0
- package/frontend/src/features/database/components/TableSidebar.tsx +47 -0
- package/frontend/src/features/database/constants.ts +26 -0
- package/frontend/src/features/database/helpers.ts +125 -0
- package/frontend/src/features/database/hooks/UseLinkModal.tsx +78 -0
- package/frontend/src/features/database/index.ts +12 -0
- package/frontend/src/features/database/page/DatabasePage.tsx +626 -0
- package/frontend/src/features/database/schema.ts +25 -0
- package/frontend/src/features/database/services/database.service.ts +216 -0
- package/frontend/src/features/functions/components/FunctionEmptyState.tsx +15 -0
- package/frontend/src/features/functions/components/FunctionRow.tsx +71 -0
- package/frontend/src/features/functions/components/FunctionViewer.tsx +46 -0
- package/frontend/src/features/functions/components/FunctionsContent.tsx +88 -0
- package/frontend/src/features/functions/components/FunctionsSidebar.tsx +56 -0
- package/frontend/src/features/functions/components/SecretEmptyState.tsx +23 -0
- package/frontend/src/features/functions/components/SecretRow.tsx +68 -0
- package/frontend/src/features/functions/components/SecretsContent.tsx +120 -0
- package/frontend/src/features/functions/hooks/useFunctions.ts +106 -0
- package/frontend/src/features/functions/page/FunctionsPage.tsx +28 -0
- package/frontend/src/features/functions/services/functions.service.ts +48 -0
- package/frontend/src/features/login/components/AuthErrorBoundary.tsx +87 -0
- package/frontend/src/features/login/components/PrivateRoute.tsx +24 -0
- package/frontend/src/features/login/page/CloudLoginPage.tsx +93 -0
- package/frontend/src/features/login/page/LoginPage.tsx +174 -0
- package/frontend/src/features/logs/components/AnalyticsLogsTable.tsx +313 -0
- package/frontend/src/features/logs/components/LogsTable.tsx +199 -0
- package/frontend/src/features/logs/hooks/useAuditLogs.ts +39 -0
- package/frontend/src/features/logs/index.ts +5 -0
- package/frontend/src/features/logs/page/AnalyticsLogsPage.tsx +530 -0
- package/frontend/src/features/logs/page/AuditsPage.tsx +192 -0
- package/frontend/src/features/logs/services/log.service.ts +171 -0
- package/frontend/src/features/metadata/hooks/useMetadata.ts +53 -0
- package/frontend/src/features/metadata/index.ts +0 -0
- package/frontend/src/features/metadata/page/MetadataPage.tsx +136 -0
- package/frontend/src/features/metadata/services/metadata.service.ts +17 -0
- package/frontend/src/features/onboard/components/CompletionCard.tsx +41 -0
- package/frontend/src/features/onboard/components/OnboardButton.tsx +84 -0
- package/frontend/src/features/onboard/components/StepContent.tsx +91 -0
- package/frontend/src/features/onboard/components/TestConnectionStep.tsx +53 -0
- package/frontend/src/features/onboard/components/mcp/CursorDeeplinkGenerator.tsx +35 -0
- package/frontend/src/features/onboard/components/mcp/McpInstallation.tsx +144 -0
- package/frontend/src/features/onboard/components/mcp/index.ts +4 -0
- package/frontend/src/features/onboard/components/mcp/mcp-helper.tsx +98 -0
- package/frontend/src/features/onboard/index.ts +3 -0
- package/frontend/src/features/onboard/page/OnBoardPage.tsx +104 -0
- package/frontend/src/features/onboard/types.ts +8 -0
- package/frontend/src/features/secrets/hooks/useSecrets.ts +139 -0
- package/frontend/src/features/secrets/services/secrets.service.ts +57 -0
- package/frontend/src/features/storage/components/BucketEmptyState.tsx +19 -0
- package/frontend/src/features/storage/components/BucketFormDialog.tsx +194 -0
- package/frontend/src/features/storage/components/BucketListSkeleton.tsx +17 -0
- package/frontend/src/features/storage/components/FilePreviewDialog.tsx +287 -0
- package/frontend/src/features/storage/components/StorageDataGrid.tsx +239 -0
- package/frontend/src/features/storage/components/StorageManager.tsx +236 -0
- package/frontend/src/features/storage/components/StorageSidebar.tsx +44 -0
- package/frontend/src/features/storage/components/UploadToast.tsx +46 -0
- package/frontend/src/features/storage/index.ts +3 -0
- package/frontend/src/features/storage/page/StoragePage.tsx +553 -0
- package/frontend/src/features/storage/services/storage.service.ts +144 -0
- package/frontend/src/features/visualizer/components/AuthNode.tsx +107 -0
- package/frontend/src/features/visualizer/components/BucketNode.tsx +34 -0
- package/frontend/src/features/visualizer/components/SchemaVisualizer.tsx +359 -0
- package/frontend/src/features/visualizer/components/TableNode.tsx +152 -0
- package/frontend/src/features/visualizer/components/VisualizerSkeleton.tsx +24 -0
- package/frontend/src/features/visualizer/components/index.ts +5 -0
- package/frontend/src/features/visualizer/page/VisualizerPage.tsx +127 -0
- package/frontend/src/index.css +248 -0
- package/frontend/src/lib/api/client.ts +163 -0
- package/frontend/src/lib/contexts/AuthContext.tsx +157 -0
- package/frontend/src/lib/contexts/OnboardStepContext.tsx +68 -0
- package/frontend/src/lib/contexts/SocketContext.tsx +303 -0
- package/frontend/src/lib/contexts/ThemeContext.tsx +125 -0
- package/frontend/src/lib/hooks/useAuth.ts +4 -0
- package/frontend/src/lib/hooks/useConfirm.ts +55 -0
- package/frontend/src/lib/hooks/useInterval.ts +27 -0
- package/frontend/src/lib/hooks/useMediaQuery.ts +59 -0
- package/frontend/src/lib/hooks/useOnboardingCompletion.ts +29 -0
- package/frontend/src/lib/hooks/usePagination.ts +27 -0
- package/frontend/src/lib/hooks/useTimeout.ts +27 -0
- package/frontend/src/lib/hooks/useToast.tsx +229 -0
- package/frontend/src/lib/utils/constants.ts +38 -0
- package/frontend/src/lib/utils/utils.ts +165 -0
- package/frontend/src/lib/utils/validation-schemas.ts +126 -0
- package/frontend/src/main.tsx +16 -0
- package/frontend/src/rdg.css +194 -0
- package/frontend/src/vite-env.d.ts +12 -0
- package/frontend/tailwind.config.js +97 -0
- package/frontend/tsconfig.json +26 -0
- package/frontend/tsconfig.node.json +10 -0
- package/frontend/vite.config.ts +37 -0
- package/frontend/vitest.config.ts +36 -0
- package/functions/deno.json +25 -0
- package/functions/server.ts +290 -0
- package/functions/worker-template.js +126 -0
- package/openapi/ai.yaml +689 -0
- package/openapi/auth.yaml +563 -0
- package/openapi/functions.yaml +476 -0
- package/openapi/health.yaml +30 -0
- package/openapi/logs.yaml +224 -0
- package/openapi/metadata.yaml +178 -0
- package/openapi/records.yaml +382 -0
- package/openapi/secrets.yaml +371 -0
- package/openapi/storage.yaml +876 -0
- package/openapi/tables.yaml +464 -0
- package/package.json +88 -0
- package/shared-schemas/package.json +31 -0
- package/shared-schemas/src/ai-api.schema.ts +167 -0
- package/shared-schemas/src/ai.schema.ts +54 -0
- package/shared-schemas/src/auth-api.schema.ts +193 -0
- package/shared-schemas/src/auth.schema.ts +94 -0
- package/shared-schemas/src/database-api.schema.ts +259 -0
- package/shared-schemas/src/database.schema.ts +69 -0
- package/shared-schemas/src/functions-api.schema.ts +25 -0
- package/shared-schemas/src/functions.schema.ts +16 -0
- package/shared-schemas/src/index.ts +13 -0
- package/shared-schemas/src/logs-api.schema.ts +49 -0
- package/shared-schemas/src/logs.schema.ts +14 -0
- package/shared-schemas/src/metadata.schema.ts +56 -0
- package/shared-schemas/src/storage-api.schema.ts +65 -0
- package/shared-schemas/src/storage.schema.ts +19 -0
- package/shared-schemas/tsconfig.json +21 -0
- package/tsconfig.json +8 -0
package/.prettierignore
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules/
|
|
3
|
+
**/node_modules/
|
|
4
|
+
|
|
5
|
+
# Build outputs
|
|
6
|
+
dist/
|
|
7
|
+
**/dist/
|
|
8
|
+
build/
|
|
9
|
+
**/build/
|
|
10
|
+
.next/
|
|
11
|
+
**/.next/
|
|
12
|
+
|
|
13
|
+
# Coverage
|
|
14
|
+
coverage/
|
|
15
|
+
**/coverage/
|
|
16
|
+
|
|
17
|
+
# Turbo
|
|
18
|
+
.turbo/
|
|
19
|
+
**/.turbo/
|
|
20
|
+
|
|
21
|
+
# Public assets
|
|
22
|
+
public/
|
|
23
|
+
**/public/
|
|
24
|
+
|
|
25
|
+
# Lock files
|
|
26
|
+
package-lock.json
|
|
27
|
+
**/package-lock.json
|
|
28
|
+
yarn.lock
|
|
29
|
+
**/yarn.lock
|
|
30
|
+
pnpm-lock.yaml
|
|
31
|
+
**/pnpm-lock.yaml
|
|
32
|
+
|
|
33
|
+
# Generated files
|
|
34
|
+
*.min.js
|
|
35
|
+
*.min.css
|
|
36
|
+
|
|
37
|
+
# Logs
|
|
38
|
+
*.log
|
|
39
|
+
|
|
40
|
+
# IDE
|
|
41
|
+
.vscode/
|
|
42
|
+
.idea/
|
|
43
|
+
|
|
44
|
+
# OS
|
|
45
|
+
.DS_Store
|
|
46
|
+
Thumbs.db
|
|
47
|
+
|
|
48
|
+
# Environment
|
|
49
|
+
.env
|
|
50
|
+
.env.*
|
|
51
|
+
|
|
52
|
+
# Git
|
|
53
|
+
.git/
|
|
54
|
+
.gitignore
|
|
55
|
+
|
|
56
|
+
# File types to ignore
|
|
57
|
+
*.md
|
|
58
|
+
*.yaml
|
|
59
|
+
*.yml
|
|
60
|
+
*.json
|
|
61
|
+
|
|
62
|
+
# Folders to ignore
|
|
63
|
+
docs/
|
|
64
|
+
examples/
|
|
65
|
+
openapi/
|
package/.prettierrc
ADDED
package/CHANGELOG.md
ADDED
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# Contributing to InsForge
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to InsForge. This guide will help you get started with the contribution process.
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
- [Code of Conduct](#code-of-conduct)
|
|
7
|
+
- [Project Structure](#project-structure)
|
|
8
|
+
- [Prerequisites](#prerequisites)
|
|
9
|
+
- [Getting Started](#getting-started)
|
|
10
|
+
- [Development Workflow](#development-workflow)
|
|
11
|
+
- [Testing](#testing)
|
|
12
|
+
- [Pull Request Process](#pull-request-process)
|
|
13
|
+
- [Code Style](#code-style)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
|
|
18
|
+
|
|
19
|
+
## Project Structure
|
|
20
|
+
|
|
21
|
+
The InsForge monorepo is organized as follows:
|
|
22
|
+
|
|
23
|
+
- `/backend` - Core backend service with Express.js, PostgreSQL, and Better Auth integration
|
|
24
|
+
- `/frontend` - React-based admin dashboard for managing databases, users, and storage
|
|
25
|
+
- `/shared-schemas` - Zod schemas and TypeScript types shared between frontend and backend
|
|
26
|
+
- `/docs` - MCP documemtation
|
|
27
|
+
- `/functions` - Serverless edge functions for custom business logic
|
|
28
|
+
- `docker-compose.yml` - Docker config file to start the project
|
|
29
|
+
|
|
30
|
+
## Prerequisites
|
|
31
|
+
|
|
32
|
+
Before you start development, ensure you have the following:
|
|
33
|
+
- [Docker](https://www.docker.com/get-started)
|
|
34
|
+
- [Node.js](https://nodejs.org/) (LTS version recommended)
|
|
35
|
+
|
|
36
|
+
## Getting Started
|
|
37
|
+
|
|
38
|
+
1. Fork the repository to your GitHub account
|
|
39
|
+
2. Clone your fork locally:
|
|
40
|
+
```bash
|
|
41
|
+
git clone https://github.com/insforge/insforge.git
|
|
42
|
+
cd insforge
|
|
43
|
+
```
|
|
44
|
+
3. Install Docker
|
|
45
|
+
4. Open Docker App
|
|
46
|
+
5. Install Node.js (LTS version recommended)
|
|
47
|
+
6. Create a .env file from the example:
|
|
48
|
+
|
|
49
|
+
On Unix-based systems:
|
|
50
|
+
```bash
|
|
51
|
+
cp .env.example .env
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
On Windows:
|
|
55
|
+
```bash
|
|
56
|
+
copy .env.example .env
|
|
57
|
+
```
|
|
58
|
+
7. Run the project
|
|
59
|
+
```bash
|
|
60
|
+
docker compose up
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Development Workflow
|
|
64
|
+
|
|
65
|
+
1. Create a new branch for your changes:
|
|
66
|
+
```bash
|
|
67
|
+
git checkout -b type/description
|
|
68
|
+
# Example: git checkout -b feat/site-deployment
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Branch type prefixes:
|
|
72
|
+
- `feat/` - New features
|
|
73
|
+
- `fix/` - Bug fixes
|
|
74
|
+
- `docs/` - Documentation changes
|
|
75
|
+
- `refactor/` - Code refactoring
|
|
76
|
+
- `test/` - Test-related changes
|
|
77
|
+
- `chore/` - Build process or tooling changes
|
|
78
|
+
|
|
79
|
+
2. Make your changes following the code style guidelines
|
|
80
|
+
3. Add tests for your changes (see test README for guidelines)
|
|
81
|
+
4. Run the test suite:
|
|
82
|
+
```bash
|
|
83
|
+
npm test:e2e
|
|
84
|
+
```
|
|
85
|
+
5. Run linter:
|
|
86
|
+
```bash
|
|
87
|
+
npm run lint
|
|
88
|
+
```
|
|
89
|
+
6. Ensure all tests pass and the code is properly formatted
|
|
90
|
+
7. Commit your changes with a descriptive message following the Conventional Commits format:
|
|
91
|
+
```
|
|
92
|
+
type(scope): description
|
|
93
|
+
|
|
94
|
+
[optional body]
|
|
95
|
+
[optional screenshots / videos]
|
|
96
|
+
[optional footer(s)]
|
|
97
|
+
```
|
|
98
|
+
8. Push your branch to your fork
|
|
99
|
+
9. Open a pull request against the main branch
|
|
100
|
+
|
|
101
|
+
## Testing
|
|
102
|
+
|
|
103
|
+
All contributions must include appropriate tests. Follow these guidelines:
|
|
104
|
+
- Write unit tests for new features
|
|
105
|
+
- Ensure all tests pass before submitting a pull request
|
|
106
|
+
- Update existing tests if your changes affect their behavior
|
|
107
|
+
- Follow the existing test patterns and structure
|
|
108
|
+
- Test across different environments when applicable
|
|
109
|
+
|
|
110
|
+
## Pull Request Process
|
|
111
|
+
|
|
112
|
+
1. Create a draft pull request early to facilitate discussion
|
|
113
|
+
2. Reference any related issues in your PR description (e.g., 'Closes #123')
|
|
114
|
+
3. Ensure all tests pass and the build is successful
|
|
115
|
+
4. Update documentation as needed
|
|
116
|
+
5. Keep your PR focused on a single feature or bug fix
|
|
117
|
+
6. Be responsive to code review feedback
|
|
118
|
+
|
|
119
|
+
## Code Style
|
|
120
|
+
|
|
121
|
+
- Follow the existing code style
|
|
122
|
+
- Use TypeScript types and interfaces effectively
|
|
123
|
+
- Keep functions small and focused
|
|
124
|
+
- Use meaningful variable and function names
|
|
125
|
+
- Add comments for complex logic
|
|
126
|
+
- Update relevant documentation when making API changes
|
package/Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
FROM node:20-alpine
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
|
|
5
|
+
# Copy only package.json files (not lock files) to avoid platform issues
|
|
6
|
+
COPY package.json ./
|
|
7
|
+
COPY backend/package.json ./backend/
|
|
8
|
+
COPY frontend/package.json ./frontend/
|
|
9
|
+
COPY shared-schemas/package.json ./shared-schemas/
|
|
10
|
+
|
|
11
|
+
# Install all dependencies - will generate Linux-compatible lock file
|
|
12
|
+
RUN npm install && npm cache clean --force && rm -rf /tmp/*
|
|
13
|
+
|
|
14
|
+
# Copy source code
|
|
15
|
+
COPY . .
|
|
16
|
+
|
|
17
|
+
# Build arguments for Vite environment variables
|
|
18
|
+
ARG VITE_API_BASE_URL
|
|
19
|
+
|
|
20
|
+
# Build frontend with the API URL baked in
|
|
21
|
+
RUN npm run build
|
|
22
|
+
|
|
23
|
+
# Expose ports
|
|
24
|
+
EXPOSE 7130 7131
|
|
25
|
+
|
|
26
|
+
# Run migrations and start the backend application
|
|
27
|
+
CMD sh -c "cd backend && npm run migrate:up && cd .. && npm start"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# GitHub OAuth Application Setup Guide
|
|
2
|
+
|
|
3
|
+
This document will guide you through the steps to create and configure a GitHub OAuth application for using GitHub login functionality in your project.
|
|
4
|
+
|
|
5
|
+
## Step 1: Create a GitHub OAuth Application
|
|
6
|
+
|
|
7
|
+
1. **Log in to your GitHub account**.
|
|
8
|
+
2. Navigate to your developer settings page:
|
|
9
|
+
* Click on your profile avatar in the top right corner.
|
|
10
|
+
* Select **Settings**.
|
|
11
|
+
* In the left sidebar, select **Developer settings**.
|
|
12
|
+
3. On the Developer settings page, select **OAuth Apps**, then click the **New OAuth App** button.
|
|
13
|
+
|
|
14
|
+
## Step 2: Fill in Application Information
|
|
15
|
+
|
|
16
|
+
On the "Register a new OAuth application" page, you need to fill in the following information:
|
|
17
|
+
|
|
18
|
+
* **Application name**: Give your application a descriptive name, such as `Insforge Dev Login`.
|
|
19
|
+
* **Homepage URL**: Your application's homepage URL. In development environment, you can set it to `http://localhost:7130` or your frontend development server address.
|
|
20
|
+
* **Application description** (optional): Provide a brief description of your application.
|
|
21
|
+
* **Authorization callback URL**: This is the URL where GitHub will redirect users after authorization. For local development, make sure to set it to:
|
|
22
|
+
```
|
|
23
|
+
http://localhost:7130/api/auth/oauth/github/callback
|
|
24
|
+
```
|
|
25
|
+
**Note**: This URL must exactly match the callback URL configured in your backend service, otherwise the OAuth flow will fail.
|
|
26
|
+
|
|
27
|
+
After filling in the information, click **Register application**.
|
|
28
|
+
|
|
29
|
+
## Step 3: Get Client ID and Client Secret
|
|
30
|
+
|
|
31
|
+
After creating the application, you will be redirected to the application's settings page. Here you can see the **Client ID**.
|
|
32
|
+
|
|
33
|
+
To get the **Client Secret**, click the **Generate a new client secret** button. GitHub will generate a secret and display it to you.
|
|
34
|
+
|
|
35
|
+
**Important**: The Client Secret will only be shown once. Please copy it immediately and keep it secure. If you lose it, you will need to generate a new one.
|
|
36
|
+
|
|
37
|
+
## Step 4: Configure Environment Variables
|
|
38
|
+
|
|
39
|
+
After obtaining the Client ID and Client Secret, you need to add them to your project's `.env` file. Make sure your `.env` file (or corresponding environment configuration file) contains the following two lines:
|
|
40
|
+
|
|
41
|
+
```env
|
|
42
|
+
GITHUB_CLIENT_ID=YOUR_GITHUB_CLIENT_ID
|
|
43
|
+
GITHUB_CLIENT_SECRET=YOUR_GITHUB_CLIENT_SECRET
|
|
44
|
+
GITHUB_REDIRECT_URI=http://localhost:7130/api/auth/oauth/github/callback
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Replace `YOUR_GITHUB_CLIENT_ID` and `YOUR_GITHUB_CLIENT_SECRET` with the actual values you obtained in the previous step.
|
|
48
|
+
|
|
49
|
+
After completing the above steps, your application is ready to use GitHub OAuth for user authentication.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Google OAuth Login Setup Guide
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This project has integrated Google OAuth login functionality, supporting user authentication through Google accounts.
|
|
6
|
+
|
|
7
|
+
## Environment Variable Configuration
|
|
8
|
+
|
|
9
|
+
Add the following configuration to your `.env` file:
|
|
10
|
+
|
|
11
|
+
```env
|
|
12
|
+
# Google OAuth Configuration
|
|
13
|
+
GOOGLE_CLIENT_ID=your_google_client_id
|
|
14
|
+
GOOGLE_CLIENT_SECRET=your_google_client_secret
|
|
15
|
+
GOOGLE_REDIRECT_URI=http://localhost:7130/api/oauth/google/callback
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Google Cloud Console Setup
|
|
19
|
+
|
|
20
|
+
1. Visit [Google Cloud Console](https://console.cloud.google.com/)
|
|
21
|
+
2. Create a new project or select an existing project
|
|
22
|
+
3. Enable Google+ API and Google Identity API
|
|
23
|
+
4. Create an OAuth 2.0 Client ID in the "Credentials" page
|
|
24
|
+
5. Configure authorized redirect URIs:
|
|
25
|
+
- Development environment: `http://localhost:7130/api/auth/oauth/google/callback`
|
|
26
|
+
- Production environment: `https://yourdomain.com/api/auth/oauth/google/callback`
|
|
27
|
+
|
|
28
|
+
## API Endpoints
|
|
29
|
+
|
|
30
|
+
### 1. Get Google OAuth Authorization URL
|
|
31
|
+
|
|
32
|
+
**Endpoint:** `GET /api/auth/v1/google-auth`
|
|
33
|
+
|
|
34
|
+
**Parameters:**
|
|
35
|
+
- `redirect_url`: Redirect URL after successful login
|
|
36
|
+
|
|
37
|
+
**Response:**
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"success": true,
|
|
41
|
+
"data": {
|
|
42
|
+
"auth_url": "https://accounts.google.com/oauth/authorize?..."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**Example:**
|
|
48
|
+
```bash
|
|
49
|
+
curl "http://localhost:7130/api/auth/v1/google-auth?redirect_url=http://localhost:7131/dashboard"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### 2. Google OAuth Callback Handling
|
|
53
|
+
|
|
54
|
+
**Endpoint:** `GET /api/auth/oauth/google/callback`
|
|
55
|
+
|
|
56
|
+
**Parameters:**
|
|
57
|
+
- `code`: Authorization code returned by Google
|
|
58
|
+
- `state`: State parameter (optional)
|
|
59
|
+
|
|
60
|
+
**Process:**
|
|
61
|
+
1. Receive Google authorization code
|
|
62
|
+
2. Exchange for access token and ID token
|
|
63
|
+
3. Verify ID token and retrieve user information
|
|
64
|
+
4. Find or create user record
|
|
65
|
+
5. Generate JWT token
|
|
66
|
+
6. Redirect to specified URL with token information
|
|
67
|
+
|
|
68
|
+
**Redirect URL Format:**
|
|
69
|
+
```
|
|
70
|
+
{redirect_url}?token={jwt_token}&user_id={user_id}&email={email}&name={name}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## User Flow
|
|
74
|
+
|
|
75
|
+
### New User Registration
|
|
76
|
+
1. User clicks "Sign in with Google"
|
|
77
|
+
2. Redirect to Google authorization page
|
|
78
|
+
3. After user authorization, system creates new user record:
|
|
79
|
+
- Create basic authentication record in `auth` table
|
|
80
|
+
- Create Google identity record in `identifies` table
|
|
81
|
+
- Create user profile record in `profiles` table
|
|
82
|
+
4. Return JWT token and user information
|
|
83
|
+
|
|
84
|
+
### Existing User Login
|
|
85
|
+
1. User clicks "Sign in with Google"
|
|
86
|
+
2. Redirect to Google authorization page
|
|
87
|
+
3. After user authorization, system:
|
|
88
|
+
- Searches for user in `identifies` table by `provider` and `provider_id`
|
|
89
|
+
- Updates `last_login_at` timestamp
|
|
90
|
+
4. Return JWT token and user information
|
|
91
|
+
|
|
92
|
+
### Email Association
|
|
93
|
+
- If user already exists but not associated with Google account, system will automatically associate
|
|
94
|
+
- If Google account is already associated with another user, an error will be returned
|
|
95
|
+
|
|
96
|
+
## Frontend Integration Example
|
|
97
|
+
|
|
98
|
+
```javascript
|
|
99
|
+
// 1. Get authorization URL
|
|
100
|
+
const response = await fetch('/api/auth/v1/google-auth?redirect_url=/dashboard');
|
|
101
|
+
const { auth_url } = await response.json();
|
|
102
|
+
|
|
103
|
+
// 2. Redirect to Google authorization page
|
|
104
|
+
window.location.href = auth_url;
|
|
105
|
+
|
|
106
|
+
// 3. Handle returned token in callback page
|
|
107
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
108
|
+
const token = urlParams.get('token');
|
|
109
|
+
const userId = urlParams.get('user_id');
|
|
110
|
+
|
|
111
|
+
if (token) {
|
|
112
|
+
// Store token
|
|
113
|
+
localStorage.setItem('auth_token', token);
|
|
114
|
+
// Navigate to main page
|
|
115
|
+
window.location.href = '/dashboard';
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Error Handling
|
|
120
|
+
|
|
121
|
+
Common error codes:
|
|
122
|
+
|
|
123
|
+
- `MISSING_FIELD`: Missing required parameters
|
|
124
|
+
- `INVALID_CREDENTIALS`: Google token verification failed
|
|
125
|
+
- `ALREADY_EXISTS`: User already exists
|
|
126
|
+
|
|
127
|
+
## Security Considerations
|
|
128
|
+
|
|
129
|
+
1. Ensure `GOOGLE_CLIENT_SECRET` environment variable is stored securely
|
|
130
|
+
2. Use HTTPS in production environment
|
|
131
|
+
3. Validate redirect URL legitimacy
|
|
132
|
+
4. Regularly rotate JWT keys
|
|
133
|
+
5. Monitor abnormal login activities
|
|
134
|
+
|
|
135
|
+
## Troubleshooting
|
|
136
|
+
|
|
137
|
+
1. **"Invalid redirect_uri" Error**
|
|
138
|
+
- Check redirect URI configuration in Google Cloud Console
|
|
139
|
+
- Ensure it matches the `GOOGLE_REDIRECT_URI` environment variable
|
|
140
|
+
|
|
141
|
+
2. **"Invalid client" Error**
|
|
142
|
+
- Verify `GOOGLE_CLIENT_ID` and `GOOGLE_CLIENT_SECRET` are correct
|
|
143
|
+
- Ensure necessary APIs are enabled in Google Cloud Console project
|
|
144
|
+
|
|
145
|
+
3. **"Token verification failed" Error**
|
|
146
|
+
- Check network connectivity
|
|
147
|
+
- Verify Google API service status
|
|
148
|
+
- Confirm client ID configuration is correct
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025 Insforge Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|