@thelllabs/winehaus-sdk 0.0.1 → 0.0.3
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/cjs/api/api.js +3 -1
- package/dist/cjs/sdk.js +1 -1
- package/dist/esm/api/api.js +3 -1
- package/dist/esm/sdk.js +1 -1
- package/dist/types/api/api.d.ts +8 -8
- package/dist/umd/index.ts +28244 -0
- package/package.json +3 -3
- package/dist/umd/index.js +0 -2
- package/dist/umd/index.js.LICENSE.txt +0 -17
package/dist/cjs/api/api.js
CHANGED
|
@@ -152,7 +152,9 @@ var HttpClient = /** @class */ (function () {
|
|
|
152
152
|
typeof body !== "string") {
|
|
153
153
|
body = JSON.stringify(body);
|
|
154
154
|
}
|
|
155
|
-
return [2 /*return*/, this.instance
|
|
155
|
+
return [2 /*return*/, this.instance
|
|
156
|
+
.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }))
|
|
157
|
+
.then(function (response) { return response.data; })];
|
|
156
158
|
}
|
|
157
159
|
});
|
|
158
160
|
}); };
|
package/dist/cjs/sdk.js
CHANGED
|
@@ -299,7 +299,7 @@ var WinehausSDK = /** @class */ (function () {
|
|
|
299
299
|
switch (_a.label) {
|
|
300
300
|
case 0: return [4 /*yield*/, this.api.auth.signIn(credential)];
|
|
301
301
|
case 1:
|
|
302
|
-
data =
|
|
302
|
+
data = _a.sent();
|
|
303
303
|
if (!data.token) {
|
|
304
304
|
throw new Error('Authentication failed. Please check your credentials.');
|
|
305
305
|
}
|
package/dist/esm/api/api.js
CHANGED
|
@@ -146,7 +146,9 @@ var HttpClient = /** @class */ (function () {
|
|
|
146
146
|
typeof body !== "string") {
|
|
147
147
|
body = JSON.stringify(body);
|
|
148
148
|
}
|
|
149
|
-
return [2 /*return*/, this.instance
|
|
149
|
+
return [2 /*return*/, this.instance
|
|
150
|
+
.request(__assign(__assign({}, requestParams), { headers: __assign(__assign({}, (requestParams.headers || {})), (type ? { "Content-Type": type } : {})), params: query, responseType: responseFormat, data: body, url: path }))
|
|
151
|
+
.then(function (response) { return response.data; })];
|
|
150
152
|
}
|
|
151
153
|
});
|
|
152
154
|
}); };
|
package/dist/esm/sdk.js
CHANGED
|
@@ -270,7 +270,7 @@ var WinehausSDK = /** @class */ (function () {
|
|
|
270
270
|
switch (_a.label) {
|
|
271
271
|
case 0: return [4 /*yield*/, this.api.auth.signIn(credential)];
|
|
272
272
|
case 1:
|
|
273
|
-
data =
|
|
273
|
+
data = _a.sent();
|
|
274
274
|
if (!data.token) {
|
|
275
275
|
throw new Error('Authentication failed. Please check your credentials.');
|
|
276
276
|
}
|
package/dist/types/api/api.d.ts
CHANGED
|
@@ -166,7 +166,7 @@ export declare namespace Admin {
|
|
|
166
166
|
type ResponseBody = TenantUserEntityDto;
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
import type { AxiosInstance, AxiosRequestConfig,
|
|
169
|
+
import type { AxiosInstance, AxiosRequestConfig, ResponseType } from "axios";
|
|
170
170
|
export type QueryParamsType = Record<string | number, any>;
|
|
171
171
|
export interface FullRequestParams extends Omit<AxiosRequestConfig, "data" | "params" | "url" | "responseType"> {
|
|
172
172
|
/** set parameter to `true` for call `securityWorker` for this request */
|
|
@@ -206,7 +206,7 @@ export declare class HttpClient<SecurityDataType = unknown> {
|
|
|
206
206
|
protected mergeRequestParams(params1: AxiosRequestConfig, params2?: AxiosRequestConfig): AxiosRequestConfig;
|
|
207
207
|
protected stringifyFormItem(formItem: unknown): string;
|
|
208
208
|
protected createFormData(input: Record<string, unknown>): FormData;
|
|
209
|
-
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<
|
|
209
|
+
request: <T = any, _E = any>({ secure, path, type, query, format, body, ...params }: FullRequestParams) => Promise<T>;
|
|
210
210
|
}
|
|
211
211
|
/**
|
|
212
212
|
* @title winehaus-api
|
|
@@ -223,7 +223,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
223
223
|
* @request GET:/
|
|
224
224
|
* @response `200` `void`
|
|
225
225
|
*/
|
|
226
|
-
index: (params?: RequestParams) => Promise<
|
|
226
|
+
index: (params?: RequestParams) => Promise<void>;
|
|
227
227
|
auth: {
|
|
228
228
|
/**
|
|
229
229
|
* No description
|
|
@@ -234,7 +234,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
234
234
|
* @secure
|
|
235
235
|
* @response `204` `void`
|
|
236
236
|
*/
|
|
237
|
-
logout: (params?: RequestParams) => Promise<
|
|
237
|
+
logout: (params?: RequestParams) => Promise<void>;
|
|
238
238
|
/**
|
|
239
239
|
* No description
|
|
240
240
|
*
|
|
@@ -244,7 +244,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
244
244
|
* @secure
|
|
245
245
|
* @response `204` `void`
|
|
246
246
|
*/
|
|
247
|
-
requestPasswordReset: (data: RequestPasswordResetDto, params?: RequestParams) => Promise<
|
|
247
|
+
requestPasswordReset: (data: RequestPasswordResetDto, params?: RequestParams) => Promise<void>;
|
|
248
248
|
/**
|
|
249
249
|
* No description
|
|
250
250
|
*
|
|
@@ -254,7 +254,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
254
254
|
* @secure
|
|
255
255
|
* @response `200` `SigninResponseDto`
|
|
256
256
|
*/
|
|
257
|
-
resetPassword: (data: ResetPasswordDto, params?: RequestParams) => Promise<
|
|
257
|
+
resetPassword: (data: ResetPasswordDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
258
258
|
/**
|
|
259
259
|
* No description
|
|
260
260
|
*
|
|
@@ -264,7 +264,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
264
264
|
* @secure
|
|
265
265
|
* @response `200` `SigninResponseDto`
|
|
266
266
|
*/
|
|
267
|
-
signIn: (data: SigninDto, params?: RequestParams) => Promise<
|
|
267
|
+
signIn: (data: SigninDto, params?: RequestParams) => Promise<SigninResponseDto>;
|
|
268
268
|
};
|
|
269
269
|
admin: {
|
|
270
270
|
/**
|
|
@@ -277,6 +277,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
277
277
|
* @response `201` `TenantUserEntityDto`
|
|
278
278
|
* @response `403` `HttpExceptionDto` Need user with one of these roles: owner, admin
|
|
279
279
|
*/
|
|
280
|
-
createTenantUser: (tenantId: string, data: CreateTenantUserDto, params?: RequestParams) => Promise<
|
|
280
|
+
createTenantUser: (tenantId: string, data: CreateTenantUserDto, params?: RequestParams) => Promise<TenantUserEntityDto>;
|
|
281
281
|
};
|
|
282
282
|
}
|