@anywayseo/gatsby-plugin 2.8.1 → 2.10.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/gatsby-node.js +1 -0
- package/package.json +1 -1
- package/utils/create-pages/index.d.ts +2 -1
- package/utils/create-pages/index.js +5 -3
- package/utils/create-pages/mdx/types.d.ts +3 -15
- package/utils/create-pages/strapi-article/index.d.ts +2 -0
- package/utils/create-pages/strapi-article/index.js +78 -0
- package/utils/create-pages/strapi-article/types.d.ts +7 -0
- package/utils/create-pages/strapi-page/types.d.ts +7 -0
- package/utils/create-pages/strapi-page/types.js +2 -0
- package/utils/create-pages/types.d.ts +22 -0
- package/utils/create-pages/types.js +2 -0
- package/utils/strapi-source/schema/collections/article.d.ts +1 -0
- package/utils/strapi-source/schema/collections/article.js +21 -0
- package/utils/strapi-source/schema/components/content.d.ts +1 -1
- package/utils/strapi-source/schema/components/content.js +16 -0
- package/utils/strapi-source/schema/index.js +2 -0
- package/utils/strapi-source/strapi-content/index.js +125 -1
- package/utils/create-pages/strapi/types.d.ts +0 -16
- /package/utils/create-pages/{strapi → strapi-article}/types.js +0 -0
- /package/utils/create-pages/{strapi → strapi-page}/index.d.ts +0 -0
- /package/utils/create-pages/{strapi → strapi-page}/index.js +0 -0
package/gatsby-node.js
CHANGED
|
@@ -63,6 +63,7 @@ function createPages(args) {
|
|
|
63
63
|
reporter.warn('Local source mode enabled. Skipping Strapi page creation.');
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
|
+
yield (0, create_pages_1.createStrapiArticles)(args, root);
|
|
66
67
|
yield (0, create_pages_1.createStrapiPages)(args, root);
|
|
67
68
|
}
|
|
68
69
|
yield (0, create_pages_1.createMdxPages)(args, root);
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createStrapiPages = exports.createRedirectPage = exports.createMdxPages = void 0;
|
|
3
|
+
exports.createStrapiPages = exports.createStrapiArticles = exports.createRedirectPage = exports.createMdxPages = void 0;
|
|
4
4
|
var mdx_1 = require("./mdx");
|
|
5
5
|
Object.defineProperty(exports, "createMdxPages", { enumerable: true, get: function () { return mdx_1.createMdxPages; } });
|
|
6
6
|
var redirect_1 = require("./redirect");
|
|
7
7
|
Object.defineProperty(exports, "createRedirectPage", { enumerable: true, get: function () { return redirect_1.createRedirectPage; } });
|
|
8
|
-
var
|
|
9
|
-
Object.defineProperty(exports, "
|
|
8
|
+
var strapi_article_1 = require("./strapi-article");
|
|
9
|
+
Object.defineProperty(exports, "createStrapiArticles", { enumerable: true, get: function () { return strapi_article_1.createStrapiArticles; } });
|
|
10
|
+
var strapi_page_1 = require("./strapi-page");
|
|
11
|
+
Object.defineProperty(exports, "createStrapiPages", { enumerable: true, get: function () { return strapi_page_1.createStrapiPages; } });
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
+
import type { IMdxPage, IStrapiPage } from '../types';
|
|
1
2
|
export interface IGetAllMdxPageQuery {
|
|
2
3
|
allMdx?: {
|
|
3
|
-
nodes:
|
|
4
|
-
frontmatter: {
|
|
5
|
-
slug: string;
|
|
6
|
-
title: string;
|
|
7
|
-
};
|
|
8
|
-
internal: {
|
|
9
|
-
contentFilePath: string;
|
|
10
|
-
};
|
|
11
|
-
}[];
|
|
4
|
+
nodes: IMdxPage[];
|
|
12
5
|
};
|
|
13
6
|
allStrapiPage?: {
|
|
14
|
-
nodes:
|
|
15
|
-
slug?: string | null;
|
|
16
|
-
hub?: {
|
|
17
|
-
slug?: string | null;
|
|
18
|
-
} | null;
|
|
19
|
-
}[];
|
|
7
|
+
nodes: IStrapiPage[];
|
|
20
8
|
};
|
|
21
9
|
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.createStrapiArticles = createStrapiArticles;
|
|
13
|
+
const path_1 = require("path");
|
|
14
|
+
const slug_1 = require("../utils/slug");
|
|
15
|
+
const hreflang_1 = require("../utils/hreflang");
|
|
16
|
+
function createStrapiArticles(_a, root_1) {
|
|
17
|
+
return __awaiter(this, arguments, void 0, function* ({ actions, reporter, graphql }, root) {
|
|
18
|
+
var _b, _c, _d, _e;
|
|
19
|
+
reporter.info('Starting to create Strapi articles');
|
|
20
|
+
try {
|
|
21
|
+
const result = yield graphql(`
|
|
22
|
+
query GetAllStrapiArticle {
|
|
23
|
+
strapiSite {
|
|
24
|
+
locale
|
|
25
|
+
}
|
|
26
|
+
allStrapiArticle {
|
|
27
|
+
nodes {
|
|
28
|
+
id
|
|
29
|
+
title
|
|
30
|
+
slug
|
|
31
|
+
locale
|
|
32
|
+
hub {
|
|
33
|
+
slug
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
`);
|
|
39
|
+
if (result.errors) {
|
|
40
|
+
throw new Error(`There was an error loading your Strapi articles: ${result.errors}`);
|
|
41
|
+
}
|
|
42
|
+
const defaultLocale = (_c = (_b = result.data) === null || _b === void 0 ? void 0 : _b.strapiSite) === null || _c === void 0 ? void 0 : _c.locale;
|
|
43
|
+
const strapiArticles = (_e = (_d = result.data) === null || _d === void 0 ? void 0 : _d.allStrapiArticle) === null || _e === void 0 ? void 0 : _e.nodes;
|
|
44
|
+
if (!(strapiArticles === null || strapiArticles === void 0 ? void 0 : strapiArticles.length)) {
|
|
45
|
+
reporter.warn('No Strapi articles found. Skipping Strapi articles creation.');
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
reporter.info(`Found ${strapiArticles.length} Strapi articles`);
|
|
49
|
+
const hrefLangMap = (0, hreflang_1.buildHrefLangMap)(strapiArticles, defaultLocale);
|
|
50
|
+
reporter.info(`Generated hrefLangs for Strapi articles`);
|
|
51
|
+
let articleCount = 0;
|
|
52
|
+
strapiArticles.forEach(({ id, slug, title, locale, hub }) => {
|
|
53
|
+
var _a;
|
|
54
|
+
if ((0, slug_1.isDummyPage)(slug)) {
|
|
55
|
+
reporter.warn('Skipping article creation: dummy article detected');
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if ((0, slug_1.isEmptyPage)(title, slug)) {
|
|
59
|
+
reporter.warn('Skipping article creation: empty article detected');
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const strapiArticleTemplate = (0, path_1.resolve)(root, `./src/templates/strapi-article.tsx`);
|
|
63
|
+
const strapiArticlePath = (0, slug_1.buildPath)((0, slug_1.mergeSlug)(slug, hub === null || hub === void 0 ? void 0 : hub.slug), locale, defaultLocale);
|
|
64
|
+
const strapiArticleHrefLangs = (_a = hrefLangMap[strapiArticlePath]) !== null && _a !== void 0 ? _a : [];
|
|
65
|
+
actions.createPage({
|
|
66
|
+
path: strapiArticlePath,
|
|
67
|
+
component: strapiArticleTemplate,
|
|
68
|
+
context: { id, hrefLangs: strapiArticleHrefLangs },
|
|
69
|
+
});
|
|
70
|
+
articleCount++;
|
|
71
|
+
});
|
|
72
|
+
reporter.success(`Created ${articleCount} Strapi articles`);
|
|
73
|
+
}
|
|
74
|
+
catch (error) {
|
|
75
|
+
reporter.panicOnBuild(`Error creating Strapi articles: ${error}`);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface IStrapiHub {
|
|
2
|
+
slug?: string | null;
|
|
3
|
+
}
|
|
4
|
+
export interface IStrapiPage {
|
|
5
|
+
id: string;
|
|
6
|
+
title?: string | null;
|
|
7
|
+
slug?: string | null;
|
|
8
|
+
locale?: string | null;
|
|
9
|
+
hub?: IStrapiHub | null;
|
|
10
|
+
}
|
|
11
|
+
export interface IStrapiSite {
|
|
12
|
+
locale?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface IMdxPage {
|
|
15
|
+
frontmatter: {
|
|
16
|
+
slug: string;
|
|
17
|
+
title: string;
|
|
18
|
+
};
|
|
19
|
+
internal: {
|
|
20
|
+
contentFilePath: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const article = "\n # === STRAPI ARTICLE DEFINITION ===\n type StrapiArticle implements Node {\n id: ID!\n title: String!\n description: String\n slug: String!\n hub: Hub\n previewImage: Image\n minutesToRead: Int\n seo: Seo\n author: Author\n locale: String\n content: [ContentComponent]\n createdAt: Date @dateformat\n updatedAt: Date @dateformat\n }\n";
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.article = void 0;
|
|
4
|
+
exports.article = `
|
|
5
|
+
# === STRAPI ARTICLE DEFINITION ===
|
|
6
|
+
type StrapiArticle implements Node {
|
|
7
|
+
id: ID!
|
|
8
|
+
title: String!
|
|
9
|
+
description: String
|
|
10
|
+
slug: String!
|
|
11
|
+
hub: Hub
|
|
12
|
+
previewImage: Image
|
|
13
|
+
minutesToRead: Int
|
|
14
|
+
seo: Seo
|
|
15
|
+
author: Author
|
|
16
|
+
locale: String
|
|
17
|
+
content: [ContentComponent]
|
|
18
|
+
createdAt: Date @dateformat
|
|
19
|
+
updatedAt: Date @dateformat
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const content = "\n # === COMPONENT DEFINITIONS ===\n union ContentComponent =\n STRAPI__COMPONENT_CONTENT_ACTION_BUTTON\n | STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE\n | STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE \n | STRAPI__COMPONENT_CONTENT_FAQ\n | STRAPI__COMPONENT_CONTENT_FEATURES\n | STRAPI__COMPONENT_CONTENT_GAME_CARDS\n | STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS\n | STRAPI__COMPONENT_CONTENT_GAME_DEMO\n | STRAPI__COMPONENT_CONTENT_GAME_INFO\n | STRAPI__COMPONENT_CONTENT_HOW_TO\n | STRAPI__COMPONENT_CONTENT_INFORMER\n | STRAPI__COMPONENT_CONTENT_LIST\n | STRAPI__COMPONENT_CONTENT_MEDIA\n | STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE\n | STRAPI__COMPONENT_CONTENT_PROS_CONS\n | STRAPI__COMPONENT_CONTENT_RICH_TEXT\n | STRAPI__COMPONENT_CONTENT_TABLE\n | STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE\n | STRAPI__COMPONENT_CONTENT_TIP\n\n # === ACTION_BUTTON ===\n type STRAPI__COMPONENT_CONTENT_ACTION_BUTTON @dontInfer {\n label: String!\n url: String!\n }\n\n # === CONTACTS ===\n type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {\n id: ID\n }\n\n # === COOKIE_POLICY ===\n type STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE @dontInfer {\n id: ID\n }\n\n # === FAQ ===\n type STRAPI__COMPONENT_CONTENT_FAQ @dontInfer {\n items: [FaqItem!]\n }\n\n # === FEATURES ===\n type STRAPI__COMPONENT_CONTENT_FEATURES @dontInfer {\n items: [FeaturesItem!]\n }\n\n # === GAME CARDS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARDS @dontInfer {\n items: [GameCard!]\n order: String!\n randomSeed: Int\n cardHeight: String\n }\n\n # === GAME CARD TABS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS @dontInfer {\n items: [GameCardTab!]\n }\n\n # === GAME_DEMO ===\n type STRAPI__COMPONENT_CONTENT_GAME_DEMO @dontInfer {\n name: String!\n src: String\n href: String\n previewImage: Image!\n partner: Partner\n }\n\n # === GAME_INFO ===\n type STRAPI__COMPONENT_CONTENT_GAME_INFO @dontInfer {\n general: GameInfoGeneral\n features: GameInfoFeatures\n currency: CurrencyList\n }\n\n # === INFORMER ===\n type STRAPI__COMPONENT_CONTENT_INFORMER @dontInfer {\n type: String!\n text: String!\n author: Author\n }\n\n # === HOW_TO ===\n type STRAPI__COMPONENT_CONTENT_HOW_TO @dontInfer {\n steps: [HowToStep!]\n }\n\n # === LIST ===\n type STRAPI__COMPONENT_CONTENT_LIST @dontInfer {\n bullet: String\n content: JsonValue\n }\n\n # === MEDIA ===\n type STRAPI__COMPONENT_CONTENT_MEDIA @dontInfer {\n file: Image\n }\n\n # === PRIVACY_POLICY ===\n type STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE @dontInfer {\n contactsSlug: String\n }\n\n # === PROS_CONS ===\n type STRAPI__COMPONENT_CONTENT_PROS_CONS @dontInfer {\n pros: [ProsConsItem!]\n cons: [ProsConsItem!]\n }\n\n # === RICH_TEXT ===\n type STRAPI__COMPONENT_CONTENT_RICH_TEXT @dontInfer {\n content: RichTextContent\n }\n\n # === TABLE ===\n type STRAPI__COMPONENT_CONTENT_TABLE @dontInfer {\n columnNumber: Int!\n content: JsonValue\n caption: String\n striped: Boolean\n bordered: Boolean\n scrollable: Boolean\n }\n\n # === TERMS_CONDITIONS ===\n type STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE @dontInfer {\n privacyPolicySlug: String\n }\n\n # === TIP ===\n type STRAPI__COMPONENT_CONTENT_TIP @dontInfer {\n tip: String!\n author: Author\n }\n ";
|
|
1
|
+
export declare const content = "\n # === COMPONENT DEFINITIONS ===\n union ContentComponent =\n STRAPI__COMPONENT_CONTENT_ACTION_BUTTON\n | STRAPI__COMPONENT_CONTENT_ARTICLE_CARDS\n | STRAPI__COMPONENT_CONTENT_ARTICLE_INFO\n | STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE\n | STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE \n | STRAPI__COMPONENT_CONTENT_FAQ\n | STRAPI__COMPONENT_CONTENT_FEATURES\n | STRAPI__COMPONENT_CONTENT_GAME_CARDS\n | STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS\n | STRAPI__COMPONENT_CONTENT_GAME_DEMO\n | STRAPI__COMPONENT_CONTENT_GAME_INFO\n | STRAPI__COMPONENT_CONTENT_HOW_TO\n | STRAPI__COMPONENT_CONTENT_INFORMER\n | STRAPI__COMPONENT_CONTENT_LIST\n | STRAPI__COMPONENT_CONTENT_MEDIA\n | STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE\n | STRAPI__COMPONENT_CONTENT_PROS_CONS\n | STRAPI__COMPONENT_CONTENT_RICH_TEXT\n | STRAPI__COMPONENT_CONTENT_TABLE\n | STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE\n | STRAPI__COMPONENT_CONTENT_TIP\n\n # === ACTION_BUTTON ===\n type STRAPI__COMPONENT_CONTENT_ACTION_BUTTON @dontInfer {\n label: String!\n url: String!\n }\n\n # === ARTICLE_CARDS ===\n type STRAPI__COMPONENT_CONTENT_ARTICLE_CARDS @dontInfer {\n articles: [StrapiArticle]\n }\n\n # === ARTICLE_INFO ===\n type STRAPI__COMPONENT_CONTENT_ARTICLE_INFO @dontInfer {\n title: String!\n description: String\n minutesToRead: Int\n publicationDate: Date @dateformat\n author: Author\n }\n\n # === CONTACTS ===\n type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {\n id: ID\n }\n\n # === COOKIE_POLICY ===\n type STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE @dontInfer {\n id: ID\n }\n\n # === FAQ ===\n type STRAPI__COMPONENT_CONTENT_FAQ @dontInfer {\n items: [FaqItem!]\n }\n\n # === FEATURES ===\n type STRAPI__COMPONENT_CONTENT_FEATURES @dontInfer {\n items: [FeaturesItem!]\n }\n\n # === GAME CARDS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARDS @dontInfer {\n items: [GameCard!]\n order: String!\n randomSeed: Int\n cardHeight: String\n }\n\n # === GAME CARD TABS ===\n type STRAPI__COMPONENT_CONTENT_GAME_CARD_TABS @dontInfer {\n items: [GameCardTab!]\n }\n\n # === GAME_DEMO ===\n type STRAPI__COMPONENT_CONTENT_GAME_DEMO @dontInfer {\n name: String!\n src: String\n href: String\n previewImage: Image!\n partner: Partner\n }\n\n # === GAME_INFO ===\n type STRAPI__COMPONENT_CONTENT_GAME_INFO @dontInfer {\n general: GameInfoGeneral\n features: GameInfoFeatures\n currency: CurrencyList\n }\n\n # === INFORMER ===\n type STRAPI__COMPONENT_CONTENT_INFORMER @dontInfer {\n type: String!\n text: String!\n author: Author\n }\n\n # === HOW_TO ===\n type STRAPI__COMPONENT_CONTENT_HOW_TO @dontInfer {\n steps: [HowToStep!]\n }\n\n # === LIST ===\n type STRAPI__COMPONENT_CONTENT_LIST @dontInfer {\n bullet: String\n content: JsonValue\n }\n\n # === MEDIA ===\n type STRAPI__COMPONENT_CONTENT_MEDIA @dontInfer {\n file: Image\n }\n\n # === PRIVACY_POLICY ===\n type STRAPI__COMPONENT_CONTENT_PRIVACY_POLICY_PAGE @dontInfer {\n contactsSlug: String\n }\n\n # === PROS_CONS ===\n type STRAPI__COMPONENT_CONTENT_PROS_CONS @dontInfer {\n pros: [ProsConsItem!]\n cons: [ProsConsItem!]\n }\n\n # === RICH_TEXT ===\n type STRAPI__COMPONENT_CONTENT_RICH_TEXT @dontInfer {\n content: RichTextContent\n }\n\n # === TABLE ===\n type STRAPI__COMPONENT_CONTENT_TABLE @dontInfer {\n columnNumber: Int!\n content: JsonValue\n caption: String\n striped: Boolean\n bordered: Boolean\n scrollable: Boolean\n }\n\n # === TERMS_CONDITIONS ===\n type STRAPI__COMPONENT_CONTENT_TERMS_CONDITIONS_PAGE @dontInfer {\n privacyPolicySlug: String\n }\n\n # === TIP ===\n type STRAPI__COMPONENT_CONTENT_TIP @dontInfer {\n tip: String!\n author: Author\n }\n ";
|
|
@@ -5,6 +5,8 @@ exports.content = `
|
|
|
5
5
|
# === COMPONENT DEFINITIONS ===
|
|
6
6
|
union ContentComponent =
|
|
7
7
|
STRAPI__COMPONENT_CONTENT_ACTION_BUTTON
|
|
8
|
+
| STRAPI__COMPONENT_CONTENT_ARTICLE_CARDS
|
|
9
|
+
| STRAPI__COMPONENT_CONTENT_ARTICLE_INFO
|
|
8
10
|
| STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE
|
|
9
11
|
| STRAPI__COMPONENT_CONTENT_COOKIE_POLICY_PAGE
|
|
10
12
|
| STRAPI__COMPONENT_CONTENT_FAQ
|
|
@@ -30,6 +32,20 @@ exports.content = `
|
|
|
30
32
|
url: String!
|
|
31
33
|
}
|
|
32
34
|
|
|
35
|
+
# === ARTICLE_CARDS ===
|
|
36
|
+
type STRAPI__COMPONENT_CONTENT_ARTICLE_CARDS @dontInfer {
|
|
37
|
+
articles: [StrapiArticle]
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
# === ARTICLE_INFO ===
|
|
41
|
+
type STRAPI__COMPONENT_CONTENT_ARTICLE_INFO @dontInfer {
|
|
42
|
+
title: String!
|
|
43
|
+
description: String
|
|
44
|
+
minutesToRead: Int
|
|
45
|
+
publicationDate: Date @dateformat
|
|
46
|
+
author: Author
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
# === CONTACTS ===
|
|
34
50
|
type STRAPI__COMPONENT_CONTENT_CONTACTS_PAGE @dontInfer {
|
|
35
51
|
id: ID
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.typeDefs = void 0;
|
|
4
|
+
const article_1 = require("./collections/article");
|
|
4
5
|
const author_1 = require("./collections/author");
|
|
5
6
|
const hub_1 = require("./collections/hub");
|
|
6
7
|
const page_1 = require("./collections/page");
|
|
@@ -13,6 +14,7 @@ const localization_1 = require("./single/localization");
|
|
|
13
14
|
const navigation_1 = require("./single/navigation");
|
|
14
15
|
const site_1 = require("./single/site");
|
|
15
16
|
exports.typeDefs = [
|
|
17
|
+
article_1.article,
|
|
16
18
|
author_1.author,
|
|
17
19
|
hub_1.hub,
|
|
18
20
|
page_1.page,
|
|
@@ -20,7 +20,7 @@ const get_entities_1 = require("./get-entities");
|
|
|
20
20
|
const utils_1 = require("./utils");
|
|
21
21
|
function sourceStrapiContentNode(args, strapiClient, config) {
|
|
22
22
|
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
var _a;
|
|
23
|
+
var _a, _b;
|
|
24
24
|
const { actions, reporter } = args;
|
|
25
25
|
const { createNode } = actions;
|
|
26
26
|
reporter.info('Starting to fetch content data from Strapi');
|
|
@@ -58,6 +58,20 @@ function sourceStrapiContentNode(args, strapiClient, config) {
|
|
|
58
58
|
'content.action-button': {
|
|
59
59
|
populate: '*',
|
|
60
60
|
},
|
|
61
|
+
'content.article-cards': {
|
|
62
|
+
populate: {
|
|
63
|
+
articles: {
|
|
64
|
+
populate: {
|
|
65
|
+
previewImage: {
|
|
66
|
+
populate: '*',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
'content.article-info': {
|
|
73
|
+
populate: '*',
|
|
74
|
+
},
|
|
61
75
|
'content.contacts-page': {
|
|
62
76
|
populate: '*',
|
|
63
77
|
},
|
|
@@ -162,6 +176,116 @@ function sourceStrapiContentNode(args, strapiClient, config) {
|
|
|
162
176
|
},
|
|
163
177
|
},
|
|
164
178
|
},
|
|
179
|
+
{
|
|
180
|
+
singularName: 'article',
|
|
181
|
+
queryParams: {
|
|
182
|
+
populate: {
|
|
183
|
+
hub: {
|
|
184
|
+
populate: '*',
|
|
185
|
+
},
|
|
186
|
+
seo: {
|
|
187
|
+
populate: '*',
|
|
188
|
+
},
|
|
189
|
+
previewImage: {
|
|
190
|
+
populate: '*',
|
|
191
|
+
},
|
|
192
|
+
content: {
|
|
193
|
+
on: {
|
|
194
|
+
'content.action-button': {
|
|
195
|
+
populate: '*',
|
|
196
|
+
},
|
|
197
|
+
'content.faq': {
|
|
198
|
+
populate: '*',
|
|
199
|
+
},
|
|
200
|
+
'content.features': {
|
|
201
|
+
populate: '*',
|
|
202
|
+
},
|
|
203
|
+
'content.game-cards': {
|
|
204
|
+
populate: {
|
|
205
|
+
items: {
|
|
206
|
+
populate: {
|
|
207
|
+
image: {
|
|
208
|
+
populate: '*',
|
|
209
|
+
},
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
'content.game-card-tabs': {
|
|
215
|
+
populate: {
|
|
216
|
+
items: {
|
|
217
|
+
populate: {
|
|
218
|
+
content: {
|
|
219
|
+
populate: {
|
|
220
|
+
image: {
|
|
221
|
+
populate: '*',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
'content.game-demo': {
|
|
230
|
+
populate: '*',
|
|
231
|
+
},
|
|
232
|
+
'content.game-info': {
|
|
233
|
+
populate: {
|
|
234
|
+
general: '*',
|
|
235
|
+
features: '*',
|
|
236
|
+
currency: {
|
|
237
|
+
populate: '*',
|
|
238
|
+
},
|
|
239
|
+
},
|
|
240
|
+
},
|
|
241
|
+
'content.how-to': {
|
|
242
|
+
populate: {
|
|
243
|
+
steps: {
|
|
244
|
+
populate: '*',
|
|
245
|
+
},
|
|
246
|
+
},
|
|
247
|
+
},
|
|
248
|
+
'content.informer': {
|
|
249
|
+
populate: '*',
|
|
250
|
+
},
|
|
251
|
+
'content.list': {
|
|
252
|
+
populate: '*',
|
|
253
|
+
},
|
|
254
|
+
'content.media': {
|
|
255
|
+
populate: '*',
|
|
256
|
+
},
|
|
257
|
+
'content.pros-cons': {
|
|
258
|
+
populate: '*',
|
|
259
|
+
},
|
|
260
|
+
'content.rich-text': {
|
|
261
|
+
populate: '*',
|
|
262
|
+
},
|
|
263
|
+
'content.table': {
|
|
264
|
+
populate: '*',
|
|
265
|
+
},
|
|
266
|
+
'content.tip': {
|
|
267
|
+
populate: '*',
|
|
268
|
+
},
|
|
269
|
+
},
|
|
270
|
+
},
|
|
271
|
+
author: {
|
|
272
|
+
populate: {
|
|
273
|
+
avatar: {
|
|
274
|
+
populate: '*',
|
|
275
|
+
},
|
|
276
|
+
socialNetworks: {
|
|
277
|
+
populate: '*',
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
},
|
|
282
|
+
locale: '*',
|
|
283
|
+
pagination: {
|
|
284
|
+
page: 1,
|
|
285
|
+
pageSize: (_b = config === null || config === void 0 ? void 0 : config.pageSize) !== null && _b !== void 0 ? _b : utils_1.DEFAULT_PAGE_SIZE,
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
},
|
|
165
289
|
];
|
|
166
290
|
const schemas = yield (0, fetch_schemas_1.fetchSchemas)(strapiClient);
|
|
167
291
|
const endpoints = (0, get_endpoints_1.getEndpoints)(schemas, [...singleTypes, ...collectionTypes]);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface IGetAllStrapiPageQuery {
|
|
2
|
-
strapiSite?: {
|
|
3
|
-
locale?: string;
|
|
4
|
-
};
|
|
5
|
-
allStrapiPage?: {
|
|
6
|
-
nodes: {
|
|
7
|
-
id: string;
|
|
8
|
-
title?: string | null;
|
|
9
|
-
slug?: string | null;
|
|
10
|
-
locale?: string | null;
|
|
11
|
-
hub?: {
|
|
12
|
-
slug?: string | null;
|
|
13
|
-
} | null;
|
|
14
|
-
}[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|