Skip to content

Commit

Permalink
docs: fix key in referenceData
Browse files Browse the repository at this point in the history
  • Loading branch information
LinneyS committed Dec 13, 2024
1 parent c111072 commit d11143a
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 53 deletions.
11 changes: 5 additions & 6 deletions packages/document-server-types/lib/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,11 @@ export interface DocEditorMailMergeRecipient {
export interface DocEditorReferenceData {
error?: string
fileType?: string
key: string
path: string
referenceData?: {
fileKey: string
instanceId: string
key: string
}
token?: string
url: string
Expand All @@ -289,11 +289,11 @@ export interface DocEditorReferenceData {
export interface DocEditorReferenceSource {
error?: string
fileType?: string
key: string
path: string
referenceData?: {
fileKey: string
instanceId: string
key: string
}
token?: string
url: string
Expand Down Expand Up @@ -430,7 +430,6 @@ export interface DocEditorConfigDocument {
export interface DocEditorConfigDocumentReferenceData {
fileKey: string
instanceId: string
key: string
}

/**
Expand Down Expand Up @@ -1245,35 +1244,35 @@ export interface DocEditorRequestInsertImageEvent {

export interface DocEditorRequestOpenEvent {
data: {
key: string
path: string
referenceData: {
fileKey: string
instanceId: string
key: string
}
windowName: string
}
}

export interface DocEditorRequestReferenceDataEvent {
data: {
key: string
link: string
path: string
referenceData: {
fileKey: string
instanceId: string
key: string
}
}
}

export interface DocEditorRequestReferenceSourceEvent {
data: {
key: string
path: string
referenceData: {
fileKey: string
instanceId: string
key: string
}
}
}
Expand Down
4 changes: 0 additions & 4 deletions site/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ playground:
href: docs/docs-api/usage-api/config/document/referenceData/#instanceId
type: string

- path: document.referenceData.key
href: docs/docs-api/usage-api/config/document/referenceData/#key
type: string

- path: document.title
href: docs/docs-api/usage-api/config/document/#title
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ The `payload` for the JWT token in the JSON format must have the same structure
``` json
{
"fileType": "xlsx",
"key": "Khirz6zTPdfd7",
"path": "sample.xlsx",
"referenceData": {
"fileKey": "BCFA2CED",
"instanceId": "https://example.com",
"key": "Khirz6zTPdfd7"
"instanceId": "https://example.com"
},
"url": "https://example.com/url-to-example-document.xlsx"
}
Expand All @@ -162,7 +162,7 @@ Sample token:

``` json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w"
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJrZXkiOiJLaGlyejZ6VFBkZmQ3IiwicGF0aCI6InNhbXBsZS54bHN4IiwicmVmZXJlbmNlRGF0YSI6eyJmaWxlS2V5IjoiQkNGQTJDRUQiLCJpbnN0YW5jZUlkIjoiaHR0cHM6Ly9leGFtcGxlLmNvbSJ9LCJ1cmwiOiJodHRwczovL2V4YW1wbGUuY29tL3VybC10by1leGFtcGxlLWRvY3VtZW50Lnhsc3gifQ.US2wsI__77B0ApzMOIUGIU49cUAORvdzGZ4V49BO4Dc"
}
```

Expand All @@ -175,11 +175,11 @@ The `payload` for the JWT token in the JSON format must have the same structure
``` json
{
"fileType": "xlsx",
"key": "Khirz6zTPdfd7",
"path": "sample.xlsx",
"referenceData": {
"fileKey": "BCFA2CED",
"instanceId": "https://example.com",
"key": "Khirz6zTPdfd7"
"instanceId": "https://example.com"
},
"url": "https://example.com/url-to-example-document.xlsx"
}
Expand All @@ -191,7 +191,7 @@ Sample token:

``` json
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w"
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJrZXkiOiJLaGlyejZ6VFBkZmQ3IiwicGF0aCI6InNhbXBsZS54bHN4IiwicmVmZXJlbmNlRGF0YSI6eyJmaWxlS2V5IjoiQkNGQTJDRUQiLCJpbnN0YW5jZUlkIjoiaHR0cHM6Ly9leGFtcGxlLmNvbSJ9LCJ1cmwiOiJodHRwczovL2V4YW1wbGUuY29tL3VybC10by1leGFtcGxlLWRvY3VtZW50Lnhsc3gifQ.US2wsI__77B0ApzMOIUGIU49cUAORvdzGZ4V49BO4Dc"
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ The steps below explain the process of inserting data into the spreadsheet by an
document: {
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
instanceId: "https://example.com"
},
},
})
Expand Down Expand Up @@ -91,11 +90,11 @@ The steps below explain the process of inserting data into the spreadsheet by an
``` ts
docEditor.setReferenceData({
fileType: "xlsx",
key: "Khirz6zTPdfd7",
path: "sample.xlsx",
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w",
url: "https://example.com/url-to-example-document.xlsx",
Expand Down Expand Up @@ -155,11 +154,11 @@ The steps below explain the process of inserting data into the spreadsheet by an

docEditor.setReferenceSource({
fileType: "xlsx",
key: "Khirz6zTPdfd7",
path: "sample.xlsx",
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w",
url: "https://example.com/url-to-example-document.xlsx",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ The list of changes of ONLYOFFICE Docs API.
- Added the [setReferenceSource](../../Usage%20API/Methods/index.md#setreferencesource) method.
- Added the [events.onRequestReferenceSource](../../Usage%20API/Config/Events/index.md#onrequestreferencesource) event.
- Added the [-9 error code](../../Additional%20API/Conversion%20API/Error%20codes/index.md) to the Conversion API.
- Added the *key* field to the [document.referenceData](../../Usage%20API/Config/Document/index.md#referencedata) parameter.
- Added the *key* field to the [setReferenceData](../../Usage%20API/Methods/index.md#setreferencedata) method.
- The [events.onRequestCompareFile](../../Usage%20API/Config/Events/index.md#onrequestcomparefile) event is deprecated, please use the [events.onRequestSelectDocument](../../Usage%20API/Config/Events/index.md#onrequestselectdocument) event instead.
- The [setRevisedFile](../../Usage%20API/Methods/index.md#setrevisedfile) method is deprecated, please use the [setRequestedDocument](../../Usage%20API/Methods/index.md#setrequesteddocument) method instead.
- Added the [events.onRequestOpen](../../Usage%20API/Config/Events/index.md#onrequestopen) event.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ const config = {
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
title: "Example Document Title.docx",
url: "https://example.com/url-to-example-document.docx",
Expand Down
12 changes: 1 addition & 11 deletions site/pages/Docs/Docs API/Usage API/Config/Document/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ Type: object
``` json
{
"fileKey": "BCFA2CED",
"instanceId": "https://example.com",
"key": "Khirz6zTPdfd7"
"instanceId": "https://example.com"
}
```

Expand All @@ -56,14 +55,6 @@ Type: string

Example: `https://example.com`

### referenceData.key

Defines the unique document identifier used by the service to take the data from the co-editing session. In case the known key is sent, the document will be taken from the cache. Every time the document is edited and saved, the key must be generated anew. The document url can be used as the **key** but without the special characters and the length is limited to 128 symbols.

Type: string

Example: "Khirz6zTPdfd7"

## title

Defines the desired file name for the viewed or edited document which will also be used as file name when the document is downloaded. The length is limited to 128 symbols.
Expand Down Expand Up @@ -94,7 +85,6 @@ const docEditor = new DocsAPI.DocEditor("placeholder", {
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
title: "Example Title",
url: "https://example.com/url-to-example-document.xlsx",
Expand Down
4 changes: 2 additions & 2 deletions site/pages/Docs/Docs API/Usage API/Config/Events/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,11 +533,11 @@ function onRequestReferenceData() {

docEditor.setReferenceData({
fileType: "xlsx",
key: "Khirz6zTPdfd7",
path: "sample.xlsx",
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w",
url: "https://example.com/url-to-example-document.xlsx",
Expand Down Expand Up @@ -572,11 +572,11 @@ function onRequestReferenceSource() {

docEditor.setReferenceSource({
fileType: "xlsx",
key: "Khirz6zTPdfd7",
path: "sample.xlsx",
referenceData: {
fileKey: "BCFA2CED",
instanceId: "https://example.com",
key: "Khirz6zTPdfd7",
},
token: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJmaWxlVHlwZSI6Inhsc3giLCJwYXRoIjoic2FtcGxlLnhsc3giLCJyZWZlcmVuY2VEYXRhIjp7ImZpbGVLZXkiOiJCQ0ZBMkNFRCIsImluc3RhbmNlSWQiOiJodHRwczovL2V4YW1wbGUuY29tIn0sInVybCI6Imh0dHBzOi8vZXhhbXBsZS5jb20vdXJsLXRvLWV4YW1wbGUtZG9jdW1lbnQueGxzeCJ9.UXosmM-E_Cu9j9QGSlcj9FEoSu5m-zCS4b6FxO_2k7w",
url: "https://example.com/url-to-example-document.xlsx",
Expand Down
Loading

0 comments on commit d11143a

Please sign in to comment.