@inkress/admin-sdk 1.0.0 → 1.1.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.
Files changed (67) hide show
  1. package/CHANGELOG.md +213 -0
  2. package/README.md +1174 -87
  3. package/dist/client.d.ts +3 -3
  4. package/dist/client.d.ts.map +1 -1
  5. package/dist/data-mappings.d.ts +177 -0
  6. package/dist/data-mappings.d.ts.map +1 -0
  7. package/dist/index.d.ts +34 -4
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.esm.js +4166 -154
  10. package/dist/index.esm.js.map +1 -1
  11. package/dist/index.js +4203 -153
  12. package/dist/index.js.map +1 -1
  13. package/dist/resources/addresses.d.ts +58 -0
  14. package/dist/resources/addresses.d.ts.map +1 -0
  15. package/dist/resources/billing-plans.d.ts +32 -15
  16. package/dist/resources/billing-plans.d.ts.map +1 -1
  17. package/dist/resources/categories.d.ts +30 -20
  18. package/dist/resources/categories.d.ts.map +1 -1
  19. package/dist/resources/currencies.d.ts +41 -0
  20. package/dist/resources/currencies.d.ts.map +1 -0
  21. package/dist/resources/exchange-rates.d.ts +50 -0
  22. package/dist/resources/exchange-rates.d.ts.map +1 -0
  23. package/dist/resources/fees.d.ts +58 -0
  24. package/dist/resources/fees.d.ts.map +1 -0
  25. package/dist/resources/financial-accounts.d.ts +47 -0
  26. package/dist/resources/financial-accounts.d.ts.map +1 -0
  27. package/dist/resources/financial-requests.d.ts +51 -0
  28. package/dist/resources/financial-requests.d.ts.map +1 -0
  29. package/dist/resources/generics.d.ts +57 -0
  30. package/dist/resources/generics.d.ts.map +1 -0
  31. package/dist/resources/kyc.d.ts +118 -0
  32. package/dist/resources/kyc.d.ts.map +1 -0
  33. package/dist/resources/merchants.d.ts +52 -15
  34. package/dist/resources/merchants.d.ts.map +1 -1
  35. package/dist/resources/orders.d.ts +74 -2
  36. package/dist/resources/orders.d.ts.map +1 -1
  37. package/dist/resources/payment-links.d.ts +65 -0
  38. package/dist/resources/payment-links.d.ts.map +1 -0
  39. package/dist/resources/payment-methods.d.ts +48 -0
  40. package/dist/resources/payment-methods.d.ts.map +1 -0
  41. package/dist/resources/products.d.ts +62 -16
  42. package/dist/resources/products.d.ts.map +1 -1
  43. package/dist/resources/public.d.ts +27 -7
  44. package/dist/resources/public.d.ts.map +1 -1
  45. package/dist/resources/subscriptions.d.ts +86 -20
  46. package/dist/resources/subscriptions.d.ts.map +1 -1
  47. package/dist/resources/tokens.d.ts +62 -0
  48. package/dist/resources/tokens.d.ts.map +1 -0
  49. package/dist/resources/transaction-entries.d.ts +48 -0
  50. package/dist/resources/transaction-entries.d.ts.map +1 -0
  51. package/dist/resources/users.d.ts +43 -21
  52. package/dist/resources/users.d.ts.map +1 -1
  53. package/dist/resources/webhook-urls.d.ts +49 -0
  54. package/dist/resources/webhook-urls.d.ts.map +1 -0
  55. package/dist/types/resources.d.ts +1294 -0
  56. package/dist/types/resources.d.ts.map +1 -0
  57. package/dist/types.d.ts +1069 -197
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/utils/query-builders.d.ts +518 -0
  60. package/dist/utils/query-builders.d.ts.map +1 -0
  61. package/dist/utils/query-transformer.d.ts +123 -0
  62. package/dist/utils/query-transformer.d.ts.map +1 -0
  63. package/dist/utils/translators.d.ts +126 -0
  64. package/dist/utils/translators.d.ts.map +1 -0
  65. package/dist/utils/webhooks.d.ts +19 -4
  66. package/dist/utils/webhooks.d.ts.map +1 -1
  67. package/package.json +14 -4
@@ -0,0 +1,58 @@
1
+ import { HttpClient } from '../client';
2
+ import { Fee, CreateFeeData, UpdateFeeData, ApiResponse } from '../types';
3
+ import { FeeQueryBuilder } from '../utils/query-builders';
4
+ import { FeeFilterParams, FeeQueryParams, FeeListResponse } from '../types/resources';
5
+ export declare class FeesResource {
6
+ private client;
7
+ constructor(client: HttpClient);
8
+ /**
9
+ * Convert filter parameters (strings to integers where needed)
10
+ */
11
+ private translateFilters;
12
+ /**
13
+ * Convert user-facing data to internal format
14
+ */
15
+ private translateToInternal;
16
+ /**
17
+ * List fees with filtering
18
+ */
19
+ list(params?: FeeFilterParams): Promise<ApiResponse<FeeListResponse>>;
20
+ /**
21
+ * Get fee by ID
22
+ */
23
+ get(id: number): Promise<ApiResponse<Fee>>;
24
+ /**
25
+ * Create a new fee
26
+ */
27
+ create(data: CreateFeeData): Promise<ApiResponse<Fee>>;
28
+ /**
29
+ * Update a fee
30
+ */
31
+ update(id: number, data: UpdateFeeData): Promise<ApiResponse<Fee>>;
32
+ /**
33
+ * Delete a fee
34
+ */
35
+ delete(id: number): Promise<ApiResponse<void>>;
36
+ /**
37
+ * Advanced query interface with full type safety
38
+ *
39
+ * @example
40
+ * const fees = await sdk.fees.query({
41
+ * kind: [1, 2],
42
+ * total: { gte: 100 },
43
+ * currency_code: 'USD'
44
+ * });
45
+ */
46
+ query(params: FeeQueryParams): Promise<ApiResponse<FeeListResponse>>;
47
+ /**
48
+ * Create a fluent query builder for fees
49
+ *
50
+ * @example
51
+ * const fees = await sdk.fees.createQueryBuilder()
52
+ * .whereKindIn([1, 2])
53
+ * .whereTotalGreaterThan(100)
54
+ * .execute();
55
+ */
56
+ createQueryBuilder(): FeeQueryBuilder;
57
+ }
58
+ //# sourceMappingURL=fees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fees.d.ts","sourceRoot":"","sources":["../../src/resources/fees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,GAAG,EACH,aAAa,EACb,aAAa,EACb,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EAEhB,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,YAAY;IACX,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAK3E;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAIhD;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAK5D;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAKxE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAIpD;;;;;;;;;OASG;IACG,KAAK,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC;IAK1E;;;;;;;;OAQG;IACH,kBAAkB,IAAI,eAAe;CAGtC"}
@@ -0,0 +1,47 @@
1
+ import { HttpClient } from '../client';
2
+ import { FinancialAccount, CreateFinancialAccountData, UpdateFinancialAccountData, ApiResponse } from '../types';
3
+ import { FinancialAccountQueryBuilder } from '../utils/query-builders';
4
+ import { FinancialAccountFilterParams, FinancialAccountQueryParams, FinancialAccountListResponse } from '../types/resources';
5
+ export declare class FinancialAccountsResource {
6
+ private client;
7
+ constructor(client: HttpClient);
8
+ /**
9
+ * List financial accounts with filtering
10
+ */
11
+ list(params?: FinancialAccountFilterParams): Promise<ApiResponse<FinancialAccountListResponse>>;
12
+ /**
13
+ * Get financial account by ID
14
+ */
15
+ get(id: number): Promise<ApiResponse<FinancialAccount>>;
16
+ /**
17
+ * Create a new financial account
18
+ */
19
+ create(data: CreateFinancialAccountData): Promise<ApiResponse<FinancialAccount>>;
20
+ /**
21
+ * Update a financial account
22
+ */
23
+ update(id: number, data: UpdateFinancialAccountData): Promise<ApiResponse<FinancialAccount>>;
24
+ /**
25
+ * Advanced query interface with full type safety
26
+ *
27
+ * @example
28
+ * const accounts = await sdk.financialAccounts.query({
29
+ * type: 'bank',
30
+ * active: true,
31
+ * provider: { contains: 'stripe' }
32
+ * });
33
+ */
34
+ query(params: FinancialAccountQueryParams): Promise<ApiResponse<FinancialAccountListResponse>>;
35
+ /**
36
+ * Create a fluent query builder for financial accounts
37
+ *
38
+ * @example
39
+ * const accounts = await sdk.financialAccounts.createQueryBuilder()
40
+ * .whereTypeEquals('bank')
41
+ * .whereActiveEquals(true)
42
+ * .orderBy('inserted_at', 'desc')
43
+ * .execute();
44
+ */
45
+ createQueryBuilder(): FinancialAccountQueryBuilder;
46
+ }
47
+ //# sourceMappingURL=financial-accounts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial-accounts.d.ts","sourceRoot":"","sources":["../../src/resources/financial-accounts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAC1B,0BAA0B,EAC1B,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAE7B,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,yBAAyB;IACxB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAIrG;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAI7D;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAItF;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAIlG;;;;;;;;;OASG;IACG,KAAK,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAKpG;;;;;;;;;OASG;IACH,kBAAkB,IAAI,4BAA4B;CAGnD"}
@@ -0,0 +1,51 @@
1
+ import { HttpClient } from '../client';
2
+ import { FinancialRequest, CreateFinancialRequestData, ApiResponse } from '../types';
3
+ import { FinancialRequestQueryBuilder } from '../utils/query-builders';
4
+ import { FinancialRequestFilterParams, FinancialRequestQueryParams, FinancialRequestListResponse } from '../types/resources';
5
+ export declare class FinancialRequestsResource {
6
+ private client;
7
+ constructor(client: HttpClient);
8
+ /**
9
+ * Convert filter parameters (strings to integers where needed)
10
+ */
11
+ private translateFilters;
12
+ /**
13
+ * Convert user-facing data to internal format
14
+ */
15
+ private translateToInternal;
16
+ /**
17
+ * List financial requests with filtering
18
+ */
19
+ list(params?: FinancialRequestFilterParams): Promise<ApiResponse<FinancialRequestListResponse>>;
20
+ /**
21
+ * Get financial request by ID
22
+ */
23
+ get(id: number): Promise<ApiResponse<FinancialRequest>>;
24
+ /**
25
+ * Create a new financial request
26
+ */
27
+ create(data: CreateFinancialRequestData): Promise<ApiResponse<FinancialRequest>>;
28
+ /**
29
+ * Advanced query interface with full type safety
30
+ *
31
+ * @example
32
+ * const requests = await sdk.financialRequests.query({
33
+ * status: [1, 2],
34
+ * total: { gte: 5000 },
35
+ * merchant_id: 123
36
+ * });
37
+ */
38
+ query(params: FinancialRequestQueryParams): Promise<ApiResponse<FinancialRequestListResponse>>;
39
+ /**
40
+ * Create a fluent query builder for financial requests
41
+ *
42
+ * @example
43
+ * const requests = await sdk.financialRequests.createQueryBuilder()
44
+ * .whereStatusIn([1, 2])
45
+ * .whereTotalGreaterThan(5000)
46
+ * .orderBy('inserted_at', 'desc')
47
+ * .execute();
48
+ */
49
+ createQueryBuilder(): FinancialRequestQueryBuilder;
50
+ }
51
+ //# sourceMappingURL=financial-requests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"financial-requests.d.ts","sourceRoot":"","sources":["../../src/resources/financial-requests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,0BAA0B,EAE1B,WAAW,EACZ,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,4BAA4B,EAE7B,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,yBAAyB;IACxB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,4BAA4B,GAAG,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAKrG;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAI7D;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAKtF;;;;;;;;;OASG;IACG,KAAK,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,WAAW,CAAC,4BAA4B,CAAC,CAAC;IAKpG;;;;;;;;;OASG;IACH,kBAAkB,IAAI,4BAA4B;CAGnD"}
@@ -0,0 +1,57 @@
1
+ import { HttpClient } from '../client';
2
+ import { ApiResponse, GenericResource } from '../types';
3
+ /**
4
+ * Generic resource handler for any endpoint
5
+ * Provides CRUD operations for resources not yet implemented with specific types
6
+ */
7
+ export declare class GenericsResource {
8
+ private client;
9
+ constructor(client: HttpClient);
10
+ /**
11
+ * List resources from a generic endpoint
12
+ *
13
+ * @example
14
+ * const data = await sdk.generics.list('/subscription_periods', { status: 1 });
15
+ */
16
+ list(endpoint: string, params?: Record<string, any>): Promise<ApiResponse<GenericResource[]>>;
17
+ /**
18
+ * Query resources from a generic endpoint with advanced filtering
19
+ * Supports all query system features (ranges, arrays, date ranges, etc.)
20
+ *
21
+ * @example
22
+ * await sdk.generics.query('/subscription_periods', {
23
+ * status: [1, 2],
24
+ * inserted_at: { after: '2024-01-01' }
25
+ * })
26
+ */
27
+ query(endpoint: string, params?: Record<string, any>): Promise<ApiResponse<GenericResource[]>>;
28
+ /**
29
+ * Get a single resource by ID from a generic endpoint
30
+ *
31
+ * @example
32
+ * const data = await sdk.generics.get('/subscription_periods', 123);
33
+ */
34
+ get(endpoint: string, id: number): Promise<ApiResponse<GenericResource>>;
35
+ /**
36
+ * Create a new resource on a generic endpoint
37
+ *
38
+ * @example
39
+ * const data = await sdk.generics.create('/subscription_periods', { name: 'Monthly', days: 30 });
40
+ */
41
+ create(endpoint: string, data: Record<string, any>): Promise<ApiResponse<GenericResource>>;
42
+ /**
43
+ * Update a resource on a generic endpoint
44
+ *
45
+ * @example
46
+ * const data = await sdk.generics.update('/subscription_periods', 123, { name: 'Monthly Premium' });
47
+ */
48
+ update(endpoint: string, id: number, data: Record<string, any>): Promise<ApiResponse<GenericResource>>;
49
+ /**
50
+ * Delete a resource from a generic endpoint
51
+ *
52
+ * @example
53
+ * await sdk.generics.delete('/subscription_periods', 123);
54
+ */
55
+ delete(endpoint: string, id: number): Promise<ApiResponse<void>>;
56
+ }
57
+ //# sourceMappingURL=generics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/resources/generics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';
3
+ import { KycQueryBuilder } from '../utils/query-builders';
4
+ export interface KycRequestListParams {
5
+ id?: number | number[];
6
+ status?: KycStatus | KycStatus[] | number | number[];
7
+ kind?: KycKind | KycKind[] | number | number[];
8
+ subject_id?: number | number[];
9
+ user_id?: number | number[];
10
+ inserted_at?: string | {
11
+ after?: string;
12
+ before?: string;
13
+ on?: string;
14
+ };
15
+ updated_at?: string | {
16
+ after?: string;
17
+ before?: string;
18
+ on?: string;
19
+ };
20
+ page?: number;
21
+ page_size?: number;
22
+ per_page?: number;
23
+ limit?: number;
24
+ order_by?: string;
25
+ sort?: string;
26
+ order?: 'asc' | 'desc';
27
+ q?: string;
28
+ search?: string;
29
+ }
30
+ export interface KycRequestListResponse {
31
+ entries: KycRequest[];
32
+ page_info: {
33
+ current_page: number;
34
+ total_pages: number;
35
+ total_entries: number;
36
+ page_size: number;
37
+ };
38
+ }
39
+ export interface LimitIncreaseRequestData {
40
+ requested_limit: number;
41
+ reason: string;
42
+ }
43
+ export interface DocumentSubmissionRequestData {
44
+ document_type: string;
45
+ document_url: string;
46
+ [key: string]: string;
47
+ }
48
+ export interface BankInfoUpdateRequestData {
49
+ account_holder_name: string;
50
+ account_holder_type: "Personal" | "Business";
51
+ account_number: number;
52
+ account_type: "Checking" | "Saving";
53
+ bank_name: string;
54
+ branch_name: string;
55
+ branch_code?: string;
56
+ routing_number?: string;
57
+ swift_code?: string;
58
+ country_code: string;
59
+ currency_code: string;
60
+ }
61
+ export interface CreateKycRequestPayload<T> {
62
+ kind: 'limit_increase' | 'document_submission' | 'bank_info_update';
63
+ data: T;
64
+ }
65
+ export declare class KycResource {
66
+ private client;
67
+ constructor(client: HttpClient);
68
+ /**
69
+ * List KYC records with pagination and filtering
70
+ * Requires Client-Id header to be set in the configuration
71
+ *
72
+ * @example
73
+ * await kyc.list({ status: 'pending' })
74
+ */
75
+ list(params?: KycRequestListParams): Promise<ApiResponse<KycRequestListResponse>>;
76
+ /**
77
+ * Query KYC records with advanced filtering
78
+ * Supports all query system features (ranges, arrays, date ranges, etc.)
79
+ *
80
+ * @example
81
+ * await kyc.query({ status: ['pending', 'in_review'], inserted_at: { after: '2024-01-01' } })
82
+ */
83
+ query(params?: KycRequestListParams): Promise<ApiResponse<KycRequestListResponse>>;
84
+ /**
85
+ * Create a fluent query builder for KYC requests
86
+ *
87
+ * @example
88
+ * await sdk.kyc.createQueryBuilder().whereStatus('pending').execute()
89
+ */
90
+ createQueryBuilder(initialQuery?: KycRequestListParams): KycQueryBuilder;
91
+ /**
92
+ * List KYC records with pagination and filtering (alias for list)
93
+ * @deprecated Use list() or query() instead
94
+ * Requires Client-Id header to be set in the configuration
95
+ */
96
+ listRequests(params?: KycRequestListParams): Promise<ApiResponse<KycRequestListResponse>>;
97
+ /**
98
+ * Get a specific KYC request by ID
99
+ * Requires Client-Id header to be set in the configuration
100
+ */
101
+ get(id: number): Promise<ApiResponse<KycRequest>>;
102
+ /**
103
+ * Request a limit increase
104
+ * Requires Client-Id header to be set in the configuration
105
+ */
106
+ requestLimitIncrease(data: CreateKycRequestPayload<LimitIncreaseRequestData>): Promise<ApiResponse<KycRequest>>;
107
+ /**
108
+ * Upload a document for KYC verification
109
+ * Requires Client-Id header to be set in the configuration
110
+ */
111
+ uploadDocument(data: CreateKycRequestPayload<DocumentSubmissionRequestData>): Promise<ApiResponse<KycRequest>>;
112
+ /**
113
+ * Update bank information
114
+ * Requires Client-Id header to be set in the configuration
115
+ */
116
+ updateBankInfo(data: CreateKycRequestPayload<BankInfoUpdateRequestData>): Promise<ApiResponse<KycRequest>>;
117
+ }
118
+ //# sourceMappingURL=kyc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kyc.d.ts","sourceRoot":"","sources":["../../src/resources/kyc.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,UAAU,EAGV,WAAW,EACX,OAAO,EACP,SAAS,EACV,MAAM,UAAU,CAAC;AAElB,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AM,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,sBAAsB,CAAC,CAAC;IAI/F;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAIvD;;;OAGG;IACG,oBAAoB,CAAC,IAAI,EAAE,uBAAuB,CAAC,wBAAwB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAIrH;;;OAGG;IACG,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,6BAA6B,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAIpH;;;OAGG;IACG,cAAc,CAAC,IAAI,EAAE,uBAAuB,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;CAGjH"}
@@ -1,26 +1,31 @@
1
1
  import { HttpClient } from '../client';
2
- import { Merchant, CreateMerchantData, UpdateMerchantData, ApiResponse, PaginationParams } from '../types';
3
- export interface MerchantListParams extends PaginationParams {
4
- search?: string;
5
- status?: number;
6
- limit?: number;
7
- }
8
- export interface MerchantListResponse {
9
- entries: Merchant[];
10
- page_info: {
11
- current_page: number;
12
- total_pages: number;
13
- total_entries: number;
14
- page_size: number;
15
- };
2
+ import { Merchant, CreateMerchantData, UpdateMerchantData, ApiResponse, MerchantBalance, MerchantLimits, MerchantSubscription, MerchantInvoice } from '../types';
3
+ import { MerchantQueryBuilder } from '../utils/query-builders';
4
+ import { MerchantFilterParams, MerchantQueryParams, MerchantListResponse } from '../types/resources';
5
+ /**
6
+ * @deprecated Use MerchantFilterParams from types/resources instead
7
+ */
8
+ export interface LegacyMerchantFilterParams {
16
9
  }
17
10
  export declare class MerchantsResource {
18
11
  private client;
19
12
  constructor(client: HttpClient);
13
+ /**
14
+ * Convert internal merchant data (integers) to user-facing data (strings)
15
+ */
16
+ private translateMerchantToUserFacing;
17
+ /**
18
+ * Convert user-facing merchant data (strings) to internal data (integers)
19
+ */
20
+ private translateMerchantToInternal;
21
+ /**
22
+ * Convert filter parameters (strings to integers where needed)
23
+ */
24
+ private translateFilters;
20
25
  /**
21
26
  * List merchants with pagination and filtering
22
27
  */
23
- list(params?: MerchantListParams): Promise<ApiResponse<MerchantListResponse>>;
28
+ list(params?: MerchantFilterParams): Promise<ApiResponse<MerchantListResponse>>;
24
29
  /**
25
30
  * Get a specific merchant by ID
26
31
  */
@@ -33,5 +38,37 @@ export declare class MerchantsResource {
33
38
  * Update an existing merchant
34
39
  */
35
40
  update(id: number, data: UpdateMerchantData): Promise<ApiResponse<Merchant>>;
41
+ /**
42
+ * Get merchant account balances
43
+ */
44
+ balances(): Promise<ApiResponse<MerchantBalance>>;
45
+ /**
46
+ * Get merchant account limits
47
+ */
48
+ limits(): Promise<ApiResponse<MerchantLimits>>;
49
+ /**
50
+ * Get merchant subscription plan details
51
+ */
52
+ subscription(): Promise<ApiResponse<MerchantSubscription>>;
53
+ /**
54
+ * Get list of merchant account invoices
55
+ */
56
+ invoices(): Promise<ApiResponse<MerchantInvoice[]>>;
57
+ /**
58
+ * Get a specific merchant invoice by ID
59
+ */
60
+ invoice(invoiceId: string): Promise<ApiResponse<MerchantInvoice>>;
61
+ /**
62
+ * Query merchants with enhanced query support
63
+ * @example
64
+ * await merchants.query({ status: 'approved', sector: 'retail' })
65
+ */
66
+ query(params?: MerchantQueryParams): Promise<ApiResponse<MerchantListResponse>>;
67
+ /**
68
+ * Create a query builder for merchants
69
+ * @example
70
+ * await sdk.merchants.createQueryBuilder().whereStatus('approved').execute()
71
+ */
72
+ createQueryBuilder(initialQuery?: MerchantQueryParams): MerchantQueryBuilder;
36
73
  }
37
74
  //# sourceMappingURL=merchants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"merchants.d.ts","sourceRoot":"","sources":["../../src/resources/merchants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACv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OAIG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAerF;;;;OAIG;IACH,kBAAkB,CAAC,YAAY,CAAC,EAAE,mBAAmB,GAAG,oBAAoB;CAI7E"}
@@ -1,5 +1,7 @@
1
1
  import { HttpClient } from '../client';
2
2
  import { Order, ApiResponse } from '../types';
3
+ import { OrderQueryBuilder } from '../utils/query-builders';
4
+ import { OrderFilterParams, OrderQueryParams, OrderListResponse } from '../types/resources';
3
5
  export interface CreateOrderRequestData {
4
6
  currency_code: string;
5
7
  customer: {
@@ -26,6 +28,26 @@ export interface UpdateOrderStatusData {
26
28
  export declare class OrdersResource {
27
29
  private client;
28
30
  constructor(client: HttpClient);
31
+ /**
32
+ * Convert internal order data (integers) to user-facing data (strings)
33
+ */
34
+ private translateOrderToUserFacing;
35
+ /**
36
+ * Convert internal merchant data to user-facing merchant
37
+ */
38
+ private translateMerchantToUserFacing;
39
+ /**
40
+ * Convert user-facing order data (strings) to internal data (integers)
41
+ */
42
+ private translateOrderToInternal;
43
+ /**
44
+ * Convert filter parameters (strings to integers where needed)
45
+ */
46
+ private translateFilters;
47
+ /**
48
+ * Convert status update data (strings to integers where needed)
49
+ */
50
+ private translateStatusUpdate;
29
51
  /**
30
52
  * Create a new order
31
53
  * Requires Client-Id header to be set in the configuration
@@ -41,15 +63,65 @@ export declare class OrdersResource {
41
63
  * Requires Client-Id header to be set in the configuration
42
64
  */
43
65
  update(id: number, data: UpdateOrderStatusData): Promise<ApiResponse<Order>>;
66
+ /**
67
+ * Delete an order
68
+ * Requires Client-Id header to be set in the configuration
69
+ */
70
+ delete(id: number): Promise<ApiResponse<void>>;
44
71
  /**
45
72
  * Get order status (public endpoint - no auth required)
46
73
  */
47
74
  getStatus(id: number): Promise<ApiResponse<Order>>;
48
75
  /**
49
76
  * Get order list with pagination and filtering
50
- * Supports filtering by status, kind, customer email, and date range
77
+ * Supports filtering by any database field
51
78
  * Requires Client-Id header to be set in the configuration
52
79
  */
53
- list(): Promise<ApiResponse<any>>;
80
+ list(params?: OrderFilterParams): Promise<ApiResponse<OrderListResponse>>;
81
+ /**
82
+ * List orders with enhanced query support
83
+ * Supports filtering by any database field using the new query system
84
+ * Requires Client-Id header to be set in the configuration
85
+ *
86
+ * @example
87
+ * // Simple queries
88
+ * await orders.query({ status: 'confirmed', kind: 'online' })
89
+ *
90
+ * // Array queries (IN operations)
91
+ * await orders.query({ id: [1, 2, 3], status: ['confirmed', 'shipped'] })
92
+ *
93
+ * // Range queries
94
+ * await orders.query({ total: { min: 100, max: 1000 } })
95
+ *
96
+ * // String searches
97
+ * await orders.query({ reference_id: { contains: 'ORDER-2024' } })
98
+ *
99
+ * // Date range queries
100
+ * await orders.query({ inserted_at: { after: '2024-01-01', before: '2024-12-31' } })
101
+ *
102
+ * // Combined queries
103
+ * await orders.query({
104
+ * status: 'confirmed',
105
+ * total: { min: 50 },
106
+ * inserted_at: { after: '2024-01-01' },
107
+ * page: 1,
108
+ * page_size: 20
109
+ * })
110
+ */
111
+ query(params?: OrderQueryParams): Promise<ApiResponse<OrderListResponse>>;
112
+ /**
113
+ * Create a query builder for orders
114
+ * Provides a fluent interface for building complex queries
115
+ *
116
+ * @example
117
+ * const orders = await sdk.orders.createQueryBuilder()
118
+ * .whereStatus('confirmed')
119
+ * .whereTotalRange(100, 1000)
120
+ * .whereReferenceContains('ORDER-2024')
121
+ * .paginate(1, 20)
122
+ * .orderBy('inserted_at', 'desc')
123
+ * .execute();
124
+ */
125
+ createQueryBuilder(initialQuery?: OrderQueryParams): OrderQueryBuilder;
54
126
  }
55
127
  //# sourceMappingURL=orders.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/resources/orders.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,KAAK,EAGL,WAAW,EAEZ,MAAM,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GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAiBlD;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAkBlF;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAIpD;;OAEG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAiBxD;;;;OAIG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAqB/E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,KAAK,CAAC,MAAM,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;IAuB/E;;;;;;;;;;;;OAYG;IACH,kBAAkB,CAAC,YAAY,CAAC,EAAE,gBAAgB,GAAG,iBAAiB;CAGvE"}
@@ -0,0 +1,65 @@
1
+ import { HttpClient } from '../client';
2
+ import { PaymentLink, CreatePaymentLinkData, UpdatePaymentLinkData, ApiResponse } from '../types';
3
+ import { PaymentLinkQueryBuilder } from '../utils/query-builders';
4
+ import { PaymentLinkFilterParams, PaymentLinkQueryParams, PaymentLinkListResponse } from '../types/resources';
5
+ export declare class PaymentLinksResource {
6
+ private client;
7
+ constructor(client: HttpClient);
8
+ /**
9
+ * Convert internal payment link data (integers) to user-facing data (strings)
10
+ */
11
+ private translateToUserFacing;
12
+ /**
13
+ * Convert filter parameters (strings to integers where needed)
14
+ */
15
+ private translateFilters;
16
+ /**
17
+ * Convert user-facing data to internal format
18
+ */
19
+ private translateToInternal;
20
+ /**
21
+ * List payment links with filtering
22
+ */
23
+ list(params?: PaymentLinkFilterParams): Promise<ApiResponse<PaymentLinkListResponse>>;
24
+ /**
25
+ * Get payment link by ID
26
+ */
27
+ get(id: number): Promise<ApiResponse<PaymentLink>>;
28
+ /**
29
+ * Create a new payment link
30
+ */
31
+ create(data: CreatePaymentLinkData): Promise<ApiResponse<PaymentLink>>;
32
+ /**
33
+ * Update a payment link
34
+ */
35
+ update(id: number, data: UpdatePaymentLinkData): Promise<ApiResponse<PaymentLink>>;
36
+ /**
37
+ * Delete a payment link
38
+ */
39
+ delete(id: number): Promise<ApiResponse<void>>;
40
+ /**
41
+ * Advanced query interface with full type safety
42
+ * Returns a QueryBuilder that compiles to the appropriate filter format
43
+ *
44
+ * @example
45
+ * const links = await sdk.paymentLinks.query({
46
+ * total: { gte: 1000 },
47
+ * status: [1, 2],
48
+ * inserted_at: { gte: '2024-01-01' }
49
+ * });
50
+ */
51
+ query(params: PaymentLinkQueryParams): Promise<ApiResponse<PaymentLinkListResponse>>;
52
+ /**
53
+ * Create a fluent query builder for payment links
54
+ *
55
+ * @example
56
+ * const links = await sdk.paymentLinks.createQueryBuilder()
57
+ * .whereTotalGreaterThan(1000)
58
+ * .whereStatusIn([1, 2])
59
+ * .orderBy('inserted_at', 'desc')
60
+ * .limit(50)
61
+ * .execute();
62
+ */
63
+ createQueryBuilder(): PaymentLinkQueryBuilder;
64
+ }
65
+ //# sourceMappingURL=payment-links.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-links.d.ts","sourceRoot":"","sources":["../../src/resources/payment-links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,WAAW,EAEX,qBAAqB,EACrB,qBAAqB,EACrB,WAAW,EACZ,MAAM,UAAU,CAAC;AAQlB,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,uBAAuB,EAExB,MAAM,oBAAoB,CAAC;AAE5B,qBAAa,oBAAoB;I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