@wenyan-md/core 3.0.11 → 3.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -213,7 +213,8 @@ async function handleFrontMatter(markdown) {
213
213
  need_open_comment,
214
214
  only_fans_can_comment,
215
215
  image_list,
216
- type
216
+ type,
217
+ digest
217
218
  } = attributes;
218
219
  if (title) {
219
220
  result.title = title;
@@ -249,6 +250,9 @@ async function handleFrontMatter(markdown) {
249
250
  if (type) {
250
251
  result.type = type;
251
252
  }
253
+ if (digest) {
254
+ result.digest = digest;
255
+ }
252
256
  if (head) {
253
257
  result.content = head + result.content;
254
258
  }
@@ -11,5 +11,6 @@ export interface FrontMatterResult {
11
11
  only_fans_can_comment?: boolean;
12
12
  image_list?: string[];
13
13
  type?: string;
14
+ digest?: string;
14
15
  }
15
16
  export declare function handleFrontMatter(markdown: string): Promise<FrontMatterResult>;
@@ -12,6 +12,7 @@ export interface ArticleOptions {
12
12
  pic_crop_1_1?: string;
13
13
  need_open_comment?: boolean;
14
14
  only_fans_can_comment?: boolean;
15
+ digest?: string;
15
16
  }
16
17
  export interface ImageTextArticleOptions extends ArticleOptions {
17
18
  images: string[];
@@ -25,6 +25,7 @@ export interface WechatPublishOptions {
25
25
  image_info?: ImageInfo;
26
26
  need_open_comment?: 0 | 1;
27
27
  only_fans_can_comment?: 0 | 1;
28
+ digest?: string;
28
29
  }
29
30
  export interface WechatErrorResponse {
30
31
  errcode: number;
package/dist/wrapper.js CHANGED
@@ -487,7 +487,8 @@ async function publishToWechatDraft(articleOptions, publishOptions = {}) {
487
487
  pic_crop_235_1,
488
488
  pic_crop_1_1,
489
489
  need_open_comment,
490
- only_fans_can_comment
490
+ only_fans_can_comment,
491
+ digest
491
492
  } = articleOptions;
492
493
  const { appId, appSecret, relativePath } = publishOptions;
493
494
  const { appId: appIdFinal, appSecret: appSecretFinal } = await getAppIdAndSecret(appId, appSecret);
@@ -527,7 +528,8 @@ async function publishToWechatDraft(articleOptions, publishOptions = {}) {
527
528
  pic_crop_235_1,
528
529
  pic_crop_1_1,
529
530
  need_open_comment: need_open_comment ? 1 : 0,
530
- only_fans_can_comment: only_fans_can_comment ? 1 : 0
531
+ only_fans_can_comment: only_fans_can_comment ? 1 : 0,
532
+ digest
531
533
  });
532
534
  if (data.media_id) {
533
535
  return data;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wenyan-md/core",
3
- "version": "3.0.11",
3
+ "version": "3.0.12",
4
4
  "description": "Core library for Wenyan markdown rendering & publishing",
5
5
  "author": "Lei <caol64@gmail.com> (https://github.com/caol64)",
6
6
  "license": "Apache-2.0",