@platecms/delta-client 0.13.0 → 1.2.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.
- package/package.json +5 -3
- package/src/__generated__/gql.ts +93 -3
- package/src/__generated__/graphql.ts +679 -82
- package/src/api/fetchContentExperiences.spec.ts +82 -0
- package/src/api/fetchContentExperiences.ts +42 -0
- package/src/api/fetchContentItems.spec.ts +62 -0
- package/src/api/fetchContentItems.ts +42 -0
- package/src/api/fetchPathParts.spec.ts +62 -0
- package/src/api/fetchPathParts.ts +42 -0
- package/src/api/fetchTags.spec.ts +61 -0
- package/src/api/fetchTags.ts +38 -0
- package/src/api/index.ts +4 -1
- package/src/api/types.ts +35 -0
- package/src/apollo/index.ts +1 -1
- package/src/app/utils/paginated-response.type.ts +19 -0
- package/src/factories/BaseFactory.ts +19 -0
- package/src/factories/ChannelFactory.ts +19 -0
- package/src/factories/ContentExperienceFactory.ts +54 -0
- package/src/factories/PathPartFactory.ts +26 -0
- package/src/factories/TagFactory.ts +30 -0
- package/src/graphql/content-experiences/content-experiences.query.gql +82 -0
- package/src/graphql/content-items/content-items.query.gql +47 -0
- package/src/graphql/fragments/asset.fragment.gql +10 -0
- package/src/graphql/fragments/asset.fragments.gql +10 -0
- package/src/graphql/fragments/building-block-field-fullfillment.fragments.gql +45 -0
- package/src/graphql/fragments/building-block-field.fragments.gql +8 -0
- package/src/graphql/fragments/building-block.fragments.gql +11 -0
- package/src/graphql/fragments/content-experience.fragments.gql +8 -0
- package/src/graphql/fragments/content-field.fragments.gql +7 -0
- package/src/graphql/fragments/content-item.fragments.gql +11 -0
- package/src/graphql/fragments/content-type.fragments.gql +11 -0
- package/src/graphql/fragments/content-values.fragments.gql +33 -0
- package/src/graphql/fragments/experience-component.fragments.gql +13 -0
- package/src/graphql/fragments/grid-placement.fragments.gql +7 -0
- package/src/graphql/fragments/path-part.fragments.gql +8 -0
- package/src/graphql/fragments/tag.fragment.gql +17 -0
- package/src/graphql/path-parts/path-parts.query.gql +52 -0
- package/src/graphql/tags/tag.query.gql +15 -3
- package/src/index.ts +1 -1
- package/src/slate/index.ts +21 -3
- package/src/utils/index.ts +8 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
query contentExperiences(
|
|
2
|
+
$paginate: PaginationOptionsInput!
|
|
3
|
+
$where: [ContentExperiencesFilterInput!]
|
|
4
|
+
$orderBy: OrderOptionsInput
|
|
5
|
+
$optionsList: [ProcessedAssetOptionsInput!]!
|
|
6
|
+
) {
|
|
7
|
+
contentExperiences(paginate: $paginate, where: $where, orderBy: $orderBy) {
|
|
8
|
+
pageInfo {
|
|
9
|
+
endCursor
|
|
10
|
+
hasNextPage
|
|
11
|
+
hasPreviousPage
|
|
12
|
+
startCursor
|
|
13
|
+
}
|
|
14
|
+
totalCount
|
|
15
|
+
edges {
|
|
16
|
+
cursor
|
|
17
|
+
node {
|
|
18
|
+
...contentExperienceFragment
|
|
19
|
+
preview {
|
|
20
|
+
...assetFragment
|
|
21
|
+
processedUrls(optionsList: $optionsList)
|
|
22
|
+
}
|
|
23
|
+
pathPart {
|
|
24
|
+
...pathPartFragment
|
|
25
|
+
}
|
|
26
|
+
experienceComponent {
|
|
27
|
+
...experienceComponentFragment
|
|
28
|
+
buildingBlock {
|
|
29
|
+
...buildingBlockFragment
|
|
30
|
+
}
|
|
31
|
+
buildingBlockFieldFulfillments {
|
|
32
|
+
...buildingBlockFieldFulfillmentFragment
|
|
33
|
+
buildingBlockField {
|
|
34
|
+
...buildingBlockFieldFragment
|
|
35
|
+
}
|
|
36
|
+
contentValue {
|
|
37
|
+
...comprehensiveContentValueFragment
|
|
38
|
+
contentItem {
|
|
39
|
+
prn
|
|
40
|
+
}
|
|
41
|
+
relatedAsset {
|
|
42
|
+
...assetFragment
|
|
43
|
+
processedUrls(optionsList: $optionsList)
|
|
44
|
+
}
|
|
45
|
+
linkedGridPlacement {
|
|
46
|
+
...gridPlacementFragment
|
|
47
|
+
experienceComponent {
|
|
48
|
+
...experienceComponentFragment
|
|
49
|
+
buildingBlock {
|
|
50
|
+
...buildingBlockFragment
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
relatedContentItem {
|
|
55
|
+
...contentItemFragment
|
|
56
|
+
contentType {
|
|
57
|
+
...contentTypeFragment
|
|
58
|
+
contentFields {
|
|
59
|
+
...contentFieldFragment
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
contentValues {
|
|
63
|
+
...comprehensiveContentValueFragment
|
|
64
|
+
contentField {
|
|
65
|
+
...contentFieldFragment
|
|
66
|
+
}
|
|
67
|
+
relatedAsset {
|
|
68
|
+
...assetFragment
|
|
69
|
+
processedUrls(optionsList: $optionsList)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
tags {
|
|
77
|
+
...tagFragment
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
query contentItems(
|
|
2
|
+
$paginate: PaginationOptionsInput!
|
|
3
|
+
$where: [ContentItemsFilterInput!]
|
|
4
|
+
$orderBy: OrderOptionsInput
|
|
5
|
+
$optionsList: [ProcessedAssetOptionsInput!]!
|
|
6
|
+
) {
|
|
7
|
+
contentItems(paginate: $paginate, where: $where, orderBy: $orderBy) {
|
|
8
|
+
pageInfo {
|
|
9
|
+
endCursor
|
|
10
|
+
hasNextPage
|
|
11
|
+
hasPreviousPage
|
|
12
|
+
startCursor
|
|
13
|
+
}
|
|
14
|
+
totalCount
|
|
15
|
+
edges {
|
|
16
|
+
cursor
|
|
17
|
+
node {
|
|
18
|
+
...contentItemFragment
|
|
19
|
+
contentValues {
|
|
20
|
+
...contentValueFragment
|
|
21
|
+
contentField {
|
|
22
|
+
...contentFieldFragment
|
|
23
|
+
}
|
|
24
|
+
relatedAsset {
|
|
25
|
+
...assetFragment
|
|
26
|
+
processedUrls(optionsList: $optionsList)
|
|
27
|
+
}
|
|
28
|
+
relatedContentItem {
|
|
29
|
+
...contentItemFragment
|
|
30
|
+
contentValues {
|
|
31
|
+
...contentValueFragment
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
contentType {
|
|
36
|
+
...contentTypeFragment
|
|
37
|
+
contentFields {
|
|
38
|
+
...contentFieldFragment
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
tags {
|
|
42
|
+
...tagFragment
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
fragment buildingBlockFieldFulfillmentFragment on BuildingBlockFieldFulfillment {
|
|
2
|
+
_id: prn
|
|
3
|
+
prn
|
|
4
|
+
contentValue {
|
|
5
|
+
...contentValueFragment
|
|
6
|
+
contentItem {
|
|
7
|
+
prn
|
|
8
|
+
}
|
|
9
|
+
relatedAsset {
|
|
10
|
+
...assetFragment
|
|
11
|
+
}
|
|
12
|
+
linkedPathPart {
|
|
13
|
+
...pathPartFragment
|
|
14
|
+
}
|
|
15
|
+
linkedGridPlacement {
|
|
16
|
+
...gridPlacementFragment
|
|
17
|
+
experienceComponent {
|
|
18
|
+
...experienceComponentFragment
|
|
19
|
+
buildingBlock {
|
|
20
|
+
...buildingBlockFragment
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
relatedContentItem {
|
|
25
|
+
...contentItemFragment
|
|
26
|
+
contentType {
|
|
27
|
+
...contentTypeFragment
|
|
28
|
+
contentFields {
|
|
29
|
+
...contentFieldFragment
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
contentValues {
|
|
33
|
+
...contentValueFragment
|
|
34
|
+
contentField {
|
|
35
|
+
...contentFieldFragment
|
|
36
|
+
}
|
|
37
|
+
relatedAsset {
|
|
38
|
+
...assetFragment
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
createdAt
|
|
44
|
+
updatedAt
|
|
45
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
fragment contentValueFragment on ContentValue {
|
|
2
|
+
_id: prn
|
|
3
|
+
prn
|
|
4
|
+
primitiveValue
|
|
5
|
+
interpolatedSmartText
|
|
6
|
+
createdAt
|
|
7
|
+
updatedAt
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
fragment comprehensiveContentValueFragment on ContentValue {
|
|
11
|
+
...contentValueFragment
|
|
12
|
+
contentField {
|
|
13
|
+
...contentFieldFragment
|
|
14
|
+
}
|
|
15
|
+
relatedAsset {
|
|
16
|
+
...assetFragment
|
|
17
|
+
}
|
|
18
|
+
linkedPathPart {
|
|
19
|
+
...pathPartFragment
|
|
20
|
+
}
|
|
21
|
+
linkedGridPlacement {
|
|
22
|
+
...gridPlacementFragment
|
|
23
|
+
}
|
|
24
|
+
linkedContentType {
|
|
25
|
+
...contentTypeFragment
|
|
26
|
+
}
|
|
27
|
+
linkedTag {
|
|
28
|
+
...tagFragment
|
|
29
|
+
}
|
|
30
|
+
relatedContentItem {
|
|
31
|
+
...contentItemFragment
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
fragment tagFragment on Tag {
|
|
2
|
+
_id: prn
|
|
3
|
+
prn
|
|
4
|
+
name
|
|
5
|
+
path
|
|
6
|
+
color
|
|
7
|
+
visibility
|
|
8
|
+
forceVisibilityOnDescendants
|
|
9
|
+
stage
|
|
10
|
+
amountOfChildren
|
|
11
|
+
amountOfContentExperiences
|
|
12
|
+
amountOfContentItems
|
|
13
|
+
hasForcedVisibility
|
|
14
|
+
nestingLevel
|
|
15
|
+
createdAt
|
|
16
|
+
updatedAt
|
|
17
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
query pathParts(
|
|
2
|
+
$paginate: PaginationOptionsInput!
|
|
3
|
+
$where: [PathPartsFilterInput!]
|
|
4
|
+
$orderBy: OrderOptionsInput
|
|
5
|
+
$optionsList: [ProcessedAssetOptionsInput!]!
|
|
6
|
+
) {
|
|
7
|
+
pathParts(paginate: $paginate, where: $where, orderBy: $orderBy) {
|
|
8
|
+
pageInfo {
|
|
9
|
+
endCursor
|
|
10
|
+
hasNextPage
|
|
11
|
+
hasPreviousPage
|
|
12
|
+
startCursor
|
|
13
|
+
}
|
|
14
|
+
totalCount
|
|
15
|
+
edges {
|
|
16
|
+
cursor
|
|
17
|
+
node {
|
|
18
|
+
...pathPartFragment
|
|
19
|
+
contentExperience {
|
|
20
|
+
...contentExperienceFragment
|
|
21
|
+
preview {
|
|
22
|
+
...assetFragment
|
|
23
|
+
processedUrls(optionsList: $optionsList)
|
|
24
|
+
}
|
|
25
|
+
experienceComponent {
|
|
26
|
+
...experienceComponentFragment
|
|
27
|
+
buildingBlock {
|
|
28
|
+
...buildingBlockFragment
|
|
29
|
+
}
|
|
30
|
+
buildingBlockFieldFulfillments {
|
|
31
|
+
buildingBlockField {
|
|
32
|
+
...buildingBlockFieldFragment
|
|
33
|
+
}
|
|
34
|
+
contentValue {
|
|
35
|
+
...contentValueFragment
|
|
36
|
+
contentItem {
|
|
37
|
+
prn
|
|
38
|
+
}
|
|
39
|
+
relatedAsset {
|
|
40
|
+
...assetFragment
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
children {
|
|
47
|
+
...pathPartFragment
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
query
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
query tags($paginate: PaginationOptionsInput!, $where: [TagsFilterInput!], $orderBy: OrderOptionsInput) {
|
|
2
|
+
tags(paginate: $paginate, where: $where, orderBy: $orderBy) {
|
|
3
|
+
pageInfo {
|
|
4
|
+
endCursor
|
|
5
|
+
hasNextPage
|
|
6
|
+
hasPreviousPage
|
|
7
|
+
startCursor
|
|
8
|
+
}
|
|
9
|
+
totalCount
|
|
10
|
+
edges {
|
|
11
|
+
cursor
|
|
12
|
+
node {
|
|
13
|
+
...tagFragment
|
|
14
|
+
}
|
|
15
|
+
}
|
|
4
16
|
}
|
|
5
17
|
}
|
package/src/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./api";
|
package/src/slate/index.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseEditor } from "slate";
|
|
2
2
|
import { ReactEditor } from "slate-react";
|
|
3
|
-
import { Root } from "@platecms/delta-cast";
|
|
3
|
+
import { Content, Root } from "@platecms/delta-cast";
|
|
4
4
|
|
|
5
5
|
declare module "slate" {
|
|
6
6
|
interface CustomTypes {
|
|
@@ -21,11 +21,13 @@ export type DeltaElement =
|
|
|
21
21
|
| BlockquoteElement
|
|
22
22
|
| CodeElement
|
|
23
23
|
| ContentValueElement
|
|
24
|
+
| ContentValueSuggestionElement
|
|
24
25
|
| HeadingElement
|
|
25
26
|
| LinkElement
|
|
26
27
|
| ListElement
|
|
27
28
|
| ListItemElement
|
|
28
|
-
| ParagraphElement
|
|
29
|
+
| ParagraphElement
|
|
30
|
+
| Suggestion;
|
|
29
31
|
|
|
30
32
|
export type DeltaLeaf = DeltaLeafMarkdown & {
|
|
31
33
|
text: string;
|
|
@@ -39,7 +41,7 @@ export type DeltaLeaf = DeltaLeafMarkdown & {
|
|
|
39
41
|
|
|
40
42
|
export interface ParagraphElement {
|
|
41
43
|
type: "paragraph";
|
|
42
|
-
children: (ContentValueElement | DeltaLeaf | LinkElement)[];
|
|
44
|
+
children: (ContentValueElement | ContentValueSuggestionElement | DeltaLeaf | LinkElement | Suggestion)[];
|
|
43
45
|
}
|
|
44
46
|
export interface HeadingElement {
|
|
45
47
|
type: "heading";
|
|
@@ -70,6 +72,13 @@ export interface ContentValueElement {
|
|
|
70
72
|
children: DeltaLeaf[];
|
|
71
73
|
}
|
|
72
74
|
|
|
75
|
+
export interface ContentValueSuggestionElement {
|
|
76
|
+
type: "contentValueSuggestion";
|
|
77
|
+
prn: string;
|
|
78
|
+
root: Root | undefined;
|
|
79
|
+
children: DeltaLeaf[];
|
|
80
|
+
}
|
|
81
|
+
|
|
73
82
|
export interface LinkElement {
|
|
74
83
|
type: "link";
|
|
75
84
|
url: string;
|
|
@@ -82,3 +91,12 @@ export interface LinkElement {
|
|
|
82
91
|
anchor?: boolean;
|
|
83
92
|
};
|
|
84
93
|
}
|
|
94
|
+
|
|
95
|
+
export interface Suggestion {
|
|
96
|
+
type: "suggestion";
|
|
97
|
+
suggested: Content[];
|
|
98
|
+
original: Content[];
|
|
99
|
+
message: string;
|
|
100
|
+
method: string;
|
|
101
|
+
children: DeltaLeaf[];
|
|
102
|
+
}
|
package/src/utils/index.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { Mode } from "../api/types";
|
|
2
|
+
|
|
1
3
|
export * from "./lib/connectors/WindowConnector";
|
|
2
4
|
export * from "./lib/events/ConnectorEvents";
|
|
3
5
|
|
|
@@ -5,3 +7,9 @@ export type Draft<T> = T & {
|
|
|
5
7
|
isDraft: boolean;
|
|
6
8
|
uuid: string;
|
|
7
9
|
};
|
|
10
|
+
|
|
11
|
+
export const API_VERSION = "v0";
|
|
12
|
+
|
|
13
|
+
export function apiBaseUrl(mode: Mode): string {
|
|
14
|
+
return `https://api.delta-${mode}.getplate.rocks`;
|
|
15
|
+
}
|