@icanbwell/bwell-sdk-ts 1.35.0 → 1.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/dist/__version__.d.ts +1 -1
  2. package/dist/__version__.js +1 -1
  3. package/dist/api/api-provider-factory.d.ts +1 -1
  4. package/dist/api/api-provider-factory.js +2 -1
  5. package/dist/api/base/api-provider.d.ts +8 -14
  6. package/dist/api/base/connection/connection-manager.d.ts +0 -2
  7. package/dist/api/base/health-data/health-manager.d.ts +4 -227
  8. package/dist/api/base/health-data/index.d.ts +1 -1
  9. package/dist/api/base/index.d.ts +0 -4
  10. package/dist/api/base/index.js +4 -4
  11. package/dist/api/base/user/index.d.ts +1 -2
  12. package/dist/api/base/user/index.js +4 -1
  13. package/dist/api/base/user/user-manager.d.ts +1 -7
  14. package/dist/api/graphql-api/connection/graphql-connection-manager.d.ts +1 -3
  15. package/dist/api/graphql-api/connection/graphql-connection-manager.js +23 -21
  16. package/dist/api/graphql-api/connection/index.d.ts +0 -1
  17. package/dist/api/graphql-api/connection/index.js +1 -1
  18. package/dist/api/graphql-api/graphql-api-provider.d.ts +4 -13
  19. package/dist/api/graphql-api/graphql-api-provider.js +10 -9
  20. package/dist/api/graphql-api/graphql-sdk/graphql-sdk.js +1 -1
  21. package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +3 -27
  22. package/dist/api/graphql-api/healthdata/graphql-health-manager.js +26 -328
  23. package/dist/api/graphql-api/healthdata/health-data-request-factory.d.ts +12 -0
  24. package/dist/api/graphql-api/healthdata/health-data-request-factory.js +12 -0
  25. package/dist/api/graphql-api/user/graphql-user-manager.d.ts +3 -6
  26. package/dist/api/graphql-api/user/graphql-user-manager.js +68 -46
  27. package/dist/bwell-sdk/bwell-sdk.d.ts +2 -13
  28. package/dist/bwell-sdk/bwell-sdk.js +27 -27
  29. package/dist/config/sdk-config.js +3 -3
  30. package/dist/graphql/operations/index.d.ts +11 -282
  31. package/dist/graphql/operations/index.js +227 -2410
  32. package/dist/graphql/operations/types.d.ts +2349 -15206
  33. package/dist/graphql/schema.d.ts +68178 -4822
  34. package/dist/graphql/schema.js +7 -63
  35. package/package.json +4 -2
  36. package/dist/api/base/activity/activity-manager.d.ts +0 -35
  37. package/dist/api/base/activity/activity-manager.js +0 -1
  38. package/dist/api/base/activity/get-tasks-request.d.ts +0 -49
  39. package/dist/api/base/activity/get-tasks-request.js +0 -35
  40. package/dist/api/base/activity/index.d.ts +0 -4
  41. package/dist/api/base/activity/index.js +0 -2
  42. package/dist/api/base/activity/types.d.ts +0 -3
  43. package/dist/api/base/activity/types.js +0 -5
  44. package/dist/api/base/activity/update-task-status-request.d.ts +0 -18
  45. package/dist/api/base/activity/update-task-status-request.js +0 -15
  46. package/dist/api/base/device/device-manager.d.ts +0 -22
  47. package/dist/api/base/device/device-manager.js +0 -5
  48. package/dist/api/base/device/device-request.d.ts +0 -62
  49. package/dist/api/base/device/device-request.js +0 -71
  50. package/dist/api/base/device/index.d.ts +0 -2
  51. package/dist/api/base/device/index.js +0 -2
  52. package/dist/api/base/event/event-manager.d.ts +0 -16
  53. package/dist/api/base/event/event-manager.js +0 -1
  54. package/dist/api/base/event/event-request.d.ts +0 -35
  55. package/dist/api/base/event/event-request.js +0 -64
  56. package/dist/api/base/event/index.d.ts +0 -2
  57. package/dist/api/base/event/index.js +0 -1
  58. package/dist/api/base/search/index.d.ts +0 -4
  59. package/dist/api/base/search/index.js +0 -3
  60. package/dist/api/base/search/request-connection-request.d.ts +0 -24
  61. package/dist/api/base/search/request-connection-request.js +0 -3
  62. package/dist/api/base/search/search-health-resources-request.d.ts +0 -87
  63. package/dist/api/base/search/search-health-resources-request.js +0 -20
  64. package/dist/api/base/search/search-manager.d.ts +0 -58
  65. package/dist/api/base/search/search-manager.js +0 -1
  66. package/dist/api/base/search/search-request.d.ts +0 -84
  67. package/dist/api/base/search/search-request.js +0 -78
  68. package/dist/api/base/user/create-data-export-direct-download-url-request.d.ts +0 -14
  69. package/dist/api/base/user/create-data-export-direct-download-url-request.js +0 -21
  70. package/dist/api/graphql-api/activity/activity-request-factories.d.ts +0 -13
  71. package/dist/api/graphql-api/activity/activity-request-factories.js +0 -66
  72. package/dist/api/graphql-api/activity/graphql-activity-manager.d.ts +0 -14
  73. package/dist/api/graphql-api/activity/graphql-activity-manager.js +0 -72
  74. package/dist/api/graphql-api/activity/index.d.ts +0 -1
  75. package/dist/api/graphql-api/activity/index.js +0 -1
  76. package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.d.ts +0 -18
  77. package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.js +0 -40
  78. package/dist/api/graphql-api/device/device-request-factory.d.ts +0 -9
  79. package/dist/api/graphql-api/device/device-request-factory.js +0 -15
  80. package/dist/api/graphql-api/device/graphql-device-manager.d.ts +0 -13
  81. package/dist/api/graphql-api/device/graphql-device-manager.js +0 -73
  82. package/dist/api/graphql-api/device/index.d.ts +0 -1
  83. package/dist/api/graphql-api/device/index.js +0 -1
  84. package/dist/api/graphql-api/event/event-request-factory.d.ts +0 -6
  85. package/dist/api/graphql-api/event/event-request-factory.js +0 -11
  86. package/dist/api/graphql-api/event/graphql-event-manager.d.ts +0 -15
  87. package/dist/api/graphql-api/event/graphql-event-manager.js +0 -65
  88. package/dist/api/graphql-api/event/index.d.ts +0 -1
  89. package/dist/api/graphql-api/event/index.js +0 -1
  90. package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.d.ts +0 -10
  91. package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.js +0 -35
  92. package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.d.ts +0 -10
  93. package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.js +0 -35
  94. package/dist/api/graphql-api/search/connection-search-request-factory.d.ts +0 -7
  95. package/dist/api/graphql-api/search/connection-search-request-factory.js +0 -21
  96. package/dist/api/graphql-api/search/graphql-search-manager.d.ts +0 -17
  97. package/dist/api/graphql-api/search/graphql-search-manager.js +0 -133
  98. package/dist/api/graphql-api/search/index.d.ts +0 -1
  99. package/dist/api/graphql-api/search/index.js +0 -1
  100. package/dist/api/graphql-api/search/provider-search-request-factory.d.ts +0 -7
  101. package/dist/api/graphql-api/search/provider-search-request-factory.js +0 -21
  102. package/dist/api/graphql-api/search/request-connection-request-factory.d.ts +0 -6
  103. package/dist/api/graphql-api/search/request-connection-request-factory.js +0 -12
  104. package/dist/api/graphql-api/search/search-health-resources-request-factory.d.ts +0 -14
  105. package/dist/api/graphql-api/search/search-health-resources-request-factory.js +0 -28
  106. package/dist/api/graphql-api/search/search-request-factory.d.ts +0 -6
  107. package/dist/api/graphql-api/search/search-request-factory.js +0 -44
  108. package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.d.ts +0 -6
  109. package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.js +0 -9
  110. package/dist/api/graphql-api/user/get-consent-request-factory.d.ts +0 -6
  111. package/dist/api/graphql-api/user/get-consent-request-factory.js +0 -8
@@ -1,24 +0,0 @@
1
- import { BaseRequest } from "../../../requests/index.js";
2
- /**
3
- * Parameters for a connection request
4
- */
5
- export type RequestConnectionRequestInput = {
6
- /**
7
- * Institution of the connection request
8
- */
9
- institution?: string;
10
- /**
11
- * Provider name of the connection request
12
- */
13
- provider?: string;
14
- /**
15
- * State of the connection request
16
- */
17
- state?: string;
18
- /**
19
- * City of the connection request
20
- */
21
- city?: string;
22
- };
23
- export declare class RequestConnectionRequest extends BaseRequest<RequestConnectionRequestInput> {
24
- }
@@ -1,3 +0,0 @@
1
- import { BaseRequest } from "../../../requests/index.js";
2
- export class RequestConnectionRequest extends BaseRequest {
3
- }
@@ -1,87 +0,0 @@
1
- import { ClientInput, FilterField as GraphQLFilterField, OrganizationType as GraphQLOrganizationType, SortField as GraphQLSortField, SortOrder as GraphQLSortOrder, OrderByInput, SearchFiltersInput, SearchLocation, UserInput } from "../../../graphql/schema.js";
2
- import { PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
3
- /**
4
- * Type representing the search filters for health resources.
5
- */
6
- export type FilterField = `${GraphQLFilterField}`;
7
- /**
8
- * Type representing the organization type for health resources.
9
- */
10
- export type OrganizationType = `${GraphQLOrganizationType}`;
11
- /**
12
- * Type representing the sort field for health resources.
13
- * @experimental
14
- */
15
- export type SortField = `${GraphQLSortField}`;
16
- /**
17
- * Type representing the sort order for health resources.
18
- */
19
- export type SortOrder = `${GraphQLSortOrder}`;
20
- /**
21
- * The provider location to search by
22
- */
23
- export type SearchPosition = {
24
- /**
25
- * Latitude
26
- */
27
- lat: number;
28
- /**
29
- * Longitude
30
- */
31
- lon: number;
32
- /**
33
- * Search radius (miles) from the specified lat/lon
34
- */
35
- distance?: number;
36
- };
37
- /**
38
- * Type representing a provider search result sorting
39
- */
40
- export type OrderBy = {
41
- /**
42
- * The provider search field to sort by
43
- */
44
- field?: SortField;
45
- /**
46
- * The direction to sort by
47
- */
48
- order?: SortOrder;
49
- };
50
- /**
51
- * Represents the parameters for a search request.
52
- * @experimental
53
- */
54
- export type SearchHealthResourcesRequestInput = PagedRequestInput & {
55
- /**
56
- * The client configuration to search for health resources.
57
- */
58
- client: [ClientInput];
59
- /**
60
- * The filters to apply to the search.
61
- */
62
- filters: SearchFiltersInput;
63
- /**
64
- * Specifies order options for the search.
65
- */
66
- orderBy?: [OrderByInput];
67
- /**
68
- * Provides the main ability to filter searches by a given term.
69
- * This can be something like an organization name, location, address, or phone number.
70
- */
71
- search?: string;
72
- /**
73
- * The location to search health resources by.
74
- */
75
- searchLocation?: SearchLocation;
76
- /**
77
- * The user for whom the search is being performed.
78
- */
79
- user?: UserInput;
80
- };
81
- /**
82
- * Request for searching health resources.
83
- * @experimental
84
- */
85
- export declare class SearchHealthResourcesRequest extends PagedRequest<SearchHealthResourcesRequestInput> {
86
- protected validator: PagedRequestValidator<SearchHealthResourcesRequestInput>;
87
- }
@@ -1,20 +0,0 @@
1
- import { PagedRequest, PagedRequestValidator, } from "../../../requests/index.js";
2
- /**
3
- * Request for searching health resources.
4
- * @experimental
5
- */
6
- export class SearchHealthResourcesRequest extends PagedRequest {
7
- constructor() {
8
- super(...arguments);
9
- this.validator = new SearchHealthResourcesRequestValidator();
10
- }
11
- }
12
- /**
13
- * Validator for SearchHealthResourcesRequestInput.
14
- * Validates the input data for searching health resources.
15
- */
16
- class SearchHealthResourcesRequestValidator extends PagedRequestValidator {
17
- validate(data, errors) {
18
- super.validate(data, errors);
19
- }
20
- }
@@ -1,58 +0,0 @@
1
- import { ValidationError } from "../../../errors/index.js";
2
- import { ProviderSearchQueryResults, RequestConnectionMutationResults, SearchHealthResourcesQueryResults } from "../../../graphql/operations/types.js";
3
- import type { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
4
- import { BaseManagerError } from "../errors.js";
5
- import { RequestConnectionRequest } from "./request-connection-request.js";
6
- import { SearchHealthResourcesRequest } from "./search-health-resources-request.js";
7
- import { SearchRequest } from "./search-request.js";
8
- type SearchResultsType = ProviderSearchQueryResults["providers"];
9
- export interface SearchResults extends SearchResultsType {
10
- }
11
- export type SearchHealthResourcesResults = SearchHealthResourcesQueryResults["searchHealthResources"];
12
- export type RequestConnectionResults = RequestConnectionMutationResults["requestConnection"];
13
- /**
14
- * The SearchManager interface provides methods for searching for providers and connections.
15
- */
16
- export interface SearchManager {
17
- /**
18
- * Performs a general search based on a SearchRequest
19
- *
20
- * @param {SearchRequest} request - Object representing search parameters
21
- * @returns {Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>} - An object containing the collection
22
- * of matching search results
23
- */
24
- search(request: SearchRequest): Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>;
25
- /**
26
- * Performs a provider search based on a SearchRequest
27
- *
28
- * @param {SearchRequest} request - Object representing search parameters
29
- * @returns {Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>} - An object containing the collection
30
- * of matching search results
31
- */
32
- searchProviders(request: SearchRequest): Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>;
33
- /**
34
- * Performs a connection search based on a SearchRequest
35
- *
36
- * @param {SearchRequest} request - Object representing search parameters
37
- * @returns {Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>} - An object containing the collection
38
- * of matching search results
39
- */
40
- searchConnections(request: SearchRequest): Promise<BWellQueryResult<SearchResults, BaseManagerError | ValidationError>>;
41
- /**
42
- * Searches for health resources based on the provided request.
43
- *
44
- * @param {SearchHealthResourcesRequest} request - Object containing the details of the search being requested
45
- * @returns {Promise<BWellQueryResult<SearchHealthResourcesResults, BaseManagerError | ValidationError>>} - An object containing the collection
46
- * of matching search results
47
- * @experimental
48
- */
49
- searchHealthResources(request: SearchHealthResourcesRequest): Promise<BWellQueryResult<SearchHealthResourcesResults, BaseManagerError | ValidationError>>;
50
- /**
51
- * Requests a new connection based on the provided information.
52
- *
53
- * @param {RequestConnectionRequest} request - Object containing the details of the connection being requested
54
- * @returns {Promise<BWellTransactionResult<RequestConnectionResults, BaseManagerError>>} - Indicates the outcome of the request
55
- */
56
- requestConnection(request: RequestConnectionRequest): Promise<BWellTransactionResult<RequestConnectionResults, BaseManagerError>>;
57
- }
58
- export {};
@@ -1 +0,0 @@
1
- export {};
@@ -1,84 +0,0 @@
1
- import { FilterField as GraphQLFilterField, OrganizationType as GraphQLOrganizationType, SortField as GraphQLSortField, SortOrder as GraphQLSortOrder } from "../../../graphql/schema.js";
2
- import { Coding } from "../../../models/index.js";
3
- import { PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
4
- import { PersonGender } from "../user/index.js";
5
- export type FilterField = `${GraphQLFilterField}`;
6
- export type OrganizationType = `${GraphQLOrganizationType}`;
7
- export type SortField = `${GraphQLSortField}`;
8
- export type SortOrder = `${GraphQLSortOrder}`;
9
- /**
10
- * The provider location to search by
11
- */
12
- export type SearchPosition = {
13
- /**
14
- * Latitude
15
- */
16
- lat: number;
17
- /**
18
- * Longitude
19
- */
20
- lon: number;
21
- /**
22
- * Search radius (miles) from the specified lat/lon
23
- */
24
- distance?: number;
25
- };
26
- /**
27
- * Type representing a provider search result sorting
28
- */
29
- export type OrderBy = {
30
- /**
31
- * The provider search field to sort by
32
- */
33
- field?: SortField;
34
- /**
35
- * The direction to sort by
36
- */
37
- order?: SortOrder;
38
- };
39
- /**
40
- * Prepresents the parameters for a search request.
41
- */
42
- export type SearchRequestInput = PagedRequestInput & {
43
- /**
44
- * Provides the main ability to filter searches by a given term. This can be something like an organization name, location, address, or phone number.
45
- */
46
- searchTerm?: string;
47
- /**
48
- * Array of strings that can be used to filter results by specialty. specialtyFilters are not useful for searching generally, since it would limit results to providers..
49
- */
50
- specialtyFilters?: Coding | Coding[];
51
- /**
52
- * Array of strings that can be used to filter results by organization type..
53
- */
54
- organizationTypeFilters?: OrganizationType[];
55
- /**
56
- * Only return Providers that have PROA connections. Defaults to false
57
- */
58
- includePopulatedPROAonly?: boolean;
59
- /**
60
- * Filter providers to the specified gender
61
- */
62
- gender?: PersonGender;
63
- /**
64
- * Location object that can be used to filter results by location
65
- */
66
- location?: SearchPosition;
67
- /**
68
- * Specifies sort options for the search.
69
- */
70
- sortBy?: OrderBy;
71
- /**
72
- * Specifies which fields should be used for aggregations. For example, you can
73
- * search for ‘smith’ and request ‘gender’ as a FilterField and along with the search
74
- * result, you will also get ‘X of males, Y of females’.
75
- */
76
- filterFields?: FilterField[];
77
- };
78
- export declare class SearchRequest extends PagedRequest<SearchRequestInput> {
79
- protected validator: PagedRequestValidator<SearchRequestInput>;
80
- }
81
- export declare function isValidOrganizationType(orgType: string): orgType is GraphQLOrganizationType;
82
- export declare function isValidSortField(sortField: string): sortField is GraphQLSortField;
83
- export declare function isValidSortOrder(sortOrder: string): sortOrder is GraphQLSortOrder;
84
- export declare function isValidFilterField(filterField: string): filterField is GraphQLFilterField;
@@ -1,78 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _SearchRequestValidator_instances, _SearchRequestValidator_validateOrganizationTypeFilters, _SearchRequestValidator_validateSortBy, _SearchRequestValidator_validateFilterFields, _SearchRequestValidator_validateGender;
7
- import { FilterField as GraphQLFilterField, OrganizationType as GraphQLOrganizationType, SortField as GraphQLSortField, SortOrder as GraphQLSortOrder, } from "../../../graphql/schema.js";
8
- import { PagedRequest, PagedRequestValidator, } from "../../../requests/index.js";
9
- import { isNotUndefined } from "../../../utils/index.js";
10
- import { isValidPersonGender } from "../user/types.js";
11
- export class SearchRequest extends PagedRequest {
12
- constructor() {
13
- super(...arguments);
14
- this.validator = new SearchRequestValidator();
15
- }
16
- }
17
- class SearchRequestValidator extends PagedRequestValidator {
18
- constructor() {
19
- super(...arguments);
20
- _SearchRequestValidator_instances.add(this);
21
- }
22
- validate(data, errors) {
23
- super.validate(data, errors);
24
- if (isNotUndefined(data.organizationTypeFilters)) {
25
- __classPrivateFieldGet(this, _SearchRequestValidator_instances, "m", _SearchRequestValidator_validateOrganizationTypeFilters).call(this, data.organizationTypeFilters, errors);
26
- }
27
- if (isNotUndefined(data.sortBy)) {
28
- __classPrivateFieldGet(this, _SearchRequestValidator_instances, "m", _SearchRequestValidator_validateSortBy).call(this, data.sortBy, errors);
29
- }
30
- if (isNotUndefined(data.filterFields)) {
31
- __classPrivateFieldGet(this, _SearchRequestValidator_instances, "m", _SearchRequestValidator_validateFilterFields).call(this, data.filterFields, errors);
32
- }
33
- if (isNotUndefined(data.gender)) {
34
- __classPrivateFieldGet(this, _SearchRequestValidator_instances, "m", _SearchRequestValidator_validateGender).call(this, data.gender, errors);
35
- }
36
- }
37
- }
38
- _SearchRequestValidator_instances = new WeakSet(), _SearchRequestValidator_validateOrganizationTypeFilters = function _SearchRequestValidator_validateOrganizationTypeFilters(organizationTypeFilters, errors) {
39
- for (const orgType of organizationTypeFilters) {
40
- if (isValidOrganizationType(orgType)) {
41
- continue;
42
- }
43
- errors.add(`Invalid organizationTypeFilters value: "${orgType}"`);
44
- }
45
- }, _SearchRequestValidator_validateSortBy = function _SearchRequestValidator_validateSortBy(orderBy, errors) {
46
- if (isNotUndefined(orderBy.field) && !isValidSortField(orderBy.field)) {
47
- errors.add(`Invalid sortBy.field value: "${orderBy.field}"`);
48
- }
49
- if (isNotUndefined(orderBy.order) && !isValidSortOrder(orderBy.order)) {
50
- errors.add(`Invalid sortBy.order value: "${orderBy.order}"`);
51
- }
52
- }, _SearchRequestValidator_validateFilterFields = function _SearchRequestValidator_validateFilterFields(filterFields, errors) {
53
- for (const filterField of filterFields) {
54
- if (!isValidFilterField(filterField)) {
55
- errors.add(`Invalid filterField value: "${filterField}"`);
56
- }
57
- }
58
- }, _SearchRequestValidator_validateGender = function _SearchRequestValidator_validateGender(gender, errors) {
59
- if (!isValidPersonGender(gender)) {
60
- errors.add(`Invalid gender value: "${gender}"`);
61
- }
62
- };
63
- const organizationValueCache = new Set(Object.values(GraphQLOrganizationType));
64
- export function isValidOrganizationType(orgType) {
65
- return organizationValueCache.has(orgType);
66
- }
67
- const sortFieldValueCache = new Set(Object.values(GraphQLSortField));
68
- export function isValidSortField(sortField) {
69
- return sortFieldValueCache.has(sortField);
70
- }
71
- const sortOrderValueCache = new Set(Object.values(GraphQLSortOrder));
72
- export function isValidSortOrder(sortOrder) {
73
- return sortOrderValueCache.has(sortOrder);
74
- }
75
- const filterFieldValueCache = new Set(Object.values(GraphQLFilterField));
76
- export function isValidFilterField(filterField) {
77
- return filterFieldValueCache.has(filterField);
78
- }
@@ -1,14 +0,0 @@
1
- import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
2
- export type CreateDataExportDirectDownloadUrlRequestInput = {
3
- exportId: string;
4
- password: string;
5
- };
6
- export declare class CreateDataExportDirectDownloadUrlRequestValidator implements Validator<CreateDataExportDirectDownloadUrlRequestInput> {
7
- validate(data: CreateDataExportDirectDownloadUrlRequestInput, errors: ErrorsCollector): void;
8
- }
9
- /**
10
- * Request object for creating a direct download URL for a data export.
11
- */
12
- export declare class CreateDataExportDirectDownloadUrlRequest extends ValidationRequest<CreateDataExportDirectDownloadUrlRequestInput> {
13
- protected validator: Validator<CreateDataExportDirectDownloadUrlRequestInput>;
14
- }
@@ -1,21 +0,0 @@
1
- import { ValidationRequest, } from "../../../requests/index.js";
2
- import { isNullOrUndefinedOrEmptyString } from "../../../utils/type-utils.js";
3
- export class CreateDataExportDirectDownloadUrlRequestValidator {
4
- validate(data, errors) {
5
- if (isNullOrUndefinedOrEmptyString(data.exportId)) {
6
- errors.add("exportId is required");
7
- }
8
- if (isNullOrUndefinedOrEmptyString(data.password)) {
9
- errors.add("password is required");
10
- }
11
- }
12
- }
13
- /**
14
- * Request object for creating a direct download URL for a data export.
15
- */
16
- export class CreateDataExportDirectDownloadUrlRequest extends ValidationRequest {
17
- constructor() {
18
- super(...arguments);
19
- this.validator = new CreateDataExportDirectDownloadUrlRequestValidator();
20
- }
21
- }
@@ -1,13 +0,0 @@
1
- import { GetTasksQueryVariables } from "../../../graphql/operations/types.js";
2
- import { RequestFactory } from "../../../requests/index.js";
3
- import { GetTasksRequest } from "../../base/index.js";
4
- export declare enum ActivitySystem {
5
- ACTIVITY_CONTENT = "https://www.icanbwell.com/contentDescription",
6
- ACTIVITY_ID = "https://www.icanbwell.com/activityId",
7
- ACTIVITY_TOPIC = "https://www.icanbwell.com/activityTopic",
8
- ACTIVITY_TYPE = "https://www.icanbwell.com/activityType"
9
- }
10
- export declare class GetTasksRequestFactory implements RequestFactory<GetTasksRequest, GetTasksQueryVariables> {
11
- #private;
12
- create(request: GetTasksRequest): GetTasksQueryVariables;
13
- }
@@ -1,66 +0,0 @@
1
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
2
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
3
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
4
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
5
- };
6
- var _GetTasksRequestFactory_instances, _GetTasksRequestFactory_toSearchToken;
7
- import { isNotUndefined } from "../../../utils/index.js";
8
- export var ActivitySystem;
9
- (function (ActivitySystem) {
10
- ActivitySystem["ACTIVITY_CONTENT"] = "https://www.icanbwell.com/contentDescription";
11
- ActivitySystem["ACTIVITY_ID"] = "https://www.icanbwell.com/activityId";
12
- ActivitySystem["ACTIVITY_TOPIC"] = "https://www.icanbwell.com/activityTopic";
13
- ActivitySystem["ACTIVITY_TYPE"] = "https://www.icanbwell.com/activityType";
14
- })(ActivitySystem || (ActivitySystem = {}));
15
- export class GetTasksRequestFactory {
16
- constructor() {
17
- _GetTasksRequestFactory_instances.add(this);
18
- }
19
- create(request) {
20
- var _a;
21
- const input = request.data();
22
- const data = {
23
- page: input.page,
24
- pageSize: input.pageSize,
25
- };
26
- if (isNotUndefined(input.id)) {
27
- data.id = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.id);
28
- }
29
- if (isNotUndefined(input.activityId)) {
30
- data.identifier = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.activityId, ActivitySystem.ACTIVITY_ID);
31
- }
32
- if (isNotUndefined(input.activityType)) {
33
- data.code = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.activityType, ActivitySystem.ACTIVITY_TYPE);
34
- }
35
- if (isNotUndefined(input.activityTopic)) {
36
- data.tag = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.activityTopic, ActivitySystem.ACTIVITY_TOPIC);
37
- }
38
- if (isNotUndefined(input.status)) {
39
- data.status = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.status);
40
- }
41
- if (isNotUndefined(input.subject)) {
42
- data.subject = __classPrivateFieldGet(this, _GetTasksRequestFactory_instances, "m", _GetTasksRequestFactory_toSearchToken).call(this, input.subject);
43
- }
44
- data.sortMethod = input.smartSort === true ? "smartSort" : "";
45
- if (isNotUndefined(input.enrichContent)) {
46
- data.enrichContent = input.enrichContent;
47
- }
48
- // default to english
49
- data.contentLanguage = (_a = input.contentLanguage) !== null && _a !== void 0 ? _a : "en";
50
- return {
51
- request: data,
52
- };
53
- }
54
- }
55
- _GetTasksRequestFactory_instances = new WeakSet(), _GetTasksRequestFactory_toSearchToken = function _GetTasksRequestFactory_toSearchToken(value, system) {
56
- const valueArr = Array.isArray(value) ? value : [value];
57
- const searchTokenValues = {
58
- value: valueArr.join(","),
59
- };
60
- if (isNotUndefined(system)) {
61
- searchTokenValues.system = system;
62
- }
63
- return {
64
- values: [searchTokenValues],
65
- };
66
- };
@@ -1,14 +0,0 @@
1
- import type { ValidationError } from "../../../errors/validation-error.js";
2
- import { type LoggerProvider } from "../../../logger/index.js";
3
- import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
4
- import type { ActivityManager } from "../../base/activity/activity-manager.js";
5
- import type { GetTasksRequest, GetTasksResults, UpdateTaskStatusRequest, UpdateTaskStatusResults } from "../../base/activity/index.js";
6
- import type { BaseManagerError } from "../../base/errors.js";
7
- import { GraphQLManager } from "../graphql-manager/index.js";
8
- import type { GraphQLSdk } from "../graphql-sdk/index.js";
9
- export declare class GraphQLActivityManager extends GraphQLManager implements ActivityManager {
10
- #private;
11
- constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
12
- getTasks(request: GetTasksRequest): Promise<BWellQueryResult<GetTasksResults, BaseManagerError | ValidationError>>;
13
- updateTaskStatus(request: UpdateTaskStatusRequest): Promise<BWellTransactionResult<UpdateTaskStatusResults, BaseManagerError | ValidationError>>;
14
- }
@@ -1,72 +0,0 @@
1
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
- return new (P || (P = Promise))(function (resolve, reject) {
4
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
- step((generator = generator.apply(thisArg, _arguments || [])).next());
8
- });
9
- };
10
- var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
11
- if (kind === "m") throw new TypeError("Private method is not writable");
12
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
13
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
14
- return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
15
- };
16
- var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
17
- if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
18
- if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
19
- return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
- };
21
- var _GraphQLActivityManager_logger, _GraphQLActivityManager_sdk, _GraphQLActivityManager_getTaskRequestFactory;
22
- import { ConsoleLoggerProvider, } from "../../../logger/index.js";
23
- import { BWellQueryResult, BWellTransactionResult, } from "../../../results/index.js";
24
- import { GraphQLManager } from "../graphql-manager/index.js";
25
- import { GetTasksRequestFactory } from "./activity-request-factories.js";
26
- export class GraphQLActivityManager extends GraphQLManager {
27
- constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
28
- super();
29
- _GraphQLActivityManager_logger.set(this, void 0);
30
- _GraphQLActivityManager_sdk.set(this, void 0);
31
- _GraphQLActivityManager_getTaskRequestFactory.set(this, new GetTasksRequestFactory());
32
- __classPrivateFieldSet(this, _GraphQLActivityManager_sdk, sdk, "f");
33
- __classPrivateFieldSet(this, _GraphQLActivityManager_logger, loggerProvider.getLogger("GraphQLActivityManager"), "f");
34
- }
35
- getTasks(request) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- var _a;
38
- const validationResult = request.validate();
39
- if (validationResult.failure()) {
40
- return validationResult.toQueryResult();
41
- }
42
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").verbose("calling getTask query...");
43
- const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLActivityManager_sdk, "f").getTasks(__classPrivateFieldGet(this, _GraphQLActivityManager_getTaskRequestFactory, "f").create(request)));
44
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").verbose("getTask query complete");
45
- if (result.hasError()) {
46
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").error("getTask query error", result.error);
47
- }
48
- else {
49
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").info("successfully called getTask query");
50
- }
51
- return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.getTasks, result.error);
52
- });
53
- }
54
- updateTaskStatus(request) {
55
- return __awaiter(this, void 0, void 0, function* () {
56
- const validationResult = request.validate();
57
- if (validationResult.failure()) {
58
- return validationResult;
59
- }
60
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").verbose("calling taskUpdateStatus mutation");
61
- const result = yield this.handleTransaction(__classPrivateFieldGet(this, _GraphQLActivityManager_sdk, "f").taskUpdateStatus(request.data()));
62
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").verbose("taskUpdateStatus mutation complete");
63
- if (result.failure()) {
64
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").error("taskUpdateStatus error", result);
65
- return result.intoFailure();
66
- }
67
- __classPrivateFieldGet(this, _GraphQLActivityManager_logger, "f").info("taskUpdateStatus mutation success");
68
- return BWellTransactionResult.success(result.data().taskUpdateStatus);
69
- });
70
- }
71
- }
72
- _GraphQLActivityManager_logger = new WeakMap(), _GraphQLActivityManager_sdk = new WeakMap(), _GraphQLActivityManager_getTaskRequestFactory = new WeakMap();
@@ -1 +0,0 @@
1
- export * from "./graphql-activity-manager.js";
@@ -1 +0,0 @@
1
- export * from "./graphql-activity-manager.js";
@@ -1,18 +0,0 @@
1
- import { CodeableConceptFieldsFragment, GetMemberConnectionsQueryResults } from "../../../graphql/operations/types.js";
2
- import { BWellQueryResult, BWellQueryResultFactory } from "../../../results/index.js";
3
- /**
4
- * Custom type representing a member's data connection
5
- */
6
- export type MemberConnection = GetMemberConnectionsQueryResults["getMemberConnections"][number] & {
7
- syncErrors: Array<CodeableConceptFieldsFragment | null> | null;
8
- };
9
- /**
10
- * Custom type representing a member's data connections
11
- */
12
- export type MemberConnectionResults = Array<MemberConnection>;
13
- /**
14
- * Factory to map the GraphQL GetMemberConnectionResults object to a BWellQueryResult using the expected shape
15
- */
16
- export declare class GraphQLGetMemberConnectionsBWellResponseFactory implements BWellQueryResultFactory<BWellQueryResult<GetMemberConnectionsQueryResults>, BWellQueryResult<MemberConnectionResults>> {
17
- create(result: BWellQueryResult<GetMemberConnectionsQueryResults>): BWellQueryResult<MemberConnectionResults>;
18
- }
@@ -1,40 +0,0 @@
1
- import { BWellQueryResult, } from "../../../results/index.js";
2
- import { isNotNullOrUndefined, isNullOrUndefined, } from "../../../utils/type-utils.js";
3
- import { MEMBER_CONNECTION_SUBSCRIPTION_STATUS_EXTENSION_ID } from "../../base/connection/index.js";
4
- /**
5
- * Factory to map the GraphQL GetMemberConnectionResults object to a BWellQueryResult using the expected shape
6
- */
7
- export class GraphQLGetMemberConnectionsBWellResponseFactory {
8
- create(result) {
9
- var _a, _b, _c, _d, _e, _f;
10
- // map subscription status to service slug, which corresponds to connection.id
11
- const subscriptionStatusMap = new Map();
12
- const subscriptionStatuseEntries = (_c = (_b = (_a = result.data) === null || _a === void 0 ? void 0 : _a.subscription_subscription) === null || _b === void 0 ? void 0 : _b.entry) !== null && _c !== void 0 ? _c : [];
13
- for (const entry of subscriptionStatuseEntries) {
14
- if (isNotNullOrUndefined((_d = entry === null || entry === void 0 ? void 0 : entry.resource) === null || _d === void 0 ? void 0 : _d.service_slug) &&
15
- isNotNullOrUndefined(entry === null || entry === void 0 ? void 0 : entry.resource.subscriptionStatus)) {
16
- for (const subStatus of entry.resource.subscriptionStatus) {
17
- subscriptionStatusMap.set(entry.resource.service_slug, {
18
- error: subStatus === null || subStatus === void 0 ? void 0 : subStatus.error,
19
- extension: subStatus === null || subStatus === void 0 ? void 0 : subStatus.extension,
20
- });
21
- }
22
- }
23
- }
24
- // Make sure getMemberConnections is an array and not undefined
25
- const getMemberConnections = (_f = (_e = result.data) === null || _e === void 0 ? void 0 : _e.getMemberConnections) !== null && _f !== void 0 ? _f : [];
26
- return new BWellQueryResult(
27
- // map subscription status info on to member connections
28
- getMemberConnections.map((connection) => {
29
- var _a;
30
- const subscriptionStatus = subscriptionStatusMap.get(connection.id);
31
- if (isNullOrUndefined(subscriptionStatus)) {
32
- return Object.assign(Object.assign({}, connection), { syncErrors: [] });
33
- }
34
- const extension = (_a = subscriptionStatus.extension) === null || _a === void 0 ? void 0 : _a.find((e) => (e === null || e === void 0 ? void 0 : e.id) === MEMBER_CONNECTION_SUBSCRIPTION_STATUS_EXTENSION_ID);
35
- return Object.assign(Object.assign({}, connection), { syncErrors: subscriptionStatus.error, syncStatus: (extension
36
- ? extension.valueString
37
- : connection.syncStatus) });
38
- }), result.error);
39
- }
40
- }
@@ -1,9 +0,0 @@
1
- import { UpdateDeviceRegistrationMutationVariables } from "../../../graphql/operations/types.js";
2
- import { RequestFactory } from "../../../requests/index.js";
3
- import { DeregisterDeviceRequest, RegisterDeviceRequest } from "../../base/device/index.js";
4
- export declare class DeregisterDeviceRequestFactory implements RequestFactory<DeregisterDeviceRequest, UpdateDeviceRegistrationMutationVariables> {
5
- create(request: DeregisterDeviceRequest): UpdateDeviceRegistrationMutationVariables;
6
- }
7
- export declare class RegisterDeviceRequestFactory implements RequestFactory<RegisterDeviceRequest, UpdateDeviceRegistrationMutationVariables> {
8
- create(request: RegisterDeviceRequest): UpdateDeviceRegistrationMutationVariables;
9
- }