@icanbwell/bwell-sdk-ts 2.0.0-alpha.0-rc.1756490690 → 2.0.0-alpha.0-rc.1757362315
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/identity-manager-factory.js +1 -1
- package/dist/config/bwell-config.d.ts +4 -10
- package/dist/config/bwell-config.js +1 -2
- package/dist/config/sdk-config.d.ts +3 -3
- package/dist/config/sdk-config.js +14 -5
- package/dist/graphql/operations/index.d.ts +1 -1
- package/dist/graphql/operations/index.js +1 -2
- package/dist/graphql/operations/types.d.ts +1 -2
- package/dist/graphql/schema.d.ts +2 -1
- package/dist/models/identity/sdk-configuration-result.d.ts +1 -2
- package/dist/telemetry/open-telemetry-instrumentation.js +1 -4
- package/package.json +1 -1
package/dist/__version__.d.ts
CHANGED
package/dist/__version__.js
CHANGED
|
@@ -2,7 +2,7 @@ import { graphQLSDKFactory } from "./graphql-api/graphql-sdk/index.js";
|
|
|
2
2
|
import { GraphQLIdentityManager } from "./graphql-api/identity/index.js";
|
|
3
3
|
export class IdentityManagerFactory {
|
|
4
4
|
createIdentityManager(config, loggerProvider) {
|
|
5
|
-
const { sdk } = graphQLSDKFactory(config.graphQL.
|
|
5
|
+
const { sdk } = graphQLSDKFactory(config.graphQL.apiUrl);
|
|
6
6
|
return new GraphQLIdentityManager(sdk, loggerProvider);
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -34,17 +34,11 @@ export type BWellConfig = {
|
|
|
34
34
|
language?: Nullable<Language>;
|
|
35
35
|
overrides?: {
|
|
36
36
|
/**
|
|
37
|
-
* Base
|
|
38
|
-
* If not provided, the SDK will use the URL returned by
|
|
39
|
-
* NOTE: Changing this setting will override
|
|
37
|
+
* Base URL for the BWell API.
|
|
38
|
+
* If not provided, the SDK will use the URL returned by remote configuration.
|
|
39
|
+
* NOTE: Changing this setting will override remote configuration.
|
|
40
40
|
*/
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Base authed URL for the BWell API.
|
|
44
|
-
* If not provided, the SDK will use the URL returned by the Client Config Service.
|
|
45
|
-
* NOTE: Changing this setting will override the remote config.
|
|
46
|
-
*/
|
|
47
|
-
authedApiUrl?: Nullable<string>;
|
|
41
|
+
apiUrl?: Nullable<string>;
|
|
48
42
|
};
|
|
49
43
|
};
|
|
50
44
|
export declare const DEFAULT_BWELL_CONFIG: Required<Omit<BWellConfig, "clientKey">>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { InvalidClientKeyError } from "../errors/index.js";
|
|
2
|
-
import { Retry
|
|
2
|
+
import { Retry } from "../graphql/schema.js";
|
|
3
3
|
import { Severity } from "../logger/index.js";
|
|
4
|
+
import { SdkConfigurationResult } from "../models/identity/index.js";
|
|
4
5
|
import { User } from "../models/user/user.js";
|
|
5
6
|
import { BWellTransactionResult } from "../results/index.js";
|
|
6
7
|
import { BWellConfig } from "./bwell-config.js";
|
|
7
8
|
import { Context } from "./context.js";
|
|
8
9
|
export type GraphQLConfig = {
|
|
9
10
|
apiUrl: string;
|
|
10
|
-
unauthApiUrl: string;
|
|
11
11
|
};
|
|
12
12
|
export type TelemetryConfig = {
|
|
13
13
|
collectorUrl: string;
|
|
@@ -36,5 +36,5 @@ export declare class SdkConfig {
|
|
|
36
36
|
get http(): HttpConfig;
|
|
37
37
|
get context(): Context;
|
|
38
38
|
setContextUser(user: User): void;
|
|
39
|
-
mergeRemoteConfig(remoteConfig:
|
|
39
|
+
mergeRemoteConfig(remoteConfig: SdkConfigurationResult | null): void;
|
|
40
40
|
}
|
|
@@ -9,7 +9,7 @@ var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (
|
|
|
9
9
|
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");
|
|
10
10
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
11
|
};
|
|
12
|
-
var _SdkConfig_instances, _SdkConfig_loggerSeverity, _SdkConfig_telemetryConfig, _SdkConfig_graphQLConfig, _SdkConfig_httpConfig, _SdkConfig_context, _SdkConfig_mergeLogLevel, _SdkConfig_mergeTelemetryConfig, _SdkConfig_mergeHttpConfig, _SdkConfig_mergeDefaultBwellConfig, _SdkConfig_getEnvFromClientKey, _SdkConfig_createDefaultGraphQLConfig, _SdkConfig_createDefaultTelemetryConfig, _SdkConfig_createDefaultHttpConfig, _SdkConfig_createDefaultContext;
|
|
12
|
+
var _SdkConfig_instances, _SdkConfig_loggerSeverity, _SdkConfig_telemetryConfig, _SdkConfig_graphQLConfig, _SdkConfig_httpConfig, _SdkConfig_context, _SdkConfig_mergeLogLevel, _SdkConfig_mergeGraphQLConfig, _SdkConfig_mergeTelemetryConfig, _SdkConfig_mergeHttpConfig, _SdkConfig_mergeDefaultBwellConfig, _SdkConfig_getEnvFromClientKey, _SdkConfig_createDefaultGraphQLConfig, _SdkConfig_createDefaultTelemetryConfig, _SdkConfig_createDefaultHttpConfig, _SdkConfig_createDefaultContext;
|
|
13
13
|
import { BWellError, InvalidClientKeyError } from "../errors/index.js";
|
|
14
14
|
import { LoggerSeverity } from "../logger/index.js";
|
|
15
15
|
import { BWellTransactionResult } from "../results/index.js";
|
|
@@ -73,7 +73,7 @@ export class SdkConfig {
|
|
|
73
73
|
}
|
|
74
74
|
mergeRemoteConfig(remoteConfig) {
|
|
75
75
|
__classPrivateFieldSet(this, _SdkConfig_loggerSeverity, __classPrivateFieldGet(this, _SdkConfig_instances, "m", _SdkConfig_mergeLogLevel).call(this, remoteConfig), "f");
|
|
76
|
-
|
|
76
|
+
__classPrivateFieldSet(this, _SdkConfig_graphQLConfig, __classPrivateFieldGet(this, _SdkConfig_instances, "m", _SdkConfig_mergeGraphQLConfig).call(this, remoteConfig), "f");
|
|
77
77
|
__classPrivateFieldSet(this, _SdkConfig_telemetryConfig, Object.freeze(__classPrivateFieldGet(this, _SdkConfig_instances, "m", _SdkConfig_mergeTelemetryConfig).call(this, remoteConfig)), "f");
|
|
78
78
|
__classPrivateFieldSet(this, _SdkConfig_httpConfig, Object.freeze(__classPrivateFieldGet(this, _SdkConfig_instances, "m", _SdkConfig_mergeHttpConfig).call(this, remoteConfig)), "f");
|
|
79
79
|
}
|
|
@@ -85,6 +85,16 @@ _SdkConfig_loggerSeverity = new WeakMap(), _SdkConfig_telemetryConfig = new Weak
|
|
|
85
85
|
return __classPrivateFieldGet(this, _SdkConfig_loggerSeverity, "f");
|
|
86
86
|
}
|
|
87
87
|
return LoggerSeverity.severityFromText(remoteLogLevel);
|
|
88
|
+
}, _SdkConfig_mergeGraphQLConfig = function _SdkConfig_mergeGraphQLConfig(remoteConfig) {
|
|
89
|
+
var _a;
|
|
90
|
+
const remoteGraphQLConfig = (_a = remoteConfig === null || remoteConfig === void 0 ? void 0 : remoteConfig.graphQLClient) !== null && _a !== void 0 ? _a : null;
|
|
91
|
+
if (remoteGraphQLConfig === null) {
|
|
92
|
+
return __classPrivateFieldGet(this, _SdkConfig_graphQLConfig, "f");
|
|
93
|
+
}
|
|
94
|
+
const { apiUrl } = this.bwellConfig.overrides;
|
|
95
|
+
return {
|
|
96
|
+
apiUrl: apiUrl !== null && apiUrl !== void 0 ? apiUrl : remoteGraphQLConfig.apiUrl,
|
|
97
|
+
};
|
|
88
98
|
}, _SdkConfig_mergeTelemetryConfig = function _SdkConfig_mergeTelemetryConfig(remoteConfig) {
|
|
89
99
|
var _a, _b;
|
|
90
100
|
const remoteTelemetry = (_a = remoteConfig === null || remoteConfig === void 0 ? void 0 : remoteConfig.telemetry) !== null && _a !== void 0 ? _a : null;
|
|
@@ -127,10 +137,9 @@ _SdkConfig_loggerSeverity = new WeakMap(), _SdkConfig_telemetryConfig = new Weak
|
|
|
127
137
|
throw new InvalidClientKeyError("It appears there is a problem with your Client Key. Contact b.well support for further assistance.");
|
|
128
138
|
}
|
|
129
139
|
}, _SdkConfig_createDefaultGraphQLConfig = function _SdkConfig_createDefaultGraphQLConfig() {
|
|
130
|
-
var _a
|
|
140
|
+
var _a;
|
|
131
141
|
return {
|
|
132
|
-
apiUrl: (_a = this.bwellConfig.overrides.
|
|
133
|
-
unauthApiUrl: (_b = this.bwellConfig.overrides.unauthedApiUrl) !== null && _b !== void 0 ? _b : "https://bwell-router-wundergraph.dev.bwell.zone/graphql",
|
|
142
|
+
apiUrl: (_a = this.bwellConfig.overrides.apiUrl) !== null && _a !== void 0 ? _a : `https://api.${__classPrivateFieldGet(this, _SdkConfig_context, "f").env}.icanbwell.com/v1/graphql`,
|
|
134
143
|
};
|
|
135
144
|
}, _SdkConfig_createDefaultTelemetryConfig = function _SdkConfig_createDefaultTelemetryConfig() {
|
|
136
145
|
return {
|
|
@@ -63,7 +63,7 @@ export declare const CancellationReasonsDocument = "\n query cancellationReas
|
|
|
63
63
|
export declare const AuthenticateDocument = "\n query authenticate {\n getToken {\n accessToken {\n jwtToken\n }\n idToken {\n jwtToken\n }\n refreshToken {\n token\n }\n }\n}\n ";
|
|
64
64
|
export declare const CreateGuestAccessTokenDocument = "\n mutation createGuestAccessToken($clientKey: String!) {\n createGuestAccessToken(clientKey: $clientKey) {\n accessToken\n refreshToken\n identityToken\n tokenType\n issuedAt\n expiresIn\n }\n}\n ";
|
|
65
65
|
export declare const ExchangeAuthCodeDocument = "\n mutation ExchangeAuthCode($authCode: String!) {\n exchangeAuthCode(authCode: $authCode) {\n accessToken {\n jwtToken\n }\n idToken {\n jwtToken\n }\n refreshToken {\n token\n }\n }\n}\n ";
|
|
66
|
-
export declare const InitializeDocument = "\n query initialize($clientKey: String!) {\n initSdk(clientKey: $clientKey) {\n httpClient {\n requestTimeout\n retry {\n interval\n attempts\n }\n }\n graphQLClient {\n
|
|
66
|
+
export declare const InitializeDocument = "\n query initialize($clientKey: String!) {\n initSdk(clientKey: $clientKey) {\n httpClient {\n requestTimeout\n retry {\n interval\n attempts\n }\n }\n graphQLClient {\n apiUrl\n fetchPolicy\n cache {\n maxSizeBytes\n }\n }\n logLevel\n telemetry {\n enabled\n collectorUrl\n }\n }\n}\n ";
|
|
67
67
|
export declare const LoginDocument = "\n query login($email: String!, $password: String!) {\n login(email: $email, password: $password) {\n accessToken {\n jwtToken\n }\n idToken {\n jwtToken\n }\n refreshToken {\n token\n }\n }\n}\n ";
|
|
68
68
|
export declare const RefreshTokensDocument = "\n query refreshTokens {\n refresh {\n accessToken\n idToken\n }\n}\n ";
|
|
69
69
|
export declare const NextQuestionDocument = "\n mutation nextQuestion($questionnaireResponse: QuestionnaireResponseInput!) {\n nextQuestion(input: $questionnaireResponse) {\n ...QuestionnaireResponseFields\n }\n}\n \n fragment QuestionnaireResponseFields on QuestionnaireResponse {\n resourceType\n id\n meta {\n ...MetaFields\n }\n identifier {\n ...IdentifierFields\n }\n questionnaire\n status\n item {\n ...QuestionnaireResponseItemFields\n item {\n ...QuestionnaireResponseItemFields\n item {\n ...QuestionnaireResponseItemFields\n }\n }\n }\n contained {\n ...QuestionnaireFields\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 id\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 id\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment QuestionnaireResponseItemFields on QuestionnaireResponseItem {\n linkId\n text\n answer {\n valueBoolean\n valueDecimal\n valueInteger\n valueDate\n valueDateTime\n valueString\n valueUri\n valueAttachment {\n contentType\n data\n url\n title\n }\n valueCoding {\n ...CodingFields\n }\n valueQuantity {\n ...QuantityFields\n }\n valueReference {\n reference\n type\n display\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 }\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment QuantityFields on Quantity {\n value\n unit\n code\n comparator\n system\n}\n \n\n fragment CodeableConceptFields on CodeableConcept {\n id\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment QuestionnaireFields on Questionnaire {\n resourceType\n id\n meta {\n ...MetaFields\n }\n identifier {\n ...IdentifierFields\n }\n name\n title\n status\n description\n item {\n ...QuestionnaireItemFields\n item {\n ...QuestionnaireItemFields\n item {\n ...QuestionnaireItemFields\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 id\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 id\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment QuestionnaireItemFields on QuestionnaireItem {\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 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 }\n linkId\n prefix\n text\n type\n enableWhen {\n question\n operator\n answerBoolean\n answerDecimal\n answerInteger\n answerDate\n answerDateTime\n answerTime\n answerString\n answerCoding {\n ...CodingFields\n }\n answerQuantity {\n ...QuantityFields\n }\n answerReference {\n reference\n type\n display\n }\n }\n enableBehavior\n required\n repeats\n readOnly\n maxLength\n answerOption {\n valueInteger\n valueDate\n valueString\n valueCoding {\n ...CodingFields\n }\n valueReference {\n reference\n type\n display\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 }\n initialSelected\n }\n initial {\n valueBoolean\n valueDecimal\n valueInteger\n valueDate\n valueDateTime\n valueString\n valueUri\n valueAttachment {\n contentType\n data\n url\n title\n }\n valueCoding {\n ...CodingFields\n }\n valueQuantity {\n ...QuantityFields\n }\n valueReference {\n reference\n type\n display\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 }\n }\n}\n \n fragment CodeableConceptFields on CodeableConcept {\n id\n text\n coding {\n ...CodingFields\n }\n}\n \n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment CodingFields on Coding {\n id\n system\n code\n display\n}\n \n\n fragment QuantityFields on Quantity {\n value\n unit\n code\n comparator\n system\n}\n ";
|
package/dist/graphql/schema.d.ts
CHANGED
|
@@ -15178,7 +15178,7 @@ export type Connection = {
|
|
|
15178
15178
|
type: DataConnectionType;
|
|
15179
15179
|
};
|
|
15180
15180
|
/** Defines the type of connection */
|
|
15181
|
-
export type ConnectionCategory = 'BASIC' | 'OAUTH';
|
|
15181
|
+
export type ConnectionCategory = 'BASIC' | 'IDENTITY' | 'OAUTH';
|
|
15182
15182
|
/** Defines connection after making updates */
|
|
15183
15183
|
export type ConnectionStatusUpdate = {
|
|
15184
15184
|
__typename?: 'ConnectionStatusUpdate';
|
|
@@ -30565,6 +30565,7 @@ export type GraphDefinitionTarget = {
|
|
|
30565
30565
|
};
|
|
30566
30566
|
export type GraphQlClientConfig = {
|
|
30567
30567
|
__typename?: 'GraphQLClientConfig';
|
|
30568
|
+
apiUrl: Scalars['String']['output'];
|
|
30568
30569
|
authUrl: Scalars['String']['output'];
|
|
30569
30570
|
cache: Cache;
|
|
30570
30571
|
fetchPolicy: Scalars['String']['output'];
|
|
@@ -31,10 +31,7 @@ export function getRuntimeInstrumentation(config) {
|
|
|
31
31
|
browser: () => {
|
|
32
32
|
return new XMLHttpRequestInstrumentation({
|
|
33
33
|
ignoreUrls: [IGNORE_URL_REGEX],
|
|
34
|
-
propagateTraceHeaderCorsUrls: [
|
|
35
|
-
config.graphQL.apiUrl,
|
|
36
|
-
config.graphQL.unauthApiUrl,
|
|
37
|
-
],
|
|
34
|
+
propagateTraceHeaderCorsUrls: [config.graphQL.apiUrl],
|
|
38
35
|
});
|
|
39
36
|
},
|
|
40
37
|
});
|