hostinger-api-sdk 0.0.2 → 0.0.4

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.
@@ -1,4 +1,4 @@
1
- name: publish-release
1
+ name: build-release
2
2
 
3
3
  on:
4
4
  push:
@@ -6,8 +6,28 @@ on:
6
6
  - main
7
7
 
8
8
  jobs:
9
- npmjs:
9
+ release:
10
10
  runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Repo checkout
13
+ uses: actions/checkout@v4
14
+
15
+ - name: Bump version and push tag
16
+ id: bump
17
+ uses: hennejg/github-tag-action@v4.3.1
18
+ with:
19
+ github_token: ${{ secrets.GITHUB_TOKEN }}
20
+ release_branches: main
21
+
22
+ - name: Release tag
23
+ uses: ncipollo/release-action@v1
24
+ with:
25
+ tag: ${{ steps.bump.outputs.new_tag }}
26
+ generateReleaseNotes: true
27
+
28
+ publish-npmjs:
29
+ runs-on: ubuntu-latest
30
+ needs: [release]
11
31
  permissions:
12
32
  contents: read
13
33
  id-token: write
@@ -27,8 +47,9 @@ jobs:
27
47
  env:
28
48
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
29
49
 
30
- github:
50
+ publish-github:
31
51
  runs-on: ubuntu-latest
52
+ needs: [release]
32
53
  permissions:
33
54
  contents: read
34
55
  id-token: write
package/CODEOWNERS ADDED
@@ -0,0 +1 @@
1
+ * @hostinger/vps-team-dev
package/README.md CHANGED
@@ -1,9 +1,9 @@
1
- ## hostinger-api-sdk@0.0.2
1
+ ## hostinger-api-sdk@0.0.4
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.2 --save
8
+ npm install hostinger-api-sdk@0.0.4 --save
9
9
  ```
package/api.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 0.0.14
6
+ * API Version: 0.0.17
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
@@ -670,6 +670,54 @@ export interface DNSV1SnapshotSnapshotWithContentResource {
670
670
  */
671
671
  'created_at'?: string;
672
672
  }
673
+ /**
674
+ *
675
+ * @export
676
+ * @interface DNSV1ZoneDestroyRequest
677
+ */
678
+ export interface DNSV1ZoneDestroyRequest {
679
+ /**
680
+ * Filter records for deletion
681
+ * @type {Array<DNSV1ZoneDestroyRequestFiltersInner>}
682
+ * @memberof DNSV1ZoneDestroyRequest
683
+ */
684
+ 'filters': Array<DNSV1ZoneDestroyRequestFiltersInner>;
685
+ }
686
+ /**
687
+ *
688
+ * @export
689
+ * @interface DNSV1ZoneDestroyRequestFiltersInner
690
+ */
691
+ export interface DNSV1ZoneDestroyRequestFiltersInner {
692
+ /**
693
+ * Name of the record
694
+ * @type {string}
695
+ * @memberof DNSV1ZoneDestroyRequestFiltersInner
696
+ */
697
+ 'name'?: string;
698
+ /**
699
+ * Type of the record
700
+ * @type {string}
701
+ * @memberof DNSV1ZoneDestroyRequestFiltersInner
702
+ */
703
+ 'type'?: DNSV1ZoneDestroyRequestFiltersInnerTypeEnum;
704
+ }
705
+
706
+ export const DNSV1ZoneDestroyRequestFiltersInnerTypeEnum = {
707
+ A: 'A',
708
+ Aaaa: 'AAAA',
709
+ Cname: 'CNAME',
710
+ Alias: 'ALIAS',
711
+ Mx: 'MX',
712
+ Txt: 'TXT',
713
+ Ns: 'NS',
714
+ Soa: 'SOA',
715
+ Srv: 'SRV',
716
+ Caa: 'CAA'
717
+ } as const;
718
+
719
+ export type DNSV1ZoneDestroyRequestFiltersInnerTypeEnum = typeof DNSV1ZoneDestroyRequestFiltersInnerTypeEnum[keyof typeof DNSV1ZoneDestroyRequestFiltersInnerTypeEnum];
720
+
673
721
  /**
674
722
  *
675
723
  * @export
@@ -692,36 +740,36 @@ export interface DNSV1ZoneNameRecordResource {
692
740
  /**
693
741
  *
694
742
  * @export
695
- * @interface DNSV1ZoneNameResource
743
+ * @interface DNSV1ZoneRecordResource
696
744
  */
697
- export interface DNSV1ZoneNameResource {
745
+ export interface DNSV1ZoneRecordResource {
698
746
  /**
699
747
  * Name of the record (use `@` for wildcard name)
700
748
  * @type {string}
701
- * @memberof DNSV1ZoneNameResource
749
+ * @memberof DNSV1ZoneRecordResource
702
750
  */
703
751
  'name'?: string;
704
752
  /**
705
753
  * Array of [`DNS.V1.Zone.NameRecordResource`](#model/dnsv1zonenamerecordresource)
706
754
  * @type {Array<DNSV1ZoneNameRecordResource>}
707
- * @memberof DNSV1ZoneNameResource
755
+ * @memberof DNSV1ZoneRecordResource
708
756
  */
709
757
  'records'?: Array<DNSV1ZoneNameRecordResource>;
710
758
  /**
711
759
  * TTL (Time-To-Live) of the record
712
760
  * @type {number}
713
- * @memberof DNSV1ZoneNameResource
761
+ * @memberof DNSV1ZoneRecordResource
714
762
  */
715
763
  'ttl'?: number;
716
764
  /**
717
765
  * Type of the record
718
766
  * @type {string}
719
- * @memberof DNSV1ZoneNameResource
767
+ * @memberof DNSV1ZoneRecordResource
720
768
  */
721
- 'type'?: DNSV1ZoneNameResourceTypeEnum;
769
+ 'type'?: DNSV1ZoneRecordResourceTypeEnum;
722
770
  }
723
771
 
724
- export const DNSV1ZoneNameResourceTypeEnum = {
772
+ export const DNSV1ZoneRecordResourceTypeEnum = {
725
773
  A: 'A',
726
774
  Aaaa: 'AAAA',
727
775
  Cname: 'CNAME',
@@ -734,7 +782,7 @@ export const DNSV1ZoneNameResourceTypeEnum = {
734
782
  Caa: 'CAA'
735
783
  } as const;
736
784
 
737
- export type DNSV1ZoneNameResourceTypeEnum = typeof DNSV1ZoneNameResourceTypeEnum[keyof typeof DNSV1ZoneNameResourceTypeEnum];
785
+ export type DNSV1ZoneRecordResourceTypeEnum = typeof DNSV1ZoneRecordResourceTypeEnum[keyof typeof DNSV1ZoneRecordResourceTypeEnum];
738
786
 
739
787
  /**
740
788
  *
@@ -761,6 +809,85 @@ export interface DNSV1ZoneResetRequest {
761
809
  */
762
810
  'whitelisted_record_types'?: Array<string>;
763
811
  }
812
+ /**
813
+ *
814
+ * @export
815
+ * @interface DNSV1ZoneUpdateRequest
816
+ */
817
+ export interface DNSV1ZoneUpdateRequest {
818
+ /**
819
+ * If `true`, resource records (RRs) matching name and type will be deleted and new RRs will be created, otherwise resource records\' ttl\'s are updated and new records are appended. If no matching RRs are found, they are created.
820
+ * @type {boolean}
821
+ * @memberof DNSV1ZoneUpdateRequest
822
+ */
823
+ 'overwrite'?: boolean;
824
+ /**
825
+ *
826
+ * @type {Array<DNSV1ZoneUpdateRequestZoneInner>}
827
+ * @memberof DNSV1ZoneUpdateRequest
828
+ */
829
+ 'zone': Array<DNSV1ZoneUpdateRequestZoneInner>;
830
+ }
831
+ /**
832
+ *
833
+ * @export
834
+ * @interface DNSV1ZoneUpdateRequestZoneInner
835
+ */
836
+ export interface DNSV1ZoneUpdateRequestZoneInner {
837
+ /**
838
+ * Name of the record (use `@` for wildcard name)
839
+ * @type {string}
840
+ * @memberof DNSV1ZoneUpdateRequestZoneInner
841
+ */
842
+ 'name': string;
843
+ /**
844
+ * Records assigned to the name
845
+ * @type {Array<DNSV1ZoneUpdateRequestZoneInnerRecordsInner>}
846
+ * @memberof DNSV1ZoneUpdateRequestZoneInner
847
+ */
848
+ 'records'?: Array<DNSV1ZoneUpdateRequestZoneInnerRecordsInner>;
849
+ /**
850
+ * TTL (Time-To-Live) of the record
851
+ * @type {number}
852
+ * @memberof DNSV1ZoneUpdateRequestZoneInner
853
+ */
854
+ 'ttl'?: number;
855
+ /**
856
+ * Type of the record
857
+ * @type {string}
858
+ * @memberof DNSV1ZoneUpdateRequestZoneInner
859
+ */
860
+ 'type': DNSV1ZoneUpdateRequestZoneInnerTypeEnum;
861
+ }
862
+
863
+ export const DNSV1ZoneUpdateRequestZoneInnerTypeEnum = {
864
+ A: 'A',
865
+ Aaaa: 'AAAA',
866
+ Cname: 'CNAME',
867
+ Alias: 'ALIAS',
868
+ Mx: 'MX',
869
+ Txt: 'TXT',
870
+ Ns: 'NS',
871
+ Soa: 'SOA',
872
+ Srv: 'SRV',
873
+ Caa: 'CAA'
874
+ } as const;
875
+
876
+ export type DNSV1ZoneUpdateRequestZoneInnerTypeEnum = typeof DNSV1ZoneUpdateRequestZoneInnerTypeEnum[keyof typeof DNSV1ZoneUpdateRequestZoneInnerTypeEnum];
877
+
878
+ /**
879
+ *
880
+ * @export
881
+ * @interface DNSV1ZoneUpdateRequestZoneInnerRecordsInner
882
+ */
883
+ export interface DNSV1ZoneUpdateRequestZoneInnerRecordsInner {
884
+ /**
885
+ * Content of the name record
886
+ * @type {string}
887
+ * @memberof DNSV1ZoneUpdateRequestZoneInnerRecordsInner
888
+ */
889
+ 'content': string;
890
+ }
764
891
  /**
765
892
  *
766
893
  * @export
@@ -1839,9 +1966,21 @@ export interface VPSV1VirtualMachineVirtualMachineResource {
1839
1966
 
1840
1967
  export const VPSV1VirtualMachineVirtualMachineResourceStateEnum = {
1841
1968
  Running: 'running',
1969
+ Starting: 'starting',
1970
+ Stopping: 'stopping',
1842
1971
  Stopped: 'stopped',
1843
1972
  Creating: 'creating',
1844
- Initial: 'initial'
1973
+ Initial: 'initial',
1974
+ Error: 'error',
1975
+ Suspending: 'suspending',
1976
+ Unsuspending: 'unsuspending',
1977
+ Suspended: 'suspended',
1978
+ Destroying: 'destroying',
1979
+ Destroyed: 'destroyed',
1980
+ Recreating: 'recreating',
1981
+ Restoring: 'restoring',
1982
+ Recovery: 'recovery',
1983
+ StoppingRecovery: 'stopping_recovery'
1845
1984
  } as const;
1846
1985
 
1847
1986
  export type VPSV1VirtualMachineVirtualMachineResourceStateEnum = typeof VPSV1VirtualMachineVirtualMachineResourceStateEnum[keyof typeof VPSV1VirtualMachineVirtualMachineResourceStateEnum];
@@ -2799,6 +2938,50 @@ export class DNSSnapshotApi extends BaseAPI {
2799
2938
  */
2800
2939
  export const DNSZoneApiAxiosParamCreator = function (configuration?: Configuration) {
2801
2940
  return {
2941
+ /**
2942
+ * This endpoint deletes selected DNS records for the selected domain.
2943
+ * @summary Delete zone records
2944
+ * @param {string} domain Domain name
2945
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
2946
+ * @param {*} [options] Override http request option.
2947
+ * @throws {RequiredError}
2948
+ */
2949
+ deleteZoneRecordsV1: async (domain: string, dNSV1ZoneDestroyRequest: DNSV1ZoneDestroyRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
2950
+ // verify required parameter 'domain' is not null or undefined
2951
+ assertParamExists('deleteZoneRecordsV1', 'domain', domain)
2952
+ // verify required parameter 'dNSV1ZoneDestroyRequest' is not null or undefined
2953
+ assertParamExists('deleteZoneRecordsV1', 'dNSV1ZoneDestroyRequest', dNSV1ZoneDestroyRequest)
2954
+ const localVarPath = `/api/dns/v1/zones/{domain}`
2955
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
2956
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
2957
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
2958
+ let baseOptions;
2959
+ if (configuration) {
2960
+ baseOptions = configuration.baseOptions;
2961
+ }
2962
+
2963
+ const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options};
2964
+ const localVarHeaderParameter = {} as any;
2965
+ const localVarQueryParameter = {} as any;
2966
+
2967
+ // authentication apiToken required
2968
+ // http bearer authentication required
2969
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
2970
+
2971
+
2972
+
2973
+ localVarHeaderParameter['Content-Type'] = 'application/json';
2974
+
2975
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
2976
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
2977
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2978
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneDestroyRequest, localVarRequestOptions, configuration)
2979
+
2980
+ return {
2981
+ url: toPathString(localVarUrlObj),
2982
+ options: localVarRequestOptions,
2983
+ };
2984
+ },
2802
2985
  /**
2803
2986
  * This endpoint retrieves DNS zone records for a specific domain.
2804
2987
  * @summary Get records
@@ -2876,6 +3059,94 @@ export const DNSZoneApiAxiosParamCreator = function (configuration?: Configurati
2876
3059
  localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
2877
3060
  localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneResetRequest, localVarRequestOptions, configuration)
2878
3061
 
3062
+ return {
3063
+ url: toPathString(localVarUrlObj),
3064
+ options: localVarRequestOptions,
3065
+ };
3066
+ },
3067
+ /**
3068
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
3069
+ * @summary Update zone records
3070
+ * @param {string} domain Domain name
3071
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3072
+ * @param {*} [options] Override http request option.
3073
+ * @throws {RequiredError}
3074
+ */
3075
+ updateZoneRecordsV1: async (domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3076
+ // verify required parameter 'domain' is not null or undefined
3077
+ assertParamExists('updateZoneRecordsV1', 'domain', domain)
3078
+ // verify required parameter 'dNSV1ZoneUpdateRequest' is not null or undefined
3079
+ assertParamExists('updateZoneRecordsV1', 'dNSV1ZoneUpdateRequest', dNSV1ZoneUpdateRequest)
3080
+ const localVarPath = `/api/dns/v1/zones/{domain}`
3081
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
3082
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3083
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3084
+ let baseOptions;
3085
+ if (configuration) {
3086
+ baseOptions = configuration.baseOptions;
3087
+ }
3088
+
3089
+ const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
3090
+ const localVarHeaderParameter = {} as any;
3091
+ const localVarQueryParameter = {} as any;
3092
+
3093
+ // authentication apiToken required
3094
+ // http bearer authentication required
3095
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3096
+
3097
+
3098
+
3099
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3100
+
3101
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3102
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3103
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3104
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneUpdateRequest, localVarRequestOptions, configuration)
3105
+
3106
+ return {
3107
+ url: toPathString(localVarUrlObj),
3108
+ options: localVarRequestOptions,
3109
+ };
3110
+ },
3111
+ /**
3112
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
3113
+ * @summary Validate zone records
3114
+ * @param {string} domain Domain name
3115
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3116
+ * @param {*} [options] Override http request option.
3117
+ * @throws {RequiredError}
3118
+ */
3119
+ validateZoneRecordsV1: async (domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
3120
+ // verify required parameter 'domain' is not null or undefined
3121
+ assertParamExists('validateZoneRecordsV1', 'domain', domain)
3122
+ // verify required parameter 'dNSV1ZoneUpdateRequest' is not null or undefined
3123
+ assertParamExists('validateZoneRecordsV1', 'dNSV1ZoneUpdateRequest', dNSV1ZoneUpdateRequest)
3124
+ const localVarPath = `/api/dns/v1/zones/{domain}/validate`
3125
+ .replace(`{${"domain"}}`, encodeURIComponent(String(domain)));
3126
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
3127
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
3128
+ let baseOptions;
3129
+ if (configuration) {
3130
+ baseOptions = configuration.baseOptions;
3131
+ }
3132
+
3133
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
3134
+ const localVarHeaderParameter = {} as any;
3135
+ const localVarQueryParameter = {} as any;
3136
+
3137
+ // authentication apiToken required
3138
+ // http bearer authentication required
3139
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
3140
+
3141
+
3142
+
3143
+ localVarHeaderParameter['Content-Type'] = 'application/json';
3144
+
3145
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
3146
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
3147
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
3148
+ localVarRequestOptions.data = serializeDataIfNeeded(dNSV1ZoneUpdateRequest, localVarRequestOptions, configuration)
3149
+
2879
3150
  return {
2880
3151
  url: toPathString(localVarUrlObj),
2881
3152
  options: localVarRequestOptions,
@@ -2891,6 +3162,19 @@ export const DNSZoneApiAxiosParamCreator = function (configuration?: Configurati
2891
3162
  export const DNSZoneApiFp = function(configuration?: Configuration) {
2892
3163
  const localVarAxiosParamCreator = DNSZoneApiAxiosParamCreator(configuration)
2893
3164
  return {
3165
+ /**
3166
+ * This endpoint deletes selected DNS records for the selected domain.
3167
+ * @summary Delete zone records
3168
+ * @param {string} domain Domain name
3169
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
3170
+ * @param {*} [options] Override http request option.
3171
+ * @throws {RequiredError}
3172
+ */
3173
+ async deleteZoneRecordsV1(domain: string, dNSV1ZoneDestroyRequest: DNSV1ZoneDestroyRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
3174
+ const localVarAxiosArgs = await localVarAxiosParamCreator.deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options);
3175
+ const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.deleteZoneRecordsV1']?.[0]?.url;
3176
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3177
+ },
2894
3178
  /**
2895
3179
  * This endpoint retrieves DNS zone records for a specific domain.
2896
3180
  * @summary Get records
@@ -2898,7 +3182,7 @@ export const DNSZoneApiFp = function(configuration?: Configuration) {
2898
3182
  * @param {*} [options] Override http request option.
2899
3183
  * @throws {RequiredError}
2900
3184
  */
2901
- async getRecordsV1(domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DNSV1ZoneNameResource>>> {
3185
+ async getRecordsV1(domain: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<DNSV1ZoneRecordResource>>> {
2902
3186
  const localVarAxiosArgs = await localVarAxiosParamCreator.getRecordsV1(domain, options);
2903
3187
  const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.getRecordsV1']?.[0]?.url;
2904
3188
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
@@ -2916,6 +3200,32 @@ export const DNSZoneApiFp = function(configuration?: Configuration) {
2916
3200
  const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.resetZoneRecordsV1']?.[0]?.url;
2917
3201
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
2918
3202
  },
3203
+ /**
3204
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
3205
+ * @summary Update zone records
3206
+ * @param {string} domain Domain name
3207
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3208
+ * @param {*} [options] Override http request option.
3209
+ * @throws {RequiredError}
3210
+ */
3211
+ async updateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
3212
+ const localVarAxiosArgs = await localVarAxiosParamCreator.updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options);
3213
+ const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.updateZoneRecordsV1']?.[0]?.url;
3214
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3215
+ },
3216
+ /**
3217
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
3218
+ * @summary Validate zone records
3219
+ * @param {string} domain Domain name
3220
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3221
+ * @param {*} [options] Override http request option.
3222
+ * @throws {RequiredError}
3223
+ */
3224
+ async validateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CommonSuccessEmptyResource>> {
3225
+ const localVarAxiosArgs = await localVarAxiosParamCreator.validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options);
3226
+ const localVarOperationServerBasePath = operationServerMap['DNSZoneApi.validateZoneRecordsV1']?.[0]?.url;
3227
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
3228
+ },
2919
3229
  }
2920
3230
  };
2921
3231
 
@@ -2926,6 +3236,17 @@ export const DNSZoneApiFp = function(configuration?: Configuration) {
2926
3236
  export const DNSZoneApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
2927
3237
  const localVarFp = DNSZoneApiFp(configuration)
2928
3238
  return {
3239
+ /**
3240
+ * This endpoint deletes selected DNS records for the selected domain.
3241
+ * @summary Delete zone records
3242
+ * @param {string} domain Domain name
3243
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
3244
+ * @param {*} [options] Override http request option.
3245
+ * @throws {RequiredError}
3246
+ */
3247
+ deleteZoneRecordsV1(domain: string, dNSV1ZoneDestroyRequest: DNSV1ZoneDestroyRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
3248
+ return localVarFp.deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options).then((request) => request(axios, basePath));
3249
+ },
2929
3250
  /**
2930
3251
  * This endpoint retrieves DNS zone records for a specific domain.
2931
3252
  * @summary Get records
@@ -2933,7 +3254,7 @@ export const DNSZoneApiFactory = function (configuration?: Configuration, basePa
2933
3254
  * @param {*} [options] Override http request option.
2934
3255
  * @throws {RequiredError}
2935
3256
  */
2936
- getRecordsV1(domain: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<DNSV1ZoneNameResource>> {
3257
+ getRecordsV1(domain: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<DNSV1ZoneRecordResource>> {
2937
3258
  return localVarFp.getRecordsV1(domain, options).then((request) => request(axios, basePath));
2938
3259
  },
2939
3260
  /**
@@ -2947,6 +3268,28 @@ export const DNSZoneApiFactory = function (configuration?: Configuration, basePa
2947
3268
  resetZoneRecordsV1(domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
2948
3269
  return localVarFp.resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(axios, basePath));
2949
3270
  },
3271
+ /**
3272
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
3273
+ * @summary Update zone records
3274
+ * @param {string} domain Domain name
3275
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3276
+ * @param {*} [options] Override http request option.
3277
+ * @throws {RequiredError}
3278
+ */
3279
+ updateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
3280
+ return localVarFp.updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(axios, basePath));
3281
+ },
3282
+ /**
3283
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
3284
+ * @summary Validate zone records
3285
+ * @param {string} domain Domain name
3286
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3287
+ * @param {*} [options] Override http request option.
3288
+ * @throws {RequiredError}
3289
+ */
3290
+ validateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig): AxiosPromise<CommonSuccessEmptyResource> {
3291
+ return localVarFp.validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(axios, basePath));
3292
+ },
2950
3293
  };
2951
3294
  };
2952
3295
 
@@ -2957,6 +3300,19 @@ export const DNSZoneApiFactory = function (configuration?: Configuration, basePa
2957
3300
  * @extends {BaseAPI}
2958
3301
  */
2959
3302
  export class DNSZoneApi extends BaseAPI {
3303
+ /**
3304
+ * This endpoint deletes selected DNS records for the selected domain.
3305
+ * @summary Delete zone records
3306
+ * @param {string} domain Domain name
3307
+ * @param {DNSV1ZoneDestroyRequest} dNSV1ZoneDestroyRequest
3308
+ * @param {*} [options] Override http request option.
3309
+ * @throws {RequiredError}
3310
+ * @memberof DNSZoneApi
3311
+ */
3312
+ public deleteZoneRecordsV1(domain: string, dNSV1ZoneDestroyRequest: DNSV1ZoneDestroyRequest, options?: RawAxiosRequestConfig) {
3313
+ return DNSZoneApiFp(this.configuration).deleteZoneRecordsV1(domain, dNSV1ZoneDestroyRequest, options).then((request) => request(this.axios, this.basePath));
3314
+ }
3315
+
2960
3316
  /**
2961
3317
  * This endpoint retrieves DNS zone records for a specific domain.
2962
3318
  * @summary Get records
@@ -2981,6 +3337,32 @@ export class DNSZoneApi extends BaseAPI {
2981
3337
  public resetZoneRecordsV1(domain: string, dNSV1ZoneResetRequest: DNSV1ZoneResetRequest, options?: RawAxiosRequestConfig) {
2982
3338
  return DNSZoneApiFp(this.configuration).resetZoneRecordsV1(domain, dNSV1ZoneResetRequest, options).then((request) => request(this.axios, this.basePath));
2983
3339
  }
3340
+
3341
+ /**
3342
+ * This endpoint updates DNS records for the selected domain. This endpoint could also be used to delete single record when multiple records exist under same name. In that case use `overwrite` flag and provide records which should remain. All other records under same name will be deleted.
3343
+ * @summary Update zone records
3344
+ * @param {string} domain Domain name
3345
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3346
+ * @param {*} [options] Override http request option.
3347
+ * @throws {RequiredError}
3348
+ * @memberof DNSZoneApi
3349
+ */
3350
+ public updateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig) {
3351
+ return DNSZoneApiFp(this.configuration).updateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(this.axios, this.basePath));
3352
+ }
3353
+
3354
+ /**
3355
+ * This endpoint used to validate DNS records prior update for the selected domain. If the validation is successful, the response will contain `200 Success` code. If there is validation error, the response will fail with `422 Validation error` code.
3356
+ * @summary Validate zone records
3357
+ * @param {string} domain Domain name
3358
+ * @param {DNSV1ZoneUpdateRequest} dNSV1ZoneUpdateRequest
3359
+ * @param {*} [options] Override http request option.
3360
+ * @throws {RequiredError}
3361
+ * @memberof DNSZoneApi
3362
+ */
3363
+ public validateZoneRecordsV1(domain: string, dNSV1ZoneUpdateRequest: DNSV1ZoneUpdateRequest, options?: RawAxiosRequestConfig) {
3364
+ return DNSZoneApiFp(this.configuration).validateZoneRecordsV1(domain, dNSV1ZoneUpdateRequest, options).then((request) => request(this.axios, this.basePath));
3365
+ }
2984
3366
  }
2985
3367
 
2986
3368
 
package/base.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  /**
4
4
  * Hostinger API
5
5
  *
6
- * API Version: 0.0.14
6
+ * API Version: 0.0.17
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.14
6
+ * API Version: 0.0.17
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.14
6
+ * API Version: 0.0.17
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.2",
51
+ 'User-Agent': "hostinger-api-sdk-typescript/0.0.4",
52
52
  ...param.baseOptions?.headers,
53
53
  },
54
54
  };