@experian-ecs/connected-api-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/umd/index.umd.js +1 -1
- package/dist/umd/index.umd.js.map +1 -1
- package/package.json +5 -5
package/dist/esm/index.mjs
CHANGED
|
@@ -695,7 +695,7 @@ $ = new WeakMap(), v = new WeakMap(), M = new WeakMap(), m = new WeakSet(), pt =
|
|
|
695
695
|
grant_type: t,
|
|
696
696
|
client_id: e,
|
|
697
697
|
client_secret: s,
|
|
698
|
-
partner_customer_id: n ?? ""
|
|
698
|
+
...t === "trusted_partner" ? { partner_customer_id: n ?? "" } : {}
|
|
699
699
|
})
|
|
700
700
|
}, i = await p(this, m, bt).call(this, o, c);
|
|
701
701
|
if (i != null && i.ok) {
|
package/dist/esm/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/lib/Error.ts","../../src/globals.ts","../../src/lib/ApiClient/ApiClient.ts","../../src/resources/CreditScores/CreditScores.ts","../../src/resources/Entitlements/Entitlements.ts","../../src/resources/CreditAttributes/CreditAttributes.ts","../../src/resources/CreditScoreSimulator/CreditScoreSimulator.ts","../../src/resources/CreditScorePlanner/CreditScorePlanner.ts","../../src/resources/Alerts/Alerts.ts","../../src/resources/CreditReports/CreditReports.ts","../../src/resources/Customers/Customers.ts","../../src/resources/CustomerAuth/CustomerAuth.ts","../../src/resources/Registrations/Registrations.ts","../../src/resources/ProductConfigs/ProductConfigs.ts","../../src/utils.ts","../../src/lib/AuthClient/AuthClient.ts","../../src/lib/SDKClient/SDKClient.ts","../../src/resources/CreditScorePlanner/typeGuards.ts","../../src/resources/CreditScoreSimulator/typeGuards.ts"],"sourcesContent":["export type ConnectedSolutionsAPIErrorData = {\n dev_url: string;\n code: string;\n message: string;\n};\n\nexport type ConnectedSolutionsSDKErrorTypes =\n | 'api_error'\n | 'auth_error'\n | 'sdk_error'\n | 'unknown_error';\n\nexport type ConnectedSolutionsClientRawError = {\n message: string;\n type: ConnectedSolutionsSDKErrorTypes;\n status?: number;\n data?: ConnectedSolutionsAPIErrorData;\n};\n\nfunction generateError(rawError: ConnectedSolutionsClientRawError) {\n switch (rawError.type) {\n case 'api_error':\n return new ConnectedSolutionsClientApiError(rawError);\n case 'auth_error':\n return new ConnectedSolutionsClientAuthError(rawError);\n case 'sdk_error':\n return new ConnectedSolutionsClientSDKError(rawError);\n default:\n return new ConnectedSolutionsClientUnknownError(rawError);\n }\n}\n\nexport class ConnectedSolutionsClientError extends Error {\n readonly message: string;\n readonly data?: ConnectedSolutionsAPIErrorData;\n readonly status?: number;\n\n constructor(raw: ConnectedSolutionsClientRawError) {\n super(raw.message);\n this.message = raw.data?.message || raw.message || '';\n this.data = raw.data;\n this.status = raw.status;\n }\n\n static generateError = generateError;\n}\n\nexport class ConnectedSolutionsClientApiError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientApiError';\n }\n}\n\nexport class ConnectedSolutionsClientAuthError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientAuthError';\n }\n}\n\nexport class ConnectedSolutionsClientUnknownError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientUnknownError';\n }\n}\n\nexport class ConnectedSolutionsClientSDKError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSDKError';\n }\n}\n","export const ENVIRONMENT_URLS = {\n PRODUCTION: 'https://connected-api.experian.com',\n SANDBOX: 'https://sandbox.connected-api.experian.com',\n UAT: 'https://uat-api.ecs.experian.com',\n INTEGRATION: 'https://integration-api.ecs.experian.com',\n DEVELOPMENT: 'https://dev-api.ecs.experian.com'\n};\n\nexport const CONTENTSTACK_URLS = {\n PRODUCTION:\n 'https://unity-contentstack.integration.us-exp-api.experiancs.com',\n SANDBOX: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n UAT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n INTEGRATION: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n DEVELOPMENT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com'\n};\n","import {\n type ConnectedSolutionsClientApiError,\n type ConnectedSolutionsClientAuthError,\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsClientSDKError,\n type ConnectedSolutionsClientUnknownError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport { CONTENTSTACK_URLS, ENVIRONMENT_URLS } from 'globals';\n\nexport type ConnectedSolutionsClientMeta = {\n status: number;\n statusText: string;\n};\n\nexport type ConnectedSolutionsClientErrors =\n | ConnectedSolutionsClientApiError\n | ConnectedSolutionsClientAuthError\n | ConnectedSolutionsClientUnknownError\n | ConnectedSolutionsClientSDKError;\n\nexport type ApiClientResponse<DataType = Record<string, unknown>> =\n | {\n data: DataType;\n error: undefined;\n meta: ConnectedSolutionsClientMeta;\n }\n | {\n data: undefined;\n error: ConnectedSolutionsClientErrors;\n meta: ConnectedSolutionsClientMeta;\n };\n\nexport class ApiClient {\n config: ConnectedSolutionsSDKConfig;\n baseUrl = '';\n contentstackUrl = '';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n const defaultEnvironement = 'PRODUCTION';\n const environment = config.environment ?? defaultEnvironement;\n\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[environment];\n this.contentstackUrl = CONTENTSTACK_URLS[environment];\n }\n\n #validateConfig(): void {\n if (!this.config.token) {\n const error: ConnectedSolutionsClientRawError = {\n type: 'sdk_error',\n message:\n 'You must first obtain and set a token before using an SDK method'\n };\n\n throw ConnectedSolutionsClientError.generateError(error);\n }\n }\n\n #isJsonResponse(response: Response) {\n return (\n response?.headers.get('content-type')?.includes('application/json') ||\n response?.headers\n .get('content-type')\n ?.includes('application/octet-stream')\n );\n }\n\n public setConfig(partialConfig: Partial<ConnectedSolutionsSDKConfig>) {\n if ('environment' in partialConfig) {\n this.config.environment = partialConfig.environment;\n }\n\n if ('token' in partialConfig) {\n this.config.token = partialConfig.token;\n }\n }\n\n public async fetchWithAuth<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n const headers =\n typeof Headers !== 'undefined' && new Headers(init?.headers);\n\n // biome-ignore lint/complexity/useLiteralKeys: works\n if (headers && !headers['Authorization']) {\n headers.set('Authorization', `Bearer ${this.config.token}`);\n }\n\n const options = {\n ...init,\n headers: headers ? headers : init?.headers || {}\n };\n\n const response = await this.fetchRequest<DataType>(input, options);\n\n return response;\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message ?? ''\n }\n };\n }\n }\n\n public async fetchRequest<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n\n const response = await fetch(input, init);\n\n if (!response?.ok) {\n let err: ConnectedSolutionsClientRawError;\n\n const apiError: ConnectedSolutionsClientRawError = {\n type: 'api_error',\n status: response?.status,\n message: response?.statusText\n };\n\n if (\n response?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = response.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n apiError.data = errorJson.error;\n }\n\n if (response?.status === 401) {\n err = {\n ...apiError,\n type: 'auth_error'\n };\n } else {\n err = {\n ...apiError,\n type: 'api_error'\n };\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n if (!this.#isJsonResponse(response)) {\n return {\n data: undefined,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n } as ApiClientResponse<DataType>;\n }\n\n const responseClone = response.clone();\n const json = await responseClone.json();\n\n return {\n data: json,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n };\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message\n }\n };\n }\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditScore } from 'resources/CreditScores/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoresService extends ApiClient {\n static #basePath = '/v1/credit/scores';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScores(\n options?: {\n product_config_id?: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore[]>> {\n const searchOptions: {\n product_config_id?: string;\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(options?.product_config_id\n ? { product_config_id: options.product_config_id }\n : {}),\n ...(options?.include_factors\n ? { include_factors: options.include_factors.toString() }\n : {}),\n ...(options?.include_ingredients\n ? { include_ingredients: options.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async orderCreditScore(\n requestOptions: {\n product_config_id: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore>> {\n const searchOptions: {\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(requestOptions?.include_factors\n ? { include_factors: requestOptions.include_factors.toString() }\n : {}),\n ...(requestOptions?.include_ingredients\n ? { include_ingredients: requestOptions.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}?${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient/ApiClient';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n Entitlement,\n Entitlements,\n ProductEligibility,\n EntitleCustomerResponse\n} from 'resources/Entitlements/types';\n\nexport class EntitlementsService extends ApiClient {\n static #basePath = '/v1/entitlements';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getEntitlements(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlements>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}?customer_id=${requestOptions.customer_id}`,\n fetchOptions\n );\n }\n\n async getEntitlementById(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n fetchOptions\n );\n }\n\n async createEntitlement(\n requestOptions: {\n name: string;\n description: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async updateEntitlement(\n requestOptions: {\n entitlement_id: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { entitlement_id, ...body } = requestOptions;\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'PUT',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async deleteEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async activateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async entitleCustomerToNewProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<EntitleCustomerResponse>> {\n const { product_config_id, entitlement_id, customer_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {}),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'X-Customer-ID': customer_id\n }\n });\n }\n\n async activateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async removeProductFromEntitlement(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getProductEligibility(\n requestOptions: { product_config_id: string; customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductEligibility>> {\n const search = new URLSearchParams(requestOptions).toString();\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/eligibility?${search}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditAttributes } from 'resources/CreditAttributes/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditAttributesService extends ApiClient {\n /**\n * Update the path below to the endpoint of the service you are adding\n */\n static #basePath = '/v1/credit/attributes';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditAttributes(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditAttributes[]>> {\n const endpoint = `${this.baseUrl}${CreditAttributesService.#basePath}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScoreSimulator,\n CreditScoreSimulatorPostRequest,\n CreditScoreSimulatorPostResponse,\n SimulationCategoryType\n} from 'resources/CreditScoreSimulator/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoreSimulatorService extends ApiClient {\n static #basePath = '/v1/credit/tools/simulator';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getSimulations(\n requestOptions: {\n product_config_id: string;\n run_all?: boolean;\n cateogory?: SimulationCategoryType;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulator>> {\n const searchOptions = {\n ...requestOptions,\n ...(requestOptions?.run_all\n ? { run_all: requestOptions.run_all.toString() }\n : {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async simulateScenario(\n requestOptions: CreditScoreSimulatorPostRequest & {\n product_config_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulatorPostResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n return this.fetchWithAuth(\n `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n }\n );\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScorePlan,\n ScorePlanCreateResponse,\n ScorePlanRevision,\n ScorePlanRevisionsRequest\n} from 'resources/CreditScorePlanner/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScorePlannerService extends ApiClient {\n static #basePath = '/v1/credit/tools/planners';\n static #revisionPath = '/revisions';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScorePlan>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n\n async createCreditScorePlan(\n requestOptions: ScorePlanRevision & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanCreateResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<void>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getCreditScorePlanRevisions(\n requestOptions: ScorePlanRevisionsRequest & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanRevision[]>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${CreditScorePlannerService.#revisionPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n body: JSON.stringify(requestBody),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { Alert, Alerts, TotalAlertCounts } from 'resources/Alerts/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class AlertsService extends ApiClient {\n static #basePath = '/v1/events-alerts';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAlerts(\n requestOptions?: {\n page_limit: number;\n next_page_token: string | null;\n disposition_status?: 'READ' | 'UNREAD';\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alerts>> {\n const options = {\n page_limit: '10',\n next_page_token: '',\n ...(requestOptions ?? {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(options).toString();\n\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}?${query}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getAlertById(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markAlertAsRead(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}/dispose`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n ...(fetchOptions ?? {})\n });\n }\n\n async getAlertCounts(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<TotalAlertCounts>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/counts`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreditReportMeta,\n CreditReport\n} from 'resources/CreditReports/types';\n\nexport class CreditReportsService extends ApiClient {\n static #basePath = '/v1/credit/reports';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getReports(\n requestOptions?: {\n product_config_id?: string;\n include_fields?: string;\n report_date?: string;\n report_between?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport[]>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportById(\n requestOptions: {\n id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportsMeta(\n requestOptions?: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: boolean;\n report_read?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta[]>> {\n const { latest_only, report_read, ...options } = requestOptions ?? {};\n\n const searchOptions: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: string;\n report_read?: string;\n } = {\n ...(options ?? {}),\n ...(latest_only ? { latest_only: latest_only.toString() } : {}),\n ...(report_read ? { report_read: report_read.toString() } : {})\n };\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportMetaById(\n requestOptions: {\n id: string;\n product_config_id?: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${id}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markReportAsRead(\n requestOptions: {\n id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}/read`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PUT',\n ...(fetchOptions ?? {})\n });\n }\n\n async orderReport(\n requestOptions: {\n product_config_id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const searchOptions = {\n ...(requestOptions.include_fields\n ? { include_fields: requestOptions.include_fields.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreateCustomerOptions,\n Customer,\n CustomerSearchOptions,\n CustomerSearchResults\n} from 'resources/Customers/types';\n\nexport class CustomersService extends ApiClient {\n static #basePath = '/v1/customers';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCustomerById(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async updateCustomer(\n requestOptions: Pick<Customer, 'customer_id'> &\n Partial<Omit<Customer, 'customer_id'>>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const { customer_id, ...updates } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(updates ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCustomer(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async createCustomer(\n requestOptions: CreateCustomerOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async searchCustomers(\n requestOptions: CustomerSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CustomerSearchResults>> {\n const { next_cursor = '', ...searchOptions } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/search`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ next_cursor, ...(searchOptions ?? {}) }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient } from 'lib/ApiClient';\nimport type {\n ApiClientResponse,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type {\n AuthAnswersRequest,\n AuthQuestions\n} from 'resources/CustomerAuth/types';\n\nexport class CustomerAuthService extends ApiClient {\n static #basePath = '/v1/authentication';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAuthQuestions(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<AuthQuestions>> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async submitAuthAnswers(\n answers: AuthAnswersRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(answers),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nimport type {\n CreateRegistrationsRequest,\n CreateRegistrationsResponse\n} from 'resources/Registrations/types';\n\nexport class RegistrationsService extends ApiClient {\n static #basePath = '/v1/registrations';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async createRegistration(\n requestOptions: CreateRegistrationsRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreateRegistrationsResponse>> {\n const endpoint = `${this.baseUrl}${RegistrationsService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n ProductConfig,\n ProductConfigsSearchOptions,\n ProductConfigs\n} from 'resources/ProductConfigs/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class ProductConfigsService extends ApiClient {\n static #basePath = '/v1/product-configs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getProductConfigs(\n searchOptions: ProductConfigsSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfigs>> {\n const { fromEntries, entries } = Object;\n const { isArray } = Array;\n\n const options = fromEntries(\n entries(searchOptions)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [\n key,\n isArray(value) ? value.join(',') : value.toString()\n ])\n );\n const query = new URLSearchParams(options).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ? fetchOptions : {})\n });\n }\n\n async getProductConfigById(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfig>> {\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}/${requestOptions.product_config_id}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n}\n","export function pascalToCamelCase(name: string): string {\n const result = `${name[0].toLowerCase()}${name.substring(1)}`.replace(\n 'Service',\n ''\n );\n\n return result;\n}\n\nexport const isNode =\n typeof process !== 'undefined' &&\n process.versions &&\n process.versions.node &&\n typeof window === 'undefined';\n","import {\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport { ENVIRONMENT_URLS } from 'src/globals';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient';\nimport { isNode } from 'utils';\n\nexport type BearerToken = {\n access_token: string;\n token_type: string;\n expires_in: number;\n expires: string;\n};\n\nexport type AuthCredentials = {\n grantType: 'client_credentials' | 'trusted_partner';\n clientId: string;\n clientSecret: string;\n customerId?: string;\n};\n\nexport type AuthServiceConfig = Omit<ConnectedSolutionsSDKConfig, 'token'>;\n\nexport class AuthService {\n config: AuthServiceConfig;\n #cache: Map<string, Promise<Response>>;\n #ttl: number | null = null;\n baseUrl = '';\n\n static #basePath = '/v1/oauth2/token';\n\n constructor(config: AuthServiceConfig) {\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[config.environment ?? 'PRODUCTION'];\n this.#cache = new Map();\n }\n\n public async getAccessToken(credentials: AuthCredentials) {\n const isBrowser = !isNode;\n\n if (isBrowser) {\n throw ConnectedSolutionsClientError.generateError({\n type: 'sdk_error',\n message: 'getAccessToken is not supported in browser'\n });\n }\n\n try {\n const response = await this.#fetchToken(credentials);\n\n return {\n data: response,\n errors: undefined,\n meta: {\n status: 200,\n statusText: 'OK'\n }\n };\n } catch (e) {\n // don't cache errors\n this.clearCache();\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status,\n statusText: e.message\n }\n };\n }\n }\n\n public getCacheLength() {\n return this.#cache.size;\n }\n\n public clearCache(): void {\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const cacheKeys = Array.from(this.#cache.keys()).filter((key) =>\n key.includes(endpoint)\n );\n\n for (const key of cacheKeys) {\n this.#cache.delete(key);\n }\n }\n\n async #fetchToken({\n grantType,\n clientId,\n clientSecret,\n customerId\n }: AuthCredentials) {\n this.#checkTokenExpiry();\n\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const options = {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'include' as RequestCredentials,\n body: JSON.stringify({\n grant_type: grantType,\n client_id: clientId,\n client_secret: clientSecret,\n partner_customer_id: customerId ?? ''\n })\n };\n\n const tokenRequest = await this.#executeRequest(endpoint, options);\n\n if (tokenRequest?.ok) {\n const tokenRequestClone = tokenRequest.clone();\n const accessToken = (await tokenRequestClone.json()) as BearerToken;\n\n if (this.#ttl === null) {\n this.#setTTL(accessToken.expires_in);\n }\n\n return accessToken;\n }\n\n // response was not ok\n let err: ConnectedSolutionsClientRawError;\n\n const errorMeta = {\n status: tokenRequest?.status,\n message: tokenRequest?.statusText || '',\n data: undefined\n };\n\n if (tokenRequest?.status === 401) {\n err = {\n type: 'auth_error',\n ...errorMeta\n };\n } else {\n err = {\n type: 'api_error',\n ...errorMeta\n };\n }\n\n if (\n tokenRequest?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = tokenRequest.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n err.data = errorJson.error;\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n #setTTL(value: number | null) {\n const now = new Date().getTime();\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const nextTimestamp = now + oneHourInMilliseconds;\n const nextState =\n value === null ? value : new Date(nextTimestamp).valueOf();\n\n this.#ttl = nextState;\n }\n\n #checkTokenExpiry() {\n const now = new Date(Date.now());\n const expires = new Date(this.#ttl ?? Number.NaN);\n const isTokenExpired = isAfter(now, expires);\n\n if (isTokenExpired) {\n this.#setTTL(null);\n this.#cache.clear();\n }\n }\n\n async #executeRequest(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<Response | undefined> {\n const cacheKey = `${input}${JSON.stringify(init || {})}`;\n\n if (!this.#cache.has(cacheKey)) {\n const promise = fetch(input, init ?? {});\n this.#cache.set(cacheKey, promise);\n }\n\n return await this.#cache.get(cacheKey);\n }\n}\n\nfunction isAfter(date1: Date, date2: Date) {\n return date1 > date2;\n}\n","import * as resources from 'resources';\nimport { pascalToCamelCase } from 'utils';\nimport type { CreditScoresService } from 'resources/CreditScores';\nimport type { EntitlementsService } from 'resources/Entitlements';\nimport type {\n ConnectedSolutionsSDK,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type { CreditScoreSimulatorService } from 'resources/CreditScoreSimulator/CreditScoreSimulator';\nimport type { CreditScorePlannerService } from 'resources/CreditScorePlanner';\nimport type { CreditAttributesService } from 'resources/CreditAttributes/CreditAttributes';\nimport { AuthService } from 'lib/AuthClient/AuthClient';\nimport { ApiClient } from 'lib/ApiClient';\nimport type { AlertsService } from 'resources/Alerts';\nimport type { CreditReportsService } from 'resources/CreditReports';\nimport type { CustomersService } from 'resources/Customers';\nimport type { CustomerAuthService } from 'resources/CustomerAuth';\nimport type { RegistrationsService } from 'resources/Registrations';\nimport type { ProductConfigsService } from 'resources/ProductConfigs';\n// new service imports go here\n\nexport class SDKClient extends ApiClient implements ConnectedSolutionsSDK {\n static #instance: SDKClient | null = null;\n alerts: AlertsService;\n auth: AuthService;\n creditReports: CreditReportsService;\n creditScores: CreditScoresService;\n creditAttributes: CreditAttributesService;\n creditScorePlanner: CreditScorePlannerService;\n creditScoreSimulator: CreditScoreSimulatorService;\n customerAuth: CustomerAuthService;\n customers: CustomersService;\n entitlements: EntitlementsService;\n productConfigs: ProductConfigsService;\n registrations: RegistrationsService;\n // new services go here\n\n // The method is static as we need to access the method only through the class here\n static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient {\n // if instance is already created return that otherwise create it\n if (SDKClient.#instance) {\n return SDKClient.#instance;\n }\n\n SDKClient.#instance = new SDKClient(config);\n return SDKClient.#instance;\n }\n\n static clearInstance() {\n SDKClient.#instance = null;\n }\n\n // constructor is private so that no other class can access it.\n private constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n for (const name in resources) {\n if (typeof resources[name] === 'function') {\n this[pascalToCamelCase(name)] = new resources[name](config);\n }\n }\n\n this.auth = new AuthService({\n environment: config.environment\n });\n }\n}\n\nexport function createSDK(userConfig: ConnectedSolutionsSDKConfig) {\n return SDKClient.getInstance(userConfig);\n}\n","import type {\n CreditScorePlan,\n FicoCreditScorePlanCompleted,\n VantageCreditScorePlanCompleted,\n FicoCreditScorePlanSet,\n VantageCreditScorePlanSet,\n VantageCreditScorePlan,\n FicoCreditScorePlan,\n ScorePlanRevisionsRequest,\n FicoScorePlanRevisionsRequest,\n VantageScorePlanRevisionsRequest,\n ScorePlanRevision,\n FicoScorePlanRevision,\n VantageScorePlanRevision\n} from 'resources/CreditScorePlanner/types';\n\nexport function isPlanCompleted(\n plan: CreditScorePlan\n): plan is FicoCreditScorePlanCompleted | VantageCreditScorePlanCompleted {\n return (\n plan.progress_status === 'TARGET_NOT_MET' ||\n plan.progress_status === 'COMPLETED'\n );\n}\n\nexport function isPlanSet(\n plan: CreditScorePlan\n): plan is\n | FicoCreditScorePlanCompleted\n | FicoCreditScorePlanSet\n | VantageCreditScorePlanCompleted\n | VantageCreditScorePlanSet {\n return (\n isPlanCompleted(plan) ||\n plan.progress_status === 'TARGET_SCORE_AND_PLAN_SET' ||\n plan.progress_status === 'ON_TRACK' ||\n plan.progress_status === 'OFF_TRACK'\n );\n}\n\nexport function isVantagePlan(\n plan: CreditScorePlan\n): plan is VantageCreditScorePlan {\n return plan.score_model.includes('VANTAGE');\n}\n\nexport function isFicoPlan(plan: CreditScorePlan): plan is FicoCreditScorePlan {\n return plan.score_model.includes('FICO');\n}\n\nexport function isFicoRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is FicoScorePlanRevisionsRequest {\n return (request as FicoScorePlanRevisionsRequest).target_score !== undefined;\n}\n\nexport function isVantageRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is VantageScorePlanRevisionsRequest {\n return (\n (request as VantageScorePlanRevisionsRequest).max_actions_per_plan !==\n undefined\n );\n}\n\nexport function isFicoRevision(\n revision: ScorePlanRevision\n): revision is FicoScorePlanRevision {\n return revision.score_model.includes('FICO');\n}\n\nexport function isVantageRevision(\n revision: ScorePlanRevision\n): revision is VantageScorePlanRevision {\n return revision.score_model.includes('VANTAGE');\n}\n","import type {\n CreditScoreSimulator,\n FicoScenario,\n FicoScenarioVariation,\n FicoScoreSimulator,\n Scenario,\n ScenarioVariation,\n VantageScenario,\n VantageScenarioVariation\n} from 'resources/CreditScoreSimulator/types';\n\nexport function isFicoSimulator(\n data?: CreditScoreSimulator\n): data is FicoScoreSimulator {\n return Boolean(data && 'best_action' in data);\n}\n\nexport function isVantageScenario(\n scenario?: Scenario\n): scenario is VantageScenario {\n return Boolean(scenario && 'simulated_score' in scenario);\n}\n\nexport function isFicoScenario(scenario: Scenario): scenario is FicoScenario {\n return !('simulated_score' in scenario);\n}\n\nexport function isFicoScenarioVariation(\n variation?: ScenarioVariation\n): variation is FicoScenarioVariation {\n return Boolean(\n variation &&\n 'slider_min_value' in variation &&\n 'slider_max_value' in variation\n );\n}\n\nexport function isVantageScenarioVariation(\n variation?: ScenarioVariation\n): variation is VantageScenarioVariation {\n return Boolean(\n variation && 'value' in variation && 'simulated_score' in variation\n );\n}\n"],"names":["generateError","rawError","ConnectedSolutionsClientApiError","ConnectedSolutionsClientAuthError","ConnectedSolutionsClientSDKError","ConnectedSolutionsClientUnknownError","ConnectedSolutionsClientError","raw","_a","__publicField","args","ENVIRONMENT_URLS","CONTENTSTACK_URLS","_ApiClient_instances","validateConfig_fn","isJsonResponse_fn","ApiClient","config","__privateAdd","environment","partialConfig","input","init","__privateMethod","headers","options","error","e","response","err","apiError","errorJson","_b","_basePath","_CreditScoresService","fetchOptions","searchOptions","query","queryString","endpoint","__privateGet","requestOptions","CreditScoresService","_EntitlementsService","entitlement_id","body","product_config_id","customer_id","search","EntitlementsService","_CreditAttributesService","CreditAttributesService","_CreditScoreSimulatorService","requestBody","CreditScoreSimulatorService","_revisionPath","_CreditScorePlannerService","CreditScorePlannerService","_AlertsService","id","AlertsService","_CreditReportsService","latest_only","report_read","CreditReportsService","_CustomersService","updates","next_cursor","CustomersService","_CustomerAuthService","answers","CustomerAuthService","_RegistrationsService","RegistrationsService","_ProductConfigsService","fromEntries","entries","isArray","value","key","ProductConfigsService","pascalToCamelCase","name","isNode","_cache","_ttl","_AuthService_instances","fetchToken_fn","setTTL_fn","checkTokenExpiry_fn","executeRequest_fn","_AuthService","__privateSet","credentials","cacheKeys","grantType","clientId","clientSecret","customerId","tokenRequest","accessToken","errorMeta","now","oneHourInMilliseconds","nextTimestamp","nextState","expires","isAfter","cacheKey","promise","AuthService","date1","date2","_instance","_SDKClient","resources","SDKClient","createSDK","userConfig","isPlanCompleted","plan","isPlanSet","isVantagePlan","isFicoPlan","isFicoRevisionsRequest","request","isVantageRevisionsRequest","isFicoRevision","revision","isVantageRevision","isFicoSimulator","data","isVantageScenario","scenario","isFicoScenario","isFicoScenarioVariation","variation","isVantageScenarioVariation"],"mappings":";;;;;;;AAmBA,SAASA,GAAcC,GAA4C;AACjE,UAAQA,EAAS,MAAM;AAAA,IACrB,KAAK;AACI,aAAA,IAAIC,GAAiCD,CAAQ;AAAA,IACtD,KAAK;AACI,aAAA,IAAIE,GAAkCF,CAAQ;AAAA,IACvD,KAAK;AACI,aAAA,IAAIG,GAAiCH,CAAQ;AAAA,IACtD;AACS,aAAA,IAAII,GAAqCJ,CAAQ;AAAA,EAAA;AAE9D;AAEO,MAAMK,UAAsC,MAAM;AAAA,EAKvD,YAAYC,GAAuC;AAlBrD,QAAAC;AAmBI,UAAMD,EAAI,OAAO;AALV,IAAAE,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAIP,SAAK,YAAUD,IAAAD,EAAI,SAAJ,gBAAAC,EAAU,YAAWD,EAAI,WAAW,IACnD,KAAK,OAAOA,EAAI,MAChB,KAAK,SAASA,EAAI;AAAA,EAAA;AAItB;AADEE,EAZWH,GAYJ,iBAAgBN;AAGlB,MAAME,WAAyCI,EAA8B;AAAA,EAClF,YAAYI,GAAwC;AAClD,UAAMA,CAAI,GACV,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAMP,WAA0CG,EAA8B;AAAA,EACnF,YAAYI,GAAwC;AAClD,UAAMA,CAAI,GACV,KA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EJ;AAEO,SAASE,GACdC,GACmC;AAC5B,SAAAA,EAAS,YAAY,SAAS,MAAM;AAC7C;AAEO,SAASC,GACdD,GACsC;AAC/B,SAAAA,EAAS,YAAY,SAAS,SAAS;AAChD;AChEO,SAASE,GACdC,GAC4B;AACrB,SAAA,GAAQA,KAAQ,iBAAiBA;AAC1C;AAEO,SAASC,GACdC,GAC6B;AACtB,SAAA,GAAQA,KAAY,qBAAqBA;AAClD;AAEO,SAASC,GAAeD,GAA8C;AAC3E,SAAO,EAAE,qBAAqBA;AAChC;AAEO,SAASE,GACdC,GACoC;AAC7B,SAAA,GACLA,KACE,sBAAsBA,KACtB,sBAAsBA;AAE5B;AAEO,SAASC,GACdD,GACuC;AAChC,SAAA,GACLA,KAAa,WAAWA,KAAa,qBAAqBA;AAE9D;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../src/lib/Error.ts","../../src/globals.ts","../../src/lib/ApiClient/ApiClient.ts","../../src/resources/CreditScores/CreditScores.ts","../../src/resources/Entitlements/Entitlements.ts","../../src/resources/CreditAttributes/CreditAttributes.ts","../../src/resources/CreditScoreSimulator/CreditScoreSimulator.ts","../../src/resources/CreditScorePlanner/CreditScorePlanner.ts","../../src/resources/Alerts/Alerts.ts","../../src/resources/CreditReports/CreditReports.ts","../../src/resources/Customers/Customers.ts","../../src/resources/CustomerAuth/CustomerAuth.ts","../../src/resources/Registrations/Registrations.ts","../../src/resources/ProductConfigs/ProductConfigs.ts","../../src/utils.ts","../../src/lib/AuthClient/AuthClient.ts","../../src/lib/SDKClient/SDKClient.ts","../../src/resources/CreditScorePlanner/typeGuards.ts","../../src/resources/CreditScoreSimulator/typeGuards.ts"],"sourcesContent":["export type ConnectedSolutionsAPIErrorData = {\n dev_url: string;\n code: string;\n message: string;\n};\n\nexport type ConnectedSolutionsSDKErrorTypes =\n | 'api_error'\n | 'auth_error'\n | 'sdk_error'\n | 'unknown_error';\n\nexport type ConnectedSolutionsClientRawError = {\n message: string;\n type: ConnectedSolutionsSDKErrorTypes;\n status?: number;\n data?: ConnectedSolutionsAPIErrorData;\n};\n\nfunction generateError(rawError: ConnectedSolutionsClientRawError) {\n switch (rawError.type) {\n case 'api_error':\n return new ConnectedSolutionsClientApiError(rawError);\n case 'auth_error':\n return new ConnectedSolutionsClientAuthError(rawError);\n case 'sdk_error':\n return new ConnectedSolutionsClientSDKError(rawError);\n default:\n return new ConnectedSolutionsClientUnknownError(rawError);\n }\n}\n\nexport class ConnectedSolutionsClientError extends Error {\n readonly message: string;\n readonly data?: ConnectedSolutionsAPIErrorData;\n readonly status?: number;\n\n constructor(raw: ConnectedSolutionsClientRawError) {\n super(raw.message);\n this.message = raw.data?.message || raw.message || '';\n this.data = raw.data;\n this.status = raw.status;\n }\n\n static generateError = generateError;\n}\n\nexport class ConnectedSolutionsClientApiError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientApiError';\n }\n}\n\nexport class ConnectedSolutionsClientAuthError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientAuthError';\n }\n}\n\nexport class ConnectedSolutionsClientUnknownError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientUnknownError';\n }\n}\n\nexport class ConnectedSolutionsClientSDKError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSDKError';\n }\n}\n","export const ENVIRONMENT_URLS = {\n PRODUCTION: 'https://connected-api.experian.com',\n SANDBOX: 'https://sandbox.connected-api.experian.com',\n UAT: 'https://uat-api.ecs.experian.com',\n INTEGRATION: 'https://integration-api.ecs.experian.com',\n DEVELOPMENT: 'https://dev-api.ecs.experian.com'\n};\n\nexport const CONTENTSTACK_URLS = {\n PRODUCTION:\n 'https://unity-contentstack.integration.us-exp-api.experiancs.com',\n SANDBOX: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n UAT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n INTEGRATION: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n DEVELOPMENT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com'\n};\n","import {\n type ConnectedSolutionsClientApiError,\n type ConnectedSolutionsClientAuthError,\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsClientSDKError,\n type ConnectedSolutionsClientUnknownError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport { CONTENTSTACK_URLS, ENVIRONMENT_URLS } from 'globals';\n\nexport type ConnectedSolutionsClientMeta = {\n status: number;\n statusText: string;\n};\n\nexport type ConnectedSolutionsClientErrors =\n | ConnectedSolutionsClientApiError\n | ConnectedSolutionsClientAuthError\n | ConnectedSolutionsClientUnknownError\n | ConnectedSolutionsClientSDKError;\n\nexport type ApiClientResponse<DataType = Record<string, unknown>> =\n | {\n data: DataType;\n error: undefined;\n meta: ConnectedSolutionsClientMeta;\n }\n | {\n data: undefined;\n error: ConnectedSolutionsClientErrors;\n meta: ConnectedSolutionsClientMeta;\n };\n\nexport class ApiClient {\n config: ConnectedSolutionsSDKConfig;\n baseUrl = '';\n contentstackUrl = '';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n const defaultEnvironement = 'PRODUCTION';\n const environment = config.environment ?? defaultEnvironement;\n\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[environment];\n this.contentstackUrl = CONTENTSTACK_URLS[environment];\n }\n\n #validateConfig(): void {\n if (!this.config.token) {\n const error: ConnectedSolutionsClientRawError = {\n type: 'sdk_error',\n message:\n 'You must first obtain and set a token before using an SDK method'\n };\n\n throw ConnectedSolutionsClientError.generateError(error);\n }\n }\n\n #isJsonResponse(response: Response) {\n return (\n response?.headers.get('content-type')?.includes('application/json') ||\n response?.headers\n .get('content-type')\n ?.includes('application/octet-stream')\n );\n }\n\n public setConfig(partialConfig: Partial<ConnectedSolutionsSDKConfig>) {\n if ('environment' in partialConfig) {\n this.config.environment = partialConfig.environment;\n }\n\n if ('token' in partialConfig) {\n this.config.token = partialConfig.token;\n }\n }\n\n public async fetchWithAuth<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n const headers =\n typeof Headers !== 'undefined' && new Headers(init?.headers);\n\n // biome-ignore lint/complexity/useLiteralKeys: works\n if (headers && !headers['Authorization']) {\n headers.set('Authorization', `Bearer ${this.config.token}`);\n }\n\n const options = {\n ...init,\n headers: headers ? headers : init?.headers || {}\n };\n\n const response = await this.fetchRequest<DataType>(input, options);\n\n return response;\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message ?? ''\n }\n };\n }\n }\n\n public async fetchRequest<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n\n const response = await fetch(input, init);\n\n if (!response?.ok) {\n let err: ConnectedSolutionsClientRawError;\n\n const apiError: ConnectedSolutionsClientRawError = {\n type: 'api_error',\n status: response?.status,\n message: response?.statusText\n };\n\n if (\n response?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = response.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n apiError.data = errorJson.error;\n }\n\n if (response?.status === 401) {\n err = {\n ...apiError,\n type: 'auth_error'\n };\n } else {\n err = {\n ...apiError,\n type: 'api_error'\n };\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n if (!this.#isJsonResponse(response)) {\n return {\n data: undefined,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n } as ApiClientResponse<DataType>;\n }\n\n const responseClone = response.clone();\n const json = await responseClone.json();\n\n return {\n data: json,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n };\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message\n }\n };\n }\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditScore } from 'resources/CreditScores/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoresService extends ApiClient {\n static #basePath = '/v1/credit/scores';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScores(\n options?: {\n product_config_id?: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore[]>> {\n const searchOptions: {\n product_config_id?: string;\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(options?.product_config_id\n ? { product_config_id: options.product_config_id }\n : {}),\n ...(options?.include_factors\n ? { include_factors: options.include_factors.toString() }\n : {}),\n ...(options?.include_ingredients\n ? { include_ingredients: options.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async orderCreditScore(\n requestOptions: {\n product_config_id: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore>> {\n const searchOptions: {\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(requestOptions?.include_factors\n ? { include_factors: requestOptions.include_factors.toString() }\n : {}),\n ...(requestOptions?.include_ingredients\n ? { include_ingredients: requestOptions.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}?${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient/ApiClient';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n Entitlement,\n Entitlements,\n ProductEligibility,\n EntitleCustomerResponse\n} from 'resources/Entitlements/types';\n\nexport class EntitlementsService extends ApiClient {\n static #basePath = '/v1/entitlements';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getEntitlements(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlements>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}?customer_id=${requestOptions.customer_id}`,\n fetchOptions\n );\n }\n\n async getEntitlementById(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n fetchOptions\n );\n }\n\n async createEntitlement(\n requestOptions: {\n name: string;\n description: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async updateEntitlement(\n requestOptions: {\n entitlement_id: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { entitlement_id, ...body } = requestOptions;\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'PUT',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async deleteEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async activateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async entitleCustomerToNewProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<EntitleCustomerResponse>> {\n const { product_config_id, entitlement_id, customer_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {}),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'X-Customer-ID': customer_id\n }\n });\n }\n\n async activateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async removeProductFromEntitlement(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getProductEligibility(\n requestOptions: { product_config_id: string; customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductEligibility>> {\n const search = new URLSearchParams(requestOptions).toString();\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/eligibility?${search}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditAttributes } from 'resources/CreditAttributes/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditAttributesService extends ApiClient {\n /**\n * Update the path below to the endpoint of the service you are adding\n */\n static #basePath = '/v1/credit/attributes';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditAttributes(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditAttributes[]>> {\n const endpoint = `${this.baseUrl}${CreditAttributesService.#basePath}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScoreSimulator,\n CreditScoreSimulatorPostRequest,\n CreditScoreSimulatorPostResponse,\n SimulationCategoryType\n} from 'resources/CreditScoreSimulator/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoreSimulatorService extends ApiClient {\n static #basePath = '/v1/credit/tools/simulator';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getSimulations(\n requestOptions: {\n product_config_id: string;\n run_all?: boolean;\n cateogory?: SimulationCategoryType;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulator>> {\n const searchOptions = {\n ...requestOptions,\n ...(requestOptions?.run_all\n ? { run_all: requestOptions.run_all.toString() }\n : {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async simulateScenario(\n requestOptions: CreditScoreSimulatorPostRequest & {\n product_config_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulatorPostResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n return this.fetchWithAuth(\n `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n }\n );\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScorePlan,\n ScorePlanCreateResponse,\n ScorePlanRevision,\n ScorePlanRevisionsRequest\n} from 'resources/CreditScorePlanner/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScorePlannerService extends ApiClient {\n static #basePath = '/v1/credit/tools/planners';\n static #revisionPath = '/revisions';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScorePlan>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n\n async createCreditScorePlan(\n requestOptions: ScorePlanRevision & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanCreateResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<void>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getCreditScorePlanRevisions(\n requestOptions: ScorePlanRevisionsRequest & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanRevision[]>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${CreditScorePlannerService.#revisionPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n body: JSON.stringify(requestBody),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { Alert, Alerts, TotalAlertCounts } from 'resources/Alerts/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class AlertsService extends ApiClient {\n static #basePath = '/v1/events-alerts';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAlerts(\n requestOptions?: {\n page_limit: number;\n next_page_token: string | null;\n disposition_status?: 'READ' | 'UNREAD';\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alerts>> {\n const options = {\n page_limit: '10',\n next_page_token: '',\n ...(requestOptions ?? {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(options).toString();\n\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}?${query}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getAlertById(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markAlertAsRead(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}/dispose`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n ...(fetchOptions ?? {})\n });\n }\n\n async getAlertCounts(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<TotalAlertCounts>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/counts`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreditReportMeta,\n CreditReport\n} from 'resources/CreditReports/types';\n\nexport class CreditReportsService extends ApiClient {\n static #basePath = '/v1/credit/reports';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getReports(\n requestOptions?: {\n product_config_id?: string;\n include_fields?: string;\n report_date?: string;\n report_between?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport[]>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportById(\n requestOptions: {\n id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportsMeta(\n requestOptions?: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: boolean;\n report_read?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta[]>> {\n const { latest_only, report_read, ...options } = requestOptions ?? {};\n\n const searchOptions: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: string;\n report_read?: string;\n } = {\n ...(options ?? {}),\n ...(latest_only ? { latest_only: latest_only.toString() } : {}),\n ...(report_read ? { report_read: report_read.toString() } : {})\n };\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportMetaById(\n requestOptions: {\n id: string;\n product_config_id?: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${id}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markReportAsRead(\n requestOptions: {\n id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}/read`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PUT',\n ...(fetchOptions ?? {})\n });\n }\n\n async orderReport(\n requestOptions: {\n product_config_id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const searchOptions = {\n ...(requestOptions.include_fields\n ? { include_fields: requestOptions.include_fields.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreateCustomerOptions,\n Customer,\n CustomerSearchOptions,\n CustomerSearchResults\n} from 'resources/Customers/types';\n\nexport class CustomersService extends ApiClient {\n static #basePath = '/v1/customers';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCustomerById(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async updateCustomer(\n requestOptions: Pick<Customer, 'customer_id'> &\n Partial<Omit<Customer, 'customer_id'>>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const { customer_id, ...updates } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(updates ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCustomer(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async createCustomer(\n requestOptions: CreateCustomerOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async searchCustomers(\n requestOptions: CustomerSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CustomerSearchResults>> {\n const { next_cursor = '', ...searchOptions } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/search`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ next_cursor, ...(searchOptions ?? {}) }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient } from 'lib/ApiClient';\nimport type {\n ApiClientResponse,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type {\n AuthAnswersRequest,\n AuthQuestions\n} from 'resources/CustomerAuth/types';\n\nexport class CustomerAuthService extends ApiClient {\n static #basePath = '/v1/authentication';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAuthQuestions(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<AuthQuestions>> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async submitAuthAnswers(\n answers: AuthAnswersRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(answers),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nimport type {\n CreateRegistrationsRequest,\n CreateRegistrationsResponse\n} from 'resources/Registrations/types';\n\nexport class RegistrationsService extends ApiClient {\n static #basePath = '/v1/registrations';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async createRegistration(\n requestOptions: CreateRegistrationsRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreateRegistrationsResponse>> {\n const endpoint = `${this.baseUrl}${RegistrationsService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n ProductConfig,\n ProductConfigsSearchOptions,\n ProductConfigs\n} from 'resources/ProductConfigs/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class ProductConfigsService extends ApiClient {\n static #basePath = '/v1/product-configs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getProductConfigs(\n searchOptions: ProductConfigsSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfigs>> {\n const { fromEntries, entries } = Object;\n const { isArray } = Array;\n\n const options = fromEntries(\n entries(searchOptions)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [\n key,\n isArray(value) ? value.join(',') : value.toString()\n ])\n );\n const query = new URLSearchParams(options).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ? fetchOptions : {})\n });\n }\n\n async getProductConfigById(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfig>> {\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}/${requestOptions.product_config_id}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n}\n","export function pascalToCamelCase(name: string): string {\n const result = `${name[0].toLowerCase()}${name.substring(1)}`.replace(\n 'Service',\n ''\n );\n\n return result;\n}\n\nexport const isNode =\n typeof process !== 'undefined' &&\n process.versions &&\n process.versions.node &&\n typeof window === 'undefined';\n","import {\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport { ENVIRONMENT_URLS } from 'src/globals';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient';\nimport { isNode } from 'utils';\n\nexport type BearerToken = {\n access_token: string;\n token_type: string;\n expires_in: number;\n expires: string;\n};\n\nexport type AuthCredentials = {\n grantType: 'client_credentials' | 'trusted_partner';\n clientId: string;\n clientSecret: string;\n customerId?: string;\n};\n\nexport type AuthServiceConfig = Omit<ConnectedSolutionsSDKConfig, 'token'>;\n\nexport class AuthService {\n config: AuthServiceConfig;\n #cache: Map<string, Promise<Response>>;\n #ttl: number | null = null;\n baseUrl = '';\n\n static #basePath = '/v1/oauth2/token';\n\n constructor(config: AuthServiceConfig) {\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[config.environment ?? 'PRODUCTION'];\n this.#cache = new Map();\n }\n\n public async getAccessToken(credentials: AuthCredentials) {\n const isBrowser = !isNode;\n\n if (isBrowser) {\n throw ConnectedSolutionsClientError.generateError({\n type: 'sdk_error',\n message: 'getAccessToken is not supported in browser'\n });\n }\n\n try {\n const response = await this.#fetchToken(credentials);\n\n return {\n data: response,\n errors: undefined,\n meta: {\n status: 200,\n statusText: 'OK'\n }\n };\n } catch (e) {\n // don't cache errors\n this.clearCache();\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status,\n statusText: e.message\n }\n };\n }\n }\n\n public getCacheLength() {\n return this.#cache.size;\n }\n\n public clearCache(): void {\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const cacheKeys = Array.from(this.#cache.keys()).filter((key) =>\n key.includes(endpoint)\n );\n\n for (const key of cacheKeys) {\n this.#cache.delete(key);\n }\n }\n\n async #fetchToken({\n grantType,\n clientId,\n clientSecret,\n customerId\n }: AuthCredentials) {\n this.#checkTokenExpiry();\n\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const options = {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'include' as RequestCredentials,\n body: JSON.stringify({\n grant_type: grantType,\n client_id: clientId,\n client_secret: clientSecret,\n ...(grantType === 'trusted_partner'\n ? { partner_customer_id: customerId ?? '' }\n : {})\n })\n };\n\n const tokenRequest = await this.#executeRequest(endpoint, options);\n\n if (tokenRequest?.ok) {\n const tokenRequestClone = tokenRequest.clone();\n const accessToken = (await tokenRequestClone.json()) as BearerToken;\n\n if (this.#ttl === null) {\n this.#setTTL(accessToken.expires_in);\n }\n\n return accessToken;\n }\n\n // response was not ok\n let err: ConnectedSolutionsClientRawError;\n\n const errorMeta = {\n status: tokenRequest?.status,\n message: tokenRequest?.statusText || '',\n data: undefined\n };\n\n if (tokenRequest?.status === 401) {\n err = {\n type: 'auth_error',\n ...errorMeta\n };\n } else {\n err = {\n type: 'api_error',\n ...errorMeta\n };\n }\n\n if (\n tokenRequest?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = tokenRequest.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n err.data = errorJson.error;\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n #setTTL(value: number | null) {\n const now = new Date().getTime();\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const nextTimestamp = now + oneHourInMilliseconds;\n const nextState =\n value === null ? value : new Date(nextTimestamp).valueOf();\n\n this.#ttl = nextState;\n }\n\n #checkTokenExpiry() {\n const now = new Date(Date.now());\n const expires = new Date(this.#ttl ?? Number.NaN);\n const isTokenExpired = isAfter(now, expires);\n\n if (isTokenExpired) {\n this.#setTTL(null);\n this.#cache.clear();\n }\n }\n\n async #executeRequest(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<Response | undefined> {\n const cacheKey = `${input}${JSON.stringify(init || {})}`;\n\n if (!this.#cache.has(cacheKey)) {\n const promise = fetch(input, init ?? {});\n this.#cache.set(cacheKey, promise);\n }\n\n return await this.#cache.get(cacheKey);\n }\n}\n\nfunction isAfter(date1: Date, date2: Date) {\n return date1 > date2;\n}\n","import * as resources from 'resources';\nimport { pascalToCamelCase } from 'utils';\nimport type { CreditScoresService } from 'resources/CreditScores';\nimport type { EntitlementsService } from 'resources/Entitlements';\nimport type {\n ConnectedSolutionsSDK,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type { CreditScoreSimulatorService } from 'resources/CreditScoreSimulator/CreditScoreSimulator';\nimport type { CreditScorePlannerService } from 'resources/CreditScorePlanner';\nimport type { CreditAttributesService } from 'resources/CreditAttributes/CreditAttributes';\nimport { AuthService } from 'lib/AuthClient/AuthClient';\nimport { ApiClient } from 'lib/ApiClient';\nimport type { AlertsService } from 'resources/Alerts';\nimport type { CreditReportsService } from 'resources/CreditReports';\nimport type { CustomersService } from 'resources/Customers';\nimport type { CustomerAuthService } from 'resources/CustomerAuth';\nimport type { RegistrationsService } from 'resources/Registrations';\nimport type { ProductConfigsService } from 'resources/ProductConfigs';\n// new service imports go here\n\nexport class SDKClient extends ApiClient implements ConnectedSolutionsSDK {\n static #instance: SDKClient | null = null;\n alerts: AlertsService;\n auth: AuthService;\n creditReports: CreditReportsService;\n creditScores: CreditScoresService;\n creditAttributes: CreditAttributesService;\n creditScorePlanner: CreditScorePlannerService;\n creditScoreSimulator: CreditScoreSimulatorService;\n customerAuth: CustomerAuthService;\n customers: CustomersService;\n entitlements: EntitlementsService;\n productConfigs: ProductConfigsService;\n registrations: RegistrationsService;\n // new services go here\n\n // The method is static as we need to access the method only through the class here\n static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient {\n // if instance is already created return that otherwise create it\n if (SDKClient.#instance) {\n return SDKClient.#instance;\n }\n\n SDKClient.#instance = new SDKClient(config);\n return SDKClient.#instance;\n }\n\n static clearInstance() {\n SDKClient.#instance = null;\n }\n\n // constructor is private so that no other class can access it.\n private constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n for (const name in resources) {\n if (typeof resources[name] === 'function') {\n this[pascalToCamelCase(name)] = new resources[name](config);\n }\n }\n\n this.auth = new AuthService({\n environment: config.environment\n });\n }\n}\n\nexport function createSDK(userConfig: ConnectedSolutionsSDKConfig) {\n return SDKClient.getInstance(userConfig);\n}\n","import type {\n CreditScorePlan,\n FicoCreditScorePlanCompleted,\n VantageCreditScorePlanCompleted,\n FicoCreditScorePlanSet,\n VantageCreditScorePlanSet,\n VantageCreditScorePlan,\n FicoCreditScorePlan,\n ScorePlanRevisionsRequest,\n FicoScorePlanRevisionsRequest,\n VantageScorePlanRevisionsRequest,\n ScorePlanRevision,\n FicoScorePlanRevision,\n VantageScorePlanRevision\n} from 'resources/CreditScorePlanner/types';\n\nexport function isPlanCompleted(\n plan: CreditScorePlan\n): plan is FicoCreditScorePlanCompleted | VantageCreditScorePlanCompleted {\n return (\n plan.progress_status === 'TARGET_NOT_MET' ||\n plan.progress_status === 'COMPLETED'\n );\n}\n\nexport function isPlanSet(\n plan: CreditScorePlan\n): plan is\n | FicoCreditScorePlanCompleted\n | FicoCreditScorePlanSet\n | VantageCreditScorePlanCompleted\n | VantageCreditScorePlanSet {\n return (\n isPlanCompleted(plan) ||\n plan.progress_status === 'TARGET_SCORE_AND_PLAN_SET' ||\n plan.progress_status === 'ON_TRACK' ||\n plan.progress_status === 'OFF_TRACK'\n );\n}\n\nexport function isVantagePlan(\n plan: CreditScorePlan\n): plan is VantageCreditScorePlan {\n return plan.score_model.includes('VANTAGE');\n}\n\nexport function isFicoPlan(plan: CreditScorePlan): plan is FicoCreditScorePlan {\n return plan.score_model.includes('FICO');\n}\n\nexport function isFicoRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is FicoScorePlanRevisionsRequest {\n return (request as FicoScorePlanRevisionsRequest).target_score !== undefined;\n}\n\nexport function isVantageRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is VantageScorePlanRevisionsRequest {\n return (\n (request as VantageScorePlanRevisionsRequest).max_actions_per_plan !==\n undefined\n );\n}\n\nexport function isFicoRevision(\n revision: ScorePlanRevision\n): revision is FicoScorePlanRevision {\n return revision.score_model.includes('FICO');\n}\n\nexport function isVantageRevision(\n revision: ScorePlanRevision\n): revision is VantageScorePlanRevision {\n return revision.score_model.includes('VANTAGE');\n}\n","import type {\n CreditScoreSimulator,\n FicoScenario,\n FicoScenarioVariation,\n FicoScoreSimulator,\n Scenario,\n ScenarioVariation,\n VantageScenario,\n VantageScenarioVariation\n} from 'resources/CreditScoreSimulator/types';\n\nexport function isFicoSimulator(\n data?: CreditScoreSimulator\n): data is FicoScoreSimulator {\n return Boolean(data && 'best_action' in data);\n}\n\nexport function isVantageScenario(\n scenario?: Scenario\n): scenario is VantageScenario {\n return Boolean(scenario && 'simulated_score' in scenario);\n}\n\nexport function isFicoScenario(scenario: Scenario): scenario is FicoScenario {\n return !('simulated_score' in scenario);\n}\n\nexport function isFicoScenarioVariation(\n variation?: ScenarioVariation\n): variation is FicoScenarioVariation {\n return Boolean(\n variation &&\n 'slider_min_value' in variation &&\n 'slider_max_value' in variation\n );\n}\n\nexport function isVantageScenarioVariation(\n variation?: ScenarioVariation\n): variation is VantageScenarioVariation {\n return Boolean(\n variation && 'value' in variation && 'simulated_score' in variation\n );\n}\n"],"names":["generateError","rawError","ConnectedSolutionsClientApiError","ConnectedSolutionsClientAuthError","ConnectedSolutionsClientSDKError","ConnectedSolutionsClientUnknownError","ConnectedSolutionsClientError","raw","_a","__publicField","args","ENVIRONMENT_URLS","CONTENTSTACK_URLS","_ApiClient_instances","validateConfig_fn","isJsonResponse_fn","ApiClient","config","__privateAdd","environment","partialConfig","input","init","__privateMethod","headers","options","error","e","response","err","apiError","errorJson","_b","_basePath","_CreditScoresService","fetchOptions","searchOptions","query","queryString","endpoint","__privateGet","requestOptions","CreditScoresService","_EntitlementsService","entitlement_id","body","product_config_id","customer_id","search","EntitlementsService","_CreditAttributesService","CreditAttributesService","_CreditScoreSimulatorService","requestBody","CreditScoreSimulatorService","_revisionPath","_CreditScorePlannerService","CreditScorePlannerService","_AlertsService","id","AlertsService","_CreditReportsService","latest_only","report_read","CreditReportsService","_CustomersService","updates","next_cursor","CustomersService","_CustomerAuthService","answers","CustomerAuthService","_RegistrationsService","RegistrationsService","_ProductConfigsService","fromEntries","entries","isArray","value","key","ProductConfigsService","pascalToCamelCase","name","isNode","_cache","_ttl","_AuthService_instances","fetchToken_fn","setTTL_fn","checkTokenExpiry_fn","executeRequest_fn","_AuthService","__privateSet","credentials","cacheKeys","grantType","clientId","clientSecret","customerId","tokenRequest","accessToken","errorMeta","now","oneHourInMilliseconds","nextTimestamp","nextState","expires","isAfter","cacheKey","promise","AuthService","date1","date2","_instance","_SDKClient","resources","SDKClient","createSDK","userConfig","isPlanCompleted","plan","isPlanSet","isVantagePlan","isFicoPlan","isFicoRevisionsRequest","request","isVantageRevisionsRequest","isFicoRevision","revision","isVantageRevision","isFicoSimulator","data","isVantageScenario","scenario","isFicoScenario","isFicoScenarioVariation","variation","isVantageScenarioVariation"],"mappings":";;;;;;;AAmBA,SAASA,GAAcC,GAA4C;AACjE,UAAQA,EAAS,MAAM;AAAA,IACrB,KAAK;AACI,aAAA,IAAIC,GAAiCD,CAAQ;AAAA,IACtD,KAAK;AACI,aAAA,IAAIE,GAAkCF,CAAQ;AAAA,IACvD,KAAK;AACI,aAAA,IAAIG,GAAiCH,CAAQ;AAAA,IACtD;AACS,aAAA,IAAII,GAAqCJ,CAAQ;AAAA,EAAA;AAE9D;AAEO,MAAMK,UAAsC,MAAM;AAAA,EAKvD,YAAYC,GAAuC;AAlBrD,QAAAC;AAmBI,UAAMD,EAAI,OAAO;AALV,IAAAE,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAIP,SAAK,YAAUD,IAAAD,EAAI,SAAJ,gBAAAC,EAAU,YAAWD,EAAI,WAAW,IACnD,KAAK,OAAOA,EAAI,MAChB,KAAK,SAASA,EAAI;AAAA,EAAA;AAItB;AADEE,EAZWH,GAYJ,iBAAgBN;AAGlB,MAAME,WAAyCI,EAA8B;AAAA,EAClF,YAAYI,GAAwC;AAClD,UAAMA,CAAI,GACV,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAMP,WAA0CG,EAA8B;AAAA,EACnF,YAAYI,GAAwC;AAClD,UAAMA,CAAI,GACV,KAAK,OAAO;AAAA,EAAA;AAEhB;AAEO,MAAML,WAA6CC,EAA8B;AAAA,EACtF,YAAYI,GAAwC;AAClD,UAAMA,CAAI,G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,MAAM;AAC7C;AAEO,SAASC,GACdD,GACsC;AAC/B,SAAAA,EAAS,YAAY,SAAS,SAAS;AAChD;AChEO,SAASE,GACdC,GAC4B;AACrB,SAAA,GAAQA,KAAQ,iBAAiBA;AAC1C;AAEO,SAASC,GACdC,GAC6B;AACtB,SAAA,GAAQA,KAAY,qBAAqBA;AAClD;AAEO,SAASC,GAAeD,GAA8C;AAC3E,SAAO,EAAE,qBAAqBA;AAChC;AAEO,SAASE,GACdC,GACoC;AAC7B,SAAA,GACLA,KACE,sBAAsBA,KACtB,sBAAsBA;AAE5B;AAEO,SAASC,GACdD,GACuC;AAChC,SAAA,GACLA,KAAa,WAAWA,KAAa,qBAAqBA;AAE9D;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -310,7 +310,7 @@ type SimulationCategoryType = 'GENERAL_CREDIT' | 'REVOLVING_CREDIT' | 'MORTGAGE_
|
|
|
310
310
|
type ImpactType = 'positive' | 'negative';
|
|
311
311
|
interface CreditScoreSimulatorPostRequest {
|
|
312
312
|
scenario: string;
|
|
313
|
-
variations: FicoScenarioVariation[];
|
|
313
|
+
variations: Omit<FicoScenarioVariation, 'slider_min_value' | 'slider_max_value'>[];
|
|
314
314
|
}
|
|
315
315
|
interface CreditScoreSimulatorPostResponse {
|
|
316
316
|
simulated_score: number;
|
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(a,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a["@experian-ecs/connected-api-sdk"]={}))})(this,function(a){"use strict";var Mt=Object.defineProperty;var Ut=a=>{throw TypeError(a)};var Kt=(a,u,d)=>u in a?Mt(a,u,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[u]=d;var l=(a,u,d)=>Kt(a,typeof u!="symbol"?u+"":u,d),gt=(a,u,d)=>u.has(a)||Ut("Cannot "+d);var r=(a,u,d)=>(gt(a,u,"read from private field"),d?d.call(a):u.get(a)),y=(a,u,d)=>u.has(a)?Ut("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(a):u.set(a,d),H=(a,u,d,j)=>(gt(a,u,"write to private field"),j?j.call(a,d):u.set(a,d),d),P=(a,u,d)=>(gt(a,u,"access private method"),d);var w,mt,Pt,D,g,z,V,N,Q,W,T,C,F,Y,q,S,L,K,f,Ct,$t,Et,_t,_;function u(o){switch(o.type){case"api_error":return new j(o);case"auth_error":return new pt(o);case"sdk_error":return new ft(o);default:return new St(o)}}class d extends Error{constructor(e){var n;super(e.message);l(this,"message");l(this,"data");l(this,"status");this.message=((n=e.data)==null?void 0:n.message)||e.message||"",this.data=e.data,this.status=e.status}}l(d,"generateError",u);class j extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientApiError"}}class pt extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientAuthError"}}class St extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientUnknownError"}}class ft extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientSDKError"}}const bt={PRODUCTION:"https://connected-api.experian.com",SANDBOX:"https://sandbox.connected-api.experian.com",UAT:"https://uat-api.ecs.experian.com",INTEGRATION:"https://integration-api.ecs.experian.com",DEVELOPMENT:"https://dev-api.ecs.experian.com"},Rt={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(t){y(this,w);l(this,"config");l(this,"baseUrl","");l(this,"contentstackUrl","");const n=t.environment??"PRODUCTION";this.config=t,this.baseUrl=bt[n],this.contentstackUrl=Rt[n]}setConfig(t){"environment"in t&&(this.config.environment=t.environment),"token"in t&&(this.config.token=t.token)}async fetchWithAuth(t,e){try{P(this,w,mt).call(this);const n=typeof Headers<"u"&&new Headers(e==null?void 0:e.headers);n&&!n.Authorization&&n.set("Authorization",`Bearer ${this.config.token}`);const s={...e,headers:n||(e==null?void 0:e.headers)||{}};return await this.fetchRequest(t,s)}catch(n){const s=n;return{data:void 0,error:s,meta:{status:s.status??500,statusText:s.message??""}}}}async fetchRequest(t,e){var n;try{P(this,w,mt).call(this);const s=await fetch(t,e);if(!(s!=null&&s.ok)){let c;const p={type:"api_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 k=await s.clone().json();p.data=k.error}throw(s==null?void 0:s.status)===401?c={...p,type:"auth_error"}:c={...p,type:"api_error"},d.generateError(c)}return P(this,w,Pt).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}}}}}w=new WeakSet,mt=function(){if(!this.config.token){const t={type:"sdk_error",message:"You must first obtain and set a token before using an SDK method"};throw d.generateError(t)}},Pt=function(t){var e,n;return((e=t==null?void 0:t.headers.get("content-type"))==null?void 0:e.includes("application/json"))||((n=t==null?void 0:t.headers.get("content-type"))==null?void 0:n.includes("application/octet-stream"))};const I=class I extends ${constructor(t){super(t)}async getCreditScores(t,e){const n={...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()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(I,D)}${i}`;return this.fetchWithAuth(h,e)}async orderCreditScore(t,e){const n={...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(I,D)}?${i}`;return this.fetchWithAuth(h,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...e??{}})}};D=new WeakMap,y(I,D,"/v1/credit/scores");let tt=I;const m=class m extends ${constructor(t){super(t)}async getEntitlements(t,e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}?customer_id=${t.customer_id}`,e)}async getEntitlementById({entitlement_id:t},e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${t}`,e)}async createEntitlement(t,e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}`,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t),...e??{}})}async updateEntitlement(t,e){const{entitlement_id:n,...s}=t;return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${n}`,{method:"PUT",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}async deleteEntitlement({entitlement_id:t},e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${t}`,{method:"DELETE",...e??{}})}async activateEntitlement({entitlement_id:t},e){const n=`${this.baseUrl}${r(m,g)}/${t}/activate`;return this.fetchWithAuth(n,{method:"POST",...e??{}})}async deactivateEntitlement({entitlement_id:t},e){const n=`${this.baseUrl}${r(m,g)}/${t}/deactivate`;return this.fetchWithAuth(n,{method:"POST",...e??{}})}async entitleCustomerToNewProduct(t,e){const{product_config_id:n,entitlement_id:s,customer_id:i}=t,h=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/activate`;return this.fetchWithAuth(h,{method:"POST",...e??{},headers:{...(e==null?void 0:e.headers)??{},"X-Customer-ID":i}})}async activateProduct(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/activate`;return this.fetchWithAuth(i,{method:"POST",...e??{}})}async deactivateProduct(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/deactivate`;return this.fetchWithAuth(i,{method:"POST",...e??{}})}async removeProductFromEntitlement(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}`;return this.fetchWithAuth(i,{method:"DELETE",...e??{}})}async getProductEligibility(t,e){const n=new URLSearchParams(t).toString(),s=`${this.baseUrl}${r(m,g)}/eligibility?${n}`;return this.fetchWithAuth(s,e)}};g=new WeakMap,y(m,g,"/v1/entitlements");let et=m;const X=class X extends ${constructor(t){super(t)}async getCreditAttributes(t){const e=`${this.baseUrl}${r(X,z)}`;return this.fetchWithAuth(e,t)}};z=new WeakMap,y(X,z,"/v1/credit/attributes");let nt=X;const B=class B extends ${constructor(t){super(t)}async getSimulations(t,e){const n={...t,...t!=null&&t.run_all?{run_all:t.run_all.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(B,V)}${i}`;return this.fetchWithAuth(h,e)}async simulateScenario(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"";return this.fetchWithAuth(`${this.baseUrl}${r(B,V)}${h}`,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}};V=new WeakMap,y(B,V,"/v1/credit/tools/simulator");let st=B;const b=class b extends ${constructor(t){super(t)}async getCreditScorePlan(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(b,N)}${s}`;return this.fetchWithAuth(i,{...e??{}})}async createCreditScorePlan(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(b,N)}${h}`;return this.fetchWithAuth(c,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}async deleteCreditScorePlan(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(b,N)}${s}`;return this.fetchWithAuth(i,{method:"DELETE",...e??{}})}async getCreditScorePlanRevisions(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(b,N)}${r(b,Q)}${h}`;return this.fetchWithAuth(c,{method:"POST",body:JSON.stringify(s),headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},...e??{}})}};N=new WeakMap,Q=new WeakMap,y(b,N,"/v1/credit/tools/planners"),y(b,Q,"/revisions");let rt=b;const x=class x extends ${constructor(t){super(t)}async getAlerts(t,e){const n={page_limit:"10",next_page_token:"",...t??{}},s=new URLSearchParams(n).toString(),i=`${this.baseUrl}${r(x,W)}?${s}`;return this.fetchWithAuth(i,e)}async getAlertById({id:t},e){const n=`${this.baseUrl}${r(x,W)}/${t}`;return this.fetchWithAuth(n,e)}async markAlertAsRead({id:t},e){const n=`${this.baseUrl}${r(x,W)}/${t}/dispose`;return this.fetchWithAuth(n,{method:"PATCH",...e??{}})}async getAlertCounts(t){const e=`${this.baseUrl}${r(x,W)}/counts`;return this.fetchWithAuth(e,t)}};W=new WeakMap,y(x,W,"/v1/events-alerts");let it=x;const A=class A extends ${constructor(t){super(t)}async getReports(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(A,T)}${s}`;return this.fetchWithAuth(i,e)}async getReportById(t,e){const{id:n,...s}=t,i=new URLSearchParams(s).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(A,T)}/${t.id}${h}`;return this.fetchWithAuth(c,e)}async getReportsMeta(t,e){const{latest_only:n,report_read:s,...i}=t??{},h={...i??{},...n?{latest_only:n.toString()}:{},...s?{report_read:s.toString()}:{}},c=new URLSearchParams(h).toString(),p=c?`?${c}`:"",v=`${this.baseUrl}${r(A,T)}/meta${p}`;return this.fetchWithAuth(v,e)}async getReportMetaById(t,e){const{id:n,...s}=t,i=new URLSearchParams(s).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(A,T)}/${n}/meta${h}`;return this.fetchWithAuth(c,e)}async markReportAsRead(t,e){const n=`${this.baseUrl}${r(A,T)}/${t.id}/read`;return this.fetchWithAuth(n,{method:"PUT",...e??{}})}async orderReport(t,e){const n={...t.include_fields?{include_fields:t.include_fields.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(A,T)}${i}`;return this.fetchWithAuth(h,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...e??{}})}};T=new WeakMap,y(A,T,"/v1/credit/reports");let ot=A;const E=class E extends ${constructor(t){super(t)}async getCustomerById(t,e){const n=`${this.baseUrl}${r(E,C)}/${t.customer_id}`;return this.fetchWithAuth(n,e)}async updateCustomer(t,e){const{customer_id:n,...s}=t,i=`${this.baseUrl}${r(E,C)}/${n}`;return this.fetchWithAuth(i,{method:"PATCH",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s??{}),...e??{}})}async deleteCustomer(t,e){const n=`${this.baseUrl}${r(E,C)}/${t.customer_id}`;return this.fetchWithAuth(n,{method:"DELETE",...e??{}})}async createCustomer(t,e){const n=`${this.baseUrl}${r(E,C)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t??{}),...e??{}})}async searchCustomers(t,e){const{next_cursor:n="",...s}=t,i=`${this.baseUrl}${r(E,C)}/search`;return this.fetchWithAuth(i,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({next_cursor:n,...s??{}}),...e??{}})}};C=new WeakMap,y(E,C,"/v1/customers");let at=E;const J=class J extends ${constructor(t){super(t)}async getAuthQuestions(t){const e=`${this.baseUrl}${r(J,F)}/questions`;return this.fetchWithAuth(e,t)}async submitAuthAnswers(t,e){const n=`${this.baseUrl}${r(J,F)}/questions`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t),...e??{}})}};F=new WeakMap,y(J,F,"/v1/authentication");let ct=J;const Z=class Z extends ${constructor(t){super(t)}async createRegistration(t,e){const n=`${this.baseUrl}${r(Z,Y)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t??{}),...e??{}})}};Y=new WeakMap,y(Z,Y,"/v1/registrations");let ut=Z;const M=class M extends ${constructor(t){super(t)}async getProductConfigs(t,e){const{fromEntries:n,entries:s}=Object,{isArray:i}=Array,h=n(s(t).filter(([k,R])=>R!=null).map(([k,R])=>[k,i(R)?R.join(","):R.toString()])),c=new URLSearchParams(h).toString(),p=c?`?${c}`:"",v=`${this.baseUrl}${r(M,q)}${p}`;return this.fetchWithAuth(v,{...e||{}})}async getProductConfigById(t,e){const n=`${this.baseUrl}${r(M,q)}/${t.product_config_id}`;return this.fetchWithAuth(n,{...e??{}})}};q=new WeakMap,y(M,q,"/v1/product-configs");let dt=M;const ht=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:it,CreditAttributesService:nt,CreditReportsService:ot,CreditScorePlannerService:rt,CreditScoreSimulatorService:st,CreditScoresService:tt,CustomerAuthService:ct,CustomersService:at,EntitlementsService:et,ProductConfigsService:dt,RegistrationsService:ut},Symbol.toStringTag,{value:"Module"}));function wt(o){return`${o[0].toLowerCase()}${o.substring(1)}`.replace("Service","")}const Nt=typeof process<"u"&&process.versions&&process.versions.node&&typeof window>"u",G=class G{constructor(t){y(this,f);l(this,"config");y(this,S);y(this,L,null);l(this,"baseUrl","");this.config=t,this.baseUrl=bt[t.environment??"PRODUCTION"],H(this,S,new Map)}async getAccessToken(t){if(!Nt)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await P(this,f,Ct).call(this,t),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 r(this,S).size}clearCache(){const t=`${this.baseUrl}${r(G,K)}`,e=Array.from(r(this,S).keys()).filter(n=>n.includes(t));for(const n of e)r(this,S).delete(n)}};S=new WeakMap,L=new WeakMap,K=new WeakMap,f=new WeakSet,Ct=async function({grantType:t,clientId:e,clientSecret:n,customerId:s}){var k;P(this,f,Et).call(this);const i=`${this.baseUrl}${r(G,K)}`,h={method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({grant_type:t,client_id:e,client_secret:n,partner_customer_id:s??""})},c=await P(this,f,_t).call(this,i,h);if(c!=null&&c.ok){const O=await c.clone().json();return r(this,L)===null&&P(this,f,$t).call(this,O.expires_in),O}let p;const v={status:c==null?void 0:c.status,message:(c==null?void 0:c.statusText)||"",data:void 0};if((c==null?void 0:c.status)===401?p={type:"auth_error",...v}:p={type:"api_error",...v},(k=c==null?void 0:c.headers.get("content-type"))!=null&&k.includes("application/json")){const O=await c.clone().json();p.data=O.error}throw d.generateError(p)},$t=function(t){const e=new Date().getTime(),n=60*60*1e3,s=e+n,i=t===null?t:new Date(s).valueOf();H(this,L,i)},Et=function(){const t=new Date(Date.now()),e=new Date(r(this,L)??Number.NaN);Wt(t,e)&&(P(this,f,$t).call(this,null),r(this,S).clear())},_t=async function(t,e){const n=`${t}${JSON.stringify(e||{})}`;if(!r(this,S).has(n)){const s=fetch(t,e??{});r(this,S).set(n,s)}return await r(this,S).get(n)},y(G,K,"/v1/oauth2/token");let lt=G;function Wt(o,t){return o>t}const U=class U extends ${constructor(e){super(e);l(this,"alerts");l(this,"auth");l(this,"creditReports");l(this,"creditScores");l(this,"creditAttributes");l(this,"creditScorePlanner");l(this,"creditScoreSimulator");l(this,"customerAuth");l(this,"customers");l(this,"entitlements");l(this,"productConfigs");l(this,"registrations");for(const n in ht)typeof ht[n]=="function"&&(this[wt(n)]=new ht[n](e));this.auth=new lt({environment:e.environment})}static getInstance(e){return r(U,_)||H(U,_,new U(e)),r(U,_)}static clearInstance(){H(U,_,null)}};_=new WeakMap,y(U,_,null);let yt=U;function Tt(o){return yt.getInstance(o)}function At(o){return o.progress_status==="TARGET_NOT_MET"||o.progress_status==="COMPLETED"}function xt(o){return At(o)||o.progress_status==="TARGET_SCORE_AND_PLAN_SET"||o.progress_status==="ON_TRACK"||o.progress_status==="OFF_TRACK"}function vt(o){return o.score_model.includes("VANTAGE")}function kt(o){return o.score_model.includes("FICO")}function Lt(o){return o.target_score!==void 0}function jt(o){return o.max_actions_per_plan!==void 0}function Dt(o){return o.score_model.includes("FICO")}function It(o){return o.score_model.includes("VANTAGE")}function Vt(o){return!!(o&&"best_action"in o)}function Bt(o){return!!(o&&"simulated_score"in o)}function Ft(o){return!("simulated_score"in o)}function Jt(o){return!!(o&&"slider_min_value"in o&&"slider_max_value"in o)}function qt(o){return!!(o&&"value"in o&&"simulated_score"in o)}a.ConnectedSolutionsClientApiError=j,a.ConnectedSolutionsClientAuthError=pt,a.ConnectedSolutionsClientError=d,a.ConnectedSolutionsClientSDKError=ft,a.ConnectedSolutionsClientUnknownError=St,a.createSDK=Tt,a.default=Tt,a.isFicoPlan=kt,a.isFicoRevision=Dt,a.isFicoRevisionsRequest=Lt,a.isFicoScenario=Ft,a.isFicoScenarioVariation=Jt,a.isFicoSimulator=Vt,a.isPlanCompleted=At,a.isPlanSet=xt,a.isVantagePlan=vt,a.isVantageRevision=It,a.isVantageRevisionsRequest=jt,a.isVantageScenario=Bt,a.isVantageScenarioVariation=qt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
15
|
+
(function(a,u){typeof exports=="object"&&typeof module<"u"?u(exports):typeof define=="function"&&define.amd?define(["exports"],u):(a=typeof globalThis<"u"?globalThis:a||self,u(a["@experian-ecs/connected-api-sdk"]={}))})(this,function(a){"use strict";var Mt=Object.defineProperty;var Ut=a=>{throw TypeError(a)};var Kt=(a,u,d)=>u in a?Mt(a,u,{enumerable:!0,configurable:!0,writable:!0,value:d}):a[u]=d;var l=(a,u,d)=>Kt(a,typeof u!="symbol"?u+"":u,d),gt=(a,u,d)=>u.has(a)||Ut("Cannot "+d);var r=(a,u,d)=>(gt(a,u,"read from private field"),d?d.call(a):u.get(a)),y=(a,u,d)=>u.has(a)?Ut("Cannot add the same private member more than once"):u instanceof WeakSet?u.add(a):u.set(a,d),H=(a,u,d,j)=>(gt(a,u,"write to private field"),j?j.call(a,d):u.set(a,d),d),P=(a,u,d)=>(gt(a,u,"access private method"),d);var w,mt,Pt,D,g,z,V,N,Q,W,T,C,F,Y,q,S,L,K,f,Ct,$t,Et,_t,_;function u(o){switch(o.type){case"api_error":return new j(o);case"auth_error":return new pt(o);case"sdk_error":return new ft(o);default:return new St(o)}}class d extends Error{constructor(e){var n;super(e.message);l(this,"message");l(this,"data");l(this,"status");this.message=((n=e.data)==null?void 0:n.message)||e.message||"",this.data=e.data,this.status=e.status}}l(d,"generateError",u);class j extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientApiError"}}class pt extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientAuthError"}}class St extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientUnknownError"}}class ft extends d{constructor(t){super(t),this.name="ConnectedSolutionsClientSDKError"}}const bt={PRODUCTION:"https://connected-api.experian.com",SANDBOX:"https://sandbox.connected-api.experian.com",UAT:"https://uat-api.ecs.experian.com",INTEGRATION:"https://integration-api.ecs.experian.com",DEVELOPMENT:"https://dev-api.ecs.experian.com"},Rt={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(t){y(this,w);l(this,"config");l(this,"baseUrl","");l(this,"contentstackUrl","");const n=t.environment??"PRODUCTION";this.config=t,this.baseUrl=bt[n],this.contentstackUrl=Rt[n]}setConfig(t){"environment"in t&&(this.config.environment=t.environment),"token"in t&&(this.config.token=t.token)}async fetchWithAuth(t,e){try{P(this,w,mt).call(this);const n=typeof Headers<"u"&&new Headers(e==null?void 0:e.headers);n&&!n.Authorization&&n.set("Authorization",`Bearer ${this.config.token}`);const s={...e,headers:n||(e==null?void 0:e.headers)||{}};return await this.fetchRequest(t,s)}catch(n){const s=n;return{data:void 0,error:s,meta:{status:s.status??500,statusText:s.message??""}}}}async fetchRequest(t,e){var n;try{P(this,w,mt).call(this);const s=await fetch(t,e);if(!(s!=null&&s.ok)){let c;const p={type:"api_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 k=await s.clone().json();p.data=k.error}throw(s==null?void 0:s.status)===401?c={...p,type:"auth_error"}:c={...p,type:"api_error"},d.generateError(c)}return P(this,w,Pt).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}}}}}w=new WeakSet,mt=function(){if(!this.config.token){const t={type:"sdk_error",message:"You must first obtain and set a token before using an SDK method"};throw d.generateError(t)}},Pt=function(t){var e,n;return((e=t==null?void 0:t.headers.get("content-type"))==null?void 0:e.includes("application/json"))||((n=t==null?void 0:t.headers.get("content-type"))==null?void 0:n.includes("application/octet-stream"))};const I=class I extends ${constructor(t){super(t)}async getCreditScores(t,e){const n={...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()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(I,D)}${i}`;return this.fetchWithAuth(h,e)}async orderCreditScore(t,e){const n={...t!=null&&t.include_factors?{include_factors:t.include_factors.toString()}:{},...t!=null&&t.include_ingredients?{include_ingredients:t.include_ingredients.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(I,D)}?${i}`;return this.fetchWithAuth(h,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...e??{}})}};D=new WeakMap,y(I,D,"/v1/credit/scores");let tt=I;const m=class m extends ${constructor(t){super(t)}async getEntitlements(t,e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}?customer_id=${t.customer_id}`,e)}async getEntitlementById({entitlement_id:t},e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${t}`,e)}async createEntitlement(t,e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}`,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t),...e??{}})}async updateEntitlement(t,e){const{entitlement_id:n,...s}=t;return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${n}`,{method:"PUT",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}async deleteEntitlement({entitlement_id:t},e){return this.fetchWithAuth(`${this.baseUrl}${r(m,g)}/${t}`,{method:"DELETE",...e??{}})}async activateEntitlement({entitlement_id:t},e){const n=`${this.baseUrl}${r(m,g)}/${t}/activate`;return this.fetchWithAuth(n,{method:"POST",...e??{}})}async deactivateEntitlement({entitlement_id:t},e){const n=`${this.baseUrl}${r(m,g)}/${t}/deactivate`;return this.fetchWithAuth(n,{method:"POST",...e??{}})}async entitleCustomerToNewProduct(t,e){const{product_config_id:n,entitlement_id:s,customer_id:i}=t,h=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/activate`;return this.fetchWithAuth(h,{method:"POST",...e??{},headers:{...(e==null?void 0:e.headers)??{},"X-Customer-ID":i}})}async activateProduct(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/activate`;return this.fetchWithAuth(i,{method:"POST",...e??{}})}async deactivateProduct(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}/deactivate`;return this.fetchWithAuth(i,{method:"POST",...e??{}})}async removeProductFromEntitlement(t,e){const{product_config_id:n,entitlement_id:s}=t,i=`${this.baseUrl}${r(m,g)}/${s}/products/${n}`;return this.fetchWithAuth(i,{method:"DELETE",...e??{}})}async getProductEligibility(t,e){const n=new URLSearchParams(t).toString(),s=`${this.baseUrl}${r(m,g)}/eligibility?${n}`;return this.fetchWithAuth(s,e)}};g=new WeakMap,y(m,g,"/v1/entitlements");let et=m;const X=class X extends ${constructor(t){super(t)}async getCreditAttributes(t){const e=`${this.baseUrl}${r(X,z)}`;return this.fetchWithAuth(e,t)}};z=new WeakMap,y(X,z,"/v1/credit/attributes");let nt=X;const B=class B extends ${constructor(t){super(t)}async getSimulations(t,e){const n={...t,...t!=null&&t.run_all?{run_all:t.run_all.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(B,V)}${i}`;return this.fetchWithAuth(h,e)}async simulateScenario(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"";return this.fetchWithAuth(`${this.baseUrl}${r(B,V)}${h}`,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}};V=new WeakMap,y(B,V,"/v1/credit/tools/simulator");let st=B;const b=class b extends ${constructor(t){super(t)}async getCreditScorePlan(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(b,N)}${s}`;return this.fetchWithAuth(i,{...e??{}})}async createCreditScorePlan(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(b,N)}${h}`;return this.fetchWithAuth(c,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s),...e??{}})}async deleteCreditScorePlan(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(b,N)}${s}`;return this.fetchWithAuth(i,{method:"DELETE",...e??{}})}async getCreditScorePlanRevisions(t,e){const{product_config_id:n,...s}=t,i=new URLSearchParams({product_config_id:n}).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(b,N)}${r(b,Q)}${h}`;return this.fetchWithAuth(c,{method:"POST",body:JSON.stringify(s),headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},...e??{}})}};N=new WeakMap,Q=new WeakMap,y(b,N,"/v1/credit/tools/planners"),y(b,Q,"/revisions");let rt=b;const x=class x extends ${constructor(t){super(t)}async getAlerts(t,e){const n={page_limit:"10",next_page_token:"",...t??{}},s=new URLSearchParams(n).toString(),i=`${this.baseUrl}${r(x,W)}?${s}`;return this.fetchWithAuth(i,e)}async getAlertById({id:t},e){const n=`${this.baseUrl}${r(x,W)}/${t}`;return this.fetchWithAuth(n,e)}async markAlertAsRead({id:t},e){const n=`${this.baseUrl}${r(x,W)}/${t}/dispose`;return this.fetchWithAuth(n,{method:"PATCH",...e??{}})}async getAlertCounts(t){const e=`${this.baseUrl}${r(x,W)}/counts`;return this.fetchWithAuth(e,t)}};W=new WeakMap,y(x,W,"/v1/events-alerts");let it=x;const A=class A extends ${constructor(t){super(t)}async getReports(t,e){const n=new URLSearchParams(t).toString(),s=n?`?${n}`:"",i=`${this.baseUrl}${r(A,T)}${s}`;return this.fetchWithAuth(i,e)}async getReportById(t,e){const{id:n,...s}=t,i=new URLSearchParams(s).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(A,T)}/${t.id}${h}`;return this.fetchWithAuth(c,e)}async getReportsMeta(t,e){const{latest_only:n,report_read:s,...i}=t??{},h={...i??{},...n?{latest_only:n.toString()}:{},...s?{report_read:s.toString()}:{}},c=new URLSearchParams(h).toString(),p=c?`?${c}`:"",v=`${this.baseUrl}${r(A,T)}/meta${p}`;return this.fetchWithAuth(v,e)}async getReportMetaById(t,e){const{id:n,...s}=t,i=new URLSearchParams(s).toString(),h=i?`?${i}`:"",c=`${this.baseUrl}${r(A,T)}/${n}/meta${h}`;return this.fetchWithAuth(c,e)}async markReportAsRead(t,e){const n=`${this.baseUrl}${r(A,T)}/${t.id}/read`;return this.fetchWithAuth(n,{method:"PUT",...e??{}})}async orderReport(t,e){const n={...t.include_fields?{include_fields:t.include_fields.toString()}:{}},s=new URLSearchParams(n).toString(),i=s?`?${s}`:"",h=`${this.baseUrl}${r(A,T)}${i}`;return this.fetchWithAuth(h,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({product_config_id:t.product_config_id}),...e??{}})}};T=new WeakMap,y(A,T,"/v1/credit/reports");let ot=A;const E=class E extends ${constructor(t){super(t)}async getCustomerById(t,e){const n=`${this.baseUrl}${r(E,C)}/${t.customer_id}`;return this.fetchWithAuth(n,e)}async updateCustomer(t,e){const{customer_id:n,...s}=t,i=`${this.baseUrl}${r(E,C)}/${n}`;return this.fetchWithAuth(i,{method:"PATCH",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(s??{}),...e??{}})}async deleteCustomer(t,e){const n=`${this.baseUrl}${r(E,C)}/${t.customer_id}`;return this.fetchWithAuth(n,{method:"DELETE",...e??{}})}async createCustomer(t,e){const n=`${this.baseUrl}${r(E,C)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t??{}),...e??{}})}async searchCustomers(t,e){const{next_cursor:n="",...s}=t,i=`${this.baseUrl}${r(E,C)}/search`;return this.fetchWithAuth(i,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify({next_cursor:n,...s??{}}),...e??{}})}};C=new WeakMap,y(E,C,"/v1/customers");let at=E;const J=class J extends ${constructor(t){super(t)}async getAuthQuestions(t){const e=`${this.baseUrl}${r(J,F)}/questions`;return this.fetchWithAuth(e,t)}async submitAuthAnswers(t,e){const n=`${this.baseUrl}${r(J,F)}/questions`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t),...e??{}})}};F=new WeakMap,y(J,F,"/v1/authentication");let ct=J;const Z=class Z extends ${constructor(t){super(t)}async createRegistration(t,e){const n=`${this.baseUrl}${r(Z,Y)}`;return this.fetchWithAuth(n,{method:"POST",headers:{...(e==null?void 0:e.headers)??{},"Content-Type":"application/json"},body:JSON.stringify(t??{}),...e??{}})}};Y=new WeakMap,y(Z,Y,"/v1/registrations");let ut=Z;const M=class M extends ${constructor(t){super(t)}async getProductConfigs(t,e){const{fromEntries:n,entries:s}=Object,{isArray:i}=Array,h=n(s(t).filter(([k,R])=>R!=null).map(([k,R])=>[k,i(R)?R.join(","):R.toString()])),c=new URLSearchParams(h).toString(),p=c?`?${c}`:"",v=`${this.baseUrl}${r(M,q)}${p}`;return this.fetchWithAuth(v,{...e||{}})}async getProductConfigById(t,e){const n=`${this.baseUrl}${r(M,q)}/${t.product_config_id}`;return this.fetchWithAuth(n,{...e??{}})}};q=new WeakMap,y(M,q,"/v1/product-configs");let dt=M;const ht=Object.freeze(Object.defineProperty({__proto__:null,AlertsService:it,CreditAttributesService:nt,CreditReportsService:ot,CreditScorePlannerService:rt,CreditScoreSimulatorService:st,CreditScoresService:tt,CustomerAuthService:ct,CustomersService:at,EntitlementsService:et,ProductConfigsService:dt,RegistrationsService:ut},Symbol.toStringTag,{value:"Module"}));function wt(o){return`${o[0].toLowerCase()}${o.substring(1)}`.replace("Service","")}const Nt=typeof process<"u"&&process.versions&&process.versions.node&&typeof window>"u",G=class G{constructor(t){y(this,f);l(this,"config");y(this,S);y(this,L,null);l(this,"baseUrl","");this.config=t,this.baseUrl=bt[t.environment??"PRODUCTION"],H(this,S,new Map)}async getAccessToken(t){if(!Nt)throw d.generateError({type:"sdk_error",message:"getAccessToken is not supported in browser"});try{return{data:await P(this,f,Ct).call(this,t),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 r(this,S).size}clearCache(){const t=`${this.baseUrl}${r(G,K)}`,e=Array.from(r(this,S).keys()).filter(n=>n.includes(t));for(const n of e)r(this,S).delete(n)}};S=new WeakMap,L=new WeakMap,K=new WeakMap,f=new WeakSet,Ct=async function({grantType:t,clientId:e,clientSecret:n,customerId:s}){var k;P(this,f,Et).call(this);const i=`${this.baseUrl}${r(G,K)}`,h={method:"POST",headers:{"content-type":"application/json"},credentials:"include",body:JSON.stringify({grant_type:t,client_id:e,client_secret:n,...t==="trusted_partner"?{partner_customer_id:s??""}:{}})},c=await P(this,f,_t).call(this,i,h);if(c!=null&&c.ok){const O=await c.clone().json();return r(this,L)===null&&P(this,f,$t).call(this,O.expires_in),O}let p;const v={status:c==null?void 0:c.status,message:(c==null?void 0:c.statusText)||"",data:void 0};if((c==null?void 0:c.status)===401?p={type:"auth_error",...v}:p={type:"api_error",...v},(k=c==null?void 0:c.headers.get("content-type"))!=null&&k.includes("application/json")){const O=await c.clone().json();p.data=O.error}throw d.generateError(p)},$t=function(t){const e=new Date().getTime(),n=60*60*1e3,s=e+n,i=t===null?t:new Date(s).valueOf();H(this,L,i)},Et=function(){const t=new Date(Date.now()),e=new Date(r(this,L)??Number.NaN);Wt(t,e)&&(P(this,f,$t).call(this,null),r(this,S).clear())},_t=async function(t,e){const n=`${t}${JSON.stringify(e||{})}`;if(!r(this,S).has(n)){const s=fetch(t,e??{});r(this,S).set(n,s)}return await r(this,S).get(n)},y(G,K,"/v1/oauth2/token");let lt=G;function Wt(o,t){return o>t}const U=class U extends ${constructor(e){super(e);l(this,"alerts");l(this,"auth");l(this,"creditReports");l(this,"creditScores");l(this,"creditAttributes");l(this,"creditScorePlanner");l(this,"creditScoreSimulator");l(this,"customerAuth");l(this,"customers");l(this,"entitlements");l(this,"productConfigs");l(this,"registrations");for(const n in ht)typeof ht[n]=="function"&&(this[wt(n)]=new ht[n](e));this.auth=new lt({environment:e.environment})}static getInstance(e){return r(U,_)||H(U,_,new U(e)),r(U,_)}static clearInstance(){H(U,_,null)}};_=new WeakMap,y(U,_,null);let yt=U;function Tt(o){return yt.getInstance(o)}function At(o){return o.progress_status==="TARGET_NOT_MET"||o.progress_status==="COMPLETED"}function xt(o){return At(o)||o.progress_status==="TARGET_SCORE_AND_PLAN_SET"||o.progress_status==="ON_TRACK"||o.progress_status==="OFF_TRACK"}function vt(o){return o.score_model.includes("VANTAGE")}function kt(o){return o.score_model.includes("FICO")}function Lt(o){return o.target_score!==void 0}function jt(o){return o.max_actions_per_plan!==void 0}function Dt(o){return o.score_model.includes("FICO")}function It(o){return o.score_model.includes("VANTAGE")}function Vt(o){return!!(o&&"best_action"in o)}function Bt(o){return!!(o&&"simulated_score"in o)}function Ft(o){return!("simulated_score"in o)}function Jt(o){return!!(o&&"slider_min_value"in o&&"slider_max_value"in o)}function qt(o){return!!(o&&"value"in o&&"simulated_score"in o)}a.ConnectedSolutionsClientApiError=j,a.ConnectedSolutionsClientAuthError=pt,a.ConnectedSolutionsClientError=d,a.ConnectedSolutionsClientSDKError=ft,a.ConnectedSolutionsClientUnknownError=St,a.createSDK=Tt,a.default=Tt,a.isFicoPlan=kt,a.isFicoRevision=Dt,a.isFicoRevisionsRequest=Lt,a.isFicoScenario=Ft,a.isFicoScenarioVariation=Jt,a.isFicoSimulator=Vt,a.isPlanCompleted=At,a.isPlanSet=xt,a.isVantagePlan=vt,a.isVantageRevision=It,a.isVantageRevisionsRequest=jt,a.isVantageScenario=Bt,a.isVantageScenarioVariation=qt,Object.defineProperties(a,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
16
16
|
//# sourceMappingURL=index.umd.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../../src/lib/Error.ts","../../src/globals.ts","../../src/lib/ApiClient/ApiClient.ts","../../src/resources/CreditScores/CreditScores.ts","../../src/resources/Entitlements/Entitlements.ts","../../src/resources/CreditAttributes/CreditAttributes.ts","../../src/resources/CreditScoreSimulator/CreditScoreSimulator.ts","../../src/resources/CreditScorePlanner/CreditScorePlanner.ts","../../src/resources/Alerts/Alerts.ts","../../src/resources/CreditReports/CreditReports.ts","../../src/resources/Customers/Customers.ts","../../src/resources/CustomerAuth/CustomerAuth.ts","../../src/resources/Registrations/Registrations.ts","../../src/resources/ProductConfigs/ProductConfigs.ts","../../src/utils.ts","../../src/lib/AuthClient/AuthClient.ts","../../src/lib/SDKClient/SDKClient.ts","../../src/resources/CreditScorePlanner/typeGuards.ts","../../src/resources/CreditScoreSimulator/typeGuards.ts"],"sourcesContent":["export type ConnectedSolutionsAPIErrorData = {\n dev_url: string;\n code: string;\n message: string;\n};\n\nexport type ConnectedSolutionsSDKErrorTypes =\n | 'api_error'\n | 'auth_error'\n | 'sdk_error'\n | 'unknown_error';\n\nexport type ConnectedSolutionsClientRawError = {\n message: string;\n type: ConnectedSolutionsSDKErrorTypes;\n status?: number;\n data?: ConnectedSolutionsAPIErrorData;\n};\n\nfunction generateError(rawError: ConnectedSolutionsClientRawError) {\n switch (rawError.type) {\n case 'api_error':\n return new ConnectedSolutionsClientApiError(rawError);\n case 'auth_error':\n return new ConnectedSolutionsClientAuthError(rawError);\n case 'sdk_error':\n return new ConnectedSolutionsClientSDKError(rawError);\n default:\n return new ConnectedSolutionsClientUnknownError(rawError);\n }\n}\n\nexport class ConnectedSolutionsClientError extends Error {\n readonly message: string;\n readonly data?: ConnectedSolutionsAPIErrorData;\n readonly status?: number;\n\n constructor(raw: ConnectedSolutionsClientRawError) {\n super(raw.message);\n this.message = raw.data?.message || raw.message || '';\n this.data = raw.data;\n this.status = raw.status;\n }\n\n static generateError = generateError;\n}\n\nexport class ConnectedSolutionsClientApiError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientApiError';\n }\n}\n\nexport class ConnectedSolutionsClientAuthError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientAuthError';\n }\n}\n\nexport class ConnectedSolutionsClientUnknownError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientUnknownError';\n }\n}\n\nexport class ConnectedSolutionsClientSDKError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSDKError';\n }\n}\n","export const ENVIRONMENT_URLS = {\n PRODUCTION: 'https://connected-api.experian.com',\n SANDBOX: 'https://sandbox.connected-api.experian.com',\n UAT: 'https://uat-api.ecs.experian.com',\n INTEGRATION: 'https://integration-api.ecs.experian.com',\n DEVELOPMENT: 'https://dev-api.ecs.experian.com'\n};\n\nexport const CONTENTSTACK_URLS = {\n PRODUCTION:\n 'https://unity-contentstack.integration.us-exp-api.experiancs.com',\n SANDBOX: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n UAT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n INTEGRATION: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n DEVELOPMENT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com'\n};\n","import {\n type ConnectedSolutionsClientApiError,\n type ConnectedSolutionsClientAuthError,\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsClientSDKError,\n type ConnectedSolutionsClientUnknownError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport { CONTENTSTACK_URLS, ENVIRONMENT_URLS } from 'globals';\n\nexport type ConnectedSolutionsClientMeta = {\n status: number;\n statusText: string;\n};\n\nexport type ConnectedSolutionsClientErrors =\n | ConnectedSolutionsClientApiError\n | ConnectedSolutionsClientAuthError\n | ConnectedSolutionsClientUnknownError\n | ConnectedSolutionsClientSDKError;\n\nexport type ApiClientResponse<DataType = Record<string, unknown>> =\n | {\n data: DataType;\n error: undefined;\n meta: ConnectedSolutionsClientMeta;\n }\n | {\n data: undefined;\n error: ConnectedSolutionsClientErrors;\n meta: ConnectedSolutionsClientMeta;\n };\n\nexport class ApiClient {\n config: ConnectedSolutionsSDKConfig;\n baseUrl = '';\n contentstackUrl = '';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n const defaultEnvironement = 'PRODUCTION';\n const environment = config.environment ?? defaultEnvironement;\n\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[environment];\n this.contentstackUrl = CONTENTSTACK_URLS[environment];\n }\n\n #validateConfig(): void {\n if (!this.config.token) {\n const error: ConnectedSolutionsClientRawError = {\n type: 'sdk_error',\n message:\n 'You must first obtain and set a token before using an SDK method'\n };\n\n throw ConnectedSolutionsClientError.generateError(error);\n }\n }\n\n #isJsonResponse(response: Response) {\n return (\n response?.headers.get('content-type')?.includes('application/json') ||\n response?.headers\n .get('content-type')\n ?.includes('application/octet-stream')\n );\n }\n\n public setConfig(partialConfig: Partial<ConnectedSolutionsSDKConfig>) {\n if ('environment' in partialConfig) {\n this.config.environment = partialConfig.environment;\n }\n\n if ('token' in partialConfig) {\n this.config.token = partialConfig.token;\n }\n }\n\n public async fetchWithAuth<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n const headers =\n typeof Headers !== 'undefined' && new Headers(init?.headers);\n\n // biome-ignore lint/complexity/useLiteralKeys: works\n if (headers && !headers['Authorization']) {\n headers.set('Authorization', `Bearer ${this.config.token}`);\n }\n\n const options = {\n ...init,\n headers: headers ? headers : init?.headers || {}\n };\n\n const response = await this.fetchRequest<DataType>(input, options);\n\n return response;\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message ?? ''\n }\n };\n }\n }\n\n public async fetchRequest<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n\n const response = await fetch(input, init);\n\n if (!response?.ok) {\n let err: ConnectedSolutionsClientRawError;\n\n const apiError: ConnectedSolutionsClientRawError = {\n type: 'api_error',\n status: response?.status,\n message: response?.statusText\n };\n\n if (\n response?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = response.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n apiError.data = errorJson.error;\n }\n\n if (response?.status === 401) {\n err = {\n ...apiError,\n type: 'auth_error'\n };\n } else {\n err = {\n ...apiError,\n type: 'api_error'\n };\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n if (!this.#isJsonResponse(response)) {\n return {\n data: undefined,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n } as ApiClientResponse<DataType>;\n }\n\n const responseClone = response.clone();\n const json = await responseClone.json();\n\n return {\n data: json,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n };\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message\n }\n };\n }\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditScore } from 'resources/CreditScores/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoresService extends ApiClient {\n static #basePath = '/v1/credit/scores';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScores(\n options?: {\n product_config_id?: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore[]>> {\n const searchOptions: {\n product_config_id?: string;\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(options?.product_config_id\n ? { product_config_id: options.product_config_id }\n : {}),\n ...(options?.include_factors\n ? { include_factors: options.include_factors.toString() }\n : {}),\n ...(options?.include_ingredients\n ? { include_ingredients: options.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async orderCreditScore(\n requestOptions: {\n product_config_id: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore>> {\n const searchOptions: {\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(requestOptions?.include_factors\n ? { include_factors: requestOptions.include_factors.toString() }\n : {}),\n ...(requestOptions?.include_ingredients\n ? { include_ingredients: requestOptions.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}?${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient/ApiClient';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n Entitlement,\n Entitlements,\n ProductEligibility,\n EntitleCustomerResponse\n} from 'resources/Entitlements/types';\n\nexport class EntitlementsService extends ApiClient {\n static #basePath = '/v1/entitlements';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getEntitlements(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlements>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}?customer_id=${requestOptions.customer_id}`,\n fetchOptions\n );\n }\n\n async getEntitlementById(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n fetchOptions\n );\n }\n\n async createEntitlement(\n requestOptions: {\n name: string;\n description: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async updateEntitlement(\n requestOptions: {\n entitlement_id: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { entitlement_id, ...body } = requestOptions;\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'PUT',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async deleteEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async activateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async entitleCustomerToNewProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<EntitleCustomerResponse>> {\n const { product_config_id, entitlement_id, customer_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {}),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'X-Customer-ID': customer_id\n }\n });\n }\n\n async activateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async removeProductFromEntitlement(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getProductEligibility(\n requestOptions: { product_config_id: string; customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductEligibility>> {\n const search = new URLSearchParams(requestOptions).toString();\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/eligibility?${search}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditAttributes } from 'resources/CreditAttributes/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditAttributesService extends ApiClient {\n /**\n * Update the path below to the endpoint of the service you are adding\n */\n static #basePath = '/v1/credit/attributes';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditAttributes(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditAttributes[]>> {\n const endpoint = `${this.baseUrl}${CreditAttributesService.#basePath}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScoreSimulator,\n CreditScoreSimulatorPostRequest,\n CreditScoreSimulatorPostResponse,\n SimulationCategoryType\n} from 'resources/CreditScoreSimulator/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoreSimulatorService extends ApiClient {\n static #basePath = '/v1/credit/tools/simulator';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getSimulations(\n requestOptions: {\n product_config_id: string;\n run_all?: boolean;\n cateogory?: SimulationCategoryType;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulator>> {\n const searchOptions = {\n ...requestOptions,\n ...(requestOptions?.run_all\n ? { run_all: requestOptions.run_all.toString() }\n : {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async simulateScenario(\n requestOptions: CreditScoreSimulatorPostRequest & {\n product_config_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulatorPostResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n return this.fetchWithAuth(\n `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n }\n );\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScorePlan,\n ScorePlanCreateResponse,\n ScorePlanRevision,\n ScorePlanRevisionsRequest\n} from 'resources/CreditScorePlanner/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScorePlannerService extends ApiClient {\n static #basePath = '/v1/credit/tools/planners';\n static #revisionPath = '/revisions';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScorePlan>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n\n async createCreditScorePlan(\n requestOptions: ScorePlanRevision & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanCreateResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<void>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getCreditScorePlanRevisions(\n requestOptions: ScorePlanRevisionsRequest & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanRevision[]>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${CreditScorePlannerService.#revisionPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n body: JSON.stringify(requestBody),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { Alert, Alerts, TotalAlertCounts } from 'resources/Alerts/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class AlertsService extends ApiClient {\n static #basePath = '/v1/events-alerts';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAlerts(\n requestOptions?: {\n page_limit: number;\n next_page_token: string | null;\n disposition_status?: 'READ' | 'UNREAD';\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alerts>> {\n const options = {\n page_limit: '10',\n next_page_token: '',\n ...(requestOptions ?? {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(options).toString();\n\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}?${query}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getAlertById(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markAlertAsRead(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}/dispose`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n ...(fetchOptions ?? {})\n });\n }\n\n async getAlertCounts(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<TotalAlertCounts>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/counts`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreditReportMeta,\n CreditReport\n} from 'resources/CreditReports/types';\n\nexport class CreditReportsService extends ApiClient {\n static #basePath = '/v1/credit/reports';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getReports(\n requestOptions?: {\n product_config_id?: string;\n include_fields?: string;\n report_date?: string;\n report_between?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport[]>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportById(\n requestOptions: {\n id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportsMeta(\n requestOptions?: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: boolean;\n report_read?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta[]>> {\n const { latest_only, report_read, ...options } = requestOptions ?? {};\n\n const searchOptions: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: string;\n report_read?: string;\n } = {\n ...(options ?? {}),\n ...(latest_only ? { latest_only: latest_only.toString() } : {}),\n ...(report_read ? { report_read: report_read.toString() } : {})\n };\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportMetaById(\n requestOptions: {\n id: string;\n product_config_id?: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${id}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markReportAsRead(\n requestOptions: {\n id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}/read`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PUT',\n ...(fetchOptions ?? {})\n });\n }\n\n async orderReport(\n requestOptions: {\n product_config_id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const searchOptions = {\n ...(requestOptions.include_fields\n ? { include_fields: requestOptions.include_fields.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreateCustomerOptions,\n Customer,\n CustomerSearchOptions,\n CustomerSearchResults\n} from 'resources/Customers/types';\n\nexport class CustomersService extends ApiClient {\n static #basePath = '/v1/customers';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCustomerById(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async updateCustomer(\n requestOptions: Pick<Customer, 'customer_id'> &\n Partial<Omit<Customer, 'customer_id'>>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const { customer_id, ...updates } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(updates ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCustomer(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async createCustomer(\n requestOptions: CreateCustomerOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async searchCustomers(\n requestOptions: CustomerSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CustomerSearchResults>> {\n const { next_cursor = '', ...searchOptions } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/search`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ next_cursor, ...(searchOptions ?? {}) }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient } from 'lib/ApiClient';\nimport type {\n ApiClientResponse,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type {\n AuthAnswersRequest,\n AuthQuestions\n} from 'resources/CustomerAuth/types';\n\nexport class CustomerAuthService extends ApiClient {\n static #basePath = '/v1/authentication';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAuthQuestions(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<AuthQuestions>> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async submitAuthAnswers(\n answers: AuthAnswersRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(answers),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nimport type {\n CreateRegistrationsRequest,\n CreateRegistrationsResponse\n} from 'resources/Registrations/types';\n\nexport class RegistrationsService extends ApiClient {\n static #basePath = '/v1/registrations';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async createRegistration(\n requestOptions: CreateRegistrationsRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreateRegistrationsResponse>> {\n const endpoint = `${this.baseUrl}${RegistrationsService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n ProductConfig,\n ProductConfigsSearchOptions,\n ProductConfigs\n} from 'resources/ProductConfigs/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class ProductConfigsService extends ApiClient {\n static #basePath = '/v1/product-configs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getProductConfigs(\n searchOptions: ProductConfigsSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfigs>> {\n const { fromEntries, entries } = Object;\n const { isArray } = Array;\n\n const options = fromEntries(\n entries(searchOptions)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [\n key,\n isArray(value) ? value.join(',') : value.toString()\n ])\n );\n const query = new URLSearchParams(options).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ? fetchOptions : {})\n });\n }\n\n async getProductConfigById(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfig>> {\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}/${requestOptions.product_config_id}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n}\n","export function pascalToCamelCase(name: string): string {\n const result = `${name[0].toLowerCase()}${name.substring(1)}`.replace(\n 'Service',\n ''\n );\n\n return result;\n}\n\nexport const isNode =\n typeof process !== 'undefined' &&\n process.versions &&\n process.versions.node &&\n typeof window === 'undefined';\n","import {\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport { ENVIRONMENT_URLS } from 'src/globals';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient';\nimport { isNode } from 'utils';\n\nexport type BearerToken = {\n access_token: string;\n token_type: string;\n expires_in: number;\n expires: string;\n};\n\nexport type AuthCredentials = {\n grantType: 'client_credentials' | 'trusted_partner';\n clientId: string;\n clientSecret: string;\n customerId?: string;\n};\n\nexport type AuthServiceConfig = Omit<ConnectedSolutionsSDKConfig, 'token'>;\n\nexport class AuthService {\n config: AuthServiceConfig;\n #cache: Map<string, Promise<Response>>;\n #ttl: number | null = null;\n baseUrl = '';\n\n static #basePath = '/v1/oauth2/token';\n\n constructor(config: AuthServiceConfig) {\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[config.environment ?? 'PRODUCTION'];\n this.#cache = new Map();\n }\n\n public async getAccessToken(credentials: AuthCredentials) {\n const isBrowser = !isNode;\n\n if (isBrowser) {\n throw ConnectedSolutionsClientError.generateError({\n type: 'sdk_error',\n message: 'getAccessToken is not supported in browser'\n });\n }\n\n try {\n const response = await this.#fetchToken(credentials);\n\n return {\n data: response,\n errors: undefined,\n meta: {\n status: 200,\n statusText: 'OK'\n }\n };\n } catch (e) {\n // don't cache errors\n this.clearCache();\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status,\n statusText: e.message\n }\n };\n }\n }\n\n public getCacheLength() {\n return this.#cache.size;\n }\n\n public clearCache(): void {\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const cacheKeys = Array.from(this.#cache.keys()).filter((key) =>\n key.includes(endpoint)\n );\n\n for (const key of cacheKeys) {\n this.#cache.delete(key);\n }\n }\n\n async #fetchToken({\n grantType,\n clientId,\n clientSecret,\n customerId\n }: AuthCredentials) {\n this.#checkTokenExpiry();\n\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const options = {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'include' as RequestCredentials,\n body: JSON.stringify({\n grant_type: grantType,\n client_id: clientId,\n client_secret: clientSecret,\n partner_customer_id: customerId ?? ''\n })\n };\n\n const tokenRequest = await this.#executeRequest(endpoint, options);\n\n if (tokenRequest?.ok) {\n const tokenRequestClone = tokenRequest.clone();\n const accessToken = (await tokenRequestClone.json()) as BearerToken;\n\n if (this.#ttl === null) {\n this.#setTTL(accessToken.expires_in);\n }\n\n return accessToken;\n }\n\n // response was not ok\n let err: ConnectedSolutionsClientRawError;\n\n const errorMeta = {\n status: tokenRequest?.status,\n message: tokenRequest?.statusText || '',\n data: undefined\n };\n\n if (tokenRequest?.status === 401) {\n err = {\n type: 'auth_error',\n ...errorMeta\n };\n } else {\n err = {\n type: 'api_error',\n ...errorMeta\n };\n }\n\n if (\n tokenRequest?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = tokenRequest.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n err.data = errorJson.error;\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n #setTTL(value: number | null) {\n const now = new Date().getTime();\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const nextTimestamp = now + oneHourInMilliseconds;\n const nextState =\n value === null ? value : new Date(nextTimestamp).valueOf();\n\n this.#ttl = nextState;\n }\n\n #checkTokenExpiry() {\n const now = new Date(Date.now());\n const expires = new Date(this.#ttl ?? Number.NaN);\n const isTokenExpired = isAfter(now, expires);\n\n if (isTokenExpired) {\n this.#setTTL(null);\n this.#cache.clear();\n }\n }\n\n async #executeRequest(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<Response | undefined> {\n const cacheKey = `${input}${JSON.stringify(init || {})}`;\n\n if (!this.#cache.has(cacheKey)) {\n const promise = fetch(input, init ?? {});\n this.#cache.set(cacheKey, promise);\n }\n\n return await this.#cache.get(cacheKey);\n }\n}\n\nfunction isAfter(date1: Date, date2: Date) {\n return date1 > date2;\n}\n","import * as resources from 'resources';\nimport { pascalToCamelCase } from 'utils';\nimport type { CreditScoresService } from 'resources/CreditScores';\nimport type { EntitlementsService } from 'resources/Entitlements';\nimport type {\n ConnectedSolutionsSDK,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type { CreditScoreSimulatorService } from 'resources/CreditScoreSimulator/CreditScoreSimulator';\nimport type { CreditScorePlannerService } from 'resources/CreditScorePlanner';\nimport type { CreditAttributesService } from 'resources/CreditAttributes/CreditAttributes';\nimport { AuthService } from 'lib/AuthClient/AuthClient';\nimport { ApiClient } from 'lib/ApiClient';\nimport type { AlertsService } from 'resources/Alerts';\nimport type { CreditReportsService } from 'resources/CreditReports';\nimport type { CustomersService } from 'resources/Customers';\nimport type { CustomerAuthService } from 'resources/CustomerAuth';\nimport type { RegistrationsService } from 'resources/Registrations';\nimport type { ProductConfigsService } from 'resources/ProductConfigs';\n// new service imports go here\n\nexport class SDKClient extends ApiClient implements ConnectedSolutionsSDK {\n static #instance: SDKClient | null = null;\n alerts: AlertsService;\n auth: AuthService;\n creditReports: CreditReportsService;\n creditScores: CreditScoresService;\n creditAttributes: CreditAttributesService;\n creditScorePlanner: CreditScorePlannerService;\n creditScoreSimulator: CreditScoreSimulatorService;\n customerAuth: CustomerAuthService;\n customers: CustomersService;\n entitlements: EntitlementsService;\n productConfigs: ProductConfigsService;\n registrations: RegistrationsService;\n // new services go here\n\n // The method is static as we need to access the method only through the class here\n static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient {\n // if instance is already created return that otherwise create it\n if (SDKClient.#instance) {\n return SDKClient.#instance;\n }\n\n SDKClient.#instance = new SDKClient(config);\n return SDKClient.#instance;\n }\n\n static clearInstance() {\n SDKClient.#instance = null;\n }\n\n // constructor is private so that no other class can access it.\n private constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n for (const name in resources) {\n if (typeof resources[name] === 'function') {\n this[pascalToCamelCase(name)] = new resources[name](config);\n }\n }\n\n this.auth = new AuthService({\n environment: config.environment\n });\n }\n}\n\nexport function createSDK(userConfig: ConnectedSolutionsSDKConfig) {\n return SDKClient.getInstance(userConfig);\n}\n","import type {\n CreditScorePlan,\n FicoCreditScorePlanCompleted,\n VantageCreditScorePlanCompleted,\n FicoCreditScorePlanSet,\n VantageCreditScorePlanSet,\n VantageCreditScorePlan,\n FicoCreditScorePlan,\n ScorePlanRevisionsRequest,\n FicoScorePlanRevisionsRequest,\n VantageScorePlanRevisionsRequest,\n ScorePlanRevision,\n FicoScorePlanRevision,\n VantageScorePlanRevision\n} from 'resources/CreditScorePlanner/types';\n\nexport function isPlanCompleted(\n plan: CreditScorePlan\n): plan is FicoCreditScorePlanCompleted | VantageCreditScorePlanCompleted {\n return (\n plan.progress_status === 'TARGET_NOT_MET' ||\n plan.progress_status === 'COMPLETED'\n );\n}\n\nexport function isPlanSet(\n plan: CreditScorePlan\n): plan is\n | FicoCreditScorePlanCompleted\n | FicoCreditScorePlanSet\n | VantageCreditScorePlanCompleted\n | VantageCreditScorePlanSet {\n return (\n isPlanCompleted(plan) ||\n plan.progress_status === 'TARGET_SCORE_AND_PLAN_SET' ||\n plan.progress_status === 'ON_TRACK' ||\n plan.progress_status === 'OFF_TRACK'\n );\n}\n\nexport function isVantagePlan(\n plan: CreditScorePlan\n): plan is VantageCreditScorePlan {\n return plan.score_model.includes('VANTAGE');\n}\n\nexport function isFicoPlan(plan: CreditScorePlan): plan is FicoCreditScorePlan {\n return plan.score_model.includes('FICO');\n}\n\nexport function isFicoRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is FicoScorePlanRevisionsRequest {\n return (request as FicoScorePlanRevisionsRequest).target_score !== undefined;\n}\n\nexport function isVantageRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is VantageScorePlanRevisionsRequest {\n return (\n (request as VantageScorePlanRevisionsRequest).max_actions_per_plan !==\n undefined\n );\n}\n\nexport function isFicoRevision(\n revision: ScorePlanRevision\n): revision is FicoScorePlanRevision {\n return revision.score_model.includes('FICO');\n}\n\nexport function isVantageRevision(\n revision: ScorePlanRevision\n): revision is VantageScorePlanRevision {\n return revision.score_model.includes('VANTAGE');\n}\n","import type {\n CreditScoreSimulator,\n FicoScenario,\n FicoScenarioVariation,\n FicoScoreSimulator,\n Scenario,\n ScenarioVariation,\n VantageScenario,\n VantageScenarioVariation\n} from 'resources/CreditScoreSimulator/types';\n\nexport function isFicoSimulator(\n data?: CreditScoreSimulator\n): data is FicoScoreSimulator {\n return Boolean(data && 'best_action' in data);\n}\n\nexport function isVantageScenario(\n scenario?: Scenario\n): scenario is VantageScenario {\n return Boolean(scenario && 'simulated_score' in scenario);\n}\n\nexport function isFicoScenario(scenario: Scenario): scenario is FicoScenario {\n return !('simulated_score' in scenario);\n}\n\nexport function isFicoScenarioVariation(\n variation?: ScenarioVariation\n): variation is FicoScenarioVariation {\n return Boolean(\n variation &&\n 'slider_min_value' in variation &&\n 'slider_max_value' in variation\n );\n}\n\nexport function isVantageScenarioVariation(\n variation?: ScenarioVariation\n): variation is VantageScenarioVariation {\n return Boolean(\n variation && 'value' in variation && 'simulated_score' in variation\n );\n}\n"],"names":["generateError","rawError","ConnectedSolutionsClientApiError","ConnectedSolutionsClientAuthError","ConnectedSolutionsClientSDKError","ConnectedSolutionsClientUnknownError","ConnectedSolutionsClientError","raw","__publicField","_a","args","ENVIRONMENT_URLS","CONTENTSTACK_URLS","ApiClient","config","__privateAdd","_ApiClient_instances","environment","partialConfig","input","init","__privateMethod","validateConfig_fn","headers","options","error","e","response","err","apiError","errorJson","isJsonResponse_fn","_b","_CreditScoresService","fetchOptions","searchOptions","query","queryString","endpoint","__privateGet","_basePath","requestOptions","CreditScoresService","_EntitlementsService","entitlement_id","body","product_config_id","customer_id","search","EntitlementsService","_CreditAttributesService","CreditAttributesService","_CreditScoreSimulatorService","requestBody","CreditScoreSimulatorService","_CreditScorePlannerService","_revisionPath","CreditScorePlannerService","_AlertsService","id","AlertsService","_CreditReportsService","latest_only","report_read","CreditReportsService","_CustomersService","updates","next_cursor","CustomersService","_CustomerAuthService","answers","CustomerAuthService","_RegistrationsService","RegistrationsService","_ProductConfigsService","fromEntries","entries","isArray","_","value","key","ProductConfigsService","pascalToCamelCase","name","isNode","_AuthService","_AuthService_instances","_cache","_ttl","__privateSet","credentials","fetchToken_fn","cacheKeys","grantType","clientId","clientSecret","customerId","checkTokenExpiry_fn","tokenRequest","executeRequest_fn","accessToken","setTTL_fn","errorMeta","now","oneHourInMilliseconds","nextTimestamp","nextState","expires","isAfter","cacheKey","promise","AuthService","date1","date2","_SDKClient","resources","_instance","SDKClient","createSDK","userConfig","isPlanCompleted","plan","isPlanSet","isVantagePlan","isFicoPlan","isFicoRevisionsRequest","request","isVantageRevisionsRequest","isFicoRevision","revision","isVantageRevision","isFicoSimulator","data","isVantageScenario","scenario","isFicoScenario","isFicoScenarioVariation","variation","isVantageScen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,SAAS,MAAM,CAC7C,CAEO,SAASC,GACdD,EACsC,CAC/B,OAAAA,EAAS,YAAY,SAAS,SAAS,CAChD,CChEO,SAASE,GACdC,EAC4B,CACrB,MAAA,GAAQA,GAAQ,gBAAiBA,EAC1C,CAEO,SAASC,GACdC,EAC6B,CACtB,MAAA,GAAQA,GAAY,oBAAqBA,EAClD,CAEO,SAASC,GAAeD,EAA8C,CAC3E,MAAO,EAAE,oBAAqBA,EAChC,CAEO,SAASE,GACdC,EACoC,CAC7B,MAAA,GACLA,GACE,qBAAsBA,GACtB,qBAAsBA,EAE5B,CAEO,SAASC,GACdD,EACuC,CAChC,MAAA,GACLA,GAAa,UAAWA,GAAa,oBAAqBA,EAE9D"}
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../../src/lib/Error.ts","../../src/globals.ts","../../src/lib/ApiClient/ApiClient.ts","../../src/resources/CreditScores/CreditScores.ts","../../src/resources/Entitlements/Entitlements.ts","../../src/resources/CreditAttributes/CreditAttributes.ts","../../src/resources/CreditScoreSimulator/CreditScoreSimulator.ts","../../src/resources/CreditScorePlanner/CreditScorePlanner.ts","../../src/resources/Alerts/Alerts.ts","../../src/resources/CreditReports/CreditReports.ts","../../src/resources/Customers/Customers.ts","../../src/resources/CustomerAuth/CustomerAuth.ts","../../src/resources/Registrations/Registrations.ts","../../src/resources/ProductConfigs/ProductConfigs.ts","../../src/utils.ts","../../src/lib/AuthClient/AuthClient.ts","../../src/lib/SDKClient/SDKClient.ts","../../src/resources/CreditScorePlanner/typeGuards.ts","../../src/resources/CreditScoreSimulator/typeGuards.ts"],"sourcesContent":["export type ConnectedSolutionsAPIErrorData = {\n dev_url: string;\n code: string;\n message: string;\n};\n\nexport type ConnectedSolutionsSDKErrorTypes =\n | 'api_error'\n | 'auth_error'\n | 'sdk_error'\n | 'unknown_error';\n\nexport type ConnectedSolutionsClientRawError = {\n message: string;\n type: ConnectedSolutionsSDKErrorTypes;\n status?: number;\n data?: ConnectedSolutionsAPIErrorData;\n};\n\nfunction generateError(rawError: ConnectedSolutionsClientRawError) {\n switch (rawError.type) {\n case 'api_error':\n return new ConnectedSolutionsClientApiError(rawError);\n case 'auth_error':\n return new ConnectedSolutionsClientAuthError(rawError);\n case 'sdk_error':\n return new ConnectedSolutionsClientSDKError(rawError);\n default:\n return new ConnectedSolutionsClientUnknownError(rawError);\n }\n}\n\nexport class ConnectedSolutionsClientError extends Error {\n readonly message: string;\n readonly data?: ConnectedSolutionsAPIErrorData;\n readonly status?: number;\n\n constructor(raw: ConnectedSolutionsClientRawError) {\n super(raw.message);\n this.message = raw.data?.message || raw.message || '';\n this.data = raw.data;\n this.status = raw.status;\n }\n\n static generateError = generateError;\n}\n\nexport class ConnectedSolutionsClientApiError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientApiError';\n }\n}\n\nexport class ConnectedSolutionsClientAuthError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientAuthError';\n }\n}\n\nexport class ConnectedSolutionsClientUnknownError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientUnknownError';\n }\n}\n\nexport class ConnectedSolutionsClientSDKError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSDKError';\n }\n}\n","export const ENVIRONMENT_URLS = {\n PRODUCTION: 'https://connected-api.experian.com',\n SANDBOX: 'https://sandbox.connected-api.experian.com',\n UAT: 'https://uat-api.ecs.experian.com',\n INTEGRATION: 'https://integration-api.ecs.experian.com',\n DEVELOPMENT: 'https://dev-api.ecs.experian.com'\n};\n\nexport const CONTENTSTACK_URLS = {\n PRODUCTION:\n 'https://unity-contentstack.integration.us-exp-api.experiancs.com',\n SANDBOX: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n UAT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n INTEGRATION: 'https://unity-contentstack.dev.us-exp-api.experiancs.com',\n DEVELOPMENT: 'https://unity-contentstack.dev.us-exp-api.experiancs.com'\n};\n","import {\n type ConnectedSolutionsClientApiError,\n type ConnectedSolutionsClientAuthError,\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsClientSDKError,\n type ConnectedSolutionsClientUnknownError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport { CONTENTSTACK_URLS, ENVIRONMENT_URLS } from 'globals';\n\nexport type ConnectedSolutionsClientMeta = {\n status: number;\n statusText: string;\n};\n\nexport type ConnectedSolutionsClientErrors =\n | ConnectedSolutionsClientApiError\n | ConnectedSolutionsClientAuthError\n | ConnectedSolutionsClientUnknownError\n | ConnectedSolutionsClientSDKError;\n\nexport type ApiClientResponse<DataType = Record<string, unknown>> =\n | {\n data: DataType;\n error: undefined;\n meta: ConnectedSolutionsClientMeta;\n }\n | {\n data: undefined;\n error: ConnectedSolutionsClientErrors;\n meta: ConnectedSolutionsClientMeta;\n };\n\nexport class ApiClient {\n config: ConnectedSolutionsSDKConfig;\n baseUrl = '';\n contentstackUrl = '';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n const defaultEnvironement = 'PRODUCTION';\n const environment = config.environment ?? defaultEnvironement;\n\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[environment];\n this.contentstackUrl = CONTENTSTACK_URLS[environment];\n }\n\n #validateConfig(): void {\n if (!this.config.token) {\n const error: ConnectedSolutionsClientRawError = {\n type: 'sdk_error',\n message:\n 'You must first obtain and set a token before using an SDK method'\n };\n\n throw ConnectedSolutionsClientError.generateError(error);\n }\n }\n\n #isJsonResponse(response: Response) {\n return (\n response?.headers.get('content-type')?.includes('application/json') ||\n response?.headers\n .get('content-type')\n ?.includes('application/octet-stream')\n );\n }\n\n public setConfig(partialConfig: Partial<ConnectedSolutionsSDKConfig>) {\n if ('environment' in partialConfig) {\n this.config.environment = partialConfig.environment;\n }\n\n if ('token' in partialConfig) {\n this.config.token = partialConfig.token;\n }\n }\n\n public async fetchWithAuth<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n const headers =\n typeof Headers !== 'undefined' && new Headers(init?.headers);\n\n // biome-ignore lint/complexity/useLiteralKeys: works\n if (headers && !headers['Authorization']) {\n headers.set('Authorization', `Bearer ${this.config.token}`);\n }\n\n const options = {\n ...init,\n headers: headers ? headers : init?.headers || {}\n };\n\n const response = await this.fetchRequest<DataType>(input, options);\n\n return response;\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message ?? ''\n }\n };\n }\n }\n\n public async fetchRequest<DataType>(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<ApiClientResponse<DataType>> {\n try {\n this.#validateConfig();\n\n const response = await fetch(input, init);\n\n if (!response?.ok) {\n let err: ConnectedSolutionsClientRawError;\n\n const apiError: ConnectedSolutionsClientRawError = {\n type: 'api_error',\n status: response?.status,\n message: response?.statusText\n };\n\n if (\n response?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = response.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n apiError.data = errorJson.error;\n }\n\n if (response?.status === 401) {\n err = {\n ...apiError,\n type: 'auth_error'\n };\n } else {\n err = {\n ...apiError,\n type: 'api_error'\n };\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n if (!this.#isJsonResponse(response)) {\n return {\n data: undefined,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n } as ApiClientResponse<DataType>;\n }\n\n const responseClone = response.clone();\n const json = await responseClone.json();\n\n return {\n data: json,\n error: undefined,\n meta: {\n status: response.status,\n statusText: response.statusText\n }\n };\n } catch (error) {\n const e = error as ConnectedSolutionsClientErrors;\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status ?? 500,\n statusText: e.message\n }\n };\n }\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditScore } from 'resources/CreditScores/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoresService extends ApiClient {\n static #basePath = '/v1/credit/scores';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScores(\n options?: {\n product_config_id?: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore[]>> {\n const searchOptions: {\n product_config_id?: string;\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(options?.product_config_id\n ? { product_config_id: options.product_config_id }\n : {}),\n ...(options?.include_factors\n ? { include_factors: options.include_factors.toString() }\n : {}),\n ...(options?.include_ingredients\n ? { include_ingredients: options.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async orderCreditScore(\n requestOptions: {\n product_config_id: string;\n include_factors?: boolean;\n include_ingredients?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScore>> {\n const searchOptions: {\n include_factors?: string;\n include_ingredients?: string;\n } = {\n ...(requestOptions?.include_factors\n ? { include_factors: requestOptions.include_factors.toString() }\n : {}),\n ...(requestOptions?.include_ingredients\n ? { include_ingredients: requestOptions.include_ingredients.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoresService.#basePath}?${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient/ApiClient';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n Entitlement,\n Entitlements,\n ProductEligibility,\n EntitleCustomerResponse\n} from 'resources/Entitlements/types';\n\nexport class EntitlementsService extends ApiClient {\n static #basePath = '/v1/entitlements';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getEntitlements(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlements>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}?customer_id=${requestOptions.customer_id}`,\n fetchOptions\n );\n }\n\n async getEntitlementById(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n fetchOptions\n );\n }\n\n async createEntitlement(\n requestOptions: {\n name: string;\n description: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async updateEntitlement(\n requestOptions: {\n entitlement_id: string;\n product_config_ids: string[];\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { entitlement_id, ...body } = requestOptions;\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'PUT',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(body),\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async deleteEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n return this.fetchWithAuth(\n `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}`,\n {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n }\n );\n }\n\n async activateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateEntitlement(\n { entitlement_id }: { entitlement_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async entitleCustomerToNewProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n customer_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<EntitleCustomerResponse>> {\n const { product_config_id, entitlement_id, customer_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {}),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'X-Customer-ID': customer_id\n }\n });\n }\n\n async activateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/activate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async deactivateProduct(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}/deactivate`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n ...(fetchOptions ?? {})\n });\n }\n\n async removeProductFromEntitlement(\n requestOptions: {\n product_config_id: string;\n entitlement_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Entitlement>> {\n const { product_config_id, entitlement_id } = requestOptions;\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/${entitlement_id}/products/${product_config_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getProductEligibility(\n requestOptions: { product_config_id: string; customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductEligibility>> {\n const search = new URLSearchParams(requestOptions).toString();\n const endpoint = `${this.baseUrl}${EntitlementsService.#basePath}/eligibility?${search}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { CreditAttributes } from 'resources/CreditAttributes/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditAttributesService extends ApiClient {\n /**\n * Update the path below to the endpoint of the service you are adding\n */\n static #basePath = '/v1/credit/attributes';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditAttributes(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditAttributes[]>> {\n const endpoint = `${this.baseUrl}${CreditAttributesService.#basePath}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScoreSimulator,\n CreditScoreSimulatorPostRequest,\n CreditScoreSimulatorPostResponse,\n SimulationCategoryType\n} from 'resources/CreditScoreSimulator/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoreSimulatorService extends ApiClient {\n static #basePath = '/v1/credit/tools/simulator';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getSimulations(\n requestOptions: {\n product_config_id: string;\n run_all?: boolean;\n cateogory?: SimulationCategoryType;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulator>> {\n const searchOptions = {\n ...requestOptions,\n ...(requestOptions?.run_all\n ? { run_all: requestOptions.run_all.toString() }\n : {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async simulateScenario(\n requestOptions: CreditScoreSimulatorPostRequest & {\n product_config_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScoreSimulatorPostResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n return this.fetchWithAuth(\n `${this.baseUrl}${CreditScoreSimulatorService.#basePath}${queryString}`,\n {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n }\n );\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n CreditScorePlan,\n ScorePlanCreateResponse,\n ScorePlanRevision,\n ScorePlanRevisionsRequest\n} from 'resources/CreditScorePlanner/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScorePlannerService extends ApiClient {\n static #basePath = '/v1/credit/tools/planners';\n static #revisionPath = '/revisions';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditScorePlan>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n\n async createCreditScorePlan(\n requestOptions: ScorePlanRevision & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanCreateResponse>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestBody),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCreditScorePlan(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<void>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async getCreditScorePlanRevisions(\n requestOptions: ScorePlanRevisionsRequest & { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ScorePlanRevision[]>> {\n const { product_config_id, ...requestBody } = requestOptions;\n const query = new URLSearchParams({ product_config_id }).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditScorePlannerService.#basePath}${CreditScorePlannerService.#revisionPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n body: JSON.stringify(requestBody),\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { Alert, Alerts, TotalAlertCounts } from 'resources/Alerts/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class AlertsService extends ApiClient {\n static #basePath = '/v1/events-alerts';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAlerts(\n requestOptions?: {\n page_limit: number;\n next_page_token: string | null;\n disposition_status?: 'READ' | 'UNREAD';\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alerts>> {\n const options = {\n page_limit: '10',\n next_page_token: '',\n ...(requestOptions ?? {})\n } as Record<string, string>;\n\n const query = new URLSearchParams(options).toString();\n\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}?${query}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getAlertById(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markAlertAsRead(\n { id }: { id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Alert>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/${id}/dispose`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n ...(fetchOptions ?? {})\n });\n }\n\n async getAlertCounts(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<TotalAlertCounts>> {\n const endpoint = `${this.baseUrl}${AlertsService.#basePath}/counts`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreditReportMeta,\n CreditReport\n} from 'resources/CreditReports/types';\n\nexport class CreditReportsService extends ApiClient {\n static #basePath = '/v1/credit/reports';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getReports(\n requestOptions?: {\n product_config_id?: string;\n include_fields?: string;\n report_date?: string;\n report_between?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport[]>> {\n const query = new URLSearchParams(requestOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportById(\n requestOptions: {\n id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportsMeta(\n requestOptions?: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: boolean;\n report_read?: boolean;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta[]>> {\n const { latest_only, report_read, ...options } = requestOptions ?? {};\n\n const searchOptions: {\n product_config_id?: string;\n report_date?: string;\n report_between?: string;\n latest_only?: string;\n report_read?: string;\n } = {\n ...(options ?? {}),\n ...(latest_only ? { latest_only: latest_only.toString() } : {}),\n ...(report_read ? { report_read: report_read.toString() } : {})\n };\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportMetaById(\n requestOptions: {\n id: string;\n product_config_id?: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReportMeta>> {\n const { id, ...searchOptions } = requestOptions;\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${id}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markReportAsRead(\n requestOptions: {\n id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}/${requestOptions.id}/read`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PUT',\n ...(fetchOptions ?? {})\n });\n }\n\n async orderReport(\n requestOptions: {\n product_config_id: string;\n include_fields?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreditReport>> {\n const searchOptions = {\n ...(requestOptions.include_fields\n ? { include_fields: requestOptions.include_fields.toString() }\n : {})\n };\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${CreditReportsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n product_config_id: requestOptions.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type {\n CreateCustomerOptions,\n Customer,\n CustomerSearchOptions,\n CustomerSearchResults\n} from 'resources/Customers/types';\n\nexport class CustomersService extends ApiClient {\n static #basePath = '/v1/customers';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getCustomerById(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async updateCustomer(\n requestOptions: Pick<Customer, 'customer_id'> &\n Partial<Omit<Customer, 'customer_id'>>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const { customer_id, ...updates } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(updates ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async deleteCustomer(\n requestOptions: { customer_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/${requestOptions.customer_id}`;\n return this.fetchWithAuth(endpoint, {\n method: 'DELETE',\n ...(fetchOptions ?? {})\n });\n }\n\n async createCustomer(\n requestOptions: CreateCustomerOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<Customer>> {\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n\n async searchCustomers(\n requestOptions: CustomerSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CustomerSearchResults>> {\n const { next_cursor = '', ...searchOptions } = requestOptions;\n const endpoint = `${this.baseUrl}${CustomersService.#basePath}/search`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({ next_cursor, ...(searchOptions ?? {}) }),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient } from 'lib/ApiClient';\nimport type {\n ApiClientResponse,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type {\n AuthAnswersRequest,\n AuthQuestions\n} from 'resources/CustomerAuth/types';\n\nexport class CustomerAuthService extends ApiClient {\n static #basePath = '/v1/authentication';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getAuthQuestions(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<AuthQuestions>> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async submitAuthAnswers(\n answers: AuthAnswersRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const endpoint = `${this.baseUrl}${CustomerAuthService.#basePath}/questions`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(answers),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nimport type {\n CreateRegistrationsRequest,\n CreateRegistrationsResponse\n} from 'resources/Registrations/types';\n\nexport class RegistrationsService extends ApiClient {\n static #basePath = '/v1/registrations';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async createRegistration(\n requestOptions: CreateRegistrationsRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<CreateRegistrationsResponse>> {\n const endpoint = `${this.baseUrl}${RegistrationsService.#basePath}`;\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(requestOptions ?? {}),\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type {\n ProductConfig,\n ProductConfigsSearchOptions,\n ProductConfigs\n} from 'resources/ProductConfigs/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class ProductConfigsService extends ApiClient {\n static #basePath = '/v1/product-configs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getProductConfigs(\n searchOptions: ProductConfigsSearchOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfigs>> {\n const { fromEntries, entries } = Object;\n const { isArray } = Array;\n\n const options = fromEntries(\n entries(searchOptions)\n .filter(([_, value]) => value !== undefined && value !== null)\n .map(([key, value]) => [\n key,\n isArray(value) ? value.join(',') : value.toString()\n ])\n );\n const query = new URLSearchParams(options).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ? fetchOptions : {})\n });\n }\n\n async getProductConfigById(\n requestOptions: { product_config_id: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfig>> {\n const endpoint = `${this.baseUrl}${ProductConfigsService.#basePath}/${requestOptions.product_config_id}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n}\n","export function pascalToCamelCase(name: string): string {\n const result = `${name[0].toLowerCase()}${name.substring(1)}`.replace(\n 'Service',\n ''\n );\n\n return result;\n}\n\nexport const isNode =\n typeof process !== 'undefined' &&\n process.versions &&\n process.versions.node &&\n typeof window === 'undefined';\n","import {\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsAPIErrorData\n} from 'lib/Error';\nimport { ENVIRONMENT_URLS } from 'src/globals';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient';\nimport { isNode } from 'utils';\n\nexport type BearerToken = {\n access_token: string;\n token_type: string;\n expires_in: number;\n expires: string;\n};\n\nexport type AuthCredentials = {\n grantType: 'client_credentials' | 'trusted_partner';\n clientId: string;\n clientSecret: string;\n customerId?: string;\n};\n\nexport type AuthServiceConfig = Omit<ConnectedSolutionsSDKConfig, 'token'>;\n\nexport class AuthService {\n config: AuthServiceConfig;\n #cache: Map<string, Promise<Response>>;\n #ttl: number | null = null;\n baseUrl = '';\n\n static #basePath = '/v1/oauth2/token';\n\n constructor(config: AuthServiceConfig) {\n this.config = config;\n this.baseUrl = ENVIRONMENT_URLS[config.environment ?? 'PRODUCTION'];\n this.#cache = new Map();\n }\n\n public async getAccessToken(credentials: AuthCredentials) {\n const isBrowser = !isNode;\n\n if (isBrowser) {\n throw ConnectedSolutionsClientError.generateError({\n type: 'sdk_error',\n message: 'getAccessToken is not supported in browser'\n });\n }\n\n try {\n const response = await this.#fetchToken(credentials);\n\n return {\n data: response,\n errors: undefined,\n meta: {\n status: 200,\n statusText: 'OK'\n }\n };\n } catch (e) {\n // don't cache errors\n this.clearCache();\n return {\n data: undefined,\n error: e,\n meta: {\n status: e.status,\n statusText: e.message\n }\n };\n }\n }\n\n public getCacheLength() {\n return this.#cache.size;\n }\n\n public clearCache(): void {\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const cacheKeys = Array.from(this.#cache.keys()).filter((key) =>\n key.includes(endpoint)\n );\n\n for (const key of cacheKeys) {\n this.#cache.delete(key);\n }\n }\n\n async #fetchToken({\n grantType,\n clientId,\n clientSecret,\n customerId\n }: AuthCredentials) {\n this.#checkTokenExpiry();\n\n const endpoint = `${this.baseUrl}${AuthService.#basePath}`;\n\n const options = {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n credentials: 'include' as RequestCredentials,\n body: JSON.stringify({\n grant_type: grantType,\n client_id: clientId,\n client_secret: clientSecret,\n ...(grantType === 'trusted_partner'\n ? { partner_customer_id: customerId ?? '' }\n : {})\n })\n };\n\n const tokenRequest = await this.#executeRequest(endpoint, options);\n\n if (tokenRequest?.ok) {\n const tokenRequestClone = tokenRequest.clone();\n const accessToken = (await tokenRequestClone.json()) as BearerToken;\n\n if (this.#ttl === null) {\n this.#setTTL(accessToken.expires_in);\n }\n\n return accessToken;\n }\n\n // response was not ok\n let err: ConnectedSolutionsClientRawError;\n\n const errorMeta = {\n status: tokenRequest?.status,\n message: tokenRequest?.statusText || '',\n data: undefined\n };\n\n if (tokenRequest?.status === 401) {\n err = {\n type: 'auth_error',\n ...errorMeta\n };\n } else {\n err = {\n type: 'api_error',\n ...errorMeta\n };\n }\n\n if (\n tokenRequest?.headers.get('content-type')?.includes('application/json')\n ) {\n const errorResponseClone = tokenRequest.clone();\n const errorJson = (await errorResponseClone.json()) as {\n error: ConnectedSolutionsAPIErrorData;\n };\n err.data = errorJson.error;\n }\n\n throw ConnectedSolutionsClientError.generateError(err);\n }\n\n #setTTL(value: number | null) {\n const now = new Date().getTime();\n const oneHourInMilliseconds = 60 * 60 * 1000;\n const nextTimestamp = now + oneHourInMilliseconds;\n const nextState =\n value === null ? value : new Date(nextTimestamp).valueOf();\n\n this.#ttl = nextState;\n }\n\n #checkTokenExpiry() {\n const now = new Date(Date.now());\n const expires = new Date(this.#ttl ?? Number.NaN);\n const isTokenExpired = isAfter(now, expires);\n\n if (isTokenExpired) {\n this.#setTTL(null);\n this.#cache.clear();\n }\n }\n\n async #executeRequest(\n input: RequestInfo,\n init?: RequestInit\n ): Promise<Response | undefined> {\n const cacheKey = `${input}${JSON.stringify(init || {})}`;\n\n if (!this.#cache.has(cacheKey)) {\n const promise = fetch(input, init ?? {});\n this.#cache.set(cacheKey, promise);\n }\n\n return await this.#cache.get(cacheKey);\n }\n}\n\nfunction isAfter(date1: Date, date2: Date) {\n return date1 > date2;\n}\n","import * as resources from 'resources';\nimport { pascalToCamelCase } from 'utils';\nimport type { CreditScoresService } from 'resources/CreditScores';\nimport type { EntitlementsService } from 'resources/Entitlements';\nimport type {\n ConnectedSolutionsSDK,\n ConnectedSolutionsSDKConfig\n} from 'lib/SDKClient/types';\nimport type { CreditScoreSimulatorService } from 'resources/CreditScoreSimulator/CreditScoreSimulator';\nimport type { CreditScorePlannerService } from 'resources/CreditScorePlanner';\nimport type { CreditAttributesService } from 'resources/CreditAttributes/CreditAttributes';\nimport { AuthService } from 'lib/AuthClient/AuthClient';\nimport { ApiClient } from 'lib/ApiClient';\nimport type { AlertsService } from 'resources/Alerts';\nimport type { CreditReportsService } from 'resources/CreditReports';\nimport type { CustomersService } from 'resources/Customers';\nimport type { CustomerAuthService } from 'resources/CustomerAuth';\nimport type { RegistrationsService } from 'resources/Registrations';\nimport type { ProductConfigsService } from 'resources/ProductConfigs';\n// new service imports go here\n\nexport class SDKClient extends ApiClient implements ConnectedSolutionsSDK {\n static #instance: SDKClient | null = null;\n alerts: AlertsService;\n auth: AuthService;\n creditReports: CreditReportsService;\n creditScores: CreditScoresService;\n creditAttributes: CreditAttributesService;\n creditScorePlanner: CreditScorePlannerService;\n creditScoreSimulator: CreditScoreSimulatorService;\n customerAuth: CustomerAuthService;\n customers: CustomersService;\n entitlements: EntitlementsService;\n productConfigs: ProductConfigsService;\n registrations: RegistrationsService;\n // new services go here\n\n // The method is static as we need to access the method only through the class here\n static getInstance(config: ConnectedSolutionsSDKConfig): SDKClient {\n // if instance is already created return that otherwise create it\n if (SDKClient.#instance) {\n return SDKClient.#instance;\n }\n\n SDKClient.#instance = new SDKClient(config);\n return SDKClient.#instance;\n }\n\n static clearInstance() {\n SDKClient.#instance = null;\n }\n\n // constructor is private so that no other class can access it.\n private constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n for (const name in resources) {\n if (typeof resources[name] === 'function') {\n this[pascalToCamelCase(name)] = new resources[name](config);\n }\n }\n\n this.auth = new AuthService({\n environment: config.environment\n });\n }\n}\n\nexport function createSDK(userConfig: ConnectedSolutionsSDKConfig) {\n return SDKClient.getInstance(userConfig);\n}\n","import type {\n CreditScorePlan,\n FicoCreditScorePlanCompleted,\n VantageCreditScorePlanCompleted,\n FicoCreditScorePlanSet,\n VantageCreditScorePlanSet,\n VantageCreditScorePlan,\n FicoCreditScorePlan,\n ScorePlanRevisionsRequest,\n FicoScorePlanRevisionsRequest,\n VantageScorePlanRevisionsRequest,\n ScorePlanRevision,\n FicoScorePlanRevision,\n VantageScorePlanRevision\n} from 'resources/CreditScorePlanner/types';\n\nexport function isPlanCompleted(\n plan: CreditScorePlan\n): plan is FicoCreditScorePlanCompleted | VantageCreditScorePlanCompleted {\n return (\n plan.progress_status === 'TARGET_NOT_MET' ||\n plan.progress_status === 'COMPLETED'\n );\n}\n\nexport function isPlanSet(\n plan: CreditScorePlan\n): plan is\n | FicoCreditScorePlanCompleted\n | FicoCreditScorePlanSet\n | VantageCreditScorePlanCompleted\n | VantageCreditScorePlanSet {\n return (\n isPlanCompleted(plan) ||\n plan.progress_status === 'TARGET_SCORE_AND_PLAN_SET' ||\n plan.progress_status === 'ON_TRACK' ||\n plan.progress_status === 'OFF_TRACK'\n );\n}\n\nexport function isVantagePlan(\n plan: CreditScorePlan\n): plan is VantageCreditScorePlan {\n return plan.score_model.includes('VANTAGE');\n}\n\nexport function isFicoPlan(plan: CreditScorePlan): plan is FicoCreditScorePlan {\n return plan.score_model.includes('FICO');\n}\n\nexport function isFicoRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is FicoScorePlanRevisionsRequest {\n return (request as FicoScorePlanRevisionsRequest).target_score !== undefined;\n}\n\nexport function isVantageRevisionsRequest(\n request: ScorePlanRevisionsRequest\n): request is VantageScorePlanRevisionsRequest {\n return (\n (request as VantageScorePlanRevisionsRequest).max_actions_per_plan !==\n undefined\n );\n}\n\nexport function isFicoRevision(\n revision: ScorePlanRevision\n): revision is FicoScorePlanRevision {\n return revision.score_model.includes('FICO');\n}\n\nexport function isVantageRevision(\n revision: ScorePlanRevision\n): revision is VantageScorePlanRevision {\n return revision.score_model.includes('VANTAGE');\n}\n","import type {\n CreditScoreSimulator,\n FicoScenario,\n FicoScenarioVariation,\n FicoScoreSimulator,\n Scenario,\n ScenarioVariation,\n VantageScenario,\n VantageScenarioVariation\n} from 'resources/CreditScoreSimulator/types';\n\nexport function isFicoSimulator(\n data?: CreditScoreSimulator\n): data is FicoScoreSimulator {\n return Boolean(data && 'best_action' in data);\n}\n\nexport function isVantageScenario(\n scenario?: Scenario\n): scenario is VantageScenario {\n return Boolean(scenario && 'simulated_score' in scenario);\n}\n\nexport function isFicoScenario(scenario: Scenario): scenario is FicoScenario {\n return !('simulated_score' in scenario);\n}\n\nexport function isFicoScenarioVariation(\n variation?: ScenarioVariation\n): variation is FicoScenarioVariation {\n return Boolean(\n variation &&\n 'slider_min_value' in variation &&\n 'slider_max_value' in variation\n );\n}\n\nexport function isVantageScenarioVariation(\n variation?: ScenarioVariation\n): variation is VantageScenarioVariation {\n return Boolean(\n variation && 'value' in variation && 'simulated_score' in variation\n );\n}\n"],"names":["generateError","rawError","ConnectedSolutionsClientApiError","ConnectedSolutionsClientAuthError","ConnectedSolutionsClientSDKError","ConnectedSolutionsClientUnknownError","ConnectedSolutionsClientError","raw","__publicField","_a","args","ENVIRONMENT_URLS","CONTENTSTACK_URLS","ApiClient","config","__privateAdd","_ApiClient_instances","environment","partialConfig","input","init","__privateMethod","validateConfig_fn","headers","options","error","e","response","err","apiError","errorJson","isJsonResponse_fn","_b","_CreditScoresService","fetchOptions","searchOptions","query","queryString","endpoint","__privateGet","_basePath","requestOptions","CreditScoresService","_EntitlementsService","entitlement_id","body","product_config_id","customer_id","search","EntitlementsService","_CreditAttributesService","CreditAttributesService","_CreditScoreSimulatorService","requestBody","CreditScoreSimulatorService","_CreditScorePlannerService","_revisionPath","CreditScorePlannerService","_AlertsService","id","AlertsService","_CreditReportsService","latest_only","report_read","CreditReportsService","_CustomersService","updates","next_cursor","CustomersService","_CustomerAuthService","answers","CustomerAuthService","_RegistrationsService","RegistrationsService","_ProductConfigsService","fromEntries","entries","isArray","_","value","key","ProductConfigsService","pascalToCamelCase","name","isNode","_AuthService","_AuthService_instances","_cache","_ttl","__privateSet","credentials","fetchToken_fn","cacheKeys","grantType","clientId","clientSecret","customerId","checkTokenExpiry_fn","tokenRequest","executeRequest_fn","accessToken","setTTL_fn","errorMeta","now","oneHourInMilliseconds","nextTimestamp","nextState","expires","isAfter","cacheKey","promise","AuthService","date1","date2","_SDKClient","resources","_instance","SDKClient","createSDK","userConfig","isPlanCompleted","plan","isPlanSet","isVantagePlan","isFicoPlan","isFicoRevisionsRequest","request","isVantageRevisionsRequest","isFicoRevision","revision","isVantageRevision","isFicoSimulator","data","isVantageScenario","scenario","isFicoScenario","isFicoScenarioVariation","variation","isVantageScenarioVariation"],"mappings":"w1BAmBA,SAASA,EAAcC,EAA4C,CACjE,OAAQA,EAAS,KAAM,CACrB,IAAK,YACI,OAAA,IAAIC,EAAiCD,CAAQ,EACtD,IAAK,aACI,OAAA,IAAIE,GAAkCF,CAAQ,EACvD,IAAK,YACI,OAAA,IAAIG,GAAiCH,CAAQ,EACtD,QACS,OAAA,IAAII,GAAqCJ,CAAQ,CAAA,CAE9D,CAEO,MAAMK,UAAsC,KAAM,CAKvD,YAAYC,EAAuC,OACjD,MAAMA,EAAI,OAAO,EALVC,EAAA,gBACAA,EAAA,aACAA,EAAA,eAIP,KAAK,UAAUC,EAAAF,EAAI,OAAJ,YAAAE,EAAU,UAAWF,EAAI,SAAW,GACnD,KAAK,KAAOA,EAAI,KAChB,KAAK,OAASA,EAAI,MAAA,CAItB,CADEC,EAZWF,EAYJ,gBAAgBN,GAGlB,MAAME,UAAyCI,CAA8B,CAClF,YAAYI,EAAwC,CAClD,MAAMA,CAAI,EACV,KAAK,KAAO,kCAAA,CAEhB,CAEO,MAAMP,WAA0CG,CAA8B,CACnF,YAAYI,EAAwC,CAClD,MAAMA,CAAI,EACV,KAAK,KAAO,mCAAA,CAEhB,CAEO,MAAML,WAA6CC,CAA8B,CACtF,YAAYI,EAAwC,CAClD,MAAMA,CAAI,EACV,KAAK,KAAO,sCAAA,CAEhB,CAEO,MAAMN,WAAyCE,CAA8B,CAClF,YAAYI,EAAwC,CAClD,MAAMA,CAAI,EACV,KAAK,KAAO,kCAAA,CAEhB,CCzEO,MAAMC,GAAmB,CAC9B,WA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CAEO,SAASE,GACdF,EACgC,CACzB,OAAAA,EAAK,YAAY,SAAS,SAAS,CAC5C,CAEO,SAASG,GAAWH,EAAoD,CACtE,OAAAA,EAAK,YAAY,SAAS,MAAM,CACzC,CAEO,SAASI,GACdC,EAC0C,CAC1C,OAAQA,EAA0C,eAAiB,MACrE,CAEO,SAASC,GACdD,EAC6C,CAC7C,OACGA,EAA6C,uBAC9C,MAEJ,CAEO,SAASE,GACdC,EACmC,CAC5B,OAAAA,EAAS,YAAY,SAAS,MAAM,CAC7C,CAEO,SAASC,GACdD,EACsC,CAC/B,OAAAA,EAAS,YAAY,SAAS,SAAS,CAChD,CChEO,SAASE,GACdC,EAC4B,CACrB,MAAA,GAAQA,GAAQ,gBAAiBA,EAC1C,CAEO,SAASC,GACdC,EAC6B,CACtB,MAAA,GAAQA,GAAY,oBAAqBA,EAClD,CAEO,SAASC,GAAeD,EAA8C,CAC3E,MAAO,EAAE,oBAAqBA,EAChC,CAEO,SAASE,GACdC,EACoC,CAC7B,MAAA,GACLA,GACE,qBAAsBA,GACtB,qBAAsBA,EAE5B,CAEO,SAASC,GACdD,EACuC,CAChC,MAAA,GACLA,GAAa,UAAWA,GAAa,oBAAqBA,EAE9D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@experian-ecs/connected-api-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Connected Experience API SDK ",
|
|
5
5
|
"author": "Experian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"build": "npm run build:clean && npm run build:lib && node ./scripts/writeLicenseToBundleFiles.mjs",
|
|
34
34
|
"build:lib": "npm run build:umd && npm run build:esm && npm run build:types",
|
|
35
35
|
"build:clean": "rm -rf dist",
|
|
36
|
-
"build:esm": "npx vite build --config config/build/esm.ts",
|
|
37
|
-
"build:umd": "npx vite build --config config/build/umd.ts",
|
|
36
|
+
"build:esm": "set \"VITE_CJS_TRACE=true\" && npx vite build --config config/build/esm.ts",
|
|
37
|
+
"build:umd": "set \"VITE_CJS_TRACE=true\" && npx vite build --config config/build/umd.ts",
|
|
38
38
|
"build:types": "npx tsup src/index.ts --dts-only",
|
|
39
39
|
"format": "npx biome format . --write",
|
|
40
40
|
"gen:service": "sh ./_templates/gen-service.sh",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
"lint:check": "npx biome check .",
|
|
43
43
|
"prepare": "husky",
|
|
44
44
|
"pre-commit": "lint-staged",
|
|
45
|
-
"test": "cross-env DEBUG_PRINT_LIMIT=\"10000000\" vitest run --coverage",
|
|
45
|
+
"test": "set \"VITE_CJS_TRACE=true\" && cross-env DEBUG_PRINT_LIMIT=\"10000000\" vitest run --coverage",
|
|
46
46
|
"test:types": "npx tsc --noEmit",
|
|
47
47
|
"test:pr": "npm run build && npm run lint:check && npm run test:types && npm run test",
|
|
48
|
-
"test:watch": "cross-env DEBUG_PRINT_LIMIT=\"10000000\" vitest watch"
|
|
48
|
+
"test:watch": "set \"VITE_CJS_TRACE=true\" && cross-env DEBUG_PRINT_LIMIT=\"10000000\" vitest watch"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@biomejs/biome": "^1.9.4",
|