@igniter-js/caller 0.1.2 → 0.1.3
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/dist/index.d.mts +109 -19
- package/dist/index.d.ts +109 -19
- package/dist/index.js +0 -72
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +0 -72
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1314,108 +1314,36 @@ var _IgniterCaller = class _IgniterCaller {
|
|
|
1314
1314
|
}
|
|
1315
1315
|
return url;
|
|
1316
1316
|
}
|
|
1317
|
-
/**
|
|
1318
|
-
* Creates a GET request.
|
|
1319
|
-
*
|
|
1320
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1321
|
-
*
|
|
1322
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1323
|
-
*
|
|
1324
|
-
* @example
|
|
1325
|
-
* ```ts
|
|
1326
|
-
* // With typed schema - response type is inferred
|
|
1327
|
-
* const result = await api.get('/users').execute()
|
|
1328
|
-
* // result.data is typed based on schema
|
|
1329
|
-
*
|
|
1330
|
-
* // Without schema or URL set later
|
|
1331
|
-
* const result = await api.get().url('/users').execute()
|
|
1332
|
-
* ```
|
|
1333
|
-
*/
|
|
1334
1317
|
get(url) {
|
|
1335
1318
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1336
1319
|
builder._setMethod("GET");
|
|
1337
1320
|
if (url) builder._setUrl(url);
|
|
1338
1321
|
return builder;
|
|
1339
1322
|
}
|
|
1340
|
-
/**
|
|
1341
|
-
* Creates a POST request.
|
|
1342
|
-
*
|
|
1343
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1344
|
-
*
|
|
1345
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1346
|
-
*
|
|
1347
|
-
* @example
|
|
1348
|
-
* ```ts
|
|
1349
|
-
* const result = await api.post('/users').body({ name: 'John' }).execute()
|
|
1350
|
-
* ```
|
|
1351
|
-
*/
|
|
1352
1323
|
post(url) {
|
|
1353
1324
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1354
1325
|
builder._setMethod("POST");
|
|
1355
1326
|
if (url) builder._setUrl(url);
|
|
1356
1327
|
return builder;
|
|
1357
1328
|
}
|
|
1358
|
-
/**
|
|
1359
|
-
* Creates a PUT request.
|
|
1360
|
-
*
|
|
1361
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1362
|
-
*
|
|
1363
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1364
|
-
*
|
|
1365
|
-
* @example
|
|
1366
|
-
* ```ts
|
|
1367
|
-
* const result = await api.put('/users/1').body({ name: 'Jane' }).execute()
|
|
1368
|
-
* ```
|
|
1369
|
-
*/
|
|
1370
1329
|
put(url) {
|
|
1371
1330
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1372
1331
|
builder._setMethod("PUT");
|
|
1373
1332
|
if (url) builder._setUrl(url);
|
|
1374
1333
|
return builder;
|
|
1375
1334
|
}
|
|
1376
|
-
/**
|
|
1377
|
-
* Creates a PATCH request.
|
|
1378
|
-
*
|
|
1379
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1380
|
-
*
|
|
1381
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1382
|
-
*
|
|
1383
|
-
* @example
|
|
1384
|
-
* ```ts
|
|
1385
|
-
* const result = await api.patch('/users/1').body({ name: 'Jane' }).execute()
|
|
1386
|
-
* ```
|
|
1387
|
-
*/
|
|
1388
1335
|
patch(url) {
|
|
1389
1336
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1390
1337
|
builder._setMethod("PATCH");
|
|
1391
1338
|
if (url) builder._setUrl(url);
|
|
1392
1339
|
return builder;
|
|
1393
1340
|
}
|
|
1394
|
-
/**
|
|
1395
|
-
* Creates a DELETE request.
|
|
1396
|
-
*
|
|
1397
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1398
|
-
*
|
|
1399
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1400
|
-
*
|
|
1401
|
-
* @example
|
|
1402
|
-
* ```ts
|
|
1403
|
-
* const result = await api.delete('/users/1').execute()
|
|
1404
|
-
* ```
|
|
1405
|
-
*/
|
|
1406
1341
|
delete(url) {
|
|
1407
1342
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1408
1343
|
builder._setMethod("DELETE");
|
|
1409
1344
|
if (url) builder._setUrl(url);
|
|
1410
1345
|
return builder;
|
|
1411
1346
|
}
|
|
1412
|
-
/**
|
|
1413
|
-
* Creates a HEAD request.
|
|
1414
|
-
*
|
|
1415
|
-
* When a URL is provided and matches a schema, the response type is automatically inferred.
|
|
1416
|
-
*
|
|
1417
|
-
* @param url Optional URL for the request. Can also be set via `.url()`.
|
|
1418
|
-
*/
|
|
1419
1347
|
head(url) {
|
|
1420
1348
|
const builder = new IgniterCallerRequestBuilder(this.createBuilderParams());
|
|
1421
1349
|
builder._setMethod("HEAD");
|