@collective-intelligence/external-apps-server-sdk 0.2.4 → 0.2.5

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/effect.d.ts CHANGED
@@ -272,6 +272,454 @@ export interface GatewayKernel {
272
272
  readonly handle: (request: Request) => Promise<Response>;
273
273
  readonly manifest: DefinedGateway["manifest"];
274
274
  }
275
+ export type AccessExplanation = {
276
+ cut: {
277
+ credential: {
278
+ apiKeyId: string;
279
+ kind: "api_key";
280
+ } | {
281
+ applicationId: string;
282
+ kind: "application_token";
283
+ };
284
+ maxPrivileges: Array<{
285
+ code: string;
286
+ mode: "manage" | "on" | "read";
287
+ }>;
288
+ tuples: Array<{
289
+ capabilities: Array<{
290
+ code: string;
291
+ held: "manage" | "on" | "read";
292
+ kept: "manage" | "on" | "read" | null;
293
+ }>;
294
+ holder: {
295
+ grantId: string;
296
+ kind: "grant";
297
+ };
298
+ }>;
299
+ } | null;
300
+ grants: Array<{
301
+ grantId: string;
302
+ label: string;
303
+ profile: {
304
+ id: string;
305
+ label: string;
306
+ };
307
+ values: Array<{
308
+ axis: {
309
+ id: string;
310
+ label: string;
311
+ };
312
+ value: {
313
+ id: string;
314
+ label: string | null;
315
+ };
316
+ }>;
317
+ origin: "declared" | "manual" | "import" | "api" | "app_server" | "invitation" | "tenant" | null;
318
+ via: {
319
+ kind: "direct";
320
+ } | {
321
+ group: {
322
+ id: string;
323
+ label: string | null;
324
+ };
325
+ kind: "group";
326
+ } | {
327
+ group: {
328
+ id: string;
329
+ label: string | null;
330
+ };
331
+ kind: "inherited_group";
332
+ };
333
+ }>;
334
+ principal: {
335
+ kind: "service_principal" | "user";
336
+ tenantRole: "tenant_admin" | "tenant_operator" | null;
337
+ userId: string;
338
+ } | {
339
+ applicationId: string;
340
+ kind: "application_server" | "application_visitors";
341
+ };
342
+ target: {
343
+ allowed: boolean;
344
+ code: string;
345
+ holders: Array<{
346
+ grantId: string;
347
+ kind: "grant";
348
+ }>;
349
+ kind: "capability";
350
+ known: boolean;
351
+ mode: "manage" | "on" | "read";
352
+ } | {
353
+ admitted: boolean;
354
+ fields: {
355
+ hidden: Array<string>;
356
+ otherFields: "hidden" | "shown";
357
+ shown: Array<string>;
358
+ } | null;
359
+ kind: "record";
360
+ operation: "read" | "write";
361
+ policies: Array<{
362
+ capability: {
363
+ code: string;
364
+ mode: "manage" | "on" | "read";
365
+ };
366
+ fields: Array<string> | {
367
+ except: Array<string>;
368
+ } | null;
369
+ id: string;
370
+ kind: "package" | "core_tenant" | "core_admin" | "core_default";
371
+ purpose: "access" | "administration";
372
+ result: {
373
+ admitted: true;
374
+ grantIds: Array<string>;
375
+ } | {
376
+ admitted: false;
377
+ reason: "axes_not_bound" | "capability_not_held" | "record_not_matched";
378
+ };
379
+ }>;
380
+ recordId: string;
381
+ schemaId: string;
382
+ };
383
+ };
384
+ export type AccessExplainRequest = {
385
+ credential?: {
386
+ apiKeyId: string;
387
+ kind: "api_key";
388
+ } | {
389
+ applicationId: string;
390
+ kind: "application_token";
391
+ };
392
+ principal: {
393
+ kind: "user";
394
+ userId: string;
395
+ } | {
396
+ applicationId: string;
397
+ kind: "application_server" | "application_visitors";
398
+ };
399
+ target: {
400
+ code: string;
401
+ kind: "capability";
402
+ mode: "manage" | "on" | "read";
403
+ } | {
404
+ kind: "record";
405
+ operation: "read" | "write";
406
+ recordId: string;
407
+ };
408
+ };
409
+ export type AccessGrantAxis = {
410
+ entitySchemaId: string;
411
+ hierarchyFieldId: string | null;
412
+ id: string;
413
+ label: string;
414
+ packageInstallationId: string | null;
415
+ slug: string;
416
+ };
417
+ export type AccessCapabilityNode = {
418
+ area: "dashboard" | "studio" | "mcp" | "admin" | "platform" | "data" | "tenant" | "app" | "package";
419
+ code: string;
420
+ grantableBy: "admins" | "holders";
421
+ id: string;
422
+ key: string;
423
+ kind: "switch" | "read_manage";
424
+ parentId: string | null;
425
+ source: "core" | "application" | "package";
426
+ status: "active" | "retired";
427
+ };
428
+ export type AccessProfile = {
429
+ audience: "user" | "server" | "anonymous" | "max_privileges";
430
+ axisIds: Array<string>;
431
+ canGrant: "all" | Array<string>;
432
+ capabilities: Array<AccessProfileCapability>;
433
+ description: string | null;
434
+ displayName: string;
435
+ fqn: string | null;
436
+ id: string;
437
+ readonly: boolean;
438
+ source: "builtin" | "package" | "custom";
439
+ version: number;
440
+ };
441
+ export type AccessProfileCapability = {
442
+ code: string;
443
+ mode: "manage" | "on" | "read";
444
+ };
445
+ export type AccessMemberCreated = {
446
+ accountCreated: boolean;
447
+ grants: Array<AccessGrant>;
448
+ mode: "direct";
449
+ userId: string;
450
+ } | {
451
+ email: string;
452
+ invitationId: string;
453
+ mode: "invitation";
454
+ };
455
+ export type AccessGrant = {
456
+ active: boolean;
457
+ axes: Array<{
458
+ axisId: string;
459
+ entityId: string;
460
+ }>;
461
+ fqn: string | null;
462
+ id: string;
463
+ origin: "declared" | "manual" | "import" | "api" | "app_server" | "invitation" | "tenant";
464
+ profileId: string;
465
+ recipient: AccessGrantRecipient;
466
+ };
467
+ export type AccessGrantRecipient = {
468
+ kind: "user";
469
+ userId: string;
470
+ } | {
471
+ coverage: "direct" | "inherited";
472
+ groupId: string;
473
+ kind: "group";
474
+ } | {
475
+ applicationId: string;
476
+ kind: "application_server" | "application_visitors";
477
+ };
478
+ export type AccessMemberCreateRequest = {
479
+ email: string;
480
+ grants: Array<{
481
+ axes?: {
482
+ [key: string]: {
483
+ knowledgeEntity: {
484
+ field: string;
485
+ value: string;
486
+ };
487
+ } | string;
488
+ };
489
+ profile: string | {
490
+ id: string;
491
+ };
492
+ }>;
493
+ kind: "member" | "guest";
494
+ mode: "direct" | "invitation";
495
+ name?: string;
496
+ };
497
+ export type AccessGrantSyncResult = {
498
+ created: Array<string>;
499
+ deleted: Array<string>;
500
+ unchanged: Array<string>;
501
+ updated: Array<string>;
502
+ };
503
+ export type AccessSnapshot = {
504
+ accessVersion: number;
505
+ capabilities: Array<{
506
+ area: "admin" | "app" | "dashboard" | "data" | "mcp" | "package" | "platform" | "studio" | "tenant";
507
+ code: string;
508
+ mode: "manage" | "on" | "read";
509
+ path: Array<string>;
510
+ }>;
511
+ grants: Array<{
512
+ grantId: string;
513
+ label: string;
514
+ profile: {
515
+ id: string;
516
+ label: string;
517
+ };
518
+ values: Array<{
519
+ axis: {
520
+ id: string;
521
+ label: string;
522
+ };
523
+ value: {
524
+ id: string;
525
+ label: string | null;
526
+ };
527
+ }>;
528
+ }>;
529
+ schemas: Array<{
530
+ read: "all" | "none" | "some";
531
+ schemaId: string;
532
+ write: "all" | "none" | "some";
533
+ }>;
534
+ versionToken: string;
535
+ };
536
+ export type AccessGroup = {
537
+ description: string | null;
538
+ fqn: string | null;
539
+ id: string;
540
+ name: string;
541
+ package: {
542
+ fqn: string;
543
+ managed: boolean;
544
+ readonly: boolean;
545
+ } | null;
546
+ parentGroupId: string | null;
547
+ slug: string | null;
548
+ };
549
+ export type AccessGroupUpdateRequest = {
550
+ description?: string | null;
551
+ name?: string;
552
+ parentGroupId?: string | null;
553
+ slug?: string | null;
554
+ };
555
+ export type AccessGroupPage = {
556
+ items: Array<AccessGroup>;
557
+ next: number | null;
558
+ };
559
+ export type AccessGroupCreateRequest = {
560
+ description?: string | null;
561
+ name: string;
562
+ parentGroupId?: string | null;
563
+ slug?: string | null;
564
+ };
565
+ export type AccessSchemaKnowledgePolicies = {
566
+ read: Array<AccessKnowledgeDataPolicy>;
567
+ schemaId: string;
568
+ write: Array<AccessKnowledgeDataPolicy>;
569
+ };
570
+ export type AccessKnowledgeDataPolicy = {
571
+ axes: Array<{
572
+ axis: string;
573
+ byCondition: true;
574
+ } | {
575
+ axis: string;
576
+ map: {
577
+ field: string;
578
+ } | {
579
+ relation: {
580
+ field: string;
581
+ key: string;
582
+ };
583
+ } | {
584
+ self: true;
585
+ };
586
+ } | {
587
+ axis: string;
588
+ unscoped: true;
589
+ }>;
590
+ capability: AccessProfileCapability;
591
+ fqn: string | null;
592
+ id: string;
593
+ includesHostOwned: boolean;
594
+ kind: "package" | "core_tenant" | "core_admin" | "core_default";
595
+ operation: "read" | "write";
596
+ otherAxesUnscoped: boolean;
597
+ purpose: "access" | "administration";
598
+ readableFields: Array<string> | {
599
+ except: Array<string>;
600
+ } | null;
601
+ schemaId: string | null;
602
+ where: unknown | null;
603
+ writableFields: Array<string> | {
604
+ except: Array<string>;
605
+ } | null;
606
+ };
607
+ export type AccessGrantUpdateRequest = {
608
+ axes?: {
609
+ [key: string]: {
610
+ knowledgeEntity: {
611
+ field: string;
612
+ value: string;
613
+ };
614
+ } | string;
615
+ };
616
+ grantee: {
617
+ user: {
618
+ email: string;
619
+ };
620
+ } | {
621
+ coverage: "direct" | "inherited";
622
+ group: {
623
+ fqn: string;
624
+ };
625
+ } | {
626
+ servicePrincipal: string;
627
+ } | {
628
+ applicationServer: string;
629
+ } | {
630
+ applicationVisitors: string;
631
+ };
632
+ profile: string | {
633
+ id: string;
634
+ };
635
+ };
636
+ export type AccessGrantList = Array<AccessGrant>;
637
+ export type AccessGrantSyncRequest = {
638
+ grants: Array<{
639
+ axes?: {
640
+ [key: string]: {
641
+ knowledgeEntity: {
642
+ field: string;
643
+ value: string;
644
+ };
645
+ } | string;
646
+ };
647
+ grantee: {
648
+ user: {
649
+ email: string;
650
+ };
651
+ } | {
652
+ coverage: "direct" | "inherited";
653
+ group: {
654
+ fqn: string;
655
+ };
656
+ } | {
657
+ servicePrincipal: string;
658
+ } | {
659
+ applicationServer: string;
660
+ } | {
661
+ applicationVisitors: string;
662
+ };
663
+ profile: string | {
664
+ id: string;
665
+ };
666
+ fqn: string;
667
+ }>;
668
+ namespace: string;
669
+ };
670
+ export type AccessGrantCreateRequest = {
671
+ axes?: {
672
+ [key: string]: {
673
+ knowledgeEntity: {
674
+ field: string;
675
+ value: string;
676
+ };
677
+ } | string;
678
+ };
679
+ grantee: {
680
+ user: {
681
+ email: string;
682
+ };
683
+ } | {
684
+ coverage: "direct" | "inherited";
685
+ group: {
686
+ fqn: string;
687
+ };
688
+ } | {
689
+ servicePrincipal: string;
690
+ } | {
691
+ applicationServer: string;
692
+ } | {
693
+ applicationVisitors: string;
694
+ };
695
+ profile: string | {
696
+ id: string;
697
+ };
698
+ fqn: string;
699
+ };
700
+ export type AccessInvitationPage = {
701
+ items: Array<AccessInvitation>;
702
+ next: number | null;
703
+ };
704
+ export type AccessInvitation = {
705
+ createdAt: string | null;
706
+ email: string;
707
+ id: string;
708
+ invitedByUserId: string | null;
709
+ status: "pending" | "accepted" | "revoked";
710
+ };
711
+ export type AccessMember = {
712
+ email: string | null;
713
+ kind: "member" | "guest";
714
+ name: string | null;
715
+ originApplicationId: string | null;
716
+ suspended: boolean;
717
+ userId: string;
718
+ };
719
+ export type AccessMemberPage = {
720
+ items: Array<AccessMember>;
721
+ next: string | null;
722
+ };
275
723
  export type ExternalApplicationsGetContextErrors = {
276
724
  /**
277
725
  * Error
@@ -367,6 +815,404 @@ export type ExternalApplicationsGetContextErrors = {
367
815
  };
368
816
  };
369
817
  export type ExternalApplicationsGetContextError = ExternalApplicationsGetContextErrors[keyof ExternalApplicationsGetContextErrors];
818
+ export type ApplicationAccessMembersListData = {
819
+ body?: never;
820
+ headers: {
821
+ authorization?: string;
822
+ "x-organization-id": string;
823
+ };
824
+ path?: never;
825
+ query?: {
826
+ after?: string;
827
+ email?: string;
828
+ limit?: string;
829
+ };
830
+ url: "/application/v1/access/members";
831
+ };
832
+ export type ApplicationAccessMembersCreateData = {
833
+ body: AccessMemberCreateRequest;
834
+ headers: {
835
+ authorization?: string;
836
+ "x-organization-id": string;
837
+ };
838
+ path?: never;
839
+ query?: never;
840
+ url: "/application/v1/access/members";
841
+ };
842
+ export type ApplicationAccessMembersDeleteData = {
843
+ body?: never;
844
+ headers: {
845
+ authorization?: string;
846
+ "x-organization-id": string;
847
+ };
848
+ path: {
849
+ userId: string;
850
+ };
851
+ query?: never;
852
+ url: "/application/v1/access/members/{userId}";
853
+ };
854
+ export type ApplicationAccessMembersGetData = {
855
+ body?: never;
856
+ headers: {
857
+ authorization?: string;
858
+ "x-organization-id": string;
859
+ };
860
+ path: {
861
+ userId: string;
862
+ };
863
+ query?: never;
864
+ url: "/application/v1/access/members/{userId}";
865
+ };
866
+ export type ApplicationAccessMembersSuspendData = {
867
+ body?: never;
868
+ headers: {
869
+ authorization?: string;
870
+ "x-organization-id": string;
871
+ };
872
+ path: {
873
+ userId: string;
874
+ };
875
+ query?: never;
876
+ url: "/application/v1/access/members/{userId}/suspend";
877
+ };
878
+ export type ApplicationAccessMembersResumeData = {
879
+ body?: never;
880
+ headers: {
881
+ authorization?: string;
882
+ "x-organization-id": string;
883
+ };
884
+ path: {
885
+ userId: string;
886
+ };
887
+ query?: never;
888
+ url: "/application/v1/access/members/{userId}/resume";
889
+ };
890
+ export type ApplicationAccessMembersListInvitationsData = {
891
+ body?: never;
892
+ headers: {
893
+ authorization?: string;
894
+ "x-organization-id": string;
895
+ };
896
+ path?: never;
897
+ query?: {
898
+ limit?: string;
899
+ page?: string;
900
+ status?: "pending" | "accepted" | "revoked";
901
+ };
902
+ url: "/application/v1/access/invitations";
903
+ };
904
+ export type ApplicationAccessMembersRevokeInvitationData = {
905
+ body?: never;
906
+ headers: {
907
+ authorization?: string;
908
+ "x-organization-id": string;
909
+ };
910
+ path: {
911
+ invitationId: string;
912
+ };
913
+ query?: never;
914
+ url: "/application/v1/access/invitations/{invitationId}";
915
+ };
916
+ export type ApplicationAccessGrantsListData = {
917
+ body?: never;
918
+ headers: {
919
+ authorization?: string;
920
+ "x-organization-id": string;
921
+ };
922
+ path?: never;
923
+ query?: {
924
+ groupId?: string;
925
+ namespace?: string;
926
+ userId?: string;
927
+ };
928
+ url: "/application/v1/access/grants";
929
+ };
930
+ export type ApplicationAccessGrantsCreateData = {
931
+ body: AccessGrantCreateRequest;
932
+ headers: {
933
+ authorization?: string;
934
+ "x-organization-id": string;
935
+ };
936
+ path?: never;
937
+ query?: never;
938
+ url: "/application/v1/access/grants";
939
+ };
940
+ export type ApplicationAccessGrantsSyncData = {
941
+ body: AccessGrantSyncRequest;
942
+ headers: {
943
+ authorization?: string;
944
+ "x-organization-id": string;
945
+ };
946
+ path?: never;
947
+ query?: never;
948
+ url: "/application/v1/access/grants/sync";
949
+ };
950
+ export type ApplicationAccessGrantsDeleteData = {
951
+ body?: never;
952
+ headers: {
953
+ authorization?: string;
954
+ "x-organization-id": string;
955
+ };
956
+ path: {
957
+ grantId: string;
958
+ };
959
+ query?: never;
960
+ url: "/application/v1/access/grants/{grantId}";
961
+ };
962
+ export type ApplicationAccessGrantsGetData = {
963
+ body?: never;
964
+ headers: {
965
+ authorization?: string;
966
+ "x-organization-id": string;
967
+ };
968
+ path: {
969
+ grantId: string;
970
+ };
971
+ query?: never;
972
+ url: "/application/v1/access/grants/{grantId}";
973
+ };
974
+ export type ApplicationAccessGrantsUpdateData = {
975
+ body: AccessGrantUpdateRequest;
976
+ headers: {
977
+ authorization?: string;
978
+ "x-organization-id": string;
979
+ };
980
+ path: {
981
+ grantId: string;
982
+ };
983
+ query?: never;
984
+ url: "/application/v1/access/grants/{grantId}";
985
+ };
986
+ export type ApplicationAccessGrantsDeleteByFqnData = {
987
+ body?: never;
988
+ headers: {
989
+ authorization?: string;
990
+ "x-organization-id": string;
991
+ };
992
+ path: {
993
+ fqn: string;
994
+ };
995
+ query?: never;
996
+ url: "/application/v1/access/grants/fqn/{fqn}";
997
+ };
998
+ export type ApplicationAccessGrantsGetByFqnData = {
999
+ body?: never;
1000
+ headers: {
1001
+ authorization?: string;
1002
+ "x-organization-id": string;
1003
+ };
1004
+ path: {
1005
+ fqn: string;
1006
+ };
1007
+ query?: never;
1008
+ url: "/application/v1/access/grants/fqn/{fqn}";
1009
+ };
1010
+ export type ApplicationAccessGrantsUpdateByFqnData = {
1011
+ body: AccessGrantUpdateRequest;
1012
+ headers: {
1013
+ authorization?: string;
1014
+ "x-organization-id": string;
1015
+ };
1016
+ path: {
1017
+ fqn: string;
1018
+ };
1019
+ query?: never;
1020
+ url: "/application/v1/access/grants/fqn/{fqn}";
1021
+ };
1022
+ export type ApplicationAccessDefinitionsListProfilesData = {
1023
+ body?: never;
1024
+ headers: {
1025
+ authorization?: string;
1026
+ "x-organization-id": string;
1027
+ };
1028
+ path?: never;
1029
+ query?: never;
1030
+ url: "/application/v1/access/profiles";
1031
+ };
1032
+ export type ApplicationAccessDefinitionsGetProfileData = {
1033
+ body?: never;
1034
+ headers: {
1035
+ authorization?: string;
1036
+ "x-organization-id": string;
1037
+ };
1038
+ path: {
1039
+ profileId: string;
1040
+ };
1041
+ query?: never;
1042
+ url: "/application/v1/access/profiles/{profileId}";
1043
+ };
1044
+ export type ApplicationAccessDefinitionsListCapabilitiesData = {
1045
+ body?: never;
1046
+ headers: {
1047
+ authorization?: string;
1048
+ "x-organization-id": string;
1049
+ };
1050
+ path?: never;
1051
+ query?: never;
1052
+ url: "/application/v1/access/catalog";
1053
+ };
1054
+ export type ApplicationAccessDefinitionsListAxesData = {
1055
+ body?: never;
1056
+ headers: {
1057
+ authorization?: string;
1058
+ "x-organization-id": string;
1059
+ };
1060
+ path?: never;
1061
+ query?: never;
1062
+ url: "/application/v1/access/axes";
1063
+ };
1064
+ export type ApplicationAccessDefinitionsListMaxPrivilegesData = {
1065
+ body?: never;
1066
+ headers: {
1067
+ authorization?: string;
1068
+ "x-organization-id": string;
1069
+ };
1070
+ path?: never;
1071
+ query?: never;
1072
+ url: "/application/v1/access/max-privileges";
1073
+ };
1074
+ export type ApplicationAccessDefinitionsGetMaxPrivilegesData = {
1075
+ body?: never;
1076
+ headers: {
1077
+ authorization?: string;
1078
+ "x-organization-id": string;
1079
+ };
1080
+ path: {
1081
+ profileId: string;
1082
+ };
1083
+ query?: never;
1084
+ url: "/application/v1/access/max-privileges/{profileId}";
1085
+ };
1086
+ export type ApplicationAccessDefinitionsListKnowledgePoliciesData = {
1087
+ body?: never;
1088
+ headers: {
1089
+ authorization?: string;
1090
+ "x-organization-id": string;
1091
+ };
1092
+ path?: never;
1093
+ query?: never;
1094
+ url: "/application/v1/access/knowledge-policies";
1095
+ };
1096
+ export type ApplicationAccessDefinitionsGetSchemaKnowledgePoliciesData = {
1097
+ body?: never;
1098
+ headers: {
1099
+ authorization?: string;
1100
+ "x-organization-id": string;
1101
+ };
1102
+ path: {
1103
+ schemaFqn: string;
1104
+ };
1105
+ query?: never;
1106
+ url: "/application/v1/access/knowledge-policies/schemas/{schemaFqn}";
1107
+ };
1108
+ export type ApplicationAccessGroupsListData = {
1109
+ body?: never;
1110
+ headers: {
1111
+ authorization?: string;
1112
+ "x-organization-id": string;
1113
+ };
1114
+ path?: never;
1115
+ query?: {
1116
+ limit?: string;
1117
+ page?: string;
1118
+ };
1119
+ url: "/application/v1/access/groups";
1120
+ };
1121
+ export type ApplicationAccessGroupsCreateData = {
1122
+ body: AccessGroupCreateRequest;
1123
+ headers: {
1124
+ authorization?: string;
1125
+ "x-organization-id": string;
1126
+ };
1127
+ path?: never;
1128
+ query?: never;
1129
+ url: "/application/v1/access/groups";
1130
+ };
1131
+ export type ApplicationAccessGroupsDeleteData = {
1132
+ body?: never;
1133
+ headers: {
1134
+ authorization?: string;
1135
+ "x-organization-id": string;
1136
+ };
1137
+ path: {
1138
+ groupId: string;
1139
+ };
1140
+ query?: never;
1141
+ url: "/application/v1/access/groups/{groupId}";
1142
+ };
1143
+ export type ApplicationAccessGroupsGetData = {
1144
+ body?: never;
1145
+ headers: {
1146
+ authorization?: string;
1147
+ "x-organization-id": string;
1148
+ };
1149
+ path: {
1150
+ groupId: string;
1151
+ };
1152
+ query?: never;
1153
+ url: "/application/v1/access/groups/{groupId}";
1154
+ };
1155
+ export type ApplicationAccessGroupsUpdateData = {
1156
+ body: AccessGroupUpdateRequest;
1157
+ headers: {
1158
+ authorization?: string;
1159
+ "x-organization-id": string;
1160
+ };
1161
+ path: {
1162
+ groupId: string;
1163
+ };
1164
+ query?: never;
1165
+ url: "/application/v1/access/groups/{groupId}";
1166
+ };
1167
+ export type ApplicationAccessGroupsAddMemberData = {
1168
+ body: {
1169
+ userId: string;
1170
+ };
1171
+ headers: {
1172
+ authorization?: string;
1173
+ "x-organization-id": string;
1174
+ };
1175
+ path: {
1176
+ groupId: string;
1177
+ };
1178
+ query?: never;
1179
+ url: "/application/v1/access/groups/{groupId}/members";
1180
+ };
1181
+ export type ApplicationAccessGroupsRemoveMemberData = {
1182
+ body?: never;
1183
+ headers: {
1184
+ authorization?: string;
1185
+ "x-organization-id": string;
1186
+ };
1187
+ path: {
1188
+ groupId: string;
1189
+ userId: string;
1190
+ };
1191
+ query?: never;
1192
+ url: "/application/v1/access/groups/{groupId}/members/{userId}";
1193
+ };
1194
+ export type ApplicationAccessPrincipalsSnapshotData = {
1195
+ body?: never;
1196
+ headers: {
1197
+ authorization?: string;
1198
+ "x-organization-id": string;
1199
+ };
1200
+ path: {
1201
+ userId: string;
1202
+ };
1203
+ query?: never;
1204
+ url: "/application/v1/access/users/{userId}/snapshot";
1205
+ };
1206
+ export type ApplicationAccessPrincipalsExplainData = {
1207
+ body: AccessExplainRequest;
1208
+ headers: {
1209
+ authorization?: string;
1210
+ "x-organization-id": string;
1211
+ };
1212
+ path?: never;
1213
+ query?: never;
1214
+ url: "/application/v1/access/explain";
1215
+ };
370
1216
  export type JsonValue = boolean | null | number | readonly JsonValue[] | Readonly<{
371
1217
  readonly [key: string]: JsonValue;
372
1218
  }> | string;
@@ -783,6 +1629,385 @@ export type CacheInvalidationValue = Readonly<{
783
1629
  */
784
1630
  invalidate: (tags: readonly CiTag[]) => Effect.Effect<void>;
785
1631
  }>;
1632
+ export type AuthToken = string | undefined;
1633
+ export interface Auth {
1634
+ /**
1635
+ * Which part of the request do we use to send the auth?
1636
+ *
1637
+ * @default 'header'
1638
+ */
1639
+ in?: "header" | "query" | "cookie";
1640
+ /**
1641
+ * Header or query parameter name.
1642
+ *
1643
+ * @default 'Authorization'
1644
+ */
1645
+ name?: string;
1646
+ scheme?: "basic" | "bearer";
1647
+ type: "apiKey" | "http";
1648
+ }
1649
+ export interface SerializerOptions<T> {
1650
+ /**
1651
+ * @default true
1652
+ */
1653
+ explode: boolean;
1654
+ style: T;
1655
+ }
1656
+ export type ArrayStyle = "form" | "spaceDelimited" | "pipeDelimited";
1657
+ export type ObjectStyle = "form" | "deepObject";
1658
+ export type QuerySerializer = (query: Record<string, unknown>) => string;
1659
+ export type BodySerializer = (body: unknown) => unknown;
1660
+ export type QuerySerializerOptionsObject = {
1661
+ allowReserved?: boolean;
1662
+ array?: Partial<SerializerOptions<ArrayStyle>>;
1663
+ object?: Partial<SerializerOptions<ObjectStyle>>;
1664
+ };
1665
+ export type QuerySerializerOptions = QuerySerializerOptionsObject & {
1666
+ /**
1667
+ * Per-parameter serialization overrides. When provided, these settings
1668
+ * override the global array/object settings for specific parameter names.
1669
+ */
1670
+ parameters?: Record<string, QuerySerializerOptionsObject>;
1671
+ };
1672
+ export type HttpMethod = "connect" | "delete" | "get" | "head" | "options" | "patch" | "post" | "put" | "trace";
1673
+ export type Client<RequestFn = never, Config = unknown, MethodFn = never, BuildUrlFn = never, SseFn = never> = {
1674
+ /**
1675
+ * Returns the final request URL.
1676
+ */
1677
+ buildUrl: BuildUrlFn;
1678
+ getConfig: () => Config;
1679
+ request: RequestFn;
1680
+ setConfig: (config: Config) => Config;
1681
+ } & {
1682
+ [K in HttpMethod]: MethodFn;
1683
+ } & ([
1684
+ SseFn
1685
+ ] extends [
1686
+ never
1687
+ ] ? {
1688
+ sse?: never;
1689
+ } : {
1690
+ sse: {
1691
+ [K in HttpMethod]: SseFn;
1692
+ };
1693
+ });
1694
+ export interface Config {
1695
+ /**
1696
+ * Auth token or a function returning auth token. The resolved value will be
1697
+ * added to the request payload as defined by its `security` array.
1698
+ */
1699
+ auth?: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken;
1700
+ /**
1701
+ * A function for serializing request body parameter. By default,
1702
+ * {@link JSON.stringify()} will be used.
1703
+ */
1704
+ bodySerializer?: BodySerializer | null;
1705
+ /**
1706
+ * An object containing any HTTP headers that you want to pre-populate your
1707
+ * `Headers` object with.
1708
+ *
1709
+ * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
1710
+ */
1711
+ headers?: RequestInit["headers"] | Record<string, string | number | boolean | (string | number | boolean)[] | null | undefined | unknown>;
1712
+ /**
1713
+ * The request method.
1714
+ *
1715
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more}
1716
+ */
1717
+ method?: Uppercase<HttpMethod>;
1718
+ /**
1719
+ * A function for serializing request query parameters. By default, arrays
1720
+ * will be exploded in form style, objects will be exploded in deepObject
1721
+ * style, and reserved characters are percent-encoded.
1722
+ *
1723
+ * This method will have no effect if the native `paramsSerializer()` Axios
1724
+ * API function is used.
1725
+ *
1726
+ * {@link https://swagger.io/docs/specification/serialization/#query View examples}
1727
+ */
1728
+ querySerializer?: QuerySerializer | QuerySerializerOptions;
1729
+ /**
1730
+ * A function validating request data. This is useful if you want to ensure
1731
+ * the request conforms to the desired shape, so it can be safely sent to
1732
+ * the server.
1733
+ */
1734
+ requestValidator?: (data: unknown) => Promise<unknown>;
1735
+ /**
1736
+ * A function transforming response data before it's returned. This is useful
1737
+ * for post-processing data, e.g., converting ISO strings into Date objects.
1738
+ */
1739
+ responseTransformer?: (data: unknown) => Promise<unknown>;
1740
+ /**
1741
+ * A function validating response data. This is useful if you want to ensure
1742
+ * the response conforms to the desired shape, so it can be safely passed to
1743
+ * the transformers and returned to the user.
1744
+ */
1745
+ responseValidator?: (data: unknown) => Promise<unknown>;
1746
+ }
1747
+ export type ServerSentEventsOptions<TData = unknown> = Omit<RequestInit, "body" | "method"> & Pick<Config, "method" | "responseTransformer" | "responseValidator"> & {
1748
+ /**
1749
+ * Fetch API implementation. You can use this option to provide a custom
1750
+ * fetch instance.
1751
+ *
1752
+ * @default globalThis.fetch
1753
+ */
1754
+ body?: RequestInit["body"] | undefined;
1755
+ fetch?: typeof fetch;
1756
+ /**
1757
+ * Implementing clients can call request interceptors inside this hook.
1758
+ */
1759
+ onRequest?: (url: string, init: RequestInit) => Promise<Request>;
1760
+ /**
1761
+ * Callback invoked when a network or parsing error occurs during streaming.
1762
+ *
1763
+ * This option applies only if the endpoint returns a stream of events.
1764
+ *
1765
+ * @param error The error that occurred.
1766
+ */
1767
+ onSseError?: (error: unknown) => void;
1768
+ /**
1769
+ * Callback invoked when an event is streamed from the server.
1770
+ *
1771
+ * This option applies only if the endpoint returns a stream of events.
1772
+ *
1773
+ * @param event Event streamed from the server.
1774
+ * @returns Nothing (void).
1775
+ */
1776
+ onSseEvent?: (event: StreamEvent<TData>) => void;
1777
+ serializedBody?: RequestInit["body"] | undefined;
1778
+ /**
1779
+ * Default retry delay in milliseconds.
1780
+ *
1781
+ * This option applies only if the endpoint returns a stream of events.
1782
+ *
1783
+ * @default 3000
1784
+ */
1785
+ sseDefaultRetryDelay?: number;
1786
+ /**
1787
+ * Maximum number of retry attempts before giving up.
1788
+ */
1789
+ sseMaxRetryAttempts?: number;
1790
+ /**
1791
+ * Maximum retry delay in milliseconds.
1792
+ *
1793
+ * Applies only when exponential backoff is used.
1794
+ *
1795
+ * This option applies only if the endpoint returns a stream of events.
1796
+ *
1797
+ * @default 30000
1798
+ */
1799
+ sseMaxRetryDelay?: number;
1800
+ /**
1801
+ * Optional sleep function for retry backoff.
1802
+ *
1803
+ * Defaults to using `setTimeout`.
1804
+ */
1805
+ sseSleepFn?: (ms: number) => Promise<void>;
1806
+ url: string;
1807
+ };
1808
+ export interface StreamEvent<TData = unknown> {
1809
+ data: TData;
1810
+ event?: string | undefined;
1811
+ id?: string | undefined;
1812
+ retry?: number;
1813
+ }
1814
+ export type ServerSentEventsResult<TData = unknown, TReturn = void, TNext = unknown> = {
1815
+ stream: AsyncGenerator<TData extends Record<string, unknown> ? TData[keyof TData] : TData, TReturn, TNext>;
1816
+ };
1817
+ export type ErrInterceptor<Err, Res, Req, Options> = (error: Err, response: Res, request: Req, options: Options) => Err | Promise<Err>;
1818
+ export type ReqInterceptor<Req, Options> = (request: Req, options: Options) => Req | Promise<Req>;
1819
+ export type ResInterceptor<Res, Req, Options> = (response: Res, request: Req, options: Options) => Res | Promise<Res>;
1820
+ declare class Interceptors<Interceptor> {
1821
+ fns: Array<Interceptor | null>;
1822
+ clear(): void;
1823
+ eject(id: number | Interceptor): void;
1824
+ exists(id: number | Interceptor): boolean;
1825
+ getInterceptorIndex(id: number | Interceptor): number;
1826
+ update(id: number | Interceptor, fn: Interceptor): number | Interceptor | false;
1827
+ use(fn: Interceptor): number;
1828
+ }
1829
+ export interface Middleware<Req, Res, Err, Options> {
1830
+ error: Interceptors<ErrInterceptor<Err, Res, Req, Options>>;
1831
+ request: Interceptors<ReqInterceptor<Req, Options>>;
1832
+ response: Interceptors<ResInterceptor<Res, Req, Options>>;
1833
+ }
1834
+ export type ResponseStyle = "data" | "fields";
1835
+ interface Config$1<T extends ClientOptions = ClientOptions> extends Omit<RequestInit, "body" | "headers" | "method">, Config {
1836
+ /**
1837
+ * Base URL for all requests made by this client.
1838
+ */
1839
+ baseUrl?: T["baseUrl"];
1840
+ /**
1841
+ * Fetch API implementation. You can use this option to provide a custom
1842
+ * fetch instance.
1843
+ *
1844
+ * @default globalThis.fetch
1845
+ */
1846
+ fetch?: typeof fetch;
1847
+ /**
1848
+ * Please don't use the Fetch client for Next.js applications. The `next`
1849
+ * options won't have any effect.
1850
+ *
1851
+ * Install {@link https://www.npmjs.com/package/@hey-api/client-next `@hey-api/client-next`} instead.
1852
+ */
1853
+ next?: never;
1854
+ /**
1855
+ * Return the response data parsed in a specified format. By default, `auto`
1856
+ * will infer the appropriate method from the `Content-Type` response header.
1857
+ * You can override this behavior with any of the {@link Body} methods.
1858
+ * Select `stream` if you don't want to parse response data at all.
1859
+ *
1860
+ * @default 'auto'
1861
+ */
1862
+ parseAs?: "arrayBuffer" | "auto" | "blob" | "formData" | "json" | "stream" | "text";
1863
+ /**
1864
+ * Should we return only data or multiple fields (data, error, response, etc.)?
1865
+ *
1866
+ * @default 'fields'
1867
+ */
1868
+ responseStyle?: ResponseStyle;
1869
+ /**
1870
+ * Throw an error instead of returning it in the response?
1871
+ *
1872
+ * @default false
1873
+ */
1874
+ throwOnError?: T["throwOnError"];
1875
+ }
1876
+ export interface RequestOptions<TData = unknown, TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends Config$1<{
1877
+ responseStyle: TResponseStyle;
1878
+ throwOnError: ThrowOnError;
1879
+ }>, Pick<ServerSentEventsOptions<TData>, "onRequest" | "onSseError" | "onSseEvent" | "sseDefaultRetryDelay" | "sseMaxRetryAttempts" | "sseMaxRetryDelay"> {
1880
+ /**
1881
+ * Any body that you want to add to your request.
1882
+ *
1883
+ * {@link https://developer.mozilla.org/docs/Web/API/fetch#body}
1884
+ */
1885
+ body?: unknown;
1886
+ path?: Record<string, unknown>;
1887
+ query?: Record<string, unknown>;
1888
+ /**
1889
+ * Security mechanism(s) to use for the request.
1890
+ */
1891
+ security?: ReadonlyArray<Auth>;
1892
+ url: Url;
1893
+ }
1894
+ export interface ResolvedRequestOptions<TResponseStyle extends ResponseStyle = "fields", ThrowOnError extends boolean = boolean, Url extends string = string> extends RequestOptions<unknown, TResponseStyle, ThrowOnError, Url> {
1895
+ headers: Headers;
1896
+ serializedBody?: string | undefined;
1897
+ }
1898
+ export type RequestResult<TData = unknown, TError = unknown, ThrowOnError extends boolean = boolean, TResponseStyle extends ResponseStyle = "fields"> = ThrowOnError extends true ? Promise<TResponseStyle extends "data" ? TData extends Record<string, unknown> ? TData[keyof TData] : TData : {
1899
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
1900
+ request: Request;
1901
+ response: Response;
1902
+ }> : Promise<TResponseStyle extends "data" ? (TData extends Record<string, unknown> ? TData[keyof TData] : TData) | undefined : ({
1903
+ data: TData extends Record<string, unknown> ? TData[keyof TData] : TData;
1904
+ error: undefined;
1905
+ } | {
1906
+ data: undefined;
1907
+ error: TError extends Record<string, unknown> ? TError[keyof TError] : TError;
1908
+ }) & {
1909
+ request: Request;
1910
+ response: Response;
1911
+ }>;
1912
+ export interface ClientOptions {
1913
+ baseUrl?: string;
1914
+ responseStyle?: ResponseStyle;
1915
+ throwOnError?: boolean;
1916
+ }
1917
+ export type MethodFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
1918
+ export type SseFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, "method">) => Promise<ServerSentEventsResult<TData, TError>>;
1919
+ export type RequestFn = <TData = unknown, TError = unknown, ThrowOnError extends boolean = false, TResponseStyle extends ResponseStyle = "fields">(options: Omit<RequestOptions<TData, TResponseStyle, ThrowOnError>, "method"> & Pick<Required<RequestOptions<TData, TResponseStyle, ThrowOnError>>, "method">) => RequestResult<TData, TError, ThrowOnError, TResponseStyle>;
1920
+ export type BuildUrlFn = <TData extends {
1921
+ body?: unknown;
1922
+ path?: Record<string, unknown>;
1923
+ query?: Record<string, unknown>;
1924
+ url: string;
1925
+ }>(options: TData & Options<TData>) => string;
1926
+ type Client$1 = Client<RequestFn, Config$1, MethodFn, BuildUrlFn, SseFn> & {
1927
+ interceptors: Middleware<Request, Response, unknown, ResolvedRequestOptions>;
1928
+ };
1929
+ export interface TEndpointData {
1930
+ body?: unknown;
1931
+ headers?: unknown;
1932
+ path?: unknown;
1933
+ query?: unknown;
1934
+ url: string;
1935
+ }
1936
+ export type OmitKeys<T, K> = Pick<T, Exclude<keyof T, K>>;
1937
+ export type Options<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown, TResponseStyle extends ResponseStyle = "fields"> = OmitKeys<RequestOptions<TResponse, TResponseStyle, ThrowOnError>, "body" | "path" | "query" | "url"> & ([
1938
+ TData
1939
+ ] extends [
1940
+ never
1941
+ ] ? unknown : Omit<TData, "url">);
1942
+ type Options$1<TData extends TEndpointData = TEndpointData, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options<TData, ThrowOnError, TResponse> & {
1943
+ /**
1944
+ * You can provide a client instance returned by `createClient()` instead of
1945
+ * individual options. This might be also useful if you want to implement a
1946
+ * custom client.
1947
+ */
1948
+ client?: Client$1;
1949
+ /**
1950
+ * You can pass arbitrary values through the `meta` object. This can be
1951
+ * used to access values that aren't defined as part of the SDK function.
1952
+ */
1953
+ meta?: Record<string, unknown>;
1954
+ };
1955
+ export type EndpointOptions<OptionsType> = Pick<OptionsType, Extract<keyof OptionsType, "body" | "headers" | "path" | "query">>;
1956
+ declare const createApplicationAccessApi: (client: Client$1) => {
1957
+ axes: {
1958
+ list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListAxesData, false, unknown>>) => Promise<AccessGrantAxis[]>;
1959
+ };
1960
+ catalog: {
1961
+ list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListCapabilitiesData, false, unknown>>) => Promise<AccessCapabilityNode[]>;
1962
+ };
1963
+ explain: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsExplainData, false, unknown>>) => Promise<AccessExplanation>;
1964
+ grants: {
1965
+ create: (options: EndpointOptions<Options$1<ApplicationAccessGrantsCreateData, false, unknown>>) => Promise<AccessGrant>;
1966
+ delete: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteData, false, unknown>>) => Promise<void>;
1967
+ deleteByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsDeleteByFqnData, false, unknown>>) => Promise<void>;
1968
+ get: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetData, false, unknown>>) => Promise<AccessGrant>;
1969
+ getByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsGetByFqnData, false, unknown>>) => Promise<AccessGrant>;
1970
+ list: (options: EndpointOptions<Options$1<ApplicationAccessGrantsListData, false, unknown>>) => Promise<AccessGrantList>;
1971
+ sync: (options: EndpointOptions<Options$1<ApplicationAccessGrantsSyncData, false, unknown>>) => Promise<AccessGrantSyncResult>;
1972
+ update: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateData, false, unknown>>) => Promise<AccessGrant>;
1973
+ updateByFqn: (options: EndpointOptions<Options$1<ApplicationAccessGrantsUpdateByFqnData, false, unknown>>) => Promise<AccessGrant>;
1974
+ };
1975
+ groups: {
1976
+ addMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsAddMemberData, false, unknown>>) => Promise<void>;
1977
+ create: (options: EndpointOptions<Options$1<ApplicationAccessGroupsCreateData, false, unknown>>) => Promise<AccessGroup>;
1978
+ delete: (options: EndpointOptions<Options$1<ApplicationAccessGroupsDeleteData, false, unknown>>) => Promise<void>;
1979
+ get: (options: EndpointOptions<Options$1<ApplicationAccessGroupsGetData, false, unknown>>) => Promise<AccessGroup>;
1980
+ list: (options: EndpointOptions<Options$1<ApplicationAccessGroupsListData, false, unknown>>) => Promise<AccessGroupPage>;
1981
+ removeMember: (options: EndpointOptions<Options$1<ApplicationAccessGroupsRemoveMemberData, false, unknown>>) => Promise<void>;
1982
+ update: (options: EndpointOptions<Options$1<ApplicationAccessGroupsUpdateData, false, unknown>>) => Promise<AccessGroup>;
1983
+ };
1984
+ invitations: {
1985
+ list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListInvitationsData, false, unknown>>) => Promise<AccessInvitationPage>;
1986
+ revoke: (options: EndpointOptions<Options$1<ApplicationAccessMembersRevokeInvitationData, false, unknown>>) => Promise<void>;
1987
+ };
1988
+ knowledgePolicies: {
1989
+ forSchema: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetSchemaKnowledgePoliciesData, false, unknown>>) => Promise<AccessSchemaKnowledgePolicies>;
1990
+ list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListKnowledgePoliciesData, false, unknown>>) => Promise<AccessKnowledgeDataPolicy[]>;
1991
+ };
1992
+ maxPrivileges: {
1993
+ get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile>;
1994
+ list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListMaxPrivilegesData, false, unknown>>) => Promise<AccessProfile[]>;
1995
+ };
1996
+ members: {
1997
+ create: (options: EndpointOptions<Options$1<ApplicationAccessMembersCreateData, false, unknown>>) => Promise<AccessMemberCreated>;
1998
+ get: (options: EndpointOptions<Options$1<ApplicationAccessMembersGetData, false, unknown>>) => Promise<AccessMember>;
1999
+ list: (options: EndpointOptions<Options$1<ApplicationAccessMembersListData, false, unknown>>) => Promise<AccessMemberPage>;
2000
+ remove: (options: EndpointOptions<Options$1<ApplicationAccessMembersDeleteData, false, unknown>>) => Promise<void>;
2001
+ resume: (options: EndpointOptions<Options$1<ApplicationAccessMembersResumeData, false, unknown>>) => Promise<void>;
2002
+ suspend: (options: EndpointOptions<Options$1<ApplicationAccessMembersSuspendData, false, unknown>>) => Promise<void>;
2003
+ };
2004
+ profiles: {
2005
+ get: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsGetProfileData, false, unknown>>) => Promise<AccessProfile>;
2006
+ list: (options: EndpointOptions<Options$1<ApplicationAccessDefinitionsListProfilesData, false, unknown>>) => Promise<AccessProfile[]>;
2007
+ };
2008
+ snapshot: (options: EndpointOptions<Options$1<ApplicationAccessPrincipalsSnapshotData, false, unknown>>) => Promise<AccessSnapshot>;
2009
+ };
2010
+ export type ApplicationAccessApi = ReturnType<typeof createApplicationAccessApi>;
786
2011
  declare const GatewayEffectRuntimeError_base: Schema.Class<GatewayEffectRuntimeError, Schema.TaggedStruct<"GatewayEffectRuntimeError", {
787
2012
  readonly cause: Schema.Defect;
788
2013
  }>, import("effect/Cause").YieldableError>;
@@ -795,6 +2020,17 @@ declare class GatewayEffectRuntimeError extends GatewayEffectRuntimeError_base {
795
2020
  }>, options: Schema.MakeOptions | undefined);
796
2021
  get message(): string;
797
2022
  }
2023
+ declare const ServerAccessError_base: Schema.Class<ServerAccessError, Schema.TaggedStruct<"ServerAccessError", {
2024
+ readonly body: Schema.StructWithRest<Schema.Struct<{
2025
+ readonly _tag: Schema.String;
2026
+ }>, readonly [
2027
+ Schema.$Record<Schema.String, Schema.Unknown>
2028
+ ]>;
2029
+ readonly status: Schema.Int;
2030
+ }>, import("effect/Cause").YieldableError>;
2031
+ declare class ServerAccessError extends ServerAccessError_base {
2032
+ get message(): string;
2033
+ }
798
2034
  declare const oauthErrorCodes: readonly [
799
2035
  "invalid_client",
800
2036
  "invalid_grant",
@@ -837,6 +2073,131 @@ declare class MemberSessionExchangeError extends MemberSessionExchangeError_base
837
2073
  }>, options: Schema.MakeOptions | undefined);
838
2074
  get message(): string;
839
2075
  }
2076
+ /** The Organization a `ci.access` call acts in. */
2077
+ export type ServerAccessContext = Readonly<{
2078
+ organizationId: string;
2079
+ }>;
2080
+ export type OptionsOf<F> = F extends (options: infer Options) => PromiseLike<infer _> ? Options : never;
2081
+ export type BodyOf<F> = OptionsOf<F> extends {
2082
+ body: infer B;
2083
+ } ? B : never;
2084
+ export type PathOf<F> = OptionsOf<F> extends {
2085
+ path: infer P;
2086
+ } ? P : never;
2087
+ export type QueryOf<F> = OptionsOf<F> extends {
2088
+ query?: infer Q;
2089
+ } ? NonNullable<Q> : never;
2090
+ export type ResultOf<F> = F extends (options: never) => PromiseLike<infer Result> ? Result : never;
2091
+ export type Api = ApplicationAccessApi;
2092
+ export type WithBody<F> = ServerAccessContext & BodyOf<F>;
2093
+ export type WithPath<F> = ServerAccessContext & PathOf<F>;
2094
+ /** How a `ci.access` call fails. */
2095
+ export type ServerAccessFailure = CiTransportError | ServerAccessError;
2096
+ export type Call<Request, Result> = (request: Request) => Effect.Effect<Result, ServerAccessFailure>;
2097
+ export type Method<Request, F> = Call<Request, ResultOf<F>>;
2098
+ /** A grant named by its id or by its Access Grant FQN. */
2099
+ export type GrantReference = PathOf<Api["grants"]["get"]> | PathOf<Api["grants"]["getByFqn"]>;
2100
+ export type ServerAccessMember = ResultOf<Api["members"]["get"]>;
2101
+ export type ServerAccessGrant = ResultOf<Api["grants"]["get"]>;
2102
+ /** The `access` service of a `ServerClient`. */
2103
+ export interface ServerAccessService {
2104
+ /** The Grant Axes and the slugs that key Axis Values. Needs `admin.profiles` at read. */
2105
+ readonly axes: Readonly<{
2106
+ list: Method<ServerAccessContext, Api["axes"]["list"]>;
2107
+ }>;
2108
+ /** The Capability Catalog of the Organization. Needs `admin.profiles` at read. */
2109
+ readonly catalog: Readonly<{
2110
+ list: Method<ServerAccessContext, Api["catalog"]["list"]>;
2111
+ }>;
2112
+ /**
2113
+ * Why a principal may use a capability or act on a Knowledge record: its
2114
+ * grants with their path and the matching policies. Needs `admin.grants`
2115
+ * at read.
2116
+ */
2117
+ readonly explain: Method<WithBody<Api["explain"]>, Api["explain"]>;
2118
+ /**
2119
+ * Access Grants by id or Access Grant FQN. Writes need `admin.grants` at
2120
+ * manage and pass Grant Authority; `sync` makes the runtime grants below
2121
+ * a namespace exactly the list. Reads need `admin.grants` at read.
2122
+ */
2123
+ readonly grants: Readonly<{
2124
+ create: Method<WithBody<Api["grants"]["create"]>, Api["grants"]["create"]>;
2125
+ delete: Call<ServerAccessContext & GrantReference, void>;
2126
+ get: Call<ServerAccessContext & GrantReference, ServerAccessGrant>;
2127
+ /** The grants of a user or Group, or below a namespace; at least one of them. */
2128
+ list: Method<ServerAccessContext & QueryOf<Api["grants"]["list"]>, Api["grants"]["list"]>;
2129
+ sync: Method<WithBody<Api["grants"]["sync"]>, Api["grants"]["sync"]>;
2130
+ update: Call<ServerAccessContext & GrantReference & BodyOf<Api["grants"]["update"]>, ServerAccessGrant>;
2131
+ }>;
2132
+ /**
2133
+ * Groups. Reads need `admin.groups` at read, writes at manage; adding or
2134
+ * removing a member of a Group that a holders-only grant reaches also
2135
+ * needs Grant Authority over that grant. An app server reads Groups but
2136
+ * writes none.
2137
+ */
2138
+ readonly groups: Readonly<{
2139
+ addMember: Call<WithPath<Api["groups"]["addMember"]> & BodyOf<Api["groups"]["addMember"]>, void>;
2140
+ create: Method<WithBody<Api["groups"]["create"]>, Api["groups"]["create"]>;
2141
+ delete: Call<WithPath<Api["groups"]["delete"]>, void>;
2142
+ get: Method<WithPath<Api["groups"]["get"]>, Api["groups"]["get"]>;
2143
+ /** A page of Groups; pass `next` as `page` to read the page after it. */
2144
+ list: Method<ServerAccessContext & QueryOf<Api["groups"]["list"]>, Api["groups"]["list"]>;
2145
+ removeMember: Call<WithPath<Api["groups"]["removeMember"]>, void>;
2146
+ update: Method<WithPath<Api["groups"]["update"]> & BodyOf<Api["groups"]["update"]>, Api["groups"]["update"]>;
2147
+ }>;
2148
+ /**
2149
+ * Invitations that `members.create` sent with mode `invitation`, newest
2150
+ * first. Reads need `admin.users` at read, a revoke at manage. Only a
2151
+ * service principal invites, so an app server is refused.
2152
+ */
2153
+ readonly invitations: Readonly<{
2154
+ /** A page of invitations, optionally by `status`; pass `next` as `page` to read the page after it. */
2155
+ list: Method<ServerAccessContext & QueryOf<Api["invitations"]["list"]>, Api["invitations"]["list"]>;
2156
+ revoke: Call<WithPath<Api["invitations"]["revoke"]>, void>;
2157
+ }>;
2158
+ /**
2159
+ * The Knowledge Data Policies, read only: the core and packages declare
2160
+ * them. `forSchema` answers the policies that decide the reads and the
2161
+ * writes of one schema, by its FQN. Needs `admin.profiles` at read.
2162
+ */
2163
+ readonly knowledgePolicies: Readonly<{
2164
+ forSchema: Method<WithPath<Api["knowledgePolicies"]["forSchema"]>, Api["knowledgePolicies"]["forSchema"]>;
2165
+ list: Method<ServerAccessContext, Api["knowledgePolicies"]["list"]>;
2166
+ }>;
2167
+ /**
2168
+ * The Max Privileges templates, read only: the most an app's user tokens
2169
+ * or an API key may do. Needs `admin.profiles` at read.
2170
+ */
2171
+ readonly maxPrivileges: Readonly<{
2172
+ get: Method<WithPath<Api["maxPrivileges"]["get"]>, Api["maxPrivileges"]["get"]>;
2173
+ list: Method<ServerAccessContext, Api["maxPrivileges"]["list"]>;
2174
+ }>;
2175
+ /**
2176
+ * Members and guests. `create` needs `admin.grants` at manage and Grant
2177
+ * Authority over each grant; reads need `admin.users` at read for
2178
+ * members and `admin.guests` at read for guests; changes need the same at
2179
+ * manage. An app server sees and changes only the guests it created.
2180
+ */
2181
+ readonly members: Readonly<{
2182
+ create: Method<WithBody<Api["members"]["create"]>, Api["members"]["create"]>;
2183
+ /** The member with this address, or `null` when the caller sees none. */
2184
+ findByEmail: Call<ServerAccessContext & Readonly<{
2185
+ email: string;
2186
+ }>, ServerAccessMember | null>;
2187
+ get: Method<WithPath<Api["members"]["get"]>, Api["members"]["get"]>;
2188
+ list: Method<ServerAccessContext & QueryOf<Api["members"]["list"]>, Api["members"]["list"]>;
2189
+ remove: Method<WithPath<Api["members"]["remove"]>, Api["members"]["remove"]>;
2190
+ resume: Method<WithPath<Api["members"]["resume"]>, Api["members"]["resume"]>;
2191
+ suspend: Method<WithPath<Api["members"]["suspend"]>, Api["members"]["suspend"]>;
2192
+ }>;
2193
+ /** Access Profiles, read only. Needs `admin.profiles` at read. */
2194
+ readonly profiles: Readonly<{
2195
+ get: Method<WithPath<Api["profiles"]["get"]>, Api["profiles"]["get"]>;
2196
+ list: Method<ServerAccessContext, Api["profiles"]["list"]>;
2197
+ }>;
2198
+ /** A user's Access Snapshot in the Organization. Needs `admin.grants` at read. */
2199
+ readonly snapshot: Method<WithPath<Api["snapshot"]>, Api["snapshot"]>;
2200
+ }
840
2201
  /**
841
2202
  * A client secret: a string at `.`, or the `Redacted` string that Effect
842
2203
  * `Config.Redacted` reads for the `./effect` layers.
@@ -948,6 +2309,12 @@ export type ServerResourceUploadResult = Readonly<{
948
2309
  }>;
949
2310
  }>;
950
2311
  export type ServerClientValue = Readonly<{
2312
+ /**
2313
+ * Members and guests, Access Grants and the read-only access model of an
2314
+ * Organization (ARC-010). A refusal of CI fails with `ServerAccessError`.
2315
+ * Calls are not retried.
2316
+ */
2317
+ access: ServerAccessService;
951
2318
  /** A File upload slot; a refusal of CI is a value of the result. */
952
2319
  createUpload: (request: ServerResourceUploadRequest) => Effect.Effect<ServerResourceUploadResult, CiTransportError>;
953
2320
  /** The value of one operation; an Expected Error of CI fails with `CiError`. */
@@ -967,6 +2334,12 @@ export type ServerClientValue = Readonly<{
967
2334
  sendMessage: (request: ServerMessageSendRequest) => Effect.Effect<MessageSendResult, CiTransportError>;
968
2335
  }>;
969
2336
  declare const ServerClient_base: Context.ServiceClass<ServerClient, "@collective-intelligence/external-apps-server-sdk/ServerClient", Readonly<{
2337
+ /**
2338
+ * Members and guests, Access Grants and the read-only access model of an
2339
+ * Organization (ARC-010). A refusal of CI fails with `ServerAccessError`.
2340
+ * Calls are not retried.
2341
+ */
2342
+ access: ServerAccessService;
970
2343
  /** A File upload slot; a refusal of CI is a value of the result. */
971
2344
  createUpload: (request: ServerResourceUploadRequest) => Effect.Effect<ServerResourceUploadResult, CiTransportError>;
972
2345
  /** The value of one operation; an Expected Error of CI fails with `CiError`. */
@@ -1267,6 +2640,8 @@ declare const GatewayEffectRuntimeError$1: typeof GatewayEffectRuntimeError;
1267
2640
  type GatewayEffectRuntimeError$1 = GatewayEffectRuntimeError;
1268
2641
  declare const MemberSessionExchangeError$1: typeof MemberSessionExchangeError;
1269
2642
  type MemberSessionExchangeError$1 = MemberSessionExchangeError;
2643
+ declare const ServerAccessError$1: typeof ServerAccessError;
2644
+ type ServerAccessError$1 = ServerAccessError;
1270
2645
  declare const ServerClient$1: typeof ServerClient;
1271
2646
  type ServerClient$1 = ServerClient;
1272
2647
  export declare const layerServerClient: (config: ServerClientConfig<ClientSecret>) => import("effect/Layer").Layer<ServerClient, never, never>;
@@ -1308,6 +2683,7 @@ export {
1308
2683
  FederatedAuthErrorCode$1 as FederatedAuthErrorCode,
1309
2684
  GatewayEffectRuntimeError$1 as GatewayEffectRuntimeError,
1310
2685
  MemberSessionExchangeError$1 as MemberSessionExchangeError,
2686
+ ServerAccessError$1 as ServerAccessError,
1311
2687
  ServerClient$1 as ServerClient,
1312
2688
  };
1313
2689