@equisoft/account-service-sdk-typescript 4.5.1-snapshot.20230206204303 → 4.5.1-snapshot.20230207210529
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/VERSION +1 -1
- package/dist/apis/OAuthApi.d.ts +5 -5
- package/dist/apis/OrganizationApi.d.ts +37 -37
- package/dist/apis/PermissionApi.d.ts +3 -3
- package/dist/apis/RoleApi.d.ts +3 -3
- package/dist/apis/ServiceAccountApi.d.ts +17 -17
- package/dist/apis/SessionApi.d.ts +25 -25
- package/dist/apis/UserApi.d.ts +45 -45
- package/dist/models/ApplyPermissionsPayload.d.ts +5 -1
- package/dist/models/ApplyPermissionsPayload.js +11 -1
- package/dist/models/AuthenticationUserAccount.d.ts +4 -0
- package/dist/models/AuthenticationUserAccount.js +14 -1
- package/dist/models/CreateOrUpdateOAuthClientPayload.d.ts +5 -1
- package/dist/models/CreateOrUpdateOAuthClientPayload.js +13 -1
- package/dist/models/CreateOrUpdateOrganizationPayload.d.ts +5 -1
- package/dist/models/CreateOrUpdateOrganizationPayload.js +12 -1
- package/dist/models/CreateOrUpdatePermissionPayload.d.ts +5 -1
- package/dist/models/CreateOrUpdatePermissionPayload.js +10 -1
- package/dist/models/CreateOrganizationPayload.d.ts +5 -1
- package/dist/models/CreateOrganizationPayload.js +12 -1
- package/dist/models/CreateOrganizationUserServiceOptionPayload.d.ts +4 -0
- package/dist/models/CreateOrganizationUserServiceOptionPayload.js +10 -1
- package/dist/models/CreateOrganizationUserServicePayload.d.ts +4 -0
- package/dist/models/CreateOrganizationUserServicePayload.js +9 -1
- package/dist/models/CreateRole.d.ts +5 -1
- package/dist/models/CreateRole.js +11 -1
- package/dist/models/DatabaseState.d.ts +1 -0
- package/dist/models/DatabaseState.js +2 -1
- package/dist/models/EnableEquisoftConnectPayloadSchema.d.ts +4 -0
- package/dist/models/EnableEquisoftConnectPayloadSchema.js +9 -1
- package/dist/models/ErrorMessage.d.ts +1 -0
- package/dist/models/ErrorMessage.js +2 -1
- package/dist/models/ErrorPayload.d.ts +5 -1
- package/dist/models/ErrorPayload.js +10 -1
- package/dist/models/Id.d.ts +4 -0
- package/dist/models/Id.js +11 -1
- package/dist/models/ImpersonatePayload.d.ts +4 -0
- package/dist/models/ImpersonatePayload.js +10 -1
- package/dist/models/LegacyRoleSchema.d.ts +5 -1
- package/dist/models/LegacyRoleSchema.js +11 -1
- package/dist/models/ListOrganizationElement.d.ts +7 -3
- package/dist/models/ListOrganizationElement.js +13 -1
- package/dist/models/ListUserOrganizations.d.ts +5 -1
- package/dist/models/ListUserOrganizations.js +10 -1
- package/dist/models/LocalizedString.d.ts +4 -0
- package/dist/models/LocalizedString.js +11 -1
- package/dist/models/LoginPayload.d.ts +4 -0
- package/dist/models/LoginPayload.js +11 -1
- package/dist/models/OAuthClient.d.ts +5 -1
- package/dist/models/OAuthClient.js +19 -1
- package/dist/models/OAuthClientCreated.d.ts +4 -0
- package/dist/models/OAuthClientCreated.js +10 -1
- package/dist/models/OAuthClientPublicKey.d.ts +4 -0
- package/dist/models/OAuthClientPublicKey.js +11 -1
- package/dist/models/Organization.d.ts +7 -3
- package/dist/models/Organization.js +15 -1
- package/dist/models/OrganizationCreated.d.ts +4 -0
- package/dist/models/OrganizationCreated.js +10 -1
- package/dist/models/OrganizationPathElement.d.ts +5 -1
- package/dist/models/OrganizationPathElement.js +11 -1
- package/dist/models/OrganizationRoleAttribution.d.ts +6 -2
- package/dist/models/OrganizationRoleAttribution.js +11 -1
- package/dist/models/OrganizationRoleAttributionPermission.d.ts +5 -1
- package/dist/models/OrganizationRoleAttributionPermission.js +11 -1
- package/dist/models/OrganizationRoleAttributionRole.d.ts +6 -2
- package/dist/models/OrganizationRoleAttributionRole.js +12 -1
- package/dist/models/OrganizationRoleAttributions.d.ts +5 -1
- package/dist/models/OrganizationRoleAttributions.js +10 -1
- package/dist/models/OrganizationServicesElement.d.ts +4 -0
- package/dist/models/OrganizationServicesElement.js +10 -1
- package/dist/models/OrganizationSsoProvider.d.ts +5 -1
- package/dist/models/OrganizationSsoProvider.js +11 -1
- package/dist/models/OrganizationUserServiceAssociation.d.ts +4 -0
- package/dist/models/OrganizationUserServiceAssociation.js +11 -1
- package/dist/models/PermissionCode.d.ts +4 -0
- package/dist/models/PermissionCode.js +10 -1
- package/dist/models/PermissionCreated.d.ts +4 -0
- package/dist/models/PermissionCreated.js +10 -1
- package/dist/models/PermissionList.d.ts +5 -1
- package/dist/models/PermissionList.js +10 -1
- package/dist/models/PermissionResourceType.d.ts +1 -0
- package/dist/models/PermissionResourceType.js +2 -1
- package/dist/models/Role.d.ts +5 -1
- package/dist/models/Role.js +12 -1
- package/dist/models/RoleCreated.d.ts +5 -1
- package/dist/models/RoleCreated.js +12 -1
- package/dist/models/RolesOnOrganization.d.ts +8 -4
- package/dist/models/RolesOnOrganization.js +14 -1
- package/dist/models/SendResetPasswordLinkPayload.d.ts +4 -0
- package/dist/models/SendResetPasswordLinkPayload.js +11 -1
- package/dist/models/ServiceAccess.d.ts +6 -2
- package/dist/models/ServiceAccess.js +10 -1
- package/dist/models/ServiceAccountCreationSchema.d.ts +4 -0
- package/dist/models/ServiceAccountCreationSchema.js +12 -1
- package/dist/models/ServiceAccountSchema.d.ts +5 -1
- package/dist/models/ServiceAccountSchema.js +15 -1
- package/dist/models/ServiceAccountStatus.d.ts +1 -0
- package/dist/models/ServiceAccountStatus.js +2 -1
- package/dist/models/ServiceAccountUpdateSchema.d.ts +4 -0
- package/dist/models/ServiceAccountUpdateSchema.js +9 -1
- package/dist/models/ServiceAccountUuidSchema.d.ts +4 -0
- package/dist/models/ServiceAccountUuidSchema.js +10 -1
- package/dist/models/ServiceName.d.ts +1 -0
- package/dist/models/ServiceName.js +2 -1
- package/dist/models/Session.d.ts +7 -3
- package/dist/models/Session.js +17 -1
- package/dist/models/SessionPayload.d.ts +5 -1
- package/dist/models/SessionPayload.js +11 -1
- package/dist/models/SessionState.d.ts +1 -0
- package/dist/models/SessionState.js +2 -1
- package/dist/models/SetPasswordByConfirmationHashPayload.d.ts +4 -0
- package/dist/models/SetPasswordByConfirmationHashPayload.js +10 -1
- package/dist/models/SetUserAccountPasswordPayload.d.ts +4 -0
- package/dist/models/SetUserAccountPasswordPayload.js +11 -1
- package/dist/models/SsoProvider.d.ts +4 -0
- package/dist/models/SsoProvider.js +11 -1
- package/dist/models/SsoToken.d.ts +4 -0
- package/dist/models/SsoToken.js +11 -1
- package/dist/models/UpdateParentOrganizationPayload.d.ts +4 -0
- package/dist/models/UpdateParentOrganizationPayload.js +10 -1
- package/dist/models/UpdateUserAccountPayload.d.ts +4 -0
- package/dist/models/UpdateUserAccountPayload.js +11 -1
- package/dist/models/UpdateUserAccountSsoPayload.d.ts +4 -0
- package/dist/models/UpdateUserAccountSsoPayload.js +10 -1
- package/dist/models/UpsertServicePayload.d.ts +4 -0
- package/dist/models/UpsertServicePayload.js +9 -1
- package/dist/models/User.d.ts +9 -5
- package/dist/models/User.js +26 -1
- package/dist/models/UserAccountOrganizationRoles.d.ts +6 -2
- package/dist/models/UserAccountOrganizationRoles.js +12 -1
- package/dist/models/UserAccountPermission.d.ts +5 -1
- package/dist/models/UserAccountPermission.js +11 -1
- package/dist/models/UserAccountRole.d.ts +5 -1
- package/dist/models/UserAccountRole.js +11 -1
- package/dist/models/UserAccountRoleAttributions.d.ts +5 -1
- package/dist/models/UserAccountRoleAttributions.js +10 -1
- package/dist/models/UserAccountSearchResult.d.ts +9 -5
- package/dist/models/UserAccountSearchResult.js +26 -1
- package/dist/models/UserAgreement.d.ts +5 -1
- package/dist/models/UserAgreement.js +10 -1
- package/dist/models/UserAgreementState.d.ts +1 -0
- package/dist/models/UserAgreementState.js +2 -1
- package/dist/models/UserPermissions.d.ts +6 -2
- package/dist/models/UserPermissions.js +11 -1
- package/dist/models/UserServiceAssociation.d.ts +4 -0
- package/dist/models/UserServiceAssociation.js +11 -1
- package/dist/models/UserSsoProvider.d.ts +4 -0
- package/dist/models/UserSsoProvider.js +10 -1
- package/dist/models/UserState.d.ts +1 -0
- package/dist/models/UserState.js +2 -1
- package/dist/runtime.d.ts +15 -2
- package/dist/runtime.js +29 -2
- package/package.json +1 -1
- package/src/apis/OAuthApi.ts +10 -8
- package/src/apis/OrganizationApi.ts +54 -52
- package/src/apis/PermissionApi.ts +7 -5
- package/src/apis/RoleApi.ts +6 -4
- package/src/apis/ServiceAccountApi.ts +26 -24
- package/src/apis/SessionApi.ts +32 -30
- package/src/apis/UserApi.ts +62 -60
- package/src/models/ApplyPermissionsPayload.ts +12 -1
- package/src/models/AuthenticationUserAccount.ts +14 -0
- package/src/models/CreateOrUpdateOAuthClientPayload.ts +14 -1
- package/src/models/CreateOrUpdateOrganizationPayload.ts +13 -1
- package/src/models/CreateOrUpdatePermissionPayload.ts +11 -1
- package/src/models/CreateOrganizationPayload.ts +13 -1
- package/src/models/CreateOrganizationUserServiceOptionPayload.ts +10 -0
- package/src/models/CreateOrganizationUserServicePayload.ts +9 -0
- package/src/models/CreateRole.ts +12 -1
- package/src/models/DatabaseState.ts +2 -1
- package/src/models/EnableEquisoftConnectPayloadSchema.ts +9 -0
- package/src/models/ErrorMessage.ts +2 -1
- package/src/models/ErrorPayload.ts +11 -1
- package/src/models/Id.ts +11 -0
- package/src/models/ImpersonatePayload.ts +10 -0
- package/src/models/LegacyRoleSchema.ts +12 -1
- package/src/models/ListOrganizationElement.ts +16 -3
- package/src/models/ListUserOrganizations.ts +11 -1
- package/src/models/LocalizedString.ts +11 -0
- package/src/models/LoginPayload.ts +11 -0
- package/src/models/OAuthClient.ts +20 -1
- package/src/models/OAuthClientCreated.ts +10 -0
- package/src/models/OAuthClientPublicKey.ts +11 -0
- package/src/models/Organization.ts +18 -3
- package/src/models/OrganizationCreated.ts +10 -0
- package/src/models/OrganizationPathElement.ts +12 -1
- package/src/models/OrganizationRoleAttribution.ts +13 -2
- package/src/models/OrganizationRoleAttributionPermission.ts +12 -1
- package/src/models/OrganizationRoleAttributionRole.ts +14 -2
- package/src/models/OrganizationRoleAttributions.ts +11 -1
- package/src/models/OrganizationServicesElement.ts +10 -0
- package/src/models/OrganizationSsoProvider.ts +12 -1
- package/src/models/OrganizationUserServiceAssociation.ts +11 -0
- package/src/models/PermissionCode.ts +10 -0
- package/src/models/PermissionCreated.ts +10 -0
- package/src/models/PermissionList.ts +11 -1
- package/src/models/PermissionResourceType.ts +2 -1
- package/src/models/Role.ts +13 -1
- package/src/models/RoleCreated.ts +13 -1
- package/src/models/RolesOnOrganization.ts +18 -4
- package/src/models/SendResetPasswordLinkPayload.ts +11 -0
- package/src/models/ServiceAccess.ts +12 -2
- package/src/models/ServiceAccountCreationSchema.ts +12 -0
- package/src/models/ServiceAccountSchema.ts +16 -1
- package/src/models/ServiceAccountStatus.ts +2 -1
- package/src/models/ServiceAccountUpdateSchema.ts +9 -0
- package/src/models/ServiceAccountUuidSchema.ts +10 -0
- package/src/models/ServiceName.ts +2 -1
- package/src/models/Session.ts +20 -3
- package/src/models/SessionPayload.ts +12 -1
- package/src/models/SessionState.ts +2 -1
- package/src/models/SetPasswordByConfirmationHashPayload.ts +10 -0
- package/src/models/SetUserAccountPasswordPayload.ts +11 -0
- package/src/models/SsoProvider.ts +11 -0
- package/src/models/SsoToken.ts +11 -0
- package/src/models/UpdateParentOrganizationPayload.ts +10 -0
- package/src/models/UpdateUserAccountPayload.ts +11 -0
- package/src/models/UpdateUserAccountSsoPayload.ts +10 -0
- package/src/models/UpsertServicePayload.ts +9 -0
- package/src/models/User.ts +31 -5
- package/src/models/UserAccountOrganizationRoles.ts +14 -2
- package/src/models/UserAccountPermission.ts +12 -1
- package/src/models/UserAccountRole.ts +12 -1
- package/src/models/UserAccountRoleAttributions.ts +11 -1
- package/src/models/UserAccountSearchResult.ts +31 -5
- package/src/models/UserAgreement.ts +11 -1
- package/src/models/UserAgreementState.ts +2 -1
- package/src/models/UserPermissions.ts +13 -2
- package/src/models/UserServiceAssociation.ts +11 -0
- package/src/models/UserSsoProvider.ts +10 -0
- package/src/models/UserState.ts +2 -1
- package/src/runtime.ts +39 -5
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import type { LocalizedString } from './LocalizedString';
|
|
16
17
|
import {
|
|
17
|
-
LocalizedString,
|
|
18
18
|
LocalizedStringFromJSON,
|
|
19
19
|
LocalizedStringFromJSONTyped,
|
|
20
20
|
LocalizedStringToJSON,
|
|
@@ -40,6 +40,17 @@ export interface UserAccountRole {
|
|
|
40
40
|
name: LocalizedString;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Check if a given object implements the UserAccountRole interface.
|
|
45
|
+
*/
|
|
46
|
+
export function instanceOfUserAccountRole(value: object): boolean {
|
|
47
|
+
let isInstance = true;
|
|
48
|
+
isInstance = isInstance && "uuid" in value;
|
|
49
|
+
isInstance = isInstance && "name" in value;
|
|
50
|
+
|
|
51
|
+
return isInstance;
|
|
52
|
+
}
|
|
53
|
+
|
|
43
54
|
export function UserAccountRoleFromJSON(json: any): UserAccountRole {
|
|
44
55
|
return UserAccountRoleFromJSONTyped(json, false);
|
|
45
56
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import type { UserAccountOrganizationRoles } from './UserAccountOrganizationRoles';
|
|
16
17
|
import {
|
|
17
|
-
UserAccountOrganizationRoles,
|
|
18
18
|
UserAccountOrganizationRolesFromJSON,
|
|
19
19
|
UserAccountOrganizationRolesFromJSONTyped,
|
|
20
20
|
UserAccountOrganizationRolesToJSON,
|
|
@@ -34,6 +34,16 @@ export interface UserAccountRoleAttributions {
|
|
|
34
34
|
organizations: Array<UserAccountOrganizationRoles>;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the UserAccountRoleAttributions interface.
|
|
39
|
+
*/
|
|
40
|
+
export function instanceOfUserAccountRoleAttributions(value: object): boolean {
|
|
41
|
+
let isInstance = true;
|
|
42
|
+
isInstance = isInstance && "organizations" in value;
|
|
43
|
+
|
|
44
|
+
return isInstance;
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
export function UserAccountRoleAttributionsFromJSON(json: any): UserAccountRoleAttributions {
|
|
38
48
|
return UserAccountRoleAttributionsFromJSONTyped(json, false);
|
|
39
49
|
}
|
|
@@ -13,32 +13,32 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import type { ServiceAccess } from './ServiceAccess';
|
|
16
17
|
import {
|
|
17
|
-
ServiceAccess,
|
|
18
18
|
ServiceAccessFromJSON,
|
|
19
19
|
ServiceAccessFromJSONTyped,
|
|
20
20
|
ServiceAccessToJSON,
|
|
21
21
|
} from './ServiceAccess';
|
|
22
|
+
import type { UserAgreement } from './UserAgreement';
|
|
22
23
|
import {
|
|
23
|
-
UserAgreement,
|
|
24
24
|
UserAgreementFromJSON,
|
|
25
25
|
UserAgreementFromJSONTyped,
|
|
26
26
|
UserAgreementToJSON,
|
|
27
27
|
} from './UserAgreement';
|
|
28
|
+
import type { UserServiceAssociation } from './UserServiceAssociation';
|
|
28
29
|
import {
|
|
29
|
-
UserServiceAssociation,
|
|
30
30
|
UserServiceAssociationFromJSON,
|
|
31
31
|
UserServiceAssociationFromJSONTyped,
|
|
32
32
|
UserServiceAssociationToJSON,
|
|
33
33
|
} from './UserServiceAssociation';
|
|
34
|
+
import type { UserSsoProvider } from './UserSsoProvider';
|
|
34
35
|
import {
|
|
35
|
-
UserSsoProvider,
|
|
36
36
|
UserSsoProviderFromJSON,
|
|
37
37
|
UserSsoProviderFromJSONTyped,
|
|
38
38
|
UserSsoProviderToJSON,
|
|
39
39
|
} from './UserSsoProvider';
|
|
40
|
+
import type { UserState } from './UserState';
|
|
40
41
|
import {
|
|
41
|
-
UserState,
|
|
42
42
|
UserStateFromJSON,
|
|
43
43
|
UserStateFromJSONTyped,
|
|
44
44
|
UserStateToJSON,
|
|
@@ -190,6 +190,32 @@ export interface UserAccountSearchResult {
|
|
|
190
190
|
ssoIdentifier?: string | null;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Check if a given object implements the UserAccountSearchResult interface.
|
|
195
|
+
*/
|
|
196
|
+
export function instanceOfUserAccountSearchResult(value: object): boolean {
|
|
197
|
+
let isInstance = true;
|
|
198
|
+
isInstance = isInstance && "id" in value;
|
|
199
|
+
isInstance = isInstance && "uuid" in value;
|
|
200
|
+
isInstance = isInstance && "displayName" in value;
|
|
201
|
+
isInstance = isInstance && "sortName" in value;
|
|
202
|
+
isInstance = isInstance && "givenName" in value;
|
|
203
|
+
isInstance = isInstance && "familyName" in value;
|
|
204
|
+
isInstance = isInstance && "email" in value;
|
|
205
|
+
isInstance = isInstance && "locale" in value;
|
|
206
|
+
isInstance = isInstance && "state" in value;
|
|
207
|
+
isInstance = isInstance && "locked" in value;
|
|
208
|
+
isInstance = isInstance && "deletable" in value;
|
|
209
|
+
isInstance = isInstance && "billable" in value;
|
|
210
|
+
isInstance = isInstance && "agreement" in value;
|
|
211
|
+
isInstance = isInstance && "services" in value;
|
|
212
|
+
isInstance = isInstance && "servicesUsers" in value;
|
|
213
|
+
isInstance = isInstance && "legacyServices" in value;
|
|
214
|
+
isInstance = isInstance && "authType" in value;
|
|
215
|
+
|
|
216
|
+
return isInstance;
|
|
217
|
+
}
|
|
218
|
+
|
|
193
219
|
export function UserAccountSearchResultFromJSON(json: any): UserAccountSearchResult {
|
|
194
220
|
return UserAccountSearchResultFromJSONTyped(json, false);
|
|
195
221
|
}
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import type { UserAgreementState } from './UserAgreementState';
|
|
16
17
|
import {
|
|
17
|
-
UserAgreementState,
|
|
18
18
|
UserAgreementStateFromJSON,
|
|
19
19
|
UserAgreementStateFromJSONTyped,
|
|
20
20
|
UserAgreementStateToJSON,
|
|
@@ -34,6 +34,16 @@ export interface UserAgreement {
|
|
|
34
34
|
state: UserAgreementState;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Check if a given object implements the UserAgreement interface.
|
|
39
|
+
*/
|
|
40
|
+
export function instanceOfUserAgreement(value: object): boolean {
|
|
41
|
+
let isInstance = true;
|
|
42
|
+
isInstance = isInstance && "state" in value;
|
|
43
|
+
|
|
44
|
+
return isInstance;
|
|
45
|
+
}
|
|
46
|
+
|
|
37
47
|
export function UserAgreementFromJSON(json: any): UserAgreement {
|
|
38
48
|
return UserAgreementFromJSONTyped(json, false);
|
|
39
49
|
}
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
*/
|
|
22
22
|
export const UserAgreementState = {
|
|
23
23
|
ACCEPTED: 'ACCEPTED',
|
|
24
|
-
REQUESTED: 'REQUESTED'
|
|
24
|
+
REQUESTED: 'REQUESTED',
|
|
25
|
+
unknown_default_open_api: '11184809'
|
|
25
26
|
} as const;
|
|
26
27
|
export type UserAgreementState = typeof UserAgreementState[keyof typeof UserAgreementState];
|
|
27
28
|
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import { exists, mapValues } from '../runtime';
|
|
16
|
+
import type { LegacyRoleSchema } from './LegacyRoleSchema';
|
|
16
17
|
import {
|
|
17
|
-
LegacyRoleSchema,
|
|
18
18
|
LegacyRoleSchemaFromJSON,
|
|
19
19
|
LegacyRoleSchemaFromJSONTyped,
|
|
20
20
|
LegacyRoleSchemaToJSON,
|
|
21
21
|
} from './LegacyRoleSchema';
|
|
22
|
+
import type { RolesOnOrganization } from './RolesOnOrganization';
|
|
22
23
|
import {
|
|
23
|
-
RolesOnOrganization,
|
|
24
24
|
RolesOnOrganizationFromJSON,
|
|
25
25
|
RolesOnOrganizationFromJSONTyped,
|
|
26
26
|
RolesOnOrganizationToJSON,
|
|
@@ -46,6 +46,17 @@ export interface UserPermissions {
|
|
|
46
46
|
legacyRoles: Array<LegacyRoleSchema>;
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Check if a given object implements the UserPermissions interface.
|
|
51
|
+
*/
|
|
52
|
+
export function instanceOfUserPermissions(value: object): boolean {
|
|
53
|
+
let isInstance = true;
|
|
54
|
+
isInstance = isInstance && "organizations" in value;
|
|
55
|
+
isInstance = isInstance && "legacyRoles" in value;
|
|
56
|
+
|
|
57
|
+
return isInstance;
|
|
58
|
+
}
|
|
59
|
+
|
|
49
60
|
export function UserPermissionsFromJSON(json: any): UserPermissions {
|
|
50
61
|
return UserPermissionsFromJSONTyped(json, false);
|
|
51
62
|
}
|
|
@@ -45,6 +45,17 @@ export interface UserServiceAssociation {
|
|
|
45
45
|
options?: { [key: string]: string; } | null;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
/**
|
|
49
|
+
* Check if a given object implements the UserServiceAssociation interface.
|
|
50
|
+
*/
|
|
51
|
+
export function instanceOfUserServiceAssociation(value: object): boolean {
|
|
52
|
+
let isInstance = true;
|
|
53
|
+
isInstance = isInstance && "organizationUuid" in value;
|
|
54
|
+
isInstance = isInstance && "code" in value;
|
|
55
|
+
|
|
56
|
+
return isInstance;
|
|
57
|
+
}
|
|
58
|
+
|
|
48
59
|
export function UserServiceAssociationFromJSON(json: any): UserServiceAssociation {
|
|
49
60
|
return UserServiceAssociationFromJSONTyped(json, false);
|
|
50
61
|
}
|
|
@@ -27,6 +27,16 @@ export interface UserSsoProvider {
|
|
|
27
27
|
code: string;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the UserSsoProvider interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfUserSsoProvider(value: object): boolean {
|
|
34
|
+
let isInstance = true;
|
|
35
|
+
isInstance = isInstance && "code" in value;
|
|
36
|
+
|
|
37
|
+
return isInstance;
|
|
38
|
+
}
|
|
39
|
+
|
|
30
40
|
export function UserSsoProviderFromJSON(json: any): UserSsoProvider {
|
|
31
41
|
return UserSsoProviderFromJSONTyped(json, false);
|
|
32
42
|
}
|
package/src/models/UserState.ts
CHANGED
package/src/runtime.ts
CHANGED
|
@@ -113,7 +113,7 @@ export class BaseAPI {
|
|
|
113
113
|
return this.withMiddleware<T>(...middlewares);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
protected async request(context: RequestOpts, initOverrides?: RequestInit |
|
|
116
|
+
protected async request(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction): Promise<Response> {
|
|
117
117
|
const { url, init } = await this.createFetchParams(context, initOverrides);
|
|
118
118
|
const response = await this.fetchApi(url, init);
|
|
119
119
|
if (response.status >= 200 && response.status < 300) {
|
|
@@ -122,7 +122,7 @@ export class BaseAPI {
|
|
|
122
122
|
throw new ResponseError(response, 'Response returned an error code');
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
-
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit |
|
|
125
|
+
private async createFetchParams(context: RequestOpts, initOverrides?: RequestInit | InitOverrideFunction) {
|
|
126
126
|
let url = this.configuration.basePath + context.path;
|
|
127
127
|
if (context.query !== undefined && Object.keys(context.query).length !== 0) {
|
|
128
128
|
// only add the querystring to the URL if there are query parameters.
|
|
@@ -177,7 +177,25 @@ export class BaseAPI {
|
|
|
177
177
|
}) || fetchParams;
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
-
let response =
|
|
180
|
+
let response = undefined;
|
|
181
|
+
try {
|
|
182
|
+
response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
|
|
183
|
+
} catch (e) {
|
|
184
|
+
for (const middleware of this.middleware) {
|
|
185
|
+
if (middleware.onError) {
|
|
186
|
+
response = await middleware.onError({
|
|
187
|
+
fetch: this.fetchApi,
|
|
188
|
+
url: fetchParams.url,
|
|
189
|
+
init: fetchParams.init,
|
|
190
|
+
error: e,
|
|
191
|
+
response: response ? response.clone() : undefined,
|
|
192
|
+
}) || response;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (response !== undefined) {
|
|
196
|
+
throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response');
|
|
197
|
+
}
|
|
198
|
+
}
|
|
181
199
|
for (const middleware of this.middleware) {
|
|
182
200
|
if (middleware.post) {
|
|
183
201
|
response = await middleware.post({
|
|
@@ -218,6 +236,13 @@ export class ResponseError extends Error {
|
|
|
218
236
|
}
|
|
219
237
|
}
|
|
220
238
|
|
|
239
|
+
export class FetchError extends Error {
|
|
240
|
+
name: "FetchError" = "FetchError";
|
|
241
|
+
constructor(public cause: unknown, msg?: string) {
|
|
242
|
+
super(msg);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
|
|
221
246
|
export class RequiredError extends Error {
|
|
222
247
|
name: "RequiredError" = "RequiredError";
|
|
223
248
|
constructor(public field: string, msg?: string) {
|
|
@@ -242,7 +267,7 @@ export type HTTPBody = Json | FormData | URLSearchParams;
|
|
|
242
267
|
export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }
|
|
243
268
|
export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original';
|
|
244
269
|
|
|
245
|
-
export type
|
|
270
|
+
export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise<RequestInit>
|
|
246
271
|
|
|
247
272
|
export interface FetchParams {
|
|
248
273
|
url: string;
|
|
@@ -269,7 +294,7 @@ export function querystring(params: HTTPQuery, prefix: string = ''): string {
|
|
|
269
294
|
.join('&');
|
|
270
295
|
}
|
|
271
296
|
|
|
272
|
-
function querystringSingleKey(key: string, value: string | number | null | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
|
|
297
|
+
function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array<string | number | null | boolean> | Set<string | number | null | boolean> | HTTPQuery, keyPrefix: string = ''): string {
|
|
273
298
|
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
|
|
274
299
|
if (value instanceof Array) {
|
|
275
300
|
const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue)))
|
|
@@ -322,9 +347,18 @@ export interface ResponseContext {
|
|
|
322
347
|
response: Response;
|
|
323
348
|
}
|
|
324
349
|
|
|
350
|
+
export interface ErrorContext {
|
|
351
|
+
fetch: FetchAPI;
|
|
352
|
+
url: string;
|
|
353
|
+
init: RequestInit;
|
|
354
|
+
error: unknown;
|
|
355
|
+
response?: Response;
|
|
356
|
+
}
|
|
357
|
+
|
|
325
358
|
export interface Middleware {
|
|
326
359
|
pre?(context: RequestContext): Promise<FetchParams | void>;
|
|
327
360
|
post?(context: ResponseContext): Promise<Response | void>;
|
|
361
|
+
onError?(context: ErrorContext): Promise<Response | void>;
|
|
328
362
|
}
|
|
329
363
|
|
|
330
364
|
export interface ApiResponse<T> {
|