@fincuratech/sikka-sdk-js 1.2.0 → 1.3.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,10 +1,19 @@
1
1
  import { getLogger } from './logger.js';
2
2
  const SIKKA_BASE_URL = 'https://api.sikkasoft.com';
3
+ const WRITEBACK_ID_PATTERN = /^Id:(\d+)$/u;
4
+ const parseWritebackId = (longMessage) => {
5
+ if (!longMessage) {
6
+ return null;
7
+ }
8
+ const match = WRITEBACK_ID_PATTERN.exec(longMessage);
9
+ return match?.[1] ?? null;
10
+ };
3
11
  export class SikkaClient {
4
12
  claimPayment = {
5
13
  post: async (request) => {
6
14
  const response = await this.post('/v4/claim_payment', request);
7
- return response;
15
+ const writebackId = parseWritebackId(response.long_message);
16
+ return { ...response, writeback_id: writebackId };
8
17
  },
9
18
  };
10
19
  claims = {
@@ -37,6 +46,16 @@ export class SikkaClient {
37
46
  return transactions.filter((txn) => txn.transaction_type === 'Procedure');
38
47
  },
39
48
  };
49
+ writebackStatus = {
50
+ get: async (id) => {
51
+ const response = await this.get('/v4/writeback_status', { id });
52
+ const item = response.items[0];
53
+ if (!item) {
54
+ throw new Error(`No writeback status found for id: ${id}`);
55
+ }
56
+ return item;
57
+ },
58
+ };
40
59
  baseUrl;
41
60
  credentials;
42
61
  refreshKey = null;
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAuBxC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAuBnD,MAAM,OAAO,WAAW;IAIN,YAAY,GAAG;QAuB7B,IAAI,EAAE,KAAK,EACT,OAAiC,EACG,EAAE;YACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAC9B,mBAAmB,EACnB,OAA6C,CAC9C,CAAC;YACF,OAAO,QAAQ,CAAC;QAClB,CAAC;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jB,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAsC,CAAC;IAC7D,CAAC;CACF;AAqBD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmC,EACnC,OAAgB,EACH,EAAE;IACf,OAAO,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["import { getLogger } from './logger.js';\nimport {\n type SikkaApiError,\n type SikkaClaim,\n type SikkaClaimListParams,\n type SikkaClaimListResponse,\n type SikkaClaimPaymentRequest,\n type SikkaClaimPaymentResponse,\n type SikkaClientConfig,\n type SikkaClientCredentials,\n type SikkaPatient,\n type SikkaPatientListParams,\n type SikkaPatientListResponse,\n type SikkaPaymentType,\n type SikkaPaymentTypeListParams,\n type SikkaPaymentTypeListResponse,\n type SikkaRequestKeyRequest,\n type SikkaRequestKeyResponse,\n type SikkaTransaction,\n type SikkaTransactionListParams,\n type SikkaTransactionListResponse,\n} from './types.js';\n\nconst SIKKA_BASE_URL = 'https://api.sikkasoft.com';\n\n/**\n * Sikka API Client\n *\n * Provides authenticated access to Sikka's ONE API for a specific practice/office.\n *\n * @example\n * ```typescript\n * const client = new SikkaClient({\n * credentials: {\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * },\n * });\n *\n * await client.authenticate();\n *\n * const patients = await client.patients.list({ firstname: 'John' });\n * ```\n */\nexport class SikkaClient {\n /**\n * Claim payment endpoints.\n */\n public readonly claimPayment = {\n /**\n * Post a payment to a claim.\n *\n * @param request - Payment details\n * @returns Payment response\n *\n * @example\n * ```typescript\n * const result = await client.claimPayment.post({\n * claim_sr_no: '123456',\n * practice_id: 'practice-id',\n * payment_amount: '100.00|50.00', // Pipe-delimited for multiple line items\n * transaction_sr_no: '789|790', // Corresponding transaction IDs\n * deductible: '0.00|0.00', // Required, use pipe-delimited if by procedure\n * write_off: '0.00|0.00',\n * claim_payment_date: '2024-01-15',\n * payment_mode: 'EFT',\n * is_payment_by_procedure_code: 'true',\n * note: 'Insurance payment',\n * });\n * ```\n */\n post: async (\n request: SikkaClaimPaymentRequest,\n ): Promise<SikkaClaimPaymentResponse> => {\n const response = await this.post<SikkaClaimPaymentResponse>(\n '/v4/claim_payment',\n request as unknown as Record<string, unknown>,\n );\n return response;\n },\n };\n\n /**\n * Claims management endpoints.\n */\n public readonly claims = {\n /**\n * List claims matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching claims\n *\n * @example\n * ```typescript\n * const claims = await client.claims.list({\n * patient_id: '12345',\n * status: 'Pending',\n * start_date: '2024-01-01',\n * end_date: '2024-12-31',\n * });\n * ```\n */\n list: async (params: SikkaClaimListParams): Promise<SikkaClaim[]> => {\n const response = await this.get<SikkaClaimListResponse>(\n '/v4/claims',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Patient management endpoints.\n */\n public readonly patients = {\n /**\n * List patients matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching patients\n *\n * @example\n * ```typescript\n * const patients = await client.patients.list({\n * firstname: 'John',\n * lastname: 'Doe',\n * });\n * ```\n */\n list: async (params: SikkaPatientListParams): Promise<SikkaPatient[]> => {\n const response = await this.get<SikkaPatientListResponse>(\n '/v4/patients',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Payment types management endpoints.\n * Payment types represent the different methods a practice accepts for payments.\n */\n public readonly paymentTypes = {\n /**\n * List payment types for the practice.\n *\n * @param params - Optional filter and pagination parameters\n * @returns List of payment types\n *\n * @example\n * ```typescript\n * // Get all payment types\n * const types = await client.paymentTypes.list();\n *\n * // Get only insurance payment types\n * const insuranceTypes = await client.paymentTypes.list({\n * is_insurance_type: true,\n * });\n * ```\n */\n list: async (\n params: SikkaPaymentTypeListParams = {},\n ): Promise<SikkaPaymentType[]> => {\n const response = await this.get<SikkaPaymentTypeListResponse>(\n '/v4/payment_types',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Transactions management endpoints.\n * Transactions include both procedures (service line items) and payments.\n */\n public readonly transactions = {\n /**\n * List transactions matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching transactions\n *\n * @example\n * ```typescript\n * const transactions = await client.transactions.list({\n * claim_sr_no: '123456',\n * });\n * ```\n */\n list: async (\n params: SikkaTransactionListParams,\n ): Promise<SikkaTransaction[]> => {\n const response = await this.get<SikkaTransactionListResponse>(\n '/v4/transactions',\n params,\n );\n return response.items;\n },\n\n /**\n * List only procedure transactions for a specific claim.\n *\n * @param claimSrNo - The claim serial number\n * @returns List of procedure transactions\n */\n listProcedures: async (claimSrNo: string): Promise<SikkaTransaction[]> => {\n const transactions = await this.transactions.list({\n claim_sr_no: claimSrNo,\n });\n return transactions.filter((txn) => txn.transaction_type === 'Procedure');\n },\n };\n\n private readonly baseUrl: string;\n\n private readonly credentials: SikkaClientCredentials;\n\n private refreshKey: string | null = null;\n\n private requestKey: string | null = null;\n\n private requestKeyExpiresAt: Date | null = null;\n\n constructor(config: SikkaClientConfig) {\n this.baseUrl = config.baseUrl ?? SIKKA_BASE_URL;\n this.credentials = config.credentials;\n }\n\n /**\n * Authenticate with the Sikka API.\n * Must be called before making any other API requests.\n * The request key is valid for 24 hours.\n */\n async authenticate(): Promise<void> {\n const log = getLogger();\n\n log.debug('Sikka API: Authenticating');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'request_key',\n office_id: this.credentials.officeId,\n secret_key: this.credentials.secretKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authenticated successfully', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n /**\n * Clear the current authentication state.\n */\n clearAuth(): void {\n this.requestKey = null;\n this.refreshKey = null;\n this.requestKeyExpiresAt = null;\n }\n\n /**\n * Ensure the client is authenticated, refreshing if necessary.\n * Automatically refreshes if token expires within 1 hour.\n */\n async ensureAuthenticated(): Promise<void> {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n const oneHourFromNow = new Date(Date.now() + 60 * 60 * 1_000);\n if (this.requestKeyExpiresAt && this.requestKeyExpiresAt < oneHourFromNow) {\n await this.refreshAuthentication();\n }\n }\n\n /**\n * Make an authenticated GET request to the Sikka API.\n */\n async get<T>(endpoint: string, params?: Record<string, unknown>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n log.debug('Sikka API GET request', { endpoint, params });\n\n const response = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'GET',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API GET ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const text = await response.text();\n if (!text || text.trim() === '') {\n return { items: [] } as T;\n }\n\n const data = JSON.parse(text) as T;\n\n log.debug('Sikka API GET response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Get the current request key.\n *\n * @throws Error if not authenticated\n */\n getRequestKey(): string {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n return this.requestKey;\n }\n\n // -------------------------------------------------------------------------\n // API Modules\n\n /**\n * Check if the client is currently authenticated with a valid token.\n */\n isAuthenticated(): boolean {\n if (!this.requestKey || !this.requestKeyExpiresAt) {\n return false;\n }\n\n return this.requestKeyExpiresAt > new Date();\n }\n\n /**\n * Make an authenticated POST request to the Sikka API.\n */\n async post<T>(endpoint: string, body: Record<string, unknown>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n log.debug('Sikka API POST request', { body, endpoint });\n\n const response = await fetch(url.toString(), {\n body: JSON.stringify(body),\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'POST',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API POST ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const data = (await response.json()) as T;\n\n log.debug('Sikka API POST response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Refresh the authentication token using the refresh key.\n * Called automatically when token is near expiration.\n */\n async refreshAuthentication(): Promise<void> {\n const log = getLogger();\n\n if (!this.refreshKey) {\n throw new Error('No refresh key available. Call authenticate() first.');\n }\n\n log.debug('Sikka API: Refreshing authentication');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'refresh_key',\n refresh_key: this.refreshKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authentication refreshed', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n private async requestNewKey(\n requestBody: SikkaRequestKeyRequest,\n ): Promise<SikkaRequestKeyResponse> {\n const response = await fetch(`${this.baseUrl}/v4/request_key`, {\n body: JSON.stringify(requestBody),\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n });\n\n if (!response.ok) {\n let errorMessage = `${response.status} ${response.statusText}`;\n try {\n const errorBody = (await response.json()) as SikkaApiError;\n errorMessage =\n errorBody.error_description ??\n errorBody.error ??\n errorBody.message ??\n errorMessage;\n } catch {\n // Ignore JSON parse errors\n }\n\n throw new Error(`Sikka authentication failed: ${errorMessage}`);\n }\n\n return response.json() as Promise<SikkaRequestKeyResponse>;\n }\n}\n\n/**\n * Create a new Sikka client instance.\n *\n * @param credentials - Office-level credentials\n * @param baseUrl - Optional base URL override\n * @returns A new SikkaClient instance\n *\n * @example\n * ```typescript\n * const client = createSikkaClient({\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * });\n *\n * await client.authenticate();\n * ```\n */\nexport const createSikkaClient = (\n credentials: SikkaClientCredentials,\n baseUrl?: string,\n): SikkaClient => {\n return new SikkaClient({ baseUrl, credentials });\n};\n"]}
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/lib/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA0BxC,MAAM,cAAc,GAAG,2BAA2B,CAAC;AAEnD,MAAM,oBAAoB,GAAG,aAAa,CAAC;AAM3C,MAAM,gBAAgB,GAAG,CAAC,WAA+B,EAAiB,EAAE;IAC1E,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM,KAAK,GAAG,oBAAoB,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;IACrD,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;AAC5B,CAAC,CAAC;AAuBF,MAAM,OAAO,WAAW;IAIN,YAAY,GAAG;QA+B7B,IAAI,EAAE,KAAK,EACT,OAAiC,EACC,EAAE;YACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,IAAI,CAC9B,mBAAmB,EACnB,OAA6C,CAC9C,CAAC;YACF,MAAM,WAAW,GAAG,gBAAgB,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;YAC5D,OAAO,EAAE,GAAG,QAAQ,EAAE,YAAY,EAA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AO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,IAAI,YAAY,GAAG,GAAG,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC;YAC/D,IAAI,CAAC;gBACH,MAAM,SAAS,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAkB,CAAC;gBAC3D,YAAY;oBACV,SAAS,CAAC,iBAAiB;wBAC3B,SAAS,CAAC,KAAK;wBACf,SAAS,CAAC,OAAO;wBACjB,YAAY,CAAC;YACjB,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;YAED,MAAM,IAAI,KAAK,CAAC,gCAAgC,YAAY,EAAE,CAAC,CAAC;QAClE,CAAC;QAED,OAAO,QAAQ,CAAC,IAAI,EAAsC,CAAC;IAC7D,CAAC;CACF;AAqBD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,WAAmC,EACnC,OAAgB,EACH,EAAE;IACf,OAAO,IAAI,WAAW,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,CAAC;AACnD,CAAC,CAAC","sourcesContent":["import { getLogger } from './logger.js';\nimport {\n type SikkaApiError,\n type SikkaClaim,\n type SikkaClaimListParams,\n type SikkaClaimListResponse,\n type SikkaClaimPaymentRequest,\n type SikkaClaimPaymentResponse,\n type SikkaClaimPaymentResult,\n type SikkaClientConfig,\n type SikkaClientCredentials,\n type SikkaPatient,\n type SikkaPatientListParams,\n type SikkaPatientListResponse,\n type SikkaPaymentType,\n type SikkaPaymentTypeListParams,\n type SikkaPaymentTypeListResponse,\n type SikkaRequestKeyRequest,\n type SikkaRequestKeyResponse,\n type SikkaTransaction,\n type SikkaTransactionListParams,\n type SikkaTransactionListResponse,\n type SikkaWritebackStatusItem,\n type SikkaWritebackStatusResponse,\n} from './types.js';\n\nconst SIKKA_BASE_URL = 'https://api.sikkasoft.com';\n\nconst WRITEBACK_ID_PATTERN = /^Id:(\\d+)$/u;\n\n/**\n * Extract the numeric writeback tracking ID from the long_message field.\n * Expected format: \"Id:3809955\"\n */\nconst parseWritebackId = (longMessage: string | undefined): string | null => {\n if (!longMessage) {\n return null;\n }\n\n const match = WRITEBACK_ID_PATTERN.exec(longMessage);\n return match?.[1] ?? null;\n};\n\n/**\n * Sikka API Client\n *\n * Provides authenticated access to Sikka's ONE API for a specific practice/office.\n *\n * @example\n * ```typescript\n * const client = new SikkaClient({\n * credentials: {\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * },\n * });\n *\n * await client.authenticate();\n *\n * const patients = await client.patients.list({ firstname: 'John' });\n * ```\n */\nexport class SikkaClient {\n /**\n * Claim payment endpoints.\n */\n public readonly claimPayment = {\n /**\n * Post a payment to a claim.\n *\n * The Sikka API accepts the request (201) but the actual PMS writeback\n * is asynchronous. The returned `writeback_id` can be used with\n * `writebackStatus.get()` to poll for completion.\n *\n * @param request - Payment details\n * @returns Payment response with parsed writeback tracking ID\n *\n * @example\n * ```typescript\n * const result = await client.claimPayment.post({\n * claim_sr_no: '123456',\n * practice_id: 'practice-id',\n * payment_amount: '100.00|50.00',\n * transaction_sr_no: '789|790',\n * deductible: '0.00|0.00',\n * write_off: '0.00|0.00',\n * claim_payment_date: '2024-01-15',\n * payment_mode: 'EFT',\n * is_payment_by_procedure_code: 'true',\n * note: 'Insurance payment',\n * });\n *\n * if (result.writeback_id) {\n * const status = await client.writebackStatus.get(result.writeback_id);\n * }\n * ```\n */\n post: async (\n request: SikkaClaimPaymentRequest,\n ): Promise<SikkaClaimPaymentResult> => {\n const response = await this.post<SikkaClaimPaymentResponse>(\n '/v4/claim_payment',\n request as unknown as Record<string, unknown>,\n );\n const writebackId = parseWritebackId(response.long_message);\n return { ...response, writeback_id: writebackId };\n },\n };\n\n /**\n * Claims management endpoints.\n */\n public readonly claims = {\n /**\n * List claims matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching claims\n *\n * @example\n * ```typescript\n * const claims = await client.claims.list({\n * patient_id: '12345',\n * status: 'Pending',\n * start_date: '2024-01-01',\n * end_date: '2024-12-31',\n * });\n * ```\n */\n list: async (params: SikkaClaimListParams): Promise<SikkaClaim[]> => {\n const response = await this.get<SikkaClaimListResponse>(\n '/v4/claims',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Patient management endpoints.\n */\n public readonly patients = {\n /**\n * List patients matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching patients\n *\n * @example\n * ```typescript\n * const patients = await client.patients.list({\n * firstname: 'John',\n * lastname: 'Doe',\n * });\n * ```\n */\n list: async (params: SikkaPatientListParams): Promise<SikkaPatient[]> => {\n const response = await this.get<SikkaPatientListResponse>(\n '/v4/patients',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Payment types management endpoints.\n * Payment types represent the different methods a practice accepts for payments.\n */\n public readonly paymentTypes = {\n /**\n * List payment types for the practice.\n *\n * @param params - Optional filter and pagination parameters\n * @returns List of payment types\n *\n * @example\n * ```typescript\n * // Get all payment types\n * const types = await client.paymentTypes.list();\n *\n * // Get only insurance payment types\n * const insuranceTypes = await client.paymentTypes.list({\n * is_insurance_type: true,\n * });\n * ```\n */\n list: async (\n params: SikkaPaymentTypeListParams = {},\n ): Promise<SikkaPaymentType[]> => {\n const response = await this.get<SikkaPaymentTypeListResponse>(\n '/v4/payment_types',\n params,\n );\n return response.items;\n },\n };\n\n /**\n * Transactions management endpoints.\n * Transactions include both procedures (service line items) and payments.\n */\n public readonly transactions = {\n /**\n * List transactions matching the given criteria.\n *\n * @param params - Search parameters\n * @returns List of matching transactions\n *\n * @example\n * ```typescript\n * const transactions = await client.transactions.list({\n * claim_sr_no: '123456',\n * });\n * ```\n */\n list: async (\n params: SikkaTransactionListParams,\n ): Promise<SikkaTransaction[]> => {\n const response = await this.get<SikkaTransactionListResponse>(\n '/v4/transactions',\n params,\n );\n return response.items;\n },\n\n /**\n * List only procedure transactions for a specific claim.\n *\n * @param claimSrNo - The claim serial number\n * @returns List of procedure transactions\n */\n listProcedures: async (claimSrNo: string): Promise<SikkaTransaction[]> => {\n const transactions = await this.transactions.list({\n claim_sr_no: claimSrNo,\n });\n return transactions.filter((txn) => txn.transaction_type === 'Procedure');\n },\n };\n\n /**\n * Writeback status endpoints.\n * Used to poll for the result of asynchronous PMS writeback operations\n * (e.g., after posting a claim payment).\n */\n public readonly writebackStatus = {\n /**\n * Get the status of a writeback operation.\n *\n * @param id - The writeback tracking ID (returned from claimPayment.post as writeback_id)\n * @returns The writeback status record\n *\n * @example\n * ```typescript\n * const result = await client.claimPayment.post({ ... });\n * if (result.writeback_id) {\n * const status = await client.writebackStatus.get(result.writeback_id);\n * console.log(status.status, status.is_completed);\n * }\n * ```\n */\n get: async (id: string): Promise<SikkaWritebackStatusItem> => {\n const response = await this.get<SikkaWritebackStatusResponse>(\n '/v4/writeback_status',\n { id },\n );\n const item = response.items[0];\n if (!item) {\n throw new Error(`No writeback status found for id: ${id}`);\n }\n\n return item;\n },\n };\n\n private readonly baseUrl: string;\n\n private readonly credentials: SikkaClientCredentials;\n\n private refreshKey: string | null = null;\n\n private requestKey: string | null = null;\n\n private requestKeyExpiresAt: Date | null = null;\n\n constructor(config: SikkaClientConfig) {\n this.baseUrl = config.baseUrl ?? SIKKA_BASE_URL;\n this.credentials = config.credentials;\n }\n\n /**\n * Authenticate with the Sikka API.\n * Must be called before making any other API requests.\n * The request key is valid for 24 hours.\n */\n async authenticate(): Promise<void> {\n const log = getLogger();\n\n log.debug('Sikka API: Authenticating');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'request_key',\n office_id: this.credentials.officeId,\n secret_key: this.credentials.secretKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authenticated successfully', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n /**\n * Clear the current authentication state.\n */\n clearAuth(): void {\n this.requestKey = null;\n this.refreshKey = null;\n this.requestKeyExpiresAt = null;\n }\n\n /**\n * Ensure the client is authenticated, refreshing if necessary.\n * Automatically refreshes if token expires within 1 hour.\n */\n async ensureAuthenticated(): Promise<void> {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n const oneHourFromNow = new Date(Date.now() + 60 * 60 * 1_000);\n if (this.requestKeyExpiresAt && this.requestKeyExpiresAt < oneHourFromNow) {\n await this.refreshAuthentication();\n }\n }\n\n /**\n * Make an authenticated GET request to the Sikka API.\n */\n async get<T>(endpoint: string, params?: Record<string, unknown>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n if (params) {\n for (const [key, value] of Object.entries(params)) {\n if (value !== null && value !== undefined) {\n url.searchParams.set(key, String(value));\n }\n }\n }\n\n log.debug('Sikka API GET request', { endpoint, params });\n\n const response = await fetch(url.toString(), {\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'GET',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API GET ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const text = await response.text();\n if (!text || text.trim() === '') {\n return { items: [] } as T;\n }\n\n const data = JSON.parse(text) as T;\n\n log.debug('Sikka API GET response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Get the current request key.\n *\n * @throws Error if not authenticated\n */\n getRequestKey(): string {\n if (!this.requestKey) {\n throw new Error('Not authenticated. Call authenticate() first.');\n }\n\n return this.requestKey;\n }\n\n // -------------------------------------------------------------------------\n // API Modules\n\n /**\n * Check if the client is currently authenticated with a valid token.\n */\n isAuthenticated(): boolean {\n if (!this.requestKey || !this.requestKeyExpiresAt) {\n return false;\n }\n\n return this.requestKeyExpiresAt > new Date();\n }\n\n /**\n * Make an authenticated POST request to the Sikka API.\n */\n async post<T>(endpoint: string, body: Record<string, unknown>): Promise<T> {\n const log = getLogger();\n\n await this.ensureAuthenticated();\n\n const requestKey = this.getRequestKey();\n const url = new URL(`${this.baseUrl}${endpoint}`);\n url.searchParams.set('request_key', requestKey);\n\n log.debug('Sikka API POST request', { body, endpoint });\n\n const response = await fetch(url.toString(), {\n body: JSON.stringify(body),\n headers: {\n 'Content-Type': 'application/json',\n 'Request-Key': requestKey,\n },\n method: 'POST',\n });\n\n if (!response.ok) {\n const errorBody = await response.text();\n throw new Error(\n `Sikka API POST ${endpoint} failed: ${response.status} ${response.statusText} - ${errorBody}`,\n );\n }\n\n const data = (await response.json()) as T;\n\n log.debug('Sikka API POST response', { endpoint, status: response.status });\n\n return data;\n }\n\n /**\n * Refresh the authentication token using the refresh key.\n * Called automatically when token is near expiration.\n */\n async refreshAuthentication(): Promise<void> {\n const log = getLogger();\n\n if (!this.refreshKey) {\n throw new Error('No refresh key available. Call authenticate() first.');\n }\n\n log.debug('Sikka API: Refreshing authentication');\n\n const requestBody: SikkaRequestKeyRequest = {\n app_id: this.credentials.appId,\n app_key: this.credentials.appKey,\n grant_type: 'refresh_key',\n refresh_key: this.refreshKey,\n };\n\n const response = await this.requestNewKey(requestBody);\n this.requestKey = response.request_key;\n this.refreshKey = response.refresh_key;\n this.requestKeyExpiresAt = new Date(response.end_time);\n\n log.debug('Sikka API: Authentication refreshed', {\n expiresAt: this.requestKeyExpiresAt.toISOString(),\n });\n }\n\n private async requestNewKey(\n requestBody: SikkaRequestKeyRequest,\n ): Promise<SikkaRequestKeyResponse> {\n const response = await fetch(`${this.baseUrl}/v4/request_key`, {\n body: JSON.stringify(requestBody),\n headers: { 'Content-Type': 'application/json' },\n method: 'POST',\n });\n\n if (!response.ok) {\n let errorMessage = `${response.status} ${response.statusText}`;\n try {\n const errorBody = (await response.json()) as SikkaApiError;\n errorMessage =\n errorBody.error_description ??\n errorBody.error ??\n errorBody.message ??\n errorMessage;\n } catch {\n // Ignore JSON parse errors\n }\n\n throw new Error(`Sikka authentication failed: ${errorMessage}`);\n }\n\n return response.json() as Promise<SikkaRequestKeyResponse>;\n }\n}\n\n/**\n * Create a new Sikka client instance.\n *\n * @param credentials - Office-level credentials\n * @param baseUrl - Optional base URL override\n * @returns A new SikkaClient instance\n *\n * @example\n * ```typescript\n * const client = createSikkaClient({\n * appId: 'your-app-id',\n * appKey: 'your-app-key',\n * officeId: 'practice-office-id',\n * secretKey: 'practice-secret-key',\n * });\n *\n * await client.authenticate();\n * ```\n */\nexport const createSikkaClient = (\n credentials: SikkaClientCredentials,\n baseUrl?: string,\n): SikkaClient => {\n return new SikkaClient({ baseUrl, credentials });\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Sikka SDK Types\n *\n * Types for interacting with the Sikka API (https://api.sikkasoft.com)\n */\n\n/**\n * Grant type for authentication\n */\nexport type SikkaGrantType = 'refresh_key' | 'request_key';\n\n/**\n * Request body for obtaining a request key\n */\nexport type SikkaRequestKeyRequest = {\n app_id: string;\n app_key: string;\n grant_type: SikkaGrantType;\n office_id?: string;\n refresh_key?: string;\n secret_key?: string;\n};\n\n/**\n * Response from the request_key endpoint\n */\nexport type SikkaRequestKeyResponse = {\n domain: string;\n end_time: string;\n expires_in: string;\n href: string;\n issued_to: string;\n refresh_key: string;\n request_count: string;\n request_key: string;\n scope: string;\n start_time: string;\n status: string;\n};\n\n/**\n * Sikka API error response\n */\nexport type SikkaApiError = {\n error?: string;\n error_description?: string;\n message?: string;\n};\n\n/**\n * An authorized practice from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPractice = {\n address: string;\n city: string;\n data_insert_date: string;\n data_synchronization_date: string;\n domain: string;\n email: string;\n href: string;\n office_id: string;\n practice_id: string;\n practice_management_system: string;\n practice_management_system_refresh_date: string;\n practice_management_system_version: string;\n practice_name: string;\n secret_key: string;\n state: string;\n zip: string;\n};\n\n/**\n * Response from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPracticesResponse = {\n execution_time: string;\n items: SikkaAuthorizedPractice[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n/**\n * App-level credentials (from env vars)\n */\nexport type SikkaAppCredentials = {\n appId: string;\n appKey: string;\n};\n\n/**\n * Credentials required to initialize the Sikka client for a specific office\n */\nexport type SikkaClientCredentials = {\n appId: string;\n appKey: string;\n officeId: string;\n secretKey: string;\n};\n\n/**\n * Configuration for the Sikka client\n */\nexport type SikkaClientConfig = {\n baseUrl?: string;\n credentials: SikkaClientCredentials;\n};\n\n// -----------------------------------------------------------------------------\n// Paginated Response Types\n\n/**\n * Generic paginated response from Sikka API\n */\nexport type SikkaPaginatedResponse<T> = {\n execution_time: string;\n items: T[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n// -----------------------------------------------------------------------------\n// Patient Types\n\n/**\n * Sikka patient record\n */\nexport type SikkaPatient = {\n address_line1: string;\n address_line2: string;\n appointment_href: string;\n birthdate: string;\n cell: string;\n city: string;\n created_date: string;\n email: string;\n fee_no: string;\n first_visit: string;\n firstname: string;\n guarantor_first_name: string;\n guarantor_href: string;\n guarantor_id: string;\n guarantor_last_name: string;\n href: string;\n last_visit: string;\n lastname: string;\n middlename: string;\n other_referral: string;\n patient_id: string;\n patient_referral: string;\n practice_href: string;\n practice_id: string;\n preferred_communication_method: string;\n preferred_contact: string;\n preferred_name: string;\n primary_insurance_company_href: string;\n primary_insurance_company_id: string;\n primary_medical_insurance: string;\n primary_medical_insurance_id: string;\n primary_medical_relationship: string;\n primary_medical_subscriber_id: string;\n primary_relationship: string;\n provider_href: string;\n provider_id: string;\n referred_out: string;\n salutation: string;\n state: string;\n status: string;\n subscriber_id: string;\n zipcode: string;\n};\n\n/**\n * Parameters for listing patients\n */\nexport type SikkaPatientListParams = {\n birthdate?: string;\n firstname?: string;\n lastname?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n};\n\n/**\n * Response from the patients endpoint\n */\nexport type SikkaPatientListResponse = SikkaPaginatedResponse<SikkaPatient>;\n\n// -----------------------------------------------------------------------------\n// Claim Types\n\n/**\n * Sikka claim record\n */\nexport type SikkaClaim = {\n bank_no: string;\n carrier_id: string;\n cheque_no: string;\n claim_channel: string;\n claim_description_href: string;\n claim_description_id: string;\n claim_payment_date: string;\n claim_sent_date: string;\n claim_sr_no: string;\n claim_status: string;\n creation_date: string;\n estimated_amount: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_company_href: string;\n insurance_company_id: string;\n insurance_company_name: string;\n note: string;\n on_hold_date: string;\n others: string;\n patient_href: string;\n patient_id: string;\n pay_to_provider: string;\n payer_id: string;\n payment_amount: string;\n practice_href: string;\n practice_id: string;\n preventive: string;\n primary_claim_id: string;\n primary_or_secondary: string;\n provider_href: string;\n provider_id: string;\n rendering_provider: string;\n resent_date: string;\n return_date: string;\n sent_claim_status: string;\n standard: string;\n total_billed_amount: string;\n total_paid_amount: string;\n tp: string;\n tracer: string;\n};\n\n/**\n * Parameters for listing claims\n */\nexport type SikkaClaimListParams = {\n claim_id?: string;\n end_date?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n start_date?: string;\n status?: string;\n};\n\n/**\n * Response from the claims endpoint\n */\nexport type SikkaClaimListResponse = SikkaPaginatedResponse<SikkaClaim>;\n\n// -----------------------------------------------------------------------------\n// Transaction Types\n\n/**\n * Transaction type in Sikka (Procedure = service line item, Payment = payment)\n */\nexport type SikkaTransactionType = 'Payment' | 'Procedure';\n\n/**\n * Sikka transaction record (represents both procedures and payments)\n */\nexport type SikkaTransaction = {\n amount: string;\n claim_href: string;\n claim_sr_no: string;\n created_by: string;\n cust_id: string;\n estimated_insurance_payment: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_payment: string;\n last_updated_by: string;\n note: string;\n patient_href: string;\n patient_id: string;\n payment_type: string;\n practice_href: string;\n practice_id: string;\n primary_insurance_estimate: string;\n procedure_code: string;\n procedure_description: string;\n provider_href: string;\n provider_id: string;\n quantity: string;\n rowhash: string;\n surface: string;\n tooth_from: string;\n tooth_to: string;\n transaction_date: string;\n transaction_entry_date: string;\n transaction_sr_no: string;\n transaction_type: SikkaTransactionType;\n};\n\n/**\n * Parameters for listing transactions\n */\nexport type SikkaTransactionListParams = {\n claim_sr_no?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n transaction_type?: SikkaTransactionType;\n};\n\n/**\n * Response from the transactions endpoint\n */\nexport type SikkaTransactionListResponse =\n SikkaPaginatedResponse<SikkaTransaction>;\n\n// -----------------------------------------------------------------------------\n// Claim Payment Types\n\n/**\n * Payment mode for posting payments\n */\nexport type SikkaPaymentMode = 'Cash' | 'Check' | 'EFT';\n\n/**\n * Request body for posting a claim payment.\n * Uses pipe-delimited values for line item amounts when is_payment_by_procedure_code=true.\n */\nexport type SikkaClaimPaymentRequest = {\n /**\n * The generic ID of the claim for which you want to post the payment.\n */\n claim_sr_no: string;\n\n /**\n * The unique identifier for the practice.\n */\n practice_id: string;\n\n /**\n * The total payment amount (format: xx.xx).\n * If is_payment_by_procedure_code=true, use pipe-delimited values (e.g., \"100.00|50.00\").\n */\n payment_amount: string;\n\n /**\n * Boolean flag indicating if the payment is allocated by procedure code.\n * For Tracker, value should be true only as PMS does not support without procedure code.\n */\n is_payment_by_procedure_code: 'false' | 'true';\n\n /**\n * The date of the payment (format: yyyy-MM-dd).\n */\n claim_payment_date: string;\n\n /**\n * The method of payment.\n * Get valid modes from payment_types API with is_insurance_type=true.\n */\n payment_mode: SikkaPaymentMode;\n\n /**\n * The deductible amount (format: xx.xx). Pass \"0\" if no amount.\n * PMS-specific formats:\n * - Dentrix Enterprise/G6: pipe-delimited \"standard|preventive|others\" (e.g., \"0|0|0\")\n * - Dentrix Ascend: pipe-delimited \"major|preventive|basic|ortho\" (e.g., \"0|0|0|0\")\n * - Tracker: Not supported\n */\n deductible: string;\n\n /**\n * The write-off amount (format: xx.xx). Pass \"0\" if no amount.\n * If is_payment_by_procedure_code=true, use pipe-delimited values.\n * - Dentrix Ascend: write_off not allowed for is_payment_by_procedure_code=false, pass \"0\"\n * - Tracker: Not supported\n */\n write_off: string;\n\n /**\n * The specific transaction ID(s) associated with the payment.\n * Required only if is_payment_by_procedure_code=true.\n * For multiple procedures, use pipe-delimited values (e.g., \"123|124|125\").\n */\n transaction_sr_no?: string;\n\n /**\n * Payment notes/remarks.\n * Should not contain special characters (<, >, &, ,).\n */\n note?: string;\n\n /**\n * The credit adjustment type ID.\n * Get from payment_types API with is_adjustment_type=true.\n * Supported only for Dentrix Enterprise, Dentrix Ascend, and Dentrix G6+.\n * Required if write_off value is negative in Dentrix Enterprise/Ascend.\n */\n adjustment_type?: string;\n\n /**\n * The provider ID for the credit adjustment.\n * Supported only for Dentrix G6+.\n * Must match count of write_off values (pipe-delimited).\n */\n credit_adjustment_provider?: string;\n\n /**\n * Boolean to trigger a debit adjustment write-back.\n * Not supported for Tracker.\n */\n is_debit_adjustment_writeback?: 'false' | 'true';\n\n /**\n * The amount for the debit adjustment (format: xx.xx).\n * Required only if performing debit adjustment write-back.\n * Must be positive (Dentrix G6+ allows 0).\n */\n debit_adjustment_amount?: string;\n\n /**\n * Date of the debit adjustment (format: yyyy-MM-dd).\n * Required for Open Dental PMS if performing debit adjustment write-back.\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_date?: string;\n\n /**\n * The debit adjustment type ID.\n * Get from payment_types API with is_debit_adjustment_type=true.\n * Required for Open Dental and Dentrix Ascend if performing debit adjustment write-back.\n */\n debit_adjustment_type?: string;\n\n /**\n * Notes for the debit adjustment.\n * Must not contain special characters (<, >, &, ,).\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_note?: string;\n\n /**\n * Boolean for procedure-level debit adjustments.\n * Supported for Open Dental only.\n * If true, debit_adjustment_amount, debit_adjustment_transaction_sr_no,\n * debit_adjustment_provider, and debit_adjustment_type must have matching counts (pipe-delimited).\n */\n is_debit_adjustment_by_procedure?: 'false' | 'true';\n\n /**\n * Transaction ID(s) for the debit adjustment.\n * Required if is_debit_adjustment_by_procedure=true.\n * Supported for Open Dental only.\n */\n debit_adjustment_transaction_sr_no?: string;\n\n /**\n * The provider ID for the debit adjustment.\n * Required for Open Dental if performing debit adjustment write-back.\n * For Dentrix G6+, must match count of debit_adjustment_amount (pipe-delimited).\n */\n debit_adjustment_provider?: string;\n\n /**\n * The cheque number.\n * Mandatory if payment mode is Cheque for Tracker.\n */\n cheque_no?: string;\n\n /**\n * The bank number.\n */\n bank_no?: string;\n\n /**\n * The name of the bank.\n * Mandatory for Tracker.\n * Get using writeback_details API with category=bank name and writeback_type=claim_payment.\n */\n bank_name?: string;\n\n /**\n * The direct deposit reference number.\n * Mandatory if payment mode is Direct Deposit for Tracker.\n */\n direct_deposit_number?: string;\n\n /**\n * The provider ID.\n * Get using providers API.\n * Supported only for Tracker and Dentrix PMS.\n */\n provider_id?: string;\n};\n\n/**\n * Response from posting a claim payment\n */\nexport type SikkaClaimPaymentResponse = {\n claim_sr_no: string;\n message: string;\n status: string;\n};\n\n// -----------------------------------------------------------------------------\n// Payment Type Types\n\n/**\n * Sikka payment type record\n */\nexport type SikkaPaymentType = {\n code: string;\n description: string;\n href: string;\n practice_href: string;\n practice_id: string;\n};\n\n/**\n * Parameters for listing payment types\n */\nexport type SikkaPaymentTypeListParams = {\n /**\n * Filter by payment type code in practice management system\n */\n code?: string;\n /**\n * Customer ID of office\n */\n customer_id?: string;\n /**\n * If true, returns Credit Adjustment Types only\n */\n is_adjustment_type?: boolean;\n /**\n * If true, returns Payment Types which require credit card details\n * for POST transaction (Planet DDS PMS only)\n */\n are_credit_card_details_required?: boolean;\n /**\n * If true, returns Debit Adjustment Types only\n */\n is_debit_adjustment_type?: boolean;\n /**\n * If true, returns Insurance Payment Types only\n */\n is_insurance_type?: boolean;\n /**\n * Results per page\n */\n limit?: number;\n /**\n * Pagination offset\n */\n offset?: number;\n /**\n * Practice ID of office\n */\n practice_id?: string;\n};\n\n/**\n * Response from the payment_types endpoint\n */\nexport type SikkaPaymentTypeListResponse =\n SikkaPaginatedResponse<SikkaPaymentType>;\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/lib/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Sikka SDK Types\n *\n * Types for interacting with the Sikka API (https://api.sikkasoft.com)\n */\n\n/**\n * Grant type for authentication\n */\nexport type SikkaGrantType = 'refresh_key' | 'request_key';\n\n/**\n * Request body for obtaining a request key\n */\nexport type SikkaRequestKeyRequest = {\n app_id: string;\n app_key: string;\n grant_type: SikkaGrantType;\n office_id?: string;\n refresh_key?: string;\n secret_key?: string;\n};\n\n/**\n * Response from the request_key endpoint\n */\nexport type SikkaRequestKeyResponse = {\n domain: string;\n end_time: string;\n expires_in: string;\n href: string;\n issued_to: string;\n refresh_key: string;\n request_count: string;\n request_key: string;\n scope: string;\n start_time: string;\n status: string;\n};\n\n/**\n * Sikka API error response\n */\nexport type SikkaApiError = {\n error?: string;\n error_description?: string;\n message?: string;\n};\n\n/**\n * An authorized practice from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPractice = {\n address: string;\n city: string;\n data_insert_date: string;\n data_synchronization_date: string;\n domain: string;\n email: string;\n href: string;\n office_id: string;\n practice_id: string;\n practice_management_system: string;\n practice_management_system_refresh_date: string;\n practice_management_system_version: string;\n practice_name: string;\n secret_key: string;\n state: string;\n zip: string;\n};\n\n/**\n * Response from the authorized_practices endpoint\n */\nexport type SikkaAuthorizedPracticesResponse = {\n execution_time: string;\n items: SikkaAuthorizedPractice[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n/**\n * App-level credentials (from env vars)\n */\nexport type SikkaAppCredentials = {\n appId: string;\n appKey: string;\n};\n\n/**\n * Credentials required to initialize the Sikka client for a specific office\n */\nexport type SikkaClientCredentials = {\n appId: string;\n appKey: string;\n officeId: string;\n secretKey: string;\n};\n\n/**\n * Configuration for the Sikka client\n */\nexport type SikkaClientConfig = {\n baseUrl?: string;\n credentials: SikkaClientCredentials;\n};\n\n// -----------------------------------------------------------------------------\n// Paginated Response Types\n\n/**\n * Generic paginated response from Sikka API\n */\nexport type SikkaPaginatedResponse<T> = {\n execution_time: string;\n items: T[];\n limit: string;\n offset: string;\n pagination: {\n current: string;\n first: string;\n last: string;\n next: string;\n previous: string;\n };\n total_count: string;\n};\n\n// -----------------------------------------------------------------------------\n// Patient Types\n\n/**\n * Sikka patient record\n */\nexport type SikkaPatient = {\n address_line1: string;\n address_line2: string;\n appointment_href: string;\n birthdate: string;\n cell: string;\n city: string;\n created_date: string;\n email: string;\n fee_no: string;\n first_visit: string;\n firstname: string;\n guarantor_first_name: string;\n guarantor_href: string;\n guarantor_id: string;\n guarantor_last_name: string;\n href: string;\n last_visit: string;\n lastname: string;\n middlename: string;\n other_referral: string;\n patient_id: string;\n patient_referral: string;\n practice_href: string;\n practice_id: string;\n preferred_communication_method: string;\n preferred_contact: string;\n preferred_name: string;\n primary_insurance_company_href: string;\n primary_insurance_company_id: string;\n primary_medical_insurance: string;\n primary_medical_insurance_id: string;\n primary_medical_relationship: string;\n primary_medical_subscriber_id: string;\n primary_relationship: string;\n provider_href: string;\n provider_id: string;\n referred_out: string;\n salutation: string;\n state: string;\n status: string;\n subscriber_id: string;\n zipcode: string;\n};\n\n/**\n * Parameters for listing patients\n */\nexport type SikkaPatientListParams = {\n birthdate?: string;\n firstname?: string;\n lastname?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n};\n\n/**\n * Response from the patients endpoint\n */\nexport type SikkaPatientListResponse = SikkaPaginatedResponse<SikkaPatient>;\n\n// -----------------------------------------------------------------------------\n// Claim Types\n\n/**\n * Sikka claim record\n */\nexport type SikkaClaim = {\n bank_no: string;\n carrier_id: string;\n cheque_no: string;\n claim_channel: string;\n claim_description_href: string;\n claim_description_id: string;\n claim_payment_date: string;\n claim_sent_date: string;\n claim_sr_no: string;\n claim_status: string;\n creation_date: string;\n estimated_amount: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_company_href: string;\n insurance_company_id: string;\n insurance_company_name: string;\n note: string;\n on_hold_date: string;\n others: string;\n patient_href: string;\n patient_id: string;\n pay_to_provider: string;\n payer_id: string;\n payment_amount: string;\n practice_href: string;\n practice_id: string;\n preventive: string;\n primary_claim_id: string;\n primary_or_secondary: string;\n provider_href: string;\n provider_id: string;\n rendering_provider: string;\n resent_date: string;\n return_date: string;\n sent_claim_status: string;\n standard: string;\n total_billed_amount: string;\n total_paid_amount: string;\n tp: string;\n tracer: string;\n};\n\n/**\n * Parameters for listing claims\n */\nexport type SikkaClaimListParams = {\n claim_id?: string;\n end_date?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n start_date?: string;\n status?: string;\n};\n\n/**\n * Response from the claims endpoint\n */\nexport type SikkaClaimListResponse = SikkaPaginatedResponse<SikkaClaim>;\n\n// -----------------------------------------------------------------------------\n// Transaction Types\n\n/**\n * Transaction type in Sikka (Procedure = service line item, Payment = payment)\n */\nexport type SikkaTransactionType = 'Payment' | 'Procedure';\n\n/**\n * Sikka transaction record (represents both procedures and payments)\n */\nexport type SikkaTransaction = {\n amount: string;\n claim_href: string;\n claim_sr_no: string;\n created_by: string;\n cust_id: string;\n estimated_insurance_payment: string;\n guarantor_href: string;\n guarantor_id: string;\n href: string;\n insurance_payment: string;\n last_updated_by: string;\n note: string;\n patient_href: string;\n patient_id: string;\n payment_type: string;\n practice_href: string;\n practice_id: string;\n primary_insurance_estimate: string;\n procedure_code: string;\n procedure_description: string;\n provider_href: string;\n provider_id: string;\n quantity: string;\n rowhash: string;\n surface: string;\n tooth_from: string;\n tooth_to: string;\n transaction_date: string;\n transaction_entry_date: string;\n transaction_sr_no: string;\n transaction_type: SikkaTransactionType;\n};\n\n/**\n * Parameters for listing transactions\n */\nexport type SikkaTransactionListParams = {\n claim_sr_no?: string;\n limit?: number;\n offset?: number;\n patient_id?: string;\n transaction_type?: SikkaTransactionType;\n};\n\n/**\n * Response from the transactions endpoint\n */\nexport type SikkaTransactionListResponse =\n SikkaPaginatedResponse<SikkaTransaction>;\n\n// -----------------------------------------------------------------------------\n// Claim Payment Types\n\n/**\n * Payment mode for posting payments\n */\nexport type SikkaPaymentMode = 'Cash' | 'Check' | 'EFT';\n\n/**\n * Request body for posting a claim payment.\n * Uses pipe-delimited values for line item amounts when is_payment_by_procedure_code=true.\n */\nexport type SikkaClaimPaymentRequest = {\n /**\n * The generic ID of the claim for which you want to post the payment.\n */\n claim_sr_no: string;\n\n /**\n * The unique identifier for the practice.\n */\n practice_id: string;\n\n /**\n * The total payment amount (format: xx.xx).\n * If is_payment_by_procedure_code=true, use pipe-delimited values (e.g., \"100.00|50.00\").\n */\n payment_amount: string;\n\n /**\n * Boolean flag indicating if the payment is allocated by procedure code.\n * For Tracker, value should be true only as PMS does not support without procedure code.\n */\n is_payment_by_procedure_code: 'false' | 'true';\n\n /**\n * The date of the payment (format: yyyy-MM-dd).\n */\n claim_payment_date: string;\n\n /**\n * The method of payment.\n * Get valid modes from payment_types API with is_insurance_type=true.\n */\n payment_mode: SikkaPaymentMode;\n\n /**\n * The deductible amount (format: xx.xx). Pass \"0\" if no amount.\n * PMS-specific formats:\n * - Dentrix Enterprise/G6: pipe-delimited \"standard|preventive|others\" (e.g., \"0|0|0\")\n * - Dentrix Ascend: pipe-delimited \"major|preventive|basic|ortho\" (e.g., \"0|0|0|0\")\n * - Tracker: Not supported\n */\n deductible: string;\n\n /**\n * The write-off amount (format: xx.xx). Pass \"0\" if no amount.\n * If is_payment_by_procedure_code=true, use pipe-delimited values.\n * - Dentrix Ascend: write_off not allowed for is_payment_by_procedure_code=false, pass \"0\"\n * - Tracker: Not supported\n */\n write_off: string;\n\n /**\n * The specific transaction ID(s) associated with the payment.\n * Required only if is_payment_by_procedure_code=true.\n * For multiple procedures, use pipe-delimited values (e.g., \"123|124|125\").\n */\n transaction_sr_no?: string;\n\n /**\n * Payment notes/remarks.\n * Should not contain special characters (<, >, &, ,).\n */\n note?: string;\n\n /**\n * The credit adjustment type ID.\n * Get from payment_types API with is_adjustment_type=true.\n * Supported only for Dentrix Enterprise, Dentrix Ascend, and Dentrix G6+.\n * Required if write_off value is negative in Dentrix Enterprise/Ascend.\n */\n adjustment_type?: string;\n\n /**\n * The provider ID for the credit adjustment.\n * Supported only for Dentrix G6+.\n * Must match count of write_off values (pipe-delimited).\n */\n credit_adjustment_provider?: string;\n\n /**\n * Boolean to trigger a debit adjustment write-back.\n * Not supported for Tracker.\n */\n is_debit_adjustment_writeback?: 'false' | 'true';\n\n /**\n * The amount for the debit adjustment (format: xx.xx).\n * Required only if performing debit adjustment write-back.\n * Must be positive (Dentrix G6+ allows 0).\n */\n debit_adjustment_amount?: string;\n\n /**\n * Date of the debit adjustment (format: yyyy-MM-dd).\n * Required for Open Dental PMS if performing debit adjustment write-back.\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_date?: string;\n\n /**\n * The debit adjustment type ID.\n * Get from payment_types API with is_debit_adjustment_type=true.\n * Required for Open Dental and Dentrix Ascend if performing debit adjustment write-back.\n */\n debit_adjustment_type?: string;\n\n /**\n * Notes for the debit adjustment.\n * Must not contain special characters (<, >, &, ,).\n * Not supported for Dentrix Ascend.\n */\n debit_adjustment_note?: string;\n\n /**\n * Boolean for procedure-level debit adjustments.\n * Supported for Open Dental only.\n * If true, debit_adjustment_amount, debit_adjustment_transaction_sr_no,\n * debit_adjustment_provider, and debit_adjustment_type must have matching counts (pipe-delimited).\n */\n is_debit_adjustment_by_procedure?: 'false' | 'true';\n\n /**\n * Transaction ID(s) for the debit adjustment.\n * Required if is_debit_adjustment_by_procedure=true.\n * Supported for Open Dental only.\n */\n debit_adjustment_transaction_sr_no?: string;\n\n /**\n * The provider ID for the debit adjustment.\n * Required for Open Dental if performing debit adjustment write-back.\n * For Dentrix G6+, must match count of debit_adjustment_amount (pipe-delimited).\n */\n debit_adjustment_provider?: string;\n\n /**\n * The cheque number.\n * Mandatory if payment mode is Cheque for Tracker.\n */\n cheque_no?: string;\n\n /**\n * The bank number.\n */\n bank_no?: string;\n\n /**\n * The name of the bank.\n * Mandatory for Tracker.\n * Get using writeback_details API with category=bank name and writeback_type=claim_payment.\n */\n bank_name?: string;\n\n /**\n * The direct deposit reference number.\n * Mandatory if payment mode is Direct Deposit for Tracker.\n */\n direct_deposit_number?: string;\n\n /**\n * The provider ID.\n * Get using providers API.\n * Supported only for Tracker and Dentrix PMS.\n */\n provider_id?: string;\n};\n\n/**\n * Raw API response from posting a claim payment.\n * The Sikka API returns a 201 with writeback tracking fields rather than\n * the final PMS result, since the actual writeback is asynchronous.\n */\nexport type SikkaClaimPaymentResponse = {\n error_code: string;\n http_code: string;\n http_code_desc: string;\n long_message: string;\n more_information: string;\n short_message: string;\n};\n\n/**\n * Enriched result from claimPayment.post() that includes\n * the parsed writeback tracking ID extracted from long_message.\n */\nexport type SikkaClaimPaymentResult = SikkaClaimPaymentResponse & {\n writeback_id: string | null;\n};\n\n// -----------------------------------------------------------------------------\n// Writeback Status Types\n\n/**\n * A single writeback status record returned by the writeback_status endpoint.\n * Represents the state of an asynchronous PMS writeback operation.\n */\nexport type SikkaWritebackStatusItem = {\n completed_time: string;\n current_status: string;\n has_error: string;\n id: string;\n is_completed: string;\n request_time: string;\n result: string;\n status: string;\n};\n\n/**\n * Response from GET /v4/writeback_status\n */\nexport type SikkaWritebackStatusResponse = {\n items: SikkaWritebackStatusItem[];\n};\n\n// -----------------------------------------------------------------------------\n// Payment Type Types\n\n/**\n * Sikka payment type record\n */\nexport type SikkaPaymentType = {\n code: string;\n description: string;\n href: string;\n practice_href: string;\n practice_id: string;\n};\n\n/**\n * Parameters for listing payment types\n */\nexport type SikkaPaymentTypeListParams = {\n /**\n * Filter by payment type code in practice management system\n */\n code?: string;\n /**\n * Customer ID of office\n */\n customer_id?: string;\n /**\n * If true, returns Credit Adjustment Types only\n */\n is_adjustment_type?: boolean;\n /**\n * If true, returns Payment Types which require credit card details\n * for POST transaction (Planet DDS PMS only)\n */\n are_credit_card_details_required?: boolean;\n /**\n * If true, returns Debit Adjustment Types only\n */\n is_debit_adjustment_type?: boolean;\n /**\n * If true, returns Insurance Payment Types only\n */\n is_insurance_type?: boolean;\n /**\n * Results per page\n */\n limit?: number;\n /**\n * Pagination offset\n */\n offset?: number;\n /**\n * Practice ID of office\n */\n practice_id?: string;\n};\n\n/**\n * Response from the payment_types endpoint\n */\nexport type SikkaPaymentTypeListResponse =\n SikkaPaginatedResponse<SikkaPaymentType>;\n"]}
@@ -1,7 +1,7 @@
1
- import { type SikkaClaim, type SikkaClaimListParams, type SikkaClaimPaymentRequest, type SikkaClaimPaymentResponse, type SikkaClientConfig, type SikkaClientCredentials, type SikkaPatient, type SikkaPatientListParams, type SikkaPaymentType, type SikkaPaymentTypeListParams, type SikkaTransaction, type SikkaTransactionListParams } from './types.js';
1
+ import { type SikkaClaim, type SikkaClaimListParams, type SikkaClaimPaymentRequest, type SikkaClaimPaymentResult, type SikkaClientConfig, type SikkaClientCredentials, type SikkaPatient, type SikkaPatientListParams, type SikkaPaymentType, type SikkaPaymentTypeListParams, type SikkaTransaction, type SikkaTransactionListParams, type SikkaWritebackStatusItem } from './types.js';
2
2
  export declare class SikkaClient {
3
3
  readonly claimPayment: {
4
- post: (request: SikkaClaimPaymentRequest) => Promise<SikkaClaimPaymentResponse>;
4
+ post: (request: SikkaClaimPaymentRequest) => Promise<SikkaClaimPaymentResult>;
5
5
  };
6
6
  readonly claims: {
7
7
  list: (params: SikkaClaimListParams) => Promise<SikkaClaim[]>;
@@ -16,6 +16,9 @@ export declare class SikkaClient {
16
16
  list: (params: SikkaTransactionListParams) => Promise<SikkaTransaction[]>;
17
17
  listProcedures: (claimSrNo: string) => Promise<SikkaTransaction[]>;
18
18
  };
19
+ readonly writebackStatus: {
20
+ get: (id: string) => Promise<SikkaWritebackStatusItem>;
21
+ };
19
22
  private readonly baseUrl;
20
23
  private readonly credentials;
21
24
  private refreshKey;
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/lib/client.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAEzB,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAE3B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAI/B,KAAK,gBAAgB,EACrB,KAAK,0BAA0B,EAEhC,MAAM,YAAY,CAAC;AAyBpB,qBAAa,WAAW;IAItB,SAAgB,YAAY;wBAwBf,wBAAwB,KAChC,OAAO,CAAC,yBAAyB,CAAC;MAOrC;IAKF,SAAgB,MAAM;uBAiBC,oBAAoB,KAAG,OAAO,CAAC,UAAU,EAAE,CAAC;MAOjE;IAKF,SAAgB,QAAQ;uBAeD,sBAAsB,KAAG,OAAO,CAAC,YAAY,EAAE,CAAC;MAOrE;IAMF,SAAgB,YAAY;wBAmBhB,0BAA0B,KACjC,OAAO,CAAC,gBAAgB,EAAE,CAAC;MAO9B;IAMF,SAAgB,YAAY;uBAehB,0BAA0B,KACjC,OAAO,CAAC,gBAAgB,EAAE,CAAC;oCAcI,MAAM,KAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;MAMtE;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAyB;IAErD,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO,CAAC,UAAU,CAAuB;IAEzC,OAAO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aClaimPaymentResponse = {
266
- claim_sr_no: string;
267
- message: string;
266
+ error_code: string;
267
+ http_code: string;
268
+ http_code_desc: string;
269
+ long_message: string;
270
+ more_information: string;
271
+ short_message: string;
272
+ };
273
+ export type SikkaClaimPaymentResult = SikkaClaimPaymentResponse & {
274
+ writeback_id: string | null;
275
+ };
276
+ export type SikkaWritebackStatusItem = {
277
+ completed_time: string;
278
+ current_status: string;
279
+ has_error: string;
280
+ id: string;
281
+ is_completed: string;
282
+ request_time: string;
283
+ result: string;
268
284
  status: string;
269
285
  };
286
+ export type SikkaWritebackStatusResponse = {
287
+ items: SikkaWritebackStatusItem[];
288
+ };
270
289
  export type SikkaPaymentType = {
271
290
  code: string;
272
291
  description: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,aAAa,CAAC;AAK3D,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,cAAc,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAKF,MAAM,MAAM,uBAAuB,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAKF,MAAM,MAAM,aAAa,GAAG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