@remkoj/optimizely-graph-functions 2.0.0-pre4 → 2.0.0-pre5
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/documents.js +113 -117
- package/dist/documents.js.map +1 -1
- package/dist/transform.js +2 -2
- package/package.json +4 -4
package/dist/documents.js
CHANGED
|
@@ -3,139 +3,135 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.DefaultFunctions = exports.queries = exports.fragments = exports.IContentDataProps = void 0;
|
|
4
4
|
exports.IContentDataProps = ["contentType", "id", "locale", "path", "__typename"];
|
|
5
5
|
exports.fragments = [
|
|
6
|
-
`fragment IContentData on
|
|
7
|
-
{
|
|
8
|
-
_metadata {
|
|
9
|
-
...IContentInfo
|
|
10
|
-
}
|
|
11
|
-
_type: __typename
|
|
6
|
+
`fragment IContentData on _IContent
|
|
7
|
+
{
|
|
8
|
+
_metadata {
|
|
9
|
+
...IContentInfo
|
|
10
|
+
}
|
|
11
|
+
_type: __typename
|
|
12
12
|
}`,
|
|
13
|
-
`fragment CompositionData on ICompositionNode {
|
|
14
|
-
name: displayName
|
|
15
|
-
layoutType
|
|
16
|
-
type
|
|
17
|
-
key
|
|
18
|
-
template: displayTemplateKey
|
|
19
|
-
settings: displaySettings {
|
|
20
|
-
key
|
|
21
|
-
value
|
|
22
|
-
}
|
|
23
|
-
... on ICompositionStructureNode {
|
|
24
|
-
nodes @recursive(depth: 10) {
|
|
25
|
-
name: displayName
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
... on ICompositionElementNode {
|
|
29
|
-
element {
|
|
30
|
-
...ElementData
|
|
31
|
-
}
|
|
32
|
-
}
|
|
13
|
+
`fragment CompositionData on ICompositionNode {
|
|
14
|
+
name: displayName
|
|
15
|
+
layoutType: nodeType
|
|
16
|
+
type
|
|
17
|
+
key
|
|
18
|
+
template: displayTemplateKey
|
|
19
|
+
settings: displaySettings {
|
|
20
|
+
key
|
|
21
|
+
value
|
|
22
|
+
}
|
|
23
|
+
... on ICompositionStructureNode {
|
|
24
|
+
nodes @recursive(depth: 10) {
|
|
25
|
+
name: displayName
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
... on ICompositionElementNode {
|
|
29
|
+
element {
|
|
30
|
+
...ElementData
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
33
|
}`,
|
|
34
|
-
`fragment IElementData on
|
|
35
|
-
_metadata {
|
|
36
|
-
...IContentInfo
|
|
37
|
-
}
|
|
38
|
-
_type: __typename
|
|
34
|
+
`fragment IElementData on _IElement {
|
|
35
|
+
_metadata {
|
|
36
|
+
...IContentInfo
|
|
37
|
+
}
|
|
38
|
+
_type: __typename
|
|
39
39
|
}`,
|
|
40
|
-
`fragment ElementData on
|
|
41
|
-
...IElementData
|
|
40
|
+
`fragment ElementData on _IElement {
|
|
41
|
+
...IElementData
|
|
42
42
|
}`,
|
|
43
|
-
`fragment BlockData on
|
|
44
|
-
...IContentData
|
|
43
|
+
`fragment BlockData on _IContent {
|
|
44
|
+
...IContentData
|
|
45
45
|
}`,
|
|
46
|
-
`fragment PageData on
|
|
47
|
-
...IContentData
|
|
46
|
+
`fragment PageData on _IContent {
|
|
47
|
+
...IContentData
|
|
48
48
|
}`,
|
|
49
|
-
`fragment LinkData on ContentUrl {
|
|
50
|
-
base
|
|
51
|
-
hierarchical
|
|
52
|
-
default
|
|
49
|
+
`fragment LinkData on ContentUrl {
|
|
50
|
+
base
|
|
51
|
+
hierarchical
|
|
52
|
+
default
|
|
53
53
|
}`,
|
|
54
|
-
`fragment ReferenceData on ContentReference {
|
|
55
|
-
key
|
|
56
|
-
url {
|
|
57
|
-
...LinkData
|
|
58
|
-
}
|
|
54
|
+
`fragment ReferenceData on ContentReference {
|
|
55
|
+
key
|
|
56
|
+
url {
|
|
57
|
+
...LinkData
|
|
58
|
+
}
|
|
59
59
|
}`,
|
|
60
|
-
`fragment IContentInfo on IContentMetadata {
|
|
61
|
-
key
|
|
62
|
-
locale
|
|
63
|
-
types
|
|
64
|
-
displayName
|
|
65
|
-
version
|
|
66
|
-
url {
|
|
67
|
-
...LinkData
|
|
68
|
-
}
|
|
60
|
+
`fragment IContentInfo on IContentMetadata {
|
|
61
|
+
key
|
|
62
|
+
locale
|
|
63
|
+
types
|
|
64
|
+
displayName
|
|
65
|
+
version
|
|
66
|
+
url {
|
|
67
|
+
...LinkData
|
|
68
|
+
}
|
|
69
69
|
}`,
|
|
70
|
-
`fragment IContentListItem on
|
|
71
|
-
...IContentData
|
|
70
|
+
`fragment IContentListItem on _IContent {
|
|
71
|
+
...IContentData
|
|
72
72
|
}`,
|
|
73
|
-
`fragment ExperienceData on
|
|
74
|
-
|
|
75
|
-
...
|
|
76
|
-
|
|
77
|
-
...CompositionData
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
73
|
+
`fragment ExperienceData on _IExperience {
|
|
74
|
+
composition {
|
|
75
|
+
...CompositionData
|
|
76
|
+
}
|
|
81
77
|
}`,
|
|
82
|
-
`fragment LinkItemData on Link {
|
|
83
|
-
title
|
|
84
|
-
text
|
|
85
|
-
target
|
|
86
|
-
url {
|
|
87
|
-
...LinkData
|
|
88
|
-
}
|
|
78
|
+
`fragment LinkItemData on Link {
|
|
79
|
+
title
|
|
80
|
+
text
|
|
81
|
+
target
|
|
82
|
+
url {
|
|
83
|
+
...LinkData
|
|
84
|
+
}
|
|
89
85
|
}`
|
|
90
86
|
];
|
|
91
87
|
exports.queries = [
|
|
92
|
-
`query getContentById($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
|
|
93
|
-
content:
|
|
94
|
-
where: {
|
|
95
|
-
_or: [
|
|
96
|
-
{ _metadata: { key: { eq: $key }, version: { eq: $version } } }
|
|
97
|
-
{ _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
locale: $locale
|
|
101
|
-
) {
|
|
102
|
-
total
|
|
103
|
-
items {
|
|
104
|
-
...BlockData
|
|
105
|
-
...PageData
|
|
106
|
-
}
|
|
107
|
-
}
|
|
88
|
+
`query getContentById($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
|
|
89
|
+
content: _Content(
|
|
90
|
+
where: {
|
|
91
|
+
_or: [
|
|
92
|
+
{ _metadata: { key: { eq: $key }, version: { eq: $version } } }
|
|
93
|
+
{ _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
locale: $locale
|
|
97
|
+
) {
|
|
98
|
+
total
|
|
99
|
+
items {
|
|
100
|
+
...BlockData
|
|
101
|
+
...PageData
|
|
102
|
+
}
|
|
103
|
+
}
|
|
108
104
|
}`,
|
|
109
|
-
`query getContentByPath($path: String!, $version: String, $locale: [Locales!], $domain: String) {
|
|
110
|
-
content:
|
|
111
|
-
where: {
|
|
112
|
-
_metadata: { url: { default: { eq: $path }, base: { eq: $domain } }, version: { eq: $version }}
|
|
113
|
-
}
|
|
114
|
-
locale: $locale
|
|
115
|
-
) {
|
|
116
|
-
total
|
|
117
|
-
items {
|
|
118
|
-
...PageData
|
|
119
|
-
}
|
|
120
|
-
}
|
|
105
|
+
`query getContentByPath($path: String!, $version: String, $locale: [Locales!], $domain: String) {
|
|
106
|
+
content: _Content(
|
|
107
|
+
where: {
|
|
108
|
+
_metadata: { url: { default: { eq: $path }, base: { eq: $domain } }, version: { eq: $version }}
|
|
109
|
+
}
|
|
110
|
+
locale: $locale
|
|
111
|
+
) {
|
|
112
|
+
total
|
|
113
|
+
items {
|
|
114
|
+
...PageData
|
|
115
|
+
}
|
|
116
|
+
}
|
|
121
117
|
}`,
|
|
122
|
-
`query getContentType($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
|
|
123
|
-
content:
|
|
124
|
-
where: {
|
|
125
|
-
_or: [
|
|
126
|
-
{ _metadata: { key: { eq: $key }, version: { eq: $version } } }
|
|
127
|
-
{ _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
locale: $locale
|
|
131
|
-
) {
|
|
132
|
-
total
|
|
133
|
-
items {
|
|
134
|
-
_metadata {
|
|
135
|
-
types
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
118
|
+
`query getContentType($key: String!, $version: String, $locale: [Locales!], $path: String, $domain: String) {
|
|
119
|
+
content: _Content(
|
|
120
|
+
where: {
|
|
121
|
+
_or: [
|
|
122
|
+
{ _metadata: { key: { eq: $key }, version: { eq: $version } } }
|
|
123
|
+
{ _metadata: { url: { hierarchical: { eq: $path }, base: { eq: $domain } }, version: { eq: $version } } }
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
locale: $locale
|
|
127
|
+
) {
|
|
128
|
+
total
|
|
129
|
+
items {
|
|
130
|
+
_metadata {
|
|
131
|
+
types
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
139
135
|
}`
|
|
140
136
|
];
|
|
141
137
|
exports.DefaultFunctions = ['getContentType', 'getContentByPath', 'getContentById'];
|
package/dist/documents.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,EAAC,YAAY,CAAC,CAAA;AAErE,QAAA,SAAS,GAAG;IACzB;;;;;;EAME;IACF;;;;;;;;;;;;;;;;;;;;EAoBE;IACF;;;;;EAKE;IACF;;EAEE;IACF;;EAEE;IACF;;EAEE;IACF;;;;EAIE;IACF;;;;;EAKE;IACF;;;;;;;;;EASE;IACF;;EAEE;IACF
|
|
1
|
+
{"version":3,"file":"documents.js","sourceRoot":"","sources":["../src/documents.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,aAAa,EAAC,IAAI,EAAC,QAAQ,EAAC,MAAM,EAAC,YAAY,CAAC,CAAA;AAErE,QAAA,SAAS,GAAG;IACzB;;;;;;EAME;IACF;;;;;;;;;;;;;;;;;;;;EAoBE;IACF;;;;;EAKE;IACF;;EAEE;IACF;;EAEE;IACF;;EAEE;IACF;;;;EAIE;IACF;;;;;EAKE;IACF;;;;;;;;;EASE;IACF;;EAEE;IACF;;;;EAIE;IACF;;;;;;;EAOE;CACD,CAAA;AACY,QAAA,OAAO,GAAG;IACvB;;;;;;;;;;;;;;;;EAgBE;IACF;;;;;;;;;;;;EAYE;IACF;;;;;;;;;;;;;;;;;EAiBE;CACD,CAAA;AAEY,QAAA,gBAAgB,GAAG,CAAC,gBAAgB,EAAC,kBAAkB,EAAC,gBAAgB,CAAC,CAAA"}
|
package/dist/transform.js
CHANGED
|
@@ -157,7 +157,7 @@ const transform = ({ documents: files, config, schema, pluginContext }) => {
|
|
|
157
157
|
exports.transform = transform;
|
|
158
158
|
exports.default = { transform: exports.transform };
|
|
159
159
|
// The recursive sections to add
|
|
160
|
-
const recursiveSelections = (0, graphql_1.parse)(`fragment IContentListItem on
|
|
161
|
-
...IContentData
|
|
160
|
+
const recursiveSelections = (0, graphql_1.parse)(`fragment IContentListItem on _IContent {
|
|
161
|
+
...IContentData
|
|
162
162
|
}`).definitions[0]?.selectionSet.selections || [];
|
|
163
163
|
//# sourceMappingURL=transform.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remkoj/optimizely-graph-functions",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.0.0-
|
|
4
|
+
"version": "2.0.0-pre5",
|
|
5
5
|
"packageManager": "yarn@4.1.1",
|
|
6
6
|
"repository": "https://github.com/remkoj/optimizely-dxp-clients.git",
|
|
7
7
|
"author": "Remko Jantzen <693172+remkoj@users.noreply.github.com>",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/node": "^20.
|
|
38
|
+
"@types/node": "^20.14.2",
|
|
39
39
|
"graphql": "^16.8.1",
|
|
40
40
|
"graphql-request": "^6.1.0",
|
|
41
41
|
"graphql-tag": "^2.12.6",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@graphql-codegen/typescript": "^4.0.7",
|
|
49
49
|
"@graphql-codegen/typescript-graphql-request": "^6.2.0",
|
|
50
50
|
"@graphql-codegen/typescript-operations": "^4.2.1",
|
|
51
|
-
"tslib": "^2.6.
|
|
51
|
+
"tslib": "^2.6.3"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"clean": "tsc --clean",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"graphql-tag": "*"
|
|
64
64
|
},
|
|
65
65
|
"optionalDependencies": {
|
|
66
|
-
"@remkoj/optimizely-graph-client": "2.0.0-
|
|
66
|
+
"@remkoj/optimizely-graph-client": "2.0.0-pre5"
|
|
67
67
|
},
|
|
68
68
|
"stableVersion": "1.0.4"
|
|
69
69
|
}
|