@platecms/delta-client 0.9.1 → 0.9.2
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 +2 -2
- package/src/schema/lib/schemas/asset.spec.ts +1 -1
- package/src/schema/lib/schemas/asset.ts +3 -2
- package/src/schema/lib/schemas/contentType.ts +2 -1
- package/src/schema/lib/schemas/gridPlacement.spec.ts +1 -1
- package/src/schema/lib/schemas/gridPlacement.ts +3 -2
- package/src/schema/lib/schemas/pathPart.spec.ts +1 -1
- package/src/schema/lib/schemas/pathPart.ts +3 -2
- package/src/schema/lib/schemas/smartText.ts +2 -1
- package/src/schema/lib/schemas/tag.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platecms/delta-client",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"description": "Utilities and functions to interact with the Delta CMS.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"publishConfig": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"src/**/*"
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@platecms/delta-cast": "0.9.
|
|
21
|
+
"@platecms/delta-cast": "0.9.2",
|
|
22
22
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
23
23
|
"graphql": "16.11.0",
|
|
24
24
|
"lodash": "4.17.21",
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Asset } from "../../../__generated__/graphql";
|
|
2
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
2
3
|
import { BaseSchema } from "./baseSchema";
|
|
3
4
|
|
|
4
5
|
export class AssetSchema extends BaseSchema<Asset | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): Asset | null {
|
|
6
|
-
if (
|
|
7
|
-
return (data as {
|
|
7
|
+
if (isContentValue(data) && "relatedAsset" in data) {
|
|
8
|
+
return (data as { relatedAsset: Asset }).relatedAsset;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
return null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ContentType } from "../../../__generated__/graphql";
|
|
2
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
2
3
|
import { BaseSchema } from "./baseSchema";
|
|
3
4
|
|
|
4
5
|
export class ContentTypeSchema extends BaseSchema<ContentType | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): ContentType | null {
|
|
6
|
-
if (
|
|
7
|
+
if (isContentValue(data) && "linkedContentType" in data) {
|
|
7
8
|
return (data as { linkedContentType: ContentType }).linkedContentType;
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { GridPlacement } from "../../../__generated__/graphql";
|
|
2
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
2
3
|
import { BaseSchema } from "./baseSchema";
|
|
3
4
|
|
|
4
5
|
export class GridPlacementSchema extends BaseSchema<GridPlacement | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): GridPlacement | null {
|
|
6
|
-
if (
|
|
7
|
-
return (data as {
|
|
7
|
+
if (isContentValue(data) && "linkedGridPlacement" in data) {
|
|
8
|
+
return (data as { linkedGridPlacement: GridPlacement }).linkedGridPlacement;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
return null;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { PathPart } from "../../../__generated__/graphql";
|
|
2
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
2
3
|
import { BaseSchema } from "./baseSchema";
|
|
3
4
|
|
|
4
5
|
export class PathPartSchema extends BaseSchema<PathPart | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): PathPart | null {
|
|
6
|
-
if (
|
|
7
|
-
return (data as {
|
|
7
|
+
if (isContentValue(data) && "linkedPathPart" in data) {
|
|
8
|
+
return (data as { linkedPathPart: PathPart }).linkedPathPart;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
return null;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Root as SmartText } from "@platecms/delta-cast";
|
|
2
2
|
import { BaseSchema } from "./baseSchema";
|
|
3
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
3
4
|
|
|
4
5
|
export class SmartTextSchema extends BaseSchema<SmartText | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): SmartText | null {
|
|
6
|
-
if (
|
|
7
|
+
if (isContentValue(data) && "interpolatedSmartText" in data) {
|
|
7
8
|
return (data as { interpolatedSmartText: SmartText }).interpolatedSmartText;
|
|
8
9
|
}
|
|
9
10
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Tag } from "../../../__generated__/graphql";
|
|
2
|
+
import { isContentValue } from "../utils/isContentValue";
|
|
2
3
|
import { BaseSchema } from "./baseSchema";
|
|
3
4
|
|
|
4
5
|
export class TagSchema extends BaseSchema<Tag | null, unknown> {
|
|
5
6
|
protected override findValue(data: unknown): Tag | null {
|
|
6
|
-
if (
|
|
7
|
+
if (isContentValue(data) && "linkedTag" in data) {
|
|
7
8
|
return (data as { linkedTag: Tag }).linkedTag;
|
|
8
9
|
}
|
|
9
10
|
|