repzo 1.0.141 → 1.0.143
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 +3 -4
- package/src/types/index.ts +14 -1
package/docs/api/subcategory.md
CHANGED
|
@@ -6,242 +6,135 @@ OpenAPI specification for Repzo SubCategory 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
|
### `/product/sub-categories`
|
|
28
20
|
|
|
29
|
-
|
|
30
21
|
#### GET /product/sub-categories
|
|
31
22
|
|
|
32
23
|
**Summary:** Find subcategories
|
|
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 subcategories |
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
47
29
|
|
|
48
30
|
|
|
31
|
+
| `params` | query | object | No | Query parameters for filtering subcategories |
|
|
49
32
|
|
|
50
33
|
##### Responses
|
|
51
34
|
|
|
52
|
-
|
|
53
35
|
**200** - A list of subcategories
|
|
54
36
|
|
|
55
|
-
|
|
56
|
-
|
|
57
37
|
Content-Type: `application/json`
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
39
|
---
|
|
64
40
|
|
|
65
|
-
|
|
66
41
|
#### POST /product/sub-categories
|
|
67
42
|
|
|
68
43
|
**Summary:** Create a subcategory
|
|
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** - SubCategory 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
|
### `/product/sub-categories/{id}`
|
|
107
60
|
|
|
108
|
-
|
|
109
61
|
#### GET /product/sub-categories/{id}
|
|
110
62
|
|
|
111
63
|
**Summary:** Get a subcategory by ID
|
|
112
64
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
65
|
##### Parameters
|
|
119
66
|
|
|
120
67
|
| Name | Location | Type | Required | Description |
|
|
121
|
-
|
|
68
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
69
|
+
|
|
122
70
|
|
|
123
71
|
| `id` | path | string | Yes | No description |
|
|
124
72
|
|
|
125
73
|
| `params` | query | object | No | No description |
|
|
126
74
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
75
|
##### Responses
|
|
132
76
|
|
|
133
|
-
|
|
134
77
|
**200** - SubCategory details
|
|
135
78
|
|
|
136
|
-
|
|
137
|
-
|
|
138
79
|
Content-Type: `application/json`
|
|
139
80
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
81
|
---
|
|
145
82
|
|
|
146
|
-
|
|
147
83
|
#### PUT /product/sub-categories/{id}
|
|
148
84
|
|
|
149
85
|
**Summary:** Update a subcategory
|
|
150
86
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
87
|
##### Parameters
|
|
157
88
|
|
|
158
89
|
| Name | Location | Type | Required | Description |
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
| `id` | path | string | Yes | No description |
|
|
162
|
-
|
|
90
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
163
91
|
|
|
164
92
|
|
|
93
|
+
| `id` | path | string | Yes | No description |
|
|
165
94
|
|
|
166
95
|
##### Request Body
|
|
167
96
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
97
|
**Content Types:**
|
|
172
98
|
|
|
173
99
|
- `application/json`
|
|
174
100
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
101
|
##### Responses
|
|
179
102
|
|
|
180
|
-
|
|
181
103
|
**200** - SubCategory updated
|
|
182
104
|
|
|
183
|
-
|
|
184
|
-
|
|
185
105
|
Content-Type: `application/json`
|
|
186
106
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
107
|
---
|
|
192
108
|
|
|
193
|
-
|
|
194
109
|
#### DELETE /product/sub-categories/{id}
|
|
195
110
|
|
|
196
111
|
**Summary:** Remove a subcategory
|
|
197
112
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
113
|
##### Parameters
|
|
204
114
|
|
|
205
115
|
| Name | Location | Type | Required | Description |
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
| `id` | path | string | Yes | No description |
|
|
209
|
-
|
|
210
|
-
|
|
116
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
211
117
|
|
|
212
118
|
|
|
119
|
+
| `id` | path | string | Yes | No description |
|
|
213
120
|
|
|
214
121
|
##### Responses
|
|
215
122
|
|
|
216
|
-
|
|
217
123
|
**200** - SubCategory removed
|
|
218
124
|
|
|
219
|
-
|
|
220
|
-
|
|
221
125
|
Content-Type: `application/json`
|
|
222
126
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
127
|
---
|
|
228
128
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
129
|
## Data Models
|
|
233
130
|
|
|
234
|
-
|
|
235
|
-
|
|
236
131
|
### SubCategoryFindResult
|
|
237
132
|
|
|
238
|
-
|
|
239
133
|
Result of finding subcategories
|
|
240
134
|
|
|
241
|
-
|
|
242
|
-
|
|
243
135
|
| Property | Type | Required | Description |
|
|
244
|
-
|
|
136
|
+
| -------- | ---- | -------- | ----------- |
|
|
137
|
+
|
|
245
138
|
|
|
246
139
|
| `data` | array | No | No description |
|
|
247
140
|
|
|
@@ -265,20 +158,13 @@ Result of finding subcategories
|
|
|
265
158
|
|
|
266
159
|
| `path` | string | No | Base URL path |
|
|
267
160
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
161
|
### SubCategorySchema
|
|
274
162
|
|
|
275
|
-
|
|
276
163
|
SubCategory schema
|
|
277
164
|
|
|
278
|
-
|
|
279
|
-
|
|
280
165
|
| Property | Type | Required | Description |
|
|
281
|
-
|
|
166
|
+
| -------- | ---- | -------- | ----------- |
|
|
167
|
+
|
|
282
168
|
|
|
283
169
|
| `_id` | string | No | Unique identifier for the subcategory |
|
|
284
170
|
|
|
@@ -304,20 +190,13 @@ SubCategory schema
|
|
|
304
190
|
|
|
305
191
|
| `__v` | number | No | Version number |
|
|
306
192
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
193
|
### SubCategoryCreateBody
|
|
313
194
|
|
|
314
|
-
|
|
315
195
|
Body for creating a subcategory
|
|
316
196
|
|
|
317
|
-
|
|
318
|
-
|
|
319
197
|
| Property | Type | Required | Description |
|
|
320
|
-
|
|
198
|
+
| -------- | ---- | -------- | ----------- |
|
|
199
|
+
|
|
321
200
|
|
|
322
201
|
| `name` | string | Yes | Name of the subcategory |
|
|
323
202
|
|
|
@@ -335,42 +214,21 @@ Body for creating a subcategory
|
|
|
335
214
|
|
|
336
215
|
| `integration_meta` | object | No | Integration metadata |
|
|
337
216
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
217
|
### SubCategoryCreateResult
|
|
344
218
|
|
|
345
|
-
|
|
346
219
|
Result of creating a subcategory
|
|
347
220
|
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
221
|
### SubCategoryGetResult
|
|
355
222
|
|
|
356
|
-
|
|
357
223
|
Result of getting a subcategory
|
|
358
224
|
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
225
|
### SubCategoryUpdateBody
|
|
366
226
|
|
|
367
|
-
|
|
368
227
|
Body for updating a subcategory
|
|
369
228
|
|
|
370
|
-
|
|
371
|
-
|
|
372
229
|
| Property | Type | Required | Description |
|
|
373
|
-
|
|
230
|
+
| -------- | ---- | -------- | ----------- |
|
|
231
|
+
|
|
374
232
|
|
|
375
233
|
| `name` | string | No | Name of the subcategory |
|
|
376
234
|
|
|
@@ -396,35 +254,14 @@ Body for updating a subcategory
|
|
|
396
254
|
|
|
397
255
|
| `__v` | number | No | Version number |
|
|
398
256
|
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
257
|
### SubCategoryUpdateResult
|
|
405
258
|
|
|
406
|
-
|
|
407
259
|
Result of updating a subcategory
|
|
408
260
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
261
|
### SubCategoryRemoveResult
|
|
416
262
|
|
|
417
|
-
|
|
418
263
|
Result of removing a subcategory
|
|
419
264
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
265
|
## TypeScript Usage
|
|
429
266
|
|
|
430
|
-
See [subcategory-examples.md](./subcategory-examples.md) for detailed TypeScript usage examples.
|
|
267
|
+
See [subcategory-examples.md](./subcategory-examples.md) for detailed TypeScript usage examples.
|
|
@@ -11,48 +11,41 @@ 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
|
### Find suppliers
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
25
|
```typescript
|
|
30
|
-
|
|
31
26
|
// GET /supplier
|
|
32
27
|
|
|
33
28
|
const params = {
|
|
34
|
-
|
|
35
29
|
params: null, // Query parameters for filtering suppliers
|
|
36
|
-
|
|
37
30
|
};
|
|
38
31
|
|
|
39
|
-
const result = await fetch(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
32
|
+
const result = await fetch(
|
|
33
|
+
`${baseURL}/supplier?${new URLSearchParams(params)}`,
|
|
34
|
+
{
|
|
35
|
+
method: "GET",
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${apiKey}`,
|
|
38
|
+
"Content-Type": "application/json",
|
|
39
|
+
},
|
|
44
40
|
}
|
|
45
|
-
|
|
41
|
+
);
|
|
46
42
|
|
|
47
43
|
const data = await result.json();
|
|
48
44
|
console.log(data);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
45
|
```
|
|
53
46
|
|
|
54
|
-
|
|
55
47
|
**Expected Response:**
|
|
48
|
+
|
|
56
49
|
```json
|
|
57
50
|
{
|
|
58
51
|
"success": true,
|
|
@@ -62,16 +55,11 @@ console.log(data);
|
|
|
62
55
|
}
|
|
63
56
|
```
|
|
64
57
|
|
|
65
|
-
|
|
66
58
|
---
|
|
67
59
|
|
|
68
|
-
|
|
69
60
|
### Create a supplier
|
|
70
61
|
|
|
71
|
-
|
|
72
|
-
|
|
73
62
|
```typescript
|
|
74
|
-
|
|
75
63
|
// POST /supplier
|
|
76
64
|
|
|
77
65
|
const requestBody = {
|
|
@@ -80,59 +68,46 @@ const requestBody = {
|
|
|
80
68
|
};
|
|
81
69
|
|
|
82
70
|
const result = await fetch(`${baseURL}/supplier`, {
|
|
83
|
-
method:
|
|
71
|
+
method: "POST",
|
|
84
72
|
headers: {
|
|
85
|
-
|
|
86
|
-
|
|
73
|
+
Authorization: `Bearer ${apiKey}`,
|
|
74
|
+
"Content-Type": "application/json",
|
|
87
75
|
},
|
|
88
|
-
body: JSON.stringify(requestBody)
|
|
76
|
+
body: JSON.stringify(requestBody),
|
|
89
77
|
});
|
|
90
78
|
|
|
91
79
|
const data = await result.json();
|
|
92
80
|
console.log(data);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
81
|
```
|
|
97
82
|
|
|
98
|
-
|
|
99
|
-
|
|
100
83
|
---
|
|
101
84
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
85
|
### Get a supplier by ID
|
|
106
86
|
|
|
107
|
-
|
|
108
|
-
|
|
109
87
|
```typescript
|
|
110
|
-
|
|
111
88
|
// GET /supplier/{id}
|
|
112
89
|
|
|
113
90
|
const params = {
|
|
114
|
-
|
|
115
|
-
id: 'example-value', // No description
|
|
116
|
-
|
|
91
|
+
id: "example-value", // No description
|
|
117
92
|
};
|
|
118
93
|
|
|
119
|
-
const result = await fetch(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
94
|
+
const result = await fetch(
|
|
95
|
+
`${baseURL}/supplier/{id}?${new URLSearchParams(params)}`,
|
|
96
|
+
{
|
|
97
|
+
method: "GET",
|
|
98
|
+
headers: {
|
|
99
|
+
Authorization: `Bearer ${apiKey}`,
|
|
100
|
+
"Content-Type": "application/json",
|
|
101
|
+
},
|
|
124
102
|
}
|
|
125
|
-
|
|
103
|
+
);
|
|
126
104
|
|
|
127
105
|
const data = await result.json();
|
|
128
106
|
console.log(data);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
107
|
```
|
|
133
108
|
|
|
134
|
-
|
|
135
109
|
**Expected Response:**
|
|
110
|
+
|
|
136
111
|
```json
|
|
137
112
|
{
|
|
138
113
|
"success": true,
|
|
@@ -142,20 +117,16 @@ console.log(data);
|
|
|
142
117
|
}
|
|
143
118
|
```
|
|
144
119
|
|
|
145
|
-
|
|
146
120
|
---
|
|
147
121
|
|
|
148
|
-
|
|
149
122
|
### Update a supplier
|
|
150
123
|
|
|
151
|
-
|
|
152
|
-
|
|
153
124
|
```typescript
|
|
154
125
|
|
|
155
126
|
```
|
|
156
127
|
|
|
157
|
-
|
|
158
128
|
**Expected Response:**
|
|
129
|
+
|
|
159
130
|
```json
|
|
160
131
|
{
|
|
161
132
|
"success": true,
|
|
@@ -165,37 +136,30 @@ console.log(data);
|
|
|
165
136
|
}
|
|
166
137
|
```
|
|
167
138
|
|
|
168
|
-
|
|
169
139
|
---
|
|
170
140
|
|
|
171
|
-
|
|
172
141
|
### Remove a supplier
|
|
173
142
|
|
|
174
|
-
|
|
175
|
-
|
|
176
143
|
```typescript
|
|
177
|
-
|
|
178
144
|
// DELETE /supplier/{id}
|
|
179
145
|
|
|
180
|
-
const id =
|
|
181
|
-
const deletePath =
|
|
146
|
+
const id = "your-resource-id";
|
|
147
|
+
const deletePath = "/supplier/{id}".replace("{id}", id);
|
|
182
148
|
|
|
183
149
|
const result = await fetch(`${baseURL}${deletePath}`, {
|
|
184
|
-
method:
|
|
150
|
+
method: "DELETE",
|
|
185
151
|
headers: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
152
|
+
Authorization: `Bearer ${apiKey}`,
|
|
153
|
+
"Content-Type": "application/json",
|
|
154
|
+
},
|
|
189
155
|
});
|
|
190
156
|
|
|
191
157
|
const data = await result.json();
|
|
192
158
|
console.log(data);
|
|
193
|
-
|
|
194
|
-
|
|
195
159
|
```
|
|
196
160
|
|
|
197
|
-
|
|
198
161
|
**Expected Response:**
|
|
162
|
+
|
|
199
163
|
```json
|
|
200
164
|
{
|
|
201
165
|
"success": true,
|
|
@@ -205,27 +169,21 @@ console.log(data);
|
|
|
205
169
|
}
|
|
206
170
|
```
|
|
207
171
|
|
|
208
|
-
|
|
209
172
|
---
|
|
210
173
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
174
|
## Using with Repzo SDK Service Types
|
|
215
175
|
|
|
216
176
|
The Repzo SDK provides TypeScript interfaces for type safety:
|
|
217
177
|
|
|
218
178
|
```typescript
|
|
219
|
-
import { Service } from
|
|
179
|
+
import { Service } from "repzo";
|
|
220
180
|
|
|
221
181
|
// Example using SDK types
|
|
222
182
|
|
|
223
|
-
|
|
224
183
|
async function example() {
|
|
225
184
|
// Use the Service.Supplier types for better type safety
|
|
226
185
|
// This provides intellisense and compile-time type checking
|
|
227
186
|
}
|
|
228
|
-
|
|
229
187
|
```
|
|
230
188
|
|
|
231
189
|
## Error Handling
|
|
@@ -233,11 +191,11 @@ async function example() {
|
|
|
233
191
|
```typescript
|
|
234
192
|
try {
|
|
235
193
|
const result = await fetch(`${baseURL}/endpoint`, {
|
|
236
|
-
method:
|
|
194
|
+
method: "GET",
|
|
237
195
|
headers: {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
196
|
+
Authorization: `Bearer ${apiKey}`,
|
|
197
|
+
"Content-Type": "application/json",
|
|
198
|
+
},
|
|
241
199
|
});
|
|
242
200
|
|
|
243
201
|
if (!result.ok) {
|
|
@@ -245,14 +203,14 @@ try {
|
|
|
245
203
|
}
|
|
246
204
|
|
|
247
205
|
const data = await result.json();
|
|
248
|
-
|
|
206
|
+
|
|
249
207
|
if (!data.success) {
|
|
250
|
-
throw new Error(data.error ||
|
|
208
|
+
throw new Error(data.error || "API request failed");
|
|
251
209
|
}
|
|
252
|
-
|
|
210
|
+
|
|
253
211
|
return data.data;
|
|
254
212
|
} catch (error) {
|
|
255
|
-
console.error(
|
|
213
|
+
console.error("API request failed:", error);
|
|
256
214
|
throw error;
|
|
257
215
|
}
|
|
258
216
|
```
|
|
@@ -268,18 +226,21 @@ const params = {
|
|
|
268
226
|
// other filters...
|
|
269
227
|
};
|
|
270
228
|
|
|
271
|
-
const result = await fetch(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
229
|
+
const result = await fetch(
|
|
230
|
+
`${baseURL}/endpoint?${new URLSearchParams(params)}`,
|
|
231
|
+
{
|
|
232
|
+
method: "GET",
|
|
233
|
+
headers: {
|
|
234
|
+
Authorization: `Bearer ${apiKey}`,
|
|
235
|
+
"Content-Type": "application/json",
|
|
236
|
+
},
|
|
276
237
|
}
|
|
277
|
-
|
|
238
|
+
);
|
|
278
239
|
|
|
279
240
|
const data = await result.json();
|
|
280
241
|
|
|
281
242
|
// Access pagination info
|
|
282
|
-
console.log(
|
|
283
|
-
console.log(
|
|
284
|
-
console.log(
|
|
285
|
-
```
|
|
243
|
+
console.log("Total items:", data.paging.total);
|
|
244
|
+
console.log("Current page:", data.paging.page);
|
|
245
|
+
console.log("Total pages:", data.paging.pages);
|
|
246
|
+
```
|