@polygonlabs/staking-api-client 1.10.0 → 2.0.0
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/CHANGELOG.md +34 -0
- package/MIGRATION.md +11 -7
- package/README.md +2 -2
- package/dist/generated/@tanstack/react-query.gen.d.ts +26 -926
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -1
- package/dist/generated/@tanstack/react-query.gen.js +1 -295
- package/dist/generated/@tanstack/react-query.gen.js.map +1 -1
- package/dist/generated/index.d.ts +2 -2
- package/dist/generated/index.d.ts.map +1 -1
- package/dist/generated/index.js +2 -2
- package/dist/generated/index.js.map +1 -1
- package/dist/generated/registry-validator.gen.d.ts +2 -194
- package/dist/generated/registry-validator.gen.d.ts.map +1 -1
- package/dist/generated/registry-validator.gen.js +2 -314
- package/dist/generated/registry-validator.gen.js.map +1 -1
- package/dist/generated/sdk.gen.d.ts +10 -74
- package/dist/generated/sdk.gen.d.ts.map +1 -1
- package/dist/generated/sdk.gen.js +9 -105
- package/dist/generated/sdk.gen.js.map +1 -1
- package/dist/generated/types.gen.d.ts +0 -280
- package/dist/generated/types.gen.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.d.ts.map +1 -1
- package/dist/react.js +1 -1
- package/dist/react.js.map +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
-
import { AddValidatorV2Body, AdminCountResponse, AdminEngagementStateResponse, AdminExportResponse, AdminImportBody, AdminImportResponse, AdminSetEngagementStateBody, AdminUpsertValidatorProfileBody, AdminValidatorProfileResponse, CheckpointsSignedCursorQuery, CheckpointsSignedCursorV2Response, CheckpointsSignedCursorV3Response,
|
|
2
|
+
import { AddValidatorV2Body, AdminCountResponse, AdminEngagementStateResponse, AdminExportResponse, AdminImportBody, AdminImportResponse, AdminSetEngagementStateBody, AdminUpsertValidatorProfileBody, AdminValidatorProfileResponse, CheckpointsSignedCursorQuery, CheckpointsSignedCursorV2Response, CheckpointsSignedCursorV3Response, DelegationsByUserV3Response, DelegatorsCursorQuery, DelegatorsCursorV2Response, DelegatorsCursorV3Response, DelegatorUnbondsV2Response, DelegatorUnbondsV3Response, ErrorResponse, GetAllValidatorsV2Query, GetAllValidatorsV3Query, GetAllValidatorsV3Response, GetValidatorSetV3Query, GetValidatorSetV3Response, GetValidatorV3Response, LoginV3Response, NotificationsCursorQuery, NotificationsCursorResponse, SummaryV3Response, UpdateValidatorV2Body, V2DelegatorObjectResponse, V2MonitorResponse, V2RewardsResponse, V2ValidatorArrayResponse, V2ValidatorObjectResponse, ValidationErrorResponse } from '@polygonlabs/staking-api-schemas';
|
|
3
3
|
import { queryOptions } from '@tanstack/react-query';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { client } from './client.gen.js';
|
|
6
|
-
import { addValidatorV2 as addValidatorV22, adminExportCount as adminExportCount2, adminExportDocuments as adminExportDocuments2, adminImportDocuments as adminImportDocuments2, adminSetValidatorEngagementState as adminSetValidatorEngagementState2, adminUpsertValidatorProfile as adminUpsertValidatorProfile2, getAllDelegatorsPageV2 as getAllDelegatorsPageV22, getAllDelegatorsPageV3 as getAllDelegatorsPageV32,
|
|
6
|
+
import { addValidatorV2 as addValidatorV22, adminExportCount as adminExportCount2, adminExportDocuments as adminExportDocuments2, adminImportDocuments as adminImportDocuments2, adminSetValidatorEngagementState as adminSetValidatorEngagementState2, adminUpsertValidatorProfile as adminUpsertValidatorProfile2, getAllDelegatorsPageV2 as getAllDelegatorsPageV22, getAllDelegatorsPageV3 as getAllDelegatorsPageV32, getAllNotificationsPageV2 as getAllNotificationsPageV22, getAllNotificationsPageV3 as getAllNotificationsPageV32, getAllValidatorsV2 as getAllValidatorsV22, getAllValidatorsV3 as getAllValidatorsV32, getCheckpointIntervalV2 as getCheckpointIntervalV22, getCheckpointsSignedPageV2 as getCheckpointsSignedPageV22, getCheckpointsSignedPageV3 as getCheckpointsSignedPageV32, getCommissionedRewardV2 as getCommissionedRewardV22, getCurrentAprV2 as getCurrentAprV22, getCurrentSpolApyV2 as getCurrentSpolApyV22, getDelegationsByUserV2 as getDelegationsByUserV22, getDelegationsByUserV3 as getDelegationsByUserV32, getDelegatorUnbondsV2 as getDelegatorUnbondsV22, getDelegatorUnbondsV3 as getDelegatorUnbondsV32, getMissedCheckpointsByAllValidatorsV2 as getMissedCheckpointsByAllValidatorsV22, getPerformanceBenchmarkV2 as getPerformanceBenchmarkV22, getRewardsSummaryV2 as getRewardsSummaryV22, getSignerAddressListForCheckpointNumberV2 as getSignerAddressListForCheckpointNumberV22, getSignerAddressListForLatestCheckpointV2 as getSignerAddressListForLatestCheckpointV22, getSignerEthBalancesV2 as getSignerEthBalancesV22, getSummaryV3 as getSummaryV32, getTotalStakedV2 as getTotalStakedV22, getUserLoginV3 as getUserLoginV32, getValidatorByAddressV2 as getValidatorByAddressV22, getValidatorDelegatorsPageV2 as getValidatorDelegatorsPageV22, getValidatorDelegatorsPageV3 as getValidatorDelegatorsPageV32, getValidatorSetV3 as getValidatorSetV32, getValidatorV2 as getValidatorV22, getValidatorV3 as getValidatorV32, updateValidatorV2 as updateValidatorV22 } from './sdk.gen.js';
|
|
7
7
|
export const adminUpsertValidatorProfileTransformer = async (data) => await AdminValidatorProfileResponse.parseAsync(data);
|
|
8
8
|
export const adminUpsertValidatorProfileErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
9
9
|
/**
|
|
@@ -405,42 +405,6 @@ export const getValidatorV3 = async (options) => {
|
|
|
405
405
|
}
|
|
406
406
|
return result;
|
|
407
407
|
};
|
|
408
|
-
export const getCheckpointsSignedByValidatorV3Transformer = async (data) => await CheckpointsSignedV3Response.parseAsync(data);
|
|
409
|
-
export const getCheckpointsSignedByValidatorV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
410
|
-
export const getCheckpointsSignedByValidatorV3 = async (options) => {
|
|
411
|
-
let result;
|
|
412
|
-
try {
|
|
413
|
-
result = await getCheckpointsSignedByValidatorV32(options);
|
|
414
|
-
}
|
|
415
|
-
catch (err) {
|
|
416
|
-
if (err instanceof Error) {
|
|
417
|
-
throw new TransportError(err);
|
|
418
|
-
}
|
|
419
|
-
let typedErr;
|
|
420
|
-
try {
|
|
421
|
-
typedErr = await getCheckpointsSignedByValidatorV3ErrorTransformer(err);
|
|
422
|
-
}
|
|
423
|
-
catch (validationError) {
|
|
424
|
-
throw new ResponseValidationError(validationError, err);
|
|
425
|
-
}
|
|
426
|
-
throw typedErr;
|
|
427
|
-
}
|
|
428
|
-
const errorBearing = result;
|
|
429
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
430
|
-
if (errorBearing.error instanceof Error) {
|
|
431
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
432
|
-
}
|
|
433
|
-
else {
|
|
434
|
-
try {
|
|
435
|
-
errorBearing.error = await getCheckpointsSignedByValidatorV3ErrorTransformer(errorBearing.error);
|
|
436
|
-
}
|
|
437
|
-
catch (validationError) {
|
|
438
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
return result;
|
|
443
|
-
};
|
|
444
408
|
export const getCheckpointsSignedPageV3Transformer = async (data) => await CheckpointsSignedCursorV3Response.parseAsync(data);
|
|
445
409
|
export const getCheckpointsSignedPageV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
446
410
|
export const getCheckpointsSignedPageV3InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(CheckpointsSignedCursorQuery, input.query) } : {} });
|
|
@@ -489,42 +453,6 @@ export const getCheckpointsSignedPageV3Options = (options) => queryOptions({ que
|
|
|
489
453
|
});
|
|
490
454
|
return data;
|
|
491
455
|
}, queryKey: getCheckpointsSignedPageV3QueryKey(options) });
|
|
492
|
-
export const getAllDelegatorsV3Transformer = async (data) => await DelegatorsListV3Response.parseAsync(data);
|
|
493
|
-
export const getAllDelegatorsV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
494
|
-
export const getAllDelegatorsV3 = async (options) => {
|
|
495
|
-
let result;
|
|
496
|
-
try {
|
|
497
|
-
result = await getAllDelegatorsV32(options);
|
|
498
|
-
}
|
|
499
|
-
catch (err) {
|
|
500
|
-
if (err instanceof Error) {
|
|
501
|
-
throw new TransportError(err);
|
|
502
|
-
}
|
|
503
|
-
let typedErr;
|
|
504
|
-
try {
|
|
505
|
-
typedErr = await getAllDelegatorsV3ErrorTransformer(err);
|
|
506
|
-
}
|
|
507
|
-
catch (validationError) {
|
|
508
|
-
throw new ResponseValidationError(validationError, err);
|
|
509
|
-
}
|
|
510
|
-
throw typedErr;
|
|
511
|
-
}
|
|
512
|
-
const errorBearing = result;
|
|
513
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
514
|
-
if (errorBearing.error instanceof Error) {
|
|
515
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
516
|
-
}
|
|
517
|
-
else {
|
|
518
|
-
try {
|
|
519
|
-
errorBearing.error = await getAllDelegatorsV3ErrorTransformer(errorBearing.error);
|
|
520
|
-
}
|
|
521
|
-
catch (validationError) {
|
|
522
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
523
|
-
}
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
return result;
|
|
527
|
-
};
|
|
528
456
|
export const getAllDelegatorsPageV3Transformer = async (data) => await DelegatorsCursorV3Response.parseAsync(data);
|
|
529
457
|
export const getAllDelegatorsPageV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
530
458
|
export const getAllDelegatorsPageV3InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(DelegatorsCursorQuery, input.query) } : {} });
|
|
@@ -645,42 +573,6 @@ export const getDelegatorUnbondsV3 = async (options) => {
|
|
|
645
573
|
}
|
|
646
574
|
return result;
|
|
647
575
|
};
|
|
648
|
-
export const getValidatorDelegatorsV3Transformer = async (data) => await DelegatorsListV3Response.parseAsync(data);
|
|
649
|
-
export const getValidatorDelegatorsV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
650
|
-
export const getValidatorDelegatorsV3 = async (options) => {
|
|
651
|
-
let result;
|
|
652
|
-
try {
|
|
653
|
-
result = await getValidatorDelegatorsV32(options);
|
|
654
|
-
}
|
|
655
|
-
catch (err) {
|
|
656
|
-
if (err instanceof Error) {
|
|
657
|
-
throw new TransportError(err);
|
|
658
|
-
}
|
|
659
|
-
let typedErr;
|
|
660
|
-
try {
|
|
661
|
-
typedErr = await getValidatorDelegatorsV3ErrorTransformer(err);
|
|
662
|
-
}
|
|
663
|
-
catch (validationError) {
|
|
664
|
-
throw new ResponseValidationError(validationError, err);
|
|
665
|
-
}
|
|
666
|
-
throw typedErr;
|
|
667
|
-
}
|
|
668
|
-
const errorBearing = result;
|
|
669
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
670
|
-
if (errorBearing.error instanceof Error) {
|
|
671
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
672
|
-
}
|
|
673
|
-
else {
|
|
674
|
-
try {
|
|
675
|
-
errorBearing.error = await getValidatorDelegatorsV3ErrorTransformer(errorBearing.error);
|
|
676
|
-
}
|
|
677
|
-
catch (validationError) {
|
|
678
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
679
|
-
}
|
|
680
|
-
}
|
|
681
|
-
}
|
|
682
|
-
return result;
|
|
683
|
-
};
|
|
684
576
|
export const getValidatorDelegatorsPageV3Transformer = async (data) => await DelegatorsCursorV3Response.parseAsync(data);
|
|
685
577
|
export const getValidatorDelegatorsPageV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
686
578
|
export const getValidatorDelegatorsPageV3InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(DelegatorsCursorQuery, input.query) } : {} });
|
|
@@ -921,42 +813,6 @@ export const getValidatorByAddressV2 = async (options) => {
|
|
|
921
813
|
}
|
|
922
814
|
return result;
|
|
923
815
|
};
|
|
924
|
-
export const getCheckpointsSignedByValidatorV2Transformer = async (data) => await V2ValidatorArrayResponse.parseAsync(data);
|
|
925
|
-
export const getCheckpointsSignedByValidatorV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
926
|
-
export const getCheckpointsSignedByValidatorV2 = async (options) => {
|
|
927
|
-
let result;
|
|
928
|
-
try {
|
|
929
|
-
result = await getCheckpointsSignedByValidatorV22(options);
|
|
930
|
-
}
|
|
931
|
-
catch (err) {
|
|
932
|
-
if (err instanceof Error) {
|
|
933
|
-
throw new TransportError(err);
|
|
934
|
-
}
|
|
935
|
-
let typedErr;
|
|
936
|
-
try {
|
|
937
|
-
typedErr = await getCheckpointsSignedByValidatorV2ErrorTransformer(err);
|
|
938
|
-
}
|
|
939
|
-
catch (validationError) {
|
|
940
|
-
throw new ResponseValidationError(validationError, err);
|
|
941
|
-
}
|
|
942
|
-
throw typedErr;
|
|
943
|
-
}
|
|
944
|
-
const errorBearing = result;
|
|
945
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
946
|
-
if (errorBearing.error instanceof Error) {
|
|
947
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
try {
|
|
951
|
-
errorBearing.error = await getCheckpointsSignedByValidatorV2ErrorTransformer(errorBearing.error);
|
|
952
|
-
}
|
|
953
|
-
catch (validationError) {
|
|
954
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
955
|
-
}
|
|
956
|
-
}
|
|
957
|
-
}
|
|
958
|
-
return result;
|
|
959
|
-
};
|
|
960
816
|
export const getCheckpointsSignedPageV2Transformer = async (data) => await CheckpointsSignedCursorV2Response.parseAsync(data);
|
|
961
817
|
export const getCheckpointsSignedPageV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
962
818
|
export const getCheckpointsSignedPageV2InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(CheckpointsSignedCursorQuery, input.query) } : {} });
|
|
@@ -1173,42 +1029,6 @@ export const updateValidatorV2Options = (options) => queryOptions({ queryFn: asy
|
|
|
1173
1029
|
});
|
|
1174
1030
|
return data;
|
|
1175
1031
|
}, queryKey: updateValidatorV2QueryKey(options) });
|
|
1176
|
-
export const getAllDelegatorsV2Transformer = async (data) => await V2DelegatorArrayResponse.parseAsync(data);
|
|
1177
|
-
export const getAllDelegatorsV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1178
|
-
export const getAllDelegatorsV2 = async (options) => {
|
|
1179
|
-
let result;
|
|
1180
|
-
try {
|
|
1181
|
-
result = await getAllDelegatorsV22(options);
|
|
1182
|
-
}
|
|
1183
|
-
catch (err) {
|
|
1184
|
-
if (err instanceof Error) {
|
|
1185
|
-
throw new TransportError(err);
|
|
1186
|
-
}
|
|
1187
|
-
let typedErr;
|
|
1188
|
-
try {
|
|
1189
|
-
typedErr = await getAllDelegatorsV2ErrorTransformer(err);
|
|
1190
|
-
}
|
|
1191
|
-
catch (validationError) {
|
|
1192
|
-
throw new ResponseValidationError(validationError, err);
|
|
1193
|
-
}
|
|
1194
|
-
throw typedErr;
|
|
1195
|
-
}
|
|
1196
|
-
const errorBearing = result;
|
|
1197
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
1198
|
-
if (errorBearing.error instanceof Error) {
|
|
1199
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
1200
|
-
}
|
|
1201
|
-
else {
|
|
1202
|
-
try {
|
|
1203
|
-
errorBearing.error = await getAllDelegatorsV2ErrorTransformer(errorBearing.error);
|
|
1204
|
-
}
|
|
1205
|
-
catch (validationError) {
|
|
1206
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
1207
|
-
}
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
return result;
|
|
1211
|
-
};
|
|
1212
1032
|
export const getAllDelegatorsPageV2Transformer = async (data) => await DelegatorsCursorV2Response.parseAsync(data);
|
|
1213
1033
|
export const getAllDelegatorsPageV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1214
1034
|
export const getAllDelegatorsPageV2InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(DelegatorsCursorQuery, input.query) } : {} });
|
|
@@ -1329,42 +1149,6 @@ export const getDelegatorUnbondsV2 = async (options) => {
|
|
|
1329
1149
|
}
|
|
1330
1150
|
return result;
|
|
1331
1151
|
};
|
|
1332
|
-
export const getValidatorDelegatorsV2Transformer = async (data) => await V2DelegatorArrayResponse.parseAsync(data);
|
|
1333
|
-
export const getValidatorDelegatorsV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1334
|
-
export const getValidatorDelegatorsV2 = async (options) => {
|
|
1335
|
-
let result;
|
|
1336
|
-
try {
|
|
1337
|
-
result = await getValidatorDelegatorsV22(options);
|
|
1338
|
-
}
|
|
1339
|
-
catch (err) {
|
|
1340
|
-
if (err instanceof Error) {
|
|
1341
|
-
throw new TransportError(err);
|
|
1342
|
-
}
|
|
1343
|
-
let typedErr;
|
|
1344
|
-
try {
|
|
1345
|
-
typedErr = await getValidatorDelegatorsV2ErrorTransformer(err);
|
|
1346
|
-
}
|
|
1347
|
-
catch (validationError) {
|
|
1348
|
-
throw new ResponseValidationError(validationError, err);
|
|
1349
|
-
}
|
|
1350
|
-
throw typedErr;
|
|
1351
|
-
}
|
|
1352
|
-
const errorBearing = result;
|
|
1353
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
1354
|
-
if (errorBearing.error instanceof Error) {
|
|
1355
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
1356
|
-
}
|
|
1357
|
-
else {
|
|
1358
|
-
try {
|
|
1359
|
-
errorBearing.error = await getValidatorDelegatorsV2ErrorTransformer(errorBearing.error);
|
|
1360
|
-
}
|
|
1361
|
-
catch (validationError) {
|
|
1362
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
1363
|
-
}
|
|
1364
|
-
}
|
|
1365
|
-
}
|
|
1366
|
-
return result;
|
|
1367
|
-
};
|
|
1368
1152
|
export const getValidatorDelegatorsPageV2Transformer = async (data) => await DelegatorsCursorV2Response.parseAsync(data);
|
|
1369
1153
|
export const getValidatorDelegatorsPageV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1370
1154
|
export const getValidatorDelegatorsPageV2InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(DelegatorsCursorQuery, input.query) } : {} });
|
|
@@ -1629,54 +1413,6 @@ export const getPerformanceBenchmarkV2 = async (options) => {
|
|
|
1629
1413
|
}
|
|
1630
1414
|
return result;
|
|
1631
1415
|
};
|
|
1632
|
-
export const getAllNotificationsV2Transformer = async (data) => await NotificationArrayResponse.parseAsync(data);
|
|
1633
|
-
export const getAllNotificationsV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1634
|
-
export const getAllNotificationsV2InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(GetAllNotificationsQuery, input.query) } : {} });
|
|
1635
|
-
export const getAllNotificationsV2 = async (options) => {
|
|
1636
|
-
const transformed = await getAllNotificationsV2InputTransformer(options ?? {});
|
|
1637
|
-
let result;
|
|
1638
|
-
try {
|
|
1639
|
-
result = await getAllNotificationsV22({ ...options, ...transformed });
|
|
1640
|
-
}
|
|
1641
|
-
catch (err) {
|
|
1642
|
-
if (err instanceof Error) {
|
|
1643
|
-
throw new TransportError(err);
|
|
1644
|
-
}
|
|
1645
|
-
let typedErr;
|
|
1646
|
-
try {
|
|
1647
|
-
typedErr = await getAllNotificationsV2ErrorTransformer(err);
|
|
1648
|
-
}
|
|
1649
|
-
catch (validationError) {
|
|
1650
|
-
throw new ResponseValidationError(validationError, err);
|
|
1651
|
-
}
|
|
1652
|
-
throw typedErr;
|
|
1653
|
-
}
|
|
1654
|
-
const errorBearing = result;
|
|
1655
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
1656
|
-
if (errorBearing.error instanceof Error) {
|
|
1657
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
1658
|
-
}
|
|
1659
|
-
else {
|
|
1660
|
-
try {
|
|
1661
|
-
errorBearing.error = await getAllNotificationsV2ErrorTransformer(errorBearing.error);
|
|
1662
|
-
}
|
|
1663
|
-
catch (validationError) {
|
|
1664
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
1665
|
-
}
|
|
1666
|
-
}
|
|
1667
|
-
}
|
|
1668
|
-
return result;
|
|
1669
|
-
};
|
|
1670
|
-
export const getAllNotificationsV2QueryKey = (options) => createQueryKey('getAllNotificationsV2', { ...options, ...options?.query !== undefined ? { query: z.encode(GetAllNotificationsQuery, options?.query) } : {} });
|
|
1671
|
-
export const getAllNotificationsV2Options = (options) => queryOptions({ queryFn: async ({ queryKey, signal }) => {
|
|
1672
|
-
const { data } = await getAllNotificationsV22({
|
|
1673
|
-
...options,
|
|
1674
|
-
...queryKey[0],
|
|
1675
|
-
signal,
|
|
1676
|
-
throwOnError: true
|
|
1677
|
-
});
|
|
1678
|
-
return data;
|
|
1679
|
-
}, queryKey: getAllNotificationsV2QueryKey(options) });
|
|
1680
1416
|
export const getAllNotificationsPageV2Transformer = async (data) => await NotificationsCursorResponse.parseAsync(data);
|
|
1681
1417
|
export const getAllNotificationsPageV2ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1682
1418
|
export const getAllNotificationsPageV2InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(NotificationsCursorQuery, input.query) } : {} });
|
|
@@ -1725,54 +1461,6 @@ export const getAllNotificationsPageV2Options = (options) => queryOptions({ quer
|
|
|
1725
1461
|
});
|
|
1726
1462
|
return data;
|
|
1727
1463
|
}, queryKey: getAllNotificationsPageV2QueryKey(options) });
|
|
1728
|
-
export const getAllNotificationsV3Transformer = async (data) => await NotificationArrayResponse.parseAsync(data);
|
|
1729
|
-
export const getAllNotificationsV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1730
|
-
export const getAllNotificationsV3InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(GetAllNotificationsQuery, input.query) } : {} });
|
|
1731
|
-
export const getAllNotificationsV3 = async (options) => {
|
|
1732
|
-
const transformed = await getAllNotificationsV3InputTransformer(options ?? {});
|
|
1733
|
-
let result;
|
|
1734
|
-
try {
|
|
1735
|
-
result = await getAllNotificationsV32({ ...options, ...transformed });
|
|
1736
|
-
}
|
|
1737
|
-
catch (err) {
|
|
1738
|
-
if (err instanceof Error) {
|
|
1739
|
-
throw new TransportError(err);
|
|
1740
|
-
}
|
|
1741
|
-
let typedErr;
|
|
1742
|
-
try {
|
|
1743
|
-
typedErr = await getAllNotificationsV3ErrorTransformer(err);
|
|
1744
|
-
}
|
|
1745
|
-
catch (validationError) {
|
|
1746
|
-
throw new ResponseValidationError(validationError, err);
|
|
1747
|
-
}
|
|
1748
|
-
throw typedErr;
|
|
1749
|
-
}
|
|
1750
|
-
const errorBearing = result;
|
|
1751
|
-
if (typeof result === "object" && result !== null && "request" in result && "response" in result && (typeof errorBearing.error === "object" && errorBearing.error !== null)) {
|
|
1752
|
-
if (errorBearing.error instanceof Error) {
|
|
1753
|
-
errorBearing.error = new TransportError(errorBearing.error);
|
|
1754
|
-
}
|
|
1755
|
-
else {
|
|
1756
|
-
try {
|
|
1757
|
-
errorBearing.error = await getAllNotificationsV3ErrorTransformer(errorBearing.error);
|
|
1758
|
-
}
|
|
1759
|
-
catch (validationError) {
|
|
1760
|
-
errorBearing.error = new ResponseValidationError(validationError, errorBearing.error);
|
|
1761
|
-
}
|
|
1762
|
-
}
|
|
1763
|
-
}
|
|
1764
|
-
return result;
|
|
1765
|
-
};
|
|
1766
|
-
export const getAllNotificationsV3QueryKey = (options) => createQueryKey('getAllNotificationsV3', { ...options, ...options?.query !== undefined ? { query: z.encode(GetAllNotificationsQuery, options?.query) } : {} });
|
|
1767
|
-
export const getAllNotificationsV3Options = (options) => queryOptions({ queryFn: async ({ queryKey, signal }) => {
|
|
1768
|
-
const { data } = await getAllNotificationsV32({
|
|
1769
|
-
...options,
|
|
1770
|
-
...queryKey[0],
|
|
1771
|
-
signal,
|
|
1772
|
-
throwOnError: true
|
|
1773
|
-
});
|
|
1774
|
-
return data;
|
|
1775
|
-
}, queryKey: getAllNotificationsV3QueryKey(options) });
|
|
1776
1464
|
export const getAllNotificationsPageV3Transformer = async (data) => await NotificationsCursorResponse.parseAsync(data);
|
|
1777
1465
|
export const getAllNotificationsPageV3ErrorTransformer = async (data) => await z.union([ValidationErrorResponse, ErrorResponse]).parseAsync(data);
|
|
1778
1466
|
export const getAllNotificationsPageV3InputTransformer = async (input) => ({ ...input.query !== undefined ? { query: await z.encode(NotificationsCursorQuery, input.query) } : {} });
|