@content-island/gatsby-source-plugin 0.4.1 → 0.6.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.
Files changed (2) hide show
  1. package/dist/index.js +7 -7
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -22,7 +22,7 @@ const l = {
22
22
  value: e.value,
23
23
  isArray: e.isArray
24
24
  }, i = (e, t, o) => Array.isArray(e) ? e.filter((n) => n.type === o).map((n) => w(n, t)) : [], c = (e, t, o) => {
25
- const n = `${E}${e.contentType.name}`, s = t ? e.fields.filter((y) => y.language === o) : e.fields, { id: a, ...p } = C.mapContentToModel({ ...e, fields: s });
25
+ const n = `${E}${e.contentType.name}`, s = t ? e.fields.filter((y) => y.language === o) : e.fields, { id: a, ...f } = C.mapContentToModel({ ...e, fields: s });
26
26
  return {
27
27
  gatsbyNodeType: n,
28
28
  gatsbyNode: {
@@ -33,7 +33,7 @@ const l = {
33
33
  _lastUpdate: e.lastUpdate,
34
34
  _isLocalized: t,
35
35
  _language: o,
36
- ...p
36
+ ...f
37
37
  }
38
38
  };
39
39
  }, R = (e) => {
@@ -41,7 +41,7 @@ const l = {
41
41
  return o ? t.map((n) => c(e, o, n)) : [c(e, o)];
42
42
  }, F = (e) => Array.isArray(e) ? e.flatMap(R) : [];
43
43
  let d = [];
44
- const $ = async (e) => (d.length === 0 && (d = (await e.getProject()).entities), d);
44
+ const $ = async (e) => (d.length === 0 && (d = (await e.getProject()).contentTypes || []), d);
45
45
  let r = [];
46
46
  const m = async (e) => {
47
47
  if (r.length === 0) {
@@ -68,7 +68,7 @@ const m = async (e) => {
68
68
  };
69
69
  e.actions.createNode(n);
70
70
  }, N = async (e, t) => await _({
71
- url: t.link,
71
+ url: t.url,
72
72
  parentNodeId: e.node.id,
73
73
  createNode: e.actions.createNode,
74
74
  createNodeId: e.createNodeId,
@@ -93,7 +93,7 @@ const m = async (e) => {
93
93
  const o = await N(e, t.value);
94
94
  o && T(e, t, o.id);
95
95
  }
96
- }, f = (e) => `${e.gatsbyNodeType}MarkdownRemark`, k = async (e, t) => {
96
+ }, p = (e) => `${e.gatsbyNodeType}MarkdownRemark`, k = async (e, t) => {
97
97
  if (t.isArray)
98
98
  e.reporter.panic(
99
99
  L(l.INCORRECT_FIELD_CONTENT, "Content Island does not support fields with markdown lists.")
@@ -103,7 +103,7 @@ const m = async (e) => {
103
103
  id: e.createNodeId(`${e.node.id}-${t.name}`),
104
104
  parent: e.node.id,
105
105
  internal: {
106
- type: f(t),
106
+ type: p(t),
107
107
  // mediaType will allow remark plugin to transform plain text into markdown node
108
108
  mediaType: g.markdown,
109
109
  content: t.value,
@@ -131,7 +131,7 @@ const m = async (e) => {
131
131
  for (const a of s)
132
132
  e.actions.createTypes(`
133
133
  type ${a.gatsbyNodeType} implements Node {
134
- ${a.name}: ${f(a)} @link(from: "fields.${a.name}")
134
+ ${a.name}: ${p(a)} @link(from: "fields.${a.name}")
135
135
  }
136
136
  `);
137
137
  }, S = async (e, t) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@content-island/gatsby-source-plugin",
3
- "version": "0.4.1",
3
+ "version": "0.6.0",
4
4
  "description": "Content Island - B2B Gatsby Source Plugin",
5
5
  "private": false,
6
6
  "sideEffects": false,
@@ -30,7 +30,7 @@
30
30
  "build:dev": "vite build --mode development"
31
31
  },
32
32
  "dependencies": {
33
- "@content-island/api-client": "^0.5.0"
33
+ "@content-island/api-client": "^0.7.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "gatsby": "^5.14.1",