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/measureunit.md
CHANGED
|
@@ -6,240 +6,133 @@ OpenAPI specification for Repzo Measure Unit 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
|
### `/measure-unit`
|
|
28
20
|
|
|
29
|
-
|
|
30
21
|
#### GET /measure-unit
|
|
31
22
|
|
|
32
23
|
**Summary:** Find measure units
|
|
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 measure units |
|
|
45
|
-
|
|
46
|
-
|
|
28
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
47
29
|
|
|
48
30
|
|
|
31
|
+
| `params` | query | object | No | Query parameters for filtering measure units |
|
|
49
32
|
|
|
50
33
|
##### Responses
|
|
51
34
|
|
|
52
|
-
|
|
53
35
|
**200** - A list of measure units
|
|
54
36
|
|
|
55
|
-
|
|
56
|
-
|
|
57
37
|
Content-Type: `application/json`
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
39
|
---
|
|
64
40
|
|
|
65
|
-
|
|
66
41
|
#### POST /measure-unit
|
|
67
42
|
|
|
68
43
|
**Summary:** Create a measure unit
|
|
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** - Measure unit 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
|
### `/measure-unit/{id}`
|
|
107
60
|
|
|
108
|
-
|
|
109
61
|
#### GET /measure-unit/{id}
|
|
110
62
|
|
|
111
63
|
**Summary:** Get a measure unit 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** - Measure unit details
|
|
133
76
|
|
|
134
|
-
|
|
135
|
-
|
|
136
77
|
Content-Type: `application/json`
|
|
137
78
|
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
79
|
---
|
|
143
80
|
|
|
144
|
-
|
|
145
81
|
#### PUT /measure-unit/{id}
|
|
146
82
|
|
|
147
83
|
**Summary:** Update a measure unit
|
|
148
84
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
85
|
##### Parameters
|
|
155
86
|
|
|
156
87
|
| Name | Location | Type | Required | Description |
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
| `id` | path | string | Yes | No description |
|
|
160
|
-
|
|
88
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
161
89
|
|
|
162
90
|
|
|
91
|
+
| `id` | path | string | Yes | No description |
|
|
163
92
|
|
|
164
93
|
##### Request Body
|
|
165
94
|
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
95
|
**Content Types:**
|
|
170
96
|
|
|
171
97
|
- `application/json`
|
|
172
98
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
99
|
##### Responses
|
|
177
100
|
|
|
178
|
-
|
|
179
101
|
**200** - Measure unit updated
|
|
180
102
|
|
|
181
|
-
|
|
182
|
-
|
|
183
103
|
Content-Type: `application/json`
|
|
184
104
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
105
|
---
|
|
190
106
|
|
|
191
|
-
|
|
192
107
|
#### DELETE /measure-unit/{id}
|
|
193
108
|
|
|
194
109
|
**Summary:** Remove a measure unit
|
|
195
110
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
111
|
##### Parameters
|
|
202
112
|
|
|
203
113
|
| Name | Location | Type | Required | Description |
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
| `id` | path | string | Yes | No description |
|
|
207
|
-
|
|
208
|
-
|
|
114
|
+
| ---- | -------- | ---- | -------- | ----------- |
|
|
209
115
|
|
|
210
116
|
|
|
117
|
+
| `id` | path | string | Yes | No description |
|
|
211
118
|
|
|
212
119
|
##### Responses
|
|
213
120
|
|
|
214
|
-
|
|
215
121
|
**200** - Measure unit removed
|
|
216
122
|
|
|
217
|
-
|
|
218
|
-
|
|
219
123
|
Content-Type: `application/json`
|
|
220
124
|
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
125
|
---
|
|
226
126
|
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
127
|
## Data Models
|
|
231
128
|
|
|
232
|
-
|
|
233
|
-
|
|
234
129
|
### MeasureUnitFindResult
|
|
235
130
|
|
|
236
|
-
|
|
237
131
|
Result of finding measure units
|
|
238
132
|
|
|
239
|
-
|
|
240
|
-
|
|
241
133
|
| Property | Type | Required | Description |
|
|
242
|
-
|
|
134
|
+
| -------- | ---- | -------- | ----------- |
|
|
135
|
+
|
|
243
136
|
|
|
244
137
|
| `data` | array | No | No description |
|
|
245
138
|
|
|
@@ -263,20 +156,13 @@ Result of finding measure units
|
|
|
263
156
|
|
|
264
157
|
| `path` | string | No | Base URL path |
|
|
265
158
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
159
|
### MeasureUnitSchema
|
|
272
160
|
|
|
273
|
-
|
|
274
161
|
Measure unit schema
|
|
275
162
|
|
|
276
|
-
|
|
277
|
-
|
|
278
163
|
| Property | Type | Required | Description |
|
|
279
|
-
|
|
164
|
+
| -------- | ---- | -------- | ----------- |
|
|
165
|
+
|
|
280
166
|
|
|
281
167
|
| `_id` | string | No | Unique identifier for the measure unit |
|
|
282
168
|
|
|
@@ -300,20 +186,13 @@ Measure unit schema
|
|
|
300
186
|
|
|
301
187
|
| `__v` | number | No | Version number |
|
|
302
188
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
189
|
### MeasureUnitFamilySchema
|
|
309
190
|
|
|
310
|
-
|
|
311
191
|
Measure unit family schema
|
|
312
192
|
|
|
313
|
-
|
|
314
|
-
|
|
315
193
|
| Property | Type | Required | Description |
|
|
316
|
-
|
|
194
|
+
| -------- | ---- | -------- | ----------- |
|
|
195
|
+
|
|
317
196
|
|
|
318
197
|
| `_id` | string | No | Unique identifier for the measure unit family |
|
|
319
198
|
|
|
@@ -335,20 +214,13 @@ Measure unit family schema
|
|
|
335
214
|
|
|
336
215
|
| `__v` | number | No | Version number |
|
|
337
216
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
217
|
### MeasureUnitCreateBody
|
|
344
218
|
|
|
345
|
-
|
|
346
219
|
Body for creating a measure unit
|
|
347
220
|
|
|
348
|
-
|
|
349
|
-
|
|
350
221
|
| Property | Type | Required | Description |
|
|
351
|
-
|
|
222
|
+
| -------- | ---- | -------- | ----------- |
|
|
223
|
+
|
|
352
224
|
|
|
353
225
|
| `name` | string | Yes | Name of the measure unit |
|
|
354
226
|
|
|
@@ -364,42 +236,21 @@ Body for creating a measure unit
|
|
|
364
236
|
|
|
365
237
|
| `integration_meta` | object | No | Integration metadata |
|
|
366
238
|
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
239
|
### MeasureUnitCreateResult
|
|
373
240
|
|
|
374
|
-
|
|
375
241
|
Result of creating a measure unit
|
|
376
242
|
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
243
|
### MeasureUnitGetResult
|
|
384
244
|
|
|
385
|
-
|
|
386
245
|
Result of getting a measure unit
|
|
387
246
|
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
247
|
### MeasureUnitUpdateBody
|
|
395
248
|
|
|
396
|
-
|
|
397
249
|
Body for updating a measure unit
|
|
398
250
|
|
|
399
|
-
|
|
400
|
-
|
|
401
251
|
| Property | Type | Required | Description |
|
|
402
|
-
|
|
252
|
+
| -------- | ---- | -------- | ----------- |
|
|
253
|
+
|
|
403
254
|
|
|
404
255
|
| `name` | string | No | Name of the measure unit |
|
|
405
256
|
|
|
@@ -423,35 +274,14 @@ Body for updating a measure unit
|
|
|
423
274
|
|
|
424
275
|
| `__v` | number | No | Version number |
|
|
425
276
|
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
277
|
### MeasureUnitUpdateResult
|
|
432
278
|
|
|
433
|
-
|
|
434
279
|
Result of updating a measure unit
|
|
435
280
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
281
|
### MeasureUnitRemoveResult
|
|
443
282
|
|
|
444
|
-
|
|
445
283
|
Result of removing a measure unit
|
|
446
284
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
285
|
## TypeScript Usage
|
|
456
286
|
|
|
457
|
-
See [measureunit-examples.md](./measureunit-examples.md) for detailed TypeScript usage examples.
|
|
287
|
+
See [measureunit-examples.md](./measureunit-examples.md) for detailed TypeScript usage examples.
|
|
@@ -11,48 +11,38 @@ 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 media
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
25
|
```typescript
|
|
30
|
-
|
|
31
26
|
// GET /media
|
|
32
27
|
|
|
33
28
|
const params = {
|
|
34
|
-
|
|
35
29
|
params: null, // Query parameters for filtering media
|
|
36
|
-
|
|
37
30
|
};
|
|
38
31
|
|
|
39
32
|
const result = await fetch(`${baseURL}/media?${new URLSearchParams(params)}`, {
|
|
40
|
-
method:
|
|
33
|
+
method: "GET",
|
|
41
34
|
headers: {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
35
|
+
Authorization: `Bearer ${apiKey}`,
|
|
36
|
+
"Content-Type": "application/json",
|
|
37
|
+
},
|
|
45
38
|
});
|
|
46
39
|
|
|
47
40
|
const data = await result.json();
|
|
48
41
|
console.log(data);
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
42
|
```
|
|
53
43
|
|
|
54
|
-
|
|
55
44
|
**Expected Response:**
|
|
45
|
+
|
|
56
46
|
```json
|
|
57
47
|
{
|
|
58
48
|
"success": true,
|
|
@@ -62,16 +52,11 @@ console.log(data);
|
|
|
62
52
|
}
|
|
63
53
|
```
|
|
64
54
|
|
|
65
|
-
|
|
66
55
|
---
|
|
67
56
|
|
|
68
|
-
|
|
69
57
|
### Create media
|
|
70
58
|
|
|
71
|
-
|
|
72
|
-
|
|
73
59
|
```typescript
|
|
74
|
-
|
|
75
60
|
// POST /media
|
|
76
61
|
|
|
77
62
|
const requestBody = {
|
|
@@ -80,59 +65,46 @@ const requestBody = {
|
|
|
80
65
|
};
|
|
81
66
|
|
|
82
67
|
const result = await fetch(`${baseURL}/media`, {
|
|
83
|
-
method:
|
|
68
|
+
method: "POST",
|
|
84
69
|
headers: {
|
|
85
|
-
|
|
86
|
-
|
|
70
|
+
Authorization: `Bearer ${apiKey}`,
|
|
71
|
+
"Content-Type": "application/json",
|
|
87
72
|
},
|
|
88
|
-
body: JSON.stringify(requestBody)
|
|
73
|
+
body: JSON.stringify(requestBody),
|
|
89
74
|
});
|
|
90
75
|
|
|
91
76
|
const data = await result.json();
|
|
92
77
|
console.log(data);
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
78
|
```
|
|
97
79
|
|
|
98
|
-
|
|
99
|
-
|
|
100
80
|
---
|
|
101
81
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
82
|
### Get media by ID
|
|
106
83
|
|
|
107
|
-
|
|
108
|
-
|
|
109
84
|
```typescript
|
|
110
|
-
|
|
111
85
|
// GET /media/{id}
|
|
112
86
|
|
|
113
87
|
const params = {
|
|
114
|
-
|
|
115
|
-
id: 'example-value', // No description
|
|
116
|
-
|
|
88
|
+
id: "example-value", // No description
|
|
117
89
|
};
|
|
118
90
|
|
|
119
|
-
const result = await fetch(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
91
|
+
const result = await fetch(
|
|
92
|
+
`${baseURL}/media/{id}?${new URLSearchParams(params)}`,
|
|
93
|
+
{
|
|
94
|
+
method: "GET",
|
|
95
|
+
headers: {
|
|
96
|
+
Authorization: `Bearer ${apiKey}`,
|
|
97
|
+
"Content-Type": "application/json",
|
|
98
|
+
},
|
|
124
99
|
}
|
|
125
|
-
|
|
100
|
+
);
|
|
126
101
|
|
|
127
102
|
const data = await result.json();
|
|
128
103
|
console.log(data);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
104
|
```
|
|
133
105
|
|
|
134
|
-
|
|
135
106
|
**Expected Response:**
|
|
107
|
+
|
|
136
108
|
```json
|
|
137
109
|
{
|
|
138
110
|
"success": true,
|
|
@@ -142,20 +114,16 @@ console.log(data);
|
|
|
142
114
|
}
|
|
143
115
|
```
|
|
144
116
|
|
|
145
|
-
|
|
146
117
|
---
|
|
147
118
|
|
|
148
|
-
|
|
149
119
|
### Update media
|
|
150
120
|
|
|
151
|
-
|
|
152
|
-
|
|
153
121
|
```typescript
|
|
154
122
|
|
|
155
123
|
```
|
|
156
124
|
|
|
157
|
-
|
|
158
125
|
**Expected Response:**
|
|
126
|
+
|
|
159
127
|
```json
|
|
160
128
|
{
|
|
161
129
|
"success": true,
|
|
@@ -165,37 +133,30 @@ console.log(data);
|
|
|
165
133
|
}
|
|
166
134
|
```
|
|
167
135
|
|
|
168
|
-
|
|
169
136
|
---
|
|
170
137
|
|
|
171
|
-
|
|
172
138
|
### Remove media
|
|
173
139
|
|
|
174
|
-
|
|
175
|
-
|
|
176
140
|
```typescript
|
|
177
|
-
|
|
178
141
|
// DELETE /media/{id}
|
|
179
142
|
|
|
180
|
-
const id =
|
|
181
|
-
const deletePath =
|
|
143
|
+
const id = "your-resource-id";
|
|
144
|
+
const deletePath = "/media/{id}".replace("{id}", id);
|
|
182
145
|
|
|
183
146
|
const result = await fetch(`${baseURL}${deletePath}`, {
|
|
184
|
-
method:
|
|
147
|
+
method: "DELETE",
|
|
185
148
|
headers: {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
149
|
+
Authorization: `Bearer ${apiKey}`,
|
|
150
|
+
"Content-Type": "application/json",
|
|
151
|
+
},
|
|
189
152
|
});
|
|
190
153
|
|
|
191
154
|
const data = await result.json();
|
|
192
155
|
console.log(data);
|
|
193
|
-
|
|
194
|
-
|
|
195
156
|
```
|
|
196
157
|
|
|
197
|
-
|
|
198
158
|
**Expected Response:**
|
|
159
|
+
|
|
199
160
|
```json
|
|
200
161
|
{
|
|
201
162
|
"success": true,
|
|
@@ -205,27 +166,21 @@ console.log(data);
|
|
|
205
166
|
}
|
|
206
167
|
```
|
|
207
168
|
|
|
208
|
-
|
|
209
169
|
---
|
|
210
170
|
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
171
|
## Using with Repzo SDK Service Types
|
|
215
172
|
|
|
216
173
|
The Repzo SDK provides TypeScript interfaces for type safety:
|
|
217
174
|
|
|
218
175
|
```typescript
|
|
219
|
-
import { Service } from
|
|
176
|
+
import { Service } from "repzo";
|
|
220
177
|
|
|
221
178
|
// Example using SDK types
|
|
222
179
|
|
|
223
|
-
|
|
224
180
|
async function example() {
|
|
225
181
|
// Use the Service.Media types for better type safety
|
|
226
182
|
// This provides intellisense and compile-time type checking
|
|
227
183
|
}
|
|
228
|
-
|
|
229
184
|
```
|
|
230
185
|
|
|
231
186
|
## Error Handling
|
|
@@ -233,11 +188,11 @@ async function example() {
|
|
|
233
188
|
```typescript
|
|
234
189
|
try {
|
|
235
190
|
const result = await fetch(`${baseURL}/endpoint`, {
|
|
236
|
-
method:
|
|
191
|
+
method: "GET",
|
|
237
192
|
headers: {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
}
|
|
193
|
+
Authorization: `Bearer ${apiKey}`,
|
|
194
|
+
"Content-Type": "application/json",
|
|
195
|
+
},
|
|
241
196
|
});
|
|
242
197
|
|
|
243
198
|
if (!result.ok) {
|
|
@@ -245,14 +200,14 @@ try {
|
|
|
245
200
|
}
|
|
246
201
|
|
|
247
202
|
const data = await result.json();
|
|
248
|
-
|
|
203
|
+
|
|
249
204
|
if (!data.success) {
|
|
250
|
-
throw new Error(data.error ||
|
|
205
|
+
throw new Error(data.error || "API request failed");
|
|
251
206
|
}
|
|
252
|
-
|
|
207
|
+
|
|
253
208
|
return data.data;
|
|
254
209
|
} catch (error) {
|
|
255
|
-
console.error(
|
|
210
|
+
console.error("API request failed:", error);
|
|
256
211
|
throw error;
|
|
257
212
|
}
|
|
258
213
|
```
|
|
@@ -268,18 +223,21 @@ const params = {
|
|
|
268
223
|
// other filters...
|
|
269
224
|
};
|
|
270
225
|
|
|
271
|
-
const result = await fetch(
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
226
|
+
const result = await fetch(
|
|
227
|
+
`${baseURL}/endpoint?${new URLSearchParams(params)}`,
|
|
228
|
+
{
|
|
229
|
+
method: "GET",
|
|
230
|
+
headers: {
|
|
231
|
+
Authorization: `Bearer ${apiKey}`,
|
|
232
|
+
"Content-Type": "application/json",
|
|
233
|
+
},
|
|
276
234
|
}
|
|
277
|
-
|
|
235
|
+
);
|
|
278
236
|
|
|
279
237
|
const data = await result.json();
|
|
280
238
|
|
|
281
239
|
// Access pagination info
|
|
282
|
-
console.log(
|
|
283
|
-
console.log(
|
|
284
|
-
console.log(
|
|
285
|
-
```
|
|
240
|
+
console.log("Total items:", data.paging.total);
|
|
241
|
+
console.log("Current page:", data.paging.page);
|
|
242
|
+
console.log("Total pages:", data.paging.pages);
|
|
243
|
+
```
|