Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADD Doc API keys endpoints to documentation #383

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Repository for Grist documentation and tutorials.

The public site is at <https://support.getgrist.com/>, served using GitHub Pages.

The content is hosted at <https://github.com/dsagal/grist-help/>. On changes to master (such as
The content is hosted at <https://github.com/gristlabs/grist-help/>. On changes to master (such as
when a pull request is merged), the public site gets automatically republished.

Previews of pull requests are automatically built by Netlify, and made available at URLs such as
Expand All @@ -15,6 +15,8 @@ Conversation tab.

## Setting up local environment

N.B.: Python 3.12 isn't supported yet. Please, use Python 3.10 or 3.11 instead.

``` sh
# initiate a python virtual environment
python3 -m venv env
Expand Down Expand Up @@ -92,7 +94,7 @@ Once you're done, add the results to the main documentation with:
To update `help/en/docs/functions.md` from the documentation comments in Grist, run:

```
./build-functions.sh <path-to-grist-checkout>
./build-functions.sh <path-to-grist-core-checkout>
```

It replaces content between `BEGIN mkpydocs`/`END mkpydocs` markers in `help/en/docs/functions.md`. You
Expand All @@ -103,7 +105,7 @@ can edit text outside of those markers directly.
To update `help/en/docs/code` from the documentation comments in Grist, run:

```
./build-plugin-api.sh <path-to-grist-checkout>
./build-plugin-api.sh <path-to-grist-core-checkout>
```

You need to first run `yarn install` in your Grist checkout directory.
Expand Down
147 changes: 144 additions & 3 deletions api/grist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,95 @@ paths:
responses:
200:
description: Success

/docs/{docId}/apikey:
post:
operationId: "createDocApiKey"
tags:
- document API key
summary: "Create a document API key"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
requestBody:
description: >
A Share object.
The linkId must be unique for the document.
In options the apiKey flag set to true is mandatory.
In options access can be set to editors or viewers.
content:
application/json:
schema:
$ref: "#/components/schemas/CreateDocApiKey"
required: true
responses:
200:
description: Success
content:
/docs/{docId}/apikey/{linkId}:
get:
operationId: "readDocApiKey"
tags:
- document API key
summary: "Read a document API key"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
- $ref: '#/components/parameters/linkIdPathParam'
responses:
200:
description: Success
patch:
operationId: "updateDocApiKey"
tags:
- document API key
summary: "Update a document API key"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
- $ref: '#/components/parameters/linkIdPathParam'
requestBody:
description: >
A Share object.
The linkId must be unique for the document.
In options the apiKey flag set to true is mandatory.
In options access can be set to editors or viewers.
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateDocApiKey"
required: true
responses:
200:
description: Success
delete:
operationId: "deleteDocApiKey"
tags:
- document API key
summary: "Delete a document API key"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
- $ref: '#/components/parameters/linkIdPathParam'
responses:
200:
description: Success
/docs/{docId}/apikeys:
get:
operationId: "readDocApiKeys"
tags:
- document API key
summary: "Read all API keys of a document"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
responses:
200:
description: Success
delete:
operationId: "deleteDocApiKeys"
tags:
- document API key
summary: "Delete all API keys of a document"
parameters:
- $ref: '#/components/parameters/docIdPathParam'
responses:
200:
description: Success
/docs/{docId}/webhooks:
get:
tags:
Expand Down Expand Up @@ -1696,7 +1784,41 @@ components:
- id: popularity
fields:
label: "Popularity ❤"

DocApiKeyOptions:
type: object
properties:
apikey:
type: boolean
enum: true
example: true
access:
type: string
enum:
-editors
-viewers
example: editors
CreateDocApiKey:
type: object
properties:
docId:
type: string
example: XXXXXXXXXXX
linkId:
type: string
example: YYYYYYYYYYY
options:
$ref: "#/components/schemas/DocApiKeyOptions"
UpdateDocApiKey:
type: object
properties:
docId:
type: string
example: XXXXXXXXXXX
linkId:
type: string
example: YYYYYYYYYYY
options:
$ref: "#/components/schemas/DocApiKeyOptions"
ColumnsList:
type: object
properties:
Expand Down Expand Up @@ -1814,7 +1936,19 @@ components:
type:
type: string
description: "Column type, by default Any. Ref, RefList and DateTime types requires a postfix, e.g. <code>DateTime:America/New_York</code>, <code>Ref:Users</code>"
enum: [Any, Text, Numeric, Int, Bool, Date, DateTime:<timezone>, Choice, ChoiceList, Ref:<tableId>, RefList:<tableId>, Attachments]
enum:
- Any
- Text
- Numeric
- Int
- Bool
- Date
- DateTime:<timezone>
- Choice
- ChoiceList
- Ref:<tableId>
- RefList:<tableId>
- Attachments
label:
type: string
description: Column label.
Expand Down Expand Up @@ -2163,6 +2297,13 @@ components:
type: integer
description: A user id
required: true
linkIdPathParam:
in: path
name: linkId
schema:
type: string
description: A string id (UUID)
required: true
noparseQueryParam:
in: query
name: noparse
Expand Down
Loading