hostinger-api-sdk 1.30.6 → 1.30.8
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/README.md +2 -2
- package/api.ts +118 -2
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +78 -2
- package/dist/api.js +76 -1
- package/dist/base.d.ts +1 -1
- package/dist/base.js +1 -1
- package/dist/common.d.ts +1 -1
- package/dist/common.js +1 -1
- package/dist/configuration.d.ts +1 -1
- package/dist/configuration.js +2 -2
- package/dist/esm/api.d.ts +78 -2
- package/dist/esm/api.js +76 -1
- package/dist/esm/base.d.ts +1 -1
- package/dist/esm/base.js +1 -1
- package/dist/esm/common.d.ts +1 -1
- package/dist/esm/common.js +1 -1
- package/dist/esm/configuration.d.ts +1 -1
- package/dist/esm/configuration.js +2 -2
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/docs/EcommerceProductsApi.md +57 -0
- package/docs/EcommerceV1ProductProductImageUploadUrlResource.md +26 -0
- package/docs/EcommerceV1ProductUploadProductImageRequest.md +3 -1
- package/index.ts +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## hostinger-api-sdk@1.30.
|
|
1
|
+
## hostinger-api-sdk@1.30.8
|
|
2
2
|
|
|
3
3
|
For more information, please visit [https://developers.hostinger.com](https://developers.hostinger.com).
|
|
4
4
|
|
|
5
5
|
### Usage
|
|
6
6
|
|
|
7
7
|
```
|
|
8
|
-
npm install hostinger-api-sdk@1.30.
|
|
8
|
+
npm install hostinger-api-sdk@1.30.8 --save
|
|
9
9
|
```
|
package/api.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3562,6 +3562,37 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3562
3562
|
*/
|
|
3563
3563
|
'is_thumbnail': boolean;
|
|
3564
3564
|
}
|
|
3565
|
+
/**
|
|
3566
|
+
*
|
|
3567
|
+
* @export
|
|
3568
|
+
* @interface EcommerceV1ProductProductImageUploadUrlResource
|
|
3569
|
+
*/
|
|
3570
|
+
export interface EcommerceV1ProductProductImageUploadUrlResource {
|
|
3571
|
+
/**
|
|
3572
|
+
* Signed URL to upload the image to with a multipart/form-data POST.
|
|
3573
|
+
* @type {string}
|
|
3574
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3575
|
+
*/
|
|
3576
|
+
'upload_url': string;
|
|
3577
|
+
/**
|
|
3578
|
+
* Form fields to send alongside the file in the multipart POST.
|
|
3579
|
+
* @type {{ [key: string]: string; }}
|
|
3580
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3581
|
+
*/
|
|
3582
|
+
'fields': { [key: string]: string; };
|
|
3583
|
+
/**
|
|
3584
|
+
* Key of the uploaded object — send it to the attach-image endpoint.
|
|
3585
|
+
* @type {string}
|
|
3586
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3587
|
+
*/
|
|
3588
|
+
'object_name': string;
|
|
3589
|
+
/**
|
|
3590
|
+
* Maximum accepted upload size in bytes.
|
|
3591
|
+
* @type {number}
|
|
3592
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3593
|
+
*/
|
|
3594
|
+
'max_bytes': number;
|
|
3595
|
+
}
|
|
3565
3596
|
/**
|
|
3566
3597
|
*
|
|
3567
3598
|
* @export
|
|
@@ -3569,11 +3600,17 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3569
3600
|
*/
|
|
3570
3601
|
export interface EcommerceV1ProductUploadProductImageRequest {
|
|
3571
3602
|
/**
|
|
3572
|
-
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted.
|
|
3603
|
+
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted. Provide either this or object_name.
|
|
3573
3604
|
* @type {string}
|
|
3574
3605
|
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3575
3606
|
*/
|
|
3576
3607
|
'image_url': string;
|
|
3608
|
+
/**
|
|
3609
|
+
* Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image.
|
|
3610
|
+
* @type {string}
|
|
3611
|
+
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3612
|
+
*/
|
|
3613
|
+
'object_name': string;
|
|
3577
3614
|
/**
|
|
3578
3615
|
* When true, the image becomes the product\'s thumbnail (primary image). When omitted, it becomes the thumbnail only if the product does not have one yet.
|
|
3579
3616
|
* @type {boolean}
|
|
@@ -19231,6 +19268,48 @@ export class EcommercePaymentsApi extends BaseAPI {
|
|
|
19231
19268
|
*/
|
|
19232
19269
|
export const EcommerceProductsApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
19233
19270
|
return {
|
|
19271
|
+
/**
|
|
19272
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
19273
|
+
* @summary Create a product image upload URL
|
|
19274
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
19275
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
19276
|
+
* @param {*} [options] Override http request option.
|
|
19277
|
+
* @throws {RequiredError}
|
|
19278
|
+
*/
|
|
19279
|
+
createAProductImageUploadURLV1: async (storeId: string, productId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
19280
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
19281
|
+
assertParamExists('createAProductImageUploadURLV1', 'storeId', storeId)
|
|
19282
|
+
// verify required parameter 'productId' is not null or undefined
|
|
19283
|
+
assertParamExists('createAProductImageUploadURLV1', 'productId', productId)
|
|
19284
|
+
const localVarPath = `/api/ecommerce/v1/stores/{store_id}/products/{product_id}/images/upload-url`
|
|
19285
|
+
.replace(`{${"store_id"}}`, encodeURIComponent(String(storeId)))
|
|
19286
|
+
.replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
|
|
19287
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
19288
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
19289
|
+
let baseOptions;
|
|
19290
|
+
if (configuration) {
|
|
19291
|
+
baseOptions = configuration.baseOptions;
|
|
19292
|
+
}
|
|
19293
|
+
|
|
19294
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
19295
|
+
const localVarHeaderParameter = {} as any;
|
|
19296
|
+
const localVarQueryParameter = {} as any;
|
|
19297
|
+
|
|
19298
|
+
// authentication apiToken required
|
|
19299
|
+
// http bearer authentication required
|
|
19300
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
19301
|
+
|
|
19302
|
+
|
|
19303
|
+
|
|
19304
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
19305
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
19306
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
19307
|
+
|
|
19308
|
+
return {
|
|
19309
|
+
url: toPathString(localVarUrlObj),
|
|
19310
|
+
options: localVarRequestOptions,
|
|
19311
|
+
};
|
|
19312
|
+
},
|
|
19234
19313
|
/**
|
|
19235
19314
|
* Create a published digital product with a single variant and an optional external download link.
|
|
19236
19315
|
* @summary Create digital product
|
|
@@ -19377,6 +19456,19 @@ export const EcommerceProductsApiAxiosParamCreator = function (configuration?: C
|
|
|
19377
19456
|
export const EcommerceProductsApiFp = function(configuration?: Configuration) {
|
|
19378
19457
|
const localVarAxiosParamCreator = EcommerceProductsApiAxiosParamCreator(configuration)
|
|
19379
19458
|
return {
|
|
19459
|
+
/**
|
|
19460
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
19461
|
+
* @summary Create a product image upload URL
|
|
19462
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
19463
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
19464
|
+
* @param {*} [options] Override http request option.
|
|
19465
|
+
* @throws {RequiredError}
|
|
19466
|
+
*/
|
|
19467
|
+
async createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource>> {
|
|
19468
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.createAProductImageUploadURLV1(storeId, productId, options);
|
|
19469
|
+
const localVarOperationServerBasePath = operationServerMap['EcommerceProductsApi.createAProductImageUploadURLV1']?.[0]?.url;
|
|
19470
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
19471
|
+
},
|
|
19380
19472
|
/**
|
|
19381
19473
|
* Create a published digital product with a single variant and an optional external download link.
|
|
19382
19474
|
* @summary Create digital product
|
|
@@ -19427,6 +19519,17 @@ export const EcommerceProductsApiFp = function(configuration?: Configuration) {
|
|
|
19427
19519
|
export const EcommerceProductsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
19428
19520
|
const localVarFp = EcommerceProductsApiFp(configuration)
|
|
19429
19521
|
return {
|
|
19522
|
+
/**
|
|
19523
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
19524
|
+
* @summary Create a product image upload URL
|
|
19525
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
19526
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
19527
|
+
* @param {*} [options] Override http request option.
|
|
19528
|
+
* @throws {RequiredError}
|
|
19529
|
+
*/
|
|
19530
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource> {
|
|
19531
|
+
return localVarFp.createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(axios, basePath));
|
|
19532
|
+
},
|
|
19430
19533
|
/**
|
|
19431
19534
|
* Create a published digital product with a single variant and an optional external download link.
|
|
19432
19535
|
* @summary Create digital product
|
|
@@ -19471,6 +19574,19 @@ export const EcommerceProductsApiFactory = function (configuration?: Configurati
|
|
|
19471
19574
|
* @extends {BaseAPI}
|
|
19472
19575
|
*/
|
|
19473
19576
|
export class EcommerceProductsApi extends BaseAPI {
|
|
19577
|
+
/**
|
|
19578
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
19579
|
+
* @summary Create a product image upload URL
|
|
19580
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
19581
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
19582
|
+
* @param {*} [options] Override http request option.
|
|
19583
|
+
* @throws {RequiredError}
|
|
19584
|
+
* @memberof EcommerceProductsApi
|
|
19585
|
+
*/
|
|
19586
|
+
public createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig) {
|
|
19587
|
+
return EcommerceProductsApiFp(this.configuration).createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(this.axios, this.basePath));
|
|
19588
|
+
}
|
|
19589
|
+
|
|
19474
19590
|
/**
|
|
19475
19591
|
* Create a published digital product with a single variant and an optional external download link.
|
|
19476
19592
|
* @summary Create digital product
|
package/base.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/common.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/configuration.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -48,7 +48,7 @@ export class Configuration {
|
|
|
48
48
|
this.baseOptions = {
|
|
49
49
|
...param.baseOptions,
|
|
50
50
|
headers: {
|
|
51
|
-
'User-Agent': "hostinger-typescript-sdk/1.30.
|
|
51
|
+
'User-Agent': "hostinger-typescript-sdk/1.30.8",
|
|
52
52
|
...param.baseOptions?.headers,
|
|
53
53
|
},
|
|
54
54
|
};
|
package/dist/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3481,6 +3481,39 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3481
3481
|
*/
|
|
3482
3482
|
'is_thumbnail': boolean;
|
|
3483
3483
|
}
|
|
3484
|
+
/**
|
|
3485
|
+
*
|
|
3486
|
+
* @export
|
|
3487
|
+
* @interface EcommerceV1ProductProductImageUploadUrlResource
|
|
3488
|
+
*/
|
|
3489
|
+
export interface EcommerceV1ProductProductImageUploadUrlResource {
|
|
3490
|
+
/**
|
|
3491
|
+
* Signed URL to upload the image to with a multipart/form-data POST.
|
|
3492
|
+
* @type {string}
|
|
3493
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3494
|
+
*/
|
|
3495
|
+
'upload_url': string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Form fields to send alongside the file in the multipart POST.
|
|
3498
|
+
* @type {{ [key: string]: string; }}
|
|
3499
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3500
|
+
*/
|
|
3501
|
+
'fields': {
|
|
3502
|
+
[key: string]: string;
|
|
3503
|
+
};
|
|
3504
|
+
/**
|
|
3505
|
+
* Key of the uploaded object — send it to the attach-image endpoint.
|
|
3506
|
+
* @type {string}
|
|
3507
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3508
|
+
*/
|
|
3509
|
+
'object_name': string;
|
|
3510
|
+
/**
|
|
3511
|
+
* Maximum accepted upload size in bytes.
|
|
3512
|
+
* @type {number}
|
|
3513
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3514
|
+
*/
|
|
3515
|
+
'max_bytes': number;
|
|
3516
|
+
}
|
|
3484
3517
|
/**
|
|
3485
3518
|
*
|
|
3486
3519
|
* @export
|
|
@@ -3488,11 +3521,17 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3488
3521
|
*/
|
|
3489
3522
|
export interface EcommerceV1ProductUploadProductImageRequest {
|
|
3490
3523
|
/**
|
|
3491
|
-
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted.
|
|
3524
|
+
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted. Provide either this or object_name.
|
|
3492
3525
|
* @type {string}
|
|
3493
3526
|
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3494
3527
|
*/
|
|
3495
3528
|
'image_url': string;
|
|
3529
|
+
/**
|
|
3530
|
+
* Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image.
|
|
3531
|
+
* @type {string}
|
|
3532
|
+
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3533
|
+
*/
|
|
3534
|
+
'object_name': string;
|
|
3496
3535
|
/**
|
|
3497
3536
|
* When true, the image becomes the product\'s thumbnail (primary image). When omitted, it becomes the thumbnail only if the product does not have one yet.
|
|
3498
3537
|
* @type {boolean}
|
|
@@ -15198,6 +15237,15 @@ export declare class EcommercePaymentsApi extends BaseAPI {
|
|
|
15198
15237
|
* @export
|
|
15199
15238
|
*/
|
|
15200
15239
|
export declare const EcommerceProductsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
15240
|
+
/**
|
|
15241
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15242
|
+
* @summary Create a product image upload URL
|
|
15243
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15244
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15245
|
+
* @param {*} [options] Override http request option.
|
|
15246
|
+
* @throws {RequiredError}
|
|
15247
|
+
*/
|
|
15248
|
+
createAProductImageUploadURLV1: (storeId: string, productId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
15201
15249
|
/**
|
|
15202
15250
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15203
15251
|
* @summary Create digital product
|
|
@@ -15232,6 +15280,15 @@ export declare const EcommerceProductsApiAxiosParamCreator: (configuration?: Con
|
|
|
15232
15280
|
* @export
|
|
15233
15281
|
*/
|
|
15234
15282
|
export declare const EcommerceProductsApiFp: (configuration?: Configuration) => {
|
|
15283
|
+
/**
|
|
15284
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15285
|
+
* @summary Create a product image upload URL
|
|
15286
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15287
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15288
|
+
* @param {*} [options] Override http request option.
|
|
15289
|
+
* @throws {RequiredError}
|
|
15290
|
+
*/
|
|
15291
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource>>;
|
|
15235
15292
|
/**
|
|
15236
15293
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15237
15294
|
* @summary Create digital product
|
|
@@ -15266,6 +15323,15 @@ export declare const EcommerceProductsApiFp: (configuration?: Configuration) =>
|
|
|
15266
15323
|
* @export
|
|
15267
15324
|
*/
|
|
15268
15325
|
export declare const EcommerceProductsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
15326
|
+
/**
|
|
15327
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15328
|
+
* @summary Create a product image upload URL
|
|
15329
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15330
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15331
|
+
* @param {*} [options] Override http request option.
|
|
15332
|
+
* @throws {RequiredError}
|
|
15333
|
+
*/
|
|
15334
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource>;
|
|
15269
15335
|
/**
|
|
15270
15336
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15271
15337
|
* @summary Create digital product
|
|
@@ -15302,6 +15368,16 @@ export declare const EcommerceProductsApiFactory: (configuration?: Configuration
|
|
|
15302
15368
|
* @extends {BaseAPI}
|
|
15303
15369
|
*/
|
|
15304
15370
|
export declare class EcommerceProductsApi extends BaseAPI {
|
|
15371
|
+
/**
|
|
15372
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15373
|
+
* @summary Create a product image upload URL
|
|
15374
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15375
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15376
|
+
* @param {*} [options] Override http request option.
|
|
15377
|
+
* @throws {RequiredError}
|
|
15378
|
+
* @memberof EcommerceProductsApi
|
|
15379
|
+
*/
|
|
15380
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<EcommerceV1ProductProductImageUploadUrlResource, any, {}, any>>;
|
|
15305
15381
|
/**
|
|
15306
15382
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15307
15383
|
* @summary Create digital product
|
package/dist/api.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.32.
|
|
7
|
+
* API Version: 1.32.6
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -7626,6 +7626,42 @@ exports.EcommercePaymentsApi = EcommercePaymentsApi;
|
|
|
7626
7626
|
*/
|
|
7627
7627
|
const EcommerceProductsApiAxiosParamCreator = function (configuration) {
|
|
7628
7628
|
return {
|
|
7629
|
+
/**
|
|
7630
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7631
|
+
* @summary Create a product image upload URL
|
|
7632
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7633
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7634
|
+
* @param {*} [options] Override http request option.
|
|
7635
|
+
* @throws {RequiredError}
|
|
7636
|
+
*/
|
|
7637
|
+
createAProductImageUploadURLV1: (storeId_1, productId_1, ...args_1) => __awaiter(this, [storeId_1, productId_1, ...args_1], void 0, function* (storeId, productId, options = {}) {
|
|
7638
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
7639
|
+
(0, common_1.assertParamExists)('createAProductImageUploadURLV1', 'storeId', storeId);
|
|
7640
|
+
// verify required parameter 'productId' is not null or undefined
|
|
7641
|
+
(0, common_1.assertParamExists)('createAProductImageUploadURLV1', 'productId', productId);
|
|
7642
|
+
const localVarPath = `/api/ecommerce/v1/stores/{store_id}/products/{product_id}/images/upload-url`
|
|
7643
|
+
.replace(`{${"store_id"}}`, encodeURIComponent(String(storeId)))
|
|
7644
|
+
.replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
|
|
7645
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7646
|
+
const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
|
|
7647
|
+
let baseOptions;
|
|
7648
|
+
if (configuration) {
|
|
7649
|
+
baseOptions = configuration.baseOptions;
|
|
7650
|
+
}
|
|
7651
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
7652
|
+
const localVarHeaderParameter = {};
|
|
7653
|
+
const localVarQueryParameter = {};
|
|
7654
|
+
// authentication apiToken required
|
|
7655
|
+
// http bearer authentication required
|
|
7656
|
+
yield (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration);
|
|
7657
|
+
(0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
|
|
7658
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7659
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
7660
|
+
return {
|
|
7661
|
+
url: (0, common_1.toPathString)(localVarUrlObj),
|
|
7662
|
+
options: localVarRequestOptions,
|
|
7663
|
+
};
|
|
7664
|
+
}),
|
|
7629
7665
|
/**
|
|
7630
7666
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7631
7667
|
* @summary Create digital product
|
|
@@ -7751,6 +7787,22 @@ exports.EcommerceProductsApiAxiosParamCreator = EcommerceProductsApiAxiosParamCr
|
|
|
7751
7787
|
const EcommerceProductsApiFp = function (configuration) {
|
|
7752
7788
|
const localVarAxiosParamCreator = (0, exports.EcommerceProductsApiAxiosParamCreator)(configuration);
|
|
7753
7789
|
return {
|
|
7790
|
+
/**
|
|
7791
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7792
|
+
* @summary Create a product image upload URL
|
|
7793
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7794
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7795
|
+
* @param {*} [options] Override http request option.
|
|
7796
|
+
* @throws {RequiredError}
|
|
7797
|
+
*/
|
|
7798
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7799
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7800
|
+
var _a, _b;
|
|
7801
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createAProductImageUploadURLV1(storeId, productId, options);
|
|
7802
|
+
const localVarOperationServerBasePath = (_b = (_a = base_1.operationServerMap['EcommerceProductsApi.createAProductImageUploadURLV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
7803
|
+
return (axios, basePath) => (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
7804
|
+
});
|
|
7805
|
+
},
|
|
7754
7806
|
/**
|
|
7755
7807
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7756
7808
|
* @summary Create digital product
|
|
@@ -7810,6 +7862,17 @@ exports.EcommerceProductsApiFp = EcommerceProductsApiFp;
|
|
|
7810
7862
|
const EcommerceProductsApiFactory = function (configuration, basePath, axios) {
|
|
7811
7863
|
const localVarFp = (0, exports.EcommerceProductsApiFp)(configuration);
|
|
7812
7864
|
return {
|
|
7865
|
+
/**
|
|
7866
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7867
|
+
* @summary Create a product image upload URL
|
|
7868
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7869
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7870
|
+
* @param {*} [options] Override http request option.
|
|
7871
|
+
* @throws {RequiredError}
|
|
7872
|
+
*/
|
|
7873
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7874
|
+
return localVarFp.createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(axios, basePath));
|
|
7875
|
+
},
|
|
7813
7876
|
/**
|
|
7814
7877
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7815
7878
|
* @summary Create digital product
|
|
@@ -7854,6 +7917,18 @@ exports.EcommerceProductsApiFactory = EcommerceProductsApiFactory;
|
|
|
7854
7917
|
* @extends {BaseAPI}
|
|
7855
7918
|
*/
|
|
7856
7919
|
class EcommerceProductsApi extends base_1.BaseAPI {
|
|
7920
|
+
/**
|
|
7921
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7922
|
+
* @summary Create a product image upload URL
|
|
7923
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7924
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7925
|
+
* @param {*} [options] Override http request option.
|
|
7926
|
+
* @throws {RequiredError}
|
|
7927
|
+
* @memberof EcommerceProductsApi
|
|
7928
|
+
*/
|
|
7929
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7930
|
+
return (0, exports.EcommerceProductsApiFp)(this.configuration).createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(this.axios, this.basePath));
|
|
7931
|
+
}
|
|
7857
7932
|
/**
|
|
7858
7933
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7859
7934
|
* @summary Create digital product
|
package/dist/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/base.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.32.
|
|
7
|
+
* API Version: 1.32.6
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/common.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/common.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.32.
|
|
7
|
+
* API Version: 1.32.6
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/configuration.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/configuration.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.32.
|
|
7
|
+
* API Version: 1.32.6
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -16,7 +16,7 @@ class Configuration {
|
|
|
16
16
|
var _a;
|
|
17
17
|
this.accessToken = param.accessToken;
|
|
18
18
|
this.basePath = param.basePath;
|
|
19
|
-
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.30.
|
|
19
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.30.8" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
20
20
|
this.formDataCtor = param.formDataCtor;
|
|
21
21
|
}
|
|
22
22
|
/**
|
package/dist/esm/api.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3481,6 +3481,39 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3481
3481
|
*/
|
|
3482
3482
|
'is_thumbnail': boolean;
|
|
3483
3483
|
}
|
|
3484
|
+
/**
|
|
3485
|
+
*
|
|
3486
|
+
* @export
|
|
3487
|
+
* @interface EcommerceV1ProductProductImageUploadUrlResource
|
|
3488
|
+
*/
|
|
3489
|
+
export interface EcommerceV1ProductProductImageUploadUrlResource {
|
|
3490
|
+
/**
|
|
3491
|
+
* Signed URL to upload the image to with a multipart/form-data POST.
|
|
3492
|
+
* @type {string}
|
|
3493
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3494
|
+
*/
|
|
3495
|
+
'upload_url': string;
|
|
3496
|
+
/**
|
|
3497
|
+
* Form fields to send alongside the file in the multipart POST.
|
|
3498
|
+
* @type {{ [key: string]: string; }}
|
|
3499
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3500
|
+
*/
|
|
3501
|
+
'fields': {
|
|
3502
|
+
[key: string]: string;
|
|
3503
|
+
};
|
|
3504
|
+
/**
|
|
3505
|
+
* Key of the uploaded object — send it to the attach-image endpoint.
|
|
3506
|
+
* @type {string}
|
|
3507
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3508
|
+
*/
|
|
3509
|
+
'object_name': string;
|
|
3510
|
+
/**
|
|
3511
|
+
* Maximum accepted upload size in bytes.
|
|
3512
|
+
* @type {number}
|
|
3513
|
+
* @memberof EcommerceV1ProductProductImageUploadUrlResource
|
|
3514
|
+
*/
|
|
3515
|
+
'max_bytes': number;
|
|
3516
|
+
}
|
|
3484
3517
|
/**
|
|
3485
3518
|
*
|
|
3486
3519
|
* @export
|
|
@@ -3488,11 +3521,17 @@ export interface EcommerceV1ProductProductImageUploadResource {
|
|
|
3488
3521
|
*/
|
|
3489
3522
|
export interface EcommerceV1ProductUploadProductImageRequest {
|
|
3490
3523
|
/**
|
|
3491
|
-
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted.
|
|
3524
|
+
* Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted. Provide either this or object_name.
|
|
3492
3525
|
* @type {string}
|
|
3493
3526
|
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3494
3527
|
*/
|
|
3495
3528
|
'image_url': string;
|
|
3529
|
+
/**
|
|
3530
|
+
* Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image.
|
|
3531
|
+
* @type {string}
|
|
3532
|
+
* @memberof EcommerceV1ProductUploadProductImageRequest
|
|
3533
|
+
*/
|
|
3534
|
+
'object_name': string;
|
|
3496
3535
|
/**
|
|
3497
3536
|
* When true, the image becomes the product\'s thumbnail (primary image). When omitted, it becomes the thumbnail only if the product does not have one yet.
|
|
3498
3537
|
* @type {boolean}
|
|
@@ -15198,6 +15237,15 @@ export declare class EcommercePaymentsApi extends BaseAPI {
|
|
|
15198
15237
|
* @export
|
|
15199
15238
|
*/
|
|
15200
15239
|
export declare const EcommerceProductsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
15240
|
+
/**
|
|
15241
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15242
|
+
* @summary Create a product image upload URL
|
|
15243
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15244
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15245
|
+
* @param {*} [options] Override http request option.
|
|
15246
|
+
* @throws {RequiredError}
|
|
15247
|
+
*/
|
|
15248
|
+
createAProductImageUploadURLV1: (storeId: string, productId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
|
|
15201
15249
|
/**
|
|
15202
15250
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15203
15251
|
* @summary Create digital product
|
|
@@ -15232,6 +15280,15 @@ export declare const EcommerceProductsApiAxiosParamCreator: (configuration?: Con
|
|
|
15232
15280
|
* @export
|
|
15233
15281
|
*/
|
|
15234
15282
|
export declare const EcommerceProductsApiFp: (configuration?: Configuration) => {
|
|
15283
|
+
/**
|
|
15284
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15285
|
+
* @summary Create a product image upload URL
|
|
15286
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15287
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15288
|
+
* @param {*} [options] Override http request option.
|
|
15289
|
+
* @throws {RequiredError}
|
|
15290
|
+
*/
|
|
15291
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource>>;
|
|
15235
15292
|
/**
|
|
15236
15293
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15237
15294
|
* @summary Create digital product
|
|
@@ -15266,6 +15323,15 @@ export declare const EcommerceProductsApiFp: (configuration?: Configuration) =>
|
|
|
15266
15323
|
* @export
|
|
15267
15324
|
*/
|
|
15268
15325
|
export declare const EcommerceProductsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
15326
|
+
/**
|
|
15327
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15328
|
+
* @summary Create a product image upload URL
|
|
15329
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15330
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15331
|
+
* @param {*} [options] Override http request option.
|
|
15332
|
+
* @throws {RequiredError}
|
|
15333
|
+
*/
|
|
15334
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): AxiosPromise<EcommerceV1ProductProductImageUploadUrlResource>;
|
|
15269
15335
|
/**
|
|
15270
15336
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15271
15337
|
* @summary Create digital product
|
|
@@ -15302,6 +15368,16 @@ export declare const EcommerceProductsApiFactory: (configuration?: Configuration
|
|
|
15302
15368
|
* @extends {BaseAPI}
|
|
15303
15369
|
*/
|
|
15304
15370
|
export declare class EcommerceProductsApi extends BaseAPI {
|
|
15371
|
+
/**
|
|
15372
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
15373
|
+
* @summary Create a product image upload URL
|
|
15374
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
15375
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
15376
|
+
* @param {*} [options] Override http request option.
|
|
15377
|
+
* @throws {RequiredError}
|
|
15378
|
+
* @memberof EcommerceProductsApi
|
|
15379
|
+
*/
|
|
15380
|
+
createAProductImageUploadURLV1(storeId: string, productId: string, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<EcommerceV1ProductProductImageUploadUrlResource, any, {}, any>>;
|
|
15305
15381
|
/**
|
|
15306
15382
|
* Create a published digital product with a single variant and an optional external download link.
|
|
15307
15383
|
* @summary Create digital product
|
package/dist/esm/api.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -7515,6 +7515,42 @@ export class EcommercePaymentsApi extends BaseAPI {
|
|
|
7515
7515
|
*/
|
|
7516
7516
|
export const EcommerceProductsApiAxiosParamCreator = function (configuration) {
|
|
7517
7517
|
return {
|
|
7518
|
+
/**
|
|
7519
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7520
|
+
* @summary Create a product image upload URL
|
|
7521
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7522
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7523
|
+
* @param {*} [options] Override http request option.
|
|
7524
|
+
* @throws {RequiredError}
|
|
7525
|
+
*/
|
|
7526
|
+
createAProductImageUploadURLV1: (storeId_1, productId_1, ...args_1) => __awaiter(this, [storeId_1, productId_1, ...args_1], void 0, function* (storeId, productId, options = {}) {
|
|
7527
|
+
// verify required parameter 'storeId' is not null or undefined
|
|
7528
|
+
assertParamExists('createAProductImageUploadURLV1', 'storeId', storeId);
|
|
7529
|
+
// verify required parameter 'productId' is not null or undefined
|
|
7530
|
+
assertParamExists('createAProductImageUploadURLV1', 'productId', productId);
|
|
7531
|
+
const localVarPath = `/api/ecommerce/v1/stores/{store_id}/products/{product_id}/images/upload-url`
|
|
7532
|
+
.replace(`{${"store_id"}}`, encodeURIComponent(String(storeId)))
|
|
7533
|
+
.replace(`{${"product_id"}}`, encodeURIComponent(String(productId)));
|
|
7534
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
7535
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
7536
|
+
let baseOptions;
|
|
7537
|
+
if (configuration) {
|
|
7538
|
+
baseOptions = configuration.baseOptions;
|
|
7539
|
+
}
|
|
7540
|
+
const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options);
|
|
7541
|
+
const localVarHeaderParameter = {};
|
|
7542
|
+
const localVarQueryParameter = {};
|
|
7543
|
+
// authentication apiToken required
|
|
7544
|
+
// http bearer authentication required
|
|
7545
|
+
yield setBearerAuthToObject(localVarHeaderParameter, configuration);
|
|
7546
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
7547
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
7548
|
+
localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
|
|
7549
|
+
return {
|
|
7550
|
+
url: toPathString(localVarUrlObj),
|
|
7551
|
+
options: localVarRequestOptions,
|
|
7552
|
+
};
|
|
7553
|
+
}),
|
|
7518
7554
|
/**
|
|
7519
7555
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7520
7556
|
* @summary Create digital product
|
|
@@ -7639,6 +7675,22 @@ export const EcommerceProductsApiAxiosParamCreator = function (configuration) {
|
|
|
7639
7675
|
export const EcommerceProductsApiFp = function (configuration) {
|
|
7640
7676
|
const localVarAxiosParamCreator = EcommerceProductsApiAxiosParamCreator(configuration);
|
|
7641
7677
|
return {
|
|
7678
|
+
/**
|
|
7679
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7680
|
+
* @summary Create a product image upload URL
|
|
7681
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7682
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7683
|
+
* @param {*} [options] Override http request option.
|
|
7684
|
+
* @throws {RequiredError}
|
|
7685
|
+
*/
|
|
7686
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7687
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7688
|
+
var _a, _b;
|
|
7689
|
+
const localVarAxiosArgs = yield localVarAxiosParamCreator.createAProductImageUploadURLV1(storeId, productId, options);
|
|
7690
|
+
const localVarOperationServerBasePath = (_b = (_a = operationServerMap['EcommerceProductsApi.createAProductImageUploadURLV1']) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.url;
|
|
7691
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
7692
|
+
});
|
|
7693
|
+
},
|
|
7642
7694
|
/**
|
|
7643
7695
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7644
7696
|
* @summary Create digital product
|
|
@@ -7697,6 +7749,17 @@ export const EcommerceProductsApiFp = function (configuration) {
|
|
|
7697
7749
|
export const EcommerceProductsApiFactory = function (configuration, basePath, axios) {
|
|
7698
7750
|
const localVarFp = EcommerceProductsApiFp(configuration);
|
|
7699
7751
|
return {
|
|
7752
|
+
/**
|
|
7753
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7754
|
+
* @summary Create a product image upload URL
|
|
7755
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7756
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7757
|
+
* @param {*} [options] Override http request option.
|
|
7758
|
+
* @throws {RequiredError}
|
|
7759
|
+
*/
|
|
7760
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7761
|
+
return localVarFp.createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(axios, basePath));
|
|
7762
|
+
},
|
|
7700
7763
|
/**
|
|
7701
7764
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7702
7765
|
* @summary Create digital product
|
|
@@ -7740,6 +7803,18 @@ export const EcommerceProductsApiFactory = function (configuration, basePath, ax
|
|
|
7740
7803
|
* @extends {BaseAPI}
|
|
7741
7804
|
*/
|
|
7742
7805
|
export class EcommerceProductsApi extends BaseAPI {
|
|
7806
|
+
/**
|
|
7807
|
+
* Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
7808
|
+
* @summary Create a product image upload URL
|
|
7809
|
+
* @param {string} storeId The ID of the store the product belongs to.
|
|
7810
|
+
* @param {string} productId The ID of the product the image will be attached to.
|
|
7811
|
+
* @param {*} [options] Override http request option.
|
|
7812
|
+
* @throws {RequiredError}
|
|
7813
|
+
* @memberof EcommerceProductsApi
|
|
7814
|
+
*/
|
|
7815
|
+
createAProductImageUploadURLV1(storeId, productId, options) {
|
|
7816
|
+
return EcommerceProductsApiFp(this.configuration).createAProductImageUploadURLV1(storeId, productId, options).then((request) => request(this.axios, this.basePath));
|
|
7817
|
+
}
|
|
7743
7818
|
/**
|
|
7744
7819
|
* Create a published digital product with a single variant and an optional external download link.
|
|
7745
7820
|
* @summary Create digital product
|
package/dist/esm/base.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/base.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/common.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/common.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -13,7 +13,7 @@ export class Configuration {
|
|
|
13
13
|
var _a;
|
|
14
14
|
this.accessToken = param.accessToken;
|
|
15
15
|
this.basePath = param.basePath;
|
|
16
|
-
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.30.
|
|
16
|
+
this.baseOptions = Object.assign(Object.assign({}, param.baseOptions), { headers: Object.assign({ 'User-Agent': "hostinger-typescript-sdk/1.30.8" }, (_a = param.baseOptions) === null || _a === void 0 ? void 0 : _a.headers) });
|
|
17
17
|
this.formDataCtor = param.formDataCtor;
|
|
18
18
|
}
|
|
19
19
|
/**
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/esm/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hostinger API
|
|
3
3
|
*
|
|
4
|
-
* API Version: 1.32.
|
|
4
|
+
* API Version: 1.32.6
|
|
5
5
|
*
|
|
6
6
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
7
7
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
/**
|
|
5
5
|
* Hostinger API
|
|
6
6
|
*
|
|
7
|
-
* API Version: 1.32.
|
|
7
|
+
* API Version: 1.32.6
|
|
8
8
|
*
|
|
9
9
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
10
10
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|
|
@@ -4,10 +4,67 @@ All URIs are relative to *https://developers.hostinger.com*
|
|
|
4
4
|
|
|
5
5
|
|Method | HTTP request | Description|
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
+
|[**createAProductImageUploadURLV1**](#createaproductimageuploadurlv1) | **POST** /api/ecommerce/v1/stores/{store_id}/products/{product_id}/images/upload-url | Create a product image upload URL|
|
|
7
8
|
|[**createDigitalProductV1**](#createdigitalproductv1) | **POST** /api/ecommerce/v1/stores/{store_id}/products/digital | Create digital product|
|
|
8
9
|
|[**createPhysicalProductV1**](#createphysicalproductv1) | **POST** /api/ecommerce/v1/stores/{store_id}/products/physical | Create physical product|
|
|
9
10
|
|[**uploadAndAttachAProductImageV1**](#uploadandattachaproductimagev1) | **POST** /api/ecommerce/v1/stores/{store_id}/products/{product_id}/images | Upload and attach a product image|
|
|
10
11
|
|
|
12
|
+
# **createAProductImageUploadURLV1**
|
|
13
|
+
> EcommerceV1ProductProductImageUploadUrlResource createAProductImageUploadURLV1()
|
|
14
|
+
|
|
15
|
+
Returns a signed URL to upload a product image to (multipart/form-data POST). Then call the attach-image endpoint with the returned object_name to scan and attach it to the product.
|
|
16
|
+
|
|
17
|
+
### Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import {
|
|
21
|
+
EcommerceProductsApi,
|
|
22
|
+
Configuration
|
|
23
|
+
} from 'hostinger-api-sdk';
|
|
24
|
+
|
|
25
|
+
const configuration = new Configuration();
|
|
26
|
+
const apiInstance = new EcommerceProductsApi(configuration);
|
|
27
|
+
|
|
28
|
+
let storeId: string; //The ID of the store the product belongs to. (default to undefined)
|
|
29
|
+
let productId: string; //The ID of the product the image will be attached to. (default to undefined)
|
|
30
|
+
|
|
31
|
+
const { status, data } = await apiInstance.createAProductImageUploadURLV1(
|
|
32
|
+
storeId,
|
|
33
|
+
productId
|
|
34
|
+
);
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Parameters
|
|
38
|
+
|
|
39
|
+
|Name | Type | Description | Notes|
|
|
40
|
+
|------------- | ------------- | ------------- | -------------|
|
|
41
|
+
| **storeId** | [**string**] | The ID of the store the product belongs to. | defaults to undefined|
|
|
42
|
+
| **productId** | [**string**] | The ID of the product the image will be attached to. | defaults to undefined|
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Return type
|
|
46
|
+
|
|
47
|
+
**EcommerceV1ProductProductImageUploadUrlResource**
|
|
48
|
+
|
|
49
|
+
### Authorization
|
|
50
|
+
|
|
51
|
+
[apiToken](../README.md#apiToken)
|
|
52
|
+
|
|
53
|
+
### HTTP request headers
|
|
54
|
+
|
|
55
|
+
- **Content-Type**: Not defined
|
|
56
|
+
- **Accept**: application/json
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### HTTP response details
|
|
60
|
+
| Status code | Description | Response headers |
|
|
61
|
+
|-------------|-------------|------------------|
|
|
62
|
+
|**200** | Success response | - |
|
|
63
|
+
|**401** | Unauthenticated response | - |
|
|
64
|
+
|**500** | Error response | - |
|
|
65
|
+
|
|
66
|
+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
|
|
67
|
+
|
|
11
68
|
# **createDigitalProductV1**
|
|
12
69
|
> EcommerceV1ProductProductCreationResource createDigitalProductV1(ecommerceV1ProductCreateDigitalProductRequest)
|
|
13
70
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# EcommerceV1ProductProductImageUploadUrlResource
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Properties
|
|
5
|
+
|
|
6
|
+
Name | Type | Description | Notes
|
|
7
|
+
------------ | ------------- | ------------- | -------------
|
|
8
|
+
**upload_url** | **string** | Signed URL to upload the image to with a multipart/form-data POST. | [optional] [default to undefined]
|
|
9
|
+
**fields** | **{ [key: string]: string; }** | Form fields to send alongside the file in the multipart POST. | [optional] [default to undefined]
|
|
10
|
+
**object_name** | **string** | Key of the uploaded object — send it to the attach-image endpoint. | [optional] [default to undefined]
|
|
11
|
+
**max_bytes** | **number** | Maximum accepted upload size in bytes. | [optional] [default to undefined]
|
|
12
|
+
|
|
13
|
+
## Example
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { EcommerceV1ProductProductImageUploadUrlResource } from 'hostinger-api-sdk';
|
|
17
|
+
|
|
18
|
+
const instance: EcommerceV1ProductProductImageUploadUrlResource = {
|
|
19
|
+
upload_url,
|
|
20
|
+
fields,
|
|
21
|
+
object_name,
|
|
22
|
+
max_bytes,
|
|
23
|
+
};
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
|
|
6
6
|
Name | Type | Description | Notes
|
|
7
7
|
------------ | ------------- | ------------- | -------------
|
|
8
|
-
**image_url** | **string** | Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted. | [default to undefined]
|
|
8
|
+
**image_url** | **string** | Publicly reachable URL of the raster image (JPEG, PNG, GIF or WebP), maximum 15MB. The image is fetched, virus-scanned and validated by content, then stored on the CDN. SVG is not accepted. Provide either this or object_name. | [optional] [default to undefined]
|
|
9
|
+
**object_name** | **string** | Key returned by the upload-url endpoint. Provide this instead of image_url to attach an uploaded image. | [optional] [default to undefined]
|
|
9
10
|
**is_thumbnail** | **boolean** | When true, the image becomes the product\'s thumbnail (primary image). When omitted, it becomes the thumbnail only if the product does not have one yet. | [optional] [default to undefined]
|
|
10
11
|
|
|
11
12
|
## Example
|
|
@@ -15,6 +16,7 @@ import { EcommerceV1ProductUploadProductImageRequest } from 'hostinger-api-sdk';
|
|
|
15
16
|
|
|
16
17
|
const instance: EcommerceV1ProductUploadProductImageRequest = {
|
|
17
18
|
image_url,
|
|
19
|
+
object_name,
|
|
18
20
|
is_thumbnail,
|
|
19
21
|
};
|
|
20
22
|
```
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 1.32.
|
|
6
|
+
* API Version: 1.32.6
|
|
7
7
|
*
|
|
8
8
|
* NOTE: This file is auto-generated, DO NOT EDIT THIS FILE MANUALLY!
|
|
9
9
|
* If you want to contribute or request a new feature, please create an issue or pull request on https://github.com/hostinger/api
|