@flowcore/sdk 1.50.0 → 1.52.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.
- package/CHANGELOG.md +16 -0
- package/esm/commands/adapter/reset-adapter.d.ts +2 -2
- package/esm/commands/adapter/reset-adapter.d.ts.map +1 -1
- package/esm/commands/adapter/reset-adapter.js +1 -1
- package/esm/commands/iam/permissions/get-user-permissions.d.ts +48 -0
- package/esm/commands/iam/permissions/get-user-permissions.d.ts.map +1 -0
- package/esm/commands/iam/permissions/get-user-permissions.js +45 -0
- package/esm/commands/iam/policies/create-policy.d.ts +89 -0
- package/esm/commands/iam/policies/create-policy.d.ts.map +1 -0
- package/esm/commands/iam/policies/create-policy.js +69 -0
- package/esm/commands/iam/policies/get-policy.d.ts +35 -0
- package/esm/commands/iam/policies/get-policy.d.ts.map +1 -0
- package/esm/commands/iam/policies/get-policy.js +37 -0
- package/esm/commands/iam/policies/id/archive-policy.d.ts +45 -0
- package/esm/commands/iam/policies/id/archive-policy.d.ts.map +1 -0
- package/esm/commands/iam/policies/id/archive-policy.js +42 -0
- package/esm/commands/iam/policies/id/get-policy.d.ts +45 -0
- package/esm/commands/iam/policies/id/get-policy.d.ts.map +1 -0
- package/esm/commands/iam/policies/id/get-policy.js +40 -0
- package/esm/commands/iam/policies/id/update-policy.d.ts +53 -0
- package/esm/commands/iam/policies/id/update-policy.d.ts.map +1 -0
- package/esm/commands/iam/policies/id/update-policy.js +46 -0
- package/esm/commands/iam/policy-associations/get-key-policies.d.ts +35 -0
- package/esm/commands/iam/policy-associations/get-key-policies.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/get-key-policies.js +77 -0
- package/esm/commands/iam/policy-associations/get-organization-policies.d.ts +35 -0
- package/esm/commands/iam/policy-associations/get-organization-policies.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/get-organization-policies.js +80 -0
- package/esm/commands/iam/policy-associations/get-policy-associations.d.ts +83 -0
- package/esm/commands/iam/policy-associations/get-policy-associations.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/get-policy-associations.js +109 -0
- package/esm/commands/iam/policy-associations/get-role-policies.d.ts +35 -0
- package/esm/commands/iam/policy-associations/get-role-policies.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/get-role-policies.js +65 -0
- package/esm/commands/iam/policy-associations/get-user-policies.d.ts +37 -0
- package/esm/commands/iam/policy-associations/get-user-policies.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/get-user-policies.js +37 -0
- package/esm/commands/iam/policy-associations/link-key-policy.d.ts +53 -0
- package/esm/commands/iam/policy-associations/link-key-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/link-key-policy.js +52 -0
- package/esm/commands/iam/policy-associations/link-role-policy.d.ts +53 -0
- package/esm/commands/iam/policy-associations/link-role-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/link-role-policy.js +52 -0
- package/esm/commands/iam/policy-associations/link-user-policy.d.ts +53 -0
- package/esm/commands/iam/policy-associations/link-user-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/link-user-policy.js +52 -0
- package/esm/commands/iam/policy-associations/unlink-key-policy.d.ts +41 -0
- package/esm/commands/iam/policy-associations/unlink-key-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/unlink-key-policy.js +44 -0
- package/esm/commands/iam/policy-associations/unlink-role-policy.d.ts +41 -0
- package/esm/commands/iam/policy-associations/unlink-role-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/unlink-role-policy.js +44 -0
- package/esm/commands/iam/policy-associations/unlink-user-policy.d.ts +41 -0
- package/esm/commands/iam/policy-associations/unlink-user-policy.d.ts.map +1 -0
- package/esm/commands/iam/policy-associations/unlink-user-policy.js +44 -0
- package/esm/commands/iam/role-associations/get-key-roles.d.ts +35 -0
- package/esm/commands/iam/role-associations/get-key-roles.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/get-key-roles.js +37 -0
- package/esm/commands/iam/role-associations/get-organization-roles.d.ts +35 -0
- package/esm/commands/iam/role-associations/get-organization-roles.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/get-organization-roles.js +54 -0
- package/esm/commands/iam/role-associations/get-role-associations.d.ts +70 -0
- package/esm/commands/iam/role-associations/get-role-associations.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/get-role-associations.js +59 -0
- package/esm/commands/iam/role-associations/get-user-roles.d.ts +37 -0
- package/esm/commands/iam/role-associations/get-user-roles.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/get-user-roles.js +42 -0
- package/esm/commands/iam/role-associations/link-key-role.d.ts +53 -0
- package/esm/commands/iam/role-associations/link-key-role.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/link-key-role.js +52 -0
- package/esm/commands/iam/role-associations/link-user-role.d.ts +53 -0
- package/esm/commands/iam/role-associations/link-user-role.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/link-user-role.js +52 -0
- package/esm/commands/iam/role-associations/unlink-key-role.d.ts +41 -0
- package/esm/commands/iam/role-associations/unlink-key-role.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/unlink-key-role.js +44 -0
- package/esm/commands/iam/role-associations/unlink-user-role.d.ts +41 -0
- package/esm/commands/iam/role-associations/unlink-user-role.d.ts.map +1 -0
- package/esm/commands/iam/role-associations/unlink-user-role.js +44 -0
- package/esm/commands/iam/roles/create-role.d.ts +60 -0
- package/esm/commands/iam/roles/create-role.d.ts.map +1 -0
- package/esm/commands/iam/roles/create-role.js +56 -0
- package/esm/commands/iam/roles/get-roles.d.ts +35 -0
- package/esm/commands/iam/roles/get-roles.d.ts.map +1 -0
- package/esm/commands/iam/roles/get-roles.js +37 -0
- package/esm/commands/iam/roles/id/archive-role.d.ts +45 -0
- package/esm/commands/iam/roles/id/archive-role.d.ts.map +1 -0
- package/esm/commands/iam/roles/id/archive-role.js +42 -0
- package/esm/commands/iam/roles/id/get-role.d.ts +35 -0
- package/esm/commands/iam/roles/id/get-role.d.ts.map +1 -0
- package/esm/commands/iam/roles/id/get-role.js +36 -0
- package/esm/commands/iam/roles/id/update-role.d.ts +47 -0
- package/esm/commands/iam/roles/id/update-role.d.ts.map +1 -0
- package/esm/commands/iam/roles/id/update-role.js +47 -0
- package/esm/commands/iam/tenant-iam-audit/get-audit-for-tenant.d.ts +88 -0
- package/esm/commands/iam/tenant-iam-audit/get-audit-for-tenant.d.ts.map +1 -0
- package/esm/commands/iam/tenant-iam-audit/get-audit-for-tenant.js +102 -0
- package/esm/commands/iam/validate/validate-key.d.ts +43 -0
- package/esm/commands/iam/validate/validate-key.d.ts.map +1 -0
- package/esm/commands/iam/validate/validate-key.js +43 -0
- package/esm/commands/iam/validate/validate-user.d.ts +77 -0
- package/esm/commands/iam/validate/validate-user.d.ts.map +1 -0
- package/esm/commands/iam/validate/validate-user.js +58 -0
- package/esm/commands/index.d.ts +33 -0
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +34 -0
- package/package.json +1 -1
- package/script/commands/adapter/reset-adapter.d.ts +2 -2
- package/script/commands/adapter/reset-adapter.d.ts.map +1 -1
- package/script/commands/adapter/reset-adapter.js +2 -2
- package/script/commands/iam/permissions/get-user-permissions.d.ts +48 -0
- package/script/commands/iam/permissions/get-user-permissions.d.ts.map +1 -0
- package/script/commands/iam/permissions/get-user-permissions.js +49 -0
- package/script/commands/iam/policies/create-policy.d.ts +89 -0
- package/script/commands/iam/policies/create-policy.d.ts.map +1 -0
- package/script/commands/iam/policies/create-policy.js +73 -0
- package/script/commands/iam/policies/get-policy.d.ts +35 -0
- package/script/commands/iam/policies/get-policy.d.ts.map +1 -0
- package/script/commands/iam/policies/get-policy.js +41 -0
- package/script/commands/iam/policies/id/archive-policy.d.ts +45 -0
- package/script/commands/iam/policies/id/archive-policy.d.ts.map +1 -0
- package/script/commands/iam/policies/id/archive-policy.js +46 -0
- package/script/commands/iam/policies/id/get-policy.d.ts +45 -0
- package/script/commands/iam/policies/id/get-policy.d.ts.map +1 -0
- package/script/commands/iam/policies/id/get-policy.js +44 -0
- package/script/commands/iam/policies/id/update-policy.d.ts +53 -0
- package/script/commands/iam/policies/id/update-policy.d.ts.map +1 -0
- package/script/commands/iam/policies/id/update-policy.js +50 -0
- package/script/commands/iam/policy-associations/get-key-policies.d.ts +35 -0
- package/script/commands/iam/policy-associations/get-key-policies.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/get-key-policies.js +81 -0
- package/script/commands/iam/policy-associations/get-organization-policies.d.ts +35 -0
- package/script/commands/iam/policy-associations/get-organization-policies.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/get-organization-policies.js +84 -0
- package/script/commands/iam/policy-associations/get-policy-associations.d.ts +83 -0
- package/script/commands/iam/policy-associations/get-policy-associations.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/get-policy-associations.js +113 -0
- package/script/commands/iam/policy-associations/get-role-policies.d.ts +35 -0
- package/script/commands/iam/policy-associations/get-role-policies.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/get-role-policies.js +69 -0
- package/script/commands/iam/policy-associations/get-user-policies.d.ts +37 -0
- package/script/commands/iam/policy-associations/get-user-policies.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/get-user-policies.js +41 -0
- package/script/commands/iam/policy-associations/link-key-policy.d.ts +53 -0
- package/script/commands/iam/policy-associations/link-key-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/link-key-policy.js +56 -0
- package/script/commands/iam/policy-associations/link-role-policy.d.ts +53 -0
- package/script/commands/iam/policy-associations/link-role-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/link-role-policy.js +56 -0
- package/script/commands/iam/policy-associations/link-user-policy.d.ts +53 -0
- package/script/commands/iam/policy-associations/link-user-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/link-user-policy.js +56 -0
- package/script/commands/iam/policy-associations/unlink-key-policy.d.ts +41 -0
- package/script/commands/iam/policy-associations/unlink-key-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/unlink-key-policy.js +48 -0
- package/script/commands/iam/policy-associations/unlink-role-policy.d.ts +41 -0
- package/script/commands/iam/policy-associations/unlink-role-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/unlink-role-policy.js +48 -0
- package/script/commands/iam/policy-associations/unlink-user-policy.d.ts +41 -0
- package/script/commands/iam/policy-associations/unlink-user-policy.d.ts.map +1 -0
- package/script/commands/iam/policy-associations/unlink-user-policy.js +48 -0
- package/script/commands/iam/role-associations/get-key-roles.d.ts +35 -0
- package/script/commands/iam/role-associations/get-key-roles.d.ts.map +1 -0
- package/script/commands/iam/role-associations/get-key-roles.js +41 -0
- package/script/commands/iam/role-associations/get-organization-roles.d.ts +35 -0
- package/script/commands/iam/role-associations/get-organization-roles.d.ts.map +1 -0
- package/script/commands/iam/role-associations/get-organization-roles.js +58 -0
- package/script/commands/iam/role-associations/get-role-associations.d.ts +70 -0
- package/script/commands/iam/role-associations/get-role-associations.d.ts.map +1 -0
- package/script/commands/iam/role-associations/get-role-associations.js +63 -0
- package/script/commands/iam/role-associations/get-user-roles.d.ts +37 -0
- package/script/commands/iam/role-associations/get-user-roles.d.ts.map +1 -0
- package/script/commands/iam/role-associations/get-user-roles.js +46 -0
- package/script/commands/iam/role-associations/link-key-role.d.ts +53 -0
- package/script/commands/iam/role-associations/link-key-role.d.ts.map +1 -0
- package/script/commands/iam/role-associations/link-key-role.js +56 -0
- package/script/commands/iam/role-associations/link-user-role.d.ts +53 -0
- package/script/commands/iam/role-associations/link-user-role.d.ts.map +1 -0
- package/script/commands/iam/role-associations/link-user-role.js +56 -0
- package/script/commands/iam/role-associations/unlink-key-role.d.ts +41 -0
- package/script/commands/iam/role-associations/unlink-key-role.d.ts.map +1 -0
- package/script/commands/iam/role-associations/unlink-key-role.js +48 -0
- package/script/commands/iam/role-associations/unlink-user-role.d.ts +41 -0
- package/script/commands/iam/role-associations/unlink-user-role.d.ts.map +1 -0
- package/script/commands/iam/role-associations/unlink-user-role.js +48 -0
- package/script/commands/iam/roles/create-role.d.ts +60 -0
- package/script/commands/iam/roles/create-role.d.ts.map +1 -0
- package/script/commands/iam/roles/create-role.js +60 -0
- package/script/commands/iam/roles/get-roles.d.ts +35 -0
- package/script/commands/iam/roles/get-roles.d.ts.map +1 -0
- package/script/commands/iam/roles/get-roles.js +41 -0
- package/script/commands/iam/roles/id/archive-role.d.ts +45 -0
- package/script/commands/iam/roles/id/archive-role.d.ts.map +1 -0
- package/script/commands/iam/roles/id/archive-role.js +46 -0
- package/script/commands/iam/roles/id/get-role.d.ts +35 -0
- package/script/commands/iam/roles/id/get-role.d.ts.map +1 -0
- package/script/commands/iam/roles/id/get-role.js +40 -0
- package/script/commands/iam/roles/id/update-role.d.ts +47 -0
- package/script/commands/iam/roles/id/update-role.d.ts.map +1 -0
- package/script/commands/iam/roles/id/update-role.js +51 -0
- package/script/commands/iam/tenant-iam-audit/get-audit-for-tenant.d.ts +88 -0
- package/script/commands/iam/tenant-iam-audit/get-audit-for-tenant.d.ts.map +1 -0
- package/script/commands/iam/tenant-iam-audit/get-audit-for-tenant.js +106 -0
- package/script/commands/iam/validate/validate-key.d.ts +43 -0
- package/script/commands/iam/validate/validate-key.d.ts.map +1 -0
- package/script/commands/iam/validate/validate-key.js +47 -0
- package/script/commands/iam/validate/validate-user.d.ts +77 -0
- package/script/commands/iam/validate/validate-user.d.ts.map +1 -0
- package/script/commands/iam/validate/validate-user.js +62 -0
- package/script/commands/index.d.ts +33 -0
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +34 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
// More flexible schema for API responses that might have missing archived field
|
|
5
|
+
const FlexibleRoleSchema = Type.Object({
|
|
6
|
+
id: Type.String(),
|
|
7
|
+
organizationId: Type.String(),
|
|
8
|
+
name: Type.String(),
|
|
9
|
+
description: Type.Optional(Type.String()),
|
|
10
|
+
flowcoreManaged: Type.Boolean(),
|
|
11
|
+
archived: Type.Optional(Type.Boolean()),
|
|
12
|
+
frn: Type.String(),
|
|
13
|
+
createdAt: Type.Optional(Type.String()),
|
|
14
|
+
updatedAt: Type.Optional(Type.String()),
|
|
15
|
+
});
|
|
16
|
+
/**
|
|
17
|
+
* Fetch roles for an organization
|
|
18
|
+
*/
|
|
19
|
+
export class OrganizationRolesCommand extends Command {
|
|
20
|
+
/**
|
|
21
|
+
* Whether the command should retry on failure
|
|
22
|
+
*/
|
|
23
|
+
retryOnFailure = true;
|
|
24
|
+
/**
|
|
25
|
+
* Get the method
|
|
26
|
+
*/
|
|
27
|
+
getMethod() {
|
|
28
|
+
return "GET";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the base url
|
|
32
|
+
*/
|
|
33
|
+
getBaseUrl() {
|
|
34
|
+
return "https://iam.api.flowcore.io";
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Get the path
|
|
38
|
+
*/
|
|
39
|
+
getPath() {
|
|
40
|
+
return `/api/v1/role-associations/organization/${this.input.organizationId}`;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Parse the response
|
|
44
|
+
*/
|
|
45
|
+
parseResponse(rawResponse) {
|
|
46
|
+
// Use the flexible schema to parse the response
|
|
47
|
+
const flexibleRoles = parseResponseHelper(Type.Array(FlexibleRoleSchema), rawResponse);
|
|
48
|
+
// Convert to the expected Role type by ensuring archived is a boolean
|
|
49
|
+
return flexibleRoles.map((role) => ({
|
|
50
|
+
...role,
|
|
51
|
+
archived: role.archived !== undefined ? role.archived : false,
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Static, type TArray, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a role-key association
|
|
5
|
+
*/
|
|
6
|
+
export declare const RoleKeyAssociationSchema: TObject<{
|
|
7
|
+
roleId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
keyId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The schema for a role-user association
|
|
13
|
+
*/
|
|
14
|
+
export declare const RoleUserAssociationSchema: TObject<{
|
|
15
|
+
roleId: TString;
|
|
16
|
+
organizationId: TString;
|
|
17
|
+
userId: TString;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* The schema for role associations
|
|
21
|
+
*/
|
|
22
|
+
export declare const RoleAssociationsSchema: TObject<{
|
|
23
|
+
keys: TArray<typeof RoleKeyAssociationSchema>;
|
|
24
|
+
users: TArray<typeof RoleUserAssociationSchema>;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* The role-key association type
|
|
28
|
+
*/
|
|
29
|
+
export type RoleKeyAssociation = Static<typeof RoleKeyAssociationSchema>;
|
|
30
|
+
/**
|
|
31
|
+
* The role-user association type
|
|
32
|
+
*/
|
|
33
|
+
export type RoleUserAssociation = Static<typeof RoleUserAssociationSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* The role associations type
|
|
36
|
+
*/
|
|
37
|
+
export type RoleAssociations = Static<typeof RoleAssociationsSchema>;
|
|
38
|
+
/**
|
|
39
|
+
* The input for the role associations command
|
|
40
|
+
*/
|
|
41
|
+
export interface RoleAssociationsInput {
|
|
42
|
+
/** The role id */
|
|
43
|
+
roleId: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Fetch associations for a role
|
|
47
|
+
*/
|
|
48
|
+
export declare class RoleAssociationsCommand extends Command<RoleAssociationsInput, RoleAssociations> {
|
|
49
|
+
/**
|
|
50
|
+
* Whether the command should retry on failure
|
|
51
|
+
*/
|
|
52
|
+
protected retryOnFailure: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Get the method
|
|
55
|
+
*/
|
|
56
|
+
protected getMethod(): string;
|
|
57
|
+
/**
|
|
58
|
+
* Get the base url
|
|
59
|
+
*/
|
|
60
|
+
protected getBaseUrl(): string;
|
|
61
|
+
/**
|
|
62
|
+
* Get the path
|
|
63
|
+
*/
|
|
64
|
+
protected getPath(): string;
|
|
65
|
+
/**
|
|
66
|
+
* Parse the response
|
|
67
|
+
*/
|
|
68
|
+
protected parseResponse(rawResponse: unknown): RoleAssociations;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=get-role-associations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-role-associations.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/get-role-associations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAE9F;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC;IAC7C,MAAM,EAAE,OAAO,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;CACf,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,OAAO,CAAC;IAC9C,MAAM,EAAE,OAAO,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,OAAO,CAAC;IAC3C,IAAI,EAAE,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;IAC7C,KAAK,EAAE,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;CAChD,CAGC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAExE;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAE1E;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAEpE;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,OAAO,CAClD,qBAAqB,EACrB,gBAAgB,CACjB;IACC;;OAEG;IACH,UAAmB,cAAc,UAAO;IAExC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,gBAAgB;CAGzE"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
/**
|
|
5
|
+
* The schema for a role-key association
|
|
6
|
+
*/
|
|
7
|
+
export const RoleKeyAssociationSchema = Type.Object({
|
|
8
|
+
roleId: Type.String(),
|
|
9
|
+
organizationId: Type.String(),
|
|
10
|
+
keyId: Type.String(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* The schema for a role-user association
|
|
14
|
+
*/
|
|
15
|
+
export const RoleUserAssociationSchema = Type.Object({
|
|
16
|
+
roleId: Type.String(),
|
|
17
|
+
organizationId: Type.String(),
|
|
18
|
+
userId: Type.String(),
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* The schema for role associations
|
|
22
|
+
*/
|
|
23
|
+
export const RoleAssociationsSchema = Type.Object({
|
|
24
|
+
keys: Type.Array(RoleKeyAssociationSchema),
|
|
25
|
+
users: Type.Array(RoleUserAssociationSchema),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* Fetch associations for a role
|
|
29
|
+
*/
|
|
30
|
+
export class RoleAssociationsCommand extends Command {
|
|
31
|
+
/**
|
|
32
|
+
* Whether the command should retry on failure
|
|
33
|
+
*/
|
|
34
|
+
retryOnFailure = true;
|
|
35
|
+
/**
|
|
36
|
+
* Get the method
|
|
37
|
+
*/
|
|
38
|
+
getMethod() {
|
|
39
|
+
return "GET";
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Get the base url
|
|
43
|
+
*/
|
|
44
|
+
getBaseUrl() {
|
|
45
|
+
return "https://iam.api.flowcore.io";
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Get the path
|
|
49
|
+
*/
|
|
50
|
+
getPath() {
|
|
51
|
+
return `/api/v1/role-associations/${this.input.roleId}`;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Parse the response
|
|
55
|
+
*/
|
|
56
|
+
parseResponse(rawResponse) {
|
|
57
|
+
return parseResponseHelper(RoleAssociationsSchema, rawResponse);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Role } from "../roles/create-role.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the user roles command
|
|
5
|
+
*/
|
|
6
|
+
export interface UserRolesInput {
|
|
7
|
+
/** The user id */
|
|
8
|
+
userId: string;
|
|
9
|
+
/** The optional organization id */
|
|
10
|
+
organizationId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fetch roles for a user
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserRolesCommand extends Command<UserRolesInput, Role[]> {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
protected retryOnFailure: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Parse the response
|
|
34
|
+
*/
|
|
35
|
+
protected parseResponse(rawResponse: unknown): Role[];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=get-user-roles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-roles.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/get-user-roles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,OAAO,EAAE,KAAK,IAAI,EAAc,MAAM,yBAAyB,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE,CAAC;IACnE;;OAEG;IACH,UAAmB,cAAc,UAAO;IAExC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IASpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,IAAI,EAAE;CAG/D"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
import { RoleSchema } from "../roles/create-role.js";
|
|
5
|
+
/**
|
|
6
|
+
* Fetch roles for a user
|
|
7
|
+
*/
|
|
8
|
+
export class UserRolesCommand extends Command {
|
|
9
|
+
/**
|
|
10
|
+
* Whether the command should retry on failure
|
|
11
|
+
*/
|
|
12
|
+
retryOnFailure = true;
|
|
13
|
+
/**
|
|
14
|
+
* Get the method
|
|
15
|
+
*/
|
|
16
|
+
getMethod() {
|
|
17
|
+
return "GET";
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the base url
|
|
21
|
+
*/
|
|
22
|
+
getBaseUrl() {
|
|
23
|
+
return "https://iam.api.flowcore.io";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the path
|
|
27
|
+
*/
|
|
28
|
+
getPath() {
|
|
29
|
+
const basePath = `/api/v1/role-associations/user/${this.input.userId}/`;
|
|
30
|
+
// Add organizationId directly to the URL as a query parameter if provided
|
|
31
|
+
if (this.input.organizationId) {
|
|
32
|
+
return `${basePath}?organizationId=${this.input.organizationId}`;
|
|
33
|
+
}
|
|
34
|
+
return basePath;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
parseResponse(rawResponse) {
|
|
40
|
+
return parseResponseHelper(Type.Array(RoleSchema), rawResponse);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a key role link response
|
|
5
|
+
*/
|
|
6
|
+
export declare const KeyRoleLinkSchema: TObject<{
|
|
7
|
+
roleId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
keyId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The key role link response type
|
|
13
|
+
*/
|
|
14
|
+
export type KeyRoleLink = Static<typeof KeyRoleLinkSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The input for the link key role command
|
|
17
|
+
*/
|
|
18
|
+
export interface LinkKeyRoleInput {
|
|
19
|
+
/** The key id */
|
|
20
|
+
keyId: string;
|
|
21
|
+
/** The role id */
|
|
22
|
+
roleId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Link a role to a key
|
|
26
|
+
*/
|
|
27
|
+
export declare class LinkKeyRoleCommand extends Command<LinkKeyRoleInput, KeyRoleLink> {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the command should retry on failure
|
|
30
|
+
*/
|
|
31
|
+
protected retryOnFailure: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the method
|
|
34
|
+
*/
|
|
35
|
+
protected getMethod(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the base url
|
|
38
|
+
*/
|
|
39
|
+
protected getBaseUrl(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the path
|
|
42
|
+
*/
|
|
43
|
+
protected getPath(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get the body
|
|
46
|
+
*/
|
|
47
|
+
protected getBody(): Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* Parse the response
|
|
50
|
+
*/
|
|
51
|
+
protected parseResponse(rawResponse: unknown): KeyRoleLink;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=link-key-role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-key-role.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/link-key-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,iBAAiB,EAAE,OAAO,CAAC;IACtC,MAAM,EAAE,OAAO,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;CACf,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE1D;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,gBAAgB,EAAE,WAAW,CAAC;IAC5E;;OAEG;IACH,UAAmB,cAAc,UAAQ;IAEzC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW;CAGpE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
/**
|
|
5
|
+
* The schema for a key role link response
|
|
6
|
+
*/
|
|
7
|
+
export const KeyRoleLinkSchema = Type.Object({
|
|
8
|
+
roleId: Type.String(),
|
|
9
|
+
organizationId: Type.String(),
|
|
10
|
+
keyId: Type.String(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Link a role to a key
|
|
14
|
+
*/
|
|
15
|
+
export class LinkKeyRoleCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
retryOnFailure = false;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
getMethod() {
|
|
24
|
+
return "POST";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
getBaseUrl() {
|
|
30
|
+
return "https://iam.api.flowcore.io";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
getPath() {
|
|
36
|
+
return `/api/v1/role-associations/key/${this.input.keyId}/`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the body
|
|
40
|
+
*/
|
|
41
|
+
getBody() {
|
|
42
|
+
return {
|
|
43
|
+
roleId: this.input.roleId,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse the response
|
|
48
|
+
*/
|
|
49
|
+
parseResponse(rawResponse) {
|
|
50
|
+
return parseResponseHelper(KeyRoleLinkSchema, rawResponse);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a user role link response
|
|
5
|
+
*/
|
|
6
|
+
export declare const UserRoleLinkSchema: TObject<{
|
|
7
|
+
roleId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
userId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The user role link response type
|
|
13
|
+
*/
|
|
14
|
+
export type UserRoleLink = Static<typeof UserRoleLinkSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The input for the link user role command
|
|
17
|
+
*/
|
|
18
|
+
export interface LinkUserRoleInput {
|
|
19
|
+
/** The user id */
|
|
20
|
+
userId: string;
|
|
21
|
+
/** The role id */
|
|
22
|
+
roleId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Link a role to a user
|
|
26
|
+
*/
|
|
27
|
+
export declare class LinkUserRoleCommand extends Command<LinkUserRoleInput, UserRoleLink> {
|
|
28
|
+
/**
|
|
29
|
+
* Whether the command should retry on failure
|
|
30
|
+
*/
|
|
31
|
+
protected retryOnFailure: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Get the method
|
|
34
|
+
*/
|
|
35
|
+
protected getMethod(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the base url
|
|
38
|
+
*/
|
|
39
|
+
protected getBaseUrl(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get the path
|
|
42
|
+
*/
|
|
43
|
+
protected getPath(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Get the body
|
|
46
|
+
*/
|
|
47
|
+
protected getBody(): Record<string, unknown>;
|
|
48
|
+
/**
|
|
49
|
+
* Parse the response
|
|
50
|
+
*/
|
|
51
|
+
protected parseResponse(rawResponse: unknown): UserRoleLink;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=link-user-role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-user-role.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/link-user-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC;IACvC,MAAM,EAAE,OAAO,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE5D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAC9C,iBAAiB,EACjB,YAAY,CACb;IACC;;OAEG;IACH,UAAmB,cAAc,UAAQ;IAEzC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,YAAY;CAGrE"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
/**
|
|
5
|
+
* The schema for a user role link response
|
|
6
|
+
*/
|
|
7
|
+
export const UserRoleLinkSchema = Type.Object({
|
|
8
|
+
roleId: Type.String(),
|
|
9
|
+
organizationId: Type.String(),
|
|
10
|
+
userId: Type.String(),
|
|
11
|
+
});
|
|
12
|
+
/**
|
|
13
|
+
* Link a role to a user
|
|
14
|
+
*/
|
|
15
|
+
export class LinkUserRoleCommand extends Command {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
retryOnFailure = false;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
getMethod() {
|
|
24
|
+
return "POST";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get the base url
|
|
28
|
+
*/
|
|
29
|
+
getBaseUrl() {
|
|
30
|
+
return "https://iam.api.flowcore.io";
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Get the path
|
|
34
|
+
*/
|
|
35
|
+
getPath() {
|
|
36
|
+
return `/api/v1/role-associations/user/${this.input.userId}/`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Get the body
|
|
40
|
+
*/
|
|
41
|
+
getBody() {
|
|
42
|
+
return {
|
|
43
|
+
roleId: this.input.roleId,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse the response
|
|
48
|
+
*/
|
|
49
|
+
parseResponse(rawResponse) {
|
|
50
|
+
return parseResponseHelper(UserRoleLinkSchema, rawResponse);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type KeyRoleLink } from "./link-key-role.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the unlink key role command
|
|
5
|
+
*/
|
|
6
|
+
export interface UnlinkKeyRoleInput {
|
|
7
|
+
/** The key id */
|
|
8
|
+
keyId: string;
|
|
9
|
+
/** The role id */
|
|
10
|
+
roleId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Unlink a role from a key
|
|
14
|
+
*/
|
|
15
|
+
export declare class UnlinkKeyRoleCommand extends Command<UnlinkKeyRoleInput, KeyRoleLink> {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
protected retryOnFailure: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the body
|
|
34
|
+
*/
|
|
35
|
+
protected getBody(): Record<string, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
protected parseResponse(rawResponse: unknown): KeyRoleLink;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unlink-key-role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlink-key-role.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/unlink-key-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,oBAAoB,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAC/C,kBAAkB,EAClB,WAAW,CACZ;IACC;;OAEG;IACH,UAAmB,cAAc,UAAQ;IAEzC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,WAAW;CAGpE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { KeyRoleLinkSchema } from "./link-key-role.js";
|
|
4
|
+
/**
|
|
5
|
+
* Unlink a role from a key
|
|
6
|
+
*/
|
|
7
|
+
export class UnlinkKeyRoleCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the command should retry on failure
|
|
10
|
+
*/
|
|
11
|
+
retryOnFailure = false;
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "DELETE";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the base url
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://iam.api.flowcore.io";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the path
|
|
26
|
+
*/
|
|
27
|
+
getPath() {
|
|
28
|
+
return `/api/v1/role-associations/key/${this.input.keyId}/`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the body
|
|
32
|
+
*/
|
|
33
|
+
getBody() {
|
|
34
|
+
return {
|
|
35
|
+
roleId: this.input.roleId,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
return parseResponseHelper(KeyRoleLinkSchema, rawResponse);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type UserRoleLink } from "./link-user-role.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the unlink user role command
|
|
5
|
+
*/
|
|
6
|
+
export interface UnlinkUserRoleInput {
|
|
7
|
+
/** The user id */
|
|
8
|
+
userId: string;
|
|
9
|
+
/** The role id */
|
|
10
|
+
roleId: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Unlink a role from a user
|
|
14
|
+
*/
|
|
15
|
+
export declare class UnlinkUserRoleCommand extends Command<UnlinkUserRoleInput, UserRoleLink> {
|
|
16
|
+
/**
|
|
17
|
+
* Whether the command should retry on failure
|
|
18
|
+
*/
|
|
19
|
+
protected retryOnFailure: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Get the method
|
|
22
|
+
*/
|
|
23
|
+
protected getMethod(): string;
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
protected getBaseUrl(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
protected getPath(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the body
|
|
34
|
+
*/
|
|
35
|
+
protected getBody(): Record<string, unknown>;
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
protected parseResponse(rawResponse: unknown): UserRoleLink;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=unlink-user-role.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unlink-user-role.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/role-associations/unlink-user-role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EAAE,KAAK,YAAY,EAAsB,MAAM,qBAAqB,CAAA;AAE3E;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAChD,mBAAmB,EACnB,YAAY,CACb;IACC;;OAEG;IACH,UAAmB,cAAc,UAAQ;IAEzC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,OAAO,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAMrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,YAAY;CAGrE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { UserRoleLinkSchema } from "./link-user-role.js";
|
|
4
|
+
/**
|
|
5
|
+
* Unlink a role from a user
|
|
6
|
+
*/
|
|
7
|
+
export class UnlinkUserRoleCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the command should retry on failure
|
|
10
|
+
*/
|
|
11
|
+
retryOnFailure = false;
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "DELETE";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the base url
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
return "https://iam.api.flowcore.io";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the path
|
|
26
|
+
*/
|
|
27
|
+
getPath() {
|
|
28
|
+
return `/api/v1/role-associations/user/${this.input.userId}/`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the body
|
|
32
|
+
*/
|
|
33
|
+
getBody() {
|
|
34
|
+
return {
|
|
35
|
+
roleId: this.input.roleId,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Parse the response
|
|
40
|
+
*/
|
|
41
|
+
parseResponse(rawResponse) {
|
|
42
|
+
return parseResponseHelper(UserRoleLinkSchema, rawResponse);
|
|
43
|
+
}
|
|
44
|
+
}
|