@icanbwell/bwell-sdk-ts 1.103.0 → 1.104.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.
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file is automatically generated. Please do not edit this file directly.
3
3
  */
4
- export declare const VERSION = "1.103.0";
4
+ export declare const VERSION = "1.104.0";
@@ -1,4 +1,4 @@
1
1
  /**
2
2
  * This file is automatically generated. Please do not edit this file directly.
3
3
  */
4
- export const VERSION = "1.103.0";
4
+ export const VERSION = "1.104.0";
@@ -1,4 +1,4 @@
1
- import { AddCareTeamMemberMutationResults, AddCareTeamMembersMutationResults, AppointmentsQueryResults, CancelAppointmentMutationResults, CancelationReasonsQueryResults, CareTeamMembersQueryResults, GetMemberPlanIdentifiersQueryResults, RemoveCareTeamMemberMutationResults, UpdateCareTeamMemberMutationResults } from "../../../graphql/operations/types.js";
1
+ import { AddCareTeamMemberMutationResults, AddCareTeamMembersMutationResults, AppointmentsQueryResults, CancelAppointmentMutationResults, CancelationReasonsQueryResults, CareTeamMembersQueryResults, GetMemberPlanIdentifiersQueryResults, RemoveCareTeamMemberMutationResults, UpdateAppointmentNotificationPreferencesMutationResults, UpdateCareTeamMemberMutationResults } from "../../../graphql/operations/types.js";
2
2
  import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
3
3
  import { BaseManagerError } from "../errors.js";
4
4
  import { AddCareTeamMemberRequest } from "./add-care-team-member-request.js";
@@ -8,9 +8,11 @@ import { CancelAppointmentRequest } from "./cancel-appointment-request.js";
8
8
  import { CancelationReasonsRequest } from "./cancelationReasons-request.js";
9
9
  import { CareTeamMembersRequest } from "./care-team-members-request.js";
10
10
  import { RemoveCareTeamMemberRequest } from "./remove-care-team-member-request.js";
11
+ import { UpdateAppointmentNotificationPreferencesRequest } from "./update-appointment-notification-preferences-request.js";
11
12
  import { UpdateCareTeamMemberRequest } from "./update-care-team-member-request.js";
12
13
  export type AppointmentsResults = AppointmentsQueryResults["appointments"];
13
14
  export type CancelAppointmentResults = CancelAppointmentMutationResults["updateAppointment"];
15
+ export type UpdateAppointmentNotificationPreferencesResults = UpdateAppointmentNotificationPreferencesMutationResults["updateAppointment"];
14
16
  export type CancelationReasonsResults = CancelationReasonsQueryResults["cancelationReasons"];
15
17
  export type CareTeamMembersResults = CareTeamMembersQueryResults["careTeamMembers"];
16
18
  export type MemberPlanIdentifiersResults = GetMemberPlanIdentifiersQueryResults["memberPlanIdentifiers"];
@@ -34,6 +36,20 @@ export interface HealthSpaceManager {
34
36
  * the appointment or an error of type `BaseManagerError`.
35
37
  */
36
38
  cancelAppointment(request: CancelAppointmentRequest): Promise<BWellTransactionResult<CancelAppointmentResults, BaseManagerError>>;
39
+ /**
40
+ * Updates a member's notification preferences for a single appointment.
41
+ *
42
+ * Generic and method-keyed: the request carries one or more per-method preferences
43
+ * (method, enabled flag, and optional method-specific `data`). scheduling-service applies
44
+ * each according to its method — for example a loginless SMS opt-out is sent as
45
+ * `{ method: NotificationMethod.Sms, enabled: false, data: signedToken }`, where the
46
+ * signed token both authorizes the request and resolves the appointment.
47
+ *
48
+ * @param request - The request object carrying the per-method notification preferences.
49
+ * @returns A promise that resolves to a `BWellTransactionResult` containing the updated
50
+ * appointment id or an error of type `BaseManagerError`.
51
+ */
52
+ updateAppointmentNotificationPreferences(request: UpdateAppointmentNotificationPreferencesRequest): Promise<BWellTransactionResult<UpdateAppointmentNotificationPreferencesResults, BaseManagerError>>;
37
53
  /**
38
54
  * Retrieves cancelation reasons based on the provided request.
39
55
  *
@@ -1,6 +1,7 @@
1
- export { AppointmentsResults, CancelAppointmentResults, HealthSpaceManager, CancelationReasonsResults, CareTeamMembersResults, MemberPlanIdentifiersResults, } from "./health-space-manager.js";
1
+ export { AppointmentsResults, CancelAppointmentResults, UpdateAppointmentNotificationPreferencesResults, HealthSpaceManager, CancelationReasonsResults, CareTeamMembersResults, MemberPlanIdentifiersResults, } from "./health-space-manager.js";
2
2
  export { AppointmentsRequest, AppointmentsRequestInput, } from "./appointments-request.js";
3
3
  export { CancelAppointmentRequest, CancelAppointmentRequestInput, } from "./cancel-appointment-request.js";
4
+ export { UpdateAppointmentNotificationPreferencesRequest, UpdateAppointmentNotificationPreferencesRequestInput, NotificationPreference, NotificationMethod, } from "./update-appointment-notification-preferences-request.js";
4
5
  export { CancelationReasonsRequest, CancelationReasonsRequestInput, } from "./cancelationReasons-request.js";
5
6
  export { RemoveCareTeamMemberRequest, RemoveCareTeamMemberInput, } from "./remove-care-team-member-request.js";
6
7
  export { AddCareTeamMemberInput, AddCareTeamMemberRequest, } from "./add-care-team-member-request.js";
@@ -1,5 +1,6 @@
1
1
  export { AppointmentsRequest, } from "./appointments-request.js";
2
2
  export { CancelAppointmentRequest, } from "./cancel-appointment-request.js";
3
+ export { UpdateAppointmentNotificationPreferencesRequest, NotificationMethod, } from "./update-appointment-notification-preferences-request.js";
3
4
  export { CancelationReasonsRequest, } from "./cancelationReasons-request.js";
4
5
  export { RemoveCareTeamMemberRequest, } from "./remove-care-team-member-request.js";
5
6
  export { AddCareTeamMemberRequest, } from "./add-care-team-member-request.js";
@@ -0,0 +1,71 @@
1
+ import { NotificationMethod, Scalars } from "../../../graphql/schema.js";
2
+ import { ErrorsCollector, ValidationRequest, Validator } from "../../../requests/index.js";
3
+ export { NotificationMethod };
4
+ /**
5
+ * A single notification-preference change for one delivery method.
6
+ *
7
+ * @property method - The delivery channel the preference applies to (e.g. SMS).
8
+ * @property enabled - Whether notifications for this method should be enabled.
9
+ * @property data - Optional method-specific payload interpreted by scheduling-service based
10
+ * on the method. For the loginless SMS opt-out it carries the signed token from the
11
+ * unsubscribe link (which both authorizes the request and identifies the appointment).
12
+ */
13
+ export type NotificationPreference = {
14
+ method: NotificationMethod;
15
+ enabled: boolean;
16
+ data?: string;
17
+ };
18
+ /**
19
+ * Input for updating a member's notification preferences for an appointment.
20
+ *
21
+ * Generic and method-keyed: send one entry per delivery method, marking it enabled or
22
+ * disabled and attaching optional method-specific `data`. scheduling-service validates and
23
+ * applies each preference according to its method — e.g. an SMS opt-out is sent as
24
+ * `{ method: NotificationMethod.Sms, enabled: false, data: signedToken }`.
25
+ *
26
+ * @property id - Optional unique identifier of the appointment whose notification
27
+ * preferences are being updated. Identifies the resource the mutation acts on. It may be
28
+ * omitted when the appointment is resolved another way — e.g. the loginless SMS opt-out
29
+ * carries a signed token in `data` that both authorizes the request and resolves the
30
+ * appointment, so no id is sent.
31
+ * @property notificationPreferences - One or more per-method preference changes.
32
+ */
33
+ export type UpdateAppointmentNotificationPreferencesRequestInput = {
34
+ id?: Scalars["ID"]["input"];
35
+ notificationPreferences: NotificationPreference[];
36
+ };
37
+ /**
38
+ * Validator for UpdateAppointmentNotificationPreferencesRequestInput.
39
+ *
40
+ * Enforces only the generic structural contract (at least one preference, each carrying a
41
+ * method and an enabled flag). The appointment id is optional — it may be resolved from a
42
+ * method-specific token instead. Method-specific rules — which methods are supported,
43
+ * whether a method may be re-enabled, what `data` must contain — are owned by
44
+ * scheduling-service so the hook stays generic across delivery channels.
45
+ */
46
+ declare class UpdateAppointmentNotificationPreferencesRequestValidator implements Validator<UpdateAppointmentNotificationPreferencesRequestInput> {
47
+ /**
48
+ * Validates the UpdateAppointmentNotificationPreferencesRequestInput.
49
+ * @param data - The input data to validate.
50
+ * @param errors - Collector for validation errors.
51
+ */
52
+ validate(data: UpdateAppointmentNotificationPreferencesRequestInput, errors: ErrorsCollector): void;
53
+ }
54
+ /**
55
+ * Represents a request to update a member's appointment notification preferences.
56
+ *
57
+ * Usage:
58
+ * const req = new UpdateAppointmentNotificationPreferencesRequest({
59
+ * id: appointmentId,
60
+ * notificationPreferences: [
61
+ * { method: NotificationMethod.Sms, enabled: false, data: signedToken },
62
+ * ],
63
+ * });
64
+ * const validation = req.validate();
65
+ */
66
+ export declare class UpdateAppointmentNotificationPreferencesRequest extends ValidationRequest<UpdateAppointmentNotificationPreferencesRequestInput> {
67
+ /**
68
+ * The validator instance for this request.
69
+ */
70
+ protected validator: UpdateAppointmentNotificationPreferencesRequestValidator;
71
+ }
@@ -0,0 +1,58 @@
1
+ import { NotificationMethod } from "../../../graphql/schema.js";
2
+ import { ValidationRequest, } from "../../../requests/index.js";
3
+ import { isNullOrUndefined } from "../../../utils/type-utils.js";
4
+ // Re-exported so consumers can reference notification methods without importing generated
5
+ // GraphQL types. Kept in sync with the schema automatically (it is the source of truth).
6
+ export { NotificationMethod };
7
+ /**
8
+ * Validator for UpdateAppointmentNotificationPreferencesRequestInput.
9
+ *
10
+ * Enforces only the generic structural contract (at least one preference, each carrying a
11
+ * method and an enabled flag). The appointment id is optional — it may be resolved from a
12
+ * method-specific token instead. Method-specific rules — which methods are supported,
13
+ * whether a method may be re-enabled, what `data` must contain — are owned by
14
+ * scheduling-service so the hook stays generic across delivery channels.
15
+ */
16
+ class UpdateAppointmentNotificationPreferencesRequestValidator {
17
+ /**
18
+ * Validates the UpdateAppointmentNotificationPreferencesRequestInput.
19
+ * @param data - The input data to validate.
20
+ * @param errors - Collector for validation errors.
21
+ */
22
+ validate(data, errors) {
23
+ if (isNullOrUndefined(data.notificationPreferences) ||
24
+ data.notificationPreferences.length === 0) {
25
+ errors.add("notificationPreferences is required and must not be empty");
26
+ return;
27
+ }
28
+ data.notificationPreferences.forEach((preference, index) => {
29
+ if (isNullOrUndefined(preference.method)) {
30
+ errors.add(`notificationPreferences[${index}].method is required`);
31
+ }
32
+ if (isNullOrUndefined(preference.enabled)) {
33
+ errors.add(`notificationPreferences[${index}].enabled is required`);
34
+ }
35
+ });
36
+ }
37
+ }
38
+ /**
39
+ * Represents a request to update a member's appointment notification preferences.
40
+ *
41
+ * Usage:
42
+ * const req = new UpdateAppointmentNotificationPreferencesRequest({
43
+ * id: appointmentId,
44
+ * notificationPreferences: [
45
+ * { method: NotificationMethod.Sms, enabled: false, data: signedToken },
46
+ * ],
47
+ * });
48
+ * const validation = req.validate();
49
+ */
50
+ export class UpdateAppointmentNotificationPreferencesRequest extends ValidationRequest {
51
+ constructor() {
52
+ super(...arguments);
53
+ /**
54
+ * The validator instance for this request.
55
+ */
56
+ this.validator = new UpdateAppointmentNotificationPreferencesRequestValidator();
57
+ }
58
+ }
@@ -3,7 +3,7 @@ import type { AddCareTeamMemberMutationResults, AddCareTeamMembersMutationResult
3
3
  import { type LoggerProvider } from "../../../logger/index.js";
4
4
  import { BWellQueryResult, BWellTransactionResult } from "../../../results/index.js";
5
5
  import type { BaseManagerError } from "../../base/errors.js";
6
- import { AddCareTeamMemberRequest, AddCareTeamMembersRequest, AppointmentsRequest, AppointmentsResults, CancelAppointmentRequest, CancelAppointmentResults, CancelationReasonsRequest, CancelationReasonsResults, CareTeamMembersRequest, CareTeamMembersResults, HealthSpaceManager, MemberPlanIdentifiersResults, RemoveCareTeamMemberRequest, UpdateCareTeamMemberRequest } from "../../base/index.js";
6
+ import { AddCareTeamMemberRequest, AddCareTeamMembersRequest, AppointmentsRequest, AppointmentsResults, CancelAppointmentRequest, CancelAppointmentResults, CancelationReasonsRequest, CancelationReasonsResults, CareTeamMembersRequest, CareTeamMembersResults, HealthSpaceManager, MemberPlanIdentifiersResults, RemoveCareTeamMemberRequest, UpdateAppointmentNotificationPreferencesRequest, UpdateAppointmentNotificationPreferencesResults, UpdateCareTeamMemberRequest } from "../../base/index.js";
7
7
  import { GraphQLManager } from "../graphql-manager/index.js";
8
8
  import type { GraphQLSdk } from "../graphql-sdk/index.js";
9
9
  export declare class GraphQLHealthSpaceManager extends GraphQLManager implements HealthSpaceManager {
@@ -24,6 +24,18 @@ export declare class GraphQLHealthSpaceManager extends GraphQLManager implements
24
24
  * - If successful, returns a success result with the updated appointment data.
25
25
  */
26
26
  cancelAppointment(request: CancelAppointmentRequest): Promise<BWellTransactionResult<CancelAppointmentResults, BaseManagerError>>;
27
+ /**
28
+ * Updates a member's notification preferences for a single appointment.
29
+ *
30
+ * Validates the request, then calls the updateAppointmentNotificationPreferences
31
+ * mutation with the per-method preferences. scheduling-service interprets each
32
+ * preference according to its method (e.g. an SMS opt-out carrying its signed token
33
+ * in `data`, which authorizes the request and resolves the appointment server-side).
34
+ *
35
+ * @param request - The request carrying the per-method notification preferences.
36
+ * @returns A BWellTransactionResult containing the updated appointment id or an error.
37
+ */
38
+ updateAppointmentNotificationPreferences(request: UpdateAppointmentNotificationPreferencesRequest): Promise<BWellTransactionResult<UpdateAppointmentNotificationPreferencesResults, BaseManagerError>>;
27
39
  getCancelationReasons(request: CancelationReasonsRequest): Promise<BWellQueryResult<CancelationReasonsResults, ValidationError | BaseManagerError>>;
28
40
  /**
29
41
  * Removes a care team member by validating the request and calling the GraphQL mutation.
@@ -18,7 +18,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
18
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
19
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
20
20
  };
21
- var _GraphQLHealthSpaceManager_logger, _GraphQLHealthSpaceManager_sdk, _GraphQLHealthSpaceManager_appointments, _GraphQLHealthSpaceManager_cancelAppointment, _GraphQLHealthSpaceManager_removeCareTeamMember, _GraphQLHealthSpaceManager_addCareTeamMember, _GraphQLHealthSpaceManager_addCareTeamMembers, _GraphQLHealthSpaceManager_updateCareTeamMember, _GraphQLHealthSpaceManager_careTeamMembers;
21
+ var _GraphQLHealthSpaceManager_logger, _GraphQLHealthSpaceManager_sdk, _GraphQLHealthSpaceManager_appointments, _GraphQLHealthSpaceManager_cancelAppointment, _GraphQLHealthSpaceManager_updateAppointmentNotificationPreferences, _GraphQLHealthSpaceManager_removeCareTeamMember, _GraphQLHealthSpaceManager_addCareTeamMember, _GraphQLHealthSpaceManager_addCareTeamMembers, _GraphQLHealthSpaceManager_updateCareTeamMember, _GraphQLHealthSpaceManager_careTeamMembers;
22
22
  import { ConsoleLoggerProvider, } from "../../../logger/index.js";
23
23
  import { BWellQueryResult, BWellTransactionResult, } from "../../../results/index.js";
24
24
  import { CareTeamMembersRequest, } from "../../base/index.js";
@@ -29,6 +29,7 @@ import { AppointmentsRequestFactory } from "./appointments-request-factory.js";
29
29
  import { CancelAppointmentRequestFactory } from "./cancel-appointment-request-factory.js";
30
30
  import { CareTeamMembersRequestFactory } from "./care-team-members-request-factory.js";
31
31
  import { RemoveCareTeamMemberRequestFactory } from "./remove-care-team-member-request-factory.js";
32
+ import { UpdateAppointmentNotificationPreferencesRequestFactory } from "./update-appointment-notification-preferences-request-factory.js";
32
33
  import { UpdateCareTeamMemberRequestFactory } from "./update-care-team-member-request-factory.js";
33
34
  export class GraphQLHealthSpaceManager extends GraphQLManager {
34
35
  constructor(sdk, loggerProvider = new ConsoleLoggerProvider()) {
@@ -37,6 +38,7 @@ export class GraphQLHealthSpaceManager extends GraphQLManager {
37
38
  _GraphQLHealthSpaceManager_sdk.set(this, void 0);
38
39
  _GraphQLHealthSpaceManager_appointments.set(this, new AppointmentsRequestFactory());
39
40
  _GraphQLHealthSpaceManager_cancelAppointment.set(this, new CancelAppointmentRequestFactory());
41
+ _GraphQLHealthSpaceManager_updateAppointmentNotificationPreferences.set(this, new UpdateAppointmentNotificationPreferencesRequestFactory());
40
42
  _GraphQLHealthSpaceManager_removeCareTeamMember.set(this, new RemoveCareTeamMemberRequestFactory());
41
43
  _GraphQLHealthSpaceManager_addCareTeamMember.set(this, new AddCareTeamMemberRequestFactory());
42
44
  _GraphQLHealthSpaceManager_addCareTeamMembers.set(this, new AddCareTeamMembersRequestFactory());
@@ -94,6 +96,34 @@ export class GraphQLHealthSpaceManager extends GraphQLManager {
94
96
  return BWellTransactionResult.success(result.data().updateAppointment);
95
97
  });
96
98
  }
99
+ /**
100
+ * Updates a member's notification preferences for a single appointment.
101
+ *
102
+ * Validates the request, then calls the updateAppointmentNotificationPreferences
103
+ * mutation with the per-method preferences. scheduling-service interprets each
104
+ * preference according to its method (e.g. an SMS opt-out carrying its signed token
105
+ * in `data`, which authorizes the request and resolves the appointment server-side).
106
+ *
107
+ * @param request - The request carrying the per-method notification preferences.
108
+ * @returns A BWellTransactionResult containing the updated appointment id or an error.
109
+ */
110
+ updateAppointmentNotificationPreferences(request) {
111
+ return __awaiter(this, void 0, void 0, function* () {
112
+ const validationResult = this.validateRequest(request);
113
+ if (validationResult.failure()) {
114
+ return validationResult.intoFailure();
115
+ }
116
+ __classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("calling update appointment notification preference mutation...");
117
+ const result = yield this.handleTransaction(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_sdk, "f").updateAppointmentNotificationPreferences(__classPrivateFieldGet(this, _GraphQLHealthSpaceManager_updateAppointmentNotificationPreferences, "f").create(request)));
118
+ __classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").verbose("update appointment notification preference mutation complete");
119
+ if (result.failure()) {
120
+ __classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").error("update appointment notification preference mutation error", result);
121
+ return result.intoFailure();
122
+ }
123
+ __classPrivateFieldGet(this, _GraphQLHealthSpaceManager_logger, "f").info("successfully called update appointment notification preference mutation");
124
+ return BWellTransactionResult.success(result.data().updateAppointment);
125
+ });
126
+ }
97
127
  getCancelationReasons(request) {
98
128
  return __awaiter(this, void 0, void 0, function* () {
99
129
  var _a;
@@ -273,4 +303,4 @@ export class GraphQLHealthSpaceManager extends GraphQLManager {
273
303
  });
274
304
  }
275
305
  }
276
- _GraphQLHealthSpaceManager_logger = new WeakMap(), _GraphQLHealthSpaceManager_sdk = new WeakMap(), _GraphQLHealthSpaceManager_appointments = new WeakMap(), _GraphQLHealthSpaceManager_cancelAppointment = new WeakMap(), _GraphQLHealthSpaceManager_removeCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_addCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_addCareTeamMembers = new WeakMap(), _GraphQLHealthSpaceManager_updateCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_careTeamMembers = new WeakMap();
306
+ _GraphQLHealthSpaceManager_logger = new WeakMap(), _GraphQLHealthSpaceManager_sdk = new WeakMap(), _GraphQLHealthSpaceManager_appointments = new WeakMap(), _GraphQLHealthSpaceManager_cancelAppointment = new WeakMap(), _GraphQLHealthSpaceManager_updateAppointmentNotificationPreferences = new WeakMap(), _GraphQLHealthSpaceManager_removeCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_addCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_addCareTeamMembers = new WeakMap(), _GraphQLHealthSpaceManager_updateCareTeamMember = new WeakMap(), _GraphQLHealthSpaceManager_careTeamMembers = new WeakMap();
@@ -1,6 +1,7 @@
1
1
  export * from "./graphql-health-space-manager.js";
2
2
  export * from "./appointments-request-factory.js";
3
3
  export * from "./cancel-appointment-request-factory.js";
4
+ export * from "./update-appointment-notification-preferences-request-factory.js";
4
5
  export * from "./remove-care-team-member-request-factory.js";
5
6
  export * from "./add-care-team-member-request-factory.js";
6
7
  export * from "./add-care-team-members-request-factory.js";
@@ -1,6 +1,7 @@
1
1
  export * from "./graphql-health-space-manager.js";
2
2
  export * from "./appointments-request-factory.js";
3
3
  export * from "./cancel-appointment-request-factory.js";
4
+ export * from "./update-appointment-notification-preferences-request-factory.js";
4
5
  export * from "./remove-care-team-member-request-factory.js";
5
6
  export * from "./add-care-team-member-request-factory.js";
6
7
  export * from "./add-care-team-members-request-factory.js";
@@ -0,0 +1,21 @@
1
+ import { UpdateAppointmentNotificationPreferencesMutationVariables } from "../../../graphql/operations/types.js";
2
+ import { RequestFactory } from "../../../requests/index.js";
3
+ import { UpdateAppointmentNotificationPreferencesRequest } from "../../base/health-space/index.js";
4
+ /**
5
+ * Factory for creating GraphQL mutation variables to update appointment notification
6
+ * preferences.
7
+ *
8
+ * Maps the request's per-method preferences straight onto the mutation's generic,
9
+ * method-keyed input. It applies no method-specific logic: scheduling-service interprets
10
+ * each preference (and its opaque `data`) according to the method — e.g. treating the SMS
11
+ * preference's `data` as the signed opt-out token.
12
+ */
13
+ export declare class UpdateAppointmentNotificationPreferencesRequestFactory implements RequestFactory<UpdateAppointmentNotificationPreferencesRequest, UpdateAppointmentNotificationPreferencesMutationVariables> {
14
+ /**
15
+ * Creates the variables for the updateAppointmentNotificationPreferences mutation.
16
+ *
17
+ * @param request - The request carrying the per-method notification preferences.
18
+ * @returns The variables object for the mutation.
19
+ */
20
+ create(request: UpdateAppointmentNotificationPreferencesRequest): UpdateAppointmentNotificationPreferencesMutationVariables;
21
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Factory for creating GraphQL mutation variables to update appointment notification
3
+ * preferences.
4
+ *
5
+ * Maps the request's per-method preferences straight onto the mutation's generic,
6
+ * method-keyed input. It applies no method-specific logic: scheduling-service interprets
7
+ * each preference (and its opaque `data`) according to the method — e.g. treating the SMS
8
+ * preference's `data` as the signed opt-out token.
9
+ */
10
+ export class UpdateAppointmentNotificationPreferencesRequestFactory {
11
+ /**
12
+ * Creates the variables for the updateAppointmentNotificationPreferences mutation.
13
+ *
14
+ * @param request - The request carrying the per-method notification preferences.
15
+ * @returns The variables object for the mutation.
16
+ */
17
+ create(request) {
18
+ const input = request.data();
19
+ return {
20
+ appointment: {
21
+ id: input.id,
22
+ notificationPreferences: input.notificationPreferences.map((preference) => ({
23
+ method: preference.method,
24
+ enabled: preference.enabled,
25
+ data: preference.data,
26
+ })),
27
+ },
28
+ };
29
+ }
30
+ }
@@ -108,7 +108,7 @@ export declare const GetDataSharingAccessDocument = "\n query GetDataSharingA
108
108
  export declare const GetDataSharingGrantsDocument = "\n query GetDataSharingGrants {\n dataSharingGrants {\n resourceType\n type\n total\n entry {\n fullUrl\n resource {\n ...DataSharingConsentFields\n }\n }\n }\n}\n \n fragment DataSharingConsentFields on Consent {\n id\n resourceType\n status\n scope {\n ...CodeableConceptFields\n }\n category {\n ...CodeableConceptFields\n }\n patient {\n reference\n type\n identifier {\n ...IdentifierFields\n }\n display\n resource {\n id\n name {\n ...HumanNameFields\n }\n telecom {\n ...ContactPointFields\n }\n }\n }\n dateTime\n performer {\n reference\n type\n identifier {\n ...IdentifierFields\n }\n display\n }\n provision {\n type\n period {\n ...PeriodFields\n }\n dataPeriod {\n ...PeriodFields\n }\n actor {\n ...DataSharingConsentActorFields\n }\n provision {\n type\n period {\n ...PeriodFields\n }\n dataPeriod {\n ...PeriodFields\n }\n actor {\n ...DataSharingConsentActorFields\n }\n }\n }\n sourceReference {\n reference\n type\n identifier {\n ...IdentifierFields\n }\n display\n }\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment IdentifierFields on Identifier {\n id\n type {\n ...CodeableConceptFields\n }\n system\n value\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment HumanNameFields on HumanName {\n text\n family\n given\n prefix\n suffix\n}\n \n\n fragment ContactPointFields on ContactPoint {\n id\n system\n value\n use\n rank\n}\n \n\n fragment PeriodFields on Period {\n start\n end\n}\n \n\n fragment DataSharingConsentActorFields on ConsentActor {\n role {\n ...CodeableConceptFields\n }\n reference {\n reference\n type\n identifier {\n ...IdentifierFields\n }\n display\n resource {\n ... on RelatedPerson {\n __typename\n ...DataSharingRelatedPersonFields\n }\n ... on Patient {\n __typename\n patientId: id\n name {\n ...HumanNameFields\n }\n telecom {\n ...ContactPointFields\n }\n }\n }\n }\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment IdentifierFields on Identifier {\n id\n type {\n ...CodeableConceptFields\n }\n system\n value\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment DataSharingRelatedPersonFields on RelatedPerson {\n resourceType\n id\n active\n name {\n ...HumanNameFields\n }\n relationship {\n ...CodeableConceptFields\n }\n}\n \n fragment HumanNameFields on HumanName {\n text\n family\n given\n prefix\n suffix\n}\n \n\n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment HumanNameFields on HumanName {\n text\n family\n given\n prefix\n suffix\n}\n \n\n fragment ContactPointFields on ContactPoint {\n id\n system\n value\n use\n rank\n}\n ";
109
109
  export declare const RequestDataSharingTokenDocument = "\n mutation RequestDataSharingToken($input: RequestDataSharingTokenInput!) {\n requestDataSharingToken(input: $input) {\n access_token\n issued_token_type\n token_type\n expires_in\n }\n}\n ";
110
110
  export declare const GetDeviceProviderStatusDocument = "\n query getDeviceProviderStatus($connectionId: String!) {\n getDeviceProviderStatus(connectionId: $connectionId) {\n connected\n }\n}\n ";
111
- export declare const GetDeviceProvidersDocument = "\n query getDeviceProviders {\n getDeviceProviders {\n providers {\n slug\n name\n type\n connected\n }\n }\n}\n ";
111
+ export declare const GetDeviceProvidersDocument = "\n query getDeviceProviders {\n getDeviceProviders {\n providers {\n slug\n name\n type\n connected\n logoUrl\n }\n }\n}\n ";
112
112
  export declare const GetDeviceUserStatusDocument = "\n query getDeviceUserStatus($connectionId: String!) {\n getDeviceUserStatus(connectionId: $connectionId) {\n exists\n deviceUserId\n mobileToken\n orgId\n }\n}\n ";
113
113
  export declare const SetupMobileSyncDocument = "\n query setupMobileSync($connectionId: String!) {\n setupMobileSync(connectionId: $connectionId) {\n deviceUserId\n mobileToken\n orgId\n }\n}\n ";
114
114
  export declare const UpdateDeviceRegistrationDocument = "\n mutation updateDeviceRegistration($deviceToken: String!, $platformName: String!, $applicationName: String!, $notificationPreference: Boolean!) {\n updateDeviceRegistration(\n input: {deviceToken: $deviceToken, platform: $platformName, applicationName: $applicationName, notificationPreference: $notificationPreference}\n ) {\n id\n }\n}\n ";
@@ -157,6 +157,7 @@ export declare const UpdateMedicationStatementDocument = "\n mutation updateM
157
157
  export declare const AppointmentsDocument = "\n query appointments($source: SearchString, $id: SearchString, $count: Int, $getPagesOffset: Int, $date: SearchDate, $supportingInformation: SearchReference, $sort: [String], $status: SearchToken) {\n appointments(\n _source: $source\n id: $id\n _count: $count\n _getpagesoffset: $getPagesOffset\n date: $date\n supporting_info: $supportingInformation\n _sort: $sort\n status: $status\n ) {\n entry {\n resource {\n id\n status\n meta {\n ...MetaFields\n }\n reasonCode {\n ...CodeableConceptFields\n }\n cancelationReason {\n ...CodeableConceptFields\n }\n extension {\n url\n valueBoolean\n valueInteger\n valueString\n valueExpression {\n description\n name\n language\n expression\n reference\n }\n valueCodeableConcept {\n ...CodeableConceptFields\n }\n valueDateTime\n valueCode\n valueUri\n valueReference {\n reference\n type\n display\n }\n }\n serviceType {\n ...CodeableConceptFields\n }\n start\n end\n supportingInformation {\n id\n reference\n display\n }\n participant {\n id\n type {\n ...CodeableConceptFields\n }\n actor {\n reference\n resource {\n ... on Location {\n resourceType\n __typename\n id\n name\n description\n identifier {\n ...IdentifierFields\n }\n telecom {\n id\n system\n value\n }\n address {\n ...AddressFields\n }\n position {\n latitude\n longitude\n }\n managingOrganization {\n reference\n }\n }\n ... on RelatedPerson {\n __typename\n resourceType\n identifier {\n ...IdentifierFields\n }\n relationship {\n ...CodeableConceptFields\n }\n telecom {\n ...ContactPointFields\n }\n personName: name {\n ...HumanNameFields\n }\n gender\n birthDate\n }\n ... on Practitioner {\n __typename\n practitionerId: id\n practitionerName: name {\n ...HumanNameFields\n }\n identifier {\n ...IdentifierFields\n }\n telecom {\n ...ContactPointFields\n }\n practitionerAddress: address {\n ...AddressFields\n }\n }\n }\n }\n }\n }\n }\n }\n}\n \n fragment MetaFields on Meta {\n versionId\n lastUpdated\n source\n security {\n ...CodingFields\n }\n tag {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment IdentifierFields on Identifier {\n id\n type {\n ...CodeableConceptFields\n }\n system\n value\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n system\n code\n display\n}\n \n\n fragment AddressFields on Address {\n use\n type\n text\n line\n city\n district\n state\n postalCode\n country\n}\n \n\n fragment ContactPointFields on ContactPoint {\n id\n system\n value\n use\n rank\n}\n \n\n fragment HumanNameFields on HumanName {\n text\n family\n given\n prefix\n suffix\n}\n ";
158
158
  export declare const CancelAppointmentDocument = "\n mutation cancelAppointment($appointment: UpdateAppointmentInput!) {\n updateAppointment(appointment: $appointment) {\n id\n status\n }\n}\n ";
159
159
  export declare const CancelationReasonsDocument = "\n query cancelationReasons($organization: SearchReference!) {\n cancelationReasons(organization: $organization) {\n id\n title\n url\n concept {\n code\n display\n }\n }\n}\n ";
160
+ export declare const UpdateAppointmentNotificationPreferencesDocument = "\n mutation updateAppointmentNotificationPreferences($appointment: UpdateAppointmentInput!) {\n updateAppointment(appointment: $appointment) {\n id\n }\n}\n ";
160
161
  export declare const AddCareTeamMemberDocument = "\n mutation addCareTeamMember($participant: CareTeamParticipantInput!) {\n updateCareTeamMember(participant: [$participant]) {\n id\n }\n}\n ";
161
162
  export declare const AddCareTeamMembersDocument = "\n mutation addCareTeamMembers($participant: [CareTeamParticipantInput]!) {\n updateCareTeamMember(participant: $participant) {\n id\n }\n}\n ";
162
163
  export declare const CareTeamMembersDocument = "\n query CareTeamMembers($pageNumber: Int, $pageSize: Int) {\n careTeamMembers(\n input: {pagingInfo: {pageNumber: $pageNumber, pageSize: $pageSize}}\n ) {\n pagingInfo {\n pageSize\n pageNumber\n totalPages\n totalItems\n }\n members {\n id\n role {\n coding {\n code\n system\n display\n }\n text\n }\n period {\n start\n end\n }\n }\n }\n}\n ";
@@ -638,6 +639,13 @@ export declare function getSdk(client: GraphQLClient, withWrapper?: SdkFunctionW
638
639
  headers: Headers;
639
640
  status: number;
640
641
  }>;
642
+ updateAppointmentNotificationPreferences(variables: Types.UpdateAppointmentNotificationPreferencesMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise<{
643
+ data: Types.UpdateAppointmentNotificationPreferencesMutationResults;
644
+ errors?: GraphQLError[];
645
+ extensions?: any;
646
+ headers: Headers;
647
+ status: number;
648
+ }>;
641
649
  addCareTeamMember(variables: Types.AddCareTeamMemberMutationVariables, requestHeaders?: GraphQLClientRequestHeaders): Promise<{
642
650
  data: Types.AddCareTeamMemberMutationResults;
643
651
  errors?: GraphQLError[];
@@ -2135,6 +2135,7 @@ export const GetDeviceProvidersDocument = `
2135
2135
  name
2136
2136
  type
2137
2137
  connected
2138
+ logoUrl
2138
2139
  }
2139
2140
  }
2140
2141
  }
@@ -4177,6 +4178,13 @@ export const CancelationReasonsDocument = `
4177
4178
  }
4178
4179
  }
4179
4180
  `;
4181
+ export const UpdateAppointmentNotificationPreferencesDocument = `
4182
+ mutation updateAppointmentNotificationPreferences($appointment: UpdateAppointmentInput!) {
4183
+ updateAppointment(appointment: $appointment) {
4184
+ id
4185
+ }
4186
+ }
4187
+ `;
4180
4188
  export const AddCareTeamMemberDocument = `
4181
4189
  mutation addCareTeamMember($participant: CareTeamParticipantInput!) {
4182
4190
  updateCareTeamMember(participant: [$participant]) {
@@ -5391,6 +5399,9 @@ export function getSdk(client, withWrapper = defaultWrapper) {
5391
5399
  cancelationReasons(variables, requestHeaders) {
5392
5400
  return withWrapper((wrappedRequestHeaders) => client.rawRequest(CancelationReasonsDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'cancelationReasons', 'query', variables);
5393
5401
  },
5402
+ updateAppointmentNotificationPreferences(variables, requestHeaders) {
5403
+ return withWrapper((wrappedRequestHeaders) => client.rawRequest(UpdateAppointmentNotificationPreferencesDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'updateAppointmentNotificationPreferences', 'mutation', variables);
5404
+ },
5394
5405
  addCareTeamMember(variables, requestHeaders) {
5395
5406
  return withWrapper((wrappedRequestHeaders) => client.rawRequest(AddCareTeamMemberDocument, variables, Object.assign(Object.assign({}, requestHeaders), wrappedRequestHeaders)), 'addCareTeamMember', 'mutation', variables);
5396
5407
  },
@@ -9708,6 +9708,7 @@ export type GetDeviceProvidersQueryResults = {
9708
9708
  name: string;
9709
9709
  type: string;
9710
9710
  connected: boolean;
9711
+ logoUrl: string | null;
9711
9712
  }>;
9712
9713
  };
9713
9714
  };
@@ -23180,6 +23181,14 @@ export type CancelationReasonsQueryResults = {
23180
23181
  } | null> | null;
23181
23182
  };
23182
23183
  };
23184
+ export type UpdateAppointmentNotificationPreferencesMutationVariables = Types.Exact<{
23185
+ appointment: Types.UpdateAppointmentInput;
23186
+ }>;
23187
+ export type UpdateAppointmentNotificationPreferencesMutationResults = {
23188
+ updateAppointment: {
23189
+ id: string;
23190
+ };
23191
+ };
23183
23192
  export type AddCareTeamMemberMutationVariables = Types.Exact<{
23184
23193
  participant: Types.CareTeamParticipantInput;
23185
23194
  }>;
@@ -2090,6 +2090,8 @@ export type DeviceProvider = {
2090
2090
  __typename?: 'DeviceProvider';
2091
2091
  /** Whether the user has connected this provider */
2092
2092
  connected: Scalars['Boolean']['output'];
2093
+ /** Provider logo image URL */
2094
+ logoUrl?: Maybe<Scalars['String']['output']>;
2093
2095
  /** Display name */
2094
2096
  name: Scalars['String']['output'];
2095
2097
  /** Provider identifier (e.g. fitbit, garmin) */
@@ -4688,6 +4690,14 @@ export type NotSearchTokenValue = {
4688
4690
  value?: InputMaybe<Scalars['String']['input']>;
4689
4691
  values?: InputMaybe<Array<InputMaybe<SearchTokenValue>>>;
4690
4692
  };
4693
+ export declare enum NotificationMethod {
4694
+ Sms = "SMS"
4695
+ }
4696
+ export type NotificationPreferenceInput = {
4697
+ data?: InputMaybe<Scalars['String']['input']>;
4698
+ enabled: Scalars['Boolean']['input'];
4699
+ method: NotificationMethod;
4700
+ };
4691
4701
  export type NutritionOrder = {
4692
4702
  __typename?: 'NutritionOrder';
4693
4703
  /**
@@ -7387,6 +7397,7 @@ export type SearchReferenceValue = {
7387
7397
  value?: InputMaybe<Scalars['String']['input']>;
7388
7398
  };
7389
7399
  export declare enum SearchResultTypeEnum {
7400
+ Device = "DEVICE",
7390
7401
  Insurance = "INSURANCE",
7391
7402
  Laboratory = "LABORATORY",
7392
7403
  Pharmacy = "PHARMACY",
@@ -8056,7 +8067,7 @@ export type UsCoreMedicationProfile = {
8056
8067
  export type UpdateAppointmentInput = {
8057
8068
  cancelationReason?: InputMaybe<CodeableConceptInput>;
8058
8069
  id?: InputMaybe<Scalars['ID']['input']>;
8059
- optOutToken?: InputMaybe<Scalars['String']['input']>;
8070
+ notificationPreferences?: InputMaybe<Array<NotificationPreferenceInput>>;
8060
8071
  status?: InputMaybe<AppointmentStatus>;
8061
8072
  };
8062
8073
  export type UpdateDeviceRegistrationRequest = {
@@ -315,6 +315,10 @@ export var LogLevel;
315
315
  LogLevel["Verbose"] = "VERBOSE";
316
316
  LogLevel["Warn"] = "WARN";
317
317
  })(LogLevel || (LogLevel = {}));
318
+ export var NotificationMethod;
319
+ (function (NotificationMethod) {
320
+ NotificationMethod["Sms"] = "SMS";
321
+ })(NotificationMethod || (NotificationMethod = {}));
318
322
  /** Classification of type of observation */
319
323
  export var ObservationCategory;
320
324
  (function (ObservationCategory) {
@@ -457,6 +461,7 @@ export var SearchContextEnum;
457
461
  })(SearchContextEnum || (SearchContextEnum = {}));
458
462
  export var SearchResultTypeEnum;
459
463
  (function (SearchResultTypeEnum) {
464
+ SearchResultTypeEnum["Device"] = "DEVICE";
460
465
  SearchResultTypeEnum["Insurance"] = "INSURANCE";
461
466
  SearchResultTypeEnum["Laboratory"] = "LABORATORY";
462
467
  SearchResultTypeEnum["Pharmacy"] = "PHARMACY";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/bwell-sdk-ts",
3
- "version": "1.103.0",
3
+ "version": "1.104.0",
4
4
  "description": "b.well TypeScript SDK",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",