@scalepad/sdk-core 0.1.0 → 0.1.1

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/src/generated.ts DELETED
@@ -1,303 +0,0 @@
1
- /* eslint-disable */
2
- import type { paths } from "./schema.js";
3
- import { BaseApiClient, type BaseClientConfig } from "./runtime.js";
4
-
5
- export type ListassetshardwareQuery = NonNullable<paths['/core/v1/assets/hardware']['get']['parameters']>['query'];
6
- export type ListassetshardwarePathParams = never;
7
- export type ListassetshardwareBody = never;
8
- export type ListassetshardwareResponse = paths['/core/v1/assets/hardware']['get']['responses']['200']['content']['application/json'];
9
- type ListassetshardwareOperation = paths['/core/v1/assets/hardware']['get'];
10
-
11
- export type GetassetshardwarebyidQuery = never;
12
- export type GetassetshardwarebyidPathParams = NonNullable<paths['/core/v1/assets/hardware/{id}']['get']['parameters']>['path'];
13
- export type GetassetshardwarebyidBody = never;
14
- export type GetassetshardwarebyidResponse = paths['/core/v1/assets/hardware/{id}']['get']['responses']['200']['content']['application/json'];
15
- type GetassetshardwarebyidOperation = paths['/core/v1/assets/hardware/{id}']['get'];
16
-
17
- export type ListassetssaasQuery = NonNullable<paths['/core/v1/assets/saas']['get']['parameters']>['query'];
18
- export type ListassetssaasPathParams = never;
19
- export type ListassetssaasBody = never;
20
- export type ListassetssaasResponse = paths['/core/v1/assets/saas']['get']['responses']['200']['content']['application/json'];
21
- type ListassetssaasOperation = paths['/core/v1/assets/saas']['get'];
22
-
23
- export type ListassetssaasusersQuery = NonNullable<paths['/core/v1/assets/saas-users']['get']['parameters']>['query'];
24
- export type ListassetssaasusersPathParams = never;
25
- export type ListassetssaasusersBody = never;
26
- export type ListassetssaasusersResponse = paths['/core/v1/assets/saas-users']['get']['responses']['200']['content']['application/json'];
27
- type ListassetssaasusersOperation = paths['/core/v1/assets/saas-users']['get'];
28
-
29
- export type GetassetssaasusersbyidQuery = never;
30
- export type GetassetssaasusersbyidPathParams = NonNullable<paths['/core/v1/assets/saas-users/{id}']['get']['parameters']>['path'];
31
- export type GetassetssaasusersbyidBody = never;
32
- export type GetassetssaasusersbyidResponse = paths['/core/v1/assets/saas-users/{id}']['get']['responses']['200']['content']['application/json'];
33
- type GetassetssaasusersbyidOperation = paths['/core/v1/assets/saas-users/{id}']['get'];
34
-
35
- export type GetassetssaasbyidQuery = never;
36
- export type GetassetssaasbyidPathParams = NonNullable<paths['/core/v1/assets/saas/{id}']['get']['parameters']>['path'];
37
- export type GetassetssaasbyidBody = never;
38
- export type GetassetssaasbyidResponse = paths['/core/v1/assets/saas/{id}']['get']['responses']['200']['content']['application/json'];
39
- type GetassetssaasbyidOperation = paths['/core/v1/assets/saas/{id}']['get'];
40
-
41
- export type ListclientsQuery = NonNullable<paths['/core/v1/clients']['get']['parameters']>['query'];
42
- export type ListclientsPathParams = never;
43
- export type ListclientsBody = never;
44
- export type ListclientsResponse = paths['/core/v1/clients']['get']['responses']['200']['content']['application/json'];
45
- type ListclientsOperation = paths['/core/v1/clients']['get'];
46
-
47
- export type GetclientsbyidQuery = never;
48
- export type GetclientsbyidPathParams = NonNullable<paths['/core/v1/clients/{id}']['get']['parameters']>['path'];
49
- export type GetclientsbyidBody = never;
50
- export type GetclientsbyidResponse = paths['/core/v1/clients/{id}']['get']['responses']['200']['content']['application/json'];
51
- type GetclientsbyidOperation = paths['/core/v1/clients/{id}']['get'];
52
-
53
- export type CreatecontactsQuery = NonNullable<paths['/core/v1/contacts']['post']['parameters']>['query'];
54
- export type CreatecontactsPathParams = never;
55
- export type CreatecontactsBody = NonNullable<paths['/core/v1/contacts']['post']['requestBody']>['content']['application/json'];
56
- export type CreatecontactsResponse = paths['/core/v1/contacts']['post']['responses']['200']['content']['application/json'];
57
- type CreatecontactsOperation = paths['/core/v1/contacts']['post'];
58
-
59
- export type GetcontactsbyidQuery = never;
60
- export type GetcontactsbyidPathParams = NonNullable<paths['/core/v1/contacts/{id}']['get']['parameters']>['path'];
61
- export type GetcontactsbyidBody = never;
62
- export type GetcontactsbyidResponse = paths['/core/v1/contacts/{id}']['get']['responses']['200']['content']['application/json'];
63
- type GetcontactsbyidOperation = paths['/core/v1/contacts/{id}']['get'];
64
-
65
- export type ListintegrationsconfigurationsQuery = never;
66
- export type ListintegrationsconfigurationsPathParams = never;
67
- export type ListintegrationsconfigurationsBody = never;
68
- export type ListintegrationsconfigurationsResponse = paths['/core/v1/integrations/configurations']['get']['responses']['200']['content']['application/json'];
69
- type ListintegrationsconfigurationsOperation = paths['/core/v1/integrations/configurations']['get'];
70
-
71
- export type ListintegrationsvendorsQuery = NonNullable<paths['/core/v1/integrations/vendors']['get']['parameters']>['query'];
72
- export type ListintegrationsvendorsPathParams = never;
73
- export type ListintegrationsvendorsBody = never;
74
- export type ListintegrationsvendorsResponse = paths['/core/v1/integrations/vendors']['get']['responses']['200']['content']['application/json'];
75
- type ListintegrationsvendorsOperation = paths['/core/v1/integrations/vendors']['get'];
76
-
77
- export type CreatemembersQuery = NonNullable<paths['/core/v1/members']['post']['parameters']>['query'];
78
- export type CreatemembersPathParams = never;
79
- export type CreatemembersBody = NonNullable<paths['/core/v1/members']['post']['requestBody']>['content']['application/json'];
80
- export type CreatemembersResponse = paths['/core/v1/members']['post']['responses']['200']['content']['application/json'];
81
- type CreatemembersOperation = paths['/core/v1/members']['post'];
82
-
83
- export type GetmembersbyidQuery = never;
84
- export type GetmembersbyidPathParams = NonNullable<paths['/core/v1/members/{id}']['get']['parameters']>['path'];
85
- export type GetmembersbyidBody = never;
86
- export type GetmembersbyidResponse = paths['/core/v1/members/{id}']['get']['responses']['200']['content']['application/json'];
87
- type GetmembersbyidOperation = paths['/core/v1/members/{id}']['get'];
88
-
89
- export type ListopportunitiesQuery = NonNullable<paths['/core/v1/opportunities']['get']['parameters']>['query'];
90
- export type ListopportunitiesPathParams = never;
91
- export type ListopportunitiesBody = never;
92
- export type ListopportunitiesResponse = paths['/core/v1/opportunities']['get']['responses']['200']['content']['application/json'];
93
- type ListopportunitiesOperation = paths['/core/v1/opportunities']['get'];
94
-
95
- export type GetopportunitiesbyidQuery = never;
96
- export type GetopportunitiesbyidPathParams = NonNullable<paths['/core/v1/opportunities/{id}']['get']['parameters']>['path'];
97
- export type GetopportunitiesbyidBody = never;
98
- export type GetopportunitiesbyidResponse = paths['/core/v1/opportunities/{id}']['get']['responses']['200']['content']['application/json'];
99
- type GetopportunitiesbyidOperation = paths['/core/v1/opportunities/{id}']['get'];
100
-
101
- export type ListservicecontractsQuery = NonNullable<paths['/core/v1/service/contracts']['get']['parameters']>['query'];
102
- export type ListservicecontractsPathParams = never;
103
- export type ListservicecontractsBody = never;
104
- export type ListservicecontractsResponse = paths['/core/v1/service/contracts']['get']['responses']['200']['content']['application/json'];
105
- type ListservicecontractsOperation = paths['/core/v1/service/contracts']['get'];
106
-
107
- export type GetservicecontractsbyidQuery = never;
108
- export type GetservicecontractsbyidPathParams = NonNullable<paths['/core/v1/service/contracts/{id}']['get']['parameters']>['path'];
109
- export type GetservicecontractsbyidBody = never;
110
- export type GetservicecontractsbyidResponse = paths['/core/v1/service/contracts/{id}']['get']['responses']['200']['content']['application/json'];
111
- type GetservicecontractsbyidOperation = paths['/core/v1/service/contracts/{id}']['get'];
112
-
113
- export type ListserviceticketsQuery = NonNullable<paths['/core/v1/service/tickets']['get']['parameters']>['query'];
114
- export type ListserviceticketsPathParams = never;
115
- export type ListserviceticketsBody = never;
116
- export type ListserviceticketsResponse = paths['/core/v1/service/tickets']['get']['responses']['200']['content']['application/json'];
117
- type ListserviceticketsOperation = paths['/core/v1/service/tickets']['get'];
118
-
119
- export type GetserviceticketsbyidQuery = never;
120
- export type GetserviceticketsbyidPathParams = NonNullable<paths['/core/v1/service/tickets/{id}']['get']['parameters']>['path'];
121
- export type GetserviceticketsbyidBody = never;
122
- export type GetserviceticketsbyidResponse = paths['/core/v1/service/tickets/{id}']['get']['responses']['200']['content']['application/json'];
123
- type GetserviceticketsbyidOperation = paths['/core/v1/service/tickets/{id}']['get'];
124
-
125
- export class GeneratedCoreClient extends BaseApiClient {
126
- public constructor(config: BaseClientConfig) {
127
- super(config);
128
- }
129
-
130
- public listAssetsHardware(query?: ListassetshardwareQuery): Promise<ListassetshardwareResponse> {
131
- const path = "/core/v1/assets/hardware";
132
- return this.requestJson({
133
- method: "GET",
134
- path,
135
- query,
136
- }) as Promise<ListassetshardwareResponse>;
137
- }
138
-
139
- public getAssetsHardwareById(pathParams: GetassetshardwarebyidPathParams): Promise<GetassetshardwarebyidResponse> {
140
- const path = `/core/v1/assets/hardware/${encodeURIComponent(String(pathParams.id))}`;
141
- return this.requestJson({
142
- method: "GET",
143
- path,
144
- }) as Promise<GetassetshardwarebyidResponse>;
145
- }
146
-
147
- public listAssetsSaas(query?: ListassetssaasQuery): Promise<ListassetssaasResponse> {
148
- const path = "/core/v1/assets/saas";
149
- return this.requestJson({
150
- method: "GET",
151
- path,
152
- query,
153
- }) as Promise<ListassetssaasResponse>;
154
- }
155
-
156
- public listAssetsSaasUsers(query?: ListassetssaasusersQuery): Promise<ListassetssaasusersResponse> {
157
- const path = "/core/v1/assets/saas-users";
158
- return this.requestJson({
159
- method: "GET",
160
- path,
161
- query,
162
- }) as Promise<ListassetssaasusersResponse>;
163
- }
164
-
165
- public getAssetsSaasUsersById(pathParams: GetassetssaasusersbyidPathParams): Promise<GetassetssaasusersbyidResponse> {
166
- const path = `/core/v1/assets/saas-users/${encodeURIComponent(String(pathParams.id))}`;
167
- return this.requestJson({
168
- method: "GET",
169
- path,
170
- }) as Promise<GetassetssaasusersbyidResponse>;
171
- }
172
-
173
- public getAssetsSaasById(pathParams: GetassetssaasbyidPathParams): Promise<GetassetssaasbyidResponse> {
174
- const path = `/core/v1/assets/saas/${encodeURIComponent(String(pathParams.id))}`;
175
- return this.requestJson({
176
- method: "GET",
177
- path,
178
- }) as Promise<GetassetssaasbyidResponse>;
179
- }
180
-
181
- public listClients(query?: ListclientsQuery): Promise<ListclientsResponse> {
182
- const path = "/core/v1/clients";
183
- return this.requestJson({
184
- method: "GET",
185
- path,
186
- query,
187
- }) as Promise<ListclientsResponse>;
188
- }
189
-
190
- public getClientsById(pathParams: GetclientsbyidPathParams): Promise<GetclientsbyidResponse> {
191
- const path = `/core/v1/clients/${encodeURIComponent(String(pathParams.id))}`;
192
- return this.requestJson({
193
- method: "GET",
194
- path,
195
- }) as Promise<GetclientsbyidResponse>;
196
- }
197
-
198
- public createContacts(query: CreatecontactsQuery | undefined, body: CreatecontactsBody): Promise<CreatecontactsResponse> {
199
- const path = "/core/v1/contacts";
200
- return this.requestJson({
201
- method: "POST",
202
- path,
203
- query,
204
- body
205
- }) as Promise<CreatecontactsResponse>;
206
- }
207
-
208
- public getContactsById(pathParams: GetcontactsbyidPathParams): Promise<GetcontactsbyidResponse> {
209
- const path = `/core/v1/contacts/${encodeURIComponent(String(pathParams.id))}`;
210
- return this.requestJson({
211
- method: "GET",
212
- path,
213
- }) as Promise<GetcontactsbyidResponse>;
214
- }
215
-
216
- public listIntegrationsConfigurations(): Promise<ListintegrationsconfigurationsResponse> {
217
- const path = "/core/v1/integrations/configurations";
218
- return this.requestJson({
219
- method: "GET",
220
- path,
221
- }) as Promise<ListintegrationsconfigurationsResponse>;
222
- }
223
-
224
- public listIntegrationsVendors(query?: ListintegrationsvendorsQuery): Promise<ListintegrationsvendorsResponse> {
225
- const path = "/core/v1/integrations/vendors";
226
- return this.requestJson({
227
- method: "GET",
228
- path,
229
- query,
230
- }) as Promise<ListintegrationsvendorsResponse>;
231
- }
232
-
233
- public createMembers(query: CreatemembersQuery | undefined, body: CreatemembersBody): Promise<CreatemembersResponse> {
234
- const path = "/core/v1/members";
235
- return this.requestJson({
236
- method: "POST",
237
- path,
238
- query,
239
- body
240
- }) as Promise<CreatemembersResponse>;
241
- }
242
-
243
- public getMembersById(pathParams: GetmembersbyidPathParams): Promise<GetmembersbyidResponse> {
244
- const path = `/core/v1/members/${encodeURIComponent(String(pathParams.id))}`;
245
- return this.requestJson({
246
- method: "GET",
247
- path,
248
- }) as Promise<GetmembersbyidResponse>;
249
- }
250
-
251
- public listOpportunities(query?: ListopportunitiesQuery): Promise<ListopportunitiesResponse> {
252
- const path = "/core/v1/opportunities";
253
- return this.requestJson({
254
- method: "GET",
255
- path,
256
- query,
257
- }) as Promise<ListopportunitiesResponse>;
258
- }
259
-
260
- public getOpportunitiesById(pathParams: GetopportunitiesbyidPathParams): Promise<GetopportunitiesbyidResponse> {
261
- const path = `/core/v1/opportunities/${encodeURIComponent(String(pathParams.id))}`;
262
- return this.requestJson({
263
- method: "GET",
264
- path,
265
- }) as Promise<GetopportunitiesbyidResponse>;
266
- }
267
-
268
- public listServiceContracts(query?: ListservicecontractsQuery): Promise<ListservicecontractsResponse> {
269
- const path = "/core/v1/service/contracts";
270
- return this.requestJson({
271
- method: "GET",
272
- path,
273
- query,
274
- }) as Promise<ListservicecontractsResponse>;
275
- }
276
-
277
- public getServiceContractsById(pathParams: GetservicecontractsbyidPathParams): Promise<GetservicecontractsbyidResponse> {
278
- const path = `/core/v1/service/contracts/${encodeURIComponent(String(pathParams.id))}`;
279
- return this.requestJson({
280
- method: "GET",
281
- path,
282
- }) as Promise<GetservicecontractsbyidResponse>;
283
- }
284
-
285
- public listServiceTickets(query?: ListserviceticketsQuery): Promise<ListserviceticketsResponse> {
286
- const path = "/core/v1/service/tickets";
287
- return this.requestJson({
288
- method: "GET",
289
- path,
290
- query,
291
- }) as Promise<ListserviceticketsResponse>;
292
- }
293
-
294
- public getServiceTicketsById(pathParams: GetserviceticketsbyidPathParams): Promise<GetserviceticketsbyidResponse> {
295
- const path = `/core/v1/service/tickets/${encodeURIComponent(String(pathParams.id))}`;
296
- return this.requestJson({
297
- method: "GET",
298
- path,
299
- }) as Promise<GetserviceticketsbyidResponse>;
300
- }
301
-
302
- }
303
-
package/src/index.ts DELETED
@@ -1,87 +0,0 @@
1
- import {
2
- GeneratedCoreClient,
3
- type GetclientsbyidResponse as GetClientResponse,
4
- type ListassetshardwareQuery as ListHardwareAssetsQuery,
5
- type ListassetshardwareResponse as ListHardwareAssetsResponse,
6
- type ListclientsQuery as ListClientsQuery,
7
- type ListclientsResponse as ListClientsResponse,
8
- type ListintegrationsconfigurationsResponse as ListIntegrationConfigurationsResponse,
9
- type ListserviceticketsQuery as ListTicketsQuery,
10
- type ListserviceticketsResponse as ListTicketsResponse
11
- } from "./generated.js";
12
- import type { BaseClientConfig } from "./runtime.js";
13
-
14
- export { coreOperations, type GeneratedOperation as GeneratedCoreOperation } from "./catalog.js";
15
- export { GeneratedCoreClient } from "./generated.js";
16
- export { BaseApiError as ScalepadApiError, type FetchLike, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue } from "./runtime.js";
17
- export type { paths } from "./schema.js";
18
-
19
- export interface ListQuery {
20
- cursor?: string;
21
- pageSize?: number;
22
- filters?: Record<string, string>;
23
- sort?: string;
24
- }
25
-
26
- export interface CoreClientConfig extends BaseClientConfig {}
27
-
28
- export interface PaginatedResponse<T = Record<string, unknown>> {
29
- data: T[];
30
- total_count?: number;
31
- next_cursor?: string | null;
32
- [key: string]: unknown;
33
- }
34
-
35
- function buildListQuery(query: ListQuery = {}): Record<string, string> {
36
- const params: Record<string, string> = {};
37
-
38
- if (query.pageSize != null) {
39
- params.page_size = String(query.pageSize);
40
- }
41
-
42
- if (query.cursor) {
43
- params.cursor = query.cursor;
44
- }
45
-
46
- if (query.sort) {
47
- params.sort = query.sort;
48
- }
49
-
50
- for (const [field, expression] of Object.entries(query.filters ?? {})) {
51
- params[`filter[${field}]`] = expression;
52
- }
53
-
54
- return params;
55
- }
56
-
57
- export class ScalepadCoreClient {
58
- private readonly generated: GeneratedCoreClient;
59
-
60
- public constructor(config: CoreClientConfig) {
61
- this.generated = new GeneratedCoreClient(config);
62
- }
63
-
64
- public listClients(query: ListQuery = {}): Promise<ListClientsResponse> {
65
- return this.generated.listClients(buildListQuery(query) as ListClientsQuery);
66
- }
67
-
68
- public getClient(id: string): Promise<GetClientResponse> {
69
- return this.generated.getClientsById({ id });
70
- }
71
-
72
- public listIntegrationConfigurations(): Promise<ListIntegrationConfigurationsResponse> {
73
- return this.generated.listIntegrationsConfigurations();
74
- }
75
-
76
- public listHardwareAssets(query: ListQuery = {}): Promise<ListHardwareAssetsResponse> {
77
- return this.generated.listAssetsHardware(buildListQuery(query) as ListHardwareAssetsQuery);
78
- }
79
-
80
- public listTickets(query: ListQuery = {}): Promise<ListTicketsResponse> {
81
- return this.generated.listServiceTickets(buildListQuery(query) as ListTicketsQuery);
82
- }
83
- }
84
-
85
- export function createCoreClient(config: CoreClientConfig): ScalepadCoreClient {
86
- return new ScalepadCoreClient(config);
87
- }
package/src/runtime.ts DELETED
@@ -1,132 +0,0 @@
1
- export type JsonPrimitive = string | number | boolean | null;
2
- export interface JsonObject {
3
- [key: string]: JsonValue;
4
- }
5
- export interface JsonArray extends Array<JsonValue> {}
6
- export type JsonValue = JsonPrimitive | JsonObject | JsonArray;
7
- export type FetchLike = typeof fetch;
8
- export type QueryArrayValue = string | number | boolean;
9
- export type QueryValue = string | number | boolean | null | undefined | ReadonlyArray<QueryArrayValue>;
10
- export type QueryParams = Record<string, QueryValue>;
11
-
12
- export class BaseApiError extends Error {
13
- public readonly status: number;
14
- public readonly payload: unknown;
15
-
16
- public constructor(message: string, status: number, payload: unknown) {
17
- super(message);
18
- this.name = "BaseApiError";
19
- this.status = status;
20
- this.payload = payload;
21
- }
22
- }
23
-
24
- export interface BaseClientConfig {
25
- apiKey: string;
26
- baseUrl?: string;
27
- fetchImpl?: FetchLike;
28
- userAgent?: string;
29
- maxRetries?: number;
30
- }
31
-
32
- const DEFAULT_BASE_URL = "https://api.scalepad.com";
33
-
34
- function delay(ms: number): Promise<void> {
35
- return new Promise((resolve) => {
36
- setTimeout(resolve, ms);
37
- });
38
- }
39
-
40
- async function parseResponseBody(response: Response): Promise<unknown> {
41
- if (response.status === 204 || response.status === 205) {
42
- return null;
43
- }
44
-
45
- const contentType = response.headers.get("content-type") ?? "";
46
- if (contentType.includes("application/json")) {
47
- return response.json();
48
- }
49
-
50
- const text = await response.text();
51
- return text.length === 0 ? null : text;
52
- }
53
-
54
- function appendQuery(url: URL, query?: QueryParams): void {
55
- if (!query) {
56
- return;
57
- }
58
-
59
- for (const [key, value] of Object.entries(query)) {
60
- if (value == null) {
61
- continue;
62
- }
63
-
64
- if (Array.isArray(value)) {
65
- url.searchParams.set(key, value.join(","));
66
- continue;
67
- }
68
-
69
- url.searchParams.set(key, String(value));
70
- }
71
- }
72
-
73
- export class BaseApiClient {
74
- private readonly apiKey: string;
75
- private readonly baseUrl: string;
76
- private readonly fetchImpl: FetchLike;
77
- private readonly userAgent: string;
78
- private readonly maxRetries: number;
79
-
80
- public constructor(config: BaseClientConfig) {
81
- this.apiKey = config.apiKey;
82
- this.baseUrl = config.baseUrl ?? DEFAULT_BASE_URL;
83
- this.fetchImpl = config.fetchImpl ?? fetch;
84
- this.userAgent = config.userAgent ?? "@scalepad/cli";
85
- this.maxRetries = config.maxRetries ?? 3;
86
- }
87
-
88
- protected async requestJson(request: {
89
- method: string;
90
- path: string;
91
- query?: QueryParams;
92
- body?: JsonValue;
93
- }): Promise<unknown> {
94
- const url = new URL(request.path, this.baseUrl);
95
- appendQuery(url, request.query);
96
-
97
- let attempt = 0;
98
- while (true) {
99
- const response = await this.fetchImpl(url, {
100
- method: request.method,
101
- headers: {
102
- accept: "application/json",
103
- ...(request.body != null ? { "content-type": "application/json" } : {}),
104
- "x-api-key": this.apiKey,
105
- "user-agent": this.userAgent
106
- },
107
- body: request.body != null ? JSON.stringify(request.body) : undefined
108
- });
109
-
110
- if (response.ok) {
111
- return parseResponseBody(response);
112
- }
113
-
114
- if (response.status === 429 && attempt < this.maxRetries) {
115
- attempt += 1;
116
- const retryAfterSeconds = Number(response.headers.get("retry-after"));
117
- const waitMs = Number.isFinite(retryAfterSeconds) && retryAfterSeconds > 0
118
- ? retryAfterSeconds * 1000
119
- : 500 * (2 ** (attempt - 1));
120
- await delay(waitMs);
121
- continue;
122
- }
123
-
124
- const payload = await parseResponseBody(response);
125
- throw new BaseApiError(
126
- `API request failed with status ${response.status}`,
127
- response.status,
128
- payload
129
- );
130
- }
131
- }
132
- }