@intelligo-dev/core 1.0.0-beta.1 → 1.0.0-beta.14
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/NOTICE +6 -0
- package/README.md +102 -0
- package/dist/attachments/errors.d.ts +7 -0
- package/dist/attachments/errors.d.ts.map +1 -0
- package/dist/attachments/errors.js +11 -0
- package/dist/attachments/errors.js.map +1 -0
- package/dist/attachments/index.d.ts +8 -0
- package/dist/attachments/index.d.ts.map +1 -0
- package/dist/attachments/index.js +7 -0
- package/dist/attachments/index.js.map +1 -0
- package/dist/attachments/service.d.ts +45 -0
- package/dist/attachments/service.d.ts.map +1 -0
- package/dist/attachments/service.js +100 -0
- package/dist/attachments/service.js.map +1 -0
- package/dist/attachments/types.d.ts +6 -0
- package/dist/attachments/types.d.ts.map +1 -0
- package/dist/attachments/types.js +2 -0
- package/dist/attachments/types.js.map +1 -0
- package/dist/conversations/errors.d.ts +2 -8
- package/dist/conversations/errors.d.ts.map +1 -1
- package/dist/conversations/errors.js +2 -8
- package/dist/conversations/errors.js.map +1 -1
- package/dist/conversations/index.d.ts +4 -12
- package/dist/conversations/index.d.ts.map +1 -1
- package/dist/conversations/index.js +2 -11
- package/dist/conversations/index.js.map +1 -1
- package/dist/conversations/service.d.ts +49 -61
- package/dist/conversations/service.d.ts.map +1 -1
- package/dist/conversations/service.js +110 -83
- package/dist/conversations/service.js.map +1 -1
- package/dist/conversations/types.d.ts +1 -4
- package/dist/conversations/types.d.ts.map +1 -1
- package/dist/conversations/types.js +0 -3
- package/dist/conversations/types.js.map +1 -1
- package/dist/db/client.d.ts +21 -10
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +43 -18
- package/dist/db/client.js.map +1 -1
- package/dist/db/index.d.ts +3 -3
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +3 -7
- package/dist/db/index.js.map +1 -1
- package/dist/db/schema/agents.d.ts +14 -51
- package/dist/db/schema/agents.d.ts.map +1 -1
- package/dist/db/schema/agents.js +9 -21
- package/dist/db/schema/agents.js.map +1 -1
- package/dist/db/schema/ai.d.ts +86 -1556
- package/dist/db/schema/ai.d.ts.map +1 -1
- package/dist/db/schema/ai.js +32 -236
- package/dist/db/schema/ai.js.map +1 -1
- package/dist/db/schema/auth.d.ts +5 -34
- package/dist/db/schema/auth.d.ts.map +1 -1
- package/dist/db/schema/auth.js +25 -56
- package/dist/db/schema/auth.js.map +1 -1
- package/dist/db/schema/billing.d.ts +339 -105
- package/dist/db/schema/billing.d.ts.map +1 -1
- package/dist/db/schema/billing.js +99 -58
- package/dist/db/schema/billing.js.map +1 -1
- package/dist/db/schema/feature-flags.d.ts +3 -12
- package/dist/db/schema/feature-flags.d.ts.map +1 -1
- package/dist/db/schema/feature-flags.js +3 -12
- package/dist/db/schema/feature-flags.js.map +1 -1
- package/dist/db/schema/identity.d.ts +12 -274
- package/dist/db/schema/identity.d.ts.map +1 -1
- package/dist/db/schema/identity.js +19 -104
- package/dist/db/schema/identity.js.map +1 -1
- package/dist/db/schema/index.d.ts +8 -15
- package/dist/db/schema/index.d.ts.map +1 -1
- package/dist/db/schema/index.js +12 -42
- package/dist/db/schema/index.js.map +1 -1
- package/dist/db/schema/notifications.d.ts +3 -17
- package/dist/db/schema/notifications.d.ts.map +1 -1
- package/dist/db/schema/notifications.js +3 -17
- package/dist/db/schema/notifications.js.map +1 -1
- package/dist/db/schema/usage.d.ts +94 -77
- package/dist/db/schema/usage.d.ts.map +1 -1
- package/dist/db/schema/usage.js +59 -89
- package/dist/db/schema/usage.js.map +1 -1
- package/dist/db/validate.d.ts +2 -11
- package/dist/db/validate.d.ts.map +1 -1
- package/dist/db/validate.js +6 -17
- package/dist/db/validate.js.map +1 -1
- package/dist/db/workspace-queries.d.ts +5 -29
- package/dist/db/workspace-queries.d.ts.map +1 -1
- package/dist/db/workspace-queries.js +5 -29
- package/dist/db/workspace-queries.js.map +1 -1
- package/dist/documents/classifier.d.ts +5 -12
- package/dist/documents/classifier.d.ts.map +1 -1
- package/dist/documents/classifier.js +16 -16
- package/dist/documents/classifier.js.map +1 -1
- package/dist/documents/errors.d.ts +2 -10
- package/dist/documents/errors.d.ts.map +1 -1
- package/dist/documents/errors.js +2 -10
- package/dist/documents/errors.js.map +1 -1
- package/dist/documents/index.d.ts +4 -13
- package/dist/documents/index.d.ts.map +1 -1
- package/dist/documents/index.js +3 -12
- package/dist/documents/index.js.map +1 -1
- package/dist/documents/service.d.ts +19 -26
- package/dist/documents/service.d.ts.map +1 -1
- package/dist/documents/service.js +44 -38
- package/dist/documents/service.js.map +1 -1
- package/dist/documents/types.d.ts +6 -10
- package/dist/documents/types.d.ts.map +1 -1
- package/dist/documents/types.js +0 -3
- package/dist/documents/types.js.map +1 -1
- package/dist/email/brand.d.ts +17 -0
- package/dist/email/brand.d.ts.map +1 -0
- package/dist/email/brand.js +9 -0
- package/dist/email/brand.js.map +1 -0
- package/dist/email/index.d.ts +4 -4
- package/dist/email/index.js +4 -4
- package/dist/email/provider.d.ts +1 -7
- package/dist/email/provider.d.ts.map +1 -1
- package/dist/email/provider.js +10 -19
- package/dist/email/provider.js.map +1 -1
- package/dist/email/send.d.ts +12 -12
- package/dist/email/send.d.ts.map +1 -1
- package/dist/email/send.js +5 -19
- package/dist/email/send.js.map +1 -1
- package/dist/email/senders.d.ts +17 -30
- package/dist/email/senders.d.ts.map +1 -1
- package/dist/email/senders.js +33 -47
- package/dist/email/senders.js.map +1 -1
- package/dist/email/templates/base-layout.d.ts +1 -1
- package/dist/email/templates/base-layout.d.ts.map +1 -1
- package/dist/email/templates/base-layout.js +4 -6
- package/dist/email/templates/base-layout.js.map +1 -1
- package/dist/email/templates/index.d.ts +10 -10
- package/dist/email/templates/index.d.ts.map +1 -1
- package/dist/email/templates/index.js +10 -16
- package/dist/email/templates/index.js.map +1 -1
- package/dist/email/templates/password-reset.d.ts +2 -2
- package/dist/email/templates/password-reset.d.ts.map +1 -1
- package/dist/email/templates/password-reset.js +10 -22
- package/dist/email/templates/password-reset.js.map +1 -1
- package/dist/email/templates/payment-failed.d.ts +2 -2
- package/dist/email/templates/payment-failed.d.ts.map +1 -1
- package/dist/email/templates/payment-failed.js +11 -24
- package/dist/email/templates/payment-failed.js.map +1 -1
- package/dist/email/templates/quota-warning.d.ts +4 -4
- package/dist/email/templates/quota-warning.d.ts.map +1 -1
- package/dist/email/templates/quota-warning.js +19 -39
- package/dist/email/templates/quota-warning.js.map +1 -1
- package/dist/email/templates/subscription-confirmed.d.ts +2 -2
- package/dist/email/templates/subscription-confirmed.d.ts.map +1 -1
- package/dist/email/templates/subscription-confirmed.js +13 -28
- package/dist/email/templates/subscription-confirmed.js.map +1 -1
- package/dist/email/templates/trial-expiry.d.ts +2 -2
- package/dist/email/templates/trial-expiry.d.ts.map +1 -1
- package/dist/email/templates/trial-expiry.js +12 -36
- package/dist/email/templates/trial-expiry.js.map +1 -1
- package/dist/email/templates/trial-warning.d.ts +2 -2
- package/dist/email/templates/trial-warning.d.ts.map +1 -1
- package/dist/email/templates/trial-warning.js +15 -32
- package/dist/email/templates/trial-warning.js.map +1 -1
- package/dist/email/templates/verify-email.d.ts +2 -2
- package/dist/email/templates/verify-email.d.ts.map +1 -1
- package/dist/email/templates/verify-email.js +10 -22
- package/dist/email/templates/verify-email.js.map +1 -1
- package/dist/email/templates/welcome.d.ts +2 -2
- package/dist/email/templates/welcome.d.ts.map +1 -1
- package/dist/email/templates/welcome.js +13 -20
- package/dist/email/templates/welcome.js.map +1 -1
- package/dist/email/templates/workspace-invitation.d.ts +2 -2
- package/dist/email/templates/workspace-invitation.d.ts.map +1 -1
- package/dist/email/templates/workspace-invitation.js +12 -26
- package/dist/email/templates/workspace-invitation.js.map +1 -1
- package/dist/env.d.ts +5 -10
- package/dist/env.d.ts.map +1 -1
- package/dist/env.js +41 -31
- package/dist/env.js.map +1 -1
- package/dist/identity/audit.d.ts +11 -24
- package/dist/identity/audit.d.ts.map +1 -1
- package/dist/identity/audit.js +13 -27
- package/dist/identity/audit.js.map +1 -1
- package/dist/identity/errors.d.ts +4 -12
- package/dist/identity/errors.d.ts.map +1 -1
- package/dist/identity/errors.js +2 -8
- package/dist/identity/errors.js.map +1 -1
- package/dist/identity/index.d.ts +6 -13
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +5 -12
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/service.d.ts +29 -47
- package/dist/identity/service.d.ts.map +1 -1
- package/dist/identity/service.js +107 -79
- package/dist/identity/service.js.map +1 -1
- package/dist/identity/types.d.ts +28 -4
- package/dist/identity/types.d.ts.map +1 -1
- package/dist/identity/types.js +0 -3
- package/dist/identity/types.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -10
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +7 -18
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +45 -49
- package/dist/logger.js.map +1 -1
- package/dist/money.d.ts +95 -0
- package/dist/money.d.ts.map +1 -0
- package/dist/money.js +208 -0
- package/dist/money.js.map +1 -0
- package/dist/notifications/index.d.ts +9 -43
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +9 -49
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/triggers.d.ts +9 -32
- package/dist/notifications/triggers.d.ts.map +1 -1
- package/dist/notifications/triggers.js +21 -58
- package/dist/notifications/triggers.js.map +1 -1
- package/dist/notifications/types.d.ts +6 -8
- package/dist/notifications/types.d.ts.map +1 -1
- package/dist/notifications/types.js +0 -9
- package/dist/notifications/types.js.map +1 -1
- package/dist/prompt.d.ts +38 -0
- package/dist/prompt.d.ts.map +1 -0
- package/dist/prompt.js +118 -0
- package/dist/prompt.js.map +1 -0
- package/dist/registry.d.ts +32 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +60 -0
- package/dist/registry.js.map +1 -0
- package/dist/request-context.d.ts +49 -0
- package/dist/request-context.d.ts.map +1 -0
- package/dist/request-context.js +100 -0
- package/dist/request-context.js.map +1 -0
- package/dist/storage/index.d.ts +65 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +109 -0
- package/dist/storage/index.js.map +1 -0
- package/package.json +74 -24
- package/src/attachments/errors.ts +18 -0
- package/src/attachments/index.ts +22 -0
- package/src/attachments/service.ts +178 -0
- package/src/attachments/types.ts +6 -0
- package/src/conversations/errors.ts +45 -0
- package/src/conversations/index.ts +39 -0
- package/src/conversations/service.ts +594 -0
- package/src/conversations/types.ts +15 -0
- package/src/db/client.ts +91 -0
- package/src/db/index.ts +3 -0
- package/src/db/migrations/0000_baseline.sql +652 -0
- package/src/db/migrations/0001_reconcile_chain_built_databases.sql +53 -0
- package/src/db/migrations/0002_webhook_claim_lease.sql +1 -0
- package/src/db/migrations/0003_local_payments.sql +18 -0
- package/src/db/migrations/README.md +103 -36
- package/src/db/migrations/legacy-chain.json +206 -0
- package/src/db/migrations/meta/0000_snapshot.json +4182 -157
- package/src/db/migrations/meta/0002_snapshot.json +2478 -368
- package/src/db/migrations/meta/0003_snapshot.json +2567 -554
- package/src/db/migrations/meta/_journal.json +8 -274
- package/src/db/schema/agents.ts +57 -0
- package/src/db/schema/ai.ts +174 -0
- package/src/db/schema/auth.ts +183 -0
- package/src/db/schema/billing.ts +245 -0
- package/src/db/schema/feature-flags.ts +20 -0
- package/src/db/schema/identity.ts +250 -0
- package/src/db/schema/index.ts +12 -0
- package/src/db/schema/notifications.ts +31 -0
- package/src/db/schema/usage.ts +269 -0
- package/src/db/validate.ts +63 -0
- package/src/db/workspace-queries.ts +64 -0
- package/src/documents/classifier.ts +61 -0
- package/src/documents/errors.ts +44 -0
- package/src/documents/index.ts +24 -0
- package/src/documents/service.ts +256 -0
- package/src/documents/types.ts +24 -0
- package/src/email/brand.ts +24 -0
- package/src/email/index.ts +19 -0
- package/src/email/provider.ts +278 -0
- package/src/email/send.ts +169 -0
- package/src/email/senders.ts +292 -0
- package/src/email/templates/base-layout.tsx +145 -0
- package/src/email/templates/index.ts +28 -0
- package/src/email/templates/password-reset.tsx +72 -0
- package/src/email/templates/payment-failed.tsx +77 -0
- package/src/email/templates/quota-warning.tsx +118 -0
- package/src/email/templates/subscription-confirmed.tsx +91 -0
- package/src/email/templates/trial-expiry.tsx +124 -0
- package/src/email/templates/trial-warning.tsx +104 -0
- package/src/email/templates/verify-email.tsx +72 -0
- package/src/email/templates/welcome.tsx +64 -0
- package/src/email/templates/workspace-invitation.tsx +105 -0
- package/src/env.ts +180 -0
- package/src/identity/audit.ts +65 -0
- package/src/identity/errors.ts +44 -0
- package/src/identity/index.ts +29 -0
- package/src/identity/service.ts +303 -0
- package/src/identity/types.ts +58 -0
- package/src/index.ts +4 -0
- package/src/logger.ts +198 -0
- package/src/money.ts +270 -0
- package/src/notifications/index.ts +112 -0
- package/src/notifications/triggers.ts +158 -0
- package/src/notifications/types.ts +26 -0
- package/src/prompt.ts +142 -0
- package/src/registry.ts +75 -0
- package/src/request-context.ts +137 -0
- package/src/storage/index.ts +153 -0
- package/dist/db/schema/rag.d.ts +0 -171
- package/dist/db/schema/rag.d.ts.map +0 -1
- package/dist/db/schema/rag.js +0 -42
- package/dist/db/schema/rag.js.map +0 -1
- package/src/db/migrations/0000_sharp_night_nurse.sql +0 -52
- package/src/db/migrations/0001_hesitant_vapor.sql +0 -40
- package/src/db/migrations/0002_numerous_lady_vermin.sql +0 -235
- package/src/db/migrations/0003_mighty_jean_grey.sql +0 -37
- package/src/db/migrations/0004_cynical_grandmaster.sql +0 -2
- package/src/db/migrations/0005_careful_switch.sql +0 -8
- package/src/db/migrations/0006_tense_blue_marvel.sql +0 -16
- package/src/db/migrations/0007_next_squadron_sinister.sql +0 -1
- package/src/db/migrations/0008_powerful_scream.sql +0 -39
- package/src/db/migrations/0009_sad_ink.sql +0 -1
- package/src/db/migrations/0010_shocking_omega_flight.sql +0 -2
- package/src/db/migrations/0011_ambiguous_otto_octavius.sql +0 -151
- package/src/db/migrations/0011_hnsw_vector_index.sql +0 -17
- package/src/db/migrations/0012_user_profiles.sql +0 -30
- package/src/db/migrations/0013_trending_seasonal_columns.sql +0 -9
- package/src/db/migrations/0014_add_product_type_to_agents.sql +0 -6
- package/src/db/migrations/0015_new_v1_tables.sql +0 -149
- package/src/db/migrations/0016_document_types.sql +0 -30
- package/src/db/migrations/0017_document_metadata.sql +0 -2
- package/src/db/migrations/0018_identity_graph.sql +0 -200
- package/src/db/migrations/0019_db_driven_prompts.sql +0 -20
- package/src/db/migrations/0020_pending_extractions.sql +0 -35
- package/src/db/migrations/0021_rag_documents.sql +0 -39
- package/src/db/migrations/0022_user_quotas_usage_jsonb.sql +0 -70
- package/src/db/migrations/0023_user_facts_user_scoped_unique.sql +0 -17
- package/src/db/migrations/0024_user_memories_hnsw.sql +0 -23
- package/src/db/migrations/0025_audit_trigger_errcode.sql +0 -21
- package/src/db/migrations/0026_user_profile_snapshots_composite_pk.sql +0 -17
- package/src/db/migrations/0027_billing_settings_mnt_columns.sql +0 -54
- package/src/db/migrations/0028_trial_credits_normalized_email.sql +0 -37
- package/src/db/migrations/0029_usage_records_conversation_idx.sql +0 -13
- package/src/db/migrations/0030_pending_extractions_composite_idx.sql +0 -11
- package/src/db/migrations/0031_rag_documents_hnsw.sql +0 -16
- package/src/db/migrations/0032_rate_limit_unique_idx.sql +0 -16
- package/src/db/migrations/0033_pending_extractions_partial_idx.sql +0 -18
- package/src/db/migrations/0034_rate_limit_count.sql +0 -9
- package/src/db/migrations/0035_credit_reservations.sql +0 -24
- package/src/db/migrations/0036_executions_audit_jobs.sql +0 -96
- package/src/db/migrations/0037_rate_limit_minute_bucket.sql +0 -46
- package/src/db/migrations/0038_user_quotas_generic_usage.sql +0 -25
- package/src/db/migrations/0039_platform_admin_impersonation.sql +0 -27
- package/src/db/migrations/0040_ee_audit_chain.sql +0 -23
- package/src/db/migrations/meta/0001_snapshot.json +0 -631
- package/src/db/migrations/meta/0004_snapshot.json +0 -2500
- package/src/db/migrations/meta/0005_snapshot.json +0 -2548
- package/src/db/migrations/meta/0006_snapshot.json +0 -2650
- package/src/db/migrations/meta/0007_snapshot.json +0 -2657
- package/src/db/migrations/meta/0008_snapshot.json +0 -2719
- package/src/db/migrations/meta/0009_snapshot.json +0 -2726
- package/src/db/migrations/meta/0010_snapshot.json +0 -2739
- package/src/db/migrations/meta/0011_snapshot.json +0 -3886
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* Used by Stripe integration for subscription and credit-based billing.
|
|
6
|
-
*
|
|
7
|
-
* Pattern: snake_case columns in PostgreSQL, camelCase TypeScript API (via Drizzle mapping)
|
|
2
|
+
* Plans, subscriptions, credit ledgers, purchases, local payments and
|
|
3
|
+
* Stripe events. Amounts in the credit ledgers are micros of their
|
|
4
|
+
* currency; amounts a buyer paid are minor units of theirs.
|
|
8
5
|
*/
|
|
9
|
-
import { pgTable, text, timestamp, integer, boolean, index, unique, } from "drizzle-orm/pg-core";
|
|
10
|
-
import { organization } from "./auth";
|
|
6
|
+
import { pgTable, text, timestamp, integer, bigint, boolean, index, unique, } from "drizzle-orm/pg-core";
|
|
7
|
+
import { organization, users } from "./auth.js";
|
|
11
8
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
9
|
+
* The registered plan catalogue, copied into rows so a subscription can
|
|
10
|
+
* reference its plan. The catalogue is the source: the rows are written
|
|
11
|
+
* from it at boot, and an edit made here is overwritten by the next one.
|
|
14
12
|
*/
|
|
15
13
|
export const plans = pgTable("plans", {
|
|
16
14
|
id: text("id").primaryKey(),
|
|
17
15
|
name: text("name").notNull(),
|
|
18
16
|
slug: text("slug").notNull().unique(),
|
|
19
17
|
description: text("description"),
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Whole major units — 29 is twenty-nine of the currency, not cents —
|
|
20
|
+
* rounded from the catalogue's price. 0 for free. The row names no
|
|
21
|
+
* currency; readers take the deployment's billing currency.
|
|
22
|
+
*/
|
|
23
|
+
priceMonthly: integer("price_monthly").notNull(),
|
|
24
|
+
/** Whole major units, as `priceMonthly`. 0 when the plan has no yearly price. */
|
|
25
|
+
priceYearly: integer("price_yearly").notNull(),
|
|
22
26
|
stripePriceIdMonthly: text("stripe_price_id_monthly"),
|
|
23
27
|
stripePriceIdYearly: text("stripe_price_id_yearly"),
|
|
24
28
|
features: text("features").notNull(), // JSON string array
|
|
@@ -28,10 +32,7 @@ export const plans = pgTable("plans", {
|
|
|
28
32
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
29
33
|
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
30
34
|
});
|
|
31
|
-
/**
|
|
32
|
-
* Subscriptions table - Workspace subscription state
|
|
33
|
-
* Each workspace has one active subscription (unique constraint)
|
|
34
|
-
*/
|
|
35
|
+
/** One subscription per workspace (unique constraint). */
|
|
35
36
|
export const subscriptions = pgTable("subscriptions", {
|
|
36
37
|
id: text("id").primaryKey(),
|
|
37
38
|
workspaceId: text("workspace_id")
|
|
@@ -53,60 +54,93 @@ export const subscriptions = pgTable("subscriptions", {
|
|
|
53
54
|
index("subscriptions_workspace_id_idx").on(table.workspaceId),
|
|
54
55
|
unique("subscriptions_workspace_id_unique").on(table.workspaceId),
|
|
55
56
|
]);
|
|
56
|
-
/**
|
|
57
|
-
* Credit balances table - Credit mode balance tracking
|
|
58
|
-
* Each workspace has one credit balance record (unique constraint on workspaceId)
|
|
59
|
-
*/
|
|
57
|
+
/** One credit balance per workspace (unique constraint). */
|
|
60
58
|
export const creditBalances = pgTable("credit_balances", {
|
|
61
59
|
id: text("id").primaryKey(),
|
|
62
60
|
workspaceId: text("workspace_id")
|
|
63
61
|
.notNull()
|
|
64
62
|
.unique()
|
|
65
63
|
.references(() => organization.id, { onDelete: "cascade" }),
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
/** The balance, in micros of `currency`. */
|
|
65
|
+
balanceMicros: bigint("balance_micros", { mode: "number" })
|
|
66
|
+
.notNull()
|
|
67
|
+
.default(0),
|
|
68
|
+
totalPurchasedMicros: bigint("total_purchased_micros", { mode: "number" })
|
|
69
|
+
.notNull()
|
|
70
|
+
.default(0),
|
|
71
|
+
totalUsedMicros: bigint("total_used_micros", { mode: "number" })
|
|
72
|
+
.notNull()
|
|
73
|
+
.default(0),
|
|
74
|
+
/** What this ledger is denominated in; a write in another is refused. */
|
|
75
|
+
currency: text("currency").notNull().default("USD"),
|
|
73
76
|
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
74
77
|
});
|
|
75
78
|
/**
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
* model price changes and FX moves can be deployed without a code push.
|
|
79
|
-
*
|
|
80
|
-
* Convention: exactly one row with id = "default".
|
|
79
|
+
* Singleton (id = "default") holding the FX rate and margin, so they change
|
|
80
|
+
* without a deploy. Read per request, cached 60s in-process.
|
|
81
81
|
*/
|
|
82
82
|
export const billingSettings = pgTable("billing_settings", {
|
|
83
83
|
id: text("id").primaryKey(),
|
|
84
|
-
/**
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
|
|
84
|
+
/** The deployment's billing currency — every ledger row is in this. */
|
|
85
|
+
currency: text("currency").notNull().default("USD"),
|
|
86
|
+
/** What one USD costs in it, in micros: 1_000_000 is a USD deployment. */
|
|
87
|
+
usdRateMicros: bigint("usd_rate_micros", { mode: "number" })
|
|
88
|
+
.notNull()
|
|
89
|
+
.default(1000000),
|
|
90
|
+
/** Margin over provider cost, in basis points of a multiplier: 40_000 = 4×. */
|
|
91
|
+
marginBp: integer("margin_bp").notNull().default(40000),
|
|
88
92
|
updatedAt: timestamp("updated_at").notNull().defaultNow(),
|
|
89
93
|
});
|
|
90
|
-
/**
|
|
91
|
-
* Credit purchases table - One-time credit purchases
|
|
92
|
-
* Tracks all credit purchase transactions
|
|
93
|
-
*/
|
|
94
|
+
/** One-time credit purchases. */
|
|
94
95
|
export const creditPurchases = pgTable("credit_purchases", {
|
|
95
96
|
id: text("id").primaryKey(),
|
|
96
97
|
workspaceId: text("workspace_id")
|
|
97
98
|
.notNull()
|
|
98
99
|
.references(() => organization.id, { onDelete: "cascade" }),
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
/** What the buyer paid, in minor units of `priceCurrency`. */
|
|
101
|
+
priceMinor: integer("price_minor"),
|
|
102
|
+
priceCurrency: text("price_currency"),
|
|
103
|
+
/**
|
|
104
|
+
* What the workspace was granted, in micros of `grantedCurrency`.
|
|
105
|
+
* Separate from the price on purpose: a pack sold for $5 grants an
|
|
106
|
+
* amount of the billing currency, which is a different unit.
|
|
107
|
+
*/
|
|
108
|
+
grantedMicros: bigint("granted_micros", { mode: "number" }),
|
|
109
|
+
grantedCurrency: text("granted_currency"),
|
|
101
110
|
stripePaymentIntentId: text("stripe_payment_intent_id"),
|
|
102
111
|
stripeCheckoutSessionId: text("stripe_checkout_session_id"),
|
|
103
112
|
status: text("status").notNull().default("pending"), // pending|completed|failed
|
|
104
113
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
105
114
|
}, (table) => [index("credit_purchases_workspace_id_idx").on(table.workspaceId)]);
|
|
106
115
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
116
|
+
* Invoices issued through a registered payment provider (QR-and-poll
|
|
117
|
+
* methods such as QPay, PIX or UPI), one row per invoice. The row is
|
|
118
|
+
* written when the invoice is opened, so settlement knows who pays and
|
|
119
|
+
* what was priced without trusting the browser; `fulfilled_at` is set
|
|
120
|
+
* in the same transaction that grants what was bought, so a payment is
|
|
121
|
+
* granted once however many polls see it paid.
|
|
109
122
|
*/
|
|
123
|
+
export const payments = pgTable("payments", {
|
|
124
|
+
id: text("id").primaryKey(),
|
|
125
|
+
/** The PAYMENT_MODE the invoice was opened under; settlement asks the same provider. */
|
|
126
|
+
provider: text("provider").notNull(),
|
|
127
|
+
invoiceId: text("invoice_id").notNull().unique(),
|
|
128
|
+
workspaceId: text("workspace_id")
|
|
129
|
+
.notNull()
|
|
130
|
+
.references(() => organization.id, { onDelete: "cascade" }),
|
|
131
|
+
userId: text("user_id").references(() => users.id, {
|
|
132
|
+
onDelete: "set null",
|
|
133
|
+
}),
|
|
134
|
+
/** What was bought, in the product's words: a plan slug, a bundle id. */
|
|
135
|
+
reference: text("reference").notNull(),
|
|
136
|
+
/** The price, in minor units of `currency`. */
|
|
137
|
+
amountMinor: integer("amount_minor").notNull(),
|
|
138
|
+
currency: text("currency").notNull(),
|
|
139
|
+
status: text("status").notNull().default("pending"), // pending|paid|failed
|
|
140
|
+
fulfilledAt: timestamp("fulfilled_at"),
|
|
141
|
+
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
142
|
+
}, (table) => [index("payments_workspace_id_idx").on(table.workspaceId)]);
|
|
143
|
+
/** Every Stripe event, for idempotent webhook processing and audit. */
|
|
110
144
|
export const financeEvents = pgTable("finance_events", {
|
|
111
145
|
id: text("id").primaryKey(),
|
|
112
146
|
workspaceId: text("workspace_id").references(() => organization.id, {
|
|
@@ -114,32 +148,39 @@ export const financeEvents = pgTable("finance_events", {
|
|
|
114
148
|
}),
|
|
115
149
|
stripeEventId: text("stripe_event_id").notNull().unique(),
|
|
116
150
|
type: text("type").notNull(), // e.g., "checkout.session.completed", "invoice.paid"
|
|
117
|
-
|
|
118
|
-
|
|
151
|
+
/** Stripe's own amount, in the minor units of `currency`. */
|
|
152
|
+
amountMinor: integer("amount_minor"),
|
|
153
|
+
currency: text("currency").default("USD"),
|
|
119
154
|
metadata: text("metadata"), // JSON string
|
|
155
|
+
/**
|
|
156
|
+
* When a delivery took the event for processing. A lease: a claim
|
|
157
|
+
* older than the webhook's lease is taken as a delivery that died.
|
|
158
|
+
*/
|
|
159
|
+
claimedAt: timestamp("claimed_at"),
|
|
160
|
+
/** Set once the handlers finished; the event is never run again. */
|
|
120
161
|
processedAt: timestamp("processed_at"),
|
|
121
162
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
122
163
|
});
|
|
123
164
|
/**
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
* ignored by the sum (cleanup cron deletes them).
|
|
131
|
-
*
|
|
132
|
-
* This is the seed of the Phase 2 `credit_reservations` table from the
|
|
133
|
-
* v2 architecture plan (ADR-0004).
|
|
165
|
+
* Closes the admission → settlement race. Admission inserts a reservation
|
|
166
|
+
* for the worst-case estimate inside the same transaction that sums the
|
|
167
|
+
* other active reservations, so concurrent requests cannot all be admitted
|
|
168
|
+
* against the same balance. Settlement closes the reservation; abandoned
|
|
169
|
+
* ones expire via `expires_at`, are ignored by the sum, and are deleted by
|
|
170
|
+
* a cleanup job.
|
|
134
171
|
*/
|
|
135
172
|
export const creditReservations = pgTable("credit_reservations", {
|
|
136
173
|
id: text("id").primaryKey(),
|
|
137
174
|
workspaceId: text("workspace_id")
|
|
138
175
|
.notNull()
|
|
139
176
|
.references(() => organization.id, { onDelete: "cascade" }),
|
|
140
|
-
/** Correlates admission with settlement
|
|
177
|
+
/** Correlates admission with settlement. */
|
|
141
178
|
requestId: text("request_id").notNull().unique(),
|
|
142
|
-
|
|
179
|
+
/** The hold, in micros of `currency`. */
|
|
180
|
+
estimatedMicros: bigint("estimated_micros", { mode: "number" })
|
|
181
|
+
.notNull()
|
|
182
|
+
.default(0),
|
|
183
|
+
currency: text("currency").notNull().default("USD"),
|
|
143
184
|
status: text("status").notNull().default("active"), // active | settled
|
|
144
185
|
createdAt: timestamp("created_at").notNull().defaultNow(),
|
|
145
186
|
expiresAt: timestamp("expires_at").notNull(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/db/schema/billing.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"billing.js","sourceRoot":"","sources":["../../../src/db/schema/billing.ts"],"names":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AA4C;IAC5C,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;IAChD,yCAAyC;IACzC,eAAe,EAAE,MAAM,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;SAC5D,OAAO,EAAE;SACT,OAAO,CAAC,CAAC,CAAC;IACb,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACnD,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,mBAAmB;IACvE,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;IACzD,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE;IAC5C,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC;CACnC,EACD,CAAC,KAAK,EAAE,EAAE,CAAC;IACT,KAAK,CAAC,gCAAgC,CAAC,CAAC,EAAE,CACxC,KAAK,CAAC,WAAW,EACjB,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,SAAS,CAChB;CACF,CACF,CAAC"}
|
|
@@ -1,16 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* TODO: In v0.3, hasFeature() will query this table for runtime flag overrides.
|
|
6
|
-
* For v0.2, FEATURE_MATRIX constant in billing/features.ts is the sole source of truth.
|
|
7
|
-
* This schema exists to prepare the DB for future runtime toggleability.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Feature flags table - Runtime feature toggles (v0.3)
|
|
11
|
-
*
|
|
12
|
-
* In v0.2, this table is created but NOT used for feature gating.
|
|
13
|
-
* FEATURE_MATRIX constant in billing/features.ts is the sole source of truth.
|
|
2
|
+
* Runtime overrides for feature gates: `@intelligo-dev/billing`'s feature
|
|
3
|
+
* check reads a flag by name here before it falls back to the plan's
|
|
4
|
+
* entitlements, so a feature can be switched without a deploy.
|
|
14
5
|
*/
|
|
15
6
|
export declare const featureFlags: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
16
7
|
name: "feature_flags";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../src/db/schema/feature-flags.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feature-flags.d.ts","sourceRoot":"","sources":["../../../src/db/schema/feature-flags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQvB,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,OAAO,YAAY,CAAC,YAAY,CAAC;AAC3D,MAAM,MAAM,iBAAiB,GAAG,OAAO,YAAY,CAAC,YAAY,CAAC"}
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* TODO: In v0.3, hasFeature() will query this table for runtime flag overrides.
|
|
6
|
-
* For v0.2, FEATURE_MATRIX constant in billing/features.ts is the sole source of truth.
|
|
7
|
-
* This schema exists to prepare the DB for future runtime toggleability.
|
|
2
|
+
* Runtime overrides for feature gates: `@intelligo-dev/billing`'s feature
|
|
3
|
+
* check reads a flag by name here before it falls back to the plan's
|
|
4
|
+
* entitlements, so a feature can be switched without a deploy.
|
|
8
5
|
*/
|
|
9
6
|
import { pgTable, text, timestamp, boolean } from "drizzle-orm/pg-core";
|
|
10
|
-
/**
|
|
11
|
-
* Feature flags table - Runtime feature toggles (v0.3)
|
|
12
|
-
*
|
|
13
|
-
* In v0.2, this table is created but NOT used for feature gating.
|
|
14
|
-
* FEATURE_MATRIX constant in billing/features.ts is the sole source of truth.
|
|
15
|
-
*/
|
|
16
7
|
export const featureFlags = pgTable("feature_flags", {
|
|
17
8
|
id: text("id").primaryKey(),
|
|
18
9
|
name: text("name").notNull().unique(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../../../src/db/schema/feature-flags.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"feature-flags.js","sourceRoot":"","sources":["../../../src/db/schema/feature-flags.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAExE,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAC,eAAe,EAAE;IACnD,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC3B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE;IACrC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;IAChC,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,EAAE,EAAE,yDAAyD;IACxG,QAAQ,EAAE,OAAO,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACtD,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;IACzD,SAAS,EAAE,SAAS,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,UAAU,EAAE;CAC1D,CAAC,CAAC"}
|
|
@@ -1,34 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The user identity graph: a user's facts, episodic memories and audit
|
|
3
|
+
* trail, synthesized into one profile snapshot an agent session reads in
|
|
4
|
+
* one query.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* category and weightable by confidence / importance.
|
|
12
|
-
* 2. `user_memories` is the unstructured narrative surface — pgvector
|
|
13
|
-
* search for episodic recall during long-running conversations.
|
|
14
|
-
* 3. `user_profile_snapshots` is the cached synthesis layer — voice
|
|
15
|
-
* agents can't afford to rebuild the profile at the top of every
|
|
16
|
-
* turn (<500ms budget), so we pre-render to this table and refresh
|
|
17
|
-
* on trigger events (session close, fact threshold, daily cron).
|
|
18
|
-
* 4. `user_memory_audit` is the trust layer — every write is logged
|
|
19
|
-
* so the "My Memory" settings page can show provenance per fact.
|
|
20
|
-
*
|
|
21
|
-
* See docs/AI-ARCHITECTURE.md §2 for the full design.
|
|
22
|
-
*
|
|
23
|
-
* Migration: src/db/migrations/0018_identity_graph.sql creates all four
|
|
24
|
-
* tables, their indexes, and the append-only triggers on
|
|
25
|
-
* user_memory_audit. Apply via `pnpm --filter @intelligo-dev/core db:push`
|
|
26
|
-
* before any code path calls into @intelligo-dev/agents/memory.
|
|
6
|
+
* - `user_facts`: the structured source of truth, queryable by category
|
|
7
|
+
* and weighted by confidence and importance.
|
|
8
|
+
* - `user_memories`: unstructured episodic recall via pgvector search.
|
|
9
|
+
* - `user_profile_snapshots`: the cached synthesis, since voice agents
|
|
10
|
+
* cannot rebuild the profile inside a turn's latency budget.
|
|
11
|
+
* - `user_memory_audit`: append-only log of every write, so a user can see
|
|
12
|
+
* where each fact came from.
|
|
27
13
|
*/
|
|
28
14
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* category should be a product decision, not a free-form string.
|
|
15
|
+
* A fact's category, the filter axis for synthesis and display. A closed
|
|
16
|
+
* list on purpose: a new category is a decision, not a free-form string.
|
|
32
17
|
*/
|
|
33
18
|
export declare const USER_FACT_CATEGORIES: readonly ["interest", "skill", "goal", "constraint", "trait", "value", "preference", "context", "background"];
|
|
34
19
|
export type UserFactCategory = (typeof USER_FACT_CATEGORIES)[number];
|
|
@@ -1037,251 +1022,6 @@ export declare const userMemoryAudit: import("drizzle-orm/pg-core").PgTableWithC
|
|
|
1037
1022
|
};
|
|
1038
1023
|
dialect: "pg";
|
|
1039
1024
|
}>;
|
|
1040
|
-
/**
|
|
1041
|
-
* Background-job queue for fact extraction (Phase F). When a chat
|
|
1042
|
-
* session ends the chat handler enqueues the conversation id here;
|
|
1043
|
-
* the worker (packages/agents/src/extraction/worker.ts) polls and
|
|
1044
|
-
* processes pending rows. Status starts as 'pending', flips to
|
|
1045
|
-
* 'processing' while the worker holds the row, then 'completed' or
|
|
1046
|
-
* 'failed' on exit. Failed rows track attempts so we can retry with
|
|
1047
|
-
* exponential backoff and a hard cap.
|
|
1048
|
-
*
|
|
1049
|
-
* Keeping the queue in Postgres rather than Inngest/QStash for now —
|
|
1050
|
-
* launch traffic is small enough that DB polling is sufficient and
|
|
1051
|
-
* the doc explicitly calls this out as the V1 design.
|
|
1052
|
-
*/
|
|
1053
|
-
export declare const EXTRACTION_STATUSES: readonly ["pending", "processing", "completed", "failed"];
|
|
1054
|
-
export type ExtractionStatus = (typeof EXTRACTION_STATUSES)[number];
|
|
1055
|
-
export declare const pendingExtractions: import("drizzle-orm/pg-core").PgTableWithColumns<{
|
|
1056
|
-
name: "pending_extractions";
|
|
1057
|
-
schema: undefined;
|
|
1058
|
-
columns: {
|
|
1059
|
-
id: import("drizzle-orm/pg-core").PgColumn<{
|
|
1060
|
-
name: "id";
|
|
1061
|
-
tableName: "pending_extractions";
|
|
1062
|
-
dataType: "string";
|
|
1063
|
-
columnType: "PgText";
|
|
1064
|
-
data: string;
|
|
1065
|
-
driverParam: string;
|
|
1066
|
-
notNull: true;
|
|
1067
|
-
hasDefault: false;
|
|
1068
|
-
isPrimaryKey: true;
|
|
1069
|
-
isAutoincrement: false;
|
|
1070
|
-
hasRuntimeDefault: false;
|
|
1071
|
-
enumValues: [string, ...string[]];
|
|
1072
|
-
baseColumn: never;
|
|
1073
|
-
identity: undefined;
|
|
1074
|
-
generated: undefined;
|
|
1075
|
-
}, {}, {}>;
|
|
1076
|
-
conversationId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1077
|
-
name: "conversation_id";
|
|
1078
|
-
tableName: "pending_extractions";
|
|
1079
|
-
dataType: "string";
|
|
1080
|
-
columnType: "PgText";
|
|
1081
|
-
data: string;
|
|
1082
|
-
driverParam: string;
|
|
1083
|
-
notNull: true;
|
|
1084
|
-
hasDefault: false;
|
|
1085
|
-
isPrimaryKey: false;
|
|
1086
|
-
isAutoincrement: false;
|
|
1087
|
-
hasRuntimeDefault: false;
|
|
1088
|
-
enumValues: [string, ...string[]];
|
|
1089
|
-
baseColumn: never;
|
|
1090
|
-
identity: undefined;
|
|
1091
|
-
generated: undefined;
|
|
1092
|
-
}, {}, {}>;
|
|
1093
|
-
workspaceId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1094
|
-
name: "workspace_id";
|
|
1095
|
-
tableName: "pending_extractions";
|
|
1096
|
-
dataType: "string";
|
|
1097
|
-
columnType: "PgText";
|
|
1098
|
-
data: string;
|
|
1099
|
-
driverParam: string;
|
|
1100
|
-
notNull: true;
|
|
1101
|
-
hasDefault: false;
|
|
1102
|
-
isPrimaryKey: false;
|
|
1103
|
-
isAutoincrement: false;
|
|
1104
|
-
hasRuntimeDefault: false;
|
|
1105
|
-
enumValues: [string, ...string[]];
|
|
1106
|
-
baseColumn: never;
|
|
1107
|
-
identity: undefined;
|
|
1108
|
-
generated: undefined;
|
|
1109
|
-
}, {}, {}>;
|
|
1110
|
-
userId: import("drizzle-orm/pg-core").PgColumn<{
|
|
1111
|
-
name: "user_id";
|
|
1112
|
-
tableName: "pending_extractions";
|
|
1113
|
-
dataType: "string";
|
|
1114
|
-
columnType: "PgText";
|
|
1115
|
-
data: string;
|
|
1116
|
-
driverParam: string;
|
|
1117
|
-
notNull: true;
|
|
1118
|
-
hasDefault: false;
|
|
1119
|
-
isPrimaryKey: false;
|
|
1120
|
-
isAutoincrement: false;
|
|
1121
|
-
hasRuntimeDefault: false;
|
|
1122
|
-
enumValues: [string, ...string[]];
|
|
1123
|
-
baseColumn: never;
|
|
1124
|
-
identity: undefined;
|
|
1125
|
-
generated: undefined;
|
|
1126
|
-
}, {}, {}>;
|
|
1127
|
-
productSlug: import("drizzle-orm/pg-core").PgColumn<{
|
|
1128
|
-
name: "product_slug";
|
|
1129
|
-
tableName: "pending_extractions";
|
|
1130
|
-
dataType: "string";
|
|
1131
|
-
columnType: "PgText";
|
|
1132
|
-
data: string;
|
|
1133
|
-
driverParam: string;
|
|
1134
|
-
notNull: true;
|
|
1135
|
-
hasDefault: false;
|
|
1136
|
-
isPrimaryKey: false;
|
|
1137
|
-
isAutoincrement: false;
|
|
1138
|
-
hasRuntimeDefault: false;
|
|
1139
|
-
enumValues: [string, ...string[]];
|
|
1140
|
-
baseColumn: never;
|
|
1141
|
-
identity: undefined;
|
|
1142
|
-
generated: undefined;
|
|
1143
|
-
}, {}, {}>;
|
|
1144
|
-
status: import("drizzle-orm/pg-core").PgColumn<{
|
|
1145
|
-
name: "status";
|
|
1146
|
-
tableName: "pending_extractions";
|
|
1147
|
-
dataType: "string";
|
|
1148
|
-
columnType: "PgText";
|
|
1149
|
-
data: "pending" | "processing" | "completed" | "failed";
|
|
1150
|
-
driverParam: string;
|
|
1151
|
-
notNull: true;
|
|
1152
|
-
hasDefault: true;
|
|
1153
|
-
isPrimaryKey: false;
|
|
1154
|
-
isAutoincrement: false;
|
|
1155
|
-
hasRuntimeDefault: false;
|
|
1156
|
-
enumValues: [string, ...string[]];
|
|
1157
|
-
baseColumn: never;
|
|
1158
|
-
identity: undefined;
|
|
1159
|
-
generated: undefined;
|
|
1160
|
-
}, {}, {
|
|
1161
|
-
$type: "pending" | "processing" | "completed" | "failed";
|
|
1162
|
-
}>;
|
|
1163
|
-
attempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
1164
|
-
name: "attempts";
|
|
1165
|
-
tableName: "pending_extractions";
|
|
1166
|
-
dataType: "number";
|
|
1167
|
-
columnType: "PgInteger";
|
|
1168
|
-
data: number;
|
|
1169
|
-
driverParam: string | number;
|
|
1170
|
-
notNull: true;
|
|
1171
|
-
hasDefault: true;
|
|
1172
|
-
isPrimaryKey: false;
|
|
1173
|
-
isAutoincrement: false;
|
|
1174
|
-
hasRuntimeDefault: false;
|
|
1175
|
-
enumValues: undefined;
|
|
1176
|
-
baseColumn: never;
|
|
1177
|
-
identity: undefined;
|
|
1178
|
-
generated: undefined;
|
|
1179
|
-
}, {}, {}>;
|
|
1180
|
-
maxAttempts: import("drizzle-orm/pg-core").PgColumn<{
|
|
1181
|
-
name: "max_attempts";
|
|
1182
|
-
tableName: "pending_extractions";
|
|
1183
|
-
dataType: "number";
|
|
1184
|
-
columnType: "PgInteger";
|
|
1185
|
-
data: number;
|
|
1186
|
-
driverParam: string | number;
|
|
1187
|
-
notNull: true;
|
|
1188
|
-
hasDefault: true;
|
|
1189
|
-
isPrimaryKey: false;
|
|
1190
|
-
isAutoincrement: false;
|
|
1191
|
-
hasRuntimeDefault: false;
|
|
1192
|
-
enumValues: undefined;
|
|
1193
|
-
baseColumn: never;
|
|
1194
|
-
identity: undefined;
|
|
1195
|
-
generated: undefined;
|
|
1196
|
-
}, {}, {}>;
|
|
1197
|
-
lastError: import("drizzle-orm/pg-core").PgColumn<{
|
|
1198
|
-
name: "last_error";
|
|
1199
|
-
tableName: "pending_extractions";
|
|
1200
|
-
dataType: "string";
|
|
1201
|
-
columnType: "PgText";
|
|
1202
|
-
data: string;
|
|
1203
|
-
driverParam: string;
|
|
1204
|
-
notNull: false;
|
|
1205
|
-
hasDefault: false;
|
|
1206
|
-
isPrimaryKey: false;
|
|
1207
|
-
isAutoincrement: false;
|
|
1208
|
-
hasRuntimeDefault: false;
|
|
1209
|
-
enumValues: [string, ...string[]];
|
|
1210
|
-
baseColumn: never;
|
|
1211
|
-
identity: undefined;
|
|
1212
|
-
generated: undefined;
|
|
1213
|
-
}, {}, {}>;
|
|
1214
|
-
nextRetryAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1215
|
-
name: "next_retry_at";
|
|
1216
|
-
tableName: "pending_extractions";
|
|
1217
|
-
dataType: "date";
|
|
1218
|
-
columnType: "PgTimestamp";
|
|
1219
|
-
data: Date;
|
|
1220
|
-
driverParam: string;
|
|
1221
|
-
notNull: false;
|
|
1222
|
-
hasDefault: false;
|
|
1223
|
-
isPrimaryKey: false;
|
|
1224
|
-
isAutoincrement: false;
|
|
1225
|
-
hasRuntimeDefault: false;
|
|
1226
|
-
enumValues: undefined;
|
|
1227
|
-
baseColumn: never;
|
|
1228
|
-
identity: undefined;
|
|
1229
|
-
generated: undefined;
|
|
1230
|
-
}, {}, {}>;
|
|
1231
|
-
enqueuedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1232
|
-
name: "enqueued_at";
|
|
1233
|
-
tableName: "pending_extractions";
|
|
1234
|
-
dataType: "date";
|
|
1235
|
-
columnType: "PgTimestamp";
|
|
1236
|
-
data: Date;
|
|
1237
|
-
driverParam: string;
|
|
1238
|
-
notNull: true;
|
|
1239
|
-
hasDefault: true;
|
|
1240
|
-
isPrimaryKey: false;
|
|
1241
|
-
isAutoincrement: false;
|
|
1242
|
-
hasRuntimeDefault: false;
|
|
1243
|
-
enumValues: undefined;
|
|
1244
|
-
baseColumn: never;
|
|
1245
|
-
identity: undefined;
|
|
1246
|
-
generated: undefined;
|
|
1247
|
-
}, {}, {}>;
|
|
1248
|
-
startedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1249
|
-
name: "started_at";
|
|
1250
|
-
tableName: "pending_extractions";
|
|
1251
|
-
dataType: "date";
|
|
1252
|
-
columnType: "PgTimestamp";
|
|
1253
|
-
data: Date;
|
|
1254
|
-
driverParam: string;
|
|
1255
|
-
notNull: false;
|
|
1256
|
-
hasDefault: false;
|
|
1257
|
-
isPrimaryKey: false;
|
|
1258
|
-
isAutoincrement: false;
|
|
1259
|
-
hasRuntimeDefault: false;
|
|
1260
|
-
enumValues: undefined;
|
|
1261
|
-
baseColumn: never;
|
|
1262
|
-
identity: undefined;
|
|
1263
|
-
generated: undefined;
|
|
1264
|
-
}, {}, {}>;
|
|
1265
|
-
completedAt: import("drizzle-orm/pg-core").PgColumn<{
|
|
1266
|
-
name: "completed_at";
|
|
1267
|
-
tableName: "pending_extractions";
|
|
1268
|
-
dataType: "date";
|
|
1269
|
-
columnType: "PgTimestamp";
|
|
1270
|
-
data: Date;
|
|
1271
|
-
driverParam: string;
|
|
1272
|
-
notNull: false;
|
|
1273
|
-
hasDefault: false;
|
|
1274
|
-
isPrimaryKey: false;
|
|
1275
|
-
isAutoincrement: false;
|
|
1276
|
-
hasRuntimeDefault: false;
|
|
1277
|
-
enumValues: undefined;
|
|
1278
|
-
baseColumn: never;
|
|
1279
|
-
identity: undefined;
|
|
1280
|
-
generated: undefined;
|
|
1281
|
-
}, {}, {}>;
|
|
1282
|
-
};
|
|
1283
|
-
dialect: "pg";
|
|
1284
|
-
}>;
|
|
1285
1025
|
export type UserFact = typeof userFacts.$inferSelect;
|
|
1286
1026
|
export type InsertUserFact = typeof userFacts.$inferInsert;
|
|
1287
1027
|
export type UserMemory = typeof userMemories.$inferSelect;
|
|
@@ -1290,6 +1030,4 @@ export type UserProfileSnapshot = typeof userProfileSnapshots.$inferSelect;
|
|
|
1290
1030
|
export type InsertUserProfileSnapshot = typeof userProfileSnapshots.$inferInsert;
|
|
1291
1031
|
export type UserMemoryAuditRow = typeof userMemoryAudit.$inferSelect;
|
|
1292
1032
|
export type InsertUserMemoryAudit = typeof userMemoryAudit.$inferInsert;
|
|
1293
|
-
export type PendingExtraction = typeof pendingExtractions.$inferSelect;
|
|
1294
|
-
export type InsertPendingExtraction = typeof pendingExtractions.$inferInsert;
|
|
1295
1033
|
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/db/schema/identity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/db/schema/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAgBH;;;GAGG;AACH,eAAO,MAAM,oBAAoB,+GAUvB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,oBAAoB,CAAC,CAAC,MAAM,CAAC,CAAC;AAErE;;;;GAIG;AACH,eAAO,MAAM,4BAA4B,sFAK/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwCrB,CAAC;AAEF,eAAO,MAAM,iBAAiB,kHAQpB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhE,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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