@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.
- package/dist/__version__.d.ts +1 -1
- package/dist/__version__.js +1 -1
- package/dist/api/api-provider-factory.d.ts +1 -1
- package/dist/api/api-provider-factory.js +2 -1
- package/dist/api/base/api-provider.d.ts +8 -14
- package/dist/api/base/connection/connection-manager.d.ts +0 -2
- package/dist/api/base/health-data/health-manager.d.ts +4 -227
- package/dist/api/base/health-data/index.d.ts +1 -1
- package/dist/api/base/index.d.ts +0 -4
- package/dist/api/base/index.js +4 -4
- package/dist/api/base/user/index.d.ts +1 -2
- package/dist/api/base/user/index.js +4 -1
- package/dist/api/base/user/user-manager.d.ts +1 -7
- package/dist/api/graphql-api/connection/graphql-connection-manager.d.ts +1 -3
- package/dist/api/graphql-api/connection/graphql-connection-manager.js +23 -21
- package/dist/api/graphql-api/connection/index.d.ts +0 -1
- package/dist/api/graphql-api/connection/index.js +1 -1
- package/dist/api/graphql-api/graphql-api-provider.d.ts +4 -13
- package/dist/api/graphql-api/graphql-api-provider.js +10 -9
- package/dist/api/graphql-api/graphql-sdk/graphql-sdk.js +1 -1
- package/dist/api/graphql-api/healthdata/graphql-health-manager.d.ts +3 -27
- package/dist/api/graphql-api/healthdata/graphql-health-manager.js +26 -328
- package/dist/api/graphql-api/healthdata/health-data-request-factory.d.ts +12 -0
- package/dist/api/graphql-api/healthdata/health-data-request-factory.js +12 -0
- package/dist/api/graphql-api/user/graphql-user-manager.d.ts +3 -6
- package/dist/api/graphql-api/user/graphql-user-manager.js +68 -46
- package/dist/bwell-sdk/bwell-sdk.d.ts +2 -13
- package/dist/bwell-sdk/bwell-sdk.js +27 -27
- package/dist/config/sdk-config.js +3 -3
- package/dist/graphql/operations/index.d.ts +11 -282
- package/dist/graphql/operations/index.js +227 -2410
- package/dist/graphql/operations/types.d.ts +2349 -15206
- package/dist/graphql/schema.d.ts +68178 -4822
- package/dist/graphql/schema.js +7 -63
- package/package.json +4 -2
- package/dist/api/base/activity/activity-manager.d.ts +0 -35
- package/dist/api/base/activity/activity-manager.js +0 -1
- package/dist/api/base/activity/get-tasks-request.d.ts +0 -49
- package/dist/api/base/activity/get-tasks-request.js +0 -35
- package/dist/api/base/activity/index.d.ts +0 -4
- package/dist/api/base/activity/index.js +0 -2
- package/dist/api/base/activity/types.d.ts +0 -3
- package/dist/api/base/activity/types.js +0 -5
- package/dist/api/base/activity/update-task-status-request.d.ts +0 -18
- package/dist/api/base/activity/update-task-status-request.js +0 -15
- package/dist/api/base/device/device-manager.d.ts +0 -22
- package/dist/api/base/device/device-manager.js +0 -5
- package/dist/api/base/device/device-request.d.ts +0 -62
- package/dist/api/base/device/device-request.js +0 -71
- package/dist/api/base/device/index.d.ts +0 -2
- package/dist/api/base/device/index.js +0 -2
- package/dist/api/base/event/event-manager.d.ts +0 -16
- package/dist/api/base/event/event-manager.js +0 -1
- package/dist/api/base/event/event-request.d.ts +0 -35
- package/dist/api/base/event/event-request.js +0 -64
- package/dist/api/base/event/index.d.ts +0 -2
- package/dist/api/base/event/index.js +0 -1
- package/dist/api/base/search/index.d.ts +0 -4
- package/dist/api/base/search/index.js +0 -3
- package/dist/api/base/search/request-connection-request.d.ts +0 -24
- package/dist/api/base/search/request-connection-request.js +0 -3
- package/dist/api/base/search/search-health-resources-request.d.ts +0 -87
- package/dist/api/base/search/search-health-resources-request.js +0 -20
- package/dist/api/base/search/search-manager.d.ts +0 -58
- package/dist/api/base/search/search-manager.js +0 -1
- package/dist/api/base/search/search-request.d.ts +0 -84
- package/dist/api/base/search/search-request.js +0 -78
- package/dist/api/base/user/create-data-export-direct-download-url-request.d.ts +0 -14
- package/dist/api/base/user/create-data-export-direct-download-url-request.js +0 -21
- package/dist/api/graphql-api/activity/activity-request-factories.d.ts +0 -13
- package/dist/api/graphql-api/activity/activity-request-factories.js +0 -66
- package/dist/api/graphql-api/activity/graphql-activity-manager.d.ts +0 -14
- package/dist/api/graphql-api/activity/graphql-activity-manager.js +0 -72
- package/dist/api/graphql-api/activity/index.d.ts +0 -1
- package/dist/api/graphql-api/activity/index.js +0 -1
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.d.ts +0 -18
- package/dist/api/graphql-api/connection/graphql-get-member-connections-bwell-response-factory.js +0 -40
- package/dist/api/graphql-api/device/device-request-factory.d.ts +0 -9
- package/dist/api/graphql-api/device/device-request-factory.js +0 -15
- package/dist/api/graphql-api/device/graphql-device-manager.d.ts +0 -13
- package/dist/api/graphql-api/device/graphql-device-manager.js +0 -73
- package/dist/api/graphql-api/device/index.d.ts +0 -1
- package/dist/api/graphql-api/device/index.js +0 -1
- package/dist/api/graphql-api/event/event-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/event/event-request-factory.js +0 -11
- package/dist/api/graphql-api/event/graphql-event-manager.d.ts +0 -15
- package/dist/api/graphql-api/event/graphql-event-manager.js +0 -65
- package/dist/api/graphql-api/event/index.d.ts +0 -1
- package/dist/api/graphql-api/event/index.js +0 -1
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.d.ts +0 -10
- package/dist/api/graphql-api/healthdata/graphql-get-medication-dispense-bwell-response-factory.js +0 -35
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.d.ts +0 -10
- package/dist/api/graphql-api/healthdata/graphql-get-medication-request-bwell-response-factory.js +0 -35
- package/dist/api/graphql-api/search/connection-search-request-factory.d.ts +0 -7
- package/dist/api/graphql-api/search/connection-search-request-factory.js +0 -21
- package/dist/api/graphql-api/search/graphql-search-manager.d.ts +0 -17
- package/dist/api/graphql-api/search/graphql-search-manager.js +0 -133
- package/dist/api/graphql-api/search/index.d.ts +0 -1
- package/dist/api/graphql-api/search/index.js +0 -1
- package/dist/api/graphql-api/search/provider-search-request-factory.d.ts +0 -7
- package/dist/api/graphql-api/search/provider-search-request-factory.js +0 -21
- package/dist/api/graphql-api/search/request-connection-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/search/request-connection-request-factory.js +0 -12
- package/dist/api/graphql-api/search/search-health-resources-request-factory.d.ts +0 -14
- package/dist/api/graphql-api/search/search-health-resources-request-factory.js +0 -28
- package/dist/api/graphql-api/search/search-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/search/search-request-factory.js +0 -44
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/user/create-data-export-direct-download-url-request-factory.js +0 -9
- package/dist/api/graphql-api/user/get-consent-request-factory.d.ts +0 -6
- package/dist/api/graphql-api/user/get-consent-request-factory.js +0 -8
package/dist/graphql/schema.js
CHANGED
|
@@ -84,11 +84,6 @@ export var ContactUseType;
|
|
|
84
84
|
ContactUseType["Mobile"] = "mobile";
|
|
85
85
|
ContactUseType["Work"] = "work";
|
|
86
86
|
})(ContactUseType || (ContactUseType = {}));
|
|
87
|
-
/** Supported ISO 4217 CurrencyCodes */
|
|
88
|
-
export var CurrencyCode;
|
|
89
|
-
(function (CurrencyCode) {
|
|
90
|
-
CurrencyCode["Usd"] = "USD";
|
|
91
|
-
})(CurrencyCode || (CurrencyCode = {}));
|
|
92
87
|
/** Defines the connection statuses */
|
|
93
88
|
export var DataConnectionStatus;
|
|
94
89
|
(function (DataConnectionStatus) {
|
|
@@ -150,11 +145,6 @@ export var EndpointStatusEnum;
|
|
|
150
145
|
EndpointStatusEnum["Suspended"] = "SUSPENDED";
|
|
151
146
|
EndpointStatusEnum["Test"] = "TEST";
|
|
152
147
|
})(EndpointStatusEnum || (EndpointStatusEnum = {}));
|
|
153
|
-
export var EventType;
|
|
154
|
-
(function (EventType) {
|
|
155
|
-
EventType["CustomEvent"] = "CUSTOM_EVENT";
|
|
156
|
-
EventType["MobilePushOpen"] = "MOBILE_PUSH_OPEN";
|
|
157
|
-
})(EventType || (EventType = {}));
|
|
158
148
|
export var FhirPersonGender;
|
|
159
149
|
(function (FhirPersonGender) {
|
|
160
150
|
FhirPersonGender["Female"] = "female";
|
|
@@ -213,18 +203,6 @@ export var GenderType;
|
|
|
213
203
|
GenderType["Other"] = "other";
|
|
214
204
|
GenderType["Unknown"] = "unknown";
|
|
215
205
|
})(GenderType || (GenderType = {}));
|
|
216
|
-
export var HealthSummaryCategory;
|
|
217
|
-
(function (HealthSummaryCategory) {
|
|
218
|
-
HealthSummaryCategory["AllergyIntolerance"] = "ALLERGY_INTOLERANCE";
|
|
219
|
-
HealthSummaryCategory["CarePlan"] = "CARE_PLAN";
|
|
220
|
-
HealthSummaryCategory["Condition"] = "CONDITION";
|
|
221
|
-
HealthSummaryCategory["Encounter"] = "ENCOUNTER";
|
|
222
|
-
HealthSummaryCategory["Immunization"] = "IMMUNIZATION";
|
|
223
|
-
HealthSummaryCategory["Labs"] = "LABS";
|
|
224
|
-
HealthSummaryCategory["Medications"] = "MEDICATIONS";
|
|
225
|
-
HealthSummaryCategory["Procedure"] = "PROCEDURE";
|
|
226
|
-
HealthSummaryCategory["VitalSigns"] = "VITAL_SIGNS";
|
|
227
|
-
})(HealthSummaryCategory || (HealthSummaryCategory = {}));
|
|
228
206
|
export var IdentifierUseKind;
|
|
229
207
|
(function (IdentifierUseKind) {
|
|
230
208
|
IdentifierUseKind["Official"] = "_official";
|
|
@@ -253,19 +231,6 @@ export var LogLevel;
|
|
|
253
231
|
LogLevel["Verbose"] = "VERBOSE";
|
|
254
232
|
LogLevel["Warn"] = "WARN";
|
|
255
233
|
})(LogLevel || (LogLevel = {}));
|
|
256
|
-
/** Classification of type of observation */
|
|
257
|
-
export var ObservationCategory;
|
|
258
|
-
(function (ObservationCategory) {
|
|
259
|
-
ObservationCategory["Activity"] = "ACTIVITY";
|
|
260
|
-
ObservationCategory["Exam"] = "EXAM";
|
|
261
|
-
ObservationCategory["Imaging"] = "IMAGING";
|
|
262
|
-
ObservationCategory["Laboratory"] = "LABORATORY";
|
|
263
|
-
ObservationCategory["Procedure"] = "PROCEDURE";
|
|
264
|
-
ObservationCategory["SocialHistory"] = "SOCIAL_HISTORY";
|
|
265
|
-
ObservationCategory["Survey"] = "SURVEY";
|
|
266
|
-
ObservationCategory["Therapy"] = "THERAPY";
|
|
267
|
-
ObservationCategory["VitalSigns"] = "VITAL_SIGNS";
|
|
268
|
-
})(ObservationCategory || (ObservationCategory = {}));
|
|
269
234
|
export var Operation;
|
|
270
235
|
(function (Operation) {
|
|
271
236
|
Operation["CancelDelete"] = "CANCEL_DELETE";
|
|
@@ -352,19 +317,6 @@ export var Questionnaire_Enum_Schema;
|
|
|
352
317
|
(function (Questionnaire_Enum_Schema) {
|
|
353
318
|
Questionnaire_Enum_Schema["QuestionnaireResponse"] = "QuestionnaireResponse";
|
|
354
319
|
})(Questionnaire_Enum_Schema || (Questionnaire_Enum_Schema = {}));
|
|
355
|
-
export var ResourceType;
|
|
356
|
-
(function (ResourceType) {
|
|
357
|
-
ResourceType["AllergyIntolerance"] = "ALLERGY_INTOLERANCE";
|
|
358
|
-
ResourceType["CarePlan"] = "CARE_PLAN";
|
|
359
|
-
ResourceType["Condition"] = "CONDITION";
|
|
360
|
-
ResourceType["Encounter"] = "ENCOUNTER";
|
|
361
|
-
ResourceType["Immunization"] = "IMMUNIZATION";
|
|
362
|
-
ResourceType["MedicationDispense"] = "MEDICATION_DISPENSE";
|
|
363
|
-
ResourceType["MedicationRequest"] = "MEDICATION_REQUEST";
|
|
364
|
-
ResourceType["MedicationStatement"] = "MEDICATION_STATEMENT";
|
|
365
|
-
ResourceType["Observation"] = "OBSERVATION";
|
|
366
|
-
ResourceType["Procedure"] = "PROCEDURE";
|
|
367
|
-
})(ResourceType || (ResourceType = {}));
|
|
368
320
|
export var SearchResultTypeEnum;
|
|
369
321
|
(function (SearchResultTypeEnum) {
|
|
370
322
|
SearchResultTypeEnum["Insurance"] = "INSURANCE";
|
|
@@ -421,23 +373,15 @@ export var SyncStatus;
|
|
|
421
373
|
SyncStatus["Retrieved"] = "RETRIEVED";
|
|
422
374
|
SyncStatus["Retrieving"] = "RETRIEVING";
|
|
423
375
|
})(SyncStatus || (SyncStatus = {}));
|
|
424
|
-
export var TaskStatus;
|
|
425
|
-
(function (TaskStatus) {
|
|
426
|
-
TaskStatus["Accepted"] = "ACCEPTED";
|
|
427
|
-
TaskStatus["Cancelled"] = "CANCELLED";
|
|
428
|
-
TaskStatus["Completed"] = "COMPLETED";
|
|
429
|
-
TaskStatus["Draft"] = "DRAFT";
|
|
430
|
-
TaskStatus["EnteredInError"] = "ENTERED_IN_ERROR";
|
|
431
|
-
TaskStatus["Failed"] = "FAILED";
|
|
432
|
-
TaskStatus["InProgress"] = "IN_PROGRESS";
|
|
433
|
-
TaskStatus["OnHold"] = "ON_HOLD";
|
|
434
|
-
TaskStatus["Ready"] = "READY";
|
|
435
|
-
TaskStatus["Received"] = "RECEIVED";
|
|
436
|
-
TaskStatus["Rejected"] = "REJECTED";
|
|
437
|
-
TaskStatus["Requested"] = "REQUESTED";
|
|
438
|
-
})(TaskStatus || (TaskStatus = {}));
|
|
439
376
|
export var TotalType;
|
|
440
377
|
(function (TotalType) {
|
|
441
378
|
TotalType["Accurate"] = "accurate";
|
|
442
379
|
TotalType["Estimate"] = "estimate";
|
|
443
380
|
})(TotalType || (TotalType = {}));
|
|
381
|
+
export var Link__Purpose;
|
|
382
|
+
(function (Link__Purpose) {
|
|
383
|
+
/** `EXECUTION` features provide metadata necessary for operation execution. */
|
|
384
|
+
Link__Purpose["Execution"] = "EXECUTION";
|
|
385
|
+
/** `SECURITY` features provide metadata necessary to securely resolve fields. */
|
|
386
|
+
Link__Purpose["Security"] = "SECURITY";
|
|
387
|
+
})(Link__Purpose || (Link__Purpose = {}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icanbwell/bwell-sdk-ts",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.36.0",
|
|
4
4
|
"description": "b.well TypeScript SDK",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"type": "module",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"directory": "bwell-sdk-typescript"
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "npm run generate && tsc --project tsconfig.build.json",
|
|
21
|
+
"build": "npm run generate:v2 && tsc --project tsconfig.build.json",
|
|
22
22
|
"build:dev": "tsc --project tsconfig.build.json",
|
|
23
23
|
"clean": "rimraf ./dist",
|
|
24
24
|
"coverage": "open ./coverage/lcov-report/index.html",
|
|
@@ -26,10 +26,12 @@
|
|
|
26
26
|
"format:check": "prettier . --check",
|
|
27
27
|
"gen:clean": "rimraf ./src/graphql",
|
|
28
28
|
"generate": "npm run generate:sdl && npm run generate:types && npm run generate:version",
|
|
29
|
+
"generate:v2": "npm run generate:sdl:v2 && npm run generate:types && npm run generate:version",
|
|
29
30
|
"generate:docs": "typedoc --tsconfig tsconfig.json && npm run format",
|
|
30
31
|
"generate:types": "graphql-codegen --config ./codegen/codegen.ts",
|
|
31
32
|
"generate:version": "node ./scripts/generate-version-file.js",
|
|
32
33
|
"generate:sdl": "npm run --prefix ../graphql generate:sdl",
|
|
34
|
+
"generate:sdl:v2": "npm run --prefix ../graphql generate:sdl:v2",
|
|
33
35
|
"lint": "eslint .",
|
|
34
36
|
"prebuild": "npm run clean",
|
|
35
37
|
"prettier": "prettier",
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ValidationError } from "../../../errors/index.js";
|
|
2
|
-
import { GetTasksQueryResults, TaskUpdateStatusMutationResults } from "../../../graphql/operations/types.js";
|
|
3
|
-
import type { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
|
|
4
|
-
import { BaseManagerError } from "../errors.js";
|
|
5
|
-
import { GetTasksRequest } from "./get-tasks-request.js";
|
|
6
|
-
import { UpdateTaskStatusRequest } from "./update-task-status-request.js";
|
|
7
|
-
export type GetTasksResults = GetTasksQueryResults["getTasks"];
|
|
8
|
-
export type UpdateTaskStatusResults = TaskUpdateStatusMutationResults["taskUpdateStatus"];
|
|
9
|
-
/**
|
|
10
|
-
* The ActivityManager interface provides methods for managing FHIR tasks.
|
|
11
|
-
* See also https://www.hl7.org/fhir/task.html
|
|
12
|
-
*/
|
|
13
|
-
export interface ActivityManager {
|
|
14
|
-
/**
|
|
15
|
-
* Tasks represent insights, recommendations, and/or requests for the user. They
|
|
16
|
-
* can be personalized and have a status to track progress. Tasks can also be linked
|
|
17
|
-
* to other FHIR resources and/or external content.
|
|
18
|
-
*
|
|
19
|
-
* @param {GetTasksRequest} request - The query search criteria
|
|
20
|
-
* @returns {Promise<BWellQueryResult<GetTasksResults, BaseManagerError>>} Collection of FHIR Task resources
|
|
21
|
-
*/
|
|
22
|
-
getTasks(request: GetTasksRequest): Promise<BWellQueryResult<GetTasksResults, BaseManagerError | ValidationError>>;
|
|
23
|
-
/**
|
|
24
|
-
* Updates the status of a specified Task. The status of the task identified
|
|
25
|
-
* by request.taskId will be updated to the new status provided.
|
|
26
|
-
*
|
|
27
|
-
* The new status must be one of the potential TaskStatus values
|
|
28
|
-
*
|
|
29
|
-
* @param {UpdateTaskStatusRequest} request - Object containing the id and desired status for the task
|
|
30
|
-
* @returns {Promise<BWellTransactionResult<UpdateTaskStatusResults, BaseManagerError>>} - Object containing the updated FHIR task resource
|
|
31
|
-
*
|
|
32
|
-
* @see https://build.fhir.org/valueset-task-status.html
|
|
33
|
-
*/
|
|
34
|
-
updateTaskStatus(request: UpdateTaskStatusRequest): Promise<BWellTransactionResult<UpdateTaskStatusResults, BaseManagerError | ValidationError>>;
|
|
35
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, PagedRequest, PagedRequestInput, PagedRequestValidator } from "../../../requests/index.js";
|
|
2
|
-
import { TaskStatus } from "./types.js";
|
|
3
|
-
export type GetTaskRequestInput = PagedRequestInput & {
|
|
4
|
-
/**
|
|
5
|
-
* The id[s] of a tasks to search for
|
|
6
|
-
*/
|
|
7
|
-
id?: string | string[];
|
|
8
|
-
/**
|
|
9
|
-
* The activityId[s] of tasks to filter by
|
|
10
|
-
*/
|
|
11
|
-
activityId?: string | string[];
|
|
12
|
-
/**
|
|
13
|
-
* The activityType[s] of tasks to filter by
|
|
14
|
-
*/
|
|
15
|
-
activityType?: string | string[];
|
|
16
|
-
/**
|
|
17
|
-
* The activityTopic[s] of tasks to filter by
|
|
18
|
-
*/
|
|
19
|
-
activityTopic?: string | string[];
|
|
20
|
-
/**
|
|
21
|
-
* The status[es] of tasks to fitler by
|
|
22
|
-
*/
|
|
23
|
-
status?: TaskStatus | TaskStatus[];
|
|
24
|
-
/**
|
|
25
|
-
* subject[s] of tasks to filter by
|
|
26
|
-
*/
|
|
27
|
-
subject?: string | string[];
|
|
28
|
-
/**
|
|
29
|
-
* If present and true, retrieve referenced content from CMS. All content found
|
|
30
|
-
* will be added to the associated Task field “extension”
|
|
31
|
-
*/
|
|
32
|
-
enrichContent?: boolean;
|
|
33
|
-
/**
|
|
34
|
-
* If present and true, results will be ordered to place better Tasks for user
|
|
35
|
-
* consumption at the front of the list. Otherwise, Tasks will be unordered.
|
|
36
|
-
*/
|
|
37
|
-
smartSort?: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* The preferred language for returned content, e.g. "en" for English, "es" for Spanish
|
|
40
|
-
*/
|
|
41
|
-
contentLanguage?: string;
|
|
42
|
-
};
|
|
43
|
-
export declare class GetTasksRequestValidator extends PagedRequestValidator<GetTaskRequestInput> {
|
|
44
|
-
#private;
|
|
45
|
-
validate(data: GetTaskRequestInput, errors: ErrorsCollector): void;
|
|
46
|
-
}
|
|
47
|
-
export declare class GetTasksRequest extends PagedRequest<GetTaskRequestInput> {
|
|
48
|
-
protected validator: PagedRequestValidator<GetTaskRequestInput>;
|
|
49
|
-
}
|
|
@@ -1,35 +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 _GetTasksRequestValidator_instances, _GetTasksRequestValidator_validateTaskStatus;
|
|
7
|
-
import { PagedRequest, PagedRequestValidator, } from "../../../requests/index.js";
|
|
8
|
-
import { isUndefined } from "../../../utils/index.js";
|
|
9
|
-
import { isValidTaskStatus } from "./types.js";
|
|
10
|
-
export class GetTasksRequestValidator extends PagedRequestValidator {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
_GetTasksRequestValidator_instances.add(this);
|
|
14
|
-
}
|
|
15
|
-
validate(data, errors) {
|
|
16
|
-
super.validate(data, errors);
|
|
17
|
-
if (!isUndefined(data.status)) {
|
|
18
|
-
const statuses = Array.isArray(data.status) ? data.status : [data.status];
|
|
19
|
-
for (const status of statuses) {
|
|
20
|
-
__classPrivateFieldGet(this, _GetTasksRequestValidator_instances, "m", _GetTasksRequestValidator_validateTaskStatus).call(this, status, errors);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
_GetTasksRequestValidator_instances = new WeakSet(), _GetTasksRequestValidator_validateTaskStatus = function _GetTasksRequestValidator_validateTaskStatus(status, errors) {
|
|
26
|
-
if (!isValidTaskStatus(status)) {
|
|
27
|
-
errors.add(`Invalid task status: "${status}"`);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export class GetTasksRequest extends PagedRequest {
|
|
31
|
-
constructor() {
|
|
32
|
-
super(...arguments);
|
|
33
|
-
this.validator = new GetTasksRequestValidator();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export { GetTasksResults, UpdateTaskStatusResults, ActivityManager, } from "./activity-manager.js";
|
|
2
|
-
export { GetTasksRequest, GetTaskRequestInput } from "./get-tasks-request.js";
|
|
3
|
-
export { UpdateTaskStatusRequest, UpdateTaskStatusRequestInput, } from "./update-task-status-request.js";
|
|
4
|
-
export { TaskStatus } from "./types.js";
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { TaskStatus as GraphQLTaskStatus } from "../../../graphql/schema.js";
|
|
2
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
3
|
-
import { TaskStatus } from "./types.js";
|
|
4
|
-
export type UpdateTaskStatusRequestInput = {
|
|
5
|
-
taskId: string;
|
|
6
|
-
newStatus: TaskStatus;
|
|
7
|
-
};
|
|
8
|
-
type UpdateTaskStatusRequestData = {
|
|
9
|
-
taskId: string;
|
|
10
|
-
newStatus: GraphQLTaskStatus;
|
|
11
|
-
};
|
|
12
|
-
export declare class UpdateTaskStatusRequestValidator implements Validator<UpdateTaskStatusRequestInput> {
|
|
13
|
-
validate(data: UpdateTaskStatusRequestInput, errors: ErrorsCollector): void;
|
|
14
|
-
}
|
|
15
|
-
export declare class UpdateTaskStatusRequest extends ValidationRequest<UpdateTaskStatusRequestInput, UpdateTaskStatusRequestData> {
|
|
16
|
-
protected validator: Validator<UpdateTaskStatusRequestInput>;
|
|
17
|
-
}
|
|
18
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isValidTaskStatus } from "./types.js";
|
|
3
|
-
export class UpdateTaskStatusRequestValidator {
|
|
4
|
-
validate(data, errors) {
|
|
5
|
-
if (!isValidTaskStatus(data.newStatus)) {
|
|
6
|
-
errors.add(`Invalid task status: "${data.newStatus}"`);
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
export class UpdateTaskStatusRequest extends ValidationRequest {
|
|
11
|
-
constructor() {
|
|
12
|
-
super(...arguments);
|
|
13
|
-
this.validator = new UpdateTaskStatusRequestValidator();
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { UpdateDeviceRegistrationMutationResults } from "../../../graphql/operations/types.js";
|
|
2
|
-
import type { BWellTransactionResult } from "../../../results/index.js";
|
|
3
|
-
import type { BaseManagerError } from "../errors.js";
|
|
4
|
-
import { DeregisterDeviceRequest, RegisterDeviceRequest } from "./device-request.js";
|
|
5
|
-
export type DeviceRegistrationResults = UpdateDeviceRegistrationMutationResults["updateDeviceRegistration"];
|
|
6
|
-
/**
|
|
7
|
-
* Base manager for device registration; used to subscribe and unsubscribe devices for push notifications.
|
|
8
|
-
*/
|
|
9
|
-
export declare abstract class DeviceManager {
|
|
10
|
-
/**
|
|
11
|
-
* Registers a device to receive notifications.
|
|
12
|
-
* @param request The request to register the device.
|
|
13
|
-
* @returns A promise resolving to an object representing the transaction result with the registration results or an error.
|
|
14
|
-
*/
|
|
15
|
-
abstract registerDevice(request: RegisterDeviceRequest): Promise<BWellTransactionResult<DeviceRegistrationResults, BaseManagerError>>;
|
|
16
|
-
/**
|
|
17
|
-
* Deregisters a device so that it will no longer receive notifications.
|
|
18
|
-
* @param request The request to deregister the device.
|
|
19
|
-
* @returns A promise resolving to an object representing the transaction result with the deregistration results or an error.
|
|
20
|
-
*/
|
|
21
|
-
abstract deregisterDevice(request: DeregisterDeviceRequest): Promise<BWellTransactionResult<DeviceRegistrationResults, BaseManagerError>>;
|
|
22
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* Error message for when deviceToken is missing
|
|
4
|
-
*/
|
|
5
|
-
export declare const INVALID_DEVICE_TOKEN_ERROR = "deviceToken is required";
|
|
6
|
-
/**
|
|
7
|
-
* Error message for when platformName is not a valid DevicePlatform value
|
|
8
|
-
*/
|
|
9
|
-
export declare const INVALID_PLATFORM_NAME_ERROR = "platformName must be a valid DevicePlatform value";
|
|
10
|
-
/**
|
|
11
|
-
* Error message for when applicationName is missing
|
|
12
|
-
*/
|
|
13
|
-
export declare const INVALID_APPLICATION_NAME_ERROR = "applicationName is required";
|
|
14
|
-
/**
|
|
15
|
-
* Enum for the device platform; currently only supports IOS and ANDROID
|
|
16
|
-
*/
|
|
17
|
-
declare enum DevicePlatformEnum {
|
|
18
|
-
IOS = "IOS",
|
|
19
|
-
ANDROID = "ANDROID"
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Type for the device platform; currently only supports IOS and ANDROID
|
|
23
|
-
*/
|
|
24
|
-
export type DevicePlatform = `${DevicePlatformEnum}`;
|
|
25
|
-
/**
|
|
26
|
-
* Base input for device request; used directly by DeregisterDeviceRequest
|
|
27
|
-
*/
|
|
28
|
-
export type DeviceRequestInput = {
|
|
29
|
-
deviceToken: string;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Input for the register device request
|
|
33
|
-
*/
|
|
34
|
-
export type RegisterDeviceRequestInput = DeviceRequestInput & {
|
|
35
|
-
platformName: DevicePlatform;
|
|
36
|
-
applicationName: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Base validator for device requests - only deviceToken is required in both request types
|
|
40
|
-
*/
|
|
41
|
-
export declare class DeviceRequestValidator<T extends DeviceRequestInput> implements Validator<T> {
|
|
42
|
-
validate(data: T, errors: ErrorsCollector): void;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Validator for RegisterDeviceRequest - checks that platform, applicationName and deviceToken are valid
|
|
46
|
-
*/
|
|
47
|
-
export declare class RegisterDeviceRequestValidator<T extends RegisterDeviceRequestInput> extends DeviceRequestValidator<T> {
|
|
48
|
-
validate(data: T, errors: ErrorsCollector): void;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Request for registering a device
|
|
52
|
-
*/
|
|
53
|
-
export declare class RegisterDeviceRequest extends ValidationRequest<RegisterDeviceRequestInput> {
|
|
54
|
-
protected validator: RegisterDeviceRequestValidator<RegisterDeviceRequestInput>;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* Request for deregistering a device
|
|
58
|
-
*/
|
|
59
|
-
export declare class DeregisterDeviceRequest extends ValidationRequest<DeviceRequestInput> {
|
|
60
|
-
protected validator: DeviceRequestValidator<DeviceRequestInput>;
|
|
61
|
-
}
|
|
62
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isBlank } from "../../../utils/index.js";
|
|
3
|
-
/**
|
|
4
|
-
* Error message for when deviceToken is missing
|
|
5
|
-
*/
|
|
6
|
-
export const INVALID_DEVICE_TOKEN_ERROR = "deviceToken is required";
|
|
7
|
-
/**
|
|
8
|
-
* Error message for when platformName is not a valid DevicePlatform value
|
|
9
|
-
*/
|
|
10
|
-
export const INVALID_PLATFORM_NAME_ERROR = "platformName must be a valid DevicePlatform value";
|
|
11
|
-
/**
|
|
12
|
-
* Error message for when applicationName is missing
|
|
13
|
-
*/
|
|
14
|
-
export const INVALID_APPLICATION_NAME_ERROR = "applicationName is required";
|
|
15
|
-
/**
|
|
16
|
-
* Enum for the device platform; currently only supports IOS and ANDROID
|
|
17
|
-
*/
|
|
18
|
-
var DevicePlatformEnum;
|
|
19
|
-
(function (DevicePlatformEnum) {
|
|
20
|
-
DevicePlatformEnum["IOS"] = "IOS";
|
|
21
|
-
DevicePlatformEnum["ANDROID"] = "ANDROID";
|
|
22
|
-
})(DevicePlatformEnum || (DevicePlatformEnum = {}));
|
|
23
|
-
const devicePlatformValueCache = new Set(Object.values(DevicePlatformEnum));
|
|
24
|
-
function isValidDevicePlatform(value) {
|
|
25
|
-
return devicePlatformValueCache.has(value);
|
|
26
|
-
}
|
|
27
|
-
function isNotValidDevicePlatform(value) {
|
|
28
|
-
return !isValidDevicePlatform(value);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Base validator for device requests - only deviceToken is required in both request types
|
|
32
|
-
*/
|
|
33
|
-
export class DeviceRequestValidator {
|
|
34
|
-
validate(data, errors) {
|
|
35
|
-
if (isBlank(data.deviceToken)) {
|
|
36
|
-
errors.add(INVALID_DEVICE_TOKEN_ERROR);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Validator for RegisterDeviceRequest - checks that platform, applicationName and deviceToken are valid
|
|
42
|
-
*/
|
|
43
|
-
export class RegisterDeviceRequestValidator extends DeviceRequestValidator {
|
|
44
|
-
validate(data, errors) {
|
|
45
|
-
super.validate(data, errors);
|
|
46
|
-
if (isNotValidDevicePlatform(data.platformName.toUpperCase())) {
|
|
47
|
-
errors.add(INVALID_PLATFORM_NAME_ERROR);
|
|
48
|
-
}
|
|
49
|
-
if (isBlank(data.applicationName)) {
|
|
50
|
-
errors.add(INVALID_APPLICATION_NAME_ERROR);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Request for registering a device
|
|
56
|
-
*/
|
|
57
|
-
export class RegisterDeviceRequest extends ValidationRequest {
|
|
58
|
-
constructor() {
|
|
59
|
-
super(...arguments);
|
|
60
|
-
this.validator = new RegisterDeviceRequestValidator();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Request for deregistering a device
|
|
65
|
-
*/
|
|
66
|
-
export class DeregisterDeviceRequest extends ValidationRequest {
|
|
67
|
-
constructor() {
|
|
68
|
-
super(...arguments);
|
|
69
|
-
this.validator = new DeviceRequestValidator();
|
|
70
|
-
}
|
|
71
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PublishEventMutationResults } from "../../../graphql/operations/types.js";
|
|
2
|
-
import type { BWellTransactionResult } from "../../../results/index.js";
|
|
3
|
-
import { BaseManagerError } from "../errors.js";
|
|
4
|
-
import { HandleNotificationRequest } from "./event-request.js";
|
|
5
|
-
export type HandleNotificationResults = PublishEventMutationResults["publishEvent"];
|
|
6
|
-
/**
|
|
7
|
-
* The EventManager interface provides a method for marking a notification as read.
|
|
8
|
-
*/
|
|
9
|
-
export interface EventManager {
|
|
10
|
-
/**
|
|
11
|
-
* Handles a notification event. This is used to track when a user opens a push notification.
|
|
12
|
-
* @param request The request to handle the notification. This takes a string parameter representing the serialized notification.
|
|
13
|
-
* @returns A promise that resolves to a transaction result with the results of the operation.
|
|
14
|
-
*/
|
|
15
|
-
handleNotification(request: HandleNotificationRequest): Promise<BWellTransactionResult<HandleNotificationResults, BaseManagerError>>;
|
|
16
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
|
|
2
|
-
export type EventRequestInput = {
|
|
3
|
-
serializedNotification: string;
|
|
4
|
-
};
|
|
5
|
-
export type IterableNotification = {
|
|
6
|
-
notification_id: string;
|
|
7
|
-
itbl: {
|
|
8
|
-
messageId: string;
|
|
9
|
-
};
|
|
10
|
-
};
|
|
11
|
-
export declare const SERIALIZED_NOTIFICATION_ERROR = "string parameter serializedNotification must be provided";
|
|
12
|
-
export declare const NOTIFICATION_ID_ERROR = "serialized notification must have a non-empty notification_id field of type string";
|
|
13
|
-
export declare const ITBL_ERROR = "serialized notification must have an itbl object containing a non-empty messageId field of type string";
|
|
14
|
-
export declare const NOT_AN_OBJECT_ERROR = "parsed notification must be a non-null object.";
|
|
15
|
-
export declare const INVALID_JSON_ERROR = "serialized notification is not valid JSON.";
|
|
16
|
-
/**
|
|
17
|
-
* Validator for event requests.
|
|
18
|
-
*/
|
|
19
|
-
export declare class EventRequestValidator implements Validator<EventRequestInput> {
|
|
20
|
-
/**
|
|
21
|
-
* Validates the serializedNotification property.
|
|
22
|
-
* @param data The data to validate.
|
|
23
|
-
* @param errors The collector for errors.
|
|
24
|
-
*/
|
|
25
|
-
validate(data: EventRequestInput, errors: ErrorsCollector): void;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Base request object for handling notifications.
|
|
29
|
-
* This request is used to track when a user opens a push notification.
|
|
30
|
-
* The request takes a string parameter representing the serialized notification.
|
|
31
|
-
* @extends ValidationRequest
|
|
32
|
-
*/
|
|
33
|
-
export declare class HandleNotificationRequest extends ValidationRequest<EventRequestInput, EventRequestInput> {
|
|
34
|
-
protected validator: EventRequestValidator;
|
|
35
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { ValidationRequest, } from "../../../requests/index.js";
|
|
2
|
-
import { isBlank, isNullOrUndefined, isUndefined, } from "../../../utils/index.js";
|
|
3
|
-
export const SERIALIZED_NOTIFICATION_ERROR = "string parameter serializedNotification must be provided";
|
|
4
|
-
export const NOTIFICATION_ID_ERROR = "serialized notification must have a non-empty notification_id field of type string";
|
|
5
|
-
export const ITBL_ERROR = "serialized notification must have an itbl object containing a non-empty messageId field of type string";
|
|
6
|
-
export const NOT_AN_OBJECT_ERROR = "parsed notification must be a non-null object.";
|
|
7
|
-
export const INVALID_JSON_ERROR = "serialized notification is not valid JSON.";
|
|
8
|
-
/**
|
|
9
|
-
* Validator for event requests.
|
|
10
|
-
*/
|
|
11
|
-
export class EventRequestValidator {
|
|
12
|
-
/**
|
|
13
|
-
* Validates the serializedNotification property.
|
|
14
|
-
* @param data The data to validate.
|
|
15
|
-
* @param errors The collector for errors.
|
|
16
|
-
*/
|
|
17
|
-
validate(data, errors) {
|
|
18
|
-
if (isUndefined(data.serializedNotification) ||
|
|
19
|
-
typeof data.serializedNotification !== "string" ||
|
|
20
|
-
isBlank(data.serializedNotification)) {
|
|
21
|
-
errors.add(SERIALIZED_NOTIFICATION_ERROR);
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
let notification = null;
|
|
25
|
-
try {
|
|
26
|
-
notification = JSON.parse(data.serializedNotification);
|
|
27
|
-
}
|
|
28
|
-
catch (_a) {
|
|
29
|
-
errors.add(INVALID_JSON_ERROR);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
if (typeof notification !== "object" || notification === null) {
|
|
33
|
-
errors.add(NOT_AN_OBJECT_ERROR);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const { itbl, notification_id } = notification;
|
|
37
|
-
if (isUndefined(notification_id) ||
|
|
38
|
-
typeof notification_id !== "string" ||
|
|
39
|
-
isBlank(notification_id)) {
|
|
40
|
-
errors.add(NOTIFICATION_ID_ERROR);
|
|
41
|
-
}
|
|
42
|
-
if (typeof itbl !== "object" || isNullOrUndefined(itbl)) {
|
|
43
|
-
errors.add(ITBL_ERROR);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
if (isUndefined(itbl.messageId) ||
|
|
47
|
-
typeof itbl.messageId !== "string" ||
|
|
48
|
-
isBlank(itbl.messageId)) {
|
|
49
|
-
errors.add(ITBL_ERROR);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Base request object for handling notifications.
|
|
55
|
-
* This request is used to track when a user opens a push notification.
|
|
56
|
-
* The request takes a string parameter representing the serialized notification.
|
|
57
|
-
* @extends ValidationRequest
|
|
58
|
-
*/
|
|
59
|
-
export class HandleNotificationRequest extends ValidationRequest {
|
|
60
|
-
constructor() {
|
|
61
|
-
super(...arguments);
|
|
62
|
-
this.validator = new EventRequestValidator();
|
|
63
|
-
}
|
|
64
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { HandleNotificationRequest, } from "./event-request.js";
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export type { SearchResults, RequestConnectionResults, SearchManager, SearchHealthResourcesResults, } from "./search-manager.js";
|
|
2
|
-
export { SearchRequest, SearchRequestInput, FilterField, OrganizationType, OrderBy, SortOrder, SortField, SearchPosition, } from "./search-request.js";
|
|
3
|
-
export { RequestConnectionRequestInput, RequestConnectionRequest, } from "./request-connection-request.js";
|
|
4
|
-
export { SearchHealthResourcesRequest, SearchHealthResourcesRequestInput, } from "./search-health-resources-request.js";
|