@commercetools/ts-client 0.0.0-beta.3 → 0.0.0-beta.4
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/commercetools-ts-client.browser.cjs.js +1 -1
- package/dist/commercetools-ts-client.browser.esm.js +1 -1
- package/dist/commercetools-ts-client.cjs.dev.js +1 -1
- package/dist/commercetools-ts-client.cjs.prod.js +1 -1
- package/dist/commercetools-ts-client.esm.js +1 -1
- package/dist/declarations/src/types/types.d.ts +14 -15
- package/package.json +1 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Buffer } from 'buffer/'
|
|
2
|
-
import fetch from 'node-fetch'
|
|
3
2
|
|
|
4
3
|
export type Nullable<T> = T | null
|
|
5
4
|
export type JsonObject<T = unknown> = { [key: string]: T }
|
|
@@ -8,8 +7,8 @@ export type MiddlewareRequest = ClientRequest
|
|
|
8
7
|
export type Middleware = (next: Next) => (request: MiddlewareRequest) => Promise<MiddlewareResponse>
|
|
9
8
|
|
|
10
9
|
export type MiddlewareResponse = {
|
|
11
|
-
resolve
|
|
12
|
-
reject
|
|
10
|
+
resolve: Function;
|
|
11
|
+
reject: Function;
|
|
13
12
|
body?: JsonObject;
|
|
14
13
|
error?: HttpErrorType;
|
|
15
14
|
statusCode: number;
|
|
@@ -44,8 +43,8 @@ export interface ClientRequest {
|
|
|
44
43
|
queryParams?: VariableMap
|
|
45
44
|
body?: string | Buffer
|
|
46
45
|
response?: ClientResponse
|
|
47
|
-
resolve?:
|
|
48
|
-
reject?:
|
|
46
|
+
resolve?: Function;
|
|
47
|
+
reject?: Function;
|
|
49
48
|
[key: string]: any
|
|
50
49
|
}
|
|
51
50
|
|
|
@@ -100,7 +99,7 @@ export type AuthMiddlewareOptions = {
|
|
|
100
99
|
scopes?: Array<string>
|
|
101
100
|
// For internal usage only
|
|
102
101
|
oauthUri?: string
|
|
103
|
-
httpClient?:
|
|
102
|
+
httpClient?: Function
|
|
104
103
|
tokenCache?: TokenCache
|
|
105
104
|
}
|
|
106
105
|
|
|
@@ -140,7 +139,7 @@ export type RefreshAuthMiddlewareOptions = {
|
|
|
140
139
|
tokenCache?: TokenCache,
|
|
141
140
|
// For internal usage only
|
|
142
141
|
oauthUri?: string
|
|
143
|
-
httpClient?:
|
|
142
|
+
httpClient?: Function
|
|
144
143
|
}
|
|
145
144
|
|
|
146
145
|
export type RequestStateStore = {
|
|
@@ -162,13 +161,13 @@ type requestBaseOptions = {
|
|
|
162
161
|
|
|
163
162
|
export type executeRequestOptions = requestBaseOptions & {
|
|
164
163
|
next: Next
|
|
165
|
-
httpClient:
|
|
164
|
+
httpClient: Function
|
|
166
165
|
userOption?: AuthMiddlewareOptions | PasswordAuthMiddlewareOptions
|
|
167
166
|
}
|
|
168
167
|
|
|
169
168
|
export type AuthMiddlewareBaseOptions = requestBaseOptions & {
|
|
170
169
|
request: MiddlewareRequest
|
|
171
|
-
httpClient?:
|
|
170
|
+
httpClient?: Function
|
|
172
171
|
}
|
|
173
172
|
|
|
174
173
|
export type RequestState = boolean
|
|
@@ -195,7 +194,7 @@ export type PasswordAuthMiddlewareOptions = {
|
|
|
195
194
|
tokenCache?: TokenCache,
|
|
196
195
|
// For internal usage only
|
|
197
196
|
oauthUri?: string
|
|
198
|
-
httpClient?:
|
|
197
|
+
httpClient?: Function
|
|
199
198
|
}
|
|
200
199
|
|
|
201
200
|
export type TokenInfo = {
|
|
@@ -236,7 +235,7 @@ export type HttpMiddlewareOptions = {
|
|
|
236
235
|
export type HttpOptions = {
|
|
237
236
|
url: string
|
|
238
237
|
clientOptions: IClientOptions
|
|
239
|
-
httpClient:
|
|
238
|
+
httpClient: Function
|
|
240
239
|
}
|
|
241
240
|
|
|
242
241
|
export type LogLevel = 'INFO' | 'ERROR'
|
|
@@ -289,7 +288,7 @@ export type IClientOptions = {
|
|
|
289
288
|
body?: string | Buffer
|
|
290
289
|
timeout?: number
|
|
291
290
|
abortController?: AbortController
|
|
292
|
-
[k: string | number
|
|
291
|
+
[k: string | number]: unknown
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
export type HttpClientConfig = IClientOptions & {
|
|
@@ -306,9 +305,9 @@ export type TResponse = {
|
|
|
306
305
|
errors?: any
|
|
307
306
|
error?: string
|
|
308
307
|
message: string
|
|
309
|
-
[k: string | number
|
|
308
|
+
[k: string | number]: any
|
|
310
309
|
}
|
|
311
|
-
[k: string | number
|
|
310
|
+
[k: string | number]: any
|
|
312
311
|
}
|
|
313
312
|
|
|
314
313
|
export type Client = {
|
|
@@ -325,7 +324,7 @@ export type ProcessOptions = { accumulate?: boolean; total?: number }
|
|
|
325
324
|
export type ErrorMiddlewareOptions = {}
|
|
326
325
|
export type SuccessResult = {
|
|
327
326
|
body: {
|
|
328
|
-
results: Record<string | number
|
|
327
|
+
results: Record<string | number, Record<string, any>>;
|
|
329
328
|
count: number;
|
|
330
329
|
};
|
|
331
330
|
statusCode: number;
|