@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 @@
|
|
|
1
|
+
{"version":3,"file":"get-policy.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policies/get-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,oBAAoB,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,0BAA0B;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,OAAO,CAAC,eAAe,EAAE,MAAM,EAAE,CAAC;IACvE;;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,MAAM,EAAE;CAGjE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyListCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../utils/parse-response-helper.js");
|
|
6
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
7
|
+
const create_policy_js_1 = require("./create-policy.js"); // Reuse the Policy type definition
|
|
8
|
+
/**
|
|
9
|
+
* List policies
|
|
10
|
+
*/
|
|
11
|
+
class PolicyListCommand extends command_js_1.Command {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the command should retry on failure
|
|
14
|
+
*/
|
|
15
|
+
retryOnFailure = true;
|
|
16
|
+
/**
|
|
17
|
+
* Get the method
|
|
18
|
+
*/
|
|
19
|
+
getMethod() {
|
|
20
|
+
return "GET";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
getBaseUrl() {
|
|
26
|
+
return "https://iam.api.flowcore.io";
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Get the path
|
|
30
|
+
*/
|
|
31
|
+
getPath() {
|
|
32
|
+
return "/api/v1/policies/";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse the response
|
|
36
|
+
*/
|
|
37
|
+
parseResponse(rawResponse) {
|
|
38
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(create_policy_js_1.PolicySchema), rawResponse);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.PolicyListCommand = PolicyListCommand;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from "../../../../common/command.js";
|
|
2
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the policy archive command
|
|
5
|
+
*/
|
|
6
|
+
export interface PolicyArchiveInput {
|
|
7
|
+
/** The policy id */
|
|
8
|
+
policyId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* The schema for the archive policy response
|
|
12
|
+
*/
|
|
13
|
+
export declare const ArchivePolicyResponseSchema: TObject<{
|
|
14
|
+
message: TString;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* The archive policy response type
|
|
18
|
+
*/
|
|
19
|
+
export type ArchivePolicyResponse = Static<typeof ArchivePolicyResponseSchema>;
|
|
20
|
+
/**
|
|
21
|
+
* Archive a policy by ID
|
|
22
|
+
*/
|
|
23
|
+
export declare class PolicyArchiveCommand extends Command<PolicyArchiveInput, ArchivePolicyResponse> {
|
|
24
|
+
/**
|
|
25
|
+
* Whether the command should retry on failure
|
|
26
|
+
*/
|
|
27
|
+
protected retryOnFailure: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Get the method
|
|
30
|
+
*/
|
|
31
|
+
protected getMethod(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the base url
|
|
34
|
+
*/
|
|
35
|
+
protected getBaseUrl(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the path
|
|
38
|
+
*/
|
|
39
|
+
protected getPath(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
protected parseResponse(rawResponse: unknown): ArchivePolicyResponse;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=archive-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archive-policy.d.ts","sourceRoot":"","sources":["../../../../../src/commands/iam/policies/id/archive-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC;IAChD,OAAO,EAAE,OAAO,CAAA;CACjB,CAEC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE9E;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAC/C,kBAAkB,EAClB,qBAAqB,CACtB;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,aAAa,CAC9B,WAAW,EAAE,OAAO,GACnB,qBAAqB;CAGzB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyArchiveCommand = exports.ArchivePolicyResponseSchema = void 0;
|
|
4
|
+
const command_js_1 = require("../../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../../utils/parse-response-helper.js");
|
|
6
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
7
|
+
/**
|
|
8
|
+
* The schema for the archive policy response
|
|
9
|
+
*/
|
|
10
|
+
exports.ArchivePolicyResponseSchema = typebox_1.Type.Object({
|
|
11
|
+
message: typebox_1.Type.String(),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Archive a policy by ID
|
|
15
|
+
*/
|
|
16
|
+
class PolicyArchiveCommand extends command_js_1.Command {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the command should retry on failure
|
|
19
|
+
*/
|
|
20
|
+
retryOnFailure = false;
|
|
21
|
+
/**
|
|
22
|
+
* Get the method
|
|
23
|
+
*/
|
|
24
|
+
getMethod() {
|
|
25
|
+
return "DELETE";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the base url
|
|
29
|
+
*/
|
|
30
|
+
getBaseUrl() {
|
|
31
|
+
return "https://iam.api.flowcore.io";
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the path
|
|
35
|
+
*/
|
|
36
|
+
getPath() {
|
|
37
|
+
return `/api/v1/policies/${this.input.policyId}`;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Parse the response
|
|
41
|
+
*/
|
|
42
|
+
parseResponse(rawResponse) {
|
|
43
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(exports.ArchivePolicyResponseSchema, rawResponse);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.PolicyArchiveCommand = PolicyArchiveCommand;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Command } from "../../../../common/command.js";
|
|
2
|
+
import { type Policy } from "../create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the policy get command
|
|
5
|
+
*/
|
|
6
|
+
export interface PolicyGetInput {
|
|
7
|
+
/** The policy id */
|
|
8
|
+
policyId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Get a policy by ID
|
|
12
|
+
*/
|
|
13
|
+
export declare class PolicyGetCommand extends Command<PolicyGetInput, Policy> {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
protected retryOnFailure: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Create a new instance of the command
|
|
20
|
+
* @param policyId - The ID of the policy to get
|
|
21
|
+
*/
|
|
22
|
+
constructor(policyId: string);
|
|
23
|
+
/**
|
|
24
|
+
* Create a new instance of the command
|
|
25
|
+
* @param input - The input for the command
|
|
26
|
+
*/
|
|
27
|
+
constructor(input: PolicyGetInput);
|
|
28
|
+
/**
|
|
29
|
+
* Get the method
|
|
30
|
+
*/
|
|
31
|
+
protected getMethod(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Get the base url
|
|
34
|
+
*/
|
|
35
|
+
protected getBaseUrl(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Get the path
|
|
38
|
+
*/
|
|
39
|
+
protected getPath(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
protected parseResponse(rawResponse: unknown): Policy;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=get-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-policy.d.ts","sourceRoot":"","sources":["../../../../../src/commands/iam/policies/id/get-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,qBAAqB,CAAA;AAE/D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;IACnE;;OAEG;IACH,UAAmB,cAAc,UAAO;IAExC;;;OAGG;gBACS,QAAQ,EAAE,MAAM;IAC5B;;;OAGG;gBACS,KAAK,EAAE,cAAc;IAMjC;;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,MAAM;CAG/D"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyGetCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../../utils/parse-response-helper.js");
|
|
6
|
+
const create_policy_js_1 = require("../create-policy.js");
|
|
7
|
+
/**
|
|
8
|
+
* Get a policy by ID
|
|
9
|
+
*/
|
|
10
|
+
class PolicyGetCommand extends command_js_1.Command {
|
|
11
|
+
/**
|
|
12
|
+
* Whether the command should retry on failure
|
|
13
|
+
*/
|
|
14
|
+
retryOnFailure = true;
|
|
15
|
+
constructor(inputOrPolicyId) {
|
|
16
|
+
const input = typeof inputOrPolicyId === "string" ? { policyId: inputOrPolicyId } : inputOrPolicyId;
|
|
17
|
+
super(input);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Get the method
|
|
21
|
+
*/
|
|
22
|
+
getMethod() {
|
|
23
|
+
return "GET";
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Get the base url
|
|
27
|
+
*/
|
|
28
|
+
getBaseUrl() {
|
|
29
|
+
return "https://iam.api.flowcore.io";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Get the path
|
|
33
|
+
*/
|
|
34
|
+
getPath() {
|
|
35
|
+
return `/api/v1/policies/${this.input.policyId}`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Parse the response
|
|
39
|
+
*/
|
|
40
|
+
parseResponse(rawResponse) {
|
|
41
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(create_policy_js_1.PolicySchema, rawResponse);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.PolicyGetCommand = PolicyGetCommand;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "../../../../common/command.js";
|
|
2
|
+
import { type Policy, type PolicyStatement } from "../create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the policy update command
|
|
5
|
+
*/
|
|
6
|
+
export interface PolicyUpdateInput {
|
|
7
|
+
/** The policy id */
|
|
8
|
+
policyId: string;
|
|
9
|
+
/** The organization id */
|
|
10
|
+
organizationId: string;
|
|
11
|
+
/** The name of the policy */
|
|
12
|
+
name: string;
|
|
13
|
+
/** The version of the policy */
|
|
14
|
+
version: string;
|
|
15
|
+
/** The policy documents */
|
|
16
|
+
policyDocuments: PolicyStatement[];
|
|
17
|
+
/** The description of the policy */
|
|
18
|
+
description?: string;
|
|
19
|
+
/** The principal role that can access the resource */
|
|
20
|
+
principal?: string;
|
|
21
|
+
/** Whether the policy is managed by Flowcore */
|
|
22
|
+
flowcoreManaged?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update a policy by ID
|
|
26
|
+
*/
|
|
27
|
+
export declare class PolicyUpdateCommand extends Command<PolicyUpdateInput, Policy> {
|
|
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): Policy;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=update-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-policy.d.ts","sourceRoot":"","sources":["../../../../../src/commands/iam/policies/id/update-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAA;AAEvD,OAAO,EAAE,KAAK,MAAM,EAAgB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAErF;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;IACtB,6BAA6B;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,gCAAgC;IAChC,OAAO,EAAE,MAAM,CAAA;IACf,2BAA2B;IAC3B,eAAe,EAAE,eAAe,EAAE,CAAA;IAClC,oCAAoC;IACpC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gDAAgD;IAChD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACzE;;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;IAQrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM;CAG/D"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PolicyUpdateCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../../utils/parse-response-helper.js");
|
|
6
|
+
const create_policy_js_1 = require("../create-policy.js");
|
|
7
|
+
/**
|
|
8
|
+
* Update a policy by ID
|
|
9
|
+
*/
|
|
10
|
+
class PolicyUpdateCommand extends command_js_1.Command {
|
|
11
|
+
/**
|
|
12
|
+
* Whether the command should retry on failure
|
|
13
|
+
*/
|
|
14
|
+
retryOnFailure = false;
|
|
15
|
+
/**
|
|
16
|
+
* Get the method
|
|
17
|
+
*/
|
|
18
|
+
getMethod() {
|
|
19
|
+
return "PATCH";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get the base url
|
|
23
|
+
*/
|
|
24
|
+
getBaseUrl() {
|
|
25
|
+
return "https://iam.api.flowcore.io";
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get the path
|
|
29
|
+
*/
|
|
30
|
+
getPath() {
|
|
31
|
+
return `/api/v1/policies/${this.input.policyId}`;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Get the body
|
|
35
|
+
*/
|
|
36
|
+
getBody() {
|
|
37
|
+
const { ...rest } = this.input;
|
|
38
|
+
return {
|
|
39
|
+
...rest,
|
|
40
|
+
flowcoreManaged: rest.flowcoreManaged ?? false,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Parse the response
|
|
45
|
+
*/
|
|
46
|
+
parseResponse(rawResponse) {
|
|
47
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(create_policy_js_1.PolicySchema, rawResponse);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
exports.PolicyUpdateCommand = PolicyUpdateCommand;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Policy } from "../policies/create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the key policies command
|
|
5
|
+
*/
|
|
6
|
+
export interface KeyPoliciesInput {
|
|
7
|
+
/** The key id */
|
|
8
|
+
keyId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch policies for a key
|
|
12
|
+
*/
|
|
13
|
+
export declare class KeyPoliciesCommand extends Command<KeyPoliciesInput, Policy[]> {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
protected retryOnFailure: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the method
|
|
20
|
+
*/
|
|
21
|
+
protected getMethod(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
protected getBaseUrl(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the path
|
|
28
|
+
*/
|
|
29
|
+
protected getPath(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
protected parseResponse(rawResponse: unknown): Policy[];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=get-key-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-key-policies.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/get-key-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,8BAA8B,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;CACd;AAsED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,OAAO,CAAC,gBAAgB,EAAE,MAAM,EAAE,CAAC;IACzE;;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,MAAM,EAAE;CAGjE"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeyPoliciesCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../utils/parse-response-helper.js");
|
|
6
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
7
|
+
const create_policy_js_1 = require("../policies/create-policy.js");
|
|
8
|
+
/**
|
|
9
|
+
* Custom parser to handle non-boolean flowcoreManaged values
|
|
10
|
+
*/
|
|
11
|
+
const parseKeyPoliciesResponse = (rawResponse) => {
|
|
12
|
+
// Check if the response is null or undefined
|
|
13
|
+
if (!rawResponse) {
|
|
14
|
+
return [];
|
|
15
|
+
}
|
|
16
|
+
// Check if it's already an array
|
|
17
|
+
if (!Array.isArray(rawResponse)) {
|
|
18
|
+
// Check if it's wrapped in an object
|
|
19
|
+
if (typeof rawResponse === "object" && "data" in rawResponse) {
|
|
20
|
+
return parseKeyPoliciesResponse(rawResponse.data);
|
|
21
|
+
}
|
|
22
|
+
if (typeof rawResponse === "object" && "policies" in rawResponse) {
|
|
23
|
+
return parseKeyPoliciesResponse(rawResponse.policies);
|
|
24
|
+
}
|
|
25
|
+
return [];
|
|
26
|
+
}
|
|
27
|
+
try {
|
|
28
|
+
// First try standard parsing
|
|
29
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(create_policy_js_1.PolicySchema), rawResponse);
|
|
30
|
+
}
|
|
31
|
+
catch (error) {
|
|
32
|
+
// If there's an error, check if it's related to flowcoreManaged
|
|
33
|
+
if (error instanceof Error &&
|
|
34
|
+
error.message.includes("flowcoreManaged") &&
|
|
35
|
+
Array.isArray(rawResponse)) {
|
|
36
|
+
// Convert flowcoreManaged to boolean for each policy
|
|
37
|
+
const sanitizedPolicies = rawResponse.map((policy) => ({
|
|
38
|
+
...policy,
|
|
39
|
+
// Convert to boolean using double negation
|
|
40
|
+
flowcoreManaged: policy.flowcoreManaged === true || !!policy.flowcoreManaged,
|
|
41
|
+
}));
|
|
42
|
+
// Try parsing again with the sanitized data
|
|
43
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(create_policy_js_1.PolicySchema), sanitizedPolicies);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Fetch policies for a key
|
|
50
|
+
*/
|
|
51
|
+
class KeyPoliciesCommand extends command_js_1.Command {
|
|
52
|
+
/**
|
|
53
|
+
* Whether the command should retry on failure
|
|
54
|
+
*/
|
|
55
|
+
retryOnFailure = true;
|
|
56
|
+
/**
|
|
57
|
+
* Get the method
|
|
58
|
+
*/
|
|
59
|
+
getMethod() {
|
|
60
|
+
return "GET";
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get the base url
|
|
64
|
+
*/
|
|
65
|
+
getBaseUrl() {
|
|
66
|
+
return "https://iam.api.flowcore.io";
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get the path
|
|
70
|
+
*/
|
|
71
|
+
getPath() {
|
|
72
|
+
return `/api/v1/policy-associations/key/${this.input.keyId}/`;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Parse the response
|
|
76
|
+
*/
|
|
77
|
+
parseResponse(rawResponse) {
|
|
78
|
+
return parseKeyPoliciesResponse(rawResponse);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.KeyPoliciesCommand = KeyPoliciesCommand;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Policy } from "../policies/create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the organization policies command
|
|
5
|
+
*/
|
|
6
|
+
export interface OrganizationPoliciesInput {
|
|
7
|
+
/** The organization id */
|
|
8
|
+
organizationId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch policies for an organization
|
|
12
|
+
*/
|
|
13
|
+
export declare class OrganizationPoliciesCommand extends Command<OrganizationPoliciesInput, Policy[]> {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
protected retryOnFailure: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Get the method
|
|
20
|
+
*/
|
|
21
|
+
protected getMethod(): string;
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
protected getBaseUrl(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Get the path
|
|
28
|
+
*/
|
|
29
|
+
protected getPath(): string;
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
protected parseResponse(rawResponse: unknown): Policy[];
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=get-organization-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-organization-policies.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/get-organization-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,8BAA8B,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,0BAA0B;IAC1B,cAAc,EAAE,MAAM,CAAA;CACvB;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,OAAO,CACtD,yBAAyB,EACzB,MAAM,EAAE,CACT;IACC;;OAEG;IACH,UAAmB,cAAc,UAAO;IAExC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAItC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAUvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAQpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,EAAE;CAoCjE"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganizationPoliciesCommand = void 0;
|
|
4
|
+
const command_js_1 = require("../../../common/command.js");
|
|
5
|
+
const parse_response_helper_js_1 = require("../../../utils/parse-response-helper.js");
|
|
6
|
+
const typebox_1 = require("@sinclair/typebox");
|
|
7
|
+
const create_policy_js_1 = require("../policies/create-policy.js");
|
|
8
|
+
/**
|
|
9
|
+
* Fetch policies for an organization
|
|
10
|
+
*/
|
|
11
|
+
class OrganizationPoliciesCommand extends command_js_1.Command {
|
|
12
|
+
/**
|
|
13
|
+
* Whether the command should retry on failure
|
|
14
|
+
*/
|
|
15
|
+
retryOnFailure = true;
|
|
16
|
+
/**
|
|
17
|
+
* Get the method
|
|
18
|
+
*/
|
|
19
|
+
getMethod() {
|
|
20
|
+
return "GET";
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Get the base url
|
|
24
|
+
*/
|
|
25
|
+
getBaseUrl() {
|
|
26
|
+
// Use a proxy URL in development mode
|
|
27
|
+
// if (process.env.NODE_ENV === "development") {
|
|
28
|
+
// return typeof window === "undefined"
|
|
29
|
+
// ? "http://localhost:3000" // Server-side in dev
|
|
30
|
+
// : ""; // Client-side in dev (relative URL)
|
|
31
|
+
// }
|
|
32
|
+
return "https://iam.api.flowcore.io";
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get the path
|
|
36
|
+
*/
|
|
37
|
+
getPath() {
|
|
38
|
+
// Use the proxy API in development mode
|
|
39
|
+
// if (process.env.NODE_ENV === "development") {
|
|
40
|
+
// return `/api/proxy/iam/policy-associations/organization/${this.input.organizationId}`;
|
|
41
|
+
// }
|
|
42
|
+
return `/api/v1/policy-associations/organization/${this.input.organizationId}`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Parse the response
|
|
46
|
+
*/
|
|
47
|
+
parseResponse(rawResponse) {
|
|
48
|
+
try {
|
|
49
|
+
// Handle empty responses
|
|
50
|
+
if (!rawResponse) {
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
// If we get an array directly, try to parse each item
|
|
54
|
+
if (Array.isArray(rawResponse)) {
|
|
55
|
+
return rawResponse.map((item) => {
|
|
56
|
+
try {
|
|
57
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(create_policy_js_1.PolicySchema, item);
|
|
58
|
+
}
|
|
59
|
+
catch (_error) {
|
|
60
|
+
// Return a minimal valid policy object
|
|
61
|
+
return {
|
|
62
|
+
id: item.id || "unknown",
|
|
63
|
+
name: item.name || "Unknown Policy",
|
|
64
|
+
version: item.version || "1.0",
|
|
65
|
+
description: item.description || "",
|
|
66
|
+
flowcoreManaged: !!item.flowcoreManaged,
|
|
67
|
+
policyDocuments: item.policyDocuments || [],
|
|
68
|
+
organizationId: this.input.organizationId,
|
|
69
|
+
frn: item.frn ||
|
|
70
|
+
`frn::${this.input.organizationId}:policy/${item.id || "unknown"}`,
|
|
71
|
+
archived: item.archived === undefined ? false : !!item.archived,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Try the normal parsing
|
|
77
|
+
return (0, parse_response_helper_js_1.parseResponseHelper)(typebox_1.Type.Array(create_policy_js_1.PolicySchema), rawResponse);
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
throw error;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
exports.OrganizationPoliciesCommand = OrganizationPoliciesCommand;
|
|
@@ -0,0 +1,83 @@
|
|
|
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 policy-key association
|
|
5
|
+
*/
|
|
6
|
+
export declare const PolicyKeyAssociationSchema: TObject<{
|
|
7
|
+
policyId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
keyId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The schema for a policy-user association
|
|
13
|
+
*/
|
|
14
|
+
export declare const PolicyUserAssociationSchema: TObject<{
|
|
15
|
+
policyId: TString;
|
|
16
|
+
organizationId: TString;
|
|
17
|
+
userId: TString;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* The schema for a policy-role association
|
|
21
|
+
*/
|
|
22
|
+
export declare const PolicyRoleAssociationSchema: TObject<{
|
|
23
|
+
policyId: TString;
|
|
24
|
+
organizationId: TString;
|
|
25
|
+
roleId: TString;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* The schema for policy associations
|
|
29
|
+
*/
|
|
30
|
+
export declare const PolicyAssociationsSchema: TObject<{
|
|
31
|
+
keys: TArray<typeof PolicyKeyAssociationSchema>;
|
|
32
|
+
users: TArray<typeof PolicyUserAssociationSchema>;
|
|
33
|
+
roles: TArray<typeof PolicyRoleAssociationSchema>;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* The policy-key association type
|
|
37
|
+
*/
|
|
38
|
+
export type PolicyKeyAssociation = Static<typeof PolicyKeyAssociationSchema>;
|
|
39
|
+
/**
|
|
40
|
+
* The policy-user association type
|
|
41
|
+
*/
|
|
42
|
+
export type PolicyUserAssociation = Static<typeof PolicyUserAssociationSchema>;
|
|
43
|
+
/**
|
|
44
|
+
* The policy-role association type
|
|
45
|
+
*/
|
|
46
|
+
export type PolicyRoleAssociation = Static<typeof PolicyRoleAssociationSchema>;
|
|
47
|
+
/**
|
|
48
|
+
* The policy associations type
|
|
49
|
+
*/
|
|
50
|
+
export type PolicyAssociations = Static<typeof PolicyAssociationsSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* The input for the policy associations command
|
|
53
|
+
*/
|
|
54
|
+
export interface PolicyAssociationsInput {
|
|
55
|
+
/** The policy id */
|
|
56
|
+
policyId: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Fetch associations for a policy
|
|
60
|
+
*/
|
|
61
|
+
export declare class PolicyAssociationsCommand extends Command<PolicyAssociationsInput, PolicyAssociations> {
|
|
62
|
+
/**
|
|
63
|
+
* Whether the command should retry on failure
|
|
64
|
+
*/
|
|
65
|
+
protected retryOnFailure: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Get the method
|
|
68
|
+
*/
|
|
69
|
+
protected getMethod(): string;
|
|
70
|
+
/**
|
|
71
|
+
* Get the base url
|
|
72
|
+
*/
|
|
73
|
+
protected getBaseUrl(): string;
|
|
74
|
+
/**
|
|
75
|
+
* Get the path
|
|
76
|
+
*/
|
|
77
|
+
protected getPath(): string;
|
|
78
|
+
/**
|
|
79
|
+
* Parse the response
|
|
80
|
+
*/
|
|
81
|
+
protected parseResponse(rawResponse: unknown): PolicyAssociations;
|
|
82
|
+
}
|
|
83
|
+
//# sourceMappingURL=get-policy-associations.d.ts.map
|