@l4yercak3/cli 1.3.1 → 2.0.0-alpha.0
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 +10 -220
- package/dist/api/client.d.ts +12 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +37 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/platform.d.ts +161 -0
- package/dist/api/platform.d.ts.map +1 -0
- package/dist/api/platform.js +70 -0
- package/dist/api/platform.js.map +1 -0
- package/dist/bin/sevenlayers.d.ts +3 -0
- package/dist/bin/sevenlayers.d.ts.map +1 -0
- package/dist/bin/sevenlayers.js +198 -0
- package/dist/bin/sevenlayers.js.map +1 -0
- package/dist/commands/agent/catalog.d.ts +5 -0
- package/dist/commands/agent/catalog.d.ts.map +1 -0
- package/dist/commands/agent/catalog.js +142 -0
- package/dist/commands/agent/catalog.js.map +1 -0
- package/dist/commands/agent/drift.d.ts +5 -0
- package/dist/commands/agent/drift.d.ts.map +1 -0
- package/dist/commands/agent/drift.js +113 -0
- package/dist/commands/agent/drift.js.map +1 -0
- package/dist/commands/agent/init.d.ts +5 -0
- package/dist/commands/agent/init.d.ts.map +1 -0
- package/dist/commands/agent/init.js +75 -0
- package/dist/commands/agent/init.js.map +1 -0
- package/dist/commands/agent/permissions.d.ts +5 -0
- package/dist/commands/agent/permissions.d.ts.map +1 -0
- package/dist/commands/agent/permissions.js +88 -0
- package/dist/commands/agent/permissions.js.map +1 -0
- package/dist/commands/agent/runner.d.ts +14 -0
- package/dist/commands/agent/runner.d.ts.map +1 -0
- package/dist/commands/agent/runner.js +59 -0
- package/dist/commands/agent/runner.js.map +1 -0
- package/dist/commands/agent/shared.d.ts +13 -0
- package/dist/commands/agent/shared.d.ts.map +1 -0
- package/dist/commands/agent/shared.js +31 -0
- package/dist/commands/agent/shared.js.map +1 -0
- package/dist/commands/agent/template.d.ts +5 -0
- package/dist/commands/agent/template.d.ts.map +1 -0
- package/dist/commands/agent/template.js +104 -0
- package/dist/commands/agent/template.js.map +1 -0
- package/dist/commands/app/connect.d.ts +7 -0
- package/dist/commands/app/connect.d.ts.map +1 -0
- package/dist/commands/app/connect.js +12 -0
- package/dist/commands/app/connect.js.map +1 -0
- package/dist/commands/app/init.d.ts +7 -0
- package/dist/commands/app/init.d.ts.map +1 -0
- package/dist/commands/app/init.js +12 -0
- package/dist/commands/app/init.js.map +1 -0
- package/dist/commands/app/link.d.ts +3 -0
- package/dist/commands/app/link.d.ts.map +1 -0
- package/dist/commands/app/link.js +92 -0
- package/dist/commands/app/link.js.map +1 -0
- package/dist/commands/app/pages.d.ts +15 -0
- package/dist/commands/app/pages.d.ts.map +1 -0
- package/dist/commands/app/pages.js +180 -0
- package/dist/commands/app/pages.js.map +1 -0
- package/dist/commands/app/register.d.ts +3 -0
- package/dist/commands/app/register.d.ts.map +1 -0
- package/dist/commands/app/register.js +120 -0
- package/dist/commands/app/register.js.map +1 -0
- package/dist/commands/app/remote.d.ts +14 -0
- package/dist/commands/app/remote.d.ts.map +1 -0
- package/dist/commands/app/remote.js +44 -0
- package/dist/commands/app/remote.js.map +1 -0
- package/dist/commands/app/setup.d.ts +3 -0
- package/dist/commands/app/setup.d.ts.map +1 -0
- package/dist/commands/app/setup.js +299 -0
- package/dist/commands/app/setup.js.map +1 -0
- package/dist/commands/app/shared.d.ts +9 -0
- package/dist/commands/app/shared.d.ts.map +1 -0
- package/dist/commands/app/shared.js +122 -0
- package/dist/commands/app/shared.js.map +1 -0
- package/dist/commands/app/sync.d.ts +7 -0
- package/dist/commands/app/sync.d.ts.map +1 -0
- package/dist/commands/app/sync.js +107 -0
- package/dist/commands/app/sync.js.map +1 -0
- package/dist/commands/booking/check.d.ts +3 -0
- package/dist/commands/booking/check.d.ts.map +1 -0
- package/dist/commands/booking/check.js +68 -0
- package/dist/commands/booking/check.js.map +1 -0
- package/dist/commands/booking/setup.d.ts +3 -0
- package/dist/commands/booking/setup.d.ts.map +1 -0
- package/dist/commands/booking/setup.js +95 -0
- package/dist/commands/booking/setup.js.map +1 -0
- package/dist/commands/booking/shared.d.ts +31 -0
- package/dist/commands/booking/shared.d.ts.map +1 -0
- package/dist/commands/booking/shared.js +112 -0
- package/dist/commands/booking/shared.js.map +1 -0
- package/dist/commands/booking/smoke.d.ts +3 -0
- package/dist/commands/booking/smoke.d.ts.map +1 -0
- package/dist/commands/booking/smoke.js +101 -0
- package/dist/commands/booking/smoke.js.map +1 -0
- package/dist/commands/cms/bind.d.ts +3 -0
- package/dist/commands/cms/bind.d.ts.map +1 -0
- package/dist/commands/cms/bind.js +212 -0
- package/dist/commands/cms/bind.js.map +1 -0
- package/dist/commands/cms/content.d.ts +40 -0
- package/dist/commands/cms/content.d.ts.map +1 -0
- package/dist/commands/cms/content.js +169 -0
- package/dist/commands/cms/content.js.map +1 -0
- package/dist/commands/cms/doctor.d.ts +3 -0
- package/dist/commands/cms/doctor.d.ts.map +1 -0
- package/dist/commands/cms/doctor.js +69 -0
- package/dist/commands/cms/doctor.js.map +1 -0
- package/dist/commands/cms/migrate.d.ts +3 -0
- package/dist/commands/cms/migrate.d.ts.map +1 -0
- package/dist/commands/cms/migrate.js +78 -0
- package/dist/commands/cms/migrate.js.map +1 -0
- package/dist/commands/cms/registry.d.ts +3 -0
- package/dist/commands/cms/registry.d.ts.map +1 -0
- package/dist/commands/cms/registry.js +161 -0
- package/dist/commands/cms/registry.js.map +1 -0
- package/dist/commands/cms/seed.d.ts +3 -0
- package/dist/commands/cms/seed.d.ts.map +1 -0
- package/dist/commands/cms/seed.js +102 -0
- package/dist/commands/cms/seed.js.map +1 -0
- package/dist/commands/cms/shared.d.ts +22 -0
- package/dist/commands/cms/shared.d.ts.map +1 -0
- package/dist/commands/cms/shared.js +82 -0
- package/dist/commands/cms/shared.js.map +1 -0
- package/dist/commands/doctor/target.d.ts +3 -0
- package/dist/commands/doctor/target.d.ts.map +1 -0
- package/dist/commands/doctor/target.js +46 -0
- package/dist/commands/doctor/target.js.map +1 -0
- package/dist/commands/env/list.d.ts +3 -0
- package/dist/commands/env/list.d.ts.map +1 -0
- package/dist/commands/env/list.js +28 -0
- package/dist/commands/env/list.js.map +1 -0
- package/dist/commands/env/set.d.ts +3 -0
- package/dist/commands/env/set.d.ts.map +1 -0
- package/dist/commands/env/set.js +36 -0
- package/dist/commands/env/set.js.map +1 -0
- package/dist/commands/env/use.d.ts +3 -0
- package/dist/commands/env/use.d.ts.map +1 -0
- package/dist/commands/env/use.js +15 -0
- package/dist/commands/env/use.js.map +1 -0
- package/dist/commands/legacy/connect.d.ts +3 -0
- package/dist/commands/legacy/connect.d.ts.map +1 -0
- package/dist/commands/legacy/connect.js +8 -0
- package/dist/commands/legacy/connect.js.map +1 -0
- package/dist/commands/legacy/pages.d.ts +3 -0
- package/dist/commands/legacy/pages.d.ts.map +1 -0
- package/dist/commands/legacy/pages.js +16 -0
- package/dist/commands/legacy/pages.js.map +1 -0
- package/dist/commands/legacy/spread.d.ts +3 -0
- package/dist/commands/legacy/spread.d.ts.map +1 -0
- package/dist/commands/legacy/spread.js +8 -0
- package/dist/commands/legacy/spread.js.map +1 -0
- package/dist/commands/legacy/sync.d.ts +3 -0
- package/dist/commands/legacy/sync.d.ts.map +1 -0
- package/dist/commands/legacy/sync.js +8 -0
- package/dist/commands/legacy/sync.js.map +1 -0
- package/dist/config/env-diff.d.ts +10 -0
- package/dist/config/env-diff.d.ts.map +1 -0
- package/dist/config/env-diff.js +24 -0
- package/dist/config/env-diff.js.map +1 -0
- package/dist/config/env-parser.d.ts +20 -0
- package/dist/config/env-parser.d.ts.map +1 -0
- package/dist/config/env-parser.js +70 -0
- package/dist/config/env-parser.js.map +1 -0
- package/dist/config/env-writer.d.ts +22 -0
- package/dist/config/env-writer.d.ts.map +1 -0
- package/dist/config/env-writer.js +172 -0
- package/dist/config/env-writer.js.map +1 -0
- package/dist/config/profile-store.d.ts +29 -0
- package/dist/config/profile-store.d.ts.map +1 -0
- package/dist/config/profile-store.js +257 -0
- package/dist/config/profile-store.js.map +1 -0
- package/dist/core/args.d.ts +11 -0
- package/dist/core/args.d.ts.map +1 -0
- package/dist/core/args.js +106 -0
- package/dist/core/args.js.map +1 -0
- package/dist/core/colors.d.ts +6 -0
- package/dist/core/colors.d.ts.map +1 -0
- package/dist/core/colors.js +29 -0
- package/dist/core/colors.js.map +1 -0
- package/dist/safety/target-guard.d.ts +16 -0
- package/dist/safety/target-guard.d.ts.map +1 -0
- package/dist/safety/target-guard.js +55 -0
- package/dist/safety/target-guard.js.map +1 -0
- package/dist/testing/booking-smoke.d.ts +17 -0
- package/dist/testing/booking-smoke.d.ts.map +1 -0
- package/dist/testing/booking-smoke.js +43 -0
- package/dist/testing/booking-smoke.js.map +1 -0
- package/dist/tests/agent-commands.test.d.ts +2 -0
- package/dist/tests/agent-commands.test.d.ts.map +1 -0
- package/dist/tests/agent-commands.test.js +180 -0
- package/dist/tests/agent-commands.test.js.map +1 -0
- package/dist/tests/agent-governance.test.d.ts +2 -0
- package/dist/tests/agent-governance.test.d.ts.map +1 -0
- package/dist/tests/agent-governance.test.js +233 -0
- package/dist/tests/agent-governance.test.js.map +1 -0
- package/dist/tests/app-commands.test.d.ts +2 -0
- package/dist/tests/app-commands.test.d.ts.map +1 -0
- package/dist/tests/app-commands.test.js +462 -0
- package/dist/tests/app-commands.test.js.map +1 -0
- package/dist/tests/booking-commands.test.d.ts +2 -0
- package/dist/tests/booking-commands.test.d.ts.map +1 -0
- package/dist/tests/booking-commands.test.js +204 -0
- package/dist/tests/booking-commands.test.js.map +1 -0
- package/dist/tests/booking-smoke.test.d.ts +2 -0
- package/dist/tests/booking-smoke.test.d.ts.map +1 -0
- package/dist/tests/booking-smoke.test.js +183 -0
- package/dist/tests/booking-smoke.test.js.map +1 -0
- package/dist/tests/cms-commands.test.d.ts +2 -0
- package/dist/tests/cms-commands.test.d.ts.map +1 -0
- package/dist/tests/cms-commands.test.js +254 -0
- package/dist/tests/cms-commands.test.js.map +1 -0
- package/dist/tests/cms-ops.test.d.ts +2 -0
- package/dist/tests/cms-ops.test.d.ts.map +1 -0
- package/dist/tests/cms-ops.test.js +125 -0
- package/dist/tests/cms-ops.test.js.map +1 -0
- package/dist/tests/env-writer.test.d.ts +2 -0
- package/dist/tests/env-writer.test.d.ts.map +1 -0
- package/dist/tests/env-writer.test.js +90 -0
- package/dist/tests/env-writer.test.js.map +1 -0
- package/dist/tests/profile-store.test.d.ts +2 -0
- package/dist/tests/profile-store.test.d.ts.map +1 -0
- package/dist/tests/profile-store.test.js +88 -0
- package/dist/tests/profile-store.test.js.map +1 -0
- package/dist/tests/target-guard.test.d.ts +2 -0
- package/dist/tests/target-guard.test.d.ts.map +1 -0
- package/dist/tests/target-guard.test.js +132 -0
- package/dist/tests/target-guard.test.js.map +1 -0
- package/dist/ui/logo.d.ts +2 -0
- package/dist/ui/logo.d.ts.map +1 -0
- package/dist/ui/logo.js +22 -0
- package/dist/ui/logo.js.map +1 -0
- package/package.json +17 -53
- package/.claude/settings.local.json +0 -36
- package/.cursor/rules.md +0 -203
- package/.eslintrc.js +0 -31
- package/CLAUDE.md +0 -100
- package/bin/cli.js +0 -116
- package/docs/ADDING_FRAMEWORK_DETECTORS.md +0 -391
- package/docs/ADDING_NEW_PROJECT_TYPE.md +0 -156
- package/docs/ARCHITECTURE_RELATIONSHIPS.md +0 -411
- package/docs/CLI_AUTHENTICATION.md +0 -214
- package/docs/CLI_PAGE_DETECTION_REQUIREMENTS.md +0 -519
- package/docs/CRM-PIPELINES-SEQUENCES-SPEC.md +0 -429
- package/docs/DETECTOR_ARCHITECTURE.md +0 -326
- package/docs/DEVELOPMENT.md +0 -194
- package/docs/IMPLEMENTATION_PHASES.md +0 -468
- package/docs/INTEGRATION_PATHS_ARCHITECTURE.md +0 -1543
- package/docs/OAUTH_CLARIFICATION.md +0 -258
- package/docs/OAUTH_SETUP_GUIDE_TEMPLATE.md +0 -211
- package/docs/PHASE_0_PROGRESS.md +0 -120
- package/docs/PHASE_1_COMPLETE.md +0 -366
- package/docs/PHASE_SUMMARY.md +0 -149
- package/docs/PLAN.md +0 -511
- package/docs/README.md +0 -56
- package/docs/STRIPE_INTEGRATION.md +0 -447
- package/docs/SUMMARY.md +0 -230
- package/docs/UPDATED_PLAN.md +0 -447
- package/docs/mcp_server/MCP_EXTENSION_GUIDE.md +0 -1313
- package/docs/mcp_server/MCP_SERVER_ARCHITECTURE.md +0 -1481
- package/docs/mcp_server/applicationOntology.ts +0 -817
- package/docs/mcp_server/cliApplications.ts +0 -639
- package/docs/mcp_server/crmOntology.ts +0 -1063
- package/docs/mcp_server/eventOntology.ts +0 -1183
- package/docs/mcp_server/formsOntology.ts +0 -1401
- package/docs/mcp_server/ontologySchemas.ts +0 -185
- package/docs/mcp_server/schema.ts +0 -250
- package/docs/microsass_production_machine/CLI_API_REFERENCE.md +0 -1197
- package/docs/microsass_production_machine/CLI_PRODUCT_VISION.md +0 -676
- package/docs/microsass_production_machine/CLI_REQUIREMENTS.md +0 -606
- package/docs/microsass_production_machine/CONNECTED_APPLICATIONS_SPEC.md +0 -390
- package/docs/microsass_production_machine/IMPLEMENTATION_ROADMAP.md +0 -725
- package/docs/microsass_production_machine/OBJECT_MAPPINGS.md +0 -808
- package/docs/microsass_production_machine/REFERENCE_IMPLEMENTATION.md +0 -532
- package/src/api/backend-client.js +0 -449
- package/src/commands/api-keys.js +0 -119
- package/src/commands/connect.js +0 -243
- package/src/commands/login.js +0 -332
- package/src/commands/logout.js +0 -30
- package/src/commands/mcp-server.js +0 -85
- package/src/commands/mcp-setup.js +0 -686
- package/src/commands/pages.js +0 -317
- package/src/commands/scaffold.js +0 -409
- package/src/commands/spread.js +0 -861
- package/src/commands/status.js +0 -62
- package/src/commands/sync.js +0 -169
- package/src/commands/upgrade.js +0 -48
- package/src/config/config-manager.js +0 -206
- package/src/detectors/api-client-detector.js +0 -85
- package/src/detectors/base-detector.js +0 -77
- package/src/detectors/database-detector.js +0 -245
- package/src/detectors/expo-detector.js +0 -166
- package/src/detectors/github-detector.js +0 -74
- package/src/detectors/index.js +0 -106
- package/src/detectors/mapping-suggestor.js +0 -119
- package/src/detectors/model-detector.js +0 -318
- package/src/detectors/nextjs-detector.js +0 -139
- package/src/detectors/oauth-detector.js +0 -122
- package/src/detectors/page-detector.js +0 -480
- package/src/detectors/registry.js +0 -121
- package/src/generators/api-client-generator.js +0 -223
- package/src/generators/api-only/client.js +0 -683
- package/src/generators/api-only/index.js +0 -96
- package/src/generators/api-only/types.js +0 -618
- package/src/generators/api-only/webhooks.js +0 -377
- package/src/generators/env-generator.js +0 -191
- package/src/generators/expo-auth-generator.js +0 -1009
- package/src/generators/gitignore-generator.js +0 -92
- package/src/generators/index.js +0 -166
- package/src/generators/manifest-generator.js +0 -154
- package/src/generators/mcp-guide-generator.js +0 -256
- package/src/generators/nextauth-generator.js +0 -247
- package/src/generators/oauth-guide-generator.js +0 -277
- package/src/generators/quickstart/components/index.js +0 -1699
- package/src/generators/quickstart/components-mobile/index.js +0 -1440
- package/src/generators/quickstart/database/convex.js +0 -1257
- package/src/generators/quickstart/database/index.js +0 -34
- package/src/generators/quickstart/database/supabase.js +0 -1132
- package/src/generators/quickstart/hooks/index.js +0 -1065
- package/src/generators/quickstart/index.js +0 -191
- package/src/generators/quickstart/pages/index.js +0 -1466
- package/src/generators/quickstart/screens/index.js +0 -1498
- package/src/logo.js +0 -116
- package/src/mcp/auth.js +0 -127
- package/src/mcp/registry/domains/applications.js +0 -516
- package/src/mcp/registry/domains/benefits.js +0 -798
- package/src/mcp/registry/domains/codegen.js +0 -894
- package/src/mcp/registry/domains/core.js +0 -324
- package/src/mcp/registry/domains/crm.js +0 -591
- package/src/mcp/registry/domains/events.js +0 -649
- package/src/mcp/registry/domains/forms.js +0 -696
- package/src/mcp/registry/index.js +0 -164
- package/src/mcp/server.js +0 -116
- package/src/utils/file-utils.js +0 -117
- package/src/utils/init-helpers.js +0 -243
- package/src/utils/prompt-utils.js +0 -195
- package/templates/CLAUDE.md +0 -86
- package/tests/api-client-detector.test.js +0 -214
- package/tests/api-client-generator.test.js +0 -176
- package/tests/backend-client.test.js +0 -640
- package/tests/base-detector.test.js +0 -101
- package/tests/commands/login.test.js +0 -143
- package/tests/commands/logout.test.js +0 -84
- package/tests/commands/status.test.js +0 -167
- package/tests/config-manager.test.js +0 -321
- package/tests/database-detector.test.js +0 -221
- package/tests/detector-index.test.js +0 -209
- package/tests/detector-registry.test.js +0 -93
- package/tests/env-generator.test.js +0 -278
- package/tests/expo-detector.test.js +0 -263
- package/tests/file-utils.test.js +0 -194
- package/tests/generators-index.test.js +0 -454
- package/tests/github-detector.test.js +0 -145
- package/tests/gitignore-generator.test.js +0 -109
- package/tests/logo.test.js +0 -96
- package/tests/nextauth-generator.test.js +0 -255
- package/tests/nextjs-detector.test.js +0 -235
- package/tests/oauth-detector.test.js +0 -264
- package/tests/oauth-guide-generator.test.js +0 -273
- package/tests/page-detector.test.js +0 -371
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ONTOLOGY SCHEMAS
|
|
3
|
-
*
|
|
4
|
-
* Universal object storage system for ALL data types.
|
|
5
|
-
* This replaces separate tables with a unified object model.
|
|
6
|
-
*
|
|
7
|
-
* Core Concepts:
|
|
8
|
-
* - objects: Universal storage for any entity (translations, events, contacts, etc.)
|
|
9
|
-
* - objectLinks: Relationships between objects (like graph edges)
|
|
10
|
-
* - objectActions: Audit trail of actions performed on objects
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { defineTable } from "convex/server";
|
|
14
|
-
import { v } from "convex/values";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* OBJECTS TABLE
|
|
18
|
-
* Universal storage for all entity types
|
|
19
|
-
*
|
|
20
|
-
* Examples:
|
|
21
|
-
* - type="translation", subtype="system", name="desktop.welcome"
|
|
22
|
-
* - type="event", subtype="podcast", name="Episode 42"
|
|
23
|
-
* - type="invoice", subtype="client", name="INV-2024-001"
|
|
24
|
-
* - type="contact", subtype="customer", name="John Doe"
|
|
25
|
-
* - type="transaction", subtype="ticket_purchase", name="Product - Customer"
|
|
26
|
-
*
|
|
27
|
-
* TRANSACTION OBJECT STRUCTURE:
|
|
28
|
-
* Transactions (type="transaction") store purchase data in customProperties.
|
|
29
|
-
*
|
|
30
|
-
* NEW STRUCTURE (v2 - Multi-line Item Transactions):
|
|
31
|
-
* One transaction per checkout with multiple line items:
|
|
32
|
-
* {
|
|
33
|
-
* checkoutSessionId: Id<"objects">,
|
|
34
|
-
* lineItems: [
|
|
35
|
-
* {
|
|
36
|
-
* productId: Id<"objects">,
|
|
37
|
-
* productName: string,
|
|
38
|
-
* productDescription?: string,
|
|
39
|
-
* quantity: number,
|
|
40
|
-
* unitPriceInCents: number, // Net price per unit
|
|
41
|
-
* totalPriceInCents: number, // Net total for this line (unitPrice * quantity)
|
|
42
|
-
* taxRatePercent: number,
|
|
43
|
-
* taxAmountInCents: number,
|
|
44
|
-
* ticketId?: Id<"objects">, // If this is a ticket product
|
|
45
|
-
* eventId?: Id<"objects">,
|
|
46
|
-
* eventName?: string,
|
|
47
|
-
* },
|
|
48
|
-
* // ... more line items
|
|
49
|
-
* ],
|
|
50
|
-
* subtotalInCents: number, // Sum of all line item totals (net)
|
|
51
|
-
* taxAmountInCents: number, // Sum of all line item taxes
|
|
52
|
-
* totalInCents: number, // Grand total (subtotal + tax)
|
|
53
|
-
* currency: string,
|
|
54
|
-
* customerName: string,
|
|
55
|
-
* customerEmail: string,
|
|
56
|
-
* payerType: "individual" | "organization",
|
|
57
|
-
* paymentMethod: string,
|
|
58
|
-
* paymentStatus: string,
|
|
59
|
-
* invoicingStatus: "pending" | "on_draft_invoice" | "invoiced",
|
|
60
|
-
* // ... other customer/payer fields
|
|
61
|
-
* }
|
|
62
|
-
*
|
|
63
|
-
* LEGACY STRUCTURE (v1 - Single Product Per Transaction):
|
|
64
|
-
* DEPRECATED: Old approach created one transaction per product.
|
|
65
|
-
* Kept for backward compatibility with existing data.
|
|
66
|
-
* {
|
|
67
|
-
* productId: Id<"objects">,
|
|
68
|
-
* productName: string,
|
|
69
|
-
* quantity: number,
|
|
70
|
-
* amountInCents: number, // Total for this ONE product
|
|
71
|
-
* currency: string,
|
|
72
|
-
* taxRatePercent: number,
|
|
73
|
-
* // ... single product fields
|
|
74
|
-
* }
|
|
75
|
-
*/
|
|
76
|
-
export const objects = defineTable({
|
|
77
|
-
// Multi-tenancy
|
|
78
|
-
organizationId: v.id("organizations"),
|
|
79
|
-
|
|
80
|
-
// Object Identity
|
|
81
|
-
type: v.string(), // "translation", "event", "invoice", "contact", etc.
|
|
82
|
-
subtype: v.optional(v.string()), // "system", "app", "content", etc.
|
|
83
|
-
|
|
84
|
-
// Universal Properties (ALL objects have these)
|
|
85
|
-
name: v.string(), // Human-readable identifier
|
|
86
|
-
description: v.optional(v.string()),
|
|
87
|
-
status: v.string(), // Object-specific statuses
|
|
88
|
-
|
|
89
|
-
// Translation-Specific Fields (only used when type="translation")
|
|
90
|
-
locale: v.optional(v.string()), // "en", "de", "pl"
|
|
91
|
-
value: v.optional(v.string()), // Translation text
|
|
92
|
-
|
|
93
|
-
// Gravel Road - Per-Org/Per-Type Customizations
|
|
94
|
-
// This allows each organization to add their own fields without schema changes
|
|
95
|
-
customProperties: v.optional(v.record(v.string(), v.any())),
|
|
96
|
-
|
|
97
|
-
// Metadata
|
|
98
|
-
// createdBy can be either platform user (staff) or frontend_user (customer)
|
|
99
|
-
// - Platform user (Id<"users">): When staff creates records administratively
|
|
100
|
-
// - Frontend user (Id<"objects">): When customers create records (guest registration, checkout)
|
|
101
|
-
createdBy: v.optional(v.union(v.id("users"), v.id("objects"))),
|
|
102
|
-
createdAt: v.number(),
|
|
103
|
-
updatedAt: v.number(),
|
|
104
|
-
})
|
|
105
|
-
// Core indexes for fast queries
|
|
106
|
-
.index("by_org", ["organizationId"])
|
|
107
|
-
.index("by_org_type", ["organizationId", "type"])
|
|
108
|
-
.index("by_org_type_subtype", ["organizationId", "type", "subtype"])
|
|
109
|
-
.index("by_type", ["type"])
|
|
110
|
-
.index("by_type_subtype", ["type", "subtype"])
|
|
111
|
-
.index("by_status", ["status"])
|
|
112
|
-
|
|
113
|
-
// Translation-specific indexes
|
|
114
|
-
.index("by_org_type_locale", ["organizationId", "type", "locale"])
|
|
115
|
-
.index("by_org_type_locale_name", ["organizationId", "type", "locale", "name"])
|
|
116
|
-
.index("by_type_locale", ["type", "locale"])
|
|
117
|
-
|
|
118
|
-
// Search indexes
|
|
119
|
-
.searchIndex("search_by_name", { searchField: "name" })
|
|
120
|
-
.searchIndex("search_by_value", { searchField: "value" });
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* OBJECT LINKS TABLE
|
|
124
|
-
* Relationships between objects (graph edges)
|
|
125
|
-
*
|
|
126
|
-
* Examples:
|
|
127
|
-
* - fromObjectId=translation1, toObjectId=event1, linkType="translates"
|
|
128
|
-
* - fromObjectId=user1, toObjectId=org1, linkType="member_of"
|
|
129
|
-
* - fromObjectId=org1, toObjectId=address1, linkType="has_address"
|
|
130
|
-
* - fromObjectId=contact1, toObjectId=event1, linkType="registers_for"
|
|
131
|
-
*/
|
|
132
|
-
export const objectLinks = defineTable({
|
|
133
|
-
organizationId: v.id("organizations"),
|
|
134
|
-
|
|
135
|
-
// Link Endpoints
|
|
136
|
-
fromObjectId: v.id("objects"),
|
|
137
|
-
toObjectId: v.id("objects"),
|
|
138
|
-
|
|
139
|
-
// Link Type (the "verb" in the relationship)
|
|
140
|
-
linkType: v.string(), // "translates", "member_of", "has_address", "registers_for", etc.
|
|
141
|
-
|
|
142
|
-
// Link-Specific Data
|
|
143
|
-
// Store additional metadata about the relationship
|
|
144
|
-
properties: v.optional(v.record(v.string(), v.any())),
|
|
145
|
-
|
|
146
|
-
// Metadata
|
|
147
|
-
// createdBy can be platform user or frontend_user (same as objects table)
|
|
148
|
-
createdBy: v.optional(v.union(v.id("users"), v.id("objects"))),
|
|
149
|
-
createdAt: v.number(),
|
|
150
|
-
})
|
|
151
|
-
.index("by_from_object", ["fromObjectId"])
|
|
152
|
-
.index("by_to_object", ["toObjectId"])
|
|
153
|
-
.index("by_org_link_type", ["organizationId", "linkType"])
|
|
154
|
-
.index("by_from_link_type", ["fromObjectId", "linkType"])
|
|
155
|
-
.index("by_to_link_type", ["toObjectId", "linkType"]);
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* OBJECT ACTIONS TABLE
|
|
159
|
-
* Audit trail of actions performed on objects
|
|
160
|
-
*
|
|
161
|
-
* Examples:
|
|
162
|
-
* - objectId=translation1, actionType="approve", performedBy=user1
|
|
163
|
-
* - objectId=event1, actionType="publish", performedBy=user2
|
|
164
|
-
* - objectId=invoice1, actionType="send", performedBy=user3
|
|
165
|
-
*/
|
|
166
|
-
export const objectActions = defineTable({
|
|
167
|
-
organizationId: v.id("organizations"),
|
|
168
|
-
objectId: v.id("objects"),
|
|
169
|
-
|
|
170
|
-
// Action Identity
|
|
171
|
-
actionType: v.string(), // "approve", "translate", "publish", "view", "edit", etc.
|
|
172
|
-
|
|
173
|
-
// Action Data
|
|
174
|
-
// Store details about what changed
|
|
175
|
-
actionData: v.optional(v.record(v.string(), v.any())),
|
|
176
|
-
|
|
177
|
-
// Who & When
|
|
178
|
-
// performedBy can be platform user or frontend_user (same as objects table)
|
|
179
|
-
performedBy: v.optional(v.union(v.id("users"), v.id("objects"))),
|
|
180
|
-
performedAt: v.number(),
|
|
181
|
-
})
|
|
182
|
-
.index("by_object", ["objectId"])
|
|
183
|
-
.index("by_org_action_type", ["organizationId", "actionType"])
|
|
184
|
-
.index("by_performer", ["performedBy"])
|
|
185
|
-
.index("by_performed_at", ["performedAt"]);
|
|
@@ -1,250 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ORGANIZED SCHEMA STRUCTURE
|
|
3
|
-
*
|
|
4
|
-
* This schema is composed from modular definitions in the schemas/ directory.
|
|
5
|
-
* See schemas/README.md for documentation on adding new apps.
|
|
6
|
-
*
|
|
7
|
-
* Structure:
|
|
8
|
-
* 1. Core platform (users, organizations, memberships)
|
|
9
|
-
* 2. App Store (apps registry, installations, purchases)
|
|
10
|
-
* 3. Individual Apps (l4yercak3pod, etc. - each is self-contained)
|
|
11
|
-
* 4. Utilities (audit logs)
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { defineSchema } from "convex/server";
|
|
15
|
-
|
|
16
|
-
// Import modular schema definitions
|
|
17
|
-
import {
|
|
18
|
-
users,
|
|
19
|
-
organizations,
|
|
20
|
-
organizationMembers,
|
|
21
|
-
userPasswords,
|
|
22
|
-
sessions,
|
|
23
|
-
frontendSessions,
|
|
24
|
-
passkeys,
|
|
25
|
-
passkeysChallenges,
|
|
26
|
-
apiKeys,
|
|
27
|
-
roles,
|
|
28
|
-
permissions,
|
|
29
|
-
rolePermissions,
|
|
30
|
-
userPreferences,
|
|
31
|
-
organizationMedia,
|
|
32
|
-
oauthConnections,
|
|
33
|
-
oauthStates,
|
|
34
|
-
cliSessions,
|
|
35
|
-
cliLoginStates,
|
|
36
|
-
oauthSignupStates,
|
|
37
|
-
webhookSubscriptions
|
|
38
|
-
} from "./schemas/coreSchemas";
|
|
39
|
-
// NOTE: apiKeyDomains table removed - now using unified domain configurations in objects table
|
|
40
|
-
import { apps, appInstallations, snapshots, snapshotLoads, purchases, appAvailabilities } from "./schemas/appStoreSchemas";
|
|
41
|
-
// import { app_podcasting } from "./schemas/appDataSchemas"; // Not yet used
|
|
42
|
-
import { auditLogs, workflowExecutionLogs } from "./schemas/utilitySchemas";
|
|
43
|
-
|
|
44
|
-
// ✅ NEW ONTOLOGY SCHEMAS
|
|
45
|
-
import { objects, objectLinks, objectActions } from "./schemas/ontologySchemas";
|
|
46
|
-
|
|
47
|
-
// 🤖 AI INTEGRATION SCHEMAS
|
|
48
|
-
import {
|
|
49
|
-
aiConversations,
|
|
50
|
-
aiMessages,
|
|
51
|
-
aiToolExecutions,
|
|
52
|
-
organizationAiSettings,
|
|
53
|
-
aiAgentTasks,
|
|
54
|
-
aiAgentMemory,
|
|
55
|
-
aiModels,
|
|
56
|
-
aiWorkItems
|
|
57
|
-
} from "./schemas/aiSchemas";
|
|
58
|
-
|
|
59
|
-
// 💳 AI BILLING SCHEMAS v3.1 (VAT-inclusive pricing, EUR only)
|
|
60
|
-
import {
|
|
61
|
-
aiUsage,
|
|
62
|
-
aiSubscriptions,
|
|
63
|
-
aiTokenBalance,
|
|
64
|
-
aiTokenPurchases,
|
|
65
|
-
aiBudgetAlerts,
|
|
66
|
-
aiBillingEvents
|
|
67
|
-
} from "./schemas/aiBillingSchemas";
|
|
68
|
-
|
|
69
|
-
// 👤 USER QUOTA SCHEMAS (Phase 1: Foundation for per-user limits)
|
|
70
|
-
import { userAIQuotas } from "./schemas/userQuotaSchemas";
|
|
71
|
-
|
|
72
|
-
// 💾 STORAGE TRACKING SCHEMAS (Organization + per-user storage)
|
|
73
|
-
import { organizationStorage, userStorageQuotas } from "./schemas/storageSchemas";
|
|
74
|
-
|
|
75
|
-
// 📧 CONTACT SYNC & BULK EMAIL SCHEMAS (AI-powered external contact integration)
|
|
76
|
-
import { contactSyncs, emailCampaigns } from "./schemas/contactSyncSchemas";
|
|
77
|
-
|
|
78
|
-
// 🔐 OAUTH 2.0 SCHEMAS (OAuth authentication for third-party integrations)
|
|
79
|
-
import {
|
|
80
|
-
oauthApplications,
|
|
81
|
-
oauthAuthorizationCodes,
|
|
82
|
-
oauthRefreshTokens,
|
|
83
|
-
oauthRevokedTokens,
|
|
84
|
-
oauthTokenUsage
|
|
85
|
-
} from "./schemas/oauthSchemas";
|
|
86
|
-
|
|
87
|
-
// 🚦 RATE LIMITING SCHEMAS (Token bucket rate limiting for API abuse prevention)
|
|
88
|
-
import { rateLimitSchemas } from "./schemas/rateLimitSchemas";
|
|
89
|
-
|
|
90
|
-
// 🛡️ SECURITY SCHEMAS (Anomaly detection and security event monitoring)
|
|
91
|
-
import { securitySchemas } from "./schemas/securitySchemas";
|
|
92
|
-
|
|
93
|
-
// 📊 GROWTH TRACKING SCHEMAS (Launch metrics and KPI tracking)
|
|
94
|
-
import {
|
|
95
|
-
dailyGrowthMetrics,
|
|
96
|
-
signupEvents,
|
|
97
|
-
weeklyScorecard,
|
|
98
|
-
salesNotifications,
|
|
99
|
-
celebrationMilestones
|
|
100
|
-
} from "./schemas/growthTrackingSchemas";
|
|
101
|
-
|
|
102
|
-
// 📧 EMAIL QUEUE SCHEMA (Email delivery tracking)
|
|
103
|
-
import { emailQueue } from "./schemas/emailQueueSchemas";
|
|
104
|
-
|
|
105
|
-
// 🎁 BENEFITS PLATFORM SCHEMAS (Benefits & Commissions tracking)
|
|
106
|
-
import {
|
|
107
|
-
benefitClaims,
|
|
108
|
-
commissionPayouts,
|
|
109
|
-
memberWallets,
|
|
110
|
-
platformFees
|
|
111
|
-
} from "./schemas/benefitsSchemas";
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* MAIN SCHEMA EXPORT
|
|
115
|
-
*
|
|
116
|
-
* All tables are defined in their respective schema modules.
|
|
117
|
-
* This file simply composes them together.
|
|
118
|
-
*/
|
|
119
|
-
export default defineSchema({
|
|
120
|
-
// 👥 CORE: Platform foundation
|
|
121
|
-
users,
|
|
122
|
-
organizations,
|
|
123
|
-
organizationMembers,
|
|
124
|
-
userPasswords,
|
|
125
|
-
sessions,
|
|
126
|
-
frontendSessions, // Customer user sessions (separate from platform staff)
|
|
127
|
-
passkeys,
|
|
128
|
-
passkeysChallenges,
|
|
129
|
-
apiKeys,
|
|
130
|
-
// Domain configurations (including API access, email, branding) stored in objects table
|
|
131
|
-
userPreferences,
|
|
132
|
-
organizationMedia,
|
|
133
|
-
oauthConnections,
|
|
134
|
-
oauthStates,
|
|
135
|
-
cliSessions,
|
|
136
|
-
cliLoginStates,
|
|
137
|
-
oauthSignupStates,
|
|
138
|
-
webhookSubscriptions,
|
|
139
|
-
|
|
140
|
-
// 🔐 RBAC: Role-Based Access Control
|
|
141
|
-
roles,
|
|
142
|
-
permissions,
|
|
143
|
-
rolePermissions,
|
|
144
|
-
|
|
145
|
-
// 🏪 APP STORE: Marketplace functionality
|
|
146
|
-
apps,
|
|
147
|
-
appInstallations,
|
|
148
|
-
appAvailabilities,
|
|
149
|
-
snapshots,
|
|
150
|
-
snapshotLoads,
|
|
151
|
-
purchases,
|
|
152
|
-
|
|
153
|
-
// 📱 APPS: Individual app data tables
|
|
154
|
-
// Each app is self-contained with its own table
|
|
155
|
-
// All apps follow the appSchemaBase pattern (see schemas/appSchemaBase.ts)
|
|
156
|
-
// NAMING: Always prefix with "app_"
|
|
157
|
-
// app_podcasting, // Podcasting App
|
|
158
|
-
// Add more apps here as they're created:
|
|
159
|
-
// app_analytics,
|
|
160
|
-
// app_subscribers,
|
|
161
|
-
// app_calendar,
|
|
162
|
-
|
|
163
|
-
// 🛠️ UTILITIES: Supporting functionality
|
|
164
|
-
auditLogs,
|
|
165
|
-
workflowExecutionLogs,
|
|
166
|
-
|
|
167
|
-
// 🥷 ONTOLOGY: Universal object system
|
|
168
|
-
objects, // Universal storage for all entity types
|
|
169
|
-
objectLinks, // Relationships between objects
|
|
170
|
-
objectActions, // Audit trail of actions
|
|
171
|
-
|
|
172
|
-
// 🤖 AI INTEGRATION: General AI Assistant + Email AI Specialist
|
|
173
|
-
aiConversations, // Chat history for general AI assistant
|
|
174
|
-
aiMessages, // Individual messages in conversations
|
|
175
|
-
aiToolExecutions, // Audit trail of tool executions
|
|
176
|
-
// NOTE: Tool drafts use objects table with status="draft" + AI metadata in customProperties
|
|
177
|
-
organizationAiSettings, // AI configuration per organization (LLM + embeddings)
|
|
178
|
-
aiModels, // AI model discovery cache (auto-refreshed daily)
|
|
179
|
-
aiWorkItems, // Work items for human-in-the-loop approval workflow
|
|
180
|
-
aiAgentTasks, // Email AI tasks with approval workflow
|
|
181
|
-
aiAgentMemory, // Email templates and preferences with vector search
|
|
182
|
-
|
|
183
|
-
// 💳 AI BILLING v3.1: Three-tier system (€49 or €2,500-€12,000/mo, VAT incl.)
|
|
184
|
-
aiUsage, // Track AI API usage for billing and monitoring (with privacy audit)
|
|
185
|
-
aiSubscriptions, // Stripe subscriptions for AI features (tier-based + sub-tiers)
|
|
186
|
-
aiTokenBalance, // Purchased token balance (Standard/Privacy-Enhanced only)
|
|
187
|
-
aiTokenPurchases, // Token pack purchase history (with VAT breakdown)
|
|
188
|
-
aiBudgetAlerts, // Budget alert history and acknowledgments
|
|
189
|
-
aiBillingEvents, // Audit log for billing operations
|
|
190
|
-
|
|
191
|
-
// 👤 USER QUOTAS: Per-user limits foundation (Phase 1: tracking only, Phase 4: enforcement)
|
|
192
|
-
userAIQuotas, // Per-user monthly AI token limits
|
|
193
|
-
|
|
194
|
-
// 💾 STORAGE TRACKING: Organization + per-user storage metrics
|
|
195
|
-
organizationStorage, // Aggregated storage per organization
|
|
196
|
-
userStorageQuotas, // Per-user storage limits (Phase 1: tracking only)
|
|
197
|
-
|
|
198
|
-
// 📧 CONTACT SYNC & BULK EMAIL: AI-powered external contact integration
|
|
199
|
-
contactSyncs, // Audit trail for contact synchronization (Microsoft/Google → CRM)
|
|
200
|
-
emailCampaigns, // Bulk email campaigns to CRM contacts/organizations
|
|
201
|
-
|
|
202
|
-
// 🔐 OAUTH 2.0: Third-party authentication and authorization
|
|
203
|
-
oauthApplications, // OAuth apps registered by organizations (Zapier, Make, etc.)
|
|
204
|
-
oauthAuthorizationCodes, // Temporary authorization codes (10 min lifetime)
|
|
205
|
-
oauthRefreshTokens, // Long-lived refresh tokens (30 days)
|
|
206
|
-
oauthRevokedTokens, // Revocation list for access tokens
|
|
207
|
-
oauthTokenUsage, // Token usage analytics (optional, for monitoring)
|
|
208
|
-
|
|
209
|
-
// 🚦 RATE LIMITING: Token bucket rate limiting for API abuse prevention
|
|
210
|
-
...rateLimitSchemas, // rateLimitBuckets, rateLimitViolations
|
|
211
|
-
|
|
212
|
-
// 🛡️ SECURITY: Anomaly detection and security event monitoring
|
|
213
|
-
...securitySchemas, // securityEvents, usageMetadata, failedAuthAttempts
|
|
214
|
-
|
|
215
|
-
// 📊 GROWTH TRACKING: Launch metrics and KPI tracking
|
|
216
|
-
dailyGrowthMetrics, // Daily metrics (automated + manual)
|
|
217
|
-
signupEvents, // Signup event tracking
|
|
218
|
-
weeklyScorecard, // Weekly scorecard snapshots
|
|
219
|
-
salesNotifications, // Sales team notifications
|
|
220
|
-
celebrationMilestones, // Milestone achievements
|
|
221
|
-
|
|
222
|
-
// 📧 EMAIL QUEUE: Email delivery tracking
|
|
223
|
-
emailQueue, // Outbound email queue
|
|
224
|
-
|
|
225
|
-
// 🎁 BENEFITS PLATFORM: Benefits & Commissions tracking
|
|
226
|
-
benefitClaims, // Benefit claim workflow tracking
|
|
227
|
-
commissionPayouts, // Commission payout workflow tracking
|
|
228
|
-
memberWallets, // Crypto wallet links for members
|
|
229
|
-
platformFees, // Platform fee tracking for billing
|
|
230
|
-
|
|
231
|
-
// ❌ OLD TRANSLATIONS - Replaced by ontology
|
|
232
|
-
// systemTranslations,
|
|
233
|
-
// appTranslations,
|
|
234
|
-
// contentTranslations,
|
|
235
|
-
// translationNamespaces,
|
|
236
|
-
// translationKeys,
|
|
237
|
-
// supportedLocales,
|
|
238
|
-
});
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* ADDING A NEW APP?
|
|
242
|
-
*
|
|
243
|
-
* 1. Define your table in schemas/appDataSchemas.ts
|
|
244
|
-
* 2. Import it above: import { yourapp } from "./schemas/appDataSchemas";
|
|
245
|
-
* 3. Add it to the schema export under "APPS" section
|
|
246
|
-
* 4. Register it in convex/apps.ts DEFAULT_APPS
|
|
247
|
-
* 5. Create convex/yourapp.ts for queries/mutations
|
|
248
|
-
*
|
|
249
|
-
* See schemas/README.md for complete guide
|
|
250
|
-
*/
|