@experian-ecs/connected-api-sdk 1.5.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 +277 -258
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +74 -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
|
@@ -1998,6 +1998,77 @@ declare class CreditLockUnlockService extends ApiClient {
|
|
|
1998
1998
|
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<CreditLockUnlockType>>;
|
|
1999
1999
|
}
|
|
2000
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
|
+
|
|
2001
2072
|
type ConnectedSolutionsSDKConfigInternal = {
|
|
2002
2073
|
environment: 'PRODUCTION' | 'SANDBOX';
|
|
2003
2074
|
token: string | null;
|
|
@@ -2019,6 +2090,7 @@ interface ConnectedSolutionsSDK {
|
|
|
2019
2090
|
identityHealthScore: IdentityHealthScoreService;
|
|
2020
2091
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2021
2092
|
creditLockUnlock: CreditLockUnlockService;
|
|
2093
|
+
offers: OffersService;
|
|
2022
2094
|
}
|
|
2023
2095
|
|
|
2024
2096
|
type ConnectedSolutionsClientMeta = {
|
|
@@ -2074,6 +2146,7 @@ declare class SDKClient extends ApiClient implements ConnectedSolutionsSDK {
|
|
|
2074
2146
|
identityHealthScore: IdentityHealthScoreService;
|
|
2075
2147
|
digitalIdentityManager: DigitalIdentityManagerService;
|
|
2076
2148
|
creditLockUnlock: CreditLockUnlockService;
|
|
2149
|
+
offers: OffersService;
|
|
2077
2150
|
static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient;
|
|
2078
2151
|
static clearInstance(): void;
|
|
2079
2152
|
private constructor();
|
|
@@ -2116,4 +2189,4 @@ declare function isCreditAttributeArray(data: unknown): data is CreditAttribute[
|
|
|
2116
2189
|
declare function isV1GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v1'>;
|
|
2117
2190
|
declare function isV2GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v2'>;
|
|
2118
2191
|
|
|
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 };
|
|
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 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"}})});
|
|
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
|