@randock/nameshift-api-client 0.0.4 → 0.0.5

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.
@@ -11,6 +11,7 @@ src/apis/index.ts
11
11
  src/index.ts
12
12
  src/models/AccountAddressDto.ts
13
13
  src/models/AccountAddressInput.ts
14
+ src/models/AccountDto.ts
14
15
  src/models/AccountFinancialInput.ts
15
16
  src/models/AccountSettingsInput.ts
16
17
  src/models/BatchUpdate404Response.ts
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AccountAddressInput, AccountFinancialInput, AccountSettingsInput, IntersectionAccountDtoWithAddressDto, IntersectionAccountDtoWithFinancialDto, IntersectionAccountDtoWithSettingsDto } from '../models/index';
13
+ import type { AccountAddressInput, AccountDto, AccountFinancialInput, AccountSettingsInput, IntersectionAccountDtoWithAddressDto, IntersectionAccountDtoWithFinancialDto, IntersectionAccountDtoWithSettingsDto } from '../models/index';
14
14
  export interface UpdateAddressRequest {
15
15
  accountId: string;
16
16
  accountAddressInput: AccountAddressInput;
@@ -27,6 +27,14 @@ export interface UpdateSettingsRequest {
27
27
  *
28
28
  */
29
29
  export declare class AccountsApi extends runtime.BaseAPI {
30
+ /**
31
+ *
32
+ */
33
+ meRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountDto>>;
34
+ /**
35
+ *
36
+ */
37
+ me(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountDto>;
30
38
  /**
31
39
  *
32
40
  */
@@ -75,6 +75,56 @@ var AccountsApi = /** @class */ (function (_super) {
75
75
  function AccountsApi() {
76
76
  return _super !== null && _super.apply(this, arguments) || this;
77
77
  }
78
+ /**
79
+ *
80
+ */
81
+ AccountsApi.prototype.meRaw = function (initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function () {
83
+ var queryParameters, headerParameters, token, tokenString, response;
84
+ return __generator(this, function (_a) {
85
+ switch (_a.label) {
86
+ case 0:
87
+ queryParameters = {};
88
+ headerParameters = {};
89
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 2];
90
+ token = this.configuration.accessToken;
91
+ return [4 /*yield*/, token("bearer", [])];
92
+ case 1:
93
+ tokenString = _a.sent();
94
+ if (tokenString) {
95
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
96
+ }
97
+ _a.label = 2;
98
+ case 2: return [4 /*yield*/, this.request({
99
+ path: "/accounts/me",
100
+ method: 'GET',
101
+ headers: headerParameters,
102
+ query: queryParameters,
103
+ }, initOverrides)];
104
+ case 3:
105
+ response = _a.sent();
106
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AccountDtoFromJSON)(jsonValue); })];
107
+ }
108
+ });
109
+ });
110
+ };
111
+ /**
112
+ *
113
+ */
114
+ AccountsApi.prototype.me = function (initOverrides) {
115
+ return __awaiter(this, void 0, void 0, function () {
116
+ var response;
117
+ return __generator(this, function (_a) {
118
+ switch (_a.label) {
119
+ case 0: return [4 /*yield*/, this.meRaw(initOverrides)];
120
+ case 1:
121
+ response = _a.sent();
122
+ return [4 /*yield*/, response.value()];
123
+ case 2: return [2 /*return*/, _a.sent()];
124
+ }
125
+ });
126
+ });
127
+ };
78
128
  /**
79
129
  *
80
130
  */
@@ -0,0 +1,37 @@
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 AccountDto
16
+ */
17
+ export interface AccountDto {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AccountDto
22
+ */
23
+ id: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof AccountDto
28
+ */
29
+ identifier: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the AccountDto interface.
33
+ */
34
+ export declare function instanceOfAccountDto(value: object): boolean;
35
+ export declare function AccountDtoFromJSON(json: any): AccountDto;
36
+ export declare function AccountDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDto;
37
+ export declare function AccountDtoToJSON(value?: AccountDto | null): any;
@@ -0,0 +1,53 @@
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.AccountDtoToJSON = exports.AccountDtoFromJSONTyped = exports.AccountDtoFromJSON = exports.instanceOfAccountDto = void 0;
17
+ /**
18
+ * Check if a given object implements the AccountDto interface.
19
+ */
20
+ function instanceOfAccountDto(value) {
21
+ var isInstance = true;
22
+ isInstance = isInstance && "id" in value;
23
+ isInstance = isInstance && "identifier" in value;
24
+ return isInstance;
25
+ }
26
+ exports.instanceOfAccountDto = instanceOfAccountDto;
27
+ function AccountDtoFromJSON(json) {
28
+ return AccountDtoFromJSONTyped(json, false);
29
+ }
30
+ exports.AccountDtoFromJSON = AccountDtoFromJSON;
31
+ function AccountDtoFromJSONTyped(json, ignoreDiscriminator) {
32
+ if ((json === undefined) || (json === null)) {
33
+ return json;
34
+ }
35
+ return {
36
+ 'id': json['id'],
37
+ 'identifier': json['identifier'],
38
+ };
39
+ }
40
+ exports.AccountDtoFromJSONTyped = AccountDtoFromJSONTyped;
41
+ function AccountDtoToJSON(value) {
42
+ if (value === undefined) {
43
+ return undefined;
44
+ }
45
+ if (value === null) {
46
+ return null;
47
+ }
48
+ return {
49
+ 'id': value.id,
50
+ 'identifier': value.identifier,
51
+ };
52
+ }
53
+ exports.AccountDtoToJSON = AccountDtoToJSON;
@@ -22,6 +22,12 @@ export interface IntersectionAccountDtoWithAddressDto {
22
22
  * @memberof IntersectionAccountDtoWithAddressDto
23
23
  */
24
24
  id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof IntersectionAccountDtoWithAddressDto
29
+ */
30
+ identifier: string;
25
31
  /**
26
32
  *
27
33
  * @type {Array<AccountAddressDto>}
@@ -21,6 +21,7 @@ var AccountAddressDto_1 = require("./AccountAddressDto");
21
21
  function instanceOfIntersectionAccountDtoWithAddressDto(value) {
22
22
  var isInstance = true;
23
23
  isInstance = isInstance && "id" in value;
24
+ isInstance = isInstance && "identifier" in value;
24
25
  isInstance = isInstance && "addresses" in value;
25
26
  return isInstance;
26
27
  }
@@ -35,6 +36,7 @@ function IntersectionAccountDtoWithAddressDtoFromJSONTyped(json, ignoreDiscrimin
35
36
  }
36
37
  return {
37
38
  'id': json['id'],
39
+ 'identifier': json['identifier'],
38
40
  'addresses': (json['addresses'].map(AccountAddressDto_1.AccountAddressDtoFromJSON)),
39
41
  };
40
42
  }
@@ -48,6 +50,7 @@ function IntersectionAccountDtoWithAddressDtoToJSON(value) {
48
50
  }
49
51
  return {
50
52
  'id': value.id,
53
+ 'identifier': value.identifier,
51
54
  'addresses': (value.addresses.map(AccountAddressDto_1.AccountAddressDtoToJSON)),
52
55
  };
53
56
  }
@@ -22,6 +22,12 @@ export interface IntersectionAccountDtoWithFinancialDto {
22
22
  * @memberof IntersectionAccountDtoWithFinancialDto
23
23
  */
24
24
  id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof IntersectionAccountDtoWithFinancialDto
29
+ */
30
+ identifier: string;
25
31
  /**
26
32
  *
27
33
  * @type {IntersectionAccountDtoWithFinancialDtoFinancial}
@@ -21,6 +21,7 @@ var IntersectionAccountDtoWithFinancialDtoFinancial_1 = require("./IntersectionA
21
21
  function instanceOfIntersectionAccountDtoWithFinancialDto(value) {
22
22
  var isInstance = true;
23
23
  isInstance = isInstance && "id" in value;
24
+ isInstance = isInstance && "identifier" in value;
24
25
  isInstance = isInstance && "financial" in value;
25
26
  return isInstance;
26
27
  }
@@ -35,6 +36,7 @@ function IntersectionAccountDtoWithFinancialDtoFromJSONTyped(json, ignoreDiscrim
35
36
  }
36
37
  return {
37
38
  'id': json['id'],
39
+ 'identifier': json['identifier'],
38
40
  'financial': (0, IntersectionAccountDtoWithFinancialDtoFinancial_1.IntersectionAccountDtoWithFinancialDtoFinancialFromJSON)(json['financial']),
39
41
  };
40
42
  }
@@ -48,6 +50,7 @@ function IntersectionAccountDtoWithFinancialDtoToJSON(value) {
48
50
  }
49
51
  return {
50
52
  'id': value.id,
53
+ 'identifier': value.identifier,
51
54
  'financial': (0, IntersectionAccountDtoWithFinancialDtoFinancial_1.IntersectionAccountDtoWithFinancialDtoFinancialToJSON)(value.financial),
52
55
  };
53
56
  }
@@ -22,6 +22,12 @@ export interface IntersectionAccountDtoWithSettingsDto {
22
22
  * @memberof IntersectionAccountDtoWithSettingsDto
23
23
  */
24
24
  id: string;
25
+ /**
26
+ *
27
+ * @type {string}
28
+ * @memberof IntersectionAccountDtoWithSettingsDto
29
+ */
30
+ identifier: string;
25
31
  /**
26
32
  *
27
33
  * @type {IntersectionAccountDtoWithSettingsDtoSettings}
@@ -21,6 +21,7 @@ var IntersectionAccountDtoWithSettingsDtoSettings_1 = require("./IntersectionAcc
21
21
  function instanceOfIntersectionAccountDtoWithSettingsDto(value) {
22
22
  var isInstance = true;
23
23
  isInstance = isInstance && "id" in value;
24
+ isInstance = isInstance && "identifier" in value;
24
25
  isInstance = isInstance && "settings" in value;
25
26
  return isInstance;
26
27
  }
@@ -35,6 +36,7 @@ function IntersectionAccountDtoWithSettingsDtoFromJSONTyped(json, ignoreDiscrimi
35
36
  }
36
37
  return {
37
38
  'id': json['id'],
39
+ 'identifier': json['identifier'],
38
40
  'settings': (0, IntersectionAccountDtoWithSettingsDtoSettings_1.IntersectionAccountDtoWithSettingsDtoSettingsFromJSON)(json['settings']),
39
41
  };
40
42
  }
@@ -48,6 +50,7 @@ function IntersectionAccountDtoWithSettingsDtoToJSON(value) {
48
50
  }
49
51
  return {
50
52
  'id': value.id,
53
+ 'identifier': value.identifier,
51
54
  'settings': (0, IntersectionAccountDtoWithSettingsDtoSettings_1.IntersectionAccountDtoWithSettingsDtoSettingsToJSON)(value.settings),
52
55
  };
53
56
  }
@@ -1,5 +1,6 @@
1
1
  export * from './AccountAddressDto';
2
2
  export * from './AccountAddressInput';
3
+ export * from './AccountDto';
3
4
  export * from './AccountFinancialInput';
4
5
  export * from './AccountSettingsInput';
5
6
  export * from './BatchUpdate404Response';
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  /* eslint-disable */
19
19
  __exportStar(require("./AccountAddressDto"), exports);
20
20
  __exportStar(require("./AccountAddressInput"), exports);
21
+ __exportStar(require("./AccountDto"), exports);
21
22
  __exportStar(require("./AccountFinancialInput"), exports);
22
23
  __exportStar(require("./AccountSettingsInput"), exports);
23
24
  __exportStar(require("./BatchUpdate404Response"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@randock/nameshift-api-client",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "OpenAPI client for @randock/nameshift-api-client",
5
5
  "author": "OpenAPI-Generator",
6
6
  "main": "./dist/index.js",
@@ -16,6 +16,7 @@
16
16
  import * as runtime from '../runtime';
17
17
  import type {
18
18
  AccountAddressInput,
19
+ AccountDto,
19
20
  AccountFinancialInput,
20
21
  AccountSettingsInput,
21
22
  IntersectionAccountDtoWithAddressDto,
@@ -27,6 +28,8 @@ import type {
27
28
  import {
28
29
  AccountAddressInputFromJSON,
29
30
  AccountAddressInputToJSON,
31
+ AccountDtoFromJSON,
32
+ AccountDtoToJSON,
30
33
  AccountFinancialInputFromJSON,
31
34
  AccountFinancialInputToJSON,
32
35
  AccountSettingsInputFromJSON,
@@ -63,6 +66,40 @@ export interface UpdateSettingsRequest {
63
66
  */
64
67
  export class AccountsApi extends runtime.BaseAPI {
65
68
 
69
+ /**
70
+ *
71
+ */
72
+ async meRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AccountDto>> {
73
+ const queryParameters: any = {};
74
+
75
+ const headerParameters: runtime.HTTPHeaders = {};
76
+
77
+ if (this.configuration && this.configuration.accessToken) {
78
+ const token = this.configuration.accessToken;
79
+ const tokenString = await token("bearer", []);
80
+
81
+ if (tokenString) {
82
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
83
+ }
84
+ }
85
+ const response = await this.request({
86
+ path: `/accounts/me`,
87
+ method: 'GET',
88
+ headers: headerParameters,
89
+ query: queryParameters,
90
+ }, initOverrides);
91
+
92
+ return new runtime.JSONApiResponse(response, (jsonValue) => AccountDtoFromJSON(jsonValue));
93
+ }
94
+
95
+ /**
96
+ *
97
+ */
98
+ async me(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AccountDto> {
99
+ const response = await this.meRaw(initOverrides);
100
+ return await response.value();
101
+ }
102
+
66
103
  /**
67
104
  *
68
105
  */
@@ -0,0 +1,75 @@
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 { exists, mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface AccountDto
20
+ */
21
+ export interface AccountDto {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof AccountDto
26
+ */
27
+ id: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof AccountDto
32
+ */
33
+ identifier: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the AccountDto interface.
38
+ */
39
+ export function instanceOfAccountDto(value: object): boolean {
40
+ let isInstance = true;
41
+ isInstance = isInstance && "id" in value;
42
+ isInstance = isInstance && "identifier" in value;
43
+
44
+ return isInstance;
45
+ }
46
+
47
+ export function AccountDtoFromJSON(json: any): AccountDto {
48
+ return AccountDtoFromJSONTyped(json, false);
49
+ }
50
+
51
+ export function AccountDtoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountDto {
52
+ if ((json === undefined) || (json === null)) {
53
+ return json;
54
+ }
55
+ return {
56
+
57
+ 'id': json['id'],
58
+ 'identifier': json['identifier'],
59
+ };
60
+ }
61
+
62
+ export function AccountDtoToJSON(value?: AccountDto | null): any {
63
+ if (value === undefined) {
64
+ return undefined;
65
+ }
66
+ if (value === null) {
67
+ return null;
68
+ }
69
+ return {
70
+
71
+ 'id': value.id,
72
+ 'identifier': value.identifier,
73
+ };
74
+ }
75
+
@@ -32,6 +32,12 @@ export interface IntersectionAccountDtoWithAddressDto {
32
32
  * @memberof IntersectionAccountDtoWithAddressDto
33
33
  */
34
34
  id: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof IntersectionAccountDtoWithAddressDto
39
+ */
40
+ identifier: string;
35
41
  /**
36
42
  *
37
43
  * @type {Array<AccountAddressDto>}
@@ -46,6 +52,7 @@ export interface IntersectionAccountDtoWithAddressDto {
46
52
  export function instanceOfIntersectionAccountDtoWithAddressDto(value: object): boolean {
47
53
  let isInstance = true;
48
54
  isInstance = isInstance && "id" in value;
55
+ isInstance = isInstance && "identifier" in value;
49
56
  isInstance = isInstance && "addresses" in value;
50
57
 
51
58
  return isInstance;
@@ -62,6 +69,7 @@ export function IntersectionAccountDtoWithAddressDtoFromJSONTyped(json: any, ign
62
69
  return {
63
70
 
64
71
  'id': json['id'],
72
+ 'identifier': json['identifier'],
65
73
  'addresses': ((json['addresses'] as Array<any>).map(AccountAddressDtoFromJSON)),
66
74
  };
67
75
  }
@@ -76,6 +84,7 @@ export function IntersectionAccountDtoWithAddressDtoToJSON(value?: IntersectionA
76
84
  return {
77
85
 
78
86
  'id': value.id,
87
+ 'identifier': value.identifier,
79
88
  'addresses': ((value.addresses as Array<any>).map(AccountAddressDtoToJSON)),
80
89
  };
81
90
  }
@@ -32,6 +32,12 @@ export interface IntersectionAccountDtoWithFinancialDto {
32
32
  * @memberof IntersectionAccountDtoWithFinancialDto
33
33
  */
34
34
  id: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof IntersectionAccountDtoWithFinancialDto
39
+ */
40
+ identifier: string;
35
41
  /**
36
42
  *
37
43
  * @type {IntersectionAccountDtoWithFinancialDtoFinancial}
@@ -46,6 +52,7 @@ export interface IntersectionAccountDtoWithFinancialDto {
46
52
  export function instanceOfIntersectionAccountDtoWithFinancialDto(value: object): boolean {
47
53
  let isInstance = true;
48
54
  isInstance = isInstance && "id" in value;
55
+ isInstance = isInstance && "identifier" in value;
49
56
  isInstance = isInstance && "financial" in value;
50
57
 
51
58
  return isInstance;
@@ -62,6 +69,7 @@ export function IntersectionAccountDtoWithFinancialDtoFromJSONTyped(json: any, i
62
69
  return {
63
70
 
64
71
  'id': json['id'],
72
+ 'identifier': json['identifier'],
65
73
  'financial': IntersectionAccountDtoWithFinancialDtoFinancialFromJSON(json['financial']),
66
74
  };
67
75
  }
@@ -76,6 +84,7 @@ export function IntersectionAccountDtoWithFinancialDtoToJSON(value?: Intersectio
76
84
  return {
77
85
 
78
86
  'id': value.id,
87
+ 'identifier': value.identifier,
79
88
  'financial': IntersectionAccountDtoWithFinancialDtoFinancialToJSON(value.financial),
80
89
  };
81
90
  }
@@ -32,6 +32,12 @@ export interface IntersectionAccountDtoWithSettingsDto {
32
32
  * @memberof IntersectionAccountDtoWithSettingsDto
33
33
  */
34
34
  id: string;
35
+ /**
36
+ *
37
+ * @type {string}
38
+ * @memberof IntersectionAccountDtoWithSettingsDto
39
+ */
40
+ identifier: string;
35
41
  /**
36
42
  *
37
43
  * @type {IntersectionAccountDtoWithSettingsDtoSettings}
@@ -46,6 +52,7 @@ export interface IntersectionAccountDtoWithSettingsDto {
46
52
  export function instanceOfIntersectionAccountDtoWithSettingsDto(value: object): boolean {
47
53
  let isInstance = true;
48
54
  isInstance = isInstance && "id" in value;
55
+ isInstance = isInstance && "identifier" in value;
49
56
  isInstance = isInstance && "settings" in value;
50
57
 
51
58
  return isInstance;
@@ -62,6 +69,7 @@ export function IntersectionAccountDtoWithSettingsDtoFromJSONTyped(json: any, ig
62
69
  return {
63
70
 
64
71
  'id': json['id'],
72
+ 'identifier': json['identifier'],
65
73
  'settings': IntersectionAccountDtoWithSettingsDtoSettingsFromJSON(json['settings']),
66
74
  };
67
75
  }
@@ -76,6 +84,7 @@ export function IntersectionAccountDtoWithSettingsDtoToJSON(value?: Intersection
76
84
  return {
77
85
 
78
86
  'id': value.id,
87
+ 'identifier': value.identifier,
79
88
  'settings': IntersectionAccountDtoWithSettingsDtoSettingsToJSON(value.settings),
80
89
  };
81
90
  }
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable */
3
3
  export * from './AccountAddressDto';
4
4
  export * from './AccountAddressInput';
5
+ export * from './AccountDto';
5
6
  export * from './AccountFinancialInput';
6
7
  export * from './AccountSettingsInput';
7
8
  export * from './BatchUpdate404Response';