@opengeni/contracts 2.7.0 → 2.9.2-canary.1
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/dist/agent-authored-durable-text.d.ts +3 -0
- package/dist/atlassian.js +2 -1
- package/dist/chunk-4IVHBXRI.js +221 -0
- package/dist/chunk-4IVHBXRI.js.map +1 -0
- package/dist/{chunk-ILB4IYNN.js → chunk-UGGTRQNU.js} +273 -249
- package/dist/chunk-UGGTRQNU.js.map +1 -0
- package/dist/company-profile.d.ts +275 -1
- package/dist/connection-authority.js +2 -1
- package/dist/connection-authority.js.map +1 -1
- package/dist/google-drive.js +2 -1
- package/dist/google-drive.js.map +1 -1
- package/dist/index.d.ts +282 -3
- package/dist/index.js +71 -5
- package/dist/managed-auth-session-sets.d.ts +19 -0
- package/dist/managed-auth-session-sets.js +12 -1
- package/dist/managed-auth-session-sets.js.map +1 -1
- package/dist/model-picker-order.d.ts +23 -0
- package/dist/model-picker-order.js +31 -0
- package/dist/model-picker-order.js.map +1 -0
- package/dist/organization-membership-lifecycle.d.ts +3 -0
- package/dist/permissions.d.ts +1 -0
- package/dist/personal-github.js +2 -1
- package/dist/personal-github.js.map +1 -1
- package/dist/session-titles.d.ts +9 -0
- package/dist/session-titles.js +17 -0
- package/dist/session-titles.js.map +1 -0
- package/package.json +9 -1
- package/src/agent-authored-durable-text.ts +13 -6
- package/src/company-profile.ts +46 -1
- package/src/index.ts +472 -180
- package/src/managed-auth-session-sets.ts +18 -0
- package/src/model-picker-order.ts +75 -0
- package/src/permissions.ts +1 -0
- package/src/session-titles.ts +12 -5
- package/dist/chunk-ILB4IYNN.js.map +0 -1
|
@@ -511,6 +511,34 @@ export declare const CompanyProfileMutationResponse: z.ZodObject<{
|
|
|
511
511
|
export type CompanyProfileMutationResponse = z.infer<typeof CompanyProfileMutationResponse>;
|
|
512
512
|
export declare const COMPANY_PROFILE_AGENT_APPROVE_OPTION: "activate";
|
|
513
513
|
export declare const COMPANY_PROFILE_AGENT_REJECT_OPTION: "skip";
|
|
514
|
+
export declare const CompanyProfileAgentPolicyMode: z.ZodEnum<{
|
|
515
|
+
automatic: "automatic";
|
|
516
|
+
off: "off";
|
|
517
|
+
suggest: "suggest";
|
|
518
|
+
}>;
|
|
519
|
+
export type CompanyProfileAgentPolicyMode = z.infer<typeof CompanyProfileAgentPolicyMode>;
|
|
520
|
+
export declare const CompanyProfileAgentPolicy: z.ZodObject<{
|
|
521
|
+
organizationId: z.ZodString;
|
|
522
|
+
mode: z.ZodEnum<{
|
|
523
|
+
automatic: "automatic";
|
|
524
|
+
off: "off";
|
|
525
|
+
suggest: "suggest";
|
|
526
|
+
}>;
|
|
527
|
+
version: z.ZodNumber;
|
|
528
|
+
updatedAt: z.ZodString;
|
|
529
|
+
changed: z.ZodOptional<z.ZodBoolean>;
|
|
530
|
+
}, z.core.$strip>;
|
|
531
|
+
export type CompanyProfileAgentPolicy = z.infer<typeof CompanyProfileAgentPolicy>;
|
|
532
|
+
export declare const UpdateCompanyProfileAgentPolicyRequest: z.ZodObject<{
|
|
533
|
+
mode: z.ZodEnum<{
|
|
534
|
+
automatic: "automatic";
|
|
535
|
+
off: "off";
|
|
536
|
+
suggest: "suggest";
|
|
537
|
+
}>;
|
|
538
|
+
expectedVersion: z.ZodNumber;
|
|
539
|
+
operationId: z.ZodString;
|
|
540
|
+
}, z.core.$strict>;
|
|
541
|
+
export type UpdateCompanyProfileAgentPolicyRequest = z.infer<typeof UpdateCompanyProfileAgentPolicyRequest>;
|
|
514
542
|
export declare const CompanyProfileAgentAttempt: z.ZodObject<{
|
|
515
543
|
accountId: z.ZodString;
|
|
516
544
|
workspaceId: z.ZodString;
|
|
@@ -572,7 +600,7 @@ export declare const CompanyProfileAgentHumanInputPrompt: z.ZodObject<{
|
|
|
572
600
|
allowSkip: z.ZodLiteral<false>;
|
|
573
601
|
}, z.core.$strip>;
|
|
574
602
|
export type CompanyProfileAgentHumanInputPrompt = z.infer<typeof CompanyProfileAgentHumanInputPrompt>;
|
|
575
|
-
export declare const
|
|
603
|
+
export declare const CompanyProfileAgentReviewRequiredReceipt: z.ZodObject<{
|
|
576
604
|
status: z.ZodLiteral<"confirmation_required">;
|
|
577
605
|
operationId: z.ZodString;
|
|
578
606
|
proposalReceiptId: z.ZodString;
|
|
@@ -619,6 +647,7 @@ export declare const CompanyProfileAgentProposalReceipt: z.ZodObject<{
|
|
|
619
647
|
createdBySubjectId: z.ZodString;
|
|
620
648
|
createdAt: z.ZodString;
|
|
621
649
|
}, z.core.$strip>;
|
|
650
|
+
policyMode: z.ZodLiteral<"suggest">;
|
|
622
651
|
humanInput: z.ZodObject<{
|
|
623
652
|
questions: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
624
653
|
id: z.ZodString;
|
|
@@ -647,6 +676,251 @@ export declare const CompanyProfileAgentProposalReceipt: z.ZodObject<{
|
|
|
647
676
|
confirmWith: z.ZodLiteral<"company_profile_confirm">;
|
|
648
677
|
replayed: z.ZodBoolean;
|
|
649
678
|
}, z.core.$strip>;
|
|
679
|
+
export type CompanyProfileAgentReviewRequiredReceipt = z.infer<typeof CompanyProfileAgentReviewRequiredReceipt>;
|
|
680
|
+
export declare const CompanyProfileAgentAutomaticActivationReceipt: z.ZodObject<{
|
|
681
|
+
status: z.ZodLiteral<"activated">;
|
|
682
|
+
operationId: z.ZodString;
|
|
683
|
+
proposalReceiptId: z.ZodString;
|
|
684
|
+
automaticActivationReceiptId: z.ZodString;
|
|
685
|
+
policyMode: z.ZodLiteral<"automatic">;
|
|
686
|
+
mutation: z.ZodObject<{
|
|
687
|
+
revision: z.ZodNullable<z.ZodObject<{
|
|
688
|
+
id: z.ZodString;
|
|
689
|
+
revision: z.ZodNumber;
|
|
690
|
+
contentHash: z.ZodString;
|
|
691
|
+
operationId: z.ZodString;
|
|
692
|
+
accountId: z.ZodString;
|
|
693
|
+
intent: z.ZodEnum<{
|
|
694
|
+
active: "active";
|
|
695
|
+
proposal: "proposal";
|
|
696
|
+
}>;
|
|
697
|
+
profile: z.ZodObject<{
|
|
698
|
+
identity: z.ZodNullable<z.ZodString>;
|
|
699
|
+
mission: z.ZodNullable<z.ZodString>;
|
|
700
|
+
products: z.ZodArray<z.ZodObject<{
|
|
701
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
702
|
+
content: z.ZodString;
|
|
703
|
+
}, z.core.$strip>>;
|
|
704
|
+
customers: z.ZodArray<z.ZodObject<{
|
|
705
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
706
|
+
content: z.ZodString;
|
|
707
|
+
}, z.core.$strip>>;
|
|
708
|
+
goals: z.ZodArray<z.ZodObject<{
|
|
709
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
710
|
+
content: z.ZodString;
|
|
711
|
+
}, z.core.$strip>>;
|
|
712
|
+
constraints: z.ZodArray<z.ZodObject<{
|
|
713
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
714
|
+
content: z.ZodString;
|
|
715
|
+
}, z.core.$strip>>;
|
|
716
|
+
}, z.core.$strict>;
|
|
717
|
+
provenance: z.ZodObject<{
|
|
718
|
+
source: z.ZodEnum<{
|
|
719
|
+
agent_admin: "agent_admin";
|
|
720
|
+
durable_learning: "durable_learning";
|
|
721
|
+
human: "human";
|
|
722
|
+
migration: "migration";
|
|
723
|
+
}>;
|
|
724
|
+
sourceId: z.ZodNullable<z.ZodString>;
|
|
725
|
+
}, z.core.$strip>;
|
|
726
|
+
supersedesRevisionId: z.ZodNullable<z.ZodString>;
|
|
727
|
+
createdBySubjectId: z.ZodString;
|
|
728
|
+
createdAt: z.ZodString;
|
|
729
|
+
}, z.core.$strip>>;
|
|
730
|
+
head: z.ZodNullable<z.ZodObject<{
|
|
731
|
+
accountId: z.ZodString;
|
|
732
|
+
revisionId: z.ZodString;
|
|
733
|
+
revision: z.ZodNumber;
|
|
734
|
+
contentHash: z.ZodString;
|
|
735
|
+
activationVersion: z.ZodNumber;
|
|
736
|
+
activatedAt: z.ZodString;
|
|
737
|
+
}, z.core.$strip>>;
|
|
738
|
+
event: z.ZodNullable<z.ZodObject<{
|
|
739
|
+
id: z.ZodString;
|
|
740
|
+
operationId: z.ZodString;
|
|
741
|
+
accountId: z.ZodString;
|
|
742
|
+
type: z.ZodEnum<{
|
|
743
|
+
activate: "activate";
|
|
744
|
+
rollback: "rollback";
|
|
745
|
+
}>;
|
|
746
|
+
activationVersion: z.ZodNumber;
|
|
747
|
+
oldRevision: z.ZodNullable<z.ZodObject<{
|
|
748
|
+
id: z.ZodString;
|
|
749
|
+
revision: z.ZodNumber;
|
|
750
|
+
contentHash: z.ZodString;
|
|
751
|
+
}, z.core.$strip>>;
|
|
752
|
+
newRevision: z.ZodNullable<z.ZodObject<{
|
|
753
|
+
id: z.ZodString;
|
|
754
|
+
revision: z.ZodNumber;
|
|
755
|
+
contentHash: z.ZodString;
|
|
756
|
+
}, z.core.$strip>>;
|
|
757
|
+
actorSubjectId: z.ZodString;
|
|
758
|
+
reason: z.ZodString;
|
|
759
|
+
createdAt: z.ZodString;
|
|
760
|
+
}, z.core.$strip>>;
|
|
761
|
+
}, z.core.$strip>;
|
|
762
|
+
replayed: z.ZodBoolean;
|
|
763
|
+
}, z.core.$strip>;
|
|
764
|
+
export type CompanyProfileAgentAutomaticActivationReceipt = z.infer<typeof CompanyProfileAgentAutomaticActivationReceipt>;
|
|
765
|
+
export declare const CompanyProfileAgentProposalReceipt: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
766
|
+
status: z.ZodLiteral<"confirmation_required">;
|
|
767
|
+
operationId: z.ZodString;
|
|
768
|
+
proposalReceiptId: z.ZodString;
|
|
769
|
+
revision: z.ZodObject<{
|
|
770
|
+
id: z.ZodString;
|
|
771
|
+
revision: z.ZodNumber;
|
|
772
|
+
contentHash: z.ZodString;
|
|
773
|
+
operationId: z.ZodString;
|
|
774
|
+
accountId: z.ZodString;
|
|
775
|
+
intent: z.ZodEnum<{
|
|
776
|
+
active: "active";
|
|
777
|
+
proposal: "proposal";
|
|
778
|
+
}>;
|
|
779
|
+
profile: z.ZodObject<{
|
|
780
|
+
identity: z.ZodNullable<z.ZodString>;
|
|
781
|
+
mission: z.ZodNullable<z.ZodString>;
|
|
782
|
+
products: z.ZodArray<z.ZodObject<{
|
|
783
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
784
|
+
content: z.ZodString;
|
|
785
|
+
}, z.core.$strip>>;
|
|
786
|
+
customers: z.ZodArray<z.ZodObject<{
|
|
787
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
788
|
+
content: z.ZodString;
|
|
789
|
+
}, z.core.$strip>>;
|
|
790
|
+
goals: z.ZodArray<z.ZodObject<{
|
|
791
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
792
|
+
content: z.ZodString;
|
|
793
|
+
}, z.core.$strip>>;
|
|
794
|
+
constraints: z.ZodArray<z.ZodObject<{
|
|
795
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
796
|
+
content: z.ZodString;
|
|
797
|
+
}, z.core.$strip>>;
|
|
798
|
+
}, z.core.$strict>;
|
|
799
|
+
provenance: z.ZodObject<{
|
|
800
|
+
source: z.ZodEnum<{
|
|
801
|
+
agent_admin: "agent_admin";
|
|
802
|
+
durable_learning: "durable_learning";
|
|
803
|
+
human: "human";
|
|
804
|
+
migration: "migration";
|
|
805
|
+
}>;
|
|
806
|
+
sourceId: z.ZodNullable<z.ZodString>;
|
|
807
|
+
}, z.core.$strip>;
|
|
808
|
+
supersedesRevisionId: z.ZodNullable<z.ZodString>;
|
|
809
|
+
createdBySubjectId: z.ZodString;
|
|
810
|
+
createdAt: z.ZodString;
|
|
811
|
+
}, z.core.$strip>;
|
|
812
|
+
policyMode: z.ZodLiteral<"suggest">;
|
|
813
|
+
humanInput: z.ZodObject<{
|
|
814
|
+
questions: z.ZodArray<z.ZodLazy<z.ZodObject<{
|
|
815
|
+
id: z.ZodString;
|
|
816
|
+
kind: z.ZodEnum<{
|
|
817
|
+
multi_select: "multi_select";
|
|
818
|
+
single_select: "single_select";
|
|
819
|
+
text: "text";
|
|
820
|
+
}>;
|
|
821
|
+
prompt: z.ZodString;
|
|
822
|
+
label: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
823
|
+
helpText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
824
|
+
options: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
825
|
+
id: z.ZodString;
|
|
826
|
+
label: z.ZodString;
|
|
827
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
828
|
+
}, z.core.$strip>>>;
|
|
829
|
+
required: z.ZodDefault<z.ZodBoolean>;
|
|
830
|
+
allowOther: z.ZodDefault<z.ZodBoolean>;
|
|
831
|
+
validation: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
832
|
+
minSelections: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
833
|
+
maxSelections: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
834
|
+
}, z.core.$strip>>>;
|
|
835
|
+
}, z.core.$strip>>>;
|
|
836
|
+
allowSkip: z.ZodLiteral<false>;
|
|
837
|
+
}, z.core.$strip>;
|
|
838
|
+
confirmWith: z.ZodLiteral<"company_profile_confirm">;
|
|
839
|
+
replayed: z.ZodBoolean;
|
|
840
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
841
|
+
status: z.ZodLiteral<"activated">;
|
|
842
|
+
operationId: z.ZodString;
|
|
843
|
+
proposalReceiptId: z.ZodString;
|
|
844
|
+
automaticActivationReceiptId: z.ZodString;
|
|
845
|
+
policyMode: z.ZodLiteral<"automatic">;
|
|
846
|
+
mutation: z.ZodObject<{
|
|
847
|
+
revision: z.ZodNullable<z.ZodObject<{
|
|
848
|
+
id: z.ZodString;
|
|
849
|
+
revision: z.ZodNumber;
|
|
850
|
+
contentHash: z.ZodString;
|
|
851
|
+
operationId: z.ZodString;
|
|
852
|
+
accountId: z.ZodString;
|
|
853
|
+
intent: z.ZodEnum<{
|
|
854
|
+
active: "active";
|
|
855
|
+
proposal: "proposal";
|
|
856
|
+
}>;
|
|
857
|
+
profile: z.ZodObject<{
|
|
858
|
+
identity: z.ZodNullable<z.ZodString>;
|
|
859
|
+
mission: z.ZodNullable<z.ZodString>;
|
|
860
|
+
products: z.ZodArray<z.ZodObject<{
|
|
861
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
862
|
+
content: z.ZodString;
|
|
863
|
+
}, z.core.$strip>>;
|
|
864
|
+
customers: z.ZodArray<z.ZodObject<{
|
|
865
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
866
|
+
content: z.ZodString;
|
|
867
|
+
}, z.core.$strip>>;
|
|
868
|
+
goals: z.ZodArray<z.ZodObject<{
|
|
869
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
870
|
+
content: z.ZodString;
|
|
871
|
+
}, z.core.$strip>>;
|
|
872
|
+
constraints: z.ZodArray<z.ZodObject<{
|
|
873
|
+
key: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>;
|
|
874
|
+
content: z.ZodString;
|
|
875
|
+
}, z.core.$strip>>;
|
|
876
|
+
}, z.core.$strict>;
|
|
877
|
+
provenance: z.ZodObject<{
|
|
878
|
+
source: z.ZodEnum<{
|
|
879
|
+
agent_admin: "agent_admin";
|
|
880
|
+
durable_learning: "durable_learning";
|
|
881
|
+
human: "human";
|
|
882
|
+
migration: "migration";
|
|
883
|
+
}>;
|
|
884
|
+
sourceId: z.ZodNullable<z.ZodString>;
|
|
885
|
+
}, z.core.$strip>;
|
|
886
|
+
supersedesRevisionId: z.ZodNullable<z.ZodString>;
|
|
887
|
+
createdBySubjectId: z.ZodString;
|
|
888
|
+
createdAt: z.ZodString;
|
|
889
|
+
}, z.core.$strip>>;
|
|
890
|
+
head: z.ZodNullable<z.ZodObject<{
|
|
891
|
+
accountId: z.ZodString;
|
|
892
|
+
revisionId: z.ZodString;
|
|
893
|
+
revision: z.ZodNumber;
|
|
894
|
+
contentHash: z.ZodString;
|
|
895
|
+
activationVersion: z.ZodNumber;
|
|
896
|
+
activatedAt: z.ZodString;
|
|
897
|
+
}, z.core.$strip>>;
|
|
898
|
+
event: z.ZodNullable<z.ZodObject<{
|
|
899
|
+
id: z.ZodString;
|
|
900
|
+
operationId: z.ZodString;
|
|
901
|
+
accountId: z.ZodString;
|
|
902
|
+
type: z.ZodEnum<{
|
|
903
|
+
activate: "activate";
|
|
904
|
+
rollback: "rollback";
|
|
905
|
+
}>;
|
|
906
|
+
activationVersion: z.ZodNumber;
|
|
907
|
+
oldRevision: z.ZodNullable<z.ZodObject<{
|
|
908
|
+
id: z.ZodString;
|
|
909
|
+
revision: z.ZodNumber;
|
|
910
|
+
contentHash: z.ZodString;
|
|
911
|
+
}, z.core.$strip>>;
|
|
912
|
+
newRevision: z.ZodNullable<z.ZodObject<{
|
|
913
|
+
id: z.ZodString;
|
|
914
|
+
revision: z.ZodNumber;
|
|
915
|
+
contentHash: z.ZodString;
|
|
916
|
+
}, z.core.$strip>>;
|
|
917
|
+
actorSubjectId: z.ZodString;
|
|
918
|
+
reason: z.ZodString;
|
|
919
|
+
createdAt: z.ZodString;
|
|
920
|
+
}, z.core.$strip>>;
|
|
921
|
+
}, z.core.$strip>;
|
|
922
|
+
replayed: z.ZodBoolean;
|
|
923
|
+
}, z.core.$strip>], "status">;
|
|
650
924
|
export type CompanyProfileAgentProposalReceipt = z.infer<typeof CompanyProfileAgentProposalReceipt>;
|
|
651
925
|
export declare const CompanyProfileAgentConfirmRequest: z.ZodObject<{
|
|
652
926
|
operationId: z.ZodString;
|
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
SessionTenancyVisibility,
|
|
5
5
|
UserResourceAuthorityGrant,
|
|
6
6
|
UserResourceDelegation
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-UGGTRQNU.js";
|
|
8
8
|
import "./chunk-WYBDERIY.js";
|
|
9
9
|
import "./chunk-MRWYRAS5.js";
|
|
10
|
+
import "./chunk-4IVHBXRI.js";
|
|
10
11
|
import "./chunk-CM6BMECR.js";
|
|
11
12
|
import "./chunk-JUFK3T4Q.js";
|
|
12
13
|
import "./chunk-YBW5JSA3.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection-authority.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ConnectionKind,\n ManagedUserResourceGrantMode,\n SessionTenancyVisibility,\n UserResourceAuthorityGrant,\n UserResourceDelegation,\n} from \"./index\";\n\n/** The only generic grant action that authorizes use of a connection. */\nexport const ConnectionUseAction = z.literal(\"connection.use\");\nexport type ConnectionUseAction = z.infer<typeof ConnectionUseAction>;\n\n/**\n * Connection authority is either workspace-owned or user-owned. Omission is\n * intentionally compatible with the historical workspace connection path.\n */\nexport const ConnectionAuthorityEnvelope = z\n .object({\n scope: z.enum([\"workspace\", \"user\"]).default(\"workspace\"),\n userDelegation: UserResourceDelegation.optional(),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.scope === \"workspace\" && value.userDelegation !== undefined) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"workspace connections cannot carry user delegation\",\n });\n return;\n }\n if (value.scope === \"user\" && value.userDelegation === undefined) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"user connections require an immutable delegation\",\n });\n return;\n }\n if (value.userDelegation && value.userDelegation.action !== ConnectionUseAction.value) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"action\"],\n message: \"connection delegation must use connection.use\",\n });\n }\n });\nexport type ConnectionAuthorityEnvelope = z.infer<typeof ConnectionAuthorityEnvelope>;\n\nexport const ConnectionAuthorityGrant = UserResourceAuthorityGrant.extend({\n action: ConnectionUseAction,\n}).strict();\nexport type ConnectionAuthorityGrant = z.infer<typeof ConnectionAuthorityGrant>;\n\n/** Owner-only opaque projection; connection identity and owner metadata stay server-side. */\nexport const ConnectionAuthoritySummary = z\n .object({\n authorityId: z.string().uuid(),\n resourceId: z.string().uuid(),\n originWorkspaceId: z.string().uuid().nullable(),\n generation: z.number().int().positive(),\n status: z.enum([\"active\", \"retained\", \"revoked\"]),\n grants: z.array(ConnectionAuthorityGrant),\n })\n .strict();\nexport type ConnectionAuthoritySummary = z.infer<typeof ConnectionAuthoritySummary>;\n\nexport const ListConnectionAuthoritiesQuery = z\n .object({\n scope: z.literal(\"user\"),\n cursor: z.string().uuid().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n })\n .strict();\nexport const ListConnectionAuthoritiesResponse = z\n .object({\n scope: z.literal(\"user\"),\n authorities: z.array(ConnectionAuthoritySummary),\n nextCursor: z.string().uuid().nullable(),\n })\n .strict();\n\nexport const IssueConnectionUseGrantRequest = z\n .object({\n scope: z.literal(\"user\"),\n mode: ManagedUserResourceGrantMode,\n context: SessionTenancyVisibility,\n sessionId: z.string().uuid().nullable().optional(),\n expectedAuthorityEpoch: z.number().int().positive().nullable().optional(),\n workspaceSharedAcknowledged: z.boolean().default(false),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.context === \"workspace_shared\" && !value.workspaceSharedAcknowledged) {\n context.addIssue({\n code: \"custom\",\n path: [\"workspaceSharedAcknowledged\"],\n message: \"workspace_shared requires durable shared-output acknowledgement\",\n });\n }\n if (value.mode === \"always\" && (value.sessionId || value.expectedAuthorityEpoch)) {\n context.addIssue({ code: \"custom\", path: [\"sessionId\"], message: \"always is unbound\" });\n }\n if (value.mode === \"session\" && (!value.sessionId || !value.expectedAuthorityEpoch)) {\n context.addIssue({\n code: \"custom\",\n path: [\"sessionId\"],\n message: \"session requires a target session and expectedAuthorityEpoch\",\n });\n }\n });\nexport type IssueConnectionUseGrantRequest = z.infer<typeof IssueConnectionUseGrantRequest>;\n\nexport const RevokeConnectionUseGrantQuery = z.object({ scope: z.literal(\"user\") }).strict();\n\nexport const ConnectionUseGrantMutationResponse = z\n .object({\n scope: z.literal(\"user\"),\n grant: ConnectionAuthorityGrant,\n })\n .strict();\nexport type ConnectionUseGrantMutationResponse = z.infer<typeof ConnectionUseGrantMutationResponse>;\n\nexport const ConnectionUseGrantRevocationResponse = z\n .object({\n scope: z.literal(\"user\"),\n grant: z\n .object({\n grantId: z.string().uuid(),\n generation: z.number().int().positive(),\n status: z.literal(\"revoked\"),\n revokedAt: z.string().datetime(),\n })\n .strict(),\n })\n .strict();\nexport type ConnectionUseGrantRevocationResponse = z.infer<\n typeof ConnectionUseGrantRevocationResponse\n>;\n\nexport const ConnectionAuthoritySelectionSource = z.enum([\n \"explicit_workspace\",\n \"legacy_workspace_omission\",\n \"legacy_user_compatibility\",\n \"user_delegation\",\n]);\nexport type ConnectionAuthoritySelectionSource = z.infer<typeof ConnectionAuthoritySelectionSource>;\n\nexport const ConnectionUseSelectionSource = z\n .string()\n .min(1)\n .max(128)\n .regex(/^[a-z0-9](?:[a-z0-9._:-]*[a-z0-9])?$/u);\nexport type ConnectionUseSelectionSource = z.infer<typeof ConnectionUseSelectionSource>;\n\nconst AcceptedConnectionWork = z.discriminatedUnion(\"kind\", [\n z\n .object({\n kind: z.literal(\"turn\"),\n turnId: z.string().uuid(),\n })\n .strict(),\n z\n .object({\n kind: z.literal(\"scheduled_task\"),\n taskId: z.string().uuid(),\n taskAuthorityRevision: z.number().int().positive(),\n runId: z.string().uuid(),\n })\n .strict(),\n]);\n\n/**\n * Internal, credential-free authority frozen when work is accepted. Personal\n * owner identity is retained only for live authorization and usage/audit\n * attribution; it is never part of the public delegation envelope.\n */\nexport const ConnectionUseAuthoritySnapshot = z\n .object({\n organizationId: z.string().uuid(),\n originWorkspaceId: z.string().uuid(),\n targetWorkspaceId: z.string().uuid(),\n targetSessionId: z.string().uuid(),\n targetSessionVisibility: SessionTenancyVisibility,\n targetSessionAuthorityEpoch: z.number().int().positive(),\n acceptedWork: AcceptedConnectionWork,\n connectionId: z.string().uuid(),\n connectionGeneration: z.number().int().positive(),\n connectionStatus: z.literal(\"active\"),\n providerDomain: z.string().min(1).max(2048),\n connectionKind: ConnectionKind,\n scope: z.enum([\"workspace\", \"user\", \"legacy_user\"]),\n ownerSubjectId: z.string().min(1).max(512).nullable(),\n ownerOrganizationMembershipId: z.string().uuid().nullable(),\n ownerMembershipAuthorizationRevision: z.number().int().positive().nullable().default(null),\n authoritySource: ConnectionAuthoritySelectionSource,\n selectionSources: z.array(ConnectionUseSelectionSource).min(1).max(128),\n userDelegation: UserResourceDelegation.nullable(),\n })\n .strict()\n .superRefine((value, context) => {\n const ownedBySubject = value.scope !== \"workspace\";\n const delegated = value.scope === \"user\";\n if (ownedBySubject !== (value.ownerSubjectId !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerSubjectId\"],\n message: \"personal connections retain an owner subject\",\n });\n }\n if (delegated !== (value.ownerOrganizationMembershipId !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerOrganizationMembershipId\"],\n message: \"only user connections retain an owner membership\",\n });\n }\n if (delegated !== (value.ownerMembershipAuthorizationRevision !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerMembershipAuthorizationRevision\"],\n message: \"only user connections retain an owner membership revision\",\n });\n }\n if (delegated !== (value.userDelegation !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"only user connections retain a delegation\",\n });\n }\n if (delegated && value.authoritySource !== \"user_delegation\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"user connections require user_delegation provenance\",\n });\n }\n if (!delegated && value.authoritySource === \"user_delegation\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"non-delegated connections cannot claim user delegation provenance\",\n });\n }\n if (value.scope === \"legacy_user\" && value.authoritySource !== \"legacy_user_compatibility\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"legacy user connections require explicit compatibility provenance\",\n });\n }\n if (value.scope === \"workspace\" && value.authoritySource === \"legacy_user_compatibility\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"workspace connections cannot claim legacy user provenance\",\n });\n }\n if (!delegated && value.originWorkspaceId !== value.targetWorkspaceId) {\n context.addIssue({\n code: \"custom\",\n path: [\"originWorkspaceId\"],\n message: \"workspace connections must be owned by the target workspace\",\n });\n }\n const delegation = value.userDelegation;\n if (!delegation) return;\n const exactFacts: Array<[boolean, (string | number)[], string]> = [\n [\n delegation.organizationId === value.organizationId,\n [\"userDelegation\", \"organizationId\"],\n \"delegation organization mismatch\",\n ],\n [\n delegation.workspaceId === value.targetWorkspaceId,\n [\"userDelegation\", \"workspaceId\"],\n \"delegation target workspace mismatch\",\n ],\n [\n delegation.action === ConnectionUseAction.value,\n [\"userDelegation\", \"action\"],\n \"delegation action mismatch\",\n ],\n [\n delegation.context === value.targetSessionVisibility,\n [\"userDelegation\", \"context\"],\n \"delegation visibility mismatch\",\n ],\n ];\n for (const [matches, path, message] of exactFacts) {\n if (!matches) context.addIssue({ code: \"custom\", path, message });\n }\n if (delegation.sessionId !== null && delegation.sessionId !== value.targetSessionId) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"sessionId\"],\n message: \"delegation session mismatch\",\n });\n }\n if (\n delegation.authorityEpoch !== null &&\n delegation.authorityEpoch !== value.targetSessionAuthorityEpoch\n ) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"authorityEpoch\"],\n message: \"delegation authority epoch mismatch\",\n });\n }\n });\nexport type ConnectionUseAuthoritySnapshot = z.infer<typeof ConnectionUseAuthoritySnapshot>;\n\nexport const ConnectionUseDenialReason = z.enum([\n \"tenant_mismatch\",\n \"workspace_access_inactive\",\n \"session_inactive\",\n \"session_identity_changed\",\n \"session_visibility_changed\",\n \"session_authority_epoch_changed\",\n \"accepted_attempt_authority_required\",\n \"accepted_snapshot_digest_changed\",\n \"connection_missing\",\n \"connection_identity_changed\",\n \"connection_generation_changed\",\n \"connection_status_inactive\",\n \"connection_owner_changed\",\n \"owner_membership_inactive\",\n \"authority_missing\",\n \"authority_identity_changed\",\n \"authority_generation_changed\",\n \"authority_status_inactive\",\n \"grant_missing\",\n \"grant_identity_changed\",\n \"grant_generation_changed\",\n \"grant_status_inactive\",\n \"grant_expired\",\n \"grant_already_consumed\",\n]);\nexport type ConnectionUseDenialReason = z.infer<typeof ConnectionUseDenialReason>;\n\nconst ConnectionUseAttributionFields = z\n .object({\n organizationId: z.string().uuid(),\n workspaceId: z.string().uuid(),\n sessionId: z.string().uuid(),\n connectionId: z.string().uuid(),\n connectionGeneration: z.number().int().positive(),\n scope: z.enum([\"workspace\", \"user\", \"legacy_user\"]),\n ownerSubjectId: z.string().min(1).max(512).nullable(),\n authorityId: z.string().uuid().nullable(),\n grantId: z.string().uuid().nullable(),\n })\n .strict();\n\nfunction refineConnectionUseAttribution(\n value: z.infer<typeof ConnectionUseAttributionFields>,\n context: z.RefinementCtx,\n): void {\n const personal = value.scope !== \"workspace\";\n for (const field of [\"ownerSubjectId\"] as const) {\n if (personal !== (value[field] !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [field],\n message: personal\n ? `personal attribution requires ${field}`\n : `workspace attribution cannot carry ${field}`,\n });\n }\n }\n const delegated = value.scope === \"user\";\n for (const field of [\"authorityId\", \"grantId\"] as const) {\n if (delegated !== (value[field] !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [field],\n message: delegated\n ? `delegated personal attribution requires ${field}`\n : `non-delegated attribution cannot carry ${field}`,\n });\n }\n }\n}\n\n/** Metadata-only attribution emitted after pre-use authorization. */\nexport const ConnectionUseAttribution = ConnectionUseAttributionFields.superRefine(\n refineConnectionUseAttribution,\n);\nexport type ConnectionUseAttribution = z.infer<typeof ConnectionUseAttribution>;\n\nexport const ConnectionUseAuditFact = ConnectionUseAttributionFields.extend({\n outcome: z.enum([\"authorized\", \"denied\"]),\n denialReason: ConnectionUseDenialReason.nullable(),\n occurredAt: z.string().datetime({ offset: true }),\n}).superRefine((value, context) => {\n refineConnectionUseAttribution(value, context);\n if ((value.outcome === \"denied\") !== (value.denialReason !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"denialReason\"],\n message: \"only denied connection use carries a denial reason\",\n });\n }\n});\nexport type ConnectionUseAuditFact = z.infer<typeof ConnectionUseAuditFact>;\n\nexport const ConnectionUseAuthorizationResult = z.discriminatedUnion(\"status\", [\n z.object({ status: z.literal(\"authorized\"), attribution: ConnectionUseAttribution }).strict(),\n z.object({ status: z.literal(\"denied\"), reason: ConnectionUseDenialReason }).strict(),\n]);\nexport type ConnectionUseAuthorizationResult = z.infer<typeof ConnectionUseAuthorizationResult>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAUX,IAAM,sBAAsB,EAAE,QAAQ,gBAAgB;AAOtD,IAAM,8BAA8B,EACxC,OAAO;AAAA,EACN,OAAO,EAAE,KAAK,CAAC,aAAa,MAAM,CAAC,EAAE,QAAQ,WAAW;AAAA,EACxD,gBAAgB,uBAAuB,SAAS;AAClD,CAAC,EACA,OAAO,EACP,YAAY,CAAC,OAAO,YAAY;AAC/B,MAAI,MAAM,UAAU,eAAe,MAAM,mBAAmB,QAAW;AACrE,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,gBAAgB;AAAA,MACvB,SAAS;AAAA,IACX,CAAC;AACD;AAAA,EACF;AACA,MAAI,MAAM,UAAU,UAAU,MAAM,mBAAmB,QAAW;AACh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AAa,yBAAyB,CAAC,EAAE,OAAO;AAAA,EAC5F,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,QAAQ,GAAG,QAAQ,0BAA0B,CAAC,EAAE,OAAO;AACtF,CAAC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/connection-authority.ts"],"sourcesContent":["import { z } from \"zod\";\nimport {\n ConnectionKind,\n ManagedUserResourceGrantMode,\n SessionTenancyVisibility,\n UserResourceAuthorityGrant,\n UserResourceDelegation,\n} from \"./index\";\n\n/** The only generic grant action that authorizes use of a connection. */\nexport const ConnectionUseAction = z.literal(\"connection.use\");\nexport type ConnectionUseAction = z.infer<typeof ConnectionUseAction>;\n\n/**\n * Connection authority is either workspace-owned or user-owned. Omission is\n * intentionally compatible with the historical workspace connection path.\n */\nexport const ConnectionAuthorityEnvelope = z\n .object({\n scope: z.enum([\"workspace\", \"user\"]).default(\"workspace\"),\n userDelegation: UserResourceDelegation.optional(),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.scope === \"workspace\" && value.userDelegation !== undefined) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"workspace connections cannot carry user delegation\",\n });\n return;\n }\n if (value.scope === \"user\" && value.userDelegation === undefined) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"user connections require an immutable delegation\",\n });\n return;\n }\n if (value.userDelegation && value.userDelegation.action !== ConnectionUseAction.value) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"action\"],\n message: \"connection delegation must use connection.use\",\n });\n }\n });\nexport type ConnectionAuthorityEnvelope = z.infer<typeof ConnectionAuthorityEnvelope>;\n\nexport const ConnectionAuthorityGrant = UserResourceAuthorityGrant.extend({\n action: ConnectionUseAction,\n}).strict();\nexport type ConnectionAuthorityGrant = z.infer<typeof ConnectionAuthorityGrant>;\n\n/** Owner-only opaque projection; connection identity and owner metadata stay server-side. */\nexport const ConnectionAuthoritySummary = z\n .object({\n authorityId: z.string().uuid(),\n resourceId: z.string().uuid(),\n originWorkspaceId: z.string().uuid().nullable(),\n generation: z.number().int().positive(),\n status: z.enum([\"active\", \"retained\", \"revoked\"]),\n grants: z.array(ConnectionAuthorityGrant),\n })\n .strict();\nexport type ConnectionAuthoritySummary = z.infer<typeof ConnectionAuthoritySummary>;\n\nexport const ListConnectionAuthoritiesQuery = z\n .object({\n scope: z.literal(\"user\"),\n cursor: z.string().uuid().optional(),\n limit: z.coerce.number().int().min(1).max(100).default(50),\n })\n .strict();\nexport const ListConnectionAuthoritiesResponse = z\n .object({\n scope: z.literal(\"user\"),\n authorities: z.array(ConnectionAuthoritySummary),\n nextCursor: z.string().uuid().nullable(),\n })\n .strict();\n\nexport const IssueConnectionUseGrantRequest = z\n .object({\n scope: z.literal(\"user\"),\n mode: ManagedUserResourceGrantMode,\n context: SessionTenancyVisibility,\n sessionId: z.string().uuid().nullable().optional(),\n expectedAuthorityEpoch: z.number().int().positive().nullable().optional(),\n workspaceSharedAcknowledged: z.boolean().default(false),\n })\n .strict()\n .superRefine((value, context) => {\n if (value.context === \"workspace_shared\" && !value.workspaceSharedAcknowledged) {\n context.addIssue({\n code: \"custom\",\n path: [\"workspaceSharedAcknowledged\"],\n message: \"workspace_shared requires durable shared-output acknowledgement\",\n });\n }\n if (value.mode === \"always\" && (value.sessionId || value.expectedAuthorityEpoch)) {\n context.addIssue({ code: \"custom\", path: [\"sessionId\"], message: \"always is unbound\" });\n }\n if (value.mode === \"session\" && (!value.sessionId || !value.expectedAuthorityEpoch)) {\n context.addIssue({\n code: \"custom\",\n path: [\"sessionId\"],\n message: \"session requires a target session and expectedAuthorityEpoch\",\n });\n }\n });\nexport type IssueConnectionUseGrantRequest = z.infer<typeof IssueConnectionUseGrantRequest>;\n\nexport const RevokeConnectionUseGrantQuery = z.object({ scope: z.literal(\"user\") }).strict();\n\nexport const ConnectionUseGrantMutationResponse = z\n .object({\n scope: z.literal(\"user\"),\n grant: ConnectionAuthorityGrant,\n })\n .strict();\nexport type ConnectionUseGrantMutationResponse = z.infer<typeof ConnectionUseGrantMutationResponse>;\n\nexport const ConnectionUseGrantRevocationResponse = z\n .object({\n scope: z.literal(\"user\"),\n grant: z\n .object({\n grantId: z.string().uuid(),\n generation: z.number().int().positive(),\n status: z.literal(\"revoked\"),\n revokedAt: z.string().datetime(),\n })\n .strict(),\n })\n .strict();\nexport type ConnectionUseGrantRevocationResponse = z.infer<\n typeof ConnectionUseGrantRevocationResponse\n>;\n\nexport const ConnectionAuthoritySelectionSource = z.enum([\n \"explicit_workspace\",\n \"legacy_workspace_omission\",\n \"legacy_user_compatibility\",\n \"user_delegation\",\n]);\nexport type ConnectionAuthoritySelectionSource = z.infer<typeof ConnectionAuthoritySelectionSource>;\n\nexport const ConnectionUseSelectionSource = z\n .string()\n .min(1)\n .max(128)\n .regex(/^[a-z0-9](?:[a-z0-9._:-]*[a-z0-9])?$/u);\nexport type ConnectionUseSelectionSource = z.infer<typeof ConnectionUseSelectionSource>;\n\nconst AcceptedConnectionWork = z.discriminatedUnion(\"kind\", [\n z\n .object({\n kind: z.literal(\"turn\"),\n turnId: z.string().uuid(),\n })\n .strict(),\n z\n .object({\n kind: z.literal(\"scheduled_task\"),\n taskId: z.string().uuid(),\n taskAuthorityRevision: z.number().int().positive(),\n runId: z.string().uuid(),\n })\n .strict(),\n]);\n\n/**\n * Internal, credential-free authority frozen when work is accepted. Personal\n * owner identity is retained only for live authorization and usage/audit\n * attribution; it is never part of the public delegation envelope.\n */\nexport const ConnectionUseAuthoritySnapshot = z\n .object({\n organizationId: z.string().uuid(),\n originWorkspaceId: z.string().uuid(),\n targetWorkspaceId: z.string().uuid(),\n targetSessionId: z.string().uuid(),\n targetSessionVisibility: SessionTenancyVisibility,\n targetSessionAuthorityEpoch: z.number().int().positive(),\n acceptedWork: AcceptedConnectionWork,\n connectionId: z.string().uuid(),\n connectionGeneration: z.number().int().positive(),\n connectionStatus: z.literal(\"active\"),\n providerDomain: z.string().min(1).max(2048),\n connectionKind: ConnectionKind,\n scope: z.enum([\"workspace\", \"user\", \"legacy_user\"]),\n ownerSubjectId: z.string().min(1).max(512).nullable(),\n ownerOrganizationMembershipId: z.string().uuid().nullable(),\n ownerMembershipAuthorizationRevision: z.number().int().positive().nullable().default(null),\n authoritySource: ConnectionAuthoritySelectionSource,\n selectionSources: z.array(ConnectionUseSelectionSource).min(1).max(128),\n userDelegation: UserResourceDelegation.nullable(),\n })\n .strict()\n .superRefine((value, context) => {\n const ownedBySubject = value.scope !== \"workspace\";\n const delegated = value.scope === \"user\";\n if (ownedBySubject !== (value.ownerSubjectId !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerSubjectId\"],\n message: \"personal connections retain an owner subject\",\n });\n }\n if (delegated !== (value.ownerOrganizationMembershipId !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerOrganizationMembershipId\"],\n message: \"only user connections retain an owner membership\",\n });\n }\n if (delegated !== (value.ownerMembershipAuthorizationRevision !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"ownerMembershipAuthorizationRevision\"],\n message: \"only user connections retain an owner membership revision\",\n });\n }\n if (delegated !== (value.userDelegation !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\"],\n message: \"only user connections retain a delegation\",\n });\n }\n if (delegated && value.authoritySource !== \"user_delegation\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"user connections require user_delegation provenance\",\n });\n }\n if (!delegated && value.authoritySource === \"user_delegation\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"non-delegated connections cannot claim user delegation provenance\",\n });\n }\n if (value.scope === \"legacy_user\" && value.authoritySource !== \"legacy_user_compatibility\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"legacy user connections require explicit compatibility provenance\",\n });\n }\n if (value.scope === \"workspace\" && value.authoritySource === \"legacy_user_compatibility\") {\n context.addIssue({\n code: \"custom\",\n path: [\"authoritySource\"],\n message: \"workspace connections cannot claim legacy user provenance\",\n });\n }\n if (!delegated && value.originWorkspaceId !== value.targetWorkspaceId) {\n context.addIssue({\n code: \"custom\",\n path: [\"originWorkspaceId\"],\n message: \"workspace connections must be owned by the target workspace\",\n });\n }\n const delegation = value.userDelegation;\n if (!delegation) return;\n const exactFacts: Array<[boolean, (string | number)[], string]> = [\n [\n delegation.organizationId === value.organizationId,\n [\"userDelegation\", \"organizationId\"],\n \"delegation organization mismatch\",\n ],\n [\n delegation.workspaceId === value.targetWorkspaceId,\n [\"userDelegation\", \"workspaceId\"],\n \"delegation target workspace mismatch\",\n ],\n [\n delegation.action === ConnectionUseAction.value,\n [\"userDelegation\", \"action\"],\n \"delegation action mismatch\",\n ],\n [\n delegation.context === value.targetSessionVisibility,\n [\"userDelegation\", \"context\"],\n \"delegation visibility mismatch\",\n ],\n ];\n for (const [matches, path, message] of exactFacts) {\n if (!matches) context.addIssue({ code: \"custom\", path, message });\n }\n if (delegation.sessionId !== null && delegation.sessionId !== value.targetSessionId) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"sessionId\"],\n message: \"delegation session mismatch\",\n });\n }\n if (\n delegation.authorityEpoch !== null &&\n delegation.authorityEpoch !== value.targetSessionAuthorityEpoch\n ) {\n context.addIssue({\n code: \"custom\",\n path: [\"userDelegation\", \"authorityEpoch\"],\n message: \"delegation authority epoch mismatch\",\n });\n }\n });\nexport type ConnectionUseAuthoritySnapshot = z.infer<typeof ConnectionUseAuthoritySnapshot>;\n\nexport const ConnectionUseDenialReason = z.enum([\n \"tenant_mismatch\",\n \"workspace_access_inactive\",\n \"session_inactive\",\n \"session_identity_changed\",\n \"session_visibility_changed\",\n \"session_authority_epoch_changed\",\n \"accepted_attempt_authority_required\",\n \"accepted_snapshot_digest_changed\",\n \"connection_missing\",\n \"connection_identity_changed\",\n \"connection_generation_changed\",\n \"connection_status_inactive\",\n \"connection_owner_changed\",\n \"owner_membership_inactive\",\n \"authority_missing\",\n \"authority_identity_changed\",\n \"authority_generation_changed\",\n \"authority_status_inactive\",\n \"grant_missing\",\n \"grant_identity_changed\",\n \"grant_generation_changed\",\n \"grant_status_inactive\",\n \"grant_expired\",\n \"grant_already_consumed\",\n]);\nexport type ConnectionUseDenialReason = z.infer<typeof ConnectionUseDenialReason>;\n\nconst ConnectionUseAttributionFields = z\n .object({\n organizationId: z.string().uuid(),\n workspaceId: z.string().uuid(),\n sessionId: z.string().uuid(),\n connectionId: z.string().uuid(),\n connectionGeneration: z.number().int().positive(),\n scope: z.enum([\"workspace\", \"user\", \"legacy_user\"]),\n ownerSubjectId: z.string().min(1).max(512).nullable(),\n authorityId: z.string().uuid().nullable(),\n grantId: z.string().uuid().nullable(),\n })\n .strict();\n\nfunction refineConnectionUseAttribution(\n value: z.infer<typeof ConnectionUseAttributionFields>,\n context: z.RefinementCtx,\n): void {\n const personal = value.scope !== \"workspace\";\n for (const field of [\"ownerSubjectId\"] as const) {\n if (personal !== (value[field] !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [field],\n message: personal\n ? `personal attribution requires ${field}`\n : `workspace attribution cannot carry ${field}`,\n });\n }\n }\n const delegated = value.scope === \"user\";\n for (const field of [\"authorityId\", \"grantId\"] as const) {\n if (delegated !== (value[field] !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [field],\n message: delegated\n ? `delegated personal attribution requires ${field}`\n : `non-delegated attribution cannot carry ${field}`,\n });\n }\n }\n}\n\n/** Metadata-only attribution emitted after pre-use authorization. */\nexport const ConnectionUseAttribution = ConnectionUseAttributionFields.superRefine(\n refineConnectionUseAttribution,\n);\nexport type ConnectionUseAttribution = z.infer<typeof ConnectionUseAttribution>;\n\nexport const ConnectionUseAuditFact = ConnectionUseAttributionFields.extend({\n outcome: z.enum([\"authorized\", \"denied\"]),\n denialReason: ConnectionUseDenialReason.nullable(),\n occurredAt: z.string().datetime({ offset: true }),\n}).superRefine((value, context) => {\n refineConnectionUseAttribution(value, context);\n if ((value.outcome === \"denied\") !== (value.denialReason !== null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"denialReason\"],\n message: \"only denied connection use carries a denial reason\",\n });\n }\n});\nexport type ConnectionUseAuditFact = z.infer<typeof ConnectionUseAuditFact>;\n\nexport const ConnectionUseAuthorizationResult = z.discriminatedUnion(\"status\", [\n z.object({ status: z.literal(\"authorized\"), attribution: ConnectionUseAttribution }).strict(),\n z.object({ status: z.literal(\"denied\"), reason: ConnectionUseDenialReason }).strict(),\n]);\nexport type ConnectionUseAuthorizationResult = z.infer<typeof ConnectionUseAuthorizationResult>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAUX,IAAM,sBAAsB,EAAE,QAAQ,gBAAgB;AAOtD,IAAM,8BAA8B,EACxC,OAAO;AAAA,EACN,OAAO,EAAE,KAAK,CAAC,aAAa,MAAM,CAAC,EAAE,QAAQ,WAAW;AAAA,EACxD,gBAAgB,uBAAuB,SAAS;AAClD,CAAC,EACA,OAAO,EACP,YAAY,CAAC,OAAO,YAAY;AAC/B,MAAI,MAAM,UAAU,eAAe,MAAM,mBAAmB,QAAW;AACrE,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,gBAAgB;AAAA,MACvB,SAAS;AAAA,IACX,CAAC;AACD;AAAA,EACF;AACA,MAAI,MAAM,UAAU,UAAU,MAAM,mBAAmB,QAAW;AAChE,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,gBAAgB;AAAA,MACvB,SAAS;AAAA,IACX,CAAC;AACD;AAAA,EACF;AACA,MAAI,MAAM,kBAAkB,MAAM,eAAe,WAAW,oBAAoB,OAAO;AACrF,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,kBAAkB,QAAQ;AAAA,MACjC,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACF,CAAC;AAGI,IAAM,2BAA2B,2BAA2B,OAAO;AAAA,EACxE,QAAQ;AACV,CAAC,EAAE,OA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,YAAY,MAAM,UAAU;AAClC,aAAW,SAAS,CAAC,eAAe,SAAS,GAAY;AACvD,QAAI,eAAe,MAAM,KAAK,MAAM,OAAO;AACzC,cAAQ,SAAS;AAAA,QACf,MAAM;AAAA,QACN,MAAM,CAAC,KAAK;AAAA,QACZ,SAAS,YACL,2CAA2C,KAAK,KAChD,0CAA0C,KAAK;AAAA,MACrD,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAGO,IAAM,2BAA2B,+BAA+B;AAAA,EACrE;AACF;AAGO,IAAM,yBAAyB,+BAA+B,OAAO;AAAA,EAC1E,SAAS,EAAE,KAAK,CAAC,cAAc,QAAQ,CAAC;AAAA,EACxC,cAAc,0BAA0B,SAAS;AAAA,EACjD,YAAY,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,KAAK,CAAC;AAClD,CAAC,EAAE,YAAY,CAAC,OAAO,YAAY;AACjC,iCAA+B,OAAO,OAAO;AAC7C,MAAK,MAAM,YAAY,cAAe,MAAM,iBAAiB,OAAO;AAClE,YAAQ,SAAS;AAAA,MACf,MAAM;AAAA,MACN,MAAM,CAAC,cAAc;AAAA,MACrB,SAAS;AAAA,IACX,CAAC;AAAA,EACH;AACF,CAAC;AAGM,IAAM,mCAAmC,EAAE,mBAAmB,UAAU;AAAA,EAC7E,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,YAAY,GAAG,aAAa,yBAAyB,CAAC,EAAE,OAAO;AAAA,EAC5F,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,QAAQ,GAAG,QAAQ,0BAA0B,CAAC,EAAE,OAAO;AACtF,CAAC;","names":[]}
|
package/dist/google-drive.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ConnectionMetadata
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-UGGTRQNU.js";
|
|
4
4
|
import {
|
|
5
5
|
ConnectorDocumentDestination,
|
|
6
6
|
ConnectorDocumentDestinationSelection
|
|
7
7
|
} from "./chunk-WYBDERIY.js";
|
|
8
8
|
import "./chunk-MRWYRAS5.js";
|
|
9
|
+
import "./chunk-4IVHBXRI.js";
|
|
9
10
|
import "./chunk-CM6BMECR.js";
|
|
10
11
|
import "./chunk-JUFK3T4Q.js";
|
|
11
12
|
import "./chunk-YBW5JSA3.js";
|
package/dist/google-drive.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/google-drive.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\nimport {\n ConnectorDocumentDestination,\n ConnectorDocumentDestinationSelection,\n} from \"./connector-destinations\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\n/** Stable serialized role retained for existing connection rows; not product-facing copy. */\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive read-only source sync\" as const;\nexport const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_SERVER_ID = \"google-drive-publishing\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_TOOL_NAME = \"google_drive_publish_file\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_CREATE_ACTION = \"create\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"publish_file\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"file_only\" | \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasFileWrite = hasFullDrive || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || hasFileWrite;\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasFileWrite) capabilities.push(\"publish_file\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : hasFileWrite\n ? \"file_only\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\n/** @deprecated Connector document destinations use organization/workspace/personal authority. */\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n destination: ConnectorDocumentDestination.optional(),\n /** @deprecated Missing destinations resolve to the current workspace boundary. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n configGeneration: z.number().int().positive().default(1),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveOutputDestination = z\n .object({\n folderId: z.string().min(1).max(256),\n folderName: z.string().min(1).max(1024),\n driveId: z.string().min(1).max(256).nullable(),\n location: z.enum([\"my_drive\", \"shared_drive\"]),\n selectedAt: z.string().datetime({ offset: true }),\n })\n .strict()\n .superRefine((value, context) => {\n if ((value.location === \"my_drive\") !== (value.driveId === null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"driveId\"],\n message: \"Google Drive destination location does not match its drive identity\",\n });\n }\n });\nexport type GoogleDriveOutputDestination = z.infer<typeof GoogleDriveOutputDestination>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.union([\n z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL),\n ]),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"file_only\", \"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n outputDestination: GoogleDriveOutputDestination.optional(),\n documentDestination: ConnectorDocumentDestination.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n capability: z.enum([\"source_read\", \"publish\"]).default(\"source_read\"),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDrivePublicationExportFile = z\n .object({\n fileId: z.string().uuid(),\n filename: z.string().trim().min(1).max(512),\n contentType: z.string().trim().min(1).max(256),\n sizeBytes: z.number().int().positive(),\n sha256: z.string().regex(/^[0-9a-f]{64}$/u),\n artifactId: z.string().regex(/^[0-9a-f]{32}$/u),\n versionId: z.string().regex(/^[0-9a-f]{32}$/u),\n materializationJobId: z.string().regex(/^[0-9a-f]{32}$/u),\n sourceHeadSequence: z.number().int().nonnegative(),\n sourceStateHash: z.string().regex(/^sha256:[0-9a-f]{64}$/u),\n })\n .strict();\nexport type GoogleDrivePublicationExportFile = z.infer<typeof GoogleDrivePublicationExportFile>;\n\nexport const GoogleDrivePublicationToolInput = z\n .object({\n title: z.string().trim().min(1).max(512),\n modality: z.enum([\"document\", \"spreadsheet\", \"presentation\"]),\n file: GoogleDrivePublicationExportFile,\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type GoogleDrivePublicationToolInput = z.infer<typeof GoogleDrivePublicationToolInput>;\n\nexport const GoogleDrivePublicationReceipt = z\n .object({\n connectionId: z.string().uuid(),\n providerFileId: z.string().min(1).max(256),\n webViewLink: z.string().url(),\n mimeType: z.enum([\n \"application/vnd.google-apps.document\",\n \"application/vnd.google-apps.spreadsheet\",\n \"application/vnd.google-apps.presentation\",\n ]),\n destination: GoogleDriveOutputDestination,\n replayed: z.boolean(),\n })\n .strict();\nexport type GoogleDrivePublicationReceipt = z.infer<typeof GoogleDrivePublicationReceipt>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nconst GoogleDriveSourceSelection = z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n });\n\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: GoogleDriveSourceSelection,\n destination: ConnectorDocumentDestinationSelection.optional(),\n /** @deprecated Legacy requests are accepted but resolve to workspace authority. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n })\n .refine((request) => request.destination !== undefined || request.targetScope !== undefined, {\n message: \"Google Drive document destination is required\",\n });\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n\nexport const GoogleDriveKnowledgeSourceItem = z.object({\n id: z.string().min(1).max(512),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(512).optional(),\n sourceKind: z.enum([\"my_drive\", \"shared_drive\", \"folder\"]),\n includeDescendants: z.boolean(),\n});\nexport type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;\n\nexport const GoogleDriveKnowledgeSourceDestination = z.object({\n authorityKind: z.enum([\"organization\", \"workspace\", \"personal\"]),\n authorityAccountId: z.string().min(1).max(128),\n authorityWorkspaceId: z.string().min(1).max(128).optional(),\n authoritySubjectId: z.string().min(1).max(512).optional(),\n collectionId: z.string().min(1).max(512).optional(),\n});\nexport type GoogleDriveKnowledgeSourceDestination = z.infer<\n typeof GoogleDriveKnowledgeSourceDestination\n>;\n\nexport const GoogleDriveKnowledgeSourceConfig = z.object({\n sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),\n destination: GoogleDriveKnowledgeSourceDestination,\n syncCadence: GoogleDriveSyncCadence,\n readPolicy: GoogleDriveReadPolicy,\n});\nexport type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;\n\nexport const SaveGoogleDriveIntegrationSourceRequest = z.intersection(\n SaveGoogleDriveSourceRequest,\n z.object({\n sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {\n message: \"At least one Google Drive source is required\",\n }),\n expectedVersion: z.number().int().positive().optional(),\n idempotencyKey: z.string().uuid(),\n }),\n);\nexport type SaveGoogle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AI,GAAG;AAAA,EAC7C,sBAAsB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EAC1D,oBAAoB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AAAA,EACxD,cAAc,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG,EAAE,SAAS;AACpD,CAAC;AAKM,IAAM,mCAAmC,EAAE,OAAO;AAAA,EACvD,SAAS,EAAE,MAAM,8BAA8B,EAAE,IAAI,CAAC,EAAE,IAAI,GAAG;AAAA,EAC/D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,YAAY;AACd,CAAC;AAGM,IAAM,0CAA0C,EAAE;AAAA,EACvD;AAAA,EACA,EAAE,OAAO;AAAA,IACP,SAAS,2BAA2B,OAAO,CAAC,YAAY,QAAQ,SAAS,GAAG;AAAA,MAC1E,SAAS;AAAA,IACX,CAAC;AAAA,IACD,iBAAiB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS;AAAA,IACtD,gBAAgB,EAAE,OAAO,EAAE,KAAK;AAAA,EAClC,CAAC;AACH;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/google-drive.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { ConnectionMetadata } from \"./index\";\nimport {\n ConnectorDocumentDestination,\n ConnectorDocumentDestinationSelection,\n} from \"./connector-destinations\";\n\nexport const GOOGLE_DRIVE_PROVIDER_DOMAIN = \"googleapis.com\" as const;\nexport const GOOGLE_DRIVE_FULL_SCOPE = \"https://www.googleapis.com/auth/drive\" as const;\nexport const GOOGLE_DRIVE_FILE_SCOPE = \"https://www.googleapis.com/auth/drive.file\" as const;\nexport const GOOGLE_DRIVE_METADATA_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.metadata.readonly\" as const;\nexport const GOOGLE_DRIVE_READONLY_SCOPE =\n \"https://www.googleapis.com/auth/drive.readonly\" as const;\n/** Stable serialized role retained for existing connection rows; not product-facing copy. */\nexport const GOOGLE_DRIVE_CREDENTIAL_ROLE = \"google_drive_metadata\" as const;\nexport const GOOGLE_DRIVE_CREDENTIAL_LABEL = \"Google Drive read-only source sync\" as const;\nexport const GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL = \"Google Drive metadata browser\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_SERVER_ID = \"google-drive-publishing\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_TOOL_NAME = \"google_drive_publish_file\" as const;\nexport const GOOGLE_DRIVE_PUBLICATION_CREATE_ACTION = \"create\" as const;\n\nexport const GoogleDriveOAuthCapability = z.enum([\n \"picker_file_read\",\n \"publish_file\",\n \"source_metadata_discovery\",\n \"source_content_read\",\n \"recursive_source_sync\",\n]);\nexport type GoogleDriveOAuthCapability = z.infer<typeof GoogleDriveOAuthCapability>;\n\nexport type GoogleDriveOAuthScopeDecision = {\n accessMode: \"file_only\" | \"metadata_readonly\" | \"readonly\" | null;\n capabilities: GoogleDriveOAuthCapability[];\n};\n\n/**\n * Converts exact Google OAuth grants into the Drive capabilities OpenGeni may\n * rely on. Unknown or malformed grants add no authority. In particular,\n * drive.file covers only files explicitly opened or shared with the app and\n * never authorizes arbitrary recursive descendant discovery.\n */\nexport function googleDriveOAuthScopeDecision(\n grantedScopes: readonly string[],\n): GoogleDriveOAuthScopeDecision {\n const granted = new Set(grantedScopes);\n const hasFullDrive = granted.has(GOOGLE_DRIVE_FULL_SCOPE);\n const hasSourceContentRead = hasFullDrive || granted.has(GOOGLE_DRIVE_READONLY_SCOPE);\n const hasFileWrite = hasFullDrive || granted.has(GOOGLE_DRIVE_FILE_SCOPE);\n const hasSourceMetadataDiscovery =\n hasSourceContentRead || granted.has(GOOGLE_DRIVE_METADATA_READONLY_SCOPE);\n const hasPickerFileRead = hasSourceContentRead || hasFileWrite;\n const capabilities: GoogleDriveOAuthCapability[] = [];\n if (hasPickerFileRead) capabilities.push(\"picker_file_read\");\n if (hasFileWrite) capabilities.push(\"publish_file\");\n if (hasSourceMetadataDiscovery) capabilities.push(\"source_metadata_discovery\");\n if (hasSourceContentRead) {\n capabilities.push(\"source_content_read\", \"recursive_source_sync\");\n }\n return {\n accessMode: hasSourceContentRead\n ? \"readonly\"\n : hasSourceMetadataDiscovery\n ? \"metadata_readonly\"\n : hasFileWrite\n ? \"file_only\"\n : null,\n capabilities,\n };\n}\n\nexport function googleDriveScopesAllowCapability(\n grantedScopes: readonly string[],\n capability: GoogleDriveOAuthCapability,\n): boolean {\n return googleDriveOAuthScopeDecision(grantedScopes).capabilities.includes(capability);\n}\n\n/** @deprecated Connector document destinations use organization/workspace/personal authority. */\nexport const GoogleDriveTargetScope = z.enum([\"user\", \"workspace\", \"organization\"]);\nexport type GoogleDriveTargetScope = z.infer<typeof GoogleDriveTargetScope>;\n\nexport const GoogleDriveSyncCadence = z.enum([\"manual\", \"hourly\", \"daily\"]);\nexport type GoogleDriveSyncCadence = z.infer<typeof GoogleDriveSyncCadence>;\n\nexport const GoogleDriveReadPolicy = z.enum([\"allow\", \"ask\", \"block\"]);\nexport type GoogleDriveReadPolicy = z.infer<typeof GoogleDriveReadPolicy>;\n\nexport const GoogleDriveConnectionLifecycleState = z.enum([\n \"active\",\n \"paused\",\n \"token_revoked\",\n \"app_removed\",\n \"disconnected\",\n \"reconnect_required\",\n \"reconsent_required\",\n]);\nexport type GoogleDriveConnectionLifecycleState = z.infer<\n typeof GoogleDriveConnectionLifecycleState\n>;\n\nconst GoogleDriveLifecycleObservedAt = z.string().datetime({ offset: true });\nexport const GoogleDriveConnectionLifecycle = z.discriminatedUnion(\"state\", [\n z.object({\n state: z.literal(\"active\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"paused\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"token_revoked\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"app_removed\"),\n recoverable: z.literal(false),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"disconnected\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconnect_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n z.object({\n state: z.literal(\"reconsent_required\"),\n recoverable: z.literal(true),\n observedAt: GoogleDriveLifecycleObservedAt,\n }),\n]);\nexport type GoogleDriveConnectionLifecycle = z.infer<typeof GoogleDriveConnectionLifecycle>;\n\nexport const GoogleDriveSelectedSource = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(256).nullable().default(null),\n destination: ConnectorDocumentDestination.optional(),\n /** @deprecated Missing destinations resolve to the current workspace boundary. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n configGeneration: z.number().int().positive().default(1),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n selectedAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveSelectedSource = z.infer<typeof GoogleDriveSelectedSource>;\n\nexport const GoogleDriveOutputDestination = z\n .object({\n folderId: z.string().min(1).max(256),\n folderName: z.string().min(1).max(1024),\n driveId: z.string().min(1).max(256).nullable(),\n location: z.enum([\"my_drive\", \"shared_drive\"]),\n selectedAt: z.string().datetime({ offset: true }),\n })\n .strict()\n .superRefine((value, context) => {\n if ((value.location === \"my_drive\") !== (value.driveId === null)) {\n context.addIssue({\n code: \"custom\",\n path: [\"driveId\"],\n message: \"Google Drive destination location does not match its drive identity\",\n });\n }\n });\nexport type GoogleDriveOutputDestination = z.infer<typeof GoogleDriveOutputDestination>;\n\nexport const GoogleDriveConnectionMetadata = z\n .object({\n credentialRole: z.literal(GOOGLE_DRIVE_CREDENTIAL_ROLE),\n credentialLabel: z.union([\n z.literal(GOOGLE_DRIVE_CREDENTIAL_LABEL),\n z.literal(GOOGLE_DRIVE_LEGACY_CREDENTIAL_LABEL),\n ]),\n googlePermissionId: z.string().min(1).max(256),\n googleEmail: z.string().email().max(320),\n googleDisplayName: z.string().min(1).max(512).nullable(),\n verifiedAt: z.string().datetime({ offset: true }),\n accessMode: z.enum([\"file_only\", \"metadata_readonly\", \"readonly\"]),\n lifecycle: GoogleDriveConnectionLifecycle.optional(),\n outputDestination: GoogleDriveOutputDestination.optional(),\n documentDestination: ConnectorDocumentDestination.optional(),\n selectedSources: z.array(GoogleDriveSelectedSource).max(100).optional(),\n /** @deprecated Read `selectedSources`; retained while existing connections migrate. */\n selectedSource: GoogleDriveSelectedSource.nullable().optional(),\n })\n .passthrough();\nexport type GoogleDriveConnectionMetadata = z.infer<typeof GoogleDriveConnectionMetadata>;\n\nexport const GoogleDriveOAuthStartRequest = z.object({\n connectionId: z.string().uuid().optional(),\n capability: z.enum([\"source_read\", \"publish\"]).default(\"source_read\"),\n});\nexport type GoogleDriveOAuthStartRequest = z.infer<typeof GoogleDriveOAuthStartRequest>;\n\nexport const GoogleDriveOAuthStartResponse = z.object({\n authorizationUrl: z.string().url(),\n expiresAt: z.string().datetime({ offset: true }),\n});\nexport type GoogleDriveOAuthStartResponse = z.infer<typeof GoogleDriveOAuthStartResponse>;\n\nexport const GoogleDriveLifecycleActionRequest = z.object({\n action: z.enum([\"pause\", \"resume\"]),\n expectedVersion: z.number().int().positive(),\n});\nexport type GoogleDriveLifecycleActionRequest = z.infer<typeof GoogleDriveLifecycleActionRequest>;\n\nexport const GoogleDriveDisconnectRequest = z.object({\n expectedVersion: z.number().int().positive(),\n idempotencyKey: z.string().trim().min(1).max(200),\n});\nexport type GoogleDriveDisconnectRequest = z.infer<typeof GoogleDriveDisconnectRequest>;\n\nexport const GoogleDrivePublicationExportFile = z\n .object({\n fileId: z.string().uuid(),\n filename: z.string().trim().min(1).max(512),\n contentType: z.string().trim().min(1).max(256),\n sizeBytes: z.number().int().positive(),\n sha256: z.string().regex(/^[0-9a-f]{64}$/u),\n artifactId: z.string().regex(/^[0-9a-f]{32}$/u),\n versionId: z.string().regex(/^[0-9a-f]{32}$/u),\n materializationJobId: z.string().regex(/^[0-9a-f]{32}$/u),\n sourceHeadSequence: z.number().int().nonnegative(),\n sourceStateHash: z.string().regex(/^sha256:[0-9a-f]{64}$/u),\n })\n .strict();\nexport type GoogleDrivePublicationExportFile = z.infer<typeof GoogleDrivePublicationExportFile>;\n\nexport const GoogleDrivePublicationToolInput = z\n .object({\n title: z.string().trim().min(1).max(512),\n modality: z.enum([\"document\", \"spreadsheet\", \"presentation\"]),\n file: GoogleDrivePublicationExportFile,\n idempotencyKey: z.string().trim().min(1).max(200),\n })\n .strict();\nexport type GoogleDrivePublicationToolInput = z.infer<typeof GoogleDrivePublicationToolInput>;\n\nexport const GoogleDrivePublicationReceipt = z\n .object({\n connectionId: z.string().uuid(),\n providerFileId: z.string().min(1).max(256),\n webViewLink: z.string().url(),\n mimeType: z.enum([\n \"application/vnd.google-apps.document\",\n \"application/vnd.google-apps.spreadsheet\",\n \"application/vnd.google-apps.presentation\",\n ]),\n destination: GoogleDriveOutputDestination,\n replayed: z.boolean(),\n })\n .strict();\nexport type GoogleDrivePublicationReceipt = z.infer<typeof GoogleDrivePublicationReceipt>;\n\nexport const GoogleDriveBrowseItem = z.object({\n id: z.string().min(1).max(256),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n kind: z.enum([\"folder\", \"file\"]),\n driveId: z.string().min(1).max(256).nullable(),\n modifiedTime: z.string().datetime({ offset: true }).nullable(),\n size: z.string().regex(/^\\d+$/).nullable(),\n webViewLink: z.string().url().nullable(),\n});\nexport type GoogleDriveBrowseItem = z.infer<typeof GoogleDriveBrowseItem>;\n\nexport const GoogleDriveBrowseResponse = z.object({\n connection: z.lazy(() => ConnectionMetadata),\n parentId: z.string().min(1).max(256),\n current: GoogleDriveBrowseItem.nullable(),\n items: z.array(GoogleDriveBrowseItem),\n nextPageToken: z.string().min(1).max(4096).nullable(),\n incompleteSearch: z.boolean(),\n});\nexport type GoogleDriveBrowseResponse = z.infer<typeof GoogleDriveBrowseResponse>;\n\nconst GoogleDriveSourceSelection = z\n .array(\n GoogleDriveBrowseItem.pick({\n id: true,\n name: true,\n mimeType: true,\n driveId: true,\n }),\n )\n .max(100)\n .refine((sources) => new Set(sources.map((source) => source.id)).size === sources.length, {\n message: \"Google Drive sources must be unique\",\n });\n\nexport const SaveGoogleDriveSourceRequest = z\n .object({\n sources: GoogleDriveSourceSelection,\n destination: ConnectorDocumentDestinationSelection.optional(),\n /** @deprecated Legacy requests are accepted but resolve to workspace authority. */\n targetScope: GoogleDriveTargetScope.optional(),\n syncCadence: GoogleDriveSyncCadence.default(\"hourly\"),\n syncEnabled: z.boolean().default(false),\n readPolicy: GoogleDriveReadPolicy.default(\"allow\"),\n })\n .refine((request) => request.destination !== undefined || request.targetScope !== undefined, {\n message: \"Google Drive document destination is required\",\n });\nexport type SaveGoogleDriveSourceRequest = z.infer<typeof SaveGoogleDriveSourceRequest>;\n\nexport const GoogleDriveKnowledgeSourceItem = z.object({\n id: z.string().min(1).max(512),\n name: z.string().min(1).max(1024),\n mimeType: z.string().min(1).max(256),\n driveId: z.string().min(1).max(512).optional(),\n sourceKind: z.enum([\"my_drive\", \"shared_drive\", \"folder\"]),\n includeDescendants: z.boolean(),\n});\nexport type GoogleDriveKnowledgeSourceItem = z.infer<typeof GoogleDriveKnowledgeSourceItem>;\n\nexport const GoogleDriveKnowledgeSourceDestination = z.object({\n authorityKind: z.enum([\"organization\", \"workspace\", \"personal\"]),\n authorityAccountId: z.string().min(1).max(128),\n authorityWorkspaceId: z.string().min(1).max(128).optional(),\n authoritySubjectId: z.string().min(1).max(512).optional(),\n collectionId: z.string().min(1).max(512).optional(),\n});\nexport type GoogleDriveKnowledgeSourceDestination = z.infer<\n typeof GoogleDriveKnowledgeSourceDestination\n>;\n\nexport const GoogleDriveKnowledgeSourceConfig = z.object({\n sources: z.array(GoogleDriveKnowledgeSourceItem).min(1).max(100),\n destination: GoogleDriveKnowledgeSourceDestination,\n syncCadence: GoogleDriveSyncCadence,\n readPolicy: GoogleDriveReadPolicy,\n});\nexport type GoogleDriveKnowledgeSourceConfig = z.infer<typeof GoogleDriveKnowledgeSourceConfig>;\n\nexport const SaveGoogleDriveIntegrationSourceRequest = z.intersection(\n SaveGoogleDriveSourceRequest,\n z.object({\n sources: GoogleDriveSourceSelection.refine((sources) => sources.length > 0, {\n message: \"At least one Google Drive source is required\",\n }),\n expectedVersion: z.number().int().positive().optional(),\n idempotencyKey: z.string().uuid(),\n }),\n);\nexport type SaveGoogleDriveIntegrationSourceRequest = z.infer<\n typeof SaveGoogleDriveIntegrationSourceRequest\n>;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAQX,IAAM,+BAA+B;AACrC,IAAM,0BAA0B;AAChC,IAAM,0BAA0B;AAChC,IAAM,uCACX;AACK,IAAM,8BACX;AAEK,IAAM,+BAA+B;AACrC,IAAM,gCAAgC;AACtC,IAAM,uCAAuC;AAC7C,IAAM,qCAAqC;AAC3C,IAAM,qCAAqC;AAC3C,IAAM,yCAAyC;AAE/C,IAAM,6BAA6B,EAAE,KAAK;AAAA,EAC/C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAcM,SAAS,8BACd,eAC+B;AAC/B,QAAM,UAAU,IAAI,IAAI,aAAa;AACrC,QAAM,eAAe,QAAQ,IAAI,uBAAuB;AACxD,QAAM,uBAAuB,gBAAgB,QAAQ,IAAI,2BAA2B;AACpF,QAAM,eAAe,gBAAgB,QAAQ,IAAI,uBAAuB;AACxE,QAAM,6BACJ,wBAAwB,QAAQ,IAAI,oCAAoC;AAC1E,QAAM,oBAAoB,wBAAwB;AAClD,QAAM,eAA6C,CA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