@experian-ecs/connected-api-sdk 1.2.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 ...(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,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D,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/typeGuards.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/resources/IdentityHealthScore/IdentityHealthScore.ts","../../src/resources/DigitalIdentityManager/DigitalIdentityManager.ts","../../src/utils.ts","../../src/lib/AuthClient/AuthClient.ts","../../src/lib/SDKClient/SDKClient.ts","../../src/resources/CreditScorePlanner/typeGuards.ts","../../src/resources/CreditScoreSimulator/typeGuards.ts","../../src/resources/CreditScores/typeGuards.ts","../../src/resources/CreditAttributes/typeGuards.ts"],"sourcesContent":["export type ConnectedSolutionsAPIErrorType =\n | 'CLIENT_SIDE_ERROR'\n | 'AUTHENTICATION_ERROR'\n | 'RATE_LIMIT_ERROR'\n | 'SERVER_SIDE_ERROR';\n\nexport type ConnectedSolutionsAPIErrorData = {\n type: ConnectedSolutionsAPIErrorType;\n dev_url: string;\n code: string;\n message: string;\n};\n\nexport type ConnectedSolutionsSDKErrorTypes =\n | 'client_side_error'\n | 'authentication_error'\n | 'rate_limit_error'\n | 'sdk_error'\n | 'server_side_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 'client_side_error':\n return new ConnectedSolutionsClientSideError(rawError);\n case 'authentication_error':\n return new ConnectedSolutionsClientAuthenticationError(rawError);\n case 'server_side_error':\n return new ConnectedSolutionsClientServerSideError(rawError);\n case 'rate_limit_error':\n return new ConnectedSolutionsClientRateLimitError(rawError);\n default:\n return new ConnectedSolutionsClientSDKError(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 ConnectedSolutionsClientSideError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSideError';\n }\n}\n\nexport class ConnectedSolutionsClientAuthenticationError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientAuthenticationError';\n }\n}\n\nexport class ConnectedSolutionsClientServerSideError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientServerSideError';\n }\n}\n\nexport class ConnectedSolutionsClientSDKError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientSDKError';\n }\n}\n\nexport class ConnectedSolutionsClientRateLimitError extends ConnectedSolutionsClientError {\n constructor(args: ConnectedSolutionsClientRawError) {\n super(args);\n this.name = 'ConnectedSolutionsClientRateLimitError';\n }\n}\n\nexport function mapApiErrorTypeToSDKErrorType(\n apiErrorType?: ConnectedSolutionsAPIErrorType\n): ConnectedSolutionsSDKErrorTypes {\n switch (apiErrorType) {\n case 'CLIENT_SIDE_ERROR':\n return 'client_side_error';\n case 'AUTHENTICATION_ERROR':\n return 'authentication_error';\n case 'RATE_LIMIT_ERROR':\n return 'rate_limit_error';\n case 'SERVER_SIDE_ERROR':\n return 'server_side_error';\n default:\n return 'sdk_error'; // fallback\n }\n}\n\nexport function mapHttpStatusToSDKErrorType(\n status?: number\n): ConnectedSolutionsSDKErrorTypes {\n if (status === 401) {\n return 'authentication_error';\n }\n if (status === 429) {\n return 'rate_limit_error';\n }\n if (status && status >= 500) {\n return 'server_side_error';\n }\n if (status && status >= 400) {\n return 'client_side_error';\n }\n return 'sdk_error'; // fallback\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.connected-api.experian.com',\n INTEGRATION: 'https://integration.connected-api.experian.com',\n DEVELOPMENT: 'https://develop.connected-api.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 ConnectedSolutionsClientSideError,\n type ConnectedSolutionsClientAuthenticationError,\n ConnectedSolutionsClientError,\n type ConnectedSolutionsClientRawError,\n type ConnectedSolutionsClientSDKError,\n type ConnectedSolutionsClientServerSideError,\n type ConnectedSolutionsClientRateLimitError,\n type ConnectedSolutionsAPIErrorData,\n mapApiErrorTypeToSDKErrorType,\n mapHttpStatusToSDKErrorType\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 | ConnectedSolutionsClientSideError\n | ConnectedSolutionsClientAuthenticationError\n | ConnectedSolutionsClientServerSideError\n | ConnectedSolutionsClientRateLimitError\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: 'sdk_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 // Map API error type to SDK error type\n apiError.type = mapApiErrorTypeToSDKErrorType(errorJson.error.type);\n } else {\n apiError.type = mapHttpStatusToSDKErrorType(response?.status);\n }\n\n throw ConnectedSolutionsClientError.generateError(apiError);\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';\nimport type { ApiVersion } from 'lib/shared/types';\n\nimport type {\n GetCreditScoreResponse,\n PostCreditScoreResponse,\n BaseCreditScoreRequestOptions\n} from 'resources/CreditScores/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class CreditScoresService extends ApiClient {\n static #basePath = '/credit/scores';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n /**\n * Get the versioned API path for credit scores.\n * @param version The API version to use.\n * @returns The versioned API path.\n */\n #getVersionedPath<Version extends ApiVersion>(\n version: Version = 'v1' as Version\n ): string {\n return `/${version}${CreditScoresService.#basePath}`;\n }\n\n async getCreditScores<Version extends ApiVersion = 'v1'>(\n options?: BaseCreditScoreRequestOptions<Version> & {\n product_config_id?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditScoreResponse<Version>>> {\n // Determine version at runtime from options\n // Default to 'v1' if not specified\n const version = options?.version;\n const versionedPath = this.#getVersionedPath(version);\n\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}${versionedPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async orderCreditScore<Version extends ApiVersion = 'v1'>(\n requestOptions: BaseCreditScoreRequestOptions<Version> & {\n product_config_id: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<PostCreditScoreResponse<Version>>> {\n // Determine version at runtime\n const version = requestOptions.version;\n const versionedPath = this.#getVersionedPath(version);\n\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}${versionedPath}${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';\nimport type { ApiVersion } from 'lib/shared/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nimport type {\n BaseCreditAttributeRequestOptions,\n GetCreditAttributeResponse\n} from 'resources/CreditAttributes/types';\n\nexport class CreditAttributesService extends ApiClient {\n static #basePath = '/credit/attributes';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n /**\n * Get the versioned API path for credit attributes.\n * @param version The API version to use.\n * @returns The versioned API path.\n */\n #getVersionedPath<Version extends ApiVersion>(\n version: Version = 'v1' as Version\n ): string {\n return `/${version}${CreditAttributesService.#basePath}`;\n }\n\n async getCreditAttributes<Version extends ApiVersion = 'v1'>(\n options?: BaseCreditAttributeRequestOptions<Version> & {\n product_config_id?: string;\n },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditAttributeResponse<Version>>> {\n // Determine version at runtime from options\n // Default to 'v1' if not specified\n const version = options?.version;\n const versionedPath = this.#getVersionedPath(version);\n\n const endpoint = `${this.baseUrl}${versionedPath}`;\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 type { ApiVersion } from 'lib/shared/types';\nimport type {\n GetCreditReportRequestOptions,\n GetCreditReportByIdRequestOptions,\n PostCreditReportRequestOptions\n} from './types';\n\nexport function isV1Options<Version extends { version?: ApiVersion }>(\n options: Version | undefined\n): options is Version & { version?: 'v1' } {\n return !options?.version || options?.version === 'v1';\n}\n\nexport function isV2Options<Version extends { version?: ApiVersion }>(\n options: Version | undefined\n): options is Version & { version?: 'v2' } {\n return options?.version === 'v2';\n}\n\nexport function hasIncludeFields<\n RequestType extends\n | GetCreditReportRequestOptions<ApiVersion>\n | GetCreditReportByIdRequestOptions<ApiVersion>\n | PostCreditReportRequestOptions<ApiVersion>\n>(\n options: RequestType | undefined\n): options is RequestType & { include_fields?: string } {\n return (\n options !== undefined &&\n isV1Options(options) &&\n 'include_fields' in options &&\n typeof options.include_fields === 'string'\n );\n}\n\nexport function hasGetReportsFields_V1<\n RequestType extends GetCreditReportRequestOptions<ApiVersion>\n>(\n options: RequestType | undefined\n): options is RequestType & {\n include_fields?: string;\n report_date?: string;\n product_config_id?: string;\n report_between?: string;\n} {\n return (\n options !== undefined &&\n isV1Options(options) &&\n (('include_fields' in options &&\n typeof options.include_fields === 'string') ||\n ('report_date' in options && typeof options.report_date === 'string') ||\n ('product_config_id' in options &&\n typeof options.product_config_id === 'string') ||\n ('report_between' in options &&\n typeof options.report_between === 'string'))\n );\n}\n\nexport function hasGetReportsFields_V2<\n RequestType extends GetCreditReportRequestOptions<ApiVersion>\n>(\n options: RequestType | undefined\n): options is RequestType & {\n product_config_id?: string;\n report_between?: string;\n} {\n return (\n options !== undefined &&\n isV2Options(options) &&\n (('product_config_id' in options &&\n typeof options.product_config_id === 'string') ||\n ('report_between' in options &&\n typeof options.report_between === 'string'))\n );\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\n\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type { ApiVersion } from 'lib/shared/types';\nimport type {\n GetCreditReportResponse,\n GetCreditReportRequestOptions,\n GetCreditReportByIdRequestOptions,\n GetCreditReportMetaRequestOptions,\n GetCreditReportMetaResponse,\n GetCreditReportMetaByIdResponse,\n GetCreditReportMetaByIdRequestOptions,\n PostCreditReportResponse,\n PostCreditReportRequestOptions,\n MarkCreditReportAsRead,\n MarkCreditReportReadRequestOptions_V2,\n GetCreditReportByIdResponse\n} from 'resources/CreditReports/types';\n\nimport {\n hasIncludeFields,\n hasGetReportsFields_V1,\n hasGetReportsFields_V2\n} from 'resources/CreditReports/typeGuards';\n\nexport class CreditReportsService extends ApiClient {\n static #basePath = '/credit/reports';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n /**\n * Get the versioned API path for credit reports.\n * @param version The API version to use.\n * @returns The versioned API path.\n */\n #getVersionedPath<Version extends ApiVersion>(\n version: Version = 'v1' as Version\n ): string {\n return `/${version}${CreditReportsService.#basePath}`;\n }\n\n async getReports<Version extends ApiVersion = 'v1'>(\n requestOptions?: GetCreditReportRequestOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditReportResponse<Version>>> {\n // Determine version at runtime from options\n // Default to 'v1' if not specified\n const version = requestOptions?.version;\n const versionedPath = this.#getVersionedPath(version);\n const searchOptions: Record<string, string> = {};\n\n // Check v1 options\n if (hasGetReportsFields_V1(requestOptions)) {\n if (requestOptions.report_between) {\n searchOptions.report_between = requestOptions.report_between.toString();\n }\n if (requestOptions.include_fields) {\n searchOptions.include_fields = requestOptions.include_fields.toString();\n }\n if (requestOptions.report_date) {\n searchOptions.report_date = requestOptions.report_date.toString();\n }\n if (requestOptions.product_config_id) {\n searchOptions.product_config_id =\n requestOptions.product_config_id.toString();\n }\n }\n\n // Check v2 options\n if (hasGetReportsFields_V2(requestOptions)) {\n if (requestOptions.product_config_id) {\n searchOptions.product_config_id =\n requestOptions.product_config_id.toString();\n }\n if (requestOptions.report_between) {\n searchOptions.report_between = requestOptions.report_between.toString();\n }\n }\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${versionedPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportById<Version extends ApiVersion = 'v1'>(\n requestOptions: GetCreditReportByIdRequestOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditReportMetaByIdResponse<Version>>> {\n const { id, version } = requestOptions;\n const versionedPath = this.#getVersionedPath(version);\n\n const searchOptions: Record<string, string> = {};\n\n // Check if include_fields exists if v1 is called\n if (hasIncludeFields(requestOptions)) {\n searchOptions.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}${versionedPath}/${id}${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportsMeta<Version extends ApiVersion>(\n requestOptions?: GetCreditReportMetaRequestOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditReportMetaResponse<Version>>> {\n const { version, latest_only, report_read, ...options } =\n requestOptions ?? {};\n const versionedPath = this.#getVersionedPath(version);\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}${versionedPath}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getReportMetaById<Version extends ApiVersion = 'v1'>(\n requestOptions: GetCreditReportMetaByIdRequestOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetCreditReportMetaByIdResponse<Version>>> {\n const { id, version, ...searchOptions } = requestOptions;\n const versionedPath = this.#getVersionedPath(version);\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${versionedPath}/${id}/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async markReportAsRead<Version extends ApiVersion = 'v1'>(\n requestOptions: MarkCreditReportAsRead<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse> {\n const { id, version } = requestOptions;\n const versionedPath = this.#getVersionedPath(version);\n const baseEndpoint = `${this.baseUrl}${versionedPath}`;\n\n if (version === 'v2') {\n const endpoint = `${baseEndpoint}/${id}/disposition`;\n const dispositionRequestOptions =\n requestOptions as MarkCreditReportReadRequestOptions_V2<Version>;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PATCH',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({\n disposition: dispositionRequestOptions.disposition\n }),\n ...(fetchOptions ?? {})\n });\n }\n const endpoint = `${baseEndpoint}/${id}/read`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'PUT',\n ...(fetchOptions ?? {})\n });\n }\n\n async orderReport<Version extends ApiVersion = 'v1'>(\n requestOptions: PostCreditReportRequestOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<PostCreditReportResponse<Version>>> {\n const searchOptions: Record<string, string> = {};\n const version = requestOptions?.version;\n const versionedPath = this.#getVersionedPath(version);\n\n // Check if include_fields exists if v1 is called\n if (hasIncludeFields(requestOptions)) {\n searchOptions.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}${versionedPath}${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 ProductConfigsSearchOptions,\n ProductConfigsResponse,\n GetProductConfigByIdResponse\n} from 'resources/ProductConfigs/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\nimport type { ApiVersion } from 'lib/shared/types';\n\nexport class ProductConfigsService extends ApiClient {\n static #basePath = '/product-configs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n /**\n * Get the versioned API path for Product Config.\n * @param version The API version to use.\n * @returns The versioned API path.\n */\n #getVersionedPath<Version extends ApiVersion>(\n version: Version = 'v1' as Version\n ): string {\n return `/${version}${ProductConfigsService.#basePath}`;\n }\n\n async getProductConfigs<Version extends ApiVersion = 'v1'>(\n searchOptions: ProductConfigsSearchOptions<Version>,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<ProductConfigsResponse<Version>>> {\n const { fromEntries, entries } = Object;\n const { isArray } = Array;\n\n // Determine version at runtime from options\n // Default to 'v1' if not specified\n const version = searchOptions?.version;\n const versionedPath = this.#getVersionedPath(version);\n\n const { version: _version, ...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}${versionedPath}${queryString}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ? fetchOptions : {})\n });\n }\n\n async getProductConfigById<Version extends ApiVersion = 'v1'>(\n requestOptions: { product_config_id: string; version?: Version },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<GetProductConfigByIdResponse<Version>>> {\n // Determine version at runtime from options\n // Default to 'v1' if not specified\n const version = requestOptions?.version;\n const versionedPath = this.#getVersionedPath(version);\n\n const endpoint = `${this.baseUrl}${versionedPath}/${requestOptions.product_config_id}`;\n\n return this.fetchWithAuth(endpoint, {\n ...(fetchOptions ?? {})\n });\n }\n}\n","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient/ApiClient';\n\nimport type {\n IHSSurvey,\n IHSSubmitSurveyRequest,\n IHSSubmitSurveyResponse,\n IHSScoreDetails,\n IHSPlan,\n IHSCreatePlanResponse,\n IHSUpdateActionRequest,\n IHSUpdateActionResponse,\n IHSGetPlanRequest\n} from 'resources/IdentityHealthScore/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class IdentityHealthScoreService extends ApiClient {\n static #basePath = '/v1/ihs';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n async getSurvey(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSSurvey>> {\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/surveys`;\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async submitSurvey(\n requestOptions: IHSSubmitSurveyRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSSubmitSurveyResponse>> {\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/surveys`;\n\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 getScore(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSScoreDetails>> {\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/scores?latest=TRUE`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async getPlan(\n requestOptions: IHSGetPlanRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSPlan>> {\n const searchOptions: {\n cursor?: string;\n action_status: string;\n count?: string;\n } = {\n action_status: requestOptions.action_status,\n ...(requestOptions.cursor ? { cursor: requestOptions.cursor } : {}),\n ...(requestOptions.count\n ? { count: requestOptions.count.toString() }\n : {})\n };\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/plans${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n async createPlan(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSCreatePlanResponse>> {\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/plans`;\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 ...(fetchOptions ?? {})\n });\n }\n\n async updateAction(\n requestOptions: { action_id: string } & IHSUpdateActionRequest,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<IHSUpdateActionResponse>> {\n const { action_id, ...body } = requestOptions;\n const endpoint = `${this.baseUrl}${IdentityHealthScoreService.#basePath}/plans/actions/${action_id}`;\n\n return this.fetchWithAuth(endpoint, {\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","import { ApiClient, type ApiClientResponse } from 'lib/ApiClient';\nimport type {\n DIMGetScansResponse,\n DIMScanDetail,\n DIMGetScansMetaResponse,\n DIMGetBrokersResponse,\n DIMGetBrokerByIdResponse,\n DIMBrokerGroupDetail,\n DIMPostScanResponse,\n DIMBrokerGroupActionResponse,\n DIMGetScansOptions,\n DIMGetScansMetaOptions,\n DIMPostScanOptions\n} from 'resources/DigitalIdentityManager/types';\nimport type { ConnectedSolutionsSDKConfig } from 'lib/SDKClient/types';\n\nexport class DigitalIdentityManagerService extends ApiClient {\n static #basePath = '/v1/dim';\n\n constructor(config: ConnectedSolutionsSDKConfig) {\n super(config);\n }\n\n /**\n * Create a new discovery scan\n * POST /v1/dim/scans\n */\n async createScan(\n options: DIMPostScanOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMPostScanResponse>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/scans`;\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: options.product_config_id\n }),\n ...(fetchOptions ?? {})\n });\n }\n\n /**\n * Get scan results\n * GET /v1/dim/scans\n */\n async getScans(\n options?: DIMGetScansOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMGetScansResponse>> {\n const searchOptions: Record<string, string> = {};\n\n if (options?.product_config_id) {\n searchOptions.product_config_id = options.product_config_id;\n }\n if (options?.scan_between) {\n searchOptions.scan_between = options.scan_between;\n }\n if (options?.cursor) {\n searchOptions.cursor = options.cursor;\n }\n if (options?.count) {\n searchOptions.count = options.count.toString();\n }\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/scans${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get scan by ID\n * GET /v1/dim/scans/{scan_id}\n */\n async getScanById(\n requestOptions: { scanId: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMScanDetail>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/scans/${requestOptions.scanId}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get scan meta data details\n * GET /v1/dim/scans/meta\n */\n async getScansMetadata(\n options?: DIMGetScansMetaOptions,\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMGetScansMetaResponse>> {\n const searchOptions: Record<string, string> = {};\n\n if (options?.product_config_id) {\n searchOptions.product_config_id = options.product_config_id;\n }\n if (options?.scan_between) {\n searchOptions.scan_between = options.scan_between;\n }\n if (options?.most_recent) {\n searchOptions.most_recent = 'TRUE';\n }\n\n const query = new URLSearchParams(searchOptions).toString();\n const queryString = query ? `?${query}` : '';\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/scans/meta${queryString}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get brokers details\n * GET /v1/dim/brokers\n */\n async getBrokers(\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMGetBrokersResponse>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/brokers`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get a broker detail\n * GET /v1/dim/brokers/{broker_id}\n */\n async getBrokerById(\n requestOptions: { brokerId: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMGetBrokerByIdResponse>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/brokers/${requestOptions.brokerId}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get brokers details for a scan\n * GET /v1/dim/scans/{scan_id}/brokers\n */\n async getBrokersByScanId(\n requestOptions: { scanId: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMGetBrokersResponse>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/scans/${requestOptions.scanId}/brokers`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Get brokers group detail\n * GET /v1/dim/brokers/groups/{group_id}\n */\n async getBrokersByGroupId(\n requestOptions: { groupId: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMBrokerGroupDetail>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/brokers/groups/${requestOptions.groupId}`;\n\n return this.fetchWithAuth(endpoint, fetchOptions);\n }\n\n /**\n * Update user action for removal (disposition a scan removal)\n * POST /v1/dim/brokers/groups/{group_id}/action\n * Returns 202 Accepted with group_id in response body\n * Note: Per OAS 1.0.29, this endpoint doesn't accept a request body\n */\n async updateBrokerGroupAction(\n requestOptions: { groupId: string },\n fetchOptions?: RequestInit\n ): Promise<ApiClientResponse<DIMBrokerGroupActionResponse>> {\n const endpoint = `${this.baseUrl}${DigitalIdentityManagerService.#basePath}/brokers/groups/${requestOptions.groupId}/action`;\n\n return this.fetchWithAuth(endpoint, {\n method: 'POST',\n headers: {\n ...(fetchOptions?.headers ?? {}),\n 'Content-Type': 'application/json'\n },\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 mapApiErrorTypeToSDKErrorType,\n mapHttpStatusToSDKErrorType\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 const err: ConnectedSolutionsClientRawError = {\n type: 'sdk_error', // fallback\n status: tokenRequest?.status,\n message: tokenRequest?.statusText || '',\n data: undefined\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 // Map API error type to SDK error type\n err.type = mapApiErrorTypeToSDKErrorType(errorJson.error.type);\n } else {\n // Map HTTP status code to SDK error type\n err.type = mapHttpStatusToSDKErrorType(tokenRequest?.status);\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';\nimport type { IdentityHealthScoreService } from 'resources/IdentityHealthScore';\nimport type { DigitalIdentityManagerService } from 'resources/DigitalIdentityManager';\n\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 identityHealthScore: IdentityHealthScoreService;\n digitalIdentityManager: DigitalIdentityManagerService;\n\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","import type { ApiVersion, Bureau } from 'lib/shared/types';\n\nimport type {\n CreditScore,\n CreditScores_V2,\n CreditScore_V2,\n GetCreditScoreResponse,\n PostCreditScoreResponse,\n BureauScore\n} from './types';\n\nexport function isValidApiVersion(version: string): version is ApiVersion {\n return version === 'v1' || version === 'v2';\n}\n\nexport function isCreditScore(data: unknown): data is CreditScore {\n if (typeof data !== 'object' || data === null) return false;\n\n const score = data as CreditScore;\n return (\n typeof score.score_id === 'string' &&\n isValidBureau(score.bureau) &&\n typeof score.score === 'number' &&\n typeof score.score_date === 'string'\n );\n}\n\nexport function isCreditScoreV2(data: unknown): data is CreditScore_V2 {\n if (typeof data !== 'object' || data === null) return false;\n\n const item = data as CreditScore_V2;\n return (\n typeof item.id === 'string' &&\n Array.isArray(item.bureau_scores) &&\n item.bureau_scores.every((score: unknown) => isBureauScore(score))\n );\n}\n\nexport function isBureauScore(data: unknown): data is BureauScore {\n if (typeof data !== 'object' || data === null) return false;\n\n const score = data as BureauScore;\n return (\n isValidBureau(score.bureau) &&\n typeof score.score === 'number' &&\n typeof score.score_date === 'string'\n );\n}\n\n// Enum/Union type guards\nexport function isValidBureau(bureau: unknown): bureau is Bureau {\n return (\n bureau === 'EXPERIAN' || bureau === 'EQUIFAX' || bureau === 'TRANSUNION'\n );\n}\n\nexport function isCreditScoresV2(data: unknown): data is CreditScores_V2 {\n return (\n typeof data === 'object' &&\n data !== null &&\n 'items' in data &&\n Array.isArray((data as CreditScores_V2).items) &&\n (data as CreditScores_V2).items.every((item: unknown) =>\n isCreditScoreV2(item)\n )\n );\n}\n\nexport function isCreditScoreArray(data: unknown): data is CreditScore[] {\n return Array.isArray(data) && data.every((item) => isCreditScore(item));\n}\n\nexport function isV1GetCreditScoresResponse(\n data: unknown\n): data is GetCreditScoreResponse<'v1'> {\n return isCreditScoreArray(data);\n}\n\nexport function isV2GetCreditScoresResponse(\n data: unknown\n): data is GetCreditScoreResponse<'v2'> {\n return isCreditScoresV2(data);\n}\n\nexport function isV1PostCreditScoresResponse(\n data: unknown\n): data is PostCreditScoreResponse<'v1'> {\n return isCreditScore(data);\n}\n\nexport function isV2PostCreditScoresResponse(\n data: unknown\n): data is PostCreditScoreResponse<'v2'> {\n return isCreditScoreV2(data);\n}\n","import type { Bureau } from 'lib/shared/types';\n\nimport type {\n CreditAttributes,\n CreditAttributes_V2,\n CreditAttribute_V2,\n GetCreditAttributeResponse,\n CreditAttribute,\n BureauAttribute\n} from './types';\n\nexport function isCreditAttribute(data: unknown): data is CreditAttributes {\n if (typeof data !== 'object' || data === null) return false;\n\n const attribute = data as CreditAttributes;\n return (\n isValidBureauAttribute(attribute.bureau) &&\n typeof attribute.reported_at === 'string' &&\n typeof attribute.categories === 'object' &&\n typeof attribute.attributes === 'object'\n );\n}\n\nexport function isCreditAttributeV2(data: unknown): data is CreditAttribute_V2 {\n if (typeof data !== 'object' || data === null) return false;\n\n const item = data as CreditAttribute_V2;\n return (\n typeof item.id === 'string' &&\n Array.isArray(item.bureau_attributes) &&\n item.bureau_attributes.every((attribute: unknown) =>\n isBureauAttribute(attribute)\n )\n );\n}\n\nexport function isBureauAttribute(data: unknown): data is BureauAttribute {\n if (typeof data !== 'object' || data === null) return false;\n\n const attribute = data as BureauAttribute;\n return (\n isValidBureauAttribute(attribute.bureau) &&\n typeof attribute.reported_at === 'string' &&\n typeof attribute.categories === 'object' &&\n typeof attribute.attributes === 'object'\n );\n}\n\n// Enum/Union type guards\nexport function isValidBureauAttribute(bureau: unknown): bureau is Bureau {\n return (\n bureau === 'EXPERIAN' || bureau === 'EQUIFAX' || bureau === 'TRANSUNION'\n );\n}\n\nexport function isCreditAttributesV2(\n data: unknown\n): data is CreditAttribute_V2 {\n return (\n typeof data === 'object' &&\n data !== null &&\n 'items' in data &&\n Array.isArray((data as CreditAttributes_V2).items) &&\n (data as CreditAttributes_V2).items.every((item: unknown) =>\n isCreditAttributeV2(item)\n )\n );\n}\n\nexport function isCreditAttributeArray(\n data: unknown\n): data is CreditAttribute[] {\n return Array.isArray(data) && data.every((item) => isCreditAttribute(item));\n}\n\nexport function isV1GetCreditAttributesResponse(\n data: unknown\n): data is GetCreditAttributeResponse<'v1'> {\n return isCreditAttributeArray(data);\n}\n\nexport function isV2GetCreditAttributesResponse(\n data: unknown\n): data is GetCreditAttributeResponse<'v2'> {\n return isCreditAttributesV2(data);\n}\n"],"names":["generateError","rawError","ConnectedSolutionsClientSideError","ConnectedSolutionsClientAuthenticationError","ConnectedSolutionsClientServerSideError","ConnectedSolutionsClientRateLimitError","ConnectedSolutionsClientSDKError","ConnectedSolutionsClientError","raw","_a","__publicField","args","mapApiErrorTypeToSDKErrorType","apiErrorType","mapHttpStatusToSDKErrorType","status","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_instances","getVersionedPath_fn","_CreditScoresService","fetchOptions","version","versionedPath","searchOptions","query","queryString","endpoint","requestOptions","__privateGet","CreditScoresService","_EntitlementsService","entitlement_id","body","product_config_id","customer_id","search","EntitlementsService","_CreditAttributesService_instances","_CreditAttributesService","CreditAttributesService","_CreditScoreSimulatorService","requestBody","CreditScoreSimulatorService","_revisionPath","_CreditScorePlannerService","CreditScorePlannerService","_AlertsService","id","AlertsService","isV1Options","isV2Options","hasIncludeFields","hasGetReportsFields_V1","hasGetReportsFields_V2","_CreditReportsService_instances","_CreditReportsService","latest_only","report_read","baseEndpoint","dispositionRequestOptions","CreditReportsService","_CustomersService","updates","next_cursor","CustomersService","_CustomerAuthService","answers","CustomerAuthService","_RegistrationsService","RegistrationsService","_ProductConfigsService_instances","_ProductConfigsService","fromEntries","entries","isArray","_version","_","value","key","ProductConfigsService","_IdentityHealthScoreService","action_id","IdentityHealthScoreService","_DigitalIdentityManagerService","DigitalIdentityManagerService","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","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","isValidApiVersion","isCreditScore","score","isValidBureau","isCreditScoreV2","item","isBureauScore","bureau","isCreditScoresV2","isCreditScoreArray","isV1GetCreditScoresResponse","isV2GetCreditScoresResponse","isV1PostCreditScoresResponse","isV2PostCreditScoresResponse","isCreditAttribute","attribute","isValidBureauAttribute","isCreditAttributeV2","isBureauAttribute","isCreditAttributesV2","isCreditAttributeArray","isV1GetCreditAttributesResponse","isV2GetC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