vesant-sdk 1.1.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{types-DgNbBnEH.d.ts → client-BIfLMfuC.d.mts} +274 -2
- package/dist/{types-DGbuL8c0.d.mts → client-BWp5FI3x.d.ts} +274 -2
- package/dist/compliance/index.d.mts +9 -4
- package/dist/compliance/index.d.ts +9 -4
- package/dist/compliance/index.js +297 -2
- package/dist/compliance/index.js.map +1 -1
- package/dist/compliance/index.mjs +297 -2
- package/dist/compliance/index.mjs.map +1 -1
- package/dist/geolocation/index.d.mts +3 -5
- package/dist/geolocation/index.d.ts +3 -5
- package/dist/geolocation/index.js +310 -250
- package/dist/geolocation/index.js.map +1 -1
- package/dist/geolocation/index.mjs +310 -250
- package/dist/geolocation/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.js +322 -251
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +322 -251
- package/dist/index.mjs.map +1 -1
- package/dist/kyc/core.d.mts +2 -3
- package/dist/kyc/core.d.ts +2 -3
- package/dist/kyc/core.js +1 -1
- package/dist/kyc/core.js.map +1 -1
- package/dist/kyc/core.mjs +1 -1
- package/dist/kyc/core.mjs.map +1 -1
- package/dist/kyc/index.d.mts +2 -3
- package/dist/kyc/index.d.ts +2 -3
- package/dist/kyc/index.js +1 -1
- package/dist/kyc/index.js.map +1 -1
- package/dist/kyc/index.mjs +1 -1
- package/dist/kyc/index.mjs.map +1 -1
- package/dist/react.d.mts +3 -5
- package/dist/react.d.ts +3 -5
- package/dist/react.js +29 -3
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +29 -3
- package/dist/react.mjs.map +1 -1
- package/dist/risk-profile/index.d.mts +4 -5
- package/dist/risk-profile/index.d.ts +4 -5
- package/dist/risk-profile/index.js +1 -1
- package/dist/risk-profile/index.js.map +1 -1
- package/dist/risk-profile/index.mjs +1 -1
- package/dist/risk-profile/index.mjs.map +1 -1
- package/dist/{types-DBGM-bFB.d.mts → types-BpKxSXGF.d.mts} +50 -1
- package/dist/{types-DBGM-bFB.d.ts → types-BpKxSXGF.d.ts} +50 -1
- package/dist/{types-BQTkTvNp.d.mts → types-DKCQN4C5.d.mts} +1 -1
- package/dist/{types-BF8mYH2W.d.ts → types-DfHLp_tz.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/client-B7YzKVEm.d.mts +0 -52
- package/dist/client-BaNLT2Df.d.ts +0 -52
- package/dist/client-VKJg2GGT.d.mts +0 -253
- package/dist/client-hXdrPhA4.d.ts +0 -253
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/errors.ts","../../src/core/logger.ts","../../src/core/version.ts","../../src/core/client.ts","../../src/risk-profile/client.ts"],"names":[],"mappings":";;;AAOO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAClC,WAAA,CACE,OAAA,EACO,IAAA,EACA,UAAA,EACA,OAAA,EACP;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAJN,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAGP,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,SAAA,CAAS,SAAS,CAAA;AAAA,EAChD;AACF,CAAA;AAEO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqB,QAAA,CAAS;AAAA,EACzC,WAAA,CAAY,SAAwB,aAAA,EAAyB;AAC3D,IAAA,KAAA,CAAM,OAAA,EAAS,eAAA,EAAiB,MAAA,EAAW,EAAE,eAAe,CAAA;AAD1B,IAAA,IAAA,CAAA,aAAA,GAAA,aAAA;AAElC,IAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AACZ,IAAA,MAAA,CAAO,c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AO,IAAA,CAAK,OAAA,CAAyB,CAAA,iBAAA,EAAoB,SAAS,CAAA,CAAA,EAAI;AAAA,MACpE,MAAA,EAAQ,KAAA;AAAA,MACR,IAAA,EAAM,IAAA,CAAK,SAAA,CAAU,OAAO;AAAA,KAC9B,EAAG,QAAW,cAAc,CAAA;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBA,MAAM,kBAAA,CACJ,UAAA,EACA,aAAA,EACA,cAAA,EAC0B;AAC1B,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,IAAA,CAAK,UAAA,CAAW,UAAA,EAAY,cAAc,CAAA;AAAA,IACzD,SAAS,KAAA,EAAO;AAEd,MAAA,IAAI,KAAA,YAAiB,QAAA,IAAY,KAAA,CAAM,IAAA,KAAS,WAAA,EAAa;AAC3D,QAAA,OAAO,MAAM,IAAA,CAAK,aAAA,CAAc,aAAA,EAAe,cAAc,CAAA;AAAA,MAC/D;AACA,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAc,aAAA,CAAc,OAAA,GAA0B,IAAI,cAAA,EAA+D;AACvH,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,gBAAA,CAAiB,OAAkC,CAAA;AAC5E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,kCAAkC,WAAW,CAAA,CAAA;AAAA,MAC7C,MAAA;AAAA,MAAW,MAAA;AAAA,MAAW;AAAA,KACxB;AAAA,EACF;AACF","file":"index.js","sourcesContent":["/**\n * Error hierarchy for CGS SDK\n *\n * Provides structured error handling with specific error types\n * for different failure scenarios.\n */\n\nexport class CGSError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode?: number,\n public details?: Record<string, unknown>\n ) {\n super(message);\n this.name = 'CGSError';\n Object.setPrototypeOf(this, CGSError.prototype);\n }\n}\n\nexport class NetworkError extends CGSError {\n constructor(message: string, public originalError?: unknown) {\n super(message, 'NETWORK_ERROR', undefined, { originalError });\n this.name = 'NetworkError';\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ValidationError extends CGSError {\n constructor(message: string, fields?: string[]) {\n super(message, 'VALIDATION_ERROR', 400, { fields });\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class ServiceUnavailableError extends CGSError {\n constructor(message: string) {\n super(`${message} is unavailable`, 'SERVICE_UNAVAILABLE', 503, { service: message });\n this.name = 'ServiceUnavailableError';\n Object.setPrototypeOf(this, ServiceUnavailableError.prototype);\n }\n}\n\nexport class ComplianceBlockedError extends CGSError {\n constructor(reasons: string[]) {\n super('Access blocked due to compliance rules', 'COMPLIANCE_BLOCKED', 403, { reasons });\n this.name = 'ComplianceBlockedError';\n Object.setPrototypeOf(this, ComplianceBlockedError.prototype);\n }\n}\n\nexport class AuthenticationError extends CGSError {\n constructor(message: string = 'Authentication failed') {\n super(message, 'AUTHENTICATION_ERROR', 401);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class RateLimitError extends CGSError {\n constructor(public retryAfter?: number) {\n super('Rate limit exceeded', 'RATE_LIMIT_EXCEEDED', 429, { retryAfter });\n this.name = 'RateLimitError';\n Object.setPrototypeOf(this, RateLimitError.prototype);\n }\n}\n\nexport class TimeoutError extends CGSError {\n constructor(public timeout: number) {\n super(`Request timeout after ${timeout}ms`, 'TIMEOUT', 408, { timeout });\n this.name = 'TimeoutError';\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class ComplianceError extends CGSError {\n constructor(\n message: string,\n public originalError?: unknown,\n code: string = 'COMPLIANCE_ERROR'\n ) {\n super(message, code, undefined, { originalError });\n this.name = 'ComplianceError';\n Object.setPrototypeOf(this, ComplianceError.prototype);\n }\n}\n","import type { Logger } from './config';\n\nexport function createConsoleLogger(): Logger {\n return {\n debug(message: string, meta?: Record<string, unknown>) {\n console.log(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n info(message: string, meta?: Record<string, unknown>) {\n console.info(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n warn(message: string, meta?: Record<string, unknown>) {\n console.warn(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n error(message: string, meta?: Record<string, unknown>) {\n console.error(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n };\n}\n\nexport const noopLogger: Logger = {\n debug() {},\n info() {},\n warn() {},\n error() {},\n};\n","/**\n * Single source of truth for the SDK version.\n */\nexport const SDK_VERSION = '1.1.0';\n","/**\n * Base HTTP client for all CGS SDK clients\n *\n * Provides common functionality:\n * - Request/response handling\n * - Error handling\n * - Retry logic with exponential backoff\n * - Timeout management\n * - Debug logging\n */\n\nimport type { BaseClientConfig, Logger, RequestInterceptor, RequestOptions, RequiredBaseClientConfig } from './config';\nimport {\n CGSError,\n NetworkError,\n TimeoutError,\n AuthenticationError,\n RateLimitError,\n ServiceUnavailableError,\n ValidationError,\n} from './errors';\nimport { createConsoleLogger } from './logger';\nimport { SDK_VERSION } from './version';\n\nexport abstract class BaseClient {\n protected config: RequiredBaseClientConfig;\n protected logger: Logger;\n private interceptors: RequestInterceptor[];\n\n constructor(config: BaseClientConfig) {\n if (!config.baseURL?.trim()) {\n throw new ValidationError('baseURL is required and must be a non-empty string', ['baseURL']);\n }\n if (!config.tenantId?.trim()) {\n throw new ValidationError('tenantId is required and must be a non-empty string', ['tenantId']);\n }\n\n this.interceptors = config.interceptors || [];\n this.logger = config.logger || createConsoleLogger();\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n interceptors: this.interceptors,\n logger: this.logger,\n };\n }\n\n /**\n * Make an HTTP request with timeout and error handling\n */\n protected async request<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n requestOptions?: RequestOptions\n ): Promise<T> {\n const url = `${serviceURL || this.config.baseURL}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-Tenant-ID': this.config.tenantId,\n 'X-SDK-Version': `vesant-sdk-ts/${SDK_VERSION}`,\n ...this.config.headers,\n ...((options.headers as Record<string, string>) || {}),\n };\n\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n // Link consumer AbortSignal to internal controller\n if (requestOptions?.signal) {\n if (requestOptions.signal.aborted) {\n controller.abort();\n } else {\n requestOptions.signal.addEventListener('abort', () => controller.abort(), { once: true });\n }\n }\n\n try {\n // Run onRequest interceptors\n let finalOptions: RequestInit = { ...options, headers };\n for (const interceptor of this.interceptors) {\n if (interceptor.onRequest) {\n finalOptions = await interceptor.onRequest(url, finalOptions);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug(`${finalOptions.method || 'GET'} ${url}`, {\n headers: finalOptions.headers as Record<string, unknown>,\n body: finalOptions.body as unknown,\n });\n }\n\n const response = await fetch(url, {\n ...finalOptions,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n let data: Record<string, unknown> | undefined;\n try {\n data = await response.json();\n } catch {\n // Non-JSON response (HTML error pages, 204 No Content, etc.)\n if (!response.ok) {\n this.handleErrorResponse(response.status, {\n error: `HTTP ${response.status}`,\n message: response.statusText,\n });\n }\n // OK response but no JSON body (e.g., 204)\n return undefined as unknown as T;\n }\n\n if (!response.ok) {\n this.handleErrorResponse(response.status, data || {});\n }\n\n // Run onResponse interceptors\n let result: unknown = data;\n for (const interceptor of this.interceptors) {\n if (interceptor.onResponse) {\n result = await interceptor.onResponse(url, result);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug('Response:', { data: result });\n }\n\n return result as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n // Run onError interceptors\n if (error instanceof Error) {\n for (const interceptor of this.interceptors) {\n if (interceptor.onError) {\n await interceptor.onError(url, error);\n }\n }\n }\n\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n // Distinguish consumer abort from timeout\n if (requestOptions?.signal?.aborted) {\n throw new CGSError('Request aborted', 'REQUEST_ABORTED');\n }\n throw new TimeoutError(this.config.timeout);\n }\n if (error instanceof CGSError) {\n throw error;\n }\n }\n\n throw new NetworkError('Network request failed', error);\n }\n }\n\n /**\n * Make an HTTP request with retry logic\n */\n protected async requestWithRetry<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n retries: number = this.config.retries,\n requestOptions?: RequestOptions\n ): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await this.request<T>(endpoint, options, serviceURL, requestOptions);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error');\n\n // Don't retry on consumer abort\n if (requestOptions?.signal?.aborted) {\n throw lastError;\n }\n\n // Don't retry on client errors (4xx), except 429 (rate limit)\n if (\n lastError instanceof CGSError &&\n lastError.statusCode &&\n lastError.statusCode >= 400 &&\n lastError.statusCode < 500 &&\n lastError.statusCode !== 429\n ) {\n throw lastError;\n }\n\n // Don't retry on last attempt\n if (attempt === retries) {\n break;\n }\n\n // Use Retry-After for 429, otherwise exponential backoff with jitter\n let delay: number;\n if (lastError instanceof RateLimitError && lastError.retryAfter) {\n delay = lastError.retryAfter * 1000;\n } else {\n delay = Math.min(1000 * Math.pow(2, attempt) + Math.random() * 1000, 10000);\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n\n if (this.config.debug) {\n this.logger.debug(`Retry attempt ${attempt + 1}/${retries} after ${delay.toFixed(0)}ms`);\n }\n }\n }\n\n throw new NetworkError(`Request failed after ${retries} retries`, lastError);\n }\n\n /**\n * Handle error responses from API\n */\n protected handleErrorResponse(status: number, data: Record<string, unknown>): never {\n const message = (data.error as string) || (data.message as string) || `HTTP ${status}`;\n\n switch (status) {\n case 400:\n throw new CGSError(message, 'BAD_REQUEST', 400, data);\n case 401:\n throw new AuthenticationError(message);\n case 403:\n throw new CGSError(message, 'FORBIDDEN', 403, data);\n case 404:\n throw new CGSError(message, 'NOT_FOUND', 404, data);\n case 429: {\n const retryAfter = (data.retry_after as number | undefined) || (data.retryAfter as number | undefined);\n throw new RateLimitError(retryAfter);\n }\n case 500:\n case 502:\n case 503:\n case 504:\n throw new ServiceUnavailableError(message);\n default:\n throw new CGSError(message, 'UNKNOWN_ERROR', status, data);\n }\n }\n\n /**\n * Build query string from parameters\n */\n protected buildQueryString(params: Record<string, unknown>): string {\n const query = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((item) => query.append(key, String(item)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n\n const queryString = query.toString();\n return queryString ? `?${queryString}` : '';\n }\n\n /**\n * Update client configuration\n */\n updateConfig(config: Partial<BaseClientConfig>): void {\n this.config = {\n ...this.config,\n ...config,\n headers: {\n ...this.config.headers,\n ...(config.headers || {}),\n },\n };\n if (config.logger) {\n this.logger = config.logger;\n }\n if (config.interceptors) {\n this.interceptors = config.interceptors;\n }\n }\n\n /**\n * Get current configuration (readonly)\n */\n getConfig(): Readonly<BaseClientConfig> {\n return { ...this.config };\n }\n\n /**\n * Health check endpoint\n */\n async healthCheck(): Promise<{ status: string; timestamp: string }> {\n return this.request('/api/v1/health');\n }\n}\n","/**\n * RiskProfileClient - Customer Risk Profile Management\n *\n * Provides methods to create, retrieve, and manage customer risk profiles\n * in the Vesant Compliance Platform.\n */\n\nimport { BaseClient } from '../core/client';\nimport { CGSError } from '../core/errors';\nimport type { BaseClientConfig, RequestOptions } from '../core/config';\nimport type {\n CustomerProfile,\n CreateProfileRequest,\n UpdateProfileRequest,\n ProfileFilters,\n ProfileListResponse,\n} from './types';\n\nexport class RiskProfileClient extends BaseClient {\n constructor(config: BaseClientConfig) {\n super(config);\n }\n\n // ============================================================================\n // Profile Management\n // ============================================================================\n\n /**\n * Create a new customer risk profile\n *\n * @param request - Profile creation data\n * @returns Created customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.createProfile({\n * customer_id: 'CUST-12345',\n * entity_type: 'individual',\n * customer_status: 'active',\n * full_name: 'John Doe',\n * email_address: 'john@example.com',\n * date_of_birth: '1990-01-15',\n * country_of_residence: 'US'\n * });\n * ```\n */\n async createProfile(request: CreateProfileRequest, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n return this.request<CustomerProfile>('/api/v1/profiles', {\n method: 'POST',\n body: JSON.stringify(request),\n }, undefined, requestOptions);\n }\n\n /**\n * Get customer profile by customer ID\n *\n * Note: This searches for the profile using the customer_id field.\n * Returns the first matching profile for the tenant.\n *\n * @param customerId - Customer ID to search for\n * @returns Customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.getProfile('CUST-12345');\n * ```\n */\n async getProfile(customerId: string, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n const response = await this.queryProfiles({\n search: customerId,\n page: 1,\n page_size: 10,\n }, requestOptions);\n\n // Find exact match by customer_id\n const profile = response.data.find(p => p.customer_id === customerId);\n if (!profile) {\n throw new CGSError(`Profile not found for customer ID: ${customerId}`, 'NOT_FOUND', 404);\n }\n\n return profile;\n }\n\n /**\n * Update customer profile\n *\n * @param profileId - Profile UUID\n * @param updates - Fields to update\n * @returns Updated customer profile\n *\n * @example\n * ```typescript\n * const updated = await client.updateProfile(profileId, {\n * location: 'New York, USA',\n * location_compliance: 'compliant',\n * last_recorded_activity: new Date().toISOString()\n * });\n * ```\n */\n async updateProfile(\n profileId: string,\n updates: UpdateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n return this.request<CustomerProfile>(`/api/v1/profiles/${profileId}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }, undefined, requestOptions);\n }\n\n /**\n * Get or create profile (idempotent operation)\n *\n * Attempts to get existing profile by customer_id, creates if not found.\n *\n * @param customerId - Customer ID\n * @param createRequest - Profile data to use if creating new profile\n * @returns Existing or newly created profile\n *\n * @example\n * ```typescript\n * const profile = await client.getOrCreateProfile('CUST-123', {\n * customer_id: 'CUST-123',\n * entity_type: 'individual',\n * full_name: 'John Doe',\n * email_address: 'john@example.com'\n * });\n * ```\n */\n async getOrCreateProfile(\n customerId: string,\n createRequest: CreateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n try {\n return await this.getProfile(customerId, requestOptions);\n } catch (error) {\n // Only treat NOT_FOUND as \"profile doesn't exist\" — re-throw other errors\n if (error instanceof CGSError && error.code === 'NOT_FOUND') {\n return await this.createProfile(createRequest, requestOptions);\n }\n throw error;\n }\n }\n\n /**\n * Query profiles with filters (internal helper for getProfile)\n */\n private async queryProfiles(filters: ProfileFilters = {}, requestOptions?: RequestOptions): Promise<ProfileListResponse> {\n const queryString = this.buildQueryString(filters as Record<string, unknown>);\n return this.request<ProfileListResponse>(\n `/api/v1/risk-dashboard/profiles${queryString}`,\n undefined, undefined, requestOptions\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/errors.ts","../../src/core/logger.ts","../../src/core/version.ts","../../src/core/client.ts","../../src/risk-profile/client.ts"],"names":[],"mappings":";;;AAOO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAClC,WAAA,CACE,OAAA,EACO,IAAA,EACA,UAAA,EACA,OAAA,EACP;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAJN,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAGP,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,SAAA,CAAS,SAA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AAA,MACV,kCAAkC,WAAW,CAAA,CAAA;AAAA,MAC7C,MAAA;AAAA,MAAW,MAAA;AAAA,MAAW;AAAA,KACxB;AAAA,EACF;AACF","file":"index.js","sourcesContent":["/**\n * Error hierarchy for CGS SDK\n *\n * Provides structured error handling with specific error types\n * for different failure scenarios.\n */\n\nexport class CGSError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode?: number,\n public details?: Record<string, unknown>\n ) {\n super(message);\n this.name = 'CGSError';\n Object.setPrototypeOf(this, CGSError.prototype);\n }\n}\n\nexport class NetworkError extends CGSError {\n constructor(message: string, public originalError?: unknown) {\n super(message, 'NETWORK_ERROR', undefined, { originalError });\n this.name = 'NetworkError';\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ValidationError extends CGSError {\n constructor(message: string, fields?: string[]) {\n super(message, 'VALIDATION_ERROR', 400, { fields });\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class ServiceUnavailableError extends CGSError {\n constructor(message: string) {\n super(`${message} is unavailable`, 'SERVICE_UNAVAILABLE', 503, { service: message });\n this.name = 'ServiceUnavailableError';\n Object.setPrototypeOf(this, ServiceUnavailableError.prototype);\n }\n}\n\nexport class ComplianceBlockedError extends CGSError {\n constructor(reasons: string[]) {\n super('Access blocked due to compliance rules', 'COMPLIANCE_BLOCKED', 403, { reasons });\n this.name = 'ComplianceBlockedError';\n Object.setPrototypeOf(this, ComplianceBlockedError.prototype);\n }\n}\n\nexport class AuthenticationError extends CGSError {\n constructor(message: string = 'Authentication failed') {\n super(message, 'AUTHENTICATION_ERROR', 401);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class RateLimitError extends CGSError {\n constructor(public retryAfter?: number) {\n super('Rate limit exceeded', 'RATE_LIMIT_EXCEEDED', 429, { retryAfter });\n this.name = 'RateLimitError';\n Object.setPrototypeOf(this, RateLimitError.prototype);\n }\n}\n\nexport class TimeoutError extends CGSError {\n constructor(public timeout: number) {\n super(`Request timeout after ${timeout}ms`, 'TIMEOUT', 408, { timeout });\n this.name = 'TimeoutError';\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class ComplianceError extends CGSError {\n constructor(\n message: string,\n public originalError?: unknown,\n code: string = 'COMPLIANCE_ERROR'\n ) {\n super(message, code, undefined, { originalError });\n this.name = 'ComplianceError';\n Object.setPrototypeOf(this, ComplianceError.prototype);\n }\n}\n","import type { Logger } from './config';\n\nexport function createConsoleLogger(): Logger {\n return {\n debug(message: string, meta?: Record<string, unknown>) {\n console.log(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n info(message: string, meta?: Record<string, unknown>) {\n console.info(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n warn(message: string, meta?: Record<string, unknown>) {\n console.warn(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n error(message: string, meta?: Record<string, unknown>) {\n console.error(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n };\n}\n\nexport const noopLogger: Logger = {\n debug() {},\n info() {},\n warn() {},\n error() {},\n};\n","/**\n * Single source of truth for the SDK version.\n */\nexport const SDK_VERSION = '1.2.0';\n","/**\n * Base HTTP client for all CGS SDK clients\n *\n * Provides common functionality:\n * - Request/response handling\n * - Error handling\n * - Retry logic with exponential backoff\n * - Timeout management\n * - Debug logging\n */\n\nimport type { BaseClientConfig, Logger, RequestInterceptor, RequestOptions, RequiredBaseClientConfig } from './config';\nimport {\n CGSError,\n NetworkError,\n TimeoutError,\n AuthenticationError,\n RateLimitError,\n ServiceUnavailableError,\n ValidationError,\n} from './errors';\nimport { createConsoleLogger } from './logger';\nimport { SDK_VERSION } from './version';\n\nexport abstract class BaseClient {\n protected config: RequiredBaseClientConfig;\n protected logger: Logger;\n private interceptors: RequestInterceptor[];\n\n constructor(config: BaseClientConfig) {\n if (!config.baseURL?.trim()) {\n throw new ValidationError('baseURL is required and must be a non-empty string', ['baseURL']);\n }\n if (!config.tenantId?.trim()) {\n throw new ValidationError('tenantId is required and must be a non-empty string', ['tenantId']);\n }\n\n this.interceptors = config.interceptors || [];\n this.logger = config.logger || createConsoleLogger();\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n interceptors: this.interceptors,\n logger: this.logger,\n };\n }\n\n /**\n * Make an HTTP request with timeout and error handling\n */\n protected async request<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n requestOptions?: RequestOptions\n ): Promise<T> {\n const url = `${serviceURL || this.config.baseURL}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-Tenant-ID': this.config.tenantId,\n 'X-SDK-Version': `vesant-sdk-ts/${SDK_VERSION}`,\n ...this.config.headers,\n ...((options.headers as Record<string, string>) || {}),\n };\n\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n // Link consumer AbortSignal to internal controller\n if (requestOptions?.signal) {\n if (requestOptions.signal.aborted) {\n controller.abort();\n } else {\n requestOptions.signal.addEventListener('abort', () => controller.abort(), { once: true });\n }\n }\n\n try {\n // Run onRequest interceptors\n let finalOptions: RequestInit = { ...options, headers };\n for (const interceptor of this.interceptors) {\n if (interceptor.onRequest) {\n finalOptions = await interceptor.onRequest(url, finalOptions);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug(`${finalOptions.method || 'GET'} ${url}`, {\n headers: finalOptions.headers as Record<string, unknown>,\n body: finalOptions.body as unknown,\n });\n }\n\n const response = await fetch(url, {\n ...finalOptions,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n let data: Record<string, unknown> | undefined;\n try {\n data = await response.json();\n } catch {\n // Non-JSON response (HTML error pages, 204 No Content, etc.)\n if (!response.ok) {\n this.handleErrorResponse(response.status, {\n error: `HTTP ${response.status}`,\n message: response.statusText,\n });\n }\n // OK response but no JSON body (e.g., 204)\n return undefined as unknown as T;\n }\n\n if (!response.ok) {\n this.handleErrorResponse(response.status, data || {});\n }\n\n // Run onResponse interceptors\n let result: unknown = data;\n for (const interceptor of this.interceptors) {\n if (interceptor.onResponse) {\n result = await interceptor.onResponse(url, result);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug('Response:', { data: result });\n }\n\n return result as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n // Run onError interceptors\n if (error instanceof Error) {\n for (const interceptor of this.interceptors) {\n if (interceptor.onError) {\n await interceptor.onError(url, error);\n }\n }\n }\n\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n // Distinguish consumer abort from timeout\n if (requestOptions?.signal?.aborted) {\n throw new CGSError('Request aborted', 'REQUEST_ABORTED');\n }\n throw new TimeoutError(this.config.timeout);\n }\n if (error instanceof CGSError) {\n throw error;\n }\n }\n\n throw new NetworkError('Network request failed', error);\n }\n }\n\n /**\n * Make an HTTP request with retry logic\n */\n protected async requestWithRetry<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n retries: number = this.config.retries,\n requestOptions?: RequestOptions\n ): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await this.request<T>(endpoint, options, serviceURL, requestOptions);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error');\n\n // Don't retry on consumer abort\n if (requestOptions?.signal?.aborted) {\n throw lastError;\n }\n\n // Don't retry on client errors (4xx), except 429 (rate limit)\n if (\n lastError instanceof CGSError &&\n lastError.statusCode &&\n lastError.statusCode >= 400 &&\n lastError.statusCode < 500 &&\n lastError.statusCode !== 429\n ) {\n throw lastError;\n }\n\n // Don't retry on last attempt\n if (attempt === retries) {\n break;\n }\n\n // Use Retry-After for 429, otherwise exponential backoff with jitter\n let delay: number;\n if (lastError instanceof RateLimitError && lastError.retryAfter) {\n delay = lastError.retryAfter * 1000;\n } else {\n delay = Math.min(1000 * Math.pow(2, attempt) + Math.random() * 1000, 10000);\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n\n if (this.config.debug) {\n this.logger.debug(`Retry attempt ${attempt + 1}/${retries} after ${delay.toFixed(0)}ms`);\n }\n }\n }\n\n throw new NetworkError(`Request failed after ${retries} retries`, lastError);\n }\n\n /**\n * Handle error responses from API\n */\n protected handleErrorResponse(status: number, data: Record<string, unknown>): never {\n const message = (data.error as string) || (data.message as string) || `HTTP ${status}`;\n\n switch (status) {\n case 400:\n throw new CGSError(message, 'BAD_REQUEST', 400, data);\n case 401:\n throw new AuthenticationError(message);\n case 403:\n throw new CGSError(message, 'FORBIDDEN', 403, data);\n case 404:\n throw new CGSError(message, 'NOT_FOUND', 404, data);\n case 429: {\n const retryAfter = (data.retry_after as number | undefined) || (data.retryAfter as number | undefined);\n throw new RateLimitError(retryAfter);\n }\n case 500:\n case 502:\n case 503:\n case 504:\n throw new ServiceUnavailableError(message);\n default:\n throw new CGSError(message, 'UNKNOWN_ERROR', status, data);\n }\n }\n\n /**\n * Build query string from parameters\n */\n protected buildQueryString(params: Record<string, unknown>): string {\n const query = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((item) => query.append(key, String(item)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n\n const queryString = query.toString();\n return queryString ? `?${queryString}` : '';\n }\n\n /**\n * Update client configuration\n */\n updateConfig(config: Partial<BaseClientConfig>): void {\n this.config = {\n ...this.config,\n ...config,\n headers: {\n ...this.config.headers,\n ...(config.headers || {}),\n },\n };\n if (config.logger) {\n this.logger = config.logger;\n }\n if (config.interceptors) {\n this.interceptors = config.interceptors;\n }\n }\n\n /**\n * Get current configuration (readonly)\n */\n getConfig(): Readonly<BaseClientConfig> {\n return { ...this.config };\n }\n\n /**\n * Health check endpoint\n */\n async healthCheck(): Promise<{ status: string; timestamp: string }> {\n return this.request('/api/v1/health');\n }\n}\n","/**\n * RiskProfileClient - Customer Risk Profile Management\n *\n * Provides methods to create, retrieve, and manage customer risk profiles\n * in the Vesant Compliance Platform.\n */\n\nimport { BaseClient } from '../core/client';\nimport { CGSError } from '../core/errors';\nimport type { BaseClientConfig, RequestOptions } from '../core/config';\nimport type {\n CustomerProfile,\n CreateProfileRequest,\n UpdateProfileRequest,\n ProfileFilters,\n ProfileListResponse,\n} from './types';\n\nexport class RiskProfileClient extends BaseClient {\n constructor(config: BaseClientConfig) {\n super(config);\n }\n\n // ============================================================================\n // Profile Management\n // ============================================================================\n\n /**\n * Create a new customer risk profile\n *\n * @param request - Profile creation data\n * @returns Created customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.createProfile({\n * customer_id: 'CUST-12345',\n * entity_type: 'individual',\n * customer_status: 'active',\n * full_name: 'John Doe',\n * email_address: 'john@example.com',\n * date_of_birth: '1990-01-15',\n * country_of_residence: 'US'\n * });\n * ```\n */\n async createProfile(request: CreateProfileRequest, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n return this.request<CustomerProfile>('/api/v1/profiles', {\n method: 'POST',\n body: JSON.stringify(request),\n }, undefined, requestOptions);\n }\n\n /**\n * Get customer profile by customer ID\n *\n * Note: This searches for the profile using the customer_id field.\n * Returns the first matching profile for the tenant.\n *\n * @param customerId - Customer ID to search for\n * @returns Customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.getProfile('CUST-12345');\n * ```\n */\n async getProfile(customerId: string, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n const response = await this.queryProfiles({\n search: customerId,\n page: 1,\n page_size: 10,\n }, requestOptions);\n\n // Find exact match by customer_id\n const profile = response.data.find(p => p.customer_id === customerId);\n if (!profile) {\n throw new CGSError(`Profile not found for customer ID: ${customerId}`, 'NOT_FOUND', 404);\n }\n\n return profile;\n }\n\n /**\n * Update customer profile\n *\n * @param profileId - Profile UUID\n * @param updates - Fields to update\n * @returns Updated customer profile\n *\n * @example\n * ```typescript\n * const updated = await client.updateProfile(profileId, {\n * location: 'New York, USA',\n * location_compliance: 'compliant',\n * last_recorded_activity: new Date().toISOString()\n * });\n * ```\n */\n async updateProfile(\n profileId: string,\n updates: UpdateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n return this.request<CustomerProfile>(`/api/v1/profiles/${profileId}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }, undefined, requestOptions);\n }\n\n /**\n * Get or create profile (idempotent operation)\n *\n * Attempts to get existing profile by customer_id, creates if not found.\n *\n * @param customerId - Customer ID\n * @param createRequest - Profile data to use if creating new profile\n * @returns Existing or newly created profile\n *\n * @example\n * ```typescript\n * const profile = await client.getOrCreateProfile('CUST-123', {\n * customer_id: 'CUST-123',\n * entity_type: 'individual',\n * full_name: 'John Doe',\n * email_address: 'john@example.com'\n * });\n * ```\n */\n async getOrCreateProfile(\n customerId: string,\n createRequest: CreateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n try {\n return await this.getProfile(customerId, requestOptions);\n } catch (error) {\n // Only treat NOT_FOUND as \"profile doesn't exist\" — re-throw other errors\n if (error instanceof CGSError && error.code === 'NOT_FOUND') {\n return await this.createProfile(createRequest, requestOptions);\n }\n throw error;\n }\n }\n\n /**\n * Query profiles with filters (internal helper for getProfile)\n */\n private async queryProfiles(filters: ProfileFilters = {}, requestOptions?: RequestOptions): Promise<ProfileListResponse> {\n const queryString = this.buildQueryString(filters as Record<string, unknown>);\n return this.request<ProfileListResponse>(\n `/api/v1/risk-dashboard/profiles${queryString}`,\n undefined, undefined, requestOptions\n );\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/core/errors.ts","../../src/core/logger.ts","../../src/core/version.ts","../../src/core/client.ts","../../src/risk-profile/client.ts"],"names":[],"mappings":";AAOO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,K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AA,KAAS,WAAA,EAAa;AAC3D,QAAA,OAAO,MAAM,IAAA,CAAK,aAAA,CAAc,aAAA,EAAe,cAAc,CAAA;AAAA,MAC/D;AACA,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAc,aAAA,CAAc,OAAA,GAA0B,IAAI,cAAA,EAA+D;AACvH,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,gBAAA,CAAiB,OAAkC,CAAA;AAC5E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,kCAAkC,WAAW,CAAA,CAAA;AAAA,MAC7C,MAAA;AAAA,MAAW,MAAA;AAAA,MAAW;AAAA,KACxB;AAAA,EACF;AACF","file":"index.mjs","sourcesContent":["/**\n * Error hierarchy for CGS SDK\n *\n * Provides structured error handling with specific error types\n * for different failure scenarios.\n */\n\nexport class CGSError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode?: number,\n public details?: Record<string, unknown>\n ) {\n super(message);\n this.name = 'CGSError';\n Object.setPrototypeOf(this, CGSError.prototype);\n }\n}\n\nexport class NetworkError extends CGSError {\n constructor(message: string, public originalError?: unknown) {\n super(message, 'NETWORK_ERROR', undefined, { originalError });\n this.name = 'NetworkError';\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ValidationError extends CGSError {\n constructor(message: string, fields?: string[]) {\n super(message, 'VALIDATION_ERROR', 400, { fields });\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class ServiceUnavailableError extends CGSError {\n constructor(message: string) {\n super(`${message} is unavailable`, 'SERVICE_UNAVAILABLE', 503, { service: message });\n this.name = 'ServiceUnavailableError';\n Object.setPrototypeOf(this, ServiceUnavailableError.prototype);\n }\n}\n\nexport class ComplianceBlockedError extends CGSError {\n constructor(reasons: string[]) {\n super('Access blocked due to compliance rules', 'COMPLIANCE_BLOCKED', 403, { reasons });\n this.name = 'ComplianceBlockedError';\n Object.setPrototypeOf(this, ComplianceBlockedError.prototype);\n }\n}\n\nexport class AuthenticationError extends CGSError {\n constructor(message: string = 'Authentication failed') {\n super(message, 'AUTHENTICATION_ERROR', 401);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class RateLimitError extends CGSError {\n constructor(public retryAfter?: number) {\n super('Rate limit exceeded', 'RATE_LIMIT_EXCEEDED', 429, { retryAfter });\n this.name = 'RateLimitError';\n Object.setPrototypeOf(this, RateLimitError.prototype);\n }\n}\n\nexport class TimeoutError extends CGSError {\n constructor(public timeout: number) {\n super(`Request timeout after ${timeout}ms`, 'TIMEOUT', 408, { timeout });\n this.name = 'TimeoutError';\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class ComplianceError extends CGSError {\n constructor(\n message: string,\n public originalError?: unknown,\n code: string = 'COMPLIANCE_ERROR'\n ) {\n super(message, code, undefined, { originalError });\n this.name = 'ComplianceError';\n Object.setPrototypeOf(this, ComplianceError.prototype);\n }\n}\n","import type { Logger } from './config';\n\nexport function createConsoleLogger(): Logger {\n return {\n debug(message: string, meta?: Record<string, unknown>) {\n console.log(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n info(message: string, meta?: Record<string, unknown>) {\n console.info(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n warn(message: string, meta?: Record<string, unknown>) {\n console.warn(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n error(message: string, meta?: Record<string, unknown>) {\n console.error(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n };\n}\n\nexport const noopLogger: Logger = {\n debug() {},\n info() {},\n warn() {},\n error() {},\n};\n","/**\n * Single source of truth for the SDK version.\n */\nexport const SDK_VERSION = '1.1.0';\n","/**\n * Base HTTP client for all CGS SDK clients\n *\n * Provides common functionality:\n * - Request/response handling\n * - Error handling\n * - Retry logic with exponential backoff\n * - Timeout management\n * - Debug logging\n */\n\nimport type { BaseClientConfig, Logger, RequestInterceptor, RequestOptions, RequiredBaseClientConfig } from './config';\nimport {\n CGSError,\n NetworkError,\n TimeoutError,\n AuthenticationError,\n RateLimitError,\n ServiceUnavailableError,\n ValidationError,\n} from './errors';\nimport { createConsoleLogger } from './logger';\nimport { SDK_VERSION } from './version';\n\nexport abstract class BaseClient {\n protected config: RequiredBaseClientConfig;\n protected logger: Logger;\n private interceptors: RequestInterceptor[];\n\n constructor(config: BaseClientConfig) {\n if (!config.baseURL?.trim()) {\n throw new ValidationError('baseURL is required and must be a non-empty string', ['baseURL']);\n }\n if (!config.tenantId?.trim()) {\n throw new ValidationError('tenantId is required and must be a non-empty string', ['tenantId']);\n }\n\n this.interceptors = config.interceptors || [];\n this.logger = config.logger || createConsoleLogger();\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n interceptors: this.interceptors,\n logger: this.logger,\n };\n }\n\n /**\n * Make an HTTP request with timeout and error handling\n */\n protected async request<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n requestOptions?: RequestOptions\n ): Promise<T> {\n const url = `${serviceURL || this.config.baseURL}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-Tenant-ID': this.config.tenantId,\n 'X-SDK-Version': `vesant-sdk-ts/${SDK_VERSION}`,\n ...this.config.headers,\n ...((options.headers as Record<string, string>) || {}),\n };\n\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n // Link consumer AbortSignal to internal controller\n if (requestOptions?.signal) {\n if (requestOptions.signal.aborted) {\n controller.abort();\n } else {\n requestOptions.signal.addEventListener('abort', () => controller.abort(), { once: true });\n }\n }\n\n try {\n // Run onRequest interceptors\n let finalOptions: RequestInit = { ...options, headers };\n for (const interceptor of this.interceptors) {\n if (interceptor.onRequest) {\n finalOptions = await interceptor.onRequest(url, finalOptions);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug(`${finalOptions.method || 'GET'} ${url}`, {\n headers: finalOptions.headers as Record<string, unknown>,\n body: finalOptions.body as unknown,\n });\n }\n\n const response = await fetch(url, {\n ...finalOptions,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n let data: Record<string, unknown> | undefined;\n try {\n data = await response.json();\n } catch {\n // Non-JSON response (HTML error pages, 204 No Content, etc.)\n if (!response.ok) {\n this.handleErrorResponse(response.status, {\n error: `HTTP ${response.status}`,\n message: response.statusText,\n });\n }\n // OK response but no JSON body (e.g., 204)\n return undefined as unknown as T;\n }\n\n if (!response.ok) {\n this.handleErrorResponse(response.status, data || {});\n }\n\n // Run onResponse interceptors\n let result: unknown = data;\n for (const interceptor of this.interceptors) {\n if (interceptor.onResponse) {\n result = await interceptor.onResponse(url, result);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug('Response:', { data: result });\n }\n\n return result as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n // Run onError interceptors\n if (error instanceof Error) {\n for (const interceptor of this.interceptors) {\n if (interceptor.onError) {\n await interceptor.onError(url, error);\n }\n }\n }\n\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n // Distinguish consumer abort from timeout\n if (requestOptions?.signal?.aborted) {\n throw new CGSError('Request aborted', 'REQUEST_ABORTED');\n }\n throw new TimeoutError(this.config.timeout);\n }\n if (error instanceof CGSError) {\n throw error;\n }\n }\n\n throw new NetworkError('Network request failed', error);\n }\n }\n\n /**\n * Make an HTTP request with retry logic\n */\n protected async requestWithRetry<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n retries: number = this.config.retries,\n requestOptions?: RequestOptions\n ): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await this.request<T>(endpoint, options, serviceURL, requestOptions);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error');\n\n // Don't retry on consumer abort\n if (requestOptions?.signal?.aborted) {\n throw lastError;\n }\n\n // Don't retry on client errors (4xx), except 429 (rate limit)\n if (\n lastError instanceof CGSError &&\n lastError.statusCode &&\n lastError.statusCode >= 400 &&\n lastError.statusCode < 500 &&\n lastError.statusCode !== 429\n ) {\n throw lastError;\n }\n\n // Don't retry on last attempt\n if (attempt === retries) {\n break;\n }\n\n // Use Retry-After for 429, otherwise exponential backoff with jitter\n let delay: number;\n if (lastError instanceof RateLimitError && lastError.retryAfter) {\n delay = lastError.retryAfter * 1000;\n } else {\n delay = Math.min(1000 * Math.pow(2, attempt) + Math.random() * 1000, 10000);\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n\n if (this.config.debug) {\n this.logger.debug(`Retry attempt ${attempt + 1}/${retries} after ${delay.toFixed(0)}ms`);\n }\n }\n }\n\n throw new NetworkError(`Request failed after ${retries} retries`, lastError);\n }\n\n /**\n * Handle error responses from API\n */\n protected handleErrorResponse(status: number, data: Record<string, unknown>): never {\n const message = (data.error as string) || (data.message as string) || `HTTP ${status}`;\n\n switch (status) {\n case 400:\n throw new CGSError(message, 'BAD_REQUEST', 400, data);\n case 401:\n throw new AuthenticationError(message);\n case 403:\n throw new CGSError(message, 'FORBIDDEN', 403, data);\n case 404:\n throw new CGSError(message, 'NOT_FOUND', 404, data);\n case 429: {\n const retryAfter = (data.retry_after as number | undefined) || (data.retryAfter as number | undefined);\n throw new RateLimitError(retryAfter);\n }\n case 500:\n case 502:\n case 503:\n case 504:\n throw new ServiceUnavailableError(message);\n default:\n throw new CGSError(message, 'UNKNOWN_ERROR', status, data);\n }\n }\n\n /**\n * Build query string from parameters\n */\n protected buildQueryString(params: Record<string, unknown>): string {\n const query = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((item) => query.append(key, String(item)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n\n const queryString = query.toString();\n return queryString ? `?${queryString}` : '';\n }\n\n /**\n * Update client configuration\n */\n updateConfig(config: Partial<BaseClientConfig>): void {\n this.config = {\n ...this.config,\n ...config,\n headers: {\n ...this.config.headers,\n ...(config.headers || {}),\n },\n };\n if (config.logger) {\n this.logger = config.logger;\n }\n if (config.interceptors) {\n this.interceptors = config.interceptors;\n }\n }\n\n /**\n * Get current configuration (readonly)\n */\n getConfig(): Readonly<BaseClientConfig> {\n return { ...this.config };\n }\n\n /**\n * Health check endpoint\n */\n async healthCheck(): Promise<{ status: string; timestamp: string }> {\n return this.request('/api/v1/health');\n }\n}\n","/**\n * RiskProfileClient - Customer Risk Profile Management\n *\n * Provides methods to create, retrieve, and manage customer risk profiles\n * in the Vesant Compliance Platform.\n */\n\nimport { BaseClient } from '../core/client';\nimport { CGSError } from '../core/errors';\nimport type { BaseClientConfig, RequestOptions } from '../core/config';\nimport type {\n CustomerProfile,\n CreateProfileRequest,\n UpdateProfileRequest,\n ProfileFilters,\n ProfileListResponse,\n} from './types';\n\nexport class RiskProfileClient extends BaseClient {\n constructor(config: BaseClientConfig) {\n super(config);\n }\n\n // ============================================================================\n // Profile Management\n // ============================================================================\n\n /**\n * Create a new customer risk profile\n *\n * @param request - Profile creation data\n * @returns Created customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.createProfile({\n * customer_id: 'CUST-12345',\n * entity_type: 'individual',\n * customer_status: 'active',\n * full_name: 'John Doe',\n * email_address: 'john@example.com',\n * date_of_birth: '1990-01-15',\n * country_of_residence: 'US'\n * });\n * ```\n */\n async createProfile(request: CreateProfileRequest, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n return this.request<CustomerProfile>('/api/v1/profiles', {\n method: 'POST',\n body: JSON.stringify(request),\n }, undefined, requestOptions);\n }\n\n /**\n * Get customer profile by customer ID\n *\n * Note: This searches for the profile using the customer_id field.\n * Returns the first matching profile for the tenant.\n *\n * @param customerId - Customer ID to search for\n * @returns Customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.getProfile('CUST-12345');\n * ```\n */\n async getProfile(customerId: string, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n const response = await this.queryProfiles({\n search: customerId,\n page: 1,\n page_size: 10,\n }, requestOptions);\n\n // Find exact match by customer_id\n const profile = response.data.find(p => p.customer_id === customerId);\n if (!profile) {\n throw new CGSError(`Profile not found for customer ID: ${customerId}`, 'NOT_FOUND', 404);\n }\n\n return profile;\n }\n\n /**\n * Update customer profile\n *\n * @param profileId - Profile UUID\n * @param updates - Fields to update\n * @returns Updated customer profile\n *\n * @example\n * ```typescript\n * const updated = await client.updateProfile(profileId, {\n * location: 'New York, USA',\n * location_compliance: 'compliant',\n * last_recorded_activity: new Date().toISOString()\n * });\n * ```\n */\n async updateProfile(\n profileId: string,\n updates: UpdateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n return this.request<CustomerProfile>(`/api/v1/profiles/${profileId}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }, undefined, requestOptions);\n }\n\n /**\n * Get or create profile (idempotent operation)\n *\n * Attempts to get existing profile by customer_id, creates if not found.\n *\n * @param customerId - Customer ID\n * @param createRequest - Profile data to use if creating new profile\n * @returns Existing or newly created profile\n *\n * @example\n * ```typescript\n * const profile = await client.getOrCreateProfile('CUST-123', {\n * customer_id: 'CUST-123',\n * entity_type: 'individual',\n * full_name: 'John Doe',\n * email_address: 'john@example.com'\n * });\n * ```\n */\n async getOrCreateProfile(\n customerId: string,\n createRequest: CreateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n try {\n return await this.getProfile(customerId, requestOptions);\n } catch (error) {\n // Only treat NOT_FOUND as \"profile doesn't exist\" — re-throw other errors\n if (error instanceof CGSError && error.code === 'NOT_FOUND') {\n return await this.createProfile(createRequest, requestOptions);\n }\n throw error;\n }\n }\n\n /**\n * Query profiles with filters (internal helper for getProfile)\n */\n private async queryProfiles(filters: ProfileFilters = {}, requestOptions?: RequestOptions): Promise<ProfileListResponse> {\n const queryString = this.buildQueryString(filters as Record<string, unknown>);\n return this.request<ProfileListResponse>(\n `/api/v1/risk-dashboard/profiles${queryString}`,\n undefined, undefined, requestOptions\n );\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/core/errors.ts","../../src/core/logger.ts","../../src/core/version.ts","../../src/core/client.ts","../../src/risk-profile/client.ts"],"names":[],"mappings":";AAOO,IAAM,QAAA,GAAN,MAAM,SAAA,SAAiB,KAAA,CAAM;AAAA,EAClC,WAAA,CACE,OAAA,EACO,IAAA,EACA,UAAA,EACA,OAAA,EACP;AACA,IAAA,KAAA,CAAM,OAAO,CAAA;AAJN,IAAA,IAAA,CAAA,IAAA,GAAA,IAAA;AACA,IAAA,IAAA,CAAA,UAAA,GAAA,UAAA;AACA,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAGP,IAAA,IAAA,CAAK,IAAA,GAAO,UAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,SAAA,CAAS,SAAS,CAAA;AAAA,EAChD;AACF,CAAA;AAEO,IAAM,YAAA,GAAN,MAAM,aAAA,SAAqB,QAAA,CAAS;AAAA,EACzC,WAAA,CAAY,SAAwB,aAAA,EAAyB;AAC3D,IAAA,KAAA,CAAM,OAAA,EAAS,eAAA,EAAiB,MAAA,EAAW,EAAE,eAAe,CAAA;AAD1B,IAAA,IAAA,CAAA,aAAA,GAAA,aAAA;AAElC,IAAA,IAAA,CAAK,IAAA,GAAO,cAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,aAAA,CAAa,SAAS,CAAA;AAAA,EACpD;AACF,CAAA;AAEO,IAAM,eAAA,GAAN,MAAM,gBAAA,SAAwB,QAAA,CAAS;AAAA,EAC5C,WAAA,CAAY,SAAiB,MAAA,EAAmB;AAC9C,IAAA,KAAA,CAAM,OAAA,EAAS,kBAAA,EAAoB,GAAA,EAAK,EAAE,QAA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AAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBA,MAAM,kBAAA,CACJ,UAAA,EACA,aAAA,EACA,cAAA,EAC0B;AAC1B,IAAA,IAAI;AACF,MAAA,OAAO,MAAM,IAAA,CAAK,UAAA,CAAW,UAAA,EAAY,cAAc,CAAA;AAAA,IACzD,SAAS,KAAA,EAAO;AAEd,MAAA,IAAI,KAAA,YAAiB,QAAA,IAAY,KAAA,CAAM,IAAA,KAAS,WAAA,EAAa;AAC3D,QAAA,OAAO,MAAM,IAAA,CAAK,aAAA,CAAc,aAAA,EAAe,cAAc,CAAA;AAAA,MAC/D;AACA,MAAA,MAAM,KAAA;AAAA,IACR;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKA,MAAc,aAAA,CAAc,OAAA,GAA0B,IAAI,cAAA,EAA+D;AACvH,IAAA,MAAM,WAAA,GAAc,IAAA,CAAK,gBAAA,CAAiB,OAAkC,CAAA;AAC5E,IAAA,OAAO,IAAA,CAAK,OAAA;AAAA,MACV,kCAAkC,WAAW,CAAA,CAAA;AAAA,MAC7C,MAAA;AAAA,MAAW,MAAA;AAAA,MAAW;AAAA,KACxB;AAAA,EACF;AACF","file":"index.mjs","sourcesContent":["/**\n * Error hierarchy for CGS SDK\n *\n * Provides structured error handling with specific error types\n * for different failure scenarios.\n */\n\nexport class CGSError extends Error {\n constructor(\n message: string,\n public code: string,\n public statusCode?: number,\n public details?: Record<string, unknown>\n ) {\n super(message);\n this.name = 'CGSError';\n Object.setPrototypeOf(this, CGSError.prototype);\n }\n}\n\nexport class NetworkError extends CGSError {\n constructor(message: string, public originalError?: unknown) {\n super(message, 'NETWORK_ERROR', undefined, { originalError });\n this.name = 'NetworkError';\n Object.setPrototypeOf(this, NetworkError.prototype);\n }\n}\n\nexport class ValidationError extends CGSError {\n constructor(message: string, fields?: string[]) {\n super(message, 'VALIDATION_ERROR', 400, { fields });\n this.name = 'ValidationError';\n Object.setPrototypeOf(this, ValidationError.prototype);\n }\n}\n\nexport class ServiceUnavailableError extends CGSError {\n constructor(message: string) {\n super(`${message} is unavailable`, 'SERVICE_UNAVAILABLE', 503, { service: message });\n this.name = 'ServiceUnavailableError';\n Object.setPrototypeOf(this, ServiceUnavailableError.prototype);\n }\n}\n\nexport class ComplianceBlockedError extends CGSError {\n constructor(reasons: string[]) {\n super('Access blocked due to compliance rules', 'COMPLIANCE_BLOCKED', 403, { reasons });\n this.name = 'ComplianceBlockedError';\n Object.setPrototypeOf(this, ComplianceBlockedError.prototype);\n }\n}\n\nexport class AuthenticationError extends CGSError {\n constructor(message: string = 'Authentication failed') {\n super(message, 'AUTHENTICATION_ERROR', 401);\n this.name = 'AuthenticationError';\n Object.setPrototypeOf(this, AuthenticationError.prototype);\n }\n}\n\nexport class RateLimitError extends CGSError {\n constructor(public retryAfter?: number) {\n super('Rate limit exceeded', 'RATE_LIMIT_EXCEEDED', 429, { retryAfter });\n this.name = 'RateLimitError';\n Object.setPrototypeOf(this, RateLimitError.prototype);\n }\n}\n\nexport class TimeoutError extends CGSError {\n constructor(public timeout: number) {\n super(`Request timeout after ${timeout}ms`, 'TIMEOUT', 408, { timeout });\n this.name = 'TimeoutError';\n Object.setPrototypeOf(this, TimeoutError.prototype);\n }\n}\n\nexport class ComplianceError extends CGSError {\n constructor(\n message: string,\n public originalError?: unknown,\n code: string = 'COMPLIANCE_ERROR'\n ) {\n super(message, code, undefined, { originalError });\n this.name = 'ComplianceError';\n Object.setPrototypeOf(this, ComplianceError.prototype);\n }\n}\n","import type { Logger } from './config';\n\nexport function createConsoleLogger(): Logger {\n return {\n debug(message: string, meta?: Record<string, unknown>) {\n console.log(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n info(message: string, meta?: Record<string, unknown>) {\n console.info(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n warn(message: string, meta?: Record<string, unknown>) {\n console.warn(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n error(message: string, meta?: Record<string, unknown>) {\n console.error(`[CGS SDK] ${message}`, meta !== undefined ? meta : '');\n },\n };\n}\n\nexport const noopLogger: Logger = {\n debug() {},\n info() {},\n warn() {},\n error() {},\n};\n","/**\n * Single source of truth for the SDK version.\n */\nexport const SDK_VERSION = '1.2.0';\n","/**\n * Base HTTP client for all CGS SDK clients\n *\n * Provides common functionality:\n * - Request/response handling\n * - Error handling\n * - Retry logic with exponential backoff\n * - Timeout management\n * - Debug logging\n */\n\nimport type { BaseClientConfig, Logger, RequestInterceptor, RequestOptions, RequiredBaseClientConfig } from './config';\nimport {\n CGSError,\n NetworkError,\n TimeoutError,\n AuthenticationError,\n RateLimitError,\n ServiceUnavailableError,\n ValidationError,\n} from './errors';\nimport { createConsoleLogger } from './logger';\nimport { SDK_VERSION } from './version';\n\nexport abstract class BaseClient {\n protected config: RequiredBaseClientConfig;\n protected logger: Logger;\n private interceptors: RequestInterceptor[];\n\n constructor(config: BaseClientConfig) {\n if (!config.baseURL?.trim()) {\n throw new ValidationError('baseURL is required and must be a non-empty string', ['baseURL']);\n }\n if (!config.tenantId?.trim()) {\n throw new ValidationError('tenantId is required and must be a non-empty string', ['tenantId']);\n }\n\n this.interceptors = config.interceptors || [];\n this.logger = config.logger || createConsoleLogger();\n this.config = {\n baseURL: config.baseURL,\n tenantId: config.tenantId,\n apiKey: config.apiKey || '',\n headers: config.headers || {},\n timeout: config.timeout || 10000,\n retries: config.retries || 3,\n debug: config.debug || false,\n interceptors: this.interceptors,\n logger: this.logger,\n };\n }\n\n /**\n * Make an HTTP request with timeout and error handling\n */\n protected async request<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n requestOptions?: RequestOptions\n ): Promise<T> {\n const url = `${serviceURL || this.config.baseURL}${endpoint}`;\n\n const headers: Record<string, string> = {\n 'Content-Type': 'application/json',\n 'X-Tenant-ID': this.config.tenantId,\n 'X-SDK-Version': `vesant-sdk-ts/${SDK_VERSION}`,\n ...this.config.headers,\n ...((options.headers as Record<string, string>) || {}),\n };\n\n if (this.config.apiKey) {\n headers['Authorization'] = `Bearer ${this.config.apiKey}`;\n }\n\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n // Link consumer AbortSignal to internal controller\n if (requestOptions?.signal) {\n if (requestOptions.signal.aborted) {\n controller.abort();\n } else {\n requestOptions.signal.addEventListener('abort', () => controller.abort(), { once: true });\n }\n }\n\n try {\n // Run onRequest interceptors\n let finalOptions: RequestInit = { ...options, headers };\n for (const interceptor of this.interceptors) {\n if (interceptor.onRequest) {\n finalOptions = await interceptor.onRequest(url, finalOptions);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug(`${finalOptions.method || 'GET'} ${url}`, {\n headers: finalOptions.headers as Record<string, unknown>,\n body: finalOptions.body as unknown,\n });\n }\n\n const response = await fetch(url, {\n ...finalOptions,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n let data: Record<string, unknown> | undefined;\n try {\n data = await response.json();\n } catch {\n // Non-JSON response (HTML error pages, 204 No Content, etc.)\n if (!response.ok) {\n this.handleErrorResponse(response.status, {\n error: `HTTP ${response.status}`,\n message: response.statusText,\n });\n }\n // OK response but no JSON body (e.g., 204)\n return undefined as unknown as T;\n }\n\n if (!response.ok) {\n this.handleErrorResponse(response.status, data || {});\n }\n\n // Run onResponse interceptors\n let result: unknown = data;\n for (const interceptor of this.interceptors) {\n if (interceptor.onResponse) {\n result = await interceptor.onResponse(url, result);\n }\n }\n\n if (this.config.debug) {\n this.logger.debug('Response:', { data: result });\n }\n\n return result as T;\n } catch (error) {\n clearTimeout(timeoutId);\n\n // Run onError interceptors\n if (error instanceof Error) {\n for (const interceptor of this.interceptors) {\n if (interceptor.onError) {\n await interceptor.onError(url, error);\n }\n }\n }\n\n if (error instanceof Error) {\n if (error.name === 'AbortError') {\n // Distinguish consumer abort from timeout\n if (requestOptions?.signal?.aborted) {\n throw new CGSError('Request aborted', 'REQUEST_ABORTED');\n }\n throw new TimeoutError(this.config.timeout);\n }\n if (error instanceof CGSError) {\n throw error;\n }\n }\n\n throw new NetworkError('Network request failed', error);\n }\n }\n\n /**\n * Make an HTTP request with retry logic\n */\n protected async requestWithRetry<T>(\n endpoint: string,\n options: RequestInit = {},\n serviceURL?: string,\n retries: number = this.config.retries,\n requestOptions?: RequestOptions\n ): Promise<T> {\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= retries; attempt++) {\n try {\n return await this.request<T>(endpoint, options, serviceURL, requestOptions);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error('Unknown error');\n\n // Don't retry on consumer abort\n if (requestOptions?.signal?.aborted) {\n throw lastError;\n }\n\n // Don't retry on client errors (4xx), except 429 (rate limit)\n if (\n lastError instanceof CGSError &&\n lastError.statusCode &&\n lastError.statusCode >= 400 &&\n lastError.statusCode < 500 &&\n lastError.statusCode !== 429\n ) {\n throw lastError;\n }\n\n // Don't retry on last attempt\n if (attempt === retries) {\n break;\n }\n\n // Use Retry-After for 429, otherwise exponential backoff with jitter\n let delay: number;\n if (lastError instanceof RateLimitError && lastError.retryAfter) {\n delay = lastError.retryAfter * 1000;\n } else {\n delay = Math.min(1000 * Math.pow(2, attempt) + Math.random() * 1000, 10000);\n }\n await new Promise((resolve) => setTimeout(resolve, delay));\n\n if (this.config.debug) {\n this.logger.debug(`Retry attempt ${attempt + 1}/${retries} after ${delay.toFixed(0)}ms`);\n }\n }\n }\n\n throw new NetworkError(`Request failed after ${retries} retries`, lastError);\n }\n\n /**\n * Handle error responses from API\n */\n protected handleErrorResponse(status: number, data: Record<string, unknown>): never {\n const message = (data.error as string) || (data.message as string) || `HTTP ${status}`;\n\n switch (status) {\n case 400:\n throw new CGSError(message, 'BAD_REQUEST', 400, data);\n case 401:\n throw new AuthenticationError(message);\n case 403:\n throw new CGSError(message, 'FORBIDDEN', 403, data);\n case 404:\n throw new CGSError(message, 'NOT_FOUND', 404, data);\n case 429: {\n const retryAfter = (data.retry_after as number | undefined) || (data.retryAfter as number | undefined);\n throw new RateLimitError(retryAfter);\n }\n case 500:\n case 502:\n case 503:\n case 504:\n throw new ServiceUnavailableError(message);\n default:\n throw new CGSError(message, 'UNKNOWN_ERROR', status, data);\n }\n }\n\n /**\n * Build query string from parameters\n */\n protected buildQueryString(params: Record<string, unknown>): string {\n const query = new URLSearchParams();\n\n Object.entries(params).forEach(([key, value]) => {\n if (value !== undefined && value !== null) {\n if (Array.isArray(value)) {\n value.forEach((item) => query.append(key, String(item)));\n } else {\n query.append(key, String(value));\n }\n }\n });\n\n const queryString = query.toString();\n return queryString ? `?${queryString}` : '';\n }\n\n /**\n * Update client configuration\n */\n updateConfig(config: Partial<BaseClientConfig>): void {\n this.config = {\n ...this.config,\n ...config,\n headers: {\n ...this.config.headers,\n ...(config.headers || {}),\n },\n };\n if (config.logger) {\n this.logger = config.logger;\n }\n if (config.interceptors) {\n this.interceptors = config.interceptors;\n }\n }\n\n /**\n * Get current configuration (readonly)\n */\n getConfig(): Readonly<BaseClientConfig> {\n return { ...this.config };\n }\n\n /**\n * Health check endpoint\n */\n async healthCheck(): Promise<{ status: string; timestamp: string }> {\n return this.request('/api/v1/health');\n }\n}\n","/**\n * RiskProfileClient - Customer Risk Profile Management\n *\n * Provides methods to create, retrieve, and manage customer risk profiles\n * in the Vesant Compliance Platform.\n */\n\nimport { BaseClient } from '../core/client';\nimport { CGSError } from '../core/errors';\nimport type { BaseClientConfig, RequestOptions } from '../core/config';\nimport type {\n CustomerProfile,\n CreateProfileRequest,\n UpdateProfileRequest,\n ProfileFilters,\n ProfileListResponse,\n} from './types';\n\nexport class RiskProfileClient extends BaseClient {\n constructor(config: BaseClientConfig) {\n super(config);\n }\n\n // ============================================================================\n // Profile Management\n // ============================================================================\n\n /**\n * Create a new customer risk profile\n *\n * @param request - Profile creation data\n * @returns Created customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.createProfile({\n * customer_id: 'CUST-12345',\n * entity_type: 'individual',\n * customer_status: 'active',\n * full_name: 'John Doe',\n * email_address: 'john@example.com',\n * date_of_birth: '1990-01-15',\n * country_of_residence: 'US'\n * });\n * ```\n */\n async createProfile(request: CreateProfileRequest, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n return this.request<CustomerProfile>('/api/v1/profiles', {\n method: 'POST',\n body: JSON.stringify(request),\n }, undefined, requestOptions);\n }\n\n /**\n * Get customer profile by customer ID\n *\n * Note: This searches for the profile using the customer_id field.\n * Returns the first matching profile for the tenant.\n *\n * @param customerId - Customer ID to search for\n * @returns Customer profile\n *\n * @example\n * ```typescript\n * const profile = await client.getProfile('CUST-12345');\n * ```\n */\n async getProfile(customerId: string, requestOptions?: RequestOptions): Promise<CustomerProfile> {\n const response = await this.queryProfiles({\n search: customerId,\n page: 1,\n page_size: 10,\n }, requestOptions);\n\n // Find exact match by customer_id\n const profile = response.data.find(p => p.customer_id === customerId);\n if (!profile) {\n throw new CGSError(`Profile not found for customer ID: ${customerId}`, 'NOT_FOUND', 404);\n }\n\n return profile;\n }\n\n /**\n * Update customer profile\n *\n * @param profileId - Profile UUID\n * @param updates - Fields to update\n * @returns Updated customer profile\n *\n * @example\n * ```typescript\n * const updated = await client.updateProfile(profileId, {\n * location: 'New York, USA',\n * location_compliance: 'compliant',\n * last_recorded_activity: new Date().toISOString()\n * });\n * ```\n */\n async updateProfile(\n profileId: string,\n updates: UpdateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n return this.request<CustomerProfile>(`/api/v1/profiles/${profileId}`, {\n method: 'PUT',\n body: JSON.stringify(updates),\n }, undefined, requestOptions);\n }\n\n /**\n * Get or create profile (idempotent operation)\n *\n * Attempts to get existing profile by customer_id, creates if not found.\n *\n * @param customerId - Customer ID\n * @param createRequest - Profile data to use if creating new profile\n * @returns Existing or newly created profile\n *\n * @example\n * ```typescript\n * const profile = await client.getOrCreateProfile('CUST-123', {\n * customer_id: 'CUST-123',\n * entity_type: 'individual',\n * full_name: 'John Doe',\n * email_address: 'john@example.com'\n * });\n * ```\n */\n async getOrCreateProfile(\n customerId: string,\n createRequest: CreateProfileRequest,\n requestOptions?: RequestOptions\n ): Promise<CustomerProfile> {\n try {\n return await this.getProfile(customerId, requestOptions);\n } catch (error) {\n // Only treat NOT_FOUND as \"profile doesn't exist\" — re-throw other errors\n if (error instanceof CGSError && error.code === 'NOT_FOUND') {\n return await this.createProfile(createRequest, requestOptions);\n }\n throw error;\n }\n }\n\n /**\n * Query profiles with filters (internal helper for getProfile)\n */\n private async queryProfiles(filters: ProfileFilters = {}, requestOptions?: RequestOptions): Promise<ProfileListResponse> {\n const queryString = this.buildQueryString(filters as Record<string, unknown>);\n return this.request<ProfileListResponse>(\n `/api/v1/risk-dashboard/profiles${queryString}`,\n undefined, undefined, requestOptions\n );\n }\n}\n"]}
|
|
@@ -65,6 +65,55 @@ interface CGSConfig {
|
|
|
65
65
|
type RequiredCGSConfig = Required<CGSConfig>;
|
|
66
66
|
type RequiredBaseClientConfig = Required<BaseClientConfig>;
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Base HTTP client for all CGS SDK clients
|
|
70
|
+
*
|
|
71
|
+
* Provides common functionality:
|
|
72
|
+
* - Request/response handling
|
|
73
|
+
* - Error handling
|
|
74
|
+
* - Retry logic with exponential backoff
|
|
75
|
+
* - Timeout management
|
|
76
|
+
* - Debug logging
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
declare abstract class BaseClient {
|
|
80
|
+
protected config: RequiredBaseClientConfig;
|
|
81
|
+
protected logger: Logger;
|
|
82
|
+
private interceptors;
|
|
83
|
+
constructor(config: BaseClientConfig);
|
|
84
|
+
/**
|
|
85
|
+
* Make an HTTP request with timeout and error handling
|
|
86
|
+
*/
|
|
87
|
+
protected request<T>(endpoint: string, options?: RequestInit, serviceURL?: string, requestOptions?: RequestOptions): Promise<T>;
|
|
88
|
+
/**
|
|
89
|
+
* Make an HTTP request with retry logic
|
|
90
|
+
*/
|
|
91
|
+
protected requestWithRetry<T>(endpoint: string, options?: RequestInit, serviceURL?: string, retries?: number, requestOptions?: RequestOptions): Promise<T>;
|
|
92
|
+
/**
|
|
93
|
+
* Handle error responses from API
|
|
94
|
+
*/
|
|
95
|
+
protected handleErrorResponse(status: number, data: Record<string, unknown>): never;
|
|
96
|
+
/**
|
|
97
|
+
* Build query string from parameters
|
|
98
|
+
*/
|
|
99
|
+
protected buildQueryString(params: Record<string, unknown>): string;
|
|
100
|
+
/**
|
|
101
|
+
* Update client configuration
|
|
102
|
+
*/
|
|
103
|
+
updateConfig(config: Partial<BaseClientConfig>): void;
|
|
104
|
+
/**
|
|
105
|
+
* Get current configuration (readonly)
|
|
106
|
+
*/
|
|
107
|
+
getConfig(): Readonly<BaseClientConfig>;
|
|
108
|
+
/**
|
|
109
|
+
* Health check endpoint
|
|
110
|
+
*/
|
|
111
|
+
healthCheck(): Promise<{
|
|
112
|
+
status: string;
|
|
113
|
+
timestamp: string;
|
|
114
|
+
}>;
|
|
115
|
+
}
|
|
116
|
+
|
|
68
117
|
/**
|
|
69
118
|
* Shared types used across all CGS SDK modules
|
|
70
119
|
*/
|
|
@@ -125,4 +174,4 @@ type LocationCompliance = 'compliant' | 'non-compliant' | 'unknown';
|
|
|
125
174
|
*/
|
|
126
175
|
type VerificationEventType = 'registration' | 'login' | 'transaction' | 'withdrawal' | 'deposit' | 'api_access' | 'profile_update';
|
|
127
176
|
|
|
128
|
-
export type
|
|
177
|
+
export { type APIResponse as A, BaseClient as B, type CustomerStatus as C, type EntityType as E, type LocationCompliance as L, type PaginationParams as P, type RequestOptions as R, type SuccessResponse as S, type Timestamp as T, type UUID as U, type VerificationEventType as V, type PaginatedResponse as a, type Logger as b, type RequestInterceptor as c, type BaseClientConfig as d, type CGSConfig as e, type RequiredCGSConfig as f, type RequiredBaseClientConfig as g, type ErrorResponse as h, type Result as i, type RiskLevel as j };
|
|
@@ -65,6 +65,55 @@ interface CGSConfig {
|
|
|
65
65
|
type RequiredCGSConfig = Required<CGSConfig>;
|
|
66
66
|
type RequiredBaseClientConfig = Required<BaseClientConfig>;
|
|
67
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Base HTTP client for all CGS SDK clients
|
|
70
|
+
*
|
|
71
|
+
* Provides common functionality:
|
|
72
|
+
* - Request/response handling
|
|
73
|
+
* - Error handling
|
|
74
|
+
* - Retry logic with exponential backoff
|
|
75
|
+
* - Timeout management
|
|
76
|
+
* - Debug logging
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
declare abstract class BaseClient {
|
|
80
|
+
protected config: RequiredBaseClientConfig;
|
|
81
|
+
protected logger: Logger;
|
|
82
|
+
private interceptors;
|
|
83
|
+
constructor(config: BaseClientConfig);
|
|
84
|
+
/**
|
|
85
|
+
* Make an HTTP request with timeout and error handling
|
|
86
|
+
*/
|
|
87
|
+
protected request<T>(endpoint: string, options?: RequestInit, serviceURL?: string, requestOptions?: RequestOptions): Promise<T>;
|
|
88
|
+
/**
|
|
89
|
+
* Make an HTTP request with retry logic
|
|
90
|
+
*/
|
|
91
|
+
protected requestWithRetry<T>(endpoint: string, options?: RequestInit, serviceURL?: string, retries?: number, requestOptions?: RequestOptions): Promise<T>;
|
|
92
|
+
/**
|
|
93
|
+
* Handle error responses from API
|
|
94
|
+
*/
|
|
95
|
+
protected handleErrorResponse(status: number, data: Record<string, unknown>): never;
|
|
96
|
+
/**
|
|
97
|
+
* Build query string from parameters
|
|
98
|
+
*/
|
|
99
|
+
protected buildQueryString(params: Record<string, unknown>): string;
|
|
100
|
+
/**
|
|
101
|
+
* Update client configuration
|
|
102
|
+
*/
|
|
103
|
+
updateConfig(config: Partial<BaseClientConfig>): void;
|
|
104
|
+
/**
|
|
105
|
+
* Get current configuration (readonly)
|
|
106
|
+
*/
|
|
107
|
+
getConfig(): Readonly<BaseClientConfig>;
|
|
108
|
+
/**
|
|
109
|
+
* Health check endpoint
|
|
110
|
+
*/
|
|
111
|
+
healthCheck(): Promise<{
|
|
112
|
+
status: string;
|
|
113
|
+
timestamp: string;
|
|
114
|
+
}>;
|
|
115
|
+
}
|
|
116
|
+
|
|
68
117
|
/**
|
|
69
118
|
* Shared types used across all CGS SDK modules
|
|
70
119
|
*/
|
|
@@ -125,4 +174,4 @@ type LocationCompliance = 'compliant' | 'non-compliant' | 'unknown';
|
|
|
125
174
|
*/
|
|
126
175
|
type VerificationEventType = 'registration' | 'login' | 'transaction' | 'withdrawal' | 'deposit' | 'api_access' | 'profile_update';
|
|
127
176
|
|
|
128
|
-
export type
|
|
177
|
+
export { type APIResponse as A, BaseClient as B, type CustomerStatus as C, type EntityType as E, type LocationCompliance as L, type PaginationParams as P, type RequestOptions as R, type SuccessResponse as S, type Timestamp as T, type UUID as U, type VerificationEventType as V, type PaginatedResponse as a, type Logger as b, type RequestInterceptor as c, type BaseClientConfig as d, type CGSConfig as e, type RequiredCGSConfig as f, type RequiredBaseClientConfig as g, type ErrorResponse as h, type Result as i, type RiskLevel as j };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntityType, C as CustomerStatus,
|
|
1
|
+
import { E as EntityType, C as CustomerStatus, L as LocationCompliance, U as UUID, T as Timestamp, P as PaginationParams, a as PaginatedResponse } from './types-BpKxSXGF.mjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Type definitions for CGS Risk Profile Service
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as EntityType, C as CustomerStatus,
|
|
1
|
+
import { E as EntityType, C as CustomerStatus, L as LocationCompliance, U as UUID, T as Timestamp, P as PaginationParams, a as PaginatedResponse } from './types-BpKxSXGF.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Type definitions for CGS Risk Profile Service
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vesant-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "TypeScript SDK for Vesant Compliance Platform - Geolocation, KYC, Risk Profiling, CipherText, and Compliance Orchestration",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { a as RequiredBaseClientConfig, L as Logger, B as BaseClientConfig, R as RequestOptions } from './types-DBGM-bFB.mjs';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Base HTTP client for all CGS SDK clients
|
|
5
|
-
*
|
|
6
|
-
* Provides common functionality:
|
|
7
|
-
* - Request/response handling
|
|
8
|
-
* - Error handling
|
|
9
|
-
* - Retry logic with exponential backoff
|
|
10
|
-
* - Timeout management
|
|
11
|
-
* - Debug logging
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
declare abstract class BaseClient {
|
|
15
|
-
protected config: RequiredBaseClientConfig;
|
|
16
|
-
protected logger: Logger;
|
|
17
|
-
private interceptors;
|
|
18
|
-
constructor(config: BaseClientConfig);
|
|
19
|
-
/**
|
|
20
|
-
* Make an HTTP request with timeout and error handling
|
|
21
|
-
*/
|
|
22
|
-
protected request<T>(endpoint: string, options?: RequestInit, serviceURL?: string, requestOptions?: RequestOptions): Promise<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Make an HTTP request with retry logic
|
|
25
|
-
*/
|
|
26
|
-
protected requestWithRetry<T>(endpoint: string, options?: RequestInit, serviceURL?: string, retries?: number, requestOptions?: RequestOptions): Promise<T>;
|
|
27
|
-
/**
|
|
28
|
-
* Handle error responses from API
|
|
29
|
-
*/
|
|
30
|
-
protected handleErrorResponse(status: number, data: Record<string, unknown>): never;
|
|
31
|
-
/**
|
|
32
|
-
* Build query string from parameters
|
|
33
|
-
*/
|
|
34
|
-
protected buildQueryString(params: Record<string, unknown>): string;
|
|
35
|
-
/**
|
|
36
|
-
* Update client configuration
|
|
37
|
-
*/
|
|
38
|
-
updateConfig(config: Partial<BaseClientConfig>): void;
|
|
39
|
-
/**
|
|
40
|
-
* Get current configuration (readonly)
|
|
41
|
-
*/
|
|
42
|
-
getConfig(): Readonly<BaseClientConfig>;
|
|
43
|
-
/**
|
|
44
|
-
* Health check endpoint
|
|
45
|
-
*/
|
|
46
|
-
healthCheck(): Promise<{
|
|
47
|
-
status: string;
|
|
48
|
-
timestamp: string;
|
|
49
|
-
}>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { BaseClient as B };
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { a as RequiredBaseClientConfig, L as Logger, B as BaseClientConfig, R as RequestOptions } from './types-DBGM-bFB.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Base HTTP client for all CGS SDK clients
|
|
5
|
-
*
|
|
6
|
-
* Provides common functionality:
|
|
7
|
-
* - Request/response handling
|
|
8
|
-
* - Error handling
|
|
9
|
-
* - Retry logic with exponential backoff
|
|
10
|
-
* - Timeout management
|
|
11
|
-
* - Debug logging
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
declare abstract class BaseClient {
|
|
15
|
-
protected config: RequiredBaseClientConfig;
|
|
16
|
-
protected logger: Logger;
|
|
17
|
-
private interceptors;
|
|
18
|
-
constructor(config: BaseClientConfig);
|
|
19
|
-
/**
|
|
20
|
-
* Make an HTTP request with timeout and error handling
|
|
21
|
-
*/
|
|
22
|
-
protected request<T>(endpoint: string, options?: RequestInit, serviceURL?: string, requestOptions?: RequestOptions): Promise<T>;
|
|
23
|
-
/**
|
|
24
|
-
* Make an HTTP request with retry logic
|
|
25
|
-
*/
|
|
26
|
-
protected requestWithRetry<T>(endpoint: string, options?: RequestInit, serviceURL?: string, retries?: number, requestOptions?: RequestOptions): Promise<T>;
|
|
27
|
-
/**
|
|
28
|
-
* Handle error responses from API
|
|
29
|
-
*/
|
|
30
|
-
protected handleErrorResponse(status: number, data: Record<string, unknown>): never;
|
|
31
|
-
/**
|
|
32
|
-
* Build query string from parameters
|
|
33
|
-
*/
|
|
34
|
-
protected buildQueryString(params: Record<string, unknown>): string;
|
|
35
|
-
/**
|
|
36
|
-
* Update client configuration
|
|
37
|
-
*/
|
|
38
|
-
updateConfig(config: Partial<BaseClientConfig>): void;
|
|
39
|
-
/**
|
|
40
|
-
* Get current configuration (readonly)
|
|
41
|
-
*/
|
|
42
|
-
getConfig(): Readonly<BaseClientConfig>;
|
|
43
|
-
/**
|
|
44
|
-
* Health check endpoint
|
|
45
|
-
*/
|
|
46
|
-
healthCheck(): Promise<{
|
|
47
|
-
status: string;
|
|
48
|
-
timestamp: string;
|
|
49
|
-
}>;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export { BaseClient as B };
|