Sign In

@mdedit/sdk

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@mdedit/sdk - npm Package Compare versions

Comparing version
0.2.1
to
0.2.2
+25
-1
dist/index.d.ts

@@ -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 };

@@ -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