diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 2c84362e..ca8df252 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 6a2d7b70-1321-499a-8677-a99a42c2e4b6 management: - docChecksum: e344d3248cac62f007bfc04f1e1ff9f0 + docChecksum: 1cf21ef1e0362daa534ba0a0c24a7cf8 docVersion: 0.0.1 - speakeasyVersion: 1.606.10 - generationVersion: 2.687.13 - releaseVersion: 1.0.10 - configChecksum: 7ac90f65253453196448728b01dfc3d8 + speakeasyVersion: 1.609.0 + generationVersion: 2.692.0 + releaseVersion: 1.0.11 + configChecksum: 5266f713dc28311d477d2368626e6306 repoURL: https://github.com/firehydrant/firehydrant-typescript-sdk.git installationURL: https://github.com/firehydrant/firehydrant-typescript-sdk published: true @@ -14,7 +14,7 @@ features: typescript: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.12 - core: 3.21.20 + core: 3.21.22 defaultEnabledRetries: 0.1.0 devContainers: 2.90.0 enumUnions: 0.1.0 @@ -142,6 +142,8 @@ generatedFiles: - docs/models/components/createpostmortemreason.md - docs/models/components/createpostmortemreport.md - docs/models/components/createpriority.md + - docs/models/components/createrole.md + - docs/models/components/createrolepermission.md - docs/models/components/createrunbook.md - docs/models/components/createrunbookattachmentrule.md - docs/models/components/createrunbookexecution.md @@ -377,6 +379,7 @@ generatedFiles: - docs/models/components/nullablechangeevententityattachment.md - docs/models/components/nullablechangeevententitylabels.md - docs/models/components/nullableconversationsapientitieschannel.md + - docs/models/components/nullableemptyvotesentity.md - docs/models/components/nullableeventnoteentity.md - docs/models/components/nullableexternalresourceentity.md - docs/models/components/nullablefhtypesgenericentity.md @@ -478,6 +481,7 @@ generatedFiles: - docs/models/components/organizationscustomfielddefinitionentity.md - docs/models/components/overrideoncallschedulerotationshifts.md - docs/models/components/patchscimuser.md + - docs/models/components/permissionentitylist.md - docs/models/components/pongentity.md - docs/models/components/postmortemspostmortemreportentity.md - docs/models/components/postmortemspostmortemreportentitypaginated.md @@ -511,6 +515,8 @@ generatedFiles: - docs/models/components/publicapiv1incidentssuccinctentity.md - docs/models/components/publicapiv1incidentstranscriptentity.md - docs/models/components/publicapiv1integrationsauthedproviderentity.md + - docs/models/components/publicapiv1permissionentity.md + - docs/models/components/publicapiv1roleentity.md - docs/models/components/publicapiv1similarincidententity.md - docs/models/components/publish.md - docs/models/components/publishpostmortemreport.md @@ -524,6 +530,7 @@ generatedFiles: - docs/models/components/retrospectivesindextemplateentitypaginated.md - docs/models/components/retrospectivestemplateentity.md - docs/models/components/retrospectivestemplateentityincidentsectionentity.md + - docs/models/components/roleentitypaginated.md - docs/models/components/runbookentity.md - docs/models/components/runbooks.md - docs/models/components/runbooksactionsentity.md @@ -706,6 +713,8 @@ generatedFiles: - docs/models/components/updatepostmortemreport.md - docs/models/components/updatepostmortemreportquestion.md - docs/models/components/updatepriority.md + - docs/models/components/updaterole.md + - docs/models/components/updaterolepermission.md - docs/models/components/updaterunbook.md - docs/models/components/updaterunbookattachmentrule.md - docs/models/components/updaterunbookexecutionstep.md @@ -909,6 +918,7 @@ generatedFiles: - docs/models/operations/deletepostmortemreasonrequest.md - docs/models/operations/deletepriorityrequest.md - docs/models/operations/deleteretrospectivetemplaterequest.md + - docs/models/operations/deleterolerequest.md - docs/models/operations/deleterunbookexecutionrequest.md - docs/models/operations/deleterunbookrequest.md - docs/models/operations/deletesavedsearchrequest.md @@ -985,6 +995,7 @@ generatedFiles: - docs/models/operations/getpostmortemreportrequest.md - docs/models/operations/getpriorityrequest.md - docs/models/operations/getretrospectivetemplaterequest.md + - docs/models/operations/getrolerequest.md - docs/models/operations/getrunbookactionfieldoptionsrequest.md - docs/models/operations/getrunbookexecutionrequest.md - docs/models/operations/getrunbookexecutionstepscriptrequest.md @@ -1111,6 +1122,7 @@ generatedFiles: - docs/models/operations/listretrospectivemetricsrequest.md - docs/models/operations/listretrospectivesrequest.md - docs/models/operations/listretrospectivetemplatesrequest.md + - docs/models/operations/listrolesrequest.md - docs/models/operations/listrunbookactionsrequest.md - docs/models/operations/listrunbookauditsrequest.md - docs/models/operations/listrunbookexecutionsrequest.md @@ -1240,6 +1252,7 @@ generatedFiles: - docs/models/operations/updateretrospectivetemplatefieldstype.md - docs/models/operations/updateretrospectivetemplaterequest.md - docs/models/operations/updateretrospectivetemplaterequestbody.md + - docs/models/operations/updaterolerequest.md - docs/models/operations/updaterunbookexecutionsteprequest.md - docs/models/operations/updaterunbookexecutionstepscriptrequest.md - docs/models/operations/updaterunbookrequest.md @@ -1292,7 +1305,9 @@ generatedFiles: - docs/sdks/integrations/README.md - docs/sdks/metricsreporting/README.md - docs/sdks/pages/README.md + - docs/sdks/permissions/README.md - docs/sdks/retrospectives/README.md + - docs/sdks/roles/README.md - docs/sdks/runbooks/README.md - docs/sdks/scim/README.md - docs/sdks/signals/README.md @@ -1559,6 +1574,9 @@ generatedFiles: - src/funcs/metricsReportingListUserInvolvementMetrics.ts - src/funcs/metricsReportingUpdateSavedSearch.ts - src/funcs/pagesCreateSignalsPage.ts + - src/funcs/permissionsListCurrentUserPermissions.ts + - src/funcs/permissionsListPermissions.ts + - src/funcs/permissionsListTeamPermissions.ts - src/funcs/retrospectivesCreateIncidentRetrospective.ts - src/funcs/retrospectivesCreateIncidentRetrospectiveDynamicInput.ts - src/funcs/retrospectivesCreateIncidentRetrospectiveField.ts @@ -1589,6 +1607,11 @@ generatedFiles: - src/funcs/retrospectivesUpdatePostMortemReason.ts - src/funcs/retrospectivesUpdatePostMortemReport.ts - src/funcs/retrospectivesUpdateRetrospectiveTemplate.ts + - src/funcs/rolesCreateRole.ts + - src/funcs/rolesDeleteRole.ts + - src/funcs/rolesGetRole.ts + - src/funcs/rolesListRoles.ts + - src/funcs/rolesUpdateRole.ts - src/funcs/runbooksCreateRunbook.ts - src/funcs/runbooksCreateRunbookExecution.ts - src/funcs/runbooksDeleteRunbook.ts @@ -2033,6 +2056,9 @@ generatedFiles: - src/mcp-server/tools/metricsReportingListUserInvolvementMetrics.ts - src/mcp-server/tools/metricsReportingUpdateSavedSearch.ts - src/mcp-server/tools/pagesCreateSignalsPage.ts + - src/mcp-server/tools/permissionsListCurrentUserPermissions.ts + - src/mcp-server/tools/permissionsListPermissions.ts + - src/mcp-server/tools/permissionsListTeamPermissions.ts - src/mcp-server/tools/retrospectivesCreateIncidentRetrospective.ts - src/mcp-server/tools/retrospectivesCreateIncidentRetrospectiveDynamicInput.ts - src/mcp-server/tools/retrospectivesCreateIncidentRetrospectiveField.ts @@ -2063,6 +2089,11 @@ generatedFiles: - src/mcp-server/tools/retrospectivesUpdatePostMortemReason.ts - src/mcp-server/tools/retrospectivesUpdatePostMortemReport.ts - src/mcp-server/tools/retrospectivesUpdateRetrospectiveTemplate.ts + - src/mcp-server/tools/rolesCreateRole.ts + - src/mcp-server/tools/rolesDeleteRole.ts + - src/mcp-server/tools/rolesGetRole.ts + - src/mcp-server/tools/rolesListRoles.ts + - src/mcp-server/tools/rolesUpdateRole.ts - src/mcp-server/tools/runbooksCreateRunbook.ts - src/mcp-server/tools/runbooksCreateRunbookExecution.ts - src/mcp-server/tools/runbooksDeleteRunbook.ts @@ -2286,6 +2317,7 @@ generatedFiles: - src/models/components/createpostmortemreason.ts - src/models/components/createpostmortemreport.ts - src/models/components/createpriority.ts + - src/models/components/createrole.ts - src/models/components/createrunbook.ts - src/models/components/createrunbookexecution.ts - src/models/components/createsavedsearch.ts @@ -2411,6 +2443,7 @@ generatedFiles: - src/models/components/nullablecalendarsevententity.ts - src/models/components/nullablechangeevententity.ts - src/models/components/nullableconversationsapientitieschannel.ts + - src/models/components/nullableemptyvotesentity.ts - src/models/components/nullableeventnoteentity.ts - src/models/components/nullableexternalresourceentity.ts - src/models/components/nullablefhtypesgenericentity.ts @@ -2488,6 +2521,7 @@ generatedFiles: - src/models/components/organizationscustomfielddefinitionentity.ts - src/models/components/overrideoncallschedulerotationshifts.ts - src/models/components/patchscimuser.ts + - src/models/components/permissionentitylist.ts - src/models/components/pongentity.ts - src/models/components/postmortemspostmortemreportentity.ts - src/models/components/postmortemspostmortemreportentitypaginated.ts @@ -2504,6 +2538,8 @@ generatedFiles: - src/models/components/publicapiv1incidentssuccinctentity.ts - src/models/components/publicapiv1incidentstranscriptentity.ts - src/models/components/publicapiv1integrationsauthedproviderentity.ts + - src/models/components/publicapiv1permissionentity.ts + - src/models/components/publicapiv1roleentity.ts - src/models/components/publicapiv1similarincidententity.ts - src/models/components/publishpostmortemreport.ts - src/models/components/reorderpostmortemreasons.ts @@ -2515,6 +2551,7 @@ generatedFiles: - src/models/components/retrospectivesindextemplateentitypaginated.ts - src/models/components/retrospectivestemplateentity.ts - src/models/components/retrospectivestemplateentityincidentsectionentity.ts + - src/models/components/roleentitypaginated.ts - src/models/components/runbookentity.ts - src/models/components/runbooksactionsentity.ts - src/models/components/runbooksactionsentitypaginated.ts @@ -2637,6 +2674,7 @@ generatedFiles: - src/models/components/updatepostmortemreason.ts - src/models/components/updatepostmortemreport.ts - src/models/components/updatepriority.ts + - src/models/components/updaterole.ts - src/models/components/updaterunbook.ts - src/models/components/updaterunbookexecutionstep.ts - src/models/components/updatesavedsearch.ts @@ -2761,6 +2799,7 @@ generatedFiles: - src/models/operations/deletepostmortemreason.ts - src/models/operations/deletepriority.ts - src/models/operations/deleteretrospectivetemplate.ts + - src/models/operations/deleterole.ts - src/models/operations/deleterunbook.ts - src/models/operations/deleterunbookexecution.ts - src/models/operations/deletesavedsearch.ts @@ -2832,6 +2871,7 @@ generatedFiles: - src/models/operations/getpostmortemreport.ts - src/models/operations/getpriority.ts - src/models/operations/getretrospectivetemplate.ts + - src/models/operations/getrole.ts - src/models/operations/getrunbook.ts - src/models/operations/getrunbookactionfieldoptions.ts - src/models/operations/getrunbookexecution.ts @@ -2933,6 +2973,7 @@ generatedFiles: - src/models/operations/listretrospectivemetrics.ts - src/models/operations/listretrospectives.ts - src/models/operations/listretrospectivetemplates.ts + - src/models/operations/listroles.ts - src/models/operations/listrunbookactions.ts - src/models/operations/listrunbookaudits.ts - src/models/operations/listrunbookexecutions.ts @@ -3032,6 +3073,7 @@ generatedFiles: - src/models/operations/updatepostmortemreport.ts - src/models/operations/updatepriority.ts - src/models/operations/updateretrospectivetemplate.ts + - src/models/operations/updaterole.ts - src/models/operations/updaterunbook.ts - src/models/operations/updaterunbookexecutionstep.ts - src/models/operations/updaterunbookexecutionstepscript.ts @@ -3079,7 +3121,9 @@ generatedFiles: - src/sdk/integrations.ts - src/sdk/metricsreporting.ts - src/sdk/pages.ts + - src/sdk/permissions.ts - src/sdk/retrospectives.ts + - src/sdk/roles.ts - src/sdk/runbooks.ts - src/sdk/scim.ts - src/sdk/sdk.ts @@ -6493,5 +6537,55 @@ examples: responses: "201": application/json: {"signal_rule": {"deduplication_expiry": "PT1H"}, "parent_alerts": [{"signal_rule": {"deduplication_expiry": "PT1H"}}], "child_alerts": [{"signal_rule": {"deduplication_expiry": "PT1H"}}]} + list_permissions: + speakeasy-default-list-permissions: + responses: + "200": + application/json: {} + list_current_user_permissions: + speakeasy-default-list-current-user-permissions: + responses: + "200": + application/json: {} + list_team_permissions: + speakeasy-default-list-team-permissions: + responses: + "200": + application/json: {} + list_roles: + speakeasy-default-list-roles: + responses: + "200": + application/json: {} + create_role: + speakeasy-default-create-role: + requestBody: + application/json: {"name": ""} + responses: + "201": + application/json: {} + get_role: + speakeasy-default-get-role: + parameters: + path: + id: "" + responses: + "200": + application/json: {} + delete_role: + speakeasy-default-delete-role: + parameters: + path: + id: "" + update_role: + speakeasy-default-update-role: + parameters: + path: + id: "" + requestBody: + application/json: {"name": ""} + responses: + "200": + application/json: {} examplesVersion: 1.0.2 generatedTests: {} diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 679d2680..9545e6cd 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -24,7 +24,7 @@ generation: generateNewTests: false skipResponseBodyAssertions: false typescript: - version: 1.0.10 + version: 1.0.11 additionalDependencies: dependencies: {} devDependencies: {} diff --git a/.speakeasy/workflow.lock b/.speakeasy/workflow.lock index 0b6733e4..6f4449bd 100644 --- a/.speakeasy/workflow.lock +++ b/.speakeasy/workflow.lock @@ -1,12 +1,12 @@ -speakeasyVersion: 1.606.10 +speakeasyVersion: 1.609.0 sources: firehydrant-oas: sourceNamespace: firehydrant-oas - sourceRevisionDigest: sha256:65cfce63dada027846f94ffca1e42c264e93b4492f87ef504151ab38f82cc5a4 - sourceBlobDigest: sha256:8c5bca268e51f545c5f389f28ca02cae5abf287b24559c416fae5b1f03f6fbd3 + sourceRevisionDigest: sha256:cbef1c238eb886da937d1aae09079b8ead60ef48be68c6be2041bac02b4669cc + sourceBlobDigest: sha256:40ca76a505d6c9874d8090f0d7233da5ec156cbece9db3e44bb981476d664adb tags: - latest - - speakeasy-sdk-regen-1756339664 + - speakeasy-sdk-regen-1756858033 - 0.0.1 firehydrant-typescript-sdk-OAS: sourceNamespace: firehydrant-typescript-sdk-oas @@ -19,10 +19,10 @@ targets: firehydrant-typescript-sdk: source: firehydrant-oas sourceNamespace: firehydrant-oas - sourceRevisionDigest: sha256:65cfce63dada027846f94ffca1e42c264e93b4492f87ef504151ab38f82cc5a4 - sourceBlobDigest: sha256:8c5bca268e51f545c5f389f28ca02cae5abf287b24559c416fae5b1f03f6fbd3 + sourceRevisionDigest: sha256:cbef1c238eb886da937d1aae09079b8ead60ef48be68c6be2041bac02b4669cc + sourceBlobDigest: sha256:40ca76a505d6c9874d8090f0d7233da5ec156cbece9db3e44bb981476d664adb codeSamplesNamespace: firehydrant-typescript-sdk-oas-code-samples - codeSamplesRevisionDigest: sha256:6e83155512b83be39f64fbbdce762e2144cd4c1f45249111c9a9350dda597b09 + codeSamplesRevisionDigest: sha256:7109c5ce1b1136e7e8119a57f7b858f6a263c0447e2c80056d55a782046589aa workflow: workflowVersion: 1.0.0 speakeasyVersion: latest diff --git a/README.md b/README.md index e0d76b47..40df807a 100644 --- a/README.md +++ b/README.md @@ -614,6 +614,12 @@ run(); * [createSignalsPage](docs/sdks/pages/README.md#createsignalspage) - Pages a target +### [permissions](docs/sdks/permissions/README.md) + +* [listPermissions](docs/sdks/permissions/README.md#listpermissions) - List permissions +* [listCurrentUserPermissions](docs/sdks/permissions/README.md#listcurrentuserpermissions) - Get all permissions for the current user +* [listTeamPermissions](docs/sdks/permissions/README.md#listteampermissions) - Get all permissions for a team + ### [retrospectives](docs/sdks/retrospectives/README.md) * [shareIncidentRetrospectives](docs/sdks/retrospectives/README.md#shareincidentretrospectives) - Share an incident's retrospective @@ -647,6 +653,14 @@ run(); * [deleteRetrospectiveTemplate](docs/sdks/retrospectives/README.md#deleteretrospectivetemplate) - Delete a retrospective template * [updateRetrospectiveTemplate](docs/sdks/retrospectives/README.md#updateretrospectivetemplate) - Update a retrospective template +### [roles](docs/sdks/roles/README.md) + +* [listRoles](docs/sdks/roles/README.md#listroles) - Get all roles +* [createRole](docs/sdks/roles/README.md#createrole) - Create a role +* [getRole](docs/sdks/roles/README.md#getrole) - Get a role +* [deleteRole](docs/sdks/roles/README.md#deleterole) - Delete a role +* [updateRole](docs/sdks/roles/README.md#updaterole) - Update a role + ### [runbooks](docs/sdks/runbooks/README.md) * [listRunbookActions](docs/sdks/runbooks/README.md#listrunbookactions) - List runbook actions @@ -1103,6 +1117,9 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`metricsReportingListUserInvolvementMetrics`](docs/sdks/metricsreporting/README.md#listuserinvolvementmetrics) - List user metrics - [`metricsReportingUpdateSavedSearch`](docs/sdks/metricsreporting/README.md#updatesavedsearch) - Update a saved search - [`pagesCreateSignalsPage`](docs/sdks/pages/README.md#createsignalspage) - Pages a target +- [`permissionsListCurrentUserPermissions`](docs/sdks/permissions/README.md#listcurrentuserpermissions) - Get all permissions for the current user +- [`permissionsListPermissions`](docs/sdks/permissions/README.md#listpermissions) - List permissions +- [`permissionsListTeamPermissions`](docs/sdks/permissions/README.md#listteampermissions) - Get all permissions for a team - [`retrospectivesCreateIncidentRetrospective`](docs/sdks/retrospectives/README.md#createincidentretrospective) - Create a new retrospective on the incident using the template - [`retrospectivesCreateIncidentRetrospectiveDynamicInput`](docs/sdks/retrospectives/README.md#createincidentretrospectivedynamicinput) - Add a new dynamic input field to a retrospective's dynamic input group field - [`retrospectivesCreateIncidentRetrospectiveField`](docs/sdks/retrospectives/README.md#createincidentretrospectivefield) - Appends a new incident retrospective field to an incident retrospective @@ -1133,6 +1150,11 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`retrospectivesUpdatePostMortemReason`](docs/sdks/retrospectives/README.md#updatepostmortemreason) - Update a contributing factor in a retrospective report - [`retrospectivesUpdatePostMortemReport`](docs/sdks/retrospectives/README.md#updatepostmortemreport) - Update a retrospective report - [`retrospectivesUpdateRetrospectiveTemplate`](docs/sdks/retrospectives/README.md#updateretrospectivetemplate) - Update a retrospective template +- [`rolesCreateRole`](docs/sdks/roles/README.md#createrole) - Create a role +- [`rolesDeleteRole`](docs/sdks/roles/README.md#deleterole) - Delete a role +- [`rolesGetRole`](docs/sdks/roles/README.md#getrole) - Get a role +- [`rolesListRoles`](docs/sdks/roles/README.md#listroles) - Get all roles +- [`rolesUpdateRole`](docs/sdks/roles/README.md#updaterole) - Update a role - [`runbooksCreateRunbook`](docs/sdks/runbooks/README.md#createrunbook) - Create a runbook - [`runbooksCreateRunbookExecution`](docs/sdks/runbooks/README.md#createrunbookexecution) - Create a runbook execution - [`runbooksDeleteRunbook`](docs/sdks/runbooks/README.md#deleterunbook) - Delete a runbook @@ -1471,7 +1493,7 @@ run(); **Inherit from [`FirehydrantError`](./src/models/errors/firehydranterror.ts)**: -* [`ErrorEntity`](./src/models/errors/errorentity.ts): ErrorEntity model. Applicable to 12 of 441 methods.* +* [`ErrorEntity`](./src/models/errors/errorentity.ts): ErrorEntity model. Applicable to 12 of 449 methods.* * [`ResponseValidationError`](./src/models/errors/responsevalidationerror.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string. diff --git a/RELEASES.md b/RELEASES.md index e1917aae..e7c71b7b 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -196,4 +196,14 @@ Based on: ### Generated - [typescript v1.0.10] . ### Releases -- [NPM v1.0.10] https://www.npmjs.com/package/firehydrant-typescript-sdk/v/1.0.10 - . \ No newline at end of file +- [NPM v1.0.10] https://www.npmjs.com/package/firehydrant-typescript-sdk/v/1.0.10 - . + +## 2025-09-04 00:07:05 +### Changes +Based on: +- OpenAPI Doc +- Speakeasy CLI 1.609.0 (2.692.0) https://github.com/speakeasy-api/speakeasy +### Generated +- [typescript v1.0.11] . +### Releases +- [NPM v1.0.11] https://www.npmjs.com/package/firehydrant-typescript-sdk/v/1.0.11 - . \ No newline at end of file diff --git a/docs/models/components/createrole.md b/docs/models/components/createrole.md new file mode 100644 index 00000000..b70e6d13 --- /dev/null +++ b/docs/models/components/createrole.md @@ -0,0 +1,22 @@ +# CreateRole + +Create a new role + +## Example Usage + +```typescript +import { CreateRole } from "firehydrant-typescript-sdk/models/components"; + +let value: CreateRole = { + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | The name of the role. | +| `slug` | *string* | :heavy_minus_sign: | A unique identifier for the role. If not provided, one will be generated from the name. | +| `description` | *string* | :heavy_minus_sign: | A long-form description of the role's purpose. | +| `permissions` | [components.CreateRolePermission](../../models/components/createrolepermission.md)[] | :heavy_minus_sign: | An array of permission slugs to assign to the role. | \ No newline at end of file diff --git a/docs/models/components/createrolepermission.md b/docs/models/components/createrolepermission.md new file mode 100644 index 00000000..8cf11ab0 --- /dev/null +++ b/docs/models/components/createrolepermission.md @@ -0,0 +1,15 @@ +# CreateRolePermission + +## Example Usage + +```typescript +import { CreateRolePermission } from "firehydrant-typescript-sdk/models/components"; + +let value: CreateRolePermission = "manage_incident_settings"; +``` + +## Values + +```typescript +"create_alerts" | "respond_to_alerts" | "read_alerts" | "manage_alert_grouping" | "read_alert_grouping" | "manage_alert_rules" | "read_alert_rules" | "manage_call_routes" | "read_call_routes" | "manage_escalation_policies" | "read_escalation_policies" | "manage_event_sources" | "read_event_sources" | "manage_on_call_schedules" | "read_on_call_schedules" | "manage_on_call_shifts" | "claim_on_call_shifts" | "manage_organization_notification_policies" | "read_notification_policy_compliance" | "manage_webhook_targets" | "read_webhook_targets" | "read_analytics" | "manage_api_keys" | "read_api_keys" | "manage_audiences" | "read_audiences" | "read_audit_events" | "manage_change_events" | "read_change_events" | "manage_incidents" | "create_incidents" | "read_incidents" | "manage_incident_settings" | "read_incident_settings" | "manage_integrations" | "read_integrations" | "manage_private_incidents" | "manage_organization_secrets" | "read_organization_secrets" | "manage_organization_settings" | "read_organization_settings" | "manage_roles" | "read_roles" | "manage_runbooks" | "read_runbooks" | "manage_service_catalog" | "read_service_catalog" | "manage_status_templates" | "read_status_templates" | "manage_status_page_updates" | "manage_support_hours" | "read_support_hours" | "manage_teams" | "read_teams" | "manage_users" | "read_users" | "manage_webhooks" | "read_webhooks" +``` \ No newline at end of file diff --git a/docs/models/components/nullableemptyvotesentity.md b/docs/models/components/nullableemptyvotesentity.md new file mode 100644 index 00000000..9d582fb1 --- /dev/null +++ b/docs/models/components/nullableemptyvotesentity.md @@ -0,0 +1,19 @@ +# NullableEmptyVotesEntity + +## Example Usage + +```typescript +import { NullableEmptyVotesEntity } from "firehydrant-typescript-sdk/models/components"; + +let value: NullableEmptyVotesEntity = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `voted` | *boolean* | :heavy_minus_sign: | Whether or not the current actor has voted | +| `liked` | *boolean* | :heavy_minus_sign: | Whether or not the current actor has voted positively | +| `disliked` | *boolean* | :heavy_minus_sign: | Whether or not the current actor has voted negatively | +| `likes` | *number* | :heavy_minus_sign: | N/A | +| `dislikes` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/permissionentitylist.md b/docs/models/components/permissionentitylist.md new file mode 100644 index 00000000..6253a53f --- /dev/null +++ b/docs/models/components/permissionentitylist.md @@ -0,0 +1,17 @@ +# PermissionEntityList + +PermissionEntityList model + +## Example Usage + +```typescript +import { PermissionEntityList } from "firehydrant-typescript-sdk/models/components"; + +let value: PermissionEntityList = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `data` | [components.PublicApiv1PermissionEntity](../../models/components/publicapiv1permissionentity.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/publicapiv1permissionentity.md b/docs/models/components/publicapiv1permissionentity.md new file mode 100644 index 00000000..977bf5ea --- /dev/null +++ b/docs/models/components/publicapiv1permissionentity.md @@ -0,0 +1,22 @@ +# PublicApiv1PermissionEntity + +## Example Usage + +```typescript +import { PublicApiv1PermissionEntity } from "firehydrant-typescript-sdk/models/components"; + +let value: PublicApiv1PermissionEntity = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------- | --------------------- | --------------------- | --------------------- | +| `slug` | *string* | :heavy_minus_sign: | N/A | +| `displayName` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `categoryDisplayName` | *string* | :heavy_minus_sign: | N/A | +| `categorySlug` | *string* | :heavy_minus_sign: | N/A | +| `parentSlug` | *string* | :heavy_minus_sign: | N/A | +| `available` | *boolean* | :heavy_minus_sign: | N/A | +| `dependencySlugs` | *string*[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/publicapiv1roleentity.md b/docs/models/components/publicapiv1roleentity.md new file mode 100644 index 00000000..0346eb0f --- /dev/null +++ b/docs/models/components/publicapiv1roleentity.md @@ -0,0 +1,25 @@ +# PublicApiv1RoleEntity + +PublicAPI_V1_RoleEntity model + +## Example Usage + +```typescript +import { PublicApiv1RoleEntity } from "firehydrant-typescript-sdk/models/components"; + +let value: PublicApiv1RoleEntity = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | N/A | +| `name` | *string* | :heavy_minus_sign: | N/A | +| `slug` | *string* | :heavy_minus_sign: | N/A | +| `description` | *string* | :heavy_minus_sign: | N/A | +| `createdAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `updatedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | N/A | +| `builtIn` | *boolean* | :heavy_minus_sign: | N/A | +| `readOnly` | *boolean* | :heavy_minus_sign: | N/A | +| `permissions` | [components.PublicApiv1PermissionEntity](../../models/components/publicapiv1permissionentity.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/roleentitypaginated.md b/docs/models/components/roleentitypaginated.md new file mode 100644 index 00000000..f86afa89 --- /dev/null +++ b/docs/models/components/roleentitypaginated.md @@ -0,0 +1,18 @@ +# RoleEntityPaginated + +RoleEntityPaginated model + +## Example Usage + +```typescript +import { RoleEntityPaginated } from "firehydrant-typescript-sdk/models/components"; + +let value: RoleEntityPaginated = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `data` | [components.PublicApiv1RoleEntity](../../models/components/publicapiv1roleentity.md)[] | :heavy_minus_sign: | N/A | +| `pagination` | [components.NullablePaginationEntity](../../models/components/nullablepaginationentity.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/runbookentity.md b/docs/models/components/runbookentity.md index a7d9cbf1..7139f885 100644 --- a/docs/models/components/runbookentity.md +++ b/docs/models/components/runbookentity.md @@ -26,7 +26,7 @@ let value: RunbookEntity = {}; | `updatedBy` | [components.NullableAuthorEntity](../../models/components/nullableauthorentity.md) | :heavy_minus_sign: | N/A | | `steps` | [components.RunbookStepEntity](../../models/components/runbookstepentity.md)[] | :heavy_minus_sign: | N/A | | `attachmentRule` | [components.NullableRulesRuleEntity](../../models/components/nullablerulesruleentity.md) | :heavy_minus_sign: | N/A | -| `votes` | [components.NullableVotesEntity](../../models/components/nullablevotesentity.md) | :heavy_minus_sign: | N/A | +| `votes` | [components.NullableEmptyVotesEntity](../../models/components/nullableemptyvotesentity.md) | :heavy_minus_sign: | N/A | | `isEditable` | *boolean* | :heavy_minus_sign: | N/A | | `owner` | [components.NullableTeamEntityLite](../../models/components/nullableteamentitylite.md) | :heavy_minus_sign: | N/A | | `categories` | *string*[] | :heavy_minus_sign: | categories the runbook applies to | diff --git a/docs/models/components/runbookstepentity.md b/docs/models/components/runbookstepentity.md index c636a052..0634e0c1 100644 --- a/docs/models/components/runbookstepentity.md +++ b/docs/models/components/runbookstepentity.md @@ -24,5 +24,5 @@ let value: RunbookStepEntity = {}; | `reruns` | *boolean* | :heavy_minus_sign: | N/A | | `repeats` | *boolean* | :heavy_minus_sign: | N/A | | `repeatsDuration` | *string* | :heavy_minus_sign: | N/A | -| `votes` | [components.NullableVotesEntity](../../models/components/nullablevotesentity.md) | :heavy_minus_sign: | N/A | +| `votes` | [components.NullableEmptyVotesEntity](../../models/components/nullableemptyvotesentity.md) | :heavy_minus_sign: | N/A | | `rule` | [components.NullableRulesRuleEntity](../../models/components/nullablerulesruleentity.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/components/updaterole.md b/docs/models/components/updaterole.md new file mode 100644 index 00000000..80f404bf --- /dev/null +++ b/docs/models/components/updaterole.md @@ -0,0 +1,21 @@ +# UpdateRole + +Update a role + +## Example Usage + +```typescript +import { UpdateRole } from "firehydrant-typescript-sdk/models/components"; + +let value: UpdateRole = { + name: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | +| `name` | *string* | :heavy_check_mark: | The name of the role. | +| `description` | *string* | :heavy_minus_sign: | A long-form description of the role's purpose. | +| `permissions` | [components.UpdateRolePermission](../../models/components/updaterolepermission.md)[] | :heavy_minus_sign: | An array of permission slugs to assign to the role. | \ No newline at end of file diff --git a/docs/models/components/updaterolepermission.md b/docs/models/components/updaterolepermission.md new file mode 100644 index 00000000..e16d0ab4 --- /dev/null +++ b/docs/models/components/updaterolepermission.md @@ -0,0 +1,15 @@ +# UpdateRolePermission + +## Example Usage + +```typescript +import { UpdateRolePermission } from "firehydrant-typescript-sdk/models/components"; + +let value: UpdateRolePermission = "manage_support_hours"; +``` + +## Values + +```typescript +"create_alerts" | "respond_to_alerts" | "read_alerts" | "manage_alert_grouping" | "read_alert_grouping" | "manage_alert_rules" | "read_alert_rules" | "manage_call_routes" | "read_call_routes" | "manage_escalation_policies" | "read_escalation_policies" | "manage_event_sources" | "read_event_sources" | "manage_on_call_schedules" | "read_on_call_schedules" | "manage_on_call_shifts" | "claim_on_call_shifts" | "manage_organization_notification_policies" | "read_notification_policy_compliance" | "manage_webhook_targets" | "read_webhook_targets" | "read_analytics" | "manage_api_keys" | "read_api_keys" | "manage_audiences" | "read_audiences" | "read_audit_events" | "manage_change_events" | "read_change_events" | "manage_incidents" | "create_incidents" | "read_incidents" | "manage_incident_settings" | "read_incident_settings" | "manage_integrations" | "read_integrations" | "manage_private_incidents" | "manage_organization_secrets" | "read_organization_secrets" | "manage_organization_settings" | "read_organization_settings" | "manage_roles" | "read_roles" | "manage_runbooks" | "read_runbooks" | "manage_service_catalog" | "read_service_catalog" | "manage_status_templates" | "read_status_templates" | "manage_status_page_updates" | "manage_support_hours" | "read_support_hours" | "manage_teams" | "read_teams" | "manage_users" | "read_users" | "manage_webhooks" | "read_webhooks" +``` \ No newline at end of file diff --git a/docs/models/operations/deleterolerequest.md b/docs/models/operations/deleterolerequest.md new file mode 100644 index 00000000..0781901b --- /dev/null +++ b/docs/models/operations/deleterolerequest.md @@ -0,0 +1,17 @@ +# DeleteRoleRequest + +## Example Usage + +```typescript +import { DeleteRoleRequest } from "firehydrant-typescript-sdk/models/operations"; + +let value: DeleteRoleRequest = { + id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/getrolerequest.md b/docs/models/operations/getrolerequest.md new file mode 100644 index 00000000..9920032a --- /dev/null +++ b/docs/models/operations/getrolerequest.md @@ -0,0 +1,17 @@ +# GetRoleRequest + +## Example Usage + +```typescript +import { GetRoleRequest } from "firehydrant-typescript-sdk/models/operations"; + +let value: GetRoleRequest = { + id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `id` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/models/operations/listrolesrequest.md b/docs/models/operations/listrolesrequest.md new file mode 100644 index 00000000..5b808119 --- /dev/null +++ b/docs/models/operations/listrolesrequest.md @@ -0,0 +1,17 @@ +# ListRolesRequest + +## Example Usage + +```typescript +import { ListRolesRequest } from "firehydrant-typescript-sdk/models/operations"; + +let value: ListRolesRequest = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | ------------------------------------------------ | +| `query` | *string* | :heavy_minus_sign: | A search query to filter roles by name and slug. | +| `page` | *number* | :heavy_minus_sign: | N/A | +| `perPage` | *number* | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/docs/models/operations/updaterolerequest.md b/docs/models/operations/updaterolerequest.md new file mode 100644 index 00000000..e1fb5dab --- /dev/null +++ b/docs/models/operations/updaterolerequest.md @@ -0,0 +1,21 @@ +# UpdateRoleRequest + +## Example Usage + +```typescript +import { UpdateRoleRequest } from "firehydrant-typescript-sdk/models/operations"; + +let value: UpdateRoleRequest = { + id: "", + updateRole: { + name: "", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | N/A | +| `updateRole` | [components.UpdateRole](../../models/components/updaterole.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/docs/sdks/permissions/README.md b/docs/sdks/permissions/README.md new file mode 100644 index 00000000..55e0cfd6 --- /dev/null +++ b/docs/sdks/permissions/README.md @@ -0,0 +1,216 @@ +# Permissions +(*permissions*) + +## Overview + +Operations about Permissions + +### Available Operations + +* [listPermissions](#listpermissions) - List permissions +* [listCurrentUserPermissions](#listcurrentuserpermissions) - Get all permissions for the current user +* [listTeamPermissions](#listteampermissions) - Get all permissions for a team + +## listPermissions + +List all permissions in the organization + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.permissions.listPermissions(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { permissionsListPermissions } from "firehydrant-typescript-sdk/funcs/permissionsListPermissions.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await permissionsListPermissions(firehydrant); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("permissionsListPermissions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PermissionEntityList](../../models/components/permissionentitylist.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## listCurrentUserPermissions + +Get all permissions for the current user + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.permissions.listCurrentUserPermissions(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { permissionsListCurrentUserPermissions } from "firehydrant-typescript-sdk/funcs/permissionsListCurrentUserPermissions.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await permissionsListCurrentUserPermissions(firehydrant); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("permissionsListCurrentUserPermissions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PermissionEntityList](../../models/components/permissionentitylist.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## listTeamPermissions + +Get all permissions for a team + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.permissions.listTeamPermissions(); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { permissionsListTeamPermissions } from "firehydrant-typescript-sdk/funcs/permissionsListTeamPermissions.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await permissionsListTeamPermissions(firehydrant); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("permissionsListTeamPermissions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PermissionEntityList](../../models/components/permissionentitylist.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/roles/README.md b/docs/sdks/roles/README.md new file mode 100644 index 00000000..4cb50d8d --- /dev/null +++ b/docs/sdks/roles/README.md @@ -0,0 +1,381 @@ +# Roles +(*roles*) + +## Overview + +Operations about Roles + +### Available Operations + +* [listRoles](#listroles) - Get all roles +* [createRole](#createrole) - Create a role +* [getRole](#getrole) - Get a role +* [deleteRole](#deleterole) - Delete a role +* [updateRole](#updaterole) - Update a role + +## listRoles + +Get all roles in the organization + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.roles.listRoles({}); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { rolesListRoles } from "firehydrant-typescript-sdk/funcs/rolesListRoles.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await rolesListRoles(firehydrant, {}); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("rolesListRoles failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListRolesRequest](../../models/operations/listrolesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.RoleEntityPaginated](../../models/components/roleentitypaginated.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## createRole + +Create a new role + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.roles.createRole({ + name: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { rolesCreateRole } from "firehydrant-typescript-sdk/funcs/rolesCreateRole.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await rolesCreateRole(firehydrant, { + name: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("rolesCreateRole failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [components.CreateRole](../../models/components/createrole.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PublicApiv1RoleEntity](../../models/components/publicapiv1roleentity.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## getRole + +Get a role + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.roles.getRole({ + id: "", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { rolesGetRole } from "firehydrant-typescript-sdk/funcs/rolesGetRole.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await rolesGetRole(firehydrant, { + id: "", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("rolesGetRole failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetRoleRequest](../../models/operations/getrolerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PublicApiv1RoleEntity](../../models/components/publicapiv1roleentity.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## deleteRole + +Delete a role + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + await firehydrant.roles.deleteRole({ + id: "", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { rolesDeleteRole } from "firehydrant-typescript-sdk/funcs/rolesDeleteRole.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await rolesDeleteRole(firehydrant, { + id: "", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("rolesDeleteRole failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteRoleRequest](../../models/operations/deleterolerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | + +## updateRole + +Update a role + +### Example Usage + + +```typescript +import { Firehydrant } from "firehydrant-typescript-sdk"; + +const firehydrant = new Firehydrant({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const result = await firehydrant.roles.updateRole({ + id: "", + updateRole: { + name: "", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { FirehydrantCore } from "firehydrant-typescript-sdk/core.js"; +import { rolesUpdateRole } from "firehydrant-typescript-sdk/funcs/rolesUpdateRole.js"; + +// Use `FirehydrantCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const firehydrant = new FirehydrantCore({ + apiKey: process.env["FIREHYDRANT_API_KEY"] ?? "", +}); + +async function run() { + const res = await rolesUpdateRole(firehydrant, { + id: "", + updateRole: { + name: "", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("rolesUpdateRole failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateRoleRequest](../../models/operations/updaterolerequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[components.PublicApiv1RoleEntity](../../models/components/publicapiv1roleentity.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------- | --------------- | --------------- | +| errors.APIError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/docs/sdks/runbooks/README.md b/docs/sdks/runbooks/README.md index fe533d49..1a8063cd 100644 --- a/docs/sdks/runbooks/README.md +++ b/docs/sdks/runbooks/README.md @@ -1063,7 +1063,7 @@ run(); ## listRunbookAudits -Please contact support to enable audit logging for your account. +This endpoint is deprecated. ### Example Usage diff --git a/examples/package-lock.json b/examples/package-lock.json index 1295b1e8..5f6aa502 100644 --- a/examples/package-lock.json +++ b/examples/package-lock.json @@ -18,7 +18,7 @@ }, "..": { "name": "firehydrant-typescript-sdk", - "version": "1.0.10", + "version": "1.0.11", "dependencies": { "zod": "^3.20.0" }, diff --git a/jsr.json b/jsr.json index 344da710..063a5b84 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "firehydrant-typescript-sdk", - "version": "1.0.10", + "version": "1.0.11", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package-lock.json b/package-lock.json index 35a0f40f..1b2e03a0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "firehydrant-typescript-sdk", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "firehydrant-typescript-sdk", - "version": "1.0.10", + "version": "1.0.11", "dependencies": { "zod": "^3.20.0" }, diff --git a/package.json b/package.json index aade7646..e2480637 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "firehydrant-typescript-sdk", - "version": "1.0.10", + "version": "1.0.11", "author": "Firehydrant", "type": "module", "bin": { diff --git a/src/funcs/permissionsListCurrentUserPermissions.ts b/src/funcs/permissionsListCurrentUserPermissions.ts new file mode 100644 index 00000000..ff8098e2 --- /dev/null +++ b/src/funcs/permissionsListCurrentUserPermissions.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get all permissions for the current user + * + * @remarks + * Get all permissions for the current user + */ +export function permissionsListCurrentUserPermissions( + client: FirehydrantCore, + options?: RequestOptions, +): APIPromise< + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: FirehydrantCore, + options?: RequestOptions, +): Promise< + [ + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const path = pathToFunc("/v1/permissions/current_user")(); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "list_current_user_permissions", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PermissionEntityList$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/permissionsListPermissions.ts b/src/funcs/permissionsListPermissions.ts new file mode 100644 index 00000000..2a0cfd8b --- /dev/null +++ b/src/funcs/permissionsListPermissions.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * List permissions + * + * @remarks + * List all permissions in the organization + */ +export function permissionsListPermissions( + client: FirehydrantCore, + options?: RequestOptions, +): APIPromise< + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: FirehydrantCore, + options?: RequestOptions, +): Promise< + [ + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const path = pathToFunc("/v1/permissions")(); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "list_permissions", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PermissionEntityList$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/permissionsListTeamPermissions.ts b/src/funcs/permissionsListTeamPermissions.ts new file mode 100644 index 00000000..5aadfb19 --- /dev/null +++ b/src/funcs/permissionsListTeamPermissions.ts @@ -0,0 +1,142 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get all permissions for a team + * + * @remarks + * Get all permissions for a team + */ +export function permissionsListTeamPermissions( + client: FirehydrantCore, + options?: RequestOptions, +): APIPromise< + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + options, + )); +} + +async function $do( + client: FirehydrantCore, + options?: RequestOptions, +): Promise< + [ + Result< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const path = pathToFunc("/v1/permissions/team")(); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "list_team_permissions", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PermissionEntityList, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PermissionEntityList$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/rolesCreateRole.ts b/src/funcs/rolesCreateRole.ts new file mode 100644 index 00000000..bf927171 --- /dev/null +++ b/src/funcs/rolesCreateRole.ts @@ -0,0 +1,160 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import { encodeJSON } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Create a role + * + * @remarks + * Create a new role + */ +export function rolesCreateRole( + client: FirehydrantCore, + request: components.CreateRole, + options?: RequestOptions, +): APIPromise< + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: FirehydrantCore, + request: components.CreateRole, + options?: RequestOptions, +): Promise< + [ + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => components.CreateRole$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload, { explode: true }); + + const path = pathToFunc("/v1/roles")(); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "create_role", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "POST", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(201, components.PublicApiv1RoleEntity$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/rolesDeleteRole.ts b/src/funcs/rolesDeleteRole.ts new file mode 100644 index 00000000..81134968 --- /dev/null +++ b/src/funcs/rolesDeleteRole.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { FirehydrantCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete a role + * + * @remarks + * Delete a role + */ +export function rolesDeleteRole( + client: FirehydrantCore, + request: operations.DeleteRoleRequest, + options?: RequestOptions, +): APIPromise< + Result< + void, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: FirehydrantCore, + request: operations.DeleteRoleRequest, + options?: RequestOptions, +): Promise< + [ + Result< + void, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.DeleteRoleRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/roles/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "*/*", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "delete_role", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + void, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.nil(204, z.void()), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/rolesGetRole.ts b/src/funcs/rolesGetRole.ts new file mode 100644 index 00000000..0536c313 --- /dev/null +++ b/src/funcs/rolesGetRole.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get a role + * + * @remarks + * Get a role + */ +export function rolesGetRole( + client: FirehydrantCore, + request: operations.GetRoleRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: FirehydrantCore, + request: operations.GetRoleRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.GetRoleRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/roles/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "get_role", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PublicApiv1RoleEntity$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/rolesListRoles.ts b/src/funcs/rolesListRoles.ts new file mode 100644 index 00000000..24e342c0 --- /dev/null +++ b/src/funcs/rolesListRoles.ts @@ -0,0 +1,167 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import { encodeFormQuery } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Get all roles + * + * @remarks + * Get all roles in the organization + */ +export function rolesListRoles( + client: FirehydrantCore, + request: operations.ListRolesRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.RoleEntityPaginated, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: FirehydrantCore, + request: operations.ListRolesRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.RoleEntityPaginated, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.ListRolesRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const path = pathToFunc("/v1/roles")(); + + const query = encodeFormQuery({ + "page": payload.page, + "per_page": payload.per_page, + "query": payload.query, + }); + + const headers = new Headers(compactMap({ + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "list_roles", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "GET", + baseURL: options?.serverURL, + path: path, + headers: headers, + query: query, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.RoleEntityPaginated, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.RoleEntityPaginated$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/rolesUpdateRole.ts b/src/funcs/rolesUpdateRole.ts new file mode 100644 index 00000000..04521536 --- /dev/null +++ b/src/funcs/rolesUpdateRole.ts @@ -0,0 +1,168 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { FirehydrantCore } from "../core.js"; +import { encodeJSON, encodeSimple } from "../lib/encodings.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import * as components from "../models/components/index.js"; +import { FirehydrantError } from "../models/errors/firehydranterror.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/httpclienterrors.js"; +import { ResponseValidationError } from "../models/errors/responsevalidationerror.js"; +import { SDKValidationError } from "../models/errors/sdkvalidationerror.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Update a role + * + * @remarks + * Update a role + */ +export function rolesUpdateRole( + client: FirehydrantCore, + request: operations.UpdateRoleRequest, + options?: RequestOptions, +): APIPromise< + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + request, + options, + )); +} + +async function $do( + client: FirehydrantCore, + request: operations.UpdateRoleRequest, + options?: RequestOptions, +): Promise< + [ + Result< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const parsed = safeParse( + request, + (value) => operations.UpdateRoleRequest$outboundSchema.parse(value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = encodeJSON("body", payload.update_role, { explode: true }); + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + + const path = pathToFunc("/v1/roles/{id}")(pathParams); + + const headers = new Headers(compactMap({ + "Content-Type": "application/json", + Accept: "application/json", + })); + + const secConfig = await extractSecurity(client._options.apiKey); + const securityInput = secConfig == null ? {} : { apiKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "update_role", + oAuth2Scopes: [], + + resolvedSecurity: requestSecurity, + + securitySource: client._options.apiKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "PATCH", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + errorCodes: ["4XX", "5XX"], + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const [result] = await M.match< + components.PublicApiv1RoleEntity, + | FirehydrantError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, components.PublicApiv1RoleEntity$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/funcs/runbooksListRunbookAudits.ts b/src/funcs/runbooksListRunbookAudits.ts index dc26e6ea..ec3f257b 100644 --- a/src/funcs/runbooksListRunbookAudits.ts +++ b/src/funcs/runbooksListRunbookAudits.ts @@ -29,7 +29,7 @@ import { Result } from "../types/fp.js"; * List runbook audits * * @remarks - * Please contact support to enable audit logging for your account. + * This endpoint is deprecated. */ export function runbooksListRunbookAudits( client: FirehydrantCore, diff --git a/src/lib/config.ts b/src/lib/config.ts index 3bdc15d5..40b654f2 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "0.0.1", - sdkVersion: "1.0.10", - genVersion: "2.687.13", + sdkVersion: "1.0.11", + genVersion: "2.692.0", userAgent: - "speakeasy-sdk/typescript 1.0.10 2.687.13 0.0.1 firehydrant-typescript-sdk", + "speakeasy-sdk/typescript 1.0.11 2.692.0 0.0.1 firehydrant-typescript-sdk", } as const; diff --git a/src/mcp-server/mcp-server.ts b/src/mcp-server/mcp-server.ts index 96818fd3..f1f97974 100644 --- a/src/mcp-server/mcp-server.ts +++ b/src/mcp-server/mcp-server.ts @@ -19,7 +19,7 @@ const routes = buildRouteMap({ export const app = buildApplication(routes, { name: "mcp", versionInfo: { - currentVersion: "1.0.10", + currentVersion: "1.0.11", }, }); diff --git a/src/mcp-server/server.ts b/src/mcp-server/server.ts index 9836a8af..f2af10e5 100644 --- a/src/mcp-server/server.ts +++ b/src/mcp-server/server.ts @@ -261,6 +261,9 @@ import { tool$metricsReportingListSavedSearches } from "./tools/metricsReporting import { tool$metricsReportingListUserInvolvementMetrics } from "./tools/metricsReportingListUserInvolvementMetrics.js"; import { tool$metricsReportingUpdateSavedSearch } from "./tools/metricsReportingUpdateSavedSearch.js"; import { tool$pagesCreateSignalsPage } from "./tools/pagesCreateSignalsPage.js"; +import { tool$permissionsListCurrentUserPermissions } from "./tools/permissionsListCurrentUserPermissions.js"; +import { tool$permissionsListPermissions } from "./tools/permissionsListPermissions.js"; +import { tool$permissionsListTeamPermissions } from "./tools/permissionsListTeamPermissions.js"; import { tool$retrospectivesCreateIncidentRetrospective } from "./tools/retrospectivesCreateIncidentRetrospective.js"; import { tool$retrospectivesCreateIncidentRetrospectiveDynamicInput } from "./tools/retrospectivesCreateIncidentRetrospectiveDynamicInput.js"; import { tool$retrospectivesCreateIncidentRetrospectiveField } from "./tools/retrospectivesCreateIncidentRetrospectiveField.js"; @@ -291,6 +294,11 @@ import { tool$retrospectivesUpdatePostMortemQuestions } from "./tools/retrospect import { tool$retrospectivesUpdatePostMortemReason } from "./tools/retrospectivesUpdatePostMortemReason.js"; import { tool$retrospectivesUpdatePostMortemReport } from "./tools/retrospectivesUpdatePostMortemReport.js"; import { tool$retrospectivesUpdateRetrospectiveTemplate } from "./tools/retrospectivesUpdateRetrospectiveTemplate.js"; +import { tool$rolesCreateRole } from "./tools/rolesCreateRole.js"; +import { tool$rolesDeleteRole } from "./tools/rolesDeleteRole.js"; +import { tool$rolesGetRole } from "./tools/rolesGetRole.js"; +import { tool$rolesListRoles } from "./tools/rolesListRoles.js"; +import { tool$rolesUpdateRole } from "./tools/rolesUpdateRole.js"; import { tool$runbooksCreateRunbook } from "./tools/runbooksCreateRunbook.js"; import { tool$runbooksCreateRunbookExecution } from "./tools/runbooksCreateRunbookExecution.js"; import { tool$runbooksDeleteRunbook } from "./tools/runbooksDeleteRunbook.js"; @@ -465,7 +473,7 @@ export function createMCPServer(deps: { }) { const server = new McpServer({ name: "Firehydrant", - version: "1.0.10", + version: "1.0.11", }); const client = new FirehydrantCore({ @@ -840,6 +848,9 @@ export function createMCPServer(deps: { tool(tool$usersListUsers); tool(tool$usersGetUser); tool(tool$usersGetCurrentUser); + tool(tool$permissionsListPermissions); + tool(tool$permissionsListCurrentUserPermissions); + tool(tool$permissionsListTeamPermissions); tool(tool$metricsReportingGetMeanTimeReport); tool(tool$metricsReportingListRetrospectiveMetrics); tool(tool$metricsReportingListUserInvolvementMetrics); @@ -855,6 +866,11 @@ export function createMCPServer(deps: { tool(tool$metricsReportingGetSignalsGroupedMetrics); tool(tool$metricsReportingGetSignalsMttxAnalytics); tool(tool$metricsReportingGetSignalsNoiseAnalytics); + tool(tool$rolesListRoles); + tool(tool$rolesCreateRole); + tool(tool$rolesGetRole); + tool(tool$rolesDeleteRole); + tool(tool$rolesUpdateRole); tool(tool$runbooksListRunbookActions); tool(tool$runbooksListRunbookExecutions); tool(tool$runbooksCreateRunbookExecution); diff --git a/src/mcp-server/tools/permissionsListCurrentUserPermissions.ts b/src/mcp-server/tools/permissionsListCurrentUserPermissions.ts new file mode 100644 index 00000000..7e508f2d --- /dev/null +++ b/src/mcp-server/tools/permissionsListCurrentUserPermissions.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { permissionsListCurrentUserPermissions } from "../../funcs/permissionsListCurrentUserPermissions.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$permissionsListCurrentUserPermissions: ToolDefinition = { + name: "permissions-list-current-user-permissions", + description: `Get all permissions for the current user + +Get all permissions for the current user`, + tool: async (client, ctx) => { + const [result, apiCall] = await permissionsListCurrentUserPermissions( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/permissionsListPermissions.ts b/src/mcp-server/tools/permissionsListPermissions.ts new file mode 100644 index 00000000..a3816359 --- /dev/null +++ b/src/mcp-server/tools/permissionsListPermissions.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { permissionsListPermissions } from "../../funcs/permissionsListPermissions.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$permissionsListPermissions: ToolDefinition = { + name: "permissions-list-permissions", + description: `List permissions + +List all permissions in the organization`, + tool: async (client, ctx) => { + const [result, apiCall] = await permissionsListPermissions( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/permissionsListTeamPermissions.ts b/src/mcp-server/tools/permissionsListTeamPermissions.ts new file mode 100644 index 00000000..63016568 --- /dev/null +++ b/src/mcp-server/tools/permissionsListTeamPermissions.ts @@ -0,0 +1,30 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { permissionsListTeamPermissions } from "../../funcs/permissionsListTeamPermissions.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +export const tool$permissionsListTeamPermissions: ToolDefinition = { + name: "permissions-list-team-permissions", + description: `Get all permissions for a team + +Get all permissions for a team`, + tool: async (client, ctx) => { + const [result, apiCall] = await permissionsListTeamPermissions( + client, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/rolesCreateRole.ts b/src/mcp-server/tools/rolesCreateRole.ts new file mode 100644 index 00000000..c351936c --- /dev/null +++ b/src/mcp-server/tools/rolesCreateRole.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesCreateRole } from "../../funcs/rolesCreateRole.js"; +import * as components from "../../models/components/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: components.CreateRole$inboundSchema, +}; + +export const tool$rolesCreateRole: ToolDefinition = { + name: "roles-create-role", + description: `Create a role + +Create a new role`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await rolesCreateRole( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/rolesDeleteRole.ts b/src/mcp-server/tools/rolesDeleteRole.ts new file mode 100644 index 00000000..7774b6fd --- /dev/null +++ b/src/mcp-server/tools/rolesDeleteRole.ts @@ -0,0 +1,35 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesDeleteRole } from "../../funcs/rolesDeleteRole.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.DeleteRoleRequest$inboundSchema, +}; + +export const tool$rolesDeleteRole: ToolDefinition = { + name: "roles-delete-role", + description: `Delete a role + +Delete a role`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await rolesDeleteRole( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + return formatResult(void 0, apiCall); + }, +}; diff --git a/src/mcp-server/tools/rolesGetRole.ts b/src/mcp-server/tools/rolesGetRole.ts new file mode 100644 index 00000000..98ae24f5 --- /dev/null +++ b/src/mcp-server/tools/rolesGetRole.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesGetRole } from "../../funcs/rolesGetRole.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.GetRoleRequest$inboundSchema, +}; + +export const tool$rolesGetRole: ToolDefinition = { + name: "roles-get-role", + description: `Get a role + +Get a role`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await rolesGetRole( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/rolesListRoles.ts b/src/mcp-server/tools/rolesListRoles.ts new file mode 100644 index 00000000..be3c225c --- /dev/null +++ b/src/mcp-server/tools/rolesListRoles.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesListRoles } from "../../funcs/rolesListRoles.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.ListRolesRequest$inboundSchema, +}; + +export const tool$rolesListRoles: ToolDefinition = { + name: "roles-list-roles", + description: `Get all roles + +Get all roles in the organization`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await rolesListRoles( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/rolesUpdateRole.ts b/src/mcp-server/tools/rolesUpdateRole.ts new file mode 100644 index 00000000..db44eefc --- /dev/null +++ b/src/mcp-server/tools/rolesUpdateRole.ts @@ -0,0 +1,37 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesUpdateRole } from "../../funcs/rolesUpdateRole.js"; +import * as operations from "../../models/operations/index.js"; +import { formatResult, ToolDefinition } from "../tools.js"; + +const args = { + request: operations.UpdateRoleRequest$inboundSchema, +}; + +export const tool$rolesUpdateRole: ToolDefinition = { + name: "roles-update-role", + description: `Update a role + +Update a role`, + args, + tool: async (client, args, ctx) => { + const [result, apiCall] = await rolesUpdateRole( + client, + args.request, + { fetchOptions: { signal: ctx.signal } }, + ).$inspect(); + + if (!result.ok) { + return { + content: [{ type: "text", text: result.error.message }], + isError: true, + }; + } + + const value = result.value; + + return formatResult(value, apiCall); + }, +}; diff --git a/src/mcp-server/tools/runbooksListRunbookAudits.ts b/src/mcp-server/tools/runbooksListRunbookAudits.ts index 0923edeb..638e8f5e 100644 --- a/src/mcp-server/tools/runbooksListRunbookAudits.ts +++ b/src/mcp-server/tools/runbooksListRunbookAudits.ts @@ -14,7 +14,7 @@ export const tool$runbooksListRunbookAudits: ToolDefinition = { name: "runbooks-list-runbook-audits", description: `List runbook audits -Please contact support to enable audit logging for your account.`, +This endpoint is deprecated.`, args, tool: async (client, args, ctx) => { const [result, apiCall] = await runbooksListRunbookAudits( diff --git a/src/models/components/createrole.ts b/src/models/components/createrole.ts new file mode 100644 index 00000000..a91f014a --- /dev/null +++ b/src/models/components/createrole.ts @@ -0,0 +1,176 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export const CreateRolePermission = { + CreateAlerts: "create_alerts", + RespondToAlerts: "respond_to_alerts", + ReadAlerts: "read_alerts", + ManageAlertGrouping: "manage_alert_grouping", + ReadAlertGrouping: "read_alert_grouping", + ManageAlertRules: "manage_alert_rules", + ReadAlertRules: "read_alert_rules", + ManageCallRoutes: "manage_call_routes", + ReadCallRoutes: "read_call_routes", + ManageEscalationPolicies: "manage_escalation_policies", + ReadEscalationPolicies: "read_escalation_policies", + ManageEventSources: "manage_event_sources", + ReadEventSources: "read_event_sources", + ManageOnCallSchedules: "manage_on_call_schedules", + ReadOnCallSchedules: "read_on_call_schedules", + ManageOnCallShifts: "manage_on_call_shifts", + ClaimOnCallShifts: "claim_on_call_shifts", + ManageOrganizationNotificationPolicies: + "manage_organization_notification_policies", + ReadNotificationPolicyCompliance: "read_notification_policy_compliance", + ManageWebhookTargets: "manage_webhook_targets", + ReadWebhookTargets: "read_webhook_targets", + ReadAnalytics: "read_analytics", + ManageApiKeys: "manage_api_keys", + ReadApiKeys: "read_api_keys", + ManageAudiences: "manage_audiences", + ReadAudiences: "read_audiences", + ReadAuditEvents: "read_audit_events", + ManageChangeEvents: "manage_change_events", + ReadChangeEvents: "read_change_events", + ManageIncidents: "manage_incidents", + CreateIncidents: "create_incidents", + ReadIncidents: "read_incidents", + ManageIncidentSettings: "manage_incident_settings", + ReadIncidentSettings: "read_incident_settings", + ManageIntegrations: "manage_integrations", + ReadIntegrations: "read_integrations", + ManagePrivateIncidents: "manage_private_incidents", + ManageOrganizationSecrets: "manage_organization_secrets", + ReadOrganizationSecrets: "read_organization_secrets", + ManageOrganizationSettings: "manage_organization_settings", + ReadOrganizationSettings: "read_organization_settings", + ManageRoles: "manage_roles", + ReadRoles: "read_roles", + ManageRunbooks: "manage_runbooks", + ReadRunbooks: "read_runbooks", + ManageServiceCatalog: "manage_service_catalog", + ReadServiceCatalog: "read_service_catalog", + ManageStatusTemplates: "manage_status_templates", + ReadStatusTemplates: "read_status_templates", + ManageStatusPageUpdates: "manage_status_page_updates", + ManageSupportHours: "manage_support_hours", + ReadSupportHours: "read_support_hours", + ManageTeams: "manage_teams", + ReadTeams: "read_teams", + ManageUsers: "manage_users", + ReadUsers: "read_users", + ManageWebhooks: "manage_webhooks", + ReadWebhooks: "read_webhooks", +} as const; +export type CreateRolePermission = ClosedEnum; + +/** + * Create a new role + */ +export type CreateRole = { + /** + * The name of the role. + */ + name: string; + /** + * A unique identifier for the role. If not provided, one will be generated from the name. + */ + slug?: string | null | undefined; + /** + * A long-form description of the role's purpose. + */ + description?: string | null | undefined; + /** + * An array of permission slugs to assign to the role. + */ + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const CreateRolePermission$inboundSchema: z.ZodNativeEnum< + typeof CreateRolePermission +> = z.nativeEnum(CreateRolePermission); + +/** @internal */ +export const CreateRolePermission$outboundSchema: z.ZodNativeEnum< + typeof CreateRolePermission +> = CreateRolePermission$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateRolePermission$ { + /** @deprecated use `CreateRolePermission$inboundSchema` instead. */ + export const inboundSchema = CreateRolePermission$inboundSchema; + /** @deprecated use `CreateRolePermission$outboundSchema` instead. */ + export const outboundSchema = CreateRolePermission$outboundSchema; +} + +/** @internal */ +export const CreateRole$inboundSchema: z.ZodType< + CreateRole, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + slug: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + permissions: z.nullable(z.array(CreateRolePermission$inboundSchema)) + .optional(), +}); + +/** @internal */ +export type CreateRole$Outbound = { + name: string; + slug?: string | null | undefined; + description?: string | null | undefined; + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const CreateRole$outboundSchema: z.ZodType< + CreateRole$Outbound, + z.ZodTypeDef, + CreateRole +> = z.object({ + name: z.string(), + slug: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + permissions: z.nullable(z.array(CreateRolePermission$outboundSchema)) + .optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace CreateRole$ { + /** @deprecated use `CreateRole$inboundSchema` instead. */ + export const inboundSchema = CreateRole$inboundSchema; + /** @deprecated use `CreateRole$outboundSchema` instead. */ + export const outboundSchema = CreateRole$outboundSchema; + /** @deprecated use `CreateRole$Outbound` instead. */ + export type Outbound = CreateRole$Outbound; +} + +export function createRoleToJSON(createRole: CreateRole): string { + return JSON.stringify(CreateRole$outboundSchema.parse(createRole)); +} + +export function createRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => CreateRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'CreateRole' from JSON`, + ); +} diff --git a/src/models/components/index.ts b/src/models/components/index.ts index 120efb27..69176167 100644 --- a/src/models/components/index.ts +++ b/src/models/components/index.ts @@ -62,6 +62,7 @@ export * from "./createoncallshift.js"; export * from "./createpostmortemreason.js"; export * from "./createpostmortemreport.js"; export * from "./createpriority.js"; +export * from "./createrole.js"; export * from "./createrunbook.js"; export * from "./createrunbookexecution.js"; export * from "./createsavedsearch.js"; @@ -186,6 +187,7 @@ export * from "./nullableauthorentity.js"; export * from "./nullablecalendarsevententity.js"; export * from "./nullablechangeevententity.js"; export * from "./nullableconversationsapientitieschannel.js"; +export * from "./nullableemptyvotesentity.js"; export * from "./nullableeventnoteentity.js"; export * from "./nullableexternalresourceentity.js"; export * from "./nullablefhtypesgenericentity.js"; @@ -263,6 +265,7 @@ export * from "./nuncnuncsubscription.js"; export * from "./organizationscustomfielddefinitionentity.js"; export * from "./overrideoncallschedulerotationshifts.js"; export * from "./patchscimuser.js"; +export * from "./permissionentitylist.js"; export * from "./pongentity.js"; export * from "./postmortemspostmortemreportentity.js"; export * from "./postmortemspostmortemreportentitypaginated.js"; @@ -279,6 +282,8 @@ export * from "./publicapiv1formconfigurationsselectedvalueentity.js"; export * from "./publicapiv1incidentssuccinctentity.js"; export * from "./publicapiv1incidentstranscriptentity.js"; export * from "./publicapiv1integrationsauthedproviderentity.js"; +export * from "./publicapiv1permissionentity.js"; +export * from "./publicapiv1roleentity.js"; export * from "./publicapiv1similarincidententity.js"; export * from "./publishpostmortemreport.js"; export * from "./reorderpostmortemreasons.js"; @@ -290,6 +295,7 @@ export * from "./retrospectivesindextemplateentity.js"; export * from "./retrospectivesindextemplateentitypaginated.js"; export * from "./retrospectivestemplateentity.js"; export * from "./retrospectivestemplateentityincidentsectionentity.js"; +export * from "./roleentitypaginated.js"; export * from "./runbookentity.js"; export * from "./runbooksactionsentity.js"; export * from "./runbooksactionsentitypaginated.js"; @@ -412,6 +418,7 @@ export * from "./updatepostmortemquestions.js"; export * from "./updatepostmortemreason.js"; export * from "./updatepostmortemreport.js"; export * from "./updatepriority.js"; +export * from "./updaterole.js"; export * from "./updaterunbook.js"; export * from "./updaterunbookexecutionstep.js"; export * from "./updatesavedsearch.js"; diff --git a/src/models/components/nullableemptyvotesentity.ts b/src/models/components/nullableemptyvotesentity.ts new file mode 100644 index 00000000..ad6cf39d --- /dev/null +++ b/src/models/components/nullableemptyvotesentity.ts @@ -0,0 +1,91 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type NullableEmptyVotesEntity = { + /** + * Whether or not the current actor has voted + */ + voted?: boolean | null | undefined; + /** + * Whether or not the current actor has voted positively + */ + liked?: boolean | null | undefined; + /** + * Whether or not the current actor has voted negatively + */ + disliked?: boolean | null | undefined; + likes?: number | null | undefined; + dislikes?: number | null | undefined; +}; + +/** @internal */ +export const NullableEmptyVotesEntity$inboundSchema: z.ZodType< + NullableEmptyVotesEntity, + z.ZodTypeDef, + unknown +> = z.object({ + voted: z.nullable(z.boolean()).optional(), + liked: z.nullable(z.boolean()).optional(), + disliked: z.nullable(z.boolean()).optional(), + likes: z.nullable(z.number().int()).optional(), + dislikes: z.nullable(z.number().int()).optional(), +}); + +/** @internal */ +export type NullableEmptyVotesEntity$Outbound = { + voted?: boolean | null | undefined; + liked?: boolean | null | undefined; + disliked?: boolean | null | undefined; + likes?: number | null | undefined; + dislikes?: number | null | undefined; +}; + +/** @internal */ +export const NullableEmptyVotesEntity$outboundSchema: z.ZodType< + NullableEmptyVotesEntity$Outbound, + z.ZodTypeDef, + NullableEmptyVotesEntity +> = z.object({ + voted: z.nullable(z.boolean()).optional(), + liked: z.nullable(z.boolean()).optional(), + disliked: z.nullable(z.boolean()).optional(), + likes: z.nullable(z.number().int()).optional(), + dislikes: z.nullable(z.number().int()).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace NullableEmptyVotesEntity$ { + /** @deprecated use `NullableEmptyVotesEntity$inboundSchema` instead. */ + export const inboundSchema = NullableEmptyVotesEntity$inboundSchema; + /** @deprecated use `NullableEmptyVotesEntity$outboundSchema` instead. */ + export const outboundSchema = NullableEmptyVotesEntity$outboundSchema; + /** @deprecated use `NullableEmptyVotesEntity$Outbound` instead. */ + export type Outbound = NullableEmptyVotesEntity$Outbound; +} + +export function nullableEmptyVotesEntityToJSON( + nullableEmptyVotesEntity: NullableEmptyVotesEntity, +): string { + return JSON.stringify( + NullableEmptyVotesEntity$outboundSchema.parse(nullableEmptyVotesEntity), + ); +} + +export function nullableEmptyVotesEntityFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => NullableEmptyVotesEntity$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'NullableEmptyVotesEntity' from JSON`, + ); +} diff --git a/src/models/components/permissionentitylist.ts b/src/models/components/permissionentitylist.ts new file mode 100644 index 00000000..c7ce736f --- /dev/null +++ b/src/models/components/permissionentitylist.ts @@ -0,0 +1,77 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PublicApiv1PermissionEntity, + PublicApiv1PermissionEntity$inboundSchema, + PublicApiv1PermissionEntity$Outbound, + PublicApiv1PermissionEntity$outboundSchema, +} from "./publicapiv1permissionentity.js"; + +/** + * PermissionEntityList model + */ +export type PermissionEntityList = { + data?: Array | null | undefined; +}; + +/** @internal */ +export const PermissionEntityList$inboundSchema: z.ZodType< + PermissionEntityList, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.nullable(z.array(PublicApiv1PermissionEntity$inboundSchema)) + .optional(), +}); + +/** @internal */ +export type PermissionEntityList$Outbound = { + data?: Array | null | undefined; +}; + +/** @internal */ +export const PermissionEntityList$outboundSchema: z.ZodType< + PermissionEntityList$Outbound, + z.ZodTypeDef, + PermissionEntityList +> = z.object({ + data: z.nullable(z.array(PublicApiv1PermissionEntity$outboundSchema)) + .optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PermissionEntityList$ { + /** @deprecated use `PermissionEntityList$inboundSchema` instead. */ + export const inboundSchema = PermissionEntityList$inboundSchema; + /** @deprecated use `PermissionEntityList$outboundSchema` instead. */ + export const outboundSchema = PermissionEntityList$outboundSchema; + /** @deprecated use `PermissionEntityList$Outbound` instead. */ + export type Outbound = PermissionEntityList$Outbound; +} + +export function permissionEntityListToJSON( + permissionEntityList: PermissionEntityList, +): string { + return JSON.stringify( + PermissionEntityList$outboundSchema.parse(permissionEntityList), + ); +} + +export function permissionEntityListFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PermissionEntityList$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PermissionEntityList' from JSON`, + ); +} diff --git a/src/models/components/publicapiv1permissionentity.ts b/src/models/components/publicapiv1permissionentity.ts new file mode 100644 index 00000000..24755963 --- /dev/null +++ b/src/models/components/publicapiv1permissionentity.ts @@ -0,0 +1,113 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type PublicApiv1PermissionEntity = { + slug?: string | null | undefined; + displayName?: string | null | undefined; + description?: string | null | undefined; + categoryDisplayName?: string | null | undefined; + categorySlug?: string | null | undefined; + parentSlug?: string | null | undefined; + available?: boolean | null | undefined; + dependencySlugs?: Array | null | undefined; +}; + +/** @internal */ +export const PublicApiv1PermissionEntity$inboundSchema: z.ZodType< + PublicApiv1PermissionEntity, + z.ZodTypeDef, + unknown +> = z.object({ + slug: z.nullable(z.string()).optional(), + display_name: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + category_display_name: z.nullable(z.string()).optional(), + category_slug: z.nullable(z.string()).optional(), + parent_slug: z.nullable(z.string()).optional(), + available: z.nullable(z.boolean()).optional(), + dependency_slugs: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + "display_name": "displayName", + "category_display_name": "categoryDisplayName", + "category_slug": "categorySlug", + "parent_slug": "parentSlug", + "dependency_slugs": "dependencySlugs", + }); +}); + +/** @internal */ +export type PublicApiv1PermissionEntity$Outbound = { + slug?: string | null | undefined; + display_name?: string | null | undefined; + description?: string | null | undefined; + category_display_name?: string | null | undefined; + category_slug?: string | null | undefined; + parent_slug?: string | null | undefined; + available?: boolean | null | undefined; + dependency_slugs?: Array | null | undefined; +}; + +/** @internal */ +export const PublicApiv1PermissionEntity$outboundSchema: z.ZodType< + PublicApiv1PermissionEntity$Outbound, + z.ZodTypeDef, + PublicApiv1PermissionEntity +> = z.object({ + slug: z.nullable(z.string()).optional(), + displayName: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + categoryDisplayName: z.nullable(z.string()).optional(), + categorySlug: z.nullable(z.string()).optional(), + parentSlug: z.nullable(z.string()).optional(), + available: z.nullable(z.boolean()).optional(), + dependencySlugs: z.nullable(z.array(z.string())).optional(), +}).transform((v) => { + return remap$(v, { + displayName: "display_name", + categoryDisplayName: "category_display_name", + categorySlug: "category_slug", + parentSlug: "parent_slug", + dependencySlugs: "dependency_slugs", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PublicApiv1PermissionEntity$ { + /** @deprecated use `PublicApiv1PermissionEntity$inboundSchema` instead. */ + export const inboundSchema = PublicApiv1PermissionEntity$inboundSchema; + /** @deprecated use `PublicApiv1PermissionEntity$outboundSchema` instead. */ + export const outboundSchema = PublicApiv1PermissionEntity$outboundSchema; + /** @deprecated use `PublicApiv1PermissionEntity$Outbound` instead. */ + export type Outbound = PublicApiv1PermissionEntity$Outbound; +} + +export function publicAPIV1PermissionEntityToJSON( + publicApiv1PermissionEntity: PublicApiv1PermissionEntity, +): string { + return JSON.stringify( + PublicApiv1PermissionEntity$outboundSchema.parse( + publicApiv1PermissionEntity, + ), + ); +} + +export function publicAPIV1PermissionEntityFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PublicApiv1PermissionEntity$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PublicApiv1PermissionEntity' from JSON`, + ); +} diff --git a/src/models/components/publicapiv1roleentity.ts b/src/models/components/publicapiv1roleentity.ts new file mode 100644 index 00000000..3b1b1c0d --- /dev/null +++ b/src/models/components/publicapiv1roleentity.ts @@ -0,0 +1,128 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + PublicApiv1PermissionEntity, + PublicApiv1PermissionEntity$inboundSchema, + PublicApiv1PermissionEntity$Outbound, + PublicApiv1PermissionEntity$outboundSchema, +} from "./publicapiv1permissionentity.js"; + +/** + * PublicAPI_V1_RoleEntity model + */ +export type PublicApiv1RoleEntity = { + id?: string | null | undefined; + name?: string | null | undefined; + slug?: string | null | undefined; + description?: string | null | undefined; + createdAt?: Date | null | undefined; + updatedAt?: Date | null | undefined; + builtIn?: boolean | null | undefined; + readOnly?: boolean | null | undefined; + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const PublicApiv1RoleEntity$inboundSchema: z.ZodType< + PublicApiv1RoleEntity, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.nullable(z.string()).optional(), + name: z.nullable(z.string()).optional(), + slug: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + created_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + updated_at: z.nullable( + z.string().datetime({ offset: true }).transform(v => new Date(v)), + ).optional(), + built_in: z.nullable(z.boolean()).optional(), + read_only: z.nullable(z.boolean()).optional(), + permissions: z.nullable(z.array(PublicApiv1PermissionEntity$inboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + "created_at": "createdAt", + "updated_at": "updatedAt", + "built_in": "builtIn", + "read_only": "readOnly", + }); +}); + +/** @internal */ +export type PublicApiv1RoleEntity$Outbound = { + id?: string | null | undefined; + name?: string | null | undefined; + slug?: string | null | undefined; + description?: string | null | undefined; + created_at?: string | null | undefined; + updated_at?: string | null | undefined; + built_in?: boolean | null | undefined; + read_only?: boolean | null | undefined; + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const PublicApiv1RoleEntity$outboundSchema: z.ZodType< + PublicApiv1RoleEntity$Outbound, + z.ZodTypeDef, + PublicApiv1RoleEntity +> = z.object({ + id: z.nullable(z.string()).optional(), + name: z.nullable(z.string()).optional(), + slug: z.nullable(z.string()).optional(), + description: z.nullable(z.string()).optional(), + createdAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + updatedAt: z.nullable(z.date().transform(v => v.toISOString())).optional(), + builtIn: z.nullable(z.boolean()).optional(), + readOnly: z.nullable(z.boolean()).optional(), + permissions: z.nullable(z.array(PublicApiv1PermissionEntity$outboundSchema)) + .optional(), +}).transform((v) => { + return remap$(v, { + createdAt: "created_at", + updatedAt: "updated_at", + builtIn: "built_in", + readOnly: "read_only", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace PublicApiv1RoleEntity$ { + /** @deprecated use `PublicApiv1RoleEntity$inboundSchema` instead. */ + export const inboundSchema = PublicApiv1RoleEntity$inboundSchema; + /** @deprecated use `PublicApiv1RoleEntity$outboundSchema` instead. */ + export const outboundSchema = PublicApiv1RoleEntity$outboundSchema; + /** @deprecated use `PublicApiv1RoleEntity$Outbound` instead. */ + export type Outbound = PublicApiv1RoleEntity$Outbound; +} + +export function publicAPIV1RoleEntityToJSON( + publicApiv1RoleEntity: PublicApiv1RoleEntity, +): string { + return JSON.stringify( + PublicApiv1RoleEntity$outboundSchema.parse(publicApiv1RoleEntity), + ); +} + +export function publicAPIV1RoleEntityFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => PublicApiv1RoleEntity$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'PublicApiv1RoleEntity' from JSON`, + ); +} diff --git a/src/models/components/roleentitypaginated.ts b/src/models/components/roleentitypaginated.ts new file mode 100644 index 00000000..e4acac49 --- /dev/null +++ b/src/models/components/roleentitypaginated.ts @@ -0,0 +1,85 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + NullablePaginationEntity, + NullablePaginationEntity$inboundSchema, + NullablePaginationEntity$Outbound, + NullablePaginationEntity$outboundSchema, +} from "./nullablepaginationentity.js"; +import { + PublicApiv1RoleEntity, + PublicApiv1RoleEntity$inboundSchema, + PublicApiv1RoleEntity$Outbound, + PublicApiv1RoleEntity$outboundSchema, +} from "./publicapiv1roleentity.js"; + +/** + * RoleEntityPaginated model + */ +export type RoleEntityPaginated = { + data?: Array | null | undefined; + pagination?: NullablePaginationEntity | null | undefined; +}; + +/** @internal */ +export const RoleEntityPaginated$inboundSchema: z.ZodType< + RoleEntityPaginated, + z.ZodTypeDef, + unknown +> = z.object({ + data: z.nullable(z.array(PublicApiv1RoleEntity$inboundSchema)).optional(), + pagination: z.nullable(NullablePaginationEntity$inboundSchema).optional(), +}); + +/** @internal */ +export type RoleEntityPaginated$Outbound = { + data?: Array | null | undefined; + pagination?: NullablePaginationEntity$Outbound | null | undefined; +}; + +/** @internal */ +export const RoleEntityPaginated$outboundSchema: z.ZodType< + RoleEntityPaginated$Outbound, + z.ZodTypeDef, + RoleEntityPaginated +> = z.object({ + data: z.nullable(z.array(PublicApiv1RoleEntity$outboundSchema)).optional(), + pagination: z.nullable(NullablePaginationEntity$outboundSchema).optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace RoleEntityPaginated$ { + /** @deprecated use `RoleEntityPaginated$inboundSchema` instead. */ + export const inboundSchema = RoleEntityPaginated$inboundSchema; + /** @deprecated use `RoleEntityPaginated$outboundSchema` instead. */ + export const outboundSchema = RoleEntityPaginated$outboundSchema; + /** @deprecated use `RoleEntityPaginated$Outbound` instead. */ + export type Outbound = RoleEntityPaginated$Outbound; +} + +export function roleEntityPaginatedToJSON( + roleEntityPaginated: RoleEntityPaginated, +): string { + return JSON.stringify( + RoleEntityPaginated$outboundSchema.parse(roleEntityPaginated), + ); +} + +export function roleEntityPaginatedFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => RoleEntityPaginated$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'RoleEntityPaginated' from JSON`, + ); +} diff --git a/src/models/components/runbookentity.ts b/src/models/components/runbookentity.ts index 84ae1563..d555d2fb 100644 --- a/src/models/components/runbookentity.ts +++ b/src/models/components/runbookentity.ts @@ -13,6 +13,12 @@ import { NullableAuthorEntity$Outbound, NullableAuthorEntity$outboundSchema, } from "./nullableauthorentity.js"; +import { + NullableEmptyVotesEntity, + NullableEmptyVotesEntity$inboundSchema, + NullableEmptyVotesEntity$Outbound, + NullableEmptyVotesEntity$outboundSchema, +} from "./nullableemptyvotesentity.js"; import { NullablePublicApiv1IncidentsSuccinctEntity, NullablePublicApiv1IncidentsSuccinctEntity$inboundSchema, @@ -31,12 +37,6 @@ import { NullableTeamEntityLite$Outbound, NullableTeamEntityLite$outboundSchema, } from "./nullableteamentitylite.js"; -import { - NullableVotesEntity, - NullableVotesEntity$inboundSchema, - NullableVotesEntity$Outbound, - NullableVotesEntity$outboundSchema, -} from "./nullablevotesentity.js"; import { RunbookStepEntity, RunbookStepEntity$inboundSchema, @@ -60,7 +60,7 @@ export type RunbookEntity = { updatedBy?: NullableAuthorEntity | null | undefined; steps?: Array | null | undefined; attachmentRule?: NullableRulesRuleEntity | null | undefined; - votes?: NullableVotesEntity | null | undefined; + votes?: NullableEmptyVotesEntity | null | undefined; isEditable?: boolean | null | undefined; owner?: NullableTeamEntityLite | null | undefined; /** @@ -101,7 +101,7 @@ export const RunbookEntity$inboundSchema: z.ZodType< updated_by: z.nullable(NullableAuthorEntity$inboundSchema).optional(), steps: z.nullable(z.array(RunbookStepEntity$inboundSchema)).optional(), attachment_rule: z.nullable(NullableRulesRuleEntity$inboundSchema).optional(), - votes: z.nullable(NullableVotesEntity$inboundSchema).optional(), + votes: z.nullable(NullableEmptyVotesEntity$inboundSchema).optional(), is_editable: z.nullable(z.boolean()).optional(), owner: z.nullable(NullableTeamEntityLite$inboundSchema).optional(), categories: z.nullable(z.array(z.string())).optional(), @@ -142,7 +142,7 @@ export type RunbookEntity$Outbound = { updated_by?: NullableAuthorEntity$Outbound | null | undefined; steps?: Array | null | undefined; attachment_rule?: NullableRulesRuleEntity$Outbound | null | undefined; - votes?: NullableVotesEntity$Outbound | null | undefined; + votes?: NullableEmptyVotesEntity$Outbound | null | undefined; is_editable?: boolean | null | undefined; owner?: NullableTeamEntityLite$Outbound | null | undefined; categories?: Array | null | undefined; @@ -173,7 +173,7 @@ export const RunbookEntity$outboundSchema: z.ZodType< updatedBy: z.nullable(NullableAuthorEntity$outboundSchema).optional(), steps: z.nullable(z.array(RunbookStepEntity$outboundSchema)).optional(), attachmentRule: z.nullable(NullableRulesRuleEntity$outboundSchema).optional(), - votes: z.nullable(NullableVotesEntity$outboundSchema).optional(), + votes: z.nullable(NullableEmptyVotesEntity$outboundSchema).optional(), isEditable: z.nullable(z.boolean()).optional(), owner: z.nullable(NullableTeamEntityLite$outboundSchema).optional(), categories: z.nullable(z.array(z.string())).optional(), diff --git a/src/models/components/runbookstepentity.ts b/src/models/components/runbookstepentity.ts index 30be6a84..c252c8b0 100644 --- a/src/models/components/runbookstepentity.ts +++ b/src/models/components/runbookstepentity.ts @@ -7,6 +7,12 @@ import { remap as remap$ } from "../../lib/primitives.js"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { + NullableEmptyVotesEntity, + NullableEmptyVotesEntity$inboundSchema, + NullableEmptyVotesEntity$Outbound, + NullableEmptyVotesEntity$outboundSchema, +} from "./nullableemptyvotesentity.js"; import { NullableRulesRuleEntity, NullableRulesRuleEntity$inboundSchema, @@ -19,12 +25,6 @@ import { NullableRunbooksActionsEntity$Outbound, NullableRunbooksActionsEntity$outboundSchema, } from "./nullablerunbooksactionsentity.js"; -import { - NullableVotesEntity, - NullableVotesEntity$inboundSchema, - NullableVotesEntity$Outbound, - NullableVotesEntity$outboundSchema, -} from "./nullablevotesentity.js"; /** * An unstructured object of key/value pairs describing the config settings for the step. @@ -57,7 +57,7 @@ export type RunbookStepEntity = { reruns?: boolean | null | undefined; repeats?: boolean | null | undefined; repeatsDuration?: string | null | undefined; - votes?: NullableVotesEntity | null | undefined; + votes?: NullableEmptyVotesEntity | null | undefined; rule?: NullableRulesRuleEntity | null | undefined; }; @@ -226,7 +226,7 @@ export const RunbookStepEntity$inboundSchema: z.ZodType< reruns: z.nullable(z.boolean()).optional(), repeats: z.nullable(z.boolean()).optional(), repeats_duration: z.nullable(z.string()).optional(), - votes: z.nullable(NullableVotesEntity$inboundSchema).optional(), + votes: z.nullable(NullableEmptyVotesEntity$inboundSchema).optional(), rule: z.nullable(NullableRulesRuleEntity$inboundSchema).optional(), }).transform((v) => { return remap$(v, { @@ -256,7 +256,7 @@ export type RunbookStepEntity$Outbound = { reruns?: boolean | null | undefined; repeats?: boolean | null | undefined; repeats_duration?: string | null | undefined; - votes?: NullableVotesEntity$Outbound | null | undefined; + votes?: NullableEmptyVotesEntity$Outbound | null | undefined; rule?: NullableRulesRuleEntity$Outbound | null | undefined; }; @@ -283,7 +283,7 @@ export const RunbookStepEntity$outboundSchema: z.ZodType< reruns: z.nullable(z.boolean()).optional(), repeats: z.nullable(z.boolean()).optional(), repeatsDuration: z.nullable(z.string()).optional(), - votes: z.nullable(NullableVotesEntity$outboundSchema).optional(), + votes: z.nullable(NullableEmptyVotesEntity$outboundSchema).optional(), rule: z.nullable(NullableRulesRuleEntity$outboundSchema).optional(), }).transform((v) => { return remap$(v, { diff --git a/src/models/components/updaterole.ts b/src/models/components/updaterole.ts new file mode 100644 index 00000000..29186ca9 --- /dev/null +++ b/src/models/components/updaterole.ts @@ -0,0 +1,169 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { ClosedEnum } from "../../types/enums.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export const UpdateRolePermission = { + CreateAlerts: "create_alerts", + RespondToAlerts: "respond_to_alerts", + ReadAlerts: "read_alerts", + ManageAlertGrouping: "manage_alert_grouping", + ReadAlertGrouping: "read_alert_grouping", + ManageAlertRules: "manage_alert_rules", + ReadAlertRules: "read_alert_rules", + ManageCallRoutes: "manage_call_routes", + ReadCallRoutes: "read_call_routes", + ManageEscalationPolicies: "manage_escalation_policies", + ReadEscalationPolicies: "read_escalation_policies", + ManageEventSources: "manage_event_sources", + ReadEventSources: "read_event_sources", + ManageOnCallSchedules: "manage_on_call_schedules", + ReadOnCallSchedules: "read_on_call_schedules", + ManageOnCallShifts: "manage_on_call_shifts", + ClaimOnCallShifts: "claim_on_call_shifts", + ManageOrganizationNotificationPolicies: + "manage_organization_notification_policies", + ReadNotificationPolicyCompliance: "read_notification_policy_compliance", + ManageWebhookTargets: "manage_webhook_targets", + ReadWebhookTargets: "read_webhook_targets", + ReadAnalytics: "read_analytics", + ManageApiKeys: "manage_api_keys", + ReadApiKeys: "read_api_keys", + ManageAudiences: "manage_audiences", + ReadAudiences: "read_audiences", + ReadAuditEvents: "read_audit_events", + ManageChangeEvents: "manage_change_events", + ReadChangeEvents: "read_change_events", + ManageIncidents: "manage_incidents", + CreateIncidents: "create_incidents", + ReadIncidents: "read_incidents", + ManageIncidentSettings: "manage_incident_settings", + ReadIncidentSettings: "read_incident_settings", + ManageIntegrations: "manage_integrations", + ReadIntegrations: "read_integrations", + ManagePrivateIncidents: "manage_private_incidents", + ManageOrganizationSecrets: "manage_organization_secrets", + ReadOrganizationSecrets: "read_organization_secrets", + ManageOrganizationSettings: "manage_organization_settings", + ReadOrganizationSettings: "read_organization_settings", + ManageRoles: "manage_roles", + ReadRoles: "read_roles", + ManageRunbooks: "manage_runbooks", + ReadRunbooks: "read_runbooks", + ManageServiceCatalog: "manage_service_catalog", + ReadServiceCatalog: "read_service_catalog", + ManageStatusTemplates: "manage_status_templates", + ReadStatusTemplates: "read_status_templates", + ManageStatusPageUpdates: "manage_status_page_updates", + ManageSupportHours: "manage_support_hours", + ReadSupportHours: "read_support_hours", + ManageTeams: "manage_teams", + ReadTeams: "read_teams", + ManageUsers: "manage_users", + ReadUsers: "read_users", + ManageWebhooks: "manage_webhooks", + ReadWebhooks: "read_webhooks", +} as const; +export type UpdateRolePermission = ClosedEnum; + +/** + * Update a role + */ +export type UpdateRole = { + /** + * The name of the role. + */ + name: string; + /** + * A long-form description of the role's purpose. + */ + description?: string | null | undefined; + /** + * An array of permission slugs to assign to the role. + */ + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const UpdateRolePermission$inboundSchema: z.ZodNativeEnum< + typeof UpdateRolePermission +> = z.nativeEnum(UpdateRolePermission); + +/** @internal */ +export const UpdateRolePermission$outboundSchema: z.ZodNativeEnum< + typeof UpdateRolePermission +> = UpdateRolePermission$inboundSchema; + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateRolePermission$ { + /** @deprecated use `UpdateRolePermission$inboundSchema` instead. */ + export const inboundSchema = UpdateRolePermission$inboundSchema; + /** @deprecated use `UpdateRolePermission$outboundSchema` instead. */ + export const outboundSchema = UpdateRolePermission$outboundSchema; +} + +/** @internal */ +export const UpdateRole$inboundSchema: z.ZodType< + UpdateRole, + z.ZodTypeDef, + unknown +> = z.object({ + name: z.string(), + description: z.nullable(z.string()).optional(), + permissions: z.nullable(z.array(UpdateRolePermission$inboundSchema)) + .optional(), +}); + +/** @internal */ +export type UpdateRole$Outbound = { + name: string; + description?: string | null | undefined; + permissions?: Array | null | undefined; +}; + +/** @internal */ +export const UpdateRole$outboundSchema: z.ZodType< + UpdateRole$Outbound, + z.ZodTypeDef, + UpdateRole +> = z.object({ + name: z.string(), + description: z.nullable(z.string()).optional(), + permissions: z.nullable(z.array(UpdateRolePermission$outboundSchema)) + .optional(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateRole$ { + /** @deprecated use `UpdateRole$inboundSchema` instead. */ + export const inboundSchema = UpdateRole$inboundSchema; + /** @deprecated use `UpdateRole$outboundSchema` instead. */ + export const outboundSchema = UpdateRole$outboundSchema; + /** @deprecated use `UpdateRole$Outbound` instead. */ + export type Outbound = UpdateRole$Outbound; +} + +export function updateRoleToJSON(updateRole: UpdateRole): string { + return JSON.stringify(UpdateRole$outboundSchema.parse(updateRole)); +} + +export function updateRoleFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateRole$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateRole' from JSON`, + ); +} diff --git a/src/models/operations/deleterole.ts b/src/models/operations/deleterole.ts new file mode 100644 index 00000000..b973ffcd --- /dev/null +++ b/src/models/operations/deleterole.ts @@ -0,0 +1,66 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type DeleteRoleRequest = { + id: string; +}; + +/** @internal */ +export const DeleteRoleRequest$inboundSchema: z.ZodType< + DeleteRoleRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type DeleteRoleRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const DeleteRoleRequest$outboundSchema: z.ZodType< + DeleteRoleRequest$Outbound, + z.ZodTypeDef, + DeleteRoleRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace DeleteRoleRequest$ { + /** @deprecated use `DeleteRoleRequest$inboundSchema` instead. */ + export const inboundSchema = DeleteRoleRequest$inboundSchema; + /** @deprecated use `DeleteRoleRequest$outboundSchema` instead. */ + export const outboundSchema = DeleteRoleRequest$outboundSchema; + /** @deprecated use `DeleteRoleRequest$Outbound` instead. */ + export type Outbound = DeleteRoleRequest$Outbound; +} + +export function deleteRoleRequestToJSON( + deleteRoleRequest: DeleteRoleRequest, +): string { + return JSON.stringify( + DeleteRoleRequest$outboundSchema.parse(deleteRoleRequest), + ); +} + +export function deleteRoleRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteRoleRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteRoleRequest' from JSON`, + ); +} diff --git a/src/models/operations/getrole.ts b/src/models/operations/getrole.ts new file mode 100644 index 00000000..aaa346c7 --- /dev/null +++ b/src/models/operations/getrole.ts @@ -0,0 +1,62 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type GetRoleRequest = { + id: string; +}; + +/** @internal */ +export const GetRoleRequest$inboundSchema: z.ZodType< + GetRoleRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), +}); + +/** @internal */ +export type GetRoleRequest$Outbound = { + id: string; +}; + +/** @internal */ +export const GetRoleRequest$outboundSchema: z.ZodType< + GetRoleRequest$Outbound, + z.ZodTypeDef, + GetRoleRequest +> = z.object({ + id: z.string(), +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace GetRoleRequest$ { + /** @deprecated use `GetRoleRequest$inboundSchema` instead. */ + export const inboundSchema = GetRoleRequest$inboundSchema; + /** @deprecated use `GetRoleRequest$outboundSchema` instead. */ + export const outboundSchema = GetRoleRequest$outboundSchema; + /** @deprecated use `GetRoleRequest$Outbound` instead. */ + export type Outbound = GetRoleRequest$Outbound; +} + +export function getRoleRequestToJSON(getRoleRequest: GetRoleRequest): string { + return JSON.stringify(GetRoleRequest$outboundSchema.parse(getRoleRequest)); +} + +export function getRoleRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => GetRoleRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'GetRoleRequest' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index daf5b30d..d5f67a3d 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -88,6 +88,7 @@ export * from "./deleteoncallshift.js"; export * from "./deletepostmortemreason.js"; export * from "./deletepriority.js"; export * from "./deleteretrospectivetemplate.js"; +export * from "./deleterole.js"; export * from "./deleterunbook.js"; export * from "./deleterunbookexecution.js"; export * from "./deletesavedsearch.js"; @@ -159,6 +160,7 @@ export * from "./getpostmortemquestion.js"; export * from "./getpostmortemreport.js"; export * from "./getpriority.js"; export * from "./getretrospectivetemplate.js"; +export * from "./getrole.js"; export * from "./getrunbook.js"; export * from "./getrunbookactionfieldoptions.js"; export * from "./getrunbookexecution.js"; @@ -259,6 +261,7 @@ export * from "./listprocessinglogentries.js"; export * from "./listretrospectivemetrics.js"; export * from "./listretrospectives.js"; export * from "./listretrospectivetemplates.js"; +export * from "./listroles.js"; export * from "./listrunbookactions.js"; export * from "./listrunbookaudits.js"; export * from "./listrunbookexecutions.js"; @@ -358,6 +361,7 @@ export * from "./updatepostmortemreason.js"; export * from "./updatepostmortemreport.js"; export * from "./updatepriority.js"; export * from "./updateretrospectivetemplate.js"; +export * from "./updaterole.js"; export * from "./updaterunbook.js"; export * from "./updaterunbookexecutionstep.js"; export * from "./updaterunbookexecutionstepscript.js"; diff --git a/src/models/operations/listroles.ts b/src/models/operations/listroles.ts new file mode 100644 index 00000000..662c1b9b --- /dev/null +++ b/src/models/operations/listroles.ts @@ -0,0 +1,86 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type ListRolesRequest = { + /** + * A search query to filter roles by name and slug. + */ + query?: string | null | undefined; + page?: number | null | undefined; + perPage?: number | null | undefined; +}; + +/** @internal */ +export const ListRolesRequest$inboundSchema: z.ZodType< + ListRolesRequest, + z.ZodTypeDef, + unknown +> = z.object({ + query: z.nullable(z.string()).optional(), + page: z.nullable(z.number().int()).optional(), + per_page: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + "per_page": "perPage", + }); +}); + +/** @internal */ +export type ListRolesRequest$Outbound = { + query?: string | null | undefined; + page?: number | null | undefined; + per_page?: number | null | undefined; +}; + +/** @internal */ +export const ListRolesRequest$outboundSchema: z.ZodType< + ListRolesRequest$Outbound, + z.ZodTypeDef, + ListRolesRequest +> = z.object({ + query: z.nullable(z.string()).optional(), + page: z.nullable(z.number().int()).optional(), + perPage: z.nullable(z.number().int()).optional(), +}).transform((v) => { + return remap$(v, { + perPage: "per_page", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace ListRolesRequest$ { + /** @deprecated use `ListRolesRequest$inboundSchema` instead. */ + export const inboundSchema = ListRolesRequest$inboundSchema; + /** @deprecated use `ListRolesRequest$outboundSchema` instead. */ + export const outboundSchema = ListRolesRequest$outboundSchema; + /** @deprecated use `ListRolesRequest$Outbound` instead. */ + export type Outbound = ListRolesRequest$Outbound; +} + +export function listRolesRequestToJSON( + listRolesRequest: ListRolesRequest, +): string { + return JSON.stringify( + ListRolesRequest$outboundSchema.parse(listRolesRequest), + ); +} + +export function listRolesRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => ListRolesRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'ListRolesRequest' from JSON`, + ); +} diff --git a/src/models/operations/updaterole.ts b/src/models/operations/updaterole.ts new file mode 100644 index 00000000..9e642938 --- /dev/null +++ b/src/models/operations/updaterole.ts @@ -0,0 +1,80 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod"; +import { remap as remap$ } from "../../lib/primitives.js"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as components from "../components/index.js"; +import { SDKValidationError } from "../errors/sdkvalidationerror.js"; + +export type UpdateRoleRequest = { + id: string; + updateRole: components.UpdateRole; +}; + +/** @internal */ +export const UpdateRoleRequest$inboundSchema: z.ZodType< + UpdateRoleRequest, + z.ZodTypeDef, + unknown +> = z.object({ + id: z.string(), + update_role: z.lazy(() => components.UpdateRole$inboundSchema), +}).transform((v) => { + return remap$(v, { + "update_role": "updateRole", + }); +}); + +/** @internal */ +export type UpdateRoleRequest$Outbound = { + id: string; + update_role: components.UpdateRole$Outbound; +}; + +/** @internal */ +export const UpdateRoleRequest$outboundSchema: z.ZodType< + UpdateRoleRequest$Outbound, + z.ZodTypeDef, + UpdateRoleRequest +> = z.object({ + id: z.string(), + updateRole: z.lazy(() => components.UpdateRole$outboundSchema), +}).transform((v) => { + return remap$(v, { + updateRole: "update_role", + }); +}); + +/** + * @internal + * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. + */ +export namespace UpdateRoleRequest$ { + /** @deprecated use `UpdateRoleRequest$inboundSchema` instead. */ + export const inboundSchema = UpdateRoleRequest$inboundSchema; + /** @deprecated use `UpdateRoleRequest$outboundSchema` instead. */ + export const outboundSchema = UpdateRoleRequest$outboundSchema; + /** @deprecated use `UpdateRoleRequest$Outbound` instead. */ + export type Outbound = UpdateRoleRequest$Outbound; +} + +export function updateRoleRequestToJSON( + updateRoleRequest: UpdateRoleRequest, +): string { + return JSON.stringify( + UpdateRoleRequest$outboundSchema.parse(updateRoleRequest), + ); +} + +export function updateRoleRequestFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => UpdateRoleRequest$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'UpdateRoleRequest' from JSON`, + ); +} diff --git a/src/sdk/permissions.ts b/src/sdk/permissions.ts new file mode 100644 index 00000000..cbc41e98 --- /dev/null +++ b/src/sdk/permissions.ts @@ -0,0 +1,57 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { permissionsListCurrentUserPermissions } from "../funcs/permissionsListCurrentUserPermissions.js"; +import { permissionsListPermissions } from "../funcs/permissionsListPermissions.js"; +import { permissionsListTeamPermissions } from "../funcs/permissionsListTeamPermissions.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Permissions extends ClientSDK { + /** + * List permissions + * + * @remarks + * List all permissions in the organization + */ + async listPermissions( + options?: RequestOptions, + ): Promise { + return unwrapAsync(permissionsListPermissions( + this, + options, + )); + } + + /** + * Get all permissions for the current user + * + * @remarks + * Get all permissions for the current user + */ + async listCurrentUserPermissions( + options?: RequestOptions, + ): Promise { + return unwrapAsync(permissionsListCurrentUserPermissions( + this, + options, + )); + } + + /** + * Get all permissions for a team + * + * @remarks + * Get all permissions for a team + */ + async listTeamPermissions( + options?: RequestOptions, + ): Promise { + return unwrapAsync(permissionsListTeamPermissions( + this, + options, + )); + } +} diff --git a/src/sdk/roles.ts b/src/sdk/roles.ts new file mode 100644 index 00000000..787bd086 --- /dev/null +++ b/src/sdk/roles.ts @@ -0,0 +1,100 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import { rolesCreateRole } from "../funcs/rolesCreateRole.js"; +import { rolesDeleteRole } from "../funcs/rolesDeleteRole.js"; +import { rolesGetRole } from "../funcs/rolesGetRole.js"; +import { rolesListRoles } from "../funcs/rolesListRoles.js"; +import { rolesUpdateRole } from "../funcs/rolesUpdateRole.js"; +import { ClientSDK, RequestOptions } from "../lib/sdks.js"; +import * as components from "../models/components/index.js"; +import * as operations from "../models/operations/index.js"; +import { unwrapAsync } from "../types/fp.js"; + +export class Roles extends ClientSDK { + /** + * Get all roles + * + * @remarks + * Get all roles in the organization + */ + async listRoles( + request: operations.ListRolesRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(rolesListRoles( + this, + request, + options, + )); + } + + /** + * Create a role + * + * @remarks + * Create a new role + */ + async createRole( + request: components.CreateRole, + options?: RequestOptions, + ): Promise { + return unwrapAsync(rolesCreateRole( + this, + request, + options, + )); + } + + /** + * Get a role + * + * @remarks + * Get a role + */ + async getRole( + request: operations.GetRoleRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(rolesGetRole( + this, + request, + options, + )); + } + + /** + * Delete a role + * + * @remarks + * Delete a role + */ + async deleteRole( + request: operations.DeleteRoleRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(rolesDeleteRole( + this, + request, + options, + )); + } + + /** + * Update a role + * + * @remarks + * Update a role + */ + async updateRole( + request: operations.UpdateRoleRequest, + options?: RequestOptions, + ): Promise { + return unwrapAsync(rolesUpdateRole( + this, + request, + options, + )); + } +} diff --git a/src/sdk/runbooks.ts b/src/sdk/runbooks.ts index 6c9d0871..2a3c4d4b 100644 --- a/src/sdk/runbooks.ts +++ b/src/sdk/runbooks.ts @@ -266,7 +266,7 @@ export class Runbooks extends ClientSDK { * List runbook audits * * @remarks - * Please contact support to enable audit logging for your account. + * This endpoint is deprecated. */ async listRunbookAudits( request: operations.ListRunbookAuditsRequest, diff --git a/src/sdk/sdk.ts b/src/sdk/sdk.ts index c2e78f16..afe0bcee 100644 --- a/src/sdk/sdk.ts +++ b/src/sdk/sdk.ts @@ -17,7 +17,9 @@ import { IncidentSettings } from "./incidentsettings.js"; import { Integrations } from "./integrations.js"; import { MetricsReporting } from "./metricsreporting.js"; import { Pages } from "./pages.js"; +import { Permissions } from "./permissions.js"; import { Retrospectives } from "./retrospectives.js"; +import { Roles } from "./roles.js"; import { Runbooks } from "./runbooks.js"; import { Scim } from "./scim.js"; import { Signals } from "./signals.js"; @@ -104,11 +106,21 @@ export class Firehydrant extends ClientSDK { return (this._users ??= new Users(this._options)); } + private _permissions?: Permissions; + get permissions(): Permissions { + return (this._permissions ??= new Permissions(this._options)); + } + private _metricsReporting?: MetricsReporting; get metricsReporting(): MetricsReporting { return (this._metricsReporting ??= new MetricsReporting(this._options)); } + private _roles?: Roles; + get roles(): Roles { + return (this._roles ??= new Roles(this._options)); + } + private _runbooks?: Runbooks; get runbooks(): Runbooks { return (this._runbooks ??= new Runbooks(this._options));