@remkoj/optimizely-graph-functions 6.0.0-pre9 → 6.0.0-rc.3

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.
Files changed (55) hide show
  1. package/AGENTS.md +105 -0
  2. package/README.md +60 -14
  3. package/dist/_transform/handleDependDirective.d.ts +11 -0
  4. package/dist/_transform/handleDependDirective.js +128 -0
  5. package/dist/_transform/handleDependDirective.js.map +1 -0
  6. package/dist/_transform/injectComponentDocuments.d.ts +3 -0
  7. package/dist/_transform/injectComponentDocuments.js +78 -24
  8. package/dist/_transform/injectComponentDocuments.js.map +1 -1
  9. package/dist/_transform/injectPageQueries.d.ts +1 -0
  10. package/dist/_transform/injectPageQueries.js +40 -7
  11. package/dist/_transform/injectPageQueries.js.map +1 -1
  12. package/dist/_transform/injectSectionQueries.d.ts +1 -0
  13. package/dist/_transform/injectSectionQueries.js +64 -17
  14. package/dist/_transform/injectSectionQueries.js.map +1 -1
  15. package/dist/_transform/normalizeFragmentNames.js +2 -0
  16. package/dist/_transform/normalizeFragmentNames.js.map +1 -1
  17. package/dist/_transform/performInjections.js +2 -35
  18. package/dist/_transform/performInjections.js.map +1 -1
  19. package/dist/cms/index.d.ts +4 -10
  20. package/dist/cms/index.js +64 -29
  21. package/dist/cms/index.js.map +1 -1
  22. package/dist/contenttype-loader.d.ts +1 -48
  23. package/dist/contenttype-loader.js +21 -286
  24. package/dist/contenttype-loader.js.map +1 -1
  25. package/dist/document-ast-plugin.d.ts +1 -1
  26. package/dist/document-ast-plugin.js +1 -1
  27. package/dist/document-ast-plugin.js.map +1 -1
  28. package/dist/documents/fragments.cms12.js.map +1 -1
  29. package/dist/documents/fragments.cms13.js +77 -13
  30. package/dist/documents/fragments.cms13.js.map +1 -1
  31. package/dist/documents/queries.cms13.js +4 -4
  32. package/dist/generator/collision-tracker.d.ts +22 -0
  33. package/dist/generator/collision-tracker.js +104 -0
  34. package/dist/generator/collision-tracker.js.map +1 -0
  35. package/dist/generator/generator.d.ts +77 -0
  36. package/dist/generator/generator.js +277 -0
  37. package/dist/generator/generator.js.map +1 -0
  38. package/dist/generator/index.d.ts +3 -0
  39. package/dist/generator/index.js +42 -0
  40. package/dist/generator/index.js.map +1 -0
  41. package/dist/generator/virtual-location.d.ts +41 -0
  42. package/dist/generator/virtual-location.js +139 -0
  43. package/dist/generator/virtual-location.js.map +1 -0
  44. package/dist/index.js +4 -1
  45. package/dist/index.js.map +1 -1
  46. package/dist/patch.js.map +1 -1
  47. package/dist/preset.js +103 -38
  48. package/dist/preset.js.map +1 -1
  49. package/dist/transform.d.ts +4 -3
  50. package/dist/transform.js +8 -1
  51. package/dist/transform.js.map +1 -1
  52. package/dist/utils.d.ts +1 -1
  53. package/dist/utils.js +13 -3
  54. package/dist/utils.js.map +1 -1
  55. package/package.json +31 -21
@@ -0,0 +1,77 @@
1
+ import { type IntegrationApi } from '@remkoj/optimizely-cms-api';
2
+ /**
3
+ * Generate GraphQL fragments and queries for Optimizely Graph,
4
+ * based upon the content type definitions within an Optimizely
5
+ * CMS instance.
6
+ */
7
+ export declare class DocumentGenerator {
8
+ protected _allContentTypes: Map<string, IntegrationApi.ContentType>;
9
+ constructor(allContentTypes?: Map<string, IntegrationApi.ContentType>);
10
+ /**
11
+ * Get the Graph Type for the Content Type, this imitates the logic
12
+ * within Optimizely CMS to transform a ContentType key into a type
13
+ * within Optimizely Graph.
14
+ *
15
+ * @param contentType
16
+ * @returns
17
+ */
18
+ getGraphType(contentType: IntegrationApi.ContentType | string): string;
19
+ /**
20
+ * Get the Graph Type for the Content Type, when it's used as a property,
21
+ * this imitates the logic within Optimizely CMS to transform a ContentType
22
+ * key into a type within Optimizely Graph.
23
+ *
24
+ * @param contentType
25
+ * @returns
26
+ */
27
+ getGraphPropertyType(contentType: IntegrationApi.ContentType | string): string;
28
+ /**
29
+ * Retrieve the default name for the data query for the given content type
30
+ *
31
+ * @param contentType
32
+ * @returns
33
+ */
34
+ getDefaultQueryName(contentType: IntegrationApi.ContentType | string): string;
35
+ /**
36
+ * Retrieve the default name for the data fragment for the given content type
37
+ *
38
+ * @param contentType
39
+ * @returns
40
+ */
41
+ getDefaultFragmentName(contentType: IntegrationApi.ContentType | string): string;
42
+ /**
43
+ * Retrieve the default name for the fragment when the content type is used as
44
+ * property
45
+ *
46
+ * @param contentType
47
+ * @returns
48
+ */
49
+ getDefaultPropertyFragmentName(contentType: IntegrationApi.ContentType | string): string;
50
+ private getSlugFromKey;
51
+ /**
52
+ * Build the GraphQL fragment that is used as injection target
53
+ *
54
+ * @param injectionTarget
55
+ * @returns
56
+ */
57
+ buildInjectionTarget(injectionTarget: string): string;
58
+ /**
59
+ * Build a query to retrieve the data for a specific content type by identifier
60
+ *
61
+ * @param contentType
62
+ * @param queryName
63
+ * @param propertyTracker
64
+ * @returns
65
+ */
66
+ buildGetQuery(contentType: IntegrationApi.ContentType, queryName?: string | ((defaultName: string) => string), propertyTracker?: Map<string, string>): string;
67
+ buildFragment(contentType: IntegrationApi.ContentType, fragmentName?: string | ((defaultName: string) => string), forProperty?: boolean, propertyTracker?: Map<string, string>): string;
68
+ /**
69
+ * Retrieve a list of component keys that are referenced as property by this type
70
+ *
71
+ * @param contentType
72
+ * @returns
73
+ */
74
+ static getReferencedPropertyComponents(contentType: IntegrationApi.ContentType): string[];
75
+ protected buildProperty(propertyName: string, propertyConfig?: IntegrationApi.ContentTypeProperty, propertyTracker?: Map<string, string>): string | null;
76
+ protected getTypeKeysFor(contentTypeRestriction: string): string | string[];
77
+ }
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocumentGenerator = void 0;
4
+ const tools_1 = require("../tools");
5
+ /**
6
+ * Generate GraphQL fragments and queries for Optimizely Graph,
7
+ * based upon the content type definitions within an Optimizely
8
+ * CMS instance.
9
+ */
10
+ class DocumentGenerator {
11
+ _allContentTypes;
12
+ constructor(allContentTypes) {
13
+ this._allContentTypes = allContentTypes ?? new Map();
14
+ }
15
+ /**
16
+ * Get the Graph Type for the Content Type, this imitates the logic
17
+ * within Optimizely CMS to transform a ContentType key into a type
18
+ * within Optimizely Graph.
19
+ *
20
+ * @param contentType
21
+ * @returns
22
+ */
23
+ getGraphType(contentType) {
24
+ const itemKey = ((0, tools_1.isNonEmptyString)(contentType) ? contentType : contentType?.key) ?? "_IContent";
25
+ return itemKey;
26
+ }
27
+ /**
28
+ * Get the Graph Type for the Content Type, when it's used as a property,
29
+ * this imitates the logic within Optimizely CMS to transform a ContentType
30
+ * key into a type within Optimizely Graph.
31
+ *
32
+ * @param contentType
33
+ * @returns
34
+ */
35
+ getGraphPropertyType(contentType) {
36
+ return this.getGraphType(contentType) + "Property";
37
+ }
38
+ /**
39
+ * Retrieve the default name for the data query for the given content type
40
+ *
41
+ * @param contentType
42
+ * @returns
43
+ */
44
+ getDefaultQueryName(contentType) {
45
+ const graphType = this.getGraphType(contentType);
46
+ return `get${this.getSlugFromKey(graphType)}Data`;
47
+ }
48
+ /**
49
+ * Retrieve the default name for the data fragment for the given content type
50
+ *
51
+ * @param contentType
52
+ * @returns
53
+ */
54
+ getDefaultFragmentName(contentType) {
55
+ const graphType = this.getGraphType(contentType);
56
+ return this.getSlugFromKey(graphType) + "Data";
57
+ }
58
+ /**
59
+ * Retrieve the default name for the fragment when the content type is used as
60
+ * property
61
+ *
62
+ * @param contentType
63
+ * @returns
64
+ */
65
+ getDefaultPropertyFragmentName(contentType) {
66
+ const graphPropertyType = this.getGraphPropertyType(contentType);
67
+ return this.getSlugFromKey(graphPropertyType) + "Data";
68
+ }
69
+ getSlugFromKey(key) {
70
+ let newKey = key.startsWith('_') ? (0, tools_1.ucFirst)(key.substring(1)) : key;
71
+ if (newKey.includes(":"))
72
+ newKey = newKey.split(":").map(x => (0, tools_1.ucFirst)(x)).join("");
73
+ return newKey;
74
+ }
75
+ /**
76
+ * Build the GraphQL fragment that is used as injection target
77
+ *
78
+ * @param injectionTarget
79
+ * @returns
80
+ */
81
+ buildInjectionTarget(injectionTarget) {
82
+ return `fragment ${injectionTarget} on _IContent { ...IContentData }`;
83
+ }
84
+ /**
85
+ * Build a query to retrieve the data for a specific content type by identifier
86
+ *
87
+ * @param contentType
88
+ * @param queryName
89
+ * @param propertyTracker
90
+ * @returns
91
+ */
92
+ buildGetQuery(contentType, queryName, propertyTracker = new Map()) {
93
+ // Prepare
94
+ if (!contentType.key || contentType.source === 'graph')
95
+ return '';
96
+ const graphType = this.getGraphType(contentType);
97
+ const renderedQueryName = (0, tools_1.isNonEmptyString)(queryName) ? queryName :
98
+ (typeof queryName === 'function' ?
99
+ queryName(this.getDefaultQueryName(contentType)) :
100
+ this.getDefaultQueryName(contentType));
101
+ // Render properties
102
+ const properties = [];
103
+ for (const propName of Object.getOwnPropertyNames(contentType.properties ?? {}))
104
+ properties.push(this.buildProperty(propName, (contentType.properties || {})[propName], propertyTracker));
105
+ // Inject base type based defaults
106
+ if (contentType.baseType === "_experience")
107
+ properties.unshift("...ExperienceData");
108
+ if (contentType.baseType === "_section")
109
+ properties.unshift("...SectionCompositionData");
110
+ //Render query
111
+ const query = `query ${renderedQueryName}($key: [String!]!, $locale: [Locales], $changeset: String, $variation: VariationInput, $version: String) {
112
+ data: ${graphType}(
113
+ ids: $key
114
+ locale: $locale
115
+ variation: $variation
116
+ where: { _metadata: { changeset: { eq: $changeset }, version: { eq: $version } } }
117
+ ) {
118
+ total
119
+ item {
120
+ _metadata {
121
+ key
122
+ version
123
+ locale
124
+ changeset
125
+ variation
126
+ }
127
+ ${properties.filter(tools_1.isNonEmptyString).join("\n ")}
128
+ }
129
+ }
130
+ }`;
131
+ return query;
132
+ }
133
+ buildFragment(contentType, fragmentName, forProperty = false, propertyTracker = new Map()) {
134
+ if (!contentType.key)
135
+ return '';
136
+ const graphType = forProperty ? this.getGraphPropertyType(contentType) : this.getGraphType(contentType);
137
+ const defaultFragmentName = forProperty ? this.getDefaultPropertyFragmentName(contentType) : this.getDefaultFragmentName(contentType);
138
+ const graphFragmentName = (0, tools_1.isNonEmptyString)(fragmentName) ?
139
+ fragmentName : (typeof fragmentName === 'function' ? fragmentName(defaultFragmentName) : defaultFragmentName);
140
+ // Inject all properties
141
+ const properties = [];
142
+ for (const propName of Object.getOwnPropertyNames(contentType.properties ?? {}))
143
+ properties.push(this.buildProperty(propName, (contentType.properties || {})[propName], propertyTracker));
144
+ // Inject base type based defaults
145
+ if (contentType.baseType === "_experience")
146
+ properties.push("...ExperienceData");
147
+ // Ensure that there's at least one property
148
+ if (properties.filter(tools_1.isNonEmptyString).length === 0)
149
+ properties.unshift("__typename");
150
+ // Construct fragment rawSDL
151
+ return `fragment ${graphFragmentName} on ${graphType} {
152
+ ${properties.filter(tools_1.isNonEmptyString).join("\n ")}
153
+ }`;
154
+ }
155
+ /**
156
+ * Retrieve a list of component keys that are referenced as property by this type
157
+ *
158
+ * @param contentType
159
+ * @returns
160
+ */
161
+ static getReferencedPropertyComponents(contentType) {
162
+ const properties = contentType.properties;
163
+ if (!properties)
164
+ return [];
165
+ return Object.getOwnPropertyNames(properties).reduce((referencedTypes, propertyKey) => {
166
+ if (properties[propertyKey].type == "component" && properties[propertyKey].contentType) {
167
+ referencedTypes.push(properties[propertyKey]?.contentType);
168
+ }
169
+ if (properties[propertyKey].type == "array" && properties[propertyKey].items?.type == "component" && properties[propertyKey].items?.contentType) {
170
+ referencedTypes.push(properties[propertyKey]?.items?.contentType);
171
+ }
172
+ return referencedTypes;
173
+ }, []);
174
+ }
175
+ buildProperty(propertyName, propertyConfig, propertyTracker = new Map()) {
176
+ // Skip all disabled properties
177
+ if (propertyConfig?.indexingType === "disabled")
178
+ return null;
179
+ // Get type information rendering
180
+ const propertyFormat = propertyConfig?.format;
181
+ const propertyItemConfig = propertyConfig?.type === 'array' ? propertyConfig?.items ?? propertyConfig : propertyConfig;
182
+ const propertyType = propertyItemConfig?.type ?? 'any';
183
+ // Skip properties with unsupported formatting
184
+ if (['categorization'].includes(propertyFormat ?? ''))
185
+ return null;
186
+ // Ensure we don't have property naming collisions
187
+ let outputPropertyName = propertyName;
188
+ if (propertyTracker.has(propertyName)) {
189
+ if (propertyTracker.get(propertyName) != propertyType) {
190
+ outputPropertyName = `${propertyName}${(0, tools_1.ucFirst)(propertyType)}: ${propertyName}`;
191
+ propertyTracker.set(`${propertyName}${(0, tools_1.ucFirst)(propertyType)}`, propertyType);
192
+ }
193
+ }
194
+ else {
195
+ propertyTracker.set(propertyName, propertyType);
196
+ }
197
+ // Render property
198
+ switch (propertyType) {
199
+ case 'url':
200
+ return outputPropertyName + " { type base default }";
201
+ case 'content': {
202
+ // Resolve allowed/restricted
203
+ const allowedTypes = (propertyItemConfig?.allowedTypes ?? []);
204
+ const restrictedTypes = (propertyItemConfig?.restrictedTypes ?? []);
205
+ const pickFrom = allowedTypes.flatMap(tn => this.getTypeKeysFor(tn));
206
+ const restrictBy = restrictedTypes.flatMap(tn => this.getTypeKeysFor(tn));
207
+ // Prepare data
208
+ const allowAny = pickFrom.length == 0 && restrictBy.length == 0;
209
+ const spreads = new Set();
210
+ spreads.add('IContentData');
211
+ if (allowAny) {
212
+ ['BlockData', 'ComponentData'].forEach(x => spreads.add(x));
213
+ }
214
+ else {
215
+ const base = pickFrom.length > 0 ? pickFrom : Array.from(this._allContentTypes.keys());
216
+ const filtered = base.filter(x => !restrictBy.includes(x));
217
+ filtered.forEach(typeName => spreads.add(this.getDefaultFragmentName(typeName)));
218
+ }
219
+ return `${outputPropertyName} {\n ${Array.from(spreads).map(spread => `...${spread}`).join('\n ')} \n}`;
220
+ }
221
+ case 'richText':
222
+ return outputPropertyName + " { json }";
223
+ case 'component': {
224
+ const dataType = propertyItemConfig?.contentType;
225
+ if (!dataType)
226
+ return null; // Skip this property if the contentType isn't set
227
+ return outputPropertyName + ` { ...${dataType}PropertyData }`;
228
+ }
229
+ case 'link':
230
+ return outputPropertyName + ` {
231
+ title
232
+ text
233
+ target
234
+ url {
235
+ type
236
+ base
237
+ default
238
+ }
239
+ }`;
240
+ case 'contentReference': {
241
+ return outputPropertyName + ` {
242
+ key
243
+ url {
244
+ type
245
+ base
246
+ default
247
+ }
248
+ item @depend(on: "ContentReference.item") {
249
+ __typename
250
+ ...CmpImageAssetInfo
251
+ ...CmpVideoAssetInfo
252
+ }
253
+ }`;
254
+ }
255
+ default:
256
+ return outputPropertyName;
257
+ }
258
+ }
259
+ getTypeKeysFor(contentTypeRestriction) {
260
+ if (this._allContentTypes.size === 0)
261
+ return contentTypeRestriction;
262
+ const allTypes = [];
263
+ // Add type if it exists
264
+ if (this._allContentTypes.has(contentTypeRestriction))
265
+ allTypes.push(contentTypeRestriction);
266
+ // Add children
267
+ this._allContentTypes.forEach((contentType, contentTypeKey) => {
268
+ if (contentType.baseType === contentTypeRestriction) {
269
+ const baseRestrictions = this.getTypeKeysFor(contentTypeKey);
270
+ allTypes.push(...baseRestrictions);
271
+ }
272
+ });
273
+ return allTypes;
274
+ }
275
+ }
276
+ exports.DocumentGenerator = DocumentGenerator;
277
+ //# sourceMappingURL=generator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/generator/generator.ts"],"names":[],"mappings":";;;AACA,oCAAoD;AAEpD;;;;GAIG;AACH,MAAa,iBAAiB;IAElB,gBAAgB,CAA0C;IAEpE,YAAmB,eAAyD;QAE1E,IAAI,CAAC,gBAAgB,GAAG,eAAe,IAAI,IAAI,GAAG,EAAE,CAAA;IACtD,CAAC;IAED;;;;;;;OAOG;IACI,YAAY,CAAC,WAAgD;QAClE,MAAM,OAAO,GAAG,CAAC,IAAA,wBAAgB,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,IAAI,WAAW,CAAA;QAC/F,OAAO,OAAO,CAAC;IACjB,CAAC;IAED;;;;;;;OAOG;IACI,oBAAoB,CAAC,WAAgD;QAC1E,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,CAAC,GAAG,UAAU,CAAA;IACp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kDAAkD;gBAChE,OAAO,kBAAkB,GAAG,UAAU,QAAQ,gBAAgB,CAAA;YAChE,CAAC;YACD,KAAK,MAAM;gBACT,OAAO,kBAAkB,GAAG;;;;;;;;;MAS9B,CAAC;YACD,KAAK,kBAAkB,CAAC,CAAC,CAAC;gBACxB,OAAO,kBAAkB,GAAG;;;;;;;;;;;;MAY9B,CAAA;YACA,CAAC;YACD;gBACE,OAAO,kBAAkB,CAAA;QAC7B,CAAC;IACH,CAAC;IAES,cAAc,CAAC,sBAA8B;QACrD,IAAI,IAAI,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC;YAClC,OAAO,sBAAsB,CAAC;QAEhC,MAAM,QAAQ,GAAa,EAAE,CAAC;QAE9B,wBAAwB;QACxB,IAAI,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,sBAAsB,CAAC;YACnD,QAAQ,CAAC,IAAI,CAAC,sBAAsB,CAAC,CAAA;QAEvC,eAAe;QACf,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAE,WAAW,EAAE,cAAc,EAAG,EAAE;YAC9D,IAAI,WAAW,CAAC,QAAQ,KAAK,sBAAsB,EAAE,CAAC;gBACpD,MAAM,gBAAgB,GAAG,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,CAAA;gBAC5D,QAAQ,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,CAAA;YACpC,CAAC;QACH,CAAC,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAvSD,8CAuSC"}
@@ -0,0 +1,3 @@
1
+ export { PropertyCollisionTracker } from './collision-tracker';
2
+ export { DocumentGenerator } from './generator';
3
+ export * as VirtualLocation from './virtual-location';
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.VirtualLocation = exports.DocumentGenerator = exports.PropertyCollisionTracker = void 0;
37
+ var collision_tracker_1 = require("./collision-tracker");
38
+ Object.defineProperty(exports, "PropertyCollisionTracker", { enumerable: true, get: function () { return collision_tracker_1.PropertyCollisionTracker; } });
39
+ var generator_1 = require("./generator");
40
+ Object.defineProperty(exports, "DocumentGenerator", { enumerable: true, get: function () { return generator_1.DocumentGenerator; } });
41
+ exports.VirtualLocation = __importStar(require("./virtual-location"));
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/generator/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yDAA8D;AAArD,6HAAA,wBAAwB,OAAA;AACjC,yCAA+C;AAAtC,8GAAA,iBAAiB,OAAA;AAC1B,sEAAqD"}
@@ -0,0 +1,41 @@
1
+ import type { IntegrationApi } from "@remkoj/optimizely-cms-api";
2
+ export type VirtualLocationOptions = {
3
+ forProperty: boolean;
4
+ type: 'fragment' | 'query' | 'target';
5
+ };
6
+ export type VirtualLocationData = {
7
+ contentTypeBase: string;
8
+ contentTypeKey: string;
9
+ injectionTargets: Array<string>;
10
+ } & VirtualLocationOptions;
11
+ /**
12
+ * The list of injection targets where fragments may be injected within the
13
+ * default queries.
14
+ */
15
+ export declare enum ContentTypeTarget {
16
+ 'SectionData' = "SectionData",
17
+ 'PageData' = "PageData",
18
+ 'MediaData' = "MediaData",
19
+ 'ComponentData' = "ComponentData",
20
+ 'ElementData' = "ElementData",
21
+ 'SectionElementData' = "SectionElementData",
22
+ 'FormElementData' = "FormElementData",
23
+ 'BlockData' = "BlockData"
24
+ }
25
+ /**
26
+ * Get a list of names of all supported injection targets, where fragments may be
27
+ * injected within the default queries.
28
+ *
29
+ * @returns The list of names
30
+ */
31
+ export declare function getInjectionTargets(): string[];
32
+ /**
33
+ * Take an `opti-cms:/` virtual path and parse it to get the configuraiton of
34
+ * the fragment/query to be generated.
35
+ *
36
+ * @param virtualPath The virtual path
37
+ * @returns The fragment/query configuration
38
+ */
39
+ export declare function parse(virtualPath: string): VirtualLocationData | undefined;
40
+ export declare function build(injectionFragment: string): string;
41
+ export declare function build(contentType: IntegrationApi.ContentType, options?: Partial<VirtualLocationOptions>): string | undefined;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ContentTypeTarget = void 0;
4
+ exports.getInjectionTargets = getInjectionTargets;
5
+ exports.parse = parse;
6
+ exports.build = build;
7
+ const tools_1 = require("../tools");
8
+ const DefaultVirtualLocationOptions = { forProperty: false, type: 'fragment' };
9
+ /**
10
+ * The list of injection targets where fragments may be injected within the
11
+ * default queries.
12
+ */
13
+ var ContentTypeTarget;
14
+ (function (ContentTypeTarget) {
15
+ ContentTypeTarget["SectionData"] = "SectionData";
16
+ ContentTypeTarget["PageData"] = "PageData";
17
+ ContentTypeTarget["MediaData"] = "MediaData";
18
+ ContentTypeTarget["ComponentData"] = "ComponentData";
19
+ ContentTypeTarget["ElementData"] = "ElementData";
20
+ ContentTypeTarget["SectionElementData"] = "SectionElementData";
21
+ ContentTypeTarget["FormElementData"] = "FormElementData";
22
+ ContentTypeTarget["BlockData"] = "BlockData";
23
+ })(ContentTypeTarget || (exports.ContentTypeTarget = ContentTypeTarget = {}));
24
+ /**
25
+ * Get a list of names of all supported injection targets, where fragments may be
26
+ * injected within the default queries.
27
+ *
28
+ * @returns The list of names
29
+ */
30
+ function getInjectionTargets() {
31
+ return Object.getOwnPropertyNames(ContentTypeTarget);
32
+ }
33
+ /**
34
+ * Take an `opti-cms:/` virtual path and parse it to get the configuraiton of
35
+ * the fragment/query to be generated.
36
+ *
37
+ * @param virtualPath The virtual path
38
+ * @returns The fragment/query configuration
39
+ */
40
+ function parse(virtualPath) {
41
+ if (!virtualPath.startsWith('opti-cms:/'))
42
+ return undefined;
43
+ const virtualURL = new URL(virtualPath);
44
+ const [basePath, baseType, ctKey, ...targets] = virtualURL.pathname.split('/').filter(tools_1.isNonEmptyString);
45
+ // Validate the basepath
46
+ if (!['contenttypes', 'contentquery', 'injectiontarget'].includes(basePath))
47
+ return undefined;
48
+ if (basePath === 'injectiontarget') {
49
+ return {
50
+ type: 'target',
51
+ contentTypeBase: '',
52
+ contentTypeKey: baseType,
53
+ forProperty: false,
54
+ injectionTargets: []
55
+ };
56
+ }
57
+ const type = basePath == "contenttypes" ? 'fragment' : 'query';
58
+ const forProperty = baseType.endsWith('.property');
59
+ const contentTypeBase = parseBaseType(forProperty ? baseType.substring(0, baseType.length - 9) : baseType);
60
+ const contentTypeKey = ctKey;
61
+ const injectionTargets = targets;
62
+ return { type, contentTypeBase, contentTypeKey, injectionTargets, forProperty };
63
+ }
64
+ function build(contentType, options) {
65
+ if (typeof (contentType) === 'string')
66
+ return `opti-cms:/injectiontarget/${contentType}`;
67
+ const { forProperty, type } = { ...DefaultVirtualLocationOptions, ...options };
68
+ const basePath = type == 'fragment' ? 'contenttypes' : 'contentquery';
69
+ const ctKey = contentType.key;
70
+ if (!ctKey || contentType.source === 'graph' || ctKey === 'SysContentFolder' || isContract(contentType))
71
+ return undefined;
72
+ const baseType = extractBaseType(contentType);
73
+ return forProperty ?
74
+ `opti-cms:/${basePath}/${baseType}.property/${ctKey}` :
75
+ `opti-cms:/${basePath}/${baseType}/${ctKey}/${getContentTypeTargets(contentType).join('/')}`;
76
+ }
77
+ function hasContractInfo(toTest) {
78
+ if (typeof (toTest) !== 'object' || toTest === null)
79
+ return false;
80
+ return typeof (toTest.isContract) === 'boolean';
81
+ }
82
+ function isContract(contentType) {
83
+ return hasContractInfo(contentType) ? contentType.isContract : false;
84
+ }
85
+ function parseBaseType(storedBaseType) {
86
+ switch (storedBaseType.toLowerCase()) {
87
+ case 'section':
88
+ case 'media':
89
+ case 'component':
90
+ case 'experience':
91
+ case 'page':
92
+ case 'image':
93
+ case 'video':
94
+ return '_' + storedBaseType;
95
+ default:
96
+ return storedBaseType;
97
+ }
98
+ }
99
+ function extractBaseType(contentType, fallback = 'cms') {
100
+ return (contentType.baseType ?? fallback).replace(/^_+/, '');
101
+ }
102
+ function getContentTypeTargets(contentType) {
103
+ if (!contentType.key || contentType.key.startsWith('graph:'))
104
+ return [];
105
+ const injections = [];
106
+ const baseType = extractBaseType(contentType);
107
+ switch (baseType) {
108
+ case 'section':
109
+ injections.push(ContentTypeTarget.SectionData);
110
+ break;
111
+ case 'page':
112
+ case 'experience':
113
+ injections.push(ContentTypeTarget.PageData);
114
+ break;
115
+ case 'media':
116
+ case 'video':
117
+ case 'image':
118
+ injections.push(ContentTypeTarget.MediaData);
119
+ break;
120
+ case 'component': {
121
+ const usage = contentType.compositionBehaviors ?? [];
122
+ const source = contentType.source;
123
+ if (!(source === '_server' && usage.length === 1 && usage[0] === 'formsElementEnabled'))
124
+ injections.push(ContentTypeTarget.ComponentData);
125
+ if (usage.includes('elementEnabled'))
126
+ injections.push(ContentTypeTarget.ElementData);
127
+ if (usage.includes('sectionEnabled'))
128
+ injections.push(ContentTypeTarget.SectionElementData);
129
+ if (usage.includes('formsElementEnabled'))
130
+ injections.push(ContentTypeTarget.FormElementData);
131
+ break;
132
+ }
133
+ default:
134
+ injections.push(ContentTypeTarget.BlockData);
135
+ break;
136
+ }
137
+ return injections;
138
+ }
139
+ //# sourceMappingURL=virtual-location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtual-location.js","sourceRoot":"","sources":["../../src/generator/virtual-location.ts"],"names":[],"mappings":";;;AA4BA,kDAEC;AASD,sBA0BC;AAID,sBAaC;AAjFD,oCAA2C;AAI3C,MAAM,6BAA6B,GAA2B,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAA;AAEtG;;;GAGG;AACH,IAAY,iBASX;AATD,WAAY,iBAAiB;IAC3B,gDAA6B,CAAA;IAC7B,0CAAuB,CAAA;IACvB,4CAAyB,CAAA;IACzB,oDAAiC,CAAA;IACjC,gDAA6B,CAAA;IAC7B,8DAA2C,CAAA;IAC3C,wDAAqC,CAAA;IACrC,4CAAyB,CAAA;AAC3B,CAAC,EATW,iBAAiB,iCAAjB,iBAAiB,QAS5B;AAED;;;;;GAKG;AACH,SAAgB,mBAAmB;IACjC,OAAO,MAAM,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AACtD,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,KAAK,CAAC,WAAmB;IACvC,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,YAAY,CAAC;QACvC,OAAO,SAAS,CAAA;IAClB,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,WAAW,CAAC,CAAA;IACvC,MAAM,CAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC,GAAG,UAAU,CAA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,gBAAgB,CAAC;gBAAE,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,CAAA;YAC3F,IAAI,KAAK,CAAC,QAAQ,CAAC,qBAAqB,CAAC;gBAAE,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC,CAAA;YAE7F,MAAM;QACR,CAAC;QACD;YACE,UAAU,CAAC,IAAI,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAA;YAC5C,MAAM;IACV,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC"}
package/dist/index.js CHANGED
@@ -45,7 +45,8 @@ const plugin = async (schema, documents, config, info) => {
45
45
  // Read the functions to fully build & extend
46
46
  const functions = config.functions || [];
47
47
  if (functions.length == 0)
48
- return "// NO FUNCTIONS TO BE EXPORTED";
48
+ return `// NO FUNCTIONS TO BE EXPORTED
49
+ export const EXPORTED_FUNCTIONS = 0;`;
49
50
  // Output the functions
50
51
  const docs = (0, graphql_1.concatAST)(documents.map(x => x.document).filter(utils_1.isNotNullOrUndefined));
51
52
  const output = functions.map(fn => {
@@ -76,6 +77,8 @@ const plugin = async (schema, documents, config, info) => {
76
77
  prepend.push(`import type * as Types from './graphql'`);
77
78
  prepend.push("\n");
78
79
  append.push("\n");
80
+ append.push(`export const EXPORTED_FUNCTIONS = ${functions.length};`);
81
+ append.push("\n");
79
82
  return { prepend, content: output.join("\n"), append };
80
83
  };
81
84
  exports.plugin = plugin;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AASA,8CAOC;AAfD,qCAA0J;AAC1J,mCAA8C;AAKjC,QAAA,gBAAgB,GAAG,CAAC,gBAAgB,EAAE,kBAAkB,EAAE,gBAAgB,CAAC,CAAA;AAExF,SAAgB,iBAAiB,CAAC,OAA4B;IAC5D,OAAO;QACL,GAAG,CAAC,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;QACzB,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