@treeseed/sdk 0.10.11 → 0.10.13
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 +2 -2
- package/dist/api/auth/d1-store.js +20 -1
- package/dist/capacity-provider.d.ts +53 -1
- package/dist/capacity.d.ts +80 -1
- package/dist/capacity.js +687 -8
- package/dist/db/d1.d.ts +109 -3227
- package/dist/db/index.d.ts +1 -0
- package/dist/db/index.js +1 -0
- package/dist/db/market-schema.d.ts +43769 -0
- package/dist/db/market-schema.js +1878 -0
- package/dist/db/node-sqlite.d.ts +109 -3227
- package/dist/db/schema.d.ts +226 -5757
- package/dist/db/schema.js +35 -226
- package/dist/index.d.ts +6 -4
- package/dist/index.js +32 -0
- package/dist/market-client.d.ts +135 -0
- package/dist/market-client.js +134 -1
- package/dist/operations/services/commit-message-provider.js +1 -1
- package/dist/operations/services/d1-migration.js +0 -59
- package/dist/operations/services/deploy.js +5 -1
- package/dist/operations/services/github-api.d.ts +83 -0
- package/dist/operations/services/github-api.js +167 -0
- package/dist/operations/services/local-dev.js +3 -3
- package/dist/operations/services/mailpit-runtime.d.ts +13 -2
- package/dist/operations/services/mailpit-runtime.js +19 -14
- package/dist/operations/services/project-web-monitor.d.ts +15 -0
- package/dist/operations/services/project-web-monitor.js +260 -0
- package/dist/operations/services/railway-api.js +2 -2
- package/dist/operations/services/release-candidate.js +9 -9
- package/dist/operations/services/runtime-paths.d.ts +1 -1
- package/dist/operations/services/runtime-paths.js +2 -2
- package/dist/operations/services/template-registry.js +10 -1
- package/dist/operations.d.ts +1 -0
- package/dist/operations.js +11 -1
- package/dist/platform-operation-store.d.ts +4 -0
- package/dist/platform-operation-store.js +29 -3
- package/dist/platform-operations.d.ts +8 -0
- package/dist/platform-operations.js +19 -0
- package/dist/remote.js +6 -6
- package/dist/scripts/tenant-d1-migrate-local.js +2 -3
- package/dist/scripts/test-cloudflare-local.js +1 -1
- package/dist/scripts/workspace-command-e2e.js +3 -1
- package/dist/sdk-types.d.ts +281 -3
- package/dist/sdk-types.js +5 -1
- package/dist/seeds/normalize.js +6 -0
- package/dist/seeds/schema.js +61 -1
- package/dist/seeds/types.d.ts +32 -0
- package/drizzle/d1/0000_treeseed_d1.sql +37 -0
- package/drizzle/market/0000_market_control_plane.sql +2929 -0
- package/drizzle/market/0001_capacity_budget_mode_default.sql +4 -0
- package/drizzle/market/0002_user_email_addresses.sql +26 -0
- package/package.json +8 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
CREATE TABLE IF NOT EXISTS "user_email_addresses" (
|
|
2
|
+
"id" text PRIMARY KEY NOT NULL,
|
|
3
|
+
"user_id" text NOT NULL,
|
|
4
|
+
"email" text NOT NULL,
|
|
5
|
+
"normalized_email" text NOT NULL,
|
|
6
|
+
"status" text DEFAULT 'pending' NOT NULL,
|
|
7
|
+
"is_primary" integer DEFAULT 0 NOT NULL,
|
|
8
|
+
"verification_requested_at" text,
|
|
9
|
+
"verified_at" text,
|
|
10
|
+
"created_at" text NOT NULL,
|
|
11
|
+
"updated_at" text NOT NULL,
|
|
12
|
+
CONSTRAINT "user_email_addresses_normalized_email_unique" UNIQUE("normalized_email")
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
CREATE INDEX IF NOT EXISTS "idx_user_email_addresses_user" ON "user_email_addresses" USING btree ("user_id","status","is_primary");
|
|
16
|
+
CREATE UNIQUE INDEX IF NOT EXISTS "idx_user_email_addresses_normalized" ON "user_email_addresses" USING btree ("normalized_email");
|
|
17
|
+
|
|
18
|
+
INSERT INTO user_email_addresses (
|
|
19
|
+
id, user_id, email, normalized_email, status, is_primary, verification_requested_at, verified_at, created_at, updated_at
|
|
20
|
+
)
|
|
21
|
+
SELECT 'email_' || md5(user_id || ':' || LOWER(email)), user_id, email, LOWER(email), 'verified', 1, created_at, COALESCE(updated_at, created_at), created_at, updated_at
|
|
22
|
+
FROM market_auth_credentials
|
|
23
|
+
WHERE email IS NOT NULL
|
|
24
|
+
AND email != ''
|
|
25
|
+
AND status = 'active'
|
|
26
|
+
ON CONFLICT (normalized_email) DO NOTHING;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeseed/sdk",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.13",
|
|
4
4
|
"description": "Shared Treeseed SDK for content-backed and D1-backed object models.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"files": [
|
|
21
21
|
"README.md",
|
|
22
22
|
"dist",
|
|
23
|
+
"drizzle",
|
|
23
24
|
"scripts/verify-driver.mjs",
|
|
24
25
|
"templates"
|
|
25
26
|
],
|
|
@@ -34,6 +35,8 @@
|
|
|
34
35
|
"setup:ci": "npm ci",
|
|
35
36
|
"build": "npm run build:dist",
|
|
36
37
|
"build:dist": "node ./scripts/run-ts.mjs ./scripts/build-dist.ts",
|
|
38
|
+
"db:generate:d1": "node ../../node_modules/drizzle-kit/bin.cjs export --config drizzle.config.ts > drizzle/d1/0000_treeseed_d1.sql",
|
|
39
|
+
"db:generate:market": "node ../../node_modules/drizzle-kit/bin.cjs export --config drizzle.market.config.ts > drizzle/market/0000_market_control_plane.sql",
|
|
37
40
|
"prepare": "node ./scripts/prepare.mjs",
|
|
38
41
|
"prepack": "npm run build:dist",
|
|
39
42
|
"test": "npm run test:unit",
|
|
@@ -287,6 +290,10 @@
|
|
|
287
290
|
"types": "./dist/db/schema.d.ts",
|
|
288
291
|
"default": "./dist/db/schema.js"
|
|
289
292
|
},
|
|
293
|
+
"./db/market-schema": {
|
|
294
|
+
"types": "./dist/db/market-schema.d.ts",
|
|
295
|
+
"default": "./dist/db/market-schema.js"
|
|
296
|
+
},
|
|
290
297
|
"./db/d1": {
|
|
291
298
|
"types": "./dist/db/d1.d.ts",
|
|
292
299
|
"default": "./dist/db/d1.js"
|