hostinger-api-sdk 0.0.1 → 0.0.2
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 +609 -1
- package/base.ts +1 -1
- package/common.ts +1 -1
- package/configuration.ts +2 -2
- package/dist/api.d.ts +374 -1
- package/dist/api.js +453 -3
- 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 +374 -1
- package/dist/esm/api.js +443 -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/index.ts +1 -1
- package/package.json +1 -1
- package/.idea/api-typescript-sdk.iml +0 -8
- package/.idea/modules.xml +0 -8
- package/.idea/php.xml +0 -19
- package/.idea/vcs.xml +0 -6
package/README.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
## hostinger-api-sdk@0.0.
|
|
1
|
+
## hostinger-api-sdk@0.0.2
|
|
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@0.0.
|
|
8
|
+
npm install hostinger-api-sdk@0.0.2 --save
|
|
9
9
|
```
|
package/api.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 0.0.
|
|
6
|
+
* API Version: 0.0.14
|
|
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
|
|
@@ -614,6 +614,153 @@ export interface CommonSuccessEmptyResource {
|
|
|
614
614
|
*/
|
|
615
615
|
'message'?: string;
|
|
616
616
|
}
|
|
617
|
+
/**
|
|
618
|
+
*
|
|
619
|
+
* @export
|
|
620
|
+
* @interface DNSV1SnapshotSnapshotResource
|
|
621
|
+
*/
|
|
622
|
+
export interface DNSV1SnapshotSnapshotResource {
|
|
623
|
+
/**
|
|
624
|
+
* Snapshot ID
|
|
625
|
+
* @type {number}
|
|
626
|
+
* @memberof DNSV1SnapshotSnapshotResource
|
|
627
|
+
*/
|
|
628
|
+
'id'?: number;
|
|
629
|
+
/**
|
|
630
|
+
* Reason of the update
|
|
631
|
+
* @type {string}
|
|
632
|
+
* @memberof DNSV1SnapshotSnapshotResource
|
|
633
|
+
*/
|
|
634
|
+
'reason'?: string;
|
|
635
|
+
/**
|
|
636
|
+
*
|
|
637
|
+
* @type {string}
|
|
638
|
+
* @memberof DNSV1SnapshotSnapshotResource
|
|
639
|
+
*/
|
|
640
|
+
'created_at'?: string;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
*
|
|
644
|
+
* @export
|
|
645
|
+
* @interface DNSV1SnapshotSnapshotWithContentResource
|
|
646
|
+
*/
|
|
647
|
+
export interface DNSV1SnapshotSnapshotWithContentResource {
|
|
648
|
+
/**
|
|
649
|
+
* Snapshot ID
|
|
650
|
+
* @type {number}
|
|
651
|
+
* @memberof DNSV1SnapshotSnapshotWithContentResource
|
|
652
|
+
*/
|
|
653
|
+
'id'?: number;
|
|
654
|
+
/**
|
|
655
|
+
* Reason of the update
|
|
656
|
+
* @type {string}
|
|
657
|
+
* @memberof DNSV1SnapshotSnapshotWithContentResource
|
|
658
|
+
*/
|
|
659
|
+
'reason'?: string;
|
|
660
|
+
/**
|
|
661
|
+
* Contents of the DNS zone
|
|
662
|
+
* @type {string}
|
|
663
|
+
* @memberof DNSV1SnapshotSnapshotWithContentResource
|
|
664
|
+
*/
|
|
665
|
+
'snapshot'?: string;
|
|
666
|
+
/**
|
|
667
|
+
*
|
|
668
|
+
* @type {string}
|
|
669
|
+
* @memberof DNSV1SnapshotSnapshotWithContentResource
|
|
670
|
+
*/
|
|
671
|
+
'created_at'?: string;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
*
|
|
675
|
+
* @export
|
|
676
|
+
* @interface DNSV1ZoneNameRecordResource
|
|
677
|
+
*/
|
|
678
|
+
export interface DNSV1ZoneNameRecordResource {
|
|
679
|
+
/**
|
|
680
|
+
* Content of the name record
|
|
681
|
+
* @type {string}
|
|
682
|
+
* @memberof DNSV1ZoneNameRecordResource
|
|
683
|
+
*/
|
|
684
|
+
'content'?: string;
|
|
685
|
+
/**
|
|
686
|
+
* Flag to mark name record as disabled
|
|
687
|
+
* @type {boolean}
|
|
688
|
+
* @memberof DNSV1ZoneNameRecordResource
|
|
689
|
+
*/
|
|
690
|
+
'disabled'?: boolean;
|
|
691
|
+
}
|
|
692
|
+
/**
|
|
693
|
+
*
|
|
694
|
+
* @export
|
|
695
|
+
* @interface DNSV1ZoneNameResource
|
|
696
|
+
*/
|
|
697
|
+
export interface DNSV1ZoneNameResource {
|
|
698
|
+
/**
|
|
699
|
+
* Name of the record (use `@` for wildcard name)
|
|
700
|
+
* @type {string}
|
|
701
|
+
* @memberof DNSV1ZoneNameResource
|
|
702
|
+
*/
|
|
703
|
+
'name'?: string;
|
|
704
|
+
/**
|
|
705
|
+
* Array of [`DNS.V1.Zone.NameRecordResource`](#model/dnsv1zonenamerecordresource)
|
|
706
|
+
* @type {Array<DNSV1ZoneNameRecordResource>}
|
|
707
|
+
* @memberof DNSV1ZoneNameResource
|
|
708
|
+
*/
|
|
709
|
+
'records'?: Array<DNSV1ZoneNameRecordResource>;
|
|
710
|
+
/**
|
|
711
|
+
* TTL (Time-To-Live) of the record
|
|
712
|
+
* @type {number}
|
|
713
|
+
* @memberof DNSV1ZoneNameResource
|
|
714
|
+
*/
|
|
715
|
+
'ttl'?: number;
|
|
716
|
+
/**
|
|
717
|
+
* Type of the record
|
|
718
|
+
* @type {string}
|
|
719
|
+
* @memberof DNSV1ZoneNameResource
|
|
720
|
+
*/
|
|
721
|
+
'type'?: DNSV1ZoneNameResourceTypeEnum;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
export const DNSV1ZoneNameResourceTypeEnum = {
|
|
725
|
+
A: 'A',
|
|
726
|
+
Aaaa: 'AAAA',
|
|
727
|
+
Cname: 'CNAME',
|
|
728
|
+
Alias: 'ALIAS',
|
|
729
|
+
Mx: 'MX',
|
|
730
|
+
Txt: 'TXT',
|
|
731
|
+
Ns: 'NS',
|
|
732
|
+
Soa: 'SOA',
|
|
733
|
+
Srv: 'SRV',
|
|
734
|
+
Caa: 'CAA'
|
|
735
|
+
} as const;
|
|
736
|
+
|
|
737
|
+
export type DNSV1ZoneNameResourceTypeEnum = typeof DNSV1ZoneNameResourceTypeEnum[keyof typeof DNSV1ZoneNameResourceTypeEnum];
|
|
738
|
+
|
|
739
|
+
/**
|
|
740
|
+
*
|
|
741
|
+
* @export
|
|
742
|
+
* @interface DNSV1ZoneResetRequest
|
|
743
|
+
*/
|
|
744
|
+
export interface DNSV1ZoneResetRequest {
|
|
745
|
+
/**
|
|
746
|
+
* Determines if operation should be run synchronously
|
|
747
|
+
* @type {boolean}
|
|
748
|
+
* @memberof DNSV1ZoneResetRequest
|
|
749
|
+
*/
|
|
750
|
+
'sync'?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Determines if email records should be reset
|
|
753
|
+
* @type {boolean}
|
|
754
|
+
* @memberof DNSV1ZoneResetRequest
|
|
755
|
+
*/
|
|
756
|
+
'reset_email_records'?: boolean;
|
|
757
|
+
/**
|
|
758
|
+
* Specifies which record types to not reset
|
|
759
|
+
* @type {Array<string>}
|
|
760
|
+
* @memberof DNSV1ZoneResetRequest
|
|
761
|
+
*/
|
|
762
|
+
'whitelisted_record_types'?: Array<string>;
|
|
763
|
+
}
|
|
617
764
|
/**
|
|
618
765
|
*
|
|
619
766
|
* @export
|
|
@@ -2377,6 +2524,467 @@ export class BillingSubscriptionsApi extends BaseAPI {
|
|
|
2377
2524
|
|
|
2378
2525
|
|
|
2379
2526
|
|
|
2527
|
+
/**
|
|
2528
|
+
* DNSSnapshotApi - axios parameter creator
|
|
2529
|
+
* @export
|
|
2530
|
+
*/
|
|
2531
|
+
export const DNSSnapshotApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2532
|
+
return {
|
|
2533
|
+
/**
|
|
2534
|
+
* This endpoint retrieves list of DNS snapshots.
|
|
2535
|
+
* @summary Get snapshot list
|
|
2536
|
+
* @param {string} domain Domain name
|
|
2537
|
+
* @param {*} [options] Override http request option.
|
|
2538
|
+
* @throws {RequiredError}
|
|
2539
|
+
*/
|
|
2540
|
+
getSnapshotListV1: async (domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2541
|
+
// verify required parameter 'domain' is not null or undefined
|
|
2542
|
+
assertParamExists('getSnapshotListV1', 'domain', domain)
|
|
2543
|
+
const localVarPath = `/api/dns/v1/snapshots/{domain}`
|
|
2544
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
2545
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2546
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2547
|
+
let baseOptions;
|
|
2548
|
+
if (configuration) {
|
|
2549
|
+
baseOptions = configuration.baseOptions;
|
|
2550
|
+
}
|
|
2551
|
+
|
|
2552
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2553
|
+
const localVarHeaderParameter = {} as any;
|
|
2554
|
+
const localVarQueryParameter = {} as any;
|
|
2555
|
+
|
|
2556
|
+
// authentication apiToken required
|
|
2557
|
+
// http bearer authentication required
|
|
2558
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2559
|
+
|
|
2560
|
+
|
|
2561
|
+
|
|
2562
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2563
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2564
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2565
|
+
|
|
2566
|
+
return {
|
|
2567
|
+
url: toPathString(localVarUrlObj),
|
|
2568
|
+
options: localVarRequestOptions,
|
|
2569
|
+
};
|
|
2570
|
+
},
|
|
2571
|
+
/**
|
|
2572
|
+
* This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
|
|
2573
|
+
* @summary Get snapshot
|
|
2574
|
+
* @param {string} domain Domain name
|
|
2575
|
+
* @param {number} snapshotId Snapshot ID
|
|
2576
|
+
* @param {*} [options] Override http request option.
|
|
2577
|
+
* @throws {RequiredError}
|
|
2578
|
+
*/
|
|
2579
|
+
getSnapshotV1: async (domain: string, snapshotId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2580
|
+
// verify required parameter 'domain' is not null or undefined
|
|
2581
|
+
assertParamExists('getSnapshotV1', 'domain', domain)
|
|
2582
|
+
// verify required parameter 'snapshotId' is not null or undefined
|
|
2583
|
+
assertParamExists('getSnapshotV1', 'snapshotId', snapshotId)
|
|
2584
|
+
const localVarPath = `/api/dns/v1/snapshots/{domain}/{snapshotId}`
|
|
2585
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)))
|
|
2586
|
+
.replace(`{${"snapshotId"}}`, encodeURIComponent(String(snapshotId)));
|
|
2587
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2588
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2589
|
+
let baseOptions;
|
|
2590
|
+
if (configuration) {
|
|
2591
|
+
baseOptions = configuration.baseOptions;
|
|
2592
|
+
}
|
|
2593
|
+
|
|
2594
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2595
|
+
const localVarHeaderParameter = {} as any;
|
|
2596
|
+
const localVarQueryParameter = {} as any;
|
|
2597
|
+
|
|
2598
|
+
// authentication apiToken required
|
|
2599
|
+
// http bearer authentication required
|
|
2600
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2601
|
+
|
|
2602
|
+
|
|
2603
|
+
|
|
2604
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2605
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2606
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2607
|
+
|
|
2608
|
+
return {
|
|
2609
|
+
url: toPathString(localVarUrlObj),
|
|
2610
|
+
options: localVarRequestOptions,
|
|
2611
|
+
};
|
|
2612
|
+
},
|
|
2613
|
+
/**
|
|
2614
|
+
* This endpoint restores DNS zone to the selected snapshot.
|
|
2615
|
+
* @summary Restore snapshot
|
|
2616
|
+
* @param {string} domain Domain name
|
|
2617
|
+
* @param {number} snapshotId Snapshot ID
|
|
2618
|
+
* @param {*} [options] Override http request option.
|
|
2619
|
+
* @throws {RequiredError}
|
|
2620
|
+
*/
|
|
2621
|
+
restoreSnapshotV1: async (domain: string, snapshotId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2622
|
+
// verify required parameter 'domain' is not null or undefined
|
|
2623
|
+
assertParamExists('restoreSnapshotV1', 'domain', domain)
|
|
2624
|
+
// verify required parameter 'snapshotId' is not null or undefined
|
|
2625
|
+
assertParamExists('restoreSnapshotV1', 'snapshotId', snapshotId)
|
|
2626
|
+
const localVarPath = `/api/dns/v1/snapshots/{domain}/{snapshotId}`
|
|
2627
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)))
|
|
2628
|
+
.replace(`{${"snapshotId"}}`, encodeURIComponent(String(snapshotId)));
|
|
2629
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2630
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2631
|
+
let baseOptions;
|
|
2632
|
+
if (configuration) {
|
|
2633
|
+
baseOptions = configuration.baseOptions;
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
2637
|
+
const localVarHeaderParameter = {} as any;
|
|
2638
|
+
const localVarQueryParameter = {} as any;
|
|
2639
|
+
|
|
2640
|
+
// authentication apiToken required
|
|
2641
|
+
// http bearer authentication required
|
|
2642
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2643
|
+
|
|
2644
|
+
|
|
2645
|
+
|
|
2646
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2647
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2648
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2649
|
+
|
|
2650
|
+
return {
|
|
2651
|
+
url: toPathString(localVarUrlObj),
|
|
2652
|
+
options: localVarRequestOptions,
|
|
2653
|
+
};
|
|
2654
|
+
},
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
|
|
2658
|
+
/**
|
|
2659
|
+
* DNSSnapshotApi - functional programming interface
|
|
2660
|
+
* @export
|
|
2661
|
+
*/
|
|
2662
|
+
export const DNSSnapshotApiFp = function(configuration?: Configuration) {
|
|
2663
|
+
const localVarAxiosParamCreator = DNSSnapshotApiAxiosParamCreator(configuration)
|
|
2664
|
+
return {
|
|
2665
|
+
/**
|
|
2666
|
+
* This endpoint retrieves list of DNS snapshots.
|
|
2667
|
+
* @summary Get snapshot list
|
|
2668
|
+
* @param {string} domain Domain name
|
|
2669
|
+
* @param {*} [options] Override http request option.
|
|
2670
|
+
* @throws {RequiredError}
|
|
2671
|
+
*/
|
|
2672
|
+
async getSnapshotListV1(domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DNSV1SnapshotSnapshotResource>>> {
|
|
2673
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getSnapshotListV1(domain, options);
|
|
2674
|
+
const localVarOperationServerBasePath = operationServerMap['DNSSnapshotApi.getSnapshotListV1']?.[0]?.url;
|
|
2675
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2676
|
+
},
|
|
2677
|
+
/**
|
|
2678
|
+
* This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
|
|
2679
|
+
* @summary Get snapshot
|
|
2680
|
+
* @param {string} domain Domain name
|
|
2681
|
+
* @param {number} snapshotId Snapshot ID
|
|
2682
|
+
* @param {*} [options] Override http request option.
|
|
2683
|
+
* @throws {RequiredError}
|
|
2684
|
+
*/
|
|
2685
|
+
async getSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DNSV1SnapshotSnapshotWithContentResource>> {
|
|
2686
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getSnapshotV1(domain, snapshotId, options);
|
|
2687
|
+
const localVarOperationServerBasePath = operationServerMap['DNSSnapshotApi.getSnapshotV1']?.[0]?.url;
|
|
2688
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2689
|
+
},
|
|
2690
|
+
/**
|
|
2691
|
+
* This endpoint restores DNS zone to the selected snapshot.
|
|
2692
|
+
* @summary Restore snapshot
|
|
2693
|
+
* @param {string} domain Domain name
|
|
2694
|
+
* @param {number} snapshotId Snapshot ID
|
|
2695
|
+
* @param {*} [options] Override http request option.
|
|
2696
|
+
* @throws {RequiredError}
|
|
2697
|
+
*/
|
|
2698
|
+
async restoreSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
|
|
2699
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.restoreSnapshotV1(domain, snapshotId, options);
|
|
2700
|
+
const localVarOperationServerBasePath = operationServerMap['DNSSnapshotApi.restoreSnapshotV1']?.[0]?.url;
|
|
2701
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2702
|
+
},
|
|
2703
|
+
}
|
|
2704
|
+
};
|
|
2705
|
+
|
|
2706
|
+
/**
|
|
2707
|
+
* DNSSnapshotApi - factory interface
|
|
2708
|
+
* @export
|
|
2709
|
+
*/
|
|
2710
|
+
export const DNSSnapshotApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2711
|
+
const localVarFp = DNSSnapshotApiFp(configuration)
|
|
2712
|
+
return {
|
|
2713
|
+
/**
|
|
2714
|
+
* This endpoint retrieves list of DNS snapshots.
|
|
2715
|
+
* @summary Get snapshot list
|
|
2716
|
+
* @param {string} domain Domain name
|
|
2717
|
+
* @param {*} [options] Override http request option.
|
|
2718
|
+
* @throws {RequiredError}
|
|
2719
|
+
*/
|
|
2720
|
+
getSnapshotListV1(domain: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<DNSV1SnapshotSnapshotResource>> {
|
|
2721
|
+
return localVarFp.getSnapshotListV1(domain, options).then((request) => request(axios, basePath));
|
|
2722
|
+
},
|
|
2723
|
+
/**
|
|
2724
|
+
* This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
|
|
2725
|
+
* @summary Get snapshot
|
|
2726
|
+
* @param {string} domain Domain name
|
|
2727
|
+
* @param {number} snapshotId Snapshot ID
|
|
2728
|
+
* @param {*} [options] Override http request option.
|
|
2729
|
+
* @throws {RequiredError}
|
|
2730
|
+
*/
|
|
2731
|
+
getSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig): AxiosPromise<DNSV1SnapshotSnapshotWithContentResource> {
|
|
2732
|
+
return localVarFp.getSnapshotV1(domain, snapshotId, options).then((request) => request(axios, basePath));
|
|
2733
|
+
},
|
|
2734
|
+
/**
|
|
2735
|
+
* This endpoint restores DNS zone to the selected snapshot.
|
|
2736
|
+
* @summary Restore snapshot
|
|
2737
|
+
* @param {string} domain Domain name
|
|
2738
|
+
* @param {number} snapshotId Snapshot ID
|
|
2739
|
+
* @param {*} [options] Override http request option.
|
|
2740
|
+
* @throws {RequiredError}
|
|
2741
|
+
*/
|
|
2742
|
+
restoreSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
|
|
2743
|
+
return localVarFp.restoreSnapshotV1(domain, snapshotId, options).then((request) => request(axios, basePath));
|
|
2744
|
+
},
|
|
2745
|
+
};
|
|
2746
|
+
};
|
|
2747
|
+
|
|
2748
|
+
/**
|
|
2749
|
+
* DNSSnapshotApi - object-oriented interface
|
|
2750
|
+
* @export
|
|
2751
|
+
* @class DNSSnapshotApi
|
|
2752
|
+
* @extends {BaseAPI}
|
|
2753
|
+
*/
|
|
2754
|
+
export class DNSSnapshotApi extends BaseAPI {
|
|
2755
|
+
/**
|
|
2756
|
+
* This endpoint retrieves list of DNS snapshots.
|
|
2757
|
+
* @summary Get snapshot list
|
|
2758
|
+
* @param {string} domain Domain name
|
|
2759
|
+
* @param {*} [options] Override http request option.
|
|
2760
|
+
* @throws {RequiredError}
|
|
2761
|
+
* @memberof DNSSnapshotApi
|
|
2762
|
+
*/
|
|
2763
|
+
public getSnapshotListV1(domain: string, options?: RawAxiosRequestConfig) {
|
|
2764
|
+
return DNSSnapshotApiFp(this.configuration).getSnapshotListV1(domain, options).then((request) => request(this.axios, this.basePath));
|
|
2765
|
+
}
|
|
2766
|
+
|
|
2767
|
+
/**
|
|
2768
|
+
* This endpoint retrieves particular DNS snapshot with the contents of DNS zone records.
|
|
2769
|
+
* @summary Get snapshot
|
|
2770
|
+
* @param {string} domain Domain name
|
|
2771
|
+
* @param {number} snapshotId Snapshot ID
|
|
2772
|
+
* @param {*} [options] Override http request option.
|
|
2773
|
+
* @throws {RequiredError}
|
|
2774
|
+
* @memberof DNSSnapshotApi
|
|
2775
|
+
*/
|
|
2776
|
+
public getSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig) {
|
|
2777
|
+
return DNSSnapshotApiFp(this.configuration).getSnapshotV1(domain, snapshotId, options).then((request) => request(this.axios, this.basePath));
|
|
2778
|
+
}
|
|
2779
|
+
|
|
2780
|
+
/**
|
|
2781
|
+
* This endpoint restores DNS zone to the selected snapshot.
|
|
2782
|
+
* @summary Restore snapshot
|
|
2783
|
+
* @param {string} domain Domain name
|
|
2784
|
+
* @param {number} snapshotId Snapshot ID
|
|
2785
|
+
* @param {*} [options] Override http request option.
|
|
2786
|
+
* @throws {RequiredError}
|
|
2787
|
+
* @memberof DNSSnapshotApi
|
|
2788
|
+
*/
|
|
2789
|
+
public restoreSnapshotV1(domain: string, snapshotId: number, options?: RawAxiosRequestConfig) {
|
|
2790
|
+
return DNSSnapshotApiFp(this.configuration).restoreSnapshotV1(domain, snapshotId, options).then((request) => request(this.axios, this.basePath));
|
|
2791
|
+
}
|
|
2792
|
+
}
|
|
2793
|
+
|
|
2794
|
+
|
|
2795
|
+
|
|
2796
|
+
/**
|
|
2797
|
+
* DNSZoneApi - axios parameter creator
|
|
2798
|
+
* @export
|
|
2799
|
+
*/
|
|
2800
|
+
export const DNSZoneApiAxiosParamCreator = function (configuration?: Configuration) {
|
|
2801
|
+
return {
|
|
2802
|
+
/**
|
|
2803
|
+
* This endpoint retrieves DNS zone records for a specific domain.
|
|
2804
|
+
* @summary Get records
|
|
2805
|
+
* @param {string} domain Domain name
|
|
2806
|
+
* @param {*} [options] Override http request option.
|
|
2807
|
+
* @throws {RequiredError}
|
|
2808
|
+
*/
|
|
2809
|
+
getRecordsV1: async (domain: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2810
|
+
// verify required parameter 'domain' is not null or undefined
|
|
2811
|
+
assertParamExists('getRecordsV1', 'domain', domain)
|
|
2812
|
+
const localVarPath = `/api/dns/v1/zones/{domain}`
|
|
2813
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
2814
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2815
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2816
|
+
let baseOptions;
|
|
2817
|
+
if (configuration) {
|
|
2818
|
+
baseOptions = configuration.baseOptions;
|
|
2819
|
+
}
|
|
2820
|
+
|
|
2821
|
+
const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
|
|
2822
|
+
const localVarHeaderParameter = {} as any;
|
|
2823
|
+
const localVarQueryParameter = {} as any;
|
|
2824
|
+
|
|
2825
|
+
// authentication apiToken required
|
|
2826
|
+
// http bearer authentication required
|
|
2827
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2828
|
+
|
|
2829
|
+
|
|
2830
|
+
|
|
2831
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2832
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2833
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2834
|
+
|
|
2835
|
+
return {
|
|
2836
|
+
url: toPathString(localVarUrlObj),
|
|
2837
|
+
options: localVarRequestOptions,
|
|
2838
|
+
};
|
|
2839
|
+
},
|
|
2840
|
+
/**
|
|
2841
|
+
* This endpoint resets DNS zone to the default records.
|
|
2842
|
+
* @summary Reset zone records
|
|
2843
|
+
* @param {string} domain Domain name
|
|
2844
|
+
* @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
|
|
2845
|
+
* @param {*} [options] Override http request option.
|
|
2846
|
+
* @throws {RequiredError}
|
|
2847
|
+
*/
|
|
2848
|
+
resetZoneRecordsV1: async (domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
|
|
2849
|
+
// verify required parameter 'domain' is not null or undefined
|
|
2850
|
+
assertParamExists('resetZoneRecordsV1', 'domain', domain)
|
|
2851
|
+
// verify required parameter 'dNSV1ZoneResetRequest' is not null or undefined
|
|
2852
|
+
assertParamExists('resetZoneRecordsV1', 'dNSV1ZoneResetRequest', dNSV1ZoneResetRequest)
|
|
2853
|
+
const localVarPath = `/api/dns/v1/zones/{domain}/reset`
|
|
2854
|
+
.replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
|
|
2855
|
+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
|
|
2856
|
+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
|
|
2857
|
+
let baseOptions;
|
|
2858
|
+
if (configuration) {
|
|
2859
|
+
baseOptions = configuration.baseOptions;
|
|
2860
|
+
}
|
|
2861
|
+
|
|
2862
|
+
const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
|
|
2863
|
+
const localVarHeaderParameter = {} as any;
|
|
2864
|
+
const localVarQueryParameter = {} as any;
|
|
2865
|
+
|
|
2866
|
+
// authentication apiToken required
|
|
2867
|
+
// http bearer authentication required
|
|
2868
|
+
await setBearerAuthToObject(localVarHeaderParameter, configuration)
|
|
2869
|
+
|
|
2870
|
+
|
|
2871
|
+
|
|
2872
|
+
localVarHeaderParameter['Content-Type'] = 'application/json';
|
|
2873
|
+
|
|
2874
|
+
setSearchParams(localVarUrlObj, localVarQueryParameter);
|
|
2875
|
+
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
|
|
2876
|
+
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
|
|
2877
|
+
localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneResetRequest, localVarRequestOptions, configuration)
|
|
2878
|
+
|
|
2879
|
+
return {
|
|
2880
|
+
url: toPathString(localVarUrlObj),
|
|
2881
|
+
options: localVarRequestOptions,
|
|
2882
|
+
};
|
|
2883
|
+
},
|
|
2884
|
+
}
|
|
2885
|
+
};
|
|
2886
|
+
|
|
2887
|
+
/**
|
|
2888
|
+
* DNSZoneApi - functional programming interface
|
|
2889
|
+
* @export
|
|
2890
|
+
*/
|
|
2891
|
+
export const DNSZoneApiFp = function(configuration?: Configuration) {
|
|
2892
|
+
const localVarAxiosParamCreator = DNSZoneApiAxiosParamCreator(configuration)
|
|
2893
|
+
return {
|
|
2894
|
+
/**
|
|
2895
|
+
* This endpoint retrieves DNS zone records for a specific domain.
|
|
2896
|
+
* @summary Get records
|
|
2897
|
+
* @param {string} domain Domain name
|
|
2898
|
+
* @param {*} [options] Override http request option.
|
|
2899
|
+
* @throws {RequiredError}
|
|
2900
|
+
*/
|
|
2901
|
+
async getRecordsV1(domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DNSV1ZoneNameResource>>> {
|
|
2902
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.getRecordsV1(domain, options);
|
|
2903
|
+
const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.getRecordsV1']?.[0]?.url;
|
|
2904
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2905
|
+
},
|
|
2906
|
+
/**
|
|
2907
|
+
* This endpoint resets DNS zone to the default records.
|
|
2908
|
+
* @summary Reset zone records
|
|
2909
|
+
* @param {string} domain Domain name
|
|
2910
|
+
* @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
|
|
2911
|
+
* @param {*} [options] Override http request option.
|
|
2912
|
+
* @throws {RequiredError}
|
|
2913
|
+
*/
|
|
2914
|
+
async resetZoneRecordsV1(domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
|
|
2915
|
+
const localVarAxiosArgs = await localVarAxiosParamCreator.resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options);
|
|
2916
|
+
const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.resetZoneRecordsV1']?.[0]?.url;
|
|
2917
|
+
return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
|
|
2918
|
+
},
|
|
2919
|
+
}
|
|
2920
|
+
};
|
|
2921
|
+
|
|
2922
|
+
/**
|
|
2923
|
+
* DNSZoneApi - factory interface
|
|
2924
|
+
* @export
|
|
2925
|
+
*/
|
|
2926
|
+
export const DNSZoneApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
|
|
2927
|
+
const localVarFp = DNSZoneApiFp(configuration)
|
|
2928
|
+
return {
|
|
2929
|
+
/**
|
|
2930
|
+
* This endpoint retrieves DNS zone records for a specific domain.
|
|
2931
|
+
* @summary Get records
|
|
2932
|
+
* @param {string} domain Domain name
|
|
2933
|
+
* @param {*} [options] Override http request option.
|
|
2934
|
+
* @throws {RequiredError}
|
|
2935
|
+
*/
|
|
2936
|
+
getRecordsV1(domain: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<DNSV1ZoneNameResource>> {
|
|
2937
|
+
return localVarFp.getRecordsV1(domain, options).then((request) => request(axios, basePath));
|
|
2938
|
+
},
|
|
2939
|
+
/**
|
|
2940
|
+
* This endpoint resets DNS zone to the default records.
|
|
2941
|
+
* @summary Reset zone records
|
|
2942
|
+
* @param {string} domain Domain name
|
|
2943
|
+
* @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
|
|
2944
|
+
* @param {*} [options] Override http request option.
|
|
2945
|
+
* @throws {RequiredError}
|
|
2946
|
+
*/
|
|
2947
|
+
resetZoneRecordsV1(domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
|
|
2948
|
+
return localVarFp.resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(axios, basePath));
|
|
2949
|
+
},
|
|
2950
|
+
};
|
|
2951
|
+
};
|
|
2952
|
+
|
|
2953
|
+
/**
|
|
2954
|
+
* DNSZoneApi - object-oriented interface
|
|
2955
|
+
* @export
|
|
2956
|
+
* @class DNSZoneApi
|
|
2957
|
+
* @extends {BaseAPI}
|
|
2958
|
+
*/
|
|
2959
|
+
export class DNSZoneApi extends BaseAPI {
|
|
2960
|
+
/**
|
|
2961
|
+
* This endpoint retrieves DNS zone records for a specific domain.
|
|
2962
|
+
* @summary Get records
|
|
2963
|
+
* @param {string} domain Domain name
|
|
2964
|
+
* @param {*} [options] Override http request option.
|
|
2965
|
+
* @throws {RequiredError}
|
|
2966
|
+
* @memberof DNSZoneApi
|
|
2967
|
+
*/
|
|
2968
|
+
public getRecordsV1(domain: string, options?: RawAxiosRequestConfig) {
|
|
2969
|
+
return DNSZoneApiFp(this.configuration).getRecordsV1(domain, options).then((request) => request(this.axios, this.basePath));
|
|
2970
|
+
}
|
|
2971
|
+
|
|
2972
|
+
/**
|
|
2973
|
+
* This endpoint resets DNS zone to the default records.
|
|
2974
|
+
* @summary Reset zone records
|
|
2975
|
+
* @param {string} domain Domain name
|
|
2976
|
+
* @param {DNSV1ZoneResetRequest} dNSV1ZoneResetRequest
|
|
2977
|
+
* @param {*} [options] Override http request option.
|
|
2978
|
+
* @throws {RequiredError}
|
|
2979
|
+
* @memberof DNSZoneApi
|
|
2980
|
+
*/
|
|
2981
|
+
public resetZoneRecordsV1(domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options?: RawAxiosRequestConfig) {
|
|
2982
|
+
return DNSZoneApiFp(this.configuration).resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(this.axios, this.basePath));
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
|
|
2986
|
+
|
|
2987
|
+
|
|
2380
2988
|
/**
|
|
2381
2989
|
* DomainsPortfolioApi - axios parameter creator
|
|
2382
2990
|
* @export
|
package/base.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* Hostinger API
|
|
5
5
|
*
|
|
6
|
-
* API Version: 0.0.
|
|
6
|
+
* API Version: 0.0.14
|
|
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: 0.0.
|
|
6
|
+
* API Version: 0.0.14
|
|
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: 0.0.
|
|
6
|
+
* API Version: 0.0.14
|
|
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-api-sdk-typescript/0.0.
|
|
51
|
+
'User-Agent': "hostinger-api-sdk-typescript/0.0.2",
|
|
52
52
|
...param.baseOptions?.headers,
|
|
53
53
|
},
|
|
54
54
|
};
|