@atlaskit/editor-synced-block-provider 0.6.1 → 0.7.0

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.
@@ -1,19 +1,23 @@
1
+ import { type PAGE_TYPE } from './ari';
1
2
  type GetContentPropertyOptions = {
2
3
  cloudId: string;
3
4
  key: string;
4
5
  pageId: string;
6
+ pageType: PAGE_TYPE;
5
7
  signal?: AbortSignal;
6
8
  };
7
9
  type CreateContentPropertyOptions = {
8
10
  cloudId: string;
9
11
  key: string;
10
12
  pageId: string;
13
+ pageType: PAGE_TYPE;
11
14
  value: string;
12
15
  };
13
16
  type UpdateContentPropertyOptions = {
14
17
  cloudId: string;
15
18
  key: string;
16
19
  pageId: string;
20
+ pageType: PAGE_TYPE;
17
21
  signal?: AbortSignal;
18
22
  value: string;
19
23
  };
@@ -31,6 +35,20 @@ export type GetContentPropertyResult = {
31
35
  };
32
36
  };
33
37
  };
38
+ export type GetBlogPostContentPropertyResult = {
39
+ data: {
40
+ confluence: {
41
+ blogPost: {
42
+ properties: [
43
+ {
44
+ key: string | null;
45
+ value: string | null;
46
+ }
47
+ ] | null;
48
+ };
49
+ };
50
+ };
51
+ };
34
52
  export type UpdateContentPropertyResult = {
35
53
  data: {
36
54
  confluence: {
@@ -43,6 +61,18 @@ export type UpdateContentPropertyResult = {
43
61
  };
44
62
  };
45
63
  };
64
+ export type UpdateBlogPostContentPropertyResult = {
65
+ data: {
66
+ confluence: {
67
+ updateValueBlogPostProperty: {
68
+ blogPostProperty: {
69
+ key: string | null;
70
+ value: string | null;
71
+ } | null;
72
+ };
73
+ };
74
+ };
75
+ };
46
76
  export type CreateContentPropertyResult = {
47
77
  data: {
48
78
  confluence: {
@@ -55,7 +85,19 @@ export type CreateContentPropertyResult = {
55
85
  };
56
86
  };
57
87
  };
58
- export declare const getContentProperty: ({ pageId, key, cloudId, }: GetContentPropertyOptions) => Promise<GetContentPropertyResult>;
59
- export declare const updateContentProperty: ({ pageId, key, value, cloudId, }: UpdateContentPropertyOptions) => Promise<UpdateContentPropertyResult>;
60
- export declare const createContentProperty: ({ pageId, key, value, cloudId, }: CreateContentPropertyOptions) => Promise<CreateContentPropertyResult>;
88
+ export type CreateBlogPostContentPropertyResult = {
89
+ data: {
90
+ confluence: {
91
+ createBlogPostProperty: {
92
+ blogPostProperty: {
93
+ key: string | null;
94
+ value: string | null;
95
+ } | null;
96
+ };
97
+ };
98
+ };
99
+ };
100
+ export declare const getContentProperty: <T extends GetContentPropertyResult | GetBlogPostContentPropertyResult>({ pageId, key, cloudId, pageType, }: GetContentPropertyOptions) => Promise<T>;
101
+ export declare const updateContentProperty: <T extends UpdateContentPropertyResult | UpdateBlogPostContentPropertyResult>({ pageId, key, value, cloudId, pageType, }: UpdateContentPropertyOptions) => Promise<T>;
102
+ export declare const createContentProperty: <T extends CreateContentPropertyResult | CreateBlogPostContentPropertyResult>({ pageId, key, value, cloudId, pageType, }: CreateContentPropertyOptions) => Promise<T>;
61
103
  export {};
@@ -1,3 +1,5 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SyncBlockNode } from '../common/types';
3
+ import type { PAGE_TYPE } from './ari';
3
4
  export declare const convertSyncBlockPMNodeToSyncBlockData: (node: PMNode, includeContent?: boolean) => SyncBlockNode;
5
+ export declare const isBlogPageType: (pageType: PAGE_TYPE) => boolean;
@@ -1,12 +1,18 @@
1
- export declare const getConfluencePageAri: (pageId: string, cloudId: string) => string;
2
- export declare const getPageIdFromAri: (ari: string) => string;
3
- /**
4
- *
5
- * @param ari ari:cloud:confluence:<cloudId>:page/<pageId>/<localId>
6
- * @returns
7
- */
1
+ export type PAGE_TYPE = 'page' | 'blogpost';
2
+ export declare const getConfluencePageAri: (pageId: string, cloudId: string, pageType?: PAGE_TYPE) => string;
3
+ export declare const getPageIdAndTypeFromAri: (ari: string) => {
4
+ id: string;
5
+ type: PAGE_TYPE;
6
+ };
8
7
  export declare const getLocalIdFromAri: (ari: string) => string;
9
8
  export declare const getPageARIFromResourceId: (resourceId: string) => string;
10
9
  export declare const getContentPropertyAri: (contentPropertyId: string, cloudId: string) => string;
10
+ /**
11
+ * DEPRECATED - Will be removed in the future
12
+ * @private
13
+ * @deprecated
14
+ * @param ari
15
+ * @returns
16
+ */
11
17
  export declare const getContentPropertyIdFromAri: (ari: string) => string;
12
18
  export declare const resourceIdFromSourceAndLocalId: (sourceId: string, localId: string) => string;
@@ -1,19 +1,23 @@
1
+ import { type PAGE_TYPE } from './ari';
1
2
  type GetContentPropertyOptions = {
2
3
  cloudId: string;
3
4
  key: string;
4
5
  pageId: string;
6
+ pageType: PAGE_TYPE;
5
7
  signal?: AbortSignal;
6
8
  };
7
9
  type CreateContentPropertyOptions = {
8
10
  cloudId: string;
9
11
  key: string;
10
12
  pageId: string;
13
+ pageType: PAGE_TYPE;
11
14
  value: string;
12
15
  };
13
16
  type UpdateContentPropertyOptions = {
14
17
  cloudId: string;
15
18
  key: string;
16
19
  pageId: string;
20
+ pageType: PAGE_TYPE;
17
21
  signal?: AbortSignal;
18
22
  value: string;
19
23
  };
@@ -31,6 +35,20 @@ export type GetContentPropertyResult = {
31
35
  };
32
36
  };
33
37
  };
38
+ export type GetBlogPostContentPropertyResult = {
39
+ data: {
40
+ confluence: {
41
+ blogPost: {
42
+ properties: [
43
+ {
44
+ key: string | null;
45
+ value: string | null;
46
+ }
47
+ ] | null;
48
+ };
49
+ };
50
+ };
51
+ };
34
52
  export type UpdateContentPropertyResult = {
35
53
  data: {
36
54
  confluence: {
@@ -43,6 +61,18 @@ export type UpdateContentPropertyResult = {
43
61
  };
44
62
  };
45
63
  };
64
+ export type UpdateBlogPostContentPropertyResult = {
65
+ data: {
66
+ confluence: {
67
+ updateValueBlogPostProperty: {
68
+ blogPostProperty: {
69
+ key: string | null;
70
+ value: string | null;
71
+ } | null;
72
+ };
73
+ };
74
+ };
75
+ };
46
76
  export type CreateContentPropertyResult = {
47
77
  data: {
48
78
  confluence: {
@@ -55,7 +85,19 @@ export type CreateContentPropertyResult = {
55
85
  };
56
86
  };
57
87
  };
58
- export declare const getContentProperty: ({ pageId, key, cloudId, }: GetContentPropertyOptions) => Promise<GetContentPropertyResult>;
59
- export declare const updateContentProperty: ({ pageId, key, value, cloudId, }: UpdateContentPropertyOptions) => Promise<UpdateContentPropertyResult>;
60
- export declare const createContentProperty: ({ pageId, key, value, cloudId, }: CreateContentPropertyOptions) => Promise<CreateContentPropertyResult>;
88
+ export type CreateBlogPostContentPropertyResult = {
89
+ data: {
90
+ confluence: {
91
+ createBlogPostProperty: {
92
+ blogPostProperty: {
93
+ key: string | null;
94
+ value: string | null;
95
+ } | null;
96
+ };
97
+ };
98
+ };
99
+ };
100
+ export declare const getContentProperty: <T extends GetContentPropertyResult | GetBlogPostContentPropertyResult>({ pageId, key, cloudId, pageType, }: GetContentPropertyOptions) => Promise<T>;
101
+ export declare const updateContentProperty: <T extends UpdateContentPropertyResult | UpdateBlogPostContentPropertyResult>({ pageId, key, value, cloudId, pageType, }: UpdateContentPropertyOptions) => Promise<T>;
102
+ export declare const createContentProperty: <T extends CreateContentPropertyResult | CreateBlogPostContentPropertyResult>({ pageId, key, value, cloudId, pageType, }: CreateContentPropertyOptions) => Promise<T>;
61
103
  export {};
@@ -1,3 +1,5 @@
1
1
  import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
2
2
  import type { SyncBlockNode } from '../common/types';
3
+ import type { PAGE_TYPE } from './ari';
3
4
  export declare const convertSyncBlockPMNodeToSyncBlockData: (node: PMNode, includeContent?: boolean) => SyncBlockNode;
5
+ export declare const isBlogPageType: (pageType: PAGE_TYPE) => boolean;
package/package.json CHANGED
@@ -82,7 +82,7 @@
82
82
  }
83
83
  },
84
84
  "name": "@atlaskit/editor-synced-block-provider",
85
- "version": "0.6.1",
85
+ "version": "0.7.0",
86
86
  "description": "Synced Block Provider for @atlaskit/editor-plugin-synced-block",
87
87
  "author": "Atlassian Pty Ltd",
88
88
  "license": "Apache-2.0",