@wordpress/core-data 4.13.0 → 5.0.1-next.957ca95e4c.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 (201) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +148 -65
  3. package/build/entities.js +38 -51
  4. package/build/entities.js.map +1 -1
  5. package/build/hooks/index.js +14 -0
  6. package/build/hooks/index.js.map +1 -1
  7. package/build/hooks/use-entity-record.js +10 -6
  8. package/build/hooks/use-entity-record.js.map +1 -1
  9. package/build/hooks/use-entity-records.js +2 -0
  10. package/build/hooks/use-entity-records.js.map +1 -1
  11. package/build/hooks/use-query-select.js +5 -2
  12. package/build/hooks/use-query-select.js.map +1 -1
  13. package/build/hooks/use-resource-permissions.js +74 -11
  14. package/build/hooks/use-resource-permissions.js.map +1 -1
  15. package/build/index.js +1 -30
  16. package/build/index.js.map +1 -1
  17. package/build/resolvers.js +17 -21
  18. package/build/resolvers.js.map +1 -1
  19. package/build/selectors.js +9 -46
  20. package/build/selectors.js.map +1 -1
  21. package/build-module/entities.js +38 -52
  22. package/build-module/entities.js.map +1 -1
  23. package/build-module/hooks/index.js +1 -0
  24. package/build-module/hooks/index.js.map +1 -1
  25. package/build-module/hooks/use-entity-record.js +10 -6
  26. package/build-module/hooks/use-entity-record.js.map +1 -1
  27. package/build-module/hooks/use-entity-records.js +2 -0
  28. package/build-module/hooks/use-entity-records.js.map +1 -1
  29. package/build-module/hooks/use-query-select.js +4 -1
  30. package/build-module/hooks/use-query-select.js.map +1 -1
  31. package/build-module/hooks/use-resource-permissions.js +70 -10
  32. package/build-module/hooks/use-resource-permissions.js.map +1 -1
  33. package/build-module/index.js +0 -5
  34. package/build-module/index.js.map +1 -1
  35. package/build-module/resolvers.js +17 -21
  36. package/build-module/resolvers.js.map +1 -1
  37. package/build-module/selectors.js +7 -44
  38. package/build-module/selectors.js.map +1 -1
  39. package/build-types/actions.d.ts +188 -0
  40. package/build-types/actions.d.ts.map +1 -0
  41. package/build-types/batch/create-batch.d.ts +71 -0
  42. package/build-types/batch/create-batch.d.ts.map +1 -0
  43. package/build-types/batch/default-processor.d.ts +11 -0
  44. package/build-types/batch/default-processor.d.ts.map +1 -0
  45. package/build-types/batch/index.d.ts +3 -0
  46. package/build-types/batch/index.d.ts.map +1 -0
  47. package/build-types/entities.d.ts +128 -0
  48. package/build-types/entities.d.ts.map +1 -0
  49. package/build-types/entity-provider.d.ts +68 -0
  50. package/build-types/entity-provider.d.ts.map +1 -0
  51. package/build-types/entity-types/attachment.d.ts +121 -0
  52. package/build-types/entity-types/attachment.d.ts.map +1 -0
  53. package/build-types/entity-types/base-entity-records.d.ts +37 -0
  54. package/build-types/entity-types/base-entity-records.d.ts.map +1 -0
  55. package/build-types/entity-types/comment.d.ts +82 -0
  56. package/build-types/entity-types/comment.d.ts.map +1 -0
  57. package/build-types/entity-types/helpers.d.ts +123 -0
  58. package/build-types/entity-types/helpers.d.ts.map +1 -0
  59. package/build-types/entity-types/index.d.ts +64 -0
  60. package/build-types/entity-types/index.d.ts.map +1 -0
  61. package/build-types/entity-types/menu-location.d.ts +25 -0
  62. package/build-types/entity-types/menu-location.d.ts.map +1 -0
  63. package/build-types/entity-types/nav-menu-item.d.ts +88 -0
  64. package/build-types/entity-types/nav-menu-item.d.ts.map +1 -0
  65. package/build-types/entity-types/nav-menu.d.ts +45 -0
  66. package/build-types/entity-types/nav-menu.d.ts.map +1 -0
  67. package/build-types/entity-types/page.d.ts +120 -0
  68. package/build-types/entity-types/page.d.ts.map +1 -0
  69. package/build-types/entity-types/plugin.d.ts +62 -0
  70. package/build-types/entity-types/plugin.d.ts.map +1 -0
  71. package/build-types/entity-types/post.d.ts +128 -0
  72. package/build-types/entity-types/post.d.ts.map +1 -0
  73. package/build-types/entity-types/settings.d.ts +89 -0
  74. package/build-types/entity-types/settings.d.ts.map +1 -0
  75. package/build-types/entity-types/sidebar.d.ts +55 -0
  76. package/build-types/entity-types/sidebar.d.ts.map +1 -0
  77. package/build-types/entity-types/taxonomy.d.ts +83 -0
  78. package/build-types/entity-types/taxonomy.d.ts.map +1 -0
  79. package/build-types/entity-types/theme.d.ts +206 -0
  80. package/build-types/entity-types/theme.d.ts.map +1 -0
  81. package/build-types/entity-types/type.d.ts +71 -0
  82. package/build-types/entity-types/type.d.ts.map +1 -0
  83. package/build-types/entity-types/user.d.ts +93 -0
  84. package/build-types/entity-types/user.d.ts.map +1 -0
  85. package/build-types/entity-types/widget-type.d.ts +33 -0
  86. package/build-types/entity-types/widget-type.d.ts.map +1 -0
  87. package/build-types/entity-types/widget.d.ts +59 -0
  88. package/build-types/entity-types/widget.d.ts.map +1 -0
  89. package/build-types/entity-types/wp-template-part.d.ts +80 -0
  90. package/build-types/entity-types/wp-template-part.d.ts.map +1 -0
  91. package/build-types/entity-types/wp-template.d.ts +80 -0
  92. package/build-types/entity-types/wp-template.d.ts.map +1 -0
  93. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts +139 -0
  94. package/build-types/fetch/__experimental-fetch-link-suggestions.d.ts.map +1 -0
  95. package/build-types/fetch/__experimental-fetch-url-data.d.ts +35 -0
  96. package/build-types/fetch/__experimental-fetch-url-data.d.ts.map +1 -0
  97. package/build-types/fetch/index.d.ts +3 -0
  98. package/build-types/fetch/index.d.ts.map +1 -0
  99. package/build-types/hooks/constants.d.ts +7 -0
  100. package/build-types/hooks/constants.d.ts.map +1 -0
  101. package/build-types/hooks/index.d.ts +4 -0
  102. package/build-types/hooks/index.d.ts.map +1 -0
  103. package/build-types/hooks/memoize.d.ts +3 -0
  104. package/build-types/hooks/memoize.d.ts.map +1 -0
  105. package/build-types/hooks/use-entity-record.d.ts +124 -0
  106. package/build-types/hooks/use-entity-record.d.ts.map +1 -0
  107. package/build-types/hooks/use-entity-records.d.ts +49 -0
  108. package/build-types/hooks/use-entity-records.d.ts.map +1 -0
  109. package/build-types/hooks/use-query-select.d.ts +46 -0
  110. package/build-types/hooks/use-query-select.d.ts.map +1 -0
  111. package/build-types/hooks/use-resource-permissions.d.ts +99 -0
  112. package/build-types/hooks/use-resource-permissions.d.ts.map +1 -0
  113. package/build-types/index.d.ts +131 -0
  114. package/build-types/index.d.ts.map +1 -0
  115. package/build-types/locks/actions.d.ts +7 -0
  116. package/build-types/locks/actions.d.ts.map +1 -0
  117. package/build-types/locks/engine.d.ts +5 -0
  118. package/build-types/locks/engine.d.ts.map +1 -0
  119. package/build-types/locks/reducer.d.ts +10 -0
  120. package/build-types/locks/reducer.d.ts.map +1 -0
  121. package/build-types/locks/selectors.d.ts +5 -0
  122. package/build-types/locks/selectors.d.ts.map +1 -0
  123. package/build-types/locks/utils.d.ts +8 -0
  124. package/build-types/locks/utils.d.ts.map +1 -0
  125. package/build-types/name.d.ts +8 -0
  126. package/build-types/name.d.ts.map +1 -0
  127. package/build-types/queried-data/actions.d.ts +32 -0
  128. package/build-types/queried-data/actions.d.ts.map +1 -0
  129. package/build-types/queried-data/get-query-parts.d.ts +60 -0
  130. package/build-types/queried-data/get-query-parts.d.ts.map +1 -0
  131. package/build-types/queried-data/index.d.ts +4 -0
  132. package/build-types/queried-data/index.d.ts.map +1 -0
  133. package/build-types/queried-data/reducer.d.ts +54 -0
  134. package/build-types/queried-data/reducer.d.ts.map +1 -0
  135. package/build-types/queried-data/selectors.d.ts +16 -0
  136. package/build-types/queried-data/selectors.d.ts.map +1 -0
  137. package/build-types/reducer.d.ts +156 -0
  138. package/build-types/reducer.d.ts.map +1 -0
  139. package/build-types/resolvers.d.ts +74 -0
  140. package/build-types/resolvers.d.ts.map +1 -0
  141. package/build-types/selectors.d.ts +524 -0
  142. package/build-types/selectors.d.ts.map +1 -0
  143. package/build-types/types.d.ts +4 -0
  144. package/build-types/types.d.ts.map +1 -0
  145. package/build-types/utils/conservative-map-item.d.ts +12 -0
  146. package/build-types/utils/conservative-map-item.d.ts.map +1 -0
  147. package/build-types/utils/forward-resolver.d.ts +10 -0
  148. package/build-types/utils/forward-resolver.d.ts.map +1 -0
  149. package/build-types/utils/get-normalized-comma-separable.d.ts +12 -0
  150. package/build-types/utils/get-normalized-comma-separable.d.ts.map +1 -0
  151. package/build-types/utils/if-matching-action.d.ts +14 -0
  152. package/build-types/utils/if-matching-action.d.ts.map +1 -0
  153. package/build-types/utils/index.d.ts +9 -0
  154. package/build-types/utils/index.d.ts.map +1 -0
  155. package/build-types/utils/is-raw-attribute.d.ts +10 -0
  156. package/build-types/utils/is-raw-attribute.d.ts.map +1 -0
  157. package/build-types/utils/on-sub-key.d.ts +4 -0
  158. package/build-types/utils/on-sub-key.d.ts.map +1 -0
  159. package/build-types/utils/replace-action.d.ts +13 -0
  160. package/build-types/utils/replace-action.d.ts.map +1 -0
  161. package/build-types/utils/with-weak-map-cache.d.ts +12 -0
  162. package/build-types/utils/with-weak-map-cache.d.ts.map +1 -0
  163. package/package.json +13 -11
  164. package/src/entities.js +325 -0
  165. package/src/entity-types/attachment.ts +3 -4
  166. package/src/entity-types/comment.ts +3 -4
  167. package/src/entity-types/index.ts +31 -88
  168. package/src/entity-types/menu-location.ts +3 -4
  169. package/src/entity-types/nav-menu-item.ts +3 -4
  170. package/src/entity-types/nav-menu.ts +3 -3
  171. package/src/entity-types/page.ts +3 -3
  172. package/src/entity-types/plugin.ts +3 -3
  173. package/src/entity-types/post.ts +3 -3
  174. package/src/entity-types/settings.ts +3 -3
  175. package/src/entity-types/sidebar.ts +3 -4
  176. package/src/entity-types/taxonomy.ts +3 -4
  177. package/src/entity-types/theme.ts +7 -3
  178. package/src/entity-types/type.ts +3 -3
  179. package/src/entity-types/user.ts +3 -3
  180. package/src/entity-types/widget-type.ts +3 -4
  181. package/src/entity-types/widget.ts +3 -3
  182. package/src/entity-types/wp-template-part.ts +3 -4
  183. package/src/entity-types/wp-template.ts +3 -4
  184. package/src/hooks/index.ts +4 -0
  185. package/src/hooks/test/use-entity-record.js +41 -1
  186. package/src/hooks/test/use-resource-permissions.js +32 -36
  187. package/src/hooks/use-entity-record.ts +18 -6
  188. package/src/hooks/use-entity-records.ts +2 -0
  189. package/src/hooks/use-query-select.ts +4 -1
  190. package/src/hooks/use-resource-permissions.ts +84 -20
  191. package/src/index.js +0 -5
  192. package/src/resolvers.js +36 -24
  193. package/src/selectors.ts +202 -341
  194. package/tsconfig.json +21 -0
  195. package/tsconfig.tsbuildinfo +1 -0
  196. package/build/entity-types/entities.js +0 -6
  197. package/build/entity-types/entities.js.map +0 -1
  198. package/build-module/entity-types/entities.js +0 -2
  199. package/build-module/entity-types/entities.js.map +0 -1
  200. package/src/entities.ts +0 -548
  201. package/src/entity-types/entities.ts +0 -130
package/tsconfig.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "rootDir": "src",
5
+ "declarationDir": "build-types",
6
+ "noUnusedParameters": false,
7
+ "checkJs": false,
8
+ "noImplicitAny": false
9
+ },
10
+ "references": [
11
+ { "path": "../api-fetch" },
12
+ { "path": "../data" },
13
+ { "path": "../deprecated" },
14
+ { "path": "../element" },
15
+ { "path": "../html-entities" },
16
+ { "path": "../i18n" },
17
+ { "path": "../is-shallow-equal" },
18
+ { "path": "../url" }
19
+ ],
20
+ "include": [ "src/**/*" ]
21
+ }
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/@types/lodash/common/common.d.ts","../../node_modules/@types/lodash/common/array.d.ts","../../node_modules/@types/lodash/common/collection.d.ts","../../node_modules/@types/lodash/common/date.d.ts","../../node_modules/@types/lodash/common/function.d.ts","../../node_modules/@types/lodash/common/lang.d.ts","../../node_modules/@types/lodash/common/math.d.ts","../../node_modules/@types/lodash/common/number.d.ts","../../node_modules/@types/lodash/common/object.d.ts","../../node_modules/@types/lodash/common/seq.d.ts","../../node_modules/@types/lodash/common/string.d.ts","../../node_modules/@types/lodash/common/util.d.ts","../../node_modules/@types/lodash/index.d.ts","../../node_modules/@types/uuid/index.d.ts","../api-fetch/build-types/types.d.ts","../api-fetch/build-types/middlewares/nonce.d.ts","../api-fetch/build-types/middlewares/preloading.d.ts","../api-fetch/build-types/middlewares/root-url.d.ts","../api-fetch/build-types/middlewares/fetch-all-middleware.d.ts","../api-fetch/build-types/middlewares/media-upload.d.ts","../api-fetch/build-types/index.d.ts","../url/build-types/is-url.d.ts","../url/build-types/is-email.d.ts","../url/build-types/get-protocol.d.ts","../url/build-types/is-valid-protocol.d.ts","../url/build-types/get-authority.d.ts","../url/build-types/is-valid-authority.d.ts","../url/build-types/get-path.d.ts","../url/build-types/is-valid-path.d.ts","../url/build-types/get-query-string.d.ts","../url/build-types/build-query-string.d.ts","../url/build-types/is-valid-query-string.d.ts","../url/build-types/get-path-and-query-string.d.ts","../url/build-types/get-fragment.d.ts","../url/build-types/is-valid-fragment.d.ts","../url/build-types/add-query-args.d.ts","../url/build-types/get-query-arg.d.ts","../url/build-types/get-query-args.d.ts","../url/build-types/has-query-arg.d.ts","../url/build-types/remove-query-args.d.ts","../url/build-types/prepend-http.d.ts","../url/build-types/safe-decode-uri.d.ts","../url/build-types/safe-decode-uri-component.d.ts","../url/build-types/filter-url-for-display.d.ts","../url/build-types/clean-for-slug.d.ts","../url/build-types/get-filename.d.ts","../url/build-types/normalize-path.d.ts","../url/build-types/index.d.ts","../../node_modules/utility-types/dist/aliases-and-guards.d.ts","../../node_modules/utility-types/dist/mapped-types.d.ts","../../node_modules/utility-types/dist/utility-types.d.ts","../../node_modules/utility-types/dist/functional-helpers.d.ts","../../node_modules/utility-types/dist/index.d.ts","../deprecated/build-types/index.d.ts","./src/queried-data/actions.js","../../node_modules/rememo/rememo.d.ts","./src/utils/conservative-map-item.js","./src/utils/get-normalized-comma-separable.js","./src/types.ts","./src/utils/if-matching-action.js","./src/utils/forward-resolver.js","./src/utils/on-sub-key.js","./src/utils/replace-action.js","./src/utils/with-weak-map-cache.js","./src/utils/is-raw-attribute.js","./src/utils/index.js","./src/queried-data/get-query-parts.js","./src/queried-data/selectors.js","../data/build-types/components/with-select/index.d.ts","../data/build-types/components/with-dispatch/index.d.ts","../../node_modules/@types/react/global.d.ts","../../node_modules/@types/react/node_modules/csstype/index.d.ts","../../node_modules/@types/prop-types/index.d.ts","../../node_modules/@types/scheduler/tracing.d.ts","../../node_modules/@types/react/index.d.ts","../data/build-types/components/with-registry/index.d.ts","../../node_modules/redux/index.d.ts","../data/build-types/types.d.ts","../data/build-types/components/use-dispatch/use-dispatch.d.ts","../data/build-types/components/use-dispatch/use-dispatch-with-map.d.ts","../data/build-types/components/use-dispatch/index.d.ts","../data/build-types/components/async-mode-provider/use-async-mode.d.ts","../data/build-types/components/async-mode-provider/context.d.ts","../data/build-types/components/async-mode-provider/index.d.ts","../data/build-types/registry.d.ts","../data/build-types/controls.d.ts","../data/build-types/redux-store/index.d.ts","../data/build-types/plugins/persistence/index.d.ts","../data/build-types/plugins/index.d.ts","../data/build-types/components/registry-provider/use-registry.d.ts","../data/build-types/components/registry-provider/context.d.ts","../data/build-types/components/registry-provider/index.d.ts","../data/build-types/components/use-select/index.d.ts","../data/build-types/factory.d.ts","../data/build-types/index.d.ts","../../node_modules/no-case/dist/index.d.ts","../../node_modules/pascal-case/dist/index.d.ts","../../node_modules/camel-case/dist/index.d.ts","../../node_modules/capital-case/dist/index.d.ts","../../node_modules/constant-case/dist/index.d.ts","../../node_modules/dot-case/dist/index.d.ts","../../node_modules/header-case/dist/index.d.ts","../../node_modules/param-case/dist/index.d.ts","../../node_modules/path-case/dist/index.d.ts","../../node_modules/sentence-case/dist/index.d.ts","../../node_modules/snake-case/dist/index.d.ts","../../node_modules/change-case/dist/index.d.ts","../i18n/build-types/sprintf.d.ts","../hooks/build-types/createAddHook.d.ts","../hooks/build-types/createRemoveHook.d.ts","../hooks/build-types/createHasHook.d.ts","../hooks/build-types/createDoingHook.d.ts","../hooks/build-types/createDidHook.d.ts","../hooks/build-types/index.d.ts","../hooks/build-types/createHooks.d.ts","../i18n/build-types/create-i18n.d.ts","../i18n/build-types/default-i18n.d.ts","../i18n/build-types/index.d.ts","./src/entities.js","./src/queried-data/reducer.js","./src/queried-data/index.js","./src/batch/default-processor.js","./src/batch/create-batch.js","./src/batch/index.js","./src/name.js","./src/actions.js","../element/build-types/react.d.ts","../element/build-types/create-interpolate-element.d.ts","../../node_modules/@types/react-dom/index.d.ts","../element/build-types/react-platform.d.ts","../element/build-types/utils.d.ts","../element/build-types/platform.d.ts","../element/build-types/serialize.d.ts","../element/build-types/raw-html.d.ts","../element/build-types/index.d.ts","./src/entity-provider.js","../is-shallow-equal/build-types/objects.d.ts","../is-shallow-equal/build-types/arrays.d.ts","../is-shallow-equal/build-types/index.d.ts","./src/reducer.js","./src/entity-types/helpers.ts","./src/entity-types/base-entity-records.ts","./src/entity-types/attachment.ts","./src/entity-types/comment.ts","./src/entity-types/menu-location.ts","./src/entity-types/nav-menu.ts","./src/entity-types/nav-menu-item.ts","./src/entity-types/page.ts","./src/entity-types/plugin.ts","./src/entity-types/post.ts","./src/entity-types/settings.ts","./src/entity-types/sidebar.ts","./src/entity-types/taxonomy.ts","./src/entity-types/theme.ts","./src/entity-types/user.ts","./src/entity-types/type.ts","./src/entity-types/widget.ts","./src/entity-types/widget-type.ts","./src/entity-types/wp-template.ts","./src/entity-types/wp-template-part.ts","./src/entity-types/index.ts","./src/selectors.ts","./src/resolvers.js","./src/locks/utils.js","./src/locks/reducer.js","./src/locks/selectors.js","./src/locks/engine.js","./src/locks/actions.js","../html-entities/build-types/index.d.ts","./src/fetch/__experimental-fetch-link-suggestions.js","./src/fetch/__experimental-fetch-url-data.js","./src/fetch/index.js","../../node_modules/memize/index.d.ts","./src/hooks/memoize.js","./src/hooks/constants.ts","./src/hooks/use-query-select.ts","./src/hooks/use-entity-record.ts","./src/hooks/use-entity-records.ts","./src/hooks/use-resource-permissions.ts","./src/hooks/index.ts","./src/index.js"],"fileInfos":[{"version":"aa9fb4c70f369237c2f45f9d969c9a59e0eae9a192962eb48581fe864aa609db","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","eb75e89d63b3b72dd9ca8b0cac801cecae5be352307c004adeaa60bc9d6df51f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"e54c8715a4954cfdc66cd69489f2b725c09ebf37492dbd91cff0a1688b1159e8","affectsGlobalScope":true},{"version":"51b8b27c21c066bf877646e320bf6a722b80d1ade65e686923cd9d4494aef1ca","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"2c8c5ee58f30e7c944e04ab1fb5506fdbb4dd507c9efa6972cf4b91cec90c503","affectsGlobalScope":true},{"version":"2bb4b3927299434052b37851a47bf5c39764f2ba88a888a107b32262e9292b7c","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"df9c8a72ca8b0ed62f5470b41208a0587f0f73f0a7db28e5a1272cf92537518e","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"93544ca2f26a48716c1b6c5091842cad63129daac422dfa4bc52460465f22bb1","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"7435b75fdf3509622e79622dbe5091cf4b09688410ee2034e4fc17d0c99d0862","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"9f1817f7c3f02f6d56e0f403b927e90bb133f371dcebc36fa7d6d208ef6899da","affectsGlobalScope":true},{"version":"cd6efb9467a8b6338ece2e2855e37765700f2cd061ca54b01b33878cf5c7677e","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"4632665b87204bb1caa8b44d165bce0c50dfab177df5b561b345a567cabacf9a","affectsGlobalScope":true},"675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","438284c7c455a29b9c0e2d1e72abc62ee93d9a163029ffe918a34c5db3b92da2","0c75b204aed9cf6ff1c7b4bed87a3ece0d9d6fc857a6350c0c95ed0c38c814e8","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","82251920b05f30981c9a4109cb5f3169dce4b477effc845c6d781044a30e7672","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","9fa6b83a35e897f340858995ca5d77e901d89fd18644cd4c9e8a4afe0b2e6363",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"fab58e600970e66547644a44bc9918e3223aa2cbd9e8763cec004b2cfb48827e","6aae23700d45e8ac7ca7e269047aed3eecc64ce87c8fa5e52f2d98e280bd04ef","6b3d3ecbf6958624910af080a873cd84b5b99d513eb52147f18fe04a51cb19ce","ea9b95f45cd90b16200134d1f79e36380d57b866300b479b3e5b62a6dbeb92bb","14bc80bd2cb4c72aaaf27cfcdb62377cf3e3366f9e9045fa8ca232629457aca9","ff164c4671955c882140da80d0a6a69552ba5c2ddce3969f74c5c9d63683744b","dca26c859f7b4b8cf118dc9b5e99d295a3031bbd980e488819ed830ba769b890","1152220b82b14ecd456908cf61b6089b49596278eace0d10030384f8e31ba5ee","91265e9c2705df9edc7d912afe177cb9dbe4bd4fe254cc43466885544c065013","81e7db9916d6ce0323656530cb9aba444450454e5a8f3d0108f04931abb36258","7858aa21ac91fef2c9cdf96b3ae00e025efed2920ffca40a75df452d4f5a9576","eb80dedcd92c17d93f403e736e1c3e2aef39379841070221a353a7c13b57369f","029f3a1e2534e85a7cd00f3e79781003e0bcf5147d96db93594ace839803c6cf","2eea9984a7ea08e576d2970ba65a65ebba02699bccdbd0d3a08bb141e15972a1","308246446616acc5397747f35fa8788de7e6ba6cd5dc0ec2752bd75eafefcdb9","9677ef56e52539a73f1d9b89c692cf866d05017b05d9d2fe8cd35a30b42c2d47","6048b5c50d6486b1084b036a7f7d6c76c032d90cc2186f79b344a12ceb488511","26885abe66e07fd38da599d5fc9b4fa8b2df803c56e9bba99a2505e0b982c042","507dc7647a71c90e8cce85259c624b355c22e0dee1833aa4ba20c15a4f5bd21a","c30aaf3d189be8c29b2d3a7761e94b5b532fec6ba0caa74d07a4c1056469acf0","454217fe7beba4cb5497d4bc7fd3116437ce85e5217eb66f3b367fbcbfd45861","65e1ffb7b2343a1814c5cb85164f7d26bce1477b2cf04e6736f37732bc4801d6","3f810d7cac3e3729241d52d667538dc4ca27687f5d40d91f4cb5bce955df5f94","a2bedf5636ce572e507823229c9b7d4e87d97830497822d76e95a971fee78c92","17ab13eba7cde42ca7c95110c7eda405ba6aba7471437d912078d67dfada98eb","f7e734ca25cb0e8c52247b9a7d98f81ffd6ac52485bf9d8938fdbd4d828f469c","5261283f0b521fc1f255a060dcd86986985bd516822b69bb5504392462962899","44e20ca481bcc2abec1f4fcf54139caa4389f1bc16e3ee9d19a10e522903e9ab","a31eda6fcbf86596f69f7c18e6d13af58191fdc9c9620bcc67595fd9e49043ab","c93085fa9e5e568c0a45f64caa05e713fd5438e93d32f5970753e44910bdd540","1e442333978b5864818023d54d4f2e2aa0cbdfb2b486a0d43c900a7a87d61d1d","f215ce6766668f37f5e4652d0facdf55816f24aa5fc6f68c5e33754dbe5219fb","e900ec60297a15c4de70ddaade026ea4fe635e27c286fedd82dd5e963daa1930","e4e975c7339a9579209f12246e95f95216aa3558b8e7719fea2fbadaf28c574b","178efee8d4335cb61ec45c10e6de6d7afe48028963c5633f5937f25eaffa2387","bd0d80db12ef1aceefc4f9d3eb88517b9634fa747ae8475981da8655292feab8","55e68fb1618e3f55f7866b8c8415152159309a14b716370081ab0b7af96d876e","bf0491af2455f92282b61807be2be6e7ad7d532e47fac7b698019d3617c28ff7","5d874fb879ab8601c02549817dceb2d0a30729cb7e161625dd6f819bbff1ec0b","ee551a880882770c4f56a0964a9767c9feafe497a5be52652527d098c88d85cb","b192606574769a5566620f9bf19358a3994bc2726ecdeaad9c66f3333b2687c8","acc22baecb7e578a5639f47b09e19de1d81ec91cf762d6f91d68297b10c63177","d83d6ec306241a9a59716eadf007d405cbc9d77b688871089a02159087100d5c","bcfac9632a790e732341b5009a60e86d72da1d2cc383c1796a66d233c5942c6f","0292552bfdda78ed1910905ea046a336186ce82d9fab516ea21616f47147ccdc","78673ec3910aff07d76d2a24b460523c69d50afadfcd836cd9a022ad1a3ebfc2","ff41da7aeac53e419a3a7eb792ea03c77cf05e44d379dfa2190920bfe6dde09b","849507adfc66cfedda67c3384a1ec078c542263589413c5b31c195aee25dc1f2","c30b952d25562463882bbbaac6242e2cb47cd342c27388f46e4b7b0c98a4b659","c32e26a53123519e9bcf0aa960cc0a5dfb3ecebcc27fe0ccc649702b45da1e2a","59688ffdb24f7f057e35f54280e90bda1e57efee745479a1bb98321b263870e8","95d027d78b9577e00f9d4e0eba816fd21f1b2927c801f89a1db8369b837471c3","9f1a1489db159ad8956dfa60d68a51f7a740f644385220af1ccfde5d5fba79c6","91faeb8163ec860e5b5c02eda51cd16e64de95baaadfec34e0fbd9d39176ed8a","b94c955213263a318d4ab2f33479464e1ee5551b9b29859b9084f4b741dc7ed6","a355bc3ad1c78a74de3dd67cc484ea4667a3f28f7d5384bcc10d0f1a2a506901","cb1063fcd20e601b70c6ce424597018ef658b4aa5ff4bf6514a351a9222238da",{"version":"ecf78e637f710f340ec08d5d92b3f31b134a46a4fcf2e758690d8c46ce62cba6","affectsGlobalScope":true},"381899b8d1d4c1be716f18cb5242ba39f66f4b1e31d45af62a32a99f8edcb39d","f7b46d22a307739c145e5fddf537818038fdfffd580d79ed717f4d4d37249380","f5a8b384f182b3851cec3596ccc96cb7464f8d3469f48c74bf2befb782a19de5",{"version":"1bc82f5b3bb93df76d19730c84467b0b346187198537135d63a672956f323720","affectsGlobalScope":true},"a958d081d81c1194d1878b28f081d0144d95f4e36c6b375e357cb982e8b40705",{"version":"8f19251323456195ec9236df857bac3b8f97b73b540ef06ead2ceccc3884954f","affectsGlobalScope":true},"125f94cba85ffdcd5c682bfda4739c07d994e50715b7cd8a0217c1cf50695cfe","6fca127aadf9a3a6ec914442d3995cdca17a9d1b337138da166d65663921dcac","d23aeb9ad9955d3b6df7a972355dd465aaa0f7b8c223834f9499585b75f2ab04","cf000108177216c2ffd9962c785dfe0eb36306b14817894115be2d8f470552d6","61937532d01a86bc9f9847e016305cec9b5a716db5a630a0c37049a477d18f60","c792ecb733fc79337b7b497d3298dc31217f0f2b944ade255037dea871915353","61e8a34952f23c48deff3e85e982b1b3a600d15fb4d3b7c07a9096505ad2c35c","4fe57f4d9ea10f6069813ca18818838ce21258f42e79f898b4fb7860ce0c58ca","1e525db7ea2d7369211b74756f1034e4219134c3c99c0e147998caf43b10e017","4d3af9c3e4d7e0b2eeed3f0eb0190aaaaa6655a63275fbc2f5d6a7cde8aa70ec","d2c8976d6e6874ce159fc31c8511fffde72dcdf230394750ea4ef3c02a32e52e","fb6fa5434ecf7670f3dba36bced663afe875282d1231fb3ae95eeedae85ce4cf","e4cb6f9e4d40f538e26c72cc81ebd8ebae3317f940f39696e30d1381f36e5a0a","30289252a73fce7ff4b88369c829ed1f8533ccc028c55b264fc96fb576ffdd6a","3f473bb1c974b627227610013561332ea2f8e6eed0e86e87eaef96b6146d28c8","c841bf19529e2909275a743e54d43dadc52671909fa27db84f965c4fa5ec3b6f","c8bd10b6cdcb527ce859b9c5b4b6168f270cec11cb051cc77eb4dead206b5e0f","19179e07983759a8dd6adeb0c6e5c6a9525564aa986123d426171bd586791d21","b4e123af1af6049685c93073a15868b50aebdad666d422edc72fa2b585fa8a37","f86c04a744ebcede96bac376f9a2c90f2bd3c422740d91dda4ca6233199d4977","6ae1bddee5c790439bd992abd063b9b46e0cadd676c2a8562268d1869213ff60","606244fc97a6a74b877f2e924ba7e55b233bc6acb57d7bf40ba84a5be2d9adb0","4a1cabac71036b8a14f5db1b753b579f0c901c7d7b9227e6872dadf6efb104e8","062959a1d825b96639d87be35fe497cbd3f89544bf06fdad577bbfb85fcf604c","4c3672dc8f4e4fdd3d18525b22b31f1b5481f5a415db96550d3ac5163a6c3dd3","f9a69ca445010b91fe08f08c06e0f86d79c0d776905f9bdb828477cb2a1eb7fc","ad7fd0e7ee457d4884b3aaecbcbd2a80b6803407c4ce2540c296170d4c7918ef","a50ef21605f41c6acad6c3ef0307e5311b94963c846ca093c764b80cdb5318d6","74b4035dd26d09a417c44ca23ab5ee69b173f8c2f6b2e47350ab0795cf2d4a17","918f86ee2b19cc38cb8b1a4cf8f223eb228aaa39df3604c42f700fac2f0b3ea1","762bc52248d3fab9873c7af564caf622358312cb35de42a4393b71cc36e14621","d02ec79cefaf292fae64b3be5a4416e64b4e420a6429fd458fac6e1bb4c7950e","27abed653f600ea0d5c86e94181beb42824e0f3f16337e2f9e7e9e9c2c392edf","d7871e0e653aa7197fee88886db5678bee6d42164c1f36e4bce9421ddfa7ca49","11ed10bdb3bcc99893570507eac8fece4840add97ee1d4f5a7fbf41cbfdea0d4","429fb571d3db07d3eaa2e74d43eb4190ece3e0de832ed564aeeaf08873e598eb","406d52bf33d618d846aa0d831ee004290567e328edcd4517bbff2937cc977abf","d3060e0810fc0d0dc009e6f086ef413d3c8aeaaf07da25c8d25fd4e181646acf","c0306658efb85764bb6d8d55097007c68a70539b24d0e18fb6edd6eb1778f632","08f7e6ffa66c66a636aecc5acbeb998215d9d09ccba0c558afb7df7e218edeaf","f829eb39aea4487f0ff94a42c56a1a73bc5202bbdeb03f7a638e4ab3e290d017","549d265a212fb5157c8919a4115e83529d0efadb9ab3bd674bc75e5df0fdf403","822d9ef74bb29e9b0362f9008b3bd1eec6d755ae3370839234282547aab95016","87f792436b033580a1dcc908d15851e4a5d3d7aa68b1d1c6a142706ef8b154a3","647dd8fd86e81524dc5915ec4997b8fc66d4a86ac2e37cde40e903ba1b349cb9","56a3aef852aa146f9fe362a1d09e13dae20f3794d33f66b371829348a8ee0e62","07c14b3359e3ed5607c690b9f421f84dd93887e06416d52f60889b4082030464","063f439998b87e20f46fa82cb793c5aae5c2d714a26bb8221e07f5d4c82c989d","573c9d08965a7fff6d8c08b20e525b10fdc5ba44c2feeda5b16edd6e4fd64dd0","e59d00012fb20e6746def2f4bc94650526aa6c574c49ad6a50a992f61a3ee675","e47b8ec56eb49bc1c53c9012daa9874de14ad0c5da442485aec333571c74b526","45a63e17814c570ea59407f231ef9c561510bd6edb36f17479b09b44619496c6","5d7018910750d9cb4a912577ad2951fc3fad83c30d637689b69ffc6bbb0c9f5a","d2d9e98a2b167079474768593e1e7125fc3db055add8fbdb5977e3d05a8a3696","6462da67490105ba7d98cf312c2faf8794c425781128b161ea8394d66502eec8","62359da52b6c8d00c50c2e50738fac82e902f916fdf458d8159e7edb1c60c3a8","1e0ac21bc775686383ea8c8e48bd98b385e6195b25c85525a7affd08a2cd38b9","0449615e1ed03c7d54fc435a63b7ef0cb4e5cea5ac40c9a63280a46f7eeae0ff","cbe4710c187acaa5f02b08715c1563fdad82764462654043eb68232ecb626b8d","5190f1a110a789c2f8ed8dcf2da6ce122dcb74249d0c01d19d1ed0b1c6bb02a1","3650bbe137c9c44bc6b8f44a56353b00eba9654e41a9355e6228f7f0f464c648","9c4f32d2fa2b6efeed4f9fbd98254121b17982110b48edcede96e2dc2af0894d","17dde5686b18dc71dbfd971a083498509a4bd1434f1f3b0566b1eb679441f167","a3dcfa473fb451f89860a5dc83f1994fccd151af55a87683cb6dffc0abba782b","40b369b61fd0bede44a39611baae531e6d46a718b705b9b45c5add4711f19744","225a94e9b80d9ed325a5996ddf6e8e8ec1e35d0cc78ce63b4f7bc3109c41fcfd","220b6ba3c2274aada1b2a9ad69f6966c8d36de546e708fe2b42425a265a48e2a","29733740a84bde4ceebd6415c3a47d36c9a956fdddeacec49a664665a54018b0","6e603a0983306db957764528f138c4897f0391799f876c4c1b46226c0dd8cef2","36d8781b9aa56efc6c8e0c6366ecdebf7327a2ac5b1e1490de1ad5a911457bb1","e8184f498bb78351e6d6f9fe654279d9882d58dd822a9a1178a96e7570262502","ff0a6ed7e754b2cfb1a907578f1c335b4c5ace714a5adb956f94d6192b17f078","bd3086a825d96259e7a1c79ad1bb13749d41cb79ba4336ba813cc65cbd51fd74","46adb1b5ccc5123a4592a20c1c56c8c7ef34d9b2ea43b16a271587ac2076728f","a32f1f8649b0e898d4a54e1860effc7f48dd285bc99f83dc35ccf85203736b3b","beacf8337f15a959b6e4d95d7b55432af842b0484da0f0d342a0dd75beab8fe3","8800447dd5175024126c56daa37ee888e507a5b4cb010790ccc86530a46424fb","cd04b594271be8b8eca1453116f1591ba60ce64d80183b07765a4b5e811966ea","c2c2c6c7ab6fd08050cc906a2230657bd7ae25365a38db7a4c2f84980133d0cf","8199ff7448213d4633834954dad4e5a5e7ed2e14fcfd3f5a1b53d156a1cd9972","327bc1d7e826f1be1b18c51b3444a2dfc66d3f810b43ff5f32b26587db3ea1d2","8818dcc765cb9236f6a01aaa837a3612271777a26ffbd29282a3c282f8704649","d461fc73e0721ae92652f11a61cd1014a0698fb7ddb81beac1aa7d09aa139abb","83ff1f6f71ab0ea7a2a725a864d70672acadada85bba149552c8d815684d90ea","3b5f3c05c1a13e8eaa38abc36a6452a68140cce157a0d7ee88e0695770696300","368eeb714465ced0e24057e40707a9e064d214774b3d7eb7f129cb24e2903b18","b5f5bbc6d622c252fc13b512ed42cafd65019768e3f0430637e517d9be69547f","71fce7a0dc64feb145e0f58842f43984a2e9ecd79861d8ad7315c0d272575275","066db40ccd6c90d1e57e9f163458713463d4e2771c156acf9ffb7f258646946e","2366b3f634513f748f1cc92ba9a5b015b39cf0195e25c942e3d844721f0e233d","667a5fe656b9e0bf163b829ad74d679c56e82c83456a7c5387ffca0d1f901e5e","d93931264950da279434192bb043f8e379b4a0959bcd294ca89c8b89e1a6772b","3a1cab834f4a3ceedd0dfe8c00b9ca84431454cad8730eef0d0a18d1c0f7a7aa","8d8b84756b85d1dd9d3a60d54f4410b892f931d46560f60ddc44a4decb8f9ee4","902abf1b6aeb2908452ad206db72b0d39029e000a28dff529751585a4e7e5f07","68e39d827a3bd5054e54a433fc90c118941096eb3e9f432b28ea5f88b0fe77b1","691a13dbde331d5bcce65e1463f924b78ad046c0c05ec57bca010e6435de8905","0f112494322a7ecb5dda1823f0f84255451a51d2ad862a0ae1014d361f0257de","bca410625e15b9622626f7ae8aa445153232e0d45e46f0e8dbcd632d735c8e47","e1802d98bc1c1b96b44ea5bb57126dc9757c9b99d87ee997af0ffe1d33afbdb0","4e6521886023150c01f961b93a382645704a6e42739c8277f3abd1a61806243c","e6295247cd02955c7385b55efa603d19c4d9330b1343937a9b1c023e346f1ab5","a1473225afc48a471cde6656263736febf2dc83543ad10ef66936f7ed71b2fe3","fadb19eb44c06b59275ad6f620324ea297cbaa20f744ca09d9d83ae122bee14c"],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"importsNotUsedAsValues":2,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitAny":false,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":false,"rootDir":"./src","strict":true,"target":99},"fileIdsList":[[45,47,48,49,50,51,52,53,54,55,56,57],[45,46,48,49,50,51,52,53,54,55,56,57],[46,47,48,49,50,51,52,53,54,55,56,57],[45,46,47,49,50,51,52,53,54,55,56,57],[45,46,47,48,50,51,52,53,54,55,56,57],[45,46,47,48,49,51,52,53,54,55,56,57],[45,46,47,48,49,50,52,53,54,55,56,57],[45,46,47,48,49,50,51,53,54,55,56,57],[45,46,47,48,49,50,51,52,54,55,56,57],[45,46,47,48,49,50,51,52,53,55,56,57],[45,46,47,48,49,50,51,52,53,54,56,57],[45,46,47,48,49,50,51,52,53,54,55,57],[45,46,47,48,49,50,51,52,53,54,55,56],[119],[115,116,117,118],[141],[140],[140,141,142,143,144,145,146,147,148,149,150],[143],[145],[93,94,95,96],[93],[94],[59,60,61,62,63,64],[59],[57,58,65,92,98,163,165,168,169],[166],[65],[166,167],[57,65,151,162,170],[139,163,169,179],[185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204],[205],[65,92,162,213],[65,92],[214,215],[221,222,223],[217],[98,139,179,219,220,225],[92,98,220,221,225],[139,218,219],[98,219,220,225],[139,163,169,170,180,184,205,206,207,212,216,224],[211],[209,210],[208],[57],[92,110],[99,112,164],[57,110,111,139,163],[57,100,111],[57,103,110,139,163,165,183],[65,92,110,151,163,169],[57,92,98,100,110,139,163,165,169,205],[103],[101,102,104,105,106,107,108,109],[126,127],[119,129],[134,135],[123,124],[122],[113,114,120,122,125,128,129,130,131,133,136,137,138],[132],[129],[121],[97],[171],[171,172,174,175,176,177,178],[173],[119,171],[158],[153,154,155,156,157,158],[153,154,155,156,157,159],[158,159],[160],[152,160,161],[181,182],[183],[81],[66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91]],"referencedMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[173,14],[119,15],[142,16],[143,17],[151,18],[144,17],[145,17],[146,19],[147,20],[141,17],[148,20],[149,17],[150,20],[97,21],[94,22],[95,23],[65,24],[63,25],[64,25],[60,25],[61,25],[62,25],[170,26],[167,27],[166,28],[168,29],[163,30],[180,31],[187,32],[188,32],[185,33],[205,32],[189,32],[191,32],[190,32],[192,32],[193,32],[194,32],[195,32],[196,32],[197,32],[198,32],[200,32],[199,32],[202,32],[201,32],[204,32],[203,32],[214,34],[215,35],[216,36],[224,37],[218,38],[221,39],[222,40],[220,41],[223,42],[225,43],[212,44],[211,45],[209,46],[210,46],[99,47],[111,48],[165,49],[164,50],[112,51],[184,52],[207,53],[206,54],[101,47],[104,55],[110,56],[106,55],[107,55],[127,14],[128,57],[135,58],[136,59],[125,60],[123,61],[137,61],[120,14],[130,61],[139,62],[133,63],[132,64],[131,61],[129,61],[122,65],[98,66],[172,67],[179,68],[178,14],[174,69],[171,14],[177,70],[153,71],[157,71],[156,71],[155,71],[159,72],[154,71],[158,73],[160,74],[161,75],[162,76],[183,77],[181,78],[82,79],[92,80]],"exportedModulesMap":[[46,1],[47,2],[45,3],[48,4],[49,5],[50,6],[51,7],[52,8],[53,9],[54,10],[55,11],[56,12],[57,13],[173,14],[119,15],[142,16],[143,17],[151,18],[144,17],[145,17],[146,19],[147,20],[141,17],[148,20],[149,17],[150,20],[97,21],[94,22],[95,23],[65,24],[63,25],[64,25],[60,25],[61,25],[62,25],[170,26],[167,27],[166,28],[168,29],[163,30],[180,31],[187,32],[188,32],[185,33],[205,32],[189,32],[191,32],[190,32],[192,32],[193,32],[194,32],[195,32],[196,32],[197,32],[198,32],[200,32],[199,32],[202,32],[201,32],[204,32],[203,32],[214,34],[215,35],[216,36],[224,37],[218,38],[221,39],[222,40],[220,41],[223,42],[225,43],[212,44],[211,45],[209,46],[210,46],[99,47],[111,48],[165,49],[164,50],[112,51],[184,52],[207,53],[206,54],[101,47],[104,55],[110,56],[106,55],[107,55],[127,14],[128,57],[135,58],[136,59],[125,60],[123,61],[137,61],[120,14],[130,61],[139,62],[133,63],[132,64],[131,61],[129,61],[122,65],[98,66],[172,67],[179,68],[178,14],[174,69],[171,14],[177,70],[153,71],[157,71],[156,71],[155,71],[159,72],[154,71],[158,73],[160,74],[161,75],[162,76],[183,77],[181,78],[82,79],[92,80]],"semanticDiagnosticsPerFile":[46,47,45,48,49,50,51,52,53,54,55,56,57,117,173,115,119,116,118,58,142,143,151,144,145,146,217,140,147,141,148,121,100,149,150,10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,41,42,43,1,9,44,93,96,97,94,95,65,63,64,60,61,62,59,170,167,166,168,163,180,187,186,188,185,205,189,191,190,192,193,194,195,196,197,198,200,199,202,201,204,203,214,215,216,219,224,218,221,222,220,223,225,212,211,209,210,208,169,99,111,165,164,112,184,207,206,103,101,105,102,104,110,109,106,107,108,127,128,126,135,136,134,125,124,123,137,114,120,113,130,138,139,133,132,131,129,122,98,172,179,176,178,174,171,177,175,153,157,156,155,159,154,158,213,160,161,162,152,182,183,181,80,75,89,88,70,90,78,77,72,68,81,82,74,83,92,67,66,71,79,73,69,76,91,85,84,87,86]},"version":"4.4.2"}
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=entities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=entities.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","sourcesContent":[]}
package/src/entities.ts DELETED
@@ -1,548 +0,0 @@
1
- /**
2
- * External dependencies
3
- */
4
- import { upperFirst, camelCase, map, find, get, startCase } from 'lodash';
5
-
6
- /**
7
- * WordPress dependencies
8
- */
9
- import apiFetch from '@wordpress/api-fetch';
10
- import { __ } from '@wordpress/i18n';
11
-
12
- /**
13
- * Internal dependencies
14
- */
15
- import { addEntities } from './actions';
16
- import type * as Records from './entity-types';
17
- import type {
18
- EntityType,
19
- Context,
20
- Post,
21
- Taxonomy,
22
- Type,
23
- Updatable,
24
- } from './entity-types';
25
-
26
- export const DEFAULT_ENTITY_KEY = 'id';
27
-
28
- const POST_RAW_ATTRIBUTES = [ 'title', 'excerpt', 'content' ];
29
-
30
- type AttachmentEntity< C extends Context = Context > = EntityType<
31
- {
32
- name: 'media';
33
- kind: 'root';
34
- baseURLParams: { context: 'edit' };
35
- },
36
- Records.Attachment< C >,
37
- C
38
- >;
39
-
40
- const attachmentConfig: AttachmentEntity[ 'config' ] = {
41
- name: 'media',
42
- kind: 'root',
43
- baseURL: '/wp/v2/media',
44
- baseURLParams: { context: 'edit' },
45
- plural: 'mediaItems',
46
- label: __( 'Media' ),
47
- rawAttributes: [ 'caption', 'title', 'description' ],
48
- };
49
-
50
- type SiteEntity< C extends Context = Context > = EntityType<
51
- {
52
- name: 'site';
53
- kind: 'root';
54
- },
55
- Records.Settings< C >,
56
- C
57
- >;
58
-
59
- const siteConfig: SiteEntity[ 'config' ] = {
60
- label: __( 'Site' ),
61
- name: 'site',
62
- kind: 'root',
63
- baseURL: '/wp/v2/settings',
64
- getTitle: ( record: Records.Settings< 'edit' > ) => {
65
- return get( record, [ 'title' ], __( 'Site Title' ) );
66
- },
67
- };
68
-
69
- type PostTypeEntity< C extends Context = Context > = EntityType<
70
- {
71
- name: 'postType';
72
- kind: 'root';
73
- key: 'slug';
74
- baseURLParams: { context: 'edit' };
75
- },
76
- Records.Type< C >,
77
- C
78
- >;
79
-
80
- const postTypeConfig: PostTypeEntity[ 'config' ] = {
81
- label: __( 'Post Type' ),
82
- name: 'postType',
83
- kind: 'root',
84
- key: 'slug',
85
- baseURL: '/wp/v2/types',
86
- baseURLParams: { context: 'edit' },
87
- };
88
-
89
- type TaxonomyEntity< C extends Context = Context > = EntityType<
90
- {
91
- name: 'taxonomy';
92
- kind: 'root';
93
- key: 'slug';
94
- baseURLParams: { context: 'edit' };
95
- },
96
- Records.Taxonomy< C >,
97
- C
98
- >;
99
-
100
- const taxonomyConfig: TaxonomyEntity[ 'config' ] = {
101
- name: 'taxonomy',
102
- kind: 'root',
103
- key: 'slug',
104
- baseURL: '/wp/v2/taxonomies',
105
- baseURLParams: { context: 'edit' },
106
- plural: 'taxonomies',
107
- label: __( 'Taxonomy' ),
108
- };
109
-
110
- type SidebarEntity< C extends Context = Context > = EntityType<
111
- {
112
- name: 'sidebar';
113
- kind: 'root';
114
- baseURLParams: { context: 'edit' };
115
- },
116
- Records.Sidebar< C >,
117
- C
118
- >;
119
-
120
- const sidebarConfig: SidebarEntity[ 'config' ] = {
121
- name: 'sidebar',
122
- kind: 'root',
123
- baseURL: '/wp/v2/sidebars',
124
- baseURLParams: { context: 'edit' },
125
- plural: 'sidebars',
126
- transientEdits: { blocks: true },
127
- label: __( 'Widget areas' ),
128
- };
129
-
130
- type WidgetEntity< C extends Context = Context > = EntityType<
131
- {
132
- name: 'widget';
133
- kind: 'root';
134
- baseURLParams: { context: 'edit' };
135
- },
136
- Records.Widget< C >,
137
- C
138
- >;
139
- const widgetConfig: WidgetEntity[ 'config' ] = {
140
- name: 'widget',
141
- kind: 'root',
142
- baseURL: '/wp/v2/widgets',
143
- baseURLParams: { context: 'edit' },
144
- plural: 'widgets',
145
- transientEdits: { blocks: true },
146
- label: __( 'Widgets' ),
147
- };
148
-
149
- type WidgetTypeEntity< C extends Context = Context > = EntityType<
150
- {
151
- name: 'widgetType';
152
- kind: 'root';
153
- baseURLParams: { context: 'edit' };
154
- },
155
- Records.WidgetType< C >,
156
- C
157
- >;
158
- const widgetTypeConfig: WidgetTypeEntity[ 'config' ] = {
159
- name: 'widgetType',
160
- kind: 'root',
161
- baseURL: '/wp/v2/widget-types',
162
- baseURLParams: { context: 'edit' },
163
- plural: 'widgetTypes',
164
- label: __( 'Widget types' ),
165
- };
166
-
167
- type UserEntity< C extends Context = Context > = EntityType<
168
- {
169
- name: 'user';
170
- kind: 'root';
171
- baseURLParams: { context: 'edit' };
172
- },
173
- Records.User< C >,
174
- C
175
- >;
176
- const userConfig: UserEntity[ 'config' ] = {
177
- label: __( 'User' ),
178
- name: 'user',
179
- kind: 'root',
180
- baseURL: '/wp/v2/users',
181
- baseURLParams: { context: 'edit' },
182
- plural: 'users',
183
- };
184
-
185
- type CommentEntity< C extends Context = Context > = EntityType<
186
- {
187
- name: 'comment';
188
- kind: 'root';
189
- baseURLParams: { context: 'edit' };
190
- },
191
- Records.Comment< C >,
192
- C
193
- >;
194
- const commentConfig: CommentEntity[ 'config' ] = {
195
- name: 'comment',
196
- kind: 'root',
197
- baseURL: '/wp/v2/comments',
198
- baseURLParams: { context: 'edit' },
199
- plural: 'comments',
200
- label: __( 'Comment' ),
201
- };
202
-
203
- type NavMenuEntity< C extends Context = Context > = EntityType<
204
- {
205
- name: 'menu';
206
- kind: 'root';
207
- baseURLParams: { context: 'edit' };
208
- },
209
- Records.NavMenu< C >,
210
- C
211
- >;
212
-
213
- const menuConfig: NavMenuEntity[ 'config' ] = {
214
- name: 'menu',
215
- kind: 'root',
216
- baseURL: '/wp/v2/menus',
217
- baseURLParams: { context: 'edit' },
218
- plural: 'menus',
219
- label: __( 'Menu' ),
220
- };
221
-
222
- type NavMenuItemEntity< C extends Context = Context > = EntityType<
223
- {
224
- name: 'menuItem';
225
- kind: 'root';
226
- baseURLParams: { context: 'edit' };
227
- },
228
- Records.NavMenuItem< C >,
229
- C
230
- >;
231
-
232
- const menuItemConfig: NavMenuItemEntity[ 'config' ] = {
233
- name: 'menuItem',
234
- kind: 'root',
235
- baseURL: '/wp/v2/menu-items',
236
- baseURLParams: { context: 'edit' },
237
- plural: 'menuItems',
238
- label: __( 'Menu Item' ),
239
- rawAttributes: [ 'title' ],
240
- };
241
-
242
- type MenuLocationEntity< C extends Context = Context > = EntityType<
243
- {
244
- name: 'menuLocation';
245
- kind: 'root';
246
- key: 'name';
247
- baseURLParams: { context: 'edit' };
248
- },
249
- Records.MenuLocation< C >,
250
- C
251
- >;
252
-
253
- const menuLocationConfig: MenuLocationEntity[ 'config' ] = {
254
- name: 'menuLocation',
255
- kind: 'root',
256
- baseURL: '/wp/v2/menu-locations',
257
- baseURLParams: { context: 'edit' },
258
- plural: 'menuLocations',
259
- label: __( 'Menu Location' ),
260
- key: 'name',
261
- };
262
-
263
- const globalStyleConfig = {
264
- label: __( 'Global Styles' ),
265
- name: 'globalStyles',
266
- kind: 'root',
267
- baseURL: '/wp/v2/global-styles',
268
- baseURLParams: { context: 'edit' },
269
- plural: 'globalStylesVariations', // Should be different than name.
270
- getTitle: ( record ) => record?.title?.rendered || record?.title,
271
- };
272
-
273
- type ThemeEntity< C extends Context = Context > = EntityType<
274
- {
275
- name: 'theme';
276
- kind: 'root';
277
- baseURLParams: { context: 'edit' };
278
- key: 'stylesheet';
279
- },
280
- Records.Theme< C >,
281
- C
282
- >;
283
-
284
- const themeConfig: ThemeEntity[ 'config' ] = {
285
- label: __( 'Themes' ),
286
- name: 'theme',
287
- kind: 'root',
288
- baseURL: '/wp/v2/themes',
289
- baseURLParams: { context: 'edit' },
290
- key: 'stylesheet',
291
- };
292
-
293
- type PluginEntity< C extends Context = Context > = EntityType<
294
- {
295
- name: 'plugin';
296
- kind: 'root';
297
- baseURLParams: { context: 'edit' };
298
- key: 'plugin';
299
- },
300
- Records.Plugin< C >,
301
- C
302
- >;
303
- const pluginConfig: PluginEntity[ 'config' ] = {
304
- label: __( 'Plugins' ),
305
- name: 'plugin',
306
- kind: 'root',
307
- baseURL: '/wp/v2/plugins',
308
- baseURLParams: { context: 'edit' },
309
- key: 'plugin',
310
- };
311
-
312
- export const rootEntitiesConfig = [
313
- {
314
- label: __( 'Base' ),
315
- kind: 'root',
316
- name: '__unstableBase',
317
- baseURL: '/',
318
- baseURLParams: {
319
- _fields: [
320
- 'description',
321
- 'gmt_offset',
322
- 'home',
323
- 'name',
324
- 'site_icon',
325
- 'site_icon_url',
326
- 'site_logo',
327
- 'timezone_string',
328
- 'url',
329
- ].join( ',' ),
330
- },
331
- },
332
- siteConfig,
333
- postTypeConfig,
334
- attachmentConfig,
335
- taxonomyConfig,
336
- sidebarConfig,
337
- widgetConfig,
338
- widgetTypeConfig,
339
- userConfig,
340
- commentConfig,
341
- menuConfig,
342
- menuItemConfig,
343
- menuLocationConfig,
344
- globalStyleConfig,
345
- themeConfig,
346
- pluginConfig,
347
- ];
348
-
349
- type PostTypeConfig = {
350
- kind: 'postType';
351
- key: 'id';
352
- defaultContext: 'edit';
353
- };
354
-
355
- type PostEntity< C extends Context = Context > = EntityType<
356
- PostTypeConfig & { name: 'post' },
357
- Records.Post< C >,
358
- C
359
- >;
360
- type PageEntity< C extends Context > = EntityType<
361
- PostTypeConfig & { name: 'page' },
362
- Records.Page< C >,
363
- C
364
- >;
365
- type WpTemplateEntity< C extends Context > = EntityType<
366
- PostTypeConfig & { name: 'wp_template' },
367
- Records.WpTemplate< C >,
368
- C
369
- >;
370
- type WpTemplatePartEntity< C extends Context > = EntityType<
371
- PostTypeConfig & { name: 'wp_template_part' },
372
- Records.WpTemplatePart< C >,
373
- C
374
- >;
375
-
376
- export type CoreEntities< C extends Context > =
377
- | SiteEntity< C >
378
- | PostTypeEntity< C >
379
- | AttachmentEntity< C >
380
- | TaxonomyEntity< C >
381
- | SidebarEntity< C >
382
- | WidgetEntity< C >
383
- | WidgetTypeEntity< C >
384
- | UserEntity< C >
385
- | CommentEntity< C >
386
- | NavMenuEntity< C >
387
- | NavMenuItemEntity< C >
388
- | MenuLocationEntity< C >
389
- | ThemeEntity< C >
390
- | PluginEntity< C >
391
- | PostEntity< C >
392
- | PageEntity< C >
393
- | WpTemplateEntity< C >
394
- | WpTemplatePartEntity< C >;
395
-
396
- export const additionalEntityConfigLoaders = [
397
- { kind: 'postType', loadEntities: loadPostTypeEntities },
398
- { kind: 'taxonomy', loadEntities: loadTaxonomyEntities },
399
- ];
400
-
401
- /**
402
- * Returns a function to be used to retrieve extra edits to apply before persisting a post type.
403
- *
404
- * @param {Object} persistedRecord Already persisted Post
405
- * @param {Object} edits Edits.
406
- * @return {Object} Updated edits.
407
- */
408
- export const prePersistPostType = ( persistedRecord, edits ) => {
409
- const newEdits = {} as Partial< Updatable< Post< 'edit' > > >;
410
-
411
- if ( persistedRecord?.status === 'auto-draft' ) {
412
- // Saving an auto-draft should create a draft by default.
413
- if ( ! edits.status && ! newEdits.status ) {
414
- newEdits.status = 'draft';
415
- }
416
-
417
- // Fix the auto-draft default title.
418
- if (
419
- ( ! edits.title || edits.title === 'Auto Draft' ) &&
420
- ! newEdits.title &&
421
- ( ! persistedRecord?.title ||
422
- persistedRecord?.title === 'Auto Draft' )
423
- ) {
424
- newEdits.title = '';
425
- }
426
- }
427
-
428
- return newEdits;
429
- };
430
-
431
- /**
432
- * Returns the list of post type entities.
433
- *
434
- * @return {Promise} Entities promise
435
- */
436
- async function loadPostTypeEntities() {
437
- const postTypes = ( await apiFetch( {
438
- path: '/wp/v2/types?context=view',
439
- } ) ) as Record< string, Type< 'view' > >;
440
- return map( postTypes, ( postType, name ) => {
441
- const isTemplate = [ 'wp_template', 'wp_template_part' ].includes(
442
- name
443
- );
444
- const namespace = postType?.rest_namespace ?? 'wp/v2';
445
- return {
446
- kind: 'postType',
447
- baseURL: `/${ namespace }/${ postType.rest_base }`,
448
- baseURLParams: { context: 'edit' },
449
- name,
450
- label: postType.name,
451
- transientEdits: {
452
- blocks: true,
453
- selection: true,
454
- },
455
- mergedEdits: { meta: true },
456
- rawAttributes: POST_RAW_ATTRIBUTES,
457
- getTitle: ( record ) =>
458
- record?.title?.rendered ||
459
- record?.title ||
460
- ( isTemplate ? startCase( record.slug ) : String( record.id ) ),
461
- __unstablePrePersist: isTemplate ? undefined : prePersistPostType,
462
- __unstable_rest_base: postType.rest_base,
463
- };
464
- } );
465
- }
466
-
467
- /**
468
- * Returns the list of the taxonomies entities.
469
- *
470
- * @return {Promise} Entities promise
471
- */
472
- async function loadTaxonomyEntities() {
473
- const taxonomies = ( await apiFetch( {
474
- path: '/wp/v2/taxonomies?context=view',
475
- } ) ) as Record< string, Taxonomy< 'view' > >;
476
- return map( taxonomies, ( taxonomy, name ) => {
477
- const namespace = taxonomy?.rest_namespace ?? 'wp/v2';
478
- return {
479
- kind: 'taxonomy',
480
- baseURL: `/${ namespace }/${ taxonomy.rest_base }`,
481
- baseURLParams: { context: 'edit' },
482
- name,
483
- label: taxonomy.name,
484
- };
485
- } );
486
- }
487
-
488
- /**
489
- * Returns the entity's getter method name given its kind and name.
490
- *
491
- * @example
492
- * ```js
493
- * const nameSingular = getMethodName( 'root', 'theme', 'get' );
494
- * // nameSingular is getRootTheme
495
- *
496
- * const namePlural = getMethodName( 'root', 'theme', 'set' );
497
- * // namePlural is setRootThemes
498
- * ```
499
- *
500
- * @param {string} kind Entity kind.
501
- * @param {string} name Entity name.
502
- * @param {string} prefix Function prefix.
503
- * @param {boolean} usePlural Whether to use the plural form or not.
504
- *
505
- * @return {string} Method name
506
- */
507
- export const getMethodName = (
508
- kind,
509
- name,
510
- prefix = 'get',
511
- usePlural = false
512
- ) => {
513
- const entityConfig = find( rootEntitiesConfig, { kind, name } );
514
- const kindPrefix = kind === 'root' ? '' : upperFirst( camelCase( kind ) );
515
- const nameSuffix =
516
- upperFirst( camelCase( name ) ) + ( usePlural ? 's' : '' );
517
- const suffix =
518
- usePlural && 'plural' in entityConfig! && entityConfig?.plural
519
- ? upperFirst( camelCase( entityConfig.plural ) )
520
- : nameSuffix;
521
- return `${ prefix }${ kindPrefix }${ suffix }`;
522
- };
523
-
524
- /**
525
- * Loads the kind entities into the store.
526
- *
527
- * @param {string} kind Kind
528
- *
529
- * @return {(thunkArgs: object) => Promise<Array>} Entities
530
- */
531
- export const getOrLoadEntitiesConfig =
532
- ( kind ) =>
533
- async ( { select, dispatch } ) => {
534
- let configs = select.getEntitiesConfig( kind );
535
- if ( configs && configs.length !== 0 ) {
536
- return configs;
537
- }
538
-
539
- const loader = find( additionalEntityConfigLoaders, { kind } );
540
- if ( ! loader ) {
541
- return [];
542
- }
543
-
544
- configs = await loader.loadEntities();
545
- dispatch( addEntities( configs ) );
546
-
547
- return configs;
548
- };