@applite/js-sdk 0.0.12 → 0.0.14
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/README.md +415 -154
- package/dist/index.d.mts +1497 -496
- package/dist/index.d.ts +1497 -496
- package/dist/index.js +688 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +667 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @applite/js-sdk
|
|
2
2
|
|
|
3
|
-
A comprehensive JavaScript/TypeScript SDK for interacting with the Applite
|
|
3
|
+
A comprehensive JavaScript/TypeScript SDK for interacting with the Applite API. This library provides a typed interface to manage application data, e-commerce operations, service bookings, and more.
|
|
4
4
|
|
|
5
|
-
> **Full Documentation**: For detailed API references and guides, visit [docs.appliteui.com
|
|
5
|
+
> **Full Documentation**: For detailed API references and guides, visit [docs.appliteui.com](https://docs.appliteui.com).
|
|
6
6
|
|
|
7
7
|
## Installation
|
|
8
8
|
|
|
@@ -16,239 +16,500 @@ yarn add @applite/js-sdk
|
|
|
16
16
|
|
|
17
17
|
## Quick Start
|
|
18
18
|
|
|
19
|
-
Initialize the client with your API base URL (optional if using relative paths in a same-origin environment).
|
|
20
|
-
|
|
21
19
|
```ts
|
|
22
20
|
import { AppliteUI } from "@applite/js-sdk";
|
|
23
21
|
|
|
24
22
|
const client = new AppliteUI({
|
|
25
23
|
baseUrl: "https://api.applite.com", // Optional: Defaults to relative path
|
|
26
24
|
});
|
|
25
|
+
|
|
26
|
+
// Authenticate a customer
|
|
27
|
+
const user = await client.app.customer.auth({
|
|
28
|
+
appId: "app_123",
|
|
29
|
+
apiKey: "your_api_key",
|
|
30
|
+
fullname: "John Doe",
|
|
31
|
+
telephone: "+2250700000000",
|
|
32
|
+
});
|
|
27
33
|
```
|
|
28
34
|
|
|
29
35
|
## Core Concepts
|
|
30
36
|
|
|
31
|
-
### Authentication
|
|
37
|
+
### Authentication
|
|
32
38
|
|
|
33
|
-
Every request requires two key parameters
|
|
39
|
+
Every request requires two key parameters:
|
|
34
40
|
|
|
35
|
-
- **`appId`**: The unique identifier of your application
|
|
36
|
-
- **`apiKey`**: The secret key used to authenticate requests
|
|
41
|
+
- **`appId`**: The unique identifier of your application
|
|
42
|
+
- **`apiKey`**: The secret key used to authenticate requests
|
|
37
43
|
|
|
38
44
|
### Method Signature
|
|
39
45
|
|
|
40
|
-
All SDK methods accept a
|
|
46
|
+
All SDK methods accept a single object containing all parameters:
|
|
41
47
|
|
|
42
48
|
```ts
|
|
43
|
-
|
|
44
|
-
await client.module.resource.action({
|
|
49
|
+
await client.module.method({
|
|
45
50
|
appId: "...",
|
|
46
51
|
apiKey: "...",
|
|
47
52
|
...specificParams,
|
|
48
53
|
});
|
|
49
54
|
```
|
|
50
55
|
|
|
51
|
-
|
|
56
|
+
### Response Structure
|
|
52
57
|
|
|
53
|
-
|
|
58
|
+
```ts
|
|
59
|
+
// Success
|
|
60
|
+
{ success: true, data: {...} }
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
62
|
+
// Error
|
|
63
|
+
{ success: false, error: "message" }
|
|
64
|
+
```
|
|
58
65
|
|
|
59
66
|
---
|
|
60
67
|
|
|
61
|
-
##
|
|
68
|
+
## API Reference
|
|
69
|
+
|
|
70
|
+
### Common Module (`client.app`)
|
|
71
|
+
|
|
72
|
+
#### Customer API (`client.app.customer`)
|
|
73
|
+
|
|
74
|
+
| Method | Description |
|
|
75
|
+
|--------|-------------|
|
|
76
|
+
| `auth(params)` | Authenticate or register a customer |
|
|
77
|
+
| `check(params)` | Check if a customer exists by phone |
|
|
78
|
+
| `list(params)` | List customers with optional filtering |
|
|
79
|
+
| `get(params)` | Get customer details by ID |
|
|
80
|
+
| `update(params)` | Update customer profile |
|
|
81
|
+
| `block(params)` | Block or unblock a customer |
|
|
82
|
+
| `delete(params)` | Delete a customer |
|
|
83
|
+
| `selfDelete(params)` | Customer self-deletion |
|
|
84
|
+
|
|
85
|
+
#### Info API (`client.app.info`)
|
|
86
|
+
|
|
87
|
+
| Method | Description |
|
|
88
|
+
|--------|-------------|
|
|
89
|
+
| `list(params)` | List all apps |
|
|
90
|
+
| `create(params)` | Create a new app |
|
|
91
|
+
| `getBySlug(params)` | Get app by slug |
|
|
92
|
+
| `getById(params)` | Get app by ID |
|
|
93
|
+
| `update(params)` | Update app details |
|
|
94
|
+
| `updateModules(params)` | Update app modules |
|
|
95
|
+
| `toggleModule(params)` | Toggle a module on/off |
|
|
96
|
+
|
|
97
|
+
#### Address API (`client.app.address`)
|
|
98
|
+
|
|
99
|
+
| Method | Description |
|
|
100
|
+
|--------|-------------|
|
|
101
|
+
| `list(params)` | List addresses |
|
|
102
|
+
| `create(params)` | Create an address |
|
|
103
|
+
| `update(params)` | Update an address |
|
|
104
|
+
| `delete(params)` | Delete an address |
|
|
105
|
+
| `getById(params)` | Get address by ID |
|
|
106
|
+
|
|
107
|
+
#### Testimony API (`client.testimony`)
|
|
108
|
+
|
|
109
|
+
| Method | Description |
|
|
110
|
+
|--------|-------------|
|
|
111
|
+
| `create(params)` | Admin: Create a testimony |
|
|
112
|
+
| `list(params)` | Admin: List testimonies with filters |
|
|
113
|
+
| `getById(params)` | Admin: Get testimony by ID |
|
|
114
|
+
| `update(params)` | Admin: Update a testimony |
|
|
115
|
+
| `delete(params)` | Admin: Delete a testimony |
|
|
116
|
+
| `updateStatus(params)` | Admin: Approve or reject testimony |
|
|
117
|
+
| `submit(params)` | Customer: Submit a new testimony |
|
|
118
|
+
| `listPublic(params)` | Public: Get approved testimonies |
|
|
119
|
+
|
|
120
|
+
#### Stats API (`client.app.stats`)
|
|
121
|
+
|
|
122
|
+
| Method | Description |
|
|
123
|
+
|--------|-------------|
|
|
124
|
+
| `create(params)` | Create a statistic entry |
|
|
125
|
+
| `get(params)` | Get statistic value |
|
|
126
|
+
|
|
127
|
+
#### Finance API (`client.app.finance`)
|
|
128
|
+
|
|
129
|
+
| Method | Description |
|
|
130
|
+
|--------|-------------|
|
|
131
|
+
| `balance(params)` | Get account balance |
|
|
132
|
+
| `listTransactions(params)` | List transactions |
|
|
133
|
+
|
|
134
|
+
#### Welcome Item API (`client.app.welcomeItem`)
|
|
135
|
+
|
|
136
|
+
| Method | Description |
|
|
137
|
+
|--------|-------------|
|
|
138
|
+
| `list(params)` | List welcome items |
|
|
139
|
+
| `create(params)` | Create a welcome item |
|
|
140
|
+
| `update(params)` | Update a welcome item |
|
|
141
|
+
| `delete(params)` | Delete a welcome item |
|
|
142
|
+
|
|
143
|
+
#### User API (`client.user`)
|
|
144
|
+
|
|
145
|
+
| Method | Description |
|
|
146
|
+
|--------|-------------|
|
|
147
|
+
| `signup(params)` | Register a new user |
|
|
148
|
+
| `signin(params)` | Sign in a user |
|
|
149
|
+
| `get(params)` | Get user by ID |
|
|
150
|
+
| `update(params)` | Update user profile |
|
|
151
|
+
| `delete(params)` | Delete a user |
|
|
152
|
+
| `editCredentials(params)` | Edit user credentials |
|
|
153
|
+
| `verifyPassword(params)` | Verify user password |
|
|
154
|
+
| `setNotification(params)` | Set notification preferences |
|
|
155
|
+
|
|
156
|
+
#### Notification Token API (`client.app.notificationToken`)
|
|
157
|
+
|
|
158
|
+
| Method | Description |
|
|
159
|
+
|--------|-------------|
|
|
160
|
+
| `register(params)` | Register a push token |
|
|
161
|
+
| `unregister(params)` | Unregister a push token |
|
|
162
|
+
|
|
163
|
+
#### Notification API (`client.notification`)
|
|
164
|
+
|
|
165
|
+
| Method | Description |
|
|
166
|
+
|--------|-------------|
|
|
167
|
+
| `getFirebaseConfig(params)` | Get Firebase config |
|
|
168
|
+
| `setFirebaseConfig(params)` | Set Firebase config |
|
|
169
|
+
| `deleteFirebaseConfig(params)` | Delete Firebase config |
|
|
170
|
+
| `getTemplates(params)` | Get notification templates |
|
|
171
|
+
| `setTemplate(params)` | Set a notification template |
|
|
172
|
+
| `deleteTemplate(params)` | Delete a notification template |
|
|
173
|
+
| `getLogs(params)` | Get notification logs |
|
|
174
|
+
|
|
175
|
+
#### Webhook API (`client.webhook`)
|
|
176
|
+
|
|
177
|
+
| Method | Description |
|
|
178
|
+
|--------|-------------|
|
|
179
|
+
| `list(params)` | List webhooks |
|
|
180
|
+
| `set(params)` | Create or update a webhook |
|
|
181
|
+
| `delete(params)` | Delete a webhook |
|
|
182
|
+
| `getLogs(params)` | Get webhook logs |
|
|
62
183
|
|
|
63
|
-
|
|
184
|
+
---
|
|
64
185
|
|
|
65
|
-
###
|
|
186
|
+
### Store Module (`client.app.store`)
|
|
187
|
+
|
|
188
|
+
#### Product API (`client.app.store.product`)
|
|
189
|
+
|
|
190
|
+
| Method | Description |
|
|
191
|
+
|--------|-------------|
|
|
192
|
+
| `list(params)` | List products |
|
|
193
|
+
| `create(params)` | Create a product |
|
|
194
|
+
| `get(params)` | Get product by ID |
|
|
195
|
+
| `update(params)` | Update a product |
|
|
196
|
+
| `delete(params)` | Delete a product |
|
|
197
|
+
|
|
198
|
+
#### Order API (`client.app.store.order`)
|
|
199
|
+
|
|
200
|
+
| Method | Description |
|
|
201
|
+
|--------|-------------|
|
|
202
|
+
| `list(params)` | List orders |
|
|
203
|
+
| `create(params)` | Create an order |
|
|
204
|
+
| `get(params)` | Get order by ID |
|
|
205
|
+
| `update(params)` | Update an order |
|
|
206
|
+
|
|
207
|
+
#### Category API (`client.app.store.category`)
|
|
208
|
+
|
|
209
|
+
| Method | Description |
|
|
210
|
+
|--------|-------------|
|
|
211
|
+
| `list(params)` | List categories |
|
|
212
|
+
| `create(params)` | Create a category |
|
|
213
|
+
| `get(params)` | Get category by ID |
|
|
214
|
+
| `update(params)` | Update a category |
|
|
215
|
+
| `delete(params)` | Delete a category |
|
|
216
|
+
|
|
217
|
+
#### Badge API (`client.app.store.badge`)
|
|
218
|
+
|
|
219
|
+
| Method | Description |
|
|
220
|
+
|--------|-------------|
|
|
221
|
+
| `list(params)` | List badges |
|
|
222
|
+
| `create(params)` | Create a badge |
|
|
223
|
+
| `update(params)` | Update a badge |
|
|
224
|
+
| `delete(params)` | Delete a badge |
|
|
225
|
+
|
|
226
|
+
#### Collection API (`client.app.store.collection`)
|
|
227
|
+
|
|
228
|
+
| Method | Description |
|
|
229
|
+
|--------|-------------|
|
|
230
|
+
| `list(params)` | List collections |
|
|
231
|
+
| `create(params)` | Create a collection |
|
|
232
|
+
| `get(params)` | Get collection by ID |
|
|
233
|
+
| `update(params)` | Update a collection |
|
|
234
|
+
| `delete(params)` | Delete a collection |
|
|
235
|
+
|
|
236
|
+
#### Discount API (`client.app.store.discount`)
|
|
237
|
+
|
|
238
|
+
| Method | Description |
|
|
239
|
+
|--------|-------------|
|
|
240
|
+
| `list(params)` | List discounts |
|
|
241
|
+
| `create(params)` | Create a discount |
|
|
242
|
+
| `get(params)` | Get discount by ID |
|
|
243
|
+
| `update(params)` | Update a discount |
|
|
244
|
+
| `delete(params)` | Delete a discount |
|
|
245
|
+
| `check(params)` | Check discount validity |
|
|
246
|
+
|
|
247
|
+
#### Option API (`client.app.store.option`)
|
|
248
|
+
|
|
249
|
+
| Method | Description |
|
|
250
|
+
|--------|-------------|
|
|
251
|
+
| `list(params)` | List options |
|
|
252
|
+
| `create(params)` | Create an option |
|
|
253
|
+
| `update(params)` | Update an option |
|
|
254
|
+
| `delete(params)` | Delete an option |
|
|
255
|
+
|
|
256
|
+
#### Seller API (`client.app.store.seller`)
|
|
257
|
+
|
|
258
|
+
| Method | Description |
|
|
259
|
+
|--------|-------------|
|
|
260
|
+
| `list(params)` | List sellers |
|
|
261
|
+
| `create(params)` | Create a seller |
|
|
262
|
+
| `get(params)` | Get seller by ID |
|
|
263
|
+
| `update(params)` | Update a seller |
|
|
264
|
+
| `delete(params)` | Delete a seller |
|
|
265
|
+
|
|
266
|
+
#### Shipping API (`client.app.store.shipping`)
|
|
267
|
+
|
|
268
|
+
| Method | Description |
|
|
269
|
+
|--------|-------------|
|
|
270
|
+
| `list(params)` | List shipping profiles |
|
|
271
|
+
| `create(params)` | Create a shipping profile |
|
|
272
|
+
| `update(params)` | Update a shipping profile |
|
|
273
|
+
| `delete(params)` | Delete a shipping profile |
|
|
274
|
+
|
|
275
|
+
#### Tag API (`client.app.store.tag`)
|
|
276
|
+
|
|
277
|
+
| Method | Description |
|
|
278
|
+
|--------|-------------|
|
|
279
|
+
| `list(params)` | List tags |
|
|
280
|
+
| `create(params)` | Create a tag |
|
|
281
|
+
| `update(params)` | Update a tag |
|
|
282
|
+
| `delete(params)` | Delete a tag |
|
|
283
|
+
|
|
284
|
+
#### Tax API (`client.app.store.tax`)
|
|
285
|
+
|
|
286
|
+
| Method | Description |
|
|
287
|
+
|--------|-------------|
|
|
288
|
+
| `list(params)` | List tax configurations |
|
|
289
|
+
| `create(params)` | Create a tax configuration |
|
|
290
|
+
| `update(params)` | Update a tax configuration |
|
|
291
|
+
| `delete(params)` | Delete a tax configuration |
|
|
66
292
|
|
|
67
|
-
|
|
293
|
+
---
|
|
68
294
|
|
|
69
|
-
|
|
295
|
+
### Multi-Service Module (`client.app.multiService`)
|
|
296
|
+
|
|
297
|
+
#### Company API (`client.app.multiService.company`)
|
|
298
|
+
|
|
299
|
+
| Method | Description |
|
|
300
|
+
|--------|-------------|
|
|
301
|
+
| `list(params)` | List companies |
|
|
302
|
+
| `create(params)` | Create a company |
|
|
303
|
+
| `get(params)` | Get company by ID |
|
|
304
|
+
| `update(params)` | Update a company |
|
|
305
|
+
| `delete(params)` | Delete a company |
|
|
306
|
+
|
|
307
|
+
#### Service API (`client.app.multiService.service`)
|
|
308
|
+
|
|
309
|
+
| Method | Description |
|
|
310
|
+
|--------|-------------|
|
|
311
|
+
| `list(params)` | List services |
|
|
312
|
+
| `create(params)` | Create a service |
|
|
313
|
+
| `get(params)` | Get service by ID |
|
|
314
|
+
| `update(params)` | Update a service |
|
|
315
|
+
| `delete(params)` | Delete a service |
|
|
316
|
+
|
|
317
|
+
#### Agent API (`client.app.multiService.agent`)
|
|
318
|
+
|
|
319
|
+
| Method | Description |
|
|
320
|
+
|--------|-------------|
|
|
321
|
+
| `list(params)` | List agents |
|
|
322
|
+
| `create(params)` | Create an agent |
|
|
323
|
+
| `get(params)` | Get agent by ID |
|
|
324
|
+
| `update(params)` | Update an agent |
|
|
325
|
+
| `delete(params)` | Delete an agent |
|
|
326
|
+
|
|
327
|
+
#### Appointment API (`client.app.multiService.appointment`)
|
|
328
|
+
|
|
329
|
+
| Method | Description |
|
|
330
|
+
|--------|-------------|
|
|
331
|
+
| `list(params)` | List appointments |
|
|
332
|
+
| `create(params)` | Create an appointment |
|
|
333
|
+
| `get(params)` | Get appointment by ID |
|
|
334
|
+
| `updateStatus(params)` | Update appointment status |
|
|
335
|
+
| `assignAgent(params)` | Assign an agent to appointment |
|
|
336
|
+
|
|
337
|
+
#### Field Template API (`client.app.multiService.fieldTemplate`)
|
|
338
|
+
|
|
339
|
+
| Method | Description |
|
|
340
|
+
|--------|-------------|
|
|
341
|
+
| `list(params)` | List field templates |
|
|
342
|
+
| `create(params)` | Create a field template |
|
|
343
|
+
| `update(params)` | Update a field template |
|
|
344
|
+
| `delete(params)` | Delete a field template |
|
|
70
345
|
|
|
71
|
-
|
|
346
|
+
---
|
|
72
347
|
|
|
73
|
-
|
|
74
|
-
const user = await client.app.customer.auth({
|
|
75
|
-
appId: "app_123",
|
|
76
|
-
apiKey: "your_api_key",
|
|
77
|
-
fullname: "John Doe",
|
|
78
|
-
telephone: "+2250700000000",
|
|
79
|
-
email: "john@example.com", // Optional
|
|
80
|
-
plateform: "STORE", // Optional: "STORE", "MULTI_SERVICE", etc.
|
|
81
|
-
});
|
|
82
|
-
```
|
|
348
|
+
### Duticotac Module (`client.duticotac`)
|
|
83
349
|
|
|
84
|
-
####
|
|
350
|
+
#### Balance API (`client.duticotac.balance`)
|
|
85
351
|
|
|
86
|
-
|
|
352
|
+
| Method | Description |
|
|
353
|
+
|--------|-------------|
|
|
354
|
+
| `get(params)` | Get account balance |
|
|
87
355
|
|
|
88
|
-
|
|
89
|
-
const user = await client.app.customer.check({
|
|
90
|
-
appId: "app_123",
|
|
91
|
-
apiKey: "your_api_key",
|
|
92
|
-
telephone: "+2250700000000",
|
|
93
|
-
});
|
|
94
|
-
```
|
|
356
|
+
#### Offer API (`client.duticotac.offer`)
|
|
95
357
|
|
|
96
|
-
|
|
358
|
+
| Method | Description |
|
|
359
|
+
|--------|-------------|
|
|
360
|
+
| `list(params)` | List offers |
|
|
361
|
+
| `create(params)` | Create an offer |
|
|
362
|
+
| `get(params)` | Get offer by ID |
|
|
363
|
+
| `update(params)` | Update an offer |
|
|
364
|
+
| `delete(params)` | Delete an offer |
|
|
97
365
|
|
|
98
|
-
|
|
366
|
+
#### Payment API (`client.duticotac.payment`)
|
|
99
367
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
plateformType: ["STORE"], // Optional filter
|
|
105
|
-
});
|
|
106
|
-
```
|
|
368
|
+
| Method | Description |
|
|
369
|
+
|--------|-------------|
|
|
370
|
+
| `initiate(params)` | Initiate a payment |
|
|
371
|
+
| `verify(params)` | Verify a payment |
|
|
107
372
|
|
|
108
|
-
####
|
|
373
|
+
#### Transaction API (`client.duticotac.transaction`)
|
|
109
374
|
|
|
110
|
-
|
|
375
|
+
| Method | Description |
|
|
376
|
+
|--------|-------------|
|
|
377
|
+
| `list(params)` | List transactions |
|
|
378
|
+
| `get(params)` | Get transaction by ID |
|
|
111
379
|
|
|
112
|
-
|
|
113
|
-
// Get details
|
|
114
|
-
const detail = await client.app.customer.get({
|
|
115
|
-
appId: "app_123",
|
|
116
|
-
apiKey: "your_api_key",
|
|
117
|
-
id: "customer_id",
|
|
118
|
-
});
|
|
380
|
+
---
|
|
119
381
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
382
|
+
### Kolabo Module (`client.kolabo`)
|
|
383
|
+
|
|
384
|
+
#### App API (`client.kolabo.app`)
|
|
385
|
+
|
|
386
|
+
| Method | Description |
|
|
387
|
+
|--------|-------------|
|
|
388
|
+
| `list(params)` | List Kolabo apps |
|
|
389
|
+
| `getBySlug(slug, params)` | Get app by slug |
|
|
390
|
+
| `get(slug, params)` | Get app details |
|
|
391
|
+
| `configure(slug, params)` | Configure a Kolabo app |
|
|
392
|
+
| `join(slug, params)` | Join a Kolabo app |
|
|
393
|
+
|
|
394
|
+
#### Customer API (`client.kolabo.customer`)
|
|
395
|
+
|
|
396
|
+
| Method | Description |
|
|
397
|
+
|--------|-------------|
|
|
398
|
+
| `list(params)` | List customers |
|
|
399
|
+
| `get(params)` | Get customer by ID |
|
|
129
400
|
|
|
130
|
-
|
|
401
|
+
#### Partner API (`client.kolabo.partner`)
|
|
131
402
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
403
|
+
| Method | Description |
|
|
404
|
+
|--------|-------------|
|
|
405
|
+
| `list(params)` | List partners |
|
|
406
|
+
| `create(params)` | Create a partner |
|
|
407
|
+
| `get(params)` | Get partner by ID |
|
|
408
|
+
| `update(params)` | Update a partner |
|
|
135
409
|
|
|
136
410
|
---
|
|
137
411
|
|
|
138
|
-
|
|
412
|
+
### Super Admin Module (`client.superAdmin`)
|
|
139
413
|
|
|
140
|
-
|
|
414
|
+
#### Auth API (`client.superAdmin.auth`)
|
|
141
415
|
|
|
142
|
-
|
|
416
|
+
| Method | Description |
|
|
417
|
+
|--------|-------------|
|
|
418
|
+
| `init(params)` | Initialize super admin |
|
|
419
|
+
| `signin(params)` | Sign in as super admin |
|
|
420
|
+
| `me(params)` | Get current admin info |
|
|
143
421
|
|
|
144
|
-
|
|
422
|
+
#### Apps API (`client.superAdmin.apps`)
|
|
145
423
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
name: "Premium T-Shirt",
|
|
152
|
-
price: 2500,
|
|
153
|
-
sellerId: "seller_123",
|
|
154
|
-
categoryId: "category_123",
|
|
155
|
-
variants: [], // Array of product variants
|
|
156
|
-
});
|
|
424
|
+
| Method | Description |
|
|
425
|
+
|--------|-------------|
|
|
426
|
+
| `list(params)` | List all apps |
|
|
427
|
+
| `get(params)` | Get app by ID |
|
|
428
|
+
| `update(params)` | Update an app |
|
|
157
429
|
|
|
158
|
-
|
|
159
|
-
await client.app.store.product.list({
|
|
160
|
-
appId: "app_123",
|
|
161
|
-
apiKey: "your_api_key",
|
|
162
|
-
});
|
|
163
|
-
```
|
|
430
|
+
#### Modules API (`client.superAdmin.modules`)
|
|
164
431
|
|
|
165
|
-
|
|
432
|
+
| Method | Description |
|
|
433
|
+
|--------|-------------|
|
|
434
|
+
| `list(params)` | List all modules |
|
|
435
|
+
| `update(params)` | Update module settings |
|
|
166
436
|
|
|
167
|
-
|
|
437
|
+
#### Stats API (`client.superAdmin.stats`)
|
|
168
438
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
appId: "app_123",
|
|
173
|
-
apiKey: "your_api_key",
|
|
174
|
-
items: [
|
|
175
|
-
{ productId: "prod_1", quantity: 2 }
|
|
176
|
-
],
|
|
177
|
-
customerId: "cust_1",
|
|
178
|
-
totalAmount: 5000,
|
|
179
|
-
shippingAddress: { ... }
|
|
180
|
-
});
|
|
439
|
+
| Method | Description |
|
|
440
|
+
|--------|-------------|
|
|
441
|
+
| `get(params)` | Get platform statistics |
|
|
181
442
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
443
|
+
#### Finance API (`client.superAdmin.finance`)
|
|
444
|
+
|
|
445
|
+
| Method | Description |
|
|
446
|
+
|--------|-------------|
|
|
447
|
+
| `balance(params)` | Get platform balance |
|
|
448
|
+
| `listTransactions(params)` | List platform transactions |
|
|
188
449
|
|
|
189
|
-
|
|
450
|
+
#### Notification API (`client.superAdmin.notification`)
|
|
190
451
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
- `option`
|
|
196
|
-
- `seller`
|
|
197
|
-
- `shipping`
|
|
198
|
-
- `tag`
|
|
199
|
-
- `tax`
|
|
452
|
+
| Method | Description |
|
|
453
|
+
|--------|-------------|
|
|
454
|
+
| `send(params)` | Send a notification |
|
|
455
|
+
| `broadcast(params)` | Broadcast to all users |
|
|
200
456
|
|
|
201
457
|
---
|
|
202
458
|
|
|
203
|
-
|
|
459
|
+
### Maintenance Module (`client.maintenance`)
|
|
204
460
|
|
|
205
|
-
|
|
461
|
+
| Method | Description |
|
|
462
|
+
|--------|-------------|
|
|
463
|
+
| `cronNotification(params)` | Run notification cron job |
|
|
464
|
+
| `cronBilling(params)` | Run billing cron job |
|
|
465
|
+
| `cleanupTransactions(params)` | Cleanup old transactions |
|
|
206
466
|
|
|
207
|
-
|
|
467
|
+
---
|
|
208
468
|
|
|
209
|
-
|
|
469
|
+
## Error Handling
|
|
210
470
|
|
|
211
|
-
|
|
212
|
-
// Create an appointment
|
|
213
|
-
await client.app.multiService.appointment.create({
|
|
214
|
-
appId: "app_123",
|
|
215
|
-
apiKey: "your_api_key",
|
|
216
|
-
serviceId: "srv_123",
|
|
217
|
-
customerId: "cust_123",
|
|
218
|
-
date: "2024-12-25T10:00:00Z",
|
|
219
|
-
status: "PENDING",
|
|
220
|
-
});
|
|
471
|
+
All API methods return a promise that resolves to a response object:
|
|
221
472
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
473
|
+
```ts
|
|
474
|
+
try {
|
|
475
|
+
const response = await client.app.customer.auth({
|
|
476
|
+
appId: "app_123",
|
|
477
|
+
apiKey: "your_api_key",
|
|
478
|
+
fullname: "John Doe",
|
|
479
|
+
telephone: "+2250700000000",
|
|
480
|
+
});
|
|
481
|
+
|
|
482
|
+
if (response.success) {
|
|
483
|
+
console.log("User:", response.data);
|
|
484
|
+
}
|
|
485
|
+
} catch (error) {
|
|
486
|
+
console.error("Request failed:", error);
|
|
487
|
+
}
|
|
229
488
|
```
|
|
230
489
|
|
|
231
|
-
### Available Service Modules
|
|
232
|
-
|
|
233
|
-
- `company`: Manage service providers.
|
|
234
|
-
- `service`: Define services offered.
|
|
235
|
-
- `agent`: Manage individual staff members.
|
|
236
|
-
|
|
237
490
|
---
|
|
238
491
|
|
|
239
492
|
## TypeScript Support
|
|
240
493
|
|
|
241
|
-
The SDK is written in TypeScript and ships with full type definitions
|
|
494
|
+
The SDK is written in TypeScript and ships with full type definitions:
|
|
242
495
|
|
|
243
496
|
```ts
|
|
244
497
|
import {
|
|
245
498
|
Customer,
|
|
246
|
-
|
|
499
|
+
CustomerListItem,
|
|
247
500
|
CustomerAuthParams,
|
|
501
|
+
CreateProductParams,
|
|
502
|
+
OrderStatus,
|
|
503
|
+
PaymentStatus,
|
|
504
|
+
// ... and many more
|
|
248
505
|
} from "@applite/js-sdk";
|
|
249
506
|
```
|
|
250
507
|
|
|
508
|
+
---
|
|
509
|
+
|
|
251
510
|
## Scripts
|
|
252
511
|
|
|
253
|
-
|
|
254
|
-
|
|
512
|
+
```bash
|
|
513
|
+
pnpm build # Build the SDK (ESM/CJS)
|
|
514
|
+
pnpm test # Run type checks
|
|
515
|
+
```
|