@mdedit/sdk
Advanced tools
+25
-1
@@ -109,2 +109,23 @@ import { ArticleContentSaveOptions } from '@mdedit/mdedit-api-client/articleContent'; | ||
| } | ||
| interface CollaborationCheckpointResponse { | ||
| collaborative: boolean; | ||
| articleId: string; | ||
| workspaceId: string; | ||
| targetId: 'content.md'; | ||
| canEdit: boolean; | ||
| canWrite?: boolean; | ||
| permission?: 'read' | 'write' | 'workspace_member' | 'owner' | null; | ||
| websocketPath: '/collaboration'; | ||
| yjsRevision?: number; | ||
| lastStoredAt?: number; | ||
| lastCheckpointAt?: number; | ||
| packageRevision?: number; | ||
| checkpointedAt: number; | ||
| changed: boolean; | ||
| changedTargets: string[]; | ||
| reviewChanged: boolean; | ||
| targetHashes: Record<string, string>; | ||
| reviewHash?: string; | ||
| lastPackageRevision?: number; | ||
| } | ||
| interface SdkClient { | ||
@@ -150,5 +171,8 @@ apiKeys: { | ||
| }; | ||
| collaboration: { | ||
| checkpoint: (workspaceId: string, articleId: string) => Promise<CollaborationCheckpointResponse>; | ||
| }; | ||
| } | ||
| declare function createSdkClient(config: ApiClientConfig): SdkClient; | ||
| export { type ApiClientConfig, type ApiKeyListItem, type AuthHeaders, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateArticleRequest, type CreateWorkspaceRequest, FetchError, type IArticle, type IFolder, type IFolderCreateRequest, type IFolderUpdateRequest, type IWorkspace, type ListApiKeysResponse, type SdkClient, type UpdateArticleRequest, type UpdateWorkspaceRequest, createSdkClient }; | ||
| export { type ApiClientConfig, type ApiKeyListItem, type AuthHeaders, type CollaborationCheckpointResponse, type CreateApiKeyRequest, type CreateApiKeyResponse, type CreateArticleRequest, type CreateWorkspaceRequest, FetchError, type IArticle, type IFolder, type IFolderCreateRequest, type IFolderUpdateRequest, type IWorkspace, type ListApiKeysResponse, type SdkClient, type UpdateArticleRequest, type UpdateWorkspaceRequest, createSdkClient }; |
+19
-0
@@ -521,2 +521,18 @@ // ../mdedit-api-client/src/shared.ts | ||
| // ../mdedit-api-client/src/collaboration.ts | ||
| var checkpointCollaboration = async (workspaceId, articleId, fetchers) => { | ||
| const fetchV2 = fetchers?.customFetchV2 ?? customFetchV2; | ||
| const response = await fetchV2( | ||
| `/workspaces/${workspaceId}/articles/${articleId}/collaboration/checkpoint`, | ||
| { method: "POST" } | ||
| ); | ||
| if (!response.ok) { | ||
| throw new errors_default( | ||
| `Error checkpointing collaboration. ${await response.text()}`, | ||
| response.status | ||
| ); | ||
| } | ||
| return response.json(); | ||
| }; | ||
| // src/index.ts | ||
@@ -583,2 +599,5 @@ var FetchError2 = class extends Error { | ||
| exportZip: (workspaceId, articleId) => withFetchError(() => exportArticleZip(workspaceId, articleId, fetchers)) | ||
| }, | ||
| collaboration: { | ||
| checkpoint: (workspaceId, articleId) => withFetchError(() => checkpointCollaboration(workspaceId, articleId, fetchers)) | ||
| } | ||
@@ -585,0 +604,0 @@ }; |
+1
-1
| { | ||
| "name": "@mdedit/sdk", | ||
| "version": "0.2.1", | ||
| "version": "0.2.2", | ||
| "private": false, | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is too big to display
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
108930
12.06%774
5.74%2
100%