@experian-ecs/connected-api-sdk 1.4.0 → 1.6.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/README.md +26 -1
- package/dist/esm/index.mjs +379 -302
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +111 -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,112 @@ 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
|
+
|
|
2001
|
+
type OffersRewardMultiplier = {
|
|
2002
|
+
filter: string;
|
|
2003
|
+
type: string;
|
|
2004
|
+
value: string;
|
|
2005
|
+
categories: string[];
|
|
2006
|
+
};
|
|
2007
|
+
type OffersRewardInfo = {
|
|
2008
|
+
ongoing_multipliers: OffersRewardMultiplier[];
|
|
2009
|
+
reward_text: string;
|
|
2010
|
+
reward_tooltip: string;
|
|
2011
|
+
intro_bonus_text: string;
|
|
2012
|
+
intro_bonus_tooltip: string;
|
|
2013
|
+
};
|
|
2014
|
+
type OffersRateAndFeeInfo = {
|
|
2015
|
+
annual_fee: string;
|
|
2016
|
+
standard_apr: string;
|
|
2017
|
+
intro_apr: string;
|
|
2018
|
+
balance_transfer_apr: string;
|
|
2019
|
+
};
|
|
2020
|
+
type OffersPrimaryBadge = {
|
|
2021
|
+
primary_badge_text: string;
|
|
2022
|
+
primary_badge_tooltip: string;
|
|
2023
|
+
};
|
|
2024
|
+
type OffersSpecialOffer = {
|
|
2025
|
+
special_offer_text: string;
|
|
2026
|
+
};
|
|
2027
|
+
type OffersFeatureInfo = {
|
|
2028
|
+
primary_badge: OffersPrimaryBadge;
|
|
2029
|
+
special_offer: OffersSpecialOffer;
|
|
2030
|
+
};
|
|
2031
|
+
type OffersHighlightInfo = {
|
|
2032
|
+
features: string[];
|
|
2033
|
+
pros: string[];
|
|
2034
|
+
primary_highlight: string;
|
|
2035
|
+
secondary_highlight: string;
|
|
2036
|
+
};
|
|
2037
|
+
type OffersLegalInfo = {
|
|
2038
|
+
short_disclaimer: string;
|
|
2039
|
+
terms_and_conditions_url: string;
|
|
2040
|
+
};
|
|
2041
|
+
type CreditCardOffer = {
|
|
2042
|
+
offer_id: string;
|
|
2043
|
+
offer_rank: number;
|
|
2044
|
+
offer_code: string;
|
|
2045
|
+
offer_name: string;
|
|
2046
|
+
image_path: string;
|
|
2047
|
+
apply_url: string;
|
|
2048
|
+
highlight_info: OffersHighlightInfo | null;
|
|
2049
|
+
feature_info: OffersFeatureInfo | null;
|
|
2050
|
+
rate_and_fee_info: OffersRateAndFeeInfo | null;
|
|
2051
|
+
reward_info: OffersRewardInfo | null;
|
|
2052
|
+
legal_info: OffersLegalInfo | null;
|
|
2053
|
+
};
|
|
2054
|
+
type OfferSummary = {
|
|
2055
|
+
total_count: number;
|
|
2056
|
+
};
|
|
2057
|
+
type OffersType = {
|
|
2058
|
+
id: string;
|
|
2059
|
+
offer_summary: OfferSummary;
|
|
2060
|
+
items: CreditCardOffer[];
|
|
2061
|
+
};
|
|
2062
|
+
type GetOffersRequestOptions = {
|
|
2063
|
+
product_config_id: string;
|
|
2064
|
+
};
|
|
2065
|
+
|
|
2066
|
+
declare class OffersService extends ApiClient {
|
|
2067
|
+
#private;
|
|
2068
|
+
constructor(config: ConnectedSolutionsSDKConfig);
|
|
2069
|
+
getOffers(requestOptions: GetOffersRequestOptions, fetchOptions?: RequestInit): Promise<ApiClientResponse<OffersType>>;
|
|
2070
|
+
}
|
|
2071
|
+
|
|
1966
2072
|
type ConnectedSolutionsSDKConfigInternal = {
|
|
1967
2073
|
environment: 'PRODUCTION' | 'SANDBOX';
|
|
1968
2074
|
token: string | null;
|
|
@@ -1983,6 +2089,8 @@ interface ConnectedSolutionsSDK {
|
|
|
1983
2089
|
registrations: RegistrationsService;
|
|
1984
2090
|
identityHealthScore: IdentityHealthScoreService;
|
|
1985
2091
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2092
|
+
creditLockUnlock: CreditLockUnlockService;
|
|
2093
|
+
offers: OffersService;
|
|
1986
2094
|
}
|
|
1987
2095
|
|
|
1988
2096
|
type ConnectedSolutionsClientMeta = {
|
|
@@ -2037,6 +2145,8 @@ declare class SDKClient extends ApiClient implements ConnectedSolutionsSDK {
|
|
|
2037
2145
|
registrations: RegistrationsService;
|
|
2038
2146
|
identityHealthScore: IdentityHealthScoreService;
|
|
2039
2147
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2148
|
+
creditLockUnlock: CreditLockUnlockService;
|
|
2149
|
+
offers: OffersService;
|
|
2040
2150
|
static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient;
|
|
2041
2151
|
static clearInstance(): void;
|
|
2042
2152
|
private constructor();
|
|
@@ -2079,4 +2189,4 @@ declare function isCreditAttributeArray(data: unknown): data is CreditAttribute[
|
|
|
2079
2189
|
declare function isV1GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v1'>;
|
|
2080
2190
|
declare function isV2GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v2'>;
|
|
2081
2191
|
|
|
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 };
|
|
2192
|
+
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 CreditCardOffer, 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 GetOffersRequestOptions, 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 OfferSummary, type OffersFeatureInfo, type OffersHighlightInfo, type OffersLegalInfo, type OffersPrimaryBadge, type OffersRateAndFeeInfo, type OffersRewardInfo, type OffersRewardMultiplier, type OffersSpecialOffer, type OffersType, 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(c,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(c=typeof globalThis<"u"?globalThis:c||self,l(c["@experian-ecs/connected-api-sdk"]={}))})(this,function(c){"use strict";var Fe=Object.defineProperty;var oe=c=>{throw TypeError(c)};var xe=(c,l,d)=>l in c?Fe(c,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[l]=d;var g=(c,l,d)=>xe(c,typeof l!="symbol"?l+"":l,d),Bt=(c,l,d)=>l.has(c)||oe("Cannot "+d);var o=(c,l,d)=>(Bt(c,l,"read from private field"),d?d.call(c):l.get(c)),y=(c,l,d)=>l.has(c)?oe("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(c):l.set(c,d),q=(c,l,d,K)=>(Bt(c,l,"write to private field"),K?K.call(c,d):l.set(c,d),d),f=(c,l,d)=>(Bt(c,l,"access private method"),d);var j,Dt,ae,O,G,Jt,b,et,rt,ue,M,L,st,k,it,E,B,N,X,ot,ut,Q,Ft,R,A,D,ht,C,F,Y,P,de,xt,he,le,V;function l(r){switch(r.type){case"client_side_error":return new K(r);case"authentication_error":return new Kt(r);case"server_side_error":return new Gt(r);case"rate_limit_error":return new Ht(r);default:return new Mt(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 Kt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientAuthenticationError"}}class Gt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientServerSideError"}}class Mt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSDKError"}}class Ht extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientRateLimitError"}}function yt(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 gt(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 Xt={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"},ye={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=Xt[n],this.contentstackUrl=ye[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,Dt).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,Dt).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=yt(_.error.type)}else h.type=gt(s==null?void 0:s.status);throw d.generateError(h)}return f(this,j,ae).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 i=s;return{data:void 0,error:i,meta:{status:i.status??500,statusText:i.message}}}}}j=new WeakSet,Dt=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)}},ae=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,i=f(this,G,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}`:"",$=`${this.baseUrl}${i}${h}`;return this.fetchWithAuth($,n)}async orderCreditScore(t,n){const s=t.version,i=f(this,G,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}`:"",$=`${this.baseUrl}${i}${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,Jt=function(t="v1"){return`/${t}${o(tt,O)}`},y(tt,O,"/credit/scores");let $t=tt;const S=class S extends m{constructor(e){super(e)}async getEntitlements(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(S,b)}?customer_id=${e.customer_id}`,t)}async getEntitlementById({entitlement_id:e},t){return this.fetchWithAuth(`${this.baseUrl}${o(S,b)}/${e}`,t)}async createEntitlement(e,t){return this.fetchWithAuth(`${this.baseUrl}${o(S,b)}`,{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(S,b)}/${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(S,b)}/${e}`,{method:"DELETE",...t??{}})}async activateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(S,b)}/${e}/activate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async deactivateEntitlement({entitlement_id:e},t){const n=`${this.baseUrl}${o(S,b)}/${e}/deactivate`;return this.fetchWithAuth(n,{method:"POST",...t??{}})}async entitleCustomerToNewProduct(e,t){const{product_config_id:n,entitlement_id:s,customer_id:i}=e,a=`${this.baseUrl}${o(S,b)}/${s}/products/${n}`;return this.fetchWithAuth(a,{method:"POST",...t??{},headers:{...(t==null?void 0:t.headers)??{},"X-Customer-ID":i}})}async activateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,i=`${this.baseUrl}${o(S,b)}/${s}/products/${n}/activate`;return this.fetchWithAuth(i,{method:"POST",...t??{}})}async deactivateProduct(e,t){const{product_config_id:n,entitlement_id:s}=e,i=`${this.baseUrl}${o(S,b)}/${s}/products/${n}/deactivate`;return this.fetchWithAuth(i,{method:"POST",...t??{}})}async removeProductFromEntitlement(e,t){const{product_config_id:n,entitlement_id:s}=e,i=`${this.baseUrl}${o(S,b)}/${s}/products/${n}`;return this.fetchWithAuth(i,{method:"DELETE",...t??{}})}async getProductEligibility(e,t){const n=new URLSearchParams(e).toString(),s=`${this.baseUrl}${o(S,b)}/eligibility?${n}`;return this.fetchWithAuth(s,t)}};b=new WeakMap,y(S,b,"/v1/entitlements");let ft=S;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,i=f(this,rt,ue).call(this,s),a=`${this.baseUrl}${i}`;return this.fetchWithAuth(a,n)}};et=new WeakMap,rt=new WeakSet,ue=function(t="v1"){return`/${t}${o(nt,et)}`},y(nt,et,"/credit/attributes");let mt=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(),i=s?`?${s}`:"",a=`${this.baseUrl}${o(H,M)}${i}`;return this.fetchWithAuth(a,t)}async simulateScenario(e,t){const{product_config_id:n,...s}=e,i=new URLSearchParams({product_config_id:n}).toString(),a=i?`?${i}`:"";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 bt=H;const p=class p extends m{constructor(e){super(e)}async getCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${o(p,L)}${s}`;return this.fetchWithAuth(i,{...t??{}})}async createCreditScorePlan(e,t){const{product_config_id:n,...s}=e,i=new URLSearchParams({product_config_id:n}).toString(),a=i?`?${i}`:"",u=`${this.baseUrl}${o(p,L)}${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}`:"",i=`${this.baseUrl}${o(p,L)}${s}`;return this.fetchWithAuth(i,{method:"DELETE",...t??{}})}async getCreditScorePlanRevisions(e,t){const{product_config_id:n,...s}=e,i=new URLSearchParams({product_config_id:n}).toString(),a=i?`?${i}`:"",u=`${this.baseUrl}${o(p,L)}${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??{}})}};L=new WeakMap,st=new WeakMap,y(p,L,"/v1/credit/tools/planners"),y(p,st,"/revisions");let St=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(),i=`${this.baseUrl}${o(I,k)}?${s}`;return this.fetchWithAuth(i,t)}async getAlertById({id:e},t){const n=`${this.baseUrl}${o(I,k)}/${e}`;return this.fetchWithAuth(n,t)}async markAlertAsRead({id:e},t){const n=`${this.baseUrl}${o(I,k)}/${e}/dispose`;return this.fetchWithAuth(n,{method:"PATCH",...t??{}})}async getAlertCounts(e){const t=`${this.baseUrl}${o(I,k)}/counts`;return this.fetchWithAuth(t,e)}};k=new WeakMap,y(I,k,"/v1/events-alerts");let _t=I;function zt(r){return!(r!=null&&r.version)||(r==null?void 0:r.version)==="v1"}function ge(r){return(r==null?void 0:r.version)==="v2"}function Qt(r){return r!==void 0&&zt(r)&&"include_fields"in r&&typeof r.include_fields=="string"}function $e(r){return r!==void 0&&zt(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 fe(r){return r!==void 0&&ge(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,i=f(this,E,B).call(this,s),a={};$e(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())),fe(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}${i}${h}`;return this.fetchWithAuth($,n)}async getReportById(t,n){const{id:s,version:i}=t,a=f(this,E,B).call(this,i),u={};Qt(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:i,report_read:a,...u}=t??{},h=f(this,E,B).call(this,s),$={...u??{},...i?{latest_only:i.toString()}:{},...a?{report_read:a.toString()}:{}},_=new URLSearchParams($).toString(),U=_?`?${_}`:"",It=`${this.baseUrl}${h}/meta${U}`;return this.fetchWithAuth(It,n)}async getReportMetaById(t,n){const{id:s,version:i,...a}=t,u=f(this,E,B).call(this,i),h=new URLSearchParams(a).toString(),$=h?`?${h}`:"",_=`${this.baseUrl}${u}/${s}/meta${$}`;return this.fetchWithAuth(_,n)}async markReportAsRead(t,n){const{id:s,version:i}=t,a=f(this,E,B).call(this,i),u=`${this.baseUrl}${a}`;if(i==="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={},i=t==null?void 0:t.version,a=f(this,E,B).call(this,i);Qt(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 At=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,i=`${this.baseUrl}${o(W,N)}/${n}`;return this.fetchWithAuth(i,{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,i=`${this.baseUrl}${o(W,N)}/search`;return this.fetchWithAuth(i,{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 Tt=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 Ct=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 Pt=at;const dt=class dt extends m{constructor(t){super(t);y(this,Q)}async getProductConfigs(t,n){const{fromEntries:s,entries:i}=Object,{isArray:a}=Array,u=t==null?void 0:t.version,h=f(this,Q,Ft).call(this,u),{version:$,..._}=s(i(t).filter(([ce,x])=>x!=null).map(([ce,x])=>[ce,a(x)?x.join(","):x.toString()])),U=new URLSearchParams(_).toString(),It=U?`?${U}`:"",Je=`${this.baseUrl}${h}${It}`;return this.fetchWithAuth(Je,{...n||{}})}async getProductConfigById(t,n){const s=t==null?void 0:t.version,i=f(this,Q,Ft).call(this,s),a=`${this.baseUrl}${i}/${t.product_config_id}`;return this.fetchWithAuth(a,{...n??{}})}};ut=new WeakMap,Q=new WeakSet,Ft=function(t="v1"){return`/${t}${o(dt,ut)}`},y(dt,ut,"/product-configs");let Ut=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(),i=s?`?${s}`:"",a=`${this.baseUrl}${o(v,R)}/plans${i}`;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,i=`${this.baseUrl}${o(v,R)}/plans/actions/${n}`;return this.fetchWithAuth(i,{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(),i=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans${i}`;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(),i=s?`?${s}`:"",a=`${this.baseUrl}${o(T,A)}/scans/meta${i}`;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 Et=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}`:"",i=`${this.baseUrl}${o(J,D)}/lock-status${s}`;return this.fetchWithAuth(i,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 Rt=J;const lt=class lt extends m{constructor(e){super(e)}async getOffers(e,t){const n=new URLSearchParams(Object.entries(e).filter(([,i])=>i!=null).map(([i,a])=>[i,a.toString()])).toString(),s=n?`?${n}`:"";return this.fetchWithAuth(`${this.baseUrl}${o(lt,ht)}${s}`,t)}};ht=new WeakMap,y(lt,ht,"/v1/offers/credit-cards");let vt=lt;const wt=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:_t,CreditAttributesService:mt,CreditLockUnlockService:Rt,CreditReportsService:At,CreditScorePlannerService:St,CreditScoreSimulatorService:bt,CreditScoresService:$t,CustomerAuthService:Ct,CustomersService:Tt,DigitalIdentityManagerService:Et,EntitlementsService:ft,IdentityHealthScoreService:pt,OffersService:vt,ProductConfigsService:Ut,RegistrationsService:Pt},Symbol.toStringTag,{value:"Module"}));function me(r){return`${r[0].toLowerCase()}${r.substring(1)}`.replace("Service","")}const be=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=Xt[e.environment??"PRODUCTION"],q(this,C,new Map)}async getAccessToken(e){if(!be)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await f(this,P,de).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,de=async function({grantType:e,clientId:t,clientSecret:n,customerId:s}){var $;f(this,P,he).call(this);const i=`${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,le).call(this,i,a);if(u!=null&&u.ok){const U=await u.clone().json();return o(this,F)===null&&f(this,P,xt).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=yt(U.error.type)}else h.type=gt(u==null?void 0:u.status);throw d.generateError(h)},xt=function(e){const t=new Date().getTime(),n=60*60*1e3,s=t+n,i=e===null?e:new Date(s).valueOf();q(this,F,i)},he=function(){const e=new Date(Date.now()),t=new Date(o(this,F)??Number.NaN);Se(e,t)&&(f(this,P,xt).call(this,null),o(this,C).clear())},le=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 Nt=Z;function Se(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");g(this,"offers");for(const n in wt)typeof wt[n]=="function"&&(this[me(n)]=new wt[n](t));this.auth=new Nt({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 Wt=w;function Yt(r){return Wt.getInstance(r)}function Zt(r){return r.progress_status==="TARGET_NOT_MET"||r.progress_status==="COMPLETED"}function _e(r){return Zt(r)||r.progress_status==="TARGET_SCORE_AND_PLAN_SET"||r.progress_status==="ON_TRACK"||r.progress_status==="OFF_TRACK"}function Ae(r){return r.score_model.includes("VANTAGE")}function Te(r){return r.score_model.includes("FICO")}function Ce(r){return r.target_score!==void 0}function Pe(r){return r.max_actions_per_plan!==void 0}function Ue(r){return r.score_model.includes("FICO")}function pe(r){return r.score_model.includes("VANTAGE")}function Ee(r){return!!(r&&"best_action"in r)}function Re(r){return!!(r&&"simulated_score"in r)}function ve(r){return!("simulated_score"in r)}function we(r){return!!(r&&"slider_min_value"in r&&"slider_max_value"in r)}function Ne(r){return!!(r&&"value"in r&&"simulated_score"in r)}function We(r){return r==="v1"||r==="v2"}function Vt(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.score_id=="string"&&Lt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function jt(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 Lt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function Lt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function Ot(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>jt(e))}function te(r){return Array.isArray(r)&&r.every(e=>Vt(e))}function Ve(r){return te(r)}function je(r){return Ot(r)}function Le(r){return Vt(r)}function ke(r){return jt(r)}function ee(r){if(typeof r!="object"||r===null)return!1;const e=r;return kt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function re(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=>ne(t))}function ne(r){if(typeof r!="object"||r===null)return!1;const e=r;return kt(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function kt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function se(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>re(e))}function ie(r){return Array.isArray(r)&&r.every(e=>ee(e))}function Ie(r){return ie(r)}function Be(r){return se(r)}const De={LOCKED:"LOCKED",UNLOCKED:"UNLOCKED"};c.ConnectedSolutionsClientAuthenticationError=Kt,c.ConnectedSolutionsClientError=d,c.ConnectedSolutionsClientRateLimitError=Ht,c.ConnectedSolutionsClientSDKError=Mt,c.ConnectedSolutionsClientServerSideError=Gt,c.ConnectedSolutionsClientSideError=K,c.LOCK_STATUS=De,c.createSDK=Yt,c.default=Yt,c.isBureauAttribute=ne,c.isBureauScore=qt,c.isCreditAttribute=ee,c.isCreditAttributeArray=ie,c.isCreditAttributeV2=re,c.isCreditAttributesV2=se,c.isCreditScore=Vt,c.isCreditScoreArray=te,c.isCreditScoreV2=jt,c.isCreditScoresV2=Ot,c.isFicoPlan=Te,c.isFicoRevision=Ue,c.isFicoRevisionsRequest=Ce,c.isFicoScenario=ve,c.isFicoScenarioVariation=we,c.isFicoSimulator=Ee,c.isPlanCompleted=Zt,c.isPlanSet=_e,c.isV1GetCreditAttributesResponse=Ie,c.isV1GetCreditScoresResponse=Ve,c.isV1PostCreditScoresResponse=Le,c.isV2GetCreditAttributesResponse=Be,c.isV2GetCreditScoresResponse=je,c.isV2PostCreditScoresResponse=ke,c.isValidApiVersion=We,c.isValidBureau=Lt,c.isValidBureauAttribute=kt,c.isVantagePlan=Ae,c.isVantageRevision=pe,c.isVantageRevisionsRequest=Pe,c.isVantageScenario=Re,c.isVantageScenarioVariation=Ne,c.mapApiErrorTypeToSDKErrorType=yt,c.mapHttpStatusToSDKErrorType=gt,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
16
16
|
//# sourceMappingURL=index.umd.js.map
|