@tokenoftrust/storefront-runner 1.4.0 → 1.4.2-rc.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/apps/storefront/astro.config.mjs +17 -1
- package/apps/storefront/integrations/materialize-guard.mjs +56 -0
- package/apps/storefront/migrations-apps/0001_woozy_lyja.sql +22 -0
- package/apps/storefront/migrations-apps/0002_good_switch.sql +26 -0
- package/apps/storefront/migrations-apps/0003_mute_marauders.sql +12 -0
- package/apps/storefront/migrations-apps/meta/0001_snapshot.json +990 -0
- package/apps/storefront/migrations-apps/meta/0002_snapshot.json +1160 -0
- package/apps/storefront/migrations-apps/meta/0003_snapshot.json +1235 -0
- package/apps/storefront/migrations-apps/meta/_journal.json +21 -0
- package/apps/storefront/package.json +0 -1
- package/apps/storefront/public/js/dashboard-team.js +38 -2
- package/apps/storefront/src/components/Seo.astro +65 -1
- package/apps/storefront/src/components/admin/AdminBlogDetailRail.astro +878 -0
- package/apps/storefront/src/components/admin/AdminBlogTab.astro +1432 -0
- package/apps/storefront/src/components/admin/AdminCustomersTab.astro +3 -7
- package/apps/storefront/src/components/admin/AdminPublishTab.astro +1756 -1382
- package/apps/storefront/src/components/admin/AdminSubscriptionsTab.astro +1 -3
- package/apps/storefront/src/components/blog/BlogPaywall.astro +87 -0
- package/apps/storefront/src/components/blog/PostAccessBadge.astro +43 -0
- package/apps/storefront/src/components/blog/PostGrid.astro +57 -0
- package/apps/storefront/src/components/blog/ReactionBar.astro +214 -0
- package/apps/storefront/src/layouts/Layout.astro +48 -3
- package/apps/storefront/src/lib/activity/alerts.ts +426 -0
- package/apps/storefront/src/lib/activity/changeActorAttribution.ts +85 -0
- package/apps/storefront/src/lib/activity/deployVersion.ts +120 -0
- package/apps/storefront/src/lib/activity/ingest.ts +188 -0
- package/apps/storefront/src/lib/activity/ingestAuth.ts +105 -0
- package/apps/storefront/src/lib/activity/killSwitch.ts +80 -0
- package/apps/storefront/src/lib/activity/query.ts +403 -0
- package/apps/storefront/src/lib/activity/recordActivity.ts +101 -0
- package/apps/storefront/src/lib/activity/store.ts +120 -0
- package/apps/storefront/src/lib/activity/uiActor.ts +150 -0
- package/apps/storefront/src/lib/activity/workerCommit.ts +70 -0
- package/apps/storefront/src/lib/admin/adminShell.ts +290 -0
- package/apps/storefront/src/lib/admin/ai/approvalMode.ts +2 -3
- package/apps/storefront/src/lib/admin/ai/audit.ts +3 -5
- package/apps/storefront/src/lib/admin/checkoutStyleInput.ts +7 -7
- package/apps/storefront/src/lib/admin/checkoutStyleTarget.ts +3 -3
- package/apps/storefront/src/lib/admin/orderClient.ts +3 -5
- package/apps/storefront/src/lib/admin/services/orders.ts +17 -19
- package/apps/storefront/src/lib/admin/viewmodels/aiWorkflows.ts +4 -6
- package/apps/storefront/src/lib/admin/viewmodels/settings.ts +1 -1
- package/apps/storefront/src/lib/apps/adminService.ts +4 -4
- package/apps/storefront/src/lib/apps/adminSession.ts +53 -44
- package/apps/storefront/src/lib/apps/apiAuth.ts +2 -2
- package/apps/storefront/src/lib/apps/apiRoute.ts +2 -2
- package/apps/storefront/src/lib/apps/catalogMapper.ts +1 -1
- package/apps/storefront/src/lib/apps/credentials.ts +2 -2
- package/apps/storefront/src/lib/apps/gatewayKeys.ts +4 -4
- package/apps/storefront/src/lib/apps/healthAggregate.ts +5 -5
- package/apps/storefront/src/lib/apps/orders/attributionService.ts +2 -2
- package/apps/storefront/src/lib/apps/orders/customerHash.ts +1 -1
- package/apps/storefront/src/lib/apps/orders/foxyOrderClient.ts +12 -12
- package/apps/storefront/src/lib/apps/orders/idempotency.ts +7 -7
- package/apps/storefront/src/lib/apps/orders/orderForwardReceiver.ts +1 -1
- package/apps/storefront/src/lib/apps/orders/orderMapper.ts +2 -2
- package/apps/storefront/src/lib/apps/orders/ordersStore.ts +6 -6
- package/apps/storefront/src/lib/apps/registryService.ts +6 -6
- package/apps/storefront/src/lib/apps/scopes.ts +2 -2
- package/apps/storefront/src/lib/apps/tokenIssuer.ts +4 -4
- package/apps/storefront/src/lib/apps/tokenVerifier.ts +6 -6
- package/apps/storefront/src/lib/apps/widgets/eligibility.ts +2 -2
- package/apps/storefront/src/lib/apps/widgets/frameProps.ts +3 -3
- package/apps/storefront/src/lib/apps/widgets/launchToken.ts +4 -4
- package/apps/storefront/src/lib/apps/widgets/placements.ts +2 -2
- package/apps/storefront/src/lib/apps/widgets/renderSlot.ts +1 -1
- package/apps/storefront/src/lib/auth/adminEntry.ts +9 -9
- package/apps/storefront/src/lib/auth/identityToken.ts +6 -14
- package/apps/storefront/src/lib/auth/loginGate.ts +75 -13
- package/apps/storefront/src/lib/auth/mcpClientAssertion.ts +6 -4
- package/apps/storefront/src/lib/auth/operatorSession.ts +113 -0
- package/apps/storefront/src/lib/auth/route.ts +44 -4
- package/apps/storefront/src/lib/auth/session.ts +7 -8
- package/apps/storefront/src/lib/auth/totAccessClient.ts +8 -18
- package/apps/storefront/src/lib/basePath.ts +9 -2
- package/apps/storefront/src/lib/blog/access.ts +29 -0
- package/apps/storefront/src/lib/blog/collection.ts +313 -0
- package/apps/storefront/src/lib/blog/markdown.ts +174 -0
- package/apps/storefront/src/lib/blog/provider.ts +5 -0
- package/apps/storefront/src/lib/blog/reactions.ts +87 -0
- package/apps/storefront/src/lib/blog/rss.ts +92 -0
- package/apps/storefront/src/lib/blog/teaser.ts +83 -0
- package/apps/storefront/src/lib/blog/types.ts +34 -0
- package/apps/storefront/src/lib/blog/viewCounts.ts +243 -0
- package/apps/storefront/src/lib/d1/catalog.ts +2 -2
- package/apps/storefront/src/lib/d1/schema-apps.ts +147 -14
- package/apps/storefront/src/lib/dev/activityIngestToken.ts +2 -4
- package/apps/storefront/src/lib/dev/activityStore.ts +3 -5
- package/apps/storefront/src/lib/dev/apiBase.ts +1 -4
- package/apps/storefront/src/lib/dev/cockpitStore.ts +1 -9
- package/apps/storefront/src/lib/dev/devDraft.ts +1 -1
- package/apps/storefront/src/lib/dev/previewStatus.ts +9 -21
- package/apps/storefront/src/lib/dev/rendezvousBroker.ts +9 -24
- package/apps/storefront/src/lib/edgeCache.ts +17 -0
- package/apps/storefront/src/lib/env.ts +51 -0
- package/apps/storefront/src/lib/http/fetchTransport.ts +63 -0
- package/apps/storefront/src/lib/i18n.ts +25 -0
- package/apps/storefront/src/lib/jsonld.ts +118 -0
- package/apps/storefront/src/lib/monitoring/manifest.ts +11 -11
- package/apps/storefront/src/lib/newsletter/confirmationEmail.ts +30 -0
- package/apps/storefront/src/lib/newsletter/consent.ts +23 -0
- package/apps/storefront/src/lib/newsletter/digest.ts +117 -0
- package/apps/storefront/src/lib/newsletter/resendClient.ts +79 -0
- package/apps/storefront/src/lib/newsletter/send.ts +265 -0
- package/apps/storefront/src/lib/newsletter/subscribers.ts +156 -0
- package/apps/storefront/src/lib/publish/adminPublishTab.ts +3519 -0
- package/apps/storefront/src/lib/publish/apex-readiness.ts +41 -18
- package/apps/storefront/src/lib/publish/dispatchHealth.ts +5 -7
- package/apps/storefront/src/lib/publish/domainState.ts +22 -13
- package/apps/storefront/src/lib/publish/panelPolling.ts +78 -0
- package/apps/storefront/src/lib/publish/shipWorkspace.ts +100 -42
- package/apps/storefront/src/lib/publish/stageBundleUpload.ts +215 -0
- package/apps/storefront/src/lib/rate/kvWindow.ts +53 -0
- package/apps/storefront/src/lib/search/index.ts +2 -2
- package/apps/storefront/src/lib/seo/alternates.ts +42 -0
- package/apps/storefront/src/lib/seo/meta.ts +65 -0
- package/apps/storefront/src/lib/social/golive.ts +212 -0
- package/apps/storefront/src/lib/social/notify.ts +32 -0
- package/apps/storefront/src/lib/social/tokenStore.ts +171 -0
- package/apps/storefront/src/lib/the-build/provider.ts +27 -0
- package/apps/storefront/src/lib/the-build/readingTime.ts +35 -0
- package/apps/storefront/src/lib/the-build/toc.ts +95 -0
- package/apps/storefront/src/lib/tot/ToTClient.ts +1 -1
- package/apps/storefront/src/lib/tot/d1Client.ts +2 -2
- package/apps/storefront/src/lib/tot/totClientInterface.ts +3 -4
- package/apps/storefront/src/lib/webhooks/deliveryStore.ts +16 -17
- package/apps/storefront/src/middleware/index.ts +130 -2
- package/apps/storefront/src/pages/admin/ops-timeline.astro +420 -0
- package/apps/storefront/src/pages/admin.astro +52 -1206
- package/apps/storefront/src/pages/api/activity.ts +137 -0
- package/apps/storefront/src/pages/api/admin/activity-alerts.ts +73 -0
- package/apps/storefront/src/pages/api/apps/admin/credentials/rotate.ts +27 -1
- package/apps/storefront/src/pages/api/apps/admin/install.ts +26 -1
- package/apps/storefront/src/pages/api/apps/admin/resume.ts +24 -1
- package/apps/storefront/src/pages/api/apps/admin/suspend.ts +24 -1
- package/apps/storefront/src/pages/api/apps/admin/uninstall.ts +25 -1
- package/apps/storefront/src/pages/api/apps/admin/update.ts +24 -1
- package/apps/storefront/src/pages/api/apps/admin/webhooks/deliveries/[deliveryId]/replay.ts +11 -0
- package/apps/storefront/src/pages/api/apps/internal/order-forward.ts +11 -0
- package/apps/storefront/src/pages/api/apps/v1/attribution.ts +20 -0
- package/apps/storefront/src/pages/api/apps/v1/webhooks/deliveries/[deliveryId]/replay.ts +12 -0
- package/apps/storefront/src/pages/api/blog/[collection]/[slug]/react.ts +104 -0
- package/apps/storefront/src/pages/api/cache-purge.ts +11 -0
- package/apps/storefront/src/pages/api/dashboard/enter-vendor.ts +30 -0
- package/apps/storefront/src/pages/api/newsletter/[collection]/subscribe.ts +146 -0
- package/apps/storefront/src/pages/api/newsletter/confirm.ts +75 -0
- package/apps/storefront/src/pages/api/newsletter/unsubscribe.ts +90 -0
- package/apps/storefront/src/pages/api/publish/stage-bundle.ts +70 -0
- package/apps/storefront/src/pages/api/rum/vitals.ts +21 -2
- package/apps/storefront/src/pages/auth/login.astro +5 -4
- package/apps/storefront/src/pages/blog/[slug].astro +96 -16
- package/apps/storefront/src/pages/blog/author/[author].astro +140 -0
- package/apps/storefront/src/pages/blog/category/[category].astro +67 -0
- package/apps/storefront/src/pages/blog/index.astro +2 -0
- package/apps/storefront/src/pages/blog/tag/[tag].astro +65 -0
- package/apps/storefront/src/pages/cockpit.astro +74 -12
- package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +15 -11
- package/apps/storefront/src/pages/search.astro +1 -1
- package/apps/storefront/src/pages/sitemap.xml.ts +20 -0
- package/apps/storefront/src/pages/the-build/[slug].astro +129 -0
- package/apps/storefront/src/pages/the-build/index.astro +146 -0
- package/apps/storefront/src/pages/the-build/rss.xml.ts +33 -0
- package/apps/storefront/src/styles/admin.css +1080 -0
- package/apps/storefront/tsconfig.json +5 -0
- package/package.json +1 -1
- package/packages/public-runtime/package.json +1 -0
- package/packages/public-runtime/src/activity/README.md +146 -0
- package/packages/public-runtime/src/activity/catalog.ts +553 -0
- package/packages/public-runtime/src/activity/event.ts +168 -0
- package/packages/public-runtime/src/activity/index.ts +16 -0
- package/packages/public-runtime/src/activity/redaction.ts +263 -0
- package/packages/public-runtime/src/candidate-index.ts +13 -0
- package/packages/public-runtime/src/catalog-d1.ts +1 -1
- package/packages/public-runtime/src/customization-preview.ts +25 -2
- package/packages/public-runtime/src/customization-runtime.ts +125 -3
- package/packages/public-runtime/src/customization-versioning.ts +10 -0
- package/packages/public-runtime/src/index.ts +7 -0
- package/packages/public-runtime/src/static-bundle.ts +357 -0
- package/packages/public-runtime/src/tenant.ts +36 -8
- package/scripts/build/copy-tenant-assets.mjs +14 -4
- package/scripts/dev/ai-edit.mjs +1 -1
- package/scripts/dev/checkout-watch.mjs +2 -2
- package/scripts/dev/file-browser.mjs +2 -4
- package/scripts/dev/file-writer.mjs +1 -1
- package/scripts/dev/git-status.mjs +2 -2
- package/scripts/dev/locate-handler.mjs +3 -3
- package/scripts/dev/port-check.mjs +3 -3
- package/scripts/dev/publish.mjs +5 -9
- package/scripts/dev/shot.mjs +1 -1
- package/scripts/dev/unified-diff.mjs +8 -3
- package/scripts/tot-dev.mjs +6 -9
- package/apps/storefront/src/lib/webhooks/signing.ts +0 -29
- package/apps/storefront/src/lib/webhooks/webhookSigningKey.ts +0 -146
|
@@ -57,6 +57,7 @@ const gitSha = (() => {
|
|
|
57
57
|
import preact from "@astrojs/preact";
|
|
58
58
|
import tailwindcss from "@tailwindcss/vite";
|
|
59
59
|
import { tenantHotReload } from "./dev-plugins/tenant-hot-reload.mjs";
|
|
60
|
+
import { materializeGuard } from "./integrations/materialize-guard.mjs";
|
|
60
61
|
|
|
61
62
|
// SSR on Cloudflare Workers. `output: 'server'` because every response is
|
|
62
63
|
// tenant-resolved at the edge from the Host header (see src/middleware).
|
|
@@ -88,7 +89,22 @@ export default defineConfig({
|
|
|
88
89
|
// images get rehosted to R2 in Phase 1 ETL (see DECISIONS.md).
|
|
89
90
|
imageService: "compile",
|
|
90
91
|
}),
|
|
91
|
-
integrations: [
|
|
92
|
+
integrations: [
|
|
93
|
+
// Refuse to build unless every Gitea-classified tenant is materialized from
|
|
94
|
+
// Gitea at a pinned ref — intrinsic to `astro build`, not just deploy.sh, so
|
|
95
|
+
// no build path can silently bake empty/stale real-tenant content.
|
|
96
|
+
materializeGuard(),
|
|
97
|
+
preact({ compat: true }),
|
|
98
|
+
// Astro's file-based router ignores ANY path segment starting with "_" (see
|
|
99
|
+
// `astro/dist/core/routing/create-manifest.js`), so a page literally named
|
|
100
|
+
// `pages/__evidence.astro` silently never becomes a route (confirmed by build:
|
|
101
|
+
// no "/__evidence" entry lands in the route manifest, and it 404s in dev — the
|
|
102
|
+
// SAME latent gap `pages/__preview/version.ts` has, pre-existing and out of
|
|
103
|
+
// scope here). `injectRoute` is the supported way to bind an arbitrary URL
|
|
104
|
+
// pattern to a component that lives OUTSIDE `src/pages` (so it never competes
|
|
105
|
+
// with file-based routing), which is how `/__evidence` — the diagnostic evidence
|
|
106
|
+
// instrument panel — is wired to a real route.
|
|
107
|
+
],
|
|
92
108
|
vite: {
|
|
93
109
|
// Build-time constants: the CLI install spec the cockpit hands out (next vs latest),
|
|
94
110
|
// and this build's commit SHA reported by /health.
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
assertPinnedMaterialized,
|
|
3
|
+
checkPinned,
|
|
4
|
+
} from "../../../scripts/tenant/materialize-tenant-content.mjs";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Refuse `astro build` when any Gitea-classified tenant's content isn't
|
|
8
|
+
* materialized from Gitea at a pinned ref. Runs in `astro:build:start`, so the
|
|
9
|
+
* guard is INTRINSIC to the build — it fires for a bare `astro build`, `pnpm
|
|
10
|
+
* build`, or a deploy.sh build alike, never letting an unmaterialized real
|
|
11
|
+
* tenant bake empty content into the Worker.
|
|
12
|
+
*
|
|
13
|
+
* TOT_TENANT_REF also assert every stamp is EXACTLY this commit (off-ref → refuse)
|
|
14
|
+
* TOT_ALLOW_UNPINNED=1 tolerate a default-branch (unpinned) materialize
|
|
15
|
+
* TOT_FRAMEWORK_ONLY_BUILD=1 tolerate ABSENT tenant content (a credential-less
|
|
16
|
+
* compile check bakes nothing, so there is nothing stale to guard). Populated
|
|
17
|
+
* content without a pinned Gitea stamp still refuses — this never weakens the
|
|
18
|
+
* deploy path, which materializes first and never sets this.
|
|
19
|
+
* TOT_BUILD_TENANTS comma-separated tenant ids to scope the guard to. A per-tenant
|
|
20
|
+
* STATIC publish (materialize-tenant.mjs) sets this to the single tenant it renders,
|
|
21
|
+
* so a SIBLING Gitea tenant that isn't part of THIS publish can't block it. Unset ⇒
|
|
22
|
+
* guard every Gitea tenant — the Worker-deploy contract, where all tenants are
|
|
23
|
+
* served from one Worker at once and any unmaterialized tenant IS a real hazard.
|
|
24
|
+
*/
|
|
25
|
+
export function materializeGuard() {
|
|
26
|
+
return {
|
|
27
|
+
name: "materialize-guard",
|
|
28
|
+
hooks: {
|
|
29
|
+
"astro:build:start": (ctx = {}) => {
|
|
30
|
+
const logger = ctx.logger;
|
|
31
|
+
const expectRef = process.env.TOT_TENANT_REF || null;
|
|
32
|
+
const allowUnpinned = process.env.TOT_ALLOW_UNPINNED === "1";
|
|
33
|
+
const scoped = (process.env.TOT_BUILD_TENANTS || "")
|
|
34
|
+
.split(",")
|
|
35
|
+
.map((t) => t.trim())
|
|
36
|
+
.filter(Boolean);
|
|
37
|
+
const onlyTenants = scoped.length > 0 ? scoped : null;
|
|
38
|
+
if (process.env.TOT_FRAMEWORK_ONLY_BUILD === "1") {
|
|
39
|
+
const { problems } = checkPinned(undefined, { expectRef, allowUnpinned, onlyTenants });
|
|
40
|
+
const absent = problems.filter((p) => p.reason === "absent");
|
|
41
|
+
const real = problems.filter((p) => p.reason !== "absent");
|
|
42
|
+
if (absent.length) {
|
|
43
|
+
const msg = `[materialize-guard] framework-only build: ${absent.length} tenant(s) absent (nothing baked): ${absent.map((p) => p.tenant).join(", ")}`;
|
|
44
|
+
if (logger && typeof logger.info === "function") logger.info(msg);
|
|
45
|
+
else console.log(msg);
|
|
46
|
+
}
|
|
47
|
+
if (real.length) {
|
|
48
|
+
assertPinnedMaterialized({ expectRef, allowUnpinned, onlyTenants });
|
|
49
|
+
}
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
assertPinnedMaterialized({ expectRef, allowUnpinned, onlyTenants });
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
CREATE TABLE `activity_events` (
|
|
2
|
+
`id` text PRIMARY KEY NOT NULL,
|
|
3
|
+
`tenant_id` text NOT NULL,
|
|
4
|
+
`action` text NOT NULL,
|
|
5
|
+
`actor_kind` text NOT NULL,
|
|
6
|
+
`actor_id` text NOT NULL,
|
|
7
|
+
`actor_ref` text,
|
|
8
|
+
`source` text NOT NULL,
|
|
9
|
+
`status` text NOT NULL,
|
|
10
|
+
`error_class` text,
|
|
11
|
+
`duration_ms` integer,
|
|
12
|
+
`change_id` text,
|
|
13
|
+
`trace_id` text,
|
|
14
|
+
`payload` text DEFAULT '{}' NOT NULL,
|
|
15
|
+
`schema_version` integer NOT NULL,
|
|
16
|
+
`at` text NOT NULL,
|
|
17
|
+
`ingested_at` text NOT NULL
|
|
18
|
+
);
|
|
19
|
+
--> statement-breakpoint
|
|
20
|
+
CREATE INDEX `idx_activity_tenant_at` ON `activity_events` (`tenant_id`,`at`);--> statement-breakpoint
|
|
21
|
+
CREATE INDEX `idx_activity_tenant_action` ON `activity_events` (`tenant_id`,`action`);--> statement-breakpoint
|
|
22
|
+
CREATE INDEX `idx_activity_change` ON `activity_events` (`change_id`);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE TABLE `newsletter_sends` (
|
|
2
|
+
`tenant_id` text NOT NULL,
|
|
3
|
+
`collection` text NOT NULL,
|
|
4
|
+
`digest_id` text NOT NULL,
|
|
5
|
+
`post_slugs` text DEFAULT '[]' NOT NULL,
|
|
6
|
+
`recipient_count` integer DEFAULT 0 NOT NULL,
|
|
7
|
+
`sent_at` text NOT NULL,
|
|
8
|
+
PRIMARY KEY(`tenant_id`, `collection`, `digest_id`)
|
|
9
|
+
);
|
|
10
|
+
--> statement-breakpoint
|
|
11
|
+
CREATE TABLE `newsletter_subscribers` (
|
|
12
|
+
`tenant_id` text NOT NULL,
|
|
13
|
+
`collection` text NOT NULL,
|
|
14
|
+
`email` text NOT NULL,
|
|
15
|
+
`status` text DEFAULT 'pending' NOT NULL,
|
|
16
|
+
`token` text NOT NULL,
|
|
17
|
+
`consent_source` text,
|
|
18
|
+
`consent_ip_hash` text,
|
|
19
|
+
`subscribed_at` text NOT NULL,
|
|
20
|
+
`confirmed_at` text,
|
|
21
|
+
`unsubscribed_at` text,
|
|
22
|
+
`last_sent_at` text,
|
|
23
|
+
PRIMARY KEY(`tenant_id`, `collection`, `email`)
|
|
24
|
+
);
|
|
25
|
+
--> statement-breakpoint
|
|
26
|
+
CREATE INDEX `idx_newsletter_tenant_coll_status` ON `newsletter_subscribers` (`tenant_id`,`collection`,`status`);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
CREATE TABLE `social_tokens` (
|
|
2
|
+
`tenant_id` text NOT NULL,
|
|
3
|
+
`network` text NOT NULL,
|
|
4
|
+
`ciphertext` text NOT NULL,
|
|
5
|
+
`iv` text NOT NULL,
|
|
6
|
+
`expires_at` text,
|
|
7
|
+
`created_at` text NOT NULL,
|
|
8
|
+
`updated_at` text NOT NULL,
|
|
9
|
+
PRIMARY KEY(`tenant_id`, `network`)
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
CREATE INDEX `idx_social_tokens_tenant` ON `social_tokens` (`tenant_id`);
|