@icanbwell/bwell-sdk-ts 1.17.0 → 1.18.0-rc.1744827279
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/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/base/api-provider.d.ts +2 -0
- package/dist/api/base/health-space/appointments-request.d.ts +60 -0
- package/dist/api/base/health-space/appointments-request.js +64 -0
- package/dist/api/base/health-space/health-space-manager.d.ts +18 -0
- package/dist/api/base/health-space/health-space-manager.js +1 -0
- package/dist/api/base/health-space/index.d.ts +2 -0
- package/dist/api/base/health-space/index.js +1 -0
- package/dist/api/base/index.d.ts +1 -0
- package/dist/api/base/index.js +1 -0
- package/dist/api/base/requests/index.d.ts +1 -0
- package/dist/api/base/requests/search-string.d.ts +32 -0
- package/dist/api/base/requests/search-string.js +47 -0
- package/dist/api/graphql-api/graphql-api-provider.d.ts +2 -0
- package/dist/api/graphql-api/graphql-api-provider.js +2 -0
- package/dist/api/graphql-api/health-space/appointments-request-factory.d.ts +12 -0
- package/dist/api/graphql-api/health-space/appointments-request-factory.js +19 -0
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.d.ts +12 -0
- package/dist/api/graphql-api/health-space/graphql-health-space-manager.js +55 -0
- package/dist/api/graphql-api/health-space/index.d.ts +2 -0
- package/dist/api/graphql-api/health-space/index.js +2 -0
- package/dist/bwell-sdk/bwell-sdk.d.ts +2 -0
- package/dist/bwell-sdk/bwell-sdk.js +3 -0
- package/dist/graphql/operations/index.d.ts +11 -1
- package/dist/graphql/operations/index.js +122 -2
- package/dist/graphql/operations/types.d.ts +234 -11
- package/dist/graphql/schema.d.ts +137 -4
- package/dist/graphql/schema.js +8 -0
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -4,10 +4,12 @@ import type { ConnectionManager } from "./connection/connection-manager.js";
|
|
|
4
4
|
import type { DeviceManager } from "./device/device-manager.js";
|
|
5
5
|
import type { EventManager } from "./event/event-manager.js";
|
|
6
6
|
import type { HealthManager } from "./health-data/health-manager.js";
|
|
7
|
+
import type { HealthSpaceManager } from "./health-space/health-space-manager.js";
|
|
7
8
|
import type { SearchManager } from "./search/search-manager.js";
|
|
8
9
|
import type { UserManager } from "./user/user-manager.js";
|
|
9
10
|
export interface ApiProvider {
|
|
10
11
|
readonly health: HealthManager;
|
|
12
|
+
readonly healthSpace: HealthSpaceManager;
|
|
11
13
|
readonly user: UserManager;
|
|
12
14
|
readonly device: DeviceManager;
|
|
13
15
|
readonly connection: ConnectionManager;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { ErrorsCollector, ValidationRequest } from "../../../requests/index.js";
|
|
2
|
+
import { SearchDate, SearchString } from "../requests/index.js";
|
|
3
|
+
export type AppointmentsRequestInput = {
|
|
4
|
+
/**
|
|
5
|
+
* The source[s] of the appointments to search for
|
|
6
|
+
*/
|
|
7
|
+
_source?: SearchString;
|
|
8
|
+
/**
|
|
9
|
+
* The id[s] of the appointments to search for
|
|
10
|
+
*/
|
|
11
|
+
_id?: SearchString;
|
|
12
|
+
/**
|
|
13
|
+
* The number of results to return
|
|
14
|
+
*/
|
|
15
|
+
_count?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The offset to start returning results from
|
|
18
|
+
*/
|
|
19
|
+
_getpagesoffset?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The date[s] filter of the appointments to search for
|
|
22
|
+
*/
|
|
23
|
+
date?: SearchDate;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* A validator class for validating appointment request inputs.
|
|
27
|
+
* This class ensures that the provided data adheres to the expected structure
|
|
28
|
+
* and constraints for appointment requests, including validation of search strings,
|
|
29
|
+
* search dates, and pagination parameters.
|
|
30
|
+
*/
|
|
31
|
+
declare class AppointmentsRequestValidator {
|
|
32
|
+
#private;
|
|
33
|
+
/**
|
|
34
|
+
* Validates the provided `AppointmentsRequestInput` data and collects any validation errors.
|
|
35
|
+
*
|
|
36
|
+
* @param data - The input data to validate, containing appointment request details.
|
|
37
|
+
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
38
|
+
*
|
|
39
|
+
* @remarks
|
|
40
|
+
* - If `_source` is provided in the input, it is validated using the `#searchStringValidator`.
|
|
41
|
+
* - If `date` is provided in the input, it is validated using the `#searchDateValidator`.
|
|
42
|
+
* - Both `_count` and `_getpagesoffset` must either be provided together or omitted together.
|
|
43
|
+
* - If `_count` is provided, its value must not be less than 0.
|
|
44
|
+
* - If `_getpagesoffset` is provided, its value must not be less than 0.
|
|
45
|
+
*
|
|
46
|
+
* @throws This method does not throw exceptions directly but collects errors in the `ErrorsCollector` instance.
|
|
47
|
+
*/
|
|
48
|
+
validate(data: AppointmentsRequestInput, errors: ErrorsCollector): void;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Represents a request for appointments within the health space.
|
|
52
|
+
* This class extends the `ValidationRequest` to provide validation
|
|
53
|
+
* for appointment-related input data.
|
|
54
|
+
*
|
|
55
|
+
* @extends ValidationRequest<AppointmentsRequestInput>
|
|
56
|
+
*/
|
|
57
|
+
export declare class AppointmentsRequest extends ValidationRequest<AppointmentsRequestInput> {
|
|
58
|
+
protected validator: AppointmentsRequestValidator;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
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 _AppointmentsRequestValidator_searchDateValidator, _AppointmentsRequestValidator_searchStringValidator;
|
|
7
|
+
import { ValidationRequest, } from "../../../requests/index.js";
|
|
8
|
+
import { SearchDateValidator } from "../requests/search-date.js";
|
|
9
|
+
import { SearchStringValidator } from "../requests/search-string.js";
|
|
10
|
+
/**
|
|
11
|
+
* A validator class for validating appointment request inputs.
|
|
12
|
+
* This class ensures that the provided data adheres to the expected structure
|
|
13
|
+
* and constraints for appointment requests, including validation of search strings,
|
|
14
|
+
* search dates, and pagination parameters.
|
|
15
|
+
*/
|
|
16
|
+
class AppointmentsRequestValidator {
|
|
17
|
+
constructor() {
|
|
18
|
+
_AppointmentsRequestValidator_searchDateValidator.set(this, new SearchDateValidator());
|
|
19
|
+
_AppointmentsRequestValidator_searchStringValidator.set(this, new SearchStringValidator());
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validates the provided `AppointmentsRequestInput` data and collects any validation errors.
|
|
23
|
+
*
|
|
24
|
+
* @param data - The input data to validate, containing appointment request details.
|
|
25
|
+
* @param errors - An instance of `ErrorsCollector` to collect validation errors.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* - If `_source` is provided in the input, it is validated using the `#searchStringValidator`.
|
|
29
|
+
* - If `date` is provided in the input, it is validated using the `#searchDateValidator`.
|
|
30
|
+
* - Both `_count` and `_getpagesoffset` must either be provided together or omitted together.
|
|
31
|
+
* - If `_count` is provided, its value must not be less than 0.
|
|
32
|
+
* - If `_getpagesoffset` is provided, its value must not be less than 0.
|
|
33
|
+
*
|
|
34
|
+
* @throws This method does not throw exceptions directly but collects errors in the `ErrorsCollector` instance.
|
|
35
|
+
*/
|
|
36
|
+
validate(data, errors) {
|
|
37
|
+
if (data._source) {
|
|
38
|
+
__classPrivateFieldGet(this, _AppointmentsRequestValidator_searchStringValidator, "f").validate(data._source, errors);
|
|
39
|
+
}
|
|
40
|
+
if (data.date) {
|
|
41
|
+
__classPrivateFieldGet(this, _AppointmentsRequestValidator_searchDateValidator, "f").validate(data.date, errors);
|
|
42
|
+
}
|
|
43
|
+
if (data._count && data._count < 0) {
|
|
44
|
+
errors.add("Value of count cannot be less than 0");
|
|
45
|
+
}
|
|
46
|
+
if (data._getpagesoffset && data._getpagesoffset < 0) {
|
|
47
|
+
errors.add("Value of getpagesoffset cannot be less than 0");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
_AppointmentsRequestValidator_searchDateValidator = new WeakMap(), _AppointmentsRequestValidator_searchStringValidator = new WeakMap();
|
|
52
|
+
/**
|
|
53
|
+
* Represents a request for appointments within the health space.
|
|
54
|
+
* This class extends the `ValidationRequest` to provide validation
|
|
55
|
+
* for appointment-related input data.
|
|
56
|
+
*
|
|
57
|
+
* @extends ValidationRequest<AppointmentsRequestInput>
|
|
58
|
+
*/
|
|
59
|
+
export class AppointmentsRequest extends ValidationRequest {
|
|
60
|
+
constructor() {
|
|
61
|
+
super(...arguments);
|
|
62
|
+
this.validator = new AppointmentsRequestValidator();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AppointmentsQueryResults } from "../../../graphql/operations/types.js";
|
|
2
|
+
import { BWellQueryResult } from "../../../results/index.js";
|
|
3
|
+
import { BaseManagerError } from "../errors.js";
|
|
4
|
+
import { AppointmentsRequest } from "./appointments-request.js";
|
|
5
|
+
export type AppointmentsResults = AppointmentsQueryResults["appointments"];
|
|
6
|
+
/**
|
|
7
|
+
* Interface representing a manager for handling operations related to health spaces.
|
|
8
|
+
*/
|
|
9
|
+
export interface HealthSpaceManager {
|
|
10
|
+
/**
|
|
11
|
+
* Retrieves appointment information based on the provided request.
|
|
12
|
+
*
|
|
13
|
+
* @param request - The request object containing parameters for fetching appointments.
|
|
14
|
+
* @returns A promise that resolves to a `BWellQueryResult` containing the appointment results
|
|
15
|
+
* or an error of type `BaseManagerError`.
|
|
16
|
+
*/
|
|
17
|
+
getAppointments(request: AppointmentsRequest): Promise<BWellQueryResult<AppointmentsResults, BaseManagerError>>;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AppointmentsRequest, } from "./appointments-request.js";
|
package/dist/api/base/index.d.ts
CHANGED
package/dist/api/base/index.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ErrorsCollector, Validator } from "../../../requests/index.js";
|
|
2
|
+
export type SearchString = {
|
|
3
|
+
values?: string[];
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Error message for when values is missing from searchString
|
|
7
|
+
*/
|
|
8
|
+
export declare const MISSING_VALUES_ERROR = "Values should be provided to instantiate a SearchString";
|
|
9
|
+
/**
|
|
10
|
+
* Error message for when values is not an array
|
|
11
|
+
*/
|
|
12
|
+
export declare const INVALID_VALUES_TYPE_ERROR = "Values in SearchString should be an array of strings";
|
|
13
|
+
/**
|
|
14
|
+
* Error message for when values is an empty array
|
|
15
|
+
*/
|
|
16
|
+
export declare const EMPTY_VALUES_ERROR = "At least one SearchStringValue must be set to instantiate a SearchString";
|
|
17
|
+
/**
|
|
18
|
+
* Error message for when string values is empty
|
|
19
|
+
*/
|
|
20
|
+
export declare const EMPTY_STRING_VALUES_ERROR = "SearchStringValue should be a non-empty string";
|
|
21
|
+
/**
|
|
22
|
+
* Validator for SearchString objects.
|
|
23
|
+
*/
|
|
24
|
+
export declare class SearchStringValidator implements Validator<SearchString> {
|
|
25
|
+
/**
|
|
26
|
+
* Ensures that at least one SearchStringValue is set and that it is non empty string
|
|
27
|
+
* @param data
|
|
28
|
+
* @param errors
|
|
29
|
+
* @returns
|
|
30
|
+
*/
|
|
31
|
+
validate(data: SearchString, errors: ErrorsCollector): void;
|
|
32
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error message for when values is missing from searchString
|
|
3
|
+
*/
|
|
4
|
+
export const MISSING_VALUES_ERROR = "Values should be provided to instantiate a SearchString";
|
|
5
|
+
/**
|
|
6
|
+
* Error message for when values is not an array
|
|
7
|
+
*/
|
|
8
|
+
export const INVALID_VALUES_TYPE_ERROR = "Values in SearchString should be an array of strings";
|
|
9
|
+
/**
|
|
10
|
+
* Error message for when values is an empty array
|
|
11
|
+
*/
|
|
12
|
+
export const EMPTY_VALUES_ERROR = "At least one SearchStringValue must be set to instantiate a SearchString";
|
|
13
|
+
/**
|
|
14
|
+
* Error message for when string values is empty
|
|
15
|
+
*/
|
|
16
|
+
export const EMPTY_STRING_VALUES_ERROR = "SearchStringValue should be a non-empty string";
|
|
17
|
+
/**
|
|
18
|
+
* Validator for SearchString objects.
|
|
19
|
+
*/
|
|
20
|
+
export class SearchStringValidator {
|
|
21
|
+
/**
|
|
22
|
+
* Ensures that at least one SearchStringValue is set and that it is non empty string
|
|
23
|
+
* @param data
|
|
24
|
+
* @param errors
|
|
25
|
+
* @returns
|
|
26
|
+
*/
|
|
27
|
+
validate(data, errors) {
|
|
28
|
+
if (!data.values) {
|
|
29
|
+
errors.add(MISSING_VALUES_ERROR);
|
|
30
|
+
}
|
|
31
|
+
else if (!Array.isArray(data.values)) {
|
|
32
|
+
errors.add(INVALID_VALUES_TYPE_ERROR);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
else if (data.values.length === 0) {
|
|
36
|
+
errors.add(EMPTY_VALUES_ERROR);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
for (const value of data.values) {
|
|
41
|
+
if (typeof value !== "string" || value.trim() === "") {
|
|
42
|
+
errors.add(EMPTY_STRING_VALUES_ERROR);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -7,12 +7,14 @@ import type { ConnectionManager } from "../base/connection/connection-manager.js
|
|
|
7
7
|
import type { DeviceManager } from "../base/device/device-manager.js";
|
|
8
8
|
import type { EventManager } from "../base/event/event-manager.js";
|
|
9
9
|
import type { HealthManager } from "../base/health-data/health-manager.js";
|
|
10
|
+
import { HealthSpaceManager } from "../base/health-space/health-space-manager.js";
|
|
10
11
|
import type { SearchManager } from "../base/search/search-manager.js";
|
|
11
12
|
import type { UserManager } from "../base/user/user-manager.js";
|
|
12
13
|
import type { GraphQLSdk } from "./graphql-sdk/index.js";
|
|
13
14
|
export declare class GraphQLApiProvider implements ApiProvider {
|
|
14
15
|
#private;
|
|
15
16
|
readonly health: HealthManager;
|
|
17
|
+
readonly healthSpace: HealthSpaceManager;
|
|
16
18
|
readonly user: UserManager;
|
|
17
19
|
readonly device: DeviceManager;
|
|
18
20
|
readonly connection: ConnectionManager;
|
|
@@ -15,6 +15,7 @@ import { GraphQLActivityManager } from "./activity/index.js";
|
|
|
15
15
|
import { GraphQLConnectionManager } from "./connection/index.js";
|
|
16
16
|
import { GraphQLDeviceManager } from "./device/index.js";
|
|
17
17
|
import { GraphQLEventManager } from "./event/index.js";
|
|
18
|
+
import { GraphQLHealthSpaceManager } from "./health-space/index.js";
|
|
18
19
|
import { GraphQLHealthManager } from "./healthdata/index.js";
|
|
19
20
|
import { GraphQLSearchManager } from "./search/index.js";
|
|
20
21
|
import { GraphQLUserManager } from "./user/index.js";
|
|
@@ -30,6 +31,7 @@ export class GraphQLApiProvider {
|
|
|
30
31
|
this.device = new GraphQLDeviceManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
31
32
|
this.event = new GraphQLEventManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
32
33
|
this.health = new GraphQLHealthManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
34
|
+
this.healthSpace = new GraphQLHealthSpaceManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
33
35
|
this.user = new GraphQLUserManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
34
36
|
this.search = new GraphQLSearchManager(__classPrivateFieldGet(this, _GraphQLApiProvider_graphqlSDK, "f"), loggerProvider);
|
|
35
37
|
this.language = new BwellSdkLanguageManager(graphqlClient);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AppointmentsQueryVariables } from "../../../graphql/operations/types.js";
|
|
2
|
+
import { RequestFactory } from "../../../requests/index.js";
|
|
3
|
+
import { AppointmentsRequest } from "../../base/health-space/index.js";
|
|
4
|
+
/**
|
|
5
|
+
* A factory class for creating `AppointmentsQueryVariables` objects from `AppointmentsRequest` objects.
|
|
6
|
+
* Implements the `RequestFactory` interface.
|
|
7
|
+
*
|
|
8
|
+
* @implements RequestFactory<AppointmentsRequest, AppointmentsQueryVariables>
|
|
9
|
+
*/
|
|
10
|
+
export declare class AppointmentsRequestFactory implements RequestFactory<AppointmentsRequest, AppointmentsQueryVariables> {
|
|
11
|
+
create(request: AppointmentsRequest): AppointmentsQueryVariables;
|
|
12
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A factory class for creating `AppointmentsQueryVariables` objects from `AppointmentsRequest` objects.
|
|
3
|
+
* Implements the `RequestFactory` interface.
|
|
4
|
+
*
|
|
5
|
+
* @implements RequestFactory<AppointmentsRequest, AppointmentsQueryVariables>
|
|
6
|
+
*/
|
|
7
|
+
export class AppointmentsRequestFactory {
|
|
8
|
+
create(request) {
|
|
9
|
+
var _a, _b, _c, _d, _e;
|
|
10
|
+
const input = request.data();
|
|
11
|
+
return {
|
|
12
|
+
source: (_a = input._source) !== null && _a !== void 0 ? _a : null,
|
|
13
|
+
id: (_b = input._id) !== null && _b !== void 0 ? _b : null,
|
|
14
|
+
count: (_c = input._count) !== null && _c !== void 0 ? _c : 25,
|
|
15
|
+
getPagesOffset: (_d = input._getpagesoffset) !== null && _d !== void 0 ? _d : 0,
|
|
16
|
+
date: (_e = input.date) !== null && _e !== void 0 ? _e : null,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ValidationError } from "../../../errors/index.js";
|
|
2
|
+
import { type LoggerProvider } from "../../../logger/index.js";
|
|
3
|
+
import { BWellQueryResult } from "../../../results/index.js";
|
|
4
|
+
import type { BaseManagerError } from "../../base/errors.js";
|
|
5
|
+
import { AppointmentsRequest, AppointmentsResults, HealthSpaceManager } from "../../base/index.js";
|
|
6
|
+
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
7
|
+
import type { GraphQLSdk } from "../graphql-sdk/index.js";
|
|
8
|
+
export declare class GraphQLHealthSpaceManager extends GraphQLManager implements HealthSpaceManager {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(sdk: GraphQLSdk, loggerProvider?: LoggerProvider);
|
|
11
|
+
getAppointments(request: AppointmentsRequest): Promise<BWellQueryResult<AppointmentsResults, ValidationError | BaseManagerError>>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
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 _GraphQLHealthSpaceManager_logger, _GraphQLHealthSpaceManager_sdk, _GraphQLHealthSpaceManager_appointments;
|
|
22
|
+
import { ConsoleLoggerProvider, } from "../../../logger/index.js";
|
|
23
|
+
import { BWellQueryResult } from "../../../results/index.js";
|
|
24
|
+
import { GraphQLManager } from "../graphql-manager/index.js";
|
|
25
|
+
import { AppointmentsRequestFactory } from "./appointments-request-factory.js";
|
|
26
|
+
export class GraphQLHealthSpaceManager extends GraphQLManager {
|
|
27
|
+
constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
|
|
28
|
+
super();
|
|
29
|
+
_GraphQLHealthSpaceManager_logger.set(this, void 0);
|
|
30
|
+
_GraphQLHealthSpaceManager_sdk.set(this, void 0);
|
|
31
|
+
_GraphQLHealthSpaceManager_appointments.set(this, new AppointmentsRequestFactory());
|
|
32
|
+
__classPrivateFieldSet(this, _GraphQLHealthSpaceManager_sdk, sdk, "f");
|
|
33
|
+
__classPrivateFieldSet(this, _GraphQLHealthSpaceManager_logger, loggerProvider.getLogger("GraphQLHealthSpaceManager"), "f");
|
|
34
|
+
}
|
|
35
|
+
getAppointments(request) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
var _a;
|
|
38
|
+
const validationResult = this.validateRequest(request);
|
|
39
|
+
if (validationResult.failure()) {
|
|
40
|
+
return validationResult.toQueryResult();
|
|
41
|
+
}
|
|
42
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("calling appointments query...");
|
|
43
|
+
const result = yield this.handleQuery(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_sdk, "f").appointments(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_appointments, "f").create(request)));
|
|
44
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("appointments query complete");
|
|
45
|
+
if (result.hasError()) {
|
|
46
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").error("appointments query error", result.error);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").info("successfully called appointments query");
|
|
50
|
+
}
|
|
51
|
+
return new BWellQueryResult((_a = result.data) === null || _a === void 0 ? void 0 : _a.appointments, result.error);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
_GraphQLHealthSpaceManager_logger = new WeakMap(), _GraphQLHealthSpaceManager_sdk = new WeakMap(), _GraphQLHealthSpaceManager_appointments = new WeakMap();
|
|
@@ -6,6 +6,7 @@ import type { HealthManager } from "../api/base/health-data/health-manager.js";
|
|
|
6
6
|
import type { AuthTokens } from "../api/base/identity/index.js";
|
|
7
7
|
import type { SearchManager } from "../api/base/search/search-manager.js";
|
|
8
8
|
import type { UserManager } from "../api/base/user/user-manager.js";
|
|
9
|
+
import { HealthSpaceManager } from "../api/index.js";
|
|
9
10
|
import { type Credentials } from "../auth/index.js";
|
|
10
11
|
import { type BWellConfig } from "../config/index.js";
|
|
11
12
|
import { type AuthenticationError, type InvalidClientKeyError, type InvalidTokenError, type OperationOutcomeError } from "../errors/index.js";
|
|
@@ -76,6 +77,7 @@ export declare class BWellSDK {
|
|
|
76
77
|
*/
|
|
77
78
|
setAuthTokens(authTokens: AuthTokens): Promise<BWellTransactionResult<null, OperationOutcomeError | InvalidTokenError>>;
|
|
78
79
|
get health(): HealthManager;
|
|
80
|
+
get healthSpace(): HealthSpaceManager;
|
|
79
81
|
get user(): UserManager;
|
|
80
82
|
get connection(): ConnectionManager;
|
|
81
83
|
get activity(): ActivityManager;
|
|
@@ -160,6 +160,9 @@ export class BWellSDK {
|
|
|
160
160
|
get health() {
|
|
161
161
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).health;
|
|
162
162
|
}
|
|
163
|
+
get healthSpace() {
|
|
164
|
+
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).healthSpace;
|
|
165
|
+
}
|
|
163
166
|
get user() {
|
|
164
167
|
return __classPrivateFieldGet(this, _BWellSDK_instances, "m", _BWellSDK_getApiProvider).call(this).user;
|
|
165
168
|
}
|