@experian-ecs/connected-api-sdk 1.4.0 → 1.5.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/esm/index.mjs +334 -276
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +38 -1
- package/dist/umd/index.umd.js +1 -1
- package/dist/umd/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1963,6 +1963,41 @@ declare class DigitalIdentityManagerService extends ApiClient {
|
|
|
1963
1963
|
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<DIMBrokerGroupActionResponse>>;
|
|
1964
1964
|
}
|
|
1965
1965
|
|
|
1966
|
+
declare const LOCK_STATUS: {
|
|
1967
|
+
readonly LOCKED: "LOCKED";
|
|
1968
|
+
readonly UNLOCKED: "UNLOCKED";
|
|
1969
|
+
};
|
|
1970
|
+
type LockStatus = (typeof LOCK_STATUS)[keyof typeof LOCK_STATUS];
|
|
1971
|
+
type CreditLockUnlockType = {
|
|
1972
|
+
product_config_id: string;
|
|
1973
|
+
bureau: Bureau;
|
|
1974
|
+
lock_status: LockStatus;
|
|
1975
|
+
updated_at: string;
|
|
1976
|
+
};
|
|
1977
|
+
|
|
1978
|
+
declare class CreditLockUnlockService extends ApiClient {
|
|
1979
|
+
#private;
|
|
1980
|
+
constructor(config: ConnectedSolutionsSDKConfig);
|
|
1981
|
+
/**
|
|
1982
|
+
* Get the current credit lock status
|
|
1983
|
+
*/
|
|
1984
|
+
getCreditLockStatus(requestOptions: {
|
|
1985
|
+
product_config_id: string;
|
|
1986
|
+
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<CreditLockUnlockType>>;
|
|
1987
|
+
/**
|
|
1988
|
+
* Lock credit file
|
|
1989
|
+
*/
|
|
1990
|
+
lockCredit(requestOptions: {
|
|
1991
|
+
product_config_id: string;
|
|
1992
|
+
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<CreditLockUnlockType>>;
|
|
1993
|
+
/**
|
|
1994
|
+
* Unlock credit file
|
|
1995
|
+
*/
|
|
1996
|
+
unlockCredit(requestOptions: {
|
|
1997
|
+
product_config_id: string;
|
|
1998
|
+
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<CreditLockUnlockType>>;
|
|
1999
|
+
}
|
|
2000
|
+
|
|
1966
2001
|
type ConnectedSolutionsSDKConfigInternal = {
|
|
1967
2002
|
environment: 'PRODUCTION' | 'SANDBOX';
|
|
1968
2003
|
token: string | null;
|
|
@@ -1983,6 +2018,7 @@ interface ConnectedSolutionsSDK {
|
|
|
1983
2018
|
registrations: RegistrationsService;
|
|
1984
2019
|
identityHealthScore: IdentityHealthScoreService;
|
|
1985
2020
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2021
|
+
creditLockUnlock: CreditLockUnlockService;
|
|
1986
2022
|
}
|
|
1987
2023
|
|
|
1988
2024
|
type ConnectedSolutionsClientMeta = {
|
|
@@ -2037,6 +2073,7 @@ declare class SDKClient extends ApiClient implements ConnectedSolutionsSDK {
|
|
|
2037
2073
|
registrations: RegistrationsService;
|
|
2038
2074
|
identityHealthScore: IdentityHealthScoreService;
|
|
2039
2075
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2076
|
+
creditLockUnlock: CreditLockUnlockService;
|
|
2040
2077
|
static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient;
|
|
2041
2078
|
static clearInstance(): void;
|
|
2042
2079
|
private constructor();
|
|
@@ -2079,4 +2116,4 @@ declare function isCreditAttributeArray(data: unknown): data is CreditAttribute[
|
|
|
2079
2116
|
declare function isV1GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v1'>;
|
|
2080
2117
|
declare function isV2GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v2'>;
|
|
2081
2118
|
|
|
2082
|
-
export { type Account, type AccountClosedDetails, type AccountCurrentDetails, type AccountImprovedDetails, type AccountInBankruptcyDetails, type AccountPaidDetails, type Account_V2, type Action, type ActivationRule, type Address, type Alert, type AlertCount, type AlertData, type AlertDetails, type AlertDisposition, type AlertMetadata, type Alerts, type AlternativeLoanMonitoringDetails, type AlternativeLoanRecord, type ApiClientResponse, type AttributeCategoryImpact, type AttributeCategoryName, type AttributeCategoryRating, type AttributeCategoryRatingName, type AttributeCategoryRatingScale, type AttributeCategoryRatingScaleType, type AttributeCategoryRatingScaleValue, type AttributeCategoryRatingScaleValueName, type AttributeHardInquiry, type AttributeHighCreditUtilizationAccount, type AttributeOldestOpenAccount, type AttributeRelevantScoreFactor, type AuthAnswer, type AuthAnswersRequest, type AuthCredentials, type AuthQuestion, type AuthQuestions, type AuthServiceConfig, type AuthorizationAlertDetails, type AuthorizationCompanyAddress, type AuthorizationCompanyDetail, type BaseCreditAttributeRequestOptions, type BaseCreditScoreRequestOptions, type BearerToken, type BureauAttribute, type BureauReport, type BureauReportMeta, type BureauScore, type CardOverLimitDetails, type ClosedAccountDetails, type CollectionAccount, type CollectionAccount_V2, type CollectionDetails, type Company, type ConnectedSolutionsAPIErrorData, type ConnectedSolutionsAPIErrorType, ConnectedSolutionsClientAuthenticationError, ConnectedSolutionsClientError, type ConnectedSolutionsClientErrors, type ConnectedSolutionsClientMeta, ConnectedSolutionsClientRateLimitError, type ConnectedSolutionsClientRawError, ConnectedSolutionsClientSDKError, ConnectedSolutionsClientServerSideError, ConnectedSolutionsClientSideError, type ConnectedSolutionsSDK, type ConnectedSolutionsSDKConfig, type ConnectedSolutionsSDKConfigInternal, type ConnectedSolutionsSDKErrorTypes, type ContactInfo, type CreateCustomerOptions, type CreateRegistrationsRequest, type CreateRegistrationsResponse, type CreditAttribute, type CreditAttributeCategory, type CreditAttribute_V2, type CreditAttributes, type CreditAttributes_V2, type CreditBalanceDecreaseDetails, type CreditBalanceIncreaseDetails, type CreditInquiry, type CreditLimitDecreaseDetails, type CreditLimitIncreaseDetails, type CreditReport, type CreditReportDisposition_V2, type CreditReportMeta, type CreditReportMeta_V2, type CreditReportScoreDetail, type CreditReportScoreRating, type CreditReportType, type CreditReport_V2, type CreditReportsMeta_V2, type CreditReports_V2, type CreditScore, type CreditScoreBelowGoalDetails, type CreditScoreDecreaseDetails, type CreditScoreFeaturePreferences, type CreditScoreGoalAchievedDetails, type CreditScoreIncreaseDetails, type CreditScoreIngredient, type CreditScorePlan, type CreditScorePostRequest, type CreditScoreRatingDecreaseDetails, type CreditScoreRatingIncreaseDetails, type CreditScoreSimulator, type CreditScoreSimulatorPostRequest, type CreditScoreSimulatorPostResponse, type CreditScoreTriggerReasons, type CreditScore_V2, type CreditScores_V2, type CreditUsageDecreaseDetails, type CreditUsageIncreaseDetails, type CreditorAddress, type CustomAttributes, type CustomFeatures, type Customer, type CustomerAddress, type CustomerDisclosure, type CustomerEmail, type CustomerId, type CustomerPhone, type CustomerSearchOptions, type CustomerSearchResults, type DIMBroker, type DIMBrokerDetail, type DIMBrokerGroupActionResponse, type DIMBrokerGroupDetail, type DIMBrokerScanStatus, type DIMGetBrokerByIdResponse, type DIMGetBrokersResponse, type DIMGetScansMetaOptions, type DIMGetScansMetaResponse, type DIMGetScansOptions, type DIMGetScansResponse, type DIMGroupRemovalInstruction, type DIMMetaBrokers, type DIMMetaRecordData, type DIMPostScanOptions, type DIMPostScanResponse, type DIMRecordData, type DIMRemovalStatus, type DIMRiskLevel, type DIMScanDetail, type DIMScanMetaData, type DIMScanStatus, type DIMScanType, type DeceasedDetails, type DerogatoryDetails, type DisclosureItem, type DormantAccountDetails, type Employers, type EntitleCustomerResponse, type EntitledProduct, type EntitledProductStatus, type Entitlement, type EntitlementId, type EntitlementNextAction, type Entitlements, type EquifaxCollectionChangeDetails, type EquifaxNewAccountDetails, type EquifaxNewAddressDetails, type EquifaxNewBankruptcyDetails, type EquifaxNewCollectionDetails, type EquifaxNewInquiryDetails, type FicoCreditScorePlan, type FicoCreditScorePlanCompleted, type FicoCreditScorePlanNotSet, type FicoCreditScorePlanSet, type FicoScenario, type FicoScenarioVariation, type FicoScoreModelVersion, type FicoScorePlanCompleted, type FicoScorePlanCreateResponse, type FicoScorePlanRevision, type FicoScorePlanRevisionsRequest, type FicoScorePlanSet, type FicoScoreSimulator, type FicoStatement, type GetCreditAttributeResponse, type GetCreditReportByIdRequestOptions, type GetCreditReportByIdResponse, type GetCreditReportMetaByIdRequestOptions, type GetCreditReportMetaByIdResponse, type GetCreditReportMetaRequestOptions, type GetCreditReportMetaResponse, type GetCreditReportRequestOptions, type GetCreditReportResponse, type GetCreditScoreResponse, type GetProductConfigByIdResponse, type GlobalProductId, type IHSActionAnswerOption, type IHSCreatePlanResponse, type IHSDisplayParameters, type IHSFactorCategory, type IHSGetPlanRequest, type IHSGetPlanRequestActionStatus, type IHSPlan, type IHSPlanAction, type IHSPlanActionItem, type IHSPlanActionStatus, type IHSPlanPriority, type IHSPlanStatus, type IHSScoreDetails, type IHSScoreFactor, type IHSSubmitSurveyRequest, type IHSSubmitSurveyResponse, type IHSSurvey, type IHSSurveyAnswer, type IHSSurveyAnswerRequest, type IHSSurveyPriority, type IHSSurveyQuestion, type IHSSurveyQuestionItem, type IHSSurveyStatus, type IHSUpdateActionRequest, type IHSUpdateActionResponse, type IHSUpsellObject, type IHSUpsellProduct, type IdentityHealthScore, type Impact, type ImpactType, type LostOrStolenCardDetails, type MappedScoreModelVersion, type MarkCreditReportAsRead, type MarkCreditReportReadRequestOptions_V1, type MarkCreditReportReadRequestOptions_V2, type Month, type Name, type NewAccountDetails, type NewAddressDetails, type NewInquiryDetails, type OnDemandEligibility, type PastDueDetails, type PaymentHistoryCode, type PaymentHistoryCode_V2, type PaymentSummary, type PaymentSummary_V2, type PersonalAddress, type PersonalAddress_V2, type PlanCompletedProgressStatus, type PlanNotSetProgressStatus, type PlanSetProgressStatus, type PostCreditReportRequestOptions, type PostCreditReportResponse, type PostCreditScoreResponse, type ProductConfig, type ProductConfigCadenceType, type ProductConfigDeliveryType, type ProductConfigId, type ProductConfig_V2, type ProductConfigs, type ProductConfigsResponse, type ProductConfigsSearchOptions, type ProductConfigs_V2, type ProductDeliveryCadence, type ProductEligibility, type PublicRecord, type PublicRecordBankruptcyDetails, type ReadStatus, type ReportDisplay, type ReportDisplayScoreDetails, type Scenario, type ScenarioVariation, type ScoreFactor, type ScoreFactorDataPoint, type ScoreIngredient, type ScoreIngredientAttribute, type ScoreIngredientAttributeSubValueType, type ScoreIngredientAttributeValueType, type ScoreIngredientImpact, type ScoreIngredientType, type ScoreItem, type ScoreModel, type ScoreModelVersion, type ScorePlanCompleted, type ScorePlanCreateResponse, type ScorePlanRevision, type ScorePlanRevisionsRequest, type ScorePlanSet, type ScoreRange, type ScoreRating, type ScoreUpdateFrequency, type SettlementDetails, type SimulationCategoryType, type SkipCannotLocateDetails, type SpecialCommentsDetails, type Statement, type Statement_V2, type Supcontent, type TotalAlertCounts, type TransUnionAccountImprovedDetails, type TransUnionAccountInBankruptcyDetails, type TransUnionDelinquentDetails, type TransUnionNewAccountDetails, type TransUnionNewAddressDetails, type TransUnionNewInquiryDetails, type TransUnionNewPublicRecordDetails, type TransUnionPublicRecordBankruptcyDetails, type VantageCreditScorePlan, type VantageCreditScorePlanCompleted, type VantageCreditScorePlanNotSet, type VantageCreditScorePlanSet, type VantageScenario, type VantageScenarioVariation, type VantageScoreModelVersion, type VantageScorePlanCompleted, type VantageScorePlanCreateResponse, type VantageScorePlanRevision, type VantageScorePlanRevisionsRequest, type VantageScorePlanSet, type VantageScoreSimulator, type VantageStatement, createSDK, createSDK as default, isBureauAttribute, isBureauScore, isCreditAttribute, isCreditAttributeArray, isCreditAttributeV2, isCreditAttributesV2, isCreditScore, isCreditScoreArray, isCreditScoreV2, isCreditScoresV2, isFicoPlan, isFicoRevision, isFicoRevisionsRequest, isFicoScenario, isFicoScenarioVariation, isFicoSimulator, isPlanCompleted, isPlanSet, isV1GetCreditAttributesResponse, isV1GetCreditScoresResponse, isV1PostCreditScoresResponse, isV2GetCreditAttributesResponse, isV2GetCreditScoresResponse, isV2PostCreditScoresResponse, isValidApiVersion, isValidBureau, isValidBureauAttribute, isVantagePlan, isVantageRevision, isVantageRevisionsRequest, isVantageScenario, isVantageScenarioVariation, mapApiErrorTypeToSDKErrorType, mapHttpStatusToSDKErrorType };
|
|
2119
|
+
export { type Account, type AccountClosedDetails, type AccountCurrentDetails, type AccountImprovedDetails, type AccountInBankruptcyDetails, type AccountPaidDetails, type Account_V2, type Action, type ActivationRule, type Address, type Alert, type AlertCount, type AlertData, type AlertDetails, type AlertDisposition, type AlertMetadata, type Alerts, type AlternativeLoanMonitoringDetails, type AlternativeLoanRecord, type ApiClientResponse, type AttributeCategoryImpact, type AttributeCategoryName, type AttributeCategoryRating, type AttributeCategoryRatingName, type AttributeCategoryRatingScale, type AttributeCategoryRatingScaleType, type AttributeCategoryRatingScaleValue, type AttributeCategoryRatingScaleValueName, type AttributeHardInquiry, type AttributeHighCreditUtilizationAccount, type AttributeOldestOpenAccount, type AttributeRelevantScoreFactor, type AuthAnswer, type AuthAnswersRequest, type AuthCredentials, type AuthQuestion, type AuthQuestions, type AuthServiceConfig, type AuthorizationAlertDetails, type AuthorizationCompanyAddress, type AuthorizationCompanyDetail, type BaseCreditAttributeRequestOptions, type BaseCreditScoreRequestOptions, type BearerToken, type BureauAttribute, type BureauReport, type BureauReportMeta, type BureauScore, type CardOverLimitDetails, type ClosedAccountDetails, type CollectionAccount, type CollectionAccount_V2, type CollectionDetails, type Company, type ConnectedSolutionsAPIErrorData, type ConnectedSolutionsAPIErrorType, ConnectedSolutionsClientAuthenticationError, ConnectedSolutionsClientError, type ConnectedSolutionsClientErrors, type ConnectedSolutionsClientMeta, ConnectedSolutionsClientRateLimitError, type ConnectedSolutionsClientRawError, ConnectedSolutionsClientSDKError, ConnectedSolutionsClientServerSideError, ConnectedSolutionsClientSideError, type ConnectedSolutionsSDK, type ConnectedSolutionsSDKConfig, type ConnectedSolutionsSDKConfigInternal, type ConnectedSolutionsSDKErrorTypes, type ContactInfo, type CreateCustomerOptions, type CreateRegistrationsRequest, type CreateRegistrationsResponse, type CreditAttribute, type CreditAttributeCategory, type CreditAttribute_V2, type CreditAttributes, type CreditAttributes_V2, type CreditBalanceDecreaseDetails, type CreditBalanceIncreaseDetails, type CreditInquiry, type CreditLimitDecreaseDetails, type CreditLimitIncreaseDetails, type CreditLockUnlockType, type CreditReport, type CreditReportDisposition_V2, type CreditReportMeta, type CreditReportMeta_V2, type CreditReportScoreDetail, type CreditReportScoreRating, type CreditReportType, type CreditReport_V2, type CreditReportsMeta_V2, type CreditReports_V2, type CreditScore, type CreditScoreBelowGoalDetails, type CreditScoreDecreaseDetails, type CreditScoreFeaturePreferences, type CreditScoreGoalAchievedDetails, type CreditScoreIncreaseDetails, type CreditScoreIngredient, type CreditScorePlan, type CreditScorePostRequest, type CreditScoreRatingDecreaseDetails, type CreditScoreRatingIncreaseDetails, type CreditScoreSimulator, type CreditScoreSimulatorPostRequest, type CreditScoreSimulatorPostResponse, type CreditScoreTriggerReasons, type CreditScore_V2, type CreditScores_V2, type CreditUsageDecreaseDetails, type CreditUsageIncreaseDetails, type CreditorAddress, type CustomAttributes, type CustomFeatures, type Customer, type CustomerAddress, type CustomerDisclosure, type CustomerEmail, type CustomerId, type CustomerPhone, type CustomerSearchOptions, type CustomerSearchResults, type DIMBroker, type DIMBrokerDetail, type DIMBrokerGroupActionResponse, type DIMBrokerGroupDetail, type DIMBrokerScanStatus, type DIMGetBrokerByIdResponse, type DIMGetBrokersResponse, type DIMGetScansMetaOptions, type DIMGetScansMetaResponse, type DIMGetScansOptions, type DIMGetScansResponse, type DIMGroupRemovalInstruction, type DIMMetaBrokers, type DIMMetaRecordData, type DIMPostScanOptions, type DIMPostScanResponse, type DIMRecordData, type DIMRemovalStatus, type DIMRiskLevel, type DIMScanDetail, type DIMScanMetaData, type DIMScanStatus, type DIMScanType, type DeceasedDetails, type DerogatoryDetails, type DisclosureItem, type DormantAccountDetails, type Employers, type EntitleCustomerResponse, type EntitledProduct, type EntitledProductStatus, type Entitlement, type EntitlementId, type EntitlementNextAction, type Entitlements, type EquifaxCollectionChangeDetails, type EquifaxNewAccountDetails, type EquifaxNewAddressDetails, type EquifaxNewBankruptcyDetails, type EquifaxNewCollectionDetails, type EquifaxNewInquiryDetails, type FicoCreditScorePlan, type FicoCreditScorePlanCompleted, type FicoCreditScorePlanNotSet, type FicoCreditScorePlanSet, type FicoScenario, type FicoScenarioVariation, type FicoScoreModelVersion, type FicoScorePlanCompleted, type FicoScorePlanCreateResponse, type FicoScorePlanRevision, type FicoScorePlanRevisionsRequest, type FicoScorePlanSet, type FicoScoreSimulator, type FicoStatement, type GetCreditAttributeResponse, type GetCreditReportByIdRequestOptions, type GetCreditReportByIdResponse, type GetCreditReportMetaByIdRequestOptions, type GetCreditReportMetaByIdResponse, type GetCreditReportMetaRequestOptions, type GetCreditReportMetaResponse, type GetCreditReportRequestOptions, type GetCreditReportResponse, type GetCreditScoreResponse, type GetProductConfigByIdResponse, type GlobalProductId, type IHSActionAnswerOption, type IHSCreatePlanResponse, type IHSDisplayParameters, type IHSFactorCategory, type IHSGetPlanRequest, type IHSGetPlanRequestActionStatus, type IHSPlan, type IHSPlanAction, type IHSPlanActionItem, type IHSPlanActionStatus, type IHSPlanPriority, type IHSPlanStatus, type IHSScoreDetails, type IHSScoreFactor, type IHSSubmitSurveyRequest, type IHSSubmitSurveyResponse, type IHSSurvey, type IHSSurveyAnswer, type IHSSurveyAnswerRequest, type IHSSurveyPriority, type IHSSurveyQuestion, type IHSSurveyQuestionItem, type IHSSurveyStatus, type IHSUpdateActionRequest, type IHSUpdateActionResponse, type IHSUpsellObject, type IHSUpsellProduct, type IdentityHealthScore, type Impact, type ImpactType, LOCK_STATUS, type LockStatus, type LostOrStolenCardDetails, type MappedScoreModelVersion, type MarkCreditReportAsRead, type MarkCreditReportReadRequestOptions_V1, type MarkCreditReportReadRequestOptions_V2, type Month, type Name, type NewAccountDetails, type NewAddressDetails, type NewInquiryDetails, type OnDemandEligibility, type PastDueDetails, type PaymentHistoryCode, type PaymentHistoryCode_V2, type PaymentSummary, type PaymentSummary_V2, type PersonalAddress, type PersonalAddress_V2, type PlanCompletedProgressStatus, type PlanNotSetProgressStatus, type PlanSetProgressStatus, type PostCreditReportRequestOptions, type PostCreditReportResponse, type PostCreditScoreResponse, type ProductConfig, type ProductConfigCadenceType, type ProductConfigDeliveryType, type ProductConfigId, type ProductConfig_V2, type ProductConfigs, type ProductConfigsResponse, type ProductConfigsSearchOptions, type ProductConfigs_V2, type ProductDeliveryCadence, type ProductEligibility, type PublicRecord, type PublicRecordBankruptcyDetails, type ReadStatus, type ReportDisplay, type ReportDisplayScoreDetails, type Scenario, type ScenarioVariation, type ScoreFactor, type ScoreFactorDataPoint, type ScoreIngredient, type ScoreIngredientAttribute, type ScoreIngredientAttributeSubValueType, type ScoreIngredientAttributeValueType, type ScoreIngredientImpact, type ScoreIngredientType, type ScoreItem, type ScoreModel, type ScoreModelVersion, type ScorePlanCompleted, type ScorePlanCreateResponse, type ScorePlanRevision, type ScorePlanRevisionsRequest, type ScorePlanSet, type ScoreRange, type ScoreRating, type ScoreUpdateFrequency, type SettlementDetails, type SimulationCategoryType, type SkipCannotLocateDetails, type SpecialCommentsDetails, type Statement, type Statement_V2, type Supcontent, type TotalAlertCounts, type TransUnionAccountImprovedDetails, type TransUnionAccountInBankruptcyDetails, type TransUnionDelinquentDetails, type TransUnionNewAccountDetails, type TransUnionNewAddressDetails, type TransUnionNewInquiryDetails, type TransUnionNewPublicRecordDetails, type TransUnionPublicRecordBankruptcyDetails, type VantageCreditScorePlan, type VantageCreditScorePlanCompleted, type VantageCreditScorePlanNotSet, type VantageCreditScorePlanSet, type VantageScenario, type VantageScenarioVariation, type VantageScoreModelVersion, type VantageScorePlanCompleted, type VantageScorePlanCreateResponse, type VantageScorePlanRevision, type VantageScorePlanRevisionsRequest, type VantageScorePlanSet, type VantageScoreSimulator, type VantageStatement, createSDK, createSDK as default, isBureauAttribute, isBureauScore, isCreditAttribute, isCreditAttributeArray, isCreditAttributeV2, isCreditAttributesV2, isCreditScore, isCreditScoreArray, isCreditScoreV2, isCreditScoresV2, isFicoPlan, isFicoRevision, isFicoRevisionsRequest, isFicoScenario, isFicoScenarioVariation, isFicoSimulator, isPlanCompleted, isPlanSet, isV1GetCreditAttributesResponse, isV1GetCreditScoresResponse, isV1PostCreditScoresResponse, isV2GetCreditAttributesResponse, isV2GetCreditScoresResponse, isV2PostCreditScoresResponse, isValidApiVersion, isValidBureau, isValidBureauAttribute, isVantagePlan, isVantageRevision, isVantageRevisionsRequest, isVantageScenario, isVantageScenarioVariation, mapApiErrorTypeToSDKErrorType, mapHttpStatusToSDKErrorType };
|
package/dist/umd/index.umd.js
CHANGED
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* OTHER LIABILITY ARISING FROM OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS CODE.
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
-
(function(i,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(i=typeof globalThis<"u"?globalThis:i||self,l(i["@experian-ecs/connected-api-sdk"]={}))})(this,function(i){"use strict";var je=Object.defineProperty;var ee=i=>{throw TypeError(i)};var Ie=(i,l,d)=>l in i?je(i,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[l]=d;var g=(i,l,d)=>Ie(i,typeof l!="symbol"?l+"":l,d),Wt=(i,l,d)=>l.has(i)||ee("Cannot "+d);var o=(i,l,d)=>(Wt(i,l,"read from private field"),d?d.call(i):l.get(i)),y=(i,l,d)=>l.has(i)?ee("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(i):l.set(i,d),Y=(i,l,d,J)=>(Wt(i,l,"write to private field"),J?J.call(i,d):l.set(i,d),d),$=(i,l,d)=>(Wt(i,l,"access private method"),d);var j,Vt,re,Z,x,jt,m,O,tt,ne,G,I,rt,k,nt,R,B,N,M,it,ot,X,It,E,A,C,D,z,P,se,kt,ie,ce,V;function l(r){switch(r.type){case"client_side_error":return new J(r);case"authentication_error":return new Lt(r);case"server_side_error":return new Bt(r);case"rate_limit_error":return new Ft(r);default:return new Dt(r)}}class d extends Error{constructor(t){var n;super(t.message);g(this,"message");g(this,"data");g(this,"status");this.message=((n=t.data)==null?void 0:n.message)||t.message||"",this.data=t.data,this.status=t.status}}g(d,"generateError",l);class J extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSideError"}}class Lt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientAuthenticationError"}}class Bt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientServerSideError"}}class Dt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSDKError"}}class Ft extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientRateLimitError"}}function ut(r){switch(r){case"CLIENT_SIDE_ERROR":return"client_side_error";case"AUTHENTICATION_ERROR":return"authentication_error";case"RATE_LIMIT_ERROR":return"rate_limit_error";case"SERVER_SIDE_ERROR":return"server_side_error";default:return"sdk_error"}}function dt(r){return r===401?"authentication_error":r===429?"rate_limit_error":r&&r>=500?"server_side_error":r&&r>=400?"client_side_error":"sdk_error"}const Jt={PRODUCTION:"https://connected-api.experian.com",SANDBOX:"https://sandbox.connected-api.experian.com",UAT:"https://uat.connected-api.experian.com",INTEGRATION:"https://integration.connected-api.experian.com",DEVELOPMENT:"https://develop.connected-api.experian.com"},oe={PRODUCTION:"https://unity-contentstack.integration.us-exp-api.experiancs.com",SANDBOX:"https://unity-contentstack.dev.us-exp-api.experiancs.com",UAT:"https://unity-contentstack.dev.us-exp-api.experiancs.com",INTEGRATION:"https://unity-contentstack.dev.us-exp-api.experiancs.com",DEVELOPMENT:"https://unity-contentstack.dev.us-exp-api.experiancs.com"};class _{constructor(e){y(this,j);g(this,"config");g(this,"baseUrl","");g(this,"contentstackUrl","");const n=e.environment??"PRODUCTION";this.config=e,this.baseUrl=Jt[n],this.contentstackUrl=oe[n]}setConfig(e){"environment"in e&&(this.config.environment=e.environment),"token"in e&&(this.config.token=e.token)}async fetchWithAuth(e,t){try{$(this,j,Vt).call(this);const n=typeof Headers<"u"&&new Headers(t==null?void 0:t.headers);n&&!n.Authorization&&n.set("Authorization",`Bearer ${this.config.token}`);const s={...t,headers:n||(t==null?void 0:t.headers)||{}};return await this.fetchRequest(e,s)}catch(n){const s=n;return{data:void 0,error:s,meta:{status:s.status??500,statusText:s.message??""}}}}async fetchRequest(e,t){var n;try{$(this,j,Vt).call(this);const s=await fetch(e,t);if(!(s!=null&&s.ok)){let u;const h={type:"sdk_error",status:s==null?void 0:s.status,message:s==null?void 0:s.statusText};if((n=s==null?void 0:s.headers.get("content-type"))!=null&&n.includes("application/json")){const S=await s.clone().json();h.data=S.error,h.type=ut(S.error.type)}else h.type=dt(s==null?void 0:s.status);throw d.generateError(h)}return $(this,j,re).call(this,s)?{data:await s.clone().json(),error:void 0,meta:{status:s.status,statusText:s.statusText}}:{data:void 0,error:void 0,meta:{status:s.status,statusText:s.statusText}}}catch(s){const c=s;return{data:void 0,error:c,meta:{status:c.status??500,statusText:c.message}}}}}j=new WeakSet,Vt=function(){if(!this.config.token){const e={type:"sdk_error",message:"You must first obtain and set a token before using an SDK method"};throw d.generateError(e)}},re=function(e){var t,n;return((t=e==null?void 0:e.headers.get("content-type"))==null?void 0:t.includes("application/json"))||((n=e==null?void 0:e.headers.get("content-type"))==null?void 0:n.includes("application/octet-stream"))};const q=class q extends _{constructor(t){super(t);y(this,x)}async getCreditScores(t,n){const s=t==null?void 0:t.version,c=$(this,x,jt).call(this,s),a={...t!=null&&t.product_config_id?{product_config_id:t.product_config_id}:{},...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",f=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth(f,n)}async orderCreditScore(t,n){const s=t.version,c=$(this,x,jt).call(this,s),a={...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",f=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth(f,{method:"POST",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...n??{}})}};Z=new WeakMap,x=new WeakSet,jt=function(t="v1"){return`/${t}${o(q,Z)}`},y(q,Z,"/credit/scores");let ht=q;const b=class b extends _{constructor(e){super(e)}async getEntitlements(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(b,m)}?customer_id=${e.customer_id}`,t)}async getEntitlementById({entitlement_id:e},t){return this.fetchWithAuth(`${this.baseUrl}${o(b,m)}/${e}`,t)}async createEntitlement(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(b,m)}`,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}async updateEntitlement(e,t){const{entitlement_id:n,...s}=e;return this.fetchWithAuth(`${this.baseUrl}${o(b,m)}/${n}`,{method:"PUT",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}async deleteEntitlement({entitlement_id:e},t){return this.fetchWithAuth(`${this.baseUrl}${o(b,m)}/${e}`,{method:"DELETE",...t??{}})}async activateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(b,m)}/${e}/activate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async deactivateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(b,m)}/${e}/deactivate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async entitleCustomerToNewProduct(e,t){const{product_config_id:n,entitlement_id:s,customer_id:c}=e,a=`${this.baseUrl}${o(b,m)}/${s}/products/${n}/activate`;return this.fetchWithAuth(a,{method:"POST",...t??{},headers:{...(t==null?void 0:t.headers)??{},"X-Customer-ID":c}})}async activateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,m)}/${s}/products/${n}/activate`;return this.fetchWithAuth(c,{method:"POST",...t??{}})}async deactivateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,m)}/${s}/products/${n}/deactivate`;return this.fetchWithAuth(c,{method:"POST",...t??{}})}async removeProductFromEntitlement(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,m)}/${s}/products/${n}`;return this.fetchWithAuth(c,{method:"DELETE",...t??{}})}async getProductEligibility(e,t){const n=new URLSearchParams(e).toString(),s=`${this.baseUrl}${o(b,m)}/eligibility?${n}`;return this.fetchWithAuth(s,t)}};m=new WeakMap,y(b,m,"/v1/entitlements");let lt=b;const et=class et extends _{constructor(t){super(t);y(this,tt)}async getCreditAttributes(t,n){const s=t==null?void 0:t.version,c=$(this,tt,ne).call(this,s),a=`${this.baseUrl}${c}`;return this.fetchWithAuth(a,n)}};O=new WeakMap,tt=new WeakSet,ne=function(t="v1"){return`/${t}${o(et,O)}`},y(et,O,"/credit/attributes");let yt=et;const K=class K extends _{constructor(e){super(e)}async getSimulations(e,t){const n={...e,...e!=null&&e.run_all?{run_all:e.run_all.toString()}:{}},s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(K,G)}${c}`;return this.fetchWithAuth(a,t)}async simulateScenario(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"";return this.fetchWithAuth(`${this.baseUrl}${o(K,G)}${a}`,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}};G=new WeakMap,y(K,G,"/v1/credit/tools/simulator");let gt=K;const v=class v extends _{constructor(e){super(e)}async getCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(v,I)}${s}`;return this.fetchWithAuth(c,{...t??{}})}async createCreditScorePlan(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"",u=`${this.baseUrl}${o(v,I)}${a}`;return this.fetchWithAuth(u,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}async deleteCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(v,I)}${s}`;return this.fetchWithAuth(c,{method:"DELETE",...t??{}})}async getCreditScorePlanRevisions(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"",u=`${this.baseUrl}${o(v,I)}${o(v,rt)}${a}`;return this.fetchWithAuth(u,{method:"POST",body:JSON.stringify(s),headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};I=new WeakMap,rt=new WeakMap,y(v,I,"/v1/credit/tools/planners"),y(v,rt,"/revisions");let ft=v;const L=class L extends _{constructor(e){super(e)}async getAlerts(e,t){const n={page_limit:"10",next_page_token:"",...e??{}},s=new URLSearchParams(n).toString(),c=`${this.baseUrl}${o(L,k)}?${s}`;return this.fetchWithAuth(c,t)}async getAlertById({id:e},t){const n=`${this.baseUrl}${o(L,k)}/${e}`;return this.fetchWithAuth(n,t)}async markAlertAsRead({id:e},t){const n=`${this.baseUrl}${o(L,k)}/${e}/dispose`;return this.fetchWithAuth(n,{method:"PATCH",...t??{}})}async getAlertCounts(e){const t=`${this.baseUrl}${o(L,k)}/counts`;return this.fetchWithAuth(t,e)}};k=new WeakMap,y(L,k,"/v1/events-alerts");let $t=L;function xt(r){return!(r!=null&&r.version)||(r==null?void 0:r.version)==="v1"}function ae(r){return(r==null?void 0:r.version)==="v2"}function Gt(r){return r!==void 0&&xt(r)&&"include_fields"in r&&typeof r.include_fields=="string"}function ue(r){return r!==void 0&&xt(r)&&("include_fields"in r&&typeof r.include_fields=="string"||"report_date"in r&&typeof r.report_date=="string"||"product_config_id"in r&&typeof r.product_config_id=="string"||"report_between"in r&&typeof r.report_between=="string")}function de(r){return r!==void 0&&ae(r)&&("product_config_id"in r&&typeof r.product_config_id=="string"||"report_between"in r&&typeof r.report_between=="string")}const st=class st extends _{constructor(t){super(t);y(this,R)}async getReports(t,n){const s=t==null?void 0:t.version,c=$(this,R,B).call(this,s),a={};ue(t)&&(t.report_between&&(a.report_between=t.report_between.toString()),t.include_fields&&(a.include_fields=t.include_fields.toString()),t.report_date&&(a.report_date=t.report_date.toString()),t.product_config_id&&(a.product_config_id=t.product_config_id.toString())),de(t)&&(t.product_config_id&&(a.product_config_id=t.product_config_id.toString()),t.report_between&&(a.report_between=t.report_between.toString()));const u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",f=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth(f,n)}async getReportById(t,n){const{id:s,version:c}=t,a=$(this,R,B).call(this,c),u={};Gt(t)&&(u.include_fields=t.include_fields.toString());const h=new URLSearchParams(u).toString(),f=h?`?${h}`:"",S=`${this.baseUrl}${a}/${s}${f}`;return this.fetchWithAuth(S,n)}async getReportsMeta(t,n){const{version:s,latest_only:c,report_read:a,...u}=t??{},h=$(this,R,B).call(this,s),f={...u??{},...c?{latest_only:c.toString()}:{},...a?{report_read:a.toString()}:{}},S=new URLSearchParams(f).toString(),U=S?`?${S}`:"",Nt=`${this.baseUrl}${h}/meta${U}`;return this.fetchWithAuth(Nt,n)}async getReportMetaById(t,n){const{id:s,version:c,...a}=t,u=$(this,R,B).call(this,c),h=new URLSearchParams(a).toString(),f=h?`?${h}`:"",S=`${this.baseUrl}${u}/${s}/meta${f}`;return this.fetchWithAuth(S,n)}async markReportAsRead(t,n){const{id:s,version:c}=t,a=$(this,R,B).call(this,c),u=`${this.baseUrl}${a}`;if(c==="v2"){const f=`${u}/${s}/disposition`,S=t;return this.fetchWithAuth(f,{method:"PATCH",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({disposition:S.disposition}),...n??{}})}const h=`${u}/${s}/read`;return this.fetchWithAuth(h,{method:"PUT",...n??{}})}async orderReport(t,n){const s={},c=t==null?void 0:t.version,a=$(this,R,B).call(this,c);Gt(t)&&(s.include_fields=t.include_fields.toString());const u=new URLSearchParams(s).toString(),h=u?`?${u}`:"",f=`${this.baseUrl}${a}${h}`;return this.fetchWithAuth(f,{method:"POST",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...n??{}})}};nt=new WeakMap,R=new WeakSet,B=function(t="v1"){return`/${t}${o(st,nt)}`},y(st,nt,"/credit/reports");let mt=st;const W=class W extends _{constructor(e){super(e)}async getCustomerById(e,t){const n=`${this.baseUrl}${o(W,N)}/${e.customer_id}`;return this.fetchWithAuth(n,t)}async updateCustomer(e,t){const{customer_id:n,...s}=e,c=`${this.baseUrl}${o(W,N)}/${n}`;return this.fetchWithAuth(c,{method:"PATCH",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s??{}),...t??{}})}async deleteCustomer(e,t){const n=`${this.baseUrl}${o(W,N)}/${e.customer_id}`;return this.fetchWithAuth(n,{method:"DELETE",...t??{}})}async createCustomer(e,t){const n=`${this.baseUrl}${o(W,N)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e??{}),...t??{}})}async searchCustomers(e,t){const{next_cursor:n="",...s}=e,c=`${this.baseUrl}${o(W,N)}/search`;return this.fetchWithAuth(c,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({next_cursor:n,...s??{}}),...t??{}})}};N=new WeakMap,y(W,N,"/v1/customers");let bt=W;const H=class H extends _{constructor(e){super(e)}async getAuthQuestions(e){const t=`${this.baseUrl}${o(H,M)}/questions`;return this.fetchWithAuth(t,e)}async submitAuthAnswers(e,t){const n=`${this.baseUrl}${o(H,M)}/questions`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}};M=new WeakMap,y(H,M,"/v1/authentication");let St=H;const ct=class ct extends _{constructor(e){super(e)}async createRegistration(e,t){const n=`${this.baseUrl}${o(ct,it)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e??{}),...t??{}})}};it=new WeakMap,y(ct,it,"/v1/registrations");let _t=ct;const at=class at extends _{constructor(t){super(t);y(this,X)}async getProductConfigs(t,n){const{fromEntries:s,entries:c}=Object,{isArray:a}=Array,u=t==null?void 0:t.version,h=$(this,X,It).call(this,u),{version:f,...S}=s(c(t).filter(([te,F])=>F!=null).map(([te,F])=>[te,a(F)?F.join(","):F.toString()])),U=new URLSearchParams(S).toString(),Nt=U?`?${U}`:"",Ve=`${this.baseUrl}${h}${Nt}`;return this.fetchWithAuth(Ve,{...n||{}})}async getProductConfigById(t,n){const s=t==null?void 0:t.version,c=$(this,X,It).call(this,s),a=`${this.baseUrl}${c}/${t.product_config_id}`;return this.fetchWithAuth(a,{...n??{}})}};ot=new WeakMap,X=new WeakSet,It=function(t="v1"){return`/${t}${o(at,ot)}`},y(at,ot,"/product-configs");let At=at;const p=class p extends _{constructor(e){super(e)}async getSurvey(e){const t=`${this.baseUrl}${o(p,E)}/surveys`;return this.fetchWithAuth(t,e)}async submitSurvey(e,t){const n=`${this.baseUrl}${o(p,E)}/surveys`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}async getScore(e){const t=`${this.baseUrl}${o(p,E)}/scores?latest=TRUE`;return this.fetchWithAuth(t,e)}async getPlan(e,t){const n={action_status:e.action_status,...e.cursor?{cursor:e.cursor}:{},...e.count?{count:e.count.toString()}:{}},s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(p,E)}/plans${c}`;return this.fetchWithAuth(a,t)}async createPlan(e){const t=`${this.baseUrl}${o(p,E)}/plans`;return this.fetchWithAuth(t,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({}),...e??{}})}async updateAction(e,t){const{action_id:n,...s}=e,c=`${this.baseUrl}${o(p,E)}/plans/actions/${n}`;return this.fetchWithAuth(c,{method:"PUT",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}};E=new WeakMap,y(p,E,"/v1/ihs");let Tt=p;const T=class T extends _{constructor(e){super(e)}async createScan(e,t){const n=`${this.baseUrl}${o(T,A)}/scans`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:e.product_config_id}),...t??{}})}async getScans(e,t){const n={};e!=null&&e.product_config_id&&(n.product_config_id=e.product_config_id),e!=null&&e.scan_between&&(n.scan_between=e.scan_between),e!=null&&e.cursor&&(n.cursor=e.cursor),e!=null&&e.count&&(n.count=e.count.toString());const s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans${c}`;return this.fetchWithAuth(a,t)}async getScanById(e,t){const n=`${this.baseUrl}${o(T,A)}/scans/${e.scanId}`;return this.fetchWithAuth(n,t)}async getScansMetadata(e,t){const n={};e!=null&&e.product_config_id&&(n.product_config_id=e.product_config_id),e!=null&&e.scan_between&&(n.scan_between=e.scan_between),e!=null&&e.most_recent&&(n.most_recent="TRUE");const s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans/meta${c}`;return this.fetchWithAuth(a,t)}async getBrokers(e){const t=`${this.baseUrl}${o(T,A)}/brokers`;return this.fetchWithAuth(t,e)}async getBrokerById(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/${e.brokerId}`;return this.fetchWithAuth(n,t)}async getBrokersByScanId(e,t){const n=`${this.baseUrl}${o(T,A)}/scans/${e.scanId}/brokers`;return this.fetchWithAuth(n,t)}async getBrokersByGroupId(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/groups/${e.groupId}`;return this.fetchWithAuth(n,t)}async updateBrokerGroupAction(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/groups/${e.groupId}/action`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};A=new WeakMap,y(T,A,"/v1/dim");let Ct=T;const Pt=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:$t,CreditAttributesService:yt,CreditReportsService:mt,CreditScorePlannerService:ft,CreditScoreSimulatorService:gt,CreditScoresService:ht,CustomerAuthService:St,CustomersService:bt,DigitalIdentityManagerService:Ct,EntitlementsService:lt,IdentityHealthScoreService:Tt,ProductConfigsService:At,RegistrationsService:_t},Symbol.toStringTag,{value:"Module"}));function he(r){return`${r[0].toLowerCase()}${r.substring(1)}`.replace("Service","")}const le=typeof process<"u"&&process.versions&&process.versions.node&&typeof window>"u",Q=class Q{constructor(e){y(this,P);g(this,"config");y(this,C);y(this,D,null);g(this,"baseUrl","");this.config=e,this.baseUrl=Jt[e.environment??"PRODUCTION"],Y(this,C,new Map)}async getAccessToken(e){if(!le)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await $(this,P,se).call(this,e),errors:void 0,meta:{status:200,statusText:"OK"}}}catch(n){return this.clearCache(),{data:void 0,error:n,meta:{status:n.status,statusText:n.message}}}}getCacheLength(){return o(this,C).size}clearCache(){const e=`${this.baseUrl}${o(Q,z)}`,t=Array.from(o(this,C).keys()).filter(n=>n.includes(e));for(const n of t)o(this,C).delete(n)}};C=new WeakMap,D=new WeakMap,z=new WeakMap,P=new WeakSet,se=async function({grantType:e,clientId:t,clientSecret:n,customerId:s}){var f;$(this,P,ie).call(this);const c=`${this.baseUrl}${o(Q,z)}`,a={method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({grant_type:e,client_id:t,client_secret:n,...e==="trusted_partner"?{partner_customer_id:s??""}:{}})},u=await $(this,P,ce).call(this,c,a);if(u!=null&&u.ok){const U=await u.clone().json();return o(this,D)===null&&$(this,P,kt).call(this,U.expires_in),U}const h={type:"sdk_error",status:u==null?void 0:u.status,message:(u==null?void 0:u.statusText)||"",data:void 0};if((f=u==null?void 0:u.headers.get("content-type"))!=null&&f.includes("application/json")){const U=await u.clone().json();h.data=U.error,h.type=ut(U.error.type)}else h.type=dt(u==null?void 0:u.status);throw d.generateError(h)},kt=function(e){const t=new Date().getTime(),n=60*60*1e3,s=t+n,c=e===null?e:new Date(s).valueOf();Y(this,D,c)},ie=function(){const e=new Date(Date.now()),t=new Date(o(this,D)??Number.NaN);ye(e,t)&&($(this,P,kt).call(this,null),o(this,C).clear())},ce=async function(e,t){const n=`${e}${JSON.stringify(t||{})}`;if(!o(this,C).has(n)){const s=fetch(e,t??{});o(this,C).set(n,s)}return await o(this,C).get(n)},y(Q,z,"/v1/oauth2/token");let Ut=Q;function ye(r,e){return r>e}const w=class w extends _{constructor(t){super(t);g(this,"alerts");g(this,"auth");g(this,"creditReports");g(this,"creditScores");g(this,"creditAttributes");g(this,"creditScorePlanner");g(this,"creditScoreSimulator");g(this,"customerAuth");g(this,"customers");g(this,"entitlements");g(this,"productConfigs");g(this,"registrations");g(this,"identityHealthScore");g(this,"digitalIdentityManager");for(const n in Pt)typeof Pt[n]=="function"&&(this[he(n)]=new Pt[n](t));this.auth=new Ut({environment:t.environment})}static getInstance(t){return o(w,V)||Y(w,V,new w(t)),o(w,V)}static clearInstance(){Y(w,V,null)}};V=new WeakMap,y(w,V,null);let vt=w;function Kt(r){return vt.getInstance(r)}function Mt(r){return r.progress_status==="TARGET_NOT_MET"||r.progress_status==="COMPLETED"}function ge(r){return Mt(r)||r.progress_status==="TARGET_SCORE_AND_PLAN_SET"||r.progress_status==="ON_TRACK"||r.progress_status==="OFF_TRACK"}function fe(r){return r.score_model.includes("VANTAGE")}function $e(r){return r.score_model.includes("FICO")}function me(r){return r.target_score!==void 0}function be(r){return r.max_actions_per_plan!==void 0}function Se(r){return r.score_model.includes("FICO")}function _e(r){return r.score_model.includes("VANTAGE")}function Ae(r){return!!(r&&"best_action"in r)}function Te(r){return!!(r&&"simulated_score"in r)}function Ce(r){return!("simulated_score"in r)}function Pe(r){return!!(r&&"slider_min_value"in r&&"slider_max_value"in r)}function Ue(r){return!!(r&&"value"in r&&"simulated_score"in r)}function ve(r){return r==="v1"||r==="v2"}function Rt(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.score_id=="string"&&pt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function Et(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.id=="string"&&Array.isArray(e.bureau_scores)&&e.bureau_scores.every(t=>Ht(t))}function Ht(r){if(typeof r!="object"||r===null)return!1;const e=r;return pt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function pt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function Xt(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>Et(e))}function zt(r){return Array.isArray(r)&&r.every(e=>Rt(e))}function Re(r){return zt(r)}function Ee(r){return Xt(r)}function pe(r){return Rt(r)}function we(r){return Et(r)}function Qt(r){if(typeof r!="object"||r===null)return!1;const e=r;return wt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function Yt(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.id=="string"&&Array.isArray(e.bureau_attributes)&&e.bureau_attributes.every(t=>Zt(t))}function Zt(r){if(typeof r!="object"||r===null)return!1;const e=r;return wt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function wt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function qt(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>Yt(e))}function Ot(r){return Array.isArray(r)&&r.every(e=>Qt(e))}function Ne(r){return Ot(r)}function We(r){return qt(r)}i.ConnectedSolutionsClientAuthenticationError=Lt,i.ConnectedSolutionsClientError=d,i.ConnectedSolutionsClientRateLimitError=Ft,i.ConnectedSolutionsClientSDKError=Dt,i.ConnectedSolutionsClientServerSideError=Bt,i.ConnectedSolutionsClientSideError=J,i.createSDK=Kt,i.default=Kt,i.isBureauAttribute=Zt,i.isBureauScore=Ht,i.isCreditAttribute=Qt,i.isCreditAttributeArray=Ot,i.isCreditAttributeV2=Yt,i.isCreditAttributesV2=qt,i.isCreditScore=Rt,i.isCreditScoreArray=zt,i.isCreditScoreV2=Et,i.isCreditScoresV2=Xt,i.isFicoPlan=$e,i.isFicoRevision=Se,i.isFicoRevisionsRequest=me,i.isFicoScenario=Ce,i.isFicoScenarioVariation=Pe,i.isFicoSimulator=Ae,i.isPlanCompleted=Mt,i.isPlanSet=ge,i.isV1GetCreditAttributesResponse=Ne,i.isV1GetCreditScoresResponse=Re,i.isV1PostCreditScoresResponse=pe,i.isV2GetCreditAttributesResponse=We,i.isV2GetCreditScoresResponse=Ee,i.isV2PostCreditScoresResponse=we,i.isValidApiVersion=ve,i.isValidBureau=pt,i.isValidBureauAttribute=wt,i.isVantagePlan=fe,i.isVantageRevision=_e,i.isVantageRevisionsRequest=be,i.isVantageScenario=Te,i.isVantageScenarioVariation=Ue,i.mapApiErrorTypeToSDKErrorType=ut,i.mapHttpStatusToSDKErrorType=dt,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
15
|
+
(function(i,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(i=typeof globalThis<"u"?globalThis:i||self,l(i["@experian-ecs/connected-api-sdk"]={}))})(this,function(i){"use strict";var Be=Object.defineProperty;var se=i=>{throw TypeError(i)};var De=(i,l,d)=>l in i?Be(i,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[l]=d;var g=(i,l,d)=>De(i,typeof l!="symbol"?l+"":l,d),kt=(i,l,d)=>l.has(i)||se("Cannot "+d);var o=(i,l,d)=>(kt(i,l,"read from private field"),d?d.call(i):l.get(i)),y=(i,l,d)=>l.has(i)?se("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(i):l.set(i,d),q=(i,l,d,K)=>(kt(i,l,"write to private field"),K?K.call(i,d):l.set(i,d),d),f=(i,l,d)=>(kt(i,l,"access private method"),d);var j,Lt,ie,O,G,It,S,et,rt,ce,M,k,st,L,it,E,B,N,X,ot,ut,Q,Bt,R,A,D,C,F,Y,P,oe,Dt,ae,ue,V;function l(r){switch(r.type){case"client_side_error":return new K(r);case"authentication_error":return new Jt(r);case"server_side_error":return new Ft(r);case"rate_limit_error":return new Kt(r);default:return new xt(r)}}class d extends Error{constructor(t){var n;super(t.message);g(this,"message");g(this,"data");g(this,"status");this.message=((n=t.data)==null?void 0:n.message)||t.message||"",this.data=t.data,this.status=t.status}}g(d,"generateError",l);class K extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSideError"}}class Jt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientAuthenticationError"}}class Ft extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientServerSideError"}}class xt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSDKError"}}class Kt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientRateLimitError"}}function ht(r){switch(r){case"CLIENT_SIDE_ERROR":return"client_side_error";case"AUTHENTICATION_ERROR":return"authentication_error";case"RATE_LIMIT_ERROR":return"rate_limit_error";case"SERVER_SIDE_ERROR":return"server_side_error";default:return"sdk_error"}}function lt(r){return r===401?"authentication_error":r===429?"rate_limit_error":r&&r>=500?"server_side_error":r&&r>=400?"client_side_error":"sdk_error"}const Gt={PRODUCTION:"https://connected-api.experian.com",SANDBOX:"https://sandbox.connected-api.experian.com",UAT:"https://uat.connected-api.experian.com",INTEGRATION:"https://integration.connected-api.experian.com",DEVELOPMENT:"https://develop.connected-api.experian.com"},de={PRODUCTION:"https://unity-contentstack.integration.us-exp-api.experiancs.com",SANDBOX:"https://unity-contentstack.dev.us-exp-api.experiancs.com",UAT:"https://unity-contentstack.dev.us-exp-api.experiancs.com",INTEGRATION:"https://unity-contentstack.dev.us-exp-api.experiancs.com",DEVELOPMENT:"https://unity-contentstack.dev.us-exp-api.experiancs.com"};class m{constructor(e){y(this,j);g(this,"config");g(this,"baseUrl","");g(this,"contentstackUrl","");const n=e.environment??"PRODUCTION";this.config=e,this.baseUrl=Gt[n],this.contentstackUrl=de[n]}setConfig(e){"environment"in e&&(this.config.environment=e.environment),"token"in e&&(this.config.token=e.token)}async fetchWithAuth(e,t){try{f(this,j,Lt).call(this);const n=typeof Headers<"u"&&new Headers(t==null?void 0:t.headers);n&&!n.Authorization&&n.set("Authorization",`Bearer ${this.config.token}`);const s={...t,headers:n||(t==null?void 0:t.headers)||{}};return await this.fetchRequest(e,s)}catch(n){const s=n;return{data:void 0,error:s,meta:{status:s.status??500,statusText:s.message??""}}}}async fetchRequest(e,t){var n;try{f(this,j,Lt).call(this);const s=await fetch(e,t);if(!(s!=null&&s.ok)){let u;const h={type:"sdk_error",status:s==null?void 0:s.status,message:s==null?void 0:s.statusText};if((n=s==null?void 0:s.headers.get("content-type"))!=null&&n.includes("application/json")){const _=await s.clone().json();h.data=_.error,h.type=ht(_.error.type)}else h.type=lt(s==null?void 0:s.status);throw d.generateError(h)}return f(this,j,ie).call(this,s)?{data:await s.clone().json(),error:void 0,meta:{status:s.status,statusText:s.statusText}}:{data:void 0,error:void 0,meta:{status:s.status,statusText:s.statusText}}}catch(s){const c=s;return{data:void 0,error:c,meta:{status:c.status??500,statusText:c.message}}}}}j=new WeakSet,Lt=function(){if(!this.config.token){const e={type:"sdk_error",message:"You must first obtain and set a token before using an SDK method"};throw d.generateError(e)}},ie=function(e){var t,n;return((t=e==null?void 0:e.headers.get("content-type"))==null?void 0:t.includes("application/json"))||((n=e==null?void 0:e.headers.get("content-type"))==null?void 0:n.includes("application/octet-stream"))};const tt=class tt extends m{constructor(t){super(t);y(this,G)}async getCreditScores(t,n){const s=t==null?void 0:t.version,c=f(this,G,It).call(this,s),a={...t!=null&&t.product_config_id?{product_config_id:t.product_config_id}:{},...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",$=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth($,n)}async orderCreditScore(t,n){const s=t.version,c=f(this,G,It).call(this,s),a={...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",$=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth($,{method:"POST",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...n??{}})}};O=new WeakMap,G=new WeakSet,It=function(t="v1"){return`/${t}${o(tt,O)}`},y(tt,O,"/credit/scores");let yt=tt;const b=class b extends m{constructor(e){super(e)}async getEntitlements(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(b,S)}?customer_id=${e.customer_id}`,t)}async getEntitlementById({entitlement_id:e},t){return this.fetchWithAuth(`${this.baseUrl}${o(b,S)}/${e}`,t)}async createEntitlement(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(b,S)}`,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}async updateEntitlement(e,t){const{entitlement_id:n,...s}=e;return this.fetchWithAuth(`${this.baseUrl}${o(b,S)}/${n}`,{method:"PUT",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}async deleteEntitlement({entitlement_id:e},t){return this.fetchWithAuth(`${this.baseUrl}${o(b,S)}/${e}`,{method:"DELETE",...t??{}})}async activateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(b,S)}/${e}/activate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async deactivateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(b,S)}/${e}/deactivate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async entitleCustomerToNewProduct(e,t){const{product_config_id:n,entitlement_id:s,customer_id:c}=e,a=`${this.baseUrl}${o(b,S)}/${s}/products/${n}/activate`;return this.fetchWithAuth(a,{method:"POST",...t??{},headers:{...(t==null?void 0:t.headers)??{},"X-Customer-ID":c}})}async activateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,S)}/${s}/products/${n}/activate`;return this.fetchWithAuth(c,{method:"POST",...t??{}})}async deactivateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,S)}/${s}/products/${n}/deactivate`;return this.fetchWithAuth(c,{method:"POST",...t??{}})}async removeProductFromEntitlement(e,t){const{product_config_id:n,entitlement_id:s}=e,c=`${this.baseUrl}${o(b,S)}/${s}/products/${n}`;return this.fetchWithAuth(c,{method:"DELETE",...t??{}})}async getProductEligibility(e,t){const n=new URLSearchParams(e).toString(),s=`${this.baseUrl}${o(b,S)}/eligibility?${n}`;return this.fetchWithAuth(s,t)}};S=new WeakMap,y(b,S,"/v1/entitlements");let gt=b;const nt=class nt extends m{constructor(t){super(t);y(this,rt)}async getCreditAttributes(t,n){const s=t==null?void 0:t.version,c=f(this,rt,ce).call(this,s),a=`${this.baseUrl}${c}`;return this.fetchWithAuth(a,n)}};et=new WeakMap,rt=new WeakSet,ce=function(t="v1"){return`/${t}${o(nt,et)}`},y(nt,et,"/credit/attributes");let $t=nt;const H=class H extends m{constructor(e){super(e)}async getSimulations(e,t){const n={...e,...e!=null&&e.run_all?{run_all:e.run_all.toString()}:{}},s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(H,M)}${c}`;return this.fetchWithAuth(a,t)}async simulateScenario(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"";return this.fetchWithAuth(`${this.baseUrl}${o(H,M)}${a}`,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}};M=new WeakMap,y(H,M,"/v1/credit/tools/simulator");let ft=H;const p=class p extends m{constructor(e){super(e)}async getCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(p,k)}${s}`;return this.fetchWithAuth(c,{...t??{}})}async createCreditScorePlan(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"",u=`${this.baseUrl}${o(p,k)}${a}`;return this.fetchWithAuth(u,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}async deleteCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(p,k)}${s}`;return this.fetchWithAuth(c,{method:"DELETE",...t??{}})}async getCreditScorePlanRevisions(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),a=c?`?${c}`:"",u=`${this.baseUrl}${o(p,k)}${o(p,st)}${a}`;return this.fetchWithAuth(u,{method:"POST",body:JSON.stringify(s),headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};k=new WeakMap,st=new WeakMap,y(p,k,"/v1/credit/tools/planners"),y(p,st,"/revisions");let mt=p;const I=class I extends m{constructor(e){super(e)}async getAlerts(e,t){const n={page_limit:"10",next_page_token:"",...e??{}},s=new URLSearchParams(n).toString(),c=`${this.baseUrl}${o(I,L)}?${s}`;return this.fetchWithAuth(c,t)}async getAlertById({id:e},t){const n=`${this.baseUrl}${o(I,L)}/${e}`;return this.fetchWithAuth(n,t)}async markAlertAsRead({id:e},t){const n=`${this.baseUrl}${o(I,L)}/${e}/dispose`;return this.fetchWithAuth(n,{method:"PATCH",...t??{}})}async getAlertCounts(e){const t=`${this.baseUrl}${o(I,L)}/counts`;return this.fetchWithAuth(t,e)}};L=new WeakMap,y(I,L,"/v1/events-alerts");let St=I;function Mt(r){return!(r!=null&&r.version)||(r==null?void 0:r.version)==="v1"}function he(r){return(r==null?void 0:r.version)==="v2"}function Ht(r){return r!==void 0&&Mt(r)&&"include_fields"in r&&typeof r.include_fields=="string"}function le(r){return r!==void 0&&Mt(r)&&("include_fields"in r&&typeof r.include_fields=="string"||"report_date"in r&&typeof r.report_date=="string"||"product_config_id"in r&&typeof r.product_config_id=="string"||"report_between"in r&&typeof r.report_between=="string")}function ye(r){return r!==void 0&&he(r)&&("product_config_id"in r&&typeof r.product_config_id=="string"||"report_between"in r&&typeof r.report_between=="string")}const ct=class ct extends m{constructor(t){super(t);y(this,E)}async getReports(t,n){const s=t==null?void 0:t.version,c=f(this,E,B).call(this,s),a={};le(t)&&(t.report_between&&(a.report_between=t.report_between.toString()),t.include_fields&&(a.include_fields=t.include_fields.toString()),t.report_date&&(a.report_date=t.report_date.toString()),t.product_config_id&&(a.product_config_id=t.product_config_id.toString())),ye(t)&&(t.product_config_id&&(a.product_config_id=t.product_config_id.toString()),t.report_between&&(a.report_between=t.report_between.toString()));const u=new URLSearchParams(a).toString(),h=u?`?${u}`:"",$=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth($,n)}async getReportById(t,n){const{id:s,version:c}=t,a=f(this,E,B).call(this,c),u={};Ht(t)&&(u.include_fields=t.include_fields.toString());const h=new URLSearchParams(u).toString(),$=h?`?${h}`:"",_=`${this.baseUrl}${a}/${s}${$}`;return this.fetchWithAuth(_,n)}async getReportsMeta(t,n){const{version:s,latest_only:c,report_read:a,...u}=t??{},h=f(this,E,B).call(this,s),$={...u??{},...c?{latest_only:c.toString()}:{},...a?{report_read:a.toString()}:{}},_=new URLSearchParams($).toString(),U=_?`?${_}`:"",jt=`${this.baseUrl}${h}/meta${U}`;return this.fetchWithAuth(jt,n)}async getReportMetaById(t,n){const{id:s,version:c,...a}=t,u=f(this,E,B).call(this,c),h=new URLSearchParams(a).toString(),$=h?`?${h}`:"",_=`${this.baseUrl}${u}/${s}/meta${$}`;return this.fetchWithAuth(_,n)}async markReportAsRead(t,n){const{id:s,version:c}=t,a=f(this,E,B).call(this,c),u=`${this.baseUrl}${a}`;if(c==="v2"){const $=`${u}/${s}/disposition`,_=t;return this.fetchWithAuth($,{method:"PATCH",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({disposition:_.disposition}),...n??{}})}const h=`${u}/${s}/read`;return this.fetchWithAuth(h,{method:"PUT",...n??{}})}async orderReport(t,n){const s={},c=t==null?void 0:t.version,a=f(this,E,B).call(this,c);Ht(t)&&(s.include_fields=t.include_fields.toString());const u=new URLSearchParams(s).toString(),h=u?`?${u}`:"",$=`${this.baseUrl}${a}${h}`;return this.fetchWithAuth($,{method:"POST",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...n??{}})}};it=new WeakMap,E=new WeakSet,B=function(t="v1"){return`/${t}${o(ct,it)}`},y(ct,it,"/credit/reports");let bt=ct;const W=class W extends m{constructor(e){super(e)}async getCustomerById(e,t){const n=`${this.baseUrl}${o(W,N)}/${e.customer_id}`;return this.fetchWithAuth(n,t)}async updateCustomer(e,t){const{customer_id:n,...s}=e,c=`${this.baseUrl}${o(W,N)}/${n}`;return this.fetchWithAuth(c,{method:"PATCH",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s??{}),...t??{}})}async deleteCustomer(e,t){const n=`${this.baseUrl}${o(W,N)}/${e.customer_id}`;return this.fetchWithAuth(n,{method:"DELETE",...t??{}})}async createCustomer(e,t){const n=`${this.baseUrl}${o(W,N)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e??{}),...t??{}})}async searchCustomers(e,t){const{next_cursor:n="",...s}=e,c=`${this.baseUrl}${o(W,N)}/search`;return this.fetchWithAuth(c,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({next_cursor:n,...s??{}}),...t??{}})}};N=new WeakMap,y(W,N,"/v1/customers");let _t=W;const z=class z extends m{constructor(e){super(e)}async getAuthQuestions(e){const t=`${this.baseUrl}${o(z,X)}/questions`;return this.fetchWithAuth(t,e)}async submitAuthAnswers(e,t){const n=`${this.baseUrl}${o(z,X)}/questions`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}};X=new WeakMap,y(z,X,"/v1/authentication");let At=z;const at=class at extends m{constructor(e){super(e)}async createRegistration(e,t){const n=`${this.baseUrl}${o(at,ot)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e??{}),...t??{}})}};ot=new WeakMap,y(at,ot,"/v1/registrations");let Tt=at;const dt=class dt extends m{constructor(t){super(t);y(this,Q)}async getProductConfigs(t,n){const{fromEntries:s,entries:c}=Object,{isArray:a}=Array,u=t==null?void 0:t.version,h=f(this,Q,Bt).call(this,u),{version:$,..._}=s(c(t).filter(([ne,x])=>x!=null).map(([ne,x])=>[ne,a(x)?x.join(","):x.toString()])),U=new URLSearchParams(_).toString(),jt=U?`?${U}`:"",Ie=`${this.baseUrl}${h}${jt}`;return this.fetchWithAuth(Ie,{...n||{}})}async getProductConfigById(t,n){const s=t==null?void 0:t.version,c=f(this,Q,Bt).call(this,s),a=`${this.baseUrl}${c}/${t.product_config_id}`;return this.fetchWithAuth(a,{...n??{}})}};ut=new WeakMap,Q=new WeakSet,Bt=function(t="v1"){return`/${t}${o(dt,ut)}`},y(dt,ut,"/product-configs");let Ct=dt;const v=class v extends m{constructor(e){super(e)}async getSurvey(e){const t=`${this.baseUrl}${o(v,R)}/surveys`;return this.fetchWithAuth(t,e)}async submitSurvey(e,t){const n=`${this.baseUrl}${o(v,R)}/surveys`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}async getScore(e){const t=`${this.baseUrl}${o(v,R)}/scores?latest=TRUE`;return this.fetchWithAuth(t,e)}async getPlan(e,t){const n={action_status:e.action_status,...e.cursor?{cursor:e.cursor}:{},...e.count?{count:e.count.toString()}:{}},s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(v,R)}/plans${c}`;return this.fetchWithAuth(a,t)}async createPlan(e){const t=`${this.baseUrl}${o(v,R)}/plans`;return this.fetchWithAuth(t,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({}),...e??{}})}async updateAction(e,t){const{action_id:n,...s}=e,c=`${this.baseUrl}${o(v,R)}/plans/actions/${n}`;return this.fetchWithAuth(c,{method:"PUT",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}};R=new WeakMap,y(v,R,"/v1/ihs");let Pt=v;const T=class T extends m{constructor(e){super(e)}async createScan(e,t){const n=`${this.baseUrl}${o(T,A)}/scans`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:e.product_config_id}),...t??{}})}async getScans(e,t){const n={};e!=null&&e.product_config_id&&(n.product_config_id=e.product_config_id),e!=null&&e.scan_between&&(n.scan_between=e.scan_between),e!=null&&e.cursor&&(n.cursor=e.cursor),e!=null&&e.count&&(n.count=e.count.toString());const s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans${c}`;return this.fetchWithAuth(a,t)}async getScanById(e,t){const n=`${this.baseUrl}${o(T,A)}/scans/${e.scanId}`;return this.fetchWithAuth(n,t)}async getScansMetadata(e,t){const n={};e!=null&&e.product_config_id&&(n.product_config_id=e.product_config_id),e!=null&&e.scan_between&&(n.scan_between=e.scan_between),e!=null&&e.most_recent&&(n.most_recent="TRUE");const s=new URLSearchParams(n).toString(),c=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans/meta${c}`;return this.fetchWithAuth(a,t)}async getBrokers(e){const t=`${this.baseUrl}${o(T,A)}/brokers`;return this.fetchWithAuth(t,e)}async getBrokerById(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/${e.brokerId}`;return this.fetchWithAuth(n,t)}async getBrokersByScanId(e,t){const n=`${this.baseUrl}${o(T,A)}/scans/${e.scanId}/brokers`;return this.fetchWithAuth(n,t)}async getBrokersByGroupId(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/groups/${e.groupId}`;return this.fetchWithAuth(n,t)}async updateBrokerGroupAction(e,t){const n=`${this.baseUrl}${o(T,A)}/brokers/groups/${e.groupId}/action`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};A=new WeakMap,y(T,A,"/v1/dim");let Ut=T;const J=class J extends m{constructor(e){super(e)}async getCreditLockStatus(e,t){const n=new URLSearchParams({product_config_id:e.product_config_id}).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(J,D)}/lock-status${s}`;return this.fetchWithAuth(c,t)}async lockCredit(e,t){const n=`${this.baseUrl}${o(J,D)}/lock`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:e.product_config_id}),...t??{}})}async unlockCredit(e,t){const n=`${this.baseUrl}${o(J,D)}/unlock`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:e.product_config_id}),...t??{}})}};D=new WeakMap,y(J,D,"/v1/credit");let pt=J;const Et=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:St,CreditAttributesService:$t,CreditLockUnlockService:pt,CreditReportsService:bt,CreditScorePlannerService:mt,CreditScoreSimulatorService:ft,CreditScoresService:yt,CustomerAuthService:At,CustomersService:_t,DigitalIdentityManagerService:Ut,EntitlementsService:gt,IdentityHealthScoreService:Pt,ProductConfigsService:Ct,RegistrationsService:Tt},Symbol.toStringTag,{value:"Module"}));function ge(r){return`${r[0].toLowerCase()}${r.substring(1)}`.replace("Service","")}const $e=typeof process<"u"&&process.versions&&process.versions.node&&typeof window>"u",Z=class Z{constructor(e){y(this,P);g(this,"config");y(this,C);y(this,F,null);g(this,"baseUrl","");this.config=e,this.baseUrl=Gt[e.environment??"PRODUCTION"],q(this,C,new Map)}async getAccessToken(e){if(!$e)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await f(this,P,oe).call(this,e),errors:void 0,meta:{status:200,statusText:"OK"}}}catch(n){return this.clearCache(),{data:void 0,error:n,meta:{status:n.status,statusText:n.message}}}}getCacheLength(){return o(this,C).size}clearCache(){const e=`${this.baseUrl}${o(Z,Y)}`,t=Array.from(o(this,C).keys()).filter(n=>n.includes(e));for(const n of t)o(this,C).delete(n)}};C=new WeakMap,F=new WeakMap,Y=new WeakMap,P=new WeakSet,oe=async function({grantType:e,clientId:t,clientSecret:n,customerId:s}){var $;f(this,P,ae).call(this);const c=`${this.baseUrl}${o(Z,Y)}`,a={method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({grant_type:e,client_id:t,client_secret:n,...e==="trusted_partner"?{partner_customer_id:s??""}:{}})},u=await f(this,P,ue).call(this,c,a);if(u!=null&&u.ok){const U=await u.clone().json();return o(this,F)===null&&f(this,P,Dt).call(this,U.expires_in),U}const h={type:"sdk_error",status:u==null?void 0:u.status,message:(u==null?void 0:u.statusText)||"",data:void 0};if(($=u==null?void 0:u.headers.get("content-type"))!=null&&$.includes("application/json")){const U=await u.clone().json();h.data=U.error,h.type=ht(U.error.type)}else h.type=lt(u==null?void 0:u.status);throw d.generateError(h)},Dt=function(e){const t=new Date().getTime(),n=60*60*1e3,s=t+n,c=e===null?e:new Date(s).valueOf();q(this,F,c)},ae=function(){const e=new Date(Date.now()),t=new Date(o(this,F)??Number.NaN);fe(e,t)&&(f(this,P,Dt).call(this,null),o(this,C).clear())},ue=async function(e,t){const n=`${e}${JSON.stringify(t||{})}`;if(!o(this,C).has(n)){const s=fetch(e,t??{});o(this,C).set(n,s)}return await o(this,C).get(n)},y(Z,Y,"/v1/oauth2/token");let Rt=Z;function fe(r,e){return r>e}const w=class w extends m{constructor(t){super(t);g(this,"alerts");g(this,"auth");g(this,"creditReports");g(this,"creditScores");g(this,"creditAttributes");g(this,"creditScorePlanner");g(this,"creditScoreSimulator");g(this,"customerAuth");g(this,"customers");g(this,"entitlements");g(this,"productConfigs");g(this,"registrations");g(this,"identityHealthScore");g(this,"digitalIdentityManager");g(this,"creditLockUnlock");for(const n in Et)typeof Et[n]=="function"&&(this[ge(n)]=new Et[n](t));this.auth=new Rt({environment:t.environment})}static getInstance(t){return o(w,V)||q(w,V,new w(t)),o(w,V)}static clearInstance(){q(w,V,null)}};V=new WeakMap,y(w,V,null);let vt=w;function Xt(r){return vt.getInstance(r)}function zt(r){return r.progress_status==="TARGET_NOT_MET"||r.progress_status==="COMPLETED"}function me(r){return zt(r)||r.progress_status==="TARGET_SCORE_AND_PLAN_SET"||r.progress_status==="ON_TRACK"||r.progress_status==="OFF_TRACK"}function Se(r){return r.score_model.includes("VANTAGE")}function be(r){return r.score_model.includes("FICO")}function _e(r){return r.target_score!==void 0}function Ae(r){return r.max_actions_per_plan!==void 0}function Te(r){return r.score_model.includes("FICO")}function Ce(r){return r.score_model.includes("VANTAGE")}function Pe(r){return!!(r&&"best_action"in r)}function Ue(r){return!!(r&&"simulated_score"in r)}function pe(r){return!("simulated_score"in r)}function Ee(r){return!!(r&&"slider_min_value"in r&&"slider_max_value"in r)}function Re(r){return!!(r&&"value"in r&&"simulated_score"in r)}function ve(r){return r==="v1"||r==="v2"}function wt(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.score_id=="string"&&Wt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function Nt(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.id=="string"&&Array.isArray(e.bureau_scores)&&e.bureau_scores.every(t=>Qt(t))}function Qt(r){if(typeof r!="object"||r===null)return!1;const e=r;return Wt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function Wt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function Yt(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>Nt(e))}function Zt(r){return Array.isArray(r)&&r.every(e=>wt(e))}function we(r){return Zt(r)}function Ne(r){return Yt(r)}function We(r){return wt(r)}function Ve(r){return Nt(r)}function qt(r){if(typeof r!="object"||r===null)return!1;const e=r;return Vt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function Ot(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.id=="string"&&Array.isArray(e.bureau_attributes)&&e.bureau_attributes.every(t=>te(t))}function te(r){if(typeof r!="object"||r===null)return!1;const e=r;return Vt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function Vt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function ee(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>Ot(e))}function re(r){return Array.isArray(r)&&r.every(e=>qt(e))}function je(r){return re(r)}function ke(r){return ee(r)}const Le={LOCKED:"LOCKED",UNLOCKED:"UNLOCKED"};i.ConnectedSolutionsClientAuthenticationError=Jt,i.ConnectedSolutionsClientError=d,i.ConnectedSolutionsClientRateLimitError=Kt,i.ConnectedSolutionsClientSDKError=xt,i.ConnectedSolutionsClientServerSideError=Ft,i.ConnectedSolutionsClientSideError=K,i.LOCK_STATUS=Le,i.createSDK=Xt,i.default=Xt,i.isBureauAttribute=te,i.isBureauScore=Qt,i.isCreditAttribute=qt,i.isCreditAttributeArray=re,i.isCreditAttributeV2=Ot,i.isCreditAttributesV2=ee,i.isCreditScore=wt,i.isCreditScoreArray=Zt,i.isCreditScoreV2=Nt,i.isCreditScoresV2=Yt,i.isFicoPlan=be,i.isFicoRevision=Te,i.isFicoRevisionsRequest=_e,i.isFicoScenario=pe,i.isFicoScenarioVariation=Ee,i.isFicoSimulator=Pe,i.isPlanCompleted=zt,i.isPlanSet=me,i.isV1GetCreditAttributesResponse=je,i.isV1GetCreditScoresResponse=we,i.isV1PostCreditScoresResponse=We,i.isV2GetCreditAttributesResponse=ke,i.isV2GetCreditScoresResponse=Ne,i.isV2PostCreditScoresResponse=Ve,i.isValidApiVersion=ve,i.isValidBureau=Wt,i.isValidBureauAttribute=Vt,i.isVantagePlan=Se,i.isVantageRevision=Ce,i.isVantageRevisionsRequest=Ae,i.isVantageScenario=Ue,i.isVantageScenarioVariation=Re,i.mapApiErrorTypeToSDKErrorType=ht,i.mapHttpStatusToSDKErrorType=lt,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
16
16
|
//# sourceMappingURL=index.umd.js.map
|