@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.
Files changed (52) hide show
  1. package/README.md +2 -2
  2. package/dist/api/auth/d1-store.js +20 -1
  3. package/dist/capacity-provider.d.ts +53 -1
  4. package/dist/capacity.d.ts +80 -1
  5. package/dist/capacity.js +687 -8
  6. package/dist/db/d1.d.ts +109 -3227
  7. package/dist/db/index.d.ts +1 -0
  8. package/dist/db/index.js +1 -0
  9. package/dist/db/market-schema.d.ts +43769 -0
  10. package/dist/db/market-schema.js +1878 -0
  11. package/dist/db/node-sqlite.d.ts +109 -3227
  12. package/dist/db/schema.d.ts +226 -5757
  13. package/dist/db/schema.js +35 -226
  14. package/dist/index.d.ts +6 -4
  15. package/dist/index.js +32 -0
  16. package/dist/market-client.d.ts +135 -0
  17. package/dist/market-client.js +134 -1
  18. package/dist/operations/services/commit-message-provider.js +1 -1
  19. package/dist/operations/services/d1-migration.js +0 -59
  20. package/dist/operations/services/deploy.js +5 -1
  21. package/dist/operations/services/github-api.d.ts +83 -0
  22. package/dist/operations/services/github-api.js +167 -0
  23. package/dist/operations/services/local-dev.js +3 -3
  24. package/dist/operations/services/mailpit-runtime.d.ts +13 -2
  25. package/dist/operations/services/mailpit-runtime.js +19 -14
  26. package/dist/operations/services/project-web-monitor.d.ts +15 -0
  27. package/dist/operations/services/project-web-monitor.js +260 -0
  28. package/dist/operations/services/railway-api.js +2 -2
  29. package/dist/operations/services/release-candidate.js +9 -9
  30. package/dist/operations/services/runtime-paths.d.ts +1 -1
  31. package/dist/operations/services/runtime-paths.js +2 -2
  32. package/dist/operations/services/template-registry.js +10 -1
  33. package/dist/operations.d.ts +1 -0
  34. package/dist/operations.js +11 -1
  35. package/dist/platform-operation-store.d.ts +4 -0
  36. package/dist/platform-operation-store.js +29 -3
  37. package/dist/platform-operations.d.ts +8 -0
  38. package/dist/platform-operations.js +19 -0
  39. package/dist/remote.js +6 -6
  40. package/dist/scripts/tenant-d1-migrate-local.js +2 -3
  41. package/dist/scripts/test-cloudflare-local.js +1 -1
  42. package/dist/scripts/workspace-command-e2e.js +3 -1
  43. package/dist/sdk-types.d.ts +281 -3
  44. package/dist/sdk-types.js +5 -1
  45. package/dist/seeds/normalize.js +6 -0
  46. package/dist/seeds/schema.js +61 -1
  47. package/dist/seeds/types.d.ts +32 -0
  48. package/drizzle/d1/0000_treeseed_d1.sql +37 -0
  49. package/drizzle/market/0000_market_control_plane.sql +2929 -0
  50. package/drizzle/market/0001_capacity_budget_mode_default.sql +4 -0
  51. package/drizzle/market/0002_user_email_addresses.sql +26 -0
  52. package/package.json +8 -1
@@ -0,0 +1,4 @@
1
+ UPDATE "capacity_providers"
2
+ SET "credit_budget_mode" = 'derived'
3
+ WHERE "credit_budget_mode" IS NULL OR "credit_budget_mode" = '';
4
+ ALTER TABLE "capacity_providers" ALTER COLUMN "credit_budget_mode" SET DEFAULT 'derived';
@@ -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.11",
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"