@nodehive/nextjs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +102 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +7 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/internal/config.d.ts +24 -0
- package/dist/auth/internal/config.d.ts.map +1 -0
- package/dist/auth/internal/config.js +2 -0
- package/dist/auth/internal/config.js.map +1 -0
- package/dist/auth/internal/draft-mode.d.ts +17 -0
- package/dist/auth/internal/draft-mode.d.ts.map +1 -0
- package/dist/auth/internal/draft-mode.js +73 -0
- package/dist/auth/internal/draft-mode.js.map +1 -0
- package/dist/auth/internal/editor-locale.d.ts +4 -0
- package/dist/auth/internal/editor-locale.d.ts.map +1 -0
- package/dist/auth/internal/editor-locale.js +14 -0
- package/dist/auth/internal/editor-locale.js.map +1 -0
- package/dist/auth/internal/handoff.d.ts +11 -0
- package/dist/auth/internal/handoff.d.ts.map +1 -0
- package/dist/auth/internal/handoff.js +44 -0
- package/dist/auth/internal/handoff.js.map +1 -0
- package/dist/auth/internal/has-session.d.ts +7 -0
- package/dist/auth/internal/has-session.d.ts.map +1 -0
- package/dist/auth/internal/has-session.js +11 -0
- package/dist/auth/internal/has-session.js.map +1 -0
- package/dist/auth/internal/logout.d.ts +12 -0
- package/dist/auth/internal/logout.d.ts.map +1 -0
- package/dist/auth/internal/logout.js +48 -0
- package/dist/auth/internal/logout.js.map +1 -0
- package/dist/auth/internal/next-cookie-storage.d.ts +28 -0
- package/dist/auth/internal/next-cookie-storage.d.ts.map +1 -0
- package/dist/auth/internal/next-cookie-storage.js +103 -0
- package/dist/auth/internal/next-cookie-storage.js.map +1 -0
- package/dist/auth/internal/nodehive-client.d.ts +6 -0
- package/dist/auth/internal/nodehive-client.d.ts.map +1 -0
- package/dist/auth/internal/nodehive-client.js +64 -0
- package/dist/auth/internal/nodehive-client.js.map +1 -0
- package/dist/auth/internal/oauth-config.d.ts +37 -0
- package/dist/auth/internal/oauth-config.d.ts.map +1 -0
- package/dist/auth/internal/oauth-config.js +70 -0
- package/dist/auth/internal/oauth-config.js.map +1 -0
- package/dist/auth/internal/proxy-helpers.d.ts +15 -0
- package/dist/auth/internal/proxy-helpers.d.ts.map +1 -0
- package/dist/auth/internal/proxy-helpers.js +43 -0
- package/dist/auth/internal/proxy-helpers.js.map +1 -0
- package/dist/auth/internal/refresh.d.ts +13 -0
- package/dist/auth/internal/refresh.d.ts.map +1 -0
- package/dist/auth/internal/refresh.js +170 -0
- package/dist/auth/internal/refresh.js.map +1 -0
- package/dist/auth/internal/require-auth.d.ts +2 -0
- package/dist/auth/internal/require-auth.d.ts.map +1 -0
- package/dist/auth/internal/require-auth.js +11 -0
- package/dist/auth/internal/require-auth.js.map +1 -0
- package/dist/auth/internal/return-to.d.ts +16 -0
- package/dist/auth/internal/return-to.d.ts.map +1 -0
- package/dist/auth/internal/return-to.js +31 -0
- package/dist/auth/internal/return-to.js.map +1 -0
- package/dist/auth/internal/routes/callback.d.ts +11 -0
- package/dist/auth/internal/routes/callback.d.ts.map +1 -0
- package/dist/auth/internal/routes/callback.js +93 -0
- package/dist/auth/internal/routes/callback.js.map +1 -0
- package/dist/auth/internal/routes/chips-exchange.d.ts +4 -0
- package/dist/auth/internal/routes/chips-exchange.d.ts.map +1 -0
- package/dist/auth/internal/routes/chips-exchange.js +64 -0
- package/dist/auth/internal/routes/chips-exchange.js.map +1 -0
- package/dist/auth/internal/routes/draft.d.ts +4 -0
- package/dist/auth/internal/routes/draft.d.ts.map +1 -0
- package/dist/auth/internal/routes/draft.js +34 -0
- package/dist/auth/internal/routes/draft.js.map +1 -0
- package/dist/auth/internal/routes/index.d.ts +25 -0
- package/dist/auth/internal/routes/index.d.ts.map +1 -0
- package/dist/auth/internal/routes/index.js +66 -0
- package/dist/auth/internal/routes/index.js.map +1 -0
- package/dist/auth/internal/routes/login.d.ts +3 -0
- package/dist/auth/internal/routes/login.d.ts.map +1 -0
- package/dist/auth/internal/routes/login.js +47 -0
- package/dist/auth/internal/routes/login.js.map +1 -0
- package/dist/auth/internal/routes/popup-done.d.ts +3 -0
- package/dist/auth/internal/routes/popup-done.d.ts.map +1 -0
- package/dist/auth/internal/routes/popup-done.js +24 -0
- package/dist/auth/internal/routes/popup-done.js.map +1 -0
- package/dist/auth/internal/routes/refresh.d.ts +6 -0
- package/dist/auth/internal/routes/refresh.d.ts.map +1 -0
- package/dist/auth/internal/routes/refresh.js +44 -0
- package/dist/auth/internal/routes/refresh.js.map +1 -0
- package/dist/auth/internal/same-origin.d.ts +8 -0
- package/dist/auth/internal/same-origin.d.ts.map +1 -0
- package/dist/auth/internal/same-origin.js +9 -0
- package/dist/auth/internal/same-origin.js.map +1 -0
- package/dist/auth/internal/session-gates.d.ts +7 -0
- package/dist/auth/internal/session-gates.d.ts.map +1 -0
- package/dist/auth/internal/session-gates.js +12 -0
- package/dist/auth/internal/session-gates.js.map +1 -0
- package/dist/auth/internal/update-session.d.ts +17 -0
- package/dist/auth/internal/update-session.d.ts.map +1 -0
- package/dist/auth/internal/update-session.js +39 -0
- package/dist/auth/internal/update-session.js.map +1 -0
- package/dist/auth/internal/use-editor-login.d.ts +33 -0
- package/dist/auth/internal/use-editor-login.d.ts.map +1 -0
- package/dist/auth/internal/use-editor-login.js +143 -0
- package/dist/auth/internal/use-editor-login.js.map +1 -0
- package/dist/auth/proxy.d.ts +8 -0
- package/dist/auth/proxy.d.ts.map +1 -0
- package/dist/auth/proxy.js +8 -0
- package/dist/auth/proxy.js.map +1 -0
- package/dist/auth/react.d.ts +2 -0
- package/dist/auth/react.d.ts.map +1 -0
- package/dist/auth/react.js +3 -0
- package/dist/auth/react.js.map +1 -0
- package/dist/auth/routes.d.ts +3 -0
- package/dist/auth/routes.d.ts.map +1 -0
- package/dist/auth/routes.js +3 -0
- package/dist/auth/routes.js.map +1 -0
- package/dist/auth/server.d.ts +23 -0
- package/dist/auth/server.d.ts.map +1 -0
- package/dist/auth/server.js +61 -0
- package/dist/auth/server.js.map +1 -0
- package/dist/puck-editor/fields.d.ts +7 -0
- package/dist/puck-editor/fields.d.ts.map +1 -0
- package/dist/puck-editor/fields.js +4 -0
- package/dist/puck-editor/fields.js.map +1 -0
- package/dist/puck-editor/index.d.ts +14 -0
- package/dist/puck-editor/index.d.ts.map +1 -0
- package/dist/puck-editor/index.js +12 -0
- package/dist/puck-editor/index.js.map +1 -0
- package/dist/puck-editor/internal/api/client.d.ts +32 -0
- package/dist/puck-editor/internal/api/client.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/client.js +128 -0
- package/dist/puck-editor/internal/api/client.js.map +1 -0
- package/dist/puck-editor/internal/api/config.d.ts +29 -0
- package/dist/puck-editor/internal/api/config.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/config.js +2 -0
- package/dist/puck-editor/internal/api/config.js.map +1 -0
- package/dist/puck-editor/internal/api/create-puck-api.d.ts +26 -0
- package/dist/puck-editor/internal/api/create-puck-api.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/create-puck-api.js +124 -0
- package/dist/puck-editor/internal/api/create-puck-api.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts +13 -0
- package/dist/puck-editor/internal/api/handlers/create-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/create-page.js +125 -0
- package/dist/puck-editor/internal/api/handlers/create-page.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/entities.d.ts +17 -0
- package/dist/puck-editor/internal/api/handlers/entities.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/entities.js +166 -0
- package/dist/puck-editor/internal/api/handlers/entities.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/publish.d.ts +6 -0
- package/dist/puck-editor/internal/api/handlers/publish.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/publish.js +115 -0
- package/dist/puck-editor/internal/api/handlers/publish.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/template.d.ts +15 -0
- package/dist/puck-editor/internal/api/handlers/template.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/template.js +222 -0
- package/dist/puck-editor/internal/api/handlers/template.js.map +1 -0
- package/dist/puck-editor/internal/api/handlers/upload.d.ts +13 -0
- package/dist/puck-editor/internal/api/handlers/upload.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/handlers/upload.js +129 -0
- package/dist/puck-editor/internal/api/handlers/upload.js.map +1 -0
- package/dist/puck-editor/internal/api/media-params.d.ts +4 -0
- package/dist/puck-editor/internal/api/media-params.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/media-params.js +38 -0
- package/dist/puck-editor/internal/api/media-params.js.map +1 -0
- package/dist/puck-editor/internal/api/media-upload.d.ts +24 -0
- package/dist/puck-editor/internal/api/media-upload.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/media-upload.js +171 -0
- package/dist/puck-editor/internal/api/media-upload.js.map +1 -0
- package/dist/puck-editor/internal/api/space.d.ts +4 -0
- package/dist/puck-editor/internal/api/space.d.ts.map +1 -0
- package/dist/puck-editor/internal/api/space.js +11 -0
- package/dist/puck-editor/internal/api/space.js.map +1 -0
- package/dist/puck-editor/internal/content-model.d.ts +55 -0
- package/dist/puck-editor/internal/content-model.d.ts.map +1 -0
- package/dist/puck-editor/internal/content-model.js +73 -0
- package/dist/puck-editor/internal/content-model.js.map +1 -0
- package/dist/puck-editor/internal/editor/allowed-types.d.ts +4 -0
- package/dist/puck-editor/internal/editor/allowed-types.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/allowed-types.js +6 -0
- package/dist/puck-editor/internal/editor/allowed-types.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts +9 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.js +231 -0
- package/dist/puck-editor/internal/editor/canvas-add-picker.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts +6 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.js +85 -0
- package/dist/puck-editor/internal/editor/canvas-empty-state.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts +2 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.js +844 -0
- package/dist/puck-editor/internal/editor/canvas-quick-add.js.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts +3 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.js +16 -0
- package/dist/puck-editor/internal/editor/canvas-scroll.js.map +1 -0
- package/dist/puck-editor/internal/editor/component-icons.d.ts +14 -0
- package/dist/puck-editor/internal/editor/component-icons.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/component-icons.js +35 -0
- package/dist/puck-editor/internal/editor/component-icons.js.map +1 -0
- package/dist/puck-editor/internal/editor/component-item.d.ts +6 -0
- package/dist/puck-editor/internal/editor/component-item.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/component-item.js +42 -0
- package/dist/puck-editor/internal/editor/component-item.js.map +1 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts +6 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.js +249 -0
- package/dist/puck-editor/internal/editor/editor-action-bar.js.map +1 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts +7 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.js +120 -0
- package/dist/puck-editor/internal/editor/editor-header-actions.js.map +1 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts +15 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.js +61 -0
- package/dist/puck-editor/internal/editor/find-missing-required-fields.js.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts +15 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js +147 -0
- package/dist/puck-editor/internal/editor/grouped-drawer-panel.js.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts +17 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.js +125 -0
- package/dist/puck-editor/internal/editor/grouped-entry-list.js.map +1 -0
- package/dist/puck-editor/internal/editor/header-save-button.d.ts +5 -0
- package/dist/puck-editor/internal/editor/header-save-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/header-save-button.js +60 -0
- package/dist/puck-editor/internal/editor/header-save-button.js.map +1 -0
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts +4 -0
- package/dist/puck-editor/internal/editor/page-template-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/page-template-picker.js +140 -0
- package/dist/puck-editor/internal/editor/page-template-picker.js.map +1 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts +6 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.js +79 -0
- package/dist/puck-editor/internal/editor/picker-entry-item.js.map +1 -0
- package/dist/puck-editor/internal/editor/picker-model.d.ts +62 -0
- package/dist/puck-editor/internal/editor/picker-model.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/picker-model.js +489 -0
- package/dist/puck-editor/internal/editor/picker-model.js.map +1 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts +30 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.js +30 -0
- package/dist/puck-editor/internal/editor/publish-puck-data.js.map +1 -0
- package/dist/puck-editor/internal/editor/puck-editor.d.ts +15 -0
- package/dist/puck-editor/internal/editor/puck-editor.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/puck-editor.js +333 -0
- package/dist/puck-editor/internal/editor/puck-editor.js.map +1 -0
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts +4 -0
- package/dist/puck-editor/internal/editor/section-template-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/section-template-modal.js +71 -0
- package/dist/puck-editor/internal/editor/section-template-modal.js.map +1 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts +15 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js +93 -0
- package/dist/puck-editor/internal/editor/use-scroll-lock-outside.js.map +1 -0
- package/dist/puck-editor/internal/editor-config.d.ts +30 -0
- package/dist/puck-editor/internal/editor-config.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor-config.js +57 -0
- package/dist/puck-editor/internal/editor-config.js.map +1 -0
- package/dist/puck-editor/internal/editor-query-client.d.ts +4 -0
- package/dist/puck-editor/internal/editor-query-client.d.ts.map +1 -0
- package/dist/puck-editor/internal/editor-query-client.js +8 -0
- package/dist/puck-editor/internal/editor-query-client.js.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts +14 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js +120 -0
- package/dist/puck-editor/internal/fields/checkbox-group/checkbox-group-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts +21 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js +24 -0
- package/dist/puck-editor/internal/fields/checkbox-group/create-checkbox-group-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts +16 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js +20 -0
- package/dist/puck-editor/internal/fields/date-picker/create-date-picker-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts +8 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js +151 -0
- package/dist/puck-editor/internal/fields/date-picker/date-picker.js.map +1 -0
- package/dist/puck-editor/internal/fields/index.d.ts +10 -0
- package/dist/puck-editor/internal/fields/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/index.js +10 -0
- package/dist/puck-editor/internal/fields/index.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts +33 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.js +83 -0
- package/dist/puck-editor/internal/fields/link-picker/anchor.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts +24 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js +31 -0
- package/dist/puck-editor/internal/fields/link-picker/create-link-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts +2 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.js +4 -0
- package/dist/puck-editor/internal/fields/link-picker/humanize.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts +27 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js +564 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-control.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts +9 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js +189 -0
- package/dist/puck-editor/internal/fields/link-picker/link-picker-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts +72 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.js +114 -0
- package/dist/puck-editor/internal/fields/link-picker/link-value.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts +14 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js +667 -0
- package/dist/puck-editor/internal/fields/link-picker/rich-text-link-button.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts +11 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js +34 -0
- package/dist/puck-editor/internal/fields/link-picker/richtext-extensions.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts +40 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js +146 -0
- package/dist/puck-editor/internal/fields/link-picker/segmented-control.js.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts +34 -0
- package/dist/puck-editor/internal/fields/link-picker/types.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/link-picker/types.js +2 -0
- package/dist/puck-editor/internal/fields/link-picker/types.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts +27 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js +32 -0
- package/dist/puck-editor/internal/fields/media-array/create-media-array-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts +13 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js +372 -0
- package/dist/puck-editor/internal/fields/media-array/media-array-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts +2 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.js +8 -0
- package/dist/puck-editor/internal/fields/media-array/reorder.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts +27 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js +32 -0
- package/dist/puck-editor/internal/fields/media-selector/create-media-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts +11 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js +219 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-editor-dialog.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts +24 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.js +8 -0
- package/dist/puck-editor/internal/fields/media-selector/crop-types.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts +8 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js +51 -0
- package/dist/puck-editor/internal/fields/media-selector/extract-fields.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts +7 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js +147 -0
- package/dist/puck-editor/internal/fields/media-selector/image-upload-form.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts +30 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js +358 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts +14 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js +355 -0
- package/dist/puck-editor/internal/fields/media-selector/media-selector-modal.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts +2 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js +55 -0
- package/dist/puck-editor/internal/fields/media-selector/use-debounced-value.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts +24 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js +229 -0
- package/dist/puck-editor/internal/fields/media-selector/use-media-library.js.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts +7 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js +120 -0
- package/dist/puck-editor/internal/fields/media-selector/video-upload-form.js.map +1 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts +31 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js +39 -0
- package/dist/puck-editor/internal/fields/node-selector/create-node-selector-field.js.map +1 -0
- package/dist/puck-editor/internal/fields/required-field-label.d.ts +16 -0
- package/dist/puck-editor/internal/fields/required-field-label.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/required-field-label.js +89 -0
- package/dist/puck-editor/internal/fields/required-field-label.js.map +1 -0
- package/dist/puck-editor/internal/fields/required.d.ts +19 -0
- package/dist/puck-editor/internal/fields/required.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/required.js +20 -0
- package/dist/puck-editor/internal/fields/required.js.map +1 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts +37 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.d.ts.map +1 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js +26 -0
- package/dist/puck-editor/internal/fields/rich-text/create-rich-text-field.js.map +1 -0
- package/dist/puck-editor/internal/i18n.d.ts +188 -0
- package/dist/puck-editor/internal/i18n.d.ts.map +1 -0
- package/dist/puck-editor/internal/i18n.js +414 -0
- package/dist/puck-editor/internal/i18n.js.map +1 -0
- package/dist/puck-editor/internal/locale.d.ts +13 -0
- package/dist/puck-editor/internal/locale.d.ts.map +1 -0
- package/dist/puck-editor/internal/locale.js +20 -0
- package/dist/puck-editor/internal/locale.js.map +1 -0
- package/dist/puck-editor/internal/localize.d.ts +11 -0
- package/dist/puck-editor/internal/localize.d.ts.map +1 -0
- package/dist/puck-editor/internal/localize.js +42 -0
- package/dist/puck-editor/internal/localize.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts +21 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js +197 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-bridge.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js +131 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-info-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js +46 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/agent-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts +46 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js +176 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/apply-patch-to-puck.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js +39 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/catalog.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.js +3 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/constants.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts +17 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js +35 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/create-page.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts +19 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js +79 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/find-component-location.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.js +243 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/help.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts +19 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js +31 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/list-media.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts +23 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js +72 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/templates.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts +20 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js +34 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/upload-media.js.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts +17 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js +70 -0
- package/dist/puck-editor/internal/plugins/agent-plugin/use-agent-handle.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js +37 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js +18 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/blocks-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/blocks-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js +861 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js +16 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts +53 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js +145 -0
- package/dist/puck-editor/internal/plugins/outline-plugin/outline-tree.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js +69 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js +18 -0
- package/dist/puck-editor/internal/plugins/sections-plugin/sections-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js +178 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/ai-options-fields.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts +3 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js +55 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/apply-vehicle-slot-constraints.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts +12 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js +125 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/component-template-modal.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts +8 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js +582 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/custom-template-list.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js +6 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/index.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts +4 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js +54 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/root-drop-zone.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts +11 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js +92 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-form.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts +7 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js +30 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/template-vehicles.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts +2 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js +471 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-panel.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts +5 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js +16 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates-plugin.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts +43 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js +115 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/templates.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts +9 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js +152 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-template-dnd.js.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts +16 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.d.ts.map +1 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js +134 -0
- package/dist/puck-editor/internal/plugins/templates-plugin/use-templates.js.map +1 -0
- package/dist/puck-editor/internal/puck-augmentation.d.ts +28 -0
- package/dist/puck-editor/internal/puck-augmentation.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-augmentation.js +7 -0
- package/dist/puck-editor/internal/puck-augmentation.js.map +1 -0
- package/dist/puck-editor/internal/puck-editor-provider.d.ts +12 -0
- package/dist/puck-editor/internal/puck-editor-provider.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-editor-provider.js +69 -0
- package/dist/puck-editor/internal/puck-editor-provider.js.map +1 -0
- package/dist/puck-editor/internal/puck-node.d.ts +29 -0
- package/dist/puck-editor/internal/puck-node.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-node.js +2 -0
- package/dist/puck-editor/internal/puck-node.js.map +1 -0
- package/dist/puck-editor/internal/puck-wrapper.d.ts +19 -0
- package/dist/puck-editor/internal/puck-wrapper.d.ts.map +1 -0
- package/dist/puck-editor/internal/puck-wrapper.js +270 -0
- package/dist/puck-editor/internal/puck-wrapper.js.map +1 -0
- package/dist/puck-editor/internal/render/cropped-image.d.ts +19 -0
- package/dist/puck-editor/internal/render/cropped-image.d.ts.map +1 -0
- package/dist/puck-editor/internal/render/cropped-image.js +126 -0
- package/dist/puck-editor/internal/render/cropped-image.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/index.d.ts +13 -0
- package/dist/puck-editor/internal/smart-actions/index.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/index.js +29 -0
- package/dist/puck-editor/internal/smart-actions/index.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts +13 -0
- package/dist/puck-editor/internal/smart-actions/new-page.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/new-page.js +80 -0
- package/dist/puck-editor/internal/smart-actions/new-page.js.map +1 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts +2 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.d.ts.map +1 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js +65 -0
- package/dist/puck-editor/internal/smart-actions/open-puck-editor.js.map +1 -0
- package/dist/puck-editor/internal/ui/calendar.d.ts +9 -0
- package/dist/puck-editor/internal/ui/calendar.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/calendar.js +147 -0
- package/dist/puck-editor/internal/ui/calendar.js.map +1 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts +13 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.js +93 -0
- package/dist/puck-editor/internal/ui/component-list-accordion.js.map +1 -0
- package/dist/puck-editor/internal/ui/dialog.d.ts +20 -0
- package/dist/puck-editor/internal/ui/dialog.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/dialog.js +286 -0
- package/dist/puck-editor/internal/ui/dialog.js.map +1 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts +11 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.js +109 -0
- package/dist/puck-editor/internal/ui/drawer-item-content.js.map +1 -0
- package/dist/puck-editor/internal/ui/icon-button.d.ts +10 -0
- package/dist/puck-editor/internal/ui/icon-button.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/icon-button.js +72 -0
- package/dist/puck-editor/internal/ui/icon-button.js.map +1 -0
- package/dist/puck-editor/internal/ui/popover.d.ts +9 -0
- package/dist/puck-editor/internal/ui/popover.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/popover.js +165 -0
- package/dist/puck-editor/internal/ui/popover.js.map +1 -0
- package/dist/puck-editor/internal/ui/required-mark.d.ts +2 -0
- package/dist/puck-editor/internal/ui/required-mark.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/required-mark.js +12 -0
- package/dist/puck-editor/internal/ui/required-mark.js.map +1 -0
- package/dist/puck-editor/internal/ui/search-control.d.ts +20 -0
- package/dist/puck-editor/internal/ui/search-control.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/search-control.js +156 -0
- package/dist/puck-editor/internal/ui/search-control.js.map +1 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts +2 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.d.ts.map +1 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.js +40 -0
- package/dist/puck-editor/internal/ui/use-panel-search-focus.js.map +1 -0
- package/dist/puck-editor/internal/use-puck-overlay.d.ts +16 -0
- package/dist/puck-editor/internal/use-puck-overlay.d.ts.map +1 -0
- package/dist/puck-editor/internal/use-puck-overlay.js +121 -0
- package/dist/puck-editor/internal/use-puck-overlay.js.map +1 -0
- package/dist/puck-editor/internal/utils.d.ts +6 -0
- package/dist/puck-editor/internal/utils.d.ts.map +1 -0
- package/dist/puck-editor/internal/utils.js +57 -0
- package/dist/puck-editor/internal/utils.js.map +1 -0
- package/dist/puck-editor/puck-theme.css +110 -0
- package/dist/puck-editor/render.d.ts +3 -0
- package/dist/puck-editor/render.d.ts.map +1 -0
- package/dist/puck-editor/render.js +2 -0
- package/dist/puck-editor/render.js.map +1 -0
- package/dist/puck-editor/server.d.ts +4 -0
- package/dist/puck-editor/server.d.ts.map +1 -0
- package/dist/puck-editor/server.js +4 -0
- package/dist/puck-editor/server.js.map +1 -0
- package/dist/puck-editor/smart-actions.d.ts +2 -0
- package/dist/puck-editor/smart-actions.d.ts.map +1 -0
- package/dist/puck-editor/smart-actions.js +2 -0
- package/dist/puck-editor/smart-actions.js.map +1 -0
- package/dist/shared/cn.d.ts +3 -0
- package/dist/shared/cn.d.ts.map +1 -0
- package/dist/shared/cn.js +9 -0
- package/dist/shared/cn.js.map +1 -0
- package/dist/shared/i18n.d.ts +5 -0
- package/dist/shared/i18n.d.ts.map +1 -0
- package/dist/shared/i18n.js +18 -0
- package/dist/shared/i18n.js.map +1 -0
- package/dist/shared/toolbar-action.d.ts +9 -0
- package/dist/shared/toolbar-action.d.ts.map +1 -0
- package/dist/shared/toolbar-action.js +2 -0
- package/dist/shared/toolbar-action.js.map +1 -0
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts +19 -0
- package/dist/smart-actions/internal/get-smart-actions-context.d.ts.map +1 -0
- package/dist/smart-actions/internal/get-smart-actions-context.js +24 -0
- package/dist/smart-actions/internal/get-smart-actions-context.js.map +1 -0
- package/dist/smart-actions/internal/i18n.d.ts +20 -0
- package/dist/smart-actions/internal/i18n.d.ts.map +1 -0
- package/dist/smart-actions/internal/i18n.js +35 -0
- package/dist/smart-actions/internal/i18n.js.map +1 -0
- package/dist/smart-actions/internal/logout-form.d.ts +8 -0
- package/dist/smart-actions/internal/logout-form.d.ts.map +1 -0
- package/dist/smart-actions/internal/logout-form.js +88 -0
- package/dist/smart-actions/internal/logout-form.js.map +1 -0
- package/dist/smart-actions/internal/refresh-page.d.ts +2 -0
- package/dist/smart-actions/internal/refresh-page.d.ts.map +1 -0
- package/dist/smart-actions/internal/refresh-page.js +126 -0
- package/dist/smart-actions/internal/refresh-page.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-button.d.ts +24 -0
- package/dist/smart-actions/internal/smart-actions-button.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-button.js +41 -0
- package/dist/smart-actions/internal/smart-actions-button.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-config.d.ts +13 -0
- package/dist/smart-actions/internal/smart-actions-config.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-config.js +101 -0
- package/dist/smart-actions/internal/smart-actions-config.js.map +1 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts +15 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.d.ts.map +1 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js +71 -0
- package/dist/smart-actions/internal/smart-actions-toolbar-client.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts +13 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js +323 -0
- package/dist/smart-actions/internal/toolbar/smart-actions-toolbar.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/storage.d.ts +7 -0
- package/dist/smart-actions/internal/toolbar/storage.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/storage.js +29 -0
- package/dist/smart-actions/internal/toolbar/storage.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/types.d.ts +4 -0
- package/dist/smart-actions/internal/toolbar/types.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/types.js +2 -0
- package/dist/smart-actions/internal/toolbar/types.js.map +1 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts +6 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.d.ts.map +1 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js +43 -0
- package/dist/smart-actions/internal/toolbar/use-smart-actions-toolbar-mode.js.map +1 -0
- package/dist/smart-actions/internal/ui/tooltip.d.ts +8 -0
- package/dist/smart-actions/internal/ui/tooltip.d.ts.map +1 -0
- package/dist/smart-actions/internal/ui/tooltip.js +156 -0
- package/dist/smart-actions/internal/ui/tooltip.js.map +1 -0
- package/dist/smart-actions/internal/user-profile.d.ts +8 -0
- package/dist/smart-actions/internal/user-profile.d.ts.map +1 -0
- package/dist/smart-actions/internal/user-profile.js +30 -0
- package/dist/smart-actions/internal/user-profile.js.map +1 -0
- package/dist/smart-actions/server.d.ts +4 -0
- package/dist/smart-actions/server.d.ts.map +1 -0
- package/dist/smart-actions/server.js +4 -0
- package/dist/smart-actions/server.js.map +1 -0
- package/dist/theme.css +2 -0
- package/dist/visual-editor/index.d.ts +4 -0
- package/dist/visual-editor/index.d.ts.map +1 -0
- package/dist/visual-editor/index.js +4 -0
- package/dist/visual-editor/index.js.map +1 -0
- package/dist/visual-editor/internal/bridge/connector.d.ts +7 -0
- package/dist/visual-editor/internal/bridge/connector.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/connector.js +72 -0
- package/dist/visual-editor/internal/bridge/connector.js.map +1 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts +8 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js +44 -0
- package/dist/visual-editor/internal/bridge/draft-mode-self-heal.js.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts +16 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js +43 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate-server.js.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts +15 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.d.ts.map +1 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js +146 -0
- package/dist/visual-editor/internal/bridge/editor-auth-gate.js.map +1 -0
- package/dist/visual-editor/internal/i18n.d.ts +29 -0
- package/dist/visual-editor/internal/i18n.d.ts.map +1 -0
- package/dist/visual-editor/internal/i18n.js +51 -0
- package/dist/visual-editor/internal/i18n.js.map +1 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts +7 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.js +15 -0
- package/dist/visual-editor/internal/overlays/drupal-origin.js.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-button.d.ts +10 -0
- package/dist/visual-editor/internal/overlays/edit-button.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-button.js +138 -0
- package/dist/visual-editor/internal/overlays/edit-button.js.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts +3 -0
- package/dist/visual-editor/internal/overlays/edit-icon.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/edit-icon.js +19 -0
- package/dist/visual-editor/internal/overlays/edit-icon.js.map +1 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts +15 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js +52 -0
- package/dist/visual-editor/internal/overlays/fragment/fragment-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts +6 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js +42 -0
- package/dist/visual-editor/internal/overlays/iframe-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts +9 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js +33 -0
- package/dist/visual-editor/internal/overlays/menu/menu-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts +13 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.js +17 -0
- package/dist/visual-editor/internal/overlays/node/node-metadata.js.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts +8 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js +25 -0
- package/dist/visual-editor/internal/overlays/node/node-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts +18 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.d.ts.map +1 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js +58 -0
- package/dist/visual-editor/internal/overlays/paragraph/paragraph-wrapper.js.map +1 -0
- package/dist/visual-editor/internal/revalidate-route.d.ts +19 -0
- package/dist/visual-editor/internal/revalidate-route.d.ts.map +1 -0
- package/dist/visual-editor/internal/revalidate-route.js +51 -0
- package/dist/visual-editor/internal/revalidate-route.js.map +1 -0
- package/dist/visual-editor/server.d.ts +7 -0
- package/dist/visual-editor/server.d.ts.map +1 -0
- package/dist/visual-editor/server.js +8 -0
- package/dist/visual-editor/server.js.map +1 -0
- package/package.json +154 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { cookies } from 'next/headers';
|
|
2
|
+
// SameSite=None reaches the cross-site editor iframe (CSRF restored by the
|
|
3
|
+
// Sec-Fetch-Site guard in proxy.ts); Partitioned (CHIPS) keeps it usable in
|
|
4
|
+
// privacy browsers without a storage-access gesture.
|
|
5
|
+
export const BASE_COOKIE_OPTIONS = {
|
|
6
|
+
httpOnly: true,
|
|
7
|
+
sameSite: 'none',
|
|
8
|
+
secure: true,
|
|
9
|
+
partitioned: true,
|
|
10
|
+
path: '/'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
// Expire both the partitioned and the legacy unpartitioned variant — a same-named
|
|
14
|
+
// cookie can exist in each partition, and the stale one would resend a consumed token.
|
|
15
|
+
// Attributes are derived from BASE_COOKIE_OPTIONS so the deletion keeps matching
|
|
16
|
+
// if those change. NOTE: this appends raw Set-Cookie headers — do not also call
|
|
17
|
+
// response.cookies.set() for an auth cookie on the same response, or Next's
|
|
18
|
+
// ResponseCookies.replace() will drop these headers.
|
|
19
|
+
export function appendClearedAuthCookie(response, name) {
|
|
20
|
+
const o = BASE_COOKIE_OPTIONS;
|
|
21
|
+
const sameSite = o.sameSite.charAt(0).toUpperCase() + o.sameSite.slice(1);
|
|
22
|
+
const base = `${name}=; Path=${o.path}; Max-Age=0; SameSite=${sameSite}` + (o.httpOnly ? '; HttpOnly' : '') + (o.secure ? '; Secure' : '');
|
|
23
|
+
response.headers.append('set-cookie', base);
|
|
24
|
+
response.headers.append('set-cookie', `${base}; Partitioned`);
|
|
25
|
+
}
|
|
26
|
+
export class NextCookieStorage {
|
|
27
|
+
constructor(proxyContext) {
|
|
28
|
+
this.request = proxyContext?.request;
|
|
29
|
+
this.response = proxyContext?.response;
|
|
30
|
+
}
|
|
31
|
+
static cookieKeys() {
|
|
32
|
+
const spacePrefix = process.env.NEXT_PUBLIC_NODEHIVE_SPACE_NAME || 'nodehive';
|
|
33
|
+
return {
|
|
34
|
+
token: `${spacePrefix}_token`,
|
|
35
|
+
refresh_token: `${spacePrefix}_refresh_token`,
|
|
36
|
+
user_details: `${spacePrefix}_user_details`,
|
|
37
|
+
token_expires_at: `${spacePrefix}_token_expires_at`,
|
|
38
|
+
oauth_state: `${spacePrefix}_oauth_state`,
|
|
39
|
+
pkce_verifier: `${spacePrefix}_pkce_verifier`,
|
|
40
|
+
return_to: `${spacePrefix}_return_to`,
|
|
41
|
+
redirect_uri: `${spacePrefix}_redirect_uri`
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
resolveKey(key) {
|
|
45
|
+
return NextCookieStorage.cookieKeys()[key] ?? null;
|
|
46
|
+
}
|
|
47
|
+
async get(key) {
|
|
48
|
+
const name = this.resolveKey(key);
|
|
49
|
+
if (!name) return null;
|
|
50
|
+
if (this.request) {
|
|
51
|
+
return this.request.cookies.get(name)?.value || null;
|
|
52
|
+
}
|
|
53
|
+
const cookieStore = await cookies();
|
|
54
|
+
return cookieStore.get(name)?.value || null;
|
|
55
|
+
}
|
|
56
|
+
async set(key, value, options) {
|
|
57
|
+
const name = this.resolveKey(key);
|
|
58
|
+
if (!name) return;
|
|
59
|
+
if (this.request && this.response) {
|
|
60
|
+
// Proxy context: set on request (for server components) and response (for browser)
|
|
61
|
+
this.request.cookies.set(name, value);
|
|
62
|
+
this.response.cookies.set(name, value, {
|
|
63
|
+
...BASE_COOKIE_OPTIONS,
|
|
64
|
+
maxAge: options?.maxAge
|
|
65
|
+
});
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Server component / server action context
|
|
70
|
+
const cookieStore = await cookies();
|
|
71
|
+
cookieStore.set({
|
|
72
|
+
name,
|
|
73
|
+
value,
|
|
74
|
+
maxAge: options?.maxAge,
|
|
75
|
+
httpOnly: options?.httpOnly ?? BASE_COOKIE_OPTIONS.httpOnly,
|
|
76
|
+
sameSite: options?.sameSite?.toLowerCase() ?? BASE_COOKIE_OPTIONS.sameSite,
|
|
77
|
+
secure: options?.secure ?? BASE_COOKIE_OPTIONS.secure,
|
|
78
|
+
partitioned: BASE_COOKIE_OPTIONS.partitioned,
|
|
79
|
+
path: options?.path ?? BASE_COOKIE_OPTIONS.path
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
async remove(key) {
|
|
83
|
+
const name = this.resolveKey(key);
|
|
84
|
+
if (!name) return;
|
|
85
|
+
if (this.request && this.response) {
|
|
86
|
+
this.request.cookies.delete(name);
|
|
87
|
+
appendClearedAuthCookie(this.response, name);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// Server-action context (logout): Next's ResponseCookies is keyed by name,
|
|
92
|
+
// so we can only emit ONE Set-Cookie per cookie — we clear the current
|
|
93
|
+
// partitioned variant. A pre-migration unpartitioned cookie can't be cleared
|
|
94
|
+
// here, but logout revokes the token at the IdP (performLogout) and the
|
|
95
|
+
// proxy's auth-failure path dual-clears it on the next request.
|
|
96
|
+
const cookieStore = await cookies();
|
|
97
|
+
cookieStore.set(name, '', {
|
|
98
|
+
...BASE_COOKIE_OPTIONS,
|
|
99
|
+
maxAge: 0
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=next-cookie-storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"next-cookie-storage.js","names":["cookies","BASE_COOKIE_OPTIONS","httpOnly","sameSite","secure","partitioned","path","appendClearedAuthCookie","response","name","o","charAt","toUpperCase","slice","base","headers","append","NextCookieStorage","constructor","proxyContext","request","cookieKeys","spacePrefix","process","env","NEXT_PUBLIC_NODEHIVE_SPACE_NAME","token","refresh_token","user_details","token_expires_at","oauth_state","pkce_verifier","return_to","redirect_uri","resolveKey","key","get","value","cookieStore","set","options","maxAge","toLowerCase","remove","delete"],"sources":["../../../src/auth/internal/next-cookie-storage.ts"],"sourcesContent":["import { cookies } from 'next/headers';\nimport type { NextRequest, NextResponse } from 'next/server';\nimport type { CookieOptions, StorageAdapter } from 'nodehive-js';\n\ntype CookieKey =\n | 'token'\n | 'refresh_token'\n | 'user_details'\n | 'token_expires_at'\n // Short-lived (10 min) transactional cookies for the Authorization Code flow.\n | 'oauth_state'\n | 'pkce_verifier'\n | 'return_to'\n | 'redirect_uri';\n\ntype CookieKeyMap = Record<CookieKey, string>;\n\nexport interface ProxyContext {\n request: NextRequest;\n response: NextResponse;\n}\n\n// SameSite=None reaches the cross-site editor iframe (CSRF restored by the\n// Sec-Fetch-Site guard in proxy.ts); Partitioned (CHIPS) keeps it usable in\n// privacy browsers without a storage-access gesture.\nexport const BASE_COOKIE_OPTIONS = {\n httpOnly: true,\n sameSite: 'none' as const,\n secure: true,\n partitioned: true,\n path: '/',\n};\n\n// Expire both the partitioned and the legacy unpartitioned variant — a same-named\n// cookie can exist in each partition, and the stale one would resend a consumed token.\n// Attributes are derived from BASE_COOKIE_OPTIONS so the deletion keeps matching\n// if those change. NOTE: this appends raw Set-Cookie headers — do not also call\n// response.cookies.set() for an auth cookie on the same response, or Next's\n// ResponseCookies.replace() will drop these headers.\nexport function appendClearedAuthCookie(\n response: NextResponse,\n name: string\n): void {\n const o = BASE_COOKIE_OPTIONS;\n const sameSite = o.sameSite.charAt(0).toUpperCase() + o.sameSite.slice(1);\n const base =\n `${name}=; Path=${o.path}; Max-Age=0; SameSite=${sameSite}` +\n (o.httpOnly ? '; HttpOnly' : '') +\n (o.secure ? '; Secure' : '');\n response.headers.append('set-cookie', base);\n response.headers.append('set-cookie', `${base}; Partitioned`);\n}\n\nexport class NextCookieStorage implements StorageAdapter {\n private request?: NextRequest;\n private response?: NextResponse;\n\n constructor(proxyContext?: ProxyContext) {\n this.request = proxyContext?.request;\n this.response = proxyContext?.response;\n }\n\n static cookieKeys(): CookieKeyMap {\n const spacePrefix =\n process.env.NEXT_PUBLIC_NODEHIVE_SPACE_NAME || 'nodehive';\n return {\n token: `${spacePrefix}_token`,\n refresh_token: `${spacePrefix}_refresh_token`,\n user_details: `${spacePrefix}_user_details`,\n token_expires_at: `${spacePrefix}_token_expires_at`,\n oauth_state: `${spacePrefix}_oauth_state`,\n pkce_verifier: `${spacePrefix}_pkce_verifier`,\n return_to: `${spacePrefix}_return_to`,\n redirect_uri: `${spacePrefix}_redirect_uri`,\n };\n }\n\n private resolveKey(key: string): string | null {\n return NextCookieStorage.cookieKeys()[key as CookieKey] ?? null;\n }\n\n async get(key: string): Promise<string | null> {\n const name = this.resolveKey(key);\n if (!name) return null;\n\n if (this.request) {\n return this.request.cookies.get(name)?.value || null;\n }\n\n const cookieStore = await cookies();\n return cookieStore.get(name)?.value || null;\n }\n\n async set(\n key: string,\n value: string,\n options?: CookieOptions\n ): Promise<void> {\n const name = this.resolveKey(key);\n if (!name) return;\n\n if (this.request && this.response) {\n // Proxy context: set on request (for server components) and response (for browser)\n this.request.cookies.set(name, value);\n this.response.cookies.set(name, value, {\n ...BASE_COOKIE_OPTIONS,\n maxAge: options?.maxAge,\n });\n return;\n }\n\n // Server component / server action context\n const cookieStore = await cookies();\n cookieStore.set({\n name,\n value,\n maxAge: options?.maxAge,\n httpOnly: options?.httpOnly ?? BASE_COOKIE_OPTIONS.httpOnly,\n sameSite:\n (options?.sameSite?.toLowerCase() as 'lax' | 'strict' | 'none') ??\n BASE_COOKIE_OPTIONS.sameSite,\n secure: options?.secure ?? BASE_COOKIE_OPTIONS.secure,\n partitioned: BASE_COOKIE_OPTIONS.partitioned,\n path: options?.path ?? BASE_COOKIE_OPTIONS.path,\n });\n }\n\n async remove(key: string): Promise<void> {\n const name = this.resolveKey(key);\n if (!name) return;\n\n if (this.request && this.response) {\n this.request.cookies.delete(name);\n appendClearedAuthCookie(this.response, name);\n return;\n }\n\n // Server-action context (logout): Next's ResponseCookies is keyed by name,\n // so we can only emit ONE Set-Cookie per cookie — we clear the current\n // partitioned variant. A pre-migration unpartitioned cookie can't be cleared\n // here, but logout revokes the token at the IdP (performLogout) and the\n // proxy's auth-failure path dual-clears it on the next request.\n const cookieStore = await cookies();\n cookieStore.set(name, '', { ...BASE_COOKIE_OPTIONS, maxAge: 0 });\n }\n}\n"],"mappings":"AAAA,SAASA,OAAO,QAAQ,cAAc;AAsBtC;AACA;AACA;AACA,OAAO,MAAMC,mBAAmB,GAAG;EACjCC,QAAQ,EAAE,IAAI;EACdC,QAAQ,EAAE,MAAe;EACzBC,MAAM,EAAE,IAAI;EACZC,WAAW,EAAE,IAAI;EACjBC,IAAI,EAAE;AACR,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,uBAAuBA,CACrCC,QAAsB,EACtBC,IAAY,EACN;EACN,MAAMC,CAAC,GAAGT,mBAAmB;EAC7B,MAAME,QAAQ,GAAGO,CAAC,CAACP,QAAQ,CAACQ,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,CAAC,CAACP,QAAQ,CAACU,KAAK,CAAC,CAAC,CAAC;EACzE,MAAMC,IAAI,GACR,GAAGL,IAAI,WAAWC,CAAC,CAACJ,IAAI,yBAAyBH,QAAQ,EAAE,IAC1DO,CAAC,CAACR,QAAQ,GAAG,YAAY,GAAG,EAAE,CAAC,IAC/BQ,CAAC,CAACN,MAAM,GAAG,UAAU,GAAG,EAAE,CAAC;EAC9BI,QAAQ,CAACO,OAAO,CAACC,MAAM,CAAC,YAAY,EAAEF,IAAI,CAAC;EAC3CN,QAAQ,CAACO,OAAO,CAACC,MAAM,CAAC,YAAY,EAAE,GAAGF,IAAI,eAAe,CAAC;AAC/D;AAEA,OAAO,MAAMG,iBAAiB,CAA2B;EAIvDC,WAAWA,CAACC,YAA2B,EAAE;IACvC,IAAI,CAACC,OAAO,GAAGD,YAAY,EAAEC,OAAO;IACpC,IAAI,CAACZ,QAAQ,GAAGW,YAAY,EAAEX,QAAQ;EACxC;EAEA,OAAOa,UAAUA,CAAA,EAAiB;IAChC,MAAMC,WAAW,GACfC,OAAO,CAACC,GAAG,CAACC,+BAA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,CAAC;EAClE;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { NodeHiveClient } from 'nodehive-js';
|
|
2
|
+
import type { NodeHiveAuthConfig } from './config';
|
|
3
|
+
import { type ProxyContext } from './next-cookie-storage';
|
|
4
|
+
export declare function buildUserClient(config: NodeHiveAuthConfig, proxyContext?: ProxyContext): NodeHiveClient;
|
|
5
|
+
export declare function buildAnonClient(config: NodeHiveAuthConfig): NodeHiveClient;
|
|
6
|
+
//# sourceMappingURL=nodehive-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodehive-client.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/nodehive-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AACnD,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAmC7E,wBAAgB,eAAe,CAC7B,MAAM,EAAE,kBAAkB,EAC1B,YAAY,CAAC,EAAE,YAAY,GAC1B,cAAc,CA0BhB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,kBAAkB,GAAG,cAAc,CAe1E"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { NodeHiveClient } from 'nodehive-js';
|
|
2
|
+
import { NextCookieStorage } from './next-cookie-storage';
|
|
3
|
+
import { getClientId, getClientSecret, getTokenUrl, REFRESH_TOKEN_MAX_AGE } from './oauth-config';
|
|
4
|
+
|
|
5
|
+
// Resolve the SDK base options once per config object. Env is read lazily (on
|
|
6
|
+
// first use per runtime instance, not at module load) and then memoized: the
|
|
7
|
+
// proxy refresh path builds a client on nearly every request, so we avoid
|
|
8
|
+
// re-reading env + re-allocating the options object each time.
|
|
9
|
+
const baseOptionsCache = new WeakMap();
|
|
10
|
+
function baseOptions(config) {
|
|
11
|
+
const cached = baseOptionsCache.get(config);
|
|
12
|
+
if (cached) return cached;
|
|
13
|
+
const options = {
|
|
14
|
+
baseUrl: process.env.NEXT_PUBLIC_DRUPAL_REST_BASE_URL || '',
|
|
15
|
+
debug: process.env.NODEHIVE_DEBUG === 'true',
|
|
16
|
+
config: config.jsonapiConfig,
|
|
17
|
+
multilingual: config.multilingual
|
|
18
|
+
};
|
|
19
|
+
baseOptionsCache.set(config, options);
|
|
20
|
+
return options;
|
|
21
|
+
}
|
|
22
|
+
export function buildUserClient(config, proxyContext) {
|
|
23
|
+
const storage = new NextCookieStorage(proxyContext);
|
|
24
|
+
const userOauthConfig = {
|
|
25
|
+
grantType: 'authorization_code',
|
|
26
|
+
clientId: getClientId(),
|
|
27
|
+
clientSecret: getClientSecret(),
|
|
28
|
+
tokenUrl: getTokenUrl()
|
|
29
|
+
};
|
|
30
|
+
const base = baseOptions(config);
|
|
31
|
+
const userClient = new NodeHiveClient({
|
|
32
|
+
...base,
|
|
33
|
+
auth: {
|
|
34
|
+
method: 'oauth',
|
|
35
|
+
oauth: userOauthConfig,
|
|
36
|
+
storage: {
|
|
37
|
+
type: 'custom',
|
|
38
|
+
adapter: storage
|
|
39
|
+
},
|
|
40
|
+
session: {
|
|
41
|
+
refreshTokenMaxAge: REFRESH_TOKEN_MAX_AGE
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
if (base.debug) console.log('Created user client');
|
|
46
|
+
return userClient;
|
|
47
|
+
}
|
|
48
|
+
export function buildAnonClient(config) {
|
|
49
|
+
const base = baseOptions(config);
|
|
50
|
+
const anonClient = new NodeHiveClient({
|
|
51
|
+
...base,
|
|
52
|
+
auth: {
|
|
53
|
+
method: 'oauth',
|
|
54
|
+
oauth: {
|
|
55
|
+
grantType: 'client_credentials',
|
|
56
|
+
clientId: process.env.NODEHIVE_OAUTH_ANON_CLIENT_ID || '',
|
|
57
|
+
clientSecret: process.env.NODEHIVE_OAUTH_ANON_CLIENT_SECRET || ''
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
if (base.debug) console.log('Created anon client');
|
|
62
|
+
return anonClient;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=nodehive-client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodehive-client.js","names":["NodeHiveClient","NextCookieStorage","getClientId","getClientSecret","getTokenUrl","REFRESH_TOKEN_MAX_AGE","baseOptionsCache","WeakMap","baseOptions","config","cached","get","options","baseUrl","process","env","NEXT_PUBLIC_DRUPAL_REST_BASE_URL","debug","NODEHIVE_DEBUG","jsonapiConfig","multilingual","set","buildUserClient","proxyContext","storage","userOauthConfig","grantType","clientId","clientSecret","tokenUrl","base","userClient","auth","method","oauth","type","adapter","session","refreshTokenMaxAge","console","log","buildAnonClient","anonClient","NODEHIVE_OAUTH_ANON_CLIENT_ID","NODEHIVE_OAUTH_ANON_CLIENT_SECRET"],"sources":["../../../src/auth/internal/nodehive-client.ts"],"sourcesContent":["import { NodeHiveClient } from 'nodehive-js';\n\nimport type { NodeHiveAuthConfig } from './config';\nimport { NextCookieStorage, type ProxyContext } from './next-cookie-storage';\nimport {\n getClientId,\n getClientSecret,\n getTokenUrl,\n REFRESH_TOKEN_MAX_AGE,\n} from './oauth-config';\n\n// Resolve the SDK base options once per config object. Env is read lazily (on\n// first use per runtime instance, not at module load) and then memoized: the\n// proxy refresh path builds a client on nearly every request, so we avoid\n// re-reading env + re-allocating the options object each time.\nconst baseOptionsCache = new WeakMap<\n NodeHiveAuthConfig,\n {\n baseUrl: string;\n debug: boolean;\n config: NodeHiveAuthConfig['jsonapiConfig'];\n multilingual: boolean;\n }\n>();\n\nfunction baseOptions(config: NodeHiveAuthConfig) {\n const cached = baseOptionsCache.get(config);\n if (cached) return cached;\n const options = {\n baseUrl: process.env.NEXT_PUBLIC_DRUPAL_REST_BASE_URL || '',\n debug: process.env.NODEHIVE_DEBUG === 'true',\n config: config.jsonapiConfig,\n multilingual: config.multilingual,\n };\n baseOptionsCache.set(config, options);\n return options;\n}\n\nexport function buildUserClient(\n config: NodeHiveAuthConfig,\n proxyContext?: ProxyContext\n): NodeHiveClient {\n const storage = new NextCookieStorage(proxyContext);\n const userOauthConfig = {\n grantType: 'authorization_code' as const,\n clientId: getClientId(),\n clientSecret: getClientSecret(),\n tokenUrl: getTokenUrl(),\n };\n\n const base = baseOptions(config);\n const userClient = new NodeHiveClient({\n ...base,\n auth: {\n method: 'oauth',\n oauth: userOauthConfig,\n storage: {\n type: 'custom',\n adapter: storage,\n },\n session: {\n refreshTokenMaxAge: REFRESH_TOKEN_MAX_AGE,\n },\n },\n });\n if (base.debug) console.log('Created user client');\n return userClient;\n}\n\nexport function buildAnonClient(config: NodeHiveAuthConfig): NodeHiveClient {\n const base = baseOptions(config);\n const anonClient = new NodeHiveClient({\n ...base,\n auth: {\n method: 'oauth',\n oauth: {\n grantType: 'client_credentials',\n clientId: process.env.NODEHIVE_OAUTH_ANON_CLIENT_ID || '',\n clientSecret: process.env.NODEHIVE_OAUTH_ANON_CLIENT_SECRET || '',\n },\n },\n });\n if (base.debug) console.log('Created anon client');\n return anonClient;\n}\n"],"mappings":"AAAA,SAASA,cAAc,QAAQ,aAAa;AAG5C,SAASC,iBAAiB,QAA2B,uBAAuB;AAC5E,SACEC,WAAW,EACXC,eAAe,EACfC,WAAW,EACXC,qBAAqB,QAChB,gBAAgB;;AAEvB;AACA;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,IAAIC,OAAO,CAQlC,CAAC;AAEH,SAASC,WAAWA,CAACC,MAA0B,EAAE;EAC/C,MAAMC,MAAM,GAAGJ,gBAAgB,CAACK,GAAG,CAACF,MAAM,CAAC;EAC3C,IAAIC,MAAM,EAAE,OAAOA,MAAM;EACzB,MAAME,OAAO,GAAG;IACdC,OAAO,EAAEC,OAAO,CAACC,GAAG,CAACC,gCAAgC,IAAI,EAAE;IAC3DC,KAAK,EAAEH,OAAO,CAACC,GAAG,CAACG,cAAc,KAAK,M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I,EAAE;QACzDf,YAAY,EAAEd,OAAO,CAACC,GAAG,CAAC6B,iCAAiC,IAAI;MACjE;IACF;EACF,CAAC,CAAC;EACF,IAAId,IAAI,CAACb,KAAK,EAAEsB,OAAO,CAACC,GAAG,CAAC,qBAAqB,CAAC;EAClD,OAAOE,UAAU;AACnB","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { NextRequest } from 'next/server';
|
|
2
|
+
/**
|
|
3
|
+
* Central resolver for the OAuth 2.0 Authorization Code flow configuration.
|
|
4
|
+
*
|
|
5
|
+
* In NodeHive the OAuth Identity Provider (Drupal Simple OAuth) IS the same
|
|
6
|
+
* backend as the REST/JSON:API base, so all endpoints are derived from
|
|
7
|
+
* NEXT_PUBLIC_DRUPAL_BASE_URL. Switching backend (prod <-> DDEV) only requires
|
|
8
|
+
* changing that one base URL — no separate OAuth endpoint config.
|
|
9
|
+
*
|
|
10
|
+
* The redirect_uri is intentionally NOT a static env var either: it is derived
|
|
11
|
+
* per-request from the Host header so a single deployment serves multiple
|
|
12
|
+
* frontend domains (the Drupal client must whitelist each /api/auth/callback).
|
|
13
|
+
*/
|
|
14
|
+
export declare const REFRESH_TOKEN_MAX_AGE = 2592000;
|
|
15
|
+
export declare function getAuthorizeUrl(): string;
|
|
16
|
+
export declare function getTokenUrl(): string;
|
|
17
|
+
export declare function getRevokeUrl(): string;
|
|
18
|
+
export declare function getClientId(): string;
|
|
19
|
+
export declare function getClientSecret(): string;
|
|
20
|
+
/**
|
|
21
|
+
* Resolve the public-facing origin of the incoming request, honoring the
|
|
22
|
+
* X-Forwarded-Proto/Host headers set by the reverse proxy in front of the
|
|
23
|
+
* production deployment.
|
|
24
|
+
*
|
|
25
|
+
* Behind Traefik the raw Host header — and therefore `request.url` /
|
|
26
|
+
* `request.nextUrl` — is the container's internal bind address (e.g.
|
|
27
|
+
* `0.0.0.0:3000`). Any browser-facing absolute redirect MUST be built from this
|
|
28
|
+
* origin, never from `request.url`, or the user gets bounced to 0.0.0.0:3000.
|
|
29
|
+
*/
|
|
30
|
+
export declare function getRequestOrigin(request: NextRequest): string;
|
|
31
|
+
/**
|
|
32
|
+
* Derive the OAuth redirect_uri from the incoming request so the same code
|
|
33
|
+
* works across multiple frontend domains. Honors X-Forwarded-Proto/Host set
|
|
34
|
+
* by the reverse proxy in front of the production deployment.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getRedirectUri(request: NextRequest): string;
|
|
37
|
+
//# sourceMappingURL=oauth-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-config.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/oauth-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE/C;;;;;;;;;;;GAWG;AAIH,eAAO,MAAM,qBAAqB,UAAU,CAAC;AAW7C,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,eAAe,IAAI,MAAM,CAExC;AAED;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAU7D;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,WAAW,GAAG,MAAM,CAE3D"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central resolver for the OAuth 2.0 Authorization Code flow configuration.
|
|
3
|
+
*
|
|
4
|
+
* In NodeHive the OAuth Identity Provider (Drupal Simple OAuth) IS the same
|
|
5
|
+
* backend as the REST/JSON:API base, so all endpoints are derived from
|
|
6
|
+
* NEXT_PUBLIC_DRUPAL_BASE_URL. Switching backend (prod <-> DDEV) only requires
|
|
7
|
+
* changing that one base URL — no separate OAuth endpoint config.
|
|
8
|
+
*
|
|
9
|
+
* The redirect_uri is intentionally NOT a static env var either: it is derived
|
|
10
|
+
* per-request from the Host header so a single deployment serves multiple
|
|
11
|
+
* frontend domains (the Drupal client must whitelist each /api/auth/callback).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
// Refresh-token lifetime, shared by the SDK session config and the CHIPS
|
|
15
|
+
// cookie exchange so the two never drift.
|
|
16
|
+
export const REFRESH_TOKEN_MAX_AGE = 2592000; // 30 days
|
|
17
|
+
|
|
18
|
+
function trimTrailingSlash(value) {
|
|
19
|
+
return value.replace(/\/+$/, '');
|
|
20
|
+
}
|
|
21
|
+
function idpBaseUrl() {
|
|
22
|
+
const base = process.env.NEXT_PUBLIC_DRUPAL_BASE_URL || '';
|
|
23
|
+
return trimTrailingSlash(base);
|
|
24
|
+
}
|
|
25
|
+
export function getAuthorizeUrl() {
|
|
26
|
+
return `${idpBaseUrl()}/oauth/authorize`;
|
|
27
|
+
}
|
|
28
|
+
export function getTokenUrl() {
|
|
29
|
+
return `${idpBaseUrl()}/oauth/token`;
|
|
30
|
+
}
|
|
31
|
+
export function getRevokeUrl() {
|
|
32
|
+
return `${idpBaseUrl()}/oauth/revoke`;
|
|
33
|
+
}
|
|
34
|
+
export function getClientId() {
|
|
35
|
+
return process.env.NODEHIVE_OAUTH_USER_CLIENT_ID || '';
|
|
36
|
+
}
|
|
37
|
+
export function getClientSecret() {
|
|
38
|
+
return process.env.NODEHIVE_OAUTH_USER_CLIENT_SECRET || '';
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Resolve the public-facing origin of the incoming request, honoring the
|
|
43
|
+
* X-Forwarded-Proto/Host headers set by the reverse proxy in front of the
|
|
44
|
+
* production deployment.
|
|
45
|
+
*
|
|
46
|
+
* Behind Traefik the raw Host header — and therefore `request.url` /
|
|
47
|
+
* `request.nextUrl` — is the container's internal bind address (e.g.
|
|
48
|
+
* `0.0.0.0:3000`). Any browser-facing absolute redirect MUST be built from this
|
|
49
|
+
* origin, never from `request.url`, or the user gets bounced to 0.0.0.0:3000.
|
|
50
|
+
*/
|
|
51
|
+
export function getRequestOrigin(request) {
|
|
52
|
+
// Chained proxies may send these as a comma-separated list; the first entry
|
|
53
|
+
// is the original client-facing value.
|
|
54
|
+
const first = value => value?.split(',')[0]?.trim() || '';
|
|
55
|
+
const forwardedHost = first(request.headers.get('x-forwarded-host'));
|
|
56
|
+
const forwardedProto = first(request.headers.get('x-forwarded-proto'));
|
|
57
|
+
const host = forwardedHost || request.headers.get('host') || '';
|
|
58
|
+
const protocol = forwardedProto || request.nextUrl.protocol.replace(':', '') || 'https';
|
|
59
|
+
return `${protocol}://${host}`;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Derive the OAuth redirect_uri from the incoming request so the same code
|
|
64
|
+
* works across multiple frontend domains. Honors X-Forwarded-Proto/Host set
|
|
65
|
+
* by the reverse proxy in front of the production deployment.
|
|
66
|
+
*/
|
|
67
|
+
export function getRedirectUri(request) {
|
|
68
|
+
return `${getRequestOrigin(request)}/api/auth/callback`;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=oauth-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"oauth-config.js","names":["REFRESH_TOKEN_MAX_AGE","trimTrailingSlash","value","replace","idpBaseUrl","base","process","env","NEXT_PUBLIC_DRUPAL_BASE_URL","getAuthorizeUrl","getTokenUrl","getRevokeUrl","getClientId","NODEHIVE_OAUTH_USER_CLIENT_ID","getClientSecret","NODEHIVE_OAUTH_USER_CLIENT_SECRET","getRequestOrigin","request","first","split","trim","forwardedHost","headers","get","forwardedProto","host","protocol","nextUrl","getRedirectUri"],"sources":["../../../src/auth/internal/oauth-config.ts"],"sourcesContent":["import type { NextRequest } from 'next/server';\n\n/**\n * Central resolver for the OAuth 2.0 Authorization Code flow configuration.\n *\n * In NodeHive the OAuth Identity Provider (Drupal Simple OAuth) IS the same\n * backend as the REST/JSON:API base, so all endpoints are derived from\n * NEXT_PUBLIC_DRUPAL_BASE_URL. Switching backend (prod <-> DDEV) only requires\n * changing that one base URL — no separate OAuth endpoint config.\n *\n * The redirect_uri is intentionally NOT a static env var either: it is derived\n * per-request from the Host header so a single deployment serves multiple\n * frontend domains (the Drupal client must whitelist each /api/auth/callback).\n */\n\n// Refresh-token lifetime, shared by the SDK session config and the CHIPS\n// cookie exchange so the two never drift.\nexport const REFRESH_TOKEN_MAX_AGE = 2592000; // 30 days\n\nfunction trimTrailingSlash(value: string): string {\n return value.replace(/\\/+$/, '');\n}\n\nfunction idpBaseUrl(): string {\n const base = process.env.NEXT_PUBLIC_DRUPAL_BASE_URL || '';\n return trimTrailingSlash(base);\n}\n\nexport function getAuthorizeUrl(): string {\n return `${idpBaseUrl()}/oauth/authorize`;\n}\n\nexport function getTokenUrl(): string {\n return `${idpBaseUrl()}/oauth/token`;\n}\n\nexport function getRevokeUrl(): string {\n return `${idpBaseUrl()}/oauth/revoke`;\n}\n\nexport function getClientId(): string {\n return process.env.NODEHIVE_OAUTH_USER_CLIENT_ID || '';\n}\n\nexport function getClientSecret(): string {\n return process.env.NODEHIVE_OAUTH_USER_CLIENT_SECRET || '';\n}\n\n/**\n * Resolve the public-facing origin of the incoming request, honoring the\n * X-Forwarded-Proto/Host headers set by the reverse proxy in front of the\n * production deployment.\n *\n * Behind Traefik the raw Host header — and therefore `request.url` /\n * `request.nextUrl` — is the container's internal bind address (e.g.\n * `0.0.0.0:3000`). Any browser-facing absolute redirect MUST be built from this\n * origin, never from `request.url`, or the user gets bounced to 0.0.0.0:3000.\n */\nexport function getRequestOrigin(request: NextRequest): string {\n // Chained proxies may send these as a comma-separated list; the first entry\n // is the original client-facing value.\n const first = (value: string | null) => value?.split(',')[0]?.trim() || '';\n const forwardedHost = first(request.headers.get('x-forwarded-host'));\n const forwardedProto = first(request.headers.get('x-forwarded-proto'));\n const host = forwardedHost || request.headers.get('host') || '';\n const protocol =\n forwardedProto || request.nextUrl.protocol.replace(':', '') || 'https';\n return `${protocol}://${host}`;\n}\n\n/**\n * Derive the OAuth redirect_uri from the incoming request so the same code\n * works across multiple frontend domains. Honors X-Forwarded-Proto/Host set\n * by the reverse proxy in front of the production deployment.\n */\nexport function getRedirectUri(request: NextRequest): string {\n return `${getRequestOrigin(request)}/api/auth/callback`;\n}\n"],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO,MAAMA,qBAAqB,GAAG,OAAO,CAAC,CAAC;;AAE9C,SAASC,iBAAiBA,CAACC,KAAa,EAAU;EAChD,OAAOA,KAAK,CAACC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;AAClC;AAEA,SAASC,UAAUA,CAAA,EAAW;EAC5B,MAAMC,IAAI,GAAGC,OAAO,CAACC,GAAG,CAACC,2BAA2B,IAAI,EAAE;EAC1D,OAAOP,iBAAiB,CAACI,IAAI,CAAC;AAChC;AAEA,OAAO,SAASI,eAAeA,CAAA,EAAW;EACxC,OAAO,GAAGL,UAAU,CAAC,CAAC,kBAAkB;AAC1C;AAEA,OAAO,SAASM,WAAWA,CAAA,EAAW;EACpC,OAAO,GAAGN,UAAU,CAAC,CAAC,cAAc;AACtC;AAEA,OAAO,SAASO,YAAYA,CAAA,EAAW;EACrC,OAAO,GAAGP,UAAU,CAAC,CAAC,eAAe;AACvC;AAEA,OAAO,SAASQ,WAAWA,CAAA,EAAW;EACpC,OAAON,OAAO,CAACC,GAAG,CAACM,6BAA6B,IAAI,EAAE;AACxD;AAEA,OAAO,SAASC,eAAeA,CAAA,EAAW;EACxC,OAAOR,OAAO,CAACC,GAAG,CAACQ,iCAAiC,IAAI,EAAE;AAC5D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,OAAoB,EAAU;EAC7D;EACA;EACA,MAAMC,KAAK,GAAIhB,KAAoB,IAAKA,KAAK,EAAEiB,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAEC,IAAI,CAAC,CAAC,IAAI,EAAE;EAC1E,MAAMC,aAAa,GAAGH,KAAK,CAACD,OAAO,CAACK,OAAO,CAACC,GAAG,CAAC,kBAAkB,CAAC,CAAC;EACpE,MAAMC,cAAc,GAAGN,KAAK,CAACD,OAAO,CAACK,OAAO,CAACC,GAAG,CAAC,mBAAmB,CAAC,CAAC;EACtE,MAAME,IAAI,GAAGJ,aAAa,IAAIJ,OAAO,CAACK,OAAO,CAACC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE;EAC/D,MAAMG,QAAQ,GACZF,cAAc,IAAIP,OAAO,CAACU,OAAO,CAACD,QAAQ,CAACvB,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,OAAO;EACxE,OAAO,GAAGuB,QAAQ,MAAMD,IAAI,EAAE;AAChC;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASG,cAAcA,CAACX,OAAoB,EAAU;EAC3D,OAAO,GAAGD,gBAAgB,CAACC,OAAO,CAAC,oBAAoB;AACzD","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NextResponse, type NextRequest } from 'next/server';
|
|
2
|
+
/**
|
|
3
|
+
* CSRF defense for the SameSite=None auth cookies: a cross-site page can send the
|
|
4
|
+
* editor's cookies on a mutating /api request, so require Sec-Fetch-Site:
|
|
5
|
+
* same-origin (a cross-site browser cannot forge it). Returns a 403 to return
|
|
6
|
+
* from the middleware, or null to continue.
|
|
7
|
+
*/
|
|
8
|
+
export declare function csrfGuard(request: NextRequest, isApi: boolean): NextResponse | null;
|
|
9
|
+
/**
|
|
10
|
+
* Response for an invalid/expired session (clears cookies): a 401 for /api
|
|
11
|
+
* callers — a fetch needs a status, not an HTML redirect — otherwise a redirect
|
|
12
|
+
* to the login entry point, preserving where the user was.
|
|
13
|
+
*/
|
|
14
|
+
export declare function authFailedResponse(request: NextRequest, isApi: boolean, loginPath?: string): NextResponse;
|
|
15
|
+
//# sourceMappingURL=proxy-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-helpers.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/proxy-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,WAAW,EAAE,MAAM,aAAa,CAAC;AAS7D;;;;;GAKG;AACH,wBAAgB,SAAS,CACvB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,OAAO,GACb,YAAY,GAAG,IAAI,CASrB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,OAAO,EACd,SAAS,SAAoB,GAC5B,YAAY,CAed"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { getRequestOrigin } from './oauth-config';
|
|
3
|
+
import { clearAuthCookies } from './refresh';
|
|
4
|
+
import { validateReturnTo } from './return-to';
|
|
5
|
+
import { isSameOriginRequest } from './same-origin';
|
|
6
|
+
const MUTATING_METHODS = new Set(['POST', 'PUT', 'PATCH', 'DELETE']);
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* CSRF defense for the SameSite=None auth cookies: a cross-site page can send the
|
|
10
|
+
* editor's cookies on a mutating /api request, so require Sec-Fetch-Site:
|
|
11
|
+
* same-origin (a cross-site browser cannot forge it). Returns a 403 to return
|
|
12
|
+
* from the middleware, or null to continue.
|
|
13
|
+
*/
|
|
14
|
+
export function csrfGuard(request, isApi) {
|
|
15
|
+
if (isApi && MUTATING_METHODS.has(request.method) && !isSameOriginRequest(request)) {
|
|
16
|
+
return new NextResponse('Forbidden', {
|
|
17
|
+
status: 403
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Response for an invalid/expired session (clears cookies): a 401 for /api
|
|
25
|
+
* callers — a fetch needs a status, not an HTML redirect — otherwise a redirect
|
|
26
|
+
* to the login entry point, preserving where the user was.
|
|
27
|
+
*/
|
|
28
|
+
export function authFailedResponse(request, isApi, loginPath = '/api/auth/login') {
|
|
29
|
+
if (isApi) {
|
|
30
|
+
const res = new NextResponse('Unauthorized', {
|
|
31
|
+
status: 401
|
|
32
|
+
});
|
|
33
|
+
clearAuthCookies(request, res);
|
|
34
|
+
return res;
|
|
35
|
+
}
|
|
36
|
+
const returnTo = validateReturnTo(`${request.nextUrl.pathname}${request.nextUrl.search}`);
|
|
37
|
+
const loginUrl = new URL(loginPath, getRequestOrigin(request));
|
|
38
|
+
loginUrl.searchParams.set('returnTo', returnTo);
|
|
39
|
+
const res = NextResponse.redirect(loginUrl);
|
|
40
|
+
clearAuthCookies(request, res);
|
|
41
|
+
return res;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=proxy-helpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proxy-helpers.js","names":["NextResponse","getRequestOrigin","clearAuthCookies","validateReturnTo","isSameOriginRequest","MUTATING_METHODS","Set","csrfGuard","request","isApi","has","method","status","authFailedResponse","loginPath","res","returnTo","nextUrl","pathname","search","loginUrl","URL","searchParams","set","redirect"],"sources":["../../../src/auth/internal/proxy-helpers.ts"],"sourcesContent":["import { NextResponse, type NextRequest } from 'next/server';\n\nimport { getRequestOrigin } from './oauth-config';\nimport { clearAuthCookies } from './refresh';\nimport { validateReturnTo } from './return-to';\nimport { isSameOriginRequest } from './same-origin';\n\nconst MUTATING_METHODS = new Set(['POST', 'PUT', 'PATCH', 'DELETE']);\n\n/**\n * CSRF defense for the SameSite=None auth cookies: a cross-site page can send the\n * editor's cookies on a mutating /api request, so require Sec-Fetch-Site:\n * same-origin (a cross-site browser cannot forge it). Returns a 403 to return\n * from the middleware, or null to continue.\n */\nexport function csrfGuard(\n request: NextRequest,\n isApi: boolean\n): NextResponse | null {\n if (\n isApi &&\n MUTATING_METHODS.has(request.method) &&\n !isSameOriginRequest(request)\n ) {\n return new NextResponse('Forbidden', { status: 403 });\n }\n return null;\n}\n\n/**\n * Response for an invalid/expired session (clears cookies): a 401 for /api\n * callers — a fetch needs a status, not an HTML redirect — otherwise a redirect\n * to the login entry point, preserving where the user was.\n */\nexport function authFailedResponse(\n request: NextRequest,\n isApi: boolean,\n loginPath = '/api/auth/login'\n): NextResponse {\n if (isApi) {\n const res = new NextResponse('Unauthorized', { status: 401 });\n clearAuthCookies(request, res);\n return res;\n }\n\n const returnTo = validateReturnTo(\n `${request.nextUrl.pathname}${request.nextUrl.search}`\n );\n const loginUrl = new URL(loginPath, getRequestOrigin(request));\n loginUrl.searchParams.set('returnTo', returnTo);\n const res = NextResponse.redirect(loginUrl);\n clearAuthCookies(request, res);\n return res;\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAA0B,aAAa;AAE5D,SAASC,gBAAgB,QAAQ,gBAAgB;AACjD,SAASC,gBAAgB,QAAQ,WAAW;AAC5C,SAASC,gBAAgB,QAAQ,aAAa;AAC9C,SAASC,mBAAmB,QAAQ,eAAe;AAEnD,MAAMC,gBAAgB,GAAG,IAAIC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;;AAEpE;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,SAASA,CACvBC,OAAoB,EACpBC,KAAc,EACO;EACrB,IACEA,KAAK,IACLJ,gBAAgB,CAACK,GAAG,CAACF,OAAO,CAACG,MAAM,CAAC,IACpC,CAACP,mBAAmB,CAACI,OAAO,CAAC,EAC7B;IACA,OAAO,IAAIR,YAAY,CAAC,WAAW,EAAE;MAAEY,MAAM,EAAE;IAAI,CAAC,CAAC;EACvD;EACA,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,kBAAkBA,CAChCL,OAAoB,EACpBC,KAAc,EACdK,SAAS,GAAG,iBAAiB,EACf;EACd,IAAIL,KAAK,EAAE;IACT,MAAMM,GAAG,GAAG,IAAIf,YAAY,CAAC,cAAc,EAAE;MAAEY,MAAM,EAAE;IAAI,CAAC,CAAC;IAC7DV,gBAAgB,CAACM,OAAO,EAAEO,GAAG,CAAC;IAC9B,OAAOA,GAAG;EACZ;EAEA,MAAMC,QAAQ,GAAGb,gBAAgB,CAC/B,GAAGK,OAAO,CAACS,OAAO,CAACC,QAAQ,GAAGV,OAAO,CAACS,OAAO,CAACE,MAAM,EACtD,CAAC;EACD,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAACP,SAAS,EAAEb,gBAAgB,CAACO,OAAO,CAAC,CAAC;EAC9DY,QAAQ,CAACE,YAAY,CAACC,GAAG,CAAC,UAAU,EAAEP,QAAQ,CAAC;EAC/C,MAAMD,GAAG,GAAGf,YAAY,CAACwB,QAAQ,CAACJ,QAAQ,CAAC;EAC3ClB,gBAAgB,CAACM,OAAO,EAAEO,GAAG,CAAC;EAC9B,OAAOA,GAAG;AACZ","ignoreList":[]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
import type { NodeHiveAuthConfig } from './config';
|
|
3
|
+
export declare function setRefreshDeadlineMsForTesting(ms: number): void;
|
|
4
|
+
export declare function shouldRefreshSession(request: NextRequest): boolean;
|
|
5
|
+
/**
|
|
6
|
+
* Mutates request.cookies and sets Set-Cookie on `response`; the caller must
|
|
7
|
+
* have created `response` with `{ request }` so the mutations are forwarded via
|
|
8
|
+
* x-middleware-request-* headers. Throws on failure — caller decides handling.
|
|
9
|
+
*/
|
|
10
|
+
export declare function refreshSession(request: NextRequest, response: NextResponse, config: NodeHiveAuthConfig): Promise<void>;
|
|
11
|
+
export declare function clearAuthCookies(request: NextRequest, response: NextResponse): void;
|
|
12
|
+
export declare function isAuthFailure(error: unknown): boolean;
|
|
13
|
+
//# sourceMappingURL=refresh.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/internal/refresh.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAG7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAmBnD,wBAAgB,8BAA8B,CAAC,EAAE,EAAE,MAAM,QAExD;AAyDD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAelE;AAED;;;;GAIG;AACH,wBAAsB,cAAc,CAClC,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,IAAI,CAAC,CASf;AAED,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAE,YAAY,GACrB,IAAI,CAQN;AAID,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIrD"}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { AuthenticationError } from 'nodehive-js';
|
|
2
|
+
import { DRAFT_MODE_COOKIE } from './draft-mode';
|
|
3
|
+
import { appendClearedAuthCookie, NextCookieStorage } from './next-cookie-storage';
|
|
4
|
+
import { buildUserClient } from './nodehive-client';
|
|
5
|
+
import { REFRESH_TOKEN_MAX_AGE } from './oauth-config';
|
|
6
|
+
const MAX_RETRIES = 3;
|
|
7
|
+
const BACKOFF_MS = 200;
|
|
8
|
+
const ROTATION_GRACE_MS = 30_000;
|
|
9
|
+
// Hard ceiling for a whole refresh (incl. retries). The proxy awaits this on
|
|
10
|
+
// nearly every request, and the SDK's token fetch has no timeout of its own, so
|
|
11
|
+
// without this a slow/hung Drupal would stall every page load. On timeout the
|
|
12
|
+
// error is non-auth → treated as transient → the stale session is kept.
|
|
13
|
+
let refreshDeadlineMs = 5_000;
|
|
14
|
+
export function setRefreshDeadlineMsForTesting(ms) {
|
|
15
|
+
refreshDeadlineMs = ms;
|
|
16
|
+
}
|
|
17
|
+
const wait = ms => new Promise(resolve => setTimeout(resolve, ms));
|
|
18
|
+
function withDeadline(promise, ms) {
|
|
19
|
+
return Promise.race([promise, new Promise((_, reject) => {
|
|
20
|
+
const timer = setTimeout(() => reject(new Error('Token refresh timed out')), ms);
|
|
21
|
+
timer.unref?.();
|
|
22
|
+
})]);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
// Per-user dedup: prevents concurrent requests from racing on token rotation.
|
|
26
|
+
// Note: This Map is per-isolate — on serverless deployments, dedup is best-effort
|
|
27
|
+
// and not guaranteed across concurrent isolates. On long-running servers it works fully.
|
|
28
|
+
const activeRefreshes = new Map();
|
|
29
|
+
|
|
30
|
+
// Grace cache for recently rotated refresh tokens.
|
|
31
|
+
//
|
|
32
|
+
// OAuth refresh tokens are single-use: each successful refresh invalidates the
|
|
33
|
+
// previous one. But the browser can have parallel requests in flight carrying
|
|
34
|
+
// the old refresh-token cookie when the rotation happens. Without this cache,
|
|
35
|
+
// stale requests arriving just AFTER the original refresh completed (so the
|
|
36
|
+
// `activeRefreshes` dedup map is already empty) trigger a second refresh that
|
|
37
|
+
// fails with invalid_grant and logs the user out.
|
|
38
|
+
//
|
|
39
|
+
// Mapping: old refresh_token → fresh LoginResult, valid for ROTATION_GRACE_MS.
|
|
40
|
+
const recentRotations = new Map();
|
|
41
|
+
function rememberRotation(oldToken, result) {
|
|
42
|
+
const expiresAt = Date.now() + ROTATION_GRACE_MS;
|
|
43
|
+
recentRotations.set(oldToken, {
|
|
44
|
+
result,
|
|
45
|
+
expiresAt
|
|
46
|
+
});
|
|
47
|
+
setTimeout(() => recentRotations.delete(oldToken), ROTATION_GRACE_MS).unref?.();
|
|
48
|
+
}
|
|
49
|
+
function getRecentRotation(oldToken) {
|
|
50
|
+
const entry = recentRotations.get(oldToken);
|
|
51
|
+
if (!entry) return null;
|
|
52
|
+
if (entry.expiresAt < Date.now()) {
|
|
53
|
+
recentRotations.delete(oldToken);
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
console.info('[Refresh] grace cache hit — stale refresh-token reused');
|
|
57
|
+
return entry.result;
|
|
58
|
+
}
|
|
59
|
+
export function shouldRefreshSession(request) {
|
|
60
|
+
const keys = NextCookieStorage.cookieKeys();
|
|
61
|
+
const token = request.cookies.get(keys.token)?.value;
|
|
62
|
+
const refreshToken = request.cookies.get(keys.refresh_token)?.value;
|
|
63
|
+
const expiresAt = request.cookies.get(keys.token_expires_at)?.value;
|
|
64
|
+
if (!refreshToken) return false;
|
|
65
|
+
const expiresAtNumber = expiresAt ? Number(expiresAt) : null;
|
|
66
|
+
const tokenExpiresSoon = typeof expiresAtNumber === 'number' && Number.isFinite(expiresAtNumber) && expiresAtNumber <= Date.now() + 60_000;
|
|
67
|
+
return !token || tokenExpiresSoon;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Mutates request.cookies and sets Set-Cookie on `response`; the caller must
|
|
72
|
+
* have created `response` with `{ request }` so the mutations are forwarded via
|
|
73
|
+
* x-middleware-request-* headers. Throws on failure — caller decides handling.
|
|
74
|
+
*/
|
|
75
|
+
export async function refreshSession(request, response, config) {
|
|
76
|
+
const keys = NextCookieStorage.cookieKeys();
|
|
77
|
+
const refreshToken = request.cookies.get(keys.refresh_token)?.value;
|
|
78
|
+
if (!refreshToken) {
|
|
79
|
+
throw new AuthenticationError('No refresh token available');
|
|
80
|
+
}
|
|
81
|
+
await refreshOnce(refreshToken, {
|
|
82
|
+
request,
|
|
83
|
+
response
|
|
84
|
+
}, config);
|
|
85
|
+
}
|
|
86
|
+
export function clearAuthCookies(request, response) {
|
|
87
|
+
const keys = NextCookieStorage.cookieKeys();
|
|
88
|
+
// Draft cookie included: a dead session must not strand the visitor in
|
|
89
|
+
// token-less draft mode. Raw headers — middleware cannot call draftMode().
|
|
90
|
+
for (const name of [...Object.values(keys), DRAFT_MODE_COOKIE]) {
|
|
91
|
+
request.cookies.delete(name);
|
|
92
|
+
appendClearedAuthCookie(response, name);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Auth failure (invalid/expired refresh token) vs transient (network, timeout,
|
|
97
|
+
// 5xx): transient errors keep the session, auth failures clear it.
|
|
98
|
+
export function isAuthFailure(error) {
|
|
99
|
+
if (!(error instanceof AuthenticationError)) return false;
|
|
100
|
+
const status = error.details?.status;
|
|
101
|
+
return status === 400 || status === 401 || status === 403;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// When the refresh is served from the grace cache or an in-flight dedup, the SDK
|
|
105
|
+
// never ran for THIS request, so its cookies were never written. Mirror the
|
|
106
|
+
// tokens onto the current request/response so this navigation renders logged-in
|
|
107
|
+
// and the browser receives the fresh cookies.
|
|
108
|
+
async function applyLoginResult(context, result) {
|
|
109
|
+
const storage = new NextCookieStorage(context);
|
|
110
|
+
const maxAge = result.expires_in ?? undefined;
|
|
111
|
+
const tokenOptions = maxAge ? {
|
|
112
|
+
maxAge
|
|
113
|
+
} : undefined;
|
|
114
|
+
await storage.set('token', result.token, tokenOptions);
|
|
115
|
+
if (result.refresh_token) {
|
|
116
|
+
await storage.set('refresh_token', result.refresh_token, {
|
|
117
|
+
maxAge: REFRESH_TOKEN_MAX_AGE
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
if (maxAge) {
|
|
121
|
+
await storage.set('token_expires_at', String(Date.now() + maxAge * 1000), tokenOptions);
|
|
122
|
+
}
|
|
123
|
+
if (result.user) {
|
|
124
|
+
await storage.set('user_details', typeof result.user === 'string' ? result.user : JSON.stringify(result.user), tokenOptions);
|
|
125
|
+
}
|
|
126
|
+
return result;
|
|
127
|
+
}
|
|
128
|
+
function refreshOnce(refreshToken, context, config) {
|
|
129
|
+
const recent = getRecentRotation(refreshToken);
|
|
130
|
+
if (recent) return applyLoginResult(context, recent);
|
|
131
|
+
const existing = activeRefreshes.get(refreshToken);
|
|
132
|
+
if (existing) {
|
|
133
|
+
return withDeadline(existing.then(result => applyLoginResult(context, result)), refreshDeadlineMs);
|
|
134
|
+
}
|
|
135
|
+
const client = buildUserClient(config, context);
|
|
136
|
+
|
|
137
|
+
// rememberRotation and the dedup cleanup hang off the underlying refresh, NOT
|
|
138
|
+
// the deadline-raced promise: if Drupal answers after the deadline the
|
|
139
|
+
// refresh token is already consumed, so it must still be grace-cached or the
|
|
140
|
+
// next request gets invalid_grant.
|
|
141
|
+
const underlying = refreshWithRetries(client).then(result => {
|
|
142
|
+
rememberRotation(refreshToken, result);
|
|
143
|
+
return result;
|
|
144
|
+
}).finally(() => {
|
|
145
|
+
activeRefreshes.delete(refreshToken);
|
|
146
|
+
});
|
|
147
|
+
activeRefreshes.set(refreshToken, underlying);
|
|
148
|
+
return withDeadline(underlying, refreshDeadlineMs);
|
|
149
|
+
}
|
|
150
|
+
async function refreshWithRetries(client) {
|
|
151
|
+
let lastError;
|
|
152
|
+
for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {
|
|
153
|
+
try {
|
|
154
|
+
return await client.auth.refreshToken();
|
|
155
|
+
} catch (error) {
|
|
156
|
+
lastError = error;
|
|
157
|
+
|
|
158
|
+
// Don't retry auth failures (invalid/expired refresh token)
|
|
159
|
+
if (isAuthFailure(error)) {
|
|
160
|
+
throw error;
|
|
161
|
+
}
|
|
162
|
+
if (attempt < MAX_RETRIES) {
|
|
163
|
+
console.warn(`[Refresh] Attempt ${attempt} failed, retrying...`, error);
|
|
164
|
+
await wait(BACKOFF_MS * 2 ** (attempt - 1));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
throw lastError;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=refresh.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh.js","names":["AuthenticationError","DRAFT_MODE_COOKIE","appendClearedAuthCookie","NextCookieStorage","buildUserClient","REFRESH_TOKEN_MAX_AGE","MAX_RETRIES","BACKOFF_MS","ROTATION_GRACE_MS","refreshDeadlineMs","setRefreshDeadlineMsForTesting","ms","wait","Promise","resolve","setTimeout","withDeadline","promise","race","_","reject","timer","Error","unref","activeRefreshes","Map","recentRotations","rememberRotation","oldToken","result","expiresAt","Date","now","set","delete","getRecentRotation","entry","get","console","info","shouldRefreshSession","request","keys","cookieKeys","token","cookies","value","refreshToken","refresh_token","token_expires_at","expiresAtNumber","Number","tokenExpiresSoon","isFinite","refreshSession","response","config","refreshOnce","clearAuthCookies","name","Object","values","isAuthFailure","error","status","details","applyLoginResult","context","storage","maxAge","expires_in","undefined","tokenOptions","String","user","JSON","stringify","recent","existing","then","client","underlying","refreshWithRetries","finally","lastError","attempt","auth","warn"],"sources":["../../../src/auth/internal/refresh.ts"],"sourcesContent":["import type { NextRequest, NextResponse } from 'next/server';\nimport { AuthenticationError, type LoginResult } from 'nodehive-js';\n\nimport type { NodeHiveAuthConfig } from './config';\nimport { DRAFT_MODE_COOKIE } from './draft-mode';\nimport {\n appendClearedAuthCookie,\n NextCookieStorage,\n type ProxyContext,\n} from './next-cookie-storage';\nimport { buildUserClient } from './nodehive-client';\nimport { REFRESH_TOKEN_MAX_AGE } from './oauth-config';\n\nconst MAX_RETRIES = 3;\nconst BACKOFF_MS = 200;\nconst ROTATION_GRACE_MS = 30_000;\n// Hard ceiling for a whole refresh (incl. retries). The proxy awaits this on\n// nearly every request, and the SDK's token fetch has no timeout of its own, so\n// without this a slow/hung Drupal would stall every page load. On timeout the\n// error is non-auth → treated as transient → the stale session is kept.\nlet refreshDeadlineMs = 5_000;\n\nexport function setRefreshDeadlineMsForTesting(ms: number) {\n refreshDeadlineMs = ms;\n}\n\nconst wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));\n\nfunction withDeadline<T>(promise: Promise<T>, ms: number): Promise<T> {\n return Promise.race([\n promise,\n new Promise<T>((_, reject) => {\n const timer = setTimeout(\n () => reject(new Error('Token refresh timed out')),\n ms\n );\n timer.unref?.();\n }),\n ]);\n}\n\n// Per-user dedup: prevents concurrent requests from racing on token rotation.\n// Note: This Map is per-isolate — on serverless deployments, dedup is best-effort\n// and not guaranteed across concurrent isolates. On long-running servers it works fully.\nconst activeRefreshes = new Map<string, Promise<LoginResult>>();\n\n// Grace cache for recently rotated refresh tokens.\n//\n// OAuth refresh tokens are single-use: each successful refresh invalidates the\n// previous one. But the browser can have parallel requests in flight carrying\n// the old refresh-token cookie when the rotation happens. Without this cache,\n// stale requests arriving just AFTER the original refresh completed (so the\n// `activeRefreshes` dedup map is already empty) trigger a second refresh that\n// fails with invalid_grant and logs the user out.\n//\n// Mapping: old refresh_token → fresh LoginResult, valid for ROTATION_GRACE_MS.\nconst recentRotations = new Map<\n string,\n { result: LoginResult; expiresAt: number }\n>();\n\nfunction rememberRotation(oldToken: string, result: LoginResult) {\n const expiresAt = Date.now() + ROTATION_GRACE_MS;\n recentRotations.set(oldToken, { result, expiresAt });\n setTimeout(\n () => recentRotations.delete(oldToken),\n ROTATION_GRACE_MS\n ).unref?.();\n}\n\nfunction getRecentRotation(oldToken: string): LoginResult | null {\n const entry = recentRotations.get(oldToken);\n if (!entry) return null;\n if (entry.expiresAt < Date.now()) {\n recentRotations.delete(oldToken);\n return null;\n }\n console.info('[Refresh] grace cache hit — stale refresh-token reused');\n return entry.result;\n}\n\nexport function shouldRefreshSession(request: NextRequest): boolean {\n const keys = NextCookieStorage.cookieKeys();\n const token = request.cookies.get(keys.token)?.value;\n const refreshToken = request.cookies.get(keys.refresh_token)?.value;\n const expiresAt = request.cookies.get(keys.token_expires_at)?.value;\n\n if (!refreshToken) return false;\n\n const expiresAtNumber = expiresAt ? Number(expiresAt) : null;\n const tokenExpiresSoon =\n typeof expiresAtNumber === 'number' &&\n Number.isFinite(expiresAtNumber) &&\n expiresAtNumber <= Date.now() + 60_000;\n\n return !token || tokenExpiresSoon;\n}\n\n/**\n * Mutates request.cookies and sets Set-Cookie on `response`; the caller must\n * have created `response` with `{ request }` so the mutations are forwarded via\n * x-middleware-request-* headers. Throws on failure — caller decides handling.\n */\nexport async function refreshSession(\n request: NextRequest,\n response: NextResponse,\n config: NodeHiveAuthConfig\n): Promise<void> {\n const keys = NextCookieStorage.cookieKeys();\n const refreshToken = request.cookies.get(keys.refresh_token)?.value;\n\n if (!refreshToken) {\n throw new AuthenticationError('No refresh token available');\n }\n\n await refreshOnce(refreshToken, { request, response }, config);\n}\n\nexport function clearAuthCookies(\n request: NextRequest,\n response: NextResponse\n): void {\n const keys = NextCookieStorage.cookieKeys();\n // Draft cookie included: a dead session must not strand the visitor in\n // token-less draft mode. Raw headers — middleware cannot call draftMode().\n for (const name of [...Object.values(keys), DRAFT_MODE_COOKIE]) {\n request.cookies.delete(name);\n appendClearedAuthCookie(response, name);\n }\n}\n\n// Auth failure (invalid/expired refresh token) vs transient (network, timeout,\n// 5xx): transient errors keep the session, auth failures clear it.\nexport function isAuthFailure(error: unknown): boolean {\n if (!(error instanceof AuthenticationError)) return false;\n const status = error.details?.status;\n return status === 400 || status === 401 || status === 403;\n}\n\n// When the refresh is served from the grace cache or an in-flight dedup, the SDK\n// never ran for THIS request, so its cookies were never written. Mirror the\n// tokens onto the current request/response so this navigation renders logged-in\n// and the browser receives the fresh cookies.\nasync function applyLoginResult(\n context: ProxyContext,\n result: LoginResult\n): Promise<LoginResult> {\n const storage = new NextCookieStorage(context);\n const maxAge = result.expires_in ?? undefined;\n const tokenOptions = maxAge ? { maxAge } : undefined;\n\n await storage.set('token', result.token, tokenOptions);\n if (result.refresh_token) {\n await storage.set('refresh_token', result.refresh_token, {\n maxAge: REFRESH_TOKEN_MAX_AGE,\n });\n }\n if (maxAge) {\n await storage.set(\n 'token_expires_at',\n String(Date.now() + maxAge * 1000),\n tokenOptions\n );\n }\n if (result.user) {\n await storage.set(\n 'user_details',\n typeof result.user === 'string'\n ? result.user\n : JSON.stringify(result.user),\n tokenOptions\n );\n }\n return result;\n}\n\nfunction refreshOnce(\n refreshToken: string,\n context: ProxyContext,\n config: NodeHiveAuthConfig\n): Promise<LoginResult> {\n const recent = getRecentRotation(refreshToken);\n if (recent) return applyLoginResult(context, recent);\n\n const existing = activeRefreshes.get(refreshToken);\n if (existing) {\n return withDeadline(\n existing.then((result) => applyLoginResult(context, result)),\n refreshDeadlineMs\n );\n }\n\n const client = buildUserClient(config, context);\n\n // rememberRotation and the dedup cleanup hang off the underlying refresh, NOT\n // the deadline-raced promise: if Drupal answers after the deadline the\n // refresh token is already consumed, so it must still be grace-cached or the\n // next request gets invalid_grant.\n const underlying = refreshWithRetries(client)\n .then((result) => {\n rememberRotation(refreshToken, result);\n return result;\n })\n .finally(() => {\n activeRefreshes.delete(refreshToken);\n });\n\n activeRefreshes.set(refreshToken, underlying);\n return withDeadline(underlying, refreshDeadlineMs);\n}\n\nasync function refreshWithRetries(\n client: ReturnType<typeof buildUserClient>\n): Promise<LoginResult> {\n let lastError: unknown;\n\n for (let attempt = 1; attempt <= MAX_RETRIES; attempt++) {\n try {\n return await client.auth.refreshToken();\n } catch (error) {\n lastError = error;\n\n // Don't retry auth failures (invalid/expired refresh token)\n if (isAuthFailure(error)) {\n throw error;\n }\n\n if (attempt < MAX_RETRIES) {\n console.warn(`[Refresh] Attempt ${attempt} failed, retrying...`, error);\n await wait(BACKOFF_MS * 2 ** (attempt - 1));\n }\n }\n }\n\n throw lastError;\n}\n"],"mappings":"AACA,SAASA,mBAAmB,QAA0B,aAAa;AAGnE,SAASC,iBAAiB,QAAQ,cAAc;AAChD,SACEC,uBAAuB,EACvBC,iBAAiB,QAEZ,uBAAuB;AAC9B,SAASC,eAAe,QAAQ,mBAAmB;AACnD,SAASC,qBAAqB,QAAQ,gBAAgB;AAEtD,MAAMC,WAAW,GAAG,CAAC;AACrB,MAAMC,UAAU,GAAG,GAAG;AACtB,MAAMC,iBAAiB,GAAG,MAAM;AAChC;AACA;AACA;AACA;AACA,IAAIC,iBAAiB,GAAG,KAAK;AAE7B,OAAO,SAASC,8BAA8BA,CAACC,EAAU,EAAE;EACzDF,iBAAiB,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