@flowcore/sdk 1.49.0 → 1.51.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 +31 -0
- package/README.md +47 -0
- package/esm/_dnt.shims.d.ts +1 -1
- package/esm/commands/adapter/reset-adapter.d.ts +52 -0
- package/esm/commands/adapter/reset-adapter.d.ts.map +1 -0
- package/esm/commands/adapter/reset-adapter.js +38 -0
- package/esm/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
- package/esm/commands/api-key/api-key.create.js +8 -21
- package/esm/commands/api-key/api-key.delete.js +4 -12
- package/esm/commands/api-key/api-key.list.js +4 -12
- package/esm/commands/data-core/data-core.create.js +4 -12
- package/esm/commands/data-core/data-core.request-delete.js +4 -12
- package/esm/commands/event-type/event-type.create.js +4 -12
- package/esm/commands/event-type/event-type.request-delete.js +4 -12
- package/esm/commands/event-type/event-type.request-truncate.js +4 -12
- package/esm/commands/events/event.list.js +4 -12
- package/esm/commands/events/events.fetch-time-buckets-by-names.js +4 -12
- package/esm/commands/events/events.fetch.js +4 -12
- package/esm/commands/events/time-bucket.list.js +4 -12
- package/esm/commands/flow-type/flow-type.create.js +4 -12
- package/esm/commands/flow-type/flow-type.request-delete.js +4 -12
- 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 +44 -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 +68 -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 +36 -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 +41 -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 +39 -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 +45 -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 +76 -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 +79 -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 +108 -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 +64 -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 +36 -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 +51 -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 +51 -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 +51 -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 +43 -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 +43 -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 +43 -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 +36 -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 +53 -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 +58 -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 +41 -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 +51 -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/{user-role-association.create.js → role-associations/link-user-role.js} +19 -8
- 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 +43 -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 +43 -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 +55 -0
- package/{script/commands/iam/role.list.d.ts → esm/commands/iam/roles/get-roles.d.ts} +10 -8
- package/esm/commands/iam/roles/get-roles.d.ts.map +1 -0
- package/esm/commands/iam/roles/get-roles.js +36 -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 +41 -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 +35 -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 +46 -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 +101 -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 +42 -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 +57 -0
- package/esm/commands/index.d.ts +34 -7
- package/esm/commands/index.d.ts.map +1 -1
- package/esm/commands/index.js +36 -8
- package/esm/commands/ingestion/ingest.batch.js +5 -18
- package/esm/commands/ingestion/ingest.event.js +5 -18
- package/esm/commands/scenario/scenario.create.js +4 -12
- package/esm/commands/scenario/scenario.delete.js +4 -12
- package/esm/commands/scenario/scenario.fetch.js +4 -12
- package/esm/commands/scenario/scenario.list.js +4 -12
- package/esm/commands/scenario/scenario.update.js +4 -12
- package/esm/commands/secret/secret.create.js +4 -12
- package/esm/commands/secret/secret.delete.js +4 -12
- package/esm/commands/secret/secret.list.js +4 -12
- package/esm/commands/security/pat.create.js +4 -12
- package/esm/commands/security/pat.delete.js +4 -12
- package/esm/commands/security/pat.exchange.js +4 -12
- package/esm/commands/security/pat.get.js +4 -12
- package/esm/commands/security/pat.list.js +4 -12
- package/esm/commands/tenant/tenant.list.js +4 -12
- package/esm/commands/variable/variable.create.js +4 -12
- package/esm/commands/variable/variable.delete.js +4 -12
- package/esm/commands/variable/variable.list.js +4 -12
- package/esm/common/command-graphql.js +4 -12
- package/esm/common/command.js +20 -45
- package/esm/common/flowcore-client.js +4 -18
- package/esm/common/notification-client.js +15 -72
- package/esm/common/websocket-client.js +16 -80
- package/esm/exceptions/client-error.js +6 -18
- package/esm/exceptions/invalid-response.js +2 -6
- package/esm/utils/local-cache.js +5 -19
- package/package.json +1 -1
- package/script/_dnt.shims.d.ts +1 -1
- package/script/commands/adapter/reset-adapter.d.ts +52 -0
- package/script/commands/adapter/reset-adapter.d.ts.map +1 -0
- package/script/commands/adapter/reset-adapter.js +42 -0
- package/script/commands/ai-agent-coordinator/conversation-stream.command.js +1 -6
- package/script/commands/api-key/api-key.create.js +8 -21
- package/script/commands/api-key/api-key.delete.js +4 -12
- package/script/commands/api-key/api-key.list.js +4 -12
- package/script/commands/data-core/data-core.create.js +4 -12
- package/script/commands/data-core/data-core.request-delete.js +4 -12
- package/script/commands/event-type/event-type.create.js +4 -12
- package/script/commands/event-type/event-type.request-delete.js +4 -12
- package/script/commands/event-type/event-type.request-truncate.js +4 -12
- package/script/commands/events/event.list.js +4 -12
- package/script/commands/events/events.fetch-time-buckets-by-names.js +4 -12
- package/script/commands/events/events.fetch.js +4 -12
- package/script/commands/events/time-bucket.list.js +4 -12
- package/script/commands/flow-type/flow-type.create.js +4 -12
- package/script/commands/flow-type/flow-type.request-delete.js +4 -12
- 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 +48 -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 +72 -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 +40 -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 +45 -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 +43 -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 +49 -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 +80 -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 +83 -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 +112 -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 +68 -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 +40 -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 +55 -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 +55 -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 +55 -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 +47 -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 +47 -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 +47 -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 +40 -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 +57 -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 +62 -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 +45 -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 +55 -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/{user-role-association.create.js → role-associations/link-user-role.js} +21 -10
- 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 +47 -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 +47 -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 +59 -0
- package/{esm/commands/iam/role.list.d.ts → script/commands/iam/roles/get-roles.d.ts} +10 -8
- package/script/commands/iam/roles/get-roles.d.ts.map +1 -0
- package/script/commands/iam/roles/get-roles.js +40 -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 +45 -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 +39 -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 +50 -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 +105 -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 +46 -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 +61 -0
- package/script/commands/index.d.ts +34 -7
- package/script/commands/index.d.ts.map +1 -1
- package/script/commands/index.js +36 -8
- package/script/commands/ingestion/ingest.batch.js +5 -18
- package/script/commands/ingestion/ingest.event.js +5 -18
- package/script/commands/scenario/scenario.create.js +4 -12
- package/script/commands/scenario/scenario.delete.js +4 -12
- package/script/commands/scenario/scenario.fetch.js +4 -12
- package/script/commands/scenario/scenario.list.js +4 -12
- package/script/commands/scenario/scenario.update.js +4 -12
- package/script/commands/secret/secret.create.js +4 -12
- package/script/commands/secret/secret.delete.js +4 -12
- package/script/commands/secret/secret.list.js +4 -12
- package/script/commands/security/pat.create.js +4 -12
- package/script/commands/security/pat.delete.js +4 -12
- package/script/commands/security/pat.exchange.js +4 -12
- package/script/commands/security/pat.get.js +4 -12
- package/script/commands/security/pat.list.js +4 -12
- package/script/commands/tenant/tenant.list.js +4 -12
- package/script/commands/variable/variable.create.js +4 -12
- package/script/commands/variable/variable.delete.js +4 -12
- package/script/commands/variable/variable.list.js +4 -12
- package/script/common/command-graphql.js +4 -12
- package/script/common/command.js +20 -45
- package/script/common/flowcore-client.js +4 -18
- package/script/common/notification-client.js +15 -72
- package/script/common/websocket-client.js +16 -80
- package/script/exceptions/client-error.js +6 -18
- package/script/exceptions/invalid-response.js +2 -6
- package/script/utils/local-cache.js +5 -19
- package/esm/commands/iam/api-key-role-association.create.d.ts +0 -45
- package/esm/commands/iam/api-key-role-association.create.d.ts.map +0 -1
- package/esm/commands/iam/api-key-role-association.create.js +0 -44
- package/esm/commands/iam/api-key-role-association.delete.d.ts +0 -45
- package/esm/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
- package/esm/commands/iam/api-key-role-association.delete.js +0 -44
- package/esm/commands/iam/api-key-role-association.list.d.ts +0 -31
- package/esm/commands/iam/api-key-role-association.list.d.ts.map +0 -1
- package/esm/commands/iam/api-key-role-association.list.js +0 -37
- package/esm/commands/iam/role.list.d.ts.map +0 -1
- package/esm/commands/iam/role.list.js +0 -41
- package/esm/commands/iam/user-role-association.create.d.ts +0 -42
- package/esm/commands/iam/user-role-association.create.d.ts.map +0 -1
- package/esm/commands/iam/user-role-association.delete.d.ts +0 -42
- package/esm/commands/iam/user-role-association.delete.d.ts.map +0 -1
- package/esm/commands/iam/user-role-association.delete.js +0 -40
- package/esm/commands/iam/user-role-association.list.d.ts +0 -33
- package/esm/commands/iam/user-role-association.list.d.ts.map +0 -1
- package/esm/commands/iam/user-role-association.list.js +0 -39
- package/esm/contracts/iam.d.ts +0 -13
- package/esm/contracts/iam.d.ts.map +0 -1
- package/esm/contracts/iam.js +0 -9
- package/script/commands/iam/api-key-role-association.create.d.ts +0 -45
- package/script/commands/iam/api-key-role-association.create.d.ts.map +0 -1
- package/script/commands/iam/api-key-role-association.create.js +0 -48
- package/script/commands/iam/api-key-role-association.delete.d.ts +0 -45
- package/script/commands/iam/api-key-role-association.delete.d.ts.map +0 -1
- package/script/commands/iam/api-key-role-association.delete.js +0 -48
- package/script/commands/iam/api-key-role-association.list.d.ts +0 -31
- package/script/commands/iam/api-key-role-association.list.d.ts.map +0 -1
- package/script/commands/iam/api-key-role-association.list.js +0 -41
- package/script/commands/iam/role.list.d.ts.map +0 -1
- package/script/commands/iam/role.list.js +0 -45
- package/script/commands/iam/user-role-association.create.d.ts +0 -42
- package/script/commands/iam/user-role-association.create.d.ts.map +0 -1
- package/script/commands/iam/user-role-association.delete.d.ts +0 -42
- package/script/commands/iam/user-role-association.delete.d.ts.map +0 -1
- package/script/commands/iam/user-role-association.delete.js +0 -44
- package/script/commands/iam/user-role-association.list.d.ts +0 -33
- package/script/commands/iam/user-role-association.list.d.ts.map +0 -1
- package/script/commands/iam/user-role-association.list.js +0 -43
- package/script/contracts/iam.d.ts +0 -13
- package/script/contracts/iam.d.ts.map +0 -1
- package/script/contracts/iam.js +0 -12
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { PolicySchema } from "../policies/create-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* Fetch policies for an organization
|
|
6
|
+
*/
|
|
7
|
+
export class OrganizationPoliciesCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the command should retry on failure
|
|
10
|
+
*/
|
|
11
|
+
retryOnFailure = true;
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "GET";
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Get the base url
|
|
20
|
+
*/
|
|
21
|
+
getBaseUrl() {
|
|
22
|
+
// Use a proxy URL in development mode
|
|
23
|
+
// if (process.env.NODE_ENV === "development") {
|
|
24
|
+
// return typeof window === "undefined"
|
|
25
|
+
// ? "http://localhost:3000" // Server-side in dev
|
|
26
|
+
// : ""; // Client-side in dev (relative URL)
|
|
27
|
+
// }
|
|
28
|
+
return "https://iam.api.flowcore.io";
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the path
|
|
32
|
+
*/
|
|
33
|
+
getPath() {
|
|
34
|
+
// Use the proxy API in development mode
|
|
35
|
+
// if (process.env.NODE_ENV === "development") {
|
|
36
|
+
// return `/api/proxy/iam/policy-associations/organization/${this.input.organizationId}`;
|
|
37
|
+
// }
|
|
38
|
+
return `/api/v1/policy-associations/organization/${this.input.organizationId}`;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parse the response
|
|
42
|
+
*/
|
|
43
|
+
parseResponse(rawResponse) {
|
|
44
|
+
try {
|
|
45
|
+
// Handle empty responses
|
|
46
|
+
if (!rawResponse) {
|
|
47
|
+
return [];
|
|
48
|
+
}
|
|
49
|
+
// If we get an array directly, try to parse each item
|
|
50
|
+
if (Array.isArray(rawResponse)) {
|
|
51
|
+
return rawResponse.map((item) => {
|
|
52
|
+
try {
|
|
53
|
+
return parseResponseHelper(PolicySchema, item);
|
|
54
|
+
}
|
|
55
|
+
catch (_error) {
|
|
56
|
+
// Return a minimal valid policy object
|
|
57
|
+
return {
|
|
58
|
+
id: item.id || "unknown",
|
|
59
|
+
name: item.name || "Unknown Policy",
|
|
60
|
+
version: item.version || "1.0",
|
|
61
|
+
description: item.description || "",
|
|
62
|
+
flowcoreManaged: !!item.flowcoreManaged,
|
|
63
|
+
policyDocuments: item.policyDocuments || [],
|
|
64
|
+
organizationId: this.input.organizationId,
|
|
65
|
+
frn: item.frn ||
|
|
66
|
+
`frn::${this.input.organizationId}:policy/${item.id || "unknown"}`,
|
|
67
|
+
archived: item.archived === undefined ? false : !!item.archived,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// Try the normal parsing
|
|
73
|
+
return parseResponseHelper(Type.Array(PolicySchema), rawResponse);
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
throw error;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { Command } from "@flowcore/sdk";
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-policy-associations.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/get-policy-associations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAE9F;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,OAAO,CAAC;IAC/C,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;CACf,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC;IAChD,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,2BAA2B,EAAE,OAAO,CAAC;IAChD,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB,CAIC,CAAA;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,OAAO,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;IAC/C,KAAK,EAAE,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;IACjD,KAAK,EAAE,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;CAClD,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC,OAAO,0BAA0B,CAAC,CAAA;AAE5E;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE9E;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAE9E;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAsDD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,OAAO,CACpD,uBAAuB,EACvB,kBAAkB,CACnB;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,kBAAkB;CAG3E"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a policy-key association
|
|
5
|
+
*/
|
|
6
|
+
export const PolicyKeyAssociationSchema = Type.Object({
|
|
7
|
+
policyId: Type.String(),
|
|
8
|
+
organizationId: Type.String(),
|
|
9
|
+
keyId: Type.String(),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* The schema for a policy-user association
|
|
13
|
+
*/
|
|
14
|
+
export const PolicyUserAssociationSchema = Type.Object({
|
|
15
|
+
policyId: Type.String(),
|
|
16
|
+
organizationId: Type.String(),
|
|
17
|
+
userId: Type.String(),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* The schema for a policy-role association
|
|
21
|
+
*/
|
|
22
|
+
export const PolicyRoleAssociationSchema = Type.Object({
|
|
23
|
+
policyId: Type.String(),
|
|
24
|
+
organizationId: Type.String(),
|
|
25
|
+
roleId: Type.String(),
|
|
26
|
+
});
|
|
27
|
+
/**
|
|
28
|
+
* The schema for policy associations
|
|
29
|
+
*/
|
|
30
|
+
export const PolicyAssociationsSchema = Type.Object({
|
|
31
|
+
keys: Type.Array(PolicyKeyAssociationSchema),
|
|
32
|
+
users: Type.Array(PolicyUserAssociationSchema),
|
|
33
|
+
roles: Type.Array(PolicyRoleAssociationSchema),
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Parse policy associations response with fallbacks for missing data
|
|
37
|
+
*/
|
|
38
|
+
const parsePolicyAssociationsResponse = (rawResponse) => {
|
|
39
|
+
try {
|
|
40
|
+
// First try standard parsing
|
|
41
|
+
return parseResponseHelper(PolicyAssociationsSchema, rawResponse);
|
|
42
|
+
}
|
|
43
|
+
catch (_error) {
|
|
44
|
+
// If it's not an object at all, return empty arrays
|
|
45
|
+
if (!rawResponse || typeof rawResponse !== "object") {
|
|
46
|
+
return { keys: [], users: [], roles: [] };
|
|
47
|
+
}
|
|
48
|
+
// Extract the raw data with safe fallbacks
|
|
49
|
+
const rawData = rawResponse;
|
|
50
|
+
// Ensure each section exists and is an array
|
|
51
|
+
let keys = Array.isArray(rawData.keys) ? rawData.keys : [];
|
|
52
|
+
let users = Array.isArray(rawData.users) ? rawData.users : [];
|
|
53
|
+
let roles = Array.isArray(rawData.roles) ? rawData.roles : [];
|
|
54
|
+
// Try to validate each section separately
|
|
55
|
+
try {
|
|
56
|
+
keys = parseResponseHelper(Type.Array(PolicyKeyAssociationSchema), keys);
|
|
57
|
+
}
|
|
58
|
+
catch (_error) {
|
|
59
|
+
keys = [];
|
|
60
|
+
}
|
|
61
|
+
try {
|
|
62
|
+
users = parseResponseHelper(Type.Array(PolicyUserAssociationSchema), users);
|
|
63
|
+
}
|
|
64
|
+
catch (_error) {
|
|
65
|
+
users = [];
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
roles = parseResponseHelper(Type.Array(PolicyRoleAssociationSchema), roles);
|
|
69
|
+
}
|
|
70
|
+
catch (_error) {
|
|
71
|
+
roles = [];
|
|
72
|
+
}
|
|
73
|
+
return { keys, users, roles };
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
/**
|
|
77
|
+
* Fetch associations for a policy
|
|
78
|
+
*/
|
|
79
|
+
export class PolicyAssociationsCommand extends Command {
|
|
80
|
+
/**
|
|
81
|
+
* Whether the command should retry on failure
|
|
82
|
+
*/
|
|
83
|
+
retryOnFailure = true;
|
|
84
|
+
/**
|
|
85
|
+
* Get the method
|
|
86
|
+
*/
|
|
87
|
+
getMethod() {
|
|
88
|
+
return "GET";
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Get the base url
|
|
92
|
+
*/
|
|
93
|
+
getBaseUrl() {
|
|
94
|
+
return "https://iam.api.flowcore.io";
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get the path
|
|
98
|
+
*/
|
|
99
|
+
getPath() {
|
|
100
|
+
return `/api/v1/policy-associations/${this.input.policyId}`;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Parse the response
|
|
104
|
+
*/
|
|
105
|
+
parseResponse(rawResponse) {
|
|
106
|
+
return parsePolicyAssociationsResponse(rawResponse);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Command } from "@flowcore/sdk";
|
|
2
|
+
import { type Policy } from "../policies/create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the role policies command
|
|
5
|
+
*/
|
|
6
|
+
export interface RolePoliciesInput {
|
|
7
|
+
/** The role id */
|
|
8
|
+
roleId: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Fetch policies for a role
|
|
12
|
+
*/
|
|
13
|
+
export declare class RolePoliciesCommand extends Command<RolePoliciesInput, 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-role-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-role-policies.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/get-role-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,8BAA8B,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;CACf;AAsDD;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC3E;;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,64 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { PolicySchema } from "../policies/create-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* Custom parser to handle non-boolean flowcoreManaged values
|
|
6
|
+
*/
|
|
7
|
+
const parseRolePoliciesResponse = (rawResponse) => {
|
|
8
|
+
try {
|
|
9
|
+
// First try standard parsing
|
|
10
|
+
return parseResponseHelper(Type.Array(PolicySchema), rawResponse);
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
// If there's an error, check if it's related to flowcoreManaged
|
|
14
|
+
if (error instanceof Error &&
|
|
15
|
+
error.message.includes("flowcoreManaged") &&
|
|
16
|
+
Array.isArray(rawResponse)) {
|
|
17
|
+
// Convert flowcoreManaged to boolean for each policy
|
|
18
|
+
const sanitizedPolicies = rawResponse.map((policy) => ({
|
|
19
|
+
...policy,
|
|
20
|
+
// Convert to boolean with explicit type-safe conversion
|
|
21
|
+
flowcoreManaged: policy.flowcoreManaged === true ||
|
|
22
|
+
policy.flowcoreManaged === "true" ||
|
|
23
|
+
(typeof policy.flowcoreManaged === "boolean" && policy.flowcoreManaged),
|
|
24
|
+
}));
|
|
25
|
+
// Try parsing again with the sanitized data
|
|
26
|
+
return parseResponseHelper(Type.Array(PolicySchema), sanitizedPolicies);
|
|
27
|
+
}
|
|
28
|
+
// If not a flowcoreManaged error or not an array, rethrow
|
|
29
|
+
throw error;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Fetch policies for a role
|
|
34
|
+
*/
|
|
35
|
+
export class RolePoliciesCommand extends Command {
|
|
36
|
+
/**
|
|
37
|
+
* Whether the command should retry on failure
|
|
38
|
+
*/
|
|
39
|
+
retryOnFailure = true;
|
|
40
|
+
/**
|
|
41
|
+
* Get the method
|
|
42
|
+
*/
|
|
43
|
+
getMethod() {
|
|
44
|
+
return "GET";
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get the base url
|
|
48
|
+
*/
|
|
49
|
+
getBaseUrl() {
|
|
50
|
+
return "https://iam.api.flowcore.io";
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Get the path
|
|
54
|
+
*/
|
|
55
|
+
getPath() {
|
|
56
|
+
return `/api/v1/policy-associations/role/${this.input.roleId}/`;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Parse the response
|
|
60
|
+
*/
|
|
61
|
+
parseResponse(rawResponse) {
|
|
62
|
+
return parseRolePoliciesResponse(rawResponse);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Command } from "@flowcore/sdk";
|
|
2
|
+
import { type Policy } from "../policies/create-policy.js";
|
|
3
|
+
/**
|
|
4
|
+
* The input for the user policies command
|
|
5
|
+
*/
|
|
6
|
+
export interface UserPoliciesInput {
|
|
7
|
+
/** The user id */
|
|
8
|
+
userId: string;
|
|
9
|
+
/** The optional organization id */
|
|
10
|
+
organizationId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Fetch policies for a user
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserPoliciesCommand extends Command<UserPoliciesInput, Policy[]> {
|
|
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): Policy[];
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=get-user-policies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-user-policies.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/get-user-policies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAE5D,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,8BAA8B,CAAA;AAExE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,mCAAmC;IACnC,cAAc,CAAC,EAAE,MAAM,CAAA;CACxB;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,OAAO,CAAC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC3E;;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,36 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
import { PolicySchema } from "../policies/create-policy.js";
|
|
4
|
+
/**
|
|
5
|
+
* Fetch policies for a user
|
|
6
|
+
*/
|
|
7
|
+
export class UserPoliciesCommand extends Command {
|
|
8
|
+
/**
|
|
9
|
+
* Whether the command should retry on failure
|
|
10
|
+
*/
|
|
11
|
+
retryOnFailure = true;
|
|
12
|
+
/**
|
|
13
|
+
* Get the method
|
|
14
|
+
*/
|
|
15
|
+
getMethod() {
|
|
16
|
+
return "GET";
|
|
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/policy-associations/user/${this.input.userId}/`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse the response
|
|
32
|
+
*/
|
|
33
|
+
parseResponse(rawResponse) {
|
|
34
|
+
return parseResponseHelper(Type.Array(PolicySchema), rawResponse);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "@flowcore/sdk";
|
|
2
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a key policy link response
|
|
5
|
+
*/
|
|
6
|
+
export declare const KeyPolicyLinkSchema: TObject<{
|
|
7
|
+
policyId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
keyId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The key policy link response type
|
|
13
|
+
*/
|
|
14
|
+
export type KeyPolicyLink = Static<typeof KeyPolicyLinkSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The input for the link key policy command
|
|
17
|
+
*/
|
|
18
|
+
export interface LinkKeyPolicyInput {
|
|
19
|
+
/** The key id */
|
|
20
|
+
keyId: string;
|
|
21
|
+
/** The policy id */
|
|
22
|
+
policyId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Link a policy to a key
|
|
26
|
+
*/
|
|
27
|
+
export declare class LinkKeyPolicyCommand extends Command<LinkKeyPolicyInput, KeyPolicyLink> {
|
|
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): KeyPolicyLink;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=link-key-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-key-policy.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/link-key-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,OAAO,CAAC;IACxC,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,KAAK,EAAE,OAAO,CAAA;CACf,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAA;AAE9D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,OAAO,CAC/C,kBAAkB,EAClB,aAAa,CACd;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,aAAa;CAGtE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a key policy link response
|
|
5
|
+
*/
|
|
6
|
+
export const KeyPolicyLinkSchema = Type.Object({
|
|
7
|
+
policyId: Type.String(),
|
|
8
|
+
organizationId: Type.String(),
|
|
9
|
+
keyId: Type.String(),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Link a policy to a key
|
|
13
|
+
*/
|
|
14
|
+
export class LinkKeyPolicyCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the command should retry on failure
|
|
17
|
+
*/
|
|
18
|
+
retryOnFailure = false;
|
|
19
|
+
/**
|
|
20
|
+
* Get the method
|
|
21
|
+
*/
|
|
22
|
+
getMethod() {
|
|
23
|
+
return "POST";
|
|
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/policy-associations/key/${this.input.keyId}/`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the body
|
|
39
|
+
*/
|
|
40
|
+
getBody() {
|
|
41
|
+
return {
|
|
42
|
+
policyId: this.input.policyId,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Parse the response
|
|
47
|
+
*/
|
|
48
|
+
parseResponse(rawResponse) {
|
|
49
|
+
return parseResponseHelper(KeyPolicyLinkSchema, rawResponse);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Command } from "@flowcore/sdk";
|
|
2
|
+
import { type Static, type TObject, type TString } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a role policy link response
|
|
5
|
+
*/
|
|
6
|
+
export declare const RolePolicyLinkSchema: TObject<{
|
|
7
|
+
policyId: TString;
|
|
8
|
+
organizationId: TString;
|
|
9
|
+
roleId: TString;
|
|
10
|
+
}>;
|
|
11
|
+
/**
|
|
12
|
+
* The role policy link response type
|
|
13
|
+
*/
|
|
14
|
+
export type RolePolicyLink = Static<typeof RolePolicyLinkSchema>;
|
|
15
|
+
/**
|
|
16
|
+
* The input for the link role policy command
|
|
17
|
+
*/
|
|
18
|
+
export interface LinkRolePolicyInput {
|
|
19
|
+
/** The role id */
|
|
20
|
+
roleId: string;
|
|
21
|
+
/** The policy id */
|
|
22
|
+
policyId: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Link a policy to a role
|
|
26
|
+
*/
|
|
27
|
+
export declare class LinkRolePolicyCommand extends Command<LinkRolePolicyInput, RolePolicyLink> {
|
|
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): RolePolicyLink;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=link-role-policy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link-role-policy.d.ts","sourceRoot":"","sources":["../../../../src/commands/iam/policy-associations/link-role-policy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAuB,MAAM,eAAe,CAAA;AAC5D,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,OAAO,EAAQ,MAAM,mBAAmB,CAAA;AAEjF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC;IACzC,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,MAAM,EAAE,OAAO,CAAA;CAChB,CAIC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEhE;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,kBAAkB;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,oBAAoB;IACpB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,OAAO,CAChD,mBAAmB,EACnB,cAAc,CACf;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,cAAc;CAGvE"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Command, parseResponseHelper } from "@flowcore/sdk";
|
|
2
|
+
import { Type } from "@sinclair/typebox";
|
|
3
|
+
/**
|
|
4
|
+
* The schema for a role policy link response
|
|
5
|
+
*/
|
|
6
|
+
export const RolePolicyLinkSchema = Type.Object({
|
|
7
|
+
policyId: Type.String(),
|
|
8
|
+
organizationId: Type.String(),
|
|
9
|
+
roleId: Type.String(),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Link a policy to a role
|
|
13
|
+
*/
|
|
14
|
+
export class LinkRolePolicyCommand extends Command {
|
|
15
|
+
/**
|
|
16
|
+
* Whether the command should retry on failure
|
|
17
|
+
*/
|
|
18
|
+
retryOnFailure = false;
|
|
19
|
+
/**
|
|
20
|
+
* Get the method
|
|
21
|
+
*/
|
|
22
|
+
getMethod() {
|
|
23
|
+
return "POST";
|
|
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/policy-associations/role/${this.input.roleId}/`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Get the body
|
|
39
|
+
*/
|
|
40
|
+
getBody() {
|
|
41
|
+
return {
|
|
42
|
+
policyId: this.input.policyId,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Parse the response
|
|
47
|
+
*/
|
|
48
|
+
parseResponse(rawResponse) {
|
|
49
|
+
return parseResponseHelper(RolePolicyLinkSchema, rawResponse);
|
|
50
|
+
}
|
|
51
|
+
}
|