@nymbalhq/platform 1.4.0 → 1.6.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +6 -0
  3. package/dist/{chunk-GMV3B3SC.js → chunk-KH3BABMV.js} +10570 -7364
  4. package/dist/chunk-KH3BABMV.js.map +1 -0
  5. package/dist/{chunk-SNNK2OX3.js → chunk-TVKV5GBY.js} +172 -9
  6. package/dist/chunk-TVKV5GBY.js.map +1 -0
  7. package/dist/db/schema/index.d.ts +6537 -3506
  8. package/dist/db/schema/index.js +1 -1
  9. package/dist/index.d.ts +893 -129
  10. package/dist/index.js +4321 -1905
  11. package/dist/index.js.map +1 -1
  12. package/dist/register-XP5XVAXM.js +8 -0
  13. package/migrations/postgres/0016_email_suppressions.sql +7 -0
  14. package/migrations/postgres/0017_order_shipments.sql +14 -0
  15. package/migrations/postgres/0018_order_key_expiry.sql +8 -0
  16. package/migrations/postgres/0019_carts_customer_idx.sql +1 -0
  17. package/migrations/postgres/0020_alert_confirmation_sent.sql +1 -0
  18. package/migrations/postgres/0021_proposals.sql +27 -0
  19. package/migrations/postgres/0022_order_source.sql +3 -0
  20. package/migrations/postgres/meta/0016_snapshot.json +2233 -0
  21. package/migrations/postgres/meta/0017_snapshot.json +2300 -0
  22. package/migrations/postgres/meta/0018_snapshot.json +2306 -0
  23. package/migrations/postgres/meta/0019_snapshot.json +2322 -0
  24. package/migrations/postgres/meta/0020_snapshot.json +2328 -0
  25. package/migrations/postgres/meta/0021_snapshot.json +2543 -0
  26. package/migrations/postgres/meta/0022_snapshot.json +2578 -0
  27. package/migrations/postgres/meta/_journal.json +49 -0
  28. package/migrations/sqlite/0016_email_suppressions.sql +7 -0
  29. package/migrations/sqlite/0017_order_shipments.sql +9 -0
  30. package/migrations/sqlite/0018_order_key_expiry.sql +25 -0
  31. package/migrations/sqlite/0019_carts_customer_idx.sql +1 -0
  32. package/migrations/sqlite/0020_alert_confirmation_sent.sql +1 -0
  33. package/migrations/sqlite/0021_proposals.sql +27 -0
  34. package/migrations/sqlite/0022_order_source.sql +3 -0
  35. package/migrations/sqlite/meta/0016_snapshot.json +1981 -0
  36. package/migrations/sqlite/meta/0017_snapshot.json +2041 -0
  37. package/migrations/sqlite/meta/0018_snapshot.json +2048 -0
  38. package/migrations/sqlite/meta/0019_snapshot.json +2056 -0
  39. package/migrations/sqlite/meta/0020_snapshot.json +2063 -0
  40. package/migrations/sqlite/meta/0021_snapshot.json +2246 -0
  41. package/migrations/sqlite/meta/0022_snapshot.json +2270 -0
  42. package/migrations/sqlite/meta/_journal.json +49 -0
  43. package/package.json +25 -52
  44. package/dist/chunk-GMV3B3SC.js.map +0 -1
  45. package/dist/chunk-SNNK2OX3.js.map +0 -1
  46. package/dist/register-N2XGSFUF.js +0 -8
  47. /package/dist/{register-N2XGSFUF.js.map → register-XP5XVAXM.js.map} +0 -0
@@ -113,6 +113,55 @@
113
113
  "when": 1793018982663,
114
114
  "tag": "0015_events_retry_at",
115
115
  "breakpoints": true
116
+ },
117
+ {
118
+ "idx": 16,
119
+ "version": "7",
120
+ "when": 1793243518295,
121
+ "tag": "0016_email_suppressions",
122
+ "breakpoints": true
123
+ },
124
+ {
125
+ "idx": 17,
126
+ "version": "7",
127
+ "when": 1793247291719,
128
+ "tag": "0017_order_shipments",
129
+ "breakpoints": true
130
+ },
131
+ {
132
+ "idx": 18,
133
+ "version": "7",
134
+ "when": 1793344408253,
135
+ "tag": "0018_order_key_expiry",
136
+ "breakpoints": true
137
+ },
138
+ {
139
+ "idx": 19,
140
+ "version": "7",
141
+ "when": 1793507532518,
142
+ "tag": "0019_carts_customer_idx",
143
+ "breakpoints": true
144
+ },
145
+ {
146
+ "idx": 20,
147
+ "version": "7",
148
+ "when": 1793605267195,
149
+ "tag": "0020_alert_confirmation_sent",
150
+ "breakpoints": true
151
+ },
152
+ {
153
+ "idx": 21,
154
+ "version": "7",
155
+ "when": 1793740929141,
156
+ "tag": "0021_proposals",
157
+ "breakpoints": true
158
+ },
159
+ {
160
+ "idx": 22,
161
+ "version": "7",
162
+ "when": 1793809830713,
163
+ "tag": "0022_order_source",
164
+ "breakpoints": true
116
165
  }
117
166
  ]
118
167
  }
@@ -0,0 +1,7 @@
1
+ CREATE TABLE `email_suppressions` (
2
+ `email` text PRIMARY KEY NOT NULL,
3
+ `reason` text NOT NULL,
4
+ `event_id` text NOT NULL,
5
+ `created_at` text NOT NULL,
6
+ CONSTRAINT "email_suppressions_reason" CHECK("email_suppressions"."reason" IN ('hard_bounce', 'complaint'))
7
+ );
@@ -0,0 +1,9 @@
1
+ CREATE TABLE `order_shipments` (
2
+ `order_id` text PRIMARY KEY NOT NULL,
3
+ `carrier` text NOT NULL,
4
+ `tracking_number` text NOT NULL,
5
+ `created_at` text NOT NULL,
6
+ FOREIGN KEY (`order_id`) REFERENCES `orders`(`id`) ON UPDATE no action ON DELETE no action
7
+ );
8
+ --> statement-breakpoint
9
+ CREATE INDEX `order_shipments_tracking_number_idx` ON `order_shipments` (`tracking_number`);
@@ -0,0 +1,25 @@
1
+ -- Every key gets an expiry. A migration reads no config, so existing rows get the default lifetimes: 48 hours for a
2
+ -- checkout key, 30 days for an email key. The value is ISO UTC text, as the repository writes `created_at`: a bare
3
+ -- `datetime()` would read back as local time. SQLite cannot add a NOT NULL column without a default, so the table
4
+ -- is rebuilt.
5
+ CREATE TABLE `__new_order_access_keys` (
6
+ `id` text PRIMARY KEY NOT NULL,
7
+ `order_id` text NOT NULL,
8
+ `key_hash` text NOT NULL,
9
+ `purpose` text NOT NULL,
10
+ `created_at` text NOT NULL,
11
+ `expires_at` text NOT NULL
12
+ );
13
+ --> statement-breakpoint
14
+ INSERT INTO `__new_order_access_keys` (`id`, `order_id`, `key_hash`, `purpose`, `created_at`, `expires_at`)
15
+ SELECT `id`, `order_id`, `key_hash`, `purpose`, `created_at`,
16
+ strftime('%Y-%m-%dT%H:%M:%fZ', `created_at`, CASE `purpose` WHEN 'email' THEN '+30 days' ELSE '+48 hours' END)
17
+ FROM `order_access_keys`;
18
+ --> statement-breakpoint
19
+ DROP TABLE `order_access_keys`;
20
+ --> statement-breakpoint
21
+ ALTER TABLE `__new_order_access_keys` RENAME TO `order_access_keys`;
22
+ --> statement-breakpoint
23
+ CREATE UNIQUE INDEX `order_access_keys_key_hash_idx` ON `order_access_keys` (`key_hash`);
24
+ --> statement-breakpoint
25
+ CREATE INDEX `order_access_keys_order_idx` ON `order_access_keys` (`order_id`);
@@ -0,0 +1 @@
1
+ CREATE INDEX `carts_customer_idx` ON `carts` (`customer_id`) WHERE "carts"."customer_id" IS NOT NULL;
@@ -0,0 +1 @@
1
+ ALTER TABLE `alert_subscriptions` ADD `confirmation_sent_at` text;
@@ -0,0 +1,27 @@
1
+ CREATE TABLE `proposals` (
2
+ `id` text PRIMARY KEY NOT NULL,
3
+ `tool` text NOT NULL,
4
+ `command` text NOT NULL,
5
+ `args` text NOT NULL,
6
+ `handles` text,
7
+ `idempotency_key` text,
8
+ `proposer_id` text,
9
+ `agent_name` text NOT NULL,
10
+ `agent_version` text,
11
+ `correlation_id` text NOT NULL,
12
+ `status` text NOT NULL,
13
+ `decided_by_kind` text,
14
+ `decided_by` text,
15
+ `decided_at` text,
16
+ `reason` text,
17
+ `outcome_status` integer,
18
+ `outcome_code` text,
19
+ `outcome_message` text,
20
+ `created_at` text NOT NULL,
21
+ `settled_at` text,
22
+ CONSTRAINT "proposals_status" CHECK("proposals"."status" IN ('pending', 'approved', 'rejected', 'applied', 'failed'))
23
+ );
24
+ --> statement-breakpoint
25
+ CREATE UNIQUE INDEX `proposals_key_unique` ON `proposals` (`proposer_id`,`tool`,`idempotency_key`) WHERE "proposals"."proposer_id" IS NOT NULL AND "proposals"."idempotency_key" IS NOT NULL;--> statement-breakpoint
26
+ CREATE INDEX `proposals_created_idx` ON `proposals` (`created_at`,`id`);--> statement-breakpoint
27
+ CREATE INDEX `proposals_status_idx` ON `proposals` (`status`,`created_at`,`id`);
@@ -0,0 +1,3 @@
1
+ ALTER TABLE `carts` ADD `source` text DEFAULT 'storefront' NOT NULL;--> statement-breakpoint
2
+ ALTER TABLE `orders` ADD `source` text DEFAULT 'storefront' NOT NULL;--> statement-breakpoint
3
+ CREATE INDEX `orders_source_created_idx` ON `orders` (`source`,`created_at`);