This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Y from "yjs"; | |
import { WebsocketProvider } from "y-websocket"; | |
const doc = new Y.Doc(); | |
// The provider takes care of broadcasting and receiving sync and awareness | |
const provider = new WebsocketProvider( | |
"wss://dovetailapp.com/api/yjs", | |
"00000000-0000-0000-0000-000000000000", // docId | |
doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Y from "yjs"; | |
import { WebsocketProvider } from "y-websocket"; | |
const doc = new Y.Doc(); | |
// The provider takes care of broadcasting and receiving sync and awareness. | |
// This will automatically perform the initial sync. | |
const provider = new WebsocketProvider( | |
"wss://dovetailapp.com/api/yjs", | |
"00000000-0000-0000-0000-000000000000", // docId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { | |
data: { project }, | |
} = await apolloClient.query<graphqlTypes.TagsDataQuery, graphqlTypes.TagsDataQueryVariables>({ | |
query: PROJECT_EXPORT_TAGS_QUERY, | |
variables: { id: projectId, limit: 25, offset }, | |
fetchPolicy: "network-only", | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export type TagsDataQuery = { | |
readonly project: { | |
readonly __typename: "Project"; | |
readonly id: string; | |
readonly tags: { | |
readonly __typename: "TagsConnection"; | |
readonly totalCount: number; | |
readonly nodes: ReadonlyArray<{ | |
readonly __typename: "Tag"; | |
readonly id: string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const EXPORT_TAGS_QUERY = gql` | |
query ExportTagsDataQuery($id: UUID!, $offset: Int, $limit: Int!) { | |
project: projectById(id: $id) { | |
id | |
tags: tagsByProjectId(condition: { deleted: false, deletedCascade: false }, offset: $offset, first: $limit) { | |
totalCount | |
nodes { | |
id | |
title | |
color |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { PreparedQuery } from '@pgtyped/query'; | |
export type file_retention_status = 'DELETED' | 'EXPIRED' | 'NOTIFIED' | 'PROCESSED'; | |
export type file_upload_status = 'CANCELLED' | 'DONE' | 'FAILED' | 'UPLOADING'; | |
export interface IGetFileByIdParams { | |
id: string; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* @name getFileById */ | |
SELECT * | |
FROM dovetail.file | |
WHERE id = :id!; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```tsx | |
import * as Y from "yjs"; | |
import * as util from "util"; | |
const ydoc = new Y.Doc(); | |
// Create a top level data type | |
const ytext = ydoc.getText("text"); | |
****// Insert subsequent characters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as Y from "yjs"; | |
import * as util from "util"; | |
const ydoc = new Y.Doc(); | |
// Create a top level data type | |
const ytext = ydoc.getText("text"); | |
// Insert subsequent characters | |
ytext.insert(0, "A"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
structs: [ | |
Item { // This insert is a tombstone | |
id: ID { client: 2617533864, clock: 0 }, | |
length: 1, | |
origin: null, | |
left: null, | |
right: null, | |
rightOrigin: null, | |
parent: 'listOfNumbers', |
NewerOlder