@medplum/mock 5.1.28 → 5.1.30

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.
@@ -26,6 +26,8 @@ import { Patient } from '@medplum/fhirtypes';
26
26
  import type { PlanDefinition } from '@medplum/fhirtypes';
27
27
  import { Practitioner } from '@medplum/fhirtypes';
28
28
  import type { ProfileResource } from '@medplum/core';
29
+ import type { Project } from '@medplum/fhirtypes';
30
+ import type { ProjectMembership } from '@medplum/fhirtypes';
29
31
  import type { Questionnaire } from '@medplum/fhirtypes';
30
32
  import type { QuestionnaireResponse } from '@medplum/fhirtypes';
31
33
  import { Reference } from '@medplum/fhirtypes';
@@ -335,6 +337,7 @@ export declare class MockClient extends MedplumClient {
335
337
  activeLoginOverride?: LoginState;
336
338
  private agentAvailable;
337
339
  private profile;
340
+ private project;
338
341
  subManager: MockSubscriptionManager | undefined;
339
342
  constructor(clientOptions?: MockClientOptions);
340
343
  get mock(): MockClientTestMethods;
@@ -349,6 +352,7 @@ export declare class MockClient extends MedplumClient {
349
352
  */
350
353
  withSeeding<T>(fn: () => T | Promise<T>): Promise<T>;
351
354
  getProfile(): ProfileResource | undefined;
355
+ getProject(): Project | undefined;
352
356
  getUserConfiguration(): WithId<UserConfiguration> | undefined;
353
357
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
354
358
  /**
@@ -423,6 +427,12 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
423
427
  * MedplumContext.profile returning undefined as if no one were logged in.
424
428
  */
425
429
  readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
430
+ /**
431
+ * Override the active project returned by `getProject()`. Defaults to `TestProject`,
432
+ * which has all features enabled. Specifying null results in `getProject()` returning
433
+ * undefined, as if there were no active project.
434
+ */
435
+ readonly project?: Project | null;
426
436
  /**
427
437
  * Override the `MockFetchClient` used by this `MockClient`.
428
438
  */
@@ -432,6 +442,7 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
432
442
  declare interface MockClientTestMethods {
433
443
  withSeeding: <T>(fn: () => T | Promise<T>) => Promise<T>;
434
444
  setProfile: (profile: ProfileResource | undefined) => void;
445
+ setProject: (project: Project | undefined) => void;
435
446
  setAgentAvailable: (value: boolean) => void;
436
447
  setSubscriptionManager: (subManager: MockSubscriptionManager) => void;
437
448
  }
@@ -514,6 +525,15 @@ export declare const SimpsonsFamily: Group;
514
525
 
515
526
  export declare const TestOrganization: WithId<Organization>;
516
527
 
528
+ export declare const TestProject: {
529
+ resourceType: "Project";
530
+ id: string;
531
+ name: string;
532
+ features: ("ai" | "ai-realtime" | "aws-comprehend" | "aws-textract" | "bots" | "cron" | "email" | "google-auth-required" | "graphql-introspection" | "scheduling" | "websocket-subscriptions" | "transaction-bundles" | "validate-terminology" | "range-search" | "log-streaming")[];
533
+ };
534
+
535
+ export declare const TestProjectMembership: ProjectMembership;
536
+
517
537
  export declare const USCoreStructureDefinitionList: StructureDefinition[];
518
538
 
519
539
  export { }
@@ -26,6 +26,8 @@ import { Patient } from '@medplum/fhirtypes';
26
26
  import type { PlanDefinition } from '@medplum/fhirtypes';
27
27
  import { Practitioner } from '@medplum/fhirtypes';
28
28
  import type { ProfileResource } from '@medplum/core';
29
+ import type { Project } from '@medplum/fhirtypes';
30
+ import type { ProjectMembership } from '@medplum/fhirtypes';
29
31
  import type { Questionnaire } from '@medplum/fhirtypes';
30
32
  import type { QuestionnaireResponse } from '@medplum/fhirtypes';
31
33
  import { Reference } from '@medplum/fhirtypes';
@@ -335,6 +337,7 @@ export declare class MockClient extends MedplumClient {
335
337
  activeLoginOverride?: LoginState;
336
338
  private agentAvailable;
337
339
  private profile;
340
+ private project;
338
341
  subManager: MockSubscriptionManager | undefined;
339
342
  constructor(clientOptions?: MockClientOptions);
340
343
  get mock(): MockClientTestMethods;
@@ -349,6 +352,7 @@ export declare class MockClient extends MedplumClient {
349
352
  */
350
353
  withSeeding<T>(fn: () => T | Promise<T>): Promise<T>;
351
354
  getProfile(): ProfileResource | undefined;
355
+ getProject(): Project | undefined;
352
356
  getUserConfiguration(): WithId<UserConfiguration> | undefined;
353
357
  setActiveLoginOverride(activeLoginOverride: LoginState): void;
354
358
  /**
@@ -423,6 +427,12 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
423
427
  * MedplumContext.profile returning undefined as if no one were logged in.
424
428
  */
425
429
  readonly profile?: ReturnType<MedplumClient['getProfile']> | null;
430
+ /**
431
+ * Override the active project returned by `getProject()`. Defaults to `TestProject`,
432
+ * which has all features enabled. Specifying null results in `getProject()` returning
433
+ * undefined, as if there were no active project.
434
+ */
435
+ readonly project?: Project | null;
426
436
  /**
427
437
  * Override the `MockFetchClient` used by this `MockClient`.
428
438
  */
@@ -432,6 +442,7 @@ export declare interface MockClientOptions extends Pick<MedplumClientOptions, 'b
432
442
  declare interface MockClientTestMethods {
433
443
  withSeeding: <T>(fn: () => T | Promise<T>) => Promise<T>;
434
444
  setProfile: (profile: ProfileResource | undefined) => void;
445
+ setProject: (project: Project | undefined) => void;
435
446
  setAgentAvailable: (value: boolean) => void;
436
447
  setSubscriptionManager: (subManager: MockSubscriptionManager) => void;
437
448
  }
@@ -514,6 +525,15 @@ export declare const SimpsonsFamily: Group;
514
525
 
515
526
  export declare const TestOrganization: WithId<Organization>;
516
527
 
528
+ export declare const TestProject: {
529
+ resourceType: "Project";
530
+ id: string;
531
+ name: string;
532
+ features: ("ai" | "ai-realtime" | "aws-comprehend" | "aws-textract" | "bots" | "cron" | "email" | "google-auth-required" | "graphql-introspection" | "scheduling" | "websocket-subscriptions" | "transaction-bundles" | "validate-terminology" | "range-search" | "log-streaming")[];
533
+ };
534
+
535
+ export declare const TestProjectMembership: ProjectMembership;
536
+
517
537
  export declare const USCoreStructureDefinitionList: StructureDefinition[];
518
538
 
519
539
  export { }