@content-island/gatsby-source-plugin 0.3.0 → 0.4.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/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from './gatsby-lifecycle';
1
+ export { createSchemaCustomization, onCreateNode, onPluginInit, sourceNodes } from './gatsby-lifecycle';
package/dist/index.js CHANGED
@@ -1,17 +1,8 @@
1
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./gatsby-lifecycle"), exports);
3
+ exports.sourceNodes = exports.onPluginInit = exports.onCreateNode = exports.createSchemaCustomization = void 0;
4
+ var gatsby_lifecycle_1 = require("./gatsby-lifecycle");
5
+ Object.defineProperty(exports, "createSchemaCustomization", { enumerable: true, get: function () { return gatsby_lifecycle_1.createSchemaCustomization; } });
6
+ Object.defineProperty(exports, "onCreateNode", { enumerable: true, get: function () { return gatsby_lifecycle_1.onCreateNode; } });
7
+ Object.defineProperty(exports, "onPluginInit", { enumerable: true, get: function () { return gatsby_lifecycle_1.onPluginInit; } });
8
+ Object.defineProperty(exports, "sourceNodes", { enumerable: true, get: function () { return gatsby_lifecycle_1.sourceNodes; } });
package/dist/mappers.js CHANGED
@@ -1,4 +1,15 @@
1
1
  "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
14
  exports.mapContentListFromApiToVm = void 0;
4
15
  const apiModel = require("@content-island/api-client");
@@ -24,9 +35,10 @@ const mapToPreprocessedFieldList = (fields, gatsbyNodeType, fieldType) => Array.
24
35
  const mapContentFromApiToVm = (content, isLocalized, language) => {
25
36
  const gatsbyNodeType = `${constants_1.NODE_TYPE_PREFIX}${content.contentType.name}`;
26
37
  const fields = isLocalized ? content.fields.filter(field => field.language === language) : content.fields;
38
+ const _a = apiModel.mapContentToModel(Object.assign(Object.assign({}, content), { fields })), { id } = _a, model = __rest(_a, ["id"]);
27
39
  return {
28
40
  gatsbyNodeType,
29
- gatsbyNode: Object.assign({ _id: content.id, _isContentIslandNode: true, _mediaFields: mapToPreprocessedFieldList(fields, gatsbyNodeType, 'media'), _markdownFields: mapToPreprocessedFieldList(fields, gatsbyNodeType, 'long-text'), _lastUpdate: content.lastUpdate, _isLocalized: isLocalized, _language: language }, apiModel.mapFieldListToModel(fields)),
41
+ gatsbyNode: Object.assign({ _id: id, _isContentIslandNode: true, _mediaFields: mapToPreprocessedFieldList(fields, gatsbyNodeType, 'media'), _markdownFields: mapToPreprocessedFieldList(fields, gatsbyNodeType, 'long-text'), _lastUpdate: content.lastUpdate, _isLocalized: isLocalized, _language: language }, model),
30
42
  };
31
43
  };
32
44
  const mapLocalizedContentFromApiToVm = (content) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@content-island/gatsby-source-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Content Island - B2B Gatsby Source Plugin",
5
5
  "private": false,
6
6
  "author": "Lemoncode",
@@ -27,7 +27,7 @@
27
27
  "build": "tsc"
28
28
  },
29
29
  "dependencies": {
30
- "@content-island/api-client": "^0.3.0"
30
+ "@content-island/api-client": "^0.4.0"
31
31
  },
32
32
  "devDependencies": {
33
33
  "gatsby": "^5.12.4",