@equisoft/account-service-sdk-typescript 3.8.0 → 3.9.0

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.
Files changed (224) hide show
  1. package/.openapi-generator/FILES +1 -0
  2. package/.openapi-generator/VERSION +1 -1
  3. package/README.md +2 -2
  4. package/dist/apis/OAuthApi.d.ts +5 -5
  5. package/dist/apis/OAuthApi.js +1 -1
  6. package/dist/apis/OrganizationApi.d.ts +37 -37
  7. package/dist/apis/OrganizationApi.js +1 -1
  8. package/dist/apis/PermissionApi.d.ts +3 -3
  9. package/dist/apis/PermissionApi.js +1 -1
  10. package/dist/apis/RoleApi.d.ts +3 -3
  11. package/dist/apis/RoleApi.js +1 -1
  12. package/dist/apis/ServiceAccountApi.d.ts +17 -17
  13. package/dist/apis/ServiceAccountApi.js +2 -2
  14. package/dist/apis/SessionApi.d.ts +25 -25
  15. package/dist/apis/SessionApi.js +1 -1
  16. package/dist/apis/UserApi.d.ts +33 -33
  17. package/dist/apis/UserApi.js +2 -2
  18. package/dist/models/ApplyPermissionsPayload.d.ts +2 -2
  19. package/dist/models/ApplyPermissionsPayload.js +4 -4
  20. package/dist/models/CreateOrUpdateOAuthClientPayload.d.ts +4 -4
  21. package/dist/models/CreateOrUpdateOAuthClientPayload.js +4 -4
  22. package/dist/models/CreateOrUpdateOrganizationPayload.d.ts +2 -2
  23. package/dist/models/CreateOrUpdateOrganizationPayload.js +4 -4
  24. package/dist/models/CreateOrUpdatePermissionPayload.d.ts +2 -2
  25. package/dist/models/CreateOrUpdatePermissionPayload.js +4 -4
  26. package/dist/models/CreateOrganizationPayload.d.ts +2 -2
  27. package/dist/models/CreateOrganizationPayload.js +4 -4
  28. package/dist/models/CreateOrganizationUserServiceOptionPayload.d.ts +1 -1
  29. package/dist/models/CreateOrganizationUserServiceOptionPayload.js +1 -1
  30. package/dist/models/CreateOrganizationUserServicePayload.d.ts +1 -1
  31. package/dist/models/CreateOrganizationUserServicePayload.js +1 -1
  32. package/dist/models/CreateRole.d.ts +2 -2
  33. package/dist/models/CreateRole.js +4 -4
  34. package/dist/models/DatabaseState.d.ts +8 -8
  35. package/dist/models/DatabaseState.js +7 -9
  36. package/dist/models/EnableEquisoftConnectPayloadSchema.d.ts +1 -1
  37. package/dist/models/EnableEquisoftConnectPayloadSchema.js +1 -1
  38. package/dist/models/ErrorMessage.d.ts +17 -17
  39. package/dist/models/ErrorMessage.js +16 -18
  40. package/dist/models/ErrorPayload.d.ts +2 -2
  41. package/dist/models/ErrorPayload.js +4 -4
  42. package/dist/models/Id.d.ts +1 -1
  43. package/dist/models/Id.js +1 -1
  44. package/dist/models/ImpersonatePayload.d.ts +1 -1
  45. package/dist/models/ImpersonatePayload.js +1 -1
  46. package/dist/models/LegacyRoleSchema.d.ts +2 -2
  47. package/dist/models/LegacyRoleSchema.js +4 -4
  48. package/dist/models/ListOrganizationElement.d.ts +4 -2
  49. package/dist/models/ListOrganizationElement.js +10 -8
  50. package/dist/models/ListUserOrganizations.d.ts +2 -2
  51. package/dist/models/ListUserOrganizations.js +4 -4
  52. package/dist/models/LocalizedString.d.ts +1 -1
  53. package/dist/models/LocalizedString.js +1 -1
  54. package/dist/models/OAuthClient.d.ts +4 -4
  55. package/dist/models/OAuthClient.js +4 -4
  56. package/dist/models/OAuthClientCreated.d.ts +1 -1
  57. package/dist/models/OAuthClientCreated.js +1 -1
  58. package/dist/models/OAuthClientPublicKey.d.ts +1 -1
  59. package/dist/models/OAuthClientPublicKey.js +1 -1
  60. package/dist/models/Organization.d.ts +4 -2
  61. package/dist/models/Organization.js +10 -8
  62. package/dist/models/OrganizationCreated.d.ts +1 -1
  63. package/dist/models/OrganizationCreated.js +1 -1
  64. package/dist/models/OrganizationPathElement.d.ts +2 -2
  65. package/dist/models/OrganizationPathElement.js +4 -4
  66. package/dist/models/OrganizationRoleAttribution.d.ts +3 -2
  67. package/dist/models/OrganizationRoleAttribution.js +7 -6
  68. package/dist/models/OrganizationRoleAttributionPermission.d.ts +2 -2
  69. package/dist/models/OrganizationRoleAttributionPermission.js +4 -4
  70. package/dist/models/OrganizationRoleAttributionRole.d.ts +3 -2
  71. package/dist/models/OrganizationRoleAttributionRole.js +7 -6
  72. package/dist/models/OrganizationRoleAttributions.d.ts +2 -2
  73. package/dist/models/OrganizationRoleAttributions.js +4 -4
  74. package/dist/models/OrganizationServicesElement.d.ts +1 -1
  75. package/dist/models/OrganizationServicesElement.js +1 -1
  76. package/dist/models/OrganizationUserServiceAssociation.d.ts +1 -1
  77. package/dist/models/OrganizationUserServiceAssociation.js +1 -1
  78. package/dist/models/PermissionCode.d.ts +1 -1
  79. package/dist/models/PermissionCode.js +1 -1
  80. package/dist/models/PermissionCreated.d.ts +1 -1
  81. package/dist/models/PermissionCreated.js +1 -1
  82. package/dist/models/PermissionList.d.ts +2 -2
  83. package/dist/models/PermissionList.js +4 -4
  84. package/dist/models/PermissionResourceType.d.ts +6 -6
  85. package/dist/models/PermissionResourceType.js +5 -7
  86. package/dist/models/Role.d.ts +2 -2
  87. package/dist/models/Role.js +4 -4
  88. package/dist/models/RoleCreated.d.ts +2 -2
  89. package/dist/models/RoleCreated.js +4 -4
  90. package/dist/models/RolesOnOrganization.d.ts +5 -2
  91. package/dist/models/RolesOnOrganization.js +13 -10
  92. package/dist/models/ServiceAccess.d.ts +3 -2
  93. package/dist/models/ServiceAccess.js +7 -6
  94. package/dist/models/ServiceAccountCreationSchema.d.ts +1 -1
  95. package/dist/models/ServiceAccountCreationSchema.js +1 -1
  96. package/dist/models/ServiceAccountSchema.d.ts +2 -2
  97. package/dist/models/ServiceAccountSchema.js +4 -4
  98. package/dist/models/ServiceAccountStatus.d.ts +7 -7
  99. package/dist/models/ServiceAccountStatus.js +6 -8
  100. package/dist/models/ServiceAccountUpdateSchema.d.ts +1 -1
  101. package/dist/models/ServiceAccountUpdateSchema.js +1 -1
  102. package/dist/models/ServiceAccountUuidSchema.d.ts +1 -1
  103. package/dist/models/ServiceAccountUuidSchema.js +1 -1
  104. package/dist/models/ServiceName.d.ts +9 -9
  105. package/dist/models/ServiceName.js +8 -10
  106. package/dist/models/Session.d.ts +4 -2
  107. package/dist/models/Session.js +12 -10
  108. package/dist/models/SessionPayload.d.ts +2 -2
  109. package/dist/models/SessionPayload.js +4 -4
  110. package/dist/models/SessionState.d.ts +9 -9
  111. package/dist/models/SessionState.js +8 -10
  112. package/dist/models/SsoProvider.d.ts +1 -1
  113. package/dist/models/SsoProvider.js +1 -1
  114. package/dist/models/SsoToken.d.ts +1 -1
  115. package/dist/models/SsoToken.js +1 -1
  116. package/dist/models/UpdateParentOrganizationPayload.d.ts +1 -1
  117. package/dist/models/UpdateParentOrganizationPayload.js +1 -1
  118. package/dist/models/UpdateUserAccountPayload.d.ts +1 -1
  119. package/dist/models/UpdateUserAccountPayload.js +1 -1
  120. package/dist/models/UpdateUserAccountSsoPayload.d.ts +1 -1
  121. package/dist/models/UpdateUserAccountSsoPayload.js +1 -1
  122. package/dist/models/UpsertServicePayload.d.ts +1 -1
  123. package/dist/models/UpsertServicePayload.js +1 -1
  124. package/dist/models/User.d.ts +6 -2
  125. package/dist/models/User.js +18 -14
  126. package/dist/models/UserAccountOrganizationRoles.d.ts +3 -2
  127. package/dist/models/UserAccountOrganizationRoles.js +7 -6
  128. package/dist/models/UserAccountPermission.d.ts +2 -2
  129. package/dist/models/UserAccountPermission.js +4 -4
  130. package/dist/models/UserAccountRole.d.ts +2 -2
  131. package/dist/models/UserAccountRole.js +4 -4
  132. package/dist/models/UserAccountRoleAttributions.d.ts +2 -2
  133. package/dist/models/UserAccountRoleAttributions.js +4 -4
  134. package/dist/models/UserAccountSearchResult.d.ts +6 -2
  135. package/dist/models/UserAccountSearchResult.js +18 -14
  136. package/dist/models/UserAgreement.d.ts +2 -2
  137. package/dist/models/UserAgreement.js +4 -4
  138. package/dist/models/UserAgreementState.d.ts +6 -6
  139. package/dist/models/UserAgreementState.js +5 -7
  140. package/dist/models/UserPermissions.d.ts +3 -2
  141. package/dist/models/UserPermissions.js +7 -6
  142. package/dist/models/UserServiceAssociation.d.ts +1 -1
  143. package/dist/models/UserServiceAssociation.js +1 -1
  144. package/dist/models/UserSsoProvider.d.ts +1 -1
  145. package/dist/models/UserSsoProvider.js +1 -1
  146. package/dist/models/UserState.d.ts +7 -7
  147. package/dist/models/UserState.js +6 -8
  148. package/dist/runtime.d.ts +46 -29
  149. package/dist/runtime.js +117 -79
  150. package/package.json +1 -1
  151. package/src/apis/OAuthApi.ts +5 -5
  152. package/src/apis/OrganizationApi.ts +37 -37
  153. package/src/apis/PermissionApi.ts +3 -3
  154. package/src/apis/RoleApi.ts +3 -3
  155. package/src/apis/ServiceAccountApi.ts +17 -17
  156. package/src/apis/SessionApi.ts +25 -25
  157. package/src/apis/UserApi.ts +33 -33
  158. package/src/models/ApplyPermissionsPayload.ts +2 -3
  159. package/src/models/CreateOrUpdateOAuthClientPayload.ts +4 -5
  160. package/src/models/CreateOrUpdateOrganizationPayload.ts +2 -3
  161. package/src/models/CreateOrUpdatePermissionPayload.ts +2 -3
  162. package/src/models/CreateOrganizationPayload.ts +2 -3
  163. package/src/models/CreateOrganizationUserServiceOptionPayload.ts +1 -2
  164. package/src/models/CreateOrganizationUserServicePayload.ts +1 -2
  165. package/src/models/CreateRole.ts +2 -3
  166. package/src/models/DatabaseState.ts +10 -8
  167. package/src/models/EnableEquisoftConnectPayloadSchema.ts +1 -2
  168. package/src/models/ErrorMessage.ts +19 -17
  169. package/src/models/ErrorPayload.ts +2 -3
  170. package/src/models/Id.ts +1 -2
  171. package/src/models/ImpersonatePayload.ts +1 -2
  172. package/src/models/LegacyRoleSchema.ts +2 -3
  173. package/src/models/ListOrganizationElement.ts +6 -3
  174. package/src/models/ListUserOrganizations.ts +2 -3
  175. package/src/models/LocalizedString.ts +1 -2
  176. package/src/models/OAuthClient.ts +4 -5
  177. package/src/models/OAuthClientCreated.ts +1 -2
  178. package/src/models/OAuthClientPublicKey.ts +1 -2
  179. package/src/models/Organization.ts +6 -3
  180. package/src/models/OrganizationCreated.ts +1 -2
  181. package/src/models/OrganizationPathElement.ts +2 -3
  182. package/src/models/OrganizationRoleAttribution.ts +4 -3
  183. package/src/models/OrganizationRoleAttributionPermission.ts +2 -3
  184. package/src/models/OrganizationRoleAttributionRole.ts +4 -3
  185. package/src/models/OrganizationRoleAttributions.ts +2 -3
  186. package/src/models/OrganizationServicesElement.ts +1 -2
  187. package/src/models/OrganizationUserServiceAssociation.ts +1 -2
  188. package/src/models/PermissionCode.ts +1 -2
  189. package/src/models/PermissionCreated.ts +1 -2
  190. package/src/models/PermissionList.ts +2 -3
  191. package/src/models/PermissionResourceType.ts +8 -6
  192. package/src/models/Role.ts +2 -3
  193. package/src/models/RoleCreated.ts +2 -3
  194. package/src/models/RolesOnOrganization.ts +8 -3
  195. package/src/models/ServiceAccess.ts +4 -3
  196. package/src/models/ServiceAccountCreationSchema.ts +1 -2
  197. package/src/models/ServiceAccountSchema.ts +2 -3
  198. package/src/models/ServiceAccountStatus.ts +9 -7
  199. package/src/models/ServiceAccountUpdateSchema.ts +1 -2
  200. package/src/models/ServiceAccountUuidSchema.ts +1 -2
  201. package/src/models/ServiceName.ts +11 -9
  202. package/src/models/Session.ts +6 -3
  203. package/src/models/SessionPayload.ts +2 -3
  204. package/src/models/SessionState.ts +11 -9
  205. package/src/models/SsoProvider.ts +1 -2
  206. package/src/models/SsoToken.ts +1 -2
  207. package/src/models/UpdateParentOrganizationPayload.ts +1 -2
  208. package/src/models/UpdateUserAccountPayload.ts +1 -2
  209. package/src/models/UpdateUserAccountSsoPayload.ts +1 -2
  210. package/src/models/UpsertServicePayload.ts +1 -2
  211. package/src/models/User.ts +10 -3
  212. package/src/models/UserAccountOrganizationRoles.ts +4 -3
  213. package/src/models/UserAccountPermission.ts +2 -3
  214. package/src/models/UserAccountRole.ts +2 -3
  215. package/src/models/UserAccountRoleAttributions.ts +2 -3
  216. package/src/models/UserAccountSearchResult.ts +10 -3
  217. package/src/models/UserAgreement.ts +2 -3
  218. package/src/models/UserAgreementState.ts +8 -6
  219. package/src/models/UserPermissions.ts +4 -3
  220. package/src/models/UserServiceAssociation.ts +1 -2
  221. package/src/models/UserSsoProvider.ts +1 -2
  222. package/src/models/UserState.ts +9 -7
  223. package/src/runtime.ts +145 -96
  224. package/tsconfig.esm.json +7 -0
@@ -5,7 +5,7 @@
5
5
  * User account and session management
6
6
  * Provides HTTP endpoints to manage User Accounts and User Sessions.
7
7
  *
8
- * The version of the OpenAPI document: 3.8.0
8
+ * The version of the OpenAPI document: 3.9.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -20,14 +20,12 @@ exports.UserStateToJSON = exports.UserStateFromJSONTyped = exports.UserStateFrom
20
20
  * * `DISABLED` - Temporarily denied login.
21
21
  * * `ENABLED` - Allowed to login.
22
22
  * @export
23
- * @enum {string}
24
23
  */
25
- var UserState;
26
- (function (UserState) {
27
- UserState["DELETED"] = "DELETED";
28
- UserState["DISABLED"] = "DISABLED";
29
- UserState["ENABLED"] = "ENABLED";
30
- })(UserState = exports.UserState || (exports.UserState = {}));
24
+ exports.UserState = {
25
+ DELETED: 'DELETED',
26
+ DISABLED: 'DISABLED',
27
+ ENABLED: 'ENABLED'
28
+ };
31
29
  function UserStateFromJSON(json) {
32
30
  return UserStateFromJSONTyped(json, false);
33
31
  }
package/dist/runtime.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * User account and session management
3
3
  * Provides HTTP endpoints to manage User Accounts and User Sessions.
4
4
  *
5
- * The version of the OpenAPI document: 3.8.0
5
+ * The version of the OpenAPI document: 3.9.0
6
6
  *
7
7
  *
8
8
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -10,6 +10,34 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  export declare const BASE_PATH: string;
13
+ export interface ConfigurationParameters {
14
+ basePath?: string;
15
+ fetchApi?: FetchAPI;
16
+ middleware?: Middleware[];
17
+ queryParamsStringify?: (params: HTTPQuery) => string;
18
+ username?: string;
19
+ password?: string;
20
+ apiKey?: string | ((name: string) => string);
21
+ accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
22
+ headers?: HTTPHeaders;
23
+ credentials?: RequestCredentials;
24
+ }
25
+ export declare class Configuration {
26
+ private configuration;
27
+ constructor(configuration?: ConfigurationParameters);
28
+ set config(configuration: Configuration);
29
+ get basePath(): string;
30
+ get fetchApi(): FetchAPI | undefined;
31
+ get middleware(): Middleware[];
32
+ get queryParamsStringify(): (params: HTTPQuery) => string;
33
+ get username(): string | undefined;
34
+ get password(): string | undefined;
35
+ get apiKey(): ((name: string) => string) | undefined;
36
+ get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
37
+ get headers(): HTTPHeaders | undefined;
38
+ get credentials(): RequestCredentials | undefined;
39
+ }
40
+ export declare const DefaultConfig: Configuration;
13
41
  /**
14
42
  * This is the base class for all generated API classes.
15
43
  */
@@ -20,7 +48,7 @@ export declare class BaseAPI {
20
48
  withMiddleware<T extends BaseAPI>(this: T, ...middlewares: Middleware[]): T;
21
49
  withPreMiddleware<T extends BaseAPI>(this: T, ...preMiddlewares: Array<Middleware['pre']>): T;
22
50
  withPostMiddleware<T extends BaseAPI>(this: T, ...postMiddlewares: Array<Middleware['post']>): T;
23
- protected request(context: RequestOpts, initOverrides?: RequestInit): Promise<Response>;
51
+ protected request(context: RequestOpts, initOverrides?: RequestInit | InitOverideFunction): Promise<Response>;
24
52
  private createFetchParams;
25
53
  private fetchApi;
26
54
  /**
@@ -29,6 +57,11 @@ export declare class BaseAPI {
29
57
  */
30
58
  private clone;
31
59
  }
60
+ export declare class ResponseError extends Error {
61
+ response: Response;
62
+ name: "ResponseError";
63
+ constructor(response: Response, msg?: string);
64
+ }
32
65
  export declare class RequiredError extends Error {
33
66
  field: string;
34
67
  name: "RequiredError";
@@ -41,42 +74,26 @@ export declare const COLLECTION_FORMATS: {
41
74
  pipes: string;
42
75
  };
43
76
  export declare type FetchAPI = WindowOrWorkerGlobalScope['fetch'];
44
- export interface ConfigurationParameters {
45
- basePath?: string;
46
- fetchApi?: FetchAPI;
47
- middleware?: Middleware[];
48
- queryParamsStringify?: (params: HTTPQuery) => string;
49
- username?: string;
50
- password?: string;
51
- apiKey?: string | ((name: string) => string);
52
- accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>);
53
- headers?: HTTPHeaders;
54
- credentials?: RequestCredentials;
55
- }
56
- export declare class Configuration {
57
- private configuration;
58
- constructor(configuration?: ConfigurationParameters);
59
- get basePath(): string;
60
- get fetchApi(): FetchAPI;
61
- get middleware(): Middleware[];
62
- get queryParamsStringify(): (params: HTTPQuery) => string;
63
- get username(): string | undefined;
64
- get password(): string | undefined;
65
- get apiKey(): ((name: string) => string) | undefined;
66
- get accessToken(): ((name?: string, scopes?: string[]) => string | Promise<string>) | undefined;
67
- get headers(): HTTPHeaders | undefined;
68
- get credentials(): RequestCredentials | undefined;
69
- }
70
77
  export declare type Json = any;
71
78
  export declare type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD';
72
79
  export declare type HTTPHeaders = {
73
80
  [key: string]: string;
74
81
  };
75
82
  export declare type HTTPQuery = {
76
- [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | HTTPQuery;
83
+ [key: string]: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery;
77
84
  };
78
85
  export declare type HTTPBody = Json | FormData | URLSearchParams;
86
+ export declare type HTTPRequestInit = {
87
+ headers?: HTTPHeaders;
88
+ method: HTTPMethod;
89
+ credentials?: RequestCredentials;
90
+ body?: HTTPBody;
91
+ };
79
92
  export declare type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
93
+ export declare type InitOverideFunction = (requestContext: {
94
+ init: HTTPRequestInit;
95
+ context: RequestOpts;
96
+ }) => Promise<RequestInit>;
80
97
  export interface FetchParams {
81
98
  url: string;
82
99
  init: RequestInit;
package/dist/runtime.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * User account and session management
6
6
  * Provides HTTP endpoints to manage User Accounts and User Sessions.
7
7
  *
8
- * The version of the OpenAPI document: 3.8.0
8
+ * The version of the OpenAPI document: 3.9.0
9
9
  *
10
10
  *
11
11
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -22,14 +22,61 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
22
22
  });
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.Configuration = exports.COLLECTION_FORMATS = exports.RequiredError = exports.BaseAPI = exports.BASE_PATH = void 0;
25
+ exports.TextApiResponse = exports.BlobApiResponse = exports.VoidApiResponse = exports.JSONApiResponse = exports.canConsumeForm = exports.mapValues = exports.querystring = exports.exists = exports.COLLECTION_FORMATS = exports.RequiredError = exports.ResponseError = exports.BaseAPI = exports.DefaultConfig = exports.Configuration = exports.BASE_PATH = void 0;
26
26
  exports.BASE_PATH = "http://localhost".replace(/\/+$/, "");
27
- const isBlob = (value) => typeof Blob !== 'undefined' && value instanceof Blob;
27
+ class Configuration {
28
+ constructor(configuration = {}) {
29
+ this.configuration = configuration;
30
+ }
31
+ set config(configuration) {
32
+ this.configuration = configuration;
33
+ }
34
+ get basePath() {
35
+ return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
36
+ }
37
+ get fetchApi() {
38
+ return this.configuration.fetchApi;
39
+ }
40
+ get middleware() {
41
+ return this.configuration.middleware || [];
42
+ }
43
+ get queryParamsStringify() {
44
+ return this.configuration.queryParamsStringify || querystring;
45
+ }
46
+ get username() {
47
+ return this.configuration.username;
48
+ }
49
+ get password() {
50
+ return this.configuration.password;
51
+ }
52
+ get apiKey() {
53
+ const apiKey = this.configuration.apiKey;
54
+ if (apiKey) {
55
+ return typeof apiKey === 'function' ? apiKey : () => apiKey;
56
+ }
57
+ return undefined;
58
+ }
59
+ get accessToken() {
60
+ const accessToken = this.configuration.accessToken;
61
+ if (accessToken) {
62
+ return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
63
+ }
64
+ return undefined;
65
+ }
66
+ get headers() {
67
+ return this.configuration.headers;
68
+ }
69
+ get credentials() {
70
+ return this.configuration.credentials;
71
+ }
72
+ }
73
+ exports.Configuration = Configuration;
74
+ exports.DefaultConfig = new Configuration();
28
75
  /**
29
76
  * This is the base class for all generated API classes.
30
77
  */
31
78
  class BaseAPI {
32
- constructor(configuration = new Configuration()) {
79
+ constructor(configuration = exports.DefaultConfig) {
33
80
  this.configuration = configuration;
34
81
  this.fetchApi = (url, init) => __awaiter(this, void 0, void 0, function* () {
35
82
  let fetchParams = { url, init };
@@ -68,28 +115,45 @@ class BaseAPI {
68
115
  }
69
116
  request(context, initOverrides) {
70
117
  return __awaiter(this, void 0, void 0, function* () {
71
- const { url, init } = this.createFetchParams(context, initOverrides);
118
+ const { url, init } = yield this.createFetchParams(context, initOverrides);
72
119
  const response = yield this.fetchApi(url, init);
73
120
  if (response.status >= 200 && response.status < 300) {
74
121
  return response;
75
122
  }
76
- throw response;
123
+ throw new ResponseError(response, 'Response returned an error code');
77
124
  });
78
125
  }
79
126
  createFetchParams(context, initOverrides) {
80
- let url = this.configuration.basePath + context.path;
81
- if (context.query !== undefined && Object.keys(context.query).length !== 0) {
82
- // only add the querystring to the URL if there are query parameters.
83
- // this is done to avoid urls ending with a "?" character which buggy webservers
84
- // do not handle correctly sometimes.
85
- url += '?' + this.configuration.queryParamsStringify(context.query);
86
- }
87
- const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body))
88
- ? context.body
89
- : JSON.stringify(context.body);
90
- const headers = Object.assign({}, this.configuration.headers, context.headers);
91
- const init = Object.assign({ method: context.method, headers: headers, body, credentials: this.configuration.credentials }, initOverrides);
92
- return { url, init };
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ let url = this.configuration.basePath + context.path;
129
+ if (context.query !== undefined && Object.keys(context.query).length !== 0) {
130
+ // only add the querystring to the URL if there are query parameters.
131
+ // this is done to avoid urls ending with a "?" character which buggy webservers
132
+ // do not handle correctly sometimes.
133
+ url += '?' + this.configuration.queryParamsStringify(context.query);
134
+ }
135
+ const headers = Object.assign({}, this.configuration.headers, context.headers);
136
+ Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {});
137
+ const initOverrideFn = typeof initOverrides === "function"
138
+ ? initOverrides
139
+ : () => __awaiter(this, void 0, void 0, function* () { return initOverrides; });
140
+ const initParams = {
141
+ method: context.method,
142
+ headers,
143
+ body: context.body,
144
+ credentials: this.configuration.credentials,
145
+ };
146
+ const overridedInit = Object.assign(Object.assign({}, initParams), (yield initOverrideFn({
147
+ init: initParams,
148
+ context,
149
+ })));
150
+ const init = Object.assign(Object.assign({}, overridedInit), { body: isFormData(overridedInit.body) ||
151
+ overridedInit.body instanceof URLSearchParams ||
152
+ isBlob(overridedInit.body)
153
+ ? overridedInit.body
154
+ : JSON.stringify(overridedInit.body) });
155
+ return { url, init };
156
+ });
93
157
  }
94
158
  /**
95
159
  * Create a shallow clone of `this` by constructing a new instance
@@ -104,6 +168,20 @@ class BaseAPI {
104
168
  }
105
169
  exports.BaseAPI = BaseAPI;
106
170
  ;
171
+ function isBlob(value) {
172
+ return typeof Blob !== 'undefined' && value instanceof Blob;
173
+ }
174
+ function isFormData(value) {
175
+ return typeof FormData !== "undefined" && value instanceof FormData;
176
+ }
177
+ class ResponseError extends Error {
178
+ constructor(response, msg) {
179
+ super(msg);
180
+ this.response = response;
181
+ this.name = "ResponseError";
182
+ }
183
+ }
184
+ exports.ResponseError = ResponseError;
107
185
  class RequiredError extends Error {
108
186
  constructor(field, msg) {
109
187
  super(msg);
@@ -118,50 +196,6 @@ exports.COLLECTION_FORMATS = {
118
196
  tsv: "\t",
119
197
  pipes: "|",
120
198
  };
121
- class Configuration {
122
- constructor(configuration = {}) {
123
- this.configuration = configuration;
124
- }
125
- get basePath() {
126
- return this.configuration.basePath != null ? this.configuration.basePath : exports.BASE_PATH;
127
- }
128
- get fetchApi() {
129
- return this.configuration.fetchApi;
130
- }
131
- get middleware() {
132
- return this.configuration.middleware || [];
133
- }
134
- get queryParamsStringify() {
135
- return this.configuration.queryParamsStringify || querystring;
136
- }
137
- get username() {
138
- return this.configuration.username;
139
- }
140
- get password() {
141
- return this.configuration.password;
142
- }
143
- get apiKey() {
144
- const apiKey = this.configuration.apiKey;
145
- if (apiKey) {
146
- return typeof apiKey === 'function' ? apiKey : () => apiKey;
147
- }
148
- return undefined;
149
- }
150
- get accessToken() {
151
- const accessToken = this.configuration.accessToken;
152
- if (accessToken) {
153
- return typeof accessToken === 'function' ? accessToken : () => __awaiter(this, void 0, void 0, function* () { return accessToken; });
154
- }
155
- return undefined;
156
- }
157
- get headers() {
158
- return this.configuration.headers;
159
- }
160
- get credentials() {
161
- return this.configuration.credentials;
162
- }
163
- }
164
- exports.Configuration = Configuration;
165
199
  function exists(json, key) {
166
200
  const value = json[key];
167
201
  return value !== null && value !== undefined;
@@ -169,26 +203,30 @@ function exists(json, key) {
169
203
  exports.exists = exists;
170
204
  function querystring(params, prefix = '') {
171
205
  return Object.keys(params)
172
- .map((key) => {
173
- const fullKey = prefix + (prefix.length ? `[${key}]` : key);
174
- const value = params[key];
175
- if (value instanceof Array) {
176
- const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
177
- .join(`&${encodeURIComponent(fullKey)}=`);
178
- return `${encodeURIComponent(fullKey)}=${multiValue}`;
179
- }
180
- if (value instanceof Date) {
181
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
182
- }
183
- if (value instanceof Object) {
184
- return querystring(value, fullKey);
185
- }
186
- return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
187
- })
206
+ .map(key => querystringSingleKey(key, params[key], prefix))
188
207
  .filter(part => part.length > 0)
189
208
  .join('&');
190
209
  }
191
210
  exports.querystring = querystring;
211
+ function querystringSingleKey(key, value, keyPrefix = '') {
212
+ const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
213
+ if (value instanceof Array) {
214
+ const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
215
+ .join(`&${encodeURIComponent(fullKey)}=`);
216
+ return `${encodeURIComponent(fullKey)}=${multiValue}`;
217
+ }
218
+ if (value instanceof Set) {
219
+ const valueAsArray = Array.from(value);
220
+ return querystringSingleKey(key, valueAsArray, keyPrefix);
221
+ }
222
+ if (value instanceof Date) {
223
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
224
+ }
225
+ if (value instanceof Object) {
226
+ return querystring(value, fullKey);
227
+ }
228
+ return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
229
+ }
192
230
  function mapValues(data, fn) {
193
231
  return Object.keys(data).reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: fn(data[key]) })), {});
194
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equisoft/account-service-sdk-typescript",
3
- "version": "3.8.0",
3
+ "version": "3.9.0",
4
4
  "description": "OpenAPI client for @equisoft/account-service-sdk-typescript",
5
5
  "author": "Equisoft Inc.",
6
6
  "main": "./dist/index.js",
@@ -4,7 +4,7 @@
4
4
  * User account and session management
5
5
  * Provides HTTP endpoints to manage User Accounts and User Sessions.
6
6
  *
7
- * The version of the OpenAPI document: 3.8.0
7
+ * The version of the OpenAPI document: 3.9.0
8
8
  *
9
9
  *
10
10
  * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
@@ -46,7 +46,7 @@ export class OAuthApi extends runtime.BaseAPI {
46
46
  /**
47
47
  * Create or update an oauth client
48
48
  */
49
- async createOrUpdateOAuthClientRaw(requestParameters: CreateOrUpdateOAuthClientRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<OAuthClientCreated>> {
49
+ async createOrUpdateOAuthClientRaw(requestParameters: CreateOrUpdateOAuthClientRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OAuthClientCreated>> {
50
50
  if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
51
51
  throw new runtime.RequiredError('clientId','Required parameter requestParameters.clientId was null or undefined when calling createOrUpdateOAuthClient.');
52
52
  }
@@ -85,7 +85,7 @@ export class OAuthApi extends runtime.BaseAPI {
85
85
  /**
86
86
  * Create or update an oauth client
87
87
  */
88
- async createOrUpdateOAuthClient(requestParameters: CreateOrUpdateOAuthClientRequest, initOverrides?: RequestInit): Promise<OAuthClientCreated> {
88
+ async createOrUpdateOAuthClient(requestParameters: CreateOrUpdateOAuthClientRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OAuthClientCreated> {
89
89
  const response = await this.createOrUpdateOAuthClientRaw(requestParameters, initOverrides);
90
90
  return await response.value();
91
91
  }
@@ -93,7 +93,7 @@ export class OAuthApi extends runtime.BaseAPI {
93
93
  /**
94
94
  * Get detailed information about an oauth client.
95
95
  */
96
- async getOAuthClientRaw(requestParameters: GetOAuthClientRequest, initOverrides?: RequestInit): Promise<runtime.ApiResponse<OAuthClient>> {
96
+ async getOAuthClientRaw(requestParameters: GetOAuthClientRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<OAuthClient>> {
97
97
  if (requestParameters.clientId === null || requestParameters.clientId === undefined) {
98
98
  throw new runtime.RequiredError('clientId','Required parameter requestParameters.clientId was null or undefined when calling getOAuthClient.');
99
99
  }
@@ -125,7 +125,7 @@ export class OAuthApi extends runtime.BaseAPI {
125
125
  /**
126
126
  * Get detailed information about an oauth client.
127
127
  */
128
- async getOAuthClient(requestParameters: GetOAuthClientRequest, initOverrides?: RequestInit): Promise<OAuthClient> {
128
+ async getOAuthClient(requestParameters: GetOAuthClientRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<OAuthClient> {
129
129
  const response = await this.getOAuthClientRaw(requestParameters, initOverrides);
130
130
  return await response.value();
131
131
  }