@polygonlabs/staker-pool-allocations-client 0.1.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/MIGRATION.md +5 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts +796 -0
- package/dist/generated/@tanstack/react-query.gen.d.ts.map +1 -0
- package/dist/generated/@tanstack/react-query.gen.js +283 -0
- package/dist/generated/@tanstack/react-query.gen.js.map +1 -0
- package/dist/generated/client/client.gen.d.ts +3 -0
- package/dist/generated/client/client.gen.d.ts.map +1 -0
- package/dist/generated/client/client.gen.js +236 -0
- package/dist/generated/client/client.gen.js.map +1 -0
- package/dist/generated/client/index.d.ts +9 -0
- package/dist/generated/client/index.d.ts.map +1 -0
- package/dist/generated/client/index.js +7 -0
- package/dist/generated/client/index.js.map +1 -0
- package/dist/generated/client/types.gen.d.ts +118 -0
- package/dist/generated/client/types.gen.d.ts.map +1 -0
- package/dist/generated/client/types.gen.js +3 -0
- package/dist/generated/client/types.gen.js.map +1 -0
- package/dist/generated/client/utils.gen.d.ts +34 -0
- package/dist/generated/client/utils.gen.d.ts.map +1 -0
- package/dist/generated/client/utils.gen.js +229 -0
- package/dist/generated/client/utils.gen.js.map +1 -0
- package/dist/generated/client.gen.d.ts +13 -0
- package/dist/generated/client.gen.d.ts.map +1 -0
- package/dist/generated/client.gen.js +4 -0
- package/dist/generated/client.gen.js.map +1 -0
- package/dist/generated/core/auth.gen.d.ts +19 -0
- package/dist/generated/core/auth.gen.d.ts.map +1 -0
- package/dist/generated/core/auth.gen.js +15 -0
- package/dist/generated/core/auth.gen.js.map +1 -0
- package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
- package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/bodySerializer.gen.js +58 -0
- package/dist/generated/core/bodySerializer.gen.js.map +1 -0
- package/dist/generated/core/params.gen.d.ts +44 -0
- package/dist/generated/core/params.gen.d.ts.map +1 -0
- package/dist/generated/core/params.gen.js +101 -0
- package/dist/generated/core/params.gen.js.map +1 -0
- package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
- package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/pathSerializer.gen.js +107 -0
- package/dist/generated/core/pathSerializer.gen.js.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
- package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
- package/dist/generated/core/queryKeySerializer.gen.js +93 -0
- package/dist/generated/core/queryKeySerializer.gen.js.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
- package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
- package/dist/generated/core/serverSentEvents.gen.js +134 -0
- package/dist/generated/core/serverSentEvents.gen.js.map +1 -0
- package/dist/generated/core/types.gen.d.ts +79 -0
- package/dist/generated/core/types.gen.d.ts.map +1 -0
- package/dist/generated/core/types.gen.js +3 -0
- package/dist/generated/core/types.gen.js.map +1 -0
- package/dist/generated/core/utils.gen.d.ts +20 -0
- package/dist/generated/core/utils.gen.d.ts.map +1 -0
- package/dist/generated/core/utils.gen.js +88 -0
- package/dist/generated/core/utils.gen.js.map +1 -0
- package/dist/generated/index.d.ts +4 -0
- package/dist/generated/index.d.ts.map +1 -0
- package/dist/generated/index.js +5 -0
- package/dist/generated/index.js.map +1 -0
- package/dist/generated/registry-validator.gen.d.ts +168 -0
- package/dist/generated/registry-validator.gen.d.ts.map +1 -0
- package/dist/generated/registry-validator.gen.js +402 -0
- package/dist/generated/registry-validator.gen.js.map +1 -0
- package/dist/generated/sdk.gen.d.ts +71 -0
- package/dist/generated/sdk.gen.d.ts.map +1 -0
- package/dist/generated/sdk.gen.js +98 -0
- package/dist/generated/sdk.gen.js.map +1 -0
- package/dist/generated/types.gen.d.ts +435 -0
- package/dist/generated/types.gen.d.ts.map +1 -0
- package/dist/generated/types.gen.js +3 -0
- package/dist/generated/types.gen.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +33 -0
- package/dist/index.js.map +1 -0
- package/dist/react.d.ts +2 -0
- package/dist/react.d.ts.map +1 -0
- package/dist/react.js +18 -0
- package/dist/react.js.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/package.json +68 -0
- package/src/generated/@tanstack/react-query.gen.ts +322 -0
- package/src/generated/client/client.gen.ts +298 -0
- package/src/generated/client/index.ts +25 -0
- package/src/generated/client/types.gen.ts +214 -0
- package/src/generated/client/utils.gen.ts +316 -0
- package/src/generated/client.gen.ts +16 -0
- package/src/generated/core/auth.gen.ts +41 -0
- package/src/generated/core/bodySerializer.gen.ts +82 -0
- package/src/generated/core/params.gen.ts +169 -0
- package/src/generated/core/pathSerializer.gen.ts +171 -0
- package/src/generated/core/queryKeySerializer.gen.ts +117 -0
- package/src/generated/core/serverSentEvents.gen.ts +243 -0
- package/src/generated/core/types.gen.ts +104 -0
- package/src/generated/core/utils.gen.ts +140 -0
- package/src/generated/index.ts +5 -0
- package/src/generated/registry-validator.gen.ts +607 -0
- package/src/generated/sdk.gen.ts +124 -0
- package/src/generated/types.gen.ts +503 -0
- package/src/index.ts +68 -0
- package/src/react.ts +42 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
import type { BodySerializer, QuerySerializer } from './bodySerializer.gen.js';
|
|
4
|
+
import {
|
|
5
|
+
type ArraySeparatorStyle,
|
|
6
|
+
serializeArrayParam,
|
|
7
|
+
serializeObjectParam,
|
|
8
|
+
serializePrimitiveParam,
|
|
9
|
+
} from './pathSerializer.gen.js';
|
|
10
|
+
|
|
11
|
+
export interface PathSerializer {
|
|
12
|
+
path: Record<string, unknown>;
|
|
13
|
+
url: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
17
|
+
|
|
18
|
+
export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => {
|
|
19
|
+
let url = _url;
|
|
20
|
+
const matches = _url.match(PATH_PARAM_RE);
|
|
21
|
+
if (matches) {
|
|
22
|
+
for (const match of matches) {
|
|
23
|
+
let explode = false;
|
|
24
|
+
let name = match.substring(1, match.length - 1);
|
|
25
|
+
let style: ArraySeparatorStyle = 'simple';
|
|
26
|
+
|
|
27
|
+
if (name.endsWith('*')) {
|
|
28
|
+
explode = true;
|
|
29
|
+
name = name.substring(0, name.length - 1);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (name.startsWith('.')) {
|
|
33
|
+
name = name.substring(1);
|
|
34
|
+
style = 'label';
|
|
35
|
+
} else if (name.startsWith(';')) {
|
|
36
|
+
name = name.substring(1);
|
|
37
|
+
style = 'matrix';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const value = path[name];
|
|
41
|
+
|
|
42
|
+
if (value === undefined || value === null) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (Array.isArray(value)) {
|
|
47
|
+
url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (typeof value === 'object') {
|
|
52
|
+
url = url.replace(
|
|
53
|
+
match,
|
|
54
|
+
serializeObjectParam({
|
|
55
|
+
explode,
|
|
56
|
+
name,
|
|
57
|
+
style,
|
|
58
|
+
value: value as Record<string, unknown>,
|
|
59
|
+
valueOnly: true,
|
|
60
|
+
}),
|
|
61
|
+
);
|
|
62
|
+
continue;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (style === 'matrix') {
|
|
66
|
+
url = url.replace(
|
|
67
|
+
match,
|
|
68
|
+
`;${serializePrimitiveParam({
|
|
69
|
+
name,
|
|
70
|
+
value: value as string,
|
|
71
|
+
})}`,
|
|
72
|
+
);
|
|
73
|
+
continue;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const replaceValue = encodeURIComponent(
|
|
77
|
+
style === 'label' ? `.${value as string}` : (value as string),
|
|
78
|
+
);
|
|
79
|
+
url = url.replace(match, replaceValue);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return url;
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export const getUrl = ({
|
|
86
|
+
baseUrl,
|
|
87
|
+
path,
|
|
88
|
+
query,
|
|
89
|
+
querySerializer,
|
|
90
|
+
url: _url,
|
|
91
|
+
}: {
|
|
92
|
+
baseUrl?: string;
|
|
93
|
+
path?: Record<string, unknown>;
|
|
94
|
+
query?: Record<string, unknown>;
|
|
95
|
+
querySerializer: QuerySerializer;
|
|
96
|
+
url: string;
|
|
97
|
+
}) => {
|
|
98
|
+
const pathUrl = _url.startsWith('/') ? _url : `/${_url}`;
|
|
99
|
+
let url = (baseUrl ?? '') + pathUrl;
|
|
100
|
+
if (path) {
|
|
101
|
+
url = defaultPathSerializer({ path, url });
|
|
102
|
+
}
|
|
103
|
+
let search = query ? querySerializer(query) : '';
|
|
104
|
+
if (search.startsWith('?')) {
|
|
105
|
+
search = search.substring(1);
|
|
106
|
+
}
|
|
107
|
+
if (search) {
|
|
108
|
+
url += `?${search}`;
|
|
109
|
+
}
|
|
110
|
+
return url;
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export function getValidRequestBody(options: {
|
|
114
|
+
body?: unknown;
|
|
115
|
+
bodySerializer?: BodySerializer | null;
|
|
116
|
+
serializedBody?: unknown;
|
|
117
|
+
}) {
|
|
118
|
+
const hasBody = options.body !== undefined;
|
|
119
|
+
const isSerializedBody = hasBody && options.bodySerializer;
|
|
120
|
+
|
|
121
|
+
if (isSerializedBody) {
|
|
122
|
+
if ('serializedBody' in options) {
|
|
123
|
+
const hasSerializedBody =
|
|
124
|
+
options.serializedBody !== undefined && options.serializedBody !== '';
|
|
125
|
+
|
|
126
|
+
return hasSerializedBody ? options.serializedBody : null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// not all clients implement a serializedBody property (i.e., client-axios)
|
|
130
|
+
return options.body !== '' ? options.body : null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
// plain/text body
|
|
134
|
+
if (hasBody) {
|
|
135
|
+
return options.body;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// no body was provided
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file is auto-generated by @hey-api/openapi-ts
|
|
2
|
+
|
|
3
|
+
export { getAddressAllocationHistoryOptions, getAddressAllocationHistoryQueryKey, getAllocationOptions, getAllocationQueryKey, getDistributionOptions, getDistributionQueryKey, getHealthCheckOptions, getHealthCheckQueryKey, getProofOptions, getProofQueryKey, getReadinessOptions, getReadinessQueryKey, getUnclaimedProofsOptions, getUnclaimedProofsQueryKey, listAllocationsInfiniteOptions, listAllocationsInfiniteQueryKey, listAllocationsOptions, listAllocationsQueryKey, listDistributionsInfiniteOptions, listDistributionsInfiniteQueryKey, listDistributionsOptions, listDistributionsQueryKey, listExcludedAllocationsOptions, listExcludedAllocationsQueryKey } from './@tanstack/react-query.gen.js';
|
|
4
|
+
export { client, type CreateClientConfig } from './client.gen.js';
|
|
5
|
+
export { getAddressAllocationHistory, type GetAddressAllocationHistoryError, type GetAddressAllocationHistoryErrors, getAddressAllocationHistoryErrorTransformer, type GetAddressAllocationHistoryResponse, type GetAddressAllocationHistoryResponses, getAddressAllocationHistoryTransformer, getAllocation, type GetAllocationError, type GetAllocationErrors, getAllocationErrorTransformer, type GetAllocationResponse, type GetAllocationResponses, getAllocationTransformer, getDistribution, type GetDistributionError, type GetDistributionErrors, getDistributionErrorTransformer, type GetDistributionResponse, type GetDistributionResponses, getDistributionTransformer, getHealthCheck, type GetHealthCheckError, type GetHealthCheckErrors, getHealthCheckErrorTransformer, type GetHealthCheckResponse, type GetHealthCheckResponses, getHealthCheckTransformer, getProof, type GetProofError, type GetProofErrors, getProofErrorTransformer, type GetProofResponse, type GetProofResponses, getProofTransformer, getReadiness, type GetReadinessError, type GetReadinessErrors, getReadinessErrorTransformer, type GetReadinessResponse, type GetReadinessResponses, getReadinessTransformer, getUnclaimedProofs, type GetUnclaimedProofsError, type GetUnclaimedProofsErrors, getUnclaimedProofsErrorTransformer, type GetUnclaimedProofsResponse, type GetUnclaimedProofsResponses, getUnclaimedProofsTransformer, isResponseValidationError, isTransportError, isWrapperError, listAllocations, type ListAllocationsError, type ListAllocationsErrors, listAllocationsErrorTransformer, type ListAllocationsResponse, type ListAllocationsResponses, listAllocationsTransformer, listDistributions, type ListDistributionsError, type ListDistributionsErrors, listDistributionsErrorTransformer, type ListDistributionsResponse, type ListDistributionsResponses, listDistributionsTransformer, listExcludedAllocations, type ListExcludedAllocationsError, type ListExcludedAllocationsErrors, listExcludedAllocationsErrorTransformer, type ListExcludedAllocationsResponse, type ListExcludedAllocationsResponses, listExcludedAllocationsTransformer, ResponseValidationError, TransportError, type WrapErrors } from './registry-validator.gen.js';
|