@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,87 @@
|
|
|
1
|
+
ALTER TABLE `pf_secret_generation` ADD `parent_secret_generation` text(41) REFERENCES pf_secret_generation(id);
|
|
2
|
+
--> statement-breakpoint
|
|
3
|
+
-- Migration-private closure index: Turso Local cannot prepare recursive CTEs.
|
|
4
|
+
-- Copy immutable ancestor identities at insertion, but check their live validity
|
|
5
|
+
-- below. Checking only the parent misses ancestors invalidated after its issuance.
|
|
6
|
+
CREATE TABLE pf_secret_generation_ancestor (
|
|
7
|
+
generation_id text(41) NOT NULL REFERENCES pf_secret_generation(id),
|
|
8
|
+
ancestor_id text(41) NOT NULL REFERENCES pf_secret_generation(id),
|
|
9
|
+
PRIMARY KEY (generation_id, ancestor_id)
|
|
10
|
+
);
|
|
11
|
+
--> statement-breakpoint
|
|
12
|
+
-- All generations predating the parent column are roots.
|
|
13
|
+
INSERT INTO pf_secret_generation_ancestor SELECT id, id FROM pf_secret_generation;
|
|
14
|
+
--> statement-breakpoint
|
|
15
|
+
CREATE TRIGGER pf_secret_generation_ancestor_no_update
|
|
16
|
+
BEFORE UPDATE ON pf_secret_generation_ancestor
|
|
17
|
+
BEGIN
|
|
18
|
+
SELECT RAISE(ABORT, 'Secret Generation ancestry is immutable');
|
|
19
|
+
END;
|
|
20
|
+
--> statement-breakpoint
|
|
21
|
+
CREATE TRIGGER pf_secret_generation_ancestor_no_delete
|
|
22
|
+
BEFORE DELETE ON pf_secret_generation_ancestor
|
|
23
|
+
BEGIN
|
|
24
|
+
SELECT RAISE(ABORT, 'Secret Generation ancestry must be retained');
|
|
25
|
+
END;
|
|
26
|
+
--> statement-breakpoint
|
|
27
|
+
CREATE TRIGGER pf_secret_generation_ancestor_insert
|
|
28
|
+
AFTER INSERT ON pf_secret_generation
|
|
29
|
+
BEGIN
|
|
30
|
+
INSERT INTO pf_secret_generation_ancestor (generation_id, ancestor_id)
|
|
31
|
+
SELECT NEW.id, ancestor_id FROM pf_secret_generation_ancestor
|
|
32
|
+
WHERE generation_id = NEW.parent_secret_generation;
|
|
33
|
+
INSERT INTO pf_secret_generation_ancestor (generation_id, ancestor_id)
|
|
34
|
+
VALUES (NEW.id, NEW.id);
|
|
35
|
+
END;
|
|
36
|
+
--> statement-breakpoint
|
|
37
|
+
-- Lineage is append-only, including against INSERT OR REPLACE and ID reuse.
|
|
38
|
+
CREATE TRIGGER pf_secret_generation_lineage_immutable
|
|
39
|
+
BEFORE UPDATE ON pf_secret_generation
|
|
40
|
+
WHEN NEW.id IS NOT OLD.id
|
|
41
|
+
OR NEW.delegation_id IS NOT OLD.delegation_id
|
|
42
|
+
OR NEW.parent_secret_generation IS NOT OLD.parent_secret_generation
|
|
43
|
+
BEGIN
|
|
44
|
+
SELECT RAISE(ABORT, 'Secret Generation lineage is immutable');
|
|
45
|
+
END;
|
|
46
|
+
--> statement-breakpoint
|
|
47
|
+
CREATE TRIGGER pf_secret_generation_lineage_no_delete
|
|
48
|
+
BEFORE DELETE ON pf_secret_generation
|
|
49
|
+
BEGIN
|
|
50
|
+
SELECT RAISE(ABORT, 'Secret Generation history must be retained');
|
|
51
|
+
END;
|
|
52
|
+
--> statement-breakpoint
|
|
53
|
+
CREATE TRIGGER pf_secret_generation_lineage_insert
|
|
54
|
+
BEFORE INSERT ON pf_secret_generation
|
|
55
|
+
BEGIN
|
|
56
|
+
SELECT RAISE(ABORT, 'Secret Generation identity already exists')
|
|
57
|
+
WHERE EXISTS (SELECT 1 FROM pf_secret_generation WHERE id = NEW.id);
|
|
58
|
+
|
|
59
|
+
SELECT RAISE(ABORT, 'Invalid Secret Generation lineage')
|
|
60
|
+
WHERE NEW.parent_secret_generation IS NOT NULL AND (
|
|
61
|
+
NEW.parent_secret_generation = NEW.id
|
|
62
|
+
OR NOT EXISTS (
|
|
63
|
+
SELECT 1 FROM pf_secret_generation WHERE id = NEW.parent_secret_generation
|
|
64
|
+
)
|
|
65
|
+
OR NEW.secret_expires_at <= NEW.secret_issued_at
|
|
66
|
+
OR EXISTS (
|
|
67
|
+
SELECT 1 FROM pf_secret_generation_ancestor lineage
|
|
68
|
+
JOIN pf_secret_generation a ON a.id = lineage.ancestor_id
|
|
69
|
+
LEFT JOIN pf_delegation d ON d.id = a.delegation_id
|
|
70
|
+
LEFT JOIN pf_provider_user p ON p.id = d.owner_provider_user
|
|
71
|
+
LEFT JOIN pf_user u ON u.id = p.user_id
|
|
72
|
+
WHERE lineage.generation_id = NEW.parent_secret_generation AND (
|
|
73
|
+
a.id = NEW.id OR a.delegation_id = NEW.delegation_id
|
|
74
|
+
OR a._deleted != 0 OR a.secret_revoked_at IS NOT NULL
|
|
75
|
+
OR a.secret_issued_at > NEW.secret_issued_at
|
|
76
|
+
OR a.secret_expires_at <= NEW.secret_issued_at
|
|
77
|
+
OR a.secret_expires_at < NEW.secret_expires_at
|
|
78
|
+
OR d.id IS NULL OR d._deleted != 0 OR d.secret_revoked_at IS NOT NULL
|
|
79
|
+
OR p.id IS NULL OR p._deleted != 0 OR u.id IS NULL OR u._deleted != 0
|
|
80
|
+
OR EXISTS (
|
|
81
|
+
SELECT 1 FROM pf_delegation_history h
|
|
82
|
+
WHERE h.secret_generation_id = a.id AND h.delegation_event = 'replaced'
|
|
83
|
+
)
|
|
84
|
+
)
|
|
85
|
+
)
|
|
86
|
+
);
|
|
87
|
+
END;
|