@randock/nameshift-api-client 0.0.192 → 0.0.193

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.
@@ -33,6 +33,7 @@ src/models/AccountSettingsLandingDto.ts
33
33
  src/models/AccountSettingsLeaseToOwnConfigurationDto.ts
34
34
  src/models/AccountSettingsSidnDto.ts
35
35
  src/models/AddressDto.ts
36
+ src/models/AdminAccountLoginDto.ts
36
37
  src/models/AdminAccountSettingsInput.ts
37
38
  src/models/AdminGetAllDomainTransfers200Response.ts
38
39
  src/models/BadRequestException.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- ## @randock/nameshift-api-client@0.0.192
1
+ ## @randock/nameshift-api-client@0.0.193
2
2
 
3
3
  This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
4
4
 
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
36
36
  _published:_
37
37
 
38
38
  ```
39
- npm install @randock/nameshift-api-client@0.0.192 --save
39
+ npm install @randock/nameshift-api-client@0.0.193 --save
40
40
  ```
41
41
 
42
42
  _unPublished (not recommended):_
@@ -44,4 +44,4 @@ _unPublished (not recommended):_
44
44
  ```
45
45
  npm install PATH_TO_GENERATED_PACKAGE --save
46
46
  ```
47
- abe60b5df2a4c9ea0d288199d037cc2548c801e1b522d6d1909d974d7180bb7ed946d2300e1e1595d39e3e7b7f72e835
47
+ 32e5a699646ffe669eab84b73f2fd38e8705183effdfcf29c6f70da5cf984119d5c10728008ff68995dc7411bc729bd6
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AccountSettingsDto, AdminAccountSettingsInput, AdminGetAllDomainTransfers200Response, ChangeOrderStatusInput, ChangeSubscriptionStatusInput, DomainTransferDetailsDto, GetAllInvoices200Response, GetAllOrders200Response, GetAllOwnedDomains200Response, GetAllSubscriptions200Response, ListAccounts200Response, ListDomains200Response, SubscriptionDetailsDto } from '../models/index';
13
+ import type { AccountSettingsDto, AdminAccountLoginDto, AdminAccountSettingsInput, AdminGetAllDomainTransfers200Response, ChangeOrderStatusInput, ChangeSubscriptionStatusInput, DomainTransferDetailsDto, GetAllInvoices200Response, GetAllOrders200Response, GetAllOwnedDomains200Response, GetAllSubscriptions200Response, ListAccounts200Response, ListDomains200Response, SubscriptionDetailsDto } from '../models/index';
14
14
  export interface AdminApiAdminGetAllDomainTransfersRequest {
15
15
  filter?: object;
16
16
  page?: number;
@@ -73,6 +73,9 @@ export interface AdminApiListDomainsRequest {
73
73
  limit?: number;
74
74
  sortBy?: Array<string>;
75
75
  }
76
+ export interface AdminApiLoginAsRequest {
77
+ accountId: string;
78
+ }
76
79
  export interface AdminApiPayDomainTransferSellerInvoiceRequest {
77
80
  transferId: string;
78
81
  invoiceId: string;
@@ -200,6 +203,14 @@ export declare class AdminApi extends runtime.BaseAPI {
200
203
  *
201
204
  */
202
205
  listDomains(requestParameters?: AdminApiListDomainsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDomains200Response>;
206
+ /**
207
+ *
208
+ */
209
+ loginAsRaw(requestParameters: AdminApiLoginAsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAccountLoginDto>>;
210
+ /**
211
+ *
212
+ */
213
+ loginAs(requestParameters: AdminApiLoginAsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAccountLoginDto>;
203
214
  /**
204
215
  *
205
216
  */
@@ -840,6 +840,59 @@ var AdminApi = /** @class */ (function (_super) {
840
840
  });
841
841
  });
842
842
  };
843
+ /**
844
+ *
845
+ */
846
+ AdminApi.prototype.loginAsRaw = function (requestParameters, initOverrides) {
847
+ return __awaiter(this, void 0, void 0, function () {
848
+ var queryParameters, headerParameters, token, tokenString, response;
849
+ return __generator(this, function (_a) {
850
+ switch (_a.label) {
851
+ case 0:
852
+ if (requestParameters['accountId'] == null) {
853
+ throw new runtime.RequiredError('accountId', 'Required parameter "accountId" was null or undefined when calling loginAs().');
854
+ }
855
+ queryParameters = {};
856
+ headerParameters = {};
857
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
858
+ token = this.configuration.accessToken;
859
+ return [4 /*yield*/, token("bearer", [])];
860
+ case 1:
861
+ tokenString = _a.sent();
862
+ if (tokenString) {
863
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
864
+ }
865
+ _a.label = 2;
866
+ case 2: return [4 /*yield*/, this.request({
867
+ path: "/admin/accounts/{accountId}/login-as".replace("{".concat("accountId", "}"), encodeURIComponent(String(requestParameters['accountId']))),
868
+ method: 'POST',
869
+ headers: headerParameters,
870
+ query: queryParameters,
871
+ }, initOverrides)];
872
+ case 3:
873
+ response = _a.sent();
874
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AdminAccountLoginDtoFromJSON)(jsonValue); })];
875
+ }
876
+ });
877
+ });
878
+ };
879
+ /**
880
+ *
881
+ */
882
+ AdminApi.prototype.loginAs = function (requestParameters, initOverrides) {
883
+ return __awaiter(this, void 0, void 0, function () {
884
+ var response;
885
+ return __generator(this, function (_a) {
886
+ switch (_a.label) {
887
+ case 0: return [4 /*yield*/, this.loginAsRaw(requestParameters, initOverrides)];
888
+ case 1:
889
+ response = _a.sent();
890
+ return [4 /*yield*/, response.value()];
891
+ case 2: return [2 /*return*/, _a.sent()];
892
+ }
893
+ });
894
+ });
895
+ };
843
896
  /**
844
897
  *
845
898
  */
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Nameshift
3
+ * Nameshift API
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AdminAccountLoginDto
16
+ */
17
+ export interface AdminAccountLoginDto {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AdminAccountLoginDto
22
+ */
23
+ token: string;
24
+ }
25
+ /**
26
+ * Check if a given object implements the AdminAccountLoginDto interface.
27
+ */
28
+ export declare function instanceOfAdminAccountLoginDto(value: object): value is AdminAccountLoginDto;
29
+ export declare function AdminAccountLoginDtoFromJSON(json: any): AdminAccountLoginDto;
30
+ export declare function AdminAccountLoginDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminAccountLoginDto;
31
+ export declare function AdminAccountLoginDtoToJSON(json: any): AdminAccountLoginDto;
32
+ export declare function AdminAccountLoginDtoToJSONTyped(value?: AdminAccountLoginDto | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Nameshift
6
+ * Nameshift API
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAdminAccountLoginDto = instanceOfAdminAccountLoginDto;
17
+ exports.AdminAccountLoginDtoFromJSON = AdminAccountLoginDtoFromJSON;
18
+ exports.AdminAccountLoginDtoFromJSONTyped = AdminAccountLoginDtoFromJSONTyped;
19
+ exports.AdminAccountLoginDtoToJSON = AdminAccountLoginDtoToJSON;
20
+ exports.AdminAccountLoginDtoToJSONTyped = AdminAccountLoginDtoToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AdminAccountLoginDto interface.
23
+ */
24
+ function instanceOfAdminAccountLoginDto(value) {
25
+ if (!('token' in value) || value['token'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function AdminAccountLoginDtoFromJSON(json) {
30
+ return AdminAccountLoginDtoFromJSONTyped(json, false);
31
+ }
32
+ function AdminAccountLoginDtoFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'token': json['token'],
38
+ };
39
+ }
40
+ function AdminAccountLoginDtoToJSON(json) {
41
+ return AdminAccountLoginDtoToJSONTyped(json, false);
42
+ }
43
+ function AdminAccountLoginDtoToJSONTyped(value, ignoreDiscriminator) {
44
+ if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'token': value['token'],
50
+ };
51
+ }
@@ -9,6 +9,7 @@ export * from './AccountSettingsLandingDto';
9
9
  export * from './AccountSettingsLeaseToOwnConfigurationDto';
10
10
  export * from './AccountSettingsSidnDto';
11
11
  export * from './AddressDto';
12
+ export * from './AdminAccountLoginDto';
12
13
  export * from './AdminAccountSettingsInput';
13
14
  export * from './AdminGetAllDomainTransfers200Response';
14
15
  export * from './BadRequestException';
@@ -27,6 +27,7 @@ __exportStar(require("./AccountSettingsLandingDto"), exports);
27
27
  __exportStar(require("./AccountSettingsLeaseToOwnConfigurationDto"), exports);
28
28
  __exportStar(require("./AccountSettingsSidnDto"), exports);
29
29
  __exportStar(require("./AddressDto"), exports);
30
+ __exportStar(require("./AdminAccountLoginDto"), exports);
30
31
  __exportStar(require("./AdminAccountSettingsInput"), exports);
31
32
  __exportStar(require("./AdminGetAllDomainTransfers200Response"), exports);
32
33
  __exportStar(require("./BadRequestException"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@randock/nameshift-api-client",
3
- "version": "0.0.192",
3
+ "version": "0.0.193",
4
4
  "description": "OpenAPI client for @randock/nameshift-api-client",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -16,6 +16,7 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  AccountSettingsDto,
19
+ AdminAccountLoginDto,
19
20
  AdminAccountSettingsInput,
20
21
  AdminGetAllDomainTransfers200Response,
21
22
  BadRequestException,
@@ -36,6 +37,8 @@ import type {
36
37
  import {
37
38
  AccountSettingsDtoFromJSON,
38
39
  AccountSettingsDtoToJSON,
40
+ AdminAccountLoginDtoFromJSON,
41
+ AdminAccountLoginDtoToJSON,
39
42
  AdminAccountSettingsInputFromJSON,
40
43
  AdminAccountSettingsInputToJSON,
41
44
  AdminGetAllDomainTransfers200ResponseFromJSON,
@@ -145,6 +148,10 @@ export interface AdminApiListDomainsRequest {
145
148
  sortBy?: Array<string>;
146
149
  }
147
150
 
151
+ export interface AdminApiLoginAsRequest {
152
+ accountId: string;
153
+ }
154
+
148
155
  export interface AdminApiPayDomainTransferSellerInvoiceRequest {
149
156
  transferId: string;
150
157
  invoiceId: string;
@@ -788,6 +795,47 @@ export class AdminApi extends runtime.BaseAPI {
788
795
  return await response.value();
789
796
  }
790
797
 
798
+ /**
799
+ *
800
+ */
801
+ async loginAsRaw(requestParameters: AdminApiLoginAsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminAccountLoginDto>> {
802
+ if (requestParameters['accountId'] == null) {
803
+ throw new runtime.RequiredError(
804
+ 'accountId',
805
+ 'Required parameter "accountId" was null or undefined when calling loginAs().'
806
+ );
807
+ }
808
+
809
+ const queryParameters: any = {};
810
+
811
+ const headerParameters: runtime.HTTPHeaders = {};
812
+
813
+ if (this.configuration && this.configuration.accessToken) {
814
+ const token = this.configuration.accessToken;
815
+ const tokenString = await token("bearer", []);
816
+
817
+ if (tokenString) {
818
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
819
+ }
820
+ }
821
+ const response = await this.request({
822
+ path: `/admin/accounts/{accountId}/login-as`.replace(`{${"accountId"}}`, encodeURIComponent(String(requestParameters['accountId']))),
823
+ method: 'POST',
824
+ headers: headerParameters,
825
+ query: queryParameters,
826
+ }, initOverrides);
827
+
828
+ return new runtime.JSONApiResponse(response, (jsonValue) => AdminAccountLoginDtoFromJSON(jsonValue));
829
+ }
830
+
831
+ /**
832
+ *
833
+ */
834
+ async loginAs(requestParameters: AdminApiLoginAsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminAccountLoginDto> {
835
+ const response = await this.loginAsRaw(requestParameters, initOverrides);
836
+ return await response.value();
837
+ }
838
+
791
839
  /**
792
840
  *
793
841
  */
@@ -0,0 +1,66 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Nameshift
5
+ * Nameshift API
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AdminAccountLoginDto
20
+ */
21
+ export interface AdminAccountLoginDto {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AdminAccountLoginDto
26
+ */
27
+ token: string;
28
+ }
29
+
30
+ /**
31
+ * Check if a given object implements the AdminAccountLoginDto interface.
32
+ */
33
+ export function instanceOfAdminAccountLoginDto(value: object): value is AdminAccountLoginDto {
34
+ if (!('token' in value) || value['token'] === undefined) return false;
35
+ return true;
36
+ }
37
+
38
+ export function AdminAccountLoginDtoFromJSON(json: any): AdminAccountLoginDto {
39
+ return AdminAccountLoginDtoFromJSONTyped(json, false);
40
+ }
41
+
42
+ export function AdminAccountLoginDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdminAccountLoginDto {
43
+ if (json == null) {
44
+ return json;
45
+ }
46
+ return {
47
+
48
+ 'token': json['token'],
49
+ };
50
+ }
51
+
52
+ export function AdminAccountLoginDtoToJSON(json: any): AdminAccountLoginDto {
53
+ return AdminAccountLoginDtoToJSONTyped(json, false);
54
+ }
55
+
56
+ export function AdminAccountLoginDtoToJSONTyped(value?: AdminAccountLoginDto | null, ignoreDiscriminator: boolean = false): any {
57
+ if (value == null) {
58
+ return value;
59
+ }
60
+
61
+ return {
62
+
63
+ 'token': value['token'],
64
+ };
65
+ }
66
+
@@ -11,6 +11,7 @@ export * from './AccountSettingsLandingDto';
11
11
  export * from './AccountSettingsLeaseToOwnConfigurationDto';
12
12
  export * from './AccountSettingsSidnDto';
13
13
  export * from './AddressDto';
14
+ export * from './AdminAccountLoginDto';
14
15
  export * from './AdminAccountSettingsInput';
15
16
  export * from './AdminGetAllDomainTransfers200Response';
16
17
  export * from './BadRequestException';