repzo 1.0.141 → 1.0.142
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/docs/README.md +16 -315
- package/docs/api/activity-ai-sales-order-examples.md +63 -112
- package/docs/api/activity-ai-sales-order.md +15 -215
- package/docs/api/activity-feedback-examples.md +82 -136
- package/docs/api/activity-feedback-v2-examples.md +86 -138
- package/docs/api/activity-feedback-v2.md +19 -263
- package/docs/api/activity-feedback.md +19 -263
- package/docs/api/activity-storecheck-examples.md +62 -101
- package/docs/api/activity-storecheck.md +13 -186
- package/docs/api/adjust-account-examples.md +50 -78
- package/docs/api/adjust-account.md +12 -117
- package/docs/api/adjust-inventory-examples.md +50 -78
- package/docs/api/adjust-inventory.md +16 -121
- package/docs/api/approval-request-examples.md +58 -97
- package/docs/api/approval-request.md +26 -189
- package/docs/api/approvals-examples.md +58 -97
- package/docs/api/approvals.md +26 -189
- package/docs/api/asset-examples.md +53 -95
- package/docs/api/asset-part-examples.md +62 -101
- package/docs/api/asset-part-receival-examples.md +62 -101
- package/docs/api/asset-part-receival.md +13 -186
- package/docs/api/asset-part-transfer-examples.md +63 -112
- package/docs/api/asset-part-transfer.md +15 -215
- package/docs/api/asset-part-type-examples.md +62 -101
- package/docs/api/asset-part-type.md +13 -186
- package/docs/api/asset-part-unit-examples.md +62 -101
- package/docs/api/asset-part-unit.md +13 -186
- package/docs/api/asset-part.md +13 -186
- package/docs/api/asset-type-examples.md +58 -97
- package/docs/api/asset-type.md +26 -189
- package/docs/api/asset-unit-examples.md +80 -147
- package/docs/api/asset-unit.md +19 -306
- package/docs/api/asset.md +26 -189
- package/docs/api/banks-examples.md +53 -95
- package/docs/api/banks.md +26 -189
- package/docs/api/bankslists-examples.md +58 -97
- package/docs/api/bankslists.md +26 -189
- package/docs/api/brand-examples.md +58 -97
- package/docs/api/brand.md +18 -181
- package/docs/api/category-examples.md +58 -97
- package/docs/api/category.md +18 -181
- package/docs/api/checks-examples.md +45 -76
- package/docs/api/checks.md +12 -117
- package/docs/api/client-channel-examples.md +62 -101
- package/docs/api/client-channel.md +20 -207
- package/docs/api/client-contact-examples.md +62 -101
- package/docs/api/client-contact.md +25 -233
- package/docs/api/client-examples.md +53 -95
- package/docs/api/client-location-examples.md +71 -126
- package/docs/api/client-location.md +19 -275
- package/docs/api/client.md +18 -181
- package/docs/api/contract-examples.md +58 -97
- package/docs/api/contract-installment-examples.md +84 -148
- package/docs/api/contract-installment.md +21 -303
- package/docs/api/contract.md +26 -189
- package/docs/api/custom-list-examples.md +58 -97
- package/docs/api/custom-list-item-examples.md +58 -97
- package/docs/api/custom-list-item.md +26 -189
- package/docs/api/custom-list.md +26 -189
- package/docs/api/custom-status-examples.md +58 -97
- package/docs/api/custom-status.md +26 -189
- package/docs/api/day-examples.md +45 -76
- package/docs/api/day.md +12 -117
- package/docs/api/feedback-options-examples.md +90 -153
- package/docs/api/feedback-options.md +23 -307
- package/docs/api/fullinvoices-examples.md +51 -83
- package/docs/api/fullinvoices.md +22 -162
- package/docs/api/index.md +99 -705
- package/docs/api/integration-action-log-examples.md +62 -101
- package/docs/api/integration-action-log.md +13 -186
- package/docs/api/integration-app-examples.md +51 -83
- package/docs/api/integration-app.md +16 -156
- package/docs/api/integration-command-log-examples.md +62 -101
- package/docs/api/integration-command-log.md +13 -186
- package/docs/api/inventory-adjustment-reason-examples.md +58 -97
- package/docs/api/inventory-adjustment-reason.md +26 -189
- package/docs/api/inventory-examples.md +35 -45
- package/docs/api/inventory.md +8 -53
- package/docs/api/mail-unsubscribe-examples.md +69 -124
- package/docs/api/mail-unsubscribe.md +13 -251
- package/docs/api/measureunit-examples.md +58 -97
- package/docs/api/measureunit-family-examples.md +58 -97
- package/docs/api/measureunit-family.md +18 -188
- package/docs/api/measureunit.md +20 -190
- package/docs/api/media-examples.md +53 -95
- package/docs/api/media-storage-examples.md +58 -97
- package/docs/api/media-storage.md +18 -181
- package/docs/api/media.md +18 -181
- package/docs/api/msl-examples.md +53 -95
- package/docs/api/msl-products-examples.md +58 -97
- package/docs/api/msl-products.md +26 -189
- package/docs/api/msl.md +26 -189
- package/docs/api/ocr-invoice-job-examples.md +74 -132
- package/docs/api/ocr-invoice-job-group-examples.md +73 -121
- package/docs/api/ocr-invoice-job-group.md +15 -215
- package/docs/api/ocr-invoice-job-page-examples.md +63 -112
- package/docs/api/ocr-invoice-job-page.md +15 -215
- package/docs/api/ocr-invoice-job-template-examples.md +62 -101
- package/docs/api/ocr-invoice-job-template.md +13 -186
- package/docs/api/ocr-invoice-job.md +19 -253
- package/docs/api/patch-action-examples.md +63 -112
- package/docs/api/patch-action.md +15 -215
- package/docs/api/payment-terms-examples.md +58 -97
- package/docs/api/payment-terms.md +28 -198
- package/docs/api/payments-examples.md +51 -83
- package/docs/api/payments.md +22 -162
- package/docs/api/pricelist-examples.md +58 -97
- package/docs/api/pricelist-item-examples.md +58 -97
- package/docs/api/pricelist-item.md +24 -208
- package/docs/api/pricelist.md +18 -181
- package/docs/api/product-examples.md +58 -97
- package/docs/api/product-group-examples.md +58 -97
- package/docs/api/product-group.md +18 -181
- package/docs/api/product-modifiers-group-examples.md +70 -125
- package/docs/api/product-modifiers-group.md +19 -275
- package/docs/api/product.md +20 -190
- package/docs/api/proforma-examples.md +51 -83
- package/docs/api/proforma.md +22 -162
- package/docs/api/quick-convert-to-pdf-examples.md +30 -41
- package/docs/api/quick-convert-to-pdf.md +6 -56
- package/docs/api/receiving-material-examples.md +51 -83
- package/docs/api/receiving-material.md +16 -156
- package/docs/api/refund-examples.md +46 -81
- package/docs/api/refund.md +16 -156
- package/docs/api/rep-balance-summary-examples.md +36 -46
- package/docs/api/rep-balance-summary.md +6 -53
- package/docs/api/rep-examples.md +53 -95
- package/docs/api/rep.md +18 -181
- package/docs/api/return-asset-part-unit-examples.md +62 -101
- package/docs/api/return-asset-part-unit.md +13 -186
- package/docs/api/return-reason-examples.md +58 -97
- package/docs/api/return-reason.md +18 -181
- package/docs/api/route-examples.md +53 -95
- package/docs/api/route.md +18 -181
- package/docs/api/safe-invoice-serial-counter-examples.md +72 -127
- package/docs/api/safe-invoice-serial-counter.md +17 -266
- package/docs/api/settings-examples.md +47 -70
- package/docs/api/settings.md +18 -123
- package/docs/api/settlement-examples.md +50 -78
- package/docs/api/settlement.md +12 -117
- package/docs/api/speciality-examples.md +70 -125
- package/docs/api/speciality.md +17 -266
- package/docs/api/store-asset-part-unit-examples.md +62 -101
- package/docs/api/store-asset-part-unit.md +13 -186
- package/docs/api/storecheck-template-examples.md +58 -97
- package/docs/api/storecheck-template.md +18 -181
- package/docs/api/subcategory-examples.md +58 -97
- package/docs/api/subcategory.md +18 -181
- package/docs/api/supplier-examples.md +58 -97
- package/docs/api/supplier.md +26 -189
- package/docs/api/svix-integration-examples.md +62 -101
- package/docs/api/svix-integration.md +13 -186
- package/docs/api/tag-examples.md +53 -95
- package/docs/api/tag.md +18 -181
- package/docs/api/tax-examples.md +53 -95
- package/docs/api/tax.md +18 -181
- package/docs/api/team-examples.md +53 -95
- package/docs/api/team.md +18 -181
- package/docs/api/transfer-examples.md +51 -83
- package/docs/api/transfer.md +16 -156
- package/docs/api/update-integration-meta-examples.md +63 -112
- package/docs/api/update-integration-meta.md +15 -215
- package/docs/api/variant-examples.md +58 -97
- package/docs/api/variant.md +20 -183
- package/docs/api/visit-examples.md +46 -81
- package/docs/api/visit.md +22 -162
- package/docs/api/warehouse-examples.md +58 -97
- package/docs/api/warehouse.md +18 -181
- package/docs/api/workorder-category-examples.md +76 -141
- package/docs/api/workorder-category.md +19 -305
- package/docs/api/workorder-examples.md +58 -97
- package/docs/api/workorder-portal-examples.md +75 -132
- package/docs/api/workorder-portal-link-examples.md +70 -145
- package/docs/api/workorder-portal-link.md +23 -336
- package/docs/api/workorder-portal.md +19 -271
- package/docs/api/workorder-request-examples.md +58 -97
- package/docs/api/workorder-request.md +26 -189
- package/docs/api/workorder.md +26 -189
- package/docs/generated/index.html +1 -1
- package/docs/generated/repzo-api-complete.yaml +2585 -2585
- package/lib/index.d.ts +180 -0
- package/lib/index.js +90 -0
- package/lib/types/index.d.ts +13393 -14636
- package/package.json +2 -3
- package/src/types/index.ts +14 -1
package/docs/api/checks.md
CHANGED
|
@@ -6,157 +6,87 @@ OpenAPI specification for Repzo Checks endpoints.
|
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
### Base URLs
|
|
11
10
|
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
11
|
+
- \*\*\*\*: `https://sv.api.repzo.me`
|
|
17
12
|
|
|
18
13
|
## Authentication
|
|
19
14
|
|
|
20
|
-
|
|
21
15
|
No authentication required.
|
|
22
16
|
|
|
23
|
-
|
|
24
17
|
## Endpoints
|
|
25
18
|
|
|
26
|
-
|
|
27
19
|
### `/checks`
|
|
28
20
|
|
|
29
|
-
|
|
30
21
|
#### GET /checks
|
|
31
22
|
|
|
32
23
|
**Summary:** Find checks
|
|
33
24
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
25
|
##### Parameters
|
|
40
26
|
|
|
41
27
|
| Name | Location | Type | Required | Description |
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
| `params` | query | object | No | Query parameters for filtering checks |
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
47
29
|
|
|
48
30
|
|
|
31
|
+
| `params` | query | object | No | Query parameters for filtering checks |
|
|
49
32
|
|
|
50
33
|
##### Responses
|
|
51
34
|
|
|
52
|
-
|
|
53
35
|
**200** - A list of checks
|
|
54
36
|
|
|
55
|
-
|
|
56
|
-
|
|
57
37
|
Content-Type: `application/json`
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
39
|
---
|
|
64
40
|
|
|
65
|
-
|
|
66
41
|
#### POST /checks
|
|
67
42
|
|
|
68
43
|
**Summary:** Create a check
|
|
69
44
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
45
|
##### Request Body
|
|
78
46
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
47
|
**Content Types:**
|
|
83
48
|
|
|
84
49
|
- `application/json`
|
|
85
50
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
51
|
##### Responses
|
|
90
52
|
|
|
91
|
-
|
|
92
53
|
**201** - Check created
|
|
93
54
|
|
|
94
|
-
|
|
95
|
-
|
|
96
55
|
Content-Type: `application/json`
|
|
97
56
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
57
|
---
|
|
103
58
|
|
|
104
|
-
|
|
105
|
-
|
|
106
59
|
### `/checks/{id}`
|
|
107
60
|
|
|
108
|
-
|
|
109
61
|
#### GET /checks/{id}
|
|
110
62
|
|
|
111
63
|
**Summary:** Get a check by ID
|
|
112
64
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
65
|
##### Parameters
|
|
119
66
|
|
|
120
67
|
| Name | Location | Type | Required | Description |
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
| `id` | path | string | Yes | No description |
|
|
124
|
-
|
|
125
|
-
|
|
68
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
126
69
|
|
|
127
70
|
|
|
71
|
+
| `id` | path | string | Yes | No description |
|
|
128
72
|
|
|
129
73
|
##### Responses
|
|
130
74
|
|
|
131
|
-
|
|
132
75
|
**200** - Check details
|
|
133
76
|
|
|
134
|
-
|
|
135
|
-
|
|
136
77
|
Content-Type: `application/json`
|
|
137
78
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
79
|
---
|
|
143
80
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
81
|
## Data Models
|
|
148
82
|
|
|
149
|
-
|
|
150
|
-
|
|
151
83
|
### CheckFindResult
|
|
152
84
|
|
|
153
|
-
|
|
154
85
|
Result of finding checks
|
|
155
86
|
|
|
156
|
-
|
|
157
|
-
|
|
158
87
|
| Property | Type | Required | Description |
|
|
159
|
-
|
|
88
|
+
| -------- | ---- | -------- | ----------- |
|
|
89
|
+
|
|
160
90
|
|
|
161
91
|
| `data` | array | No | No description |
|
|
162
92
|
|
|
@@ -170,20 +100,13 @@ Result of finding checks
|
|
|
170
100
|
|
|
171
101
|
| `per_page` | number | No | Number of checks per page |
|
|
172
102
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
103
|
### CheckSchema
|
|
179
104
|
|
|
180
|
-
|
|
181
105
|
Check schema
|
|
182
106
|
|
|
183
|
-
|
|
184
|
-
|
|
185
107
|
| Property | Type | Required | Description |
|
|
186
|
-
|
|
108
|
+
| -------- | ---- | -------- | ----------- |
|
|
109
|
+
|
|
187
110
|
|
|
188
111
|
| `_id` | string | No | Unique identifier for the check |
|
|
189
112
|
|
|
@@ -219,20 +142,13 @@ Check schema
|
|
|
219
142
|
|
|
220
143
|
| `__v` | number | No | Version number |
|
|
221
144
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
145
|
### CheckCreateBody
|
|
228
146
|
|
|
229
|
-
|
|
230
147
|
Body for creating a check
|
|
231
148
|
|
|
232
|
-
|
|
233
|
-
|
|
234
149
|
| Property | Type | Required | Description |
|
|
235
|
-
|
|
150
|
+
| -------- | ---- | -------- | ----------- |
|
|
151
|
+
|
|
236
152
|
|
|
237
153
|
| `client` | string | Yes | Client ID associated with the check |
|
|
238
154
|
|
|
@@ -254,35 +170,14 @@ Body for creating a check
|
|
|
254
170
|
|
|
255
171
|
| `integration_meta` | object | No | Integration metadata |
|
|
256
172
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
173
|
### CheckCreateResult
|
|
263
174
|
|
|
264
|
-
|
|
265
175
|
Result of creating a check
|
|
266
176
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
177
|
### CheckGetResult
|
|
274
178
|
|
|
275
|
-
|
|
276
179
|
Result of getting a check
|
|
277
180
|
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
181
|
## TypeScript Usage
|
|
287
182
|
|
|
288
|
-
See [checks-examples.md](./checks-examples.md) for detailed TypeScript usage examples.
|
|
183
|
+
See [checks-examples.md](./checks-examples.md) for detailed TypeScript usage examples.
|
|
@@ -11,38 +11,32 @@ npm install repzo
|
|
|
11
11
|
## Basic Setup
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
|
-
import { Service } from
|
|
14
|
+
import { Service } from "repzo";
|
|
15
15
|
|
|
16
16
|
// Initialize with your API key
|
|
17
|
-
const apiKey =
|
|
18
|
-
const baseURL =
|
|
17
|
+
const apiKey = "your-api-key";
|
|
18
|
+
const baseURL = "https://api.repzo.me/v1";
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## API Usage Examples
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
23
|
### Get all client channels
|
|
26
24
|
|
|
27
|
-
|
|
28
25
|
Retrieve a list of all client channels with optional filtering and pagination
|
|
29
26
|
|
|
30
|
-
|
|
31
27
|
```typescript
|
|
32
|
-
|
|
33
28
|
// GET /client-channel
|
|
34
29
|
|
|
35
30
|
const params = {
|
|
36
|
-
|
|
37
31
|
page: 1, // Page number for pagination
|
|
38
32
|
|
|
39
33
|
per_page: 1, // Number of items per page
|
|
40
34
|
|
|
41
|
-
sort:
|
|
35
|
+
sort: "example-value", // Sort field
|
|
42
36
|
|
|
43
37
|
_id: null, // Filter by channel ID(s)
|
|
44
38
|
|
|
45
|
-
search:
|
|
39
|
+
search: "example-value", // Search text for channel name
|
|
46
40
|
|
|
47
41
|
name: null, // Filter by channel name(s)
|
|
48
42
|
|
|
@@ -52,31 +46,30 @@ const params = {
|
|
|
52
46
|
|
|
53
47
|
from_updatedAt: 1, // Filter channels updated after this timestamp
|
|
54
48
|
|
|
55
|
-
from__id:
|
|
49
|
+
from__id: "example-value", // Filter channels with ID greater than this value
|
|
56
50
|
|
|
57
|
-
to__id:
|
|
51
|
+
to__id: "example-value", // Filter channels with ID less than this value
|
|
58
52
|
|
|
59
53
|
sortBy: null, // Advanced sorting options
|
|
60
|
-
|
|
61
54
|
};
|
|
62
55
|
|
|
63
|
-
const result = await fetch(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
56
|
+
const result = await fetch(
|
|
57
|
+
`${baseURL}/client-channel?${new URLSearchParams(params)}`,
|
|
58
|
+
{
|
|
59
|
+
method: "GET",
|
|
60
|
+
headers: {
|
|
61
|
+
Authorization: `Bearer ${apiKey}`,
|
|
62
|
+
"Content-Type": "application/json",
|
|
63
|
+
},
|
|
68
64
|
}
|
|
69
|
-
|
|
65
|
+
);
|
|
70
66
|
|
|
71
67
|
const data = await result.json();
|
|
72
68
|
console.log(data);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
69
|
```
|
|
77
70
|
|
|
78
|
-
|
|
79
71
|
**Expected Response:**
|
|
72
|
+
|
|
80
73
|
```json
|
|
81
74
|
{
|
|
82
75
|
"success": true,
|
|
@@ -86,18 +79,13 @@ console.log(data);
|
|
|
86
79
|
}
|
|
87
80
|
```
|
|
88
81
|
|
|
89
|
-
|
|
90
82
|
---
|
|
91
83
|
|
|
92
|
-
|
|
93
84
|
### Create a new client channel
|
|
94
85
|
|
|
95
|
-
|
|
96
86
|
Create a new client channel
|
|
97
87
|
|
|
98
|
-
|
|
99
88
|
```typescript
|
|
100
|
-
|
|
101
89
|
// POST /client-channel
|
|
102
90
|
|
|
103
91
|
const requestBody = {
|
|
@@ -106,61 +94,48 @@ const requestBody = {
|
|
|
106
94
|
};
|
|
107
95
|
|
|
108
96
|
const result = await fetch(`${baseURL}/client-channel`, {
|
|
109
|
-
method:
|
|
97
|
+
method: "POST",
|
|
110
98
|
headers: {
|
|
111
|
-
|
|
112
|
-
|
|
99
|
+
Authorization: `Bearer ${apiKey}`,
|
|
100
|
+
"Content-Type": "application/json",
|
|
113
101
|
},
|
|
114
|
-
body: JSON.stringify(requestBody)
|
|
102
|
+
body: JSON.stringify(requestBody),
|
|
115
103
|
});
|
|
116
104
|
|
|
117
105
|
const data = await result.json();
|
|
118
106
|
console.log(data);
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
107
|
```
|
|
123
108
|
|
|
124
|
-
|
|
125
|
-
|
|
126
109
|
---
|
|
127
110
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
111
|
### Get a specific client channel
|
|
132
112
|
|
|
133
|
-
|
|
134
113
|
Retrieve a specific client channel by ID
|
|
135
114
|
|
|
136
|
-
|
|
137
115
|
```typescript
|
|
138
|
-
|
|
139
116
|
// GET /client-channel/{id}
|
|
140
117
|
|
|
141
118
|
const params = {
|
|
142
|
-
|
|
143
|
-
id: 'example-value', // Channel ID
|
|
144
|
-
|
|
119
|
+
id: "example-value", // Channel ID
|
|
145
120
|
};
|
|
146
121
|
|
|
147
|
-
const result = await fetch(
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
122
|
+
const result = await fetch(
|
|
123
|
+
`${baseURL}/client-channel/{id}?${new URLSearchParams(params)}`,
|
|
124
|
+
{
|
|
125
|
+
method: "GET",
|
|
126
|
+
headers: {
|
|
127
|
+
Authorization: `Bearer ${apiKey}`,
|
|
128
|
+
"Content-Type": "application/json",
|
|
129
|
+
},
|
|
152
130
|
}
|
|
153
|
-
|
|
131
|
+
);
|
|
154
132
|
|
|
155
133
|
const data = await result.json();
|
|
156
134
|
console.log(data);
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
135
|
```
|
|
161
136
|
|
|
162
|
-
|
|
163
137
|
**Expected Response:**
|
|
138
|
+
|
|
164
139
|
```json
|
|
165
140
|
{
|
|
166
141
|
"success": true,
|
|
@@ -170,22 +145,18 @@ console.log(data);
|
|
|
170
145
|
}
|
|
171
146
|
```
|
|
172
147
|
|
|
173
|
-
|
|
174
148
|
---
|
|
175
149
|
|
|
176
|
-
|
|
177
150
|
### Update a client channel
|
|
178
151
|
|
|
179
|
-
|
|
180
152
|
Update an existing client channel
|
|
181
153
|
|
|
182
|
-
|
|
183
154
|
```typescript
|
|
184
155
|
|
|
185
156
|
```
|
|
186
157
|
|
|
187
|
-
|
|
188
158
|
**Expected Response:**
|
|
159
|
+
|
|
189
160
|
```json
|
|
190
161
|
{
|
|
191
162
|
"success": true,
|
|
@@ -195,39 +166,32 @@ Update an existing client channel
|
|
|
195
166
|
}
|
|
196
167
|
```
|
|
197
168
|
|
|
198
|
-
|
|
199
169
|
---
|
|
200
170
|
|
|
201
|
-
|
|
202
171
|
### Delete a client channel
|
|
203
172
|
|
|
204
|
-
|
|
205
173
|
Delete an existing client channel
|
|
206
174
|
|
|
207
|
-
|
|
208
175
|
```typescript
|
|
209
|
-
|
|
210
176
|
// DELETE /client-channel/{id}
|
|
211
177
|
|
|
212
|
-
const id =
|
|
213
|
-
const deletePath =
|
|
178
|
+
const id = "your-resource-id";
|
|
179
|
+
const deletePath = "/client-channel/{id}".replace("{id}", id);
|
|
214
180
|
|
|
215
181
|
const result = await fetch(`${baseURL}${deletePath}`, {
|
|
216
|
-
method:
|
|
182
|
+
method: "DELETE",
|
|
217
183
|
headers: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
184
|
+
Authorization: `Bearer ${apiKey}`,
|
|
185
|
+
"Content-Type": "application/json",
|
|
186
|
+
},
|
|
221
187
|
});
|
|
222
188
|
|
|
223
189
|
const data = await result.json();
|
|
224
190
|
console.log(data);
|
|
225
|
-
|
|
226
|
-
|
|
227
191
|
```
|
|
228
192
|
|
|
229
|
-
|
|
230
193
|
**Expected Response:**
|
|
194
|
+
|
|
231
195
|
```json
|
|
232
196
|
{
|
|
233
197
|
"success": true,
|
|
@@ -237,27 +201,21 @@ console.log(data);
|
|
|
237
201
|
}
|
|
238
202
|
```
|
|
239
203
|
|
|
240
|
-
|
|
241
204
|
---
|
|
242
205
|
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
206
|
## Using with Repzo SDK Service Types
|
|
247
207
|
|
|
248
208
|
The Repzo SDK provides TypeScript interfaces for type safety:
|
|
249
209
|
|
|
250
210
|
```typescript
|
|
251
|
-
import { Service } from
|
|
211
|
+
import { Service } from "repzo";
|
|
252
212
|
|
|
253
213
|
// Example using SDK types
|
|
254
214
|
|
|
255
|
-
|
|
256
215
|
async function example() {
|
|
257
216
|
// Use the Service.Clientchannel types for better type safety
|
|
258
217
|
// This provides intellisense and compile-time type checking
|
|
259
218
|
}
|
|
260
|
-
|
|
261
219
|
```
|
|
262
220
|
|
|
263
221
|
## Error Handling
|
|
@@ -265,11 +223,11 @@ async function example() {
|
|
|
265
223
|
```typescript
|
|
266
224
|
try {
|
|
267
225
|
const result = await fetch(`${baseURL}/endpoint`, {
|
|
268
|
-
method:
|
|
226
|
+
method: "GET",
|
|
269
227
|
headers: {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
}
|
|
228
|
+
Authorization: `Bearer ${apiKey}`,
|
|
229
|
+
"Content-Type": "application/json",
|
|
230
|
+
},
|
|
273
231
|
});
|
|
274
232
|
|
|
275
233
|
if (!result.ok) {
|
|
@@ -277,14 +235,14 @@ try {
|
|
|
277
235
|
}
|
|
278
236
|
|
|
279
237
|
const data = await result.json();
|
|
280
|
-
|
|
238
|
+
|
|
281
239
|
if (!data.success) {
|
|
282
|
-
throw new Error(data.error ||
|
|
240
|
+
throw new Error(data.error || "API request failed");
|
|
283
241
|
}
|
|
284
|
-
|
|
242
|
+
|
|
285
243
|
return data.data;
|
|
286
244
|
} catch (error) {
|
|
287
|
-
console.error(
|
|
245
|
+
console.error("API request failed:", error);
|
|
288
246
|
throw error;
|
|
289
247
|
}
|
|
290
248
|
```
|
|
@@ -300,18 +258,21 @@ const params = {
|
|
|
300
258
|
// other filters...
|
|
301
259
|
};
|
|
302
260
|
|
|
303
|
-
const result = await fetch(
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
261
|
+
const result = await fetch(
|
|
262
|
+
`${baseURL}/endpoint?${new URLSearchParams(params)}`,
|
|
263
|
+
{
|
|
264
|
+
method: "GET",
|
|
265
|
+
headers: {
|
|
266
|
+
Authorization: `Bearer ${apiKey}`,
|
|
267
|
+
"Content-Type": "application/json",
|
|
268
|
+
},
|
|
308
269
|
}
|
|
309
|
-
|
|
270
|
+
);
|
|
310
271
|
|
|
311
272
|
const data = await result.json();
|
|
312
273
|
|
|
313
274
|
// Access pagination info
|
|
314
|
-
console.log(
|
|
315
|
-
console.log(
|
|
316
|
-
console.log(
|
|
317
|
-
```
|
|
275
|
+
console.log("Total items:", data.paging.total);
|
|
276
|
+
console.log("Current page:", data.paging.page);
|
|
277
|
+
console.log("Total pages:", data.paging.pages);
|
|
278
|
+
```
|