@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.52.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.51.0...v1.52.0) (2025-06-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add period to make release please happen ([a566202](https://github.com/flowcore-io/flowcore-sdk/commit/a56620263c67b1d7b0e943416310d59fb59fbb49))
|
|
9
|
+
* add period to make release please happen ([44ca4bc](https://github.com/flowcore-io/flowcore-sdk/commit/44ca4bc9203462c3139caf5f0abe4dbe9a23b917))
|
|
10
|
+
|
|
11
|
+
## [1.51.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.50.0...v1.51.0) (2025-06-23)
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **commands:** add IAM-related exports to index.ts for permissions, … ([022b85b](https://github.com/flowcore-io/flowcore-sdk/commit/022b85b7d2c7e0171e0315977b0dad03d439a52e))
|
|
17
|
+
* **commands:** add IAM-related exports to index.ts for permissions, policies, role associations, and validation ([f55a116](https://github.com/flowcore-io/flowcore-sdk/commit/f55a1164e35dc18f8c068b1fad633f493ac64c47))
|
|
18
|
+
|
|
3
19
|
## [1.50.0](https://github.com/flowcore-io/flowcore-sdk/compare/v1.49.0...v1.50.0) (2025-06-19)
|
|
4
20
|
|
|
5
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reset-adapter.d.ts","sourceRoot":"","sources":["../../../src/commands/adapter/reset-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"reset-adapter.d.ts","sourceRoot":"","sources":["../../../src/commands/adapter/reset-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEjD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,8BAA8B;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAoB;IACnC,uCAAuC;IACvC,OAAO,EAAE,OAAO,CAAA;IAChB,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAA;CAChB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,oBAAoB,CAAC;IACvF;;OAEG;IACH,UAAmB,kBAAkB,SAAS;IAE9C;;OAEG;IACH,UAAmB,cAAc,UAAO;IAExC;;OAEG;cACgB,SAAS,IAAI,MAAM;IAGtC;;OAEG;cACgB,UAAU,IAAI,MAAM;IAIvC;;OAEG;cACgB,OAAO,IAAI,MAAM;IAIpC;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,oBAAoB;CAG7E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
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 permission
|
|
5
|
+
*/
|
|
6
|
+
export declare const UserPermissionSchema: TObject<{
|
|
7
|
+
tenant: TString;
|
|
8
|
+
type: TString;
|
|
9
|
+
id: TString;
|
|
10
|
+
action: TArray<TString>;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* The permission type
|
|
14
|
+
*/
|
|
15
|
+
export type UserPermission = Static<typeof UserPermissionSchema>;
|
|
16
|
+
/**
|
|
17
|
+
* The input for the user permissions command
|
|
18
|
+
*/
|
|
19
|
+
export interface UserPermissionsInput {
|
|
20
|
+
/** The optional permission type */
|
|
21
|
+
type?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Get all permissions for the current user
|
|
25
|
+
*/
|
|
26
|
+
export declare class UserPermissionsCommand extends Command<UserPermissionsInput, UserPermission[]> {
|
|
27
|
+
/**
|
|
28
|
+
* Whether the command should retry on failure
|
|
29
|
+
*/
|
|
30
|
+
protected retryOnFailure: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Get the method
|
|
33
|
+
*/
|
|
34
|
+
protected getMethod(): string;
|
|
35
|
+
/**
|
|
36
|
+
* Get the base url
|
|
37
|
+
*/
|
|
38
|
+
protected getBaseUrl(): string;
|
|
39
|
+
/**
|
|
40
|
+
* Get the path
|
|
41
|
+
*/
|
|
42
|
+
protected getPath(): string;
|
|
43
|
+
/**
|
|
44
|
+
* Parse the response
|
|
45
|
+
*/
|
|
46
|
+
protected parseResponse(rawResponse: unknown): UserPermission[];
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=get-user-permissions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-permissions.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/permissions/get-user-permissions.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,oBAAoB,EAAE,OAAO,CAAC;IACzC,MAAM,EAAE,OAAO,CAAA;IACf,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAA;CACxB,CAKC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED;;GAEG;AACH,qBAAa,sBAAuB,SAAQ,OAAO,CACjD,oBAAoB,EACpB,cAAc,EAAE,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,cAAc,EAAE;CAGzE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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 permission
|
|
6
|
+
*/
|
|
7
|
+
export const UserPermissionSchema = Type.Object({
|
|
8
|
+
tenant: Type.String(),
|
|
9
|
+
type: Type.String(),
|
|
10
|
+
id: Type.String(),
|
|
11
|
+
action: Type.Array(Type.String()),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* Get all permissions for the current user
|
|
15
|
+
*/
|
|
16
|
+
export class UserPermissionsCommand extends Command {
|
|
17
|
+
/**
|
|
18
|
+
* Whether the command should retry on failure
|
|
19
|
+
*/
|
|
20
|
+
retryOnFailure = true;
|
|
21
|
+
/**
|
|
22
|
+
* Get the method
|
|
23
|
+
*/
|
|
24
|
+
getMethod() {
|
|
25
|
+
return "GET";
|
|
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/permissions/";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Parse the response
|
|
41
|
+
*/
|
|
42
|
+
parseResponse(rawResponse) {
|
|
43
|
+
return parseResponseHelper(Type.Array(UserPermissionSchema), rawResponse);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Static, type TArray, type TBoolean, type TObject, type TOptional, type TString, type TUnion } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a policy statement document
|
|
5
|
+
*/
|
|
6
|
+
export declare const PolicyStatementSchema: TObject<{
|
|
7
|
+
statementId: TOptional<TString>;
|
|
8
|
+
resource: TString;
|
|
9
|
+
action: TUnion<[TString, TArray<TString>]>;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The schema for a policy
|
|
13
|
+
*/
|
|
14
|
+
export declare const PolicySchema: TObject<{
|
|
15
|
+
id: TString;
|
|
16
|
+
organizationId: TString;
|
|
17
|
+
name: TString;
|
|
18
|
+
version: TString;
|
|
19
|
+
policyDocuments: TArray<typeof PolicyStatementSchema>;
|
|
20
|
+
description: TOptional<TString>;
|
|
21
|
+
principal: TOptional<TString>;
|
|
22
|
+
flowcoreManaged: TBoolean;
|
|
23
|
+
archived: TOptional<TBoolean>;
|
|
24
|
+
frn: TString;
|
|
25
|
+
}>;
|
|
26
|
+
/**
|
|
27
|
+
* The Policy type
|
|
28
|
+
*/
|
|
29
|
+
export type Policy = Static<typeof PolicySchema>;
|
|
30
|
+
/**
|
|
31
|
+
* The Policy Statement type
|
|
32
|
+
*/
|
|
33
|
+
export type PolicyStatement = Static<typeof PolicyStatementSchema>;
|
|
34
|
+
/**
|
|
35
|
+
* The input for the policy create command
|
|
36
|
+
*/
|
|
37
|
+
export interface PolicyCreateInput {
|
|
38
|
+
/** The organization id */
|
|
39
|
+
organizationId: string;
|
|
40
|
+
/** The name of the policy */
|
|
41
|
+
name: string;
|
|
42
|
+
/** The version of the policy */
|
|
43
|
+
version: string;
|
|
44
|
+
/** The policy documents */
|
|
45
|
+
policyDocuments: Array<{
|
|
46
|
+
/** The optional statement id */
|
|
47
|
+
statementId?: string;
|
|
48
|
+
/** The resource for this statement */
|
|
49
|
+
resource: string;
|
|
50
|
+
/** The actions for this statement */
|
|
51
|
+
action: string | string[];
|
|
52
|
+
}>;
|
|
53
|
+
/** The description of the policy */
|
|
54
|
+
description?: string;
|
|
55
|
+
/** The principal role that can access the resource */
|
|
56
|
+
principal?: string;
|
|
57
|
+
/** Whether the policy is managed by Flowcore */
|
|
58
|
+
flowcoreManaged?: boolean;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Create a policy
|
|
62
|
+
*/
|
|
63
|
+
export declare class PolicyCreateCommand extends Command<PolicyCreateInput, Policy> {
|
|
64
|
+
/**
|
|
65
|
+
* Whether the command should retry on failure
|
|
66
|
+
*/
|
|
67
|
+
protected retryOnFailure: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Get the method
|
|
70
|
+
*/
|
|
71
|
+
protected getMethod(): string;
|
|
72
|
+
/**
|
|
73
|
+
* Get the base url
|
|
74
|
+
*/
|
|
75
|
+
protected getBaseUrl(): string;
|
|
76
|
+
/**
|
|
77
|
+
* Get the path
|
|
78
|
+
*/
|
|
79
|
+
protected getPath(): string;
|
|
80
|
+
/**
|
|
81
|
+
* Get the body
|
|
82
|
+
*/
|
|
83
|
+
protected getBody(): Record<string, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* Parse the response
|
|
86
|
+
*/
|
|
87
|
+
protected parseResponse(rawResponse: unknown): Policy;
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=create-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-policy.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policies/create-policy.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEpD,OAAO,EACL,KAAK,MAAM,EACX,KAAK,MAAM,EACX,KAAK,QAAQ,EACb,KAAK,OAAO,EACZ,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,MAAM,EAEZ,MAAM,mBAAmB,CAAA;AAE1B;;GAEG;AACH,eAAO,MAAM,qBAAqB,EAAE,OAAO,CAAC;IAC1C,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,MAAM,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;CAC3C,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC;IACjC,EAAE,EAAE,OAAO,CAAA;IACX,cAAc,EAAE,OAAO,CAAA;IACvB,IAAI,EAAE,OAAO,CAAA;IACb,OAAO,EAAE,OAAO,CAAA;IAChB,eAAe,EAAE,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;IACrD,WAAW,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC/B,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAA;IAC7B,eAAe,EAAE,QAAQ,CAAA;IACzB,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAA;IAC7B,GAAG,EAAE,OAAO,CAAA;CACb,CAWC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,YAAY,CAAC,CAAA;AAEhD;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAElE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,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,KAAK,CAAC;QACrB,gCAAgC;QAChC,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,sCAAsC;QACtC,QAAQ,EAAE,MAAM,CAAA;QAChB,qCAAqC;QACrC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAC1B,CAAC,CAAA;IACF,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;IAOrD;;OAEG;cACgB,aAAa,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM;CAG/D"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
// src/contracts/policy.ts
|
|
2
|
+
import { Command } from "../../../common/command.js";
|
|
3
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
4
|
+
import { Type, } from "@sinclair/typebox";
|
|
5
|
+
/**
|
|
6
|
+
* The schema for a policy statement document
|
|
7
|
+
*/
|
|
8
|
+
export const PolicyStatementSchema = Type.Object({
|
|
9
|
+
statementId: Type.Optional(Type.String()),
|
|
10
|
+
resource: Type.String(),
|
|
11
|
+
action: Type.Union([Type.String(), Type.Array(Type.String())]),
|
|
12
|
+
});
|
|
13
|
+
/**
|
|
14
|
+
* The schema for a policy
|
|
15
|
+
*/
|
|
16
|
+
export const PolicySchema = Type.Object({
|
|
17
|
+
id: Type.String(),
|
|
18
|
+
organizationId: Type.String(),
|
|
19
|
+
name: Type.String(),
|
|
20
|
+
version: Type.String(),
|
|
21
|
+
policyDocuments: Type.Array(PolicyStatementSchema),
|
|
22
|
+
description: Type.Optional(Type.String()),
|
|
23
|
+
principal: Type.Optional(Type.String()),
|
|
24
|
+
flowcoreManaged: Type.Boolean(),
|
|
25
|
+
archived: Type.Optional(Type.Boolean()),
|
|
26
|
+
frn: Type.String(),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* Create a policy
|
|
30
|
+
*/
|
|
31
|
+
export class PolicyCreateCommand extends Command {
|
|
32
|
+
/**
|
|
33
|
+
* Whether the command should retry on failure
|
|
34
|
+
*/
|
|
35
|
+
retryOnFailure = false;
|
|
36
|
+
/**
|
|
37
|
+
* Get the method
|
|
38
|
+
*/
|
|
39
|
+
getMethod() {
|
|
40
|
+
return "POST";
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Get the base url
|
|
44
|
+
*/
|
|
45
|
+
getBaseUrl() {
|
|
46
|
+
return "https://iam.api.flowcore.io";
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get the path
|
|
50
|
+
*/
|
|
51
|
+
getPath() {
|
|
52
|
+
return "/api/v1/policies/";
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Get the body
|
|
56
|
+
*/
|
|
57
|
+
getBody() {
|
|
58
|
+
return {
|
|
59
|
+
...this.input,
|
|
60
|
+
flowcoreManaged: this.input.flowcoreManaged ?? false,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parse the response
|
|
65
|
+
*/
|
|
66
|
+
parseResponse(rawResponse) {
|
|
67
|
+
return parseResponseHelper(PolicySchema, rawResponse);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { type Policy } from "./create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the policy list command
|
|
5
|
+
*/
|
|
6
|
+
export interface PolicyListInput {
|
|
7
|
+
/** The organization id */
|
|
8
|
+
organizationId?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List policies
|
|
12
|
+
*/
|
|
13
|
+
export declare class PolicyListCommand extends Command<PolicyListInput, 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-policy.d.ts.map
|
|
@@ -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,37 @@
|
|
|
1
|
+
import { Command } from "../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../utils/parse-response-helper.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
import { PolicySchema } from "./create-policy.js"; // Reuse the Policy type definition
|
|
5
|
+
/**
|
|
6
|
+
* List policies
|
|
7
|
+
*/
|
|
8
|
+
export class PolicyListCommand 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
|
+
return "/api/v1/policies/";
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parse the response
|
|
33
|
+
*/
|
|
34
|
+
parseResponse(rawResponse) {
|
|
35
|
+
return parseResponseHelper(Type.Array(PolicySchema), rawResponse);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -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,42 @@
|
|
|
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 the archive policy response
|
|
6
|
+
*/
|
|
7
|
+
export const ArchivePolicyResponseSchema = Type.Object({
|
|
8
|
+
message: Type.String(),
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Archive a policy by ID
|
|
12
|
+
*/
|
|
13
|
+
export class PolicyArchiveCommand extends Command {
|
|
14
|
+
/**
|
|
15
|
+
* Whether the command should retry on failure
|
|
16
|
+
*/
|
|
17
|
+
retryOnFailure = false;
|
|
18
|
+
/**
|
|
19
|
+
* Get the method
|
|
20
|
+
*/
|
|
21
|
+
getMethod() {
|
|
22
|
+
return "DELETE";
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get the base url
|
|
26
|
+
*/
|
|
27
|
+
getBaseUrl() {
|
|
28
|
+
return "https://iam.api.flowcore.io";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the path
|
|
32
|
+
*/
|
|
33
|
+
getPath() {
|
|
34
|
+
return `/api/v1/policies/${this.input.policyId}`;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Parse the response
|
|
38
|
+
*/
|
|
39
|
+
parseResponse(rawResponse) {
|
|
40
|
+
return parseResponseHelper(ArchivePolicyResponseSchema, rawResponse);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -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,40 @@
|
|
|
1
|
+
import { Command } from "../../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../../utils/parse-response-helper.js";
|
|
3
|
+
import { PolicySchema } from "../create-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* Get a policy by ID
|
|
6
|
+
*/
|
|
7
|
+
export class PolicyGetCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the command should retry on failure
|
|
10
|
+
*/
|
|
11
|
+
retryOnFailure = true;
|
|
12
|
+
constructor(inputOrPolicyId) {
|
|
13
|
+
const input = typeof inputOrPolicyId === "string" ? { policyId: inputOrPolicyId } : inputOrPolicyId;
|
|
14
|
+
super(input);
|
|
15
|
+
}
|
|
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/${this.input.policyId}`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Parse the response
|
|
36
|
+
*/
|
|
37
|
+
parseResponse(rawResponse) {
|
|
38
|
+
return parseResponseHelper(PolicySchema, rawResponse);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -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,46 @@
|
|
|
1
|
+
import { Command } from "../../../../common/command.js";
|
|
2
|
+
import { parseResponseHelper } from "../../../../utils/parse-response-helper.js";
|
|
3
|
+
import { PolicySchema } from "../create-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* Update a policy by ID
|
|
6
|
+
*/
|
|
7
|
+
export class PolicyUpdateCommand 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 "PATCH";
|
|
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/policies/${this.input.policyId}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the body
|
|
32
|
+
*/
|
|
33
|
+
getBody() {
|
|
34
|
+
const { ...rest } = this.input;
|
|
35
|
+
return {
|
|
36
|
+
...rest,
|
|
37
|
+
flowcoreManaged: rest.flowcoreManaged ?? false,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
parseResponse(rawResponse) {
|
|
44
|
+
return parseResponseHelper(PolicySchema, rawResponse);
|
|
45
|
+
}
|
|
46
|
+
}
|