@teamnovu/kit-shopware-api-client 0.0.5 → 0.0.7
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/client.d.ts +3 -1
- package/dist/index.mjs +4 -3
- package/package.json +1 -1
- package/src/client.ts +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ import { OperationOptions, OperationProp, ShopwareClientOptions } from './types'
|
|
|
3
3
|
export interface ResponseType<TKey> {
|
|
4
4
|
__response?: TKey;
|
|
5
5
|
}
|
|
6
|
-
export type BrandedResponse<Operations, OperationKey extends (keyof Operations) & string> = ResponseType<OperationKey> & OperationProp<Operations, OperationKey, 'response'
|
|
6
|
+
export type BrandedResponse<Operations, OperationKey extends (keyof Operations) & string> = ResponseType<OperationKey> & OperationProp<Operations, OperationKey, 'response'> & {
|
|
7
|
+
__BLBL: string;
|
|
8
|
+
};
|
|
7
9
|
export declare class ShopwareClient<Operations> extends EventEmitter {
|
|
8
10
|
private options;
|
|
9
11
|
constructor(options: ShopwareClientOptions);
|
package/dist/index.mjs
CHANGED
|
@@ -127,7 +127,7 @@ function b(i) {
|
|
|
127
127
|
return r;
|
|
128
128
|
}
|
|
129
129
|
const E = /^(?<name>\w+?)\s(?<method>get|post|put|patch|delete)\s+(?<url>\/.*)/i;
|
|
130
|
-
class
|
|
130
|
+
class k extends m {
|
|
131
131
|
constructor(e) {
|
|
132
132
|
super();
|
|
133
133
|
u(this, "options", {
|
|
@@ -221,10 +221,11 @@ class v extends m {
|
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
async query(e, t) {
|
|
224
|
-
return (await this.queryRaw(e, t)).json()
|
|
224
|
+
return (await this.queryRaw(e, t)).json().catch(() => {
|
|
225
|
+
});
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
228
|
export {
|
|
228
229
|
p as ShopwareApiError,
|
|
229
|
-
|
|
230
|
+
k as ShopwareClient
|
|
230
231
|
};
|
package/package.json
CHANGED
package/src/client.ts
CHANGED
|
@@ -17,7 +17,7 @@ export interface ResponseType<TKey> {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
export type BrandedResponse<Operations, OperationKey extends (keyof Operations) & string> =
|
|
20
|
-
ResponseType<OperationKey> & OperationProp<Operations, OperationKey, 'response'>
|
|
20
|
+
ResponseType<OperationKey> & OperationProp<Operations, OperationKey, 'response'> & { __BLBL: string }
|
|
21
21
|
|
|
22
22
|
export class ShopwareClient<Operations> extends EventEmitter {
|
|
23
23
|
private options: ShopwareClientOptions = {
|
|
@@ -170,6 +170,6 @@ export class ShopwareClient<Operations> extends EventEmitter {
|
|
|
170
170
|
): Promise<BrandedResponse<Operations, OperationKey>> {
|
|
171
171
|
const response = await this.queryRaw(operation, options)
|
|
172
172
|
|
|
173
|
-
return response.json()
|
|
173
|
+
return response.json().catch(() => undefined)
|
|
174
174
|
}
|
|
175
175
|
}
|