From e2081a19b5303d87bc07d485987b8a3e7f613aa9 Mon Sep 17 00:00:00 2001 From: Timo Behrendt Date: Wed, 16 Jul 2025 07:21:12 +0200 Subject: [PATCH] initial-commit (#1) Reviewed-on: https://gitea.t000-n.de/t.behrendt/outline-mcp/pulls/1 Co-authored-by: Timo Behrendt Co-committed-by: Timo Behrendt --- .bun-version | 1 + .dockerignore | 6 + .gitea/workflows/cd.yaml | 92 + .gitea/workflows/ci.yaml | 25 + .gitignore | 140 +- Dockerfile | 23 + Makefile | 6 + README.md | 37 +- bun.lock | 957 +++ cspell.code.json | 12 + eslint.config.js | 85 + openapitools.json | 7 + package.json | 39 + project-words.txt | 2 + renovate.json | 9 + run-outline.sh | 5 + schemas/outline.json | 7263 +++++++++++++++++ src/config.ts | 8 + src/gen/api/outline/.openapi-generator-ignore | 23 + src/gen/api/outline/.openapi-generator/FILES | 171 + .../api/outline/.openapi-generator/VERSION | 1 + src/gen/api/outline/apis/AttachmentsApi.ts | 194 + src/gen/api/outline/apis/AuthApi.ts | 111 + src/gen/api/outline/apis/CollectionsApi.ts | 800 ++ src/gen/api/outline/apis/CommentsApi.ts | 312 + src/gen/api/outline/apis/DocumentsApi.ts | 1175 +++ src/gen/api/outline/apis/EventsApi.ts | 87 + src/gen/api/outline/apis/FileOperationsApi.ts | 243 + src/gen/api/outline/apis/GroupsApi.ts | 472 ++ src/gen/api/outline/apis/OAuthClientsApi.ts | 340 + src/gen/api/outline/apis/RevisionsApi.ts | 142 + src/gen/api/outline/apis/SharesApi.ts | 305 + src/gen/api/outline/apis/StarsApi.ts | 249 + src/gen/api/outline/apis/UsersApi.ts | 461 ++ src/gen/api/outline/apis/ViewsApi.ts | 144 + src/gen/api/outline/apis/index.ts | 16 + src/gen/api/outline/index.ts | 5 + src/gen/api/outline/models/Ability.ts | 45 + src/gen/api/outline/models/Attachment.ts | 97 + .../models/AttachmentsCreate200Response.ts | 73 + .../AttachmentsCreate200ResponseData.ts | 97 + .../models/AttachmentsCreateRequest.ts | 92 + .../models/AttachmentsDelete200Response.ts | 65 + .../models/AttachmentsRedirectRequest.ts | 66 + src/gen/api/outline/models/Auth.ts | 88 + .../outline/models/AuthConfig200Response.ts | 73 + .../models/AuthConfig200ResponseData.ts | 89 + .../AuthConfig200ResponseDataServicesInner.ts | 81 + .../api/outline/models/AuthInfo200Response.ts | 73 + src/gen/api/outline/models/Collection.ts | 195 + .../models/CollectionGroupMembership.ts | 96 + src/gen/api/outline/models/CollectionSort.ts | 84 + .../api/outline/models/CollectionStatus.ts | 52 + .../models/CollectionsAddGroup200Response.ts | 73 + .../CollectionsAddGroup200ResponseData.ts | 73 + .../models/CollectionsAddGroupRequest.ts | 93 + .../models/CollectionsAddUser200Response.ts | 73 + .../CollectionsAddUser200ResponseData.ts | 88 + .../models/CollectionsAddUserRequest.ts | 93 + .../models/CollectionsCreateRequest.ts | 116 + .../models/CollectionsDeleteRequest.ts | 66 + .../models/CollectionsDocuments200Response.ts | 73 + .../models/CollectionsExport200Response.ts | 73 + .../CollectionsExport200ResponseData.ts | 73 + .../models/CollectionsExportAllRequest.ts | 77 + .../models/CollectionsExportRequest.ts | 86 + .../CollectionsGroupMemberships200Response.ts | 88 + ...lectionsGroupMemberships200ResponseData.ts | 88 + .../CollectionsGroupMembershipsRequest.ts | 108 + .../models/CollectionsInfo200Response.ts | 88 + .../outline/models/CollectionsInfoRequest.ts | 66 + .../models/CollectionsList200Response.ts | 103 + .../outline/models/CollectionsListRequest.ts | 124 + .../CollectionsMemberships200Response.ts | 88 + .../models/CollectionsMembershipsRequest.ts | 108 + .../models/CollectionsRemoveGroupRequest.ts | 75 + .../models/CollectionsRemoveUserRequest.ts | 75 + .../models/CollectionsUpdateRequest.ts | 124 + src/gen/api/outline/models/Comment.ts | 133 + .../models/CommentsCreate200Response.ts | 73 + .../outline/models/CommentsCreateRequest.ts | 98 + .../outline/models/CommentsInfo200Response.ts | 88 + .../api/outline/models/CommentsInfoRequest.ts | 74 + .../outline/models/CommentsList200Response.ts | 103 + .../api/outline/models/CommentsListRequest.ts | 124 + .../outline/models/CommentsUpdateRequest.ts | 75 + src/gen/api/outline/models/Document.ts | 218 + .../outline/models/DocumentsAddUserRequest.ts | 93 + .../DocumentsAnswerquestion200Response.ts | 103 + .../models/DocumentsAnswerquestionRequest.ts | 128 + .../outline/models/DocumentsCreateRequest.ts | 115 + .../outline/models/DocumentsDeleteRequest.ts | 74 + .../outline/models/DocumentsDraftsRequest.ts | 127 + .../models/DocumentsExport200Response.ts | 65 + .../outline/models/DocumentsExportRequest.ts | 66 + .../models/DocumentsInfo200Response.ts | 88 + .../outline/models/DocumentsInfoRequest.ts | 73 + .../models/DocumentsList200Response.ts | 103 + .../outline/models/DocumentsListRequest.ts | 140 + .../models/DocumentsMembershipsRequest.ts | 74 + .../models/DocumentsMove200Response.ts | 88 + .../models/DocumentsMove200ResponseData.ts | 88 + .../outline/models/DocumentsMoveRequest.ts | 82 + .../models/DocumentsRemoveUserRequest.ts | 75 + .../outline/models/DocumentsRestoreRequest.ts | 74 + .../models/DocumentsSearch200Response.ts | 103 + .../DocumentsSearch200ResponseDataInner.ts | 89 + .../outline/models/DocumentsSearchRequest.ts | 144 + .../models/DocumentsUnpublishRequest.ts | 66 + .../outline/models/DocumentsUpdateRequest.ts | 106 + .../models/DocumentsUsers200Response.ts | 103 + .../outline/models/DocumentsUsersRequest.ts | 74 + .../outline/models/DocumentsViewedRequest.ts | 100 + src/gen/api/outline/models/Event.ts | 136 + .../outline/models/EventsList200Response.ts | 88 + .../api/outline/models/EventsListRequest.ts | 140 + src/gen/api/outline/models/FileOperation.ts | 146 + .../models/FileoperationsInfo200Response.ts | 73 + .../models/FileoperationsInfoRequest.ts | 66 + .../models/FileoperationsList200Response.ts | 88 + .../models/FileoperationsListRequest.ts | 118 + src/gen/api/outline/models/Group.ts | 93 + src/gen/api/outline/models/GroupMembership.ts | 94 + .../models/GroupsAddUser200Response.ts | 73 + .../models/GroupsAddUser200ResponseData.ts | 103 + .../outline/models/GroupsAddUserRequest.ts | 75 + .../api/outline/models/GroupsCreateRequest.ts | 66 + .../outline/models/GroupsInfo200Response.ts | 88 + .../api/outline/models/GroupsInfoRequest.ts | 66 + .../outline/models/GroupsList200Response.ts | 103 + .../models/GroupsList200ResponseData.ts | 88 + .../api/outline/models/GroupsListRequest.ts | 124 + .../models/GroupsMemberships200Response.ts | 88 + .../GroupsMemberships200ResponseData.ts | 88 + .../models/GroupsMembershipsRequest.ts | 90 + .../models/GroupsRemoveUser200Response.ts | 73 + .../models/GroupsRemoveUser200ResponseData.ts | 73 + .../api/outline/models/GroupsUpdateRequest.ts | 75 + src/gen/api/outline/models/InlineObject.ts | 81 + src/gen/api/outline/models/Invite.ts | 91 + src/gen/api/outline/models/Membership.ts | 96 + src/gen/api/outline/models/ModelError.ts | 97 + src/gen/api/outline/models/NavigationNode.ts | 89 + src/gen/api/outline/models/OAuthClient.ts | 148 + .../models/OauthClientsCreateRequest.ts | 115 + .../models/OauthClientsInfo200Response.ts | 88 + .../outline/models/OauthClientsInfoRequest.ts | 73 + .../models/OauthClientsList200Response.ts | 146 + .../models/OauthClientsRotateSecretRequest.ts | 66 + .../models/OauthClientsUpdateRequest.ts | 122 + src/gen/api/outline/models/Pagination.ts | 73 + src/gen/api/outline/models/Permission.ts | 53 + src/gen/api/outline/models/Policy.ts | 80 + src/gen/api/outline/models/Revision.ts | 108 + .../models/RevisionsInfo200Response.ts | 73 + .../outline/models/RevisionsInfoRequest.ts | 66 + .../models/RevisionsList200Response.ts | 88 + .../outline/models/RevisionsListRequest.ts | 108 + src/gen/api/outline/models/SearchResult.ts | 103 + src/gen/api/outline/models/Share.ts | 138 + .../api/outline/models/SharesCreateRequest.ts | 66 + .../outline/models/SharesInfo200Response.ts | 88 + .../api/outline/models/SharesInfoRequest.ts | 73 + .../outline/models/SharesList200Response.ts | 103 + .../api/outline/models/SharesListRequest.ts | 108 + .../api/outline/models/SharesUpdateRequest.ts | 75 + src/gen/api/outline/models/Sorting.ts | 84 + src/gen/api/outline/models/Star.ts | 100 + .../outline/models/StarsCreate200Response.ts | 88 + .../api/outline/models/StarsCreateRequest.ts | 81 + .../outline/models/StarsList200Response.ts | 103 + .../models/StarsList200ResponseData.ts | 88 + .../api/outline/models/StarsUpdateRequest.ts | 75 + src/gen/api/outline/models/Team.ts | 177 + src/gen/api/outline/models/User.ts | 126 + src/gen/api/outline/models/UserRole.ts | 55 + .../outline/models/UsersInfo200Response.ts | 88 + .../api/outline/models/UsersInfoRequest.ts | 66 + .../outline/models/UsersInvite200Response.ts | 73 + .../models/UsersInvite200ResponseData.ts | 88 + .../api/outline/models/UsersInviteRequest.ts | 74 + .../outline/models/UsersList200Response.ts | 103 + .../api/outline/models/UsersListRequest.ts | 151 + .../api/outline/models/UsersUpdateRequest.ts | 81 + .../outline/models/UsersUpdateRoleRequest.ts | 85 + src/gen/api/outline/models/View.ts | 108 + .../outline/models/ViewsCreate200Response.ts | 73 + .../outline/models/ViewsList200Response.ts | 73 + .../api/outline/models/ViewsListRequest.ts | 66 + src/gen/api/outline/models/index.ts | 154 + src/gen/api/outline/runtime.ts | 535 ++ src/main.ts | 98 + src/outline.ts | 44 + src/tools/collection.ts | 28 + src/tools/common.ts | 19 + src/tools/document.ts | 68 + src/tools/toolsFactory.ts | 5 + src/tools/utils.ts | 28 + tsconfig.json | 34 + 199 files changed, 28879 insertions(+), 123 deletions(-) create mode 100644 .bun-version create mode 100644 .dockerignore create mode 100644 .gitea/workflows/cd.yaml create mode 100644 .gitea/workflows/ci.yaml create mode 100644 Dockerfile create mode 100644 Makefile create mode 100644 bun.lock create mode 100644 cspell.code.json create mode 100644 eslint.config.js create mode 100644 openapitools.json create mode 100644 package.json create mode 100644 project-words.txt create mode 100644 renovate.json create mode 100755 run-outline.sh create mode 100644 schemas/outline.json create mode 100644 src/config.ts create mode 100644 src/gen/api/outline/.openapi-generator-ignore create mode 100644 src/gen/api/outline/.openapi-generator/FILES create mode 100644 src/gen/api/outline/.openapi-generator/VERSION create mode 100644 src/gen/api/outline/apis/AttachmentsApi.ts create mode 100644 src/gen/api/outline/apis/AuthApi.ts create mode 100644 src/gen/api/outline/apis/CollectionsApi.ts create mode 100644 src/gen/api/outline/apis/CommentsApi.ts create mode 100644 src/gen/api/outline/apis/DocumentsApi.ts create mode 100644 src/gen/api/outline/apis/EventsApi.ts create mode 100644 src/gen/api/outline/apis/FileOperationsApi.ts create mode 100644 src/gen/api/outline/apis/GroupsApi.ts create mode 100644 src/gen/api/outline/apis/OAuthClientsApi.ts create mode 100644 src/gen/api/outline/apis/RevisionsApi.ts create mode 100644 src/gen/api/outline/apis/SharesApi.ts create mode 100644 src/gen/api/outline/apis/StarsApi.ts create mode 100644 src/gen/api/outline/apis/UsersApi.ts create mode 100644 src/gen/api/outline/apis/ViewsApi.ts create mode 100644 src/gen/api/outline/apis/index.ts create mode 100644 src/gen/api/outline/index.ts create mode 100644 src/gen/api/outline/models/Ability.ts create mode 100644 src/gen/api/outline/models/Attachment.ts create mode 100644 src/gen/api/outline/models/AttachmentsCreate200Response.ts create mode 100644 src/gen/api/outline/models/AttachmentsCreate200ResponseData.ts create mode 100644 src/gen/api/outline/models/AttachmentsCreateRequest.ts create mode 100644 src/gen/api/outline/models/AttachmentsDelete200Response.ts create mode 100644 src/gen/api/outline/models/AttachmentsRedirectRequest.ts create mode 100644 src/gen/api/outline/models/Auth.ts create mode 100644 src/gen/api/outline/models/AuthConfig200Response.ts create mode 100644 src/gen/api/outline/models/AuthConfig200ResponseData.ts create mode 100644 src/gen/api/outline/models/AuthConfig200ResponseDataServicesInner.ts create mode 100644 src/gen/api/outline/models/AuthInfo200Response.ts create mode 100644 src/gen/api/outline/models/Collection.ts create mode 100644 src/gen/api/outline/models/CollectionGroupMembership.ts create mode 100644 src/gen/api/outline/models/CollectionSort.ts create mode 100644 src/gen/api/outline/models/CollectionStatus.ts create mode 100644 src/gen/api/outline/models/CollectionsAddGroup200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsAddGroup200ResponseData.ts create mode 100644 src/gen/api/outline/models/CollectionsAddGroupRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsAddUser200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsAddUser200ResponseData.ts create mode 100644 src/gen/api/outline/models/CollectionsAddUserRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsCreateRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsDeleteRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsDocuments200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsExport200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsExport200ResponseData.ts create mode 100644 src/gen/api/outline/models/CollectionsExportAllRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsExportRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsGroupMemberships200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsGroupMemberships200ResponseData.ts create mode 100644 src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsInfo200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsInfoRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsList200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsListRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsMemberships200Response.ts create mode 100644 src/gen/api/outline/models/CollectionsMembershipsRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsRemoveGroupRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsRemoveUserRequest.ts create mode 100644 src/gen/api/outline/models/CollectionsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/Comment.ts create mode 100644 src/gen/api/outline/models/CommentsCreate200Response.ts create mode 100644 src/gen/api/outline/models/CommentsCreateRequest.ts create mode 100644 src/gen/api/outline/models/CommentsInfo200Response.ts create mode 100644 src/gen/api/outline/models/CommentsInfoRequest.ts create mode 100644 src/gen/api/outline/models/CommentsList200Response.ts create mode 100644 src/gen/api/outline/models/CommentsListRequest.ts create mode 100644 src/gen/api/outline/models/CommentsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/Document.ts create mode 100644 src/gen/api/outline/models/DocumentsAddUserRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsAnswerquestion200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsAnswerquestionRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsCreateRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsDeleteRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsDraftsRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsExport200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsExportRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsInfo200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsInfoRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsList200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsListRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsMembershipsRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsMove200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsMove200ResponseData.ts create mode 100644 src/gen/api/outline/models/DocumentsMoveRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsRemoveUserRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsRestoreRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsSearch200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsSearch200ResponseDataInner.ts create mode 100644 src/gen/api/outline/models/DocumentsSearchRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsUnpublishRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsUsers200Response.ts create mode 100644 src/gen/api/outline/models/DocumentsUsersRequest.ts create mode 100644 src/gen/api/outline/models/DocumentsViewedRequest.ts create mode 100644 src/gen/api/outline/models/Event.ts create mode 100644 src/gen/api/outline/models/EventsList200Response.ts create mode 100644 src/gen/api/outline/models/EventsListRequest.ts create mode 100644 src/gen/api/outline/models/FileOperation.ts create mode 100644 src/gen/api/outline/models/FileoperationsInfo200Response.ts create mode 100644 src/gen/api/outline/models/FileoperationsInfoRequest.ts create mode 100644 src/gen/api/outline/models/FileoperationsList200Response.ts create mode 100644 src/gen/api/outline/models/FileoperationsListRequest.ts create mode 100644 src/gen/api/outline/models/Group.ts create mode 100644 src/gen/api/outline/models/GroupMembership.ts create mode 100644 src/gen/api/outline/models/GroupsAddUser200Response.ts create mode 100644 src/gen/api/outline/models/GroupsAddUser200ResponseData.ts create mode 100644 src/gen/api/outline/models/GroupsAddUserRequest.ts create mode 100644 src/gen/api/outline/models/GroupsCreateRequest.ts create mode 100644 src/gen/api/outline/models/GroupsInfo200Response.ts create mode 100644 src/gen/api/outline/models/GroupsInfoRequest.ts create mode 100644 src/gen/api/outline/models/GroupsList200Response.ts create mode 100644 src/gen/api/outline/models/GroupsList200ResponseData.ts create mode 100644 src/gen/api/outline/models/GroupsListRequest.ts create mode 100644 src/gen/api/outline/models/GroupsMemberships200Response.ts create mode 100644 src/gen/api/outline/models/GroupsMemberships200ResponseData.ts create mode 100644 src/gen/api/outline/models/GroupsMembershipsRequest.ts create mode 100644 src/gen/api/outline/models/GroupsRemoveUser200Response.ts create mode 100644 src/gen/api/outline/models/GroupsRemoveUser200ResponseData.ts create mode 100644 src/gen/api/outline/models/GroupsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/InlineObject.ts create mode 100644 src/gen/api/outline/models/Invite.ts create mode 100644 src/gen/api/outline/models/Membership.ts create mode 100644 src/gen/api/outline/models/ModelError.ts create mode 100644 src/gen/api/outline/models/NavigationNode.ts create mode 100644 src/gen/api/outline/models/OAuthClient.ts create mode 100644 src/gen/api/outline/models/OauthClientsCreateRequest.ts create mode 100644 src/gen/api/outline/models/OauthClientsInfo200Response.ts create mode 100644 src/gen/api/outline/models/OauthClientsInfoRequest.ts create mode 100644 src/gen/api/outline/models/OauthClientsList200Response.ts create mode 100644 src/gen/api/outline/models/OauthClientsRotateSecretRequest.ts create mode 100644 src/gen/api/outline/models/OauthClientsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/Pagination.ts create mode 100644 src/gen/api/outline/models/Permission.ts create mode 100644 src/gen/api/outline/models/Policy.ts create mode 100644 src/gen/api/outline/models/Revision.ts create mode 100644 src/gen/api/outline/models/RevisionsInfo200Response.ts create mode 100644 src/gen/api/outline/models/RevisionsInfoRequest.ts create mode 100644 src/gen/api/outline/models/RevisionsList200Response.ts create mode 100644 src/gen/api/outline/models/RevisionsListRequest.ts create mode 100644 src/gen/api/outline/models/SearchResult.ts create mode 100644 src/gen/api/outline/models/Share.ts create mode 100644 src/gen/api/outline/models/SharesCreateRequest.ts create mode 100644 src/gen/api/outline/models/SharesInfo200Response.ts create mode 100644 src/gen/api/outline/models/SharesInfoRequest.ts create mode 100644 src/gen/api/outline/models/SharesList200Response.ts create mode 100644 src/gen/api/outline/models/SharesListRequest.ts create mode 100644 src/gen/api/outline/models/SharesUpdateRequest.ts create mode 100644 src/gen/api/outline/models/Sorting.ts create mode 100644 src/gen/api/outline/models/Star.ts create mode 100644 src/gen/api/outline/models/StarsCreate200Response.ts create mode 100644 src/gen/api/outline/models/StarsCreateRequest.ts create mode 100644 src/gen/api/outline/models/StarsList200Response.ts create mode 100644 src/gen/api/outline/models/StarsList200ResponseData.ts create mode 100644 src/gen/api/outline/models/StarsUpdateRequest.ts create mode 100644 src/gen/api/outline/models/Team.ts create mode 100644 src/gen/api/outline/models/User.ts create mode 100644 src/gen/api/outline/models/UserRole.ts create mode 100644 src/gen/api/outline/models/UsersInfo200Response.ts create mode 100644 src/gen/api/outline/models/UsersInfoRequest.ts create mode 100644 src/gen/api/outline/models/UsersInvite200Response.ts create mode 100644 src/gen/api/outline/models/UsersInvite200ResponseData.ts create mode 100644 src/gen/api/outline/models/UsersInviteRequest.ts create mode 100644 src/gen/api/outline/models/UsersList200Response.ts create mode 100644 src/gen/api/outline/models/UsersListRequest.ts create mode 100644 src/gen/api/outline/models/UsersUpdateRequest.ts create mode 100644 src/gen/api/outline/models/UsersUpdateRoleRequest.ts create mode 100644 src/gen/api/outline/models/View.ts create mode 100644 src/gen/api/outline/models/ViewsCreate200Response.ts create mode 100644 src/gen/api/outline/models/ViewsList200Response.ts create mode 100644 src/gen/api/outline/models/ViewsListRequest.ts create mode 100644 src/gen/api/outline/models/index.ts create mode 100644 src/gen/api/outline/runtime.ts create mode 100644 src/main.ts create mode 100644 src/outline.ts create mode 100644 src/tools/collection.ts create mode 100644 src/tools/common.ts create mode 100644 src/tools/document.ts create mode 100644 src/tools/toolsFactory.ts create mode 100644 src/tools/utils.ts create mode 100644 tsconfig.json diff --git a/.bun-version b/.bun-version new file mode 100644 index 0000000..591bdbc --- /dev/null +++ b/.bun-version @@ -0,0 +1 @@ +1.2.18 diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3c961ce --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +* + +!src/ +!package.json +!bun.lock +!tsconfig.json diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml new file mode 100644 index 0000000..c5538ae --- /dev/null +++ b/.gitea/workflows/cd.yaml @@ -0,0 +1,92 @@ +name: CD + +on: + push: + branches: + - main + +env: + DOCKER_REGISTRY: gitea.t000-n.de + +jobs: + check-changes: + name: Check changes + runs-on: ubuntu-latest + outputs: + changes: ${{ steps.filter.outputs.code }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Get changed files + id: filter + uses: dorny/paths-filter@v3 + with: + filters: | + code: + - 'src/**' + - '.bun-version' + - 'package.json' + - 'tsconfig.json' + - 'Dockerfile' + - 'bun.lockb' + + test: + uses: ./.gitea/workflows/ci.yaml + + build_and_push: + name: Build and push + strategy: + matrix: + arch: [amd64, arm64] + needs: + - test + - check-changes + runs-on: + - ubuntu-latest + - linux_${{ matrix.arch }} + if: ${{ needs.check-changes.outputs.changes == 'true' }} + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT + echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + - uses: docker/build-push-action@v6 + with: + context: . + file: ./Dockerfile + platforms: linux/${{ matrix.arch }} + push: true + provenance: false + tags: | + ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }} + + create_manifest: + name: Create manifest + needs: + - build_and_push + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: meta + run: | + echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT + echo REPO_VERSION=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT + - uses: docker/login-action@v3 + with: + registry: ${{ env.DOCKER_REGISTRY }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_PASSWORD }} + - run: | + docker manifest create ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest \ + ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-amd64 \ + ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-arm64 + + docker manifest push ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..0fe8aed --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,25 @@ +name: CI + +on: + pull_request: + workflow_call: + +jobs: + test: + name: Test + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - uses: oven-sh/setup-bun@v2 + with: + bun-version-file: ".bun-version" + # only required for cspell compatibility until a mature replacement is available + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: bun install --frozen-lockfile + - name: Run lint + run: bun run check:code + - name: Run spellcheck + run: bun run check:spell diff --git a/.gitignore b/.gitignore index 2309cc8..a14702c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,77 +1,19 @@ -# ---> Node -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -.pnpm-debug.log* +# dependencies (bun install) +node_modules -# Diagnostic reports (https://nodejs.org/api/report.html) -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +# output +out +dist +*.tgz -# Runtime data -pids -*.pid -*.seed -*.pid.lock - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul +# code coverage coverage *.lcov -# nyc test coverage -.nyc_output - -# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Bower dependency directory (https://bower.io/) -bower_components - -# node-waf configuration -.lock-wscript - -# Compiled binary addons (https://nodejs.org/api/addons.html) -build/Release - -# Dependency directories -node_modules/ -jspm_packages/ - -# Snowpack dependency directory (https://snowpack.dev/) -web_modules/ - -# TypeScript cache -*.tsbuildinfo - -# Optional npm cache directory -.npm - -# Optional eslint cache -.eslintcache - -# Optional stylelint cache -.stylelintcache - -# Microbundle cache -.rpt2_cache/ -.rts2_cache_cjs/ -.rts2_cache_es/ -.rts2_cache_umd/ - -# Optional REPL history -.node_repl_history - -# Output of 'npm pack' -*.tgz - -# Yarn Integrity file -.yarn-integrity +# logs +logs +_.log +report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json # dotenv environment variable files .env @@ -80,59 +22,13 @@ web_modules/ .env.production.local .env.local -# parcel-bundler cache (https://parceljs.org/) +# caches +.eslintcache .cache -.parcel-cache +*.tsbuildinfo -# Next.js build output -.next -out - -# Nuxt.js build / generate output -.nuxt -dist - -# Gatsby files -.cache/ -# Comment in the public line in if your project uses Gatsby and not Next.js -# https://nextjs.org/blog/next-9-1#public-directory-support -# public - -# vuepress build output -.vuepress/dist - -# vuepress v2.x temp and cache directory -.temp -.cache - -# vitepress build output -**/.vitepress/dist - -# vitepress cache directory -**/.vitepress/cache - -# Docusaurus cache and generated files -.docusaurus - -# Serverless directories -.serverless/ - -# FuseBox cache -.fusebox/ - -# DynamoDB Local files -.dynamodb/ - -# TernJS port file -.tern-port - -# Stores VSCode versions used for testing VSCode extensions -.vscode-test - -# yarn v2 -.yarn/cache -.yarn/unplugged -.yarn/build-state.yml -.yarn/install-state.gz -.pnp.* +# IntelliJ based IDEs +.idea +# Finder (MacOS) folder config +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..702b0b2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,23 @@ +FROM oven/bun:1.2.18 AS base + +WORKDIR /app + +FROM base AS install +RUN mkdir -p /temp/dev +COPY package.json bun.lock /temp/dev/ +RUN cd /temp/dev && bun install --frozen-lockfile + +RUN mkdir -p /temp/prod +COPY package.json bun.lock /temp/prod/ +RUN cd /temp/prod && bun install --frozen-lockfile --production + +FROM base AS build +COPY --from=install /temp/dev/node_modules node_modules +COPY . . +RUN bun run build + +FROM base AS release +COPY --from=install /temp/prod/node_modules node_modules +COPY --from=build /app/dist . + +CMD [ "bun", "/app/main.js"] \ No newline at end of file diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e0cd834 --- /dev/null +++ b/Makefile @@ -0,0 +1,6 @@ +# generates the outline api in typescript from schemas/outline.json using openapi-generator +generate-outline-api: + npx @openapitools/openapi-generator-cli generate -i schemas/outline.json -g typescript-fetch -o src/gen/api/outline + +start: + bun run start diff --git a/README.md b/README.md index 454106b..4d17d14 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,37 @@ -# outline-mcp +# Outline MCP +[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server wrapping the [Outline HTTP API](https://www.getoutline.com/developers). Tools will be added as needed. + +## Run + +Use docker image pushed to https://gitea.t000-n.de/t.behrendt/outline-mcp:latest + +Required Environment variables: + +- OUTLINE_BASE_URL=https:/example.com/api +- OUTLINE_API_KEY=xx_api_xx + +The server will start on port 3000. + +## Integrate into Claude + +Use [mcp-remote](https://www.npmjs.com/package/mcp-remote) as this currently works best with Claude Desktop. Change the URL to wherever your MCP server runs and adjust authentication according to the package. Refer to the [Claude Desktop MCP documentation](https://modelcontextprotocol.io/quickstart/user) for a deeper dive. + +```json +{ + "mcpServers": { + "outline": { + "command": "npx", + "args": ["mcp-remote", "http://localhost:3000/mcp"] + } + } +} +``` + +## Test + +Use the [mcp inspector](https://www.npmjs.com/package/@modelcontextprotocol/inspector) to view tools and run tests. + +```bash +bunx @modelcontextprotocol/inspector +``` diff --git a/bun.lock b/bun.lock new file mode 100644 index 0000000..49c10e6 --- /dev/null +++ b/bun.lock @@ -0,0 +1,957 @@ +{ + "lockfileVersion": 1, + "workspaces": { + "": { + "name": "outline-mcp", + "dependencies": { + "@modelcontextprotocol/sdk": "^1.15.1", + "cors": "^2.8.5", + "env-var": "^7.5.0", + "express": "^5.1.0", + "pino": "^9.7.0", + }, + "devDependencies": { + "@types/bun": "latest", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@typescript-eslint/eslint-plugin": "^8.37.0", + "@typescript-eslint/parser": "^8.37.0", + "cspell": "^9.1.5", + "eslint": "^9.31.0", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-prettier": "^5.5.1", + "eslint-plugin-security": "^3.0.1", + "eslint-plugin-unicorn": "^59.0.1", + "typescript-eslint": "^8.37.0", + }, + "peerDependencies": { + "typescript": "^5", + }, + }, + }, + "packages": { + "@babel/helper-validator-identifier": ["@babel/helper-validator-identifier@7.27.1", "", {}, "sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow=="], + + "@cspell/cspell-bundled-dicts": ["@cspell/cspell-bundled-dicts@9.1.5", "", { "dependencies": { "@cspell/dict-ada": "^4.1.1", "@cspell/dict-al": "^1.1.1", "@cspell/dict-aws": "^4.0.12", "@cspell/dict-bash": "^4.2.1", "@cspell/dict-companies": "^3.2.2", "@cspell/dict-cpp": "^6.0.9", "@cspell/dict-cryptocurrencies": "^5.0.5", "@cspell/dict-csharp": "^4.0.7", "@cspell/dict-css": "^4.0.18", "@cspell/dict-dart": "^2.3.1", "@cspell/dict-data-science": "^2.0.9", "@cspell/dict-django": "^4.1.5", "@cspell/dict-docker": "^1.1.15", "@cspell/dict-dotnet": "^5.0.10", "@cspell/dict-elixir": "^4.0.8", "@cspell/dict-en-common-misspellings": "^2.1.3", "@cspell/dict-en-gb-mit": "^3.1.4", "@cspell/dict-en_us": "^4.4.14", "@cspell/dict-filetypes": "^3.0.13", "@cspell/dict-flutter": "^1.1.1", "@cspell/dict-fonts": "^4.0.5", "@cspell/dict-fsharp": "^1.1.1", "@cspell/dict-fullstack": "^3.2.7", "@cspell/dict-gaming-terms": "^1.1.2", "@cspell/dict-git": "^3.0.7", "@cspell/dict-golang": "^6.0.23", "@cspell/dict-google": "^1.0.9", "@cspell/dict-haskell": "^4.0.6", "@cspell/dict-html": "^4.0.12", "@cspell/dict-html-symbol-entities": "^4.0.4", "@cspell/dict-java": "^5.0.12", "@cspell/dict-julia": "^1.1.1", "@cspell/dict-k8s": "^1.0.12", "@cspell/dict-kotlin": "^1.1.1", "@cspell/dict-latex": "^4.0.4", "@cspell/dict-lorem-ipsum": "^4.0.5", "@cspell/dict-lua": "^4.0.8", "@cspell/dict-makefile": "^1.0.5", "@cspell/dict-markdown": "^2.0.12", "@cspell/dict-monkeyc": "^1.0.11", "@cspell/dict-node": "^5.0.8", "@cspell/dict-npm": "^5.2.11", "@cspell/dict-php": "^4.0.15", "@cspell/dict-powershell": "^5.0.15", "@cspell/dict-public-licenses": "^2.0.14", "@cspell/dict-python": "^4.2.19", "@cspell/dict-r": "^2.1.1", "@cspell/dict-ruby": "^5.0.9", "@cspell/dict-rust": "^4.0.12", "@cspell/dict-scala": "^5.0.8", "@cspell/dict-shell": "^1.1.1", "@cspell/dict-software-terms": "^5.1.4", "@cspell/dict-sql": "^2.2.1", "@cspell/dict-svelte": "^1.0.7", "@cspell/dict-swift": "^2.0.6", "@cspell/dict-terraform": "^1.1.3", "@cspell/dict-typescript": "^3.2.3", "@cspell/dict-vue": "^3.0.5" } }, "sha512-CdaWYdxnXBFRWAga2qhB/WVO4oCxgSeV1hosvnFCBxrFUyG5KuqYRJdYgCQcITs6dpA3IdNNa7+zWX8JvxnH+A=="], + + "@cspell/cspell-json-reporter": ["@cspell/cspell-json-reporter@9.1.5", "", { "dependencies": { "@cspell/cspell-types": "9.1.5" } }, "sha512-tnapaKwxlHa7e5kuy0quJjW0oZlqetTbbsmYlayavm4PEVhuuNEp+skj4t957aRMGSq76t8Kgl7vS5Qp41ToMw=="], + + "@cspell/cspell-pipe": ["@cspell/cspell-pipe@9.1.5", "", {}, "sha512-6zmRfbqTHpYcI/n5uoerQVMqY31lnhA34BHU97uZn6kaW5rXTmQLze/WKmlrs+LAFfDL6MHIOLBJAusZw5Bb5g=="], + + "@cspell/cspell-resolver": ["@cspell/cspell-resolver@9.1.5", "", { "dependencies": { "global-directory": "^4.0.1" } }, "sha512-xZdTdcOcRoShrmA7S3tX5s8UmxFNaef5xdv8TABDjnTr6oPLBsZ5S3kPBZ8T+xlkj3MUB593SIkhD/0G74vLpw=="], + + "@cspell/cspell-service-bus": ["@cspell/cspell-service-bus@9.1.5", "", {}, "sha512-mAXtwYw5Xobn8uicZjblI+8SPscKHK3eDGm7hnYeThb/kzS83uQog0+8LbSh+YiXDrAqzXn73kXMHg1D+EvMpQ=="], + + "@cspell/cspell-types": ["@cspell/cspell-types@9.1.5", "", {}, "sha512-SPX9vHhqCtPE0wayvwmczax8X0oAXA3sBFIW31CoSyiu4lJ5sfKM4ZaoL25Wu4bW6GlYhaW4+diemmTdLHquag=="], + + "@cspell/dict-ada": ["@cspell/dict-ada@4.1.1", "", {}, "sha512-E+0YW9RhZod/9Qy2gxfNZiHJjCYFlCdI69br1eviQQWB8yOTJX0JHXLs79kOYhSW0kINPVUdvddEBe6Lu6CjGQ=="], + + "@cspell/dict-al": ["@cspell/dict-al@1.1.1", "", {}, "sha512-sD8GCaZetgQL4+MaJLXqbzWcRjfKVp8x+px3HuCaaiATAAtvjwUQ5/Iubiqwfd1boIh2Y1/3EgM3TLQ7Q8e0wQ=="], + + "@cspell/dict-aws": ["@cspell/dict-aws@4.0.12", "", {}, "sha512-k1F48eYlX+LsCK2QjqpfHBrjNwNwRyut/XsGumyhUXZsm+j9NVuxQaFCjiEwXi81KE0YE3GBVdwSjqhuUOkpnQ=="], + + "@cspell/dict-bash": ["@cspell/dict-bash@4.2.1", "", { "dependencies": { "@cspell/dict-shell": "1.1.1" } }, "sha512-SBnzfAyEAZLI9KFS7DUG6Xc1vDFuLllY3jz0WHvmxe8/4xV3ufFE3fGxalTikc1VVeZgZmxYiABw4iGxVldYEg=="], + + "@cspell/dict-companies": ["@cspell/dict-companies@3.2.2", "", {}, "sha512-iIuEBPfWzSQugIOn+OKOVsdfE9UloON5SKl57TbvC//D5mgIwPAMZGYT69yv20cjc5E6oMu353hCV3WFy9XO9A=="], + + "@cspell/dict-cpp": ["@cspell/dict-cpp@6.0.9", "", {}, "sha512-Xdq9MwGh0D5rsnbOqFW24NIClXXRhN11KJdySMibpcqYGeomxB2ODFBuhj1H7azO7kVGkGH0Okm4yQ2TRzBx0g=="], + + "@cspell/dict-cryptocurrencies": ["@cspell/dict-cryptocurrencies@5.0.5", "", {}, "sha512-R68hYYF/rtlE6T/dsObStzN5QZw+0aQBinAXuWCVqwdS7YZo0X33vGMfChkHaiCo3Z2+bkegqHlqxZF4TD3rUA=="], + + "@cspell/dict-csharp": ["@cspell/dict-csharp@4.0.7", "", {}, "sha512-H16Hpu8O/1/lgijFt2lOk4/nnldFtQ4t8QHbyqphqZZVE5aS4J/zD/WvduqnLY21aKhZS6jo/xF5PX9jyqPKUA=="], + + "@cspell/dict-css": ["@cspell/dict-css@4.0.18", "", {}, "sha512-EF77RqROHL+4LhMGW5NTeKqfUd/e4OOv6EDFQ/UQQiFyWuqkEKyEz0NDILxOFxWUEVdjT2GQ2cC7t12B6pESwg=="], + + "@cspell/dict-dart": ["@cspell/dict-dart@2.3.1", "", {}, "sha512-xoiGnULEcWdodXI6EwVyqpZmpOoh8RA2Xk9BNdR7DLamV/QMvEYn8KJ7NlRiTSauJKPNkHHQ5EVHRM6sTS7jdg=="], + + "@cspell/dict-data-science": ["@cspell/dict-data-science@2.0.9", "", {}, "sha512-wTOFMlxv06veIwKdXUwdGxrQcK44Zqs426m6JGgHIB/GqvieZQC5n0UI+tUm5OCxuNyo4OV6mylT4cRMjtKtWQ=="], + + "@cspell/dict-django": ["@cspell/dict-django@4.1.5", "", {}, "sha512-AvTWu99doU3T8ifoMYOMLW2CXKvyKLukPh1auOPwFGHzueWYvBBN+OxF8wF7XwjTBMMeRleVdLh3aWCDEX/ZWg=="], + + "@cspell/dict-docker": ["@cspell/dict-docker@1.1.15", "", {}, "sha512-wYthMAbEbqDBr9P90VC9aT3zjErrJbUtIr91pDmse7Y5WUvQtAwFhiJHgmNrtx2fZ2idII0eYvpMqoEO+FYFxw=="], + + "@cspell/dict-dotnet": ["@cspell/dict-dotnet@5.0.10", "", {}, "sha512-ooar8BP/RBNP1gzYfJPStKEmpWy4uv/7JCq6FOnJLeD1yyfG3d/LFMVMwiJo+XWz025cxtkM3wuaikBWzCqkmg=="], + + "@cspell/dict-elixir": ["@cspell/dict-elixir@4.0.8", "", {}, "sha512-CyfphrbMyl4Ms55Vzuj+mNmd693HjBFr9hvU+B2YbFEZprE5AG+EXLYTMRWrXbpds4AuZcvN3deM2XVB80BN/Q=="], + + "@cspell/dict-en-common-misspellings": ["@cspell/dict-en-common-misspellings@2.1.3", "", {}, "sha512-v1I97Hr1OrK+mwHsVzbY4vsPxx6mA5quhxzanF6XuRofz00wH4HPz8Q3llzRHxka5Wl/59gyan04UkUrvP4gdA=="], + + "@cspell/dict-en-gb-mit": ["@cspell/dict-en-gb-mit@3.1.5", "", {}, "sha512-ovJScYOzSeik0cmr2L379VDWXaFD/FMlC6yXz1X3soGPheGkjVSgI3HICAv7Lk+knf906ifhAcEIrbTPKq9EnQ=="], + + "@cspell/dict-en_us": ["@cspell/dict-en_us@4.4.15", "", {}, "sha512-mhWaLui5aq0pgM4oIqAJNbOW/wQG3epe4nu22eqYTLQN+ztdzyn7aFpE+9yTtZTNvldK0xtN7jgk2mtHZ9w+1A=="], + + "@cspell/dict-filetypes": ["@cspell/dict-filetypes@3.0.13", "", {}, "sha512-g6rnytIpQlMNKGJT1JKzWkC+b3xCliDKpQ3ANFSq++MnR4GaLiifaC4JkVON11Oh/UTplYOR1nY3BR4X30bswA=="], + + "@cspell/dict-flutter": ["@cspell/dict-flutter@1.1.1", "", {}, "sha512-UlOzRcH2tNbFhZmHJN48Za/2/MEdRHl2BMkCWZBYs+30b91mWvBfzaN4IJQU7dUZtowKayVIF9FzvLZtZokc5A=="], + + "@cspell/dict-fonts": ["@cspell/dict-fonts@4.0.5", "", {}, "sha512-BbpkX10DUX/xzHs6lb7yzDf/LPjwYIBJHJlUXSBXDtK/1HaeS+Wqol4Mlm2+NAgZ7ikIE5DQMViTgBUY3ezNoQ=="], + + "@cspell/dict-fsharp": ["@cspell/dict-fsharp@1.1.1", "", {}, "sha512-imhs0u87wEA4/cYjgzS0tAyaJpwG7vwtC8UyMFbwpmtw+/bgss+osNfyqhYRyS/ehVCWL17Ewx2UPkexjKyaBA=="], + + "@cspell/dict-fullstack": ["@cspell/dict-fullstack@3.2.7", "", {}, "sha512-IxEk2YAwAJKYCUEgEeOg3QvTL4XLlyArJElFuMQevU1dPgHgzWElFevN5lsTFnvMFA1riYsVinqJJX0BanCFEg=="], + + "@cspell/dict-gaming-terms": ["@cspell/dict-gaming-terms@1.1.2", "", {}, "sha512-9XnOvaoTBscq0xuD6KTEIkk9hhdfBkkvJAIsvw3JMcnp1214OCGW8+kako5RqQ2vTZR3Tnf3pc57o7VgkM0q1Q=="], + + "@cspell/dict-git": ["@cspell/dict-git@3.0.7", "", {}, "sha512-odOwVKgfxCQfiSb+nblQZc4ErXmnWEnv8XwkaI4sNJ7cNmojnvogYVeMqkXPjvfrgEcizEEA4URRD2Ms5PDk1w=="], + + "@cspell/dict-golang": ["@cspell/dict-golang@6.0.23", "", {}, "sha512-oXqUh/9dDwcmVlfUF5bn3fYFqbUzC46lXFQmi5emB0vYsyQXdNWsqi6/yH3uE7bdRE21nP7Yo0mR1jjFNyLamg=="], + + "@cspell/dict-google": ["@cspell/dict-google@1.0.9", "", {}, "sha512-biL65POqialY0i4g6crj7pR6JnBkbsPovB2WDYkj3H4TuC/QXv7Pu5pdPxeUJA6TSCHI7T5twsO4VSVyRxD9CA=="], + + "@cspell/dict-haskell": ["@cspell/dict-haskell@4.0.6", "", {}, "sha512-ib8SA5qgftExpYNjWhpYIgvDsZ/0wvKKxSP+kuSkkak520iPvTJumEpIE+qPcmJQo4NzdKMN8nEfaeci4OcFAQ=="], + + "@cspell/dict-html": ["@cspell/dict-html@4.0.12", "", {}, "sha512-JFffQ1dDVEyJq6tCDWv0r/RqkdSnV43P2F/3jJ9rwLgdsOIXwQbXrz6QDlvQLVvNSnORH9KjDtenFTGDyzfCaA=="], + + "@cspell/dict-html-symbol-entities": ["@cspell/dict-html-symbol-entities@4.0.4", "", {}, "sha512-afea+0rGPDeOV9gdO06UW183Qg6wRhWVkgCFwiO3bDupAoyXRuvupbb5nUyqSTsLXIKL8u8uXQlJ9pkz07oVXw=="], + + "@cspell/dict-java": ["@cspell/dict-java@5.0.12", "", {}, "sha512-qPSNhTcl7LGJ5Qp6VN71H8zqvRQK04S08T67knMq9hTA8U7G1sTKzLmBaDOFhq17vNX/+rT+rbRYp+B5Nwza1A=="], + + "@cspell/dict-julia": ["@cspell/dict-julia@1.1.1", "", {}, "sha512-WylJR9TQ2cgwd5BWEOfdO3zvDB+L7kYFm0I9u0s9jKHWQ6yKmfKeMjU9oXxTBxIufhCXm92SKwwVNAC7gjv+yA=="], + + "@cspell/dict-k8s": ["@cspell/dict-k8s@1.0.12", "", {}, "sha512-2LcllTWgaTfYC7DmkMPOn9GsBWsA4DZdlun4po8s2ysTP7CPEnZc1ZfK6pZ2eI4TsZemlUQQ+NZxMe9/QutQxg=="], + + "@cspell/dict-kotlin": ["@cspell/dict-kotlin@1.1.1", "", {}, "sha512-J3NzzfgmxRvEeOe3qUXnSJQCd38i/dpF9/t3quuWh6gXM+krsAXP75dY1CzDmS8mrJAlBdVBeAW5eAZTD8g86Q=="], + + "@cspell/dict-latex": ["@cspell/dict-latex@4.0.4", "", {}, "sha512-YdTQhnTINEEm/LZgTzr9Voz4mzdOXH7YX+bSFs3hnkUHCUUtX/mhKgf1CFvZ0YNM2afjhQcmLaR9bDQVyYBvpA=="], + + "@cspell/dict-lorem-ipsum": ["@cspell/dict-lorem-ipsum@4.0.5", "", {}, "sha512-9a4TJYRcPWPBKkQAJ/whCu4uCAEgv/O2xAaZEI0n4y1/l18Yyx8pBKoIX5QuVXjjmKEkK7hi5SxyIsH7pFEK9Q=="], + + "@cspell/dict-lua": ["@cspell/dict-lua@4.0.8", "", {}, "sha512-N4PkgNDMu9JVsRu7JBS/3E/dvfItRgk9w5ga2dKq+JupP2Y3lojNaAVFhXISh4Y0a6qXDn2clA6nvnavQ/jjLA=="], + + "@cspell/dict-makefile": ["@cspell/dict-makefile@1.0.5", "", {}, "sha512-4vrVt7bGiK8Rx98tfRbYo42Xo2IstJkAF4tLLDMNQLkQ86msDlYSKG1ZCk8Abg+EdNcFAjNhXIiNO+w4KflGAQ=="], + + "@cspell/dict-markdown": ["@cspell/dict-markdown@2.0.12", "", { "peerDependencies": { "@cspell/dict-css": "^4.0.18", "@cspell/dict-html": "^4.0.12", "@cspell/dict-html-symbol-entities": "^4.0.4", "@cspell/dict-typescript": "^3.2.3" } }, "sha512-ufwoliPijAgWkD/ivAMC+A9QD895xKiJRF/fwwknQb7kt7NozTLKFAOBtXGPJAB4UjhGBpYEJVo2elQ0FCAH9A=="], + + "@cspell/dict-monkeyc": ["@cspell/dict-monkeyc@1.0.11", "", {}, "sha512-7Q1Ncu0urALI6dPTrEbSTd//UK0qjRBeaxhnm8uY5fgYNFYAG+u4gtnTIo59S6Bw5P++4H3DiIDYoQdY/lha8w=="], + + "@cspell/dict-node": ["@cspell/dict-node@5.0.8", "", {}, "sha512-AirZcN2i84ynev3p2/1NCPEhnNsHKMz9zciTngGoqpdItUb2bDt1nJBjwlsrFI78GZRph/VaqTVFwYikmncpXg=="], + + "@cspell/dict-npm": ["@cspell/dict-npm@5.2.12", "", {}, "sha512-f5xcEl6+JZCFvDCOKJJuKv1ZMOzq9sBg/7y/iuqkBOgjeGDdB+PSrOJWk2jqu3PzXjjX39KJkt7mRUzv8Mrh1g=="], + + "@cspell/dict-php": ["@cspell/dict-php@4.0.15", "", {}, "sha512-iepGB2gtToMWSTvybesn4/lUp4LwXcEm0s8vasJLP76WWVkq1zYjmeS+WAIzNgsuURyZ/9mGqhS0CWMuo74ODw=="], + + "@cspell/dict-powershell": ["@cspell/dict-powershell@5.0.15", "", {}, "sha512-l4S5PAcvCFcVDMJShrYD0X6Huv9dcsQPlsVsBGbH38wvuN7gS7+GxZFAjTNxDmTY1wrNi1cCatSg6Pu2BW4rgg=="], + + "@cspell/dict-public-licenses": ["@cspell/dict-public-licenses@2.0.14", "", {}, "sha512-8NhNzQWALF6+NlLeKZKilSHbeW9MWeiD+NcrjehMAcovKFbsn8smmQG/bVxw+Ymtd6WEgNpLgswAqNsbSQQ4og=="], + + "@cspell/dict-python": ["@cspell/dict-python@4.2.19", "", { "dependencies": { "@cspell/dict-data-science": "^2.0.9" } }, "sha512-9S2gTlgILp1eb6OJcVZeC8/Od83N8EqBSg5WHVpx97eMMJhifOzePkE0kDYjyHMtAFznCQTUu0iQEJohNQ5B0A=="], + + "@cspell/dict-r": ["@cspell/dict-r@2.1.1", "", {}, "sha512-71Ka+yKfG4ZHEMEmDxc6+blFkeTTvgKbKAbwiwQAuKl3zpqs1Y0vUtwW2N4b3LgmSPhV3ODVY0y4m5ofqDuKMw=="], + + "@cspell/dict-ruby": ["@cspell/dict-ruby@5.0.9", "", {}, "sha512-H2vMcERMcANvQshAdrVx0XoWaNX8zmmiQN11dZZTQAZaNJ0xatdJoSqY8C8uhEMW89bfgpN+NQgGuDXW2vmXEw=="], + + "@cspell/dict-rust": ["@cspell/dict-rust@4.0.12", "", {}, "sha512-z2QiH+q9UlNhobBJArvILRxV8Jz0pKIK7gqu4TgmEYyjiu1TvnGZ1tbYHeu9w3I/wOP6UMDoCBTty5AlYfW0mw=="], + + "@cspell/dict-scala": ["@cspell/dict-scala@5.0.8", "", {}, "sha512-YdftVmumv8IZq9zu1gn2U7A4bfM2yj9Vaupydotyjuc+EEZZSqAafTpvW/jKLWji2TgybM1L2IhmV0s/Iv9BTw=="], + + "@cspell/dict-shell": ["@cspell/dict-shell@1.1.1", "", {}, "sha512-T37oYxE7OV1x/1D4/13Y8JZGa1QgDCXV7AVt3HLXjn0Fe3TaNDvf5sU0fGnXKmBPqFFrHdpD3uutAQb1dlp15g=="], + + "@cspell/dict-software-terms": ["@cspell/dict-software-terms@5.1.4", "", {}, "sha512-zeinnVFfha+Snh8hMk4hRJTYWNLcRNaHRSvMMVe1DU8oljb1agfq6ouBt/uypIzwgGgAopPz9ArGyc/gVn9y8w=="], + + "@cspell/dict-sql": ["@cspell/dict-sql@2.2.1", "", {}, "sha512-qDHF8MpAYCf4pWU8NKbnVGzkoxMNrFqBHyG/dgrlic5EQiKANCLELYtGlX5auIMDLmTf1inA0eNtv74tyRJ/vg=="], + + "@cspell/dict-svelte": ["@cspell/dict-svelte@1.0.7", "", {}, "sha512-hGZsGqP0WdzKkdpeVLBivRuSNzOTvN036EBmpOwxH+FTY2DuUH7ecW+cSaMwOgmq5JFSdTcbTNFlNC8HN8lhaQ=="], + + "@cspell/dict-swift": ["@cspell/dict-swift@2.0.6", "", {}, "sha512-PnpNbrIbex2aqU1kMgwEKvCzgbkHtj3dlFLPMqW1vSniop7YxaDTtvTUO4zA++ugYAEL+UK8vYrBwDPTjjvSnA=="], + + "@cspell/dict-terraform": ["@cspell/dict-terraform@1.1.3", "", {}, "sha512-gr6wxCydwSFyyBKhBA2xkENXtVFToheqYYGFvlMZXWjviynXmh+NK/JTvTCk/VHk3+lzbO9EEQKee6VjrAUSbA=="], + + "@cspell/dict-typescript": ["@cspell/dict-typescript@3.2.3", "", {}, "sha512-zXh1wYsNljQZfWWdSPYwQhpwiuW0KPW1dSd8idjMRvSD0aSvWWHoWlrMsmZeRl4qM4QCEAjua8+cjflm41cQBg=="], + + "@cspell/dict-vue": ["@cspell/dict-vue@3.0.5", "", {}, "sha512-Mqutb8jbM+kIcywuPQCCaK5qQHTdaByoEO2J9LKFy3sqAdiBogNkrplqUK0HyyRFgCfbJUgjz3N85iCMcWH0JA=="], + + "@cspell/dynamic-import": ["@cspell/dynamic-import@9.1.5", "", { "dependencies": { "@cspell/url": "9.1.5", "import-meta-resolve": "^4.1.0" } }, "sha512-vf6mSD9XW3fvl/uXShiZJ58f+FV6uoOPoFV0+xyg78h80bpXOagJeAd/vy0YcGcP/kcAcgRK0q22wCeKkGbeOA=="], + + "@cspell/filetypes": ["@cspell/filetypes@9.1.5", "", {}, "sha512-Rhy+jBQwLKP6QnW2hIUYZiJ7TfJpTTW/gMfXJYf38BMIKkDlSx1bJV0j6VTcQF3EdqY6f5HmY48uDzNB87ygQQ=="], + + "@cspell/strong-weak-map": ["@cspell/strong-weak-map@9.1.5", "", {}, "sha512-/IvDGDZAGk41Gm6i/YDpu7Cn47Ap6c+ZXHRb5/BdzK7oomSfeDA77YBTMJrbwSQQEt/NDY+5LXxmB161xIQxSw=="], + + "@cspell/url": ["@cspell/url@9.1.5", "", {}, "sha512-2AxwDCf4fwXF558Qf4fHUAreVUvEaRhWagkX3uO6PES+54/uNmLDmjL3Xl6R+GpGGrIeRrBGtc/nqAeamK9g+g=="], + + "@eslint-community/eslint-utils": ["@eslint-community/eslint-utils@4.7.0", "", { "dependencies": { "eslint-visitor-keys": "^3.4.3" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw=="], + + "@eslint-community/regexpp": ["@eslint-community/regexpp@4.12.1", "", {}, "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ=="], + + "@eslint/config-array": ["@eslint/config-array@0.21.0", "", { "dependencies": { "@eslint/object-schema": "^2.1.6", "debug": "^4.3.1", "minimatch": "^3.1.2" } }, "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ=="], + + "@eslint/config-helpers": ["@eslint/config-helpers@0.3.0", "", {}, "sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw=="], + + "@eslint/core": ["@eslint/core@0.15.1", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA=="], + + "@eslint/eslintrc": ["@eslint/eslintrc@3.3.1", "", { "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^10.0.1", "globals": "^14.0.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", "minimatch": "^3.1.2", "strip-json-comments": "^3.1.1" } }, "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ=="], + + "@eslint/js": ["@eslint/js@9.31.0", "", {}, "sha512-LOm5OVt7D4qiKCqoiPbA7LWmI+tbw1VbTUowBcUMgQSuM6poJufkFkYDcQpo5KfgD39TnNySV26QjOh7VFpSyw=="], + + "@eslint/object-schema": ["@eslint/object-schema@2.1.6", "", {}, "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA=="], + + "@eslint/plugin-kit": ["@eslint/plugin-kit@0.3.3", "", { "dependencies": { "@eslint/core": "^0.15.1", "levn": "^0.4.1" } }, "sha512-1+WqvgNMhmlAambTvT3KPtCl/Ibr68VldY2XY40SL1CE0ZXiakFR/cbTspaF5HsnpDMvcYYoJHfl4980NBjGag=="], + + "@humanfs/core": ["@humanfs/core@0.19.1", "", {}, "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA=="], + + "@humanfs/node": ["@humanfs/node@0.16.6", "", { "dependencies": { "@humanfs/core": "^0.19.1", "@humanwhocodes/retry": "^0.3.0" } }, "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw=="], + + "@humanwhocodes/module-importer": ["@humanwhocodes/module-importer@1.0.1", "", {}, "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA=="], + + "@humanwhocodes/retry": ["@humanwhocodes/retry@0.4.3", "", {}, "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ=="], + + "@modelcontextprotocol/sdk": ["@modelcontextprotocol/sdk@1.15.1", "", { "dependencies": { "ajv": "^6.12.6", "content-type": "^1.0.5", "cors": "^2.8.5", "cross-spawn": "^7.0.5", "eventsource": "^3.0.2", "eventsource-parser": "^3.0.0", "express": "^5.0.1", "express-rate-limit": "^7.5.0", "pkce-challenge": "^5.0.0", "raw-body": "^3.0.0", "zod": "^3.23.8", "zod-to-json-schema": "^3.24.1" } }, "sha512-W/XlN9c528yYn+9MQkVjxiTPgPxoxt+oczfjHBDsJx0+59+O7B75Zhsp0B16Xbwbz8ANISDajh6+V7nIcPMc5w=="], + + "@nodelib/fs.scandir": ["@nodelib/fs.scandir@2.1.5", "", { "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" } }, "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g=="], + + "@nodelib/fs.stat": ["@nodelib/fs.stat@2.0.5", "", {}, "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A=="], + + "@nodelib/fs.walk": ["@nodelib/fs.walk@1.2.8", "", { "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" } }, "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg=="], + + "@pkgr/core": ["@pkgr/core@0.2.7", "", {}, "sha512-YLT9Zo3oNPJoBjBc4q8G2mjU4tqIbf5CEOORbUUr48dCD9q3umJ3IPlVqOqDakPfd2HuwccBaqlGhN4Gmr5OWg=="], + + "@rtsao/scc": ["@rtsao/scc@1.1.0", "", {}, "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g=="], + + "@types/body-parser": ["@types/body-parser@1.19.6", "", { "dependencies": { "@types/connect": "*", "@types/node": "*" } }, "sha512-HLFeCYgz89uk22N5Qg3dvGvsv46B8GLvKKo1zKG4NybA8U2DiEO3w9lqGg29t/tfLRJpJ6iQxnVw4OnB7MoM9g=="], + + "@types/bun": ["@types/bun@1.2.18", "", { "dependencies": { "bun-types": "1.2.18" } }, "sha512-Xf6RaWVheyemaThV0kUfaAUvCNokFr+bH8Jxp+tTZfx7dAPA8z9ePnP9S9+Vspzuxxx9JRAXhnyccRj3GyCMdQ=="], + + "@types/connect": ["@types/connect@3.4.38", "", { "dependencies": { "@types/node": "*" } }, "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug=="], + + "@types/cors": ["@types/cors@2.8.19", "", { "dependencies": { "@types/node": "*" } }, "sha512-mFNylyeyqN93lfe/9CSxOGREz8cpzAhH+E93xJ4xWQf62V8sQ/24reV2nyzUWM6H6Xji+GGHpkbLe7pVoUEskg=="], + + "@types/estree": ["@types/estree@1.0.8", "", {}, "sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w=="], + + "@types/express": ["@types/express@5.0.3", "", { "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^5.0.0", "@types/serve-static": "*" } }, "sha512-wGA0NX93b19/dZC1J18tKWVIYWyyF2ZjT9vin/NRu0qzzvfVzWjs04iq2rQ3H65vCTQYlRqs3YHfY7zjdV+9Kw=="], + + "@types/express-serve-static-core": ["@types/express-serve-static-core@5.0.7", "", { "dependencies": { "@types/node": "*", "@types/qs": "*", "@types/range-parser": "*", "@types/send": "*" } }, "sha512-R+33OsgWw7rOhD1emjU7dzCDHucJrgJXMA5PYCzJxVil0dsyx5iBEPHqpPfiKNJQb7lZ1vxwoLR4Z87bBUpeGQ=="], + + "@types/http-errors": ["@types/http-errors@2.0.5", "", {}, "sha512-r8Tayk8HJnX0FztbZN7oVqGccWgw98T/0neJphO91KkmOzug1KkofZURD4UaD5uH8AqcFLfdPErnBod0u71/qg=="], + + "@types/json-schema": ["@types/json-schema@7.0.15", "", {}, "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA=="], + + "@types/json5": ["@types/json5@0.0.29", "", {}, "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ=="], + + "@types/mime": ["@types/mime@1.3.5", "", {}, "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w=="], + + "@types/node": ["@types/node@24.0.13", "", { "dependencies": { "undici-types": "~7.8.0" } }, "sha512-Qm9OYVOFHFYg3wJoTSrz80hoec5Lia/dPp84do3X7dZvLikQvM1YpmvTBEdIr/e+U8HTkFjLHLnl78K/qjf+jQ=="], + + "@types/qs": ["@types/qs@6.14.0", "", {}, "sha512-eOunJqu0K1923aExK6y8p6fsihYEn/BYuQ4g0CxAAgFc4b/ZLN4CrsRZ55srTdqoiLzU2B2evC+apEIxprEzkQ=="], + + "@types/range-parser": ["@types/range-parser@1.2.7", "", {}, "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ=="], + + "@types/react": ["@types/react@19.1.8", "", { "dependencies": { "csstype": "^3.0.2" } }, "sha512-AwAfQ2Wa5bCx9WP8nZL2uMZWod7J7/JSplxbTmBQ5ms6QpqNYm672H0Vu9ZVKVngQ+ii4R/byguVEUZQyeg44g=="], + + "@types/send": ["@types/send@0.17.5", "", { "dependencies": { "@types/mime": "^1", "@types/node": "*" } }, "sha512-z6F2D3cOStZvuk2SaP6YrwkNO65iTZcwA2ZkSABegdkAh/lf+Aa/YQndZVfmEXT5vgAp6zv06VQ3ejSVjAny4w=="], + + "@types/serve-static": ["@types/serve-static@1.15.8", "", { "dependencies": { "@types/http-errors": "*", "@types/node": "*", "@types/send": "*" } }, "sha512-roei0UY3LhpOJvjbIP6ZZFngyLKl5dskOtDhxY5THRSpO+ZI+nzJ+m5yUMzGrp89YRa7lvknKkMYjqQFGwA7Sg=="], + + "@typescript-eslint/eslint-plugin": ["@typescript-eslint/eslint-plugin@8.37.0", "", { "dependencies": { "@eslint-community/regexpp": "^4.10.0", "@typescript-eslint/scope-manager": "8.37.0", "@typescript-eslint/type-utils": "8.37.0", "@typescript-eslint/utils": "8.37.0", "@typescript-eslint/visitor-keys": "8.37.0", "graphemer": "^1.4.0", "ignore": "^7.0.0", "natural-compare": "^1.4.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "@typescript-eslint/parser": "^8.37.0", "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-jsuVWeIkb6ggzB+wPCsR4e6loj+rM72ohW6IBn2C+5NCvfUVY8s33iFPySSVXqtm5Hu29Ne/9bnA0JmyLmgenA=="], + + "@typescript-eslint/parser": ["@typescript-eslint/parser@8.37.0", "", { "dependencies": { "@typescript-eslint/scope-manager": "8.37.0", "@typescript-eslint/types": "8.37.0", "@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/visitor-keys": "8.37.0", "debug": "^4.3.4" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-kVIaQE9vrN9RLCQMQ3iyRlVJpTiDUY6woHGb30JDkfJErqrQEmtdWH3gV0PBAfGZgQXoqzXOO0T3K6ioApbbAA=="], + + "@typescript-eslint/project-service": ["@typescript-eslint/project-service@8.37.0", "", { "dependencies": { "@typescript-eslint/tsconfig-utils": "^8.37.0", "@typescript-eslint/types": "^8.37.0", "debug": "^4.3.4" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-BIUXYsbkl5A1aJDdYJCBAo8rCEbAvdquQ8AnLb6z5Lp1u3x5PNgSSx9A/zqYc++Xnr/0DVpls8iQ2cJs/izTXA=="], + + "@typescript-eslint/scope-manager": ["@typescript-eslint/scope-manager@8.37.0", "", { "dependencies": { "@typescript-eslint/types": "8.37.0", "@typescript-eslint/visitor-keys": "8.37.0" } }, "sha512-0vGq0yiU1gbjKob2q691ybTg9JX6ShiVXAAfm2jGf3q0hdP6/BruaFjL/ManAR/lj05AvYCH+5bbVo0VtzmjOA=="], + + "@typescript-eslint/tsconfig-utils": ["@typescript-eslint/tsconfig-utils@8.37.0", "", { "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-1/YHvAVTimMM9mmlPvTec9NP4bobA1RkDbMydxG8omqwJJLEW/Iy2C4adsAESIXU3WGLXFHSZUU+C9EoFWl4Zg=="], + + "@typescript-eslint/type-utils": ["@typescript-eslint/type-utils@8.37.0", "", { "dependencies": { "@typescript-eslint/types": "8.37.0", "@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/utils": "8.37.0", "debug": "^4.3.4", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-SPkXWIkVZxhgwSwVq9rqj/4VFo7MnWwVaRNznfQDc/xPYHjXnPfLWn+4L6FF1cAz6e7dsqBeMawgl7QjUMj4Ow=="], + + "@typescript-eslint/types": ["@typescript-eslint/types@8.37.0", "", {}, "sha512-ax0nv7PUF9NOVPs+lmQ7yIE7IQmAf8LGcXbMvHX5Gm+YJUYNAl340XkGnrimxZ0elXyoQJuN5sbg6C4evKA4SQ=="], + + "@typescript-eslint/typescript-estree": ["@typescript-eslint/typescript-estree@8.37.0", "", { "dependencies": { "@typescript-eslint/project-service": "8.37.0", "@typescript-eslint/tsconfig-utils": "8.37.0", "@typescript-eslint/types": "8.37.0", "@typescript-eslint/visitor-keys": "8.37.0", "debug": "^4.3.4", "fast-glob": "^3.3.2", "is-glob": "^4.0.3", "minimatch": "^9.0.4", "semver": "^7.6.0", "ts-api-utils": "^2.1.0" }, "peerDependencies": { "typescript": ">=4.8.4 <5.9.0" } }, "sha512-zuWDMDuzMRbQOM+bHyU4/slw27bAUEcKSKKs3hcv2aNnc/tvE/h7w60dwVw8vnal2Pub6RT1T7BI8tFZ1fE+yg=="], + + "@typescript-eslint/utils": ["@typescript-eslint/utils@8.37.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.7.0", "@typescript-eslint/scope-manager": "8.37.0", "@typescript-eslint/types": "8.37.0", "@typescript-eslint/typescript-estree": "8.37.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-TSFvkIW6gGjN2p6zbXo20FzCABbyUAuq6tBvNRGsKdsSQ6a7rnV6ADfZ7f4iI3lIiXc4F4WWvtUfDw9CJ9pO5A=="], + + "@typescript-eslint/visitor-keys": ["@typescript-eslint/visitor-keys@8.37.0", "", { "dependencies": { "@typescript-eslint/types": "8.37.0", "eslint-visitor-keys": "^4.2.1" } }, "sha512-YzfhzcTnZVPiLfP/oeKtDp2evwvHLMe0LOy7oe+hb9KKIumLNohYS9Hgp1ifwpu42YWxhZE8yieggz6JpqO/1w=="], + + "accepts": ["accepts@2.0.0", "", { "dependencies": { "mime-types": "^3.0.0", "negotiator": "^1.0.0" } }, "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng=="], + + "acorn": ["acorn@8.15.0", "", { "bin": { "acorn": "bin/acorn" } }, "sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg=="], + + "acorn-jsx": ["acorn-jsx@5.3.2", "", { "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ=="], + + "ajv": ["ajv@6.12.6", "", { "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", "json-schema-traverse": "^0.4.1", "uri-js": "^4.2.2" } }, "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g=="], + + "ansi-styles": ["ansi-styles@4.3.0", "", { "dependencies": { "color-convert": "^2.0.1" } }, "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg=="], + + "argparse": ["argparse@2.0.1", "", {}, "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="], + + "array-buffer-byte-length": ["array-buffer-byte-length@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "is-array-buffer": "^3.0.5" } }, "sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw=="], + + "array-includes": ["array-includes@3.1.9", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.24.0", "es-object-atoms": "^1.1.1", "get-intrinsic": "^1.3.0", "is-string": "^1.1.1", "math-intrinsics": "^1.1.0" } }, "sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ=="], + + "array-timsort": ["array-timsort@1.0.3", "", {}, "sha512-/+3GRL7dDAGEfM6TseQk/U+mi18TU2Ms9I3UlLdUMhz2hbvGNTKdj9xniwXfUqgYhHxRx0+8UnKkvlNwVU+cWQ=="], + + "array.prototype.findlastindex": ["array.prototype.findlastindex@1.2.6", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-shim-unscopables": "^1.1.0" } }, "sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ=="], + + "array.prototype.flat": ["array.prototype.flat@1.3.3", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-rwG/ja1neyLqCuGZ5YYrznA62D4mZXg0i1cIskIUKSiqF3Cje9/wXAls9B9s1Wa2fomMsIv8czB8jZcPmxCXFg=="], + + "array.prototype.flatmap": ["array.prototype.flatmap@1.3.3", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-shim-unscopables": "^1.0.2" } }, "sha512-Y7Wt51eKJSyi80hFrJCePGGNo5ktJCslFuboqJsbf57CCPcm5zztluPlc4/aD8sWsKvlwatezpV4U1efk8kpjg=="], + + "arraybuffer.prototype.slice": ["arraybuffer.prototype.slice@1.0.4", "", { "dependencies": { "array-buffer-byte-length": "^1.0.1", "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "is-array-buffer": "^3.0.4" } }, "sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ=="], + + "async-function": ["async-function@1.0.0", "", {}, "sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA=="], + + "atomic-sleep": ["atomic-sleep@1.0.0", "", {}, "sha512-kNOjDqAh7px0XWNI+4QbzoiR/nTkHAWNud2uvnJquD1/x5a7EQZMJT0AczqK0Qn67oY/TTQ1LbUKajZpp3I9tQ=="], + + "available-typed-arrays": ["available-typed-arrays@1.0.7", "", { "dependencies": { "possible-typed-array-names": "^1.0.0" } }, "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ=="], + + "balanced-match": ["balanced-match@1.0.2", "", {}, "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw=="], + + "body-parser": ["body-parser@2.2.0", "", { "dependencies": { "bytes": "^3.1.2", "content-type": "^1.0.5", "debug": "^4.4.0", "http-errors": "^2.0.0", "iconv-lite": "^0.6.3", "on-finished": "^2.4.1", "qs": "^6.14.0", "raw-body": "^3.0.0", "type-is": "^2.0.0" } }, "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg=="], + + "brace-expansion": ["brace-expansion@1.1.12", "", { "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg=="], + + "braces": ["braces@3.0.3", "", { "dependencies": { "fill-range": "^7.1.1" } }, "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA=="], + + "browserslist": ["browserslist@4.25.1", "", { "dependencies": { "caniuse-lite": "^1.0.30001726", "electron-to-chromium": "^1.5.173", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, "bin": { "browserslist": "cli.js" } }, "sha512-KGj0KoOMXLpSNkkEI6Z6mShmQy0bc1I+T7K9N81k4WWMrfz+6fQ6es80B/YLAeRoKvjYE1YSHHOW1qe9xIVzHw=="], + + "builtin-modules": ["builtin-modules@5.0.0", "", {}, "sha512-bkXY9WsVpY7CvMhKSR6pZilZu9Ln5WDrKVBUXf2S443etkmEO4V58heTecXcUIsNsi4Rx8JUO4NfX1IcQl4deg=="], + + "bun-types": ["bun-types@1.2.18", "", { "dependencies": { "@types/node": "*" }, "peerDependencies": { "@types/react": "^19" } }, "sha512-04+Eha5NP7Z0A9YgDAzMk5PHR16ZuLVa83b26kH5+cp1qZW4F6FmAURngE7INf4tKOvCE69vYvDEwoNl1tGiWw=="], + + "bytes": ["bytes@3.1.2", "", {}, "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg=="], + + "call-bind": ["call-bind@1.0.8", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.0", "es-define-property": "^1.0.0", "get-intrinsic": "^1.2.4", "set-function-length": "^1.2.2" } }, "sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww=="], + + "call-bind-apply-helpers": ["call-bind-apply-helpers@1.0.2", "", { "dependencies": { "es-errors": "^1.3.0", "function-bind": "^1.1.2" } }, "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ=="], + + "call-bound": ["call-bound@1.0.4", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "get-intrinsic": "^1.3.0" } }, "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg=="], + + "callsites": ["callsites@3.1.0", "", {}, "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="], + + "caniuse-lite": ["caniuse-lite@1.0.30001727", "", {}, "sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q=="], + + "chalk": ["chalk@5.4.1", "", {}, "sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w=="], + + "chalk-template": ["chalk-template@1.1.0", "", { "dependencies": { "chalk": "^5.2.0" } }, "sha512-T2VJbcDuZQ0Tb2EWwSotMPJjgpy1/tGee1BTpUNsGZ/qgNjV2t7Mvu+d4600U564nbLesN1x2dPL+xii174Ekg=="], + + "ci-info": ["ci-info@4.3.0", "", {}, "sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ=="], + + "clean-regexp": ["clean-regexp@1.0.0", "", { "dependencies": { "escape-string-regexp": "^1.0.5" } }, "sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw=="], + + "clear-module": ["clear-module@4.1.2", "", { "dependencies": { "parent-module": "^2.0.0", "resolve-from": "^5.0.0" } }, "sha512-LWAxzHqdHsAZlPlEyJ2Poz6AIs384mPeqLVCru2p0BrP9G/kVGuhNyZYClLO6cXlnuJjzC8xtsJIuMjKqLXoAw=="], + + "color-convert": ["color-convert@2.0.1", "", { "dependencies": { "color-name": "~1.1.4" } }, "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ=="], + + "color-name": ["color-name@1.1.4", "", {}, "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="], + + "commander": ["commander@14.0.0", "", {}, "sha512-2uM9rYjPvyq39NwLRqaiLtWHyDC1FvryJDa2ATTVims5YAS4PupsEQsDvP14FqhFr0P49CYDugi59xaxJlTXRA=="], + + "comment-json": ["comment-json@4.2.5", "", { "dependencies": { "array-timsort": "^1.0.3", "core-util-is": "^1.0.3", "esprima": "^4.0.1", "has-own-prop": "^2.0.0", "repeat-string": "^1.6.1" } }, "sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw=="], + + "concat-map": ["concat-map@0.0.1", "", {}, "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg=="], + + "content-disposition": ["content-disposition@1.0.0", "", { "dependencies": { "safe-buffer": "5.2.1" } }, "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg=="], + + "content-type": ["content-type@1.0.5", "", {}, "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA=="], + + "cookie": ["cookie@0.7.2", "", {}, "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w=="], + + "cookie-signature": ["cookie-signature@1.2.2", "", {}, "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg=="], + + "core-js-compat": ["core-js-compat@3.44.0", "", { "dependencies": { "browserslist": "^4.25.1" } }, "sha512-JepmAj2zfl6ogy34qfWtcE7nHKAJnKsQFRn++scjVS2bZFllwptzw61BZcZFYBPpUznLfAvh0LGhxKppk04ClA=="], + + "core-util-is": ["core-util-is@1.0.3", "", {}, "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ=="], + + "cors": ["cors@2.8.5", "", { "dependencies": { "object-assign": "^4", "vary": "^1" } }, "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g=="], + + "cross-spawn": ["cross-spawn@7.0.6", "", { "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", "which": "^2.0.1" } }, "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA=="], + + "cspell": ["cspell@9.1.5", "", { "dependencies": { "@cspell/cspell-json-reporter": "9.1.5", "@cspell/cspell-pipe": "9.1.5", "@cspell/cspell-types": "9.1.5", "@cspell/dynamic-import": "9.1.5", "@cspell/url": "9.1.5", "chalk": "^5.4.1", "chalk-template": "^1.1.0", "commander": "^14.0.0", "cspell-config-lib": "9.1.5", "cspell-dictionary": "9.1.5", "cspell-gitignore": "9.1.5", "cspell-glob": "9.1.5", "cspell-io": "9.1.5", "cspell-lib": "9.1.5", "fast-json-stable-stringify": "^2.1.0", "file-entry-cache": "^9.1.0", "semver": "^7.7.2", "tinyglobby": "^0.2.14" }, "bin": { "cspell": "bin.mjs", "cspell-esm": "bin.mjs" } }, "sha512-AlFoGplH1YyRoCFHg2K0auS8vDna4yJjUiuP2mVZn82MaEKJQ4tMgnvUMdP+HtPP1lFlQ0iCvFr6+VVqCJVEDg=="], + + "cspell-config-lib": ["cspell-config-lib@9.1.5", "", { "dependencies": { "@cspell/cspell-types": "9.1.5", "comment-json": "^4.2.5", "smol-toml": "^1.4.1", "yaml": "^2.8.0" } }, "sha512-VE3tsr2y+FwTENoAPFqzx8xE/+xTkllW3/i0HDRai5Kv8o35+ilTozY476bOI7fj445wNqPR8JstEdV314fdGA=="], + + "cspell-dictionary": ["cspell-dictionary@9.1.5", "", { "dependencies": { "@cspell/cspell-pipe": "9.1.5", "@cspell/cspell-types": "9.1.5", "cspell-trie-lib": "9.1.5", "fast-equals": "^5.2.2" } }, "sha512-UpMFtKs9O028yIxea/svTyUPPgNzlVdZXsht5O47nDuK+pVfZu+ngJOGSwmyoafQqd25jY00WRFXhQ5h503u1g=="], + + "cspell-gitignore": ["cspell-gitignore@9.1.5", "", { "dependencies": { "@cspell/url": "9.1.5", "cspell-glob": "9.1.5", "cspell-io": "9.1.5" }, "bin": { "cspell-gitignore": "bin.mjs" } }, "sha512-zTLVv0xhuMKxCTdy1M68MuOYvDD/6IKLg8aL+06kO2TM3tQR91mJVSrazT9c+AmmpstOhzcVGmXf6vBNNDUa0Q=="], + + "cspell-glob": ["cspell-glob@9.1.5", "", { "dependencies": { "@cspell/url": "9.1.5", "picomatch": "^4.0.2" } }, "sha512-aMlUCSLcxVL7BdFAlxHHCvA/R35Jr457t4XJiJOoUCupybr5cBPvn8PNpEllBKhG60n6F/QN2uIt+r1tCJbAaQ=="], + + "cspell-grammar": ["cspell-grammar@9.1.5", "", { "dependencies": { "@cspell/cspell-pipe": "9.1.5", "@cspell/cspell-types": "9.1.5" }, "bin": { "cspell-grammar": "bin.mjs" } }, "sha512-TSqlFZk2thBghPSEKb1DeLoLVxlko/KBrg7siCaJV8aBi0Juve48f4+rIfSW9L7Nd5Y7VpuYxI0iriP4LTE+Dw=="], + + "cspell-io": ["cspell-io@9.1.5", "", { "dependencies": { "@cspell/cspell-service-bus": "9.1.5", "@cspell/url": "9.1.5" } }, "sha512-i4bw5QDZp1yoxii+bmD/V6eFGIX5IzGwROko/6X84JHjtJGItiiA3kLfO69fZuXhzuzn9GjWRhSVX6wHafRAtQ=="], + + "cspell-lib": ["cspell-lib@9.1.5", "", { "dependencies": { "@cspell/cspell-bundled-dicts": "9.1.5", "@cspell/cspell-pipe": "9.1.5", "@cspell/cspell-resolver": "9.1.5", "@cspell/cspell-types": "9.1.5", "@cspell/dynamic-import": "9.1.5", "@cspell/filetypes": "9.1.5", "@cspell/strong-weak-map": "9.1.5", "@cspell/url": "9.1.5", "clear-module": "^4.1.2", "comment-json": "^4.2.5", "cspell-config-lib": "9.1.5", "cspell-dictionary": "9.1.5", "cspell-glob": "9.1.5", "cspell-grammar": "9.1.5", "cspell-io": "9.1.5", "cspell-trie-lib": "9.1.5", "env-paths": "^3.0.0", "fast-equals": "^5.2.2", "gensequence": "^7.0.0", "import-fresh": "^3.3.1", "resolve-from": "^5.0.0", "vscode-languageserver-textdocument": "^1.0.12", "vscode-uri": "^3.1.0", "xdg-basedir": "^5.1.0" } }, "sha512-vxHPePzJRVFMN6NfKlCeekH11OZrxG7yW06BJ312tzsK/xovQ6Y+Rv2w2WC9h5TKHhPN2vP0aDPls/5ASH9PDA=="], + + "cspell-trie-lib": ["cspell-trie-lib@9.1.5", "", { "dependencies": { "@cspell/cspell-pipe": "9.1.5", "@cspell/cspell-types": "9.1.5", "gensequence": "^7.0.0" } }, "sha512-wDP7wUH54vVrdDCkpd6W0H3DkWbYhYzm6yDGqi/aN/Z0q/ZR2tBByEY4IjYeJ6VNxhzJZq4+2xYZQaQkZWJgwQ=="], + + "csstype": ["csstype@3.1.3", "", {}, "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="], + + "data-view-buffer": ["data-view-buffer@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ=="], + + "data-view-byte-length": ["data-view-byte-length@1.0.2", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-data-view": "^1.0.2" } }, "sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ=="], + + "data-view-byte-offset": ["data-view-byte-offset@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-data-view": "^1.0.1" } }, "sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ=="], + + "debug": ["debug@4.4.1", "", { "dependencies": { "ms": "^2.1.3" } }, "sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ=="], + + "deep-is": ["deep-is@0.1.4", "", {}, "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ=="], + + "define-data-property": ["define-data-property@1.1.4", "", { "dependencies": { "es-define-property": "^1.0.0", "es-errors": "^1.3.0", "gopd": "^1.0.1" } }, "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A=="], + + "define-properties": ["define-properties@1.2.1", "", { "dependencies": { "define-data-property": "^1.0.1", "has-property-descriptors": "^1.0.0", "object-keys": "^1.1.1" } }, "sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg=="], + + "depd": ["depd@2.0.0", "", {}, "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw=="], + + "doctrine": ["doctrine@2.1.0", "", { "dependencies": { "esutils": "^2.0.2" } }, "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw=="], + + "dunder-proto": ["dunder-proto@1.0.1", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.1", "es-errors": "^1.3.0", "gopd": "^1.2.0" } }, "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A=="], + + "ee-first": ["ee-first@1.1.1", "", {}, "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow=="], + + "electron-to-chromium": ["electron-to-chromium@1.5.183", "", {}, "sha512-vCrDBYjQCAEefWGjlK3EpoSKfKbT10pR4XXPdn65q7snuNOZnthoVpBfZPykmDapOKfoD+MMIPG8ZjKyyc9oHA=="], + + "encodeurl": ["encodeurl@2.0.0", "", {}, "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg=="], + + "env-paths": ["env-paths@3.0.0", "", {}, "sha512-dtJUTepzMW3Lm/NPxRf3wP4642UWhjL2sQxc+ym2YMj1m/H2zDNQOlezafzkHwn6sMstjHTwG6iQQsctDW/b1A=="], + + "env-var": ["env-var@7.5.0", "", {}, "sha512-mKZOzLRN0ETzau2W2QXefbFjo5EF4yWq28OyKb9ICdeNhHJlOE/pHHnz4hdYJ9cNZXcJHo5xN4OT4pzuSHSNvA=="], + + "es-abstract": ["es-abstract@1.24.0", "", { "dependencies": { "array-buffer-byte-length": "^1.0.2", "arraybuffer.prototype.slice": "^1.0.4", "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "data-view-buffer": "^1.0.2", "data-view-byte-length": "^1.0.2", "data-view-byte-offset": "^1.0.1", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "es-set-tostringtag": "^2.1.0", "es-to-primitive": "^1.3.0", "function.prototype.name": "^1.1.8", "get-intrinsic": "^1.3.0", "get-proto": "^1.0.1", "get-symbol-description": "^1.1.0", "globalthis": "^1.0.4", "gopd": "^1.2.0", "has-property-descriptors": "^1.0.2", "has-proto": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "internal-slot": "^1.1.0", "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", "is-data-view": "^1.0.2", "is-negative-zero": "^2.0.3", "is-regex": "^1.2.1", "is-set": "^2.0.3", "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", "is-weakref": "^1.1.1", "math-intrinsics": "^1.1.0", "object-inspect": "^1.13.4", "object-keys": "^1.1.1", "object.assign": "^4.1.7", "own-keys": "^1.0.1", "regexp.prototype.flags": "^1.5.4", "safe-array-concat": "^1.1.3", "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", "set-proto": "^1.0.0", "stop-iteration-iterator": "^1.1.0", "string.prototype.trim": "^1.2.10", "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", "typed-array-buffer": "^1.0.3", "typed-array-byte-length": "^1.0.3", "typed-array-byte-offset": "^1.0.4", "typed-array-length": "^1.0.7", "unbox-primitive": "^1.1.0", "which-typed-array": "^1.1.19" } }, "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg=="], + + "es-define-property": ["es-define-property@1.0.1", "", {}, "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g=="], + + "es-errors": ["es-errors@1.3.0", "", {}, "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw=="], + + "es-object-atoms": ["es-object-atoms@1.1.1", "", { "dependencies": { "es-errors": "^1.3.0" } }, "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA=="], + + "es-set-tostringtag": ["es-set-tostringtag@2.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA=="], + + "es-shim-unscopables": ["es-shim-unscopables@1.1.0", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw=="], + + "es-to-primitive": ["es-to-primitive@1.3.0", "", { "dependencies": { "is-callable": "^1.2.7", "is-date-object": "^1.0.5", "is-symbol": "^1.0.4" } }, "sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g=="], + + "escalade": ["escalade@3.2.0", "", {}, "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA=="], + + "escape-html": ["escape-html@1.0.3", "", {}, "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow=="], + + "escape-string-regexp": ["escape-string-regexp@4.0.0", "", {}, "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA=="], + + "eslint": ["eslint@9.31.0", "", { "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.12.1", "@eslint/config-array": "^0.21.0", "@eslint/config-helpers": "^0.3.0", "@eslint/core": "^0.15.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "9.31.0", "@eslint/plugin-kit": "^0.3.1", "@humanfs/node": "^0.16.6", "@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/retry": "^0.4.2", "@types/estree": "^1.0.6", "@types/json-schema": "^7.0.15", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.6", "debug": "^4.3.2", "escape-string-regexp": "^4.0.0", "eslint-scope": "^8.4.0", "eslint-visitor-keys": "^4.2.1", "espree": "^10.4.0", "esquery": "^1.5.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^8.0.0", "find-up": "^5.0.0", "glob-parent": "^6.0.2", "ignore": "^5.2.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", "json-stable-stringify-without-jsonify": "^1.0.1", "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", "optionator": "^0.9.3" }, "peerDependencies": { "jiti": "*" }, "optionalPeers": ["jiti"], "bin": { "eslint": "bin/eslint.js" } }, "sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ=="], + + "eslint-import-resolver-node": ["eslint-import-resolver-node@0.3.9", "", { "dependencies": { "debug": "^3.2.7", "is-core-module": "^2.13.0", "resolve": "^1.22.4" } }, "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g=="], + + "eslint-module-utils": ["eslint-module-utils@2.12.1", "", { "dependencies": { "debug": "^3.2.7" } }, "sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw=="], + + "eslint-plugin-import": ["eslint-plugin-import@2.32.0", "", { "dependencies": { "@rtsao/scc": "^1.1.0", "array-includes": "^3.1.9", "array.prototype.findlastindex": "^1.2.6", "array.prototype.flat": "^1.3.3", "array.prototype.flatmap": "^1.3.3", "debug": "^3.2.7", "doctrine": "^2.1.0", "eslint-import-resolver-node": "^0.3.9", "eslint-module-utils": "^2.12.1", "hasown": "^2.0.2", "is-core-module": "^2.16.1", "is-glob": "^4.0.3", "minimatch": "^3.1.2", "object.fromentries": "^2.0.8", "object.groupby": "^1.0.3", "object.values": "^1.2.1", "semver": "^6.3.1", "string.prototype.trimend": "^1.0.9", "tsconfig-paths": "^3.15.0" }, "peerDependencies": { "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 || ^9" } }, "sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA=="], + + "eslint-plugin-prettier": ["eslint-plugin-prettier@5.5.1", "", { "dependencies": { "prettier-linter-helpers": "^1.0.0", "synckit": "^0.11.7" }, "peerDependencies": { "@types/eslint": ">=8.0.0", "eslint": ">=8.0.0", "eslint-config-prettier": ">= 7.0.0 <10.0.0 || >=10.1.0", "prettier": ">=3.0.0" }, "optionalPeers": ["@types/eslint", "eslint-config-prettier"] }, "sha512-dobTkHT6XaEVOo8IO90Q4DOSxnm3Y151QxPJlM/vKC0bVy+d6cVWQZLlFiuZPP0wS6vZwSKeJgKkcS+KfMBlRw=="], + + "eslint-plugin-security": ["eslint-plugin-security@3.0.1", "", { "dependencies": { "safe-regex": "^2.1.1" } }, "sha512-XjVGBhtDZJfyuhIxnQ/WMm385RbX3DBu7H1J7HNNhmB2tnGxMeqVSnYv79oAj992ayvIBZghsymwkYFS6cGH4Q=="], + + "eslint-plugin-unicorn": ["eslint-plugin-unicorn@59.0.1", "", { "dependencies": { "@babel/helper-validator-identifier": "^7.25.9", "@eslint-community/eslint-utils": "^4.5.1", "@eslint/plugin-kit": "^0.2.7", "ci-info": "^4.2.0", "clean-regexp": "^1.0.0", "core-js-compat": "^3.41.0", "esquery": "^1.6.0", "find-up-simple": "^1.0.1", "globals": "^16.0.0", "indent-string": "^5.0.0", "is-builtin-module": "^5.0.0", "jsesc": "^3.1.0", "pluralize": "^8.0.0", "regexp-tree": "^0.1.27", "regjsparser": "^0.12.0", "semver": "^7.7.1", "strip-indent": "^4.0.0" }, "peerDependencies": { "eslint": ">=9.22.0" } }, "sha512-EtNXYuWPUmkgSU2E7Ttn57LbRREQesIP1BiLn7OZLKodopKfDXfBUkC/0j6mpw2JExwf43Uf3qLSvrSvppgy8Q=="], + + "eslint-scope": ["eslint-scope@8.4.0", "", { "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg=="], + + "eslint-visitor-keys": ["eslint-visitor-keys@4.2.1", "", {}, "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ=="], + + "espree": ["espree@10.4.0", "", { "dependencies": { "acorn": "^8.15.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^4.2.1" } }, "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ=="], + + "esprima": ["esprima@4.0.1", "", { "bin": { "esparse": "./bin/esparse.js", "esvalidate": "./bin/esvalidate.js" } }, "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="], + + "esquery": ["esquery@1.6.0", "", { "dependencies": { "estraverse": "^5.1.0" } }, "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg=="], + + "esrecurse": ["esrecurse@4.3.0", "", { "dependencies": { "estraverse": "^5.2.0" } }, "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag=="], + + "estraverse": ["estraverse@5.3.0", "", {}, "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA=="], + + "esutils": ["esutils@2.0.3", "", {}, "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="], + + "etag": ["etag@1.8.1", "", {}, "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg=="], + + "eventsource": ["eventsource@3.0.7", "", { "dependencies": { "eventsource-parser": "^3.0.1" } }, "sha512-CRT1WTyuQoD771GW56XEZFQ/ZoSfWid1alKGDYMmkt2yl8UXrVR4pspqWNEcqKvVIzg6PAltWjxcSSPrboA4iA=="], + + "eventsource-parser": ["eventsource-parser@3.0.3", "", {}, "sha512-nVpZkTMM9rF6AQ9gPJpFsNAMt48wIzB5TQgiTLdHiuO8XEDhUgZEhqKlZWXbIzo9VmJ/HvysHqEaVeD5v9TPvA=="], + + "express": ["express@5.1.0", "", { "dependencies": { "accepts": "^2.0.0", "body-parser": "^2.2.0", "content-disposition": "^1.0.0", "content-type": "^1.0.5", "cookie": "^0.7.1", "cookie-signature": "^1.2.1", "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "finalhandler": "^2.1.0", "fresh": "^2.0.0", "http-errors": "^2.0.0", "merge-descriptors": "^2.0.0", "mime-types": "^3.0.0", "on-finished": "^2.4.1", "once": "^1.4.0", "parseurl": "^1.3.3", "proxy-addr": "^2.0.7", "qs": "^6.14.0", "range-parser": "^1.2.1", "router": "^2.2.0", "send": "^1.1.0", "serve-static": "^2.2.0", "statuses": "^2.0.1", "type-is": "^2.0.1", "vary": "^1.1.2" } }, "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA=="], + + "express-rate-limit": ["express-rate-limit@7.5.1", "", { "peerDependencies": { "express": ">= 4.11" } }, "sha512-7iN8iPMDzOMHPUYllBEsQdWVB6fPDMPqwjBaFrgr4Jgr/+okjvzAy+UHlYYL/Vs0OsOrMkwS6PJDkFlJwoxUnw=="], + + "fast-deep-equal": ["fast-deep-equal@3.1.3", "", {}, "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="], + + "fast-diff": ["fast-diff@1.3.0", "", {}, "sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw=="], + + "fast-equals": ["fast-equals@5.2.2", "", {}, "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw=="], + + "fast-glob": ["fast-glob@3.3.3", "", { "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", "glob-parent": "^5.1.2", "merge2": "^1.3.0", "micromatch": "^4.0.8" } }, "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg=="], + + "fast-json-stable-stringify": ["fast-json-stable-stringify@2.1.0", "", {}, "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="], + + "fast-levenshtein": ["fast-levenshtein@2.0.6", "", {}, "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw=="], + + "fast-redact": ["fast-redact@3.5.0", "", {}, "sha512-dwsoQlS7h9hMeYUq1W++23NDcBLV4KqONnITDV9DjfS3q1SgDGVrBdvvTLUotWtPSD7asWDV9/CmsZPy8Hf70A=="], + + "fastq": ["fastq@1.19.1", "", { "dependencies": { "reusify": "^1.0.4" } }, "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ=="], + + "fdir": ["fdir@6.4.6", "", { "peerDependencies": { "picomatch": "^3 || ^4" }, "optionalPeers": ["picomatch"] }, "sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w=="], + + "file-entry-cache": ["file-entry-cache@9.1.0", "", { "dependencies": { "flat-cache": "^5.0.0" } }, "sha512-/pqPFG+FdxWQj+/WSuzXSDaNzxgTLr/OrR1QuqfEZzDakpdYE70PwUxL7BPUa8hpjbvY1+qvCl8k+8Tq34xJgg=="], + + "fill-range": ["fill-range@7.1.1", "", { "dependencies": { "to-regex-range": "^5.0.1" } }, "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg=="], + + "finalhandler": ["finalhandler@2.1.0", "", { "dependencies": { "debug": "^4.4.0", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "on-finished": "^2.4.1", "parseurl": "^1.3.3", "statuses": "^2.0.1" } }, "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q=="], + + "find-up": ["find-up@5.0.0", "", { "dependencies": { "locate-path": "^6.0.0", "path-exists": "^4.0.0" } }, "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng=="], + + "find-up-simple": ["find-up-simple@1.0.1", "", {}, "sha512-afd4O7zpqHeRyg4PfDQsXmlDe2PfdHtJt6Akt8jOWaApLOZk5JXs6VMR29lz03pRe9mpykrRCYIYxaJYcfpncQ=="], + + "flat-cache": ["flat-cache@5.0.0", "", { "dependencies": { "flatted": "^3.3.1", "keyv": "^4.5.4" } }, "sha512-JrqFmyUl2PnPi1OvLyTVHnQvwQ0S+e6lGSwu8OkAZlSaNIZciTY2H/cOOROxsBA1m/LZNHDsqAgDZt6akWcjsQ=="], + + "flatted": ["flatted@3.3.3", "", {}, "sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg=="], + + "for-each": ["for-each@0.3.5", "", { "dependencies": { "is-callable": "^1.2.7" } }, "sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg=="], + + "forwarded": ["forwarded@0.2.0", "", {}, "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow=="], + + "fresh": ["fresh@2.0.0", "", {}, "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A=="], + + "function-bind": ["function-bind@1.1.2", "", {}, "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA=="], + + "function.prototype.name": ["function.prototype.name@1.1.8", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "functions-have-names": "^1.2.3", "hasown": "^2.0.2", "is-callable": "^1.2.7" } }, "sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q=="], + + "functions-have-names": ["functions-have-names@1.2.3", "", {}, "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ=="], + + "gensequence": ["gensequence@7.0.0", "", {}, "sha512-47Frx13aZh01afHJTB3zTtKIlFI6vWY+MYCN9Qpew6i52rfKjnhCF/l1YlC8UmEMvvntZZ6z4PiCcmyuedR2aQ=="], + + "get-intrinsic": ["get-intrinsic@1.3.0", "", { "dependencies": { "call-bind-apply-helpers": "^1.0.2", "es-define-property": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.1.1", "function-bind": "^1.1.2", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-symbols": "^1.1.0", "hasown": "^2.0.2", "math-intrinsics": "^1.1.0" } }, "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ=="], + + "get-proto": ["get-proto@1.0.1", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-object-atoms": "^1.0.0" } }, "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g=="], + + "get-symbol-description": ["get-symbol-description@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.6" } }, "sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg=="], + + "glob-parent": ["glob-parent@6.0.2", "", { "dependencies": { "is-glob": "^4.0.3" } }, "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A=="], + + "global-directory": ["global-directory@4.0.1", "", { "dependencies": { "ini": "4.1.1" } }, "sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q=="], + + "globals": ["globals@16.3.0", "", {}, "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ=="], + + "globalthis": ["globalthis@1.0.4", "", { "dependencies": { "define-properties": "^1.2.1", "gopd": "^1.0.1" } }, "sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ=="], + + "gopd": ["gopd@1.2.0", "", {}, "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg=="], + + "graphemer": ["graphemer@1.4.0", "", {}, "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag=="], + + "has-bigints": ["has-bigints@1.1.0", "", {}, "sha512-R3pbpkcIqv2Pm3dUwgjclDRVmWpTJW2DcMzcIhEXEx1oh/CEMObMm3KLmRJOdvhM7o4uQBnwr8pzRK2sJWIqfg=="], + + "has-flag": ["has-flag@4.0.0", "", {}, "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ=="], + + "has-own-prop": ["has-own-prop@2.0.0", "", {}, "sha512-Pq0h+hvsVm6dDEa8x82GnLSYHOzNDt7f0ddFa3FqcQlgzEiptPqL+XrOJNavjOzSYiYWIrgeVYYgGlLmnxwilQ=="], + + "has-property-descriptors": ["has-property-descriptors@1.0.2", "", { "dependencies": { "es-define-property": "^1.0.0" } }, "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg=="], + + "has-proto": ["has-proto@1.2.0", "", { "dependencies": { "dunder-proto": "^1.0.0" } }, "sha512-KIL7eQPfHQRC8+XluaIw7BHUwwqL19bQn4hzNgdr+1wXoU0KKj6rufu47lhY7KbJR2C6T6+PfyN0Ea7wkSS+qQ=="], + + "has-symbols": ["has-symbols@1.1.0", "", {}, "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ=="], + + "has-tostringtag": ["has-tostringtag@1.0.2", "", { "dependencies": { "has-symbols": "^1.0.3" } }, "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw=="], + + "hasown": ["hasown@2.0.2", "", { "dependencies": { "function-bind": "^1.1.2" } }, "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ=="], + + "http-errors": ["http-errors@2.0.0", "", { "dependencies": { "depd": "2.0.0", "inherits": "2.0.4", "setprototypeof": "1.2.0", "statuses": "2.0.1", "toidentifier": "1.0.1" } }, "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ=="], + + "iconv-lite": ["iconv-lite@0.6.3", "", { "dependencies": { "safer-buffer": ">= 2.1.2 < 3.0.0" } }, "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw=="], + + "ignore": ["ignore@7.0.5", "", {}, "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg=="], + + "import-fresh": ["import-fresh@3.3.1", "", { "dependencies": { "parent-module": "^1.0.0", "resolve-from": "^4.0.0" } }, "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ=="], + + "import-meta-resolve": ["import-meta-resolve@4.1.0", "", {}, "sha512-I6fiaX09Xivtk+THaMfAwnA3MVA5Big1WHF1Dfx9hFuvNIWpXnorlkzhcQf6ehrqQiiZECRt1poOAkPmer3ruw=="], + + "imurmurhash": ["imurmurhash@0.1.4", "", {}, "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA=="], + + "indent-string": ["indent-string@5.0.0", "", {}, "sha512-m6FAo/spmsW2Ab2fU35JTYwtOKa2yAwXSwgjSv1TJzh4Mh7mC3lzAOVLBprb72XsTrgkEIsl7YrFNAiDiRhIGg=="], + + "inherits": ["inherits@2.0.4", "", {}, "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="], + + "ini": ["ini@4.1.1", "", {}, "sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g=="], + + "internal-slot": ["internal-slot@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "hasown": "^2.0.2", "side-channel": "^1.1.0" } }, "sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw=="], + + "ipaddr.js": ["ipaddr.js@1.9.1", "", {}, "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="], + + "is-array-buffer": ["is-array-buffer@3.0.5", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A=="], + + "is-async-function": ["is-async-function@2.1.1", "", { "dependencies": { "async-function": "^1.0.0", "call-bound": "^1.0.3", "get-proto": "^1.0.1", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ=="], + + "is-bigint": ["is-bigint@1.1.0", "", { "dependencies": { "has-bigints": "^1.0.2" } }, "sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ=="], + + "is-boolean-object": ["is-boolean-object@1.2.2", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A=="], + + "is-builtin-module": ["is-builtin-module@5.0.0", "", { "dependencies": { "builtin-modules": "^5.0.0" } }, "sha512-f4RqJKBUe5rQkJ2eJEJBXSticB3hGbN9j0yxxMQFqIW89Jp9WYFtzfTcRlstDKVUTRzSOTLKRfO9vIztenwtxA=="], + + "is-callable": ["is-callable@1.2.7", "", {}, "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA=="], + + "is-core-module": ["is-core-module@2.16.1", "", { "dependencies": { "hasown": "^2.0.2" } }, "sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w=="], + + "is-data-view": ["is-data-view@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "is-typed-array": "^1.1.13" } }, "sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw=="], + + "is-date-object": ["is-date-object@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "has-tostringtag": "^1.0.2" } }, "sha512-PwwhEakHVKTdRNVOw+/Gyh0+MzlCl4R6qKvkhuvLtPMggI1WAHt9sOwZxQLSGpUaDnrdyDsomoRgNnCfKNSXXg=="], + + "is-extglob": ["is-extglob@2.1.1", "", {}, "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ=="], + + "is-finalizationregistry": ["is-finalizationregistry@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg=="], + + "is-generator-function": ["is-generator-function@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "get-proto": "^1.0.0", "has-tostringtag": "^1.0.2", "safe-regex-test": "^1.1.0" } }, "sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ=="], + + "is-glob": ["is-glob@4.0.3", "", { "dependencies": { "is-extglob": "^2.1.1" } }, "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg=="], + + "is-map": ["is-map@2.0.3", "", {}, "sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw=="], + + "is-negative-zero": ["is-negative-zero@2.0.3", "", {}, "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw=="], + + "is-number": ["is-number@7.0.0", "", {}, "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng=="], + + "is-number-object": ["is-number-object@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-lZhclumE1G6VYD8VHe35wFaIif+CTy5SJIi5+3y4psDgWu4wPDoBhF8NxUOinEc7pHgiTsT6MaBb92rKhhD+Xw=="], + + "is-promise": ["is-promise@4.0.0", "", {}, "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ=="], + + "is-regex": ["is-regex@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2", "hasown": "^2.0.2" } }, "sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g=="], + + "is-set": ["is-set@2.0.3", "", {}, "sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg=="], + + "is-shared-array-buffer": ["is-shared-array-buffer@1.0.4", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A=="], + + "is-string": ["is-string@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3", "has-tostringtag": "^1.0.2" } }, "sha512-BtEeSsoaQjlSPBemMQIrY1MY0uM6vnS1g5fmufYOtnxLGUZM2178PKbhsk7Ffv58IX+ZtcvoGwccYsh0PglkAA=="], + + "is-symbol": ["is-symbol@1.1.1", "", { "dependencies": { "call-bound": "^1.0.2", "has-symbols": "^1.1.0", "safe-regex-test": "^1.1.0" } }, "sha512-9gGx6GTtCQM73BgmHQXfDmLtfjjTUDSyoxTCbp5WtoixAhfgsDirWIcVQ/IHpvI5Vgd5i/J5F7B9cN/WlVbC/w=="], + + "is-typed-array": ["is-typed-array@1.1.15", "", { "dependencies": { "which-typed-array": "^1.1.16" } }, "sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ=="], + + "is-weakmap": ["is-weakmap@2.0.2", "", {}, "sha512-K5pXYOm9wqY1RgjpL3YTkF39tni1XajUIkawTLUo9EZEVUFga5gSQJF8nNS7ZwJQ02y+1YCNYcMh+HIf1ZqE+w=="], + + "is-weakref": ["is-weakref@1.1.1", "", { "dependencies": { "call-bound": "^1.0.3" } }, "sha512-6i9mGWSlqzNMEqpCp93KwRS1uUOodk2OJ6b+sq7ZPDSy2WuI5NFIxp/254TytR8ftefexkWn5xNiHUNpPOfSew=="], + + "is-weakset": ["is-weakset@2.0.4", "", { "dependencies": { "call-bound": "^1.0.3", "get-intrinsic": "^1.2.6" } }, "sha512-mfcwb6IzQyOKTs84CQMrOwW4gQcaTOAWJ0zzJCl2WSPDrWk/OzDaImWFH3djXhb24g4eudZfLRozAvPGw4d9hQ=="], + + "isarray": ["isarray@2.0.5", "", {}, "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw=="], + + "isexe": ["isexe@2.0.0", "", {}, "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw=="], + + "js-yaml": ["js-yaml@4.1.0", "", { "dependencies": { "argparse": "^2.0.1" }, "bin": { "js-yaml": "bin/js-yaml.js" } }, "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA=="], + + "jsesc": ["jsesc@3.1.0", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA=="], + + "json-buffer": ["json-buffer@3.0.1", "", {}, "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ=="], + + "json-schema-traverse": ["json-schema-traverse@0.4.1", "", {}, "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="], + + "json-stable-stringify-without-jsonify": ["json-stable-stringify-without-jsonify@1.0.1", "", {}, "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw=="], + + "json5": ["json5@1.0.2", "", { "dependencies": { "minimist": "^1.2.0" }, "bin": { "json5": "lib/cli.js" } }, "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA=="], + + "keyv": ["keyv@4.5.4", "", { "dependencies": { "json-buffer": "3.0.1" } }, "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw=="], + + "levn": ["levn@0.4.1", "", { "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" } }, "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ=="], + + "locate-path": ["locate-path@6.0.0", "", { "dependencies": { "p-locate": "^5.0.0" } }, "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw=="], + + "lodash.merge": ["lodash.merge@4.6.2", "", {}, "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ=="], + + "math-intrinsics": ["math-intrinsics@1.1.0", "", {}, "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g=="], + + "media-typer": ["media-typer@1.1.0", "", {}, "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw=="], + + "merge-descriptors": ["merge-descriptors@2.0.0", "", {}, "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g=="], + + "merge2": ["merge2@1.4.1", "", {}, "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg=="], + + "micromatch": ["micromatch@4.0.8", "", { "dependencies": { "braces": "^3.0.3", "picomatch": "^2.3.1" } }, "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA=="], + + "mime-db": ["mime-db@1.54.0", "", {}, "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ=="], + + "mime-types": ["mime-types@3.0.1", "", { "dependencies": { "mime-db": "^1.54.0" } }, "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA=="], + + "min-indent": ["min-indent@1.0.1", "", {}, "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg=="], + + "minimatch": ["minimatch@3.1.2", "", { "dependencies": { "brace-expansion": "^1.1.7" } }, "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw=="], + + "minimist": ["minimist@1.2.8", "", {}, "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA=="], + + "ms": ["ms@2.1.3", "", {}, "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA=="], + + "natural-compare": ["natural-compare@1.4.0", "", {}, "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw=="], + + "negotiator": ["negotiator@1.0.0", "", {}, "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg=="], + + "node-releases": ["node-releases@2.0.19", "", {}, "sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw=="], + + "object-assign": ["object-assign@4.1.1", "", {}, "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg=="], + + "object-inspect": ["object-inspect@1.13.4", "", {}, "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew=="], + + "object-keys": ["object-keys@1.1.1", "", {}, "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA=="], + + "object.assign": ["object.assign@4.1.7", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0", "has-symbols": "^1.1.0", "object-keys": "^1.1.1" } }, "sha512-nK28WOo+QIjBkDduTINE4JkF/UJJKyf2EJxvJKfblDpyg0Q+pkOHNTL0Qwy6NP6FhE/EnzV73BxxqcJaXY9anw=="], + + "object.fromentries": ["object.fromentries@2.0.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2", "es-object-atoms": "^1.0.0" } }, "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ=="], + + "object.groupby": ["object.groupby@1.0.3", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-abstract": "^1.23.2" } }, "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ=="], + + "object.values": ["object.values@1.2.1", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.3", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-gXah6aZrcUxjWg2zR2MwouP2eHlCBzdV4pygudehaKXSGW4v2AsRQUK+lwwXhii6KFZcunEnmSUoYp5CXibxtA=="], + + "on-exit-leak-free": ["on-exit-leak-free@2.1.2", "", {}, "sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA=="], + + "on-finished": ["on-finished@2.4.1", "", { "dependencies": { "ee-first": "1.1.1" } }, "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg=="], + + "once": ["once@1.4.0", "", { "dependencies": { "wrappy": "1" } }, "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w=="], + + "optionator": ["optionator@0.9.4", "", { "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", "type-check": "^0.4.0", "word-wrap": "^1.2.5" } }, "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g=="], + + "own-keys": ["own-keys@1.0.1", "", { "dependencies": { "get-intrinsic": "^1.2.6", "object-keys": "^1.1.1", "safe-push-apply": "^1.0.0" } }, "sha512-qFOyK5PjiWZd+QQIh+1jhdb9LpxTF0qs7Pm8o5QHYZ0M3vKqSqzsZaEB6oWlxZ+q2sJBMI/Ktgd2N5ZwQoRHfg=="], + + "p-limit": ["p-limit@3.1.0", "", { "dependencies": { "yocto-queue": "^0.1.0" } }, "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ=="], + + "p-locate": ["p-locate@5.0.0", "", { "dependencies": { "p-limit": "^3.0.2" } }, "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw=="], + + "parent-module": ["parent-module@2.0.0", "", { "dependencies": { "callsites": "^3.1.0" } }, "sha512-uo0Z9JJeWzv8BG+tRcapBKNJ0dro9cLyczGzulS6EfeyAdeC9sbojtW6XwvYxJkEne9En+J2XEl4zyglVeIwFg=="], + + "parseurl": ["parseurl@1.3.3", "", {}, "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="], + + "path-exists": ["path-exists@4.0.0", "", {}, "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w=="], + + "path-key": ["path-key@3.1.1", "", {}, "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q=="], + + "path-parse": ["path-parse@1.0.7", "", {}, "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="], + + "path-to-regexp": ["path-to-regexp@8.2.0", "", {}, "sha512-TdrF7fW9Rphjq4RjrW0Kp2AW0Ahwu9sRGTkS6bvDi0SCwZlEZYmcfDbEsTz8RVk0EHIS/Vd1bv3JhG+1xZuAyQ=="], + + "picocolors": ["picocolors@1.1.1", "", {}, "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="], + + "picomatch": ["picomatch@4.0.2", "", {}, "sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg=="], + + "pino": ["pino@9.7.0", "", { "dependencies": { "atomic-sleep": "^1.0.0", "fast-redact": "^3.1.1", "on-exit-leak-free": "^2.1.0", "pino-abstract-transport": "^2.0.0", "pino-std-serializers": "^7.0.0", "process-warning": "^5.0.0", "quick-format-unescaped": "^4.0.3", "real-require": "^0.2.0", "safe-stable-stringify": "^2.3.1", "sonic-boom": "^4.0.1", "thread-stream": "^3.0.0" }, "bin": { "pino": "bin.js" } }, "sha512-vnMCM6xZTb1WDmLvtG2lE/2p+t9hDEIvTWJsu6FejkE62vB7gDhvzrpFR4Cw2to+9JNQxVnkAKVPA1KPB98vWg=="], + + "pino-abstract-transport": ["pino-abstract-transport@2.0.0", "", { "dependencies": { "split2": "^4.0.0" } }, "sha512-F63x5tizV6WCh4R6RHyi2Ml+M70DNRXt/+HANowMflpgGFMAym/VKm6G7ZOQRjqN7XbGxK1Lg9t6ZrtzOaivMw=="], + + "pino-std-serializers": ["pino-std-serializers@7.0.0", "", {}, "sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA=="], + + "pkce-challenge": ["pkce-challenge@5.0.0", "", {}, "sha512-ueGLflrrnvwB3xuo/uGob5pd5FN7l0MsLf0Z87o/UQmRtwjvfylfc9MurIxRAWywCYTgrvpXBcqjV4OfCYGCIQ=="], + + "pluralize": ["pluralize@8.0.0", "", {}, "sha512-Nc3IT5yHzflTfbjgqWcCPpo7DaKy4FnpB0l/zCAW0Tc7jxAiuqSxHasntB3D7887LSrA93kDJ9IXovxJYxyLCA=="], + + "possible-typed-array-names": ["possible-typed-array-names@1.1.0", "", {}, "sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg=="], + + "prelude-ls": ["prelude-ls@1.2.1", "", {}, "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g=="], + + "prettier": ["prettier@3.6.2", "", { "bin": { "prettier": "bin/prettier.cjs" } }, "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ=="], + + "prettier-linter-helpers": ["prettier-linter-helpers@1.0.0", "", { "dependencies": { "fast-diff": "^1.1.2" } }, "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w=="], + + "process-warning": ["process-warning@5.0.0", "", {}, "sha512-a39t9ApHNx2L4+HBnQKqxxHNs1r7KF+Intd8Q/g1bUh6q0WIp9voPXJ/x0j+ZL45KF1pJd9+q2jLIRMfvEshkA=="], + + "proxy-addr": ["proxy-addr@2.0.7", "", { "dependencies": { "forwarded": "0.2.0", "ipaddr.js": "1.9.1" } }, "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg=="], + + "punycode": ["punycode@2.3.1", "", {}, "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg=="], + + "qs": ["qs@6.14.0", "", { "dependencies": { "side-channel": "^1.1.0" } }, "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w=="], + + "queue-microtask": ["queue-microtask@1.2.3", "", {}, "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A=="], + + "quick-format-unescaped": ["quick-format-unescaped@4.0.4", "", {}, "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="], + + "range-parser": ["range-parser@1.2.1", "", {}, "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="], + + "raw-body": ["raw-body@3.0.0", "", { "dependencies": { "bytes": "3.1.2", "http-errors": "2.0.0", "iconv-lite": "0.6.3", "unpipe": "1.0.0" } }, "sha512-RmkhL8CAyCRPXCE28MMH0z2PNWQBNk2Q09ZdxM9IOOXwxwZbN+qbWaatPkdkWIKL2ZVDImrN/pK5HTRz2PcS4g=="], + + "real-require": ["real-require@0.2.0", "", {}, "sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg=="], + + "reflect.getprototypeof": ["reflect.getprototypeof@1.0.10", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-abstract": "^1.23.9", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0", "get-intrinsic": "^1.2.7", "get-proto": "^1.0.1", "which-builtin-type": "^1.2.1" } }, "sha512-00o4I+DVrefhv+nX0ulyi3biSHCPDe+yLv5o/p6d/UVlirijB8E16FtfwSAi4g3tcqrQ4lRAqQSoFEZJehYEcw=="], + + "regexp-tree": ["regexp-tree@0.1.27", "", { "bin": { "regexp-tree": "bin/regexp-tree" } }, "sha512-iETxpjK6YoRWJG5o6hXLwvjYAoW+FEZn9os0PD/b6AP6xQwsa/Y7lCVgIixBbUPMfhu+i2LtdeAqVTgGlQarfA=="], + + "regexp.prototype.flags": ["regexp.prototype.flags@1.5.4", "", { "dependencies": { "call-bind": "^1.0.8", "define-properties": "^1.2.1", "es-errors": "^1.3.0", "get-proto": "^1.0.1", "gopd": "^1.2.0", "set-function-name": "^2.0.2" } }, "sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA=="], + + "regjsparser": ["regjsparser@0.12.0", "", { "dependencies": { "jsesc": "~3.0.2" }, "bin": { "regjsparser": "bin/parser" } }, "sha512-cnE+y8bz4NhMjISKbgeVJtqNbtf5QpjZP+Bslo+UqkIt9QPnX9q095eiRRASJG1/tz6dlNr6Z5NsBiWYokp6EQ=="], + + "repeat-string": ["repeat-string@1.6.1", "", {}, "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w=="], + + "resolve": ["resolve@1.22.10", "", { "dependencies": { "is-core-module": "^2.16.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, "bin": { "resolve": "bin/resolve" } }, "sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w=="], + + "resolve-from": ["resolve-from@5.0.0", "", {}, "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw=="], + + "reusify": ["reusify@1.1.0", "", {}, "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw=="], + + "router": ["router@2.2.0", "", { "dependencies": { "debug": "^4.4.0", "depd": "^2.0.0", "is-promise": "^4.0.0", "parseurl": "^1.3.3", "path-to-regexp": "^8.0.0" } }, "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ=="], + + "run-parallel": ["run-parallel@1.2.0", "", { "dependencies": { "queue-microtask": "^1.2.2" } }, "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA=="], + + "safe-array-concat": ["safe-array-concat@1.1.3", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "get-intrinsic": "^1.2.6", "has-symbols": "^1.1.0", "isarray": "^2.0.5" } }, "sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q=="], + + "safe-buffer": ["safe-buffer@5.2.1", "", {}, "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="], + + "safe-push-apply": ["safe-push-apply@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "isarray": "^2.0.5" } }, "sha512-iKE9w/Z7xCzUMIZqdBsp6pEQvwuEebH4vdpjcDWnyzaI6yl6O9FHvVpmGelvEHNsoY6wGblkxR6Zty/h00WiSA=="], + + "safe-regex": ["safe-regex@2.1.1", "", { "dependencies": { "regexp-tree": "~0.1.1" } }, "sha512-rx+x8AMzKb5Q5lQ95Zoi6ZbJqwCLkqi3XuJXp5P3rT8OEc6sZCJG5AE5dU3lsgRr/F4Bs31jSlVN+j5KrsGu9A=="], + + "safe-regex-test": ["safe-regex-test@1.1.0", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "is-regex": "^1.2.1" } }, "sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw=="], + + "safe-stable-stringify": ["safe-stable-stringify@2.5.0", "", {}, "sha512-b3rppTKm9T+PsVCBEOUR46GWI7fdOs00VKZ1+9c1EWDaDMvjQc6tUwuFyIprgGgTcWoVHSKrU8H31ZHA2e0RHA=="], + + "safer-buffer": ["safer-buffer@2.1.2", "", {}, "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="], + + "semver": ["semver@7.7.2", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA=="], + + "send": ["send@1.2.0", "", { "dependencies": { "debug": "^4.3.5", "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "etag": "^1.8.1", "fresh": "^2.0.0", "http-errors": "^2.0.0", "mime-types": "^3.0.1", "ms": "^2.1.3", "on-finished": "^2.4.1", "range-parser": "^1.2.1", "statuses": "^2.0.1" } }, "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw=="], + + "serve-static": ["serve-static@2.2.0", "", { "dependencies": { "encodeurl": "^2.0.0", "escape-html": "^1.0.3", "parseurl": "^1.3.3", "send": "^1.2.0" } }, "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ=="], + + "set-function-length": ["set-function-length@1.2.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "function-bind": "^1.1.2", "get-intrinsic": "^1.2.4", "gopd": "^1.0.1", "has-property-descriptors": "^1.0.2" } }, "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg=="], + + "set-function-name": ["set-function-name@2.0.2", "", { "dependencies": { "define-data-property": "^1.1.4", "es-errors": "^1.3.0", "functions-have-names": "^1.2.3", "has-property-descriptors": "^1.0.2" } }, "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ=="], + + "set-proto": ["set-proto@1.0.0", "", { "dependencies": { "dunder-proto": "^1.0.1", "es-errors": "^1.3.0", "es-object-atoms": "^1.0.0" } }, "sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw=="], + + "setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="], + + "shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="], + + "shebang-regex": ["shebang-regex@3.0.0", "", {}, "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A=="], + + "side-channel": ["side-channel@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3", "side-channel-list": "^1.0.0", "side-channel-map": "^1.0.1", "side-channel-weakmap": "^1.0.2" } }, "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw=="], + + "side-channel-list": ["side-channel-list@1.0.0", "", { "dependencies": { "es-errors": "^1.3.0", "object-inspect": "^1.13.3" } }, "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA=="], + + "side-channel-map": ["side-channel-map@1.0.1", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3" } }, "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA=="], + + "side-channel-weakmap": ["side-channel-weakmap@1.0.2", "", { "dependencies": { "call-bound": "^1.0.2", "es-errors": "^1.3.0", "get-intrinsic": "^1.2.5", "object-inspect": "^1.13.3", "side-channel-map": "^1.0.1" } }, "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A=="], + + "smol-toml": ["smol-toml@1.4.1", "", {}, "sha512-CxdwHXyYTONGHThDbq5XdwbFsuY4wlClRGejfE2NtwUtiHYsP1QtNsHb/hnj31jKYSchztJsaA8pSQoVzkfCFg=="], + + "sonic-boom": ["sonic-boom@4.2.0", "", { "dependencies": { "atomic-sleep": "^1.0.0" } }, "sha512-INb7TM37/mAcsGmc9hyyI6+QR3rR1zVRu36B0NeGXKnOOLiZOfER5SA+N7X7k3yUYRzLWafduTDvJAfDswwEww=="], + + "split2": ["split2@4.2.0", "", {}, "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg=="], + + "statuses": ["statuses@2.0.2", "", {}, "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw=="], + + "stop-iteration-iterator": ["stop-iteration-iterator@1.1.0", "", { "dependencies": { "es-errors": "^1.3.0", "internal-slot": "^1.1.0" } }, "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ=="], + + "string.prototype.trim": ["string.prototype.trim@1.2.10", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-data-property": "^1.1.4", "define-properties": "^1.2.1", "es-abstract": "^1.23.5", "es-object-atoms": "^1.0.0", "has-property-descriptors": "^1.0.2" } }, "sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA=="], + + "string.prototype.trimend": ["string.prototype.trimend@1.0.9", "", { "dependencies": { "call-bind": "^1.0.8", "call-bound": "^1.0.2", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-G7Ok5C6E/j4SGfyLCloXTrngQIQU3PWtXGst3yM7Bea9FRURf1S42ZHlZZtsNque2FN2PoUhfZXYLNWwEr4dLQ=="], + + "string.prototype.trimstart": ["string.prototype.trimstart@1.0.8", "", { "dependencies": { "call-bind": "^1.0.7", "define-properties": "^1.2.1", "es-object-atoms": "^1.0.0" } }, "sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg=="], + + "strip-bom": ["strip-bom@3.0.0", "", {}, "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA=="], + + "strip-indent": ["strip-indent@4.0.0", "", { "dependencies": { "min-indent": "^1.0.1" } }, "sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA=="], + + "strip-json-comments": ["strip-json-comments@3.1.1", "", {}, "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig=="], + + "supports-color": ["supports-color@7.2.0", "", { "dependencies": { "has-flag": "^4.0.0" } }, "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw=="], + + "supports-preserve-symlinks-flag": ["supports-preserve-symlinks-flag@1.0.0", "", {}, "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w=="], + + "synckit": ["synckit@0.11.8", "", { "dependencies": { "@pkgr/core": "^0.2.4" } }, "sha512-+XZ+r1XGIJGeQk3VvXhT6xx/VpbHsRzsTkGgF6E5RX9TTXD0118l87puaEBZ566FhqblC6U0d4XnubznJDm30A=="], + + "thread-stream": ["thread-stream@3.1.0", "", { "dependencies": { "real-require": "^0.2.0" } }, "sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A=="], + + "tinyglobby": ["tinyglobby@0.2.14", "", { "dependencies": { "fdir": "^6.4.4", "picomatch": "^4.0.2" } }, "sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ=="], + + "to-regex-range": ["to-regex-range@5.0.1", "", { "dependencies": { "is-number": "^7.0.0" } }, "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ=="], + + "toidentifier": ["toidentifier@1.0.1", "", {}, "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="], + + "ts-api-utils": ["ts-api-utils@2.1.0", "", { "peerDependencies": { "typescript": ">=4.8.4" } }, "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ=="], + + "tsconfig-paths": ["tsconfig-paths@3.15.0", "", { "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.2", "minimist": "^1.2.6", "strip-bom": "^3.0.0" } }, "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg=="], + + "type-check": ["type-check@0.4.0", "", { "dependencies": { "prelude-ls": "^1.2.1" } }, "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew=="], + + "type-is": ["type-is@2.0.1", "", { "dependencies": { "content-type": "^1.0.5", "media-typer": "^1.1.0", "mime-types": "^3.0.0" } }, "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw=="], + + "typed-array-buffer": ["typed-array-buffer@1.0.3", "", { "dependencies": { "call-bound": "^1.0.3", "es-errors": "^1.3.0", "is-typed-array": "^1.1.14" } }, "sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw=="], + + "typed-array-byte-length": ["typed-array-byte-length@1.0.3", "", { "dependencies": { "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.14" } }, "sha512-BaXgOuIxz8n8pIq3e7Atg/7s+DpiYrxn4vdot3w9KbnBhcRQq6o3xemQdIfynqSeXeDrF32x+WvfzmOjPiY9lg=="], + + "typed-array-byte-offset": ["typed-array-byte-offset@1.0.4", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "for-each": "^0.3.3", "gopd": "^1.2.0", "has-proto": "^1.2.0", "is-typed-array": "^1.1.15", "reflect.getprototypeof": "^1.0.9" } }, "sha512-bTlAFB/FBYMcuX81gbL4OcpH5PmlFHqlCCpAl8AlEzMz5k53oNDvN8p1PNOWLEmI2x4orp3raOFB51tv9X+MFQ=="], + + "typed-array-length": ["typed-array-length@1.0.7", "", { "dependencies": { "call-bind": "^1.0.7", "for-each": "^0.3.3", "gopd": "^1.0.1", "is-typed-array": "^1.1.13", "possible-typed-array-names": "^1.0.0", "reflect.getprototypeof": "^1.0.6" } }, "sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg=="], + + "typescript": ["typescript@5.8.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="], + + "typescript-eslint": ["typescript-eslint@8.37.0", "", { "dependencies": { "@typescript-eslint/eslint-plugin": "8.37.0", "@typescript-eslint/parser": "8.37.0", "@typescript-eslint/typescript-estree": "8.37.0", "@typescript-eslint/utils": "8.37.0" }, "peerDependencies": { "eslint": "^8.57.0 || ^9.0.0", "typescript": ">=4.8.4 <5.9.0" } }, "sha512-TnbEjzkE9EmcO0Q2zM+GE8NQLItNAJpMmED1BdgoBMYNdqMhzlbqfdSwiRlAzEK2pA9UzVW0gzaaIzXWg2BjfA=="], + + "unbox-primitive": ["unbox-primitive@1.1.0", "", { "dependencies": { "call-bound": "^1.0.3", "has-bigints": "^1.0.2", "has-symbols": "^1.1.0", "which-boxed-primitive": "^1.1.1" } }, "sha512-nWJ91DjeOkej/TA8pXQ3myruKpKEYgqvpw9lz4OPHj/NWFNluYrjbz9j01CJ8yKQd2g4jFoOkINCTW2I5LEEyw=="], + + "undici-types": ["undici-types@7.8.0", "", {}, "sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw=="], + + "unpipe": ["unpipe@1.0.0", "", {}, "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ=="], + + "update-browserslist-db": ["update-browserslist-db@1.1.3", "", { "dependencies": { "escalade": "^3.2.0", "picocolors": "^1.1.1" }, "peerDependencies": { "browserslist": ">= 4.21.0" }, "bin": { "update-browserslist-db": "cli.js" } }, "sha512-UxhIZQ+QInVdunkDAaiazvvT/+fXL5Osr0JZlJulepYu6Jd7qJtDZjlur0emRlT71EN3ScPoE7gvsuIKKNavKw=="], + + "uri-js": ["uri-js@4.4.1", "", { "dependencies": { "punycode": "^2.1.0" } }, "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg=="], + + "vary": ["vary@1.1.2", "", {}, "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg=="], + + "vscode-languageserver-textdocument": ["vscode-languageserver-textdocument@1.0.12", "", {}, "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA=="], + + "vscode-uri": ["vscode-uri@3.1.0", "", {}, "sha512-/BpdSx+yCQGnCvecbyXdxHDkuk55/G3xwnC0GqY4gmQ3j+A+g8kzzgB4Nk/SINjqn6+waqw3EgbVF2QKExkRxQ=="], + + "which": ["which@2.0.2", "", { "dependencies": { "isexe": "^2.0.0" }, "bin": { "node-which": "./bin/node-which" } }, "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA=="], + + "which-boxed-primitive": ["which-boxed-primitive@1.1.1", "", { "dependencies": { "is-bigint": "^1.1.0", "is-boolean-object": "^1.2.1", "is-number-object": "^1.1.1", "is-string": "^1.1.1", "is-symbol": "^1.1.1" } }, "sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA=="], + + "which-builtin-type": ["which-builtin-type@1.2.1", "", { "dependencies": { "call-bound": "^1.0.2", "function.prototype.name": "^1.1.6", "has-tostringtag": "^1.0.2", "is-async-function": "^2.0.0", "is-date-object": "^1.1.0", "is-finalizationregistry": "^1.1.0", "is-generator-function": "^1.0.10", "is-regex": "^1.2.1", "is-weakref": "^1.0.2", "isarray": "^2.0.5", "which-boxed-primitive": "^1.1.0", "which-collection": "^1.0.2", "which-typed-array": "^1.1.16" } }, "sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q=="], + + "which-collection": ["which-collection@1.0.2", "", { "dependencies": { "is-map": "^2.0.3", "is-set": "^2.0.3", "is-weakmap": "^2.0.2", "is-weakset": "^2.0.3" } }, "sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw=="], + + "which-typed-array": ["which-typed-array@1.1.19", "", { "dependencies": { "available-typed-arrays": "^1.0.7", "call-bind": "^1.0.8", "call-bound": "^1.0.4", "for-each": "^0.3.5", "get-proto": "^1.0.1", "gopd": "^1.2.0", "has-tostringtag": "^1.0.2" } }, "sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw=="], + + "word-wrap": ["word-wrap@1.2.5", "", {}, "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA=="], + + "wrappy": ["wrappy@1.0.2", "", {}, "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ=="], + + "xdg-basedir": ["xdg-basedir@5.1.0", "", {}, "sha512-GCPAHLvrIH13+c0SuacwvRYj2SxJXQ4kaVTT5xgL3kPrz56XxkF21IGhjSE1+W0aw7gpBWRGXLCPnPby6lSpmQ=="], + + "yaml": ["yaml@2.8.0", "", { "bin": { "yaml": "bin.mjs" } }, "sha512-4lLa/EcQCB0cJkyts+FpIRx5G/llPxfP6VQU5KByHEhLxY3IJCH0f0Hy1MHI8sClTvsIb8qwRJ6R/ZdlDJ/leQ=="], + + "yocto-queue": ["yocto-queue@0.1.0", "", {}, "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q=="], + + "zod": ["zod@3.25.76", "", {}, "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ=="], + + "zod-to-json-schema": ["zod-to-json-schema@3.24.6", "", { "peerDependencies": { "zod": "^3.24.1" } }, "sha512-h/z3PKvcTcTetyjl1fkj79MHNEjm+HpD6NXheWjzOekY7kV+lwDYnHw+ivHkijnCSMz1yJaWBD9vu/Fcmk+vEg=="], + + "@eslint-community/eslint-utils/eslint-visitor-keys": ["eslint-visitor-keys@3.4.3", "", {}, "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag=="], + + "@eslint/eslintrc/globals": ["globals@14.0.0", "", {}, "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ=="], + + "@eslint/eslintrc/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], + + "@humanfs/node/@humanwhocodes/retry": ["@humanwhocodes/retry@0.3.1", "", {}, "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA=="], + + "@typescript-eslint/typescript-estree/minimatch": ["minimatch@9.0.5", "", { "dependencies": { "brace-expansion": "^2.0.1" } }, "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow=="], + + "clean-regexp/escape-string-regexp": ["escape-string-regexp@1.0.5", "", {}, "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg=="], + + "eslint/chalk": ["chalk@4.1.2", "", { "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" } }, "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA=="], + + "eslint/file-entry-cache": ["file-entry-cache@8.0.0", "", { "dependencies": { "flat-cache": "^4.0.0" } }, "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ=="], + + "eslint/ignore": ["ignore@5.3.2", "", {}, "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g=="], + + "eslint-import-resolver-node/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], + + "eslint-module-utils/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], + + "eslint-plugin-import/debug": ["debug@3.2.7", "", { "dependencies": { "ms": "^2.1.1" } }, "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ=="], + + "eslint-plugin-import/semver": ["semver@6.3.1", "", { "bin": { "semver": "bin/semver.js" } }, "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA=="], + + "eslint-plugin-unicorn/@eslint/plugin-kit": ["@eslint/plugin-kit@0.2.8", "", { "dependencies": { "@eslint/core": "^0.13.0", "levn": "^0.4.1" } }, "sha512-ZAoA40rNMPwSm+AeHpCq8STiNAwzWLJuP8Xv4CHIc9wv/PSuExjMrmjfYNj682vW0OOiZ1HKxzvjQr9XZIisQA=="], + + "fast-glob/glob-parent": ["glob-parent@5.1.2", "", { "dependencies": { "is-glob": "^4.0.1" } }, "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow=="], + + "http-errors/statuses": ["statuses@2.0.1", "", {}, "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ=="], + + "import-fresh/parent-module": ["parent-module@1.0.1", "", { "dependencies": { "callsites": "^3.0.0" } }, "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g=="], + + "import-fresh/resolve-from": ["resolve-from@4.0.0", "", {}, "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g=="], + + "micromatch/picomatch": ["picomatch@2.3.1", "", {}, "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA=="], + + "regjsparser/jsesc": ["jsesc@3.0.2", "", { "bin": { "jsesc": "bin/jsesc" } }, "sha512-xKqzzWXDttJuOcawBt4KnKHHIf5oQ/Cxax+0PWFG+DFDgHNAdi+TXECADI+RYiFUMmx8792xsMbbgXj4CwnP4g=="], + + "@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["brace-expansion@2.0.2", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ=="], + + "eslint-plugin-unicorn/@eslint/plugin-kit/@eslint/core": ["@eslint/core@0.13.0", "", { "dependencies": { "@types/json-schema": "^7.0.15" } }, "sha512-yfkgDw1KR66rkT5A8ci4irzDysN7FRpq3ttJolR88OqQikAWqwA8j5VZyas+vjyBNFIJ7MfybJ9plMILI2UrCw=="], + + "eslint/file-entry-cache/flat-cache": ["flat-cache@4.0.1", "", { "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.4" } }, "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw=="], + } +} diff --git a/cspell.code.json b/cspell.code.json new file mode 100644 index 0000000..83861ac --- /dev/null +++ b/cspell.code.json @@ -0,0 +1,12 @@ +{ + "version": "0.2", + "language": "en-GB", + "dictionaryDefinitions": [ + { + "name": "project-words", + "path": "./project-words.txt" + } + ], + "dictionaries": ["project-words", "typescript"], + "ignorePaths": ["node_modules", "dist", "/project-words.txt"] +} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 0000000..989de07 --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,85 @@ +import pluginJs from "@eslint/js"; +import importPlugin from "eslint-plugin-import"; +import prettier from "eslint-plugin-prettier"; +import securityPlugin from "eslint-plugin-security"; +import unicornPlugin from "eslint-plugin-unicorn"; +import globals from "globals"; +import tsPlugin from "typescript-eslint"; + +/** @type {import('eslint').Linter.Config[]} */ +export default [ + { + ignores: [ + "node_modules/**", + "dist/**", + "build/**", + "coverage/**", + "*.min.js", + "src/gen/**", // Exclude generated API files + ], + }, + securityPlugin.configs.recommended, + { + files: ["src/**/*.ts"], + }, + { + languageOptions: { globals: globals.node }, + }, + { + rules: { + "no-restricted-syntax": ["off", "ForOfStatement"], + "no-console": ["error"], + "no-duplicate-imports": "error", + "prefer-template": "error", + quotes: ["error", "double", { avoidEscape: true }], + }, + }, + { + plugins: { + prettier, + }, + rules: { + "prettier/prettier": [ + 1, + { + endOfLine: "lf", + printWidth: 180, + semi: true, + singleQuote: false, + tabWidth: 2, + trailingComma: "es5", + }, + ], + }, + }, + { + plugins: { + unicorn: unicornPlugin, + }, + rules: { + "unicorn/empty-brace-spaces": "off", + "unicorn/no-null": "off", + }, + }, + { + plugins: { + import: importPlugin, + }, + rules: { + "import/order": [ + "error", + { + groups: ["builtin", "external", "internal", "parent", "sibling", "index", "object", "type"], + "newlines-between": "always", + alphabetize: { + order: "asc", + caseInsensitive: true, + }, + }, + ], + "import/no-duplicates": "error", + }, + }, + pluginJs.configs.recommended, + ...tsPlugin.configs.recommended, +]; diff --git a/openapitools.json b/openapitools.json new file mode 100644 index 0000000..a82623d --- /dev/null +++ b/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..da889fc --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "scripts": { + "start": "bun run src/main.ts", + "check:code": "bun run lint && bun run typecheck", + "check:spell": "cspell --config cspell.code.json **/*.ts", + "lint": "eslint -c eslint.config.js .", + "lint:fix": "eslint -c eslint.config.js --fix .", + "typecheck": "tsc --noEmit", + "build": "tsc" + }, + "dependencies": { + "@modelcontextprotocol/sdk": "^1.15.1", + "cors": "^2.8.5", + "env-var": "^7.5.0", + "express": "^5.1.0", + "pino": "^9.7.0" + }, + "devDependencies": { + "@types/bun": "latest", + "@types/cors": "^2.8.19", + "@types/express": "^5.0.3", + "@typescript-eslint/eslint-plugin": "^8.37.0", + "@typescript-eslint/parser": "^8.37.0", + "cspell": "^9.1.5", + "eslint": "^9.31.0", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-prettier": "^5.5.1", + "eslint-plugin-security": "^3.0.1", + "eslint-plugin-unicorn": "^59.0.1", + "typescript-eslint": "^8.37.0" + }, + "peerDependencies": { + "typescript": "^5" + }, + "name": "outline-mcp", + "module": "index.ts", + "type": "module", + "private": true +} diff --git a/project-words.txt b/project-words.txt new file mode 100644 index 0000000..62d92c3 --- /dev/null +++ b/project-words.txt @@ -0,0 +1,2 @@ +modelcontextprotocol +onsessioninitialized diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..6b5f7fd --- /dev/null +++ b/renovate.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "packageRules": [ + { + "matchPackageNames": ["Bun", "oven/bun"], + "groupName": "bun version" + } + ] +} diff --git a/run-outline.sh b/run-outline.sh new file mode 100755 index 0000000..3a94296 --- /dev/null +++ b/run-outline.sh @@ -0,0 +1,5 @@ +#!/bin/bash +cd /home/tbehrendt/dev/outline-mcp +export OUTLINE_API_KEY=$1 +export OUTLINE_BASE_URL=$2 +exec bun run src/main.ts diff --git a/schemas/outline.json b/schemas/outline.json new file mode 100644 index 0000000..16f8b4e --- /dev/null +++ b/schemas/outline.json @@ -0,0 +1,7263 @@ +{ + "openapi": "3.0.0", + "info": { + "title": "Outline API", + "description": "# Introduction\n\nThe Outline API is structured in an RPC style. It enables you to\nprogramatically interact with all aspects of Outline’s data – in fact, the\nmain application is built on exactly the same API.\n\nThe API structure is available as an\n[openapi specification](https://github.com/outline/openapi) if that’s your\njam – it can be used to generate clients for most programming languages.\n\n# Making requests\n\nOutline’s API follows simple RPC style conventions where each API endpoint is\na `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is\nsupported and all response payloads are JSON.\n\nWhen making `POST` requests, request parameters are parsed depending on\nContent-Type header. To make a call using JSON payload, you must pass\nContent-Type: application/json header, here’s an example using CURL:\n\n```\ncurl https://app.getoutline.com/api/documents.info \\\n-X 'POST' \\\n-H 'authorization: Bearer MY_API_KEY' \\\n-H 'content-type: application/json' \\\n-H 'accept: application/json' \\\n-d '{\"id\": \"outline-api-NTpezNwhUP\"}'\n```\n\nOr, with JavaScript:\n\n```javascript\nconst response = await fetch(\"https://app.getoutline.com/api/documents.info\", {\n method: \"POST\",\n headers: {\n Accept: \"application/json\",\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer MY_API_KEY\"\n }\n})\n\nconst body = await response.json();\nconst document = body.data;\n```\n\n# Authentication\n\n## API key\n\nYou can create new API keys under **Settings => API & Apps**. Be\ncareful when handling your keys as they give access to all of your documents,\nyou should treat them like passwords and they should never be committed to\nsource control.\n\nTo authenticate with API, you should supply the API key as the `Authorization` header\n(`Authorization: Bearer YOUR_API_KEY`).\n\n## OAuth 2.0\n\nOAuth 2.0 is a widely used protocol for authorization and authentication. It allows users\nto grant third-party _or_ internal applications access to their resources without sharing\ntheir credentials. To use OAuth 2.0 you need to follow these steps:\n\n1. Register your application under **Settings => Applications**\n2. Obtain an access token by exchanging the client credentials for an access token\n3. Use the access token to authenticate requests to the API\n\nSome API endpoints allow unauthenticated requests for public resources and\nthey can be called without authentication\n\n# Scopes\n\nScopes are used to limit the access of an API key or application to specific resources. For example,\nan application may only need access to read documents, but not write them. Scopes can\nbe global in the case of `read` and `write` scopes, specific to an API endpoint like\n`documents.read` and `documents.create`, or use wildcard scopes like `documents.*`.\n\nSome examples of scopes that can be used are:\n\n- `documents.read`: Allows reading documents\n- `documents.write`: Allows writing documents\n- `documents.*`: Allows all document-related actions\n- `users.*`: Allows all user-related actions\n- `read`: Allows all read actions\n- `write`: Allows all write actions\n\n# Errors\n\nAll successful API requests will be returned with a 200 or 201 status code\nand `ok: true` in the response payload. If there’s an error while making the\nrequest, the appropriate status code is returned with the error message:\n\n```\n{\n \"ok\": false,\n \"error\": \"Not Found\"\n}\n```\n\n# Pagination\n\nMost top-level API resources have support for \"list\" API methods. For instance,\nyou can list users, documents, and collections. These list methods share\ncommon parameters, taking both `limit` and `offset`.\n\nResponses will echo these parameters in the root `pagination` key, and also\ninclude a `nextPath` key which can be used as a handy shortcut to fetch the\nnext page of results. For example:\n\n```\n{\n ok: true,\n status: 200,\n data: […],\n pagination: {\n limit: 25,\n offset: 0,\n nextPath: \"/api/documents.list?limit=25&offset=25\"\n }\n}\n```\n\n# Rate limits\n\nLike most APIs, Outline has rate limits in place to prevent abuse. Endpoints\nthat mutate data are more restrictive than read-only endpoints. If you exceed\nthe rate limit for a given endpoint, you will receive a `429 Too Many Requests`\nstatus code.\n\nThe response will include a `Retry-After` header that indicates how many seconds\nyou should wait before making another request.\n\n# Policies\n\nMost API resources have associated \"policies\", these objects describe the\ncurrent authentications authorized actions related to an individual resource. It\nshould be noted that the policy \"id\" is identical to the resource it is\nrelated to, policies themselves do not have unique identifiers.\n\nFor most usecases of the API, policies can be safely ignored. Calling\nunauthorized methods will result in the appropriate response code – these can\nbe used in an interface to adjust which elements are visible.\n", + "version": "0.1.0", + "contact": { + "email": "hello@getoutline.com" + } + }, + "servers": [ + { + "url": "https://app.getoutline.com/api", + "description": "Production" + } + ], + "security": [ + { + "BearerAuth": [] + }, + { + "OAuth2": [ + "read", + "write" + ] + } + ], + "tags": [ + { + "name": "Attachments", + "description": "`Attachments` represent a file uploaded to cloud storage. They are created\nbefore the upload happens from the client and store all the meta information\nsuch as file type, size, and location.\n" + }, + { + "name": "Auth", + "description": "`Auth` represents the current API Keys authentication details. It can be\nused to check that a token is still valid and load the IDs for the current\nuser and team.\n" + }, + { + "name": "Collections", + "description": "`Collections` represent grouping of documents in the knowledge base, they\noffer a way to structure information in a nested hierarchy and a level\nat which read and write permissions can be granted to individual users or\ngroups of users.\n" + }, + { + "name": "Comments", + "description": "`Comments` represent a comment either on a selection of text in a document\nor on the document itself.\n" + }, + { + "name": "Documents", + "description": "`Documents` are what everything else revolves around. A document represents\na single page of information and always returns the latest version of the\ncontent. Documents are stored in [Markdown](https://spec.commonmark.org/)\nformatting.\n" + }, + { + "name": "Events", + "description": "`Events` represent an artifact of an action. Whether it is creating a user,\nediting a document, changing permissions, or any other action – an event\nis created that can be used as an audit trail or activity stream.\n" + }, + { + "name": "FileOperations", + "description": "`FileOperations` represent background jobs for importing or exporting files.\nYou can query the file operation to find the state of progress and any\nresulting output.\n" + }, + { + "name": "Groups", + "description": "`Groups` represent a list of users that logically belong together, for\nexample there might be groups for each department in your organization.\nGroups can be granted access to collections with read or write permissions.\n" + }, + { + "name": "OAuthClients", + "description": "`OAuthClients` represent OAuth clients that can be used to authenticate\nusers with third-party services.\n" + }, + { + "name": "OAuthAuthentications", + "description": "`OAuthAuthentications` represent individual scoped authentications between\nOutline and an `OAuthClient`.\n" + }, + { + "name": "Revisions", + "description": "`Revisions` represent a snapshop of a document at a point in time. They\nare used to keep tracking of editing and collaboration history – a document\ncan also be restored to a previous revision if neccessary.\n" + }, + { + "name": "Shares", + "description": "`Shares` represent authorization to view a document without being a member\nof the team. Shares are created in order to give access to documents publicly.\nEach user that shares a document will have a unique share object.\n" + }, + { + "name": "Stars", + "description": "`Stars` represent a favorited document or collection in the application sidebar.\nEach user has their own collection of starred items.\n" + }, + { + "name": "Users", + "description": "`Users` represent an individual with access to the knowledge base. Users\ncan be created automatically when signing in with SSO or when a user is\ninvited via email.\n" + }, + { + "name": "Views", + "description": "`Views` represent a compressed record of an individual users views of a\ndocument. Individual views are not recorded but a first, last and total\nis kept per user.\n" + } + ], + "paths": { + "/attachments.create": { + "post": { + "tags": [ + "Attachments" + ], + "summary": "Create an attachment", + "description": "Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "image.png" + }, + "documentId": { + "type": "string", + "description": "Identifier for the associated document, if any.", + "format": "uuid" + }, + "contentType": { + "type": "string", + "example": "image/png" + }, + "size": { + "type": "number", + "description": "Size of the file attachment in bytes." + } + }, + "required": [ + "name", + "contentType", + "size" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "maxUploadSize": { + "type": "number" + }, + "uploadUrl": { + "type": "string", + "format": "uri" + }, + "form": { + "type": "object" + }, + "attachment": { + "$ref": "#/components/schemas/Attachment" + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "attachmentsCreate" + } + }, + "/attachments.redirect": { + "post": { + "tags": [ + "Attachments" + ], + "summary": "Retrieve an attachment", + "description": "Load an attachment from where it is stored based on the id. If the attachment is private then a temporary, signed url with embedded credentials is generated on demand.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the attachment.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "302": { + "description": "The url for the attachment" + } + }, + "operationId": "attachmentsRedirect" + } + }, + "/attachments.delete": { + "post": { + "tags": [ + "Attachments" + ], + "summary": "Delete an attachment", + "description": "Deleting an attachment is permanant. It will not delete references or links to the attachment that may exist in your documents.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for the attachment." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "attachmentsDelete" + } + }, + "/auth.info": { + "post": { + "tags": [ + "Auth" + ], + "summary": "Retrieve auth", + "description": "Retrieve authentication details for the current API key", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Auth" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "authInfo" + } + }, + "/auth.config": { + "post": { + "tags": [ + "Auth" + ], + "summary": "Retrieve auth config", + "description": "Retrieve authentication options", + "security": [], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Acme Inc" + }, + "hostname": { + "type": "string", + "example": "acme-inc.getoutline.com" + }, + "services": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "slack" + }, + "name": { + "type": "string", + "example": "Slack" + }, + "authUrl": { + "type": "string", + "example": "https://acme-inc.getoutline.com/auth/slack" + } + } + } + } + } + } + } + } + } + } + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "authConfig" + } + }, + "/collections.info": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Retrieve a collection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the collection.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Collection" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsInfo" + } + }, + "/collections.documents": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Retrieve a collections document structure", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the collection.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NavigationNode" + }, + "example": [] + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsDocuments" + } + }, + "/collections.list": { + "post": { + "tags": [ + "Collections" + ], + "summary": "List all collections", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "query": { + "type": "string", + "description": "If set, will filter the results by collection name." + }, + "statusFilter": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionStatus" + }, + "description": "An optional array of statuses to filter by." + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Collection" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsList" + } + }, + "/collections.create": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Create a collection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Human Resources" + }, + "description": { + "type": "string", + "description": "A brief description of the collection, markdown supported.", + "example": "HR documentation is confidential and should be handled with care." + }, + "permission": { + "$ref": "#/components/schemas/Permission" + }, + "icon": { + "type": "string", + "description": "A string that represents an icon in the outline-icons package or an emoji" + }, + "color": { + "type": "string", + "description": "A hex color code for the collection icon", + "example": "#123123" + }, + "sharing": { + "type": "boolean", + "description": "Whether public sharing of documents is allowed", + "example": false + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Collection" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsCreate" + } + }, + "/collections.update": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Update a collection", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "example": "Human Resources" + }, + "description": { + "type": "string", + "description": "A brief description of the collection, markdown supported.", + "example": "HR documentation is confidential and should be handled with care." + }, + "permission": { + "$ref": "#/components/schemas/Permission" + }, + "icon": { + "type": "string", + "description": "A string that represents an icon in the outline-icons package or an emoji" + }, + "color": { + "type": "string", + "description": "A hex color code for the collection icon", + "example": "#123123" + }, + "sharing": { + "type": "boolean", + "description": "Whether public sharing of documents is allowed", + "example": false + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Collection" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsUpdate" + } + }, + "/collections.add_user": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Add a collection user", + "description": "This method allows you to add a user membership to the specified collection.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "memberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Membership" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsAddUser" + } + }, + "/collections.remove_user": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Remove a collection user", + "description": "This method allows you to remove a user from the specified collection.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Identifier for the collection", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsRemoveUser" + } + }, + "/collections.memberships": { + "post": { + "tags": [ + "Collections" + ], + "summary": "List all collection memberships", + "description": "This method allows you to list a collections individual memberships. It's important to note that memberships returned from this endpoint do not include group memberships.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Identifier for the collection", + "format": "uuid" + }, + "query": { + "type": "string", + "description": "Filter memberships by user names", + "example": "jenny" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + }, + "required": [ + "id" + ] + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "memberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Membership" + } + } + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsMemberships" + } + }, + "/collections.add_group": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Add a group to a collection", + "description": "This method allows you to give all members in a group access to a collection.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "groupId": { + "type": "string", + "format": "uuid" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + }, + "required": [ + "id", + "groupId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "collectionGroupMemberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionGroupMembership" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsAddGroup" + } + }, + "/collections.remove_group": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Remove a collection group", + "description": "This method allows you to revoke all members in a group access to a collection. Note that members of the group may still retain access through other groups or individual memberships.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Identifier for the collection", + "format": "uuid" + }, + "groupId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id", + "groupId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsRemoveGroup" + } + }, + "/collections.group_memberships": { + "post": { + "tags": [ + "Collections" + ], + "summary": "List all collection group members", + "description": "This method allows you to list a collections group memberships. This is the list of groups that have been given access to the collection.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Identifier for the collection", + "format": "uuid" + }, + "query": { + "type": "string", + "description": "Filter memberships by group names", + "example": "developers" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + }, + "required": [ + "id" + ] + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Group" + } + }, + "collectionGroupMemberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/CollectionGroupMembership" + } + } + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsGroupMemberships" + } + }, + "/collections.delete": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Delete a collection", + "description": "Delete a collection and all of its documents. This action can’t be undone so please be careful.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsDelete" + } + }, + "/collections.export": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Export a collection", + "description": "Triggers a bulk export of the collection in markdown format and their attachments. If documents are nested then they will be nested in folders inside the zip file. The endpoint returns a `FileOperation` that can be queried to track the progress of the export and get the url for the final file.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "format": { + "type": "string", + "enum": [ + "outline-markdown", + "json", + "html" + ] + }, + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "fileOperation": { + "$ref": "#/components/schemas/FileOperation" + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsExport" + } + }, + "/collections.export_all": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Export all collections", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "format": { + "type": "string", + "enum": [ + "outline-markdown", + "json", + "html" + ] + } + } + } + } + } + }, + "description": "Triggers a bulk export of all documents in and their attachments. The endpoint returns a `FileOperation` that can be queried through the fileOperations endpoint to track the progress of the export and get the url for the final file.", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "fileOperation": { + "$ref": "#/components/schemas/FileOperation" + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "collectionsExportAll" + } + }, + "/comments.create": { + "post": { + "tags": [ + "Comments" + ], + "summary": "Create a comment", + "description": "Add a comment or reply to a document, either `data` or `text` is required.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "documentId": { + "type": "string", + "format": "uuid" + }, + "parentCommentId": { + "type": "string", + "format": "uuid" + }, + "data": { + "type": "object", + "description": "The body of the comment." + }, + "text": { + "type": "string", + "description": "The body of the comment in markdown.", + "example": "Sounds great" + } + }, + "required": [ + "documentId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Comment" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "commentsCreate" + } + }, + "/comments.info": { + "post": { + "tags": [ + "Comments" + ], + "summary": "Retrieve a comment", + "description": "Retrieve a comment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "includeAnchorText": { + "type": "boolean", + "description": "Include the document text that the comment is anchored to, if any, in the response." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Comment" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "commentsInfo" + } + }, + "/comments.update": { + "post": { + "tags": [ + "Comments" + ], + "summary": "Update a comment", + "description": "Update a comment", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "data": { + "type": "object" + } + }, + "required": [ + "id", + "data" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Comment" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "commentsUpdate" + } + }, + "/comments.delete": { + "post": { + "tags": [ + "Comments" + ], + "summary": "Delete a comment", + "description": "Deletes a comment. If the comment is a top-level comment, all its children will be deleted as well.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "commentsDelete" + } + }, + "/comments.list": { + "post": { + "tags": [ + "Comments" + ], + "summary": "List all comments", + "description": "This method will list all comments matching the given properties.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid", + "description": "Filter to a specific document" + }, + "collectionId": { + "type": "string", + "format": "uuid", + "description": "Filter to a specific collection" + }, + "includeAnchorText": { + "type": "boolean", + "description": "Include the document text that the comment is anchored to, if any, in the response." + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Comment" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "commentsList" + } + }, + "/documents.info": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Retrieve a document", + "description": "Retrieve a document by its `UUID`, `urlId`, or `shareId`. At least one of these parameters must be provided.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "shareId": { + "type": "string", + "format": "uuid", + "description": "Unique identifier for a document share, a shareId may be used in place of a document UUID" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsInfo" + } + }, + "/documents.import": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Import a file as a document", + "description": "This method allows you to create a new document by importing an existing file. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document.", + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "file": { + "type": "object", + "description": "Plain text, markdown, docx, csv, tsv, and html format are supported." + }, + "collectionId": { + "type": "string", + "format": "uuid" + }, + "parentDocumentId": { + "type": "string", + "format": "uuid" + }, + "template": { + "type": "boolean" + }, + "publish": { + "type": "boolean" + } + }, + "required": [ + "file" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsImport" + } + }, + "/documents.export": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Export a document as markdown", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "string", + "description": "The document content in Markdown formatting" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsExport" + } + }, + "/documents.list": { + "post": { + "tags": [ + "Documents" + ], + "summary": "List all documents", + "description": "This method will list all published documents and draft documents belonging to the current user.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "format": "uuid", + "description": "Optionally filter to a specific collection" + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "backlinkDocumentId": { + "type": "string", + "format": "uuid" + }, + "parentDocumentId": { + "type": "string", + "format": "uuid" + }, + "template": { + "type": "boolean", + "description": "Optionally filter to only templates" + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsList" + } + }, + "/documents.drafts": { + "post": { + "tags": [ + "Documents" + ], + "summary": "List all draft documents", + "description": "This method will list all draft documents belonging to the current user.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "collectionId": { + "type": "string", + "description": "A collection to search within", + "format": "uuid" + }, + "dateFilter": { + "type": "string", + "description": "Any documents that have not been updated within the specified period will be filtered out", + "example": "month", + "enum": [ + "day", + "week", + "month", + "year" + ] + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsDrafts" + } + }, + "/documents.viewed": { + "post": { + "tags": [ + "Documents" + ], + "summary": "List all recently viewed documents", + "description": "This method will list all documents recently viewed by the current user.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsViewed" + } + }, + "/documents.answerQuestion": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Query documents with natural language", + "description": "This method allows asking direct questions of your documents – where possible an answer will be provided. Search results will be restricted to those accessible by the current access token. Note that \"AI answers\" must be enabled for the workspace.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "type": "object", + "properties": { + "query": { + "type": "string", + "example": "What is our holiday policy?" + }, + "userId": { + "type": "string", + "description": "Any documents that have not been edited by the user identifier will be filtered out", + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "A collection to search within", + "format": "uuid" + }, + "documentId": { + "type": "string", + "description": "A document to search within", + "format": "uuid" + }, + "statusFilter": { + "type": "string", + "description": "Any documents that are not in the specified status will be filtered out", + "enum": [ + "draft", + "archived", + "published" + ] + }, + "dateFilter": { + "type": "string", + "description": "Any documents that have not been updated within the specified period will be filtered out", + "enum": [ + "day", + "week", + "month", + "year" + ] + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "search": { + "$ref": "#/components/schemas/SearchResult" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsAnswerquestion" + } + }, + "/documents.search": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Search all documents", + "description": "This methods allows you to search your teams documents with keywords. Note that search results will be restricted to those accessible by the current access token.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "type": "object", + "properties": { + "query": { + "type": "string", + "example": "hiring" + }, + "userId": { + "type": "string", + "description": "Any documents that have not been edited by the user identifier will be filtered out", + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "A collection to search within", + "format": "uuid" + }, + "documentId": { + "type": "string", + "description": "A document to search within", + "format": "uuid" + }, + "statusFilter": { + "type": "string", + "description": "Any documents that are not in the specified status will be filtered out", + "example": "published", + "enum": [ + "draft", + "archived", + "published" + ] + }, + "dateFilter": { + "type": "string", + "description": "Any documents that have not been updated within the specified period will be filtered out", + "example": "month", + "enum": [ + "day", + "week", + "month", + "year" + ] + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "type": "object", + "properties": { + "context": { + "type": "string", + "description": "A short snippet of context from the document that includes the search query.", + "example": "At Acme Inc our hiring practices are inclusive" + }, + "ranking": { + "type": "number", + "description": "The ranking used to order search results based on relevance.", + "format": "float", + "example": 1.1844109 + }, + "document": { + "$ref": "#/components/schemas/Document" + } + } + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsSearch" + } + }, + "/documents.create": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Create a document", + "description": "This method allows you to create or publish a new document. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string", + "example": "Welcome to Acme Inc" + }, + "text": { + "type": "string", + "description": "The body of the document in markdown" + }, + "collectionId": { + "type": "string", + "format": "uuid" + }, + "parentDocumentId": { + "type": "string", + "format": "uuid" + }, + "templateId": { + "type": "string", + "format": "uuid" + }, + "template": { + "type": "boolean", + "description": "Whether this document should be considered to be a template." + }, + "publish": { + "type": "boolean", + "description": "Whether this document should be immediately published and made visible to other team members." + } + }, + "required": [ + "title", + "collectionId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsCreate" + } + }, + "/documents.update": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Update a document", + "description": "This method allows you to modify an already created document", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "title": { + "type": "string", + "description": "The title of the document." + }, + "text": { + "type": "string", + "description": "The body of the document in markdown." + }, + "append": { + "type": "boolean", + "description": "If true the text field will be appended to the end of the existing document, rather than the default behavior of replacing it. This is potentially useful for things like logging into a document." + }, + "publish": { + "type": "boolean", + "description": "Whether this document should be published and made visible to other team members, if a draft" + }, + "done": { + "type": "boolean", + "description": "Whether the editing session has finished, this will trigger any notifications. This property will soon be deprecated." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsUpdate" + } + }, + "/documents.templatize": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Create a template from a document", + "description": "This method allows you to createa new template using an existing document as the basis", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsTemplatize" + } + }, + "/documents.unpublish": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Unpublish a document", + "description": "Unpublishing a document moves it back to a draft status and out of the collection.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsUnpublish" + } + }, + "/documents.move": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Move a document", + "description": "Move a document to a new location or collection. If no parent document is provided, the document will be moved to the collection root.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "collectionId": { + "type": "string", + "format": "uuid" + }, + "parentDocumentId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + }, + "collections": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Collection" + } + } + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsMove" + } + }, + "/documents.archive": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Archive a document", + "description": "Archiving a document allows outdated information to be moved out of sight whilst retaining the ability to optionally search and restore it later.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsArchive" + } + }, + "/documents.restore": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Restore a document", + "description": "If a document has been archived or deleted, it can be restored. Optionally a revision can be passed to restore the document to a previous point in time.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "revisionId": { + "type": "string", + "format": "uuid", + "description": "Identifier for the revision to restore to." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Document" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsRestore" + } + }, + "/documents.delete": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Delete a document", + "description": "Deleting a document moves it to the trash. If not restored within 30 days it is permenantly deleted.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "permanent": { + "type": "boolean", + "example": false, + "description": "If set to true the document will be destroyed with no way to recover rather than moved to the trash." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsDelete" + } + }, + "/documents.users": { + "post": { + "tags": [ + "Documents" + ], + "summary": "List document users", + "description": "All users with access to a document. To list only users with direct membership to the document use `documents.memberships`", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "query": { + "type": "string", + "description": "If set, will filter the results by user name." + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsUsers" + } + }, + "/documents.memberships": { + "post": { + "tags": [ + "Documents" + ], + "summary": "List document memberships", + "description": "Users with direct membership to a document. To list all users with access to a document use `documents.users`.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "example": "hDYep1TPAM", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "query": { + "type": "string", + "description": "If set, will filter the results by user name" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "memberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Membership" + } + } + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsMemberships" + } + }, + "/documents.add_user": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Add a document user", + "description": "This method allows you to add a user membership to the specified document.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "userId": { + "type": "string", + "format": "uuid" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "memberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Membership" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsAddUser" + } + }, + "/documents.remove_user": { + "post": { + "tags": [ + "Documents" + ], + "summary": "Remove a document user", + "description": "This method allows you to remove a user membership from the specified document.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the document. Either the UUID or the urlId is acceptable." + }, + "userId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "documentsRemoveUser" + } + }, + "/events.list": { + "post": { + "tags": [ + "Events" + ], + "summary": "List all events", + "description": "Events are an audit trail of important events that happen in the knowledge base.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Filter to a specific event, e.g. \"collections.create\". Event names are in the format \"objects.verb\"" + }, + "actorId": { + "type": "string", + "format": "uuid", + "description": "Filter to events performed by the selected user" + }, + "documentId": { + "type": "string", + "format": "uuid", + "description": "Filter to events performed in the selected document" + }, + "collectionId": { + "type": "string", + "format": "uuid", + "description": "Filter to events performed in the selected collection" + }, + "auditLog": { + "type": "boolean", + "description": "Whether to return detailed events suitable for an audit log. Without this flag less detailed event types will be returned." + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Event" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "eventsList" + } + }, + "/fileOperations.info": { + "post": { + "tags": [ + "FileOperations" + ], + "summary": "Retrieve a file operation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the file operation.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/FileOperation" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "fileoperationsInfo" + } + }, + "/fileOperations.delete": { + "post": { + "tags": [ + "FileOperations" + ], + "summary": "Delete a file operation", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the file operation.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "fileoperationsDelete" + } + }, + "/fileOperations.redirect": { + "post": { + "tags": [ + "FileOperations" + ], + "summary": "Retrieve the file", + "description": "Load the resulting file from where it is stored based on the id. A temporary, signed url with embedded credentials is generated on demand.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the file operation.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "fileoperationsRedirect" + } + }, + "/fileOperations.list": { + "post": { + "tags": [ + "FileOperations" + ], + "summary": "List all file operations", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "The type of fileOperation", + "example": "export", + "enum": [ + "export", + "import" + ] + } + }, + "required": [ + "type" + ] + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/FileOperation" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "fileoperationsList" + } + }, + "/groups.info": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Retrieve a group", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the group.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Group" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsInfo" + } + }, + "/groups.list": { + "post": { + "tags": [ + "Groups" + ], + "summary": "List all groups", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "userId": { + "type": "string", + "format": "uuid", + "description": "Filter to groups including a specific user" + }, + "externalId": { + "type": "string", + "format": "uuid", + "description": "Filter to groups matching an external ID" + }, + "query": { + "type": "string", + "format": "uuid", + "description": "Filter to groups matching a search query" + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Group" + } + }, + "groupMemberships": { + "type": "array", + "description": "A preview of memberships in the group, note that this is not all memberships which can be queried from `groups.memberships`.", + "items": { + "$ref": "#/components/schemas/GroupMembership" + } + } + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsList" + } + }, + "/groups.create": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Create a group", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "example": "Designers" + } + }, + "required": [ + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Group" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsCreate" + } + }, + "/groups.update": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Update a group", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "name": { + "type": "string", + "example": "Designers" + } + }, + "required": [ + "id", + "name" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Group" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsUpdate" + } + }, + "/groups.delete": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Delete a group", + "description": "Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action can’t be undone so please be careful.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsDelete" + } + }, + "/groups.memberships": { + "post": { + "tags": [ + "Groups" + ], + "summary": "List all group members", + "description": "List and filter all the members in a group.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Group id", + "example": "a32c2ee6-fbde-4654-841b-0eabdc71b812" + }, + "query": { + "type": "string", + "description": "Filter memberships by user names", + "example": "jenny" + } + }, + "required": [ + "id" + ] + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "groupMemberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GroupMembership" + } + } + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsMemberships" + } + }, + "/groups.add_user": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Add a group member", + "description": "This method allows you to add a user to the specified group.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Group" + } + }, + "groupMemberships": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Membership" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsAddUser" + } + }, + "/groups.remove_user": { + "post": { + "tags": [ + "Groups" + ], + "summary": "Remove a group member", + "description": "This method allows you to remove a user from the group.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Identifier for the collection", + "format": "uuid" + }, + "userId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id", + "userId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "groups": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Group" + } + } + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "groupsRemoveUser" + } + }, + "/oauthClients.info": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "Retrieve an OAuth client", + "description": "To retrieve information about an OAuth client you must pass either an `id` or a `clientId`.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the OAuth client.", + "format": "uuid" + }, + "clientId": { + "type": "string", + "description": "Public identifier for the OAuth client.", + "example": "2bquf8avrpdv31par42a" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/OAuthClient" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsInfo" + } + }, + "/oauthClients.list": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "List accessible OAuth clients", + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/OAuthClient" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + ] + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsList" + } + }, + "/oauthClients.create": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "Create an OAuth client", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "Name of the OAuth client.", + "example": "My App" + }, + "description": { + "type": "string", + "description": "A short description of this OAuth client.", + "example": "Integrate Acme Inc's services into Outline." + }, + "developerName": { + "type": "string", + "description": "The name of the developer who created this OAuth client.", + "example": "Acme Inc" + }, + "developerUrl": { + "type": "string", + "description": "The URL of the developer who created this OAuth client.", + "example": "https://example.com" + }, + "avatarUrl": { + "type": "string", + "description": "A URL pointing to an image representing the OAuth client." + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of redirect URIs for the OAuth client.", + "example": [ + "https://example.com/callback" + ] + }, + "published": { + "type": "boolean", + "description": "Whether the OAuth client is available to other workspaces.", + "example": true + } + }, + "required": [ + "name", + "redirectUris" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/OAuthClient" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsCreate" + } + }, + "/oauthClients.update": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "Update an OAuth client", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the OAuth client.", + "format": "uuid" + }, + "name": { + "type": "string", + "description": "Name of the OAuth client.", + "example": "My App" + }, + "description": { + "type": "string", + "description": "A short description of this OAuth client.", + "example": "Integrate Acme Inc's services into Outline." + }, + "developerName": { + "type": "string", + "description": "The name of the developer who created this OAuth client.", + "example": "Acme Inc" + }, + "developerUrl": { + "type": "string", + "description": "The URL of the developer who created this OAuth client.", + "example": "https://example.com" + }, + "avatarUrl": { + "type": "string", + "description": "A URL pointing to an image representing the OAuth client." + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "List of redirect URIs for the OAuth client.", + "example": [ + "https://example.com/callback" + ] + }, + "published": { + "type": "boolean", + "description": "Whether the OAuth client is available to other workspaces.", + "example": true + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/OAuthClient" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsUpdate" + } + }, + "/oauthClients.rotate_secret": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "Rotate the secret for an OAuth client", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the OAuth client.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/OAuthClient" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsRotateSecret" + } + }, + "/oauthClients.delete": { + "post": { + "tags": [ + "OAuthClients" + ], + "summary": "Delete an OAuth client", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the OAuth client.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "oauthClientsDelete" + } + }, + "/revisions.info": { + "post": { + "tags": [ + "Revisions" + ], + "summary": "Retrieve a revision", + "description": "A revision is a snapshot of a document at a specific point in time. This endpoint allows you to retrieve a specific version of a document by its unique identifier.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the revision.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Revision" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "revisionsInfo" + } + }, + "/revisions.list": { + "post": { + "tags": [ + "Revisions" + ], + "summary": "List all revisions", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid", + "description": "The document ID to retrieve revisions for" + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Revision" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "revisionsList" + } + }, + "/shares.info": { + "post": { + "tags": [ + "Shares" + ], + "summary": "Retrieve a share object", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the share.", + "format": "uuid" + }, + "documentId": { + "type": "string", + "description": "Unique identifier for a document. One of id or documentId must be provided.", + "format": "uuid" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Share" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "sharesInfo" + } + }, + "/shares.list": { + "post": { + "tags": [ + "Shares" + ], + "summary": "List all shares", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "query": { + "type": "string", + "format": "uuid", + "description": "Filter to shared documents matching a search query" + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Share" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "sharesList" + } + }, + "/shares.create": { + "post": { + "tags": [ + "Shares" + ], + "summary": "Create a share", + "description": "Creates a new share link that can be used by to access a document. If you request multiple shares for the same document with the same API key, the same share object will be returned. By default all shares are unpublished.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "documentId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Share" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "sharesCreate" + } + }, + "/shares.update": { + "post": { + "tags": [ + "Shares" + ], + "summary": "Update a share", + "description": "Allows changing an existing share's published status, which removes authentication and makes it available to anyone with the link.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "published": { + "type": "boolean" + } + }, + "required": [ + "id", + "published" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Share" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "sharesUpdate" + } + }, + "/shares.revoke": { + "post": { + "tags": [ + "Shares" + ], + "summary": "Revoke a share", + "description": "Makes the share link inactive so that it can no longer be used to access the document.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "sharesRevoke" + } + }, + "/stars.create": { + "post": { + "tags": [ + "Stars" + ], + "summary": "Create a star", + "description": "Stars a document or collection so it appears in the users sidebar. One of either `documentId` or `collectionId` must be provided.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid" + }, + "collectionId": { + "type": "string", + "format": "uuid" + }, + "index": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Star" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "starsCreate" + } + }, + "/stars.list": { + "post": { + "tags": [ + "Stars" + ], + "summary": "List all stars", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Pagination" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "stars": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Star" + } + }, + "documents": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Document" + } + } + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "starsList" + } + }, + "/stars.update": { + "post": { + "tags": [ + "Stars" + ], + "summary": "Update a stars order in the sidebar", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "index": { + "type": "string" + } + }, + "required": [ + "id", + "index" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/Star" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "starsUpdate" + } + }, + "/stars.delete": { + "post": { + "tags": [ + "Stars" + ], + "summary": "Delete a star", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "400": { + "$ref": "#/components/responses/Validation" + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "starsDelete" + } + }, + "/users.invite": { + "post": { + "tags": [ + "Users" + ], + "summary": "Invite users", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "invites": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invite" + } + } + }, + "required": [ + "invites" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "sent": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Invite" + } + }, + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + } + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersInvite" + } + }, + "/users.info": { + "post": { + "tags": [ + "Users" + ], + "summary": "Retrieve a user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the user.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersInfo" + } + }, + "/users.list": { + "post": { + "tags": [ + "Users" + ], + "summary": "List all users", + "description": "List and filter all the users in the team", + "requestBody": { + "content": { + "application/json": { + "schema": { + "allOf": [ + { + "$ref": "#/components/schemas/Pagination" + }, + { + "$ref": "#/components/schemas/Sorting" + }, + { + "type": "object", + "properties": { + "query": { + "type": "string", + "example": "jane" + }, + "emails": { + "type": "array", + "description": "Array of emails", + "items": { + "type": "string" + }, + "example": [ + "jane.crandall@mail.com", + "prudence.crandall@mail.com" + ] + }, + "filter": { + "type": "string", + "description": "The status to filter by", + "enum": [ + "all", + "invited", + "active", + "suspended" + ] + }, + "role": { + "$ref": "#/components/schemas/UserRole" + } + } + } + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + }, + "pagination": { + "$ref": "#/components/schemas/Pagination" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersList" + } + }, + "/users.update": { + "post": { + "tags": [ + "Users" + ], + "summary": "Update a user", + "description": "Update a users name or avatar. If no `id` is passed then the user associated with the authentication will be updated by default.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "language": { + "type": "string", + "format": "BCP47" + }, + "avatarUrl": { + "type": "string", + "format": "uri" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersUpdate" + } + }, + "/users.update_role": { + "post": { + "tags": [ + "Users" + ], + "summary": "Change a users role", + "description": "Change the role of a user, only available to admin authorization.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the user.", + "format": "uuid" + }, + "role": { + "$ref": "#/components/schemas/UserRole" + } + }, + "required": [ + "id", + "role" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersUpdateRole" + } + }, + "/users.suspend": { + "post": { + "tags": [ + "Users" + ], + "summary": "Suspend a user", + "description": "Suspending a user prevents the user from signing in. Users that are suspended are also not counted against billing totals in the hosted version.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the user.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersSuspend" + } + }, + "/users.activate": { + "post": { + "tags": [ + "Users" + ], + "summary": "Activate a user", + "description": "Activating a previously suspended user allows them to signin again. Users that are activated will cause billing totals to be re-calculated in the hosted version.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the user.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/User" + }, + "policies": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Policy" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersActivate" + } + }, + "/users.delete": { + "post": { + "tags": [ + "Users" + ], + "summary": "Delete a user", + "description": "Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the user.", + "format": "uuid" + } + }, + "required": [ + "id" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "success": { + "type": "boolean", + "example": true + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "404": { + "$ref": "#/components/responses/NotFound" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "usersDelete" + } + }, + "/views.list": { + "post": { + "tags": [ + "Views" + ], + "summary": "List all views", + "description": "List all users that have viewed a document and the overall view count.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid", + "description": "The document ID to retrieve views for" + } + }, + "required": [ + "documentId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/View" + } + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + }, + "429": { + "$ref": "#/components/responses/RateLimited" + } + }, + "operationId": "viewsList" + } + }, + "/views.create": { + "post": { + "tags": [ + "Views" + ], + "summary": "Create a view", + "description": "Creates a new view for a document. This is documented in the interests of thoroughness however it is recommended that views are not created from outside of the Outline UI.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "documentId": { + "type": "string", + "format": "uuid" + } + }, + "required": [ + "documentId" + ] + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "$ref": "#/components/schemas/View" + } + } + } + } + } + }, + "401": { + "$ref": "#/components/responses/Unauthenticated" + }, + "403": { + "$ref": "#/components/responses/Unauthorized" + } + }, + "operationId": "viewsCreate" + } + } + }, + "components": { + "schemas": { + "Permission": { + "type": "string", + "enum": [ + "read", + "read_write" + ] + }, + "Attachment": { + "type": "object", + "properties": { + "contentType": { + "type": "string", + "example": "image/png" + }, + "size": { + "type": "number" + }, + "name": { + "type": "string" + }, + "url": { + "type": "string", + "format": "uri" + }, + "documentId": { + "type": "string", + "description": "Identifier for the associated document, if any.", + "format": "uuid" + } + } + }, + "Pagination": { + "type": "object", + "properties": { + "offset": { + "type": "number", + "example": 0 + }, + "limit": { + "type": "number", + "example": 25 + } + } + }, + "Sorting": { + "type": "object", + "properties": { + "sort": { + "type": "string", + "example": "updatedAt" + }, + "direction": { + "type": "string", + "example": "DESC", + "enum": [ + "ASC", + "DESC" + ] + } + } + }, + "NavigationNode": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the document.", + "format": "uuid" + }, + "title": { + "type": "string" + }, + "url": { + "type": "string" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/components/schemas/NavigationNode" + } + } + } + }, + "Auth": { + "type": "object", + "properties": { + "user": { + "$ref": "#/components/schemas/User" + }, + "team": { + "$ref": "#/components/schemas/Team" + } + } + }, + "Collection": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "urlId": { + "type": "string", + "description": "A short unique identifier that can be used to identify the collection instead of the UUID.", + "readOnly": true, + "example": "hDYep1TPAM" + }, + "name": { + "type": "string", + "description": "The name of the collection.", + "example": "Human Resources" + }, + "description": { + "type": "string", + "description": "A description of the collection, may contain markdown formatting", + "example": "" + }, + "sort": { + "type": "object", + "description": "The sort of documents in the collection. Note that not all API responses respect this and it is left as a frontend concern to implement.", + "properties": { + "field": { + "type": "string" + }, + "direction": { + "type": "string", + "enum": [ + "asc", + "desc" + ] + } + } + }, + "index": { + "type": "string", + "description": "The position of the collection in the sidebar", + "example": "P" + }, + "color": { + "type": "string", + "description": "A color representing the collection, this is used to help make collections more identifiable in the UI. It should be in HEX format including the #", + "example": "#123123" + }, + "icon": { + "type": "string", + "description": "A string that represents an icon in the outline-icons package or an emoji" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + }, + "sharing": { + "type": "boolean", + "description": "Whether public document sharing is enabled in this collection", + "default": false + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "description": "The date and time that this object was last changed", + "readOnly": true, + "format": "date-time" + }, + "deletedAt": { + "type": "string", + "nullable": true, + "description": "The date and time that this object was deleted", + "readOnly": true, + "format": "date-time" + }, + "archivedAt": { + "type": "string", + "nullable": true, + "description": "The date and time that this object was archived", + "readOnly": true, + "format": "date-time" + }, + "archivedBy": { + "$ref": "#/components/schemas/User" + } + } + }, + "Comment": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "data": { + "type": "object", + "description": "The editor data representing this comment." + }, + "documentId": { + "type": "string", + "description": "Identifier for the document this is related to.", + "format": "uuid" + }, + "parentCommentId": { + "type": "string", + "description": "Identifier for the comment this is a child of, if any.", + "format": "uuid" + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + }, + "createdBy": { + "$ref": "#/components/schemas/User" + }, + "updatedAt": { + "type": "string", + "description": "The date and time that this object was last changed", + "readOnly": true, + "format": "date-time" + }, + "updatedBy": { + "$ref": "#/components/schemas/User" + }, + "anchorText": { + "type": "string", + "description": "The document text that the comment is anchored to, only included if includeAnchorText=true.", + "readOnly": true + } + } + }, + "Document": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "Identifier for the associated collection.", + "format": "uuid" + }, + "parentDocumentId": { + "type": "string", + "description": "Identifier for the document this is a child of, if any.", + "format": "uuid" + }, + "title": { + "type": "string", + "description": "The title of the document.", + "example": "🎉 Welcome to Acme Inc" + }, + "fullWidth": { + "type": "boolean", + "description": "Whether this document should be displayed in a full-width view." + }, + "emoji": { + "type": "string", + "description": "An emoji associated with the document.", + "example": "🎉" + }, + "text": { + "type": "string", + "description": "The text content of the document, contains markdown formatting", + "example": "…" + }, + "urlId": { + "type": "string", + "description": "A short unique ID that can be used to identify the document as an alternative to the UUID", + "example": "hDYep1TPAM" + }, + "collaborators": { + "type": "array", + "items": { + "$ref": "#/components/schemas/User" + } + }, + "pinned": { + "type": "boolean", + "description": "Whether this document is pinned in the collection" + }, + "template": { + "type": "boolean", + "description": "Whether this document is a template" + }, + "templateId": { + "type": "string", + "description": "Unique identifier for the template this document was created from, if any", + "format": "uuid" + }, + "revision": { + "type": "number", + "description": "A number that is auto incrementing with every revision of the document that is saved", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + }, + "createdBy": { + "$ref": "#/components/schemas/User" + }, + "updatedAt": { + "type": "string", + "description": "The date and time that this object was last changed", + "readOnly": true, + "format": "date-time" + }, + "updatedBy": { + "$ref": "#/components/schemas/User" + }, + "publishedAt": { + "type": "string", + "nullable": true, + "description": "The date and time that this object was published", + "readOnly": true, + "format": "date-time" + }, + "archivedAt": { + "type": "string", + "description": "The date and time that this object was archived", + "readOnly": true, + "format": "date-time" + }, + "deletedAt": { + "type": "string", + "nullable": true, + "description": "The date and time that this object was deleted", + "readOnly": true, + "format": "date-time" + } + } + }, + "Event": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "name": { + "type": "string", + "example": "documents.create", + "readOnly": true + }, + "modelId": { + "type": "string", + "description": "Identifier for the object this event is associated with when it is not one of document, collection, or user.", + "format": "uuid", + "readOnly": true + }, + "actorId": { + "type": "string", + "description": "The user that performed the action.", + "format": "uuid", + "readOnly": true + }, + "actorIpAddress": { + "type": "string", + "description": "The ip address the action was performed from. This field is only returned when the `auditLog` boolean is true.", + "example": "60.169.88.100", + "readOnly": true + }, + "collectionId": { + "type": "string", + "format": "uuid", + "description": "Identifier for the associated collection, if any", + "readOnly": true + }, + "documentId": { + "type": "string", + "format": "uuid", + "description": "Identifier for the associated document, if any", + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "The date and time that this event was created", + "readOnly": true, + "format": "date-time" + }, + "data": { + "type": "object", + "example": { + "name": "Equipment list" + }, + "description": "Additional unstructured data associated with the event", + "readOnly": true + }, + "actor": { + "$ref": "#/components/schemas/User" + } + } + }, + "Error": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "example": false + }, + "error": { + "type": "string" + }, + "message": { + "type": "string" + }, + "status": { + "type": "number" + }, + "data": { + "type": "object" + } + } + }, + "FileOperation": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "type": { + "type": "string", + "example": "export", + "description": "The type of file operation.", + "readOnly": true, + "enum": [ + "import", + "export" + ] + }, + "state": { + "type": "string", + "description": "The state of the file operation.", + "example": "complete", + "readOnly": true, + "enum": [ + "creating", + "uploading", + "complete", + "error", + "expired" + ] + }, + "collection": { + "allOf": [ + { + "nullable": true + }, + { + "$ref": "#/components/schemas/Collection" + } + ] + }, + "user": { + "$ref": "#/components/schemas/User" + }, + "size": { + "type": "number", + "description": "The size of the resulting file in bytes", + "readOnly": true, + "example": 2048 + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + } + } + }, + "Group": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of this group.", + "example": "Engineering" + }, + "memberCount": { + "type": "number", + "description": "The number of users that are members of the group", + "example": 11, + "readOnly": true + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + }, + "updatedAt": { + "type": "string", + "description": "The date and time that this object was last changed", + "readOnly": true, + "format": "date-time" + } + } + }, + "OAuthClient": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of this OAuth client.", + "example": "Acme Inc" + }, + "description": { + "type": "string", + "description": "A short description of this OAuth client.", + "example": "Integrate Acme Inc's services into Outline." + }, + "developerName": { + "type": "string", + "description": "The name of the developer who created this OAuth client.", + "example": "Acme Inc" + }, + "developerUrl": { + "type": "string", + "description": "The URL of the developer who created this OAuth client.", + "example": "https://example.com" + }, + "avatarUrl": { + "type": "string", + "description": "A URL pointing to an image representing the OAuth client." + }, + "clientId": { + "type": "string", + "description": "The client ID for the OAuth client.", + "readOnly": true, + "example": "2bquf8avrpdv31par42a" + }, + "clientSecret": { + "type": "string", + "description": "The client secret for the OAuth client.", + "readOnly": true, + "example": "ol_sk_rapdv31..." + }, + "redirectUris": { + "type": "array", + "items": { + "type": "string" + }, + "description": "The redirect URIs for the OAuth client.", + "example": [ + "https://example.com/callback" + ] + }, + "published": { + "type": "boolean", + "description": "Whether the OAuth client is available to other workspaces.", + "example": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this OAuth client was created", + "readOnly": true + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this OAuth client was updated", + "readOnly": true + } + } + }, + "Revision": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "documentId": { + "type": "string", + "description": "Identifier for the associated document.", + "readOnly": true, + "format": "uuid" + }, + "title": { + "type": "string", + "description": "Title of the document.", + "readOnly": true + }, + "text": { + "type": "string", + "description": "Body of the document, may contain markdown formatting", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this revision was created", + "readOnly": true + }, + "createdBy": { + "$ref": "#/components/schemas/User" + } + } + }, + "Share": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "documentTitle": { + "type": "string", + "description": "Title of the shared document.", + "example": "React best practices", + "readOnly": true + }, + "documentUrl": { + "type": "string", + "format": "uri", + "description": "URL of the original document.", + "readOnly": true + }, + "url": { + "type": "string", + "format": "uri", + "description": "URL of the publicly shared document.", + "readOnly": true + }, + "published": { + "type": "boolean", + "example": false, + "description": "If true the share can be loaded without a user account." + }, + "includeChildDocuments": { + "type": "boolean", + "example": true, + "description": "If to also give permission to view documents nested beneath this one." + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this share was created", + "readOnly": true + }, + "createdBy": { + "$ref": "#/components/schemas/User" + }, + "updatedAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this share was edited", + "readOnly": true + }, + "lastAccessedAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this share was last viewed", + "readOnly": true + } + } + }, + "Star": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "index": { + "type": "string", + "description": "Index of the star in the list of stars." + }, + "documentId": { + "type": "string", + "description": "Unique identifier for the starred document.", + "readOnly": true, + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "Unique identifier for the starred collection.", + "readOnly": true, + "format": "uuid" + }, + "documentUrl": { + "type": "string", + "format": "uri", + "description": "URL of the original document.", + "readOnly": true + }, + "createdAt": { + "type": "string", + "format": "date-time", + "description": "Date and time when this star was created", + "readOnly": true + } + } + }, + "Team": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of this team, it is usually auto-generated when the first SSO connection is made but can be changed if neccessary." + }, + "avatarUrl": { + "type": "string", + "format": "uri", + "description": "The URL for the image associated with this team, it will be displayed in the team switcher and in the top left of the knowledge base along with the name." + }, + "sharing": { + "type": "boolean", + "description": "Whether this team has share links globally enabled. If this value is false then all sharing UI and APIs are disabled." + }, + "defaultCollectionId": { + "type": "string", + "description": "If set then the referenced collection is where users will be redirected to after signing in instead of the Home screen", + "format": "uuid" + }, + "defaultUserRole": { + "$ref": "#/components/schemas/UserRole" + }, + "memberCollectionCreate": { + "type": "boolean", + "description": "Whether members are allowed to create new collections. If false then only admins can create collections." + }, + "documentEmbeds": { + "type": "boolean", + "description": "Whether this team has embeds in documents globally enabled. It can be disabled to reduce potential data leakage to third parties." + }, + "collaborativeEditing": { + "type": "boolean", + "description": "Whether this team has collaborative editing in documents globally enabled." + }, + "inviteRequired": { + "type": "boolean", + "description": "Whether an invite is required to join this team, if false users may join with a linked SSO provider." + }, + "allowedDomains": { + "type": "array", + "items": { + "type": "string", + "description": "A hostname that user emails are restricted to" + } + }, + "guestSignin": { + "type": "boolean", + "description": "Whether this team has guest signin enabled. Guests can signin with an email address and are not required to have a Google Workspace/Slack SSO account once invited." + }, + "subdomain": { + "type": "string", + "description": "Represents the subdomain at which this team's knowledge base can be accessed." + }, + "url": { + "type": "string", + "description": "The fully qualified URL at which this team's knowledge base can be accessed.", + "readOnly": true, + "format": "uri" + } + } + }, + "User": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true, + "format": "uuid" + }, + "name": { + "type": "string", + "description": "The name of this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.", + "example": "Jane Doe" + }, + "avatarUrl": { + "type": "string", + "format": "uri", + "description": "The URL for the image associated with this user, it will be displayed in the application UI and email notifications." + }, + "email": { + "type": "string", + "description": "The email associated with this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary.", + "format": "email", + "readOnly": true + }, + "role": { + "$ref": "#/components/schemas/UserRole" + }, + "isSuspended": { + "type": "boolean", + "description": "Whether this user has been suspended.", + "readOnly": true + }, + "lastActiveAt": { + "type": "string", + "description": "The last time this user made an API request, this value is updated at most every 5 minutes.", + "readOnly": true, + "format": "date-time" + }, + "createdAt": { + "type": "string", + "description": "The date and time that this user first signed in or was invited as a guest.", + "readOnly": true, + "format": "date-time" + } + } + }, + "Invite": { + "type": "object", + "properties": { + "name": { + "type": "string", + "description": "The full name of the user being invited" + }, + "email": { + "type": "string", + "description": "The email address to invite" + }, + "role": { + "$ref": "#/components/schemas/UserRole" + } + } + }, + "UserRole": { + "type": "string", + "enum": [ + "admin", + "member", + "viewer", + "guest" + ] + }, + "CollectionStatus": { + "type": "string", + "enum": [ + "archived" + ] + }, + "Membership": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true + }, + "userId": { + "type": "string", + "description": "Identifier for the associated user.", + "readOnly": true, + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "Identifier for the associated collection.", + "readOnly": true, + "format": "uuid" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + } + }, + "SearchResult": { + "type": "object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "format": "uuid" + }, + "query": { + "type": "string", + "description": "The user-provided search query", + "example": "What is our hiring policy?", + "readOnly": true + }, + "answer": { + "type": "string", + "description": "An answer to the query, if possible", + "example": "Our hiring policy can be summarized as…", + "readOnly": true + }, + "source": { + "type": "string", + "example": "app", + "description": "The source of the query", + "readOnly": true, + "enum": [ + "api", + "app" + ] + }, + "createdAt": { + "type": "string", + "description": "The date and time that this object was created", + "readOnly": true, + "format": "date-time" + } + } + }, + "Policy": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object this policy references.", + "format": "uuid", + "readOnly": true + }, + "abilities": { + "type": "object", + "description": "The abilities that are allowed by this policy, if an array is returned then the individual ID's in the array represent the memberships that grant the ability.", + "additionalProperties": { + "$ref": "#/components/schemas/Ability" + }, + "example": { + "read": true, + "update": true, + "delete": false + } + } + } + }, + "Ability": { + "description": "A single permission granted by a policy", + "example": true, + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "boolean" + } + ] + }, + "GroupMembership": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true + }, + "groupId": { + "type": "string", + "description": "Identifier for the associated group.", + "readOnly": true, + "format": "uuid" + }, + "userId": { + "type": "string", + "description": "Identifier for the associated user.", + "readOnly": true, + "format": "uuid" + }, + "user": { + "$ref": "#/components/schemas/User" + } + } + }, + "CollectionGroupMembership": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true + }, + "groupId": { + "type": "string", + "description": "Identifier for the associated group.", + "readOnly": true, + "format": "uuid" + }, + "collectionId": { + "type": "string", + "description": "Identifier for the associated collection.", + "readOnly": true, + "format": "uuid" + }, + "permission": { + "$ref": "#/components/schemas/Permission" + } + } + }, + "View": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "Unique identifier for the object.", + "readOnly": true + }, + "documentId": { + "type": "string", + "description": "Identifier for the associated document.", + "readOnly": true, + "format": "uuid" + }, + "firstViewedAt": { + "type": "string", + "description": "When the document was first viewed by the user", + "readOnly": true, + "format": "date-time" + }, + "lastViewedAt": { + "type": "string", + "description": "When the document was last viewed by the user", + "readOnly": true, + "format": "date-time" + }, + "count": { + "type": "number", + "description": "The number of times the user has viewed the document.", + "example": 22, + "readOnly": true + }, + "user": { + "$ref": "#/components/schemas/User" + } + } + } + }, + "responses": { + "NotFound": { + "description": "The specified resource was not found.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Validation": { + "description": "The request failed one or more validations.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Unauthorized": { + "description": "The current API key is not authorized to perform this action.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "Unauthenticated": { + "description": "The API key is missing or otherwise invalid.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Error" + } + } + } + }, + "RateLimited": { + "description": "The request was rate limited.", + "headers": { + "Retry-After": { + "$ref": "#/components/headers/Retry-After" + }, + "RateLimit-Limit": { + "$ref": "#/components/headers/RateLimit-Limit" + }, + "RateLimit-Remaining": { + "$ref": "#/components/headers/RateLimit-Remaining" + }, + "RateLimit-Reset": { + "$ref": "#/components/headers/RateLimit-Reset" + } + }, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "ok": { + "type": "boolean", + "example": false + }, + "error": { + "type": "string", + "example": "rate_limit_exceeded" + }, + "status": { + "type": "number", + "example": 429 + } + } + } + } + } + } + }, + "headers": { + "Retry-After": { + "schema": { + "type": "integer" + }, + "description": "Seconds in the future to retry the request, if rate limited." + }, + "RateLimit-Limit": { + "schema": { + "type": "integer" + }, + "description": "The maximum requests available in the current duration." + }, + "RateLimit-Remaining": { + "schema": { + "type": "integer" + }, + "description": "How many requests are left in the current duration." + }, + "RateLimit-Reset": { + "schema": { + "type": "string" + }, + "description": "Timestamp in the future the duration will reset." + } + }, + "securitySchemes": { + "BearerAuth": { + "type": "http", + "scheme": "bearer", + "bearerFormat": "JWT" + }, + "OAuth2": { + "type": "oauth2", + "flows": { + "authorizationCode": { + "authorizationUrl": "https://app.getoutline.com/oauth/authorize", + "tokenUrl": "https://app.getoutline.com/oauth/token", + "refreshUrl": "https://app.getoutline.com/oauth/token", + "scopes": { + "read": "Read access", + "write": "Write access" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/src/config.ts b/src/config.ts new file mode 100644 index 0000000..49f87b7 --- /dev/null +++ b/src/config.ts @@ -0,0 +1,8 @@ +import * as envVar from "env-var"; + +const config = { + baseUrl: envVar.get("OUTLINE_BASE_URL").required().asString(), + apiKey: envVar.get("OUTLINE_API_KEY").required().asString(), +}; + +export default config; diff --git a/src/gen/api/outline/.openapi-generator-ignore b/src/gen/api/outline/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/src/gen/api/outline/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/src/gen/api/outline/.openapi-generator/FILES b/src/gen/api/outline/.openapi-generator/FILES new file mode 100644 index 0000000..93a2305 --- /dev/null +++ b/src/gen/api/outline/.openapi-generator/FILES @@ -0,0 +1,171 @@ +.openapi-generator-ignore +apis/AttachmentsApi.ts +apis/AuthApi.ts +apis/CollectionsApi.ts +apis/CommentsApi.ts +apis/DocumentsApi.ts +apis/EventsApi.ts +apis/FileOperationsApi.ts +apis/GroupsApi.ts +apis/OAuthClientsApi.ts +apis/RevisionsApi.ts +apis/SharesApi.ts +apis/StarsApi.ts +apis/UsersApi.ts +apis/ViewsApi.ts +apis/index.ts +index.ts +models/Ability.ts +models/Attachment.ts +models/AttachmentsCreate200Response.ts +models/AttachmentsCreate200ResponseData.ts +models/AttachmentsCreateRequest.ts +models/AttachmentsDelete200Response.ts +models/AttachmentsRedirectRequest.ts +models/Auth.ts +models/AuthConfig200Response.ts +models/AuthConfig200ResponseData.ts +models/AuthConfig200ResponseDataServicesInner.ts +models/AuthInfo200Response.ts +models/Collection.ts +models/CollectionGroupMembership.ts +models/CollectionSort.ts +models/CollectionStatus.ts +models/CollectionsAddGroup200Response.ts +models/CollectionsAddGroup200ResponseData.ts +models/CollectionsAddGroupRequest.ts +models/CollectionsAddUser200Response.ts +models/CollectionsAddUser200ResponseData.ts +models/CollectionsAddUserRequest.ts +models/CollectionsCreateRequest.ts +models/CollectionsDeleteRequest.ts +models/CollectionsDocuments200Response.ts +models/CollectionsExport200Response.ts +models/CollectionsExport200ResponseData.ts +models/CollectionsExportAllRequest.ts +models/CollectionsExportRequest.ts +models/CollectionsGroupMemberships200Response.ts +models/CollectionsGroupMemberships200ResponseData.ts +models/CollectionsGroupMembershipsRequest.ts +models/CollectionsInfo200Response.ts +models/CollectionsInfoRequest.ts +models/CollectionsList200Response.ts +models/CollectionsListRequest.ts +models/CollectionsMemberships200Response.ts +models/CollectionsMembershipsRequest.ts +models/CollectionsRemoveGroupRequest.ts +models/CollectionsRemoveUserRequest.ts +models/CollectionsUpdateRequest.ts +models/Comment.ts +models/CommentsCreate200Response.ts +models/CommentsCreateRequest.ts +models/CommentsInfo200Response.ts +models/CommentsInfoRequest.ts +models/CommentsList200Response.ts +models/CommentsListRequest.ts +models/CommentsUpdateRequest.ts +models/Document.ts +models/DocumentsAddUserRequest.ts +models/DocumentsAnswerquestion200Response.ts +models/DocumentsAnswerquestionRequest.ts +models/DocumentsCreateRequest.ts +models/DocumentsDeleteRequest.ts +models/DocumentsDraftsRequest.ts +models/DocumentsExport200Response.ts +models/DocumentsExportRequest.ts +models/DocumentsInfo200Response.ts +models/DocumentsInfoRequest.ts +models/DocumentsList200Response.ts +models/DocumentsListRequest.ts +models/DocumentsMembershipsRequest.ts +models/DocumentsMove200Response.ts +models/DocumentsMove200ResponseData.ts +models/DocumentsMoveRequest.ts +models/DocumentsRemoveUserRequest.ts +models/DocumentsRestoreRequest.ts +models/DocumentsSearch200Response.ts +models/DocumentsSearch200ResponseDataInner.ts +models/DocumentsSearchRequest.ts +models/DocumentsUnpublishRequest.ts +models/DocumentsUpdateRequest.ts +models/DocumentsUsers200Response.ts +models/DocumentsUsersRequest.ts +models/DocumentsViewedRequest.ts +models/Event.ts +models/EventsList200Response.ts +models/EventsListRequest.ts +models/FileOperation.ts +models/FileoperationsInfo200Response.ts +models/FileoperationsInfoRequest.ts +models/FileoperationsList200Response.ts +models/FileoperationsListRequest.ts +models/Group.ts +models/GroupMembership.ts +models/GroupsAddUser200Response.ts +models/GroupsAddUser200ResponseData.ts +models/GroupsAddUserRequest.ts +models/GroupsCreateRequest.ts +models/GroupsInfo200Response.ts +models/GroupsInfoRequest.ts +models/GroupsList200Response.ts +models/GroupsList200ResponseData.ts +models/GroupsListRequest.ts +models/GroupsMemberships200Response.ts +models/GroupsMemberships200ResponseData.ts +models/GroupsMembershipsRequest.ts +models/GroupsRemoveUser200Response.ts +models/GroupsRemoveUser200ResponseData.ts +models/GroupsUpdateRequest.ts +models/InlineObject.ts +models/Invite.ts +models/Membership.ts +models/ModelError.ts +models/NavigationNode.ts +models/OAuthClient.ts +models/OauthClientsCreateRequest.ts +models/OauthClientsInfo200Response.ts +models/OauthClientsInfoRequest.ts +models/OauthClientsList200Response.ts +models/OauthClientsRotateSecretRequest.ts +models/OauthClientsUpdateRequest.ts +models/Pagination.ts +models/Permission.ts +models/Policy.ts +models/Revision.ts +models/RevisionsInfo200Response.ts +models/RevisionsInfoRequest.ts +models/RevisionsList200Response.ts +models/RevisionsListRequest.ts +models/SearchResult.ts +models/Share.ts +models/SharesCreateRequest.ts +models/SharesInfo200Response.ts +models/SharesInfoRequest.ts +models/SharesList200Response.ts +models/SharesListRequest.ts +models/SharesUpdateRequest.ts +models/Sorting.ts +models/Star.ts +models/StarsCreate200Response.ts +models/StarsCreateRequest.ts +models/StarsList200Response.ts +models/StarsList200ResponseData.ts +models/StarsUpdateRequest.ts +models/Team.ts +models/User.ts +models/UserRole.ts +models/UsersInfo200Response.ts +models/UsersInfoRequest.ts +models/UsersInvite200Response.ts +models/UsersInvite200ResponseData.ts +models/UsersInviteRequest.ts +models/UsersList200Response.ts +models/UsersListRequest.ts +models/UsersUpdateRequest.ts +models/UsersUpdateRoleRequest.ts +models/View.ts +models/ViewsCreate200Response.ts +models/ViewsList200Response.ts +models/ViewsListRequest.ts +models/index.ts +runtime.ts diff --git a/src/gen/api/outline/.openapi-generator/VERSION b/src/gen/api/outline/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/src/gen/api/outline/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/src/gen/api/outline/apis/AttachmentsApi.ts b/src/gen/api/outline/apis/AttachmentsApi.ts new file mode 100644 index 0000000..a445279 --- /dev/null +++ b/src/gen/api/outline/apis/AttachmentsApi.ts @@ -0,0 +1,194 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsCreate200Response, + AttachmentsCreateRequest, + AttachmentsDelete200Response, + AttachmentsRedirectRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsCreate200ResponseFromJSON, + AttachmentsCreate200ResponseToJSON, + AttachmentsCreateRequestFromJSON, + AttachmentsCreateRequestToJSON, + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + AttachmentsRedirectRequestFromJSON, + AttachmentsRedirectRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface AttachmentsCreateOperationRequest { + attachmentsCreateRequest?: AttachmentsCreateRequest; +} + +export interface AttachmentsDeleteRequest { + attachmentsRedirectRequest?: AttachmentsRedirectRequest; +} + +export interface AttachmentsRedirectOperationRequest { + attachmentsRedirectRequest?: AttachmentsRedirectRequest; +} + +/** + * + */ +export class AttachmentsApi extends runtime.BaseAPI { + + /** + * Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage. + * Create an attachment + */ + async attachmentsCreateRaw(requestParameters: AttachmentsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/attachments.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AttachmentsCreateRequestToJSON(requestParameters['attachmentsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsCreate200ResponseFromJSON(jsonValue)); + } + + /** + * Creating an attachment object creates a database record and returns the inputs needed to generate a signed url and upload the file from the client to cloud storage. + * Create an attachment + */ + async attachmentsCreate(requestParameters: AttachmentsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachmentsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deleting an attachment is permanant. It will not delete references or links to the attachment that may exist in your documents. + * Delete an attachment + */ + async attachmentsDeleteRaw(requestParameters: AttachmentsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/attachments.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AttachmentsRedirectRequestToJSON(requestParameters['attachmentsRedirectRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Deleting an attachment is permanant. It will not delete references or links to the attachment that may exist in your documents. + * Delete an attachment + */ + async attachmentsDelete(requestParameters: AttachmentsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.attachmentsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Load an attachment from where it is stored based on the id. If the attachment is private then a temporary, signed url with embedded credentials is generated on demand. + * Retrieve an attachment + */ + async attachmentsRedirectRaw(requestParameters: AttachmentsRedirectOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/attachments.redirect`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: AttachmentsRedirectRequestToJSON(requestParameters['attachmentsRedirectRequest']), + }, initOverrides); + + return new runtime.VoidApiResponse(response); + } + + /** + * Load an attachment from where it is stored based on the id. If the attachment is private then a temporary, signed url with embedded credentials is generated on demand. + * Retrieve an attachment + */ + async attachmentsRedirect(requestParameters: AttachmentsRedirectOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + await this.attachmentsRedirectRaw(requestParameters, initOverrides); + } + +} diff --git a/src/gen/api/outline/apis/AuthApi.ts b/src/gen/api/outline/apis/AuthApi.ts new file mode 100644 index 0000000..c8e5b24 --- /dev/null +++ b/src/gen/api/outline/apis/AuthApi.ts @@ -0,0 +1,111 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AuthConfig200Response, + AuthInfo200Response, + InlineObject, +} from '../models/index'; +import { + AuthConfig200ResponseFromJSON, + AuthConfig200ResponseToJSON, + AuthInfo200ResponseFromJSON, + AuthInfo200ResponseToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +/** + * + */ +export class AuthApi extends runtime.BaseAPI { + + /** + * Retrieve authentication options + * Retrieve auth config + */ + async authConfigRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + + let urlPath = `/auth.config`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AuthConfig200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve authentication options + * Retrieve auth config + */ + async authConfig(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.authConfigRaw(initOverrides); + return await response.value(); + } + + /** + * Retrieve authentication details for the current API key + * Retrieve auth + */ + async authInfoRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/auth.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AuthInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve authentication details for the current API key + * Retrieve auth + */ + async authInfo(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.authInfoRaw(initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/CollectionsApi.ts b/src/gen/api/outline/apis/CollectionsApi.ts new file mode 100644 index 0000000..e439746 --- /dev/null +++ b/src/gen/api/outline/apis/CollectionsApi.ts @@ -0,0 +1,800 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsAddGroup200Response, + CollectionsAddGroupRequest, + CollectionsAddUser200Response, + CollectionsAddUserRequest, + CollectionsCreateRequest, + CollectionsDeleteRequest, + CollectionsDocuments200Response, + CollectionsExport200Response, + CollectionsExportAllRequest, + CollectionsExportRequest, + CollectionsGroupMemberships200Response, + CollectionsGroupMembershipsRequest, + CollectionsInfo200Response, + CollectionsInfoRequest, + CollectionsList200Response, + CollectionsListRequest, + CollectionsMemberships200Response, + CollectionsMembershipsRequest, + CollectionsRemoveGroupRequest, + CollectionsRemoveUserRequest, + CollectionsUpdateRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsAddGroup200ResponseFromJSON, + CollectionsAddGroup200ResponseToJSON, + CollectionsAddGroupRequestFromJSON, + CollectionsAddGroupRequestToJSON, + CollectionsAddUser200ResponseFromJSON, + CollectionsAddUser200ResponseToJSON, + CollectionsAddUserRequestFromJSON, + CollectionsAddUserRequestToJSON, + CollectionsCreateRequestFromJSON, + CollectionsCreateRequestToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + CollectionsDocuments200ResponseFromJSON, + CollectionsDocuments200ResponseToJSON, + CollectionsExport200ResponseFromJSON, + CollectionsExport200ResponseToJSON, + CollectionsExportAllRequestFromJSON, + CollectionsExportAllRequestToJSON, + CollectionsExportRequestFromJSON, + CollectionsExportRequestToJSON, + CollectionsGroupMemberships200ResponseFromJSON, + CollectionsGroupMemberships200ResponseToJSON, + CollectionsGroupMembershipsRequestFromJSON, + CollectionsGroupMembershipsRequestToJSON, + CollectionsInfo200ResponseFromJSON, + CollectionsInfo200ResponseToJSON, + CollectionsInfoRequestFromJSON, + CollectionsInfoRequestToJSON, + CollectionsList200ResponseFromJSON, + CollectionsList200ResponseToJSON, + CollectionsListRequestFromJSON, + CollectionsListRequestToJSON, + CollectionsMemberships200ResponseFromJSON, + CollectionsMemberships200ResponseToJSON, + CollectionsMembershipsRequestFromJSON, + CollectionsMembershipsRequestToJSON, + CollectionsRemoveGroupRequestFromJSON, + CollectionsRemoveGroupRequestToJSON, + CollectionsRemoveUserRequestFromJSON, + CollectionsRemoveUserRequestToJSON, + CollectionsUpdateRequestFromJSON, + CollectionsUpdateRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface CollectionsAddGroupOperationRequest { + collectionsAddGroupRequest?: CollectionsAddGroupRequest; +} + +export interface CollectionsAddUserOperationRequest { + collectionsAddUserRequest?: CollectionsAddUserRequest; +} + +export interface CollectionsCreateOperationRequest { + collectionsCreateRequest?: CollectionsCreateRequest; +} + +export interface CollectionsDeleteOperationRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface CollectionsDocumentsRequest { + collectionsInfoRequest?: CollectionsInfoRequest; +} + +export interface CollectionsExportOperationRequest { + collectionsExportRequest?: CollectionsExportRequest; +} + +export interface CollectionsExportAllOperationRequest { + collectionsExportAllRequest?: CollectionsExportAllRequest; +} + +export interface CollectionsGroupMembershipsOperationRequest { + collectionsGroupMembershipsRequest?: CollectionsGroupMembershipsRequest; +} + +export interface CollectionsInfoOperationRequest { + collectionsInfoRequest?: CollectionsInfoRequest; +} + +export interface CollectionsListOperationRequest { + collectionsListRequest?: CollectionsListRequest; +} + +export interface CollectionsMembershipsOperationRequest { + collectionsMembershipsRequest?: CollectionsMembershipsRequest; +} + +export interface CollectionsRemoveGroupOperationRequest { + collectionsRemoveGroupRequest?: CollectionsRemoveGroupRequest; +} + +export interface CollectionsRemoveUserOperationRequest { + collectionsRemoveUserRequest?: CollectionsRemoveUserRequest; +} + +export interface CollectionsUpdateOperationRequest { + collectionsUpdateRequest?: CollectionsUpdateRequest; +} + +/** + * + */ +export class CollectionsApi extends runtime.BaseAPI { + + /** + * This method allows you to give all members in a group access to a collection. + * Add a group to a collection + */ + async collectionsAddGroupRaw(requestParameters: CollectionsAddGroupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.add_group`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsAddGroupRequestToJSON(requestParameters['collectionsAddGroupRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsAddGroup200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to give all members in a group access to a collection. + * Add a group to a collection + */ + async collectionsAddGroup(requestParameters: CollectionsAddGroupOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsAddGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to add a user membership to the specified collection. + * Add a collection user + */ + async collectionsAddUserRaw(requestParameters: CollectionsAddUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.add_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsAddUserRequestToJSON(requestParameters['collectionsAddUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsAddUser200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to add a user membership to the specified collection. + * Add a collection user + */ + async collectionsAddUser(requestParameters: CollectionsAddUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsAddUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a collection + */ + async collectionsCreateRaw(requestParameters: CollectionsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsCreateRequestToJSON(requestParameters['collectionsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Create a collection + */ + async collectionsCreate(requestParameters: CollectionsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a collection and all of its documents. This action can’t be undone so please be careful. + * Delete a collection + */ + async collectionsDeleteRaw(requestParameters: CollectionsDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Delete a collection and all of its documents. This action can’t be undone so please be careful. + * Delete a collection + */ + async collectionsDelete(requestParameters: CollectionsDeleteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a collections document structure + */ + async collectionsDocumentsRaw(requestParameters: CollectionsDocumentsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.documents`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsInfoRequestToJSON(requestParameters['collectionsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsDocuments200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a collections document structure + */ + async collectionsDocuments(requestParameters: CollectionsDocumentsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsDocumentsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Triggers a bulk export of the collection in markdown format and their attachments. If documents are nested then they will be nested in folders inside the zip file. The endpoint returns a `FileOperation` that can be queried to track the progress of the export and get the url for the final file. + * Export a collection + */ + async collectionsExportRaw(requestParameters: CollectionsExportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.export`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsExportRequestToJSON(requestParameters['collectionsExportRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsExport200ResponseFromJSON(jsonValue)); + } + + /** + * Triggers a bulk export of the collection in markdown format and their attachments. If documents are nested then they will be nested in folders inside the zip file. The endpoint returns a `FileOperation` that can be queried to track the progress of the export and get the url for the final file. + * Export a collection + */ + async collectionsExport(requestParameters: CollectionsExportOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsExportRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Triggers a bulk export of all documents in and their attachments. The endpoint returns a `FileOperation` that can be queried through the fileOperations endpoint to track the progress of the export and get the url for the final file. + * Export all collections + */ + async collectionsExportAllRaw(requestParameters: CollectionsExportAllOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.export_all`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsExportAllRequestToJSON(requestParameters['collectionsExportAllRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsExport200ResponseFromJSON(jsonValue)); + } + + /** + * Triggers a bulk export of all documents in and their attachments. The endpoint returns a `FileOperation` that can be queried through the fileOperations endpoint to track the progress of the export and get the url for the final file. + * Export all collections + */ + async collectionsExportAll(requestParameters: CollectionsExportAllOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsExportAllRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to list a collections group memberships. This is the list of groups that have been given access to the collection. + * List all collection group members + */ + async collectionsGroupMembershipsRaw(requestParameters: CollectionsGroupMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.group_memberships`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsGroupMembershipsRequestToJSON(requestParameters['collectionsGroupMembershipsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsGroupMemberships200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to list a collections group memberships. This is the list of groups that have been given access to the collection. + * List all collection group members + */ + async collectionsGroupMemberships(requestParameters: CollectionsGroupMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsGroupMembershipsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a collection + */ + async collectionsInfoRaw(requestParameters: CollectionsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsInfoRequestToJSON(requestParameters['collectionsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a collection + */ + async collectionsInfo(requestParameters: CollectionsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all collections + */ + async collectionsListRaw(requestParameters: CollectionsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsListRequestToJSON(requestParameters['collectionsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all collections + */ + async collectionsList(requestParameters: CollectionsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to list a collections individual memberships. It\'s important to note that memberships returned from this endpoint do not include group memberships. + * List all collection memberships + */ + async collectionsMembershipsRaw(requestParameters: CollectionsMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.memberships`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsMembershipsRequestToJSON(requestParameters['collectionsMembershipsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsMemberships200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to list a collections individual memberships. It\'s important to note that memberships returned from this endpoint do not include group memberships. + * List all collection memberships + */ + async collectionsMemberships(requestParameters: CollectionsMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsMembershipsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to revoke all members in a group access to a collection. Note that members of the group may still retain access through other groups or individual memberships. + * Remove a collection group + */ + async collectionsRemoveGroupRaw(requestParameters: CollectionsRemoveGroupOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.remove_group`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsRemoveGroupRequestToJSON(requestParameters['collectionsRemoveGroupRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to revoke all members in a group access to a collection. Note that members of the group may still retain access through other groups or individual memberships. + * Remove a collection group + */ + async collectionsRemoveGroup(requestParameters: CollectionsRemoveGroupOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsRemoveGroupRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to remove a user from the specified collection. + * Remove a collection user + */ + async collectionsRemoveUserRaw(requestParameters: CollectionsRemoveUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.remove_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsRemoveUserRequestToJSON(requestParameters['collectionsRemoveUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to remove a user from the specified collection. + * Remove a collection user + */ + async collectionsRemoveUser(requestParameters: CollectionsRemoveUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsRemoveUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a collection + */ + async collectionsUpdateRaw(requestParameters: CollectionsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/collections.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsUpdateRequestToJSON(requestParameters['collectionsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Update a collection + */ + async collectionsUpdate(requestParameters: CollectionsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.collectionsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/CommentsApi.ts b/src/gen/api/outline/apis/CommentsApi.ts new file mode 100644 index 0000000..114cd9d --- /dev/null +++ b/src/gen/api/outline/apis/CommentsApi.ts @@ -0,0 +1,312 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsDeleteRequest, + CommentsCreate200Response, + CommentsCreateRequest, + CommentsInfo200Response, + CommentsInfoRequest, + CommentsList200Response, + CommentsListRequest, + CommentsUpdateRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + CommentsCreate200ResponseFromJSON, + CommentsCreate200ResponseToJSON, + CommentsCreateRequestFromJSON, + CommentsCreateRequestToJSON, + CommentsInfo200ResponseFromJSON, + CommentsInfo200ResponseToJSON, + CommentsInfoRequestFromJSON, + CommentsInfoRequestToJSON, + CommentsList200ResponseFromJSON, + CommentsList200ResponseToJSON, + CommentsListRequestFromJSON, + CommentsListRequestToJSON, + CommentsUpdateRequestFromJSON, + CommentsUpdateRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface CommentsCreateOperationRequest { + commentsCreateRequest?: CommentsCreateRequest; +} + +export interface CommentsDeleteRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface CommentsInfoOperationRequest { + commentsInfoRequest?: CommentsInfoRequest; +} + +export interface CommentsListOperationRequest { + commentsListRequest?: CommentsListRequest; +} + +export interface CommentsUpdateOperationRequest { + commentsUpdateRequest?: CommentsUpdateRequest; +} + +/** + * + */ +export class CommentsApi extends runtime.BaseAPI { + + /** + * Add a comment or reply to a document, either `data` or `text` is required. + * Create a comment + */ + async commentsCreateRaw(requestParameters: CommentsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/comments.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CommentsCreateRequestToJSON(requestParameters['commentsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CommentsCreate200ResponseFromJSON(jsonValue)); + } + + /** + * Add a comment or reply to a document, either `data` or `text` is required. + * Create a comment + */ + async commentsCreate(requestParameters: CommentsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commentsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deletes a comment. If the comment is a top-level comment, all its children will be deleted as well. + * Delete a comment + */ + async commentsDeleteRaw(requestParameters: CommentsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/comments.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Deletes a comment. If the comment is a top-level comment, all its children will be deleted as well. + * Delete a comment + */ + async commentsDelete(requestParameters: CommentsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commentsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a comment + * Retrieve a comment + */ + async commentsInfoRaw(requestParameters: CommentsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/comments.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CommentsInfoRequestToJSON(requestParameters['commentsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CommentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a comment + * Retrieve a comment + */ + async commentsInfo(requestParameters: CommentsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commentsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method will list all comments matching the given properties. + * List all comments + */ + async commentsListRaw(requestParameters: CommentsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/comments.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CommentsListRequestToJSON(requestParameters['commentsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CommentsList200ResponseFromJSON(jsonValue)); + } + + /** + * This method will list all comments matching the given properties. + * List all comments + */ + async commentsList(requestParameters: CommentsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commentsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a comment + * Update a comment + */ + async commentsUpdateRaw(requestParameters: CommentsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/comments.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CommentsUpdateRequestToJSON(requestParameters['commentsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CommentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Update a comment + * Update a comment + */ + async commentsUpdate(requestParameters: CommentsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.commentsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/DocumentsApi.ts b/src/gen/api/outline/apis/DocumentsApi.ts new file mode 100644 index 0000000..bee5f80 --- /dev/null +++ b/src/gen/api/outline/apis/DocumentsApi.ts @@ -0,0 +1,1175 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsAddUser200Response, + CollectionsDeleteRequest, + CollectionsMemberships200Response, + DocumentsAddUserRequest, + DocumentsAnswerquestion200Response, + DocumentsAnswerquestionRequest, + DocumentsCreateRequest, + DocumentsDeleteRequest, + DocumentsDraftsRequest, + DocumentsExport200Response, + DocumentsExportRequest, + DocumentsInfo200Response, + DocumentsInfoRequest, + DocumentsList200Response, + DocumentsListRequest, + DocumentsMembershipsRequest, + DocumentsMove200Response, + DocumentsMoveRequest, + DocumentsRemoveUserRequest, + DocumentsRestoreRequest, + DocumentsSearch200Response, + DocumentsSearchRequest, + DocumentsUnpublishRequest, + DocumentsUpdateRequest, + DocumentsUsers200Response, + DocumentsUsersRequest, + DocumentsViewedRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsAddUser200ResponseFromJSON, + CollectionsAddUser200ResponseToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + CollectionsMemberships200ResponseFromJSON, + CollectionsMemberships200ResponseToJSON, + DocumentsAddUserRequestFromJSON, + DocumentsAddUserRequestToJSON, + DocumentsAnswerquestion200ResponseFromJSON, + DocumentsAnswerquestion200ResponseToJSON, + DocumentsAnswerquestionRequestFromJSON, + DocumentsAnswerquestionRequestToJSON, + DocumentsCreateRequestFromJSON, + DocumentsCreateRequestToJSON, + DocumentsDeleteRequestFromJSON, + DocumentsDeleteRequestToJSON, + DocumentsDraftsRequestFromJSON, + DocumentsDraftsRequestToJSON, + DocumentsExport200ResponseFromJSON, + DocumentsExport200ResponseToJSON, + DocumentsExportRequestFromJSON, + DocumentsExportRequestToJSON, + DocumentsInfo200ResponseFromJSON, + DocumentsInfo200ResponseToJSON, + DocumentsInfoRequestFromJSON, + DocumentsInfoRequestToJSON, + DocumentsList200ResponseFromJSON, + DocumentsList200ResponseToJSON, + DocumentsListRequestFromJSON, + DocumentsListRequestToJSON, + DocumentsMembershipsRequestFromJSON, + DocumentsMembershipsRequestToJSON, + DocumentsMove200ResponseFromJSON, + DocumentsMove200ResponseToJSON, + DocumentsMoveRequestFromJSON, + DocumentsMoveRequestToJSON, + DocumentsRemoveUserRequestFromJSON, + DocumentsRemoveUserRequestToJSON, + DocumentsRestoreRequestFromJSON, + DocumentsRestoreRequestToJSON, + DocumentsSearch200ResponseFromJSON, + DocumentsSearch200ResponseToJSON, + DocumentsSearchRequestFromJSON, + DocumentsSearchRequestToJSON, + DocumentsUnpublishRequestFromJSON, + DocumentsUnpublishRequestToJSON, + DocumentsUpdateRequestFromJSON, + DocumentsUpdateRequestToJSON, + DocumentsUsers200ResponseFromJSON, + DocumentsUsers200ResponseToJSON, + DocumentsUsersRequestFromJSON, + DocumentsUsersRequestToJSON, + DocumentsViewedRequestFromJSON, + DocumentsViewedRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface DocumentsAddUserOperationRequest { + documentsAddUserRequest?: DocumentsAddUserRequest; +} + +export interface DocumentsAnswerquestionOperationRequest { + documentsAnswerquestionRequest?: DocumentsAnswerquestionRequest; +} + +export interface DocumentsArchiveRequest { + documentsUnpublishRequest?: DocumentsUnpublishRequest; +} + +export interface DocumentsCreateOperationRequest { + documentsCreateRequest?: DocumentsCreateRequest; +} + +export interface DocumentsDeleteOperationRequest { + documentsDeleteRequest?: DocumentsDeleteRequest; +} + +export interface DocumentsDraftsOperationRequest { + documentsDraftsRequest?: DocumentsDraftsRequest; +} + +export interface DocumentsExportOperationRequest { + documentsExportRequest?: DocumentsExportRequest; +} + +export interface DocumentsImportRequest { + file: object; + collectionId?: string; + parentDocumentId?: string; + template?: boolean; + publish?: boolean; +} + +export interface DocumentsInfoOperationRequest { + documentsInfoRequest?: DocumentsInfoRequest; +} + +export interface DocumentsListOperationRequest { + documentsListRequest?: DocumentsListRequest; +} + +export interface DocumentsMembershipsOperationRequest { + documentsMembershipsRequest?: DocumentsMembershipsRequest; +} + +export interface DocumentsMoveOperationRequest { + documentsMoveRequest?: DocumentsMoveRequest; +} + +export interface DocumentsRemoveUserOperationRequest { + documentsRemoveUserRequest?: DocumentsRemoveUserRequest; +} + +export interface DocumentsRestoreOperationRequest { + documentsRestoreRequest?: DocumentsRestoreRequest; +} + +export interface DocumentsSearchOperationRequest { + documentsSearchRequest?: DocumentsSearchRequest; +} + +export interface DocumentsTemplatizeRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface DocumentsUnpublishOperationRequest { + documentsUnpublishRequest?: DocumentsUnpublishRequest; +} + +export interface DocumentsUpdateOperationRequest { + documentsUpdateRequest?: DocumentsUpdateRequest; +} + +export interface DocumentsUsersOperationRequest { + documentsUsersRequest?: DocumentsUsersRequest; +} + +export interface DocumentsViewedOperationRequest { + documentsViewedRequest?: DocumentsViewedRequest; +} + +/** + * + */ +export class DocumentsApi extends runtime.BaseAPI { + + /** + * This method allows you to add a user membership to the specified document. + * Add a document user + */ + async documentsAddUserRaw(requestParameters: DocumentsAddUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.add_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsAddUserRequestToJSON(requestParameters['documentsAddUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsAddUser200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to add a user membership to the specified document. + * Add a document user + */ + async documentsAddUser(requestParameters: DocumentsAddUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsAddUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows asking direct questions of your documents – where possible an answer will be provided. Search results will be restricted to those accessible by the current access token. Note that \"AI answers\" must be enabled for the workspace. + * Query documents with natural language + */ + async documentsAnswerquestionRaw(requestParameters: DocumentsAnswerquestionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.answerQuestion`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsAnswerquestionRequestToJSON(requestParameters['documentsAnswerquestionRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsAnswerquestion200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows asking direct questions of your documents – where possible an answer will be provided. Search results will be restricted to those accessible by the current access token. Note that \"AI answers\" must be enabled for the workspace. + * Query documents with natural language + */ + async documentsAnswerquestion(requestParameters: DocumentsAnswerquestionOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsAnswerquestionRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Archiving a document allows outdated information to be moved out of sight whilst retaining the ability to optionally search and restore it later. + * Archive a document + */ + async documentsArchiveRaw(requestParameters: DocumentsArchiveRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.archive`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsUnpublishRequestToJSON(requestParameters['documentsUnpublishRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Archiving a document allows outdated information to be moved out of sight whilst retaining the ability to optionally search and restore it later. + * Archive a document + */ + async documentsArchive(requestParameters: DocumentsArchiveRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsArchiveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to create or publish a new document. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document. + * Create a document + */ + async documentsCreateRaw(requestParameters: DocumentsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsCreateRequestToJSON(requestParameters['documentsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to create or publish a new document. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document. + * Create a document + */ + async documentsCreate(requestParameters: DocumentsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deleting a document moves it to the trash. If not restored within 30 days it is permenantly deleted. + * Delete a document + */ + async documentsDeleteRaw(requestParameters: DocumentsDeleteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsDeleteRequestToJSON(requestParameters['documentsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Deleting a document moves it to the trash. If not restored within 30 days it is permenantly deleted. + * Delete a document + */ + async documentsDelete(requestParameters: DocumentsDeleteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method will list all draft documents belonging to the current user. + * List all draft documents + */ + async documentsDraftsRaw(requestParameters: DocumentsDraftsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.drafts`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsDraftsRequestToJSON(requestParameters['documentsDraftsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsList200ResponseFromJSON(jsonValue)); + } + + /** + * This method will list all draft documents belonging to the current user. + * List all draft documents + */ + async documentsDrafts(requestParameters: DocumentsDraftsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsDraftsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Export a document as markdown + */ + async documentsExportRaw(requestParameters: DocumentsExportOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.export`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsExportRequestToJSON(requestParameters['documentsExportRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsExport200ResponseFromJSON(jsonValue)); + } + + /** + * Export a document as markdown + */ + async documentsExport(requestParameters: DocumentsExportOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsExportRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to create a new document by importing an existing file. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document. + * Import a file as a document + */ + async documentsImportRaw(requestParameters: DocumentsImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + if (requestParameters['file'] == null) { + throw new runtime.RequiredError( + 'file', + 'Required parameter "file" was null or undefined when calling documentsImport().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any): any }; + let useForm = false; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['file'] != null) { + formParams.append('file', new Blob([JSON.stringify(DocumentsInfo200ResponseToJSON(requestParameters['file']))], { type: "application/json", })); + } + + if (requestParameters['collectionId'] != null) { + formParams.append('collectionId', requestParameters['collectionId'] as any); + } + + if (requestParameters['parentDocumentId'] != null) { + formParams.append('parentDocumentId', requestParameters['parentDocumentId'] as any); + } + + if (requestParameters['template'] != null) { + formParams.append('template', requestParameters['template'] as any); + } + + if (requestParameters['publish'] != null) { + formParams.append('publish', requestParameters['publish'] as any); + } + + + let urlPath = `/documents.import`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: formParams, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to create a new document by importing an existing file. By default a document is set to the collection root. If you want to create a nested/child document, you should pass parentDocumentId to set the parent document. + * Import a file as a document + */ + async documentsImport(requestParameters: DocumentsImportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsImportRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a document by its `UUID`, `urlId`, or `shareId`. At least one of these parameters must be provided. + * Retrieve a document + */ + async documentsInfoRaw(requestParameters: DocumentsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsInfoRequestToJSON(requestParameters['documentsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a document by its `UUID`, `urlId`, or `shareId`. At least one of these parameters must be provided. + * Retrieve a document + */ + async documentsInfo(requestParameters: DocumentsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method will list all published documents and draft documents belonging to the current user. + * List all documents + */ + async documentsListRaw(requestParameters: DocumentsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsListRequestToJSON(requestParameters['documentsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsList200ResponseFromJSON(jsonValue)); + } + + /** + * This method will list all published documents and draft documents belonging to the current user. + * List all documents + */ + async documentsList(requestParameters: DocumentsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Users with direct membership to a document. To list all users with access to a document use `documents.users`. + * List document memberships + */ + async documentsMembershipsRaw(requestParameters: DocumentsMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.memberships`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsMembershipsRequestToJSON(requestParameters['documentsMembershipsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => CollectionsMemberships200ResponseFromJSON(jsonValue)); + } + + /** + * Users with direct membership to a document. To list all users with access to a document use `documents.users`. + * List document memberships + */ + async documentsMemberships(requestParameters: DocumentsMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsMembershipsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Move a document to a new location or collection. If no parent document is provided, the document will be moved to the collection root. + * Move a document + */ + async documentsMoveRaw(requestParameters: DocumentsMoveOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.move`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsMoveRequestToJSON(requestParameters['documentsMoveRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsMove200ResponseFromJSON(jsonValue)); + } + + /** + * Move a document to a new location or collection. If no parent document is provided, the document will be moved to the collection root. + * Move a document + */ + async documentsMove(requestParameters: DocumentsMoveOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsMoveRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to remove a user membership from the specified document. + * Remove a document user + */ + async documentsRemoveUserRaw(requestParameters: DocumentsRemoveUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.remove_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsRemoveUserRequestToJSON(requestParameters['documentsRemoveUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to remove a user membership from the specified document. + * Remove a document user + */ + async documentsRemoveUser(requestParameters: DocumentsRemoveUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsRemoveUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * If a document has been archived or deleted, it can be restored. Optionally a revision can be passed to restore the document to a previous point in time. + * Restore a document + */ + async documentsRestoreRaw(requestParameters: DocumentsRestoreOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.restore`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsRestoreRequestToJSON(requestParameters['documentsRestoreRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * If a document has been archived or deleted, it can be restored. Optionally a revision can be passed to restore the document to a previous point in time. + * Restore a document + */ + async documentsRestore(requestParameters: DocumentsRestoreOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsRestoreRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This methods allows you to search your teams documents with keywords. Note that search results will be restricted to those accessible by the current access token. + * Search all documents + */ + async documentsSearchRaw(requestParameters: DocumentsSearchOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.search`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsSearchRequestToJSON(requestParameters['documentsSearchRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsSearch200ResponseFromJSON(jsonValue)); + } + + /** + * This methods allows you to search your teams documents with keywords. Note that search results will be restricted to those accessible by the current access token. + * Search all documents + */ + async documentsSearch(requestParameters: DocumentsSearchOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsSearchRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to createa new template using an existing document as the basis + * Create a template from a document + */ + async documentsTemplatizeRaw(requestParameters: DocumentsTemplatizeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.templatize`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to createa new template using an existing document as the basis + * Create a template from a document + */ + async documentsTemplatize(requestParameters: DocumentsTemplatizeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsTemplatizeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Unpublishing a document moves it back to a draft status and out of the collection. + * Unpublish a document + */ + async documentsUnpublishRaw(requestParameters: DocumentsUnpublishOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.unpublish`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsUnpublishRequestToJSON(requestParameters['documentsUnpublishRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Unpublishing a document moves it back to a draft status and out of the collection. + * Unpublish a document + */ + async documentsUnpublish(requestParameters: DocumentsUnpublishOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsUnpublishRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to modify an already created document + * Update a document + */ + async documentsUpdateRaw(requestParameters: DocumentsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsUpdateRequestToJSON(requestParameters['documentsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to modify an already created document + * Update a document + */ + async documentsUpdate(requestParameters: DocumentsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * All users with access to a document. To list only users with direct membership to the document use `documents.memberships` + * List document users + */ + async documentsUsersRaw(requestParameters: DocumentsUsersOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.users`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsUsersRequestToJSON(requestParameters['documentsUsersRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsUsers200ResponseFromJSON(jsonValue)); + } + + /** + * All users with access to a document. To list only users with direct membership to the document use `documents.memberships` + * List document users + */ + async documentsUsers(requestParameters: DocumentsUsersOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsUsersRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method will list all documents recently viewed by the current user. + * List all recently viewed documents + */ + async documentsViewedRaw(requestParameters: DocumentsViewedOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/documents.viewed`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: DocumentsViewedRequestToJSON(requestParameters['documentsViewedRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => DocumentsList200ResponseFromJSON(jsonValue)); + } + + /** + * This method will list all documents recently viewed by the current user. + * List all recently viewed documents + */ + async documentsViewed(requestParameters: DocumentsViewedOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.documentsViewedRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/EventsApi.ts b/src/gen/api/outline/apis/EventsApi.ts new file mode 100644 index 0000000..00642e8 --- /dev/null +++ b/src/gen/api/outline/apis/EventsApi.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + EventsList200Response, + EventsListRequest, + InlineObject, +} from '../models/index'; +import { + EventsList200ResponseFromJSON, + EventsList200ResponseToJSON, + EventsListRequestFromJSON, + EventsListRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface EventsListOperationRequest { + eventsListRequest?: EventsListRequest; +} + +/** + * + */ +export class EventsApi extends runtime.BaseAPI { + + /** + * Events are an audit trail of important events that happen in the knowledge base. + * List all events + */ + async eventsListRaw(requestParameters: EventsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/events.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: EventsListRequestToJSON(requestParameters['eventsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => EventsList200ResponseFromJSON(jsonValue)); + } + + /** + * Events are an audit trail of important events that happen in the knowledge base. + * List all events + */ + async eventsList(requestParameters: EventsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.eventsListRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/FileOperationsApi.ts b/src/gen/api/outline/apis/FileOperationsApi.ts new file mode 100644 index 0000000..4e067c0 --- /dev/null +++ b/src/gen/api/outline/apis/FileOperationsApi.ts @@ -0,0 +1,243 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + FileoperationsInfo200Response, + FileoperationsInfoRequest, + FileoperationsList200Response, + FileoperationsListRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + FileoperationsInfo200ResponseFromJSON, + FileoperationsInfo200ResponseToJSON, + FileoperationsInfoRequestFromJSON, + FileoperationsInfoRequestToJSON, + FileoperationsList200ResponseFromJSON, + FileoperationsList200ResponseToJSON, + FileoperationsListRequestFromJSON, + FileoperationsListRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface FileoperationsDeleteRequest { + fileoperationsInfoRequest?: FileoperationsInfoRequest; +} + +export interface FileoperationsInfoOperationRequest { + fileoperationsInfoRequest?: FileoperationsInfoRequest; +} + +export interface FileoperationsListOperationRequest { + fileoperationsListRequest?: FileoperationsListRequest; +} + +export interface FileoperationsRedirectRequest { + fileoperationsInfoRequest?: FileoperationsInfoRequest; +} + +/** + * + */ +export class FileOperationsApi extends runtime.BaseAPI { + + /** + * Delete a file operation + */ + async fileoperationsDeleteRaw(requestParameters: FileoperationsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/fileOperations.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Delete a file operation + */ + async fileoperationsDelete(requestParameters: FileoperationsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fileoperationsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a file operation + */ + async fileoperationsInfoRaw(requestParameters: FileoperationsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/fileOperations.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FileoperationsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a file operation + */ + async fileoperationsInfo(requestParameters: FileoperationsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fileoperationsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all file operations + */ + async fileoperationsListRaw(requestParameters: FileoperationsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/fileOperations.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: FileoperationsListRequestToJSON(requestParameters['fileoperationsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => FileoperationsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all file operations + */ + async fileoperationsList(requestParameters: FileoperationsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fileoperationsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Load the resulting file from where it is stored based on the id. A temporary, signed url with embedded credentials is generated on demand. + * Retrieve the file + */ + async fileoperationsRedirectRaw(requestParameters: FileoperationsRedirectRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/fileOperations.redirect`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: FileoperationsInfoRequestToJSON(requestParameters['fileoperationsInfoRequest']), + }, initOverrides); + + return new runtime.BlobApiResponse(response); + } + + /** + * Load the resulting file from where it is stored based on the id. A temporary, signed url with embedded credentials is generated on demand. + * Retrieve the file + */ + async fileoperationsRedirect(requestParameters: FileoperationsRedirectRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.fileoperationsRedirectRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/GroupsApi.ts b/src/gen/api/outline/apis/GroupsApi.ts new file mode 100644 index 0000000..388bf61 --- /dev/null +++ b/src/gen/api/outline/apis/GroupsApi.ts @@ -0,0 +1,472 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsDeleteRequest, + CollectionsRemoveUserRequest, + GroupsAddUser200Response, + GroupsAddUserRequest, + GroupsCreateRequest, + GroupsInfo200Response, + GroupsInfoRequest, + GroupsList200Response, + GroupsListRequest, + GroupsMemberships200Response, + GroupsMembershipsRequest, + GroupsRemoveUser200Response, + GroupsUpdateRequest, + InlineObject, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + CollectionsRemoveUserRequestFromJSON, + CollectionsRemoveUserRequestToJSON, + GroupsAddUser200ResponseFromJSON, + GroupsAddUser200ResponseToJSON, + GroupsAddUserRequestFromJSON, + GroupsAddUserRequestToJSON, + GroupsCreateRequestFromJSON, + GroupsCreateRequestToJSON, + GroupsInfo200ResponseFromJSON, + GroupsInfo200ResponseToJSON, + GroupsInfoRequestFromJSON, + GroupsInfoRequestToJSON, + GroupsList200ResponseFromJSON, + GroupsList200ResponseToJSON, + GroupsListRequestFromJSON, + GroupsListRequestToJSON, + GroupsMemberships200ResponseFromJSON, + GroupsMemberships200ResponseToJSON, + GroupsMembershipsRequestFromJSON, + GroupsMembershipsRequestToJSON, + GroupsRemoveUser200ResponseFromJSON, + GroupsRemoveUser200ResponseToJSON, + GroupsUpdateRequestFromJSON, + GroupsUpdateRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, +} from '../models/index'; + +export interface GroupsAddUserOperationRequest { + groupsAddUserRequest?: GroupsAddUserRequest; +} + +export interface GroupsCreateOperationRequest { + groupsCreateRequest?: GroupsCreateRequest; +} + +export interface GroupsDeleteRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface GroupsInfoOperationRequest { + groupsInfoRequest?: GroupsInfoRequest; +} + +export interface GroupsListOperationRequest { + groupsListRequest?: GroupsListRequest; +} + +export interface GroupsMembershipsOperationRequest { + groupsMembershipsRequest?: GroupsMembershipsRequest; +} + +export interface GroupsRemoveUserRequest { + collectionsRemoveUserRequest?: CollectionsRemoveUserRequest; +} + +export interface GroupsUpdateOperationRequest { + groupsUpdateRequest?: GroupsUpdateRequest; +} + +/** + * + */ +export class GroupsApi extends runtime.BaseAPI { + + /** + * This method allows you to add a user to the specified group. + * Add a group member + */ + async groupsAddUserRaw(requestParameters: GroupsAddUserOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.add_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsAddUserRequestToJSON(requestParameters['groupsAddUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsAddUser200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to add a user to the specified group. + * Add a group member + */ + async groupsAddUser(requestParameters: GroupsAddUserOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsAddUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Create a group + */ + async groupsCreateRaw(requestParameters: GroupsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsCreateRequestToJSON(requestParameters['groupsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Create a group + */ + async groupsCreate(requestParameters: GroupsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action can’t be undone so please be careful. + * Delete a group + */ + async groupsDeleteRaw(requestParameters: GroupsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Deleting a group will cause all of its members to lose access to any collections the group has previously been added to. This action can’t be undone so please be careful. + * Delete a group + */ + async groupsDelete(requestParameters: GroupsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a group + */ + async groupsInfoRaw(requestParameters: GroupsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsInfoRequestToJSON(requestParameters['groupsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a group + */ + async groupsInfo(requestParameters: GroupsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all groups + */ + async groupsListRaw(requestParameters: GroupsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsListRequestToJSON(requestParameters['groupsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all groups + */ + async groupsList(requestParameters: GroupsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List and filter all the members in a group. + * List all group members + */ + async groupsMembershipsRaw(requestParameters: GroupsMembershipsOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.memberships`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsMembershipsRequestToJSON(requestParameters['groupsMembershipsRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsMemberships200ResponseFromJSON(jsonValue)); + } + + /** + * List and filter all the members in a group. + * List all group members + */ + async groupsMemberships(requestParameters: GroupsMembershipsOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsMembershipsRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * This method allows you to remove a user from the group. + * Remove a group member + */ + async groupsRemoveUserRaw(requestParameters: GroupsRemoveUserRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.remove_user`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsRemoveUserRequestToJSON(requestParameters['collectionsRemoveUserRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsRemoveUser200ResponseFromJSON(jsonValue)); + } + + /** + * This method allows you to remove a user from the group. + * Remove a group member + */ + async groupsRemoveUser(requestParameters: GroupsRemoveUserRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsRemoveUserRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a group + */ + async groupsUpdateRaw(requestParameters: GroupsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/groups.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: GroupsUpdateRequestToJSON(requestParameters['groupsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => GroupsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Update a group + */ + async groupsUpdate(requestParameters: GroupsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.groupsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/OAuthClientsApi.ts b/src/gen/api/outline/apis/OAuthClientsApi.ts new file mode 100644 index 0000000..b1606f9 --- /dev/null +++ b/src/gen/api/outline/apis/OAuthClientsApi.ts @@ -0,0 +1,340 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + InlineObject, + OauthClientsCreateRequest, + OauthClientsInfo200Response, + OauthClientsInfoRequest, + OauthClientsList200Response, + OauthClientsRotateSecretRequest, + OauthClientsUpdateRequest, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, + OauthClientsCreateRequestFromJSON, + OauthClientsCreateRequestToJSON, + OauthClientsInfo200ResponseFromJSON, + OauthClientsInfo200ResponseToJSON, + OauthClientsInfoRequestFromJSON, + OauthClientsInfoRequestToJSON, + OauthClientsList200ResponseFromJSON, + OauthClientsList200ResponseToJSON, + OauthClientsRotateSecretRequestFromJSON, + OauthClientsRotateSecretRequestToJSON, + OauthClientsUpdateRequestFromJSON, + OauthClientsUpdateRequestToJSON, +} from '../models/index'; + +export interface OauthClientsCreateOperationRequest { + oauthClientsCreateRequest?: OauthClientsCreateRequest; +} + +export interface OauthClientsDeleteRequest { + oauthClientsRotateSecretRequest?: OauthClientsRotateSecretRequest; +} + +export interface OauthClientsInfoOperationRequest { + oauthClientsInfoRequest?: OauthClientsInfoRequest; +} + +export interface OauthClientsRotateSecretOperationRequest { + oauthClientsRotateSecretRequest?: OauthClientsRotateSecretRequest; +} + +export interface OauthClientsUpdateOperationRequest { + oauthClientsUpdateRequest?: OauthClientsUpdateRequest; +} + +/** + * + */ +export class OAuthClientsApi extends runtime.BaseAPI { + + /** + * Create an OAuth client + */ + async oauthClientsCreateRaw(requestParameters: OauthClientsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OauthClientsCreateRequestToJSON(requestParameters['oauthClientsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Create an OAuth client + */ + async oauthClientsCreate(requestParameters: OauthClientsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete an OAuth client + */ + async oauthClientsDeleteRaw(requestParameters: OauthClientsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OauthClientsRotateSecretRequestToJSON(requestParameters['oauthClientsRotateSecretRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Delete an OAuth client + */ + async oauthClientsDelete(requestParameters: OauthClientsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * To retrieve information about an OAuth client you must pass either an `id` or a `clientId`. + * Retrieve an OAuth client + */ + async oauthClientsInfoRaw(requestParameters: OauthClientsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OauthClientsInfoRequestToJSON(requestParameters['oauthClientsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * To retrieve information about an OAuth client you must pass either an `id` or a `clientId`. + * Retrieve an OAuth client + */ + async oauthClientsInfo(requestParameters: OauthClientsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List accessible OAuth clients + */ + async oauthClientsListRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsList200ResponseFromJSON(jsonValue)); + } + + /** + * List accessible OAuth clients + */ + async oauthClientsList(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsListRaw(initOverrides); + return await response.value(); + } + + /** + * Rotate the secret for an OAuth client + */ + async oauthClientsRotateSecretRaw(requestParameters: OauthClientsRotateSecretOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.rotate_secret`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OauthClientsRotateSecretRequestToJSON(requestParameters['oauthClientsRotateSecretRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Rotate the secret for an OAuth client + */ + async oauthClientsRotateSecret(requestParameters: OauthClientsRotateSecretOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsRotateSecretRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update an OAuth client + */ + async oauthClientsUpdateRaw(requestParameters: OauthClientsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/oauthClients.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: OauthClientsUpdateRequestToJSON(requestParameters['oauthClientsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => OauthClientsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Update an OAuth client + */ + async oauthClientsUpdate(requestParameters: OauthClientsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.oauthClientsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/RevisionsApi.ts b/src/gen/api/outline/apis/RevisionsApi.ts new file mode 100644 index 0000000..d741de0 --- /dev/null +++ b/src/gen/api/outline/apis/RevisionsApi.ts @@ -0,0 +1,142 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + InlineObject, + RevisionsInfo200Response, + RevisionsInfoRequest, + RevisionsList200Response, + RevisionsListRequest, +} from '../models/index'; +import { + InlineObjectFromJSON, + InlineObjectToJSON, + RevisionsInfo200ResponseFromJSON, + RevisionsInfo200ResponseToJSON, + RevisionsInfoRequestFromJSON, + RevisionsInfoRequestToJSON, + RevisionsList200ResponseFromJSON, + RevisionsList200ResponseToJSON, + RevisionsListRequestFromJSON, + RevisionsListRequestToJSON, +} from '../models/index'; + +export interface RevisionsInfoOperationRequest { + revisionsInfoRequest?: RevisionsInfoRequest; +} + +export interface RevisionsListOperationRequest { + revisionsListRequest?: RevisionsListRequest; +} + +/** + * + */ +export class RevisionsApi extends runtime.BaseAPI { + + /** + * A revision is a snapshot of a document at a specific point in time. This endpoint allows you to retrieve a specific version of a document by its unique identifier. + * Retrieve a revision + */ + async revisionsInfoRaw(requestParameters: RevisionsInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/revisions.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RevisionsInfoRequestToJSON(requestParameters['revisionsInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RevisionsInfo200ResponseFromJSON(jsonValue)); + } + + /** + * A revision is a snapshot of a document at a specific point in time. This endpoint allows you to retrieve a specific version of a document by its unique identifier. + * Retrieve a revision + */ + async revisionsInfo(requestParameters: RevisionsInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.revisionsInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all revisions + */ + async revisionsListRaw(requestParameters: RevisionsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/revisions.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: RevisionsListRequestToJSON(requestParameters['revisionsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => RevisionsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all revisions + */ + async revisionsList(requestParameters: RevisionsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.revisionsListRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/SharesApi.ts b/src/gen/api/outline/apis/SharesApi.ts new file mode 100644 index 0000000..8249e46 --- /dev/null +++ b/src/gen/api/outline/apis/SharesApi.ts @@ -0,0 +1,305 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsDeleteRequest, + InlineObject, + SharesCreateRequest, + SharesInfo200Response, + SharesInfoRequest, + SharesList200Response, + SharesListRequest, + SharesUpdateRequest, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, + SharesCreateRequestFromJSON, + SharesCreateRequestToJSON, + SharesInfo200ResponseFromJSON, + SharesInfo200ResponseToJSON, + SharesInfoRequestFromJSON, + SharesInfoRequestToJSON, + SharesList200ResponseFromJSON, + SharesList200ResponseToJSON, + SharesListRequestFromJSON, + SharesListRequestToJSON, + SharesUpdateRequestFromJSON, + SharesUpdateRequestToJSON, +} from '../models/index'; + +export interface SharesCreateOperationRequest { + sharesCreateRequest?: SharesCreateRequest; +} + +export interface SharesInfoOperationRequest { + sharesInfoRequest?: SharesInfoRequest; +} + +export interface SharesListOperationRequest { + sharesListRequest?: SharesListRequest; +} + +export interface SharesRevokeRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface SharesUpdateOperationRequest { + sharesUpdateRequest?: SharesUpdateRequest; +} + +/** + * + */ +export class SharesApi extends runtime.BaseAPI { + + /** + * Creates a new share link that can be used by to access a document. If you request multiple shares for the same document with the same API key, the same share object will be returned. By default all shares are unpublished. + * Create a share + */ + async sharesCreateRaw(requestParameters: SharesCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/shares.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharesCreateRequestToJSON(requestParameters['sharesCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Creates a new share link that can be used by to access a document. If you request multiple shares for the same document with the same API key, the same share object will be returned. By default all shares are unpublished. + * Create a share + */ + async sharesCreate(requestParameters: SharesCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sharesCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a share object + */ + async sharesInfoRaw(requestParameters: SharesInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/shares.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharesInfoRequestToJSON(requestParameters['sharesInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a share object + */ + async sharesInfo(requestParameters: SharesInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sharesInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all shares + */ + async sharesListRaw(requestParameters: SharesListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/shares.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharesListRequestToJSON(requestParameters['sharesListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SharesList200ResponseFromJSON(jsonValue)); + } + + /** + * List all shares + */ + async sharesList(requestParameters: SharesListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sharesListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Makes the share link inactive so that it can no longer be used to access the document. + * Revoke a share + */ + async sharesRevokeRaw(requestParameters: SharesRevokeRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/shares.revoke`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Makes the share link inactive so that it can no longer be used to access the document. + * Revoke a share + */ + async sharesRevoke(requestParameters: SharesRevokeRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sharesRevokeRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Allows changing an existing share\'s published status, which removes authentication and makes it available to anyone with the link. + * Update a share + */ + async sharesUpdateRaw(requestParameters: SharesUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/shares.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharesUpdateRequestToJSON(requestParameters['sharesUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => SharesInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Allows changing an existing share\'s published status, which removes authentication and makes it available to anyone with the link. + * Update a share + */ + async sharesUpdate(requestParameters: SharesUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.sharesUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/StarsApi.ts b/src/gen/api/outline/apis/StarsApi.ts new file mode 100644 index 0000000..69cad9f --- /dev/null +++ b/src/gen/api/outline/apis/StarsApi.ts @@ -0,0 +1,249 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + CollectionsDeleteRequest, + InlineObject, + Pagination, + StarsCreate200Response, + StarsCreateRequest, + StarsList200Response, + StarsUpdateRequest, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + CollectionsDeleteRequestFromJSON, + CollectionsDeleteRequestToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, + PaginationFromJSON, + PaginationToJSON, + StarsCreate200ResponseFromJSON, + StarsCreate200ResponseToJSON, + StarsCreateRequestFromJSON, + StarsCreateRequestToJSON, + StarsList200ResponseFromJSON, + StarsList200ResponseToJSON, + StarsUpdateRequestFromJSON, + StarsUpdateRequestToJSON, +} from '../models/index'; + +export interface StarsCreateOperationRequest { + starsCreateRequest?: StarsCreateRequest; +} + +export interface StarsDeleteRequest { + collectionsDeleteRequest?: CollectionsDeleteRequest; +} + +export interface StarsListRequest { + pagination?: Pagination; +} + +export interface StarsUpdateOperationRequest { + starsUpdateRequest?: StarsUpdateRequest; +} + +/** + * + */ +export class StarsApi extends runtime.BaseAPI { + + /** + * Stars a document or collection so it appears in the users sidebar. One of either `documentId` or `collectionId` must be provided. + * Create a star + */ + async starsCreateRaw(requestParameters: StarsCreateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/stars.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: StarsCreateRequestToJSON(requestParameters['starsCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => StarsCreate200ResponseFromJSON(jsonValue)); + } + + /** + * Stars a document or collection so it appears in the users sidebar. One of either `documentId` or `collectionId` must be provided. + * Create a star + */ + async starsCreate(requestParameters: StarsCreateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.starsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Delete a star + */ + async starsDeleteRaw(requestParameters: StarsDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/stars.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: CollectionsDeleteRequestToJSON(requestParameters['collectionsDeleteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Delete a star + */ + async starsDelete(requestParameters: StarsDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.starsDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all stars + */ + async starsListRaw(requestParameters: StarsListRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/stars.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: PaginationToJSON(requestParameters['pagination']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => StarsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all stars + */ + async starsList(requestParameters: StarsListRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.starsListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a stars order in the sidebar + */ + async starsUpdateRaw(requestParameters: StarsUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/stars.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: StarsUpdateRequestToJSON(requestParameters['starsUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => StarsCreate200ResponseFromJSON(jsonValue)); + } + + /** + * Update a stars order in the sidebar + */ + async starsUpdate(requestParameters: StarsUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.starsUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/UsersApi.ts b/src/gen/api/outline/apis/UsersApi.ts new file mode 100644 index 0000000..34f470a --- /dev/null +++ b/src/gen/api/outline/apis/UsersApi.ts @@ -0,0 +1,461 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AttachmentsDelete200Response, + InlineObject, + UsersInfo200Response, + UsersInfoRequest, + UsersInvite200Response, + UsersInviteRequest, + UsersList200Response, + UsersListRequest, + UsersUpdateRequest, + UsersUpdateRoleRequest, +} from '../models/index'; +import { + AttachmentsDelete200ResponseFromJSON, + AttachmentsDelete200ResponseToJSON, + InlineObjectFromJSON, + InlineObjectToJSON, + UsersInfo200ResponseFromJSON, + UsersInfo200ResponseToJSON, + UsersInfoRequestFromJSON, + UsersInfoRequestToJSON, + UsersInvite200ResponseFromJSON, + UsersInvite200ResponseToJSON, + UsersInviteRequestFromJSON, + UsersInviteRequestToJSON, + UsersList200ResponseFromJSON, + UsersList200ResponseToJSON, + UsersListRequestFromJSON, + UsersListRequestToJSON, + UsersUpdateRequestFromJSON, + UsersUpdateRequestToJSON, + UsersUpdateRoleRequestFromJSON, + UsersUpdateRoleRequestToJSON, +} from '../models/index'; + +export interface UsersActivateRequest { + usersInfoRequest?: UsersInfoRequest; +} + +export interface UsersDeleteRequest { + usersInfoRequest?: UsersInfoRequest; +} + +export interface UsersInfoOperationRequest { + usersInfoRequest?: UsersInfoRequest; +} + +export interface UsersInviteOperationRequest { + usersInviteRequest?: UsersInviteRequest; +} + +export interface UsersListOperationRequest { + usersListRequest?: UsersListRequest; +} + +export interface UsersSuspendRequest { + usersInfoRequest?: UsersInfoRequest; +} + +export interface UsersUpdateOperationRequest { + usersUpdateRequest?: UsersUpdateRequest; +} + +export interface UsersUpdateRoleOperationRequest { + usersUpdateRoleRequest?: UsersUpdateRoleRequest; +} + +/** + * + */ +export class UsersApi extends runtime.BaseAPI { + + /** + * Activating a previously suspended user allows them to signin again. Users that are activated will cause billing totals to be re-calculated in the hosted version. + * Activate a user + */ + async usersActivateRaw(requestParameters: UsersActivateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.activate`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Activating a previously suspended user allows them to signin again. Users that are activated will cause billing totals to be re-calculated in the hosted version. + * Activate a user + */ + async usersActivate(requestParameters: UsersActivateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersActivateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again. + * Delete a user + */ + async usersDeleteRaw(requestParameters: UsersDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.delete`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentsDelete200ResponseFromJSON(jsonValue)); + } + + /** + * Deleting a user removes the object entirely. In almost every circumstance it is preferable to suspend a user, as a deleted user can be recreated by signing in with SSO again. + * Delete a user + */ + async usersDelete(requestParameters: UsersDeleteRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersDeleteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Retrieve a user + */ + async usersInfoRaw(requestParameters: UsersInfoOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.info`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Retrieve a user + */ + async usersInfo(requestParameters: UsersInfoOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersInfoRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Invite users + */ + async usersInviteRaw(requestParameters: UsersInviteOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.invite`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersInviteRequestToJSON(requestParameters['usersInviteRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInvite200ResponseFromJSON(jsonValue)); + } + + /** + * Invite users + */ + async usersInvite(requestParameters: UsersInviteOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersInviteRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List and filter all the users in the team + * List all users + */ + async usersListRaw(requestParameters: UsersListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersListRequestToJSON(requestParameters['usersListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersList200ResponseFromJSON(jsonValue)); + } + + /** + * List and filter all the users in the team + * List all users + */ + async usersList(requestParameters: UsersListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersListRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Suspending a user prevents the user from signing in. Users that are suspended are also not counted against billing totals in the hosted version. + * Suspend a user + */ + async usersSuspendRaw(requestParameters: UsersSuspendRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.suspend`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersInfoRequestToJSON(requestParameters['usersInfoRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Suspending a user prevents the user from signing in. Users that are suspended are also not counted against billing totals in the hosted version. + * Suspend a user + */ + async usersSuspend(requestParameters: UsersSuspendRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersSuspendRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Update a users name or avatar. If no `id` is passed then the user associated with the authentication will be updated by default. + * Update a user + */ + async usersUpdateRaw(requestParameters: UsersUpdateOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.update`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersUpdateRequestToJSON(requestParameters['usersUpdateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Update a users name or avatar. If no `id` is passed then the user associated with the authentication will be updated by default. + * Update a user + */ + async usersUpdate(requestParameters: UsersUpdateOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersUpdateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * Change the role of a user, only available to admin authorization. + * Change a users role + */ + async usersUpdateRoleRaw(requestParameters: UsersUpdateRoleOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/users.update_role`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: UsersUpdateRoleRequestToJSON(requestParameters['usersUpdateRoleRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => UsersInfo200ResponseFromJSON(jsonValue)); + } + + /** + * Change the role of a user, only available to admin authorization. + * Change a users role + */ + async usersUpdateRole(requestParameters: UsersUpdateRoleOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.usersUpdateRoleRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/ViewsApi.ts b/src/gen/api/outline/apis/ViewsApi.ts new file mode 100644 index 0000000..1513e3c --- /dev/null +++ b/src/gen/api/outline/apis/ViewsApi.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + InlineObject, + SharesCreateRequest, + ViewsCreate200Response, + ViewsList200Response, + ViewsListRequest, +} from '../models/index'; +import { + InlineObjectFromJSON, + InlineObjectToJSON, + SharesCreateRequestFromJSON, + SharesCreateRequestToJSON, + ViewsCreate200ResponseFromJSON, + ViewsCreate200ResponseToJSON, + ViewsList200ResponseFromJSON, + ViewsList200ResponseToJSON, + ViewsListRequestFromJSON, + ViewsListRequestToJSON, +} from '../models/index'; + +export interface ViewsCreateRequest { + sharesCreateRequest?: SharesCreateRequest; +} + +export interface ViewsListOperationRequest { + viewsListRequest?: ViewsListRequest; +} + +/** + * + */ +export class ViewsApi extends runtime.BaseAPI { + + /** + * Creates a new view for a document. This is documented in the interests of thoroughness however it is recommended that views are not created from outside of the Outline UI. + * Create a view + */ + async viewsCreateRaw(requestParameters: ViewsCreateRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/views.create`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: SharesCreateRequestToJSON(requestParameters['sharesCreateRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ViewsCreate200ResponseFromJSON(jsonValue)); + } + + /** + * Creates a new view for a document. This is documented in the interests of thoroughness however it is recommended that views are not created from outside of the Outline UI. + * Create a view + */ + async viewsCreate(requestParameters: ViewsCreateRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.viewsCreateRaw(requestParameters, initOverrides); + return await response.value(); + } + + /** + * List all users that have viewed a document and the overall view count. + * List all views + */ + async viewsListRaw(requestParameters: ViewsListOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.accessToken) { + // oauth required + headerParameters["Authorization"] = await this.configuration.accessToken("OAuth2", ["read", "write"]); + } + + if (this.configuration && this.configuration.accessToken) { + const token = this.configuration.accessToken; + const tokenString = await token("BearerAuth", []); + + if (tokenString) { + headerParameters["Authorization"] = `Bearer ${tokenString}`; + } + } + + let urlPath = `/views.list`; + + const response = await this.request({ + path: urlPath, + method: 'POST', + headers: headerParameters, + query: queryParameters, + body: ViewsListRequestToJSON(requestParameters['viewsListRequest']), + }, initOverrides); + + return new runtime.JSONApiResponse(response, (jsonValue) => ViewsList200ResponseFromJSON(jsonValue)); + } + + /** + * List all users that have viewed a document and the overall view count. + * List all views + */ + async viewsList(requestParameters: ViewsListOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise { + const response = await this.viewsListRaw(requestParameters, initOverrides); + return await response.value(); + } + +} diff --git a/src/gen/api/outline/apis/index.ts b/src/gen/api/outline/apis/index.ts new file mode 100644 index 0000000..b1405a3 --- /dev/null +++ b/src/gen/api/outline/apis/index.ts @@ -0,0 +1,16 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './AttachmentsApi'; +export * from './AuthApi'; +export * from './CollectionsApi'; +export * from './CommentsApi'; +export * from './DocumentsApi'; +export * from './EventsApi'; +export * from './FileOperationsApi'; +export * from './GroupsApi'; +export * from './OAuthClientsApi'; +export * from './RevisionsApi'; +export * from './SharesApi'; +export * from './StarsApi'; +export * from './UsersApi'; +export * from './ViewsApi'; diff --git a/src/gen/api/outline/index.ts b/src/gen/api/outline/index.ts new file mode 100644 index 0000000..bebe8bb --- /dev/null +++ b/src/gen/api/outline/index.ts @@ -0,0 +1,5 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './apis/index'; +export * from './models/index'; diff --git a/src/gen/api/outline/models/Ability.ts b/src/gen/api/outline/models/Ability.ts new file mode 100644 index 0000000..c1ad1b0 --- /dev/null +++ b/src/gen/api/outline/models/Ability.ts @@ -0,0 +1,45 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +/** + * @type Ability + * A single permission granted by a policy + * @export + */ +export type Ability = Array | boolean; + +export function AbilityFromJSON(json: any): Ability { + return AbilityFromJSONTyped(json, false); +} + +export function AbilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Ability { + if (json == null) { + return json; + } + + return {} as any; +} + +export function AbilityToJSON(json: any): any { + return AbilityToJSONTyped(json, false); +} + +export function AbilityToJSONTyped(value?: Ability | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return {}; +} + diff --git a/src/gen/api/outline/models/Attachment.ts b/src/gen/api/outline/models/Attachment.ts new file mode 100644 index 0000000..7baff94 --- /dev/null +++ b/src/gen/api/outline/models/Attachment.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Attachment + */ +export interface Attachment { + /** + * + * @type {string} + * @memberof Attachment + */ + contentType?: string; + /** + * + * @type {number} + * @memberof Attachment + */ + size?: number; + /** + * + * @type {string} + * @memberof Attachment + */ + name?: string; + /** + * + * @type {string} + * @memberof Attachment + */ + url?: string; + /** + * Identifier for the associated document, if any. + * @type {string} + * @memberof Attachment + */ + documentId?: string; +} + +/** + * Check if a given object implements the Attachment interface. + */ +export function instanceOfAttachment(value: object): value is Attachment { + return true; +} + +export function AttachmentFromJSON(json: any): Attachment { + return AttachmentFromJSONTyped(json, false); +} + +export function AttachmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachment { + if (json == null) { + return json; + } + return { + + 'contentType': json['contentType'] == null ? undefined : json['contentType'], + 'size': json['size'] == null ? undefined : json['size'], + 'name': json['name'] == null ? undefined : json['name'], + 'url': json['url'] == null ? undefined : json['url'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + }; +} + +export function AttachmentToJSON(json: any): Attachment { + return AttachmentToJSONTyped(json, false); +} + +export function AttachmentToJSONTyped(value?: Attachment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'contentType': value['contentType'], + 'size': value['size'], + 'name': value['name'], + 'url': value['url'], + 'documentId': value['documentId'], + }; +} + diff --git a/src/gen/api/outline/models/AttachmentsCreate200Response.ts b/src/gen/api/outline/models/AttachmentsCreate200Response.ts new file mode 100644 index 0000000..4291704 --- /dev/null +++ b/src/gen/api/outline/models/AttachmentsCreate200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AttachmentsCreate200ResponseData } from './AttachmentsCreate200ResponseData'; +import { + AttachmentsCreate200ResponseDataFromJSON, + AttachmentsCreate200ResponseDataFromJSONTyped, + AttachmentsCreate200ResponseDataToJSON, + AttachmentsCreate200ResponseDataToJSONTyped, +} from './AttachmentsCreate200ResponseData'; + +/** + * + * @export + * @interface AttachmentsCreate200Response + */ +export interface AttachmentsCreate200Response { + /** + * + * @type {AttachmentsCreate200ResponseData} + * @memberof AttachmentsCreate200Response + */ + data?: AttachmentsCreate200ResponseData; +} + +/** + * Check if a given object implements the AttachmentsCreate200Response interface. + */ +export function instanceOfAttachmentsCreate200Response(value: object): value is AttachmentsCreate200Response { + return true; +} + +export function AttachmentsCreate200ResponseFromJSON(json: any): AttachmentsCreate200Response { + return AttachmentsCreate200ResponseFromJSONTyped(json, false); +} + +export function AttachmentsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : AttachmentsCreate200ResponseDataFromJSON(json['data']), + }; +} + +export function AttachmentsCreate200ResponseToJSON(json: any): AttachmentsCreate200Response { + return AttachmentsCreate200ResponseToJSONTyped(json, false); +} + +export function AttachmentsCreate200ResponseToJSONTyped(value?: AttachmentsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': AttachmentsCreate200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/AttachmentsCreate200ResponseData.ts b/src/gen/api/outline/models/AttachmentsCreate200ResponseData.ts new file mode 100644 index 0000000..f4d1848 --- /dev/null +++ b/src/gen/api/outline/models/AttachmentsCreate200ResponseData.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Attachment } from './Attachment'; +import { + AttachmentFromJSON, + AttachmentFromJSONTyped, + AttachmentToJSON, + AttachmentToJSONTyped, +} from './Attachment'; + +/** + * + * @export + * @interface AttachmentsCreate200ResponseData + */ +export interface AttachmentsCreate200ResponseData { + /** + * + * @type {number} + * @memberof AttachmentsCreate200ResponseData + */ + maxUploadSize?: number; + /** + * + * @type {string} + * @memberof AttachmentsCreate200ResponseData + */ + uploadUrl?: string; + /** + * + * @type {object} + * @memberof AttachmentsCreate200ResponseData + */ + form?: object; + /** + * + * @type {Attachment} + * @memberof AttachmentsCreate200ResponseData + */ + attachment?: Attachment; +} + +/** + * Check if a given object implements the AttachmentsCreate200ResponseData interface. + */ +export function instanceOfAttachmentsCreate200ResponseData(value: object): value is AttachmentsCreate200ResponseData { + return true; +} + +export function AttachmentsCreate200ResponseDataFromJSON(json: any): AttachmentsCreate200ResponseData { + return AttachmentsCreate200ResponseDataFromJSONTyped(json, false); +} + +export function AttachmentsCreate200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreate200ResponseData { + if (json == null) { + return json; + } + return { + + 'maxUploadSize': json['maxUploadSize'] == null ? undefined : json['maxUploadSize'], + 'uploadUrl': json['uploadUrl'] == null ? undefined : json['uploadUrl'], + 'form': json['form'] == null ? undefined : json['form'], + 'attachment': json['attachment'] == null ? undefined : AttachmentFromJSON(json['attachment']), + }; +} + +export function AttachmentsCreate200ResponseDataToJSON(json: any): AttachmentsCreate200ResponseData { + return AttachmentsCreate200ResponseDataToJSONTyped(json, false); +} + +export function AttachmentsCreate200ResponseDataToJSONTyped(value?: AttachmentsCreate200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'maxUploadSize': value['maxUploadSize'], + 'uploadUrl': value['uploadUrl'], + 'form': value['form'], + 'attachment': AttachmentToJSON(value['attachment']), + }; +} + diff --git a/src/gen/api/outline/models/AttachmentsCreateRequest.ts b/src/gen/api/outline/models/AttachmentsCreateRequest.ts new file mode 100644 index 0000000..da3f7d4 --- /dev/null +++ b/src/gen/api/outline/models/AttachmentsCreateRequest.ts @@ -0,0 +1,92 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AttachmentsCreateRequest + */ +export interface AttachmentsCreateRequest { + /** + * + * @type {string} + * @memberof AttachmentsCreateRequest + */ + name: string; + /** + * Identifier for the associated document, if any. + * @type {string} + * @memberof AttachmentsCreateRequest + */ + documentId?: string; + /** + * + * @type {string} + * @memberof AttachmentsCreateRequest + */ + contentType: string; + /** + * Size of the file attachment in bytes. + * @type {number} + * @memberof AttachmentsCreateRequest + */ + size: number; +} + +/** + * Check if a given object implements the AttachmentsCreateRequest interface. + */ +export function instanceOfAttachmentsCreateRequest(value: object): value is AttachmentsCreateRequest { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('contentType' in value) || value['contentType'] === undefined) return false; + if (!('size' in value) || value['size'] === undefined) return false; + return true; +} + +export function AttachmentsCreateRequestFromJSON(json: any): AttachmentsCreateRequest { + return AttachmentsCreateRequestFromJSONTyped(json, false); +} + +export function AttachmentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsCreateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'contentType': json['contentType'], + 'size': json['size'], + }; +} + +export function AttachmentsCreateRequestToJSON(json: any): AttachmentsCreateRequest { + return AttachmentsCreateRequestToJSONTyped(json, false); +} + +export function AttachmentsCreateRequestToJSONTyped(value?: AttachmentsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'documentId': value['documentId'], + 'contentType': value['contentType'], + 'size': value['size'], + }; +} + diff --git a/src/gen/api/outline/models/AttachmentsDelete200Response.ts b/src/gen/api/outline/models/AttachmentsDelete200Response.ts new file mode 100644 index 0000000..773f195 --- /dev/null +++ b/src/gen/api/outline/models/AttachmentsDelete200Response.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AttachmentsDelete200Response + */ +export interface AttachmentsDelete200Response { + /** + * + * @type {boolean} + * @memberof AttachmentsDelete200Response + */ + success?: boolean; +} + +/** + * Check if a given object implements the AttachmentsDelete200Response interface. + */ +export function instanceOfAttachmentsDelete200Response(value: object): value is AttachmentsDelete200Response { + return true; +} + +export function AttachmentsDelete200ResponseFromJSON(json: any): AttachmentsDelete200Response { + return AttachmentsDelete200ResponseFromJSONTyped(json, false); +} + +export function AttachmentsDelete200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsDelete200Response { + if (json == null) { + return json; + } + return { + + 'success': json['success'] == null ? undefined : json['success'], + }; +} + +export function AttachmentsDelete200ResponseToJSON(json: any): AttachmentsDelete200Response { + return AttachmentsDelete200ResponseToJSONTyped(json, false); +} + +export function AttachmentsDelete200ResponseToJSONTyped(value?: AttachmentsDelete200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'success': value['success'], + }; +} + diff --git a/src/gen/api/outline/models/AttachmentsRedirectRequest.ts b/src/gen/api/outline/models/AttachmentsRedirectRequest.ts new file mode 100644 index 0000000..c14cf18 --- /dev/null +++ b/src/gen/api/outline/models/AttachmentsRedirectRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AttachmentsRedirectRequest + */ +export interface AttachmentsRedirectRequest { + /** + * Unique identifier for the attachment. + * @type {string} + * @memberof AttachmentsRedirectRequest + */ + id: string; +} + +/** + * Check if a given object implements the AttachmentsRedirectRequest interface. + */ +export function instanceOfAttachmentsRedirectRequest(value: object): value is AttachmentsRedirectRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function AttachmentsRedirectRequestFromJSON(json: any): AttachmentsRedirectRequest { + return AttachmentsRedirectRequestFromJSONTyped(json, false); +} + +export function AttachmentsRedirectRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AttachmentsRedirectRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function AttachmentsRedirectRequestToJSON(json: any): AttachmentsRedirectRequest { + return AttachmentsRedirectRequestToJSONTyped(json, false); +} + +export function AttachmentsRedirectRequestToJSONTyped(value?: AttachmentsRedirectRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/Auth.ts b/src/gen/api/outline/models/Auth.ts new file mode 100644 index 0000000..f52a46f --- /dev/null +++ b/src/gen/api/outline/models/Auth.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Team } from './Team'; +import { + TeamFromJSON, + TeamFromJSONTyped, + TeamToJSON, + TeamToJSONTyped, +} from './Team'; + +/** + * + * @export + * @interface Auth + */ +export interface Auth { + /** + * + * @type {User} + * @memberof Auth + */ + user?: User; + /** + * + * @type {Team} + * @memberof Auth + */ + team?: Team; +} + +/** + * Check if a given object implements the Auth interface. + */ +export function instanceOfAuth(value: object): value is Auth { + return true; +} + +export function AuthFromJSON(json: any): Auth { + return AuthFromJSONTyped(json, false); +} + +export function AuthFromJSONTyped(json: any, ignoreDiscriminator: boolean): Auth { + if (json == null) { + return json; + } + return { + + 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), + 'team': json['team'] == null ? undefined : TeamFromJSON(json['team']), + }; +} + +export function AuthToJSON(json: any): Auth { + return AuthToJSONTyped(json, false); +} + +export function AuthToJSONTyped(value?: Auth | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'user': UserToJSON(value['user']), + 'team': TeamToJSON(value['team']), + }; +} + diff --git a/src/gen/api/outline/models/AuthConfig200Response.ts b/src/gen/api/outline/models/AuthConfig200Response.ts new file mode 100644 index 0000000..b2b4027 --- /dev/null +++ b/src/gen/api/outline/models/AuthConfig200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AuthConfig200ResponseData } from './AuthConfig200ResponseData'; +import { + AuthConfig200ResponseDataFromJSON, + AuthConfig200ResponseDataFromJSONTyped, + AuthConfig200ResponseDataToJSON, + AuthConfig200ResponseDataToJSONTyped, +} from './AuthConfig200ResponseData'; + +/** + * + * @export + * @interface AuthConfig200Response + */ +export interface AuthConfig200Response { + /** + * + * @type {AuthConfig200ResponseData} + * @memberof AuthConfig200Response + */ + data?: AuthConfig200ResponseData; +} + +/** + * Check if a given object implements the AuthConfig200Response interface. + */ +export function instanceOfAuthConfig200Response(value: object): value is AuthConfig200Response { + return true; +} + +export function AuthConfig200ResponseFromJSON(json: any): AuthConfig200Response { + return AuthConfig200ResponseFromJSONTyped(json, false); +} + +export function AuthConfig200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthConfig200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : AuthConfig200ResponseDataFromJSON(json['data']), + }; +} + +export function AuthConfig200ResponseToJSON(json: any): AuthConfig200Response { + return AuthConfig200ResponseToJSONTyped(json, false); +} + +export function AuthConfig200ResponseToJSONTyped(value?: AuthConfig200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': AuthConfig200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/AuthConfig200ResponseData.ts b/src/gen/api/outline/models/AuthConfig200ResponseData.ts new file mode 100644 index 0000000..1d93db5 --- /dev/null +++ b/src/gen/api/outline/models/AuthConfig200ResponseData.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { AuthConfig200ResponseDataServicesInner } from './AuthConfig200ResponseDataServicesInner'; +import { + AuthConfig200ResponseDataServicesInnerFromJSON, + AuthConfig200ResponseDataServicesInnerFromJSONTyped, + AuthConfig200ResponseDataServicesInnerToJSON, + AuthConfig200ResponseDataServicesInnerToJSONTyped, +} from './AuthConfig200ResponseDataServicesInner'; + +/** + * + * @export + * @interface AuthConfig200ResponseData + */ +export interface AuthConfig200ResponseData { + /** + * + * @type {string} + * @memberof AuthConfig200ResponseData + */ + name?: string; + /** + * + * @type {string} + * @memberof AuthConfig200ResponseData + */ + hostname?: string; + /** + * + * @type {Array} + * @memberof AuthConfig200ResponseData + */ + services?: Array; +} + +/** + * Check if a given object implements the AuthConfig200ResponseData interface. + */ +export function instanceOfAuthConfig200ResponseData(value: object): value is AuthConfig200ResponseData { + return true; +} + +export function AuthConfig200ResponseDataFromJSON(json: any): AuthConfig200ResponseData { + return AuthConfig200ResponseDataFromJSONTyped(json, false); +} + +export function AuthConfig200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthConfig200ResponseData { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'hostname': json['hostname'] == null ? undefined : json['hostname'], + 'services': json['services'] == null ? undefined : ((json['services'] as Array).map(AuthConfig200ResponseDataServicesInnerFromJSON)), + }; +} + +export function AuthConfig200ResponseDataToJSON(json: any): AuthConfig200ResponseData { + return AuthConfig200ResponseDataToJSONTyped(json, false); +} + +export function AuthConfig200ResponseDataToJSONTyped(value?: AuthConfig200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'hostname': value['hostname'], + 'services': value['services'] == null ? undefined : ((value['services'] as Array).map(AuthConfig200ResponseDataServicesInnerToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/AuthConfig200ResponseDataServicesInner.ts b/src/gen/api/outline/models/AuthConfig200ResponseDataServicesInner.ts new file mode 100644 index 0000000..fdf3b10 --- /dev/null +++ b/src/gen/api/outline/models/AuthConfig200ResponseDataServicesInner.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface AuthConfig200ResponseDataServicesInner + */ +export interface AuthConfig200ResponseDataServicesInner { + /** + * + * @type {string} + * @memberof AuthConfig200ResponseDataServicesInner + */ + id?: string; + /** + * + * @type {string} + * @memberof AuthConfig200ResponseDataServicesInner + */ + name?: string; + /** + * + * @type {string} + * @memberof AuthConfig200ResponseDataServicesInner + */ + authUrl?: string; +} + +/** + * Check if a given object implements the AuthConfig200ResponseDataServicesInner interface. + */ +export function instanceOfAuthConfig200ResponseDataServicesInner(value: object): value is AuthConfig200ResponseDataServicesInner { + return true; +} + +export function AuthConfig200ResponseDataServicesInnerFromJSON(json: any): AuthConfig200ResponseDataServicesInner { + return AuthConfig200ResponseDataServicesInnerFromJSONTyped(json, false); +} + +export function AuthConfig200ResponseDataServicesInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthConfig200ResponseDataServicesInner { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'authUrl': json['authUrl'] == null ? undefined : json['authUrl'], + }; +} + +export function AuthConfig200ResponseDataServicesInnerToJSON(json: any): AuthConfig200ResponseDataServicesInner { + return AuthConfig200ResponseDataServicesInnerToJSONTyped(json, false); +} + +export function AuthConfig200ResponseDataServicesInnerToJSONTyped(value?: AuthConfig200ResponseDataServicesInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'authUrl': value['authUrl'], + }; +} + diff --git a/src/gen/api/outline/models/AuthInfo200Response.ts b/src/gen/api/outline/models/AuthInfo200Response.ts new file mode 100644 index 0000000..30c5c93 --- /dev/null +++ b/src/gen/api/outline/models/AuthInfo200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Auth } from './Auth'; +import { + AuthFromJSON, + AuthFromJSONTyped, + AuthToJSON, + AuthToJSONTyped, +} from './Auth'; + +/** + * + * @export + * @interface AuthInfo200Response + */ +export interface AuthInfo200Response { + /** + * + * @type {Auth} + * @memberof AuthInfo200Response + */ + data?: Auth; +} + +/** + * Check if a given object implements the AuthInfo200Response interface. + */ +export function instanceOfAuthInfo200Response(value: object): value is AuthInfo200Response { + return true; +} + +export function AuthInfo200ResponseFromJSON(json: any): AuthInfo200Response { + return AuthInfo200ResponseFromJSONTyped(json, false); +} + +export function AuthInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : AuthFromJSON(json['data']), + }; +} + +export function AuthInfo200ResponseToJSON(json: any): AuthInfo200Response { + return AuthInfo200ResponseToJSONTyped(json, false); +} + +export function AuthInfo200ResponseToJSONTyped(value?: AuthInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': AuthToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/Collection.ts b/src/gen/api/outline/models/Collection.ts new file mode 100644 index 0000000..e0fdf7b --- /dev/null +++ b/src/gen/api/outline/models/Collection.ts @@ -0,0 +1,195 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionSort } from './CollectionSort'; +import { + CollectionSortFromJSON, + CollectionSortFromJSONTyped, + CollectionSortToJSON, + CollectionSortToJSONTyped, +} from './CollectionSort'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface Collection + */ +export interface Collection { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Collection + */ + readonly id?: string; + /** + * A short unique identifier that can be used to identify the collection instead of the UUID. + * @type {string} + * @memberof Collection + */ + readonly urlId?: string; + /** + * The name of the collection. + * @type {string} + * @memberof Collection + */ + name?: string; + /** + * A description of the collection, may contain markdown formatting + * @type {string} + * @memberof Collection + */ + description?: string; + /** + * + * @type {CollectionSort} + * @memberof Collection + */ + sort?: CollectionSort; + /** + * The position of the collection in the sidebar + * @type {string} + * @memberof Collection + */ + index?: string; + /** + * A color representing the collection, this is used to help make collections more identifiable in the UI. It should be in HEX format including the # + * @type {string} + * @memberof Collection + */ + color?: string; + /** + * A string that represents an icon in the outline-icons package or an emoji + * @type {string} + * @memberof Collection + */ + icon?: string; + /** + * + * @type {Permission} + * @memberof Collection + */ + permission?: Permission; + /** + * Whether public document sharing is enabled in this collection + * @type {boolean} + * @memberof Collection + */ + sharing?: boolean; + /** + * The date and time that this object was created + * @type {Date} + * @memberof Collection + */ + readonly createdAt?: Date; + /** + * The date and time that this object was last changed + * @type {Date} + * @memberof Collection + */ + readonly updatedAt?: Date; + /** + * The date and time that this object was deleted + * @type {Date} + * @memberof Collection + */ + readonly deletedAt?: Date | null; + /** + * The date and time that this object was archived + * @type {Date} + * @memberof Collection + */ + readonly archivedAt?: Date | null; + /** + * + * @type {User} + * @memberof Collection + */ + archivedBy?: User; +} + + + +/** + * Check if a given object implements the Collection interface. + */ +export function instanceOfCollection(value: object): value is Collection { + return true; +} + +export function CollectionFromJSON(json: any): Collection { + return CollectionFromJSONTyped(json, false); +} + +export function CollectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Collection { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'urlId': json['urlId'] == null ? undefined : json['urlId'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'sort': json['sort'] == null ? undefined : CollectionSortFromJSON(json['sort']), + 'index': json['index'] == null ? undefined : json['index'], + 'color': json['color'] == null ? undefined : json['color'], + 'icon': json['icon'] == null ? undefined : json['icon'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + 'sharing': json['sharing'] == null ? undefined : json['sharing'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])), + 'archivedAt': json['archivedAt'] == null ? undefined : (new Date(json['archivedAt'])), + 'archivedBy': json['archivedBy'] == null ? undefined : UserFromJSON(json['archivedBy']), + }; +} + +export function CollectionToJSON(json: any): Collection { + return CollectionToJSONTyped(json, false); +} + +export function CollectionToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'sort': CollectionSortToJSON(value['sort']), + 'index': value['index'], + 'color': value['color'], + 'icon': value['icon'], + 'permission': PermissionToJSON(value['permission']), + 'sharing': value['sharing'], + 'archivedBy': UserToJSON(value['archivedBy']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionGroupMembership.ts b/src/gen/api/outline/models/CollectionGroupMembership.ts new file mode 100644 index 0000000..f46f08c --- /dev/null +++ b/src/gen/api/outline/models/CollectionGroupMembership.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionGroupMembership + */ +export interface CollectionGroupMembership { + /** + * Unique identifier for the object. + * @type {string} + * @memberof CollectionGroupMembership + */ + readonly id?: string; + /** + * Identifier for the associated group. + * @type {string} + * @memberof CollectionGroupMembership + */ + readonly groupId?: string; + /** + * Identifier for the associated collection. + * @type {string} + * @memberof CollectionGroupMembership + */ + readonly collectionId?: string; + /** + * + * @type {Permission} + * @memberof CollectionGroupMembership + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the CollectionGroupMembership interface. + */ +export function instanceOfCollectionGroupMembership(value: object): value is CollectionGroupMembership { + return true; +} + +export function CollectionGroupMembershipFromJSON(json: any): CollectionGroupMembership { + return CollectionGroupMembershipFromJSONTyped(json, false); +} + +export function CollectionGroupMembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionGroupMembership { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'groupId': json['groupId'] == null ? undefined : json['groupId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function CollectionGroupMembershipToJSON(json: any): CollectionGroupMembership { + return CollectionGroupMembershipToJSONTyped(json, false); +} + +export function CollectionGroupMembershipToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionSort.ts b/src/gen/api/outline/models/CollectionSort.ts new file mode 100644 index 0000000..90dfa74 --- /dev/null +++ b/src/gen/api/outline/models/CollectionSort.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * The sort of documents in the collection. Note that not all API responses respect this and it is left as a frontend concern to implement. + * @export + * @interface CollectionSort + */ +export interface CollectionSort { + /** + * + * @type {string} + * @memberof CollectionSort + */ + field?: string; + /** + * + * @type {string} + * @memberof CollectionSort + */ + direction?: CollectionSortDirectionEnum; +} + + +/** + * @export + */ +export const CollectionSortDirectionEnum = { + Asc: 'asc', + Desc: 'desc' +} as const; +export type CollectionSortDirectionEnum = typeof CollectionSortDirectionEnum[keyof typeof CollectionSortDirectionEnum]; + + +/** + * Check if a given object implements the CollectionSort interface. + */ +export function instanceOfCollectionSort(value: object): value is CollectionSort { + return true; +} + +export function CollectionSortFromJSON(json: any): CollectionSort { + return CollectionSortFromJSONTyped(json, false); +} + +export function CollectionSortFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionSort { + if (json == null) { + return json; + } + return { + + 'field': json['field'] == null ? undefined : json['field'], + 'direction': json['direction'] == null ? undefined : json['direction'], + }; +} + +export function CollectionSortToJSON(json: any): CollectionSort { + return CollectionSortToJSONTyped(json, false); +} + +export function CollectionSortToJSONTyped(value?: CollectionSort | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'field': value['field'], + 'direction': value['direction'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionStatus.ts b/src/gen/api/outline/models/CollectionStatus.ts new file mode 100644 index 0000000..7891738 --- /dev/null +++ b/src/gen/api/outline/models/CollectionStatus.ts @@ -0,0 +1,52 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const CollectionStatus = { + Archived: 'archived' +} as const; +export type CollectionStatus = typeof CollectionStatus[keyof typeof CollectionStatus]; + + +export function instanceOfCollectionStatus(value: any): boolean { + for (const key in CollectionStatus) { + if (Object.prototype.hasOwnProperty.call(CollectionStatus, key)) { + if (CollectionStatus[key as keyof typeof CollectionStatus] === value) { + return true; + } + } + } + return false; +} + +export function CollectionStatusFromJSON(json: any): CollectionStatus { + return CollectionStatusFromJSONTyped(json, false); +} + +export function CollectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionStatus { + return json as CollectionStatus; +} + +export function CollectionStatusToJSON(value?: CollectionStatus | null): any { + return value as any; +} + +export function CollectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): CollectionStatus { + return value as CollectionStatus; +} + diff --git a/src/gen/api/outline/models/CollectionsAddGroup200Response.ts b/src/gen/api/outline/models/CollectionsAddGroup200Response.ts new file mode 100644 index 0000000..98078fa --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddGroup200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionsAddGroup200ResponseData } from './CollectionsAddGroup200ResponseData'; +import { + CollectionsAddGroup200ResponseDataFromJSON, + CollectionsAddGroup200ResponseDataFromJSONTyped, + CollectionsAddGroup200ResponseDataToJSON, + CollectionsAddGroup200ResponseDataToJSONTyped, +} from './CollectionsAddGroup200ResponseData'; + +/** + * + * @export + * @interface CollectionsAddGroup200Response + */ +export interface CollectionsAddGroup200Response { + /** + * + * @type {CollectionsAddGroup200ResponseData} + * @memberof CollectionsAddGroup200Response + */ + data?: CollectionsAddGroup200ResponseData; +} + +/** + * Check if a given object implements the CollectionsAddGroup200Response interface. + */ +export function instanceOfCollectionsAddGroup200Response(value: object): value is CollectionsAddGroup200Response { + return true; +} + +export function CollectionsAddGroup200ResponseFromJSON(json: any): CollectionsAddGroup200Response { + return CollectionsAddGroup200ResponseFromJSONTyped(json, false); +} + +export function CollectionsAddGroup200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroup200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionsAddGroup200ResponseDataFromJSON(json['data']), + }; +} + +export function CollectionsAddGroup200ResponseToJSON(json: any): CollectionsAddGroup200Response { + return CollectionsAddGroup200ResponseToJSONTyped(json, false); +} + +export function CollectionsAddGroup200ResponseToJSONTyped(value?: CollectionsAddGroup200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionsAddGroup200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsAddGroup200ResponseData.ts b/src/gen/api/outline/models/CollectionsAddGroup200ResponseData.ts new file mode 100644 index 0000000..37db3ac --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddGroup200ResponseData.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionGroupMembership } from './CollectionGroupMembership'; +import { + CollectionGroupMembershipFromJSON, + CollectionGroupMembershipFromJSONTyped, + CollectionGroupMembershipToJSON, + CollectionGroupMembershipToJSONTyped, +} from './CollectionGroupMembership'; + +/** + * + * @export + * @interface CollectionsAddGroup200ResponseData + */ +export interface CollectionsAddGroup200ResponseData { + /** + * + * @type {Array} + * @memberof CollectionsAddGroup200ResponseData + */ + collectionGroupMemberships?: Array; +} + +/** + * Check if a given object implements the CollectionsAddGroup200ResponseData interface. + */ +export function instanceOfCollectionsAddGroup200ResponseData(value: object): value is CollectionsAddGroup200ResponseData { + return true; +} + +export function CollectionsAddGroup200ResponseDataFromJSON(json: any): CollectionsAddGroup200ResponseData { + return CollectionsAddGroup200ResponseDataFromJSONTyped(json, false); +} + +export function CollectionsAddGroup200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroup200ResponseData { + if (json == null) { + return json; + } + return { + + 'collectionGroupMemberships': json['collectionGroupMemberships'] == null ? undefined : ((json['collectionGroupMemberships'] as Array).map(CollectionGroupMembershipFromJSON)), + }; +} + +export function CollectionsAddGroup200ResponseDataToJSON(json: any): CollectionsAddGroup200ResponseData { + return CollectionsAddGroup200ResponseDataToJSONTyped(json, false); +} + +export function CollectionsAddGroup200ResponseDataToJSONTyped(value?: CollectionsAddGroup200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'collectionGroupMemberships': value['collectionGroupMemberships'] == null ? undefined : ((value['collectionGroupMemberships'] as Array).map(CollectionGroupMembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsAddGroupRequest.ts b/src/gen/api/outline/models/CollectionsAddGroupRequest.ts new file mode 100644 index 0000000..5839d6d --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddGroupRequest.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsAddGroupRequest + */ +export interface CollectionsAddGroupRequest { + /** + * + * @type {string} + * @memberof CollectionsAddGroupRequest + */ + id: string; + /** + * + * @type {string} + * @memberof CollectionsAddGroupRequest + */ + groupId: string; + /** + * + * @type {Permission} + * @memberof CollectionsAddGroupRequest + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the CollectionsAddGroupRequest interface. + */ +export function instanceOfCollectionsAddGroupRequest(value: object): value is CollectionsAddGroupRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('groupId' in value) || value['groupId'] === undefined) return false; + return true; +} + +export function CollectionsAddGroupRequestFromJSON(json: any): CollectionsAddGroupRequest { + return CollectionsAddGroupRequestFromJSONTyped(json, false); +} + +export function CollectionsAddGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddGroupRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'groupId': json['groupId'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function CollectionsAddGroupRequestToJSON(json: any): CollectionsAddGroupRequest { + return CollectionsAddGroupRequestToJSONTyped(json, false); +} + +export function CollectionsAddGroupRequestToJSONTyped(value?: CollectionsAddGroupRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'groupId': value['groupId'], + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsAddUser200Response.ts b/src/gen/api/outline/models/CollectionsAddUser200Response.ts new file mode 100644 index 0000000..f90f42c --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddUser200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionsAddUser200ResponseData } from './CollectionsAddUser200ResponseData'; +import { + CollectionsAddUser200ResponseDataFromJSON, + CollectionsAddUser200ResponseDataFromJSONTyped, + CollectionsAddUser200ResponseDataToJSON, + CollectionsAddUser200ResponseDataToJSONTyped, +} from './CollectionsAddUser200ResponseData'; + +/** + * + * @export + * @interface CollectionsAddUser200Response + */ +export interface CollectionsAddUser200Response { + /** + * + * @type {CollectionsAddUser200ResponseData} + * @memberof CollectionsAddUser200Response + */ + data?: CollectionsAddUser200ResponseData; +} + +/** + * Check if a given object implements the CollectionsAddUser200Response interface. + */ +export function instanceOfCollectionsAddUser200Response(value: object): value is CollectionsAddUser200Response { + return true; +} + +export function CollectionsAddUser200ResponseFromJSON(json: any): CollectionsAddUser200Response { + return CollectionsAddUser200ResponseFromJSONTyped(json, false); +} + +export function CollectionsAddUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUser200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionsAddUser200ResponseDataFromJSON(json['data']), + }; +} + +export function CollectionsAddUser200ResponseToJSON(json: any): CollectionsAddUser200Response { + return CollectionsAddUser200ResponseToJSONTyped(json, false); +} + +export function CollectionsAddUser200ResponseToJSONTyped(value?: CollectionsAddUser200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionsAddUser200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsAddUser200ResponseData.ts b/src/gen/api/outline/models/CollectionsAddUser200ResponseData.ts new file mode 100644 index 0000000..98e62b4 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddUser200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Membership } from './Membership'; +import { + MembershipFromJSON, + MembershipFromJSONTyped, + MembershipToJSON, + MembershipToJSONTyped, +} from './Membership'; + +/** + * + * @export + * @interface CollectionsAddUser200ResponseData + */ +export interface CollectionsAddUser200ResponseData { + /** + * + * @type {Array} + * @memberof CollectionsAddUser200ResponseData + */ + users?: Array; + /** + * + * @type {Array} + * @memberof CollectionsAddUser200ResponseData + */ + memberships?: Array; +} + +/** + * Check if a given object implements the CollectionsAddUser200ResponseData interface. + */ +export function instanceOfCollectionsAddUser200ResponseData(value: object): value is CollectionsAddUser200ResponseData { + return true; +} + +export function CollectionsAddUser200ResponseDataFromJSON(json: any): CollectionsAddUser200ResponseData { + return CollectionsAddUser200ResponseDataFromJSONTyped(json, false); +} + +export function CollectionsAddUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUser200ResponseData { + if (json == null) { + return json; + } + return { + + 'users': json['users'] == null ? undefined : ((json['users'] as Array).map(UserFromJSON)), + 'memberships': json['memberships'] == null ? undefined : ((json['memberships'] as Array).map(MembershipFromJSON)), + }; +} + +export function CollectionsAddUser200ResponseDataToJSON(json: any): CollectionsAddUser200ResponseData { + return CollectionsAddUser200ResponseDataToJSONTyped(json, false); +} + +export function CollectionsAddUser200ResponseDataToJSONTyped(value?: CollectionsAddUser200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'users': value['users'] == null ? undefined : ((value['users'] as Array).map(UserToJSON)), + 'memberships': value['memberships'] == null ? undefined : ((value['memberships'] as Array).map(MembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsAddUserRequest.ts b/src/gen/api/outline/models/CollectionsAddUserRequest.ts new file mode 100644 index 0000000..ff98cec --- /dev/null +++ b/src/gen/api/outline/models/CollectionsAddUserRequest.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsAddUserRequest + */ +export interface CollectionsAddUserRequest { + /** + * + * @type {string} + * @memberof CollectionsAddUserRequest + */ + id: string; + /** + * + * @type {string} + * @memberof CollectionsAddUserRequest + */ + userId: string; + /** + * + * @type {Permission} + * @memberof CollectionsAddUserRequest + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the CollectionsAddUserRequest interface. + */ +export function instanceOfCollectionsAddUserRequest(value: object): value is CollectionsAddUserRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; +} + +export function CollectionsAddUserRequestFromJSON(json: any): CollectionsAddUserRequest { + return CollectionsAddUserRequestFromJSONTyped(json, false); +} + +export function CollectionsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsAddUserRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function CollectionsAddUserRequestToJSON(json: any): CollectionsAddUserRequest { + return CollectionsAddUserRequestToJSONTyped(json, false); +} + +export function CollectionsAddUserRequestToJSONTyped(value?: CollectionsAddUserRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsCreateRequest.ts b/src/gen/api/outline/models/CollectionsCreateRequest.ts new file mode 100644 index 0000000..9902eaa --- /dev/null +++ b/src/gen/api/outline/models/CollectionsCreateRequest.ts @@ -0,0 +1,116 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsCreateRequest + */ +export interface CollectionsCreateRequest { + /** + * + * @type {string} + * @memberof CollectionsCreateRequest + */ + name: string; + /** + * A brief description of the collection, markdown supported. + * @type {string} + * @memberof CollectionsCreateRequest + */ + description?: string; + /** + * + * @type {Permission} + * @memberof CollectionsCreateRequest + */ + permission?: Permission; + /** + * A string that represents an icon in the outline-icons package or an emoji + * @type {string} + * @memberof CollectionsCreateRequest + */ + icon?: string; + /** + * A hex color code for the collection icon + * @type {string} + * @memberof CollectionsCreateRequest + */ + color?: string; + /** + * Whether public sharing of documents is allowed + * @type {boolean} + * @memberof CollectionsCreateRequest + */ + sharing?: boolean; +} + + + +/** + * Check if a given object implements the CollectionsCreateRequest interface. + */ +export function instanceOfCollectionsCreateRequest(value: object): value is CollectionsCreateRequest { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CollectionsCreateRequestFromJSON(json: any): CollectionsCreateRequest { + return CollectionsCreateRequestFromJSONTyped(json, false); +} + +export function CollectionsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsCreateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + 'icon': json['icon'] == null ? undefined : json['icon'], + 'color': json['color'] == null ? undefined : json['color'], + 'sharing': json['sharing'] == null ? undefined : json['sharing'], + }; +} + +export function CollectionsCreateRequestToJSON(json: any): CollectionsCreateRequest { + return CollectionsCreateRequestToJSONTyped(json, false); +} + +export function CollectionsCreateRequestToJSONTyped(value?: CollectionsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'permission': PermissionToJSON(value['permission']), + 'icon': value['icon'], + 'color': value['color'], + 'sharing': value['sharing'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsDeleteRequest.ts b/src/gen/api/outline/models/CollectionsDeleteRequest.ts new file mode 100644 index 0000000..e11eefd --- /dev/null +++ b/src/gen/api/outline/models/CollectionsDeleteRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsDeleteRequest + */ +export interface CollectionsDeleteRequest { + /** + * + * @type {string} + * @memberof CollectionsDeleteRequest + */ + id: string; +} + +/** + * Check if a given object implements the CollectionsDeleteRequest interface. + */ +export function instanceOfCollectionsDeleteRequest(value: object): value is CollectionsDeleteRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsDeleteRequestFromJSON(json: any): CollectionsDeleteRequest { + return CollectionsDeleteRequestFromJSONTyped(json, false); +} + +export function CollectionsDeleteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsDeleteRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function CollectionsDeleteRequestToJSON(json: any): CollectionsDeleteRequest { + return CollectionsDeleteRequestToJSONTyped(json, false); +} + +export function CollectionsDeleteRequestToJSONTyped(value?: CollectionsDeleteRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsDocuments200Response.ts b/src/gen/api/outline/models/CollectionsDocuments200Response.ts new file mode 100644 index 0000000..575527b --- /dev/null +++ b/src/gen/api/outline/models/CollectionsDocuments200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { NavigationNode } from './NavigationNode'; +import { + NavigationNodeFromJSON, + NavigationNodeFromJSONTyped, + NavigationNodeToJSON, + NavigationNodeToJSONTyped, +} from './NavigationNode'; + +/** + * + * @export + * @interface CollectionsDocuments200Response + */ +export interface CollectionsDocuments200Response { + /** + * + * @type {Array} + * @memberof CollectionsDocuments200Response + */ + data?: Array; +} + +/** + * Check if a given object implements the CollectionsDocuments200Response interface. + */ +export function instanceOfCollectionsDocuments200Response(value: object): value is CollectionsDocuments200Response { + return true; +} + +export function CollectionsDocuments200ResponseFromJSON(json: any): CollectionsDocuments200Response { + return CollectionsDocuments200ResponseFromJSONTyped(json, false); +} + +export function CollectionsDocuments200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsDocuments200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(NavigationNodeFromJSON)), + }; +} + +export function CollectionsDocuments200ResponseToJSON(json: any): CollectionsDocuments200Response { + return CollectionsDocuments200ResponseToJSONTyped(json, false); +} + +export function CollectionsDocuments200ResponseToJSONTyped(value?: CollectionsDocuments200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(NavigationNodeToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsExport200Response.ts b/src/gen/api/outline/models/CollectionsExport200Response.ts new file mode 100644 index 0000000..feb86b7 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsExport200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionsExport200ResponseData } from './CollectionsExport200ResponseData'; +import { + CollectionsExport200ResponseDataFromJSON, + CollectionsExport200ResponseDataFromJSONTyped, + CollectionsExport200ResponseDataToJSON, + CollectionsExport200ResponseDataToJSONTyped, +} from './CollectionsExport200ResponseData'; + +/** + * + * @export + * @interface CollectionsExport200Response + */ +export interface CollectionsExport200Response { + /** + * + * @type {CollectionsExport200ResponseData} + * @memberof CollectionsExport200Response + */ + data?: CollectionsExport200ResponseData; +} + +/** + * Check if a given object implements the CollectionsExport200Response interface. + */ +export function instanceOfCollectionsExport200Response(value: object): value is CollectionsExport200Response { + return true; +} + +export function CollectionsExport200ResponseFromJSON(json: any): CollectionsExport200Response { + return CollectionsExport200ResponseFromJSONTyped(json, false); +} + +export function CollectionsExport200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExport200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionsExport200ResponseDataFromJSON(json['data']), + }; +} + +export function CollectionsExport200ResponseToJSON(json: any): CollectionsExport200Response { + return CollectionsExport200ResponseToJSONTyped(json, false); +} + +export function CollectionsExport200ResponseToJSONTyped(value?: CollectionsExport200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionsExport200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsExport200ResponseData.ts b/src/gen/api/outline/models/CollectionsExport200ResponseData.ts new file mode 100644 index 0000000..75aaac6 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsExport200ResponseData.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FileOperation } from './FileOperation'; +import { + FileOperationFromJSON, + FileOperationFromJSONTyped, + FileOperationToJSON, + FileOperationToJSONTyped, +} from './FileOperation'; + +/** + * + * @export + * @interface CollectionsExport200ResponseData + */ +export interface CollectionsExport200ResponseData { + /** + * + * @type {FileOperation} + * @memberof CollectionsExport200ResponseData + */ + fileOperation?: FileOperation; +} + +/** + * Check if a given object implements the CollectionsExport200ResponseData interface. + */ +export function instanceOfCollectionsExport200ResponseData(value: object): value is CollectionsExport200ResponseData { + return true; +} + +export function CollectionsExport200ResponseDataFromJSON(json: any): CollectionsExport200ResponseData { + return CollectionsExport200ResponseDataFromJSONTyped(json, false); +} + +export function CollectionsExport200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExport200ResponseData { + if (json == null) { + return json; + } + return { + + 'fileOperation': json['fileOperation'] == null ? undefined : FileOperationFromJSON(json['fileOperation']), + }; +} + +export function CollectionsExport200ResponseDataToJSON(json: any): CollectionsExport200ResponseData { + return CollectionsExport200ResponseDataToJSONTyped(json, false); +} + +export function CollectionsExport200ResponseDataToJSONTyped(value?: CollectionsExport200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'fileOperation': FileOperationToJSON(value['fileOperation']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsExportAllRequest.ts b/src/gen/api/outline/models/CollectionsExportAllRequest.ts new file mode 100644 index 0000000..c19abb2 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsExportAllRequest.ts @@ -0,0 +1,77 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsExportAllRequest + */ +export interface CollectionsExportAllRequest { + /** + * + * @type {string} + * @memberof CollectionsExportAllRequest + */ + format?: CollectionsExportAllRequestFormatEnum; +} + + +/** + * @export + */ +export const CollectionsExportAllRequestFormatEnum = { + OutlineMarkdown: 'outline-markdown', + Json: 'json', + Html: 'html' +} as const; +export type CollectionsExportAllRequestFormatEnum = typeof CollectionsExportAllRequestFormatEnum[keyof typeof CollectionsExportAllRequestFormatEnum]; + + +/** + * Check if a given object implements the CollectionsExportAllRequest interface. + */ +export function instanceOfCollectionsExportAllRequest(value: object): value is CollectionsExportAllRequest { + return true; +} + +export function CollectionsExportAllRequestFromJSON(json: any): CollectionsExportAllRequest { + return CollectionsExportAllRequestFromJSONTyped(json, false); +} + +export function CollectionsExportAllRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExportAllRequest { + if (json == null) { + return json; + } + return { + + 'format': json['format'] == null ? undefined : json['format'], + }; +} + +export function CollectionsExportAllRequestToJSON(json: any): CollectionsExportAllRequest { + return CollectionsExportAllRequestToJSONTyped(json, false); +} + +export function CollectionsExportAllRequestToJSONTyped(value?: CollectionsExportAllRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'format': value['format'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsExportRequest.ts b/src/gen/api/outline/models/CollectionsExportRequest.ts new file mode 100644 index 0000000..ff38101 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsExportRequest.ts @@ -0,0 +1,86 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsExportRequest + */ +export interface CollectionsExportRequest { + /** + * + * @type {string} + * @memberof CollectionsExportRequest + */ + format?: CollectionsExportRequestFormatEnum; + /** + * + * @type {string} + * @memberof CollectionsExportRequest + */ + id: string; +} + + +/** + * @export + */ +export const CollectionsExportRequestFormatEnum = { + OutlineMarkdown: 'outline-markdown', + Json: 'json', + Html: 'html' +} as const; +export type CollectionsExportRequestFormatEnum = typeof CollectionsExportRequestFormatEnum[keyof typeof CollectionsExportRequestFormatEnum]; + + +/** + * Check if a given object implements the CollectionsExportRequest interface. + */ +export function instanceOfCollectionsExportRequest(value: object): value is CollectionsExportRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsExportRequestFromJSON(json: any): CollectionsExportRequest { + return CollectionsExportRequestFromJSONTyped(json, false); +} + +export function CollectionsExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsExportRequest { + if (json == null) { + return json; + } + return { + + 'format': json['format'] == null ? undefined : json['format'], + 'id': json['id'], + }; +} + +export function CollectionsExportRequestToJSON(json: any): CollectionsExportRequest { + return CollectionsExportRequestToJSONTyped(json, false); +} + +export function CollectionsExportRequestToJSONTyped(value?: CollectionsExportRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'format': value['format'], + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsGroupMemberships200Response.ts b/src/gen/api/outline/models/CollectionsGroupMemberships200Response.ts new file mode 100644 index 0000000..feccf61 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsGroupMemberships200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionsGroupMemberships200ResponseData } from './CollectionsGroupMemberships200ResponseData'; +import { + CollectionsGroupMemberships200ResponseDataFromJSON, + CollectionsGroupMemberships200ResponseDataFromJSONTyped, + CollectionsGroupMemberships200ResponseDataToJSON, + CollectionsGroupMemberships200ResponseDataToJSONTyped, +} from './CollectionsGroupMemberships200ResponseData'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; + +/** + * + * @export + * @interface CollectionsGroupMemberships200Response + */ +export interface CollectionsGroupMemberships200Response { + /** + * + * @type {CollectionsGroupMemberships200ResponseData} + * @memberof CollectionsGroupMemberships200Response + */ + data?: CollectionsGroupMemberships200ResponseData; + /** + * + * @type {Pagination} + * @memberof CollectionsGroupMemberships200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the CollectionsGroupMemberships200Response interface. + */ +export function instanceOfCollectionsGroupMemberships200Response(value: object): value is CollectionsGroupMemberships200Response { + return true; +} + +export function CollectionsGroupMemberships200ResponseFromJSON(json: any): CollectionsGroupMemberships200Response { + return CollectionsGroupMemberships200ResponseFromJSONTyped(json, false); +} + +export function CollectionsGroupMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMemberships200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionsGroupMemberships200ResponseDataFromJSON(json['data']), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function CollectionsGroupMemberships200ResponseToJSON(json: any): CollectionsGroupMemberships200Response { + return CollectionsGroupMemberships200ResponseToJSONTyped(json, false); +} + +export function CollectionsGroupMemberships200ResponseToJSONTyped(value?: CollectionsGroupMemberships200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionsGroupMemberships200ResponseDataToJSON(value['data']), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsGroupMemberships200ResponseData.ts b/src/gen/api/outline/models/CollectionsGroupMemberships200ResponseData.ts new file mode 100644 index 0000000..74d8fdf --- /dev/null +++ b/src/gen/api/outline/models/CollectionsGroupMemberships200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { CollectionGroupMembership } from './CollectionGroupMembership'; +import { + CollectionGroupMembershipFromJSON, + CollectionGroupMembershipFromJSONTyped, + CollectionGroupMembershipToJSON, + CollectionGroupMembershipToJSONTyped, +} from './CollectionGroupMembership'; + +/** + * + * @export + * @interface CollectionsGroupMemberships200ResponseData + */ +export interface CollectionsGroupMemberships200ResponseData { + /** + * + * @type {Array} + * @memberof CollectionsGroupMemberships200ResponseData + */ + groups?: Array; + /** + * + * @type {Array} + * @memberof CollectionsGroupMemberships200ResponseData + */ + collectionGroupMemberships?: Array; +} + +/** + * Check if a given object implements the CollectionsGroupMemberships200ResponseData interface. + */ +export function instanceOfCollectionsGroupMemberships200ResponseData(value: object): value is CollectionsGroupMemberships200ResponseData { + return true; +} + +export function CollectionsGroupMemberships200ResponseDataFromJSON(json: any): CollectionsGroupMemberships200ResponseData { + return CollectionsGroupMemberships200ResponseDataFromJSONTyped(json, false); +} + +export function CollectionsGroupMemberships200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMemberships200ResponseData { + if (json == null) { + return json; + } + return { + + 'groups': json['groups'] == null ? undefined : ((json['groups'] as Array).map(GroupFromJSON)), + 'collectionGroupMemberships': json['collectionGroupMemberships'] == null ? undefined : ((json['collectionGroupMemberships'] as Array).map(CollectionGroupMembershipFromJSON)), + }; +} + +export function CollectionsGroupMemberships200ResponseDataToJSON(json: any): CollectionsGroupMemberships200ResponseData { + return CollectionsGroupMemberships200ResponseDataToJSONTyped(json, false); +} + +export function CollectionsGroupMemberships200ResponseDataToJSONTyped(value?: CollectionsGroupMemberships200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'groups': value['groups'] == null ? undefined : ((value['groups'] as Array).map(GroupToJSON)), + 'collectionGroupMemberships': value['collectionGroupMemberships'] == null ? undefined : ((value['collectionGroupMemberships'] as Array).map(CollectionGroupMembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts b/src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts new file mode 100644 index 0000000..1428b89 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsGroupMembershipsRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsGroupMembershipsRequest + */ +export interface CollectionsGroupMembershipsRequest { + /** + * + * @type {number} + * @memberof CollectionsGroupMembershipsRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof CollectionsGroupMembershipsRequest + */ + limit?: number; + /** + * Identifier for the collection + * @type {string} + * @memberof CollectionsGroupMembershipsRequest + */ + id: string; + /** + * Filter memberships by group names + * @type {string} + * @memberof CollectionsGroupMembershipsRequest + */ + query?: string; + /** + * + * @type {Permission} + * @memberof CollectionsGroupMembershipsRequest + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the CollectionsGroupMembershipsRequest interface. + */ +export function instanceOfCollectionsGroupMembershipsRequest(value: object): value is CollectionsGroupMembershipsRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsGroupMembershipsRequestFromJSON(json: any): CollectionsGroupMembershipsRequest { + return CollectionsGroupMembershipsRequestFromJSONTyped(json, false); +} + +export function CollectionsGroupMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsGroupMembershipsRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'id': json['id'], + 'query': json['query'] == null ? undefined : json['query'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function CollectionsGroupMembershipsRequestToJSON(json: any): CollectionsGroupMembershipsRequest { + return CollectionsGroupMembershipsRequestToJSONTyped(json, false); +} + +export function CollectionsGroupMembershipsRequestToJSONTyped(value?: CollectionsGroupMembershipsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'id': value['id'], + 'query': value['query'], + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsInfo200Response.ts b/src/gen/api/outline/models/CollectionsInfo200Response.ts new file mode 100644 index 0000000..04ac45e --- /dev/null +++ b/src/gen/api/outline/models/CollectionsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Collection } from './Collection'; +import { + CollectionFromJSON, + CollectionFromJSONTyped, + CollectionToJSON, + CollectionToJSONTyped, +} from './Collection'; + +/** + * + * @export + * @interface CollectionsInfo200Response + */ +export interface CollectionsInfo200Response { + /** + * + * @type {Collection} + * @memberof CollectionsInfo200Response + */ + data?: Collection; + /** + * + * @type {Array} + * @memberof CollectionsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the CollectionsInfo200Response interface. + */ +export function instanceOfCollectionsInfo200Response(value: object): value is CollectionsInfo200Response { + return true; +} + +export function CollectionsInfo200ResponseFromJSON(json: any): CollectionsInfo200Response { + return CollectionsInfo200ResponseFromJSONTyped(json, false); +} + +export function CollectionsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function CollectionsInfo200ResponseToJSON(json: any): CollectionsInfo200Response { + return CollectionsInfo200ResponseToJSONTyped(json, false); +} + +export function CollectionsInfo200ResponseToJSONTyped(value?: CollectionsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsInfoRequest.ts b/src/gen/api/outline/models/CollectionsInfoRequest.ts new file mode 100644 index 0000000..98cce7d --- /dev/null +++ b/src/gen/api/outline/models/CollectionsInfoRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsInfoRequest + */ +export interface CollectionsInfoRequest { + /** + * Unique identifier for the collection. + * @type {string} + * @memberof CollectionsInfoRequest + */ + id: string; +} + +/** + * Check if a given object implements the CollectionsInfoRequest interface. + */ +export function instanceOfCollectionsInfoRequest(value: object): value is CollectionsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsInfoRequestFromJSON(json: any): CollectionsInfoRequest { + return CollectionsInfoRequestFromJSONTyped(json, false); +} + +export function CollectionsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function CollectionsInfoRequestToJSON(json: any): CollectionsInfoRequest { + return CollectionsInfoRequestToJSONTyped(json, false); +} + +export function CollectionsInfoRequestToJSONTyped(value?: CollectionsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsList200Response.ts b/src/gen/api/outline/models/CollectionsList200Response.ts new file mode 100644 index 0000000..4f017ac --- /dev/null +++ b/src/gen/api/outline/models/CollectionsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { Collection } from './Collection'; +import { + CollectionFromJSON, + CollectionFromJSONTyped, + CollectionToJSON, + CollectionToJSONTyped, +} from './Collection'; + +/** + * + * @export + * @interface CollectionsList200Response + */ +export interface CollectionsList200Response { + /** + * + * @type {Array} + * @memberof CollectionsList200Response + */ + data?: Array; + /** + * + * @type {Pagination} + * @memberof CollectionsList200Response + */ + pagination?: Pagination; + /** + * + * @type {Array} + * @memberof CollectionsList200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the CollectionsList200Response interface. + */ +export function instanceOfCollectionsList200Response(value: object): value is CollectionsList200Response { + return true; +} + +export function CollectionsList200ResponseFromJSON(json: any): CollectionsList200Response { + return CollectionsList200ResponseFromJSONTyped(json, false); +} + +export function CollectionsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(CollectionFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function CollectionsList200ResponseToJSON(json: any): CollectionsList200Response { + return CollectionsList200ResponseToJSONTyped(json, false); +} + +export function CollectionsList200ResponseToJSONTyped(value?: CollectionsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(CollectionToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsListRequest.ts b/src/gen/api/outline/models/CollectionsListRequest.ts new file mode 100644 index 0000000..4524960 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsListRequest.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { CollectionStatus } from './CollectionStatus'; +import { + CollectionStatusFromJSON, + CollectionStatusFromJSONTyped, + CollectionStatusToJSON, + CollectionStatusToJSONTyped, +} from './CollectionStatus'; + +/** + * + * @export + * @interface CollectionsListRequest + */ +export interface CollectionsListRequest { + /** + * + * @type {number} + * @memberof CollectionsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof CollectionsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof CollectionsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof CollectionsListRequest + */ + direction?: CollectionsListRequestDirectionEnum; + /** + * If set, will filter the results by collection name. + * @type {string} + * @memberof CollectionsListRequest + */ + query?: string; + /** + * An optional array of statuses to filter by. + * @type {Array} + * @memberof CollectionsListRequest + */ + statusFilter?: Array; +} + + +/** + * @export + */ +export const CollectionsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type CollectionsListRequestDirectionEnum = typeof CollectionsListRequestDirectionEnum[keyof typeof CollectionsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the CollectionsListRequest interface. + */ +export function instanceOfCollectionsListRequest(value: object): value is CollectionsListRequest { + return true; +} + +export function CollectionsListRequestFromJSON(json: any): CollectionsListRequest { + return CollectionsListRequestFromJSONTyped(json, false); +} + +export function CollectionsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'query': json['query'] == null ? undefined : json['query'], + 'statusFilter': json['statusFilter'] == null ? undefined : ((json['statusFilter'] as Array).map(CollectionStatusFromJSON)), + }; +} + +export function CollectionsListRequestToJSON(json: any): CollectionsListRequest { + return CollectionsListRequestToJSONTyped(json, false); +} + +export function CollectionsListRequestToJSONTyped(value?: CollectionsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'query': value['query'], + 'statusFilter': value['statusFilter'] == null ? undefined : ((value['statusFilter'] as Array).map(CollectionStatusToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsMemberships200Response.ts b/src/gen/api/outline/models/CollectionsMemberships200Response.ts new file mode 100644 index 0000000..d329419 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsMemberships200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { CollectionsAddUser200ResponseData } from './CollectionsAddUser200ResponseData'; +import { + CollectionsAddUser200ResponseDataFromJSON, + CollectionsAddUser200ResponseDataFromJSONTyped, + CollectionsAddUser200ResponseDataToJSON, + CollectionsAddUser200ResponseDataToJSONTyped, +} from './CollectionsAddUser200ResponseData'; + +/** + * + * @export + * @interface CollectionsMemberships200Response + */ +export interface CollectionsMemberships200Response { + /** + * + * @type {CollectionsAddUser200ResponseData} + * @memberof CollectionsMemberships200Response + */ + data?: CollectionsAddUser200ResponseData; + /** + * + * @type {Pagination} + * @memberof CollectionsMemberships200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the CollectionsMemberships200Response interface. + */ +export function instanceOfCollectionsMemberships200Response(value: object): value is CollectionsMemberships200Response { + return true; +} + +export function CollectionsMemberships200ResponseFromJSON(json: any): CollectionsMemberships200Response { + return CollectionsMemberships200ResponseFromJSONTyped(json, false); +} + +export function CollectionsMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsMemberships200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CollectionsAddUser200ResponseDataFromJSON(json['data']), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function CollectionsMemberships200ResponseToJSON(json: any): CollectionsMemberships200Response { + return CollectionsMemberships200ResponseToJSONTyped(json, false); +} + +export function CollectionsMemberships200ResponseToJSONTyped(value?: CollectionsMemberships200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CollectionsAddUser200ResponseDataToJSON(value['data']), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsMembershipsRequest.ts b/src/gen/api/outline/models/CollectionsMembershipsRequest.ts new file mode 100644 index 0000000..5f1997d --- /dev/null +++ b/src/gen/api/outline/models/CollectionsMembershipsRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsMembershipsRequest + */ +export interface CollectionsMembershipsRequest { + /** + * + * @type {number} + * @memberof CollectionsMembershipsRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof CollectionsMembershipsRequest + */ + limit?: number; + /** + * Identifier for the collection + * @type {string} + * @memberof CollectionsMembershipsRequest + */ + id: string; + /** + * Filter memberships by user names + * @type {string} + * @memberof CollectionsMembershipsRequest + */ + query?: string; + /** + * + * @type {Permission} + * @memberof CollectionsMembershipsRequest + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the CollectionsMembershipsRequest interface. + */ +export function instanceOfCollectionsMembershipsRequest(value: object): value is CollectionsMembershipsRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsMembershipsRequestFromJSON(json: any): CollectionsMembershipsRequest { + return CollectionsMembershipsRequestFromJSONTyped(json, false); +} + +export function CollectionsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsMembershipsRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'id': json['id'], + 'query': json['query'] == null ? undefined : json['query'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function CollectionsMembershipsRequestToJSON(json: any): CollectionsMembershipsRequest { + return CollectionsMembershipsRequestToJSONTyped(json, false); +} + +export function CollectionsMembershipsRequestToJSONTyped(value?: CollectionsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'id': value['id'], + 'query': value['query'], + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/CollectionsRemoveGroupRequest.ts b/src/gen/api/outline/models/CollectionsRemoveGroupRequest.ts new file mode 100644 index 0000000..c7606e6 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsRemoveGroupRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsRemoveGroupRequest + */ +export interface CollectionsRemoveGroupRequest { + /** + * Identifier for the collection + * @type {string} + * @memberof CollectionsRemoveGroupRequest + */ + id: string; + /** + * + * @type {string} + * @memberof CollectionsRemoveGroupRequest + */ + groupId: string; +} + +/** + * Check if a given object implements the CollectionsRemoveGroupRequest interface. + */ +export function instanceOfCollectionsRemoveGroupRequest(value: object): value is CollectionsRemoveGroupRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('groupId' in value) || value['groupId'] === undefined) return false; + return true; +} + +export function CollectionsRemoveGroupRequestFromJSON(json: any): CollectionsRemoveGroupRequest { + return CollectionsRemoveGroupRequestFromJSONTyped(json, false); +} + +export function CollectionsRemoveGroupRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsRemoveGroupRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'groupId': json['groupId'], + }; +} + +export function CollectionsRemoveGroupRequestToJSON(json: any): CollectionsRemoveGroupRequest { + return CollectionsRemoveGroupRequestToJSONTyped(json, false); +} + +export function CollectionsRemoveGroupRequestToJSONTyped(value?: CollectionsRemoveGroupRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'groupId': value['groupId'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsRemoveUserRequest.ts b/src/gen/api/outline/models/CollectionsRemoveUserRequest.ts new file mode 100644 index 0000000..3495c20 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsRemoveUserRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CollectionsRemoveUserRequest + */ +export interface CollectionsRemoveUserRequest { + /** + * Identifier for the collection + * @type {string} + * @memberof CollectionsRemoveUserRequest + */ + id: string; + /** + * + * @type {string} + * @memberof CollectionsRemoveUserRequest + */ + userId: string; +} + +/** + * Check if a given object implements the CollectionsRemoveUserRequest interface. + */ +export function instanceOfCollectionsRemoveUserRequest(value: object): value is CollectionsRemoveUserRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; +} + +export function CollectionsRemoveUserRequestFromJSON(json: any): CollectionsRemoveUserRequest { + return CollectionsRemoveUserRequestFromJSONTyped(json, false); +} + +export function CollectionsRemoveUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsRemoveUserRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + }; +} + +export function CollectionsRemoveUserRequestToJSON(json: any): CollectionsRemoveUserRequest { + return CollectionsRemoveUserRequestToJSONTyped(json, false); +} + +export function CollectionsRemoveUserRequestToJSONTyped(value?: CollectionsRemoveUserRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + }; +} + diff --git a/src/gen/api/outline/models/CollectionsUpdateRequest.ts b/src/gen/api/outline/models/CollectionsUpdateRequest.ts new file mode 100644 index 0000000..93f2976 --- /dev/null +++ b/src/gen/api/outline/models/CollectionsUpdateRequest.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface CollectionsUpdateRequest + */ +export interface CollectionsUpdateRequest { + /** + * + * @type {string} + * @memberof CollectionsUpdateRequest + */ + id: string; + /** + * + * @type {string} + * @memberof CollectionsUpdateRequest + */ + name?: string; + /** + * A brief description of the collection, markdown supported. + * @type {string} + * @memberof CollectionsUpdateRequest + */ + description?: string; + /** + * + * @type {Permission} + * @memberof CollectionsUpdateRequest + */ + permission?: Permission; + /** + * A string that represents an icon in the outline-icons package or an emoji + * @type {string} + * @memberof CollectionsUpdateRequest + */ + icon?: string; + /** + * A hex color code for the collection icon + * @type {string} + * @memberof CollectionsUpdateRequest + */ + color?: string; + /** + * Whether public sharing of documents is allowed + * @type {boolean} + * @memberof CollectionsUpdateRequest + */ + sharing?: boolean; +} + + + +/** + * Check if a given object implements the CollectionsUpdateRequest interface. + */ +export function instanceOfCollectionsUpdateRequest(value: object): value is CollectionsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CollectionsUpdateRequestFromJSON(json: any): CollectionsUpdateRequest { + return CollectionsUpdateRequestFromJSONTyped(json, false); +} + +export function CollectionsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CollectionsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + 'icon': json['icon'] == null ? undefined : json['icon'], + 'color': json['color'] == null ? undefined : json['color'], + 'sharing': json['sharing'] == null ? undefined : json['sharing'], + }; +} + +export function CollectionsUpdateRequestToJSON(json: any): CollectionsUpdateRequest { + return CollectionsUpdateRequestToJSONTyped(json, false); +} + +export function CollectionsUpdateRequestToJSONTyped(value?: CollectionsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'permission': PermissionToJSON(value['permission']), + 'icon': value['icon'], + 'color': value['color'], + 'sharing': value['sharing'], + }; +} + diff --git a/src/gen/api/outline/models/Comment.ts b/src/gen/api/outline/models/Comment.ts new file mode 100644 index 0000000..934f927 --- /dev/null +++ b/src/gen/api/outline/models/Comment.ts @@ -0,0 +1,133 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Comment + */ +export interface Comment { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Comment + */ + readonly id?: string; + /** + * The editor data representing this comment. + * @type {object} + * @memberof Comment + */ + data?: object; + /** + * Identifier for the document this is related to. + * @type {string} + * @memberof Comment + */ + documentId?: string; + /** + * Identifier for the comment this is a child of, if any. + * @type {string} + * @memberof Comment + */ + parentCommentId?: string; + /** + * The date and time that this object was created + * @type {Date} + * @memberof Comment + */ + readonly createdAt?: Date; + /** + * + * @type {User} + * @memberof Comment + */ + createdBy?: User; + /** + * The date and time that this object was last changed + * @type {Date} + * @memberof Comment + */ + readonly updatedAt?: Date; + /** + * + * @type {User} + * @memberof Comment + */ + updatedBy?: User; + /** + * The document text that the comment is anchored to, only included if includeAnchorText=true. + * @type {string} + * @memberof Comment + */ + readonly anchorText?: string; +} + +/** + * Check if a given object implements the Comment interface. + */ +export function instanceOfComment(value: object): value is Comment { + return true; +} + +export function CommentFromJSON(json: any): Comment { + return CommentFromJSONTyped(json, false); +} + +export function CommentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Comment { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'data': json['data'] == null ? undefined : json['data'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'parentCommentId': json['parentCommentId'] == null ? undefined : json['parentCommentId'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'updatedBy': json['updatedBy'] == null ? undefined : UserFromJSON(json['updatedBy']), + 'anchorText': json['anchorText'] == null ? undefined : json['anchorText'], + }; +} + +export function CommentToJSON(json: any): Comment { + return CommentToJSONTyped(json, false); +} + +export function CommentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'], + 'documentId': value['documentId'], + 'parentCommentId': value['parentCommentId'], + 'createdBy': UserToJSON(value['createdBy']), + 'updatedBy': UserToJSON(value['updatedBy']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsCreate200Response.ts b/src/gen/api/outline/models/CommentsCreate200Response.ts new file mode 100644 index 0000000..f1db1a3 --- /dev/null +++ b/src/gen/api/outline/models/CommentsCreate200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; + +/** + * + * @export + * @interface CommentsCreate200Response + */ +export interface CommentsCreate200Response { + /** + * + * @type {Comment} + * @memberof CommentsCreate200Response + */ + data?: Comment; +} + +/** + * Check if a given object implements the CommentsCreate200Response interface. + */ +export function instanceOfCommentsCreate200Response(value: object): value is CommentsCreate200Response { + return true; +} + +export function CommentsCreate200ResponseFromJSON(json: any): CommentsCreate200Response { + return CommentsCreate200ResponseFromJSONTyped(json, false); +} + +export function CommentsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CommentFromJSON(json['data']), + }; +} + +export function CommentsCreate200ResponseToJSON(json: any): CommentsCreate200Response { + return CommentsCreate200ResponseToJSONTyped(json, false); +} + +export function CommentsCreate200ResponseToJSONTyped(value?: CommentsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CommentToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsCreateRequest.ts b/src/gen/api/outline/models/CommentsCreateRequest.ts new file mode 100644 index 0000000..e0468ca --- /dev/null +++ b/src/gen/api/outline/models/CommentsCreateRequest.ts @@ -0,0 +1,98 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsCreateRequest + */ +export interface CommentsCreateRequest { + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + id?: string; + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + documentId: string; + /** + * + * @type {string} + * @memberof CommentsCreateRequest + */ + parentCommentId?: string; + /** + * The body of the comment. + * @type {object} + * @memberof CommentsCreateRequest + */ + data?: object; + /** + * The body of the comment in markdown. + * @type {string} + * @memberof CommentsCreateRequest + */ + text?: string; +} + +/** + * Check if a given object implements the CommentsCreateRequest interface. + */ +export function instanceOfCommentsCreateRequest(value: object): value is CommentsCreateRequest { + if (!('documentId' in value) || value['documentId'] === undefined) return false; + return true; +} + +export function CommentsCreateRequestFromJSON(json: any): CommentsCreateRequest { + return CommentsCreateRequestFromJSONTyped(json, false); +} + +export function CommentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsCreateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentId': json['documentId'], + 'parentCommentId': json['parentCommentId'] == null ? undefined : json['parentCommentId'], + 'data': json['data'] == null ? undefined : json['data'], + 'text': json['text'] == null ? undefined : json['text'], + }; +} + +export function CommentsCreateRequestToJSON(json: any): CommentsCreateRequest { + return CommentsCreateRequestToJSONTyped(json, false); +} + +export function CommentsCreateRequestToJSONTyped(value?: CommentsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'documentId': value['documentId'], + 'parentCommentId': value['parentCommentId'], + 'data': value['data'], + 'text': value['text'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsInfo200Response.ts b/src/gen/api/outline/models/CommentsInfo200Response.ts new file mode 100644 index 0000000..3e1915e --- /dev/null +++ b/src/gen/api/outline/models/CommentsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; + +/** + * + * @export + * @interface CommentsInfo200Response + */ +export interface CommentsInfo200Response { + /** + * + * @type {Comment} + * @memberof CommentsInfo200Response + */ + data?: Comment; + /** + * + * @type {Array} + * @memberof CommentsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the CommentsInfo200Response interface. + */ +export function instanceOfCommentsInfo200Response(value: object): value is CommentsInfo200Response { + return true; +} + +export function CommentsInfo200ResponseFromJSON(json: any): CommentsInfo200Response { + return CommentsInfo200ResponseFromJSONTyped(json, false); +} + +export function CommentsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : CommentFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function CommentsInfo200ResponseToJSON(json: any): CommentsInfo200Response { + return CommentsInfo200ResponseToJSONTyped(json, false); +} + +export function CommentsInfo200ResponseToJSONTyped(value?: CommentsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': CommentToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/CommentsInfoRequest.ts b/src/gen/api/outline/models/CommentsInfoRequest.ts new file mode 100644 index 0000000..5ce8e1b --- /dev/null +++ b/src/gen/api/outline/models/CommentsInfoRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsInfoRequest + */ +export interface CommentsInfoRequest { + /** + * + * @type {string} + * @memberof CommentsInfoRequest + */ + id: string; + /** + * Include the document text that the comment is anchored to, if any, in the response. + * @type {boolean} + * @memberof CommentsInfoRequest + */ + includeAnchorText?: boolean; +} + +/** + * Check if a given object implements the CommentsInfoRequest interface. + */ +export function instanceOfCommentsInfoRequest(value: object): value is CommentsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function CommentsInfoRequestFromJSON(json: any): CommentsInfoRequest { + return CommentsInfoRequestFromJSONTyped(json, false); +} + +export function CommentsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'includeAnchorText': json['includeAnchorText'] == null ? undefined : json['includeAnchorText'], + }; +} + +export function CommentsInfoRequestToJSON(json: any): CommentsInfoRequest { + return CommentsInfoRequestToJSONTyped(json, false); +} + +export function CommentsInfoRequestToJSONTyped(value?: CommentsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'includeAnchorText': value['includeAnchorText'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsList200Response.ts b/src/gen/api/outline/models/CommentsList200Response.ts new file mode 100644 index 0000000..e44ebd3 --- /dev/null +++ b/src/gen/api/outline/models/CommentsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Comment } from './Comment'; +import { + CommentFromJSON, + CommentFromJSONTyped, + CommentToJSON, + CommentToJSONTyped, +} from './Comment'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; + +/** + * + * @export + * @interface CommentsList200Response + */ +export interface CommentsList200Response { + /** + * + * @type {Array} + * @memberof CommentsList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof CommentsList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof CommentsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the CommentsList200Response interface. + */ +export function instanceOfCommentsList200Response(value: object): value is CommentsList200Response { + return true; +} + +export function CommentsList200ResponseFromJSON(json: any): CommentsList200Response { + return CommentsList200ResponseFromJSONTyped(json, false); +} + +export function CommentsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(CommentFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function CommentsList200ResponseToJSON(json: any): CommentsList200Response { + return CommentsList200ResponseToJSONTyped(json, false); +} + +export function CommentsList200ResponseToJSONTyped(value?: CommentsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(CommentToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/CommentsListRequest.ts b/src/gen/api/outline/models/CommentsListRequest.ts new file mode 100644 index 0000000..c7e405b --- /dev/null +++ b/src/gen/api/outline/models/CommentsListRequest.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsListRequest + */ +export interface CommentsListRequest { + /** + * + * @type {number} + * @memberof CommentsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof CommentsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof CommentsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof CommentsListRequest + */ + direction?: CommentsListRequestDirectionEnum; + /** + * Filter to a specific document + * @type {string} + * @memberof CommentsListRequest + */ + documentId?: string; + /** + * Filter to a specific collection + * @type {string} + * @memberof CommentsListRequest + */ + collectionId?: string; + /** + * Include the document text that the comment is anchored to, if any, in the response. + * @type {boolean} + * @memberof CommentsListRequest + */ + includeAnchorText?: boolean; +} + + +/** + * @export + */ +export const CommentsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type CommentsListRequestDirectionEnum = typeof CommentsListRequestDirectionEnum[keyof typeof CommentsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the CommentsListRequest interface. + */ +export function instanceOfCommentsListRequest(value: object): value is CommentsListRequest { + return true; +} + +export function CommentsListRequestFromJSON(json: any): CommentsListRequest { + return CommentsListRequestFromJSONTyped(json, false); +} + +export function CommentsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'includeAnchorText': json['includeAnchorText'] == null ? undefined : json['includeAnchorText'], + }; +} + +export function CommentsListRequestToJSON(json: any): CommentsListRequest { + return CommentsListRequestToJSONTyped(json, false); +} + +export function CommentsListRequestToJSONTyped(value?: CommentsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'documentId': value['documentId'], + 'collectionId': value['collectionId'], + 'includeAnchorText': value['includeAnchorText'], + }; +} + diff --git a/src/gen/api/outline/models/CommentsUpdateRequest.ts b/src/gen/api/outline/models/CommentsUpdateRequest.ts new file mode 100644 index 0000000..7c029ae --- /dev/null +++ b/src/gen/api/outline/models/CommentsUpdateRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface CommentsUpdateRequest + */ +export interface CommentsUpdateRequest { + /** + * + * @type {string} + * @memberof CommentsUpdateRequest + */ + id: string; + /** + * + * @type {object} + * @memberof CommentsUpdateRequest + */ + data: object; +} + +/** + * Check if a given object implements the CommentsUpdateRequest interface. + */ +export function instanceOfCommentsUpdateRequest(value: object): value is CommentsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('data' in value) || value['data'] === undefined) return false; + return true; +} + +export function CommentsUpdateRequestFromJSON(json: any): CommentsUpdateRequest { + return CommentsUpdateRequestFromJSONTyped(json, false); +} + +export function CommentsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CommentsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'data': json['data'], + }; +} + +export function CommentsUpdateRequestToJSON(json: any): CommentsUpdateRequest { + return CommentsUpdateRequestToJSONTyped(json, false); +} + +export function CommentsUpdateRequestToJSONTyped(value?: CommentsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'data': value['data'], + }; +} + diff --git a/src/gen/api/outline/models/Document.ts b/src/gen/api/outline/models/Document.ts new file mode 100644 index 0000000..9c9b4a5 --- /dev/null +++ b/src/gen/api/outline/models/Document.ts @@ -0,0 +1,218 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Document + */ +export interface Document { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Document + */ + readonly id?: string; + /** + * Identifier for the associated collection. + * @type {string} + * @memberof Document + */ + collectionId?: string; + /** + * Identifier for the document this is a child of, if any. + * @type {string} + * @memberof Document + */ + parentDocumentId?: string; + /** + * The title of the document. + * @type {string} + * @memberof Document + */ + title?: string; + /** + * Whether this document should be displayed in a full-width view. + * @type {boolean} + * @memberof Document + */ + fullWidth?: boolean; + /** + * An emoji associated with the document. + * @type {string} + * @memberof Document + */ + emoji?: string; + /** + * The text content of the document, contains markdown formatting + * @type {string} + * @memberof Document + */ + text?: string; + /** + * A short unique ID that can be used to identify the document as an alternative to the UUID + * @type {string} + * @memberof Document + */ + urlId?: string; + /** + * + * @type {Array} + * @memberof Document + */ + collaborators?: Array; + /** + * Whether this document is pinned in the collection + * @type {boolean} + * @memberof Document + */ + pinned?: boolean; + /** + * Whether this document is a template + * @type {boolean} + * @memberof Document + */ + template?: boolean; + /** + * Unique identifier for the template this document was created from, if any + * @type {string} + * @memberof Document + */ + templateId?: string; + /** + * A number that is auto incrementing with every revision of the document that is saved + * @type {number} + * @memberof Document + */ + readonly revision?: number; + /** + * The date and time that this object was created + * @type {Date} + * @memberof Document + */ + readonly createdAt?: Date; + /** + * + * @type {User} + * @memberof Document + */ + createdBy?: User; + /** + * The date and time that this object was last changed + * @type {Date} + * @memberof Document + */ + readonly updatedAt?: Date; + /** + * + * @type {User} + * @memberof Document + */ + updatedBy?: User; + /** + * The date and time that this object was published + * @type {Date} + * @memberof Document + */ + readonly publishedAt?: Date | null; + /** + * The date and time that this object was archived + * @type {Date} + * @memberof Document + */ + readonly archivedAt?: Date; + /** + * The date and time that this object was deleted + * @type {Date} + * @memberof Document + */ + readonly deletedAt?: Date | null; +} + +/** + * Check if a given object implements the Document interface. + */ +export function instanceOfDocument(value: object): value is Document { + return true; +} + +export function DocumentFromJSON(json: any): Document { + return DocumentFromJSONTyped(json, false); +} + +export function DocumentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Document { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'], + 'title': json['title'] == null ? undefined : json['title'], + 'fullWidth': json['fullWidth'] == null ? undefined : json['fullWidth'], + 'emoji': json['emoji'] == null ? undefined : json['emoji'], + 'text': json['text'] == null ? undefined : json['text'], + 'urlId': json['urlId'] == null ? undefined : json['urlId'], + 'collaborators': json['collaborators'] == null ? undefined : ((json['collaborators'] as Array).map(UserFromJSON)), + 'pinned': json['pinned'] == null ? undefined : json['pinned'], + 'template': json['template'] == null ? undefined : json['template'], + 'templateId': json['templateId'] == null ? undefined : json['templateId'], + 'revision': json['revision'] == null ? undefined : json['revision'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'updatedBy': json['updatedBy'] == null ? undefined : UserFromJSON(json['updatedBy']), + 'publishedAt': json['publishedAt'] == null ? undefined : (new Date(json['publishedAt'])), + 'archivedAt': json['archivedAt'] == null ? undefined : (new Date(json['archivedAt'])), + 'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])), + }; +} + +export function DocumentToJSON(json: any): Document { + return DocumentToJSONTyped(json, false); +} + +export function DocumentToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'collectionId': value['collectionId'], + 'parentDocumentId': value['parentDocumentId'], + 'title': value['title'], + 'fullWidth': value['fullWidth'], + 'emoji': value['emoji'], + 'text': value['text'], + 'urlId': value['urlId'], + 'collaborators': value['collaborators'] == null ? undefined : ((value['collaborators'] as Array).map(UserToJSON)), + 'pinned': value['pinned'], + 'template': value['template'], + 'templateId': value['templateId'], + 'createdBy': UserToJSON(value['createdBy']), + 'updatedBy': UserToJSON(value['updatedBy']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsAddUserRequest.ts b/src/gen/api/outline/models/DocumentsAddUserRequest.ts new file mode 100644 index 0000000..5bb773d --- /dev/null +++ b/src/gen/api/outline/models/DocumentsAddUserRequest.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface DocumentsAddUserRequest + */ +export interface DocumentsAddUserRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsAddUserRequest + */ + id: string; + /** + * + * @type {string} + * @memberof DocumentsAddUserRequest + */ + userId: string; + /** + * + * @type {Permission} + * @memberof DocumentsAddUserRequest + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the DocumentsAddUserRequest interface. + */ +export function instanceOfDocumentsAddUserRequest(value: object): value is DocumentsAddUserRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; +} + +export function DocumentsAddUserRequestFromJSON(json: any): DocumentsAddUserRequest { + return DocumentsAddUserRequestFromJSONTyped(json, false); +} + +export function DocumentsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAddUserRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function DocumentsAddUserRequestToJSON(json: any): DocumentsAddUserRequest { + return DocumentsAddUserRequestToJSONTyped(json, false); +} + +export function DocumentsAddUserRequestToJSONTyped(value?: DocumentsAddUserRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsAnswerquestion200Response.ts b/src/gen/api/outline/models/DocumentsAnswerquestion200Response.ts new file mode 100644 index 0000000..9322b0c --- /dev/null +++ b/src/gen/api/outline/models/DocumentsAnswerquestion200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { SearchResult } from './SearchResult'; +import { + SearchResultFromJSON, + SearchResultFromJSONTyped, + SearchResultToJSON, + SearchResultToJSONTyped, +} from './SearchResult'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface DocumentsAnswerquestion200Response + */ +export interface DocumentsAnswerquestion200Response { + /** + * + * @type {Array} + * @memberof DocumentsAnswerquestion200Response + */ + documents?: Array; + /** + * + * @type {Array} + * @memberof DocumentsAnswerquestion200Response + */ + policies?: Array; + /** + * + * @type {SearchResult} + * @memberof DocumentsAnswerquestion200Response + */ + search?: SearchResult; +} + +/** + * Check if a given object implements the DocumentsAnswerquestion200Response interface. + */ +export function instanceOfDocumentsAnswerquestion200Response(value: object): value is DocumentsAnswerquestion200Response { + return true; +} + +export function DocumentsAnswerquestion200ResponseFromJSON(json: any): DocumentsAnswerquestion200Response { + return DocumentsAnswerquestion200ResponseFromJSONTyped(json, false); +} + +export function DocumentsAnswerquestion200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAnswerquestion200Response { + if (json == null) { + return json; + } + return { + + 'documents': json['documents'] == null ? undefined : ((json['documents'] as Array).map(DocumentFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'search': json['search'] == null ? undefined : SearchResultFromJSON(json['search']), + }; +} + +export function DocumentsAnswerquestion200ResponseToJSON(json: any): DocumentsAnswerquestion200Response { + return DocumentsAnswerquestion200ResponseToJSONTyped(json, false); +} + +export function DocumentsAnswerquestion200ResponseToJSONTyped(value?: DocumentsAnswerquestion200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documents': value['documents'] == null ? undefined : ((value['documents'] as Array).map(DocumentToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'search': SearchResultToJSON(value['search']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsAnswerquestionRequest.ts b/src/gen/api/outline/models/DocumentsAnswerquestionRequest.ts new file mode 100644 index 0000000..a0afc31 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsAnswerquestionRequest.ts @@ -0,0 +1,128 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsAnswerquestionRequest + */ +export interface DocumentsAnswerquestionRequest { + /** + * + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + query?: string; + /** + * Any documents that have not been edited by the user identifier will be filtered out + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + userId?: string; + /** + * A collection to search within + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + collectionId?: string; + /** + * A document to search within + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + documentId?: string; + /** + * Any documents that are not in the specified status will be filtered out + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + statusFilter?: DocumentsAnswerquestionRequestStatusFilterEnum; + /** + * Any documents that have not been updated within the specified period will be filtered out + * @type {string} + * @memberof DocumentsAnswerquestionRequest + */ + dateFilter?: DocumentsAnswerquestionRequestDateFilterEnum; +} + + +/** + * @export + */ +export const DocumentsAnswerquestionRequestStatusFilterEnum = { + Draft: 'draft', + Archived: 'archived', + Published: 'published' +} as const; +export type DocumentsAnswerquestionRequestStatusFilterEnum = typeof DocumentsAnswerquestionRequestStatusFilterEnum[keyof typeof DocumentsAnswerquestionRequestStatusFilterEnum]; + +/** + * @export + */ +export const DocumentsAnswerquestionRequestDateFilterEnum = { + Day: 'day', + Week: 'week', + Month: 'month', + Year: 'year' +} as const; +export type DocumentsAnswerquestionRequestDateFilterEnum = typeof DocumentsAnswerquestionRequestDateFilterEnum[keyof typeof DocumentsAnswerquestionRequestDateFilterEnum]; + + +/** + * Check if a given object implements the DocumentsAnswerquestionRequest interface. + */ +export function instanceOfDocumentsAnswerquestionRequest(value: object): value is DocumentsAnswerquestionRequest { + return true; +} + +export function DocumentsAnswerquestionRequestFromJSON(json: any): DocumentsAnswerquestionRequest { + return DocumentsAnswerquestionRequestFromJSONTyped(json, false); +} + +export function DocumentsAnswerquestionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsAnswerquestionRequest { + if (json == null) { + return json; + } + return { + + 'query': json['query'] == null ? undefined : json['query'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'statusFilter': json['statusFilter'] == null ? undefined : json['statusFilter'], + 'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'], + }; +} + +export function DocumentsAnswerquestionRequestToJSON(json: any): DocumentsAnswerquestionRequest { + return DocumentsAnswerquestionRequestToJSONTyped(json, false); +} + +export function DocumentsAnswerquestionRequestToJSONTyped(value?: DocumentsAnswerquestionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'query': value['query'], + 'userId': value['userId'], + 'collectionId': value['collectionId'], + 'documentId': value['documentId'], + 'statusFilter': value['statusFilter'], + 'dateFilter': value['dateFilter'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsCreateRequest.ts b/src/gen/api/outline/models/DocumentsCreateRequest.ts new file mode 100644 index 0000000..d4f784e --- /dev/null +++ b/src/gen/api/outline/models/DocumentsCreateRequest.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsCreateRequest + */ +export interface DocumentsCreateRequest { + /** + * + * @type {string} + * @memberof DocumentsCreateRequest + */ + title: string; + /** + * The body of the document in markdown + * @type {string} + * @memberof DocumentsCreateRequest + */ + text?: string; + /** + * + * @type {string} + * @memberof DocumentsCreateRequest + */ + collectionId: string; + /** + * + * @type {string} + * @memberof DocumentsCreateRequest + */ + parentDocumentId?: string; + /** + * + * @type {string} + * @memberof DocumentsCreateRequest + */ + templateId?: string; + /** + * Whether this document should be considered to be a template. + * @type {boolean} + * @memberof DocumentsCreateRequest + */ + template?: boolean; + /** + * Whether this document should be immediately published and made visible to other team members. + * @type {boolean} + * @memberof DocumentsCreateRequest + */ + publish?: boolean; +} + +/** + * Check if a given object implements the DocumentsCreateRequest interface. + */ +export function instanceOfDocumentsCreateRequest(value: object): value is DocumentsCreateRequest { + if (!('title' in value) || value['title'] === undefined) return false; + if (!('collectionId' in value) || value['collectionId'] === undefined) return false; + return true; +} + +export function DocumentsCreateRequestFromJSON(json: any): DocumentsCreateRequest { + return DocumentsCreateRequestFromJSONTyped(json, false); +} + +export function DocumentsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsCreateRequest { + if (json == null) { + return json; + } + return { + + 'title': json['title'], + 'text': json['text'] == null ? undefined : json['text'], + 'collectionId': json['collectionId'], + 'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'], + 'templateId': json['templateId'] == null ? undefined : json['templateId'], + 'template': json['template'] == null ? undefined : json['template'], + 'publish': json['publish'] == null ? undefined : json['publish'], + }; +} + +export function DocumentsCreateRequestToJSON(json: any): DocumentsCreateRequest { + return DocumentsCreateRequestToJSONTyped(json, false); +} + +export function DocumentsCreateRequestToJSONTyped(value?: DocumentsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'title': value['title'], + 'text': value['text'], + 'collectionId': value['collectionId'], + 'parentDocumentId': value['parentDocumentId'], + 'templateId': value['templateId'], + 'template': value['template'], + 'publish': value['publish'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsDeleteRequest.ts b/src/gen/api/outline/models/DocumentsDeleteRequest.ts new file mode 100644 index 0000000..466d2ec --- /dev/null +++ b/src/gen/api/outline/models/DocumentsDeleteRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsDeleteRequest + */ +export interface DocumentsDeleteRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsDeleteRequest + */ + id: string; + /** + * If set to true the document will be destroyed with no way to recover rather than moved to the trash. + * @type {boolean} + * @memberof DocumentsDeleteRequest + */ + permanent?: boolean; +} + +/** + * Check if a given object implements the DocumentsDeleteRequest interface. + */ +export function instanceOfDocumentsDeleteRequest(value: object): value is DocumentsDeleteRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsDeleteRequestFromJSON(json: any): DocumentsDeleteRequest { + return DocumentsDeleteRequestFromJSONTyped(json, false); +} + +export function DocumentsDeleteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsDeleteRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'permanent': json['permanent'] == null ? undefined : json['permanent'], + }; +} + +export function DocumentsDeleteRequestToJSON(json: any): DocumentsDeleteRequest { + return DocumentsDeleteRequestToJSONTyped(json, false); +} + +export function DocumentsDeleteRequestToJSONTyped(value?: DocumentsDeleteRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'permanent': value['permanent'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsDraftsRequest.ts b/src/gen/api/outline/models/DocumentsDraftsRequest.ts new file mode 100644 index 0000000..0b37f2f --- /dev/null +++ b/src/gen/api/outline/models/DocumentsDraftsRequest.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsDraftsRequest + */ +export interface DocumentsDraftsRequest { + /** + * + * @type {number} + * @memberof DocumentsDraftsRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof DocumentsDraftsRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof DocumentsDraftsRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof DocumentsDraftsRequest + */ + direction?: DocumentsDraftsRequestDirectionEnum; + /** + * A collection to search within + * @type {string} + * @memberof DocumentsDraftsRequest + */ + collectionId?: string; + /** + * Any documents that have not been updated within the specified period will be filtered out + * @type {string} + * @memberof DocumentsDraftsRequest + */ + dateFilter?: DocumentsDraftsRequestDateFilterEnum; +} + + +/** + * @export + */ +export const DocumentsDraftsRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type DocumentsDraftsRequestDirectionEnum = typeof DocumentsDraftsRequestDirectionEnum[keyof typeof DocumentsDraftsRequestDirectionEnum]; + +/** + * @export + */ +export const DocumentsDraftsRequestDateFilterEnum = { + Day: 'day', + Week: 'week', + Month: 'month', + Year: 'year' +} as const; +export type DocumentsDraftsRequestDateFilterEnum = typeof DocumentsDraftsRequestDateFilterEnum[keyof typeof DocumentsDraftsRequestDateFilterEnum]; + + +/** + * Check if a given object implements the DocumentsDraftsRequest interface. + */ +export function instanceOfDocumentsDraftsRequest(value: object): value is DocumentsDraftsRequest { + return true; +} + +export function DocumentsDraftsRequestFromJSON(json: any): DocumentsDraftsRequest { + return DocumentsDraftsRequestFromJSONTyped(json, false); +} + +export function DocumentsDraftsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsDraftsRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'], + }; +} + +export function DocumentsDraftsRequestToJSON(json: any): DocumentsDraftsRequest { + return DocumentsDraftsRequestToJSONTyped(json, false); +} + +export function DocumentsDraftsRequestToJSONTyped(value?: DocumentsDraftsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'collectionId': value['collectionId'], + 'dateFilter': value['dateFilter'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsExport200Response.ts b/src/gen/api/outline/models/DocumentsExport200Response.ts new file mode 100644 index 0000000..d59ffa7 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsExport200Response.ts @@ -0,0 +1,65 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsExport200Response + */ +export interface DocumentsExport200Response { + /** + * The document content in Markdown formatting + * @type {string} + * @memberof DocumentsExport200Response + */ + data?: string; +} + +/** + * Check if a given object implements the DocumentsExport200Response interface. + */ +export function instanceOfDocumentsExport200Response(value: object): value is DocumentsExport200Response { + return true; +} + +export function DocumentsExport200ResponseFromJSON(json: any): DocumentsExport200Response { + return DocumentsExport200ResponseFromJSONTyped(json, false); +} + +export function DocumentsExport200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsExport200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : json['data'], + }; +} + +export function DocumentsExport200ResponseToJSON(json: any): DocumentsExport200Response { + return DocumentsExport200ResponseToJSONTyped(json, false); +} + +export function DocumentsExport200ResponseToJSONTyped(value?: DocumentsExport200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsExportRequest.ts b/src/gen/api/outline/models/DocumentsExportRequest.ts new file mode 100644 index 0000000..32cf3b2 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsExportRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsExportRequest + */ +export interface DocumentsExportRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsExportRequest + */ + id: string; +} + +/** + * Check if a given object implements the DocumentsExportRequest interface. + */ +export function instanceOfDocumentsExportRequest(value: object): value is DocumentsExportRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsExportRequestFromJSON(json: any): DocumentsExportRequest { + return DocumentsExportRequestFromJSONTyped(json, false); +} + +export function DocumentsExportRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsExportRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function DocumentsExportRequestToJSON(json: any): DocumentsExportRequest { + return DocumentsExportRequestToJSONTyped(json, false); +} + +export function DocumentsExportRequestToJSONTyped(value?: DocumentsExportRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsInfo200Response.ts b/src/gen/api/outline/models/DocumentsInfo200Response.ts new file mode 100644 index 0000000..7eac792 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface DocumentsInfo200Response + */ +export interface DocumentsInfo200Response { + /** + * + * @type {Document} + * @memberof DocumentsInfo200Response + */ + data?: Document; + /** + * + * @type {Array} + * @memberof DocumentsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the DocumentsInfo200Response interface. + */ +export function instanceOfDocumentsInfo200Response(value: object): value is DocumentsInfo200Response { + return true; +} + +export function DocumentsInfo200ResponseFromJSON(json: any): DocumentsInfo200Response { + return DocumentsInfo200ResponseFromJSONTyped(json, false); +} + +export function DocumentsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : DocumentFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function DocumentsInfo200ResponseToJSON(json: any): DocumentsInfo200Response { + return DocumentsInfo200ResponseToJSONTyped(json, false); +} + +export function DocumentsInfo200ResponseToJSONTyped(value?: DocumentsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': DocumentToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsInfoRequest.ts b/src/gen/api/outline/models/DocumentsInfoRequest.ts new file mode 100644 index 0000000..f2f6eac --- /dev/null +++ b/src/gen/api/outline/models/DocumentsInfoRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsInfoRequest + */ +export interface DocumentsInfoRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsInfoRequest + */ + id?: string; + /** + * Unique identifier for a document share, a shareId may be used in place of a document UUID + * @type {string} + * @memberof DocumentsInfoRequest + */ + shareId?: string; +} + +/** + * Check if a given object implements the DocumentsInfoRequest interface. + */ +export function instanceOfDocumentsInfoRequest(value: object): value is DocumentsInfoRequest { + return true; +} + +export function DocumentsInfoRequestFromJSON(json: any): DocumentsInfoRequest { + return DocumentsInfoRequestFromJSONTyped(json, false); +} + +export function DocumentsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'shareId': json['shareId'] == null ? undefined : json['shareId'], + }; +} + +export function DocumentsInfoRequestToJSON(json: any): DocumentsInfoRequest { + return DocumentsInfoRequestToJSONTyped(json, false); +} + +export function DocumentsInfoRequestToJSONTyped(value?: DocumentsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'shareId': value['shareId'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsList200Response.ts b/src/gen/api/outline/models/DocumentsList200Response.ts new file mode 100644 index 0000000..5021d39 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface DocumentsList200Response + */ +export interface DocumentsList200Response { + /** + * + * @type {Array} + * @memberof DocumentsList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof DocumentsList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof DocumentsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the DocumentsList200Response interface. + */ +export function instanceOfDocumentsList200Response(value: object): value is DocumentsList200Response { + return true; +} + +export function DocumentsList200ResponseFromJSON(json: any): DocumentsList200Response { + return DocumentsList200ResponseFromJSONTyped(json, false); +} + +export function DocumentsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(DocumentFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function DocumentsList200ResponseToJSON(json: any): DocumentsList200Response { + return DocumentsList200ResponseToJSONTyped(json, false); +} + +export function DocumentsList200ResponseToJSONTyped(value?: DocumentsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(DocumentToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsListRequest.ts b/src/gen/api/outline/models/DocumentsListRequest.ts new file mode 100644 index 0000000..e79bef2 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsListRequest.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsListRequest + */ +export interface DocumentsListRequest { + /** + * + * @type {number} + * @memberof DocumentsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof DocumentsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof DocumentsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof DocumentsListRequest + */ + direction?: DocumentsListRequestDirectionEnum; + /** + * Optionally filter to a specific collection + * @type {string} + * @memberof DocumentsListRequest + */ + collectionId?: string; + /** + * + * @type {string} + * @memberof DocumentsListRequest + */ + userId?: string; + /** + * + * @type {string} + * @memberof DocumentsListRequest + */ + backlinkDocumentId?: string; + /** + * + * @type {string} + * @memberof DocumentsListRequest + */ + parentDocumentId?: string; + /** + * Optionally filter to only templates + * @type {boolean} + * @memberof DocumentsListRequest + */ + template?: boolean; +} + + +/** + * @export + */ +export const DocumentsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type DocumentsListRequestDirectionEnum = typeof DocumentsListRequestDirectionEnum[keyof typeof DocumentsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the DocumentsListRequest interface. + */ +export function instanceOfDocumentsListRequest(value: object): value is DocumentsListRequest { + return true; +} + +export function DocumentsListRequestFromJSON(json: any): DocumentsListRequest { + return DocumentsListRequestFromJSONTyped(json, false); +} + +export function DocumentsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'backlinkDocumentId': json['backlinkDocumentId'] == null ? undefined : json['backlinkDocumentId'], + 'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'], + 'template': json['template'] == null ? undefined : json['template'], + }; +} + +export function DocumentsListRequestToJSON(json: any): DocumentsListRequest { + return DocumentsListRequestToJSONTyped(json, false); +} + +export function DocumentsListRequestToJSONTyped(value?: DocumentsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'collectionId': value['collectionId'], + 'userId': value['userId'], + 'backlinkDocumentId': value['backlinkDocumentId'], + 'parentDocumentId': value['parentDocumentId'], + 'template': value['template'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsMembershipsRequest.ts b/src/gen/api/outline/models/DocumentsMembershipsRequest.ts new file mode 100644 index 0000000..604278a --- /dev/null +++ b/src/gen/api/outline/models/DocumentsMembershipsRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsMembershipsRequest + */ +export interface DocumentsMembershipsRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsMembershipsRequest + */ + id: string; + /** + * If set, will filter the results by user name + * @type {string} + * @memberof DocumentsMembershipsRequest + */ + query?: string; +} + +/** + * Check if a given object implements the DocumentsMembershipsRequest interface. + */ +export function instanceOfDocumentsMembershipsRequest(value: object): value is DocumentsMembershipsRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsMembershipsRequestFromJSON(json: any): DocumentsMembershipsRequest { + return DocumentsMembershipsRequestFromJSONTyped(json, false); +} + +export function DocumentsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMembershipsRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'query': json['query'] == null ? undefined : json['query'], + }; +} + +export function DocumentsMembershipsRequestToJSON(json: any): DocumentsMembershipsRequest { + return DocumentsMembershipsRequestToJSONTyped(json, false); +} + +export function DocumentsMembershipsRequestToJSONTyped(value?: DocumentsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'query': value['query'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsMove200Response.ts b/src/gen/api/outline/models/DocumentsMove200Response.ts new file mode 100644 index 0000000..d00eccc --- /dev/null +++ b/src/gen/api/outline/models/DocumentsMove200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { DocumentsMove200ResponseData } from './DocumentsMove200ResponseData'; +import { + DocumentsMove200ResponseDataFromJSON, + DocumentsMove200ResponseDataFromJSONTyped, + DocumentsMove200ResponseDataToJSON, + DocumentsMove200ResponseDataToJSONTyped, +} from './DocumentsMove200ResponseData'; + +/** + * + * @export + * @interface DocumentsMove200Response + */ +export interface DocumentsMove200Response { + /** + * + * @type {DocumentsMove200ResponseData} + * @memberof DocumentsMove200Response + */ + data?: DocumentsMove200ResponseData; + /** + * + * @type {Array} + * @memberof DocumentsMove200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the DocumentsMove200Response interface. + */ +export function instanceOfDocumentsMove200Response(value: object): value is DocumentsMove200Response { + return true; +} + +export function DocumentsMove200ResponseFromJSON(json: any): DocumentsMove200Response { + return DocumentsMove200ResponseFromJSONTyped(json, false); +} + +export function DocumentsMove200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMove200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : DocumentsMove200ResponseDataFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function DocumentsMove200ResponseToJSON(json: any): DocumentsMove200Response { + return DocumentsMove200ResponseToJSONTyped(json, false); +} + +export function DocumentsMove200ResponseToJSONTyped(value?: DocumentsMove200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': DocumentsMove200ResponseDataToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsMove200ResponseData.ts b/src/gen/api/outline/models/DocumentsMove200ResponseData.ts new file mode 100644 index 0000000..b7ccbe9 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsMove200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Collection } from './Collection'; +import { + CollectionFromJSON, + CollectionFromJSONTyped, + CollectionToJSON, + CollectionToJSONTyped, +} from './Collection'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface DocumentsMove200ResponseData + */ +export interface DocumentsMove200ResponseData { + /** + * + * @type {Array} + * @memberof DocumentsMove200ResponseData + */ + documents?: Array; + /** + * + * @type {Array} + * @memberof DocumentsMove200ResponseData + */ + collections?: Array; +} + +/** + * Check if a given object implements the DocumentsMove200ResponseData interface. + */ +export function instanceOfDocumentsMove200ResponseData(value: object): value is DocumentsMove200ResponseData { + return true; +} + +export function DocumentsMove200ResponseDataFromJSON(json: any): DocumentsMove200ResponseData { + return DocumentsMove200ResponseDataFromJSONTyped(json, false); +} + +export function DocumentsMove200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMove200ResponseData { + if (json == null) { + return json; + } + return { + + 'documents': json['documents'] == null ? undefined : ((json['documents'] as Array).map(DocumentFromJSON)), + 'collections': json['collections'] == null ? undefined : ((json['collections'] as Array).map(CollectionFromJSON)), + }; +} + +export function DocumentsMove200ResponseDataToJSON(json: any): DocumentsMove200ResponseData { + return DocumentsMove200ResponseDataToJSONTyped(json, false); +} + +export function DocumentsMove200ResponseDataToJSONTyped(value?: DocumentsMove200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documents': value['documents'] == null ? undefined : ((value['documents'] as Array).map(DocumentToJSON)), + 'collections': value['collections'] == null ? undefined : ((value['collections'] as Array).map(CollectionToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsMoveRequest.ts b/src/gen/api/outline/models/DocumentsMoveRequest.ts new file mode 100644 index 0000000..55e42f4 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsMoveRequest.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsMoveRequest + */ +export interface DocumentsMoveRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsMoveRequest + */ + id: string; + /** + * + * @type {string} + * @memberof DocumentsMoveRequest + */ + collectionId?: string; + /** + * + * @type {string} + * @memberof DocumentsMoveRequest + */ + parentDocumentId?: string; +} + +/** + * Check if a given object implements the DocumentsMoveRequest interface. + */ +export function instanceOfDocumentsMoveRequest(value: object): value is DocumentsMoveRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsMoveRequestFromJSON(json: any): DocumentsMoveRequest { + return DocumentsMoveRequestFromJSONTyped(json, false); +} + +export function DocumentsMoveRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsMoveRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'parentDocumentId': json['parentDocumentId'] == null ? undefined : json['parentDocumentId'], + }; +} + +export function DocumentsMoveRequestToJSON(json: any): DocumentsMoveRequest { + return DocumentsMoveRequestToJSONTyped(json, false); +} + +export function DocumentsMoveRequestToJSONTyped(value?: DocumentsMoveRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'collectionId': value['collectionId'], + 'parentDocumentId': value['parentDocumentId'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsRemoveUserRequest.ts b/src/gen/api/outline/models/DocumentsRemoveUserRequest.ts new file mode 100644 index 0000000..42d9973 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsRemoveUserRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsRemoveUserRequest + */ +export interface DocumentsRemoveUserRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsRemoveUserRequest + */ + id: string; + /** + * + * @type {string} + * @memberof DocumentsRemoveUserRequest + */ + userId: string; +} + +/** + * Check if a given object implements the DocumentsRemoveUserRequest interface. + */ +export function instanceOfDocumentsRemoveUserRequest(value: object): value is DocumentsRemoveUserRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; +} + +export function DocumentsRemoveUserRequestFromJSON(json: any): DocumentsRemoveUserRequest { + return DocumentsRemoveUserRequestFromJSONTyped(json, false); +} + +export function DocumentsRemoveUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsRemoveUserRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + }; +} + +export function DocumentsRemoveUserRequestToJSON(json: any): DocumentsRemoveUserRequest { + return DocumentsRemoveUserRequestToJSONTyped(json, false); +} + +export function DocumentsRemoveUserRequestToJSONTyped(value?: DocumentsRemoveUserRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsRestoreRequest.ts b/src/gen/api/outline/models/DocumentsRestoreRequest.ts new file mode 100644 index 0000000..22f36c8 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsRestoreRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsRestoreRequest + */ +export interface DocumentsRestoreRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsRestoreRequest + */ + id: string; + /** + * Identifier for the revision to restore to. + * @type {string} + * @memberof DocumentsRestoreRequest + */ + revisionId?: string; +} + +/** + * Check if a given object implements the DocumentsRestoreRequest interface. + */ +export function instanceOfDocumentsRestoreRequest(value: object): value is DocumentsRestoreRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsRestoreRequestFromJSON(json: any): DocumentsRestoreRequest { + return DocumentsRestoreRequestFromJSONTyped(json, false); +} + +export function DocumentsRestoreRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsRestoreRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'revisionId': json['revisionId'] == null ? undefined : json['revisionId'], + }; +} + +export function DocumentsRestoreRequestToJSON(json: any): DocumentsRestoreRequest { + return DocumentsRestoreRequestToJSONTyped(json, false); +} + +export function DocumentsRestoreRequestToJSONTyped(value?: DocumentsRestoreRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'revisionId': value['revisionId'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsSearch200Response.ts b/src/gen/api/outline/models/DocumentsSearch200Response.ts new file mode 100644 index 0000000..98fcda7 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsSearch200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { DocumentsSearch200ResponseDataInner } from './DocumentsSearch200ResponseDataInner'; +import { + DocumentsSearch200ResponseDataInnerFromJSON, + DocumentsSearch200ResponseDataInnerFromJSONTyped, + DocumentsSearch200ResponseDataInnerToJSON, + DocumentsSearch200ResponseDataInnerToJSONTyped, +} from './DocumentsSearch200ResponseDataInner'; + +/** + * + * @export + * @interface DocumentsSearch200Response + */ +export interface DocumentsSearch200Response { + /** + * + * @type {Array} + * @memberof DocumentsSearch200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof DocumentsSearch200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof DocumentsSearch200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the DocumentsSearch200Response interface. + */ +export function instanceOfDocumentsSearch200Response(value: object): value is DocumentsSearch200Response { + return true; +} + +export function DocumentsSearch200ResponseFromJSON(json: any): DocumentsSearch200Response { + return DocumentsSearch200ResponseFromJSONTyped(json, false); +} + +export function DocumentsSearch200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearch200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(DocumentsSearch200ResponseDataInnerFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function DocumentsSearch200ResponseToJSON(json: any): DocumentsSearch200Response { + return DocumentsSearch200ResponseToJSONTyped(json, false); +} + +export function DocumentsSearch200ResponseToJSONTyped(value?: DocumentsSearch200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(DocumentsSearch200ResponseDataInnerToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsSearch200ResponseDataInner.ts b/src/gen/api/outline/models/DocumentsSearch200ResponseDataInner.ts new file mode 100644 index 0000000..3615645 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsSearch200ResponseDataInner.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface DocumentsSearch200ResponseDataInner + */ +export interface DocumentsSearch200ResponseDataInner { + /** + * A short snippet of context from the document that includes the search query. + * @type {string} + * @memberof DocumentsSearch200ResponseDataInner + */ + context?: string; + /** + * The ranking used to order search results based on relevance. + * @type {number} + * @memberof DocumentsSearch200ResponseDataInner + */ + ranking?: number; + /** + * + * @type {Document} + * @memberof DocumentsSearch200ResponseDataInner + */ + document?: Document; +} + +/** + * Check if a given object implements the DocumentsSearch200ResponseDataInner interface. + */ +export function instanceOfDocumentsSearch200ResponseDataInner(value: object): value is DocumentsSearch200ResponseDataInner { + return true; +} + +export function DocumentsSearch200ResponseDataInnerFromJSON(json: any): DocumentsSearch200ResponseDataInner { + return DocumentsSearch200ResponseDataInnerFromJSONTyped(json, false); +} + +export function DocumentsSearch200ResponseDataInnerFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearch200ResponseDataInner { + if (json == null) { + return json; + } + return { + + 'context': json['context'] == null ? undefined : json['context'], + 'ranking': json['ranking'] == null ? undefined : json['ranking'], + 'document': json['document'] == null ? undefined : DocumentFromJSON(json['document']), + }; +} + +export function DocumentsSearch200ResponseDataInnerToJSON(json: any): DocumentsSearch200ResponseDataInner { + return DocumentsSearch200ResponseDataInnerToJSONTyped(json, false); +} + +export function DocumentsSearch200ResponseDataInnerToJSONTyped(value?: DocumentsSearch200ResponseDataInner | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'context': value['context'], + 'ranking': value['ranking'], + 'document': DocumentToJSON(value['document']), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsSearchRequest.ts b/src/gen/api/outline/models/DocumentsSearchRequest.ts new file mode 100644 index 0000000..7e781b3 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsSearchRequest.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsSearchRequest + */ +export interface DocumentsSearchRequest { + /** + * + * @type {number} + * @memberof DocumentsSearchRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof DocumentsSearchRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof DocumentsSearchRequest + */ + query?: string; + /** + * Any documents that have not been edited by the user identifier will be filtered out + * @type {string} + * @memberof DocumentsSearchRequest + */ + userId?: string; + /** + * A collection to search within + * @type {string} + * @memberof DocumentsSearchRequest + */ + collectionId?: string; + /** + * A document to search within + * @type {string} + * @memberof DocumentsSearchRequest + */ + documentId?: string; + /** + * Any documents that are not in the specified status will be filtered out + * @type {string} + * @memberof DocumentsSearchRequest + */ + statusFilter?: DocumentsSearchRequestStatusFilterEnum; + /** + * Any documents that have not been updated within the specified period will be filtered out + * @type {string} + * @memberof DocumentsSearchRequest + */ + dateFilter?: DocumentsSearchRequestDateFilterEnum; +} + + +/** + * @export + */ +export const DocumentsSearchRequestStatusFilterEnum = { + Draft: 'draft', + Archived: 'archived', + Published: 'published' +} as const; +export type DocumentsSearchRequestStatusFilterEnum = typeof DocumentsSearchRequestStatusFilterEnum[keyof typeof DocumentsSearchRequestStatusFilterEnum]; + +/** + * @export + */ +export const DocumentsSearchRequestDateFilterEnum = { + Day: 'day', + Week: 'week', + Month: 'month', + Year: 'year' +} as const; +export type DocumentsSearchRequestDateFilterEnum = typeof DocumentsSearchRequestDateFilterEnum[keyof typeof DocumentsSearchRequestDateFilterEnum]; + + +/** + * Check if a given object implements the DocumentsSearchRequest interface. + */ +export function instanceOfDocumentsSearchRequest(value: object): value is DocumentsSearchRequest { + return true; +} + +export function DocumentsSearchRequestFromJSON(json: any): DocumentsSearchRequest { + return DocumentsSearchRequestFromJSONTyped(json, false); +} + +export function DocumentsSearchRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsSearchRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'query': json['query'] == null ? undefined : json['query'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'statusFilter': json['statusFilter'] == null ? undefined : json['statusFilter'], + 'dateFilter': json['dateFilter'] == null ? undefined : json['dateFilter'], + }; +} + +export function DocumentsSearchRequestToJSON(json: any): DocumentsSearchRequest { + return DocumentsSearchRequestToJSONTyped(json, false); +} + +export function DocumentsSearchRequestToJSONTyped(value?: DocumentsSearchRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'query': value['query'], + 'userId': value['userId'], + 'collectionId': value['collectionId'], + 'documentId': value['documentId'], + 'statusFilter': value['statusFilter'], + 'dateFilter': value['dateFilter'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsUnpublishRequest.ts b/src/gen/api/outline/models/DocumentsUnpublishRequest.ts new file mode 100644 index 0000000..fa3e894 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsUnpublishRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsUnpublishRequest + */ +export interface DocumentsUnpublishRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsUnpublishRequest + */ + id: string; +} + +/** + * Check if a given object implements the DocumentsUnpublishRequest interface. + */ +export function instanceOfDocumentsUnpublishRequest(value: object): value is DocumentsUnpublishRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsUnpublishRequestFromJSON(json: any): DocumentsUnpublishRequest { + return DocumentsUnpublishRequestFromJSONTyped(json, false); +} + +export function DocumentsUnpublishRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUnpublishRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function DocumentsUnpublishRequestToJSON(json: any): DocumentsUnpublishRequest { + return DocumentsUnpublishRequestToJSONTyped(json, false); +} + +export function DocumentsUnpublishRequestToJSONTyped(value?: DocumentsUnpublishRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsUpdateRequest.ts b/src/gen/api/outline/models/DocumentsUpdateRequest.ts new file mode 100644 index 0000000..d1c19b6 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsUpdateRequest.ts @@ -0,0 +1,106 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsUpdateRequest + */ +export interface DocumentsUpdateRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsUpdateRequest + */ + id: string; + /** + * The title of the document. + * @type {string} + * @memberof DocumentsUpdateRequest + */ + title?: string; + /** + * The body of the document in markdown. + * @type {string} + * @memberof DocumentsUpdateRequest + */ + text?: string; + /** + * If true the text field will be appended to the end of the existing document, rather than the default behavior of replacing it. This is potentially useful for things like logging into a document. + * @type {boolean} + * @memberof DocumentsUpdateRequest + */ + append?: boolean; + /** + * Whether this document should be published and made visible to other team members, if a draft + * @type {boolean} + * @memberof DocumentsUpdateRequest + */ + publish?: boolean; + /** + * Whether the editing session has finished, this will trigger any notifications. This property will soon be deprecated. + * @type {boolean} + * @memberof DocumentsUpdateRequest + */ + done?: boolean; +} + +/** + * Check if a given object implements the DocumentsUpdateRequest interface. + */ +export function instanceOfDocumentsUpdateRequest(value: object): value is DocumentsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsUpdateRequestFromJSON(json: any): DocumentsUpdateRequest { + return DocumentsUpdateRequestFromJSONTyped(json, false); +} + +export function DocumentsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'title': json['title'] == null ? undefined : json['title'], + 'text': json['text'] == null ? undefined : json['text'], + 'append': json['append'] == null ? undefined : json['append'], + 'publish': json['publish'] == null ? undefined : json['publish'], + 'done': json['done'] == null ? undefined : json['done'], + }; +} + +export function DocumentsUpdateRequestToJSON(json: any): DocumentsUpdateRequest { + return DocumentsUpdateRequestToJSONTyped(json, false); +} + +export function DocumentsUpdateRequestToJSONTyped(value?: DocumentsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'title': value['title'], + 'text': value['text'], + 'append': value['append'], + 'publish': value['publish'], + 'done': value['done'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsUsers200Response.ts b/src/gen/api/outline/models/DocumentsUsers200Response.ts new file mode 100644 index 0000000..109fc0e --- /dev/null +++ b/src/gen/api/outline/models/DocumentsUsers200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface DocumentsUsers200Response + */ +export interface DocumentsUsers200Response { + /** + * + * @type {Array} + * @memberof DocumentsUsers200Response + */ + data?: Array; + /** + * + * @type {Pagination} + * @memberof DocumentsUsers200Response + */ + pagination?: Pagination; + /** + * + * @type {Array} + * @memberof DocumentsUsers200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the DocumentsUsers200Response interface. + */ +export function instanceOfDocumentsUsers200Response(value: object): value is DocumentsUsers200Response { + return true; +} + +export function DocumentsUsers200ResponseFromJSON(json: any): DocumentsUsers200Response { + return DocumentsUsers200ResponseFromJSONTyped(json, false); +} + +export function DocumentsUsers200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUsers200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(UserFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function DocumentsUsers200ResponseToJSON(json: any): DocumentsUsers200Response { + return DocumentsUsers200ResponseToJSONTyped(json, false); +} + +export function DocumentsUsers200ResponseToJSONTyped(value?: DocumentsUsers200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(UserToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/DocumentsUsersRequest.ts b/src/gen/api/outline/models/DocumentsUsersRequest.ts new file mode 100644 index 0000000..91693c1 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsUsersRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsUsersRequest + */ +export interface DocumentsUsersRequest { + /** + * Unique identifier for the document. Either the UUID or the urlId is acceptable. + * @type {string} + * @memberof DocumentsUsersRequest + */ + id: string; + /** + * If set, will filter the results by user name. + * @type {string} + * @memberof DocumentsUsersRequest + */ + query?: string; +} + +/** + * Check if a given object implements the DocumentsUsersRequest interface. + */ +export function instanceOfDocumentsUsersRequest(value: object): value is DocumentsUsersRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function DocumentsUsersRequestFromJSON(json: any): DocumentsUsersRequest { + return DocumentsUsersRequestFromJSONTyped(json, false); +} + +export function DocumentsUsersRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsUsersRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'query': json['query'] == null ? undefined : json['query'], + }; +} + +export function DocumentsUsersRequestToJSON(json: any): DocumentsUsersRequest { + return DocumentsUsersRequestToJSONTyped(json, false); +} + +export function DocumentsUsersRequestToJSONTyped(value?: DocumentsUsersRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'query': value['query'], + }; +} + diff --git a/src/gen/api/outline/models/DocumentsViewedRequest.ts b/src/gen/api/outline/models/DocumentsViewedRequest.ts new file mode 100644 index 0000000..9d53510 --- /dev/null +++ b/src/gen/api/outline/models/DocumentsViewedRequest.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface DocumentsViewedRequest + */ +export interface DocumentsViewedRequest { + /** + * + * @type {number} + * @memberof DocumentsViewedRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof DocumentsViewedRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof DocumentsViewedRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof DocumentsViewedRequest + */ + direction?: DocumentsViewedRequestDirectionEnum; +} + + +/** + * @export + */ +export const DocumentsViewedRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type DocumentsViewedRequestDirectionEnum = typeof DocumentsViewedRequestDirectionEnum[keyof typeof DocumentsViewedRequestDirectionEnum]; + + +/** + * Check if a given object implements the DocumentsViewedRequest interface. + */ +export function instanceOfDocumentsViewedRequest(value: object): value is DocumentsViewedRequest { + return true; +} + +export function DocumentsViewedRequestFromJSON(json: any): DocumentsViewedRequest { + return DocumentsViewedRequestFromJSONTyped(json, false); +} + +export function DocumentsViewedRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentsViewedRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + }; +} + +export function DocumentsViewedRequestToJSON(json: any): DocumentsViewedRequest { + return DocumentsViewedRequestToJSONTyped(json, false); +} + +export function DocumentsViewedRequestToJSONTyped(value?: DocumentsViewedRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + }; +} + diff --git a/src/gen/api/outline/models/Event.ts b/src/gen/api/outline/models/Event.ts new file mode 100644 index 0000000..4741eca --- /dev/null +++ b/src/gen/api/outline/models/Event.ts @@ -0,0 +1,136 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Event + */ +export interface Event { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Event + */ + readonly id?: string; + /** + * + * @type {string} + * @memberof Event + */ + readonly name?: string; + /** + * Identifier for the object this event is associated with when it is not one of document, collection, or user. + * @type {string} + * @memberof Event + */ + readonly modelId?: string; + /** + * The user that performed the action. + * @type {string} + * @memberof Event + */ + readonly actorId?: string; + /** + * The ip address the action was performed from. This field is only returned when the `auditLog` boolean is true. + * @type {string} + * @memberof Event + */ + readonly actorIpAddress?: string; + /** + * Identifier for the associated collection, if any + * @type {string} + * @memberof Event + */ + readonly collectionId?: string; + /** + * Identifier for the associated document, if any + * @type {string} + * @memberof Event + */ + readonly documentId?: string; + /** + * The date and time that this event was created + * @type {Date} + * @memberof Event + */ + readonly createdAt?: Date; + /** + * Additional unstructured data associated with the event + * @type {object} + * @memberof Event + */ + readonly data?: object; + /** + * + * @type {User} + * @memberof Event + */ + actor?: User; +} + +/** + * Check if a given object implements the Event interface. + */ +export function instanceOfEvent(value: object): value is Event { + return true; +} + +export function EventFromJSON(json: any): Event { + return EventFromJSONTyped(json, false); +} + +export function EventFromJSONTyped(json: any, ignoreDiscriminator: boolean): Event { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'modelId': json['modelId'] == null ? undefined : json['modelId'], + 'actorId': json['actorId'] == null ? undefined : json['actorId'], + 'actorIpAddress': json['actorIpAddress'] == null ? undefined : json['actorIpAddress'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'data': json['data'] == null ? undefined : json['data'], + 'actor': json['actor'] == null ? undefined : UserFromJSON(json['actor']), + }; +} + +export function EventToJSON(json: any): Event { + return EventToJSONTyped(json, false); +} + +export function EventToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'actor': UserToJSON(value['actor']), + }; +} + diff --git a/src/gen/api/outline/models/EventsList200Response.ts b/src/gen/api/outline/models/EventsList200Response.ts new file mode 100644 index 0000000..5075690 --- /dev/null +++ b/src/gen/api/outline/models/EventsList200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { Event } from './Event'; +import { + EventFromJSON, + EventFromJSONTyped, + EventToJSON, + EventToJSONTyped, +} from './Event'; + +/** + * + * @export + * @interface EventsList200Response + */ +export interface EventsList200Response { + /** + * + * @type {Array} + * @memberof EventsList200Response + */ + data?: Array; + /** + * + * @type {Pagination} + * @memberof EventsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the EventsList200Response interface. + */ +export function instanceOfEventsList200Response(value: object): value is EventsList200Response { + return true; +} + +export function EventsList200ResponseFromJSON(json: any): EventsList200Response { + return EventsList200ResponseFromJSONTyped(json, false); +} + +export function EventsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(EventFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function EventsList200ResponseToJSON(json: any): EventsList200Response { + return EventsList200ResponseToJSONTyped(json, false); +} + +export function EventsList200ResponseToJSONTyped(value?: EventsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(EventToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/EventsListRequest.ts b/src/gen/api/outline/models/EventsListRequest.ts new file mode 100644 index 0000000..4fde60d --- /dev/null +++ b/src/gen/api/outline/models/EventsListRequest.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface EventsListRequest + */ +export interface EventsListRequest { + /** + * + * @type {number} + * @memberof EventsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof EventsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof EventsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof EventsListRequest + */ + direction?: EventsListRequestDirectionEnum; + /** + * Filter to a specific event, e.g. "collections.create". Event names are in the format "objects.verb" + * @type {string} + * @memberof EventsListRequest + */ + name?: string; + /** + * Filter to events performed by the selected user + * @type {string} + * @memberof EventsListRequest + */ + actorId?: string; + /** + * Filter to events performed in the selected document + * @type {string} + * @memberof EventsListRequest + */ + documentId?: string; + /** + * Filter to events performed in the selected collection + * @type {string} + * @memberof EventsListRequest + */ + collectionId?: string; + /** + * Whether to return detailed events suitable for an audit log. Without this flag less detailed event types will be returned. + * @type {boolean} + * @memberof EventsListRequest + */ + auditLog?: boolean; +} + + +/** + * @export + */ +export const EventsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type EventsListRequestDirectionEnum = typeof EventsListRequestDirectionEnum[keyof typeof EventsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the EventsListRequest interface. + */ +export function instanceOfEventsListRequest(value: object): value is EventsListRequest { + return true; +} + +export function EventsListRequestFromJSON(json: any): EventsListRequest { + return EventsListRequestFromJSONTyped(json, false); +} + +export function EventsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): EventsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'name': json['name'] == null ? undefined : json['name'], + 'actorId': json['actorId'] == null ? undefined : json['actorId'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'auditLog': json['auditLog'] == null ? undefined : json['auditLog'], + }; +} + +export function EventsListRequestToJSON(json: any): EventsListRequest { + return EventsListRequestToJSONTyped(json, false); +} + +export function EventsListRequestToJSONTyped(value?: EventsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'name': value['name'], + 'actorId': value['actorId'], + 'documentId': value['documentId'], + 'collectionId': value['collectionId'], + 'auditLog': value['auditLog'], + }; +} + diff --git a/src/gen/api/outline/models/FileOperation.ts b/src/gen/api/outline/models/FileOperation.ts new file mode 100644 index 0000000..96936d3 --- /dev/null +++ b/src/gen/api/outline/models/FileOperation.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Collection } from './Collection'; +import { + CollectionFromJSON, + CollectionFromJSONTyped, + CollectionToJSON, + CollectionToJSONTyped, +} from './Collection'; + +/** + * + * @export + * @interface FileOperation + */ +export interface FileOperation { + /** + * Unique identifier for the object. + * @type {string} + * @memberof FileOperation + */ + readonly id?: string; + /** + * The type of file operation. + * @type {string} + * @memberof FileOperation + */ + readonly type?: FileOperationTypeEnum; + /** + * The state of the file operation. + * @type {string} + * @memberof FileOperation + */ + readonly state?: FileOperationStateEnum; + /** + * + * @type {Collection} + * @memberof FileOperation + */ + collection?: Collection | null; + /** + * + * @type {User} + * @memberof FileOperation + */ + user?: User; + /** + * The size of the resulting file in bytes + * @type {number} + * @memberof FileOperation + */ + readonly size?: number; + /** + * The date and time that this object was created + * @type {Date} + * @memberof FileOperation + */ + readonly createdAt?: Date; +} + + +/** + * @export + */ +export const FileOperationTypeEnum = { + Import: 'import', + Export: 'export' +} as const; +export type FileOperationTypeEnum = typeof FileOperationTypeEnum[keyof typeof FileOperationTypeEnum]; + +/** + * @export + */ +export const FileOperationStateEnum = { + Creating: 'creating', + Uploading: 'uploading', + Complete: 'complete', + Error: 'error', + Expired: 'expired' +} as const; +export type FileOperationStateEnum = typeof FileOperationStateEnum[keyof typeof FileOperationStateEnum]; + + +/** + * Check if a given object implements the FileOperation interface. + */ +export function instanceOfFileOperation(value: object): value is FileOperation { + return true; +} + +export function FileOperationFromJSON(json: any): FileOperation { + return FileOperationFromJSONTyped(json, false); +} + +export function FileOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileOperation { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'type': json['type'] == null ? undefined : json['type'], + 'state': json['state'] == null ? undefined : json['state'], + 'collection': json['collection'] == null ? undefined : CollectionFromJSON(json['collection']), + 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), + 'size': json['size'] == null ? undefined : json['size'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + }; +} + +export function FileOperationToJSON(json: any): FileOperation { + return FileOperationToJSONTyped(json, false); +} + +export function FileOperationToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'collection': CollectionToJSON(value['collection']), + 'user': UserToJSON(value['user']), + }; +} + diff --git a/src/gen/api/outline/models/FileoperationsInfo200Response.ts b/src/gen/api/outline/models/FileoperationsInfo200Response.ts new file mode 100644 index 0000000..d98c930 --- /dev/null +++ b/src/gen/api/outline/models/FileoperationsInfo200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { FileOperation } from './FileOperation'; +import { + FileOperationFromJSON, + FileOperationFromJSONTyped, + FileOperationToJSON, + FileOperationToJSONTyped, +} from './FileOperation'; + +/** + * + * @export + * @interface FileoperationsInfo200Response + */ +export interface FileoperationsInfo200Response { + /** + * + * @type {FileOperation} + * @memberof FileoperationsInfo200Response + */ + data?: FileOperation; +} + +/** + * Check if a given object implements the FileoperationsInfo200Response interface. + */ +export function instanceOfFileoperationsInfo200Response(value: object): value is FileoperationsInfo200Response { + return true; +} + +export function FileoperationsInfo200ResponseFromJSON(json: any): FileoperationsInfo200Response { + return FileoperationsInfo200ResponseFromJSONTyped(json, false); +} + +export function FileoperationsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : FileOperationFromJSON(json['data']), + }; +} + +export function FileoperationsInfo200ResponseToJSON(json: any): FileoperationsInfo200Response { + return FileoperationsInfo200ResponseToJSONTyped(json, false); +} + +export function FileoperationsInfo200ResponseToJSONTyped(value?: FileoperationsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': FileOperationToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/FileoperationsInfoRequest.ts b/src/gen/api/outline/models/FileoperationsInfoRequest.ts new file mode 100644 index 0000000..52e9abb --- /dev/null +++ b/src/gen/api/outline/models/FileoperationsInfoRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface FileoperationsInfoRequest + */ +export interface FileoperationsInfoRequest { + /** + * Unique identifier for the file operation. + * @type {string} + * @memberof FileoperationsInfoRequest + */ + id: string; +} + +/** + * Check if a given object implements the FileoperationsInfoRequest interface. + */ +export function instanceOfFileoperationsInfoRequest(value: object): value is FileoperationsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function FileoperationsInfoRequestFromJSON(json: any): FileoperationsInfoRequest { + return FileoperationsInfoRequestFromJSONTyped(json, false); +} + +export function FileoperationsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function FileoperationsInfoRequestToJSON(json: any): FileoperationsInfoRequest { + return FileoperationsInfoRequestToJSONTyped(json, false); +} + +export function FileoperationsInfoRequestToJSONTyped(value?: FileoperationsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/FileoperationsList200Response.ts b/src/gen/api/outline/models/FileoperationsList200Response.ts new file mode 100644 index 0000000..ac0b2b3 --- /dev/null +++ b/src/gen/api/outline/models/FileoperationsList200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { FileOperation } from './FileOperation'; +import { + FileOperationFromJSON, + FileOperationFromJSONTyped, + FileOperationToJSON, + FileOperationToJSONTyped, +} from './FileOperation'; + +/** + * + * @export + * @interface FileoperationsList200Response + */ +export interface FileoperationsList200Response { + /** + * + * @type {Array} + * @memberof FileoperationsList200Response + */ + data?: Array; + /** + * + * @type {Pagination} + * @memberof FileoperationsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the FileoperationsList200Response interface. + */ +export function instanceOfFileoperationsList200Response(value: object): value is FileoperationsList200Response { + return true; +} + +export function FileoperationsList200ResponseFromJSON(json: any): FileoperationsList200Response { + return FileoperationsList200ResponseFromJSONTyped(json, false); +} + +export function FileoperationsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(FileOperationFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function FileoperationsList200ResponseToJSON(json: any): FileoperationsList200Response { + return FileoperationsList200ResponseToJSONTyped(json, false); +} + +export function FileoperationsList200ResponseToJSONTyped(value?: FileoperationsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(FileOperationToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/FileoperationsListRequest.ts b/src/gen/api/outline/models/FileoperationsListRequest.ts new file mode 100644 index 0000000..9e4a63e --- /dev/null +++ b/src/gen/api/outline/models/FileoperationsListRequest.ts @@ -0,0 +1,118 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface FileoperationsListRequest + */ +export interface FileoperationsListRequest { + /** + * + * @type {number} + * @memberof FileoperationsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof FileoperationsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof FileoperationsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof FileoperationsListRequest + */ + direction?: FileoperationsListRequestDirectionEnum; + /** + * The type of fileOperation + * @type {string} + * @memberof FileoperationsListRequest + */ + type: FileoperationsListRequestTypeEnum; +} + + +/** + * @export + */ +export const FileoperationsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type FileoperationsListRequestDirectionEnum = typeof FileoperationsListRequestDirectionEnum[keyof typeof FileoperationsListRequestDirectionEnum]; + +/** + * @export + */ +export const FileoperationsListRequestTypeEnum = { + Export: 'export', + Import: 'import' +} as const; +export type FileoperationsListRequestTypeEnum = typeof FileoperationsListRequestTypeEnum[keyof typeof FileoperationsListRequestTypeEnum]; + + +/** + * Check if a given object implements the FileoperationsListRequest interface. + */ +export function instanceOfFileoperationsListRequest(value: object): value is FileoperationsListRequest { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function FileoperationsListRequestFromJSON(json: any): FileoperationsListRequest { + return FileoperationsListRequestFromJSONTyped(json, false); +} + +export function FileoperationsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): FileoperationsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'type': json['type'], + }; +} + +export function FileoperationsListRequestToJSON(json: any): FileoperationsListRequest { + return FileoperationsListRequestToJSONTyped(json, false); +} + +export function FileoperationsListRequestToJSONTyped(value?: FileoperationsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'type': value['type'], + }; +} + diff --git a/src/gen/api/outline/models/Group.ts b/src/gen/api/outline/models/Group.ts new file mode 100644 index 0000000..2656032 --- /dev/null +++ b/src/gen/api/outline/models/Group.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Group + */ +export interface Group { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Group + */ + readonly id?: string; + /** + * The name of this group. + * @type {string} + * @memberof Group + */ + name?: string; + /** + * The number of users that are members of the group + * @type {number} + * @memberof Group + */ + readonly memberCount?: number; + /** + * The date and time that this object was created + * @type {Date} + * @memberof Group + */ + readonly createdAt?: Date; + /** + * The date and time that this object was last changed + * @type {Date} + * @memberof Group + */ + readonly updatedAt?: Date; +} + +/** + * Check if a given object implements the Group interface. + */ +export function instanceOfGroup(value: object): value is Group { + return true; +} + +export function GroupFromJSON(json: any): Group { + return GroupFromJSONTyped(json, false); +} + +export function GroupFromJSONTyped(json: any, ignoreDiscriminator: boolean): Group { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'memberCount': json['memberCount'] == null ? undefined : json['memberCount'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + }; +} + +export function GroupToJSON(json: any): Group { + return GroupToJSONTyped(json, false); +} + +export function GroupToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + }; +} + diff --git a/src/gen/api/outline/models/GroupMembership.ts b/src/gen/api/outline/models/GroupMembership.ts new file mode 100644 index 0000000..8a0b3a9 --- /dev/null +++ b/src/gen/api/outline/models/GroupMembership.ts @@ -0,0 +1,94 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface GroupMembership + */ +export interface GroupMembership { + /** + * Unique identifier for the object. + * @type {string} + * @memberof GroupMembership + */ + readonly id?: string; + /** + * Identifier for the associated group. + * @type {string} + * @memberof GroupMembership + */ + readonly groupId?: string; + /** + * Identifier for the associated user. + * @type {string} + * @memberof GroupMembership + */ + readonly userId?: string; + /** + * + * @type {User} + * @memberof GroupMembership + */ + user?: User; +} + +/** + * Check if a given object implements the GroupMembership interface. + */ +export function instanceOfGroupMembership(value: object): value is GroupMembership { + return true; +} + +export function GroupMembershipFromJSON(json: any): GroupMembership { + return GroupMembershipFromJSONTyped(json, false); +} + +export function GroupMembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupMembership { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'groupId': json['groupId'] == null ? undefined : json['groupId'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), + }; +} + +export function GroupMembershipToJSON(json: any): GroupMembership { + return GroupMembershipToJSONTyped(json, false); +} + +export function GroupMembershipToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'user': UserToJSON(value['user']), + }; +} + diff --git a/src/gen/api/outline/models/GroupsAddUser200Response.ts b/src/gen/api/outline/models/GroupsAddUser200Response.ts new file mode 100644 index 0000000..349a3bc --- /dev/null +++ b/src/gen/api/outline/models/GroupsAddUser200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { GroupsAddUser200ResponseData } from './GroupsAddUser200ResponseData'; +import { + GroupsAddUser200ResponseDataFromJSON, + GroupsAddUser200ResponseDataFromJSONTyped, + GroupsAddUser200ResponseDataToJSON, + GroupsAddUser200ResponseDataToJSONTyped, +} from './GroupsAddUser200ResponseData'; + +/** + * + * @export + * @interface GroupsAddUser200Response + */ +export interface GroupsAddUser200Response { + /** + * + * @type {GroupsAddUser200ResponseData} + * @memberof GroupsAddUser200Response + */ + data?: GroupsAddUser200ResponseData; +} + +/** + * Check if a given object implements the GroupsAddUser200Response interface. + */ +export function instanceOfGroupsAddUser200Response(value: object): value is GroupsAddUser200Response { + return true; +} + +export function GroupsAddUser200ResponseFromJSON(json: any): GroupsAddUser200Response { + return GroupsAddUser200ResponseFromJSONTyped(json, false); +} + +export function GroupsAddUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUser200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : GroupsAddUser200ResponseDataFromJSON(json['data']), + }; +} + +export function GroupsAddUser200ResponseToJSON(json: any): GroupsAddUser200Response { + return GroupsAddUser200ResponseToJSONTyped(json, false); +} + +export function GroupsAddUser200ResponseToJSONTyped(value?: GroupsAddUser200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': GroupsAddUser200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/GroupsAddUser200ResponseData.ts b/src/gen/api/outline/models/GroupsAddUser200ResponseData.ts new file mode 100644 index 0000000..fcea55c --- /dev/null +++ b/src/gen/api/outline/models/GroupsAddUser200ResponseData.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Membership } from './Membership'; +import { + MembershipFromJSON, + MembershipFromJSONTyped, + MembershipToJSON, + MembershipToJSONTyped, +} from './Membership'; + +/** + * + * @export + * @interface GroupsAddUser200ResponseData + */ +export interface GroupsAddUser200ResponseData { + /** + * + * @type {Array} + * @memberof GroupsAddUser200ResponseData + */ + users?: Array; + /** + * + * @type {Array} + * @memberof GroupsAddUser200ResponseData + */ + groups?: Array; + /** + * + * @type {Array} + * @memberof GroupsAddUser200ResponseData + */ + groupMemberships?: Array; +} + +/** + * Check if a given object implements the GroupsAddUser200ResponseData interface. + */ +export function instanceOfGroupsAddUser200ResponseData(value: object): value is GroupsAddUser200ResponseData { + return true; +} + +export function GroupsAddUser200ResponseDataFromJSON(json: any): GroupsAddUser200ResponseData { + return GroupsAddUser200ResponseDataFromJSONTyped(json, false); +} + +export function GroupsAddUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUser200ResponseData { + if (json == null) { + return json; + } + return { + + 'users': json['users'] == null ? undefined : ((json['users'] as Array).map(UserFromJSON)), + 'groups': json['groups'] == null ? undefined : ((json['groups'] as Array).map(GroupFromJSON)), + 'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array).map(MembershipFromJSON)), + }; +} + +export function GroupsAddUser200ResponseDataToJSON(json: any): GroupsAddUser200ResponseData { + return GroupsAddUser200ResponseDataToJSONTyped(json, false); +} + +export function GroupsAddUser200ResponseDataToJSONTyped(value?: GroupsAddUser200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'users': value['users'] == null ? undefined : ((value['users'] as Array).map(UserToJSON)), + 'groups': value['groups'] == null ? undefined : ((value['groups'] as Array).map(GroupToJSON)), + 'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array).map(MembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/GroupsAddUserRequest.ts b/src/gen/api/outline/models/GroupsAddUserRequest.ts new file mode 100644 index 0000000..a263dae --- /dev/null +++ b/src/gen/api/outline/models/GroupsAddUserRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsAddUserRequest + */ +export interface GroupsAddUserRequest { + /** + * + * @type {string} + * @memberof GroupsAddUserRequest + */ + id: string; + /** + * + * @type {string} + * @memberof GroupsAddUserRequest + */ + userId: string; +} + +/** + * Check if a given object implements the GroupsAddUserRequest interface. + */ +export function instanceOfGroupsAddUserRequest(value: object): value is GroupsAddUserRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('userId' in value) || value['userId'] === undefined) return false; + return true; +} + +export function GroupsAddUserRequestFromJSON(json: any): GroupsAddUserRequest { + return GroupsAddUserRequestFromJSONTyped(json, false); +} + +export function GroupsAddUserRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsAddUserRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'userId': json['userId'], + }; +} + +export function GroupsAddUserRequestToJSON(json: any): GroupsAddUserRequest { + return GroupsAddUserRequestToJSONTyped(json, false); +} + +export function GroupsAddUserRequestToJSONTyped(value?: GroupsAddUserRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'userId': value['userId'], + }; +} + diff --git a/src/gen/api/outline/models/GroupsCreateRequest.ts b/src/gen/api/outline/models/GroupsCreateRequest.ts new file mode 100644 index 0000000..f2de7a3 --- /dev/null +++ b/src/gen/api/outline/models/GroupsCreateRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsCreateRequest + */ +export interface GroupsCreateRequest { + /** + * + * @type {string} + * @memberof GroupsCreateRequest + */ + name: string; +} + +/** + * Check if a given object implements the GroupsCreateRequest interface. + */ +export function instanceOfGroupsCreateRequest(value: object): value is GroupsCreateRequest { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function GroupsCreateRequestFromJSON(json: any): GroupsCreateRequest { + return GroupsCreateRequestFromJSONTyped(json, false); +} + +export function GroupsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsCreateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + }; +} + +export function GroupsCreateRequestToJSON(json: any): GroupsCreateRequest { + return GroupsCreateRequestToJSONTyped(json, false); +} + +export function GroupsCreateRequestToJSONTyped(value?: GroupsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + }; +} + diff --git a/src/gen/api/outline/models/GroupsInfo200Response.ts b/src/gen/api/outline/models/GroupsInfo200Response.ts new file mode 100644 index 0000000..d33acbd --- /dev/null +++ b/src/gen/api/outline/models/GroupsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; + +/** + * + * @export + * @interface GroupsInfo200Response + */ +export interface GroupsInfo200Response { + /** + * + * @type {Group} + * @memberof GroupsInfo200Response + */ + data?: Group; + /** + * + * @type {Array} + * @memberof GroupsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the GroupsInfo200Response interface. + */ +export function instanceOfGroupsInfo200Response(value: object): value is GroupsInfo200Response { + return true; +} + +export function GroupsInfo200ResponseFromJSON(json: any): GroupsInfo200Response { + return GroupsInfo200ResponseFromJSONTyped(json, false); +} + +export function GroupsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : GroupFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function GroupsInfo200ResponseToJSON(json: any): GroupsInfo200Response { + return GroupsInfo200ResponseToJSONTyped(json, false); +} + +export function GroupsInfo200ResponseToJSONTyped(value?: GroupsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': GroupToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/GroupsInfoRequest.ts b/src/gen/api/outline/models/GroupsInfoRequest.ts new file mode 100644 index 0000000..f95041f --- /dev/null +++ b/src/gen/api/outline/models/GroupsInfoRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsInfoRequest + */ +export interface GroupsInfoRequest { + /** + * Unique identifier for the group. + * @type {string} + * @memberof GroupsInfoRequest + */ + id: string; +} + +/** + * Check if a given object implements the GroupsInfoRequest interface. + */ +export function instanceOfGroupsInfoRequest(value: object): value is GroupsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function GroupsInfoRequestFromJSON(json: any): GroupsInfoRequest { + return GroupsInfoRequestFromJSONTyped(json, false); +} + +export function GroupsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function GroupsInfoRequestToJSON(json: any): GroupsInfoRequest { + return GroupsInfoRequestToJSONTyped(json, false); +} + +export function GroupsInfoRequestToJSONTyped(value?: GroupsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/GroupsList200Response.ts b/src/gen/api/outline/models/GroupsList200Response.ts new file mode 100644 index 0000000..a878393 --- /dev/null +++ b/src/gen/api/outline/models/GroupsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { GroupsList200ResponseData } from './GroupsList200ResponseData'; +import { + GroupsList200ResponseDataFromJSON, + GroupsList200ResponseDataFromJSONTyped, + GroupsList200ResponseDataToJSON, + GroupsList200ResponseDataToJSONTyped, +} from './GroupsList200ResponseData'; + +/** + * + * @export + * @interface GroupsList200Response + */ +export interface GroupsList200Response { + /** + * + * @type {GroupsList200ResponseData} + * @memberof GroupsList200Response + */ + data?: GroupsList200ResponseData; + /** + * + * @type {Array} + * @memberof GroupsList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof GroupsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the GroupsList200Response interface. + */ +export function instanceOfGroupsList200Response(value: object): value is GroupsList200Response { + return true; +} + +export function GroupsList200ResponseFromJSON(json: any): GroupsList200Response { + return GroupsList200ResponseFromJSONTyped(json, false); +} + +export function GroupsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : GroupsList200ResponseDataFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function GroupsList200ResponseToJSON(json: any): GroupsList200Response { + return GroupsList200ResponseToJSONTyped(json, false); +} + +export function GroupsList200ResponseToJSONTyped(value?: GroupsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': GroupsList200ResponseDataToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/GroupsList200ResponseData.ts b/src/gen/api/outline/models/GroupsList200ResponseData.ts new file mode 100644 index 0000000..66f917c --- /dev/null +++ b/src/gen/api/outline/models/GroupsList200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; +import type { GroupMembership } from './GroupMembership'; +import { + GroupMembershipFromJSON, + GroupMembershipFromJSONTyped, + GroupMembershipToJSON, + GroupMembershipToJSONTyped, +} from './GroupMembership'; + +/** + * + * @export + * @interface GroupsList200ResponseData + */ +export interface GroupsList200ResponseData { + /** + * + * @type {Array} + * @memberof GroupsList200ResponseData + */ + groups?: Array; + /** + * A preview of memberships in the group, note that this is not all memberships which can be queried from `groups.memberships`. + * @type {Array} + * @memberof GroupsList200ResponseData + */ + groupMemberships?: Array; +} + +/** + * Check if a given object implements the GroupsList200ResponseData interface. + */ +export function instanceOfGroupsList200ResponseData(value: object): value is GroupsList200ResponseData { + return true; +} + +export function GroupsList200ResponseDataFromJSON(json: any): GroupsList200ResponseData { + return GroupsList200ResponseDataFromJSONTyped(json, false); +} + +export function GroupsList200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsList200ResponseData { + if (json == null) { + return json; + } + return { + + 'groups': json['groups'] == null ? undefined : ((json['groups'] as Array).map(GroupFromJSON)), + 'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array).map(GroupMembershipFromJSON)), + }; +} + +export function GroupsList200ResponseDataToJSON(json: any): GroupsList200ResponseData { + return GroupsList200ResponseDataToJSONTyped(json, false); +} + +export function GroupsList200ResponseDataToJSONTyped(value?: GroupsList200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'groups': value['groups'] == null ? undefined : ((value['groups'] as Array).map(GroupToJSON)), + 'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array).map(GroupMembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/GroupsListRequest.ts b/src/gen/api/outline/models/GroupsListRequest.ts new file mode 100644 index 0000000..5935dc1 --- /dev/null +++ b/src/gen/api/outline/models/GroupsListRequest.ts @@ -0,0 +1,124 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsListRequest + */ +export interface GroupsListRequest { + /** + * + * @type {number} + * @memberof GroupsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof GroupsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof GroupsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof GroupsListRequest + */ + direction?: GroupsListRequestDirectionEnum; + /** + * Filter to groups including a specific user + * @type {string} + * @memberof GroupsListRequest + */ + userId?: string; + /** + * Filter to groups matching an external ID + * @type {string} + * @memberof GroupsListRequest + */ + externalId?: string; + /** + * Filter to groups matching a search query + * @type {string} + * @memberof GroupsListRequest + */ + query?: string; +} + + +/** + * @export + */ +export const GroupsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type GroupsListRequestDirectionEnum = typeof GroupsListRequestDirectionEnum[keyof typeof GroupsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the GroupsListRequest interface. + */ +export function instanceOfGroupsListRequest(value: object): value is GroupsListRequest { + return true; +} + +export function GroupsListRequestFromJSON(json: any): GroupsListRequest { + return GroupsListRequestFromJSONTyped(json, false); +} + +export function GroupsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'externalId': json['externalId'] == null ? undefined : json['externalId'], + 'query': json['query'] == null ? undefined : json['query'], + }; +} + +export function GroupsListRequestToJSON(json: any): GroupsListRequest { + return GroupsListRequestToJSONTyped(json, false); +} + +export function GroupsListRequestToJSONTyped(value?: GroupsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'userId': value['userId'], + 'externalId': value['externalId'], + 'query': value['query'], + }; +} + diff --git a/src/gen/api/outline/models/GroupsMemberships200Response.ts b/src/gen/api/outline/models/GroupsMemberships200Response.ts new file mode 100644 index 0000000..d934165 --- /dev/null +++ b/src/gen/api/outline/models/GroupsMemberships200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { GroupsMemberships200ResponseData } from './GroupsMemberships200ResponseData'; +import { + GroupsMemberships200ResponseDataFromJSON, + GroupsMemberships200ResponseDataFromJSONTyped, + GroupsMemberships200ResponseDataToJSON, + GroupsMemberships200ResponseDataToJSONTyped, +} from './GroupsMemberships200ResponseData'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; + +/** + * + * @export + * @interface GroupsMemberships200Response + */ +export interface GroupsMemberships200Response { + /** + * + * @type {GroupsMemberships200ResponseData} + * @memberof GroupsMemberships200Response + */ + data?: GroupsMemberships200ResponseData; + /** + * + * @type {Pagination} + * @memberof GroupsMemberships200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the GroupsMemberships200Response interface. + */ +export function instanceOfGroupsMemberships200Response(value: object): value is GroupsMemberships200Response { + return true; +} + +export function GroupsMemberships200ResponseFromJSON(json: any): GroupsMemberships200Response { + return GroupsMemberships200ResponseFromJSONTyped(json, false); +} + +export function GroupsMemberships200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMemberships200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : GroupsMemberships200ResponseDataFromJSON(json['data']), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function GroupsMemberships200ResponseToJSON(json: any): GroupsMemberships200Response { + return GroupsMemberships200ResponseToJSONTyped(json, false); +} + +export function GroupsMemberships200ResponseToJSONTyped(value?: GroupsMemberships200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': GroupsMemberships200ResponseDataToJSON(value['data']), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/GroupsMemberships200ResponseData.ts b/src/gen/api/outline/models/GroupsMemberships200ResponseData.ts new file mode 100644 index 0000000..724eb91 --- /dev/null +++ b/src/gen/api/outline/models/GroupsMemberships200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { GroupMembership } from './GroupMembership'; +import { + GroupMembershipFromJSON, + GroupMembershipFromJSONTyped, + GroupMembershipToJSON, + GroupMembershipToJSONTyped, +} from './GroupMembership'; + +/** + * + * @export + * @interface GroupsMemberships200ResponseData + */ +export interface GroupsMemberships200ResponseData { + /** + * + * @type {Array} + * @memberof GroupsMemberships200ResponseData + */ + users?: Array; + /** + * + * @type {Array} + * @memberof GroupsMemberships200ResponseData + */ + groupMemberships?: Array; +} + +/** + * Check if a given object implements the GroupsMemberships200ResponseData interface. + */ +export function instanceOfGroupsMemberships200ResponseData(value: object): value is GroupsMemberships200ResponseData { + return true; +} + +export function GroupsMemberships200ResponseDataFromJSON(json: any): GroupsMemberships200ResponseData { + return GroupsMemberships200ResponseDataFromJSONTyped(json, false); +} + +export function GroupsMemberships200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMemberships200ResponseData { + if (json == null) { + return json; + } + return { + + 'users': json['users'] == null ? undefined : ((json['users'] as Array).map(UserFromJSON)), + 'groupMemberships': json['groupMemberships'] == null ? undefined : ((json['groupMemberships'] as Array).map(GroupMembershipFromJSON)), + }; +} + +export function GroupsMemberships200ResponseDataToJSON(json: any): GroupsMemberships200ResponseData { + return GroupsMemberships200ResponseDataToJSONTyped(json, false); +} + +export function GroupsMemberships200ResponseDataToJSONTyped(value?: GroupsMemberships200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'users': value['users'] == null ? undefined : ((value['users'] as Array).map(UserToJSON)), + 'groupMemberships': value['groupMemberships'] == null ? undefined : ((value['groupMemberships'] as Array).map(GroupMembershipToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/GroupsMembershipsRequest.ts b/src/gen/api/outline/models/GroupsMembershipsRequest.ts new file mode 100644 index 0000000..dbcaa58 --- /dev/null +++ b/src/gen/api/outline/models/GroupsMembershipsRequest.ts @@ -0,0 +1,90 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsMembershipsRequest + */ +export interface GroupsMembershipsRequest { + /** + * + * @type {number} + * @memberof GroupsMembershipsRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof GroupsMembershipsRequest + */ + limit?: number; + /** + * Group id + * @type {string} + * @memberof GroupsMembershipsRequest + */ + id: string; + /** + * Filter memberships by user names + * @type {string} + * @memberof GroupsMembershipsRequest + */ + query?: string; +} + +/** + * Check if a given object implements the GroupsMembershipsRequest interface. + */ +export function instanceOfGroupsMembershipsRequest(value: object): value is GroupsMembershipsRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function GroupsMembershipsRequestFromJSON(json: any): GroupsMembershipsRequest { + return GroupsMembershipsRequestFromJSONTyped(json, false); +} + +export function GroupsMembershipsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsMembershipsRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'id': json['id'], + 'query': json['query'] == null ? undefined : json['query'], + }; +} + +export function GroupsMembershipsRequestToJSON(json: any): GroupsMembershipsRequest { + return GroupsMembershipsRequestToJSONTyped(json, false); +} + +export function GroupsMembershipsRequestToJSONTyped(value?: GroupsMembershipsRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'id': value['id'], + 'query': value['query'], + }; +} + diff --git a/src/gen/api/outline/models/GroupsRemoveUser200Response.ts b/src/gen/api/outline/models/GroupsRemoveUser200Response.ts new file mode 100644 index 0000000..92ae63a --- /dev/null +++ b/src/gen/api/outline/models/GroupsRemoveUser200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { GroupsRemoveUser200ResponseData } from './GroupsRemoveUser200ResponseData'; +import { + GroupsRemoveUser200ResponseDataFromJSON, + GroupsRemoveUser200ResponseDataFromJSONTyped, + GroupsRemoveUser200ResponseDataToJSON, + GroupsRemoveUser200ResponseDataToJSONTyped, +} from './GroupsRemoveUser200ResponseData'; + +/** + * + * @export + * @interface GroupsRemoveUser200Response + */ +export interface GroupsRemoveUser200Response { + /** + * + * @type {GroupsRemoveUser200ResponseData} + * @memberof GroupsRemoveUser200Response + */ + data?: GroupsRemoveUser200ResponseData; +} + +/** + * Check if a given object implements the GroupsRemoveUser200Response interface. + */ +export function instanceOfGroupsRemoveUser200Response(value: object): value is GroupsRemoveUser200Response { + return true; +} + +export function GroupsRemoveUser200ResponseFromJSON(json: any): GroupsRemoveUser200Response { + return GroupsRemoveUser200ResponseFromJSONTyped(json, false); +} + +export function GroupsRemoveUser200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsRemoveUser200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : GroupsRemoveUser200ResponseDataFromJSON(json['data']), + }; +} + +export function GroupsRemoveUser200ResponseToJSON(json: any): GroupsRemoveUser200Response { + return GroupsRemoveUser200ResponseToJSONTyped(json, false); +} + +export function GroupsRemoveUser200ResponseToJSONTyped(value?: GroupsRemoveUser200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': GroupsRemoveUser200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/GroupsRemoveUser200ResponseData.ts b/src/gen/api/outline/models/GroupsRemoveUser200ResponseData.ts new file mode 100644 index 0000000..61060f6 --- /dev/null +++ b/src/gen/api/outline/models/GroupsRemoveUser200ResponseData.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Group } from './Group'; +import { + GroupFromJSON, + GroupFromJSONTyped, + GroupToJSON, + GroupToJSONTyped, +} from './Group'; + +/** + * + * @export + * @interface GroupsRemoveUser200ResponseData + */ +export interface GroupsRemoveUser200ResponseData { + /** + * + * @type {Array} + * @memberof GroupsRemoveUser200ResponseData + */ + groups?: Array; +} + +/** + * Check if a given object implements the GroupsRemoveUser200ResponseData interface. + */ +export function instanceOfGroupsRemoveUser200ResponseData(value: object): value is GroupsRemoveUser200ResponseData { + return true; +} + +export function GroupsRemoveUser200ResponseDataFromJSON(json: any): GroupsRemoveUser200ResponseData { + return GroupsRemoveUser200ResponseDataFromJSONTyped(json, false); +} + +export function GroupsRemoveUser200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsRemoveUser200ResponseData { + if (json == null) { + return json; + } + return { + + 'groups': json['groups'] == null ? undefined : ((json['groups'] as Array).map(GroupFromJSON)), + }; +} + +export function GroupsRemoveUser200ResponseDataToJSON(json: any): GroupsRemoveUser200ResponseData { + return GroupsRemoveUser200ResponseDataToJSONTyped(json, false); +} + +export function GroupsRemoveUser200ResponseDataToJSONTyped(value?: GroupsRemoveUser200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'groups': value['groups'] == null ? undefined : ((value['groups'] as Array).map(GroupToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/GroupsUpdateRequest.ts b/src/gen/api/outline/models/GroupsUpdateRequest.ts new file mode 100644 index 0000000..38e6441 --- /dev/null +++ b/src/gen/api/outline/models/GroupsUpdateRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface GroupsUpdateRequest + */ +export interface GroupsUpdateRequest { + /** + * + * @type {string} + * @memberof GroupsUpdateRequest + */ + id: string; + /** + * + * @type {string} + * @memberof GroupsUpdateRequest + */ + name: string; +} + +/** + * Check if a given object implements the GroupsUpdateRequest interface. + */ +export function instanceOfGroupsUpdateRequest(value: object): value is GroupsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function GroupsUpdateRequestFromJSON(json: any): GroupsUpdateRequest { + return GroupsUpdateRequestFromJSONTyped(json, false); +} + +export function GroupsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): GroupsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + }; +} + +export function GroupsUpdateRequestToJSON(json: any): GroupsUpdateRequest { + return GroupsUpdateRequestToJSONTyped(json, false); +} + +export function GroupsUpdateRequestToJSONTyped(value?: GroupsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + }; +} + diff --git a/src/gen/api/outline/models/InlineObject.ts b/src/gen/api/outline/models/InlineObject.ts new file mode 100644 index 0000000..4cab3ab --- /dev/null +++ b/src/gen/api/outline/models/InlineObject.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface InlineObject + */ +export interface InlineObject { + /** + * + * @type {boolean} + * @memberof InlineObject + */ + ok?: boolean; + /** + * + * @type {string} + * @memberof InlineObject + */ + error?: string; + /** + * + * @type {number} + * @memberof InlineObject + */ + status?: number; +} + +/** + * Check if a given object implements the InlineObject interface. + */ +export function instanceOfInlineObject(value: object): value is InlineObject { + return true; +} + +export function InlineObjectFromJSON(json: any): InlineObject { + return InlineObjectFromJSONTyped(json, false); +} + +export function InlineObjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): InlineObject { + if (json == null) { + return json; + } + return { + + 'ok': json['ok'] == null ? undefined : json['ok'], + 'error': json['error'] == null ? undefined : json['error'], + 'status': json['status'] == null ? undefined : json['status'], + }; +} + +export function InlineObjectToJSON(json: any): InlineObject { + return InlineObjectToJSONTyped(json, false); +} + +export function InlineObjectToJSONTyped(value?: InlineObject | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ok': value['ok'], + 'error': value['error'], + 'status': value['status'], + }; +} + diff --git a/src/gen/api/outline/models/Invite.ts b/src/gen/api/outline/models/Invite.ts new file mode 100644 index 0000000..13c6bd0 --- /dev/null +++ b/src/gen/api/outline/models/Invite.ts @@ -0,0 +1,91 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UserRole } from './UserRole'; +import { + UserRoleFromJSON, + UserRoleFromJSONTyped, + UserRoleToJSON, + UserRoleToJSONTyped, +} from './UserRole'; + +/** + * + * @export + * @interface Invite + */ +export interface Invite { + /** + * The full name of the user being invited + * @type {string} + * @memberof Invite + */ + name?: string; + /** + * The email address to invite + * @type {string} + * @memberof Invite + */ + email?: string; + /** + * + * @type {UserRole} + * @memberof Invite + */ + role?: UserRole; +} + + + +/** + * Check if a given object implements the Invite interface. + */ +export function instanceOfInvite(value: object): value is Invite { + return true; +} + +export function InviteFromJSON(json: any): Invite { + return InviteFromJSONTyped(json, false); +} + +export function InviteFromJSONTyped(json: any, ignoreDiscriminator: boolean): Invite { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'email': json['email'] == null ? undefined : json['email'], + 'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']), + }; +} + +export function InviteToJSON(json: any): Invite { + return InviteToJSONTyped(json, false); +} + +export function InviteToJSONTyped(value?: Invite | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'email': value['email'], + 'role': UserRoleToJSON(value['role']), + }; +} + diff --git a/src/gen/api/outline/models/Membership.ts b/src/gen/api/outline/models/Membership.ts new file mode 100644 index 0000000..2815dac --- /dev/null +++ b/src/gen/api/outline/models/Membership.ts @@ -0,0 +1,96 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Permission } from './Permission'; +import { + PermissionFromJSON, + PermissionFromJSONTyped, + PermissionToJSON, + PermissionToJSONTyped, +} from './Permission'; + +/** + * + * @export + * @interface Membership + */ +export interface Membership { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Membership + */ + readonly id?: string; + /** + * Identifier for the associated user. + * @type {string} + * @memberof Membership + */ + readonly userId?: string; + /** + * Identifier for the associated collection. + * @type {string} + * @memberof Membership + */ + readonly collectionId?: string; + /** + * + * @type {Permission} + * @memberof Membership + */ + permission?: Permission; +} + + + +/** + * Check if a given object implements the Membership interface. + */ +export function instanceOfMembership(value: object): value is Membership { + return true; +} + +export function MembershipFromJSON(json: any): Membership { + return MembershipFromJSONTyped(json, false); +} + +export function MembershipFromJSONTyped(json: any, ignoreDiscriminator: boolean): Membership { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'userId': json['userId'] == null ? undefined : json['userId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'permission': json['permission'] == null ? undefined : PermissionFromJSON(json['permission']), + }; +} + +export function MembershipToJSON(json: any): Membership { + return MembershipToJSONTyped(json, false); +} + +export function MembershipToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'permission': PermissionToJSON(value['permission']), + }; +} + diff --git a/src/gen/api/outline/models/ModelError.ts b/src/gen/api/outline/models/ModelError.ts new file mode 100644 index 0000000..49ded60 --- /dev/null +++ b/src/gen/api/outline/models/ModelError.ts @@ -0,0 +1,97 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ModelError + */ +export interface ModelError { + /** + * + * @type {boolean} + * @memberof ModelError + */ + ok?: boolean; + /** + * + * @type {string} + * @memberof ModelError + */ + error?: string; + /** + * + * @type {string} + * @memberof ModelError + */ + message?: string; + /** + * + * @type {number} + * @memberof ModelError + */ + status?: number; + /** + * + * @type {object} + * @memberof ModelError + */ + data?: object; +} + +/** + * Check if a given object implements the ModelError interface. + */ +export function instanceOfModelError(value: object): value is ModelError { + return true; +} + +export function ModelErrorFromJSON(json: any): ModelError { + return ModelErrorFromJSONTyped(json, false); +} + +export function ModelErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelError { + if (json == null) { + return json; + } + return { + + 'ok': json['ok'] == null ? undefined : json['ok'], + 'error': json['error'] == null ? undefined : json['error'], + 'message': json['message'] == null ? undefined : json['message'], + 'status': json['status'] == null ? undefined : json['status'], + 'data': json['data'] == null ? undefined : json['data'], + }; +} + +export function ModelErrorToJSON(json: any): ModelError { + return ModelErrorToJSONTyped(json, false); +} + +export function ModelErrorToJSONTyped(value?: ModelError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ok': value['ok'], + 'error': value['error'], + 'message': value['message'], + 'status': value['status'], + 'data': value['data'], + }; +} + diff --git a/src/gen/api/outline/models/NavigationNode.ts b/src/gen/api/outline/models/NavigationNode.ts new file mode 100644 index 0000000..fff59f7 --- /dev/null +++ b/src/gen/api/outline/models/NavigationNode.ts @@ -0,0 +1,89 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface NavigationNode + */ +export interface NavigationNode { + /** + * Unique identifier for the document. + * @type {string} + * @memberof NavigationNode + */ + id?: string; + /** + * + * @type {string} + * @memberof NavigationNode + */ + title?: string; + /** + * + * @type {string} + * @memberof NavigationNode + */ + url?: string; + /** + * + * @type {Array} + * @memberof NavigationNode + */ + children?: Array; +} + +/** + * Check if a given object implements the NavigationNode interface. + */ +export function instanceOfNavigationNode(value: object): value is NavigationNode { + return true; +} + +export function NavigationNodeFromJSON(json: any): NavigationNode { + return NavigationNodeFromJSONTyped(json, false); +} + +export function NavigationNodeFromJSONTyped(json: any, ignoreDiscriminator: boolean): NavigationNode { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'title': json['title'] == null ? undefined : json['title'], + 'url': json['url'] == null ? undefined : json['url'], + 'children': json['children'] == null ? undefined : ((json['children'] as Array).map(NavigationNodeFromJSON)), + }; +} + +export function NavigationNodeToJSON(json: any): NavigationNode { + return NavigationNodeToJSONTyped(json, false); +} + +export function NavigationNodeToJSONTyped(value?: NavigationNode | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'title': value['title'], + 'url': value['url'], + 'children': value['children'] == null ? undefined : ((value['children'] as Array).map(NavigationNodeToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/OAuthClient.ts b/src/gen/api/outline/models/OAuthClient.ts new file mode 100644 index 0000000..bfadf08 --- /dev/null +++ b/src/gen/api/outline/models/OAuthClient.ts @@ -0,0 +1,148 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OAuthClient + */ +export interface OAuthClient { + /** + * Unique identifier for the object. + * @type {string} + * @memberof OAuthClient + */ + readonly id?: string; + /** + * The name of this OAuth client. + * @type {string} + * @memberof OAuthClient + */ + name?: string; + /** + * A short description of this OAuth client. + * @type {string} + * @memberof OAuthClient + */ + description?: string; + /** + * The name of the developer who created this OAuth client. + * @type {string} + * @memberof OAuthClient + */ + developerName?: string; + /** + * The URL of the developer who created this OAuth client. + * @type {string} + * @memberof OAuthClient + */ + developerUrl?: string; + /** + * A URL pointing to an image representing the OAuth client. + * @type {string} + * @memberof OAuthClient + */ + avatarUrl?: string; + /** + * The client ID for the OAuth client. + * @type {string} + * @memberof OAuthClient + */ + readonly clientId?: string; + /** + * The client secret for the OAuth client. + * @type {string} + * @memberof OAuthClient + */ + readonly clientSecret?: string; + /** + * The redirect URIs for the OAuth client. + * @type {Array} + * @memberof OAuthClient + */ + redirectUris?: Array; + /** + * Whether the OAuth client is available to other workspaces. + * @type {boolean} + * @memberof OAuthClient + */ + published?: boolean; + /** + * Date and time when this OAuth client was created + * @type {Date} + * @memberof OAuthClient + */ + readonly createdAt?: Date; + /** + * Date and time when this OAuth client was updated + * @type {Date} + * @memberof OAuthClient + */ + readonly updatedAt?: Date; +} + +/** + * Check if a given object implements the OAuthClient interface. + */ +export function instanceOfOAuthClient(value: object): value is OAuthClient { + return true; +} + +export function OAuthClientFromJSON(json: any): OAuthClient { + return OAuthClientFromJSONTyped(json, false); +} + +export function OAuthClientFromJSONTyped(json: any, ignoreDiscriminator: boolean): OAuthClient { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'developerName': json['developerName'] == null ? undefined : json['developerName'], + 'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + 'clientId': json['clientId'] == null ? undefined : json['clientId'], + 'clientSecret': json['clientSecret'] == null ? undefined : json['clientSecret'], + 'redirectUris': json['redirectUris'] == null ? undefined : json['redirectUris'], + 'published': json['published'] == null ? undefined : json['published'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + }; +} + +export function OAuthClientToJSON(json: any): OAuthClient { + return OAuthClientToJSONTyped(json, false); +} + +export function OAuthClientToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'developerName': value['developerName'], + 'developerUrl': value['developerUrl'], + 'avatarUrl': value['avatarUrl'], + 'redirectUris': value['redirectUris'], + 'published': value['published'], + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsCreateRequest.ts b/src/gen/api/outline/models/OauthClientsCreateRequest.ts new file mode 100644 index 0000000..ad4b371 --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsCreateRequest.ts @@ -0,0 +1,115 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OauthClientsCreateRequest + */ +export interface OauthClientsCreateRequest { + /** + * Name of the OAuth client. + * @type {string} + * @memberof OauthClientsCreateRequest + */ + name: string; + /** + * A short description of this OAuth client. + * @type {string} + * @memberof OauthClientsCreateRequest + */ + description?: string; + /** + * The name of the developer who created this OAuth client. + * @type {string} + * @memberof OauthClientsCreateRequest + */ + developerName?: string; + /** + * The URL of the developer who created this OAuth client. + * @type {string} + * @memberof OauthClientsCreateRequest + */ + developerUrl?: string; + /** + * A URL pointing to an image representing the OAuth client. + * @type {string} + * @memberof OauthClientsCreateRequest + */ + avatarUrl?: string; + /** + * List of redirect URIs for the OAuth client. + * @type {Array} + * @memberof OauthClientsCreateRequest + */ + redirectUris: Array; + /** + * Whether the OAuth client is available to other workspaces. + * @type {boolean} + * @memberof OauthClientsCreateRequest + */ + published?: boolean; +} + +/** + * Check if a given object implements the OauthClientsCreateRequest interface. + */ +export function instanceOfOauthClientsCreateRequest(value: object): value is OauthClientsCreateRequest { + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirectUris' in value) || value['redirectUris'] === undefined) return false; + return true; +} + +export function OauthClientsCreateRequestFromJSON(json: any): OauthClientsCreateRequest { + return OauthClientsCreateRequestFromJSONTyped(json, false); +} + +export function OauthClientsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsCreateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'developerName': json['developerName'] == null ? undefined : json['developerName'], + 'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + 'redirectUris': json['redirectUris'], + 'published': json['published'] == null ? undefined : json['published'], + }; +} + +export function OauthClientsCreateRequestToJSON(json: any): OauthClientsCreateRequest { + return OauthClientsCreateRequestToJSONTyped(json, false); +} + +export function OauthClientsCreateRequestToJSONTyped(value?: OauthClientsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'developerName': value['developerName'], + 'developerUrl': value['developerUrl'], + 'avatarUrl': value['avatarUrl'], + 'redirectUris': value['redirectUris'], + 'published': value['published'], + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsInfo200Response.ts b/src/gen/api/outline/models/OauthClientsInfo200Response.ts new file mode 100644 index 0000000..8c7e1f1 --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { OAuthClient } from './OAuthClient'; +import { + OAuthClientFromJSON, + OAuthClientFromJSONTyped, + OAuthClientToJSON, + OAuthClientToJSONTyped, +} from './OAuthClient'; + +/** + * + * @export + * @interface OauthClientsInfo200Response + */ +export interface OauthClientsInfo200Response { + /** + * + * @type {OAuthClient} + * @memberof OauthClientsInfo200Response + */ + data?: OAuthClient; + /** + * + * @type {Array} + * @memberof OauthClientsInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the OauthClientsInfo200Response interface. + */ +export function instanceOfOauthClientsInfo200Response(value: object): value is OauthClientsInfo200Response { + return true; +} + +export function OauthClientsInfo200ResponseFromJSON(json: any): OauthClientsInfo200Response { + return OauthClientsInfo200ResponseFromJSONTyped(json, false); +} + +export function OauthClientsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : OAuthClientFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function OauthClientsInfo200ResponseToJSON(json: any): OauthClientsInfo200Response { + return OauthClientsInfo200ResponseToJSONTyped(json, false); +} + +export function OauthClientsInfo200ResponseToJSONTyped(value?: OauthClientsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': OAuthClientToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsInfoRequest.ts b/src/gen/api/outline/models/OauthClientsInfoRequest.ts new file mode 100644 index 0000000..2402c17 --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsInfoRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OauthClientsInfoRequest + */ +export interface OauthClientsInfoRequest { + /** + * Unique identifier for the OAuth client. + * @type {string} + * @memberof OauthClientsInfoRequest + */ + id?: string; + /** + * Public identifier for the OAuth client. + * @type {string} + * @memberof OauthClientsInfoRequest + */ + clientId?: string; +} + +/** + * Check if a given object implements the OauthClientsInfoRequest interface. + */ +export function instanceOfOauthClientsInfoRequest(value: object): value is OauthClientsInfoRequest { + return true; +} + +export function OauthClientsInfoRequestFromJSON(json: any): OauthClientsInfoRequest { + return OauthClientsInfoRequestFromJSONTyped(json, false); +} + +export function OauthClientsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'clientId': json['clientId'] == null ? undefined : json['clientId'], + }; +} + +export function OauthClientsInfoRequestToJSON(json: any): OauthClientsInfoRequest { + return OauthClientsInfoRequestToJSONTyped(json, false); +} + +export function OauthClientsInfoRequestToJSONTyped(value?: OauthClientsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'clientId': value['clientId'], + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsList200Response.ts b/src/gen/api/outline/models/OauthClientsList200Response.ts new file mode 100644 index 0000000..e84019b --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsList200Response.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { OAuthClient } from './OAuthClient'; +import { + OAuthClientFromJSON, + OAuthClientFromJSONTyped, + OAuthClientToJSON, + OAuthClientToJSONTyped, +} from './OAuthClient'; + +/** + * + * @export + * @interface OauthClientsList200Response + */ +export interface OauthClientsList200Response { + /** + * + * @type {number} + * @memberof OauthClientsList200Response + */ + offset?: number; + /** + * + * @type {number} + * @memberof OauthClientsList200Response + */ + limit?: number; + /** + * + * @type {string} + * @memberof OauthClientsList200Response + */ + sort?: string; + /** + * + * @type {string} + * @memberof OauthClientsList200Response + */ + direction?: OauthClientsList200ResponseDirectionEnum; + /** + * + * @type {Array} + * @memberof OauthClientsList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof OauthClientsList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof OauthClientsList200Response + */ + pagination?: Pagination; +} + + +/** + * @export + */ +export const OauthClientsList200ResponseDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type OauthClientsList200ResponseDirectionEnum = typeof OauthClientsList200ResponseDirectionEnum[keyof typeof OauthClientsList200ResponseDirectionEnum]; + + +/** + * Check if a given object implements the OauthClientsList200Response interface. + */ +export function instanceOfOauthClientsList200Response(value: object): value is OauthClientsList200Response { + return true; +} + +export function OauthClientsList200ResponseFromJSON(json: any): OauthClientsList200Response { + return OauthClientsList200ResponseFromJSONTyped(json, false); +} + +export function OauthClientsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsList200Response { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(OAuthClientFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function OauthClientsList200ResponseToJSON(json: any): OauthClientsList200Response { + return OauthClientsList200ResponseToJSONTyped(json, false); +} + +export function OauthClientsList200ResponseToJSONTyped(value?: OauthClientsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(OAuthClientToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsRotateSecretRequest.ts b/src/gen/api/outline/models/OauthClientsRotateSecretRequest.ts new file mode 100644 index 0000000..8f962c6 --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsRotateSecretRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OauthClientsRotateSecretRequest + */ +export interface OauthClientsRotateSecretRequest { + /** + * Unique identifier for the OAuth client. + * @type {string} + * @memberof OauthClientsRotateSecretRequest + */ + id: string; +} + +/** + * Check if a given object implements the OauthClientsRotateSecretRequest interface. + */ +export function instanceOfOauthClientsRotateSecretRequest(value: object): value is OauthClientsRotateSecretRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function OauthClientsRotateSecretRequestFromJSON(json: any): OauthClientsRotateSecretRequest { + return OauthClientsRotateSecretRequestFromJSONTyped(json, false); +} + +export function OauthClientsRotateSecretRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsRotateSecretRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function OauthClientsRotateSecretRequestToJSON(json: any): OauthClientsRotateSecretRequest { + return OauthClientsRotateSecretRequestToJSONTyped(json, false); +} + +export function OauthClientsRotateSecretRequestToJSONTyped(value?: OauthClientsRotateSecretRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/OauthClientsUpdateRequest.ts b/src/gen/api/outline/models/OauthClientsUpdateRequest.ts new file mode 100644 index 0000000..a46a83c --- /dev/null +++ b/src/gen/api/outline/models/OauthClientsUpdateRequest.ts @@ -0,0 +1,122 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface OauthClientsUpdateRequest + */ +export interface OauthClientsUpdateRequest { + /** + * Unique identifier for the OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + id: string; + /** + * Name of the OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + name?: string; + /** + * A short description of this OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + description?: string; + /** + * The name of the developer who created this OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + developerName?: string; + /** + * The URL of the developer who created this OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + developerUrl?: string; + /** + * A URL pointing to an image representing the OAuth client. + * @type {string} + * @memberof OauthClientsUpdateRequest + */ + avatarUrl?: string; + /** + * List of redirect URIs for the OAuth client. + * @type {Array} + * @memberof OauthClientsUpdateRequest + */ + redirectUris?: Array; + /** + * Whether the OAuth client is available to other workspaces. + * @type {boolean} + * @memberof OauthClientsUpdateRequest + */ + published?: boolean; +} + +/** + * Check if a given object implements the OauthClientsUpdateRequest interface. + */ +export function instanceOfOauthClientsUpdateRequest(value: object): value is OauthClientsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function OauthClientsUpdateRequestFromJSON(json: any): OauthClientsUpdateRequest { + return OauthClientsUpdateRequestFromJSONTyped(json, false); +} + +export function OauthClientsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): OauthClientsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'developerName': json['developerName'] == null ? undefined : json['developerName'], + 'developerUrl': json['developerUrl'] == null ? undefined : json['developerUrl'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + 'redirectUris': json['redirectUris'] == null ? undefined : json['redirectUris'], + 'published': json['published'] == null ? undefined : json['published'], + }; +} + +export function OauthClientsUpdateRequestToJSON(json: any): OauthClientsUpdateRequest { + return OauthClientsUpdateRequestToJSONTyped(json, false); +} + +export function OauthClientsUpdateRequestToJSONTyped(value?: OauthClientsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'developerName': value['developerName'], + 'developerUrl': value['developerUrl'], + 'avatarUrl': value['avatarUrl'], + 'redirectUris': value['redirectUris'], + 'published': value['published'], + }; +} + diff --git a/src/gen/api/outline/models/Pagination.ts b/src/gen/api/outline/models/Pagination.ts new file mode 100644 index 0000000..acd4b44 --- /dev/null +++ b/src/gen/api/outline/models/Pagination.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Pagination + */ +export interface Pagination { + /** + * + * @type {number} + * @memberof Pagination + */ + offset?: number; + /** + * + * @type {number} + * @memberof Pagination + */ + limit?: number; +} + +/** + * Check if a given object implements the Pagination interface. + */ +export function instanceOfPagination(value: object): value is Pagination { + return true; +} + +export function PaginationFromJSON(json: any): Pagination { + return PaginationFromJSONTyped(json, false); +} + +export function PaginationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pagination { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + }; +} + +export function PaginationToJSON(json: any): Pagination { + return PaginationToJSONTyped(json, false); +} + +export function PaginationToJSONTyped(value?: Pagination | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + }; +} + diff --git a/src/gen/api/outline/models/Permission.ts b/src/gen/api/outline/models/Permission.ts new file mode 100644 index 0000000..2c22270 --- /dev/null +++ b/src/gen/api/outline/models/Permission.ts @@ -0,0 +1,53 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const Permission = { + Read: 'read', + ReadWrite: 'read_write' +} as const; +export type Permission = typeof Permission[keyof typeof Permission]; + + +export function instanceOfPermission(value: any): boolean { + for (const key in Permission) { + if (Object.prototype.hasOwnProperty.call(Permission, key)) { + if (Permission[key as keyof typeof Permission] === value) { + return true; + } + } + } + return false; +} + +export function PermissionFromJSON(json: any): Permission { + return PermissionFromJSONTyped(json, false); +} + +export function PermissionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Permission { + return json as Permission; +} + +export function PermissionToJSON(value?: Permission | null): any { + return value as any; +} + +export function PermissionToJSONTyped(value: any, ignoreDiscriminator: boolean): Permission { + return value as Permission; +} + diff --git a/src/gen/api/outline/models/Policy.ts b/src/gen/api/outline/models/Policy.ts new file mode 100644 index 0000000..cb67cec --- /dev/null +++ b/src/gen/api/outline/models/Policy.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Ability } from './Ability'; +import { + AbilityFromJSON, + AbilityFromJSONTyped, + AbilityToJSON, + AbilityToJSONTyped, +} from './Ability'; + +/** + * + * @export + * @interface Policy + */ +export interface Policy { + /** + * Unique identifier for the object this policy references. + * @type {string} + * @memberof Policy + */ + readonly id?: string; + /** + * The abilities that are allowed by this policy, if an array is returned then the individual ID's in the array represent the memberships that grant the ability. + * @type {{ [key: string]: Ability; }} + * @memberof Policy + */ + abilities?: { [key: string]: Ability; }; +} + +/** + * Check if a given object implements the Policy interface. + */ +export function instanceOfPolicy(value: object): value is Policy { + return true; +} + +export function PolicyFromJSON(json: any): Policy { + return PolicyFromJSONTyped(json, false); +} + +export function PolicyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Policy { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'abilities': json['abilities'] == null ? undefined : (mapValues(json['abilities'], AbilityFromJSON)), + }; +} + +export function PolicyToJSON(json: any): Policy { + return PolicyToJSONTyped(json, false); +} + +export function PolicyToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'abilities': value['abilities'] == null ? undefined : (mapValues(value['abilities'], AbilityToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/Revision.ts b/src/gen/api/outline/models/Revision.ts new file mode 100644 index 0000000..9b4626c --- /dev/null +++ b/src/gen/api/outline/models/Revision.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Revision + */ +export interface Revision { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Revision + */ + readonly id?: string; + /** + * Identifier for the associated document. + * @type {string} + * @memberof Revision + */ + readonly documentId?: string; + /** + * Title of the document. + * @type {string} + * @memberof Revision + */ + readonly title?: string; + /** + * Body of the document, may contain markdown formatting + * @type {string} + * @memberof Revision + */ + readonly text?: string; + /** + * Date and time when this revision was created + * @type {Date} + * @memberof Revision + */ + readonly createdAt?: Date; + /** + * + * @type {User} + * @memberof Revision + */ + createdBy?: User; +} + +/** + * Check if a given object implements the Revision interface. + */ +export function instanceOfRevision(value: object): value is Revision { + return true; +} + +export function RevisionFromJSON(json: any): Revision { + return RevisionFromJSONTyped(json, false); +} + +export function RevisionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Revision { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'title': json['title'] == null ? undefined : json['title'], + 'text': json['text'] == null ? undefined : json['text'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']), + }; +} + +export function RevisionToJSON(json: any): Revision { + return RevisionToJSONTyped(json, false); +} + +export function RevisionToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'createdBy': UserToJSON(value['createdBy']), + }; +} + diff --git a/src/gen/api/outline/models/RevisionsInfo200Response.ts b/src/gen/api/outline/models/RevisionsInfo200Response.ts new file mode 100644 index 0000000..efcc4fc --- /dev/null +++ b/src/gen/api/outline/models/RevisionsInfo200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Revision } from './Revision'; +import { + RevisionFromJSON, + RevisionFromJSONTyped, + RevisionToJSON, + RevisionToJSONTyped, +} from './Revision'; + +/** + * + * @export + * @interface RevisionsInfo200Response + */ +export interface RevisionsInfo200Response { + /** + * + * @type {Revision} + * @memberof RevisionsInfo200Response + */ + data?: Revision; +} + +/** + * Check if a given object implements the RevisionsInfo200Response interface. + */ +export function instanceOfRevisionsInfo200Response(value: object): value is RevisionsInfo200Response { + return true; +} + +export function RevisionsInfo200ResponseFromJSON(json: any): RevisionsInfo200Response { + return RevisionsInfo200ResponseFromJSONTyped(json, false); +} + +export function RevisionsInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : RevisionFromJSON(json['data']), + }; +} + +export function RevisionsInfo200ResponseToJSON(json: any): RevisionsInfo200Response { + return RevisionsInfo200ResponseToJSONTyped(json, false); +} + +export function RevisionsInfo200ResponseToJSONTyped(value?: RevisionsInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': RevisionToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/RevisionsInfoRequest.ts b/src/gen/api/outline/models/RevisionsInfoRequest.ts new file mode 100644 index 0000000..bc192c3 --- /dev/null +++ b/src/gen/api/outline/models/RevisionsInfoRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RevisionsInfoRequest + */ +export interface RevisionsInfoRequest { + /** + * Unique identifier for the revision. + * @type {string} + * @memberof RevisionsInfoRequest + */ + id: string; +} + +/** + * Check if a given object implements the RevisionsInfoRequest interface. + */ +export function instanceOfRevisionsInfoRequest(value: object): value is RevisionsInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function RevisionsInfoRequestFromJSON(json: any): RevisionsInfoRequest { + return RevisionsInfoRequestFromJSONTyped(json, false); +} + +export function RevisionsInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function RevisionsInfoRequestToJSON(json: any): RevisionsInfoRequest { + return RevisionsInfoRequestToJSONTyped(json, false); +} + +export function RevisionsInfoRequestToJSONTyped(value?: RevisionsInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/RevisionsList200Response.ts b/src/gen/api/outline/models/RevisionsList200Response.ts new file mode 100644 index 0000000..3708dbd --- /dev/null +++ b/src/gen/api/outline/models/RevisionsList200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { Revision } from './Revision'; +import { + RevisionFromJSON, + RevisionFromJSONTyped, + RevisionToJSON, + RevisionToJSONTyped, +} from './Revision'; + +/** + * + * @export + * @interface RevisionsList200Response + */ +export interface RevisionsList200Response { + /** + * + * @type {Array} + * @memberof RevisionsList200Response + */ + data?: Array; + /** + * + * @type {Pagination} + * @memberof RevisionsList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the RevisionsList200Response interface. + */ +export function instanceOfRevisionsList200Response(value: object): value is RevisionsList200Response { + return true; +} + +export function RevisionsList200ResponseFromJSON(json: any): RevisionsList200Response { + return RevisionsList200ResponseFromJSONTyped(json, false); +} + +export function RevisionsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(RevisionFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function RevisionsList200ResponseToJSON(json: any): RevisionsList200Response { + return RevisionsList200ResponseToJSONTyped(json, false); +} + +export function RevisionsList200ResponseToJSONTyped(value?: RevisionsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(RevisionToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/RevisionsListRequest.ts b/src/gen/api/outline/models/RevisionsListRequest.ts new file mode 100644 index 0000000..274d2af --- /dev/null +++ b/src/gen/api/outline/models/RevisionsListRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface RevisionsListRequest + */ +export interface RevisionsListRequest { + /** + * + * @type {number} + * @memberof RevisionsListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof RevisionsListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof RevisionsListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof RevisionsListRequest + */ + direction?: RevisionsListRequestDirectionEnum; + /** + * The document ID to retrieve revisions for + * @type {string} + * @memberof RevisionsListRequest + */ + documentId?: string; +} + + +/** + * @export + */ +export const RevisionsListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type RevisionsListRequestDirectionEnum = typeof RevisionsListRequestDirectionEnum[keyof typeof RevisionsListRequestDirectionEnum]; + + +/** + * Check if a given object implements the RevisionsListRequest interface. + */ +export function instanceOfRevisionsListRequest(value: object): value is RevisionsListRequest { + return true; +} + +export function RevisionsListRequestFromJSON(json: any): RevisionsListRequest { + return RevisionsListRequestFromJSONTyped(json, false); +} + +export function RevisionsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RevisionsListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + }; +} + +export function RevisionsListRequestToJSON(json: any): RevisionsListRequest { + return RevisionsListRequestToJSONTyped(json, false); +} + +export function RevisionsListRequestToJSONTyped(value?: RevisionsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'documentId': value['documentId'], + }; +} + diff --git a/src/gen/api/outline/models/SearchResult.ts b/src/gen/api/outline/models/SearchResult.ts new file mode 100644 index 0000000..6208c8e --- /dev/null +++ b/src/gen/api/outline/models/SearchResult.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface SearchResult + */ +export interface SearchResult { + /** + * + * @type {string} + * @memberof SearchResult + */ + readonly id?: string; + /** + * The user-provided search query + * @type {string} + * @memberof SearchResult + */ + readonly query?: string; + /** + * An answer to the query, if possible + * @type {string} + * @memberof SearchResult + */ + readonly answer?: string; + /** + * The source of the query + * @type {string} + * @memberof SearchResult + */ + readonly source?: SearchResultSourceEnum; + /** + * The date and time that this object was created + * @type {Date} + * @memberof SearchResult + */ + readonly createdAt?: Date; +} + + +/** + * @export + */ +export const SearchResultSourceEnum = { + Api: 'api', + App: 'app' +} as const; +export type SearchResultSourceEnum = typeof SearchResultSourceEnum[keyof typeof SearchResultSourceEnum]; + + +/** + * Check if a given object implements the SearchResult interface. + */ +export function instanceOfSearchResult(value: object): value is SearchResult { + return true; +} + +export function SearchResultFromJSON(json: any): SearchResult { + return SearchResultFromJSONTyped(json, false); +} + +export function SearchResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchResult { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'query': json['query'] == null ? undefined : json['query'], + 'answer': json['answer'] == null ? undefined : json['answer'], + 'source': json['source'] == null ? undefined : json['source'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + }; +} + +export function SearchResultToJSON(json: any): SearchResult { + return SearchResultToJSONTyped(json, false); +} + +export function SearchResultToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + }; +} + diff --git a/src/gen/api/outline/models/Share.ts b/src/gen/api/outline/models/Share.ts new file mode 100644 index 0000000..63d25e7 --- /dev/null +++ b/src/gen/api/outline/models/Share.ts @@ -0,0 +1,138 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface Share + */ +export interface Share { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Share + */ + readonly id?: string; + /** + * Title of the shared document. + * @type {string} + * @memberof Share + */ + readonly documentTitle?: string; + /** + * URL of the original document. + * @type {string} + * @memberof Share + */ + readonly documentUrl?: string; + /** + * URL of the publicly shared document. + * @type {string} + * @memberof Share + */ + readonly url?: string; + /** + * If true the share can be loaded without a user account. + * @type {boolean} + * @memberof Share + */ + published?: boolean; + /** + * If to also give permission to view documents nested beneath this one. + * @type {boolean} + * @memberof Share + */ + includeChildDocuments?: boolean; + /** + * Date and time when this share was created + * @type {Date} + * @memberof Share + */ + readonly createdAt?: Date; + /** + * + * @type {User} + * @memberof Share + */ + createdBy?: User; + /** + * Date and time when this share was edited + * @type {Date} + * @memberof Share + */ + readonly updatedAt?: Date; + /** + * Date and time when this share was last viewed + * @type {Date} + * @memberof Share + */ + readonly lastAccessedAt?: Date; +} + +/** + * Check if a given object implements the Share interface. + */ +export function instanceOfShare(value: object): value is Share { + return true; +} + +export function ShareFromJSON(json: any): Share { + return ShareFromJSONTyped(json, false); +} + +export function ShareFromJSONTyped(json: any, ignoreDiscriminator: boolean): Share { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentTitle': json['documentTitle'] == null ? undefined : json['documentTitle'], + 'documentUrl': json['documentUrl'] == null ? undefined : json['documentUrl'], + 'url': json['url'] == null ? undefined : json['url'], + 'published': json['published'] == null ? undefined : json['published'], + 'includeChildDocuments': json['includeChildDocuments'] == null ? undefined : json['includeChildDocuments'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + 'createdBy': json['createdBy'] == null ? undefined : UserFromJSON(json['createdBy']), + 'updatedAt': json['updatedAt'] == null ? undefined : (new Date(json['updatedAt'])), + 'lastAccessedAt': json['lastAccessedAt'] == null ? undefined : (new Date(json['lastAccessedAt'])), + }; +} + +export function ShareToJSON(json: any): Share { + return ShareToJSONTyped(json, false); +} + +export function ShareToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'published': value['published'], + 'includeChildDocuments': value['includeChildDocuments'], + 'createdBy': UserToJSON(value['createdBy']), + }; +} + diff --git a/src/gen/api/outline/models/SharesCreateRequest.ts b/src/gen/api/outline/models/SharesCreateRequest.ts new file mode 100644 index 0000000..6cdfb07 --- /dev/null +++ b/src/gen/api/outline/models/SharesCreateRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface SharesCreateRequest + */ +export interface SharesCreateRequest { + /** + * + * @type {string} + * @memberof SharesCreateRequest + */ + documentId: string; +} + +/** + * Check if a given object implements the SharesCreateRequest interface. + */ +export function instanceOfSharesCreateRequest(value: object): value is SharesCreateRequest { + if (!('documentId' in value) || value['documentId'] === undefined) return false; + return true; +} + +export function SharesCreateRequestFromJSON(json: any): SharesCreateRequest { + return SharesCreateRequestFromJSONTyped(json, false); +} + +export function SharesCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesCreateRequest { + if (json == null) { + return json; + } + return { + + 'documentId': json['documentId'], + }; +} + +export function SharesCreateRequestToJSON(json: any): SharesCreateRequest { + return SharesCreateRequestToJSONTyped(json, false); +} + +export function SharesCreateRequestToJSONTyped(value?: SharesCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documentId': value['documentId'], + }; +} + diff --git a/src/gen/api/outline/models/SharesInfo200Response.ts b/src/gen/api/outline/models/SharesInfo200Response.ts new file mode 100644 index 0000000..3e31b78 --- /dev/null +++ b/src/gen/api/outline/models/SharesInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Share } from './Share'; +import { + ShareFromJSON, + ShareFromJSONTyped, + ShareToJSON, + ShareToJSONTyped, +} from './Share'; + +/** + * + * @export + * @interface SharesInfo200Response + */ +export interface SharesInfo200Response { + /** + * + * @type {Share} + * @memberof SharesInfo200Response + */ + data?: Share; + /** + * + * @type {Array} + * @memberof SharesInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the SharesInfo200Response interface. + */ +export function instanceOfSharesInfo200Response(value: object): value is SharesInfo200Response { + return true; +} + +export function SharesInfo200ResponseFromJSON(json: any): SharesInfo200Response { + return SharesInfo200ResponseFromJSONTyped(json, false); +} + +export function SharesInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ShareFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function SharesInfo200ResponseToJSON(json: any): SharesInfo200Response { + return SharesInfo200ResponseToJSONTyped(json, false); +} + +export function SharesInfo200ResponseToJSONTyped(value?: SharesInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': ShareToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/SharesInfoRequest.ts b/src/gen/api/outline/models/SharesInfoRequest.ts new file mode 100644 index 0000000..efbe203 --- /dev/null +++ b/src/gen/api/outline/models/SharesInfoRequest.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface SharesInfoRequest + */ +export interface SharesInfoRequest { + /** + * Unique identifier for the share. + * @type {string} + * @memberof SharesInfoRequest + */ + id?: string; + /** + * Unique identifier for a document. One of id or documentId must be provided. + * @type {string} + * @memberof SharesInfoRequest + */ + documentId?: string; +} + +/** + * Check if a given object implements the SharesInfoRequest interface. + */ +export function instanceOfSharesInfoRequest(value: object): value is SharesInfoRequest { + return true; +} + +export function SharesInfoRequestFromJSON(json: any): SharesInfoRequest { + return SharesInfoRequestFromJSONTyped(json, false); +} + +export function SharesInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + }; +} + +export function SharesInfoRequestToJSON(json: any): SharesInfoRequest { + return SharesInfoRequestToJSONTyped(json, false); +} + +export function SharesInfoRequestToJSONTyped(value?: SharesInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'documentId': value['documentId'], + }; +} + diff --git a/src/gen/api/outline/models/SharesList200Response.ts b/src/gen/api/outline/models/SharesList200Response.ts new file mode 100644 index 0000000..d81f378 --- /dev/null +++ b/src/gen/api/outline/models/SharesList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { Share } from './Share'; +import { + ShareFromJSON, + ShareFromJSONTyped, + ShareToJSON, + ShareToJSONTyped, +} from './Share'; + +/** + * + * @export + * @interface SharesList200Response + */ +export interface SharesList200Response { + /** + * + * @type {Array} + * @memberof SharesList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof SharesList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof SharesList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the SharesList200Response interface. + */ +export function instanceOfSharesList200Response(value: object): value is SharesList200Response { + return true; +} + +export function SharesList200ResponseFromJSON(json: any): SharesList200Response { + return SharesList200ResponseFromJSONTyped(json, false); +} + +export function SharesList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(ShareFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function SharesList200ResponseToJSON(json: any): SharesList200Response { + return SharesList200ResponseToJSONTyped(json, false); +} + +export function SharesList200ResponseToJSONTyped(value?: SharesList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(ShareToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/SharesListRequest.ts b/src/gen/api/outline/models/SharesListRequest.ts new file mode 100644 index 0000000..5cee2a4 --- /dev/null +++ b/src/gen/api/outline/models/SharesListRequest.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface SharesListRequest + */ +export interface SharesListRequest { + /** + * + * @type {number} + * @memberof SharesListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof SharesListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof SharesListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof SharesListRequest + */ + direction?: SharesListRequestDirectionEnum; + /** + * Filter to shared documents matching a search query + * @type {string} + * @memberof SharesListRequest + */ + query?: string; +} + + +/** + * @export + */ +export const SharesListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type SharesListRequestDirectionEnum = typeof SharesListRequestDirectionEnum[keyof typeof SharesListRequestDirectionEnum]; + + +/** + * Check if a given object implements the SharesListRequest interface. + */ +export function instanceOfSharesListRequest(value: object): value is SharesListRequest { + return true; +} + +export function SharesListRequestFromJSON(json: any): SharesListRequest { + return SharesListRequestFromJSONTyped(json, false); +} + +export function SharesListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'query': json['query'] == null ? undefined : json['query'], + }; +} + +export function SharesListRequestToJSON(json: any): SharesListRequest { + return SharesListRequestToJSONTyped(json, false); +} + +export function SharesListRequestToJSONTyped(value?: SharesListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'query': value['query'], + }; +} + diff --git a/src/gen/api/outline/models/SharesUpdateRequest.ts b/src/gen/api/outline/models/SharesUpdateRequest.ts new file mode 100644 index 0000000..ffe00af --- /dev/null +++ b/src/gen/api/outline/models/SharesUpdateRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface SharesUpdateRequest + */ +export interface SharesUpdateRequest { + /** + * + * @type {string} + * @memberof SharesUpdateRequest + */ + id: string; + /** + * + * @type {boolean} + * @memberof SharesUpdateRequest + */ + published: boolean; +} + +/** + * Check if a given object implements the SharesUpdateRequest interface. + */ +export function instanceOfSharesUpdateRequest(value: object): value is SharesUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('published' in value) || value['published'] === undefined) return false; + return true; +} + +export function SharesUpdateRequestFromJSON(json: any): SharesUpdateRequest { + return SharesUpdateRequestFromJSONTyped(json, false); +} + +export function SharesUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): SharesUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'published': json['published'], + }; +} + +export function SharesUpdateRequestToJSON(json: any): SharesUpdateRequest { + return SharesUpdateRequestToJSONTyped(json, false); +} + +export function SharesUpdateRequestToJSONTyped(value?: SharesUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'published': value['published'], + }; +} + diff --git a/src/gen/api/outline/models/Sorting.ts b/src/gen/api/outline/models/Sorting.ts new file mode 100644 index 0000000..2dc8b85 --- /dev/null +++ b/src/gen/api/outline/models/Sorting.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Sorting + */ +export interface Sorting { + /** + * + * @type {string} + * @memberof Sorting + */ + sort?: string; + /** + * + * @type {string} + * @memberof Sorting + */ + direction?: SortingDirectionEnum; +} + + +/** + * @export + */ +export const SortingDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type SortingDirectionEnum = typeof SortingDirectionEnum[keyof typeof SortingDirectionEnum]; + + +/** + * Check if a given object implements the Sorting interface. + */ +export function instanceOfSorting(value: object): value is Sorting { + return true; +} + +export function SortingFromJSON(json: any): Sorting { + return SortingFromJSONTyped(json, false); +} + +export function SortingFromJSONTyped(json: any, ignoreDiscriminator: boolean): Sorting { + if (json == null) { + return json; + } + return { + + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + }; +} + +export function SortingToJSON(json: any): Sorting { + return SortingToJSONTyped(json, false); +} + +export function SortingToJSONTyped(value?: Sorting | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sort': value['sort'], + 'direction': value['direction'], + }; +} + diff --git a/src/gen/api/outline/models/Star.ts b/src/gen/api/outline/models/Star.ts new file mode 100644 index 0000000..e74e04c --- /dev/null +++ b/src/gen/api/outline/models/Star.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface Star + */ +export interface Star { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Star + */ + readonly id?: string; + /** + * Index of the star in the list of stars. + * @type {string} + * @memberof Star + */ + index?: string; + /** + * Unique identifier for the starred document. + * @type {string} + * @memberof Star + */ + readonly documentId?: string; + /** + * Unique identifier for the starred collection. + * @type {string} + * @memberof Star + */ + readonly collectionId?: string; + /** + * URL of the original document. + * @type {string} + * @memberof Star + */ + readonly documentUrl?: string; + /** + * Date and time when this star was created + * @type {Date} + * @memberof Star + */ + readonly createdAt?: Date; +} + +/** + * Check if a given object implements the Star interface. + */ +export function instanceOfStar(value: object): value is Star { + return true; +} + +export function StarFromJSON(json: any): Star { + return StarFromJSONTyped(json, false); +} + +export function StarFromJSONTyped(json: any, ignoreDiscriminator: boolean): Star { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'index': json['index'] == null ? undefined : json['index'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'documentUrl': json['documentUrl'] == null ? undefined : json['documentUrl'], + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + }; +} + +export function StarToJSON(json: any): Star { + return StarToJSONTyped(json, false); +} + +export function StarToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'index': value['index'], + }; +} + diff --git a/src/gen/api/outline/models/StarsCreate200Response.ts b/src/gen/api/outline/models/StarsCreate200Response.ts new file mode 100644 index 0000000..47b2fc6 --- /dev/null +++ b/src/gen/api/outline/models/StarsCreate200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Star } from './Star'; +import { + StarFromJSON, + StarFromJSONTyped, + StarToJSON, + StarToJSONTyped, +} from './Star'; + +/** + * + * @export + * @interface StarsCreate200Response + */ +export interface StarsCreate200Response { + /** + * + * @type {Star} + * @memberof StarsCreate200Response + */ + data?: Star; + /** + * + * @type {Array} + * @memberof StarsCreate200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the StarsCreate200Response interface. + */ +export function instanceOfStarsCreate200Response(value: object): value is StarsCreate200Response { + return true; +} + +export function StarsCreate200ResponseFromJSON(json: any): StarsCreate200Response { + return StarsCreate200ResponseFromJSONTyped(json, false); +} + +export function StarsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : StarFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function StarsCreate200ResponseToJSON(json: any): StarsCreate200Response { + return StarsCreate200ResponseToJSONTyped(json, false); +} + +export function StarsCreate200ResponseToJSONTyped(value?: StarsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': StarToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsCreateRequest.ts b/src/gen/api/outline/models/StarsCreateRequest.ts new file mode 100644 index 0000000..1a6ec89 --- /dev/null +++ b/src/gen/api/outline/models/StarsCreateRequest.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface StarsCreateRequest + */ +export interface StarsCreateRequest { + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + documentId?: string; + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + collectionId?: string; + /** + * + * @type {string} + * @memberof StarsCreateRequest + */ + index?: string; +} + +/** + * Check if a given object implements the StarsCreateRequest interface. + */ +export function instanceOfStarsCreateRequest(value: object): value is StarsCreateRequest { + return true; +} + +export function StarsCreateRequestFromJSON(json: any): StarsCreateRequest { + return StarsCreateRequestFromJSONTyped(json, false); +} + +export function StarsCreateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsCreateRequest { + if (json == null) { + return json; + } + return { + + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'collectionId': json['collectionId'] == null ? undefined : json['collectionId'], + 'index': json['index'] == null ? undefined : json['index'], + }; +} + +export function StarsCreateRequestToJSON(json: any): StarsCreateRequest { + return StarsCreateRequestToJSONTyped(json, false); +} + +export function StarsCreateRequestToJSONTyped(value?: StarsCreateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documentId': value['documentId'], + 'collectionId': value['collectionId'], + 'index': value['index'], + }; +} + diff --git a/src/gen/api/outline/models/StarsList200Response.ts b/src/gen/api/outline/models/StarsList200Response.ts new file mode 100644 index 0000000..09512a0 --- /dev/null +++ b/src/gen/api/outline/models/StarsList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { StarsList200ResponseData } from './StarsList200ResponseData'; +import { + StarsList200ResponseDataFromJSON, + StarsList200ResponseDataFromJSONTyped, + StarsList200ResponseDataToJSON, + StarsList200ResponseDataToJSONTyped, +} from './StarsList200ResponseData'; + +/** + * + * @export + * @interface StarsList200Response + */ +export interface StarsList200Response { + /** + * + * @type {StarsList200ResponseData} + * @memberof StarsList200Response + */ + data?: StarsList200ResponseData; + /** + * + * @type {Pagination} + * @memberof StarsList200Response + */ + pagination?: Pagination; + /** + * + * @type {Array} + * @memberof StarsList200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the StarsList200Response interface. + */ +export function instanceOfStarsList200Response(value: object): value is StarsList200Response { + return true; +} + +export function StarsList200ResponseFromJSON(json: any): StarsList200Response { + return StarsList200ResponseFromJSONTyped(json, false); +} + +export function StarsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : StarsList200ResponseDataFromJSON(json['data']), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function StarsList200ResponseToJSON(json: any): StarsList200Response { + return StarsList200ResponseToJSONTyped(json, false); +} + +export function StarsList200ResponseToJSONTyped(value?: StarsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': StarsList200ResponseDataToJSON(value['data']), + 'pagination': PaginationToJSON(value['pagination']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsList200ResponseData.ts b/src/gen/api/outline/models/StarsList200ResponseData.ts new file mode 100644 index 0000000..a320d8d --- /dev/null +++ b/src/gen/api/outline/models/StarsList200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Star } from './Star'; +import { + StarFromJSON, + StarFromJSONTyped, + StarToJSON, + StarToJSONTyped, +} from './Star'; +import type { Document } from './Document'; +import { + DocumentFromJSON, + DocumentFromJSONTyped, + DocumentToJSON, + DocumentToJSONTyped, +} from './Document'; + +/** + * + * @export + * @interface StarsList200ResponseData + */ +export interface StarsList200ResponseData { + /** + * + * @type {Array} + * @memberof StarsList200ResponseData + */ + stars?: Array; + /** + * + * @type {Array} + * @memberof StarsList200ResponseData + */ + documents?: Array; +} + +/** + * Check if a given object implements the StarsList200ResponseData interface. + */ +export function instanceOfStarsList200ResponseData(value: object): value is StarsList200ResponseData { + return true; +} + +export function StarsList200ResponseDataFromJSON(json: any): StarsList200ResponseData { + return StarsList200ResponseDataFromJSONTyped(json, false); +} + +export function StarsList200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsList200ResponseData { + if (json == null) { + return json; + } + return { + + 'stars': json['stars'] == null ? undefined : ((json['stars'] as Array).map(StarFromJSON)), + 'documents': json['documents'] == null ? undefined : ((json['documents'] as Array).map(DocumentFromJSON)), + }; +} + +export function StarsList200ResponseDataToJSON(json: any): StarsList200ResponseData { + return StarsList200ResponseDataToJSONTyped(json, false); +} + +export function StarsList200ResponseDataToJSONTyped(value?: StarsList200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'stars': value['stars'] == null ? undefined : ((value['stars'] as Array).map(StarToJSON)), + 'documents': value['documents'] == null ? undefined : ((value['documents'] as Array).map(DocumentToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/StarsUpdateRequest.ts b/src/gen/api/outline/models/StarsUpdateRequest.ts new file mode 100644 index 0000000..c04f4b7 --- /dev/null +++ b/src/gen/api/outline/models/StarsUpdateRequest.ts @@ -0,0 +1,75 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface StarsUpdateRequest + */ +export interface StarsUpdateRequest { + /** + * + * @type {string} + * @memberof StarsUpdateRequest + */ + id: string; + /** + * + * @type {string} + * @memberof StarsUpdateRequest + */ + index: string; +} + +/** + * Check if a given object implements the StarsUpdateRequest interface. + */ +export function instanceOfStarsUpdateRequest(value: object): value is StarsUpdateRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('index' in value) || value['index'] === undefined) return false; + return true; +} + +export function StarsUpdateRequestFromJSON(json: any): StarsUpdateRequest { + return StarsUpdateRequestFromJSONTyped(json, false); +} + +export function StarsUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): StarsUpdateRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'index': json['index'], + }; +} + +export function StarsUpdateRequestToJSON(json: any): StarsUpdateRequest { + return StarsUpdateRequestToJSONTyped(json, false); +} + +export function StarsUpdateRequestToJSONTyped(value?: StarsUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'index': value['index'], + }; +} + diff --git a/src/gen/api/outline/models/Team.ts b/src/gen/api/outline/models/Team.ts new file mode 100644 index 0000000..93ed3e1 --- /dev/null +++ b/src/gen/api/outline/models/Team.ts @@ -0,0 +1,177 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UserRole } from './UserRole'; +import { + UserRoleFromJSON, + UserRoleFromJSONTyped, + UserRoleToJSON, + UserRoleToJSONTyped, +} from './UserRole'; + +/** + * + * @export + * @interface Team + */ +export interface Team { + /** + * Unique identifier for the object. + * @type {string} + * @memberof Team + */ + readonly id?: string; + /** + * The name of this team, it is usually auto-generated when the first SSO connection is made but can be changed if neccessary. + * @type {string} + * @memberof Team + */ + name?: string; + /** + * The URL for the image associated with this team, it will be displayed in the team switcher and in the top left of the knowledge base along with the name. + * @type {string} + * @memberof Team + */ + avatarUrl?: string; + /** + * Whether this team has share links globally enabled. If this value is false then all sharing UI and APIs are disabled. + * @type {boolean} + * @memberof Team + */ + sharing?: boolean; + /** + * If set then the referenced collection is where users will be redirected to after signing in instead of the Home screen + * @type {string} + * @memberof Team + */ + defaultCollectionId?: string; + /** + * + * @type {UserRole} + * @memberof Team + */ + defaultUserRole?: UserRole; + /** + * Whether members are allowed to create new collections. If false then only admins can create collections. + * @type {boolean} + * @memberof Team + */ + memberCollectionCreate?: boolean; + /** + * Whether this team has embeds in documents globally enabled. It can be disabled to reduce potential data leakage to third parties. + * @type {boolean} + * @memberof Team + */ + documentEmbeds?: boolean; + /** + * Whether this team has collaborative editing in documents globally enabled. + * @type {boolean} + * @memberof Team + */ + collaborativeEditing?: boolean; + /** + * Whether an invite is required to join this team, if false users may join with a linked SSO provider. + * @type {boolean} + * @memberof Team + */ + inviteRequired?: boolean; + /** + * + * @type {Array} + * @memberof Team + */ + allowedDomains?: Array; + /** + * Whether this team has guest signin enabled. Guests can signin with an email address and are not required to have a Google Workspace/Slack SSO account once invited. + * @type {boolean} + * @memberof Team + */ + guestSignin?: boolean; + /** + * Represents the subdomain at which this team's knowledge base can be accessed. + * @type {string} + * @memberof Team + */ + subdomain?: string; + /** + * The fully qualified URL at which this team's knowledge base can be accessed. + * @type {string} + * @memberof Team + */ + readonly url?: string; +} + + + +/** + * Check if a given object implements the Team interface. + */ +export function instanceOfTeam(value: object): value is Team { + return true; +} + +export function TeamFromJSON(json: any): Team { + return TeamFromJSONTyped(json, false); +} + +export function TeamFromJSONTyped(json: any, ignoreDiscriminator: boolean): Team { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + 'sharing': json['sharing'] == null ? undefined : json['sharing'], + 'defaultCollectionId': json['defaultCollectionId'] == null ? undefined : json['defaultCollectionId'], + 'defaultUserRole': json['defaultUserRole'] == null ? undefined : UserRoleFromJSON(json['defaultUserRole']), + 'memberCollectionCreate': json['memberCollectionCreate'] == null ? undefined : json['memberCollectionCreate'], + 'documentEmbeds': json['documentEmbeds'] == null ? undefined : json['documentEmbeds'], + 'collaborativeEditing': json['collaborativeEditing'] == null ? undefined : json['collaborativeEditing'], + 'inviteRequired': json['inviteRequired'] == null ? undefined : json['inviteRequired'], + 'allowedDomains': json['allowedDomains'] == null ? undefined : json['allowedDomains'], + 'guestSignin': json['guestSignin'] == null ? undefined : json['guestSignin'], + 'subdomain': json['subdomain'] == null ? undefined : json['subdomain'], + 'url': json['url'] == null ? undefined : json['url'], + }; +} + +export function TeamToJSON(json: any): Team { + return TeamToJSONTyped(json, false); +} + +export function TeamToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'avatarUrl': value['avatarUrl'], + 'sharing': value['sharing'], + 'defaultCollectionId': value['defaultCollectionId'], + 'defaultUserRole': UserRoleToJSON(value['defaultUserRole']), + 'memberCollectionCreate': value['memberCollectionCreate'], + 'documentEmbeds': value['documentEmbeds'], + 'collaborativeEditing': value['collaborativeEditing'], + 'inviteRequired': value['inviteRequired'], + 'allowedDomains': value['allowedDomains'], + 'guestSignin': value['guestSignin'], + 'subdomain': value['subdomain'], + }; +} + diff --git a/src/gen/api/outline/models/User.ts b/src/gen/api/outline/models/User.ts new file mode 100644 index 0000000..5c9a19e --- /dev/null +++ b/src/gen/api/outline/models/User.ts @@ -0,0 +1,126 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UserRole } from './UserRole'; +import { + UserRoleFromJSON, + UserRoleFromJSONTyped, + UserRoleToJSON, + UserRoleToJSONTyped, +} from './UserRole'; + +/** + * + * @export + * @interface User + */ +export interface User { + /** + * Unique identifier for the object. + * @type {string} + * @memberof User + */ + readonly id?: string; + /** + * The name of this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary. + * @type {string} + * @memberof User + */ + name?: string; + /** + * The URL for the image associated with this user, it will be displayed in the application UI and email notifications. + * @type {string} + * @memberof User + */ + avatarUrl?: string; + /** + * The email associated with this user, it is migrated from Slack or Google Workspace when the SSO connection is made but can be changed if neccessary. + * @type {string} + * @memberof User + */ + readonly email?: string; + /** + * + * @type {UserRole} + * @memberof User + */ + role?: UserRole; + /** + * Whether this user has been suspended. + * @type {boolean} + * @memberof User + */ + readonly isSuspended?: boolean; + /** + * The last time this user made an API request, this value is updated at most every 5 minutes. + * @type {Date} + * @memberof User + */ + readonly lastActiveAt?: Date; + /** + * The date and time that this user first signed in or was invited as a guest. + * @type {Date} + * @memberof User + */ + readonly createdAt?: Date; +} + + + +/** + * Check if a given object implements the User interface. + */ +export function instanceOfUser(value: object): value is User { + return true; +} + +export function UserFromJSON(json: any): User { + return UserFromJSONTyped(json, false); +} + +export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + 'email': json['email'] == null ? undefined : json['email'], + 'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']), + 'isSuspended': json['isSuspended'] == null ? undefined : json['isSuspended'], + 'lastActiveAt': json['lastActiveAt'] == null ? undefined : (new Date(json['lastActiveAt'])), + 'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])), + }; +} + +export function UserToJSON(json: any): User { + return UserToJSONTyped(json, false); +} + +export function UserToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'avatarUrl': value['avatarUrl'], + 'role': UserRoleToJSON(value['role']), + }; +} + diff --git a/src/gen/api/outline/models/UserRole.ts b/src/gen/api/outline/models/UserRole.ts new file mode 100644 index 0000000..c0a054e --- /dev/null +++ b/src/gen/api/outline/models/UserRole.ts @@ -0,0 +1,55 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * + * @export + */ +export const UserRole = { + Admin: 'admin', + Member: 'member', + Viewer: 'viewer', + Guest: 'guest' +} as const; +export type UserRole = typeof UserRole[keyof typeof UserRole]; + + +export function instanceOfUserRole(value: any): boolean { + for (const key in UserRole) { + if (Object.prototype.hasOwnProperty.call(UserRole, key)) { + if (UserRole[key as keyof typeof UserRole] === value) { + return true; + } + } + } + return false; +} + +export function UserRoleFromJSON(json: any): UserRole { + return UserRoleFromJSONTyped(json, false); +} + +export function UserRoleFromJSONTyped(json: any, ignoreDiscriminator: boolean): UserRole { + return json as UserRole; +} + +export function UserRoleToJSON(value?: UserRole | null): any { + return value as any; +} + +export function UserRoleToJSONTyped(value: any, ignoreDiscriminator: boolean): UserRole { + return value as UserRole; +} + diff --git a/src/gen/api/outline/models/UsersInfo200Response.ts b/src/gen/api/outline/models/UsersInfo200Response.ts new file mode 100644 index 0000000..d76d335 --- /dev/null +++ b/src/gen/api/outline/models/UsersInfo200Response.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface UsersInfo200Response + */ +export interface UsersInfo200Response { + /** + * + * @type {User} + * @memberof UsersInfo200Response + */ + data?: User; + /** + * + * @type {Array} + * @memberof UsersInfo200Response + */ + policies?: Array; +} + +/** + * Check if a given object implements the UsersInfo200Response interface. + */ +export function instanceOfUsersInfo200Response(value: object): value is UsersInfo200Response { + return true; +} + +export function UsersInfo200ResponseFromJSON(json: any): UsersInfo200Response { + return UsersInfo200ResponseFromJSONTyped(json, false); +} + +export function UsersInfo200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInfo200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : UserFromJSON(json['data']), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + }; +} + +export function UsersInfo200ResponseToJSON(json: any): UsersInfo200Response { + return UsersInfo200ResponseToJSONTyped(json, false); +} + +export function UsersInfo200ResponseToJSONTyped(value?: UsersInfo200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': UserToJSON(value['data']), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/UsersInfoRequest.ts b/src/gen/api/outline/models/UsersInfoRequest.ts new file mode 100644 index 0000000..dd86825 --- /dev/null +++ b/src/gen/api/outline/models/UsersInfoRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface UsersInfoRequest + */ +export interface UsersInfoRequest { + /** + * Unique identifier for the user. + * @type {string} + * @memberof UsersInfoRequest + */ + id: string; +} + +/** + * Check if a given object implements the UsersInfoRequest interface. + */ +export function instanceOfUsersInfoRequest(value: object): value is UsersInfoRequest { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function UsersInfoRequestFromJSON(json: any): UsersInfoRequest { + return UsersInfoRequestFromJSONTyped(json, false); +} + +export function UsersInfoRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInfoRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function UsersInfoRequestToJSON(json: any): UsersInfoRequest { + return UsersInfoRequestToJSONTyped(json, false); +} + +export function UsersInfoRequestToJSONTyped(value?: UsersInfoRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/src/gen/api/outline/models/UsersInvite200Response.ts b/src/gen/api/outline/models/UsersInvite200Response.ts new file mode 100644 index 0000000..62eda55 --- /dev/null +++ b/src/gen/api/outline/models/UsersInvite200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UsersInvite200ResponseData } from './UsersInvite200ResponseData'; +import { + UsersInvite200ResponseDataFromJSON, + UsersInvite200ResponseDataFromJSONTyped, + UsersInvite200ResponseDataToJSON, + UsersInvite200ResponseDataToJSONTyped, +} from './UsersInvite200ResponseData'; + +/** + * + * @export + * @interface UsersInvite200Response + */ +export interface UsersInvite200Response { + /** + * + * @type {UsersInvite200ResponseData} + * @memberof UsersInvite200Response + */ + data?: UsersInvite200ResponseData; +} + +/** + * Check if a given object implements the UsersInvite200Response interface. + */ +export function instanceOfUsersInvite200Response(value: object): value is UsersInvite200Response { + return true; +} + +export function UsersInvite200ResponseFromJSON(json: any): UsersInvite200Response { + return UsersInvite200ResponseFromJSONTyped(json, false); +} + +export function UsersInvite200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInvite200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : UsersInvite200ResponseDataFromJSON(json['data']), + }; +} + +export function UsersInvite200ResponseToJSON(json: any): UsersInvite200Response { + return UsersInvite200ResponseToJSONTyped(json, false); +} + +export function UsersInvite200ResponseToJSONTyped(value?: UsersInvite200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': UsersInvite200ResponseDataToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/UsersInvite200ResponseData.ts b/src/gen/api/outline/models/UsersInvite200ResponseData.ts new file mode 100644 index 0000000..d41f708 --- /dev/null +++ b/src/gen/api/outline/models/UsersInvite200ResponseData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; +import type { Invite } from './Invite'; +import { + InviteFromJSON, + InviteFromJSONTyped, + InviteToJSON, + InviteToJSONTyped, +} from './Invite'; + +/** + * + * @export + * @interface UsersInvite200ResponseData + */ +export interface UsersInvite200ResponseData { + /** + * + * @type {Array} + * @memberof UsersInvite200ResponseData + */ + sent?: Array; + /** + * + * @type {Array} + * @memberof UsersInvite200ResponseData + */ + users?: Array; +} + +/** + * Check if a given object implements the UsersInvite200ResponseData interface. + */ +export function instanceOfUsersInvite200ResponseData(value: object): value is UsersInvite200ResponseData { + return true; +} + +export function UsersInvite200ResponseDataFromJSON(json: any): UsersInvite200ResponseData { + return UsersInvite200ResponseDataFromJSONTyped(json, false); +} + +export function UsersInvite200ResponseDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInvite200ResponseData { + if (json == null) { + return json; + } + return { + + 'sent': json['sent'] == null ? undefined : ((json['sent'] as Array).map(InviteFromJSON)), + 'users': json['users'] == null ? undefined : ((json['users'] as Array).map(UserFromJSON)), + }; +} + +export function UsersInvite200ResponseDataToJSON(json: any): UsersInvite200ResponseData { + return UsersInvite200ResponseDataToJSONTyped(json, false); +} + +export function UsersInvite200ResponseDataToJSONTyped(value?: UsersInvite200ResponseData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'sent': value['sent'] == null ? undefined : ((value['sent'] as Array).map(InviteToJSON)), + 'users': value['users'] == null ? undefined : ((value['users'] as Array).map(UserToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/UsersInviteRequest.ts b/src/gen/api/outline/models/UsersInviteRequest.ts new file mode 100644 index 0000000..abe105c --- /dev/null +++ b/src/gen/api/outline/models/UsersInviteRequest.ts @@ -0,0 +1,74 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Invite } from './Invite'; +import { + InviteFromJSON, + InviteFromJSONTyped, + InviteToJSON, + InviteToJSONTyped, +} from './Invite'; + +/** + * + * @export + * @interface UsersInviteRequest + */ +export interface UsersInviteRequest { + /** + * + * @type {Array} + * @memberof UsersInviteRequest + */ + invites: Array; +} + +/** + * Check if a given object implements the UsersInviteRequest interface. + */ +export function instanceOfUsersInviteRequest(value: object): value is UsersInviteRequest { + if (!('invites' in value) || value['invites'] === undefined) return false; + return true; +} + +export function UsersInviteRequestFromJSON(json: any): UsersInviteRequest { + return UsersInviteRequestFromJSONTyped(json, false); +} + +export function UsersInviteRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersInviteRequest { + if (json == null) { + return json; + } + return { + + 'invites': ((json['invites'] as Array).map(InviteFromJSON)), + }; +} + +export function UsersInviteRequestToJSON(json: any): UsersInviteRequest { + return UsersInviteRequestToJSONTyped(json, false); +} + +export function UsersInviteRequestToJSONTyped(value?: UsersInviteRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'invites': ((value['invites'] as Array).map(InviteToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/UsersList200Response.ts b/src/gen/api/outline/models/UsersList200Response.ts new file mode 100644 index 0000000..037e51e --- /dev/null +++ b/src/gen/api/outline/models/UsersList200Response.ts @@ -0,0 +1,103 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { Policy } from './Policy'; +import { + PolicyFromJSON, + PolicyFromJSONTyped, + PolicyToJSON, + PolicyToJSONTyped, +} from './Policy'; +import type { Pagination } from './Pagination'; +import { + PaginationFromJSON, + PaginationFromJSONTyped, + PaginationToJSON, + PaginationToJSONTyped, +} from './Pagination'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface UsersList200Response + */ +export interface UsersList200Response { + /** + * + * @type {Array} + * @memberof UsersList200Response + */ + data?: Array; + /** + * + * @type {Array} + * @memberof UsersList200Response + */ + policies?: Array; + /** + * + * @type {Pagination} + * @memberof UsersList200Response + */ + pagination?: Pagination; +} + +/** + * Check if a given object implements the UsersList200Response interface. + */ +export function instanceOfUsersList200Response(value: object): value is UsersList200Response { + return true; +} + +export function UsersList200ResponseFromJSON(json: any): UsersList200Response { + return UsersList200ResponseFromJSONTyped(json, false); +} + +export function UsersList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(UserFromJSON)), + 'policies': json['policies'] == null ? undefined : ((json['policies'] as Array).map(PolicyFromJSON)), + 'pagination': json['pagination'] == null ? undefined : PaginationFromJSON(json['pagination']), + }; +} + +export function UsersList200ResponseToJSON(json: any): UsersList200Response { + return UsersList200ResponseToJSONTyped(json, false); +} + +export function UsersList200ResponseToJSONTyped(value?: UsersList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(UserToJSON)), + 'policies': value['policies'] == null ? undefined : ((value['policies'] as Array).map(PolicyToJSON)), + 'pagination': PaginationToJSON(value['pagination']), + }; +} + diff --git a/src/gen/api/outline/models/UsersListRequest.ts b/src/gen/api/outline/models/UsersListRequest.ts new file mode 100644 index 0000000..974d95c --- /dev/null +++ b/src/gen/api/outline/models/UsersListRequest.ts @@ -0,0 +1,151 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UserRole } from './UserRole'; +import { + UserRoleFromJSON, + UserRoleFromJSONTyped, + UserRoleToJSON, + UserRoleToJSONTyped, +} from './UserRole'; + +/** + * + * @export + * @interface UsersListRequest + */ +export interface UsersListRequest { + /** + * + * @type {number} + * @memberof UsersListRequest + */ + offset?: number; + /** + * + * @type {number} + * @memberof UsersListRequest + */ + limit?: number; + /** + * + * @type {string} + * @memberof UsersListRequest + */ + sort?: string; + /** + * + * @type {string} + * @memberof UsersListRequest + */ + direction?: UsersListRequestDirectionEnum; + /** + * + * @type {string} + * @memberof UsersListRequest + */ + query?: string; + /** + * Array of emails + * @type {Array} + * @memberof UsersListRequest + */ + emails?: Array; + /** + * The status to filter by + * @type {string} + * @memberof UsersListRequest + */ + filter?: UsersListRequestFilterEnum; + /** + * + * @type {UserRole} + * @memberof UsersListRequest + */ + role?: UserRole; +} + + +/** + * @export + */ +export const UsersListRequestDirectionEnum = { + Asc: 'ASC', + Desc: 'DESC' +} as const; +export type UsersListRequestDirectionEnum = typeof UsersListRequestDirectionEnum[keyof typeof UsersListRequestDirectionEnum]; + +/** + * @export + */ +export const UsersListRequestFilterEnum = { + All: 'all', + Invited: 'invited', + Active: 'active', + Suspended: 'suspended' +} as const; +export type UsersListRequestFilterEnum = typeof UsersListRequestFilterEnum[keyof typeof UsersListRequestFilterEnum]; + + +/** + * Check if a given object implements the UsersListRequest interface. + */ +export function instanceOfUsersListRequest(value: object): value is UsersListRequest { + return true; +} + +export function UsersListRequestFromJSON(json: any): UsersListRequest { + return UsersListRequestFromJSONTyped(json, false); +} + +export function UsersListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersListRequest { + if (json == null) { + return json; + } + return { + + 'offset': json['offset'] == null ? undefined : json['offset'], + 'limit': json['limit'] == null ? undefined : json['limit'], + 'sort': json['sort'] == null ? undefined : json['sort'], + 'direction': json['direction'] == null ? undefined : json['direction'], + 'query': json['query'] == null ? undefined : json['query'], + 'emails': json['emails'] == null ? undefined : json['emails'], + 'filter': json['filter'] == null ? undefined : json['filter'], + 'role': json['role'] == null ? undefined : UserRoleFromJSON(json['role']), + }; +} + +export function UsersListRequestToJSON(json: any): UsersListRequest { + return UsersListRequestToJSONTyped(json, false); +} + +export function UsersListRequestToJSONTyped(value?: UsersListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'offset': value['offset'], + 'limit': value['limit'], + 'sort': value['sort'], + 'direction': value['direction'], + 'query': value['query'], + 'emails': value['emails'], + 'filter': value['filter'], + 'role': UserRoleToJSON(value['role']), + }; +} + diff --git a/src/gen/api/outline/models/UsersUpdateRequest.ts b/src/gen/api/outline/models/UsersUpdateRequest.ts new file mode 100644 index 0000000..10b1d8f --- /dev/null +++ b/src/gen/api/outline/models/UsersUpdateRequest.ts @@ -0,0 +1,81 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface UsersUpdateRequest + */ +export interface UsersUpdateRequest { + /** + * + * @type {string} + * @memberof UsersUpdateRequest + */ + name?: string; + /** + * + * @type {string} + * @memberof UsersUpdateRequest + */ + language?: string; + /** + * + * @type {string} + * @memberof UsersUpdateRequest + */ + avatarUrl?: string; +} + +/** + * Check if a given object implements the UsersUpdateRequest interface. + */ +export function instanceOfUsersUpdateRequest(value: object): value is UsersUpdateRequest { + return true; +} + +export function UsersUpdateRequestFromJSON(json: any): UsersUpdateRequest { + return UsersUpdateRequestFromJSONTyped(json, false); +} + +export function UsersUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersUpdateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'language': json['language'] == null ? undefined : json['language'], + 'avatarUrl': json['avatarUrl'] == null ? undefined : json['avatarUrl'], + }; +} + +export function UsersUpdateRequestToJSON(json: any): UsersUpdateRequest { + return UsersUpdateRequestToJSONTyped(json, false); +} + +export function UsersUpdateRequestToJSONTyped(value?: UsersUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'language': value['language'], + 'avatarUrl': value['avatarUrl'], + }; +} + diff --git a/src/gen/api/outline/models/UsersUpdateRoleRequest.ts b/src/gen/api/outline/models/UsersUpdateRoleRequest.ts new file mode 100644 index 0000000..69a6d4d --- /dev/null +++ b/src/gen/api/outline/models/UsersUpdateRoleRequest.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { UserRole } from './UserRole'; +import { + UserRoleFromJSON, + UserRoleFromJSONTyped, + UserRoleToJSON, + UserRoleToJSONTyped, +} from './UserRole'; + +/** + * + * @export + * @interface UsersUpdateRoleRequest + */ +export interface UsersUpdateRoleRequest { + /** + * Unique identifier for the user. + * @type {string} + * @memberof UsersUpdateRoleRequest + */ + id: string; + /** + * + * @type {UserRole} + * @memberof UsersUpdateRoleRequest + */ + role: UserRole; +} + + + +/** + * Check if a given object implements the UsersUpdateRoleRequest interface. + */ +export function instanceOfUsersUpdateRoleRequest(value: object): value is UsersUpdateRoleRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('role' in value) || value['role'] === undefined) return false; + return true; +} + +export function UsersUpdateRoleRequestFromJSON(json: any): UsersUpdateRoleRequest { + return UsersUpdateRoleRequestFromJSONTyped(json, false); +} + +export function UsersUpdateRoleRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsersUpdateRoleRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'role': UserRoleFromJSON(json['role']), + }; +} + +export function UsersUpdateRoleRequestToJSON(json: any): UsersUpdateRoleRequest { + return UsersUpdateRoleRequestToJSONTyped(json, false); +} + +export function UsersUpdateRoleRequestToJSONTyped(value?: UsersUpdateRoleRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'role': UserRoleToJSON(value['role']), + }; +} + diff --git a/src/gen/api/outline/models/View.ts b/src/gen/api/outline/models/View.ts new file mode 100644 index 0000000..0f96417 --- /dev/null +++ b/src/gen/api/outline/models/View.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { User } from './User'; +import { + UserFromJSON, + UserFromJSONTyped, + UserToJSON, + UserToJSONTyped, +} from './User'; + +/** + * + * @export + * @interface View + */ +export interface View { + /** + * Unique identifier for the object. + * @type {string} + * @memberof View + */ + readonly id?: string; + /** + * Identifier for the associated document. + * @type {string} + * @memberof View + */ + readonly documentId?: string; + /** + * When the document was first viewed by the user + * @type {Date} + * @memberof View + */ + readonly firstViewedAt?: Date; + /** + * When the document was last viewed by the user + * @type {Date} + * @memberof View + */ + readonly lastViewedAt?: Date; + /** + * The number of times the user has viewed the document. + * @type {number} + * @memberof View + */ + readonly count?: number; + /** + * + * @type {User} + * @memberof View + */ + user?: User; +} + +/** + * Check if a given object implements the View interface. + */ +export function instanceOfView(value: object): value is View { + return true; +} + +export function ViewFromJSON(json: any): View { + return ViewFromJSONTyped(json, false); +} + +export function ViewFromJSONTyped(json: any, ignoreDiscriminator: boolean): View { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'documentId': json['documentId'] == null ? undefined : json['documentId'], + 'firstViewedAt': json['firstViewedAt'] == null ? undefined : (new Date(json['firstViewedAt'])), + 'lastViewedAt': json['lastViewedAt'] == null ? undefined : (new Date(json['lastViewedAt'])), + 'count': json['count'] == null ? undefined : json['count'], + 'user': json['user'] == null ? undefined : UserFromJSON(json['user']), + }; +} + +export function ViewToJSON(json: any): View { + return ViewToJSONTyped(json, false); +} + +export function ViewToJSONTyped(value?: Omit | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'user': UserToJSON(value['user']), + }; +} + diff --git a/src/gen/api/outline/models/ViewsCreate200Response.ts b/src/gen/api/outline/models/ViewsCreate200Response.ts new file mode 100644 index 0000000..105d35b --- /dev/null +++ b/src/gen/api/outline/models/ViewsCreate200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { View } from './View'; +import { + ViewFromJSON, + ViewFromJSONTyped, + ViewToJSON, + ViewToJSONTyped, +} from './View'; + +/** + * + * @export + * @interface ViewsCreate200Response + */ +export interface ViewsCreate200Response { + /** + * + * @type {View} + * @memberof ViewsCreate200Response + */ + data?: View; +} + +/** + * Check if a given object implements the ViewsCreate200Response interface. + */ +export function instanceOfViewsCreate200Response(value: object): value is ViewsCreate200Response { + return true; +} + +export function ViewsCreate200ResponseFromJSON(json: any): ViewsCreate200Response { + return ViewsCreate200ResponseFromJSONTyped(json, false); +} + +export function ViewsCreate200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ViewsCreate200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ViewFromJSON(json['data']), + }; +} + +export function ViewsCreate200ResponseToJSON(json: any): ViewsCreate200Response { + return ViewsCreate200ResponseToJSONTyped(json, false); +} + +export function ViewsCreate200ResponseToJSONTyped(value?: ViewsCreate200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': ViewToJSON(value['data']), + }; +} + diff --git a/src/gen/api/outline/models/ViewsList200Response.ts b/src/gen/api/outline/models/ViewsList200Response.ts new file mode 100644 index 0000000..531c8bb --- /dev/null +++ b/src/gen/api/outline/models/ViewsList200Response.ts @@ -0,0 +1,73 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +import type { View } from './View'; +import { + ViewFromJSON, + ViewFromJSONTyped, + ViewToJSON, + ViewToJSONTyped, +} from './View'; + +/** + * + * @export + * @interface ViewsList200Response + */ +export interface ViewsList200Response { + /** + * + * @type {Array} + * @memberof ViewsList200Response + */ + data?: Array; +} + +/** + * Check if a given object implements the ViewsList200Response interface. + */ +export function instanceOfViewsList200Response(value: object): value is ViewsList200Response { + return true; +} + +export function ViewsList200ResponseFromJSON(json: any): ViewsList200Response { + return ViewsList200ResponseFromJSONTyped(json, false); +} + +export function ViewsList200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ViewsList200Response { + if (json == null) { + return json; + } + return { + + 'data': json['data'] == null ? undefined : ((json['data'] as Array).map(ViewFromJSON)), + }; +} + +export function ViewsList200ResponseToJSON(json: any): ViewsList200Response { + return ViewsList200ResponseToJSONTyped(json, false); +} + +export function ViewsList200ResponseToJSONTyped(value?: ViewsList200Response | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'data': value['data'] == null ? undefined : ((value['data'] as Array).map(ViewToJSON)), + }; +} + diff --git a/src/gen/api/outline/models/ViewsListRequest.ts b/src/gen/api/outline/models/ViewsListRequest.ts new file mode 100644 index 0000000..a7f7cde --- /dev/null +++ b/src/gen/api/outline/models/ViewsListRequest.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../runtime'; +/** + * + * @export + * @interface ViewsListRequest + */ +export interface ViewsListRequest { + /** + * The document ID to retrieve views for + * @type {string} + * @memberof ViewsListRequest + */ + documentId: string; +} + +/** + * Check if a given object implements the ViewsListRequest interface. + */ +export function instanceOfViewsListRequest(value: object): value is ViewsListRequest { + if (!('documentId' in value) || value['documentId'] === undefined) return false; + return true; +} + +export function ViewsListRequestFromJSON(json: any): ViewsListRequest { + return ViewsListRequestFromJSONTyped(json, false); +} + +export function ViewsListRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): ViewsListRequest { + if (json == null) { + return json; + } + return { + + 'documentId': json['documentId'], + }; +} + +export function ViewsListRequestToJSON(json: any): ViewsListRequest { + return ViewsListRequestToJSONTyped(json, false); +} + +export function ViewsListRequestToJSONTyped(value?: ViewsListRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'documentId': value['documentId'], + }; +} + diff --git a/src/gen/api/outline/models/index.ts b/src/gen/api/outline/models/index.ts new file mode 100644 index 0000000..36029d6 --- /dev/null +++ b/src/gen/api/outline/models/index.ts @@ -0,0 +1,154 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Ability'; +export * from './Attachment'; +export * from './AttachmentsCreate200Response'; +export * from './AttachmentsCreate200ResponseData'; +export * from './AttachmentsCreateRequest'; +export * from './AttachmentsDelete200Response'; +export * from './AttachmentsRedirectRequest'; +export * from './Auth'; +export * from './AuthConfig200Response'; +export * from './AuthConfig200ResponseData'; +export * from './AuthConfig200ResponseDataServicesInner'; +export * from './AuthInfo200Response'; +export * from './Collection'; +export * from './CollectionGroupMembership'; +export * from './CollectionSort'; +export * from './CollectionStatus'; +export * from './CollectionsAddGroup200Response'; +export * from './CollectionsAddGroup200ResponseData'; +export * from './CollectionsAddGroupRequest'; +export * from './CollectionsAddUser200Response'; +export * from './CollectionsAddUser200ResponseData'; +export * from './CollectionsAddUserRequest'; +export * from './CollectionsCreateRequest'; +export * from './CollectionsDeleteRequest'; +export * from './CollectionsDocuments200Response'; +export * from './CollectionsExport200Response'; +export * from './CollectionsExport200ResponseData'; +export * from './CollectionsExportAllRequest'; +export * from './CollectionsExportRequest'; +export * from './CollectionsGroupMemberships200Response'; +export * from './CollectionsGroupMemberships200ResponseData'; +export * from './CollectionsGroupMembershipsRequest'; +export * from './CollectionsInfo200Response'; +export * from './CollectionsInfoRequest'; +export * from './CollectionsList200Response'; +export * from './CollectionsListRequest'; +export * from './CollectionsMemberships200Response'; +export * from './CollectionsMembershipsRequest'; +export * from './CollectionsRemoveGroupRequest'; +export * from './CollectionsRemoveUserRequest'; +export * from './CollectionsUpdateRequest'; +export * from './Comment'; +export * from './CommentsCreate200Response'; +export * from './CommentsCreateRequest'; +export * from './CommentsInfo200Response'; +export * from './CommentsInfoRequest'; +export * from './CommentsList200Response'; +export * from './CommentsListRequest'; +export * from './CommentsUpdateRequest'; +export * from './Document'; +export * from './DocumentsAddUserRequest'; +export * from './DocumentsAnswerquestion200Response'; +export * from './DocumentsAnswerquestionRequest'; +export * from './DocumentsCreateRequest'; +export * from './DocumentsDeleteRequest'; +export * from './DocumentsDraftsRequest'; +export * from './DocumentsExport200Response'; +export * from './DocumentsExportRequest'; +export * from './DocumentsInfo200Response'; +export * from './DocumentsInfoRequest'; +export * from './DocumentsList200Response'; +export * from './DocumentsListRequest'; +export * from './DocumentsMembershipsRequest'; +export * from './DocumentsMove200Response'; +export * from './DocumentsMove200ResponseData'; +export * from './DocumentsMoveRequest'; +export * from './DocumentsRemoveUserRequest'; +export * from './DocumentsRestoreRequest'; +export * from './DocumentsSearch200Response'; +export * from './DocumentsSearch200ResponseDataInner'; +export * from './DocumentsSearchRequest'; +export * from './DocumentsUnpublishRequest'; +export * from './DocumentsUpdateRequest'; +export * from './DocumentsUsers200Response'; +export * from './DocumentsUsersRequest'; +export * from './DocumentsViewedRequest'; +export * from './Event'; +export * from './EventsList200Response'; +export * from './EventsListRequest'; +export * from './FileOperation'; +export * from './FileoperationsInfo200Response'; +export * from './FileoperationsInfoRequest'; +export * from './FileoperationsList200Response'; +export * from './FileoperationsListRequest'; +export * from './Group'; +export * from './GroupMembership'; +export * from './GroupsAddUser200Response'; +export * from './GroupsAddUser200ResponseData'; +export * from './GroupsAddUserRequest'; +export * from './GroupsCreateRequest'; +export * from './GroupsInfo200Response'; +export * from './GroupsInfoRequest'; +export * from './GroupsList200Response'; +export * from './GroupsList200ResponseData'; +export * from './GroupsListRequest'; +export * from './GroupsMemberships200Response'; +export * from './GroupsMemberships200ResponseData'; +export * from './GroupsMembershipsRequest'; +export * from './GroupsRemoveUser200Response'; +export * from './GroupsRemoveUser200ResponseData'; +export * from './GroupsUpdateRequest'; +export * from './InlineObject'; +export * from './Invite'; +export * from './Membership'; +export * from './ModelError'; +export * from './NavigationNode'; +export * from './OAuthClient'; +export * from './OauthClientsCreateRequest'; +export * from './OauthClientsInfo200Response'; +export * from './OauthClientsInfoRequest'; +export * from './OauthClientsList200Response'; +export * from './OauthClientsRotateSecretRequest'; +export * from './OauthClientsUpdateRequest'; +export * from './Pagination'; +export * from './Permission'; +export * from './Policy'; +export * from './Revision'; +export * from './RevisionsInfo200Response'; +export * from './RevisionsInfoRequest'; +export * from './RevisionsList200Response'; +export * from './RevisionsListRequest'; +export * from './SearchResult'; +export * from './Share'; +export * from './SharesCreateRequest'; +export * from './SharesInfo200Response'; +export * from './SharesInfoRequest'; +export * from './SharesList200Response'; +export * from './SharesListRequest'; +export * from './SharesUpdateRequest'; +export * from './Sorting'; +export * from './Star'; +export * from './StarsCreate200Response'; +export * from './StarsCreateRequest'; +export * from './StarsList200Response'; +export * from './StarsList200ResponseData'; +export * from './StarsUpdateRequest'; +export * from './Team'; +export * from './User'; +export * from './UserRole'; +export * from './UsersInfo200Response'; +export * from './UsersInfoRequest'; +export * from './UsersInvite200Response'; +export * from './UsersInvite200ResponseData'; +export * from './UsersInviteRequest'; +export * from './UsersList200Response'; +export * from './UsersListRequest'; +export * from './UsersUpdateRequest'; +export * from './UsersUpdateRoleRequest'; +export * from './View'; +export * from './ViewsCreate200Response'; +export * from './ViewsList200Response'; +export * from './ViewsListRequest'; diff --git a/src/gen/api/outline/runtime.ts b/src/gen/api/outline/runtime.ts new file mode 100644 index 0000000..7a5f132 --- /dev/null +++ b/src/gen/api/outline/runtime.ts @@ -0,0 +1,535 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Outline API + * # Introduction The Outline API is structured in an RPC style. It enables you to programatically interact with all aspects of Outline’s data – in fact, the main application is built on exactly the same API. The API structure is available as an [openapi specification](https://github.com/outline/openapi) if that’s your jam – it can be used to generate clients for most programming languages. # Making requests Outline’s API follows simple RPC style conventions where each API endpoint is a `POST` method on `https://app.getoutline.com/api/:method`. Only HTTPS is supported and all response payloads are JSON. When making `POST` requests, request parameters are parsed depending on Content-Type header. To make a call using JSON payload, you must pass Content-Type: application/json header, here’s an example using CURL: ``` curl https://app.getoutline.com/api/documents.info \\ -X \'POST\' \\ -H \'authorization: Bearer MY_API_KEY\' \\ -H \'content-type: application/json\' \\ -H \'accept: application/json\' \\ -d \'{\"id\": \"outline-api-NTpezNwhUP\"}\' ``` Or, with JavaScript: ```javascript const response = await fetch(\"https://app.getoutline.com/api/documents.info\", { method: \"POST\", headers: { Accept: \"application/json\", \"Content-Type\": \"application/json\", Authorization: \"Bearer MY_API_KEY\" } }) const body = await response.json(); const document = body.data; ``` # Authentication ## API key You can create new API keys under **Settings => API & Apps**. Be careful when handling your keys as they give access to all of your documents, you should treat them like passwords and they should never be committed to source control. To authenticate with API, you should supply the API key as the `Authorization` header (`Authorization: Bearer YOUR_API_KEY`). ## OAuth 2.0 OAuth 2.0 is a widely used protocol for authorization and authentication. It allows users to grant third-party _or_ internal applications access to their resources without sharing their credentials. To use OAuth 2.0 you need to follow these steps: 1. Register your application under **Settings => Applications** 2. Obtain an access token by exchanging the client credentials for an access token 3. Use the access token to authenticate requests to the API Some API endpoints allow unauthenticated requests for public resources and they can be called without authentication # Scopes Scopes are used to limit the access of an API key or application to specific resources. For example, an application may only need access to read documents, but not write them. Scopes can be global in the case of `read` and `write` scopes, specific to an API endpoint like `documents.read` and `documents.create`, or use wildcard scopes like `documents.*`. Some examples of scopes that can be used are: - `documents.read`: Allows reading documents - `documents.write`: Allows writing documents - `documents.*`: Allows all document-related actions - `users.*`: Allows all user-related actions - `read`: Allows all read actions - `write`: Allows all write actions # Errors All successful API requests will be returned with a 200 or 201 status code and `ok: true` in the response payload. If there’s an error while making the request, the appropriate status code is returned with the error message: ``` { \"ok\": false, \"error\": \"Not Found\" } ``` # Pagination Most top-level API resources have support for \"list\" API methods. For instance, you can list users, documents, and collections. These list methods share common parameters, taking both `limit` and `offset`. Responses will echo these parameters in the root `pagination` key, and also include a `nextPath` key which can be used as a handy shortcut to fetch the next page of results. For example: ``` { ok: true, status: 200, data: […], pagination: { limit: 25, offset: 0, nextPath: \"/api/documents.list?limit=25&offset=25\" } } ``` # Rate limits Like most APIs, Outline has rate limits in place to prevent abuse. Endpoints that mutate data are more restrictive than read-only endpoints. If you exceed the rate limit for a given endpoint, you will receive a `429 Too Many Requests` status code. The response will include a `Retry-After` header that indicates how many seconds you should wait before making another request. # Policies Most API resources have associated \"policies\", these objects describe the current authentications authorized actions related to an individual resource. It should be noted that the policy \"id\" is identical to the resource it is related to, policies themselves do not have unique identifiers. For most usecases of the API, policies can be safely ignored. Calling unauthorized methods will result in the appropriate response code – these can be used in an interface to adjust which elements are visible. + * + * The version of the OpenAPI document: 0.1.0 + * Contact: hello@getoutline.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +export const BASE_PATH = "https://app.getoutline.com/api".replace(/\/+$/, ""); + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: + | string + | Promise + | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: + | string + | Promise + | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null + ? this.configuration.basePath + : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === "function" ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): + | ((name?: string, scopes?: string[]) => string | Promise) + | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === "function" + ? accessToken + : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + private static readonly jsonRegex = new RegExp( + "^(:?application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$", + "i" + ); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware( + this: T, + ...preMiddlewares: Array + ) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware( + this: T, + ...postMiddlewares: Array + ) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request( + context: RequestOpts, + initOverrides?: RequestInit | InitOverrideFunction + ): Promise { + const { url, init } = await this.createFetchParams(context, initOverrides); + const response = await this.fetchApi(url, init); + if (response && response.status >= 200 && response.status < 300) { + return response; + } + throw new ResponseError( + response as Response, + "Response returned an error code " + response?.status + ); + } + + private async createFetchParams( + context: RequestOpts, + initOverrides?: RequestInit | InitOverrideFunction + ) { + let url = this.configuration.basePath + context.path; + if ( + context.query !== undefined && + Object.keys(context.query).length !== 0 + ) { + // only add the querystring to the URL if there are query parameters. + // this is done to avoid urls ending with a "?" character which buggy webservers + // do not handle correctly sometimes. + url += "?" + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers + ); + Object.keys(headers).forEach((key) => + headers[key] === undefined ? delete headers[key] : {} + ); + + const initOverrideFn = + typeof initOverrides === "function" + ? initOverrides + : async () => initOverrides; + + const initParams = { + method: context.method, + headers, + body: context.body, + credentials: this.configuration.credentials, + }; + + const overriddenInit: RequestInit = { + ...initParams, + ...(await initOverrideFn({ + init: initParams, + context, + })), + }; + + let body: any; + if ( + isFormData(overriddenInit.body) || + overriddenInit.body instanceof URLSearchParams || + isBlob(overriddenInit.body) + ) { + body = overriddenInit.body; + } else if (this.isJsonMime(headers["Content-Type"])) { + body = JSON.stringify(overriddenInit.body); + } else { + body = overriddenInit.body; + } + + const init: RequestInit = { + ...overriddenInit, + body, + }; + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = + (await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + })) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)( + fetchParams.url, + fetchParams.init + ); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = + (await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + })) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError( + e, + "The request failed and the interceptors did not return an alternative response" + ); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = + (await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + })) || response; + } + } + return response; + }; + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +} + +function isBlob(value: any): value is Blob { + return typeof Blob !== "undefined" && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor( + public response: Response, + msg?: string + ) { + super(msg); + } +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor( + public cause: Error, + msg?: string + ) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor( + public field: string, + msg?: string + ) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope["fetch"]; + +export type Json = any; +export type HTTPMethod = + | "GET" + | "POST" + | "PUT" + | "PATCH" + | "DELETE" + | "OPTIONS" + | "HEAD"; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { + [key: string]: + | string + | number + | null + | boolean + | Array + | Set + | HTTPQuery; +}; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { + headers?: HTTPHeaders; + method: HTTPMethod; + credentials?: RequestCredentials; + body?: HTTPBody; +}; +export type ModelPropertyNaming = + | "camelCase" + | "snake_case" + | "PascalCase" + | "original"; + +export type InitOverrideFunction = (requestContext: { + init: HTTPRequestInit; + context: RequestOpts; +}) => Promise; + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ""): string { + return Object.keys(params) + .map((key) => querystringSingleKey(key, params[key], prefix)) + .filter((part) => part.length > 0) + .join("&"); +} + +function querystringSingleKey( + key: string, + value: + | string + | number + | null + | undefined + | boolean + | Array + | Set + | HTTPQuery, + keyPrefix: string = "" +): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value + .map((singleValue) => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent( + value.toISOString() + )}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + const result: { [key: string]: any } = {}; + for (const key of Object.keys(data)) { + result[key] = fn(data[key]); + } + return result; +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ("multipart/form-data" === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor( + public raw: Response, + private transformer: ResponseTransformer = (jsonValue: any) => jsonValue + ) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + } +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + } +} diff --git a/src/main.ts b/src/main.ts new file mode 100644 index 0000000..7620735 --- /dev/null +++ b/src/main.ts @@ -0,0 +1,98 @@ +import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js"; +import { isInitializeRequest } from "@modelcontextprotocol/sdk/types.js"; +import express from "express"; +import pino from "pino"; +import { z } from "zod"; + +import { outlineMcpFactory } from "./outline"; + +const sessionIdSchema = z.string().uuid(); + +async function main() { + const logger = pino({ + level: "debug", + }); + + const transports: Record = {}; + + const app = express(); + app.use(express.json()); + + app.post("/mcp", async (req, res) => { + logger.debug( + { + body: JSON.stringify(req.body), + }, + "Received MCP request" + ); + const sessionIdHeader = req.headers["mcp-session-id"] as string | undefined; + let transport: StreamableHTTPServerTransport; + + if (sessionIdHeader) { + const safeSessionId = sessionIdSchema.safeParse(sessionIdHeader); + if (!safeSessionId.success) { + logger.error("Invalid session ID format"); + res.status(400).json({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Invalid session ID format", + }, + id: null, + }); + return; + } + + const sessionId = safeSessionId.data; + if (transports[sessionId]) { + transport = transports[sessionId]; + } else { + logger.error("Session not found"); + res.status(400).json({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Session not found", + }, + id: null, + }); + return; + } + } else if (isInitializeRequest(req.body)) { + transport = new StreamableHTTPServerTransport({ + sessionIdGenerator: () => crypto.randomUUID(), + onsessioninitialized: (sessionId) => { + transports[sessionId] = transport; + }, + }); + + transport.onclose = () => { + if (transport.sessionId) { + delete transports[transport.sessionId]; + } + }; + const outlineMcpServer = outlineMcpFactory(logger.child({ sessionId: transport.sessionId })); + + await outlineMcpServer.connect(transport); + } else { + logger.error("Bad Request: No valid session ID provided"); + res.status(400).json({ + jsonrpc: "2.0", + error: { + code: -32000, + message: "Bad Request: No valid session ID provided", + }, + id: null, + }); + return; + } + + await transport.handleRequest(req, res, req.body); + }); + + app.listen(3000, () => { + logger.info("Server is running on port 3000"); + }); +} + +main(); diff --git a/src/outline.ts b/src/outline.ts new file mode 100644 index 0000000..a14ef89 --- /dev/null +++ b/src/outline.ts @@ -0,0 +1,44 @@ +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; + +import config from "./config"; +import { CollectionsApi, Configuration, DocumentsApi } from "./gen/api/outline"; +import { registerCollectionTools } from "./tools/collection"; +import { registerDocumentTools } from "./tools/document"; + +import type { Logger } from "pino"; + +const createOutlineClient = (baseUrl: string, apiKey: string, logger: Logger) => { + const config = new Configuration({ + basePath: baseUrl, + accessToken: () => Promise.resolve(apiKey), + middleware: [ + { + pre: async (request) => { + logger.debug({ request }, "Request"); + return request; + }, + post: async (context) => { + logger.debug({ context }, "Response"); + }, + }, + ], + }); + + return { + documents: new DocumentsApi(config), + collections: new CollectionsApi(config), + }; +}; + +export const outlineMcpFactory = (logger: Logger) => { + const server = new McpServer({ + name: "outline-mcp", + version: "1.0.0", + }); + + const client = createOutlineClient(config.baseUrl, config.apiKey, logger); + registerDocumentTools(server, client.documents, logger); + registerCollectionTools(server, client.collections, logger); + + return server; +}; diff --git a/src/tools/collection.ts b/src/tools/collection.ts new file mode 100644 index 0000000..27e8f59 --- /dev/null +++ b/src/tools/collection.ts @@ -0,0 +1,28 @@ +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; + +import { handleSuccess, handleError } from "./utils"; + +import type { ToolsFactory } from "./toolsFactory"; +import type { CollectionsApi } from "../gen/api/outline"; +import type { Logger } from "pino"; + +export const registerCollectionTools: ToolsFactory = (server: McpServer, client: CollectionsApi, logger: Logger) => { + server.registerTool( + "collections_list", + { + title: "List Collections", + description: "List all collections in the Outline workspace", + inputSchema: {}, + }, + async () => { + try { + const response = await client.collectionsList(); + return handleSuccess(response, logger.child({ tool: "collections_list" })); + } catch (err) { + const error = handleError(err, logger.child({ tool: "collections_list" })); + logger.error(error); + return error; + } + } + ); +}; diff --git a/src/tools/common.ts b/src/tools/common.ts new file mode 100644 index 0000000..449a897 --- /dev/null +++ b/src/tools/common.ts @@ -0,0 +1,19 @@ +import { z } from "zod"; + +const positiveInteger = z.number().int().positive(); +const uuid = z.string().uuid(); +const optionalUuid = uuid.optional(); + +// Pagination +export const offset = positiveInteger.optional(); +export const limit = positiveInteger.optional().default(10); +export const sort = z.enum(["createdAt", "updatedAt", "title"]).optional(); +export const direction = z + .enum(["asc", "desc"]) + .optional() + .transform((val) => val?.toUpperCase() as "ASC" | "DESC" | undefined); + +export const collectionId = optionalUuid; +export const userId = optionalUuid; +export const backlinkDocumentId = optionalUuid; +export const parentDocumentId = optionalUuid; diff --git a/src/tools/document.ts b/src/tools/document.ts new file mode 100644 index 0000000..8c1e04c --- /dev/null +++ b/src/tools/document.ts @@ -0,0 +1,68 @@ +import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import { z } from "zod"; + +import { backlinkDocumentId, collectionId, direction, limit, offset, parentDocumentId, sort, userId } from "./common"; +import { handleSuccess, handleError } from "./utils"; + +import type { ToolsFactory } from "./toolsFactory"; +import type { DocumentsApi } from "../gen/api/outline"; +import type { Logger } from "pino"; + +export const registerDocumentTools: ToolsFactory = (server: McpServer, client: DocumentsApi, logger: Logger): void => { + server.registerTool( + "documents_info", + { + title: "Get Document Info", + description: "Retrieve a document by its UUID, urlId, or shareId. At least one of these parameters must be provided.", + inputSchema: { + id: z.string().optional().describe("Unique identifier for the document. Either the UUID or the urlId is acceptable."), + shareId: z.string().optional().describe("Unique identifier for a document share, a shareId may be used in place of a document UUID"), + }, + }, + async (args) => { + try { + const response = await client.documentsInfo({ + documentsInfoRequest: { + id: args?.id, + shareId: args?.shareId, + }, + }); + return handleSuccess(response, logger.child({ tool: "documents_info" })); + } catch (error) { + return handleError(error, logger.child({ tool: "documents_info" })); + } + } + ); + + const documentsListSchema = z.object({ + offset, + limit, + sort, + direction, + collectionId, + userId, + backlinkDocumentId, + parentDocumentId, + template: z.boolean().optional(), + }); + + server.registerTool( + "documents_list", + { + title: "List Documents", + description: "This method will list all published documents and draft documents belonging to the current user.", + inputSchema: documentsListSchema.shape, + }, + async (args) => { + try { + const validatedArgs = documentsListSchema.parse(args); + const response = await client.documentsList({ + documentsListRequest: validatedArgs, + }); + return handleSuccess(response, logger.child({ tool: "documents_list" })); + } catch (error) { + return handleError(error, logger.child({ tool: "documents_list" })); + } + } + ); +}; diff --git a/src/tools/toolsFactory.ts b/src/tools/toolsFactory.ts new file mode 100644 index 0000000..a6ba500 --- /dev/null +++ b/src/tools/toolsFactory.ts @@ -0,0 +1,5 @@ +import type { BaseAPI } from "../gen/api/outline"; +import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; +import type { Logger } from "pino"; + +export type ToolsFactory = (server: McpServer, client: T, logger: Logger) => void; diff --git a/src/tools/utils.ts b/src/tools/utils.ts new file mode 100644 index 0000000..a7e0012 --- /dev/null +++ b/src/tools/utils.ts @@ -0,0 +1,28 @@ +import type { Logger } from "pino"; + +export const handleError = (error: unknown, logger: Logger) => { + const message = `Error: ${error instanceof Error ? error.message : "Unknown error"}`; + + logger.error(message); + return { + content: [ + { + type: "text" as const, + text: message, + }, + ], + }; +}; + +const handleApiResponse = (response: unknown) => { + return JSON.stringify(response, null, 2); +}; + +export const handleSuccess = (data: unknown, logger: Logger) => { + const message = handleApiResponse(data); + logger.debug(message); + + return { + content: [{ type: "text" as const, text: message }], + }; +}; diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..54b8683 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,34 @@ +{ + "compilerOptions": { + // Environment setup & latest features + "lib": ["ESNext", "DOM"], + "target": "ESNext", + "module": "ESNext", + "moduleDetection": "force", + "jsx": "react-jsx", + "allowJs": true, + + // Bundler mode + "moduleResolution": "bundler", + "verbatimModuleSyntax": true, + "noEmit": false, + + // Best practices + "strict": true, + "skipLibCheck": true, + "noFallthroughCasesInSwitch": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": false, + + // Some stricter flags (disabled by default) + "noUnusedLocals": false, + "noUnusedParameters": false, + "noPropertyAccessFromIndexSignature": false, + + "outDir": "./dist", + "rootDir": "./src", + "removeComments": true + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] +}