@experian-ecs/connected-api-sdk 1.3.0 → 1.4.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 +24 -1
- package/dist/esm/index.mjs +354 -346
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +57 -8
- 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
|
@@ -575,10 +575,10 @@ declare class AuthService {
|
|
|
575
575
|
type AlertMetadata = {
|
|
576
576
|
alert_id: string;
|
|
577
577
|
customer_id: string;
|
|
578
|
-
bureau
|
|
578
|
+
bureau?: string;
|
|
579
579
|
event_key: string;
|
|
580
580
|
schema_version: string;
|
|
581
|
-
tenant_id
|
|
581
|
+
tenant_id?: string;
|
|
582
582
|
};
|
|
583
583
|
type AlertDisposition = {
|
|
584
584
|
read_status: 'Y' | 'N';
|
|
@@ -982,7 +982,29 @@ type CreditScoreBelowGoalDetails = {
|
|
|
982
982
|
previous_score_rating: string;
|
|
983
983
|
goal_value: string;
|
|
984
984
|
};
|
|
985
|
-
type
|
|
985
|
+
type AuthorizationCompanyAddress = Address & {
|
|
986
|
+
activity_date: string;
|
|
987
|
+
};
|
|
988
|
+
type AuthorizationCompanyDetail = Omit<Company, 'address'> & {
|
|
989
|
+
address: AuthorizationCompanyAddress;
|
|
990
|
+
};
|
|
991
|
+
type AuthorizationAlertDetails = {
|
|
992
|
+
company: AuthorizationCompanyDetail;
|
|
993
|
+
};
|
|
994
|
+
type AlternativeLoanRecord = {
|
|
995
|
+
loan_date: string;
|
|
996
|
+
loan_amount: string;
|
|
997
|
+
loan_current_balance: string;
|
|
998
|
+
loan_actual_payment: string;
|
|
999
|
+
loan_amount_past_due: string;
|
|
1000
|
+
loan_closed_date?: string;
|
|
1001
|
+
company: string;
|
|
1002
|
+
};
|
|
1003
|
+
type AlternativeLoanMonitoringDetails = {
|
|
1004
|
+
occurrence_count: string;
|
|
1005
|
+
loans: AlternativeLoanRecord[];
|
|
1006
|
+
};
|
|
1007
|
+
type AlertDetails = AuthorizationAlertDetails | DormantAccountDetails | AlternativeLoanMonitoringDetails | NewInquiryDetails | EquifaxNewInquiryDetails | TransUnionNewInquiryDetails | NewAccountDetails | EquifaxNewAccountDetails | TransUnionNewAccountDetails | NewAddressDetails | EquifaxNewAddressDetails | TransUnionNewAddressDetails | SpecialCommentsDetails | SkipCannotLocateDetails | LostOrStolenCardDetails | CardOverLimitDetails | PastDueDetails | DerogatoryDetails | SettlementDetails | ClosedAccountDetails | AccountInBankruptcyDetails | TransUnionAccountInBankruptcyDetails | PublicRecordBankruptcyDetails | TransUnionPublicRecordBankruptcyDetails | CollectionDetails | DeceasedDetails | CreditBalanceIncreaseDetails | CreditBalanceDecreaseDetails | CreditLimitIncreaseDetails | CreditLimitDecreaseDetails | CreditUsageIncreaseDetails | CreditUsageDecreaseDetails | AccountClosedDetails | AccountCurrentDetails | AccountImprovedDetails | TransUnionAccountImprovedDetails | AccountPaidDetails | CreditScoreIncreaseDetails | CreditScoreDecreaseDetails | CreditScoreRatingIncreaseDetails | CreditScoreRatingDecreaseDetails | CreditScoreGoalAchievedDetails | CreditScoreBelowGoalDetails | EquifaxCollectionChangeDetails | EquifaxNewCollectionDetails | EquifaxNewBankruptcyDetails | TransUnionNewPublicRecordDetails | TransUnionDelinquentDetails;
|
|
986
1008
|
type AlertData<AlertDetailsType = AlertDetails> = {
|
|
987
1009
|
alert_date: string;
|
|
988
1010
|
alert_severity?: string;
|
|
@@ -1517,14 +1539,35 @@ type ProductConfig = {
|
|
|
1517
1539
|
created_at: string;
|
|
1518
1540
|
updated_at: string;
|
|
1519
1541
|
};
|
|
1542
|
+
type ScoreItem = {
|
|
1543
|
+
bureau: Bureau;
|
|
1544
|
+
score_model: Omit<ScoreModel, 'disclosure'>;
|
|
1545
|
+
};
|
|
1546
|
+
type DisclosureItem = {
|
|
1547
|
+
bureau: Bureau;
|
|
1548
|
+
model: ScoreModelVersion;
|
|
1549
|
+
disclosure: {
|
|
1550
|
+
short_form: string;
|
|
1551
|
+
long_form: string;
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
type ProductConfig_V2 = Omit<ProductConfig, 'disclosure'> & {
|
|
1555
|
+
scores_items: ScoreItem[];
|
|
1556
|
+
disclosure_items: DisclosureItem[];
|
|
1557
|
+
};
|
|
1520
1558
|
type ProductConfigs = {
|
|
1521
1559
|
previous_cursor: string;
|
|
1522
1560
|
next_cursor: string;
|
|
1523
1561
|
items: ProductConfig[];
|
|
1524
1562
|
};
|
|
1563
|
+
type ProductConfigs_V2 = {
|
|
1564
|
+
next_cursor: string;
|
|
1565
|
+
items: ProductConfig_V2[];
|
|
1566
|
+
};
|
|
1567
|
+
type ProductConfigsResponse<Version extends ApiVersion> = Version extends 'v1' ? ProductConfigs : ProductConfigs_V2;
|
|
1525
1568
|
type ProductConfigDeliveryType = 'ON_DEMAND' | 'ON_SCHEDULE' | 'MONITORING' | 'ON_ACTIVATION' | 'AD_HOC';
|
|
1526
1569
|
type ProductConfigCadenceType = 'DAILY' | 'WEEKLY' | 'BI_WEEKLY' | 'MONTHLY' | 'QUARTERLY' | 'YEARLY';
|
|
1527
|
-
type ProductConfigsSearchOptions = {
|
|
1570
|
+
type ProductConfigsSearchOptions<Version extends ApiVersion> = {
|
|
1528
1571
|
/**
|
|
1529
1572
|
* @description The cursor for the current page.
|
|
1530
1573
|
*/
|
|
@@ -1559,15 +1602,21 @@ type ProductConfigsSearchOptions = {
|
|
|
1559
1602
|
* Pattern: ^((?:(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2}(?:\.\d+)?))(Z|[\+-]\d{2}:\d{2})?)$
|
|
1560
1603
|
*/
|
|
1561
1604
|
created_between?: [string, string];
|
|
1605
|
+
/**
|
|
1606
|
+
* @description The API version to use for the request.
|
|
1607
|
+
*/
|
|
1608
|
+
version?: Version;
|
|
1562
1609
|
};
|
|
1610
|
+
type GetProductConfigByIdResponse<Version extends ApiVersion> = Version extends 'v1' ? ProductConfig : ProductConfig_V2;
|
|
1563
1611
|
|
|
1564
1612
|
declare class ProductConfigsService extends ApiClient {
|
|
1565
1613
|
#private;
|
|
1566
1614
|
constructor(config: ConnectedSolutionsSDKConfig);
|
|
1567
|
-
getProductConfigs(searchOptions: ProductConfigsSearchOptions
|
|
1568
|
-
getProductConfigById(requestOptions: {
|
|
1615
|
+
getProductConfigs<Version extends ApiVersion = 'v1'>(searchOptions: ProductConfigsSearchOptions<Version>, fetchOptions?: RequestInit): Promise<ApiClientResponse<ProductConfigsResponse<Version>>>;
|
|
1616
|
+
getProductConfigById<Version extends ApiVersion = 'v1'>(requestOptions: {
|
|
1569
1617
|
product_config_id: string;
|
|
1570
|
-
|
|
1618
|
+
version?: Version;
|
|
1619
|
+
}, fetchOptions?: RequestInit): Promise<ApiClientResponse<GetProductConfigByIdResponse<Version>>>;
|
|
1571
1620
|
}
|
|
1572
1621
|
|
|
1573
1622
|
type IHSSurveyStatus = 'COMPLETED' | 'GENERATING' | 'AVAILABLE' | 'FAILED';
|
|
@@ -2030,4 +2079,4 @@ declare function isCreditAttributeArray(data: unknown): data is CreditAttribute[
|
|
|
2030
2079
|
declare function isV1GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v1'>;
|
|
2031
2080
|
declare function isV2GetCreditAttributesResponse(data: unknown): data is GetCreditAttributeResponse<'v2'>;
|
|
2032
2081
|
|
|
2033
|
-
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 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 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 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 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 ProductConfigId, 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 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 };
|
|
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 };
|
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 ve=Object.defineProperty;var Yt=i=>{throw TypeError(i)};var we=(i,l,d)=>l in i?ve(i,l,{enumerable:!0,configurable:!0,writable:!0,value:d}):i[l]=d;var y=(i,l,d)=>we(i,typeof l!="symbol"?l+"":l,d),vt=(i,l,d)=>l.has(i)||Yt("Cannot "+d);var o=(i,l,d)=>(vt(i,l,"read from private field"),d?d.call(i):l.get(i)),g=(i,l,d)=>l.has(i)?Yt("Cannot add the same private member more than once"):l instanceof WeakSet?l.add(i):l.set(i,d),Y=(i,l,d,F)=>(vt(i,l,"write to private field"),F?F.call(i,d):l.set(i,d),d),$=(i,l,d)=>(vt(i,l,"access private method"),d);var j,wt,Zt,Z,J,Nt,b,O,tt,qt,x,I,rt,k,nt,R,B,N,K,it,H,E,T,P,D,z,U,Ot,Wt,te,ee,V;function l(r){switch(r.type){case"client_side_error":return new F(r);case"authentication_error":return new Vt(r);case"server_side_error":return new jt(r);case"rate_limit_error":return new kt(r);default:return new It(r)}}class d extends Error{constructor(t){var n;super(t.message);y(this,"message");y(this,"data");y(this,"status");this.message=((n=t.data)==null?void 0:n.message)||t.message||"",this.data=t.data,this.status=t.status}}y(d,"generateError",l);class F extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSideError"}}class Vt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientAuthenticationError"}}class jt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientServerSideError"}}class It extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientSDKError"}}class kt extends d{constructor(e){super(e),this.name="ConnectedSolutionsClientRateLimitError"}}function ot(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 at(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 Lt={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"},re={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){g(this,j);y(this,"config");y(this,"baseUrl","");y(this,"contentstackUrl","");const n=e.environment??"PRODUCTION";this.config=e,this.baseUrl=Lt[n],this.contentstackUrl=re[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,wt).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,wt).call(this);const s=await fetch(e,t);if(!(s!=null&&s.ok)){let a;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 m=await s.clone().json();h.data=m.error,h.type=ot(m.error.type)}else h.type=at(s==null?void 0:s.status);throw d.generateError(h)}return $(this,j,Zt).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,wt=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)}},Zt=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);g(this,J)}async getCreditScores(t,n){const s=t==null?void 0:t.version,c=$(this,J,Nt).call(this,s),u={...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()}:{}},a=new URLSearchParams(u).toString(),h=a?`?${a}`:"",f=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth(f,n)}async orderCreditScore(t,n){const s=t.version,c=$(this,J,Nt).call(this,s),u={...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},a=new URLSearchParams(u).toString(),h=a?`?${a}`:"",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,J=new WeakSet,Nt=function(t="v1"){return`/${t}${o(q,Z)}`},g(q,Z,"/credit/scores");let ut=q;const S=class S extends _{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:c}=e,u=`${this.baseUrl}${o(S,b)}/${s}/products/${n}/activate`;return this.fetchWithAuth(u,{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(S,b)}/${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(S,b)}/${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(S,b)}/${s}/products/${n}`;return this.fetchWithAuth(c,{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,g(S,b,"/v1/entitlements");let dt=S;const et=class et extends _{constructor(t){super(t);g(this,tt)}async getCreditAttributes(t,n){const s=t==null?void 0:t.version,c=$(this,tt,qt).call(this,s),u=`${this.baseUrl}${c}`;return this.fetchWithAuth(u,n)}};O=new WeakMap,tt=new WeakSet,qt=function(t="v1"){return`/${t}${o(et,O)}`},g(et,O,"/credit/attributes");let ht=et;const G=class G 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}`:"",u=`${this.baseUrl}${o(G,x)}${c}`;return this.fetchWithAuth(u,t)}async simulateScenario(e,t){const{product_config_id:n,...s}=e,c=new URLSearchParams({product_config_id:n}).toString(),u=c?`?${c}`:"";return this.fetchWithAuth(`${this.baseUrl}${o(G,x)}${u}`,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...t??{}})}};x=new WeakMap,g(G,x,"/v1/credit/tools/simulator");let lt=G;const p=class p extends _{constructor(e){super(e)}async getCreditScorePlan(e,t){const n=new URLSearchParams(e).toString(),s=n?`?${n}`:"",c=`${this.baseUrl}${o(p,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(),u=c?`?${c}`:"",a=`${this.baseUrl}${o(p,I)}${u}`;return this.fetchWithAuth(a,{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,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(),u=c?`?${c}`:"",a=`${this.baseUrl}${o(p,I)}${o(p,rt)}${u}`;return this.fetchWithAuth(a,{method:"POST",body:JSON.stringify(s),headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};I=new WeakMap,rt=new WeakMap,g(p,I,"/v1/credit/tools/planners"),g(p,rt,"/revisions");let yt=p;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,g(L,k,"/v1/events-alerts");let gt=L;function Bt(r){return!(r!=null&&r.version)||(r==null?void 0:r.version)==="v1"}function ne(r){return(r==null?void 0:r.version)==="v2"}function Dt(r){return r!==void 0&&Bt(r)&&"include_fields"in r&&typeof r.include_fields=="string"}function se(r){return r!==void 0&&Bt(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 ie(r){return r!==void 0&&ne(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);g(this,R)}async getReports(t,n){const s=t==null?void 0:t.version,c=$(this,R,B).call(this,s),u={};se(t)&&(t.report_between&&(u.report_between=t.report_between.toString()),t.include_fields&&(u.include_fields=t.include_fields.toString()),t.report_date&&(u.report_date=t.report_date.toString()),t.product_config_id&&(u.product_config_id=t.product_config_id.toString())),ie(t)&&(t.product_config_id&&(u.product_config_id=t.product_config_id.toString()),t.report_between&&(u.report_between=t.report_between.toString()));const a=new URLSearchParams(u).toString(),h=a?`?${a}`:"",f=`${this.baseUrl}${c}${h}`;return this.fetchWithAuth(f,n)}async getReportById(t,n){const{id:s,version:c}=t,u=$(this,R,B).call(this,c),a={};Dt(t)&&(a.include_fields=t.include_fields.toString());const h=new URLSearchParams(a).toString(),f=h?`?${h}`:"",m=`${this.baseUrl}${u}/${s}${f}`;return this.fetchWithAuth(m,n)}async getReportsMeta(t,n){const{version:s,latest_only:c,report_read:u,...a}=t??{},h=$(this,R,B).call(this,s),f={...a??{},...c?{latest_only:c.toString()}:{},...u?{report_read:u.toString()}:{}},m=new URLSearchParams(f).toString(),A=m?`?${m}`:"",Ee=`${this.baseUrl}${h}/meta${A}`;return this.fetchWithAuth(Ee,n)}async getReportMetaById(t,n){const{id:s,version:c,...u}=t,a=$(this,R,B).call(this,c),h=new URLSearchParams(u).toString(),f=h?`?${h}`:"",m=`${this.baseUrl}${a}/${s}/meta${f}`;return this.fetchWithAuth(m,n)}async markReportAsRead(t,n){const{id:s,version:c}=t,u=$(this,R,B).call(this,c),a=`${this.baseUrl}${u}`;if(c==="v2"){const f=`${a}/${s}/disposition`,m=t;return this.fetchWithAuth(f,{method:"PATCH",headers:{...(n==null?void 0:n.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({disposition:m.disposition}),...n??{}})}const h=`${a}/${s}/read`;return this.fetchWithAuth(h,{method:"PUT",...n??{}})}async orderReport(t,n){const s={},c=t==null?void 0:t.version,u=$(this,R,B).call(this,c);Dt(t)&&(s.include_fields=t.include_fields.toString());const a=new URLSearchParams(s).toString(),h=a?`?${a}`:"",f=`${this.baseUrl}${u}${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)}`},g(st,nt,"/credit/reports");let ft=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,g(W,N,"/v1/customers");let $t=W;const M=class M extends _{constructor(e){super(e)}async getAuthQuestions(e){const t=`${this.baseUrl}${o(M,K)}/questions`;return this.fetchWithAuth(t,e)}async submitAuthAnswers(e,t){const n=`${this.baseUrl}${o(M,K)}/questions`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(e),...t??{}})}};K=new WeakMap,g(M,K,"/v1/authentication");let mt=M;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,g(ct,it,"/v1/registrations");let bt=ct;const X=class X extends _{constructor(e){super(e)}async getProductConfigs(e,t){const{fromEntries:n,entries:s}=Object,{isArray:c}=Array,u=n(s(e).filter(([m,A])=>A!=null).map(([m,A])=>[m,c(A)?A.join(","):A.toString()])),a=new URLSearchParams(u).toString(),h=a?`?${a}`:"",f=`${this.baseUrl}${o(X,H)}${h}`;return this.fetchWithAuth(f,{...t||{}})}async getProductConfigById(e,t){const n=`${this.baseUrl}${o(X,H)}/${e.product_config_id}`;return this.fetchWithAuth(n,{...t??{}})}};H=new WeakMap,g(X,H,"/v1/product-configs");let St=X;const v=class v extends _{constructor(e){super(e)}async getSurvey(e){const t=`${this.baseUrl}${o(v,E)}/surveys`;return this.fetchWithAuth(t,e)}async submitSurvey(e,t){const n=`${this.baseUrl}${o(v,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(v,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}`:"",u=`${this.baseUrl}${o(v,E)}/plans${c}`;return this.fetchWithAuth(u,t)}async createPlan(e){const t=`${this.baseUrl}${o(v,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(v,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,g(v,E,"/v1/ihs");let _t=v;const C=class C extends _{constructor(e){super(e)}async createScan(e,t){const n=`${this.baseUrl}${o(C,T)}/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}`:"",u=`${this.baseUrl}${o(C,T)}/scans${c}`;return this.fetchWithAuth(u,t)}async getScanById(e,t){const n=`${this.baseUrl}${o(C,T)}/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}`:"",u=`${this.baseUrl}${o(C,T)}/scans/meta${c}`;return this.fetchWithAuth(u,t)}async getBrokers(e){const t=`${this.baseUrl}${o(C,T)}/brokers`;return this.fetchWithAuth(t,e)}async getBrokerById(e,t){const n=`${this.baseUrl}${o(C,T)}/brokers/${e.brokerId}`;return this.fetchWithAuth(n,t)}async getBrokersByScanId(e,t){const n=`${this.baseUrl}${o(C,T)}/scans/${e.scanId}/brokers`;return this.fetchWithAuth(n,t)}async getBrokersByGroupId(e,t){const n=`${this.baseUrl}${o(C,T)}/brokers/groups/${e.groupId}`;return this.fetchWithAuth(n,t)}async updateBrokerGroupAction(e,t){const n=`${this.baseUrl}${o(C,T)}/brokers/groups/${e.groupId}/action`;return this.fetchWithAuth(n,{method:"POST",headers:{...(t==null?void 0:t.headers)??{},"Content-Type":"application/json"},...t??{}})}};T=new WeakMap,g(C,T,"/v1/dim");let At=C;const Tt=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:gt,CreditAttributesService:ht,CreditReportsService:ft,CreditScorePlannerService:yt,CreditScoreSimulatorService:lt,CreditScoresService:ut,CustomerAuthService:mt,CustomersService:$t,DigitalIdentityManagerService:At,EntitlementsService:dt,IdentityHealthScoreService:_t,ProductConfigsService:St,RegistrationsService:bt},Symbol.toStringTag,{value:"Module"}));function ce(r){return`${r[0].toLowerCase()}${r.substring(1)}`.replace("Service","")}const oe=typeof process<"u"&&process.versions&&process.versions.node&&typeof window>"u",Q=class Q{constructor(e){g(this,U);y(this,"config");g(this,P);g(this,D,null);y(this,"baseUrl","");this.config=e,this.baseUrl=Lt[e.environment??"PRODUCTION"],Y(this,P,new Map)}async getAccessToken(e){if(!oe)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await $(this,U,Ot).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,P).size}clearCache(){const e=`${this.baseUrl}${o(Q,z)}`,t=Array.from(o(this,P).keys()).filter(n=>n.includes(e));for(const n of t)o(this,P).delete(n)}};P=new WeakMap,D=new WeakMap,z=new WeakMap,U=new WeakSet,Ot=async function({grantType:e,clientId:t,clientSecret:n,customerId:s}){var f;$(this,U,te).call(this);const c=`${this.baseUrl}${o(Q,z)}`,u={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??""}:{}})},a=await $(this,U,ee).call(this,c,u);if(a!=null&&a.ok){const A=await a.clone().json();return o(this,D)===null&&$(this,U,Wt).call(this,A.expires_in),A}const h={type:"sdk_error",status:a==null?void 0:a.status,message:(a==null?void 0:a.statusText)||"",data:void 0};if((f=a==null?void 0:a.headers.get("content-type"))!=null&&f.includes("application/json")){const A=await a.clone().json();h.data=A.error,h.type=ot(A.error.type)}else h.type=at(a==null?void 0:a.status);throw d.generateError(h)},Wt=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)},te=function(){const e=new Date(Date.now()),t=new Date(o(this,D)??Number.NaN);ae(e,t)&&($(this,U,Wt).call(this,null),o(this,P).clear())},ee=async function(e,t){const n=`${e}${JSON.stringify(t||{})}`;if(!o(this,P).has(n)){const s=fetch(e,t??{});o(this,P).set(n,s)}return await o(this,P).get(n)},g(Q,z,"/v1/oauth2/token");let Ct=Q;function ae(r,e){return r>e}const w=class w extends _{constructor(t){super(t);y(this,"alerts");y(this,"auth");y(this,"creditReports");y(this,"creditScores");y(this,"creditAttributes");y(this,"creditScorePlanner");y(this,"creditScoreSimulator");y(this,"customerAuth");y(this,"customers");y(this,"entitlements");y(this,"productConfigs");y(this,"registrations");y(this,"identityHealthScore");y(this,"digitalIdentityManager");for(const n in Tt)typeof Tt[n]=="function"&&(this[ce(n)]=new Tt[n](t));this.auth=new Ct({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,g(w,V,null);let Pt=w;function Ft(r){return Pt.getInstance(r)}function Jt(r){return r.progress_status==="TARGET_NOT_MET"||r.progress_status==="COMPLETED"}function ue(r){return Jt(r)||r.progress_status==="TARGET_SCORE_AND_PLAN_SET"||r.progress_status==="ON_TRACK"||r.progress_status==="OFF_TRACK"}function de(r){return r.score_model.includes("VANTAGE")}function he(r){return r.score_model.includes("FICO")}function le(r){return r.target_score!==void 0}function ye(r){return r.max_actions_per_plan!==void 0}function ge(r){return r.score_model.includes("FICO")}function fe(r){return r.score_model.includes("VANTAGE")}function $e(r){return!!(r&&"best_action"in r)}function me(r){return!!(r&&"simulated_score"in r)}function be(r){return!("simulated_score"in r)}function Se(r){return!!(r&&"slider_min_value"in r&&"slider_max_value"in r)}function _e(r){return!!(r&&"value"in r&&"simulated_score"in r)}function Ae(r){return r==="v1"||r==="v2"}function Ut(r){if(typeof r!="object"||r===null)return!1;const e=r;return typeof e.score_id=="string"&&Rt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function pt(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=>xt(t))}function xt(r){if(typeof r!="object"||r===null)return!1;const e=r;return Rt(e.bureau)&&typeof e.score=="number"&&typeof e.score_date=="string"}function Rt(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function Gt(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>pt(e))}function Kt(r){return Array.isArray(r)&&r.every(e=>Ut(e))}function Te(r){return Kt(r)}function Ce(r){return Gt(r)}function Pe(r){return Ut(r)}function Ue(r){return pt(r)}function Mt(r){if(typeof r!="object"||r===null)return!1;const e=r;return Et(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function Ht(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=>Xt(t))}function Xt(r){if(typeof r!="object"||r===null)return!1;const e=r;return Et(e.bureau)&&typeof e.reported_at=="string"&&typeof e.categories=="object"&&typeof e.attributes=="object"}function Et(r){return r==="EXPERIAN"||r==="EQUIFAX"||r==="TRANSUNION"}function zt(r){return typeof r=="object"&&r!==null&&"items"in r&&Array.isArray(r.items)&&r.items.every(e=>Ht(e))}function Qt(r){return Array.isArray(r)&&r.every(e=>Mt(e))}function pe(r){return Qt(r)}function Re(r){return zt(r)}i.ConnectedSolutionsClientAuthenticationError=Vt,i.ConnectedSolutionsClientError=d,i.ConnectedSolutionsClientRateLimitError=kt,i.ConnectedSolutionsClientSDKError=It,i.ConnectedSolutionsClientServerSideError=jt,i.ConnectedSolutionsClientSideError=F,i.createSDK=Ft,i.default=Ft,i.isBureauAttribute=Xt,i.isBureauScore=xt,i.isCreditAttribute=Mt,i.isCreditAttributeArray=Qt,i.isCreditAttributeV2=Ht,i.isCreditAttributesV2=zt,i.isCreditScore=Ut,i.isCreditScoreArray=Kt,i.isCreditScoreV2=pt,i.isCreditScoresV2=Gt,i.isFicoPlan=he,i.isFicoRevision=ge,i.isFicoRevisionsRequest=le,i.isFicoScenario=be,i.isFicoScenarioVariation=Se,i.isFicoSimulator=$e,i.isPlanCompleted=Jt,i.isPlanSet=ue,i.isV1GetCreditAttributesResponse=pe,i.isV1GetCreditScoresResponse=Te,i.isV1PostCreditScoresResponse=Pe,i.isV2GetCreditAttributesResponse=Re,i.isV2GetCreditScoresResponse=Ce,i.isV2PostCreditScoresResponse=Ue,i.isValidApiVersion=Ae,i.isValidBureau=Rt,i.isValidBureauAttribute=Et,i.isVantagePlan=de,i.isVantageRevision=fe,i.isVantageRevisionsRequest=ye,i.isVantageScenario=me,i.isVantageScenarioVariation=_e,i.mapApiErrorTypeToSDKErrorType=ot,i.mapHttpStatusToSDKErrorType=at,Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
15
|
+
(function(i,l){typeof exports=="object"&&typeof module<"u"?l(exports):typeof define=="function"&&define.amd?define(["exports"],l):(i=typeof globalThis<"u"?globalThis:i||self,l(i["@experian-ecs/connected-api-sdk"]={}))})(this,function(i){"use strict";var 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"}})});
|
|
16
16
|
//# sourceMappingURL=index.umd.js.map
|