@processfocus/cli 0.1.0-next.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/LICENSE.md +28 -0
- package/README.md +736 -0
- package/dist/bundled-db-import.mjs +475 -0
- package/dist/bundled-graphql-schema.mjs +55 -0
- package/dist/main.mjs +1444 -0
- package/dist/prepare-deployment-artifact.mjs +4 -0
- package/dist/resources/cedar/policies.cedar +315 -0
- package/dist/resources/cedar/schema.cedarschema +276 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/migration.sql +1 -0
- package/dist/resources/system-migrations/20251230050207_wild_ikaris/snapshot.json +10 -0
- package/dist/resources/system-migrations/20260215222342_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260217210625_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260225225114_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260304233747_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260313015405_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260317191043_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401023429_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260401074807_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260407221320_legacy_deploy_placeholder/migration.sql +1 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/migration.sql +588 -0
- package/dist/resources/system-migrations/20260409221005_lyrical_slapstick/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/migration.sql +259 -0
- package/dist/resources/system-migrations/20260410054541_updated-at-triggers/snapshot.json +5580 -0
- package/dist/resources/system-migrations/20260506185000_external-participants/migration.sql +27 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/migration.sql +16 -0
- package/dist/resources/system-migrations/20260525081848_confused_mac_gargan/snapshot.json +5929 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/migration.sql +1 -0
- package/dist/resources/system-migrations/20260525211724_ordinary_archangel/snapshot.json +5954 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/migration.sql +1 -0
- package/dist/resources/system-migrations/20260526022120_cultured_daredevil/snapshot.json +5979 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/migration.sql +26 -0
- package/dist/resources/system-migrations/20260607222956_blue_maelstrom/snapshot.json +6139 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/migration.sql +4 -0
- package/dist/resources/system-migrations/20260608074412_productive_guardian/snapshot.json +6179 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/migration.sql +3 -0
- package/dist/resources/system-migrations/20260609042621_huge_hellcat/snapshot.json +6209 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/migration.sql +107 -0
- package/dist/resources/system-migrations/20260626224225_glorious_tenebrous/snapshot.json +6221 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/migration.sql +26 -0
- package/dist/resources/system-migrations/20260722090215_mighty_colonel_america/snapshot.json +6490 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/migration.sql +1 -0
- package/dist/resources/system-migrations/20260722234847_brainy_quasimodo/snapshot.json +6500 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/migration.sql +51 -0
- package/dist/resources/system-migrations/20260727044204_nostalgic_lightspeed/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/migration.sql +30 -0
- package/dist/resources/system-migrations/20260727044743_green_thaddeus_ross/snapshot.json +6670 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/migration.sql +80 -0
- package/dist/resources/system-migrations/20260727085203_safe_flatman/snapshot.json +6803 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/migration.sql +14 -0
- package/dist/resources/system-migrations/20260727192244_natural_franklin_richards/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/migration.sql +1 -0
- package/dist/resources/system-migrations/20260727230751_updated-at-triggers/snapshot.json +6947 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/migration.sql +25 -0
- package/dist/resources/system-migrations/20260727230758_pale_mother_askani/snapshot.json +7121 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/migration.sql +4 -0
- package/dist/resources/system-migrations/20260831084613_nostalgic_hannibal_king/snapshot.json +6852 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/migration.sql +77 -0
- package/dist/resources/system-migrations/20260906234923_stiff_maria_hill/snapshot.json +7396 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907104651_delegation-rename-snapshots/snapshot.json +7416 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/migration.sql +2 -0
- package/dist/resources/system-migrations/20260907113440_abandoned_vertigo/snapshot.json +7466 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/migration.sql +87 -0
- package/dist/resources/system-migrations/20260908002610_mute_sharon_ventura/snapshot.json +7491 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/migration.sql +1 -0
- package/dist/resources/system-migrations/20260914100808_slippery_ultragirl/snapshot.json +7501 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919083020_passkey-name/snapshot.json +7511 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/migration.sql +1 -0
- package/dist/resources/system-migrations/20260919094049_passkey-last-used/snapshot.json +7521 -0
- package/package.json +36 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
ALTER TABLE `pf_invitation` ADD `invitation_status` text(32) DEFAULT 'pending' NOT NULL;--> statement-breakpoint
|
|
2
|
+
ALTER TABLE `pf_invitation` ADD `invitation_source` text(32) DEFAULT 'legacy' NOT NULL;--> statement-breakpoint
|
|
3
|
+
ALTER TABLE `pf_invitation` ADD `invitation_pending_email` text(320);--> statement-breakpoint
|
|
4
|
+
ALTER TABLE `pf_invitation` ADD `invitation_accepted_at` real;--> statement-breakpoint
|
|
5
|
+
ALTER TABLE `pf_invitation` ADD `invitation_accepted_by_provider` text(64);--> statement-breakpoint
|
|
6
|
+
ALTER TABLE `pf_invitation` ADD `invitation_accepted_by_subject` text(256);--> statement-breakpoint
|
|
7
|
+
ALTER TABLE `pf_invitation` ADD `accepted_by_provider_user` text(41) REFERENCES pf_provider_user(id);--> statement-breakpoint
|
|
8
|
+
ALTER TABLE `pf_invitation` ADD `invitation_legacy_closed_at` real;--> statement-breakpoint
|
|
9
|
+
ALTER TABLE `pf_invitation` ADD `invitation_legacy_closure_reason` text(128);--> statement-breakpoint
|
|
10
|
+
-- Replace unique-per-email with non-unique email lookup so accepted history
|
|
11
|
+
-- can share a Normalized Email with a later pending invitation.
|
|
12
|
+
DROP INDEX IF EXISTS `pf_invitation_emailidx_idx`;--> statement-breakpoint
|
|
13
|
+
CREATE INDEX `pf_invitation_emailidx_idx` ON `pf_invitation` (`email`) WHERE _deleted = 0;--> statement-breakpoint
|
|
14
|
+
CREATE INDEX `pf_invitation_statusidx_idx` ON `pf_invitation` (`invitation_status`) WHERE _deleted = 0;--> statement-breakpoint
|
|
15
|
+
-- Normalize emails and seed pending uniqueness for live invitations.
|
|
16
|
+
UPDATE `pf_invitation`
|
|
17
|
+
SET
|
|
18
|
+
`email` = lower(trim(`email`)),
|
|
19
|
+
`invitation_pending_email` = lower(trim(`email`)),
|
|
20
|
+
`invitation_status` = 'pending',
|
|
21
|
+
`invitation_source` = 'legacy',
|
|
22
|
+
`updated_at` = julianday('now'),
|
|
23
|
+
`updated_by` = 'SYSTEM'
|
|
24
|
+
WHERE `_deleted` = 0;--> statement-breakpoint
|
|
25
|
+
-- Mark invitations that already match a non-passkey Provider User as
|
|
26
|
+
-- legacy-closed without inventing historical acceptance or role assignment.
|
|
27
|
+
UPDATE `pf_invitation`
|
|
28
|
+
SET
|
|
29
|
+
`invitation_status` = 'legacy_closed',
|
|
30
|
+
`invitation_pending_email` = NULL,
|
|
31
|
+
`accepted_by_provider_user` = (
|
|
32
|
+
SELECT `pu`.`id`
|
|
33
|
+
FROM `pf_provider_user` AS `pu`
|
|
34
|
+
INNER JOIN `pf_user` AS `u` ON `u`.`id` = `pu`.`user_id`
|
|
35
|
+
WHERE `pu`.`_deleted` = 0
|
|
36
|
+
AND `u`.`_deleted` = 0
|
|
37
|
+
AND `u`.`provider` != 'passkey'
|
|
38
|
+
AND lower(trim(`pu`.`email`)) = `pf_invitation`.`email`
|
|
39
|
+
ORDER BY `pu`.`created_at` ASC, `pu`.`id` ASC
|
|
40
|
+
LIMIT 1
|
|
41
|
+
),
|
|
42
|
+
`invitation_legacy_closed_at` = julianday('now'),
|
|
43
|
+
`invitation_legacy_closure_reason` = 'existing_provider_user',
|
|
44
|
+
`updated_at` = julianday('now'),
|
|
45
|
+
`updated_by` = 'SYSTEM'
|
|
46
|
+
WHERE `_deleted` = 0
|
|
47
|
+
AND EXISTS (
|
|
48
|
+
SELECT 1
|
|
49
|
+
FROM `pf_provider_user` AS `pu`
|
|
50
|
+
INNER JOIN `pf_user` AS `u` ON `u`.`id` = `pu`.`user_id`
|
|
51
|
+
WHERE `pu`.`_deleted` = 0
|
|
52
|
+
AND `u`.`_deleted` = 0
|
|
53
|
+
AND `u`.`provider` != 'passkey'
|
|
54
|
+
AND lower(trim(`pu`.`email`)) = `pf_invitation`.`email`
|
|
55
|
+
);--> statement-breakpoint
|
|
56
|
+
-- Collapse historically case-variant duplicate pending emails so the pending
|
|
57
|
+
-- uniqueness index can be created. Keep the oldest row; soft-delete the rest.
|
|
58
|
+
UPDATE `pf_invitation`
|
|
59
|
+
SET
|
|
60
|
+
`_deleted` = 1,
|
|
61
|
+
`invitation_pending_email` = NULL,
|
|
62
|
+
`updated_at` = julianday('now'),
|
|
63
|
+
`updated_by` = 'SYSTEM'
|
|
64
|
+
WHERE `id` IN (
|
|
65
|
+
SELECT `id` FROM (
|
|
66
|
+
SELECT
|
|
67
|
+
`id`,
|
|
68
|
+
ROW_NUMBER() OVER (
|
|
69
|
+
PARTITION BY `invitation_pending_email`
|
|
70
|
+
ORDER BY `created_at` ASC, `id` ASC
|
|
71
|
+
) AS `rn`
|
|
72
|
+
FROM `pf_invitation`
|
|
73
|
+
WHERE `_deleted` = 0
|
|
74
|
+
AND `invitation_status` = 'pending'
|
|
75
|
+
AND `invitation_pending_email` IS NOT NULL
|
|
76
|
+
) AS `ranked`
|
|
77
|
+
WHERE `rn` > 1
|
|
78
|
+
);--> statement-breakpoint
|
|
79
|
+
-- Pending uniqueness applies only after legacy close and duplicate collapse.
|
|
80
|
+
CREATE UNIQUE INDEX `pf_invitation_pendingemailidx_idx` ON `pf_invitation` (`invitation_pending_email`) WHERE _deleted = 0;
|