@uniformdev/canvas-contentful 18.17.1-alpha.13 → 18.19.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.esm.js CHANGED
@@ -74,6 +74,8 @@ import {
74
74
  // src/utils.ts
75
75
  import { createLimitPolicy } from "@uniformdev/canvas";
76
76
  var defaultContentfulLimitPolicy = createLimitPolicy({
77
+ // per https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/api-rate-limits, the default CDA rate limit is 55/sec
78
+ // preview is lower, however the Contentful client handles rate limit retries internally already
77
79
  throttle: {
78
80
  limit: 55,
79
81
  interval: 1e3
@@ -162,6 +164,7 @@ function createContentfulEnhancer({
162
164
  return result;
163
165
  }
164
166
  const client2 = resolveClientForParameter2({
167
+ // note: we can non-null assert paramValue because of the `isParameterValueDefined` check above.
165
168
  parameterValue: paramValue,
166
169
  parameterName,
167
170
  clients,
@@ -196,6 +199,8 @@ function createContentfulEnhancer({
196
199
  })) != null ? _a : defaultQuery;
197
200
  const uniqueBatchEntries = new UniqueBatchEntries(
198
201
  taskGroup.tasks,
202
+ // We can non-null assert `value` because we've already done null/undefined-checking when
203
+ // grouping the tasks.
199
204
  (task) => isLegacyValue(task.parameter.value) ? task.parameter.value : task.parameter.value.entryId
200
205
  );
201
206
  const idsToResolve = Object.keys(uniqueBatchEntries.groups);
@@ -237,6 +242,7 @@ function createContentfulEnhancer({
237
242
  const client2 = resolveClientForParameter2({
238
243
  clients,
239
244
  parameterName,
245
+ // We can non-null assert parameter.value because of the `isParameterValueDefined` check above.
240
246
  parameterValue: parameter.value,
241
247
  component,
242
248
  context
package/dist/index.js CHANGED
@@ -104,6 +104,8 @@ var import_canvas2 = require("@uniformdev/canvas");
104
104
  // src/utils.ts
105
105
  var import_canvas = require("@uniformdev/canvas");
106
106
  var defaultContentfulLimitPolicy = (0, import_canvas.createLimitPolicy)({
107
+ // per https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/api-rate-limits, the default CDA rate limit is 55/sec
108
+ // preview is lower, however the Contentful client handles rate limit retries internally already
107
109
  throttle: {
108
110
  limit: 55,
109
111
  interval: 1e3
@@ -192,6 +194,7 @@ function createContentfulEnhancer({
192
194
  return result;
193
195
  }
194
196
  const client2 = resolveClientForParameter2({
197
+ // note: we can non-null assert paramValue because of the `isParameterValueDefined` check above.
195
198
  parameterValue: paramValue,
196
199
  parameterName,
197
200
  clients,
@@ -226,6 +229,8 @@ function createContentfulEnhancer({
226
229
  })) != null ? _a : defaultQuery;
227
230
  const uniqueBatchEntries = new import_canvas2.UniqueBatchEntries(
228
231
  taskGroup.tasks,
232
+ // We can non-null assert `value` because we've already done null/undefined-checking when
233
+ // grouping the tasks.
229
234
  (task) => isLegacyValue(task.parameter.value) ? task.parameter.value : task.parameter.value.entryId
230
235
  );
231
236
  const idsToResolve = Object.keys(uniqueBatchEntries.groups);
@@ -267,6 +272,7 @@ function createContentfulEnhancer({
267
272
  const client2 = resolveClientForParameter2({
268
273
  clients,
269
274
  parameterName,
275
+ // We can non-null assert parameter.value because of the `isParameterValueDefined` check above.
270
276
  parameterValue: parameter.value,
271
277
  component,
272
278
  context
package/dist/index.mjs CHANGED
@@ -74,6 +74,8 @@ import {
74
74
  // src/utils.ts
75
75
  import { createLimitPolicy } from "@uniformdev/canvas";
76
76
  var defaultContentfulLimitPolicy = createLimitPolicy({
77
+ // per https://www.contentful.com/developers/docs/references/content-delivery-api/#/introduction/api-rate-limits, the default CDA rate limit is 55/sec
78
+ // preview is lower, however the Contentful client handles rate limit retries internally already
77
79
  throttle: {
78
80
  limit: 55,
79
81
  interval: 1e3
@@ -162,6 +164,7 @@ function createContentfulEnhancer({
162
164
  return result;
163
165
  }
164
166
  const client2 = resolveClientForParameter2({
167
+ // note: we can non-null assert paramValue because of the `isParameterValueDefined` check above.
165
168
  parameterValue: paramValue,
166
169
  parameterName,
167
170
  clients,
@@ -196,6 +199,8 @@ function createContentfulEnhancer({
196
199
  })) != null ? _a : defaultQuery;
197
200
  const uniqueBatchEntries = new UniqueBatchEntries(
198
201
  taskGroup.tasks,
202
+ // We can non-null assert `value` because we've already done null/undefined-checking when
203
+ // grouping the tasks.
199
204
  (task) => isLegacyValue(task.parameter.value) ? task.parameter.value : task.parameter.value.entryId
200
205
  );
201
206
  const idsToResolve = Object.keys(uniqueBatchEntries.groups);
@@ -237,6 +242,7 @@ function createContentfulEnhancer({
237
242
  const client2 = resolveClientForParameter2({
238
243
  clients,
239
244
  parameterName,
245
+ // We can non-null assert parameter.value because of the `isParameterValueDefined` check above.
240
246
  parameterValue: parameter.value,
241
247
  component,
242
248
  context
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-contentful",
3
- "version": "18.17.1-alpha.13+77f2eaabc",
3
+ "version": "18.19.0",
4
4
  "description": "Contentful data enhancers for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -20,10 +20,11 @@
20
20
  "clean": "rimraf dist",
21
21
  "test": "jest --maxWorkers=1",
22
22
  "lint": "eslint \"src/**/*.{js,ts,tsx}\"",
23
- "format": "prettier --write \"src/**/*.{js,ts,tsx}\""
23
+ "format": "prettier --write \"src/**/*.{js,ts,tsx}\"",
24
+ "document": "api-extractor run --local"
24
25
  },
25
26
  "dependencies": {
26
- "@uniformdev/canvas": "18.17.1-alpha.13+77f2eaabc"
27
+ "@uniformdev/canvas": "18.19.0"
27
28
  },
28
29
  "peerDependencies": {
29
30
  "@contentful/rich-text-html-renderer": ">= 14",
@@ -39,5 +40,5 @@
39
40
  "publishConfig": {
40
41
  "access": "public"
41
42
  },
42
- "gitHead": "77f2eaabc380a8251c040f8bdd21d5451351022f"
43
+ "gitHead": "bd4414826a6d38b928b5ba2ea68e58160b784562"
43
44
  }