@mdedit/sdk
Advanced tools
+19
-3
@@ -155,2 +155,12 @@ type AuthHeaders = Record<string, string>; | ||
| } | ||
| type PublicationMode = 'snapshot' | 'live'; | ||
| type PublicationSyncStatus = 'idle' | 'queued' | 'syncing' | 'succeeded' | 'failed'; | ||
| interface PublicationSourceMetadata { | ||
| sourceArticleRevision?: number; | ||
| sourceContentRevision?: number; | ||
| sourcePackageRevision?: number; | ||
| sourceContentHash?: string; | ||
| sourceVersionId?: string; | ||
| lastSuccessfulSyncAt?: number; | ||
| } | ||
| interface PublishArticleRequest { | ||
@@ -164,4 +174,5 @@ customSlug?: string; | ||
| }; | ||
| mode?: PublicationMode; | ||
| } | ||
| interface PublishArticleResponse { | ||
| interface PublishArticleResponse extends PublicationSourceMetadata { | ||
| publishId: string; | ||
@@ -171,4 +182,6 @@ shortUrl: string; | ||
| publishedAt: number; | ||
| mode: PublicationMode; | ||
| syncStatus: PublicationSyncStatus; | ||
| } | ||
| interface PublishStatusResponse { | ||
| interface PublishStatusResponse extends PublicationSourceMetadata { | ||
| isPublished: boolean; | ||
@@ -183,2 +196,5 @@ publishId?: string; | ||
| seoMetadata?: PublishArticleRequest['seoMetadata']; | ||
| mode?: PublicationMode; | ||
| syncStatus?: PublicationSyncStatus; | ||
| syncError?: string; | ||
| } | ||
@@ -241,2 +257,2 @@ interface UnpublishArticleResponse { | ||
| export { type ApiClientConfig, type ApiKeyListItem, type ArticleContentCommitResponse, type ArticleContentSaveOptions, 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 PublishArticleRequest, type PublishArticleResponse, type PublishStatusResponse, type SdkClient, type UnpublishArticleResponse, type UpdateArticleRequest, type UpdateWorkspaceRequest, createSdkClient }; | ||
| export { type ApiClientConfig, type ApiKeyListItem, type ArticleContentCommitResponse, type ArticleContentSaveOptions, 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 PublicationMode, type PublicationSourceMetadata, type PublicationSyncStatus, type PublishArticleRequest, type PublishArticleResponse, type PublishStatusResponse, type SdkClient, type UnpublishArticleResponse, type UpdateArticleRequest, type UpdateWorkspaceRequest, createSdkClient }; |
+1
-1
| { | ||
| "name": "@mdedit/sdk", | ||
| "version": "0.3.3", | ||
| "version": "0.3.4", | ||
| "private": false, | ||
@@ -5,0 +5,0 @@ "type": "module", |
+25
-0
@@ -34,2 +34,27 @@ # `@mdedit/sdk` | ||
| ## Public links | ||
| New agent-facing workflows should request `mode: 'live'`; a Live link follows later | ||
| durable document edits at the same URL. Use `mode: 'snapshot'` for a frozen artifact. | ||
| When updating an existing publication, omit `mode` to preserve its stored mode. | ||
| ```ts | ||
| const publication = await client.publish.publish(workspaceId, articleId, { | ||
| mode: 'live', | ||
| }); | ||
| const status = await client.publish.status(workspaceId, articleId); | ||
| console.log({ | ||
| url: status.shortUrl, | ||
| mode: status.mode, | ||
| sourceVersionId: status.sourceVersionId, | ||
| syncStatus: status.syncStatus, | ||
| syncError: status.syncError, | ||
| }); | ||
| ``` | ||
| The SDK exports `PublicationMode`, `PublicationSyncStatus`, and | ||
| `PublicationSourceMetadata` for typed integrations. Existing links without stored mode | ||
| metadata are legacy Snapshots until explicitly changed. | ||
| ## Error handling | ||
@@ -36,0 +61,0 @@ |
Sorry, the diff of this file is too big to display
143045
1.57%941
1.73%73
52.08%