@plitzi/sdk-shared 0.32.24 → 0.33.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 (244) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/auth/authFailureLink.d.ts +9 -0
  3. package/dist/auth/authFailureLink.mjs +20 -0
  4. package/dist/auth/failureChannel.d.ts +31 -0
  5. package/dist/auth/failureChannel.mjs +26 -0
  6. package/dist/auth/index.d.ts +3 -0
  7. package/dist/auth/index.mjs +3 -0
  8. package/dist/connectors/constants.d.ts +28 -0
  9. package/dist/connectors/constants.mjs +29 -0
  10. package/dist/connectors/index.d.ts +7 -0
  11. package/dist/connectors/index.mjs +5 -0
  12. package/dist/connectors/manifestTokens.d.ts +17 -0
  13. package/dist/connectors/manifestTokens.mjs +70 -0
  14. package/dist/connectors/presets.d.ts +22 -0
  15. package/dist/connectors/presets.mjs +220 -0
  16. package/dist/connectors/validateManifest.d.ts +28 -0
  17. package/dist/connectors/validateManifest.mjs +183 -0
  18. package/dist/dataSource/getBindingsDetails.mjs +1 -1
  19. package/dist/hooks/useNetwork.mjs +32 -26
  20. package/dist/hooks/usePlitziServiceContext.d.ts +1 -3
  21. package/dist/index.d.ts +2 -1
  22. package/dist/index.mjs +47 -40
  23. package/dist/navigation/index.d.ts +4 -0
  24. package/dist/navigation/index.mjs +3 -0
  25. package/dist/navigation/matchPath.d.ts +12 -0
  26. package/dist/navigation/matchPath.mjs +42 -0
  27. package/dist/navigation/routes.d.ts +28 -0
  28. package/dist/navigation/routes.mjs +124 -0
  29. package/dist/network/NetworkContext.d.ts +5 -3
  30. package/dist/network/NetworkInternalContext.d.ts +1 -2
  31. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.d.ts +8 -0
  32. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceAddConnectorMutation.mjs +16 -0
  33. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.d.ts +8 -0
  34. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceRemoveConnectorMutation.mjs +12 -0
  35. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.d.ts +8 -0
  36. package/dist/network/graphql/builder/Mutations/Space/connectors/SpaceUpdateConnectorMutation.mjs +16 -0
  37. package/dist/network/graphql/builder/Mutations/index.d.ts +9 -18
  38. package/dist/network/graphql/builder/Mutations/index.mjs +150 -156
  39. package/dist/network/graphql/builder/Queries/InitQuery.d.ts +1 -4
  40. package/dist/network/graphql/builder/Queries/InitQuery.mjs +2 -33
  41. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.d.ts +9 -0
  42. package/dist/network/graphql/builder/Queries/Space/SpaceConnectorsQuery.mjs +25 -0
  43. package/dist/network/graphql/builder/Queries/Space/SpaceDeploymentsQuery.mjs +1 -0
  44. package/dist/network/graphql/builder/Queries/index.d.ts +3 -12
  45. package/dist/network/graphql/builder/Queries/index.mjs +22 -28
  46. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.d.ts +19 -0
  47. package/dist/network/graphql/builder/Subscriptions/SpaceEventSubscription.mjs +12 -0
  48. package/dist/network/graphql/builder/Subscriptions/index.d.ts +4 -163
  49. package/dist/network/graphql/builder/Subscriptions/index.mjs +3 -109
  50. package/dist/network/graphql/builder/index.d.ts +2 -2
  51. package/dist/network/graphql/builder/index.mjs +1 -1
  52. package/dist/network/graphql/index.mjs +1 -1
  53. package/dist/network/graphql/sdk/Mutations/index.d.ts +2 -13
  54. package/dist/network/graphql/sdk/Mutations/index.mjs +2 -9
  55. package/dist/network/graphql/sdk/Queries/InitQuery.d.ts +1 -4
  56. package/dist/network/graphql/sdk/Queries/InitQuery.mjs +1 -13
  57. package/dist/network/graphql/sdk/Queries/index.d.ts +0 -12
  58. package/dist/network/graphql/sdk/Queries/index.mjs +8 -16
  59. package/dist/network/index.d.ts +3 -1
  60. package/dist/network/index.mjs +7 -6
  61. package/dist/network/spaceEvents.d.ts +405 -0
  62. package/dist/network/spaceEvents.mjs +244 -0
  63. package/dist/server/index.d.ts +5 -5
  64. package/dist/server/index.mjs +4 -3
  65. package/dist/server/rsc/refreshRsc.d.ts +16 -0
  66. package/dist/server/rsc/refreshRsc.mjs +16 -0
  67. package/dist/server/rsc/useRscRefresh.d.ts +2 -0
  68. package/dist/server/rsc/useRscRefresh.mjs +10 -0
  69. package/dist/server/rsc/useRscSync.d.ts +11 -0
  70. package/dist/server/rsc/useRscSync.mjs +20 -0
  71. package/dist/store/index.d.ts +54 -53
  72. package/dist/store/index.mjs +4 -3
  73. package/dist/store/renderSettings.d.ts +26 -0
  74. package/dist/store/renderSettings.mjs +39 -0
  75. package/dist/types/AuthTypes.d.ts +33 -3
  76. package/dist/types/BuilderTypes.d.ts +15 -0
  77. package/dist/types/CollectionTypes.d.ts +3 -49
  78. package/dist/types/CommonTypes.d.ts +17 -2
  79. package/dist/types/ConnectorTypes.d.ts +147 -0
  80. package/dist/types/ConnectorTypes.mjs +0 -0
  81. package/dist/types/DevToolsTypes.d.ts +18 -3
  82. package/dist/types/InteractionTypes.d.ts +1 -1
  83. package/dist/types/McpTypes/index.d.ts +0 -4
  84. package/dist/types/NavigationTypes.d.ts +0 -10
  85. package/dist/types/SchemaTypes.d.ts +27 -5
  86. package/dist/types/SdkTypes.d.ts +19 -2
  87. package/dist/types/ServerTypes.d.ts +296 -103
  88. package/dist/types/SpaceTypes.d.ts +17 -1
  89. package/dist/types/StoreTypes.d.ts +36 -0
  90. package/dist/types/index.d.ts +1 -0
  91. package/dist/websockets/RTCodec.d.ts +6 -0
  92. package/package.json +108 -309
  93. package/vite.config.ts +21 -1
  94. package/dist/collections/CollectionContext.d.ts +0 -2
  95. package/dist/collections/CollectionContext.mjs +0 -5
  96. package/dist/collections/index.d.ts +0 -3
  97. package/dist/collections/index.mjs +0 -2
  98. package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.d.ts +0 -4
  99. package/dist/network/graphql/builder/Mutations/Collection/CollectionAddMutation.mjs +0 -24
  100. package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.d.ts +0 -4
  101. package/dist/network/graphql/builder/Mutations/Collection/CollectionAddRecordMutation.mjs +0 -16
  102. package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.d.ts +0 -4
  103. package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveMutation.mjs +0 -17
  104. package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +0 -4
  105. package/dist/network/graphql/builder/Mutations/Collection/CollectionRemoveRecordMutation.mjs +0 -14
  106. package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.d.ts +0 -4
  107. package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateMutation.mjs +0 -32
  108. package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +0 -4
  109. package/dist/network/graphql/builder/Mutations/Collection/CollectionUpdateRecordMutation.mjs +0 -16
  110. package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.d.ts +0 -6
  111. package/dist/network/graphql/builder/Queries/Collection/CollectionQuery.mjs +0 -35
  112. package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.d.ts +0 -6
  113. package/dist/network/graphql/builder/Queries/Collection/CollectionRecordQuery.mjs +0 -16
  114. package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.d.ts +0 -9
  115. package/dist/network/graphql/builder/Queries/Collection/CollectionRecordsQuery.mjs +0 -27
  116. package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.d.ts +0 -9
  117. package/dist/network/graphql/builder/Queries/Collection/CollectionsQuery.mjs +0 -37
  118. package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.d.ts +0 -11
  119. package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorConnectedSubscription.mjs +0 -17
  120. package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.d.ts +0 -11
  121. package/dist/network/graphql/builder/Subscriptions/Collaborator/CollaboratorDisconnectedSubscription.mjs +0 -17
  122. package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.d.ts +0 -2
  123. package/dist/network/graphql/builder/Subscriptions/Segment/SegmentAddTemplateSubscription.mjs +0 -41
  124. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.d.ts +0 -11
  125. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentAddElementSubscription.mjs +0 -40
  126. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.d.ts +0 -10
  127. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentCloneElementSubscription.mjs +0 -30
  128. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.d.ts +0 -10
  129. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentMoveElementSubscription.mjs +0 -15
  130. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.d.ts +0 -6
  131. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentRemoveElementSubscription.mjs +0 -12
  132. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.d.ts +0 -11
  133. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementSubscription.mjs +0 -27
  134. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementsSubscription.d.ts +0 -7
  135. package/dist/network/graphql/builder/Subscriptions/Segment/space/elements/SegmentUpdateElementsSubscription.mjs +0 -27
  136. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.d.ts +0 -7
  137. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceAddVariableSubscription.mjs +0 -21
  138. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.d.ts +0 -7
  139. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceRemoveVariableSubscription.mjs +0 -14
  140. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.d.ts +0 -7
  141. package/dist/network/graphql/builder/Subscriptions/Segment/space/variables/SegmentSpaceUpdateVariableSubscription.mjs +0 -21
  142. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.d.ts +0 -11
  143. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleAddSelectorVariableSubscription.mjs +0 -16
  144. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.d.ts +0 -10
  145. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleRemoveSelectorVariableSubscription.mjs +0 -15
  146. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.d.ts +0 -11
  147. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectorVariables/SegmentStyleUpdateSelectorVariableSubscription.mjs +0 -16
  148. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.d.ts +0 -17
  149. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleAddSelectorSubscription.mjs +0 -17
  150. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.d.ts +0 -8
  151. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorSubscription.mjs +0 -13
  152. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorsSubscription.d.ts +0 -8
  153. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleRemoveSelectorsSubscription.mjs +0 -13
  154. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.d.ts +0 -16
  155. package/dist/network/graphql/builder/Subscriptions/Segment/style/selectors/SegmentStyleUpdateSelectorSubscription.mjs +0 -17
  156. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.d.ts +0 -9
  157. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleAddVariableSubscription.mjs +0 -14
  158. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.d.ts +0 -8
  159. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleRemoveVariableSubscription.mjs +0 -13
  160. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.d.ts +0 -9
  161. package/dist/network/graphql/builder/Subscriptions/Segment/style/variables/SegmentStyleUpdateVariableSubscription.mjs +0 -14
  162. package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.d.ts +0 -11
  163. package/dist/network/graphql/builder/Subscriptions/Space/SpaceAddTemplateSubscription.mjs +0 -40
  164. package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.d.ts +0 -6
  165. package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdateSettingsSubscription.mjs +0 -12
  166. package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.d.ts +0 -6
  167. package/dist/network/graphql/builder/Subscriptions/Space/SpaceUpdatedSubscription.mjs +0 -29
  168. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.d.ts +0 -10
  169. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceAddElementSubscription.mjs +0 -39
  170. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.d.ts +0 -9
  171. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceCloneElementSubscription.mjs +0 -29
  172. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.d.ts +0 -9
  173. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceMoveElementSubscription.mjs +0 -14
  174. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.d.ts +0 -5
  175. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceRemoveElementSubscription.mjs +0 -11
  176. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.d.ts +0 -6
  177. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementSubscription.mjs +0 -26
  178. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementsSubscription.d.ts +0 -6
  179. package/dist/network/graphql/builder/Subscriptions/Space/elements/SpaceUpdateElementsSubscription.mjs +0 -26
  180. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.d.ts +0 -6
  181. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceAddPageFolderSubscription.mjs +0 -16
  182. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.d.ts +0 -5
  183. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceRemovePageFolderSubscription.mjs +0 -11
  184. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.d.ts +0 -6
  185. package/dist/network/graphql/builder/Subscriptions/Space/folders/SpaceUpdatePageFolderSubscription.mjs +0 -16
  186. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.d.ts +0 -6
  187. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceAddPageSubscription.mjs +0 -26
  188. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.d.ts +0 -6
  189. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceHomePageSubscription.mjs +0 -26
  190. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.d.ts +0 -5
  191. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceRemovePageSubscription.mjs +0 -11
  192. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.d.ts +0 -6
  193. package/dist/network/graphql/builder/Subscriptions/Space/pages/SpaceUpdatePageSubscription.mjs +0 -26
  194. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.d.ts +0 -6
  195. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceAddVariableSubscription.mjs +0 -20
  196. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.d.ts +0 -5
  197. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceRemoveVariableSubscription.mjs +0 -11
  198. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.d.ts +0 -6
  199. package/dist/network/graphql/builder/Subscriptions/Space/variables/SpaceUpdateVariableSubscription.mjs +0 -20
  200. package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.d.ts +0 -6
  201. package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdateSettingsSubscription.mjs +0 -12
  202. package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.d.ts +0 -4
  203. package/dist/network/graphql/builder/Subscriptions/Style/StyleUpdatedSubscription.mjs +0 -13
  204. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.d.ts +0 -16
  205. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleAddSelectorSubscription.mjs +0 -16
  206. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.d.ts +0 -7
  207. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorSubscription.mjs +0 -12
  208. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorsSubscription.d.ts +0 -7
  209. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleRemoveSelectorsSubscription.mjs +0 -12
  210. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.d.ts +0 -15
  211. package/dist/network/graphql/builder/Subscriptions/Style/selector/StyleUpdateSelectorSubscription.mjs +0 -16
  212. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.d.ts +0 -10
  213. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleAddSelectorVariableSubscription.mjs +0 -15
  214. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.d.ts +0 -9
  215. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleRemoveSelectorVariableSubscription.mjs +0 -14
  216. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.d.ts +0 -10
  217. package/dist/network/graphql/builder/Subscriptions/Style/selectorVariables/StyleUpdateSelectorVariableSubscription.mjs +0 -15
  218. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.d.ts +0 -8
  219. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleAddVariableSubscription.mjs +0 -13
  220. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.d.ts +0 -7
  221. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleRemoveVariableSubscription.mjs +0 -12
  222. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.d.ts +0 -8
  223. package/dist/network/graphql/builder/Subscriptions/Style/variables/StyleUpdateVariableSubscription.mjs +0 -13
  224. package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddMutation.d.ts +0 -2
  225. package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.d.ts +0 -4
  226. package/dist/network/graphql/sdk/Mutations/Collection/CollectionAddRecordMutation.mjs +0 -16
  227. package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveMutation.d.ts +0 -2
  228. package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.d.ts +0 -4
  229. package/dist/network/graphql/sdk/Mutations/Collection/CollectionRemoveRecordMutation.mjs +0 -14
  230. package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateMutation.d.ts +0 -2
  231. package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.d.ts +0 -4
  232. package/dist/network/graphql/sdk/Mutations/Collection/CollectionUpdateRecordMutation.mjs +0 -16
  233. package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.d.ts +0 -6
  234. package/dist/network/graphql/sdk/Queries/Collection/CollectionQuery.mjs +0 -32
  235. package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.d.ts +0 -6
  236. package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordQuery.mjs +0 -14
  237. package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.d.ts +0 -9
  238. package/dist/network/graphql/sdk/Queries/Collection/CollectionRecordsQuery.mjs +0 -25
  239. package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.d.ts +0 -9
  240. package/dist/network/graphql/sdk/Queries/Collection/CollectionsQuery.mjs +0 -25
  241. package/dist/server/rsc/RscContext.d.ts +0 -13
  242. package/dist/server/rsc/RscContext.mjs +0 -5
  243. package/dist/server/rsc/RscProvider.d.ts +0 -13
  244. package/dist/server/rsc/RscProvider.mjs +0 -42
@@ -0,0 +1,183 @@
1
+ import { BODYLESS_METHODS as e, CONNECTOR_HTTP_METHODS as t } from "./constants.mjs";
2
+ import { connectorTokens as n } from "./manifestTokens.mjs";
3
+ //#region src/connectors/validateManifest.ts
4
+ var r = [
5
+ "offset",
6
+ "page",
7
+ "cursor"
8
+ ], i = [
9
+ "text",
10
+ "richText",
11
+ "image",
12
+ "multiImage",
13
+ "video",
14
+ "link",
15
+ "email",
16
+ "phone",
17
+ "number",
18
+ "date",
19
+ "switch",
20
+ "color",
21
+ "option",
22
+ "file"
23
+ ], a = /\{\{\s*([^}]+?)\s*\}\}/g, o = (e) => typeof e == "object" && !!e && !Array.isArray(e), s = (e) => typeof e == "string" && e.trim() !== "", c = (e) => typeof e == "string" ? e : JSON.stringify(e), l = (e) => [...e.matchAll(a)].map((e) => e[1]), u = (e, t) => n.some((n) => n.scopes.includes(t) ? n.value.endsWith(".") ? e.startsWith(n.value) : e === n.value : !1), d = (e, t, n, r) => {
24
+ e.errors.push({
25
+ path: t,
26
+ message: n,
27
+ ...r === void 0 ? {} : { hint: r }
28
+ });
29
+ }, f = (e, t, n, r) => {
30
+ e.warnings.push({
31
+ path: t,
32
+ message: n,
33
+ ...r === void 0 ? {} : { hint: r }
34
+ });
35
+ }, p = (e, t, n, r) => {
36
+ if (t !== void 0) {
37
+ if (!o(t)) {
38
+ d(e, n, "Must be an object of string values", "Each entry is one name and its templated value");
39
+ return;
40
+ }
41
+ for (let [i, a] of Object.entries(t)) {
42
+ if (typeof a != "string") {
43
+ d(e, `${n}.${i}`, "Must be a string", "Values are Twig templates the server renders per request");
44
+ continue;
45
+ }
46
+ e.templates.push({
47
+ path: `${n}.${i}`,
48
+ value: a,
49
+ scope: r
50
+ });
51
+ }
52
+ return t;
53
+ }
54
+ }, m = (e, n, r, i) => {
55
+ if (n === void 0) {
56
+ i && d(e, r, "A write endpoint must declare its method", `One of ${t.join(", ")}`);
57
+ return;
58
+ }
59
+ if (typeof n != "string" || !t.includes(n)) {
60
+ d(e, r, `"${c(n)}" is not an HTTP method`, `One of ${t.join(", ")}`);
61
+ return;
62
+ }
63
+ return n;
64
+ }, h = (e, t, n, r) => {
65
+ if (!s(t.path)) {
66
+ d(e, `${n}.path`, "An endpoint needs a path", "It is appended to baseUrl, e.g. \"/api/{{resource}}\"");
67
+ return;
68
+ }
69
+ e.templates.push({
70
+ path: `${n}.path`,
71
+ value: t.path,
72
+ scope: r
73
+ });
74
+ }, g = (e, t, n) => {
75
+ if (t !== void 0) {
76
+ if (typeof t != "string" || !r.includes(t)) {
77
+ d(e, n, `"${c(t)}" is not a paging style`, `One of ${r.join(", ")}`);
78
+ return;
79
+ }
80
+ return t;
81
+ }
82
+ }, _ = (t, n, r, i) => {
83
+ let a = `endpoints.read.${n}`;
84
+ if (!o(r)) {
85
+ d(t, a, "A read endpoint must be an object", "It declares at least a path");
86
+ return;
87
+ }
88
+ h(t, r, a, "request");
89
+ let s = m(t, r.method, `${a}.method`, !1) ?? "GET", c = p(t, r.query, `${a}.query`, "request");
90
+ p(t, r.headers, `${a}.headers`, "request");
91
+ let l = p(t, r.body, `${a}.body`, "request"), u = g(t, r.pagination, `${a}.pagination`) ?? i;
92
+ if (l && e.includes(s) && f(t, `${a}.body`, `A ${s} request carries no body, so this one is never sent`, "Move these values into `query`, or read through POST if the provider expects a body"), u === void 0) return;
93
+ let _ = JSON.stringify({
94
+ path: r.path,
95
+ query: c ?? {},
96
+ body: l ?? {}
97
+ }), v = {
98
+ offset: "{{offset}}",
99
+ page: "{{page}}",
100
+ cursor: "{{cursor}}"
101
+ }[u];
102
+ v !== void 0 && !_.includes(v) && f(t, `${a}.query`, `"${n}" pages by ${u} but never uses ${v}, so every page resolves to the first one`, `Put ${v} in the query (or the path) this endpoint sends`);
103
+ }, v = (e, t, n) => {
104
+ let r = `endpoints.write.${t}`;
105
+ if (!o(n)) {
106
+ d(e, r, "A write endpoint must be an object", "It declares at least a method and a path");
107
+ return;
108
+ }
109
+ h(e, n, r, "write"), m(e, n.method, `${r}.method`, !0), p(e, n.query, `${r}.query`, "write"), p(e, n.headers, `${r}.headers`, "write"), n.bodyPath !== void 0 && typeof n.bodyPath != "string" && d(e, `${r}.bodyPath`, "Must be a string", "It names where to nest the values, e.g. \"data\"");
110
+ }, y = (e, t, n) => {
111
+ if (!o(t)) {
112
+ d(e, "endpoints", "A connector must declare its endpoints", "At least one read endpoint, usually \"list\"");
113
+ return;
114
+ }
115
+ if (!o(t.read) || Object.keys(t.read).length === 0) d(e, "endpoints.read", "A connector needs at least one read endpoint", "Name it \"list\" — that is the one a provider element addresses when it names none");
116
+ else for (let [r, i] of Object.entries(t.read)) _(e, r, i, n);
117
+ if (t.write !== void 0) {
118
+ if (!o(t.write)) {
119
+ d(e, "endpoints.write", "Must be an object of endpoints keyed by name", "Omit it for a read-only connector");
120
+ return;
121
+ }
122
+ for (let [n, r] of Object.entries(t.write)) v(e, n, r);
123
+ }
124
+ }, b = (e, t) => {
125
+ if (t !== void 0) {
126
+ if (!o(t)) {
127
+ d(e, "auth", "Must be an object", "Shape: { in, name, value }");
128
+ return;
129
+ }
130
+ if (t.in !== "header" && t.in !== "query" && d(e, "auth.in", "Auth travels in a header or a query parameter", "One of header, query"), s(t.name) || d(e, "auth.name", "Auth needs the name it is sent under", "e.g. \"Authorization\" for a bearer token"), typeof t.value != "string") {
131
+ d(e, "auth.value", "Must be a string", "A template, e.g. \"Bearer {{credential.token}}\"");
132
+ return;
133
+ }
134
+ e.templates.push({
135
+ path: "auth.value",
136
+ value: t.value,
137
+ scope: "request"
138
+ });
139
+ }
140
+ }, x = (e, t) => {
141
+ let n = p(e, t, "operators", "filter");
142
+ if (n) for (let [t, r] of Object.entries(n)) typeof r == "string" && !r.includes("=") && d(e, `operators.${t}`, `Operator "${t}" renders no "key=value" pair, so a filter using it is dropped`, "Write the full query entry, e.g. \"filters[{{field}}][$eq]={{value}}\"");
143
+ }, S = (e, t) => {
144
+ if (t !== void 0) {
145
+ if (!o(t)) {
146
+ d(e, "fields", "Must be an object of field name → type", `Types: ${i.join(", ")}`);
147
+ return;
148
+ }
149
+ for (let [n, r] of Object.entries(t)) (typeof r != "string" || !i.includes(r)) && d(e, `fields.${n}`, `"${c(r)}" is not a field type`, `One of ${i.join(", ")}`);
150
+ }
151
+ }, C = (e, t) => {
152
+ let r = !1;
153
+ for (let t of e.templates) for (let i of l(t.value)) i.startsWith("credential.") && (r = !0), u(i, t.scope) || f(e, t.path, `{{${i}}} is not a value the engine binds here, so it renders empty`, `Tokens available in this position: ${n.filter((e) => e.scopes.includes(t.scope)).map((e) => e.value).join(", ")}`);
154
+ if (r && !s(t)) {
155
+ f(e, "credential", "This manifest reads {{credential.…}} but names no credential, so every request goes unauthenticated", "The connector still saves. Ask the space owner to create the credential and attach it — the secret is never part of the manifest.");
156
+ return;
157
+ }
158
+ !r && s(t) && f(e, "credential", "A credential is attached but no template reads {{credential.…}}, so it is never sent", "Reference it where the provider expects it, e.g. auth.value = \"Bearer {{credential.token}}\"");
159
+ }, w = (e) => {
160
+ let t = {
161
+ errors: [],
162
+ warnings: [],
163
+ templates: []
164
+ };
165
+ if (!o(e)) return {
166
+ valid: !1,
167
+ errors: [{
168
+ path: "",
169
+ message: "A manifest must be an object",
170
+ hint: "It declares baseUrl and endpoints"
171
+ }],
172
+ warnings: []
173
+ };
174
+ s(e.baseUrl) ? /^https?:\/\//.test(e.baseUrl) || d(t, "baseUrl", "Base URL must start with http:// or https://", "The engine resolves paths against it") : d(t, "baseUrl", "A connector needs a base URL", "The origin every endpoint path is appended to"), e.credential !== void 0 && typeof e.credential != "string" && d(t, "credential", "Must be the identifier of a stored credential", "The secret itself never goes here");
175
+ let n = g(t, e.pagination, "pagination");
176
+ return b(t, e.auth), p(t, e.headers, "headers", "request"), y(t, e.endpoints, n), x(t, e.operators), S(t, e.fields), e.media !== void 0 && (o(e.media) ? e.media.baseUrl !== void 0 && !s(e.media.baseUrl) && d(t, "media.baseUrl", "Must be a non-empty string", "The origin relative media paths are rebased onto") : d(t, "media", "Must be an object", "Shape: { baseUrl }")), e.projection !== void 0 && e.projection !== "full" && d(t, "projection", "The only projection is \"full\"", "Omit it to send only the paths the page binds"), C(t, e.credential), {
177
+ valid: t.errors.length === 0,
178
+ errors: t.errors,
179
+ warnings: t.warnings
180
+ };
181
+ };
182
+ //#endregion
183
+ export { w as validateConnectorManifest };
@@ -1,5 +1,5 @@
1
1
  import e from "./utility/index.mjs";
2
- import { camelCase as t, get as n, set as r } from "@plitzi/plitzi-ui";
2
+ import { camelCase as t, get as n, set as r } from "@plitzi/plitzi-ui/helpers/lodash";
3
3
  import { QueryBuilderEvaluator as i } from "@plitzi/plitzi-ui/QueryBuilder";
4
4
  import { produce as a } from "immer";
5
5
  //#region src/dataSource/getBindingsDetails.ts
@@ -1,43 +1,49 @@
1
- import { useCallback as e, useState as t } from "react";
1
+ import { authFailureFromResponse as e, reportAuthFailure as t } from "../auth/failureChannel.mjs";
2
+ import { useCallback as n, useState as r } from "react";
2
3
  //#region src/hooks/useNetwork.ts
3
- var n = ({ initLoading: n = !1, server: r, webKey: i, internalUsage: a = !0, baseUrl: o }) => {
4
- let [s, c] = t(n);
4
+ var i = ({ initLoading: i = !1, server: a, webKey: o, internalUsage: s = !0, baseUrl: c }) => {
5
+ let [l, u] = r(i);
5
6
  return {
6
- networkLoading: s,
7
- networkQuery: e(async (e, t = {}, n = "get", s = "") => {
7
+ networkLoading: l,
8
+ networkQuery: n(async (n, r = {}, i = "get", l = "") => {
8
9
  try {
9
- c(!0), n = n.toLowerCase();
10
- let l = new Headers();
11
- l.append("Content-Type", "application/json"), s ? l.append("Authorization", `Bearer ${s}`) : i && l.append("Authorization", `Bearer ${i}`);
12
- let u = "";
13
- a && r && (u = o ?? r.serverUrl);
14
- let d = t;
15
- (t instanceof FormData ? Array.from(t.values()) : Object.values(t)).forEach((e) => {
16
- if (e instanceof Blob && l.get("Content-Type") !== "multipart/form-data") {
17
- l.delete("Content-Type");
10
+ u(!0), i = i.toLowerCase();
11
+ let d = new Headers();
12
+ d.append("Content-Type", "application/json"), l ? d.append("Authorization", `Bearer ${l}`) : o && d.append("Authorization", `Bearer ${o}`);
13
+ let f = "";
14
+ s && a && (f = c ?? a.serverUrl);
15
+ let p = r;
16
+ (r instanceof FormData ? Array.from(r.values()) : Object.values(r)).forEach((e) => {
17
+ if (e instanceof Blob && d.get("Content-Type") !== "multipart/form-data") {
18
+ d.delete("Content-Type");
18
19
  return;
19
20
  }
20
- }), d instanceof FormData || (d = new FormData(), Object.entries(t).forEach(([e, t]) => {
21
- d.append(e, t);
21
+ }), p instanceof FormData || (p = new FormData(), Object.entries(r).forEach(([e, t]) => {
22
+ p.append(e, t);
22
23
  }));
23
- let f = {
24
- method: n,
25
- headers: l,
26
- body: d
24
+ let m = {
25
+ method: i,
26
+ headers: d,
27
+ body: p
27
28
  };
28
- return l.get("Content-Type") === "application/json" && (f.body = JSON.stringify(t)), n === "get" && delete f.body, await (await fetch(`${u}${e}`, f)).json();
29
+ d.get("Content-Type") === "application/json" && (m.body = JSON.stringify(r)), i === "get" && delete m.body;
30
+ let h = await fetch(`${f}${n}`, m), g = await h.json(), _ = e(h.status, g);
31
+ return _ && t({
32
+ reason: _,
33
+ url: `${f}${n}`
34
+ }), g;
29
35
  } catch (e) {
30
36
  console.error(e);
31
37
  } finally {
32
- c(!1);
38
+ u(!1);
33
39
  }
34
40
  }, [
35
- i,
41
+ o,
42
+ s,
36
43
  a,
37
- r,
38
- o
44
+ c
39
45
  ])
40
46
  };
41
47
  };
42
48
  //#endregion
43
- export { n as default };
49
+ export { i as default };
@@ -1,6 +1,6 @@
1
1
  import { BuilderContextValue } from '../builder';
2
2
  import { NetworkContextValue } from '../network';
3
- import { CollectionContextValue, ComponentContextValue, EventBridgeContextValue, InteractionsContextValue, NavigationContextValue, PluginsContextValue, SegmentsContextValue, Theme } from '../types';
3
+ import { ComponentContextValue, EventBridgeContextValue, InteractionsContextValue, PluginsContextValue, SegmentsContextValue, Theme } from '../types';
4
4
  import { Context, ReactNode, RefObject } from 'react';
5
5
  export type PlitziServiceContextValue<TEventBridge = any, TInteractions = any> = {
6
6
  settings: {
@@ -20,8 +20,6 @@ export type PlitziServiceContextValue<TEventBridge = any, TInteractions = any> =
20
20
  customContexts: Record<string, Context<any>>;
21
21
  contexts: {
22
22
  SegmentsContext: Context<SegmentsContextValue>;
23
- NavigationContext: Context<NavigationContextValue>;
24
- CollectionContext: Context<CollectionContextValue>;
25
23
  ComponentContext: Context<ComponentContextValue>;
26
24
  EventBridgeContext: Context<EventBridgeContextValue<TEventBridge>>;
27
25
  PluginsContext: Context<PluginsContextValue>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './types';
2
+ export * from './auth';
2
3
  export * from './helpers';
3
4
  export * from './hooks';
4
5
  export * from './builder';
@@ -6,10 +7,10 @@ export * from './style';
6
7
  export * from './schema';
7
8
  export * from './elements';
8
9
  export * from './dataSource';
10
+ export * from './connectors';
9
11
  export * from './network';
10
12
  export * from './network/graphql';
11
13
  export * from './segments';
12
- export * from './collections';
13
14
  export * from './websockets';
14
15
  export * from './devTools';
15
16
  export * from './theme';
package/dist/index.mjs CHANGED
@@ -1,40 +1,47 @@
1
- import e from "./builder/contexts/BuilderContext.mjs";
2
- import { contexts_exports as t } from "./builder/contexts/index.mjs";
3
- import n from "./collections/CollectionContext.mjs";
4
- import r from "./dataSource/helpers/getSourceName.mjs";
5
- import i from "./helpers/fetchManifest.mjs";
6
- import a from "./helpers/generateFacade.mjs";
7
- import o from "./helpers/syntaxHighlight.mjs";
8
- import { formatDate as s, formatDateUTC as c, formatFromNow as l, formatUTCToLocal as u, getDurationMs as d, isDate as f, isValidFormat as p, parseDate as m, toUnixSeconds as h } from "./helpers/formatDate.mjs";
9
- import { filters as g } from "./helpers/twigWrapper/filters/filters.mjs";
10
- import { processTwig as _ } from "./helpers/twigWrapper/processTwig/processTwig.mjs";
11
- import { hasValidToken as v } from "./helpers/twigWrapper/tokens/hasValidToken.mjs";
12
- import { ParamsFromURL as y, delay as b, emptyObject as x, generateID as S, getDisplayName as C, getKeyDecoded as w, getPathsFromObeject as T, hexToRGB as E, isInViewport as D, isTestMode as O, makeId as k } from "./helpers/utils.mjs";
13
- import { disableReactDevTools as A } from "./helpers/security.mjs";
14
- import { createStripTypenameLink as j, stripTypenameDeep as M } from "./helpers/stripTypename.mjs";
15
- import N from "./dataSource/hooks/useRegisterSource.mjs";
16
- import P, { utilityOptions as F } from "./dataSource/utility/index.mjs";
17
- import I from "./dataSource/getBindingsDetails.mjs";
18
- import L from "./devTools/DevToolsContext.mjs";
19
- import R, { createStoreDevToolsLogger as z, pConsole as B } from "./devTools/utils/PlitziConsole.mjs";
20
- import V from "./elements/ComponentContext.mjs";
21
- import H from "./hooks/useNetwork.mjs";
22
- import U, { PlitziServiceContext as W, PlitziServiceProvider as G } from "./hooks/usePlitziServiceContext.mjs";
23
- import { StyleVariableCategory as K } from "./types/StyleTypes.mjs";
24
- import q, { EMPTY_STYLE_SCHEMA as J, StyleBindingsAllowed as Y, baseDefaultValue as X, inheritableAttributesBase as Z } from "./style/styleConstants.mjs";
25
- import Q from "./schema/SchemaContext.mjs";
26
- import { EMPTY_SCHEMA as $, VARIABLE_REGEX as ee } from "./schema/schemaConstants.mjs";
27
- import te from "./network/NetworkContext.mjs";
28
- import ne from "./network/NetworkInternalContext.mjs";
29
- import re from "./network/graphql/builder/Mutations/index.mjs";
30
- import ie from "./network/graphql/builder/Queries/index.mjs";
31
- import ae from "./network/graphql/builder/Subscriptions/index.mjs";
32
- import oe from "./network/graphql/sdk/Mutations/index.mjs";
33
- import se from "./network/graphql/sdk/Queries/index.mjs";
34
- import ce from "./segments/SegmentsContext.mjs";
35
- import le, { RTEvent as ue, RTEventCloseCode as de, getInstance as fe, isRTEvent as pe, setInstance as me } from "./websockets/RTCodec.mjs";
36
- import he, { ThemeContext as ge } from "./theme/ThemeProvider.mjs";
37
- import _e from "./server/rsc/RscContext.mjs";
38
- import ve from "./server/rsc/RscProvider.mjs";
39
- import { runtimeStatePersist as ye } from "./state/runtimeStatePersist.mjs";
40
- export { e as BuilderContext, re as BuilderMutations, ie as BuilderQueries, ae as BuilderSubscriptions, n as CollectionContext, V as ComponentContext, L as DevToolsContext, $ as EMPTY_SCHEMA, J as EMPTY_STYLE_SCHEMA, te as NetworkContext, ne as NetworkInternalContext, y as ParamsFromURL, R as PlitziConsole, W as PlitziServiceContext, G as PlitziServiceProvider, le as RTCodec, ue as RTEvent, de as RTEventCloseCode, _e as RscContext, ve as RscProvider, Q as SchemaContext, oe as SdkMutations, se as SdkQueries, ce as SegmentsContext, Y as StyleBindingsAllowed, K as StyleVariableCategory, ge as ThemeContext, he as ThemeProvider, ee as VARIABLE_REGEX, X as baseDefaultValue, t as contexts, z as createStoreDevToolsLogger, j as createStripTypenameLink, b as delay, A as disableReactDevTools, x as emptyObject, i as fetchManifest, g as filters, s as formatDate, c as formatDateUTC, l as formatFromNow, u as formatUTCToLocal, a as generateFacade, S as generateID, I as getBindingsDetails, C as getDisplayName, d as getDurationMs, fe as getInstance, w as getKeyDecoded, T as getPathsFromObeject, r as getSourceName, v as hasValidToken, E as hexToRGB, Z as inheritableAttributesBase, f as isDate, D as isInViewport, pe as isRTEvent, O as isTestMode, p as isValidFormat, k as makeId, B as pConsole, m as parseDate, _ as processTwig, ye as runtimeStatePersist, me as setInstance, M as stripTypenameDeep, q as styleConstants, o as syntaxHighlight, h as toUnixSeconds, H as useNetwork, U as usePlitziServiceContext, N as useRegisterSource, P as utility, F as utilityOptions };
1
+ import { authFailureFromResponse as e, onAuthFailure as t, reportAuthFailure as n, sameRegistrableDomain as r } from "./auth/failureChannel.mjs";
2
+ import { createAuthFailureLink as i } from "./auth/authFailureLink.mjs";
3
+ import a from "./builder/contexts/BuilderContext.mjs";
4
+ import { contexts_exports as o } from "./builder/contexts/index.mjs";
5
+ import { BODYLESS_METHODS as s, CONNECTOR_HTTP_METHODS as c, DEFAULT_READ_ENDPOINT as l, EMPTY_RESPONSE_METHODS as u, READ_ENDPOINT_NAMES as d, WRITE_ENDPOINT_NAMES as f } from "./connectors/constants.mjs";
6
+ import { connectorTokens as p, getConnectorTokens as m } from "./connectors/manifestTokens.mjs";
7
+ import { connectorPresets as h, emptyManifest as g } from "./connectors/presets.mjs";
8
+ import { validateConnectorManifest as _ } from "./connectors/validateManifest.mjs";
9
+ import v from "./dataSource/helpers/getSourceName.mjs";
10
+ import y from "./helpers/fetchManifest.mjs";
11
+ import b from "./helpers/generateFacade.mjs";
12
+ import x from "./helpers/syntaxHighlight.mjs";
13
+ import { formatDate as S, formatDateUTC as C, formatFromNow as w, formatUTCToLocal as T, getDurationMs as E, isDate as D, isValidFormat as O, parseDate as k, toUnixSeconds as A } from "./helpers/formatDate.mjs";
14
+ import { filters as j } from "./helpers/twigWrapper/filters/filters.mjs";
15
+ import { processTwig as M } from "./helpers/twigWrapper/processTwig/processTwig.mjs";
16
+ import { hasValidToken as N } from "./helpers/twigWrapper/tokens/hasValidToken.mjs";
17
+ import { ParamsFromURL as P, delay as F, emptyObject as I, generateID as L, getDisplayName as R, getKeyDecoded as z, getPathsFromObeject as B, hexToRGB as V, isInViewport as H, isTestMode as U, makeId as W } from "./helpers/utils.mjs";
18
+ import { disableReactDevTools as G } from "./helpers/security.mjs";
19
+ import { createStripTypenameLink as K, stripTypenameDeep as q } from "./helpers/stripTypename.mjs";
20
+ import J from "./dataSource/hooks/useRegisterSource.mjs";
21
+ import Y, { utilityOptions as X } from "./dataSource/utility/index.mjs";
22
+ import Z from "./dataSource/getBindingsDetails.mjs";
23
+ import Q from "./devTools/DevToolsContext.mjs";
24
+ import $, { createStoreDevToolsLogger as ee, pConsole as te } from "./devTools/utils/PlitziConsole.mjs";
25
+ import ne from "./elements/ComponentContext.mjs";
26
+ import re from "./hooks/useNetwork.mjs";
27
+ import ie, { PlitziServiceContext as ae, PlitziServiceProvider as oe } from "./hooks/usePlitziServiceContext.mjs";
28
+ import { StyleVariableCategory as se } from "./types/StyleTypes.mjs";
29
+ import ce, { EMPTY_STYLE_SCHEMA as le, StyleBindingsAllowed as ue, baseDefaultValue as de, inheritableAttributesBase as fe } from "./style/styleConstants.mjs";
30
+ import pe from "./schema/SchemaContext.mjs";
31
+ import { EMPTY_SCHEMA as me, VARIABLE_REGEX as he } from "./schema/schemaConstants.mjs";
32
+ import ge from "./network/NetworkContext.mjs";
33
+ import _e from "./network/NetworkInternalContext.mjs";
34
+ import { SpaceEvents as ve, spaceEventSchemas as ye, validateSpaceEvent as be } from "./network/spaceEvents.mjs";
35
+ import xe from "./network/graphql/builder/Mutations/index.mjs";
36
+ import Se from "./network/graphql/builder/Queries/index.mjs";
37
+ import Ce from "./network/graphql/builder/Subscriptions/index.mjs";
38
+ import we from "./network/graphql/sdk/Mutations/index.mjs";
39
+ import Te from "./network/graphql/sdk/Queries/index.mjs";
40
+ import Ee from "./segments/SegmentsContext.mjs";
41
+ import De, { RTEvent as Oe, RTEventCloseCode as ke, getInstance as Ae, isRTEvent as je, setInstance as Me } from "./websockets/RTCodec.mjs";
42
+ import Ne, { ThemeContext as Pe } from "./theme/ThemeProvider.mjs";
43
+ import Fe, { rscDataPath as Ie } from "./server/rsc/refreshRsc.mjs";
44
+ import Le from "./server/rsc/useRscRefresh.mjs";
45
+ import Re from "./server/rsc/useRscSync.mjs";
46
+ import { runtimeStatePersist as ze } from "./state/runtimeStatePersist.mjs";
47
+ export { s as BODYLESS_METHODS, a as BuilderContext, xe as BuilderMutations, Se as BuilderQueries, c as CONNECTOR_HTTP_METHODS, ne as ComponentContext, l as DEFAULT_READ_ENDPOINT, Q as DevToolsContext, u as EMPTY_RESPONSE_METHODS, me as EMPTY_SCHEMA, le as EMPTY_STYLE_SCHEMA, ge as NetworkContext, _e as NetworkInternalContext, P as ParamsFromURL, $ as PlitziConsole, ae as PlitziServiceContext, oe as PlitziServiceProvider, d as READ_ENDPOINT_NAMES, De as RTCodec, Oe as RTEvent, ke as RTEventCloseCode, pe as SchemaContext, we as SdkMutations, Te as SdkQueries, Ee as SegmentsContext, Ce as SpaceEventSubscription, ve as SpaceEvents, ue as StyleBindingsAllowed, se as StyleVariableCategory, Pe as ThemeContext, Ne as ThemeProvider, he as VARIABLE_REGEX, f as WRITE_ENDPOINT_NAMES, e as authFailureFromResponse, de as baseDefaultValue, h as connectorPresets, p as connectorTokens, o as contexts, i as createAuthFailureLink, ee as createStoreDevToolsLogger, K as createStripTypenameLink, F as delay, G as disableReactDevTools, g as emptyManifest, I as emptyObject, y as fetchManifest, j as filters, S as formatDate, C as formatDateUTC, w as formatFromNow, T as formatUTCToLocal, b as generateFacade, L as generateID, Z as getBindingsDetails, m as getConnectorTokens, R as getDisplayName, E as getDurationMs, Ae as getInstance, z as getKeyDecoded, B as getPathsFromObeject, v as getSourceName, N as hasValidToken, V as hexToRGB, fe as inheritableAttributesBase, D as isDate, H as isInViewport, je as isRTEvent, U as isTestMode, O as isValidFormat, W as makeId, t as onAuthFailure, te as pConsole, k as parseDate, M as processTwig, Fe as refreshRsc, n as reportAuthFailure, Ie as rscDataPath, ze as runtimeStatePersist, r as sameRegistrableDomain, Me as setInstance, ye as spaceEventSchemas, q as stripTypenameDeep, ce as styleConstants, x as syntaxHighlight, A as toUnixSeconds, re as useNetwork, ie as usePlitziServiceContext, J as useRegisterSource, Le as useRscRefresh, Re as useRscSync, Y as utility, X as utilityOptions, _ as validateConnectorManifest, be as validateSpaceEvent };
@@ -0,0 +1,4 @@
1
+ export { matchPath } from './matchPath';
2
+ export { getPageFullPath, getPaths, matchRoutePath, isPageAuthored, getRouteParams } from './routes';
3
+ export type { PathMatch, PathPattern } from './matchPath';
4
+ export type { NavigationAccessLevel, NavigationAction, Path } from './routes';
@@ -0,0 +1,3 @@
1
+ import { matchPath as e } from "./matchPath.mjs";
2
+ import { getPageFullPath as t, getPaths as n, getRouteParams as r, isPageAuthored as i, matchRoutePath as a } from "./routes.mjs";
3
+ export { t as getPageFullPath, n as getPaths, r as getRouteParams, i as isPageAuthored, e as matchPath, a as matchRoutePath };
@@ -0,0 +1,12 @@
1
+ export type PathPattern = {
2
+ path: string;
3
+ caseSensitive?: boolean;
4
+ end?: boolean;
5
+ };
6
+ export type PathMatch = {
7
+ params: Record<string, string | undefined>;
8
+ pathname: string;
9
+ pathnameBase: string;
10
+ pattern: Required<PathPattern>;
11
+ };
12
+ export declare const matchPath: (pattern: PathPattern | string, pathname: string) => PathMatch | null;
@@ -0,0 +1,42 @@
1
+ //#region src/navigation/matchPath.ts
2
+ var e = (e, t, n) => {
3
+ let r = [], i = `^${e.replace(/\/*\*?$/, "").replace(/^\/*/, "/").replace(/[\\.*+^${}|()[\]]/g, "\\$&").replace(/\/:([\w-]+)(\?)?/g, (e, t, n, i, a) => {
4
+ if (r.push({
5
+ paramName: t,
6
+ isOptional: n !== void 0
7
+ }), n === void 0) return "/([^\\/]+)";
8
+ let o = a.charAt(i + e.length);
9
+ return o && o !== "/" ? "/([^\\/]*)" : "(?:/([^\\/]*))?";
10
+ }).replace(/\/([\w-]+)\?(\/|$)/g, "(/$1)?$2")}`;
11
+ return e.endsWith("*") ? (r.push({
12
+ paramName: "*",
13
+ isOptional: !1
14
+ }), i += e === "*" || e === "/*" ? "(.*)$" : "(?:\\/(.+)|\\/*)$") : n ? i += "\\/*$" : e !== "" && e !== "/" && (i += "(?:(?=\\/|$))"), [new RegExp(i, t ? void 0 : "i"), r];
15
+ }, t = (t, n) => {
16
+ let r = typeof t == "string" ? {
17
+ path: t,
18
+ caseSensitive: !1,
19
+ end: !0
20
+ } : {
21
+ path: t.path,
22
+ caseSensitive: t.caseSensitive ?? !1,
23
+ end: t.end ?? !0
24
+ }, [i, a] = e(r.path, r.caseSensitive, r.end), o = n.match(i);
25
+ if (!o) return null;
26
+ let s = o[0], c = o.slice(1), l = s.replace(/(.)\/+$/, "$1");
27
+ return {
28
+ params: a.reduce((e, { paramName: t, isOptional: n }, r) => {
29
+ let i = c[r];
30
+ if (t === "*") {
31
+ let e = i ?? "";
32
+ l = s.slice(0, s.length - e.length).replace(/(.)\/+$/, "$1");
33
+ }
34
+ return n && !i ? (e[t] = void 0, e) : (e[t] = (i ?? "").replace(/%2F/g, "/"), e);
35
+ }, {}),
36
+ pathname: s,
37
+ pathnameBase: l,
38
+ pattern: r
39
+ };
40
+ };
41
+ //#endregion
42
+ export { t as matchPath };
@@ -0,0 +1,28 @@
1
+ import { PathMatch } from './matchPath';
2
+ import { Element, PageFolder } from '../types';
3
+ export type NavigationAction = 'accessDenied' | 'normal' | 'redirect' | 'notFound';
4
+ export type NavigationAccessLevel = 'public' | 'authenticated';
5
+ export type Path = {
6
+ accessLevel?: NavigationAccessLevel;
7
+ enabled?: boolean;
8
+ hasAccess: boolean;
9
+ isRaw: boolean;
10
+ pageId: string;
11
+ path: string;
12
+ unauthorizedBehaviour?: NavigationAction;
13
+ unauthorizedPageRedirect?: string;
14
+ };
15
+ declare function getPageFullPath(pages: Record<string, Element>, pageFolders: PageFolder[], pageId: string, asString: true): string;
16
+ declare function getPageFullPath(pages: Record<string, Element>, pageFolders: PageFolder[], pageId: string, asString?: false): Record<string, string>;
17
+ declare const isPageAuthored: (accessLevel?: NavigationAccessLevel, authenticated?: boolean, previewMode?: boolean) => boolean;
18
+ declare const getPaths: (pages?: Record<string, Element>, pageFolders?: PageFolder[], authenticated?: boolean, basePath?: string, previewMode?: boolean, strictMode?: boolean) => Path[];
19
+ declare const matchRoutePath: (paths: Path[], pathName: string, authenticated: boolean) => {
20
+ action: {
21
+ type: "authenticated" | "accessDenied" | "redirect" | "notFound" | "normal";
22
+ path?: string;
23
+ };
24
+ pathMatch?: PathMatch;
25
+ pageId?: string;
26
+ };
27
+ declare const getRouteParams: (path: string) => string[];
28
+ export { getPageFullPath, getPaths, matchRoutePath, isPageAuthored, getRouteParams };
@@ -0,0 +1,124 @@
1
+ import { matchPath as e } from "./matchPath.mjs";
2
+ //#region src/navigation/routes.ts
3
+ var t = (e) => e.replace(/{{([a-zA-Z0-9-_:*/]+)}}/i, ":$1").replaceAll(/[/]+/gim, "/"), n = (e, t) => {
4
+ if (!t || !e[t]) return "";
5
+ let { slug: r, parentId: i } = e[t];
6
+ return i ? `${n(e, i)}/${r}` : r;
7
+ };
8
+ function r(e, r, i, a = !1) {
9
+ let { slug: o = "", folder: s, default: c } = e[i]?.attributes ?? {
10
+ slug: i,
11
+ folder: "",
12
+ default: !1
13
+ };
14
+ if (c && !a) return {
15
+ "/": i,
16
+ [`/${i}`]: i
17
+ };
18
+ if (c && a) return "/";
19
+ if (!s && !a) return {
20
+ [t(`/${o}`)]: i,
21
+ [`/${i}`]: i
22
+ };
23
+ if (!s && a) return `/${o}`;
24
+ if (!r.find((e) => e.id === s)) return a ? `/${o}` : {
25
+ [t(`/${o}`)]: i,
26
+ [`/${i}`]: i
27
+ };
28
+ let l = [n(r.reduce((e, t) => ({
29
+ ...e,
30
+ [t.id]: t
31
+ }), {}), s), o || i].filter(Boolean).join("/");
32
+ return a ? `/${l}` : {
33
+ [`/${l}`]: i,
34
+ [`/${i}`]: i
35
+ };
36
+ }
37
+ var i = (e, t, n = !0) => !e || !n || t === void 0 || t && e === "authenticated" || !t && e === "public" ? !0 : t && e === "public" ? !1 : !e, a = (e = {}, t = [], n, a = "", o = !0, s = !0) => {
38
+ let c = Object.keys(e).reduce((s, c) => {
39
+ let { attributes: { accessLevel: l, enabled: u = !0, unauthorizedBehaviour: d } } = e[c], { attributes: { unauthorizedPageRedirect: f } } = e[c];
40
+ if (!u && o) return s;
41
+ f &&= r(e, t, f.replace("/", ""), !0);
42
+ let p = r(e, t, c), m = Object.keys(p).map((e) => ({
43
+ pageId: c,
44
+ path: `${a}${e}`.replaceAll("//", "/"),
45
+ accessLevel: l,
46
+ enabled: u,
47
+ isRaw: `/${c}` === e,
48
+ unauthorizedBehaviour: d,
49
+ unauthorizedPageRedirect: f,
50
+ hasAccess: i(l, n, o)
51
+ }));
52
+ return [...s, ...m];
53
+ }, []).filter((e) => e.path !== "*" || e.hasAccess).sort((e, t) => e.path === t.path ? e.accessLevel === "authenticated" ? -1 : 1 : e.path > t.path ? -1 : 1);
54
+ if (!c.find((e) => e.path === "*") && !s) {
55
+ let e = c.find((e) => e.path === "/" && e.hasAccess);
56
+ e && e.unauthorizedBehaviour === "redirect" && e.unauthorizedPageRedirect && c.push({
57
+ ...e,
58
+ path: "*",
59
+ hasAccess: !1,
60
+ isRaw: !0,
61
+ unauthorizedBehaviour: "redirect",
62
+ unauthorizedPageRedirect: "/"
63
+ });
64
+ }
65
+ return c;
66
+ }, o = (t, n, r) => {
67
+ if (!n) return {
68
+ action: {
69
+ type: "accessDenied",
70
+ path: void 0
71
+ },
72
+ pathMatch: void 0
73
+ };
74
+ let i = [];
75
+ t.forEach((t) => {
76
+ let r = e({
77
+ path: t.path,
78
+ end: t.path !== "*"
79
+ }, n);
80
+ r && i.push({
81
+ matchResult: r,
82
+ path: t,
83
+ pageId: t.pageId
84
+ });
85
+ });
86
+ let a = i.find(({ path: { accessLevel: e } }) => e === "authenticated" && r || e === "public" && !r || !e);
87
+ if (a ||= i.find(({ path: { accessLevel: e } }) => e === "authenticated" && !r || e === "public" && r), !a && t.find((e) => e.path === "/" && e.hasAccess)) return {
88
+ action: {
89
+ type: "redirect",
90
+ path: "/"
91
+ },
92
+ pathMatch: void 0
93
+ };
94
+ if (!a) return {
95
+ action: {
96
+ type: "notFound",
97
+ path: void 0
98
+ },
99
+ pathMatch: void 0
100
+ };
101
+ let { pageId: o, matchResult: s, path: { hasAccess: c, unauthorizedBehaviour: l, unauthorizedPageRedirect: u } } = a;
102
+ return !c && l === "redirect" && u ? {
103
+ action: {
104
+ type: "redirect",
105
+ path: u
106
+ },
107
+ pathMatch: void 0
108
+ } : c ? {
109
+ action: {
110
+ type: "normal",
111
+ path: void 0
112
+ },
113
+ pathMatch: s,
114
+ pageId: o
115
+ } : {
116
+ action: {
117
+ type: "accessDenied",
118
+ path: void 0
119
+ },
120
+ pathMatch: void 0
121
+ };
122
+ }, s = (e) => !e || typeof e != "string" ? [] : (e.match(/:[a-zA-Z0-9-_:*]+/gim) || []).map((e) => e.replace(":", ""));
123
+ //#endregion
124
+ export { r as getPageFullPath, a as getPaths, s as getRouteParams, i as isPageAuthored, o as matchRoutePath };