@inkress/admin-sdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/CONTRIBUTING.md +266 -0
- package/LICENSE +21 -0
- package/README.md +455 -0
- package/dist/client.d.ts +30 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/index.d.ts +76 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +520 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +527 -0
- package/dist/index.js.map +1 -0
- package/dist/resources/billing-plans.d.ts +46 -0
- package/dist/resources/billing-plans.d.ts.map +1 -0
- package/dist/resources/categories.d.ts +49 -0
- package/dist/resources/categories.d.ts.map +1 -0
- package/dist/resources/merchants.d.ts +37 -0
- package/dist/resources/merchants.d.ts.map +1 -0
- package/dist/resources/orders.d.ts +55 -0
- package/dist/resources/orders.d.ts.map +1 -0
- package/dist/resources/products.d.ts +47 -0
- package/dist/resources/products.d.ts.map +1 -0
- package/dist/resources/public.d.ts +40 -0
- package/dist/resources/public.d.ts.map +1 -0
- package/dist/resources/subscriptions.d.ts +89 -0
- package/dist/resources/subscriptions.d.ts.map +1 -0
- package/dist/resources/users.d.ts +57 -0
- package/dist/resources/users.d.ts.map +1 -0
- package/dist/types.d.ts +445 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/webhooks.d.ts +42 -0
- package/dist/utils/webhooks.d.ts.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merchants.d.ts","sourceRoot":"","sources":["../../src/resources/merchants.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,QAAQ,EACR,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,QAAQ,EAAE,CAAC;IACpB,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,qBAAa,iBAAiB;IAChB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAInF;;OAEG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAIrD;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;IAItE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;CAGnF"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { Order, ApiResponse } from '../types';
|
|
3
|
+
export interface CreateOrderRequestData {
|
|
4
|
+
currency_code: string;
|
|
5
|
+
customer: {
|
|
6
|
+
email: string;
|
|
7
|
+
first_name?: string;
|
|
8
|
+
last_name?: string;
|
|
9
|
+
};
|
|
10
|
+
total: number;
|
|
11
|
+
reference_id?: string;
|
|
12
|
+
kind?: 'online' | 'offline' | 'subscription';
|
|
13
|
+
}
|
|
14
|
+
export interface CreateOrderResponseData {
|
|
15
|
+
id: number;
|
|
16
|
+
payment_urls?: {
|
|
17
|
+
short_link: string;
|
|
18
|
+
};
|
|
19
|
+
transaction?: {
|
|
20
|
+
id: number;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface UpdateOrderStatusData {
|
|
24
|
+
status: number;
|
|
25
|
+
}
|
|
26
|
+
export declare class OrdersResource {
|
|
27
|
+
private client;
|
|
28
|
+
constructor(client: HttpClient);
|
|
29
|
+
/**
|
|
30
|
+
* Create a new order
|
|
31
|
+
* Requires Client-Id header to be set in the configuration
|
|
32
|
+
*/
|
|
33
|
+
create(data: CreateOrderRequestData): Promise<ApiResponse<CreateOrderResponseData>>;
|
|
34
|
+
/**
|
|
35
|
+
* Get order details by ID
|
|
36
|
+
* Requires Client-Id header to be set in the configuration
|
|
37
|
+
*/
|
|
38
|
+
get(id: number): Promise<ApiResponse<Order>>;
|
|
39
|
+
/**
|
|
40
|
+
* Update order status
|
|
41
|
+
* Requires Client-Id header to be set in the configuration
|
|
42
|
+
*/
|
|
43
|
+
update(id: number, data: UpdateOrderStatusData): Promise<ApiResponse<Order>>;
|
|
44
|
+
/**
|
|
45
|
+
* Get order status (public endpoint - no auth required)
|
|
46
|
+
*/
|
|
47
|
+
getStatus(id: number): Promise<ApiResponse<Order>>;
|
|
48
|
+
/**
|
|
49
|
+
* Get order list with pagination and filtering
|
|
50
|
+
* Supports filtering by status, kind, customer email, and date range
|
|
51
|
+
* Requires Client-Id header to be set in the configuration
|
|
52
|
+
*/
|
|
53
|
+
list(): Promise<ApiResponse<any>>;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=orders.d.ts.map
|
|
@@ -0,0 +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,UAAU,CAAC;AAElB,MAAM,WAAW,sBAAsB;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE;QACR,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,GAAG,SAAS,GAAG,cAAc,CAAC;CAC9C;AAED,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,CAAC,EAAE;QACb,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,MAAM,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,uBAAuB,CAAC,CAAC;IAIzF;;;OAGG;IACG,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAIlD;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAIlF;;OAEG;IACG,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;IAIxD;;;;OAIG;IACG,IAAI,IAAI,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;CAGxC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { Product, CreateProductData, UpdateProductData, ApiResponse, PaginationParams } from '../types';
|
|
3
|
+
export interface ProductListParams extends PaginationParams {
|
|
4
|
+
search?: string;
|
|
5
|
+
status?: number;
|
|
6
|
+
category?: string;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface ProductListResponse {
|
|
10
|
+
entries: Product[];
|
|
11
|
+
page_info: {
|
|
12
|
+
current_page: number;
|
|
13
|
+
total_pages: number;
|
|
14
|
+
total_entries: number;
|
|
15
|
+
page_size: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export declare class ProductsResource {
|
|
19
|
+
private client;
|
|
20
|
+
constructor(client: HttpClient);
|
|
21
|
+
/**
|
|
22
|
+
* List products with pagination and filtering
|
|
23
|
+
* Requires Client-Id header to be set in the configuration
|
|
24
|
+
*/
|
|
25
|
+
list(params?: ProductListParams): Promise<ApiResponse<ProductListResponse>>;
|
|
26
|
+
/**
|
|
27
|
+
* Get a specific product by ID
|
|
28
|
+
* Requires Client-Id header to be set in the configuration
|
|
29
|
+
*/
|
|
30
|
+
get(id: number): Promise<ApiResponse<Product>>;
|
|
31
|
+
/**
|
|
32
|
+
* Create a new product
|
|
33
|
+
* Requires Client-Id header to be set in the configuration
|
|
34
|
+
*/
|
|
35
|
+
create(data: CreateProductData): Promise<ApiResponse<Product>>;
|
|
36
|
+
/**
|
|
37
|
+
* Update an existing product
|
|
38
|
+
* Requires Client-Id header to be set in the configuration
|
|
39
|
+
*/
|
|
40
|
+
update(id: number, data: UpdateProductData): Promise<ApiResponse<Product>>;
|
|
41
|
+
/**
|
|
42
|
+
* Delete a product
|
|
43
|
+
* Requires Client-Id header to be set in the configuration
|
|
44
|
+
*/
|
|
45
|
+
delete(id: number): Promise<ApiResponse<void>>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/resources/products.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MA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ginationParams, PublicMerchant } from '../types';
|
|
3
|
+
export interface PublicProductListParams extends PaginationParams {
|
|
4
|
+
search?: string;
|
|
5
|
+
category?: string;
|
|
6
|
+
limit?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface PublicProductListResponse {
|
|
9
|
+
entries: Product[];
|
|
10
|
+
page_info: {
|
|
11
|
+
current_page: number;
|
|
12
|
+
total_pages: number;
|
|
13
|
+
total_entries: number;
|
|
14
|
+
page_size: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export interface PublicMerchantParams {
|
|
18
|
+
username?: string;
|
|
19
|
+
'domain.cname'?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare class PublicResource {
|
|
22
|
+
private client;
|
|
23
|
+
constructor(client: HttpClient);
|
|
24
|
+
/**
|
|
25
|
+
* Get public information about a merchant by username or cname
|
|
26
|
+
*/
|
|
27
|
+
getMerchant(params: PublicMerchantParams): Promise<ApiResponse<PublicMerchant>>;
|
|
28
|
+
/**
|
|
29
|
+
* Get merchant fees (public endpoint - no auth required)
|
|
30
|
+
*/
|
|
31
|
+
getMerchantFees(merchantUsername: string, params: {
|
|
32
|
+
currency: string;
|
|
33
|
+
total: number;
|
|
34
|
+
}): Promise<ApiResponse<PublicMerchantFees>>;
|
|
35
|
+
/**
|
|
36
|
+
* Get merchant products (public endpoint - no auth required)
|
|
37
|
+
*/
|
|
38
|
+
getMerchantProducts(merchantUsername: string, params?: PublicProductListParams): Promise<ApiResponse<PublicProductListResponse>>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=public.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/resources/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,gBAAgB,EAChB,cAAc,EACf,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,EAAE,CAAC;IACnB,SAAS,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,WAAW,EAAE,MAAM,CAAC;QACpB,aAAa,EAAE,MAAM,CAAC;QACtB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,cAAc;IACb,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IAIrF;;OAEG;IACG,eAAe,CAAC,gBAAgB,EAAE,MAAM,EAAE,MAAM,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC;IAItI;;OAEG;IACG,mBAAmB,CACvB,gBAAgB,EAAE,MAAM,EACxB,MAAM,CAAC,EAAE,uBAAuB,GAC/B,OAAO,CAAC,WAAW,CAAC,yBAAyB,CAAC,CAAC;CAGnD"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { Subscription, SubscriptionPeriod, ApiResponse, PaginationParams } from '../types';
|
|
3
|
+
export interface SubscriptionListParams extends PaginationParams {
|
|
4
|
+
status?: number;
|
|
5
|
+
billing_plan_id?: number;
|
|
6
|
+
customer_id?: number;
|
|
7
|
+
limit?: number;
|
|
8
|
+
}
|
|
9
|
+
export interface SubscriptionListResponse {
|
|
10
|
+
entries: Subscription[];
|
|
11
|
+
page_info: {
|
|
12
|
+
current_page: number;
|
|
13
|
+
total_pages: number;
|
|
14
|
+
total_entries: number;
|
|
15
|
+
page_size: number;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
export interface CreateSubscriptionLinkData {
|
|
19
|
+
reference_id: string;
|
|
20
|
+
title: string;
|
|
21
|
+
plan_id: string;
|
|
22
|
+
customer: {
|
|
23
|
+
first_name: string;
|
|
24
|
+
last_name: string;
|
|
25
|
+
email: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface CreateSubscriptionLinkResponse {
|
|
29
|
+
id: number;
|
|
30
|
+
payment_urls: {
|
|
31
|
+
short_link: string;
|
|
32
|
+
};
|
|
33
|
+
subscription: Subscription;
|
|
34
|
+
}
|
|
35
|
+
export interface ChargeSubscriptionData {
|
|
36
|
+
reference_id: string;
|
|
37
|
+
total: number;
|
|
38
|
+
title: string;
|
|
39
|
+
}
|
|
40
|
+
export interface ChargeSubscriptionResponse {
|
|
41
|
+
id: number;
|
|
42
|
+
payment_urls: {
|
|
43
|
+
short_link: string;
|
|
44
|
+
};
|
|
45
|
+
transaction: any;
|
|
46
|
+
}
|
|
47
|
+
export interface SubscriptionPeriodsParams extends PaginationParams {
|
|
48
|
+
status?: 'pending' | 'paid' | 'failed' | 'cancelled';
|
|
49
|
+
limit?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface SubscriptionPeriodsResponse {
|
|
52
|
+
entries: SubscriptionPeriod[];
|
|
53
|
+
page_info: {
|
|
54
|
+
current_page: number;
|
|
55
|
+
total_pages: number;
|
|
56
|
+
total_entries: number;
|
|
57
|
+
page_size: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export declare class SubscriptionsResource {
|
|
61
|
+
private client;
|
|
62
|
+
constructor(client: HttpClient);
|
|
63
|
+
/**
|
|
64
|
+
* List billing subscriptions with pagination and filtering
|
|
65
|
+
* Requires Client-Id header to be set in the configuration
|
|
66
|
+
*/
|
|
67
|
+
list(params?: SubscriptionListParams): Promise<ApiResponse<SubscriptionListResponse>>;
|
|
68
|
+
/**
|
|
69
|
+
* Create a subscription payment link
|
|
70
|
+
* Requires Client-Id header to be set in the configuration
|
|
71
|
+
*/
|
|
72
|
+
createLink(data: CreateSubscriptionLinkData): Promise<ApiResponse<CreateSubscriptionLinkResponse>>;
|
|
73
|
+
/**
|
|
74
|
+
* Charge an existing subscription
|
|
75
|
+
* Requires Client-Id header to be set in the configuration
|
|
76
|
+
*/
|
|
77
|
+
charge(uid: string, data: ChargeSubscriptionData): Promise<ApiResponse<ChargeSubscriptionResponse>>;
|
|
78
|
+
/**
|
|
79
|
+
* Get subscription billing periods
|
|
80
|
+
* Requires Client-Id header to be set in the configuration
|
|
81
|
+
*/
|
|
82
|
+
getPeriods(uid: string, params?: SubscriptionPeriodsParams): Promise<ApiResponse<SubscriptionPeriodsResponse>>;
|
|
83
|
+
/**
|
|
84
|
+
* Cancel a subscription
|
|
85
|
+
* Requires Client-Id header to be set in the configuration
|
|
86
|
+
*/
|
|
87
|
+
cancel(uid: number, code: string): Promise<ApiResponse<any>>;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=subscriptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscriptions.d.ts","sourceRoot":"","sources":["../../src/resources/subscriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,YAAY,EACZ,kBAAkB,EAIlB,WAAW,EACX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC9D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;C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CAAC;KACnB,CAAC;CACH;AAED,qBAAa,qBAAqB;IACpB,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAEtC;;;OAGG;IACG,IAAI,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAI3F;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,0BAA0B,GAAG,OAAO,CAAC,WAAW,CAAC,8BAA8B,CAAC,CAAC;IAIxG;;;OAGG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAIzG;;;OAGG;IACG,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,yBAAyB,GAAG,OAAO,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC;IAIpH;;;OAGG;IACG,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;CAGnE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { HttpClient } from '../client';
|
|
2
|
+
import { User, CreateUserData, UpdateUserData, ApiResponse, PaginationParams } from '../types';
|
|
3
|
+
export interface UserListParams extends PaginationParams {
|
|
4
|
+
search?: string;
|
|
5
|
+
status?: number;
|
|
6
|
+
level?: number;
|
|
7
|
+
role_id?: number;
|
|
8
|
+
organisation_id?: number;
|
|
9
|
+
limit?: number;
|
|
10
|
+
}
|
|
11
|
+
export interface UserListResponse {
|
|
12
|
+
entries: User[];
|
|
13
|
+
page_info: {
|
|
14
|
+
current_page: number;
|
|
15
|
+
total_pages: number;
|
|
16
|
+
total_entries: number;
|
|
17
|
+
page_size: number;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export interface CreateUserRequestData extends CreateUserData {
|
|
21
|
+
level?: number;
|
|
22
|
+
dob?: number | null;
|
|
23
|
+
sex?: number | null;
|
|
24
|
+
image?: string | null;
|
|
25
|
+
organisation_id?: number | null;
|
|
26
|
+
merchant_id?: number | null;
|
|
27
|
+
}
|
|
28
|
+
export declare class UsersResource {
|
|
29
|
+
private client;
|
|
30
|
+
constructor(client: HttpClient);
|
|
31
|
+
/**
|
|
32
|
+
* List users with pagination and filtering
|
|
33
|
+
* Requires Client-Id header to be set in the configuration
|
|
34
|
+
*/
|
|
35
|
+
list(params?: UserListParams): Promise<ApiResponse<UserListResponse>>;
|
|
36
|
+
/**
|
|
37
|
+
* Get a specific user by ID
|
|
38
|
+
* Requires Client-Id header to be set in the configuration
|
|
39
|
+
*/
|
|
40
|
+
get(id: number): Promise<ApiResponse<User>>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a new user
|
|
43
|
+
* Requires Client-Id header to be set in the configuration
|
|
44
|
+
*/
|
|
45
|
+
create(data: CreateUserRequestData): Promise<ApiResponse<User>>;
|
|
46
|
+
/**
|
|
47
|
+
* Update an existing user
|
|
48
|
+
* Requires Client-Id header to be set in the configuration
|
|
49
|
+
*/
|
|
50
|
+
update(id: number, data: UpdateUserData): Promise<ApiResponse<User>>;
|
|
51
|
+
/**
|
|
52
|
+
* Delete a user
|
|
53
|
+
* Requires Client-Id header to be set in the configuration
|
|
54
|
+
*/
|
|
55
|
+
delete(id: number): Promise<ApiResponse<void>>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=users.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/resources/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EACL,IAAI,EACJ,cAAc,EACd,cAAc,EACd,WAAW,EACX,gBAAgB,EACjB,MAAM,UAAU,CAAC;AAElB,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACtD,MAAM,CAAC,EAAE,MAAM,CA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