@parra/parra-js-sdk 0.2.74 → 0.2.76
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/ParraAPI.d.ts +23 -0
- package/dist/ParraAPI.js +12 -0
- package/package.json +1 -1
package/dist/ParraAPI.d.ts
CHANGED
|
@@ -1,4 +1,26 @@
|
|
|
1
1
|
import { HTTPClient } from "@parra/http-client";
|
|
2
|
+
export interface Size {
|
|
3
|
+
width: number;
|
|
4
|
+
height: number;
|
|
5
|
+
}
|
|
6
|
+
export interface UploadImageAssetRequestBody {
|
|
7
|
+
group: string;
|
|
8
|
+
image: File;
|
|
9
|
+
}
|
|
10
|
+
export interface ImageAsset {
|
|
11
|
+
id: string;
|
|
12
|
+
created_at: string;
|
|
13
|
+
updated_at: string;
|
|
14
|
+
deleted_at?: string | null;
|
|
15
|
+
tenant_id: string;
|
|
16
|
+
size: Size;
|
|
17
|
+
url: string;
|
|
18
|
+
bucket: string;
|
|
19
|
+
key: string;
|
|
20
|
+
group: string;
|
|
21
|
+
file_type: string;
|
|
22
|
+
mime_type: string;
|
|
23
|
+
}
|
|
2
24
|
export interface AuthorizationCheckRequestBody {
|
|
3
25
|
namespace: string;
|
|
4
26
|
subject: string;
|
|
@@ -537,6 +559,7 @@ declare class ParraAPI {
|
|
|
537
559
|
constructor(http: HTTPClient, options: {
|
|
538
560
|
baseUrl: string;
|
|
539
561
|
});
|
|
562
|
+
uploadImageAssetForTenantById: (tenant_id: string, body?: UploadImageAssetRequestBody | undefined) => Promise<ImageAsset>;
|
|
540
563
|
createCustomer: (body?: CreateCustomerRequestBody | undefined) => Promise<Customer>;
|
|
541
564
|
updateEntitlementsForCustomerById: (customer_id: string) => Promise<Response>;
|
|
542
565
|
createBillingPortalSession: (tenant_id: string) => Promise<BillingPortalSession>;
|
package/dist/ParraAPI.js
CHANGED
|
@@ -46,6 +46,18 @@ var ParraAPI = /** @class */ (function () {
|
|
|
46
46
|
var _this = this;
|
|
47
47
|
this.http = http;
|
|
48
48
|
this.options = options;
|
|
49
|
+
this.uploadImageAssetForTenantById = function (tenant_id, body) {
|
|
50
|
+
var formData = new FormData();
|
|
51
|
+
Object.entries(body || {}).forEach(function (_a) {
|
|
52
|
+
var key = _a[0], value = _a[1];
|
|
53
|
+
formData.append(key, value);
|
|
54
|
+
});
|
|
55
|
+
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/tenants/").concat(tenant_id, "/assets/images"), {
|
|
56
|
+
method: "post",
|
|
57
|
+
body: formData,
|
|
58
|
+
headers: {},
|
|
59
|
+
});
|
|
60
|
+
};
|
|
49
61
|
this.createCustomer = function (body) {
|
|
50
62
|
return _this.http.execute("".concat(_this.options.baseUrl, "/v1/customers"), {
|
|
51
63
|
method: "post",
|