synapse-react-client 3.3.6 → 3.3.7

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/index.d.ts CHANGED
@@ -276,6 +276,7 @@ import { UserGroupHeaderResponse } from '@sage-bionetworks/synapse-types';
276
276
  import { UserGroupHeaderResponsePage } from '@sage-bionetworks/synapse-types';
277
277
  import { UserProfile } from '@sage-bionetworks/synapse-types';
278
278
  import { UseStorageValueResult } from '@react-hookz/web/cjs/useStorageValue';
279
+ import { UseSuspenseQueryResult } from '@tanstack/react-query';
279
280
  import { ValidateDefiningSqlResponse } from '@sage-bionetworks/synapse-types';
280
281
  import { ValidationResults } from '@sage-bionetworks/synapse-types';
281
282
  import { VerificationSubmission } from '@sage-bionetworks/synapse-types';
@@ -832,6 +833,20 @@ declare function createColumnModels(accessToken: string, columnModels: SetOption
832
833
  */
833
834
  declare const createEntity: <T extends Entity>(entity: T, accessToken: string | undefined) => Promise<T>;
834
835
 
836
+ /**
837
+ * Create a new Access Control List (ACL), overriding inheritance.
838
+ *
839
+ * By default, Entities such as FileEntity and Folder inherit their permission from their containing Project. For such
840
+ * Entities the Project is the Entity's 'benefactor'. This permission inheritance can be overridden by creating an ACL
841
+ * for the Entity. When this occurs the Entity becomes its own benefactor and all permission are determined by its own ACL.
842
+ *
843
+ * If the ACL of an Entity is deleted, then its benefactor will automatically be set to its parent's benefactor.
844
+ *
845
+ * Note: The caller must be granted ACCESS_TYPE.CHANGE_PERMISSIONS on the Entity to call this method.
846
+ * https://rest-docs.synapse.org/rest/POST/entity/id/acl.html
847
+ */
848
+ declare const createEntityACL: (acl: AccessControlList, accessToken?: string | undefined) => Promise<AccessControlList>;
849
+
835
850
  /**
836
851
  * Create an evaluation queue
837
852
  * https://rest-docs.synapse.org/rest/POST/evaluation.html
@@ -1076,6 +1091,21 @@ declare const deleteEmail: (accessToken: string | undefined, email: string) => P
1076
1091
 
1077
1092
  declare const deleteEntity: (accessToken: string | undefined, entityId: string | number) => Promise<void>;
1078
1093
 
1094
+ /**
1095
+ * Delete the Access Control List (ACL) for a given Entity.
1096
+ *
1097
+ * By default, Entities such as FileEntity and Folder inherit their permission from their containing Project. For such
1098
+ * Entities the Project is the Entity's 'benefactor'. This permission inheritance can be overridden by creating an ACL
1099
+ * for the Entity. When this occurs the Entity becomes its own benefactor and all permission are determined by its own ACL.
1100
+ *
1101
+ * If the ACL of an Entity is deleted, then its benefactor will automatically be set to its parent's benefactor. The ACL
1102
+ * for a Project cannot be deleted.
1103
+ *
1104
+ * Note: The caller must be granted ACCESS_TYPE.CHANGE_PERMISSIONS on the Entity to call this method.
1105
+ * https://rest-docs.synapse.org/rest/PUT/entity/id/acl.html
1106
+ */
1107
+ declare const deleteEntityACL: (id: string, accessToken?: string | undefined) => Promise<void>;
1108
+
1079
1109
  /**
1080
1110
  * Delete an existing evaluation queue
1081
1111
  * https://rest-docs.synapse.org/rest/PUT/evaluation/evalId.html
@@ -2727,6 +2757,8 @@ declare type ImmutableTableQueryResult = {
2727
2757
  currentQueryRequest: ReadonlyDeep<QueryBundleRequest>;
2728
2758
  /** The next (uncommitted) query request. This will become the current query request when commitChanges is called, or the configured debounced timer elapses. */
2729
2759
  nextQueryRequest: ReadonlyDeep<QueryBundleRequest>;
2760
+ /** Resets the debounce timer to delay committing changes in `nextQueryRequest` */
2761
+ resetDebounceTimer: () => void;
2730
2762
  /** Update the currentQueryRequest to be the nextQueryRequest */
2731
2763
  commitChanges: () => void;
2732
2764
  getInitQueryRequest: () => QueryBundleRequest;
@@ -3667,6 +3699,7 @@ export declare type QueryContextType<TIncludedFields extends OptionalQueryBundle
3667
3699
  executeQueryRequest: ImmutableTableQueryResult['setQuery'];
3668
3700
  /** Resets the query to its initial state, clearing all filters added by the user */
3669
3701
  resetQuery: ImmutableTableQueryResult['resetQuery'];
3702
+ resetDebounceTimer: ImmutableTableQueryResult['resetDebounceTimer'];
3670
3703
  addValueToSelectedFacet: ImmutableTableQueryResult['addValueToSelectedFacet'];
3671
3704
  setRangeFacetValue: ImmutableTableQueryResult['setRangeFacetValue'];
3672
3705
  removeSelectedFacet: ImmutableTableQueryResult['removeSelectedFacet'];
@@ -4413,7 +4446,9 @@ declare namespace SynapseClient {
4413
4446
  getEntityHeaders,
4414
4447
  getEntityAlias,
4415
4448
  getEntityHeader,
4449
+ createEntityACL,
4416
4450
  updateEntityACL,
4451
+ deleteEntityACL,
4417
4452
  updateEntity,
4418
4453
  deleteEntity,
4419
4454
  getEntityBundleV2,
@@ -5280,11 +5315,16 @@ declare namespace SynapseQueries {
5280
5315
  useGetEntityAlias,
5281
5316
  useGetEntityEvaluations,
5282
5317
  useGetEntityPermissions,
5318
+ useCreateEntityACL,
5283
5319
  useUpdateEntityACL,
5320
+ useDeleteEntityACL,
5321
+ useSuspenseGetEntityBenefactorACL,
5284
5322
  useUpdateTableColumns,
5285
5323
  useGetSchemaBinding,
5286
5324
  useGetValidationResults,
5325
+ useGetEntityBundleQueryOptions,
5287
5326
  useGetEntityBundle,
5327
+ useSuspenseGetEntityBundle,
5288
5328
  useGetEntityActionsRequired,
5289
5329
  useGetEntityChallenge,
5290
5330
  useGetEntityChildren,
@@ -5342,6 +5382,7 @@ declare namespace SynapseQueries {
5342
5382
  useGetProjectsInfinite,
5343
5383
  useGetNotificationEmail,
5344
5384
  useGetCurrentUserProfile,
5385
+ useSuspenseGetCurrentUserProfile,
5345
5386
  useGetUserBundle,
5346
5387
  useGetCurrentUserBundle,
5347
5388
  useGetUserProfile,
@@ -5812,6 +5853,8 @@ declare function useCreateAccessRequirementACL(options?: UseMutationOptions<Acce
5812
5853
 
5813
5854
  declare function useCreateEntity(options?: UseMutationOptions<Entity, SynapseClientError, Pick<Entity, 'name' | 'description' | 'parentId' | 'concreteType'>>): UseMutationResult<Entity, SynapseClientError, Pick<Entity, "name" | "description" | "concreteType" | "parentId">, unknown>;
5814
5855
 
5856
+ declare function useCreateEntityACL(options?: Partial<UseMutationOptions<AccessControlList, SynapseClientError, AccessControlList>>): UseMutationResult<AccessControlList, SynapseClientError, AccessControlList, unknown>;
5857
+
5815
5858
  declare function useCreateLockAccessRequirement(options?: Partial<UseMutationOptions<AccessRequirement, SynapseClientError, string>>): UseMutationResult<AccessRequirement, SynapseClientError, string, unknown>;
5816
5859
 
5817
5860
  declare function useCreateOAuthClient(options?: Partial<UseMutationOptions<OAuthClient, SynapseClientError, OAuthClient>>): UseMutationResult<OAuthClient, SynapseClientError, OAuthClient, unknown>;
@@ -5839,6 +5882,8 @@ declare function useDeleteAccessRequirementACL(options?: UseMutationOptions<void
5839
5882
 
5840
5883
  declare function useDeleteEntity(options?: Partial<UseMutationOptions<void, SynapseClientError, string>>): UseMutationResult<void, SynapseClientError, string, unknown>;
5841
5884
 
5885
+ declare function useDeleteEntityACL(options?: Partial<UseMutationOptions<void, SynapseClientError, string>>): UseMutationResult<void, SynapseClientError, string, unknown>;
5886
+
5842
5887
  declare function useDeleteOAuthClient(options?: Partial<UseMutationOptions<void, SynapseClientError, string>>): UseMutationResult<void, SynapseClientError, string, unknown>;
5843
5888
 
5844
5889
  declare function useDeleteTeamMembership(options?: Partial<UseMutationOptions<void, SynapseClientError, TeamMembershipParam>>): UseMutationResult<void, SynapseClientError, TeamMembershipParam, unknown>;
@@ -5918,7 +5963,12 @@ declare function useGetEntityActionsRequired(entityId: string, options?: Partial
5918
5963
 
5919
5964
  declare function useGetEntityAlias(alias: string, options?: Partial<UseQueryOptions<EntityId | null, SynapseClientError>>): UseQueryResult<EntityId | null, SynapseClientError>;
5920
5965
 
5921
- declare function useGetEntityBundle<T extends EntityBundleRequest = typeof ALL_ENTITY_BUNDLE_FIELDS>(entityId: string, version?: number, bundleRequest?: T, options?: Partial<UseQueryOptions<EntityBundle<T>, SynapseClientError>>): UseQueryResult<EntityBundle<T>, SynapseClientError>;
5966
+ declare function useGetEntityBundle<T extends EntityBundleRequest = typeof ALL_ENTITY_BUNDLE_FIELDS, TSelect = EntityBundle<T>>(entityId: string, version?: number, bundleRequest?: T, options?: Partial<UseQueryOptions<EntityBundle<T>, SynapseClientError, TSelect>>): UseQueryResult<TSelect, SynapseClientError>;
5967
+
5968
+ declare function useGetEntityBundleQueryOptions<T extends EntityBundleRequest = typeof ALL_ENTITY_BUNDLE_FIELDS>(entityId: string, version?: number, bundleRequest?: T): {
5969
+ queryKey: QueryKey;
5970
+ queryFn: () => Promise<EntityBundle<T>>;
5971
+ };
5922
5972
 
5923
5973
  declare function useGetEntityChallenge(entityId: string, options?: Partial<UseQueryOptions<Challenge, SynapseClientError>>): UseQueryResult<Challenge, SynapseClientError>;
5924
5974
 
@@ -6049,7 +6099,7 @@ declare function useGetUserGroupHeader(principalId: string, options?: Partial<Us
6049
6099
  /**
6050
6100
  * Get an array of UserGroupHeaders, utilizing a react-query cache. This is always an unauthenticated call
6051
6101
  * (the users current email addresses will never be returned in the result).
6052
- * @param principalId
6102
+ * @param principalIds
6053
6103
  * @param options
6054
6104
  * @returns
6055
6105
  */
@@ -6405,6 +6455,20 @@ request: CreateSubmissionRequest;
6405
6455
  accessRequirementId: string;
6406
6456
  }, unknown>;
6407
6457
 
6458
+ declare function useSuspenseGetCurrentUserProfile(options?: Partial<UseQueryOptions<UserProfile, SynapseClientError>>): UseSuspenseQueryResult<UserProfile, SynapseClientError>;
6459
+
6460
+ /**
6461
+ * Retrieve the ACL of an entity. This call will succeed even for entities where the caller
6462
+ * does not have READ permission.
6463
+ * @param entityId
6464
+ * @param options
6465
+ */
6466
+ declare function useSuspenseGetEntityBenefactorACL(entityId: string, options?: Partial<UseQueryOptions<EntityBundle<{
6467
+ includeBenefactorACL: true;
6468
+ }>, SynapseClientError, AccessControlList>>): UseSuspenseQueryResult<AccessControlList, SynapseClientError>;
6469
+
6470
+ declare function useSuspenseGetEntityBundle<T extends EntityBundleRequest = typeof ALL_ENTITY_BUNDLE_FIELDS>(entityId: string, version?: number, bundleRequest?: T, options?: Partial<UseQueryOptions<EntityBundle<T>, SynapseClientError>>): UseSuspenseQueryResult<EntityBundle<T>, SynapseClientError>;
6471
+
6408
6472
  export declare function useSynapseContext(): SynapseContextType;
6409
6473
 
6410
6474
  declare function useUpdateAccessRequirement<T extends AccessRequirement>(options?: UseMutationOptions<T, SynapseClientError, T>): UseMutationResult<T, SynapseClientError, T, unknown>;