@prismicio/client 7.13.0 → 7.13.1

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.
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const version = "7.13.0";
3
+ const version = "7.13.1";
4
4
  exports.version = version;
5
5
  //# sourceMappingURL=package.json.cjs.map
@@ -1,4 +1,4 @@
1
- const version = "7.13.0";
1
+ const version = "7.13.1";
2
2
  export {
3
3
  version
4
4
  };
@@ -34,7 +34,13 @@ export type AnySlicePrimaryField = GroupField | AnyRegularField;
34
34
  /**
35
35
  * A list of repeatable fields.
36
36
  */
37
- export type Repeatable<Field extends LinkField, State extends FieldState = FieldState> = State extends "empty" ? [] : [Field, ...Field[]];
37
+ export type Repeatable<Field extends LinkField, State extends FieldState = FieldState> = State extends "empty" ? [] : [WithKey<Field>, ...WithKey<Field>[]];
38
+ /**
39
+ * Wrapper to add a key to a field when inside a repeatable.
40
+ */
41
+ type WithKey<Field extends LinkField> = Field & {
42
+ key: string;
43
+ };
38
44
  /**
39
45
  * Useful to flatten the type output to improve type hints shown in editors. And
40
46
  * also to transform an interface into a type to aide with assignability.
@@ -48,3 +54,4 @@ export type Repeatable<Field extends LinkField, State extends FieldState = Field
48
54
  export type Simplify<T> = {
49
55
  [P in keyof T]: T[P];
50
56
  };
57
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismicio/client",
3
- "version": "7.13.0",
3
+ "version": "7.13.1",
4
4
  "description": "The official JavaScript + TypeScript client library for Prismic",
5
5
  "keywords": [
6
6
  "typescript",
@@ -69,8 +69,8 @@
69
69
  "prepare": "npm run build",
70
70
  "release": "npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
71
71
  "release:dry": "standard-version --dry-run",
72
- "release:alpha": "npm run test && standard-version --release-as minor --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
73
- "release:alpha:dry": "standard-version --release-as minor --prerelease alpha --dry-run",
72
+ "release:alpha": "npm run test && standard-version --release-as patch --prerelease alpha && git push --follow-tags && npm run build && npm publish --tag alpha",
73
+ "release:alpha:dry": "standard-version --release-as patch --prerelease alpha --dry-run",
74
74
  "lint": "eslint --ext .js,.ts .",
75
75
  "types": "tsc --noEmit",
76
76
  "unit": "vitest run --coverage",
@@ -59,7 +59,12 @@ export type AnySlicePrimaryField = GroupField | AnyRegularField
59
59
  export type Repeatable<
60
60
  Field extends LinkField,
61
61
  State extends FieldState = FieldState,
62
- > = State extends "empty" ? [] : [Field, ...Field[]]
62
+ > = State extends "empty" ? [] : [WithKey<Field>, ...WithKey<Field>[]]
63
+
64
+ /**
65
+ * Wrapper to add a key to a field when inside a repeatable.
66
+ */
67
+ type WithKey<Field extends LinkField> = Field & { key: string }
63
68
 
64
69
  /**
65
70
  * Useful to flatten the type output to improve type hints shown in editors. And