@fc3/mmcadi 0.1.22 → 0.1.24
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/bin/compile +2 -2
- package/dist/.last-compile-time +1 -1
- package/dist/.last-publish-time +1 -1
- package/dist/client.js +1549 -265
- package/dist/src/client/client.js +1 -1
- package/dist/src/client/client.js.map +1 -1
- package/dist/src/client/enum/media-ready-state.d.ts +8 -0
- package/dist/src/client/enum/media-ready-state.js +12 -0
- package/dist/src/client/enum/media-ready-state.js.map +1 -0
- package/dist/src/client/enum/page-type.d.ts +6 -1
- package/dist/src/client/enum/page-type.js +5 -0
- package/dist/src/client/enum/page-type.js.map +1 -1
- package/dist/src/client/factory/page.js +11 -1
- package/dist/src/client/factory/page.js.map +1 -1
- package/dist/src/client/page/add-block-to-playlist.d.ts +5 -0
- package/dist/src/client/page/add-block-to-playlist.js +12 -0
- package/dist/src/client/page/add-block-to-playlist.js.map +1 -0
- package/dist/src/client/page/confirm-delete-block.js +1 -1
- package/dist/src/client/page/confirm-delete-block.js.map +1 -1
- package/dist/src/client/page/confirm-hide-block.d.ts +7 -0
- package/dist/src/client/page/confirm-hide-block.js +28 -0
- package/dist/src/client/page/confirm-hide-block.js.map +1 -0
- package/dist/src/client/page/cursor.d.ts +45 -0
- package/dist/src/client/page/cursor.js +429 -0
- package/dist/src/client/page/cursor.js.map +1 -0
- package/dist/src/client/page/edit-block.js +1 -1
- package/dist/src/client/page/edit-block.js.map +1 -1
- package/dist/src/client/page/history.d.ts +16 -0
- package/dist/src/client/page/history.js +126 -0
- package/dist/src/client/page/history.js.map +1 -0
- package/dist/src/client/page/select-block-destination.d.ts +5 -0
- package/dist/src/client/page/select-block-destination.js +12 -0
- package/dist/src/client/page/select-block-destination.js.map +1 -0
- package/dist/src/client/page/select-block-type.js +1 -1
- package/dist/src/client/page/select-block-type.js.map +1 -1
- package/dist/src/client/page/view-custom.d.ts +5 -29
- package/dist/src/client/page/view-custom.js +31 -282
- package/dist/src/client/page/view-custom.js.map +1 -1
- package/dist/src/client/page/view-playlist.d.ts +5 -0
- package/dist/src/client/page/view-playlist.js +16 -0
- package/dist/src/client/page/view-playlist.js.map +1 -0
- package/dist/src/client/page.d.ts +1 -0
- package/dist/src/client/page.js +8 -1
- package/dist/src/client/page.js.map +1 -1
- package/dist/src/client/shim/logger.d.ts +8 -2
- package/dist/src/client/shim/logger.js +19 -2
- package/dist/src/client/shim/logger.js.map +1 -1
- package/dist/src/client/shim/process.d.ts +4 -0
- package/dist/src/client/shim/process.js +16 -0
- package/dist/src/client/shim/process.js.map +1 -0
- package/dist/src/client/utility/get-block-activation-href.d.ts +2 -0
- package/dist/src/client/utility/get-block-activation-href.js +25 -0
- package/dist/src/client/utility/get-block-activation-href.js.map +1 -0
- package/dist/src/client/utility/get-meta-value.js +1 -1
- package/dist/src/client/utility/get-meta-value.js.map +1 -1
- package/dist/src/common/builder/block/background.js +1 -1
- package/dist/src/common/builder/block/background.js.map +1 -1
- package/dist/src/common/builder/block/folder.js +1 -1
- package/dist/src/common/builder/block/folder.js.map +1 -1
- package/dist/src/common/builder/block/header.d.ts +4 -1
- package/dist/src/common/builder/block/header.js +16 -3
- package/dist/src/common/builder/block/header.js.map +1 -1
- package/dist/src/common/builder/block/link.js +1 -1
- package/dist/src/common/builder/block/link.js.map +1 -1
- package/dist/src/constant/role/creator.js +1 -1
- package/dist/src/constant/role/creator.js.map +1 -1
- package/dist/src/constant/role/public.js +1 -1
- package/dist/src/constant/role/public.js.map +1 -1
- package/dist/src/constant/role/unknown.js +1 -1
- package/dist/src/constant/role/unknown.js.map +1 -1
- package/dist/src/enum/action-type.d.ts +4 -1
- package/dist/src/enum/action-type.js +3 -0
- package/dist/src/enum/action-type.js.map +1 -1
- package/dist/src/enum/block-type.d.ts +1 -0
- package/dist/src/enum/block-type.js +1 -0
- package/dist/src/enum/block-type.js.map +1 -1
- package/dist/src/enum/emoji.d.ts +11 -2
- package/dist/src/enum/emoji.js +10 -1
- package/dist/src/enum/emoji.js.map +1 -1
- package/dist/src/enum/tool-type.d.ts +1 -0
- package/dist/src/enum/tool-type.js +1 -0
- package/dist/src/enum/tool-type.js.map +1 -1
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +3 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/interface/repository.d.ts +10 -2
- package/dist/src/lib/feature/feature.js +2 -2
- package/dist/src/lib/feature/feature.js.map +1 -1
- package/dist/src/lib/filesystem/enum/file-extension.d.ts +1 -0
- package/dist/src/lib/filesystem/enum/file-extension.js +1 -0
- package/dist/src/lib/filesystem/enum/file-extension.js.map +1 -1
- package/dist/src/lib/http/enum/content-type.d.ts +1 -0
- package/dist/src/lib/http/enum/content-type.js +1 -0
- package/dist/src/lib/http/enum/content-type.js.map +1 -1
- package/dist/src/lib/http/enum/header.d.ts +4 -0
- package/dist/src/lib/http/enum/header.js +4 -0
- package/dist/src/lib/http/enum/header.js.map +1 -1
- package/dist/src/lib/http/utility/get-content-type-for-extension.js +2 -0
- package/dist/src/lib/http/utility/get-content-type-for-extension.js.map +1 -1
- package/dist/src/lib/random/elements.js +1 -1
- package/dist/src/lib/random/elements.js.map +1 -1
- package/dist/src/lib/server/http/endpoint/ping.d.ts +2 -3
- package/dist/src/lib/server/http/endpoint.js +2 -2
- package/dist/src/lib/server/http/endpoint.js.map +1 -1
- package/dist/src/operation.d.ts +2 -2
- package/dist/src/operation.js +3 -2
- package/dist/src/operation.js.map +1 -1
- package/dist/src/server/endpoint/abstract-page.d.ts +2 -2
- package/dist/src/server/endpoint/abstract-page.js +23 -5
- package/dist/src/server/endpoint/abstract-page.js.map +1 -1
- package/dist/src/server/endpoint/action/create.d.ts +5 -2
- package/dist/src/server/endpoint/action/create.js +126 -28
- package/dist/src/server/endpoint/action/create.js.map +1 -1
- package/dist/src/server/endpoint/action/get.d.ts +8 -2
- package/dist/src/server/endpoint/action/get.js +100 -7
- package/dist/src/server/endpoint/action/get.js.map +1 -1
- package/dist/src/server/endpoint/base.d.ts +3 -1
- package/dist/src/server/endpoint/base.js +8 -3
- package/dist/src/server/endpoint/base.js.map +1 -1
- package/dist/src/server/endpoint/history.d.ts +13 -0
- package/dist/src/server/endpoint/history.js +61 -0
- package/dist/src/server/endpoint/history.js.map +1 -0
- package/dist/src/server/endpoint/login.d.ts +2 -2
- package/dist/src/server/endpoint/login.js +3 -3
- package/dist/src/server/endpoint/login.js.map +1 -1
- package/dist/src/server/endpoint/logout.d.ts +1 -1
- package/dist/src/server/endpoint/logout.js +8 -3
- package/dist/src/server/endpoint/logout.js.map +1 -1
- package/dist/src/server/endpoint/month.d.ts +2 -2
- package/dist/src/server/endpoint/month.js +2 -2
- package/dist/src/server/endpoint/month.js.map +1 -1
- package/dist/src/server/endpoint/playlist/create.d.ts +14 -0
- package/dist/src/server/endpoint/playlist/create.js +38 -0
- package/dist/src/server/endpoint/playlist/create.js.map +1 -0
- package/dist/src/server/endpoint/playlist/get.d.ts +17 -0
- package/dist/src/server/endpoint/playlist/get.js +106 -0
- package/dist/src/server/endpoint/playlist/get.js.map +1 -0
- package/dist/src/server/endpoint/robots.d.ts +1 -1
- package/dist/src/server/endpoint/robots.js +1 -1
- package/dist/src/server/endpoint/robots.js.map +1 -1
- package/dist/src/server/endpoint/session/create.d.ts +1 -1
- package/dist/src/server/endpoint/session/create.js +2 -2
- package/dist/src/server/endpoint/session/create.js.map +1 -1
- package/dist/src/server/endpoint/settings/get.d.ts +4 -2
- package/dist/src/server/endpoint/settings/get.js +29 -10
- package/dist/src/server/endpoint/settings/get.js.map +1 -1
- package/dist/src/server/endpoint/settings/update.d.ts +1 -1
- package/dist/src/server/endpoint/settings/update.js +1 -1
- package/dist/src/server/endpoint/settings/update.js.map +1 -1
- package/dist/src/server/endpoint/week.d.ts +2 -2
- package/dist/src/server/endpoint/week.js +2 -2
- package/dist/src/server/endpoint/week.js.map +1 -1
- package/dist/src/server/endpoint/year.d.ts +2 -2
- package/dist/src/server/endpoint/year.js +2 -2
- package/dist/src/server/endpoint/year.js.map +1 -1
- package/dist/src/server/factory/{block-result-serializer.d.ts → block-serializer.d.ts} +2 -2
- package/dist/src/server/factory/{block-result-serializer.js → block-serializer.js} +19 -16
- package/dist/src/server/factory/block-serializer.js.map +1 -0
- package/dist/src/server/middleware/base.d.ts +1 -1
- package/dist/src/server/middleware/base.js +1 -1
- package/dist/src/server/middleware/base.js.map +1 -1
- package/dist/src/server/middleware/error-handler.d.ts +1 -1
- package/dist/src/server/middleware/error-handler.js +17 -6
- package/dist/src/server/middleware/error-handler.js.map +1 -1
- package/dist/src/server/middleware/static-file.d.ts +1 -1
- package/dist/src/server/middleware/static-file.js +103 -24
- package/dist/src/server/middleware/static-file.js.map +1 -1
- package/dist/src/server/operation/add-block.d.ts +1 -1
- package/dist/src/server/operation/add-block.js +22 -3
- package/dist/src/server/operation/add-block.js.map +1 -1
- package/dist/src/server/operation/add-entry-to-playlist.d.ts +12 -0
- package/dist/src/server/operation/add-entry-to-playlist.js +65 -0
- package/dist/src/server/operation/add-entry-to-playlist.js.map +1 -0
- package/dist/src/server/operation/create-playlist.d.ts +10 -0
- package/dist/src/server/operation/create-playlist.js +35 -0
- package/dist/src/server/operation/create-playlist.js.map +1 -0
- package/dist/src/server/operation/create-session.d.ts +1 -1
- package/dist/src/server/operation/create-session.js +1 -1
- package/dist/src/server/operation/create-session.js.map +1 -1
- package/dist/src/server/operation/delete-block.d.ts +7 -4
- package/dist/src/server/operation/delete-block.js +48 -10
- package/dist/src/server/operation/delete-block.js.map +1 -1
- package/dist/src/server/operation/demote-block.d.ts +1 -1
- package/dist/src/server/operation/demote-block.js +1 -1
- package/dist/src/server/operation/demote-block.js.map +1 -1
- package/dist/src/server/operation/destroy-session.d.ts +1 -1
- package/dist/src/server/operation/destroy-session.js +13 -1
- package/dist/src/server/operation/destroy-session.js.map +1 -1
- package/dist/src/server/operation/find-account.d.ts +1 -1
- package/dist/src/server/operation/find-account.js +5 -8
- package/dist/src/server/operation/find-account.js.map +1 -1
- package/dist/src/server/operation/find-playlist.d.ts +10 -0
- package/dist/src/server/operation/find-playlist.js +22 -0
- package/dist/src/server/operation/find-playlist.js.map +1 -0
- package/dist/src/server/operation/hide-block.d.ts +14 -0
- package/dist/src/server/operation/hide-block.js +55 -0
- package/dist/src/server/operation/hide-block.js.map +1 -0
- package/dist/src/server/operation/load-account.d.ts +1 -0
- package/dist/src/server/operation/load-account.js +7 -0
- package/dist/src/server/operation/load-account.js.map +1 -1
- package/dist/src/server/operation/load-block.d.ts +1 -1
- package/dist/src/server/operation/load-block.js +1 -1
- package/dist/src/server/operation/load-block.js.map +1 -1
- package/dist/src/server/operation/load-directory-items.d.ts +1 -1
- package/dist/src/server/operation/load-directory-items.js +1 -1
- package/dist/src/server/operation/load-directory-items.js.map +1 -1
- package/dist/src/server/operation/load-page.d.ts +4 -2
- package/dist/src/server/operation/load-page.js +106 -48
- package/dist/src/server/operation/load-page.js.map +1 -1
- package/dist/src/server/operation/load-playlists-for-account.d.ts +11 -0
- package/dist/src/server/operation/load-playlists-for-account.js +22 -0
- package/dist/src/server/operation/load-playlists-for-account.js.map +1 -0
- package/dist/src/server/operation/move-block.d.ts +17 -0
- package/dist/src/server/operation/move-block.js +121 -0
- package/dist/src/server/operation/move-block.js.map +1 -0
- package/dist/src/server/operation/promote-block.d.ts +1 -1
- package/dist/src/server/operation/promote-block.js +1 -1
- package/dist/src/server/operation/promote-block.js.map +1 -1
- package/dist/src/server/operation/save-page.d.ts +1 -1
- package/dist/src/server/operation/save-page.js +1 -1
- package/dist/src/server/operation/save-page.js.map +1 -1
- package/dist/src/server/operation/store-file.d.ts +14 -0
- package/dist/src/server/operation/{store-files.js → store-file.js} +29 -27
- package/dist/src/server/operation/store-file.js.map +1 -0
- package/dist/src/server/operation/update-account-settings.d.ts +1 -1
- package/dist/src/server/operation/update-account-settings.js +2 -2
- package/dist/src/server/operation/update-account-settings.js.map +1 -1
- package/dist/src/server/operation/update-block.d.ts +1 -1
- package/dist/src/server/operation/update-block.js +5 -5
- package/dist/src/server/operation/update-block.js.map +1 -1
- package/dist/src/server/repository/filesystem.d.ts +30 -0
- package/dist/src/server/repository/filesystem.js +179 -0
- package/dist/src/server/repository/filesystem.js.map +1 -0
- package/dist/src/server/repository/memory.d.ts +11 -2
- package/dist/src/server/repository/memory.js +69 -5
- package/dist/src/server/repository/memory.js.map +1 -1
- package/dist/src/server/{result-serializer → serializer}/action.d.ts +8 -1
- package/dist/src/server/{result-serializer → serializer}/action.js +375 -16
- package/dist/src/server/serializer/action.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/base.d.ts +3 -2
- package/dist/src/server/{result-serializer → serializer}/base.js +42 -5
- package/dist/src/server/serializer/base.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/audio.js +14 -10
- package/dist/src/server/serializer/block/audio.js.map +1 -0
- package/dist/src/server/serializer/block/background.js.map +1 -0
- package/dist/src/server/serializer/block/calendar.js.map +1 -0
- package/dist/src/server/serializer/block/directory.js.map +1 -0
- package/dist/src/server/serializer/block/ephemeral.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/folder.js +5 -0
- package/dist/src/server/serializer/block/folder.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/header.js +3 -2
- package/dist/src/server/serializer/block/header.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/image.js +12 -13
- package/dist/src/server/serializer/block/image.js.map +1 -0
- package/dist/src/server/serializer/block/link.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/list.js +1 -1
- package/dist/src/server/serializer/block/list.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/multi-column.js +2 -2
- package/dist/src/server/serializer/block/multi-column.js.map +1 -0
- package/dist/src/server/serializer/block/note.js.map +1 -0
- package/dist/src/server/serializer/block/parameter.js.map +1 -0
- package/dist/src/server/serializer/block/todo.js.map +1 -0
- package/dist/src/server/serializer/block/video.d.ts +6 -0
- package/dist/src/server/serializer/block/video.js +40 -0
- package/dist/src/server/serializer/block/video.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block/whitespace.js +12 -1
- package/dist/src/server/serializer/block/whitespace.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/block.d.ts +2 -2
- package/dist/src/server/{result-serializer → serializer}/block.js +7 -4
- package/dist/src/server/serializer/block.js.map +1 -0
- package/dist/src/server/serializer/common/time-place-options.js.map +1 -0
- package/dist/src/server/serializer/history.d.ts +19 -0
- package/dist/src/server/serializer/history.js +77 -0
- package/dist/src/server/serializer/history.js.map +1 -0
- package/dist/src/server/serializer/login.js.map +1 -0
- package/dist/src/server/serializer/month.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/page.d.ts +2 -1
- package/dist/src/server/{result-serializer → serializer}/page.js +20 -35
- package/dist/src/server/serializer/page.js.map +1 -0
- package/dist/src/server/serializer/playlist.d.ts +27 -0
- package/dist/src/server/serializer/playlist.js +46 -0
- package/dist/src/server/serializer/playlist.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/settings.d.ts +9 -0
- package/dist/src/server/{result-serializer → serializer}/settings.js +45 -2
- package/dist/src/server/serializer/settings.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/week.js +2 -2
- package/dist/src/server/serializer/week.js.map +1 -0
- package/dist/src/server/{result-serializer → serializer}/year.js +2 -2
- package/dist/src/server/serializer/year.js.map +1 -0
- package/dist/src/server/utility/accepts-content-type.d.ts +1 -1
- package/dist/src/server/utility/accepts-content-type.js +1 -1
- package/dist/src/server/utility/accepts-content-type.js.map +1 -1
- package/dist/src/server/utility/accepts-html.d.ts +1 -1
- package/dist/src/server/utility/accepts-html.js +1 -1
- package/dist/src/server/utility/accepts-html.js.map +1 -1
- package/dist/src/server/utility/accepts-json.d.ts +1 -1
- package/dist/src/server/utility/accepts-json.js +1 -1
- package/dist/src/server/utility/accepts-json.js.map +1 -1
- package/dist/src/server/utility/create-date.js +1 -1
- package/dist/src/server/utility/create-date.js.map +1 -1
- package/dist/src/server/utility/day-to-date.js +1 -1
- package/dist/src/server/utility/day-to-date.js.map +1 -1
- package/dist/src/server/utility/get-block-at-index-path.js +1 -1
- package/dist/src/server/utility/get-block-at-index-path.js.map +1 -1
- package/dist/src/server/utility/get-custom-page-type-for-path.js +1 -1
- package/dist/src/server/utility/get-custom-page-type-for-path.js.map +1 -1
- package/dist/src/server/utility/get-emoji-for-block-type.js +6 -2
- package/dist/src/server/utility/get-emoji-for-block-type.js.map +1 -1
- package/dist/src/server/utility/get-emoji-for-tool-type.js +1 -0
- package/dist/src/server/utility/get-emoji-for-tool-type.js.map +1 -1
- package/dist/src/server/utility/get-hex-for-color.js +1 -1
- package/dist/src/server/utility/get-hex-for-color.js.map +1 -1
- package/dist/src/server/utility/get-key-for-role.js +1 -1
- package/dist/src/server/utility/get-key-for-role.js.map +1 -1
- package/dist/src/server/utility/get-label-for-time-place-visibility.js +1 -1
- package/dist/src/server/utility/get-label-for-time-place-visibility.js.map +1 -1
- package/dist/src/server/utility/get-month-name.js +1 -1
- package/dist/src/server/utility/get-month-name.js.map +1 -1
- package/dist/src/server/utility/get-parent-index-path.js +1 -1
- package/dist/src/server/utility/get-parent-index-path.js.map +1 -1
- package/dist/src/server/utility/get-random-emoji-for-date.js +2 -2
- package/dist/src/server/utility/get-random-emoji-for-date.js.map +1 -1
- package/dist/src/server/utility/get-siblings-and-index-for-index-path.js +2 -2
- package/dist/src/server/utility/get-siblings-and-index-for-index-path.js.map +1 -1
- package/dist/src/server/utility/get-thumbnail-filename.js +1 -1
- package/dist/src/server/utility/get-thumbnail-filename.js.map +1 -1
- package/dist/src/server/utility/get-weekday-name.js +1 -1
- package/dist/src/server/utility/get-weekday-name.js.map +1 -1
- package/dist/src/server/utility/key-to-date.js +1 -1
- package/dist/src/server/utility/key-to-date.js.map +1 -1
- package/dist/src/server/utility/month-to-date.js +1 -1
- package/dist/src/server/utility/month-to-date.js.map +1 -1
- package/dist/src/server/utility/parse-index-path.js +1 -1
- package/dist/src/server/utility/parse-index-path.js.map +1 -1
- package/dist/src/server/utility/path-to-date.js +1 -1
- package/dist/src/server/utility/path-to-date.js.map +1 -1
- package/dist/src/server/utility/supports-thumbnail.d.ts +2 -0
- package/dist/src/server/utility/supports-thumbnail.js +14 -0
- package/dist/src/server/utility/supports-thumbnail.js.map +1 -0
- package/dist/src/server/utility/validate-page.js +1 -1
- package/dist/src/server/utility/validate-page.js.map +1 -1
- package/dist/src/server/utility/validate-path.js +1 -1
- package/dist/src/server/utility/validate-path.js.map +1 -1
- package/dist/src/server/utility/validate-url.js +1 -1
- package/dist/src/server/utility/validate-url.js.map +1 -1
- package/dist/src/server/utility/year-to-date.js +1 -1
- package/dist/src/server/utility/year-to-date.js.map +1 -1
- package/dist/src/server.d.ts +6 -1
- package/dist/src/server.js +45 -11
- package/dist/src/server.js.map +1 -1
- package/dist/src/type/account-settings.d.ts +3 -2
- package/dist/src/type/action/add-block-to-playlist.d.ts +11 -0
- package/dist/src/type/action/add-block-to-playlist.js +3 -0
- package/dist/src/type/action/add-block-to-playlist.js.map +1 -0
- package/dist/src/type/action/add-block.d.ts +10 -2
- package/dist/src/type/action/hide-block.d.ts +9 -0
- package/dist/src/type/action/hide-block.js +3 -0
- package/dist/src/type/action/hide-block.js.map +1 -0
- package/dist/src/type/action/move-block.d.ts +10 -0
- package/dist/src/type/action/move-block.js +3 -0
- package/dist/src/type/action/move-block.js.map +1 -0
- package/dist/src/type/block/audio.d.ts +4 -0
- package/dist/src/type/block/header.d.ts +2 -0
- package/dist/src/type/block/image.d.ts +2 -0
- package/dist/src/type/block/video.d.ts +8 -0
- package/dist/src/type/block/video.js +3 -0
- package/dist/src/type/block/video.js.map +1 -0
- package/dist/src/type/block.d.ts +2 -2
- package/dist/src/type/page.d.ts +2 -0
- package/dist/src/type/playlist.d.ts +11 -0
- package/dist/src/type/playlist.js +3 -0
- package/dist/src/type/playlist.js.map +1 -0
- package/dist/src/type/unpersisted.d.ts +2 -0
- package/dist/src/type/unpersisted.js +3 -0
- package/dist/src/type/unpersisted.js.map +1 -0
- package/dist/test/unit/server/operation/promote-block.js +13 -2
- package/dist/test/unit/server/operation/promote-block.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +18 -3
- package/dist/src/server/endpoint/account/get.d.ts +0 -14
- package/dist/src/server/endpoint/account/get.js +0 -34
- package/dist/src/server/endpoint/account/get.js.map +0 -1
- package/dist/src/server/endpoint/role/get.d.ts +0 -14
- package/dist/src/server/endpoint/role/get.js +0 -43
- package/dist/src/server/endpoint/role/get.js.map +0 -1
- package/dist/src/server/factory/block-result-serializer.js.map +0 -1
- package/dist/src/server/operation/store-files.d.ts +0 -15
- package/dist/src/server/operation/store-files.js.map +0 -1
- package/dist/src/server/result-serializer/account.d.ts +0 -9
- package/dist/src/server/result-serializer/account.js +0 -26
- package/dist/src/server/result-serializer/account.js.map +0 -1
- package/dist/src/server/result-serializer/action.js.map +0 -1
- package/dist/src/server/result-serializer/base.js.map +0 -1
- package/dist/src/server/result-serializer/block/audio.js.map +0 -1
- package/dist/src/server/result-serializer/block/background.js.map +0 -1
- package/dist/src/server/result-serializer/block/calendar.js.map +0 -1
- package/dist/src/server/result-serializer/block/directory.js.map +0 -1
- package/dist/src/server/result-serializer/block/ephemeral.js.map +0 -1
- package/dist/src/server/result-serializer/block/folder.js.map +0 -1
- package/dist/src/server/result-serializer/block/header.js.map +0 -1
- package/dist/src/server/result-serializer/block/image.js.map +0 -1
- package/dist/src/server/result-serializer/block/link.js.map +0 -1
- package/dist/src/server/result-serializer/block/list.js.map +0 -1
- package/dist/src/server/result-serializer/block/multi-column.js.map +0 -1
- package/dist/src/server/result-serializer/block/note.js.map +0 -1
- package/dist/src/server/result-serializer/block/parameter.js.map +0 -1
- package/dist/src/server/result-serializer/block/todo.js.map +0 -1
- package/dist/src/server/result-serializer/block/whitespace.js.map +0 -1
- package/dist/src/server/result-serializer/block.js.map +0 -1
- package/dist/src/server/result-serializer/common/time-place-options.js.map +0 -1
- package/dist/src/server/result-serializer/login.js.map +0 -1
- package/dist/src/server/result-serializer/month.js.map +0 -1
- package/dist/src/server/result-serializer/page.js.map +0 -1
- package/dist/src/server/result-serializer/role.d.ts +0 -9
- package/dist/src/server/result-serializer/role.js +0 -26
- package/dist/src/server/result-serializer/role.js.map +0 -1
- package/dist/src/server/result-serializer/settings.js.map +0 -1
- package/dist/src/server/result-serializer/week.js.map +0 -1
- package/dist/src/server/result-serializer/year.js.map +0 -1
- package/dist/test/unit/lib/grammar/inflector.d.ts +0 -1
- package/dist/test/unit/lib/grammar/inflector.js +0 -72
- package/dist/test/unit/lib/grammar/inflector.js.map +0 -1
- /package/dist/src/server/{result-serializer → serializer}/block/audio.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/background.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/background.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/calendar.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/calendar.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/directory.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/directory.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/ephemeral.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/ephemeral.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/folder.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/header.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/image.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/link.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/link.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/list.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/multi-column.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/note.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/note.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/parameter.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/parameter.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/todo.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/todo.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/block/whitespace.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/common/time-place-options.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/common/time-place-options.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/login.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/login.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/month.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/month.js +0 -0
- /package/dist/src/server/{result-serializer → serializer}/week.d.ts +0 -0
- /package/dist/src/server/{result-serializer → serializer}/year.d.ts +0 -0
package/dist/client.js
CHANGED
|
@@ -1,80 +1,975 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __esm = (fn, res) => function __init() {
|
|
10
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
11
|
+
};
|
|
12
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
13
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
14
|
+
};
|
|
15
|
+
var __export = (target, all) => {
|
|
16
|
+
for (var name in all)
|
|
17
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
18
|
+
};
|
|
19
|
+
var __copyProps = (to, from, except, desc) => {
|
|
20
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
21
|
+
for (let key of __getOwnPropNames(from))
|
|
22
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
23
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
9
24
|
}
|
|
10
|
-
|
|
11
|
-
|
|
25
|
+
return to;
|
|
26
|
+
};
|
|
27
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
28
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
29
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
30
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
31
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
32
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
33
|
+
mod
|
|
34
|
+
));
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
|
|
37
|
+
// node_modules/@fc3/errors/dist/src/error/base.js
|
|
38
|
+
var require_base = __commonJS({
|
|
39
|
+
"node_modules/@fc3/errors/dist/src/error/base.js"(exports) {
|
|
40
|
+
"use strict";
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var BaseError = class extends Error {
|
|
43
|
+
constructor(message, code) {
|
|
44
|
+
message = message.replace(/\s+/g, " ").trim();
|
|
45
|
+
super(message);
|
|
46
|
+
this.code = code || null;
|
|
47
|
+
}
|
|
48
|
+
getMessage() {
|
|
49
|
+
return this.message;
|
|
50
|
+
}
|
|
51
|
+
getCode() {
|
|
52
|
+
return this.code;
|
|
53
|
+
}
|
|
54
|
+
getData() {
|
|
55
|
+
const error_type = this.getType();
|
|
56
|
+
const code = this.getCode();
|
|
57
|
+
const message = this.getMessage();
|
|
58
|
+
return {
|
|
59
|
+
error_type,
|
|
60
|
+
code,
|
|
61
|
+
message
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
exports.default = BaseError;
|
|
12
66
|
}
|
|
13
|
-
|
|
14
|
-
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// node_modules/@fc3/errors/dist/src/enum/error-type.js
|
|
70
|
+
var require_error_type = __commonJS({
|
|
71
|
+
"node_modules/@fc3/errors/dist/src/enum/error-type.js"(exports) {
|
|
72
|
+
"use strict";
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
var ErrorType;
|
|
75
|
+
(function(ErrorType2) {
|
|
76
|
+
ErrorType2["CONFLICT"] = "conflict";
|
|
77
|
+
ErrorType2["GENERIC"] = "generic";
|
|
78
|
+
ErrorType2["OMITTED"] = "omitted";
|
|
79
|
+
ErrorType2["INVALID"] = "invalid";
|
|
80
|
+
ErrorType2["NOT_ALLOWED"] = "not_allowed";
|
|
81
|
+
ErrorType2["NOT_FOUND"] = "not_found";
|
|
82
|
+
ErrorType2["NOT_IMPLEMENTED"] = "not_implemented";
|
|
83
|
+
ErrorType2["TIMEOUT"] = "timeout";
|
|
84
|
+
ErrorType2["UNAUTHORIZED"] = "unauthorized";
|
|
85
|
+
})(ErrorType || (ErrorType = {}));
|
|
86
|
+
exports.default = ErrorType;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// node_modules/@fc3/errors/dist/src/error/conflict.js
|
|
91
|
+
var require_conflict = __commonJS({
|
|
92
|
+
"node_modules/@fc3/errors/dist/src/error/conflict.js"(exports) {
|
|
93
|
+
"use strict";
|
|
94
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
95
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
96
|
+
};
|
|
97
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
98
|
+
var base_1 = __importDefault(require_base());
|
|
99
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
100
|
+
var ConflictError = class extends base_1.default {
|
|
101
|
+
constructor(message, code) {
|
|
102
|
+
super(message || "Something went wrong", code);
|
|
103
|
+
}
|
|
104
|
+
getType() {
|
|
105
|
+
return error_type_1.default.CONFLICT;
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
exports.default = ConflictError;
|
|
15
109
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
// node_modules/@fc3/errors/dist/src/error/generic.js
|
|
113
|
+
var require_generic = __commonJS({
|
|
114
|
+
"node_modules/@fc3/errors/dist/src/error/generic.js"(exports) {
|
|
115
|
+
"use strict";
|
|
116
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
117
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
24
118
|
};
|
|
119
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
120
|
+
var base_1 = __importDefault(require_base());
|
|
121
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
122
|
+
var GenericError = class _GenericError extends base_1.default {
|
|
123
|
+
static fromNativeError(error) {
|
|
124
|
+
const coded_error = error;
|
|
125
|
+
return new _GenericError(coded_error.message, coded_error.code);
|
|
126
|
+
}
|
|
127
|
+
constructor(message, code) {
|
|
128
|
+
super(message || "Something went wrong.", code);
|
|
129
|
+
}
|
|
130
|
+
getType() {
|
|
131
|
+
return error_type_1.default.GENERIC;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
exports.default = GenericError;
|
|
25
135
|
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const coded_error = error;
|
|
48
|
-
return new _GenericError(coded_error.message, coded_error.code);
|
|
49
|
-
}
|
|
50
|
-
constructor(message, code) {
|
|
51
|
-
super(message || "Something went wrong.", code);
|
|
52
|
-
}
|
|
53
|
-
getType() {
|
|
54
|
-
return error_type_default.GENERIC;
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// node_modules/@fc3/errors/dist/src/error/invalid.js
|
|
139
|
+
var require_invalid = __commonJS({
|
|
140
|
+
"node_modules/@fc3/errors/dist/src/error/invalid.js"(exports) {
|
|
141
|
+
"use strict";
|
|
142
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
143
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
144
|
+
};
|
|
145
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
146
|
+
var base_1 = __importDefault(require_base());
|
|
147
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
148
|
+
var InvalidError2 = class extends base_1.default {
|
|
149
|
+
constructor(message) {
|
|
150
|
+
super(message || "The specified data is invalid.");
|
|
151
|
+
}
|
|
152
|
+
getType() {
|
|
153
|
+
return error_type_1.default.INVALID;
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
exports.default = InvalidError2;
|
|
55
157
|
}
|
|
56
|
-
};
|
|
57
|
-
var generic_default = GenericError;
|
|
158
|
+
});
|
|
58
159
|
|
|
59
|
-
//
|
|
60
|
-
var
|
|
61
|
-
|
|
62
|
-
|
|
160
|
+
// node_modules/@fc3/errors/dist/src/error/not-found.js
|
|
161
|
+
var require_not_found = __commonJS({
|
|
162
|
+
"node_modules/@fc3/errors/dist/src/error/not-found.js"(exports) {
|
|
163
|
+
"use strict";
|
|
164
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
165
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
166
|
+
};
|
|
167
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
168
|
+
var base_1 = __importDefault(require_base());
|
|
169
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
170
|
+
var NotFoundError = class extends base_1.default {
|
|
171
|
+
constructor(message, code) {
|
|
172
|
+
super(message || "The desired file or resource was not found", code);
|
|
173
|
+
}
|
|
174
|
+
getType() {
|
|
175
|
+
return error_type_1.default.NOT_FOUND;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
exports.default = NotFoundError;
|
|
63
179
|
}
|
|
64
|
-
|
|
65
|
-
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// node_modules/@fc3/errors/dist/src/error/not-implemented.js
|
|
183
|
+
var require_not_implemented = __commonJS({
|
|
184
|
+
"node_modules/@fc3/errors/dist/src/error/not-implemented.js"(exports) {
|
|
185
|
+
"use strict";
|
|
186
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
187
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
188
|
+
};
|
|
189
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
190
|
+
var base_1 = __importDefault(require_base());
|
|
191
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
192
|
+
var NotImplementedError = class extends base_1.default {
|
|
193
|
+
constructor(message) {
|
|
194
|
+
if (message === void 0) {
|
|
195
|
+
message = "Not implemented";
|
|
196
|
+
} else {
|
|
197
|
+
message = `Not implemented: ${message}`;
|
|
198
|
+
}
|
|
199
|
+
super(message);
|
|
200
|
+
}
|
|
201
|
+
getType() {
|
|
202
|
+
return error_type_1.default.NOT_IMPLEMENTED;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
exports.default = NotImplementedError;
|
|
66
206
|
}
|
|
67
|
-
};
|
|
68
|
-
var invalid_default = InvalidError;
|
|
207
|
+
});
|
|
69
208
|
|
|
70
|
-
//
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
209
|
+
// node_modules/@fc3/errors/dist/src/error/timeout.js
|
|
210
|
+
var require_timeout = __commonJS({
|
|
211
|
+
"node_modules/@fc3/errors/dist/src/error/timeout.js"(exports) {
|
|
212
|
+
"use strict";
|
|
213
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
214
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
215
|
+
};
|
|
216
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
217
|
+
var base_1 = __importDefault(require_base());
|
|
218
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
219
|
+
var TimeoutError = class extends base_1.default {
|
|
220
|
+
constructor(message) {
|
|
221
|
+
super(message || "Operation timed out");
|
|
222
|
+
}
|
|
223
|
+
getType() {
|
|
224
|
+
return error_type_1.default.TIMEOUT;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
exports.default = TimeoutError;
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
|
|
231
|
+
// node_modules/@fc3/errors/dist/src/error/unauthorized.js
|
|
232
|
+
var require_unauthorized = __commonJS({
|
|
233
|
+
"node_modules/@fc3/errors/dist/src/error/unauthorized.js"(exports) {
|
|
234
|
+
"use strict";
|
|
235
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
236
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
237
|
+
};
|
|
238
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
239
|
+
var base_1 = __importDefault(require_base());
|
|
240
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
241
|
+
var UnauthorizedError = class extends base_1.default {
|
|
242
|
+
constructor(message) {
|
|
243
|
+
super(message || "Permission denied");
|
|
244
|
+
}
|
|
245
|
+
getType() {
|
|
246
|
+
return error_type_1.default.UNAUTHORIZED;
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
exports.default = UnauthorizedError;
|
|
250
|
+
}
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// node_modules/@fc3/errors/dist/src/error/invariant-violation.js
|
|
254
|
+
var require_invariant_violation = __commonJS({
|
|
255
|
+
"node_modules/@fc3/errors/dist/src/error/invariant-violation.js"(exports) {
|
|
256
|
+
"use strict";
|
|
257
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
258
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
259
|
+
};
|
|
260
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
261
|
+
var generic_1 = __importDefault(require_generic());
|
|
262
|
+
var InvariantViolation12 = class extends generic_1.default {
|
|
263
|
+
};
|
|
264
|
+
exports.default = InvariantViolation12;
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
// node_modules/@fc3/errors/dist/src/error/omitted.js
|
|
269
|
+
var require_omitted = __commonJS({
|
|
270
|
+
"node_modules/@fc3/errors/dist/src/error/omitted.js"(exports) {
|
|
271
|
+
"use strict";
|
|
272
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
273
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
274
|
+
};
|
|
275
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
276
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
277
|
+
var invalid_1 = __importDefault(require_invalid());
|
|
278
|
+
var OmittedError = class extends invalid_1.default {
|
|
279
|
+
constructor(message) {
|
|
280
|
+
super(message || "Must specify a value");
|
|
281
|
+
}
|
|
282
|
+
getType() {
|
|
283
|
+
return error_type_1.default.OMITTED;
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
exports.default = OmittedError;
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
// node_modules/@fc3/errors/dist/src/error/not-allowed.js
|
|
291
|
+
var require_not_allowed = __commonJS({
|
|
292
|
+
"node_modules/@fc3/errors/dist/src/error/not-allowed.js"(exports) {
|
|
293
|
+
"use strict";
|
|
294
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
295
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
296
|
+
};
|
|
297
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
298
|
+
var base_1 = __importDefault(require_base());
|
|
299
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
300
|
+
var NotAllowedError = class extends base_1.default {
|
|
301
|
+
constructor(message) {
|
|
302
|
+
super(message || "Not allowed");
|
|
303
|
+
}
|
|
304
|
+
getType() {
|
|
305
|
+
return error_type_1.default.NOT_ALLOWED;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
exports.default = NotAllowedError;
|
|
309
|
+
}
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
// node_modules/@fc3/errors/dist/src/utility/create-error-for-error-type.js
|
|
313
|
+
var require_create_error_for_error_type = __commonJS({
|
|
314
|
+
"node_modules/@fc3/errors/dist/src/utility/create-error-for-error-type.js"(exports) {
|
|
315
|
+
"use strict";
|
|
316
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
317
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
318
|
+
};
|
|
319
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
320
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
321
|
+
var omitted_1 = __importDefault(require_omitted());
|
|
322
|
+
var invalid_1 = __importDefault(require_invalid());
|
|
323
|
+
var timeout_1 = __importDefault(require_timeout());
|
|
324
|
+
var generic_1 = __importDefault(require_generic());
|
|
325
|
+
var conflict_1 = __importDefault(require_conflict());
|
|
326
|
+
var not_found_1 = __importDefault(require_not_found());
|
|
327
|
+
var not_allowed_1 = __importDefault(require_not_allowed());
|
|
328
|
+
var unauthorized_1 = __importDefault(require_unauthorized());
|
|
329
|
+
var not_implemented_1 = __importDefault(require_not_implemented());
|
|
330
|
+
function createErrorForErrorType(error_type, error_code, message) {
|
|
331
|
+
const error_constructor = getConstructorForErrorType(error_type);
|
|
332
|
+
return new error_constructor(message, error_code);
|
|
333
|
+
}
|
|
334
|
+
function getConstructorForErrorType(error_type) {
|
|
335
|
+
switch (error_type) {
|
|
336
|
+
case error_type_1.default.CONFLICT:
|
|
337
|
+
return conflict_1.default;
|
|
338
|
+
case error_type_1.default.INVALID:
|
|
339
|
+
return invalid_1.default;
|
|
340
|
+
case error_type_1.default.NOT_ALLOWED:
|
|
341
|
+
return not_allowed_1.default;
|
|
342
|
+
case error_type_1.default.NOT_FOUND:
|
|
343
|
+
return not_found_1.default;
|
|
344
|
+
case error_type_1.default.NOT_IMPLEMENTED:
|
|
345
|
+
return not_implemented_1.default;
|
|
346
|
+
case error_type_1.default.OMITTED:
|
|
347
|
+
return omitted_1.default;
|
|
348
|
+
case error_type_1.default.TIMEOUT:
|
|
349
|
+
return timeout_1.default;
|
|
350
|
+
case error_type_1.default.UNAUTHORIZED:
|
|
351
|
+
return unauthorized_1.default;
|
|
352
|
+
default:
|
|
353
|
+
return generic_1.default;
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
exports.default = createErrorForErrorType;
|
|
357
|
+
}
|
|
358
|
+
});
|
|
359
|
+
|
|
360
|
+
// src/client/shim/process.ts
|
|
361
|
+
var process_exports = {};
|
|
362
|
+
__export(process_exports, {
|
|
363
|
+
bindProcessLifespanTo: () => bindProcessLifespanTo,
|
|
364
|
+
execute: () => execute
|
|
365
|
+
});
|
|
366
|
+
function execute(command) {
|
|
367
|
+
throw new import_errors.InvariantViolation(`
|
|
368
|
+
Tried to call process.execute() in client context
|
|
369
|
+
`);
|
|
370
|
+
}
|
|
371
|
+
function bindProcessLifespanTo(promise) {
|
|
372
|
+
throw new import_errors.InvariantViolation(`
|
|
373
|
+
Tried to call process.bindProcessLifespanTo in client context
|
|
374
|
+
`);
|
|
375
|
+
}
|
|
376
|
+
var import_errors;
|
|
377
|
+
var init_process = __esm({
|
|
378
|
+
"src/client/shim/process.ts"() {
|
|
379
|
+
"use strict";
|
|
380
|
+
import_errors = __toESM(require_src2());
|
|
381
|
+
}
|
|
382
|
+
});
|
|
383
|
+
|
|
384
|
+
// node_modules/@fc3/errors/dist/src/utility/get-error-type-for-posix-error-code.js
|
|
385
|
+
var require_get_error_type_for_posix_error_code = __commonJS({
|
|
386
|
+
"node_modules/@fc3/errors/dist/src/utility/get-error-type-for-posix-error-code.js"(exports) {
|
|
387
|
+
"use strict";
|
|
388
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
389
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
390
|
+
};
|
|
391
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
392
|
+
var process_1 = (init_process(), __toCommonJS(process_exports));
|
|
393
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
394
|
+
function getErrorTypeForPosixErrorCode(error_code) {
|
|
395
|
+
switch (error_code) {
|
|
396
|
+
case process_1.PosixErrorCode.EPERM:
|
|
397
|
+
case process_1.PosixErrorCode.EACCES:
|
|
398
|
+
return error_type_1.default.UNAUTHORIZED;
|
|
399
|
+
case process_1.PosixErrorCode.ENOENT:
|
|
400
|
+
return error_type_1.default.NOT_FOUND;
|
|
401
|
+
case process_1.PosixErrorCode.EEXIST:
|
|
402
|
+
return error_type_1.default.CONFLICT;
|
|
403
|
+
case process_1.PosixErrorCode.ENOTDIR:
|
|
404
|
+
case process_1.PosixErrorCode.EISDIR:
|
|
405
|
+
case process_1.PosixErrorCode.EINVAL:
|
|
406
|
+
return error_type_1.default.INVALID;
|
|
407
|
+
case process_1.PosixErrorCode.EADDRINUSE:
|
|
408
|
+
return error_type_1.default.CONFLICT;
|
|
409
|
+
case process_1.PosixErrorCode.ETIMEDOUT:
|
|
410
|
+
return error_type_1.default.TIMEOUT;
|
|
411
|
+
case process_1.PosixErrorCode.ECONNREFUSED:
|
|
412
|
+
case process_1.PosixErrorCode.EHOSTDOWN:
|
|
413
|
+
case process_1.PosixErrorCode.EHOSTUNREACH:
|
|
414
|
+
// TODO: Add error type for these; they are common enough to warrant it.
|
|
415
|
+
default:
|
|
416
|
+
return error_type_1.default.GENERIC;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
exports.default = getErrorTypeForPosixErrorCode;
|
|
420
|
+
}
|
|
421
|
+
});
|
|
422
|
+
|
|
423
|
+
// node_modules/@fc3/errors/dist/src/utility/wrap-error.js
|
|
424
|
+
var require_wrap_error = __commonJS({
|
|
425
|
+
"node_modules/@fc3/errors/dist/src/utility/wrap-error.js"(exports) {
|
|
426
|
+
"use strict";
|
|
427
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
428
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
429
|
+
};
|
|
430
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
431
|
+
var base_1 = __importDefault(require_base());
|
|
432
|
+
var generic_1 = __importDefault(require_generic());
|
|
433
|
+
var create_error_for_error_type_1 = __importDefault(require_create_error_for_error_type());
|
|
434
|
+
var get_error_type_for_posix_error_code_1 = __importDefault(require_get_error_type_for_posix_error_code());
|
|
435
|
+
function wrapError(error) {
|
|
436
|
+
if (error instanceof base_1.default) {
|
|
437
|
+
return error;
|
|
438
|
+
}
|
|
439
|
+
if (typeof error === "string") {
|
|
440
|
+
return new generic_1.default(error);
|
|
441
|
+
}
|
|
442
|
+
const potential_base_error = error;
|
|
443
|
+
if (potential_base_error.getType !== void 0) {
|
|
444
|
+
return potential_base_error;
|
|
445
|
+
}
|
|
446
|
+
const coded_error = error;
|
|
447
|
+
if (coded_error.code) {
|
|
448
|
+
const error_type = (0, get_error_type_for_posix_error_code_1.default)(coded_error.code);
|
|
449
|
+
return (0, create_error_for_error_type_1.default)(error_type, coded_error.code, coded_error.message);
|
|
450
|
+
}
|
|
451
|
+
return generic_1.default.fromNativeError(coded_error);
|
|
452
|
+
}
|
|
453
|
+
exports.default = wrapError;
|
|
454
|
+
}
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
// node_modules/@fc3/errors/dist/src/utility/error-matches.js
|
|
458
|
+
var require_error_matches = __commonJS({
|
|
459
|
+
"node_modules/@fc3/errors/dist/src/utility/error-matches.js"(exports) {
|
|
460
|
+
"use strict";
|
|
461
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
462
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
463
|
+
};
|
|
464
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
465
|
+
var wrap_error_1 = __importDefault(require_wrap_error());
|
|
466
|
+
function errorMatches(error, error_constructor) {
|
|
467
|
+
if (!(error instanceof Error)) {
|
|
468
|
+
return false;
|
|
469
|
+
}
|
|
470
|
+
if (error.constructor.name === error_constructor.name) {
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
if (error instanceof error_constructor) {
|
|
474
|
+
return true;
|
|
475
|
+
}
|
|
476
|
+
const wrapped_error = (0, wrap_error_1.default)(error);
|
|
477
|
+
return wrapped_error.constructor.name === error_constructor.name;
|
|
478
|
+
}
|
|
479
|
+
exports.default = errorMatches;
|
|
480
|
+
}
|
|
481
|
+
});
|
|
482
|
+
|
|
483
|
+
// node_modules/@fc3/network/dist/src/enum/network-protocol.js
|
|
484
|
+
var require_network_protocol = __commonJS({
|
|
485
|
+
"node_modules/@fc3/network/dist/src/enum/network-protocol.js"(exports) {
|
|
486
|
+
"use strict";
|
|
487
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
488
|
+
var NetworkProtocol;
|
|
489
|
+
(function(NetworkProtocol2) {
|
|
490
|
+
NetworkProtocol2["SSH"] = "ssh";
|
|
491
|
+
NetworkProtocol2["TCP"] = "tcp";
|
|
492
|
+
NetworkProtocol2["HTTP"] = "http";
|
|
493
|
+
NetworkProtocol2["HTTPS"] = "https";
|
|
494
|
+
NetworkProtocol2["SECURE_WEBSOCKET"] = "wss";
|
|
495
|
+
NetworkProtocol2["WEBSOCKET"] = "ws";
|
|
496
|
+
})(NetworkProtocol || (NetworkProtocol = {}));
|
|
497
|
+
exports.default = NetworkProtocol;
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
|
|
501
|
+
// node_modules/@fc3/network/dist/src/enum/http-status-code.js
|
|
502
|
+
var require_http_status_code = __commonJS({
|
|
503
|
+
"node_modules/@fc3/network/dist/src/enum/http-status-code.js"(exports) {
|
|
504
|
+
"use strict";
|
|
505
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
506
|
+
var HttpStatusCode;
|
|
507
|
+
(function(HttpStatusCode2) {
|
|
508
|
+
HttpStatusCode2[HttpStatusCode2["SUCCESS"] = 200] = "SUCCESS";
|
|
509
|
+
HttpStatusCode2[HttpStatusCode2["CREATED"] = 201] = "CREATED";
|
|
510
|
+
HttpStatusCode2[HttpStatusCode2["ACCEPTED"] = 202] = "ACCEPTED";
|
|
511
|
+
HttpStatusCode2[HttpStatusCode2["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
512
|
+
HttpStatusCode2[HttpStatusCode2["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
513
|
+
HttpStatusCode2[HttpStatusCode2["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
514
|
+
HttpStatusCode2[HttpStatusCode2["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
515
|
+
HttpStatusCode2[HttpStatusCode2["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
516
|
+
HttpStatusCode2[HttpStatusCode2["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
517
|
+
HttpStatusCode2[HttpStatusCode2["IM_USED"] = 226] = "IM_USED";
|
|
518
|
+
HttpStatusCode2[HttpStatusCode2["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
|
|
519
|
+
HttpStatusCode2[HttpStatusCode2["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
520
|
+
HttpStatusCode2[HttpStatusCode2["REDIRECT"] = 302] = "REDIRECT";
|
|
521
|
+
HttpStatusCode2[HttpStatusCode2["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
522
|
+
HttpStatusCode2[HttpStatusCode2["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
523
|
+
HttpStatusCode2[HttpStatusCode2["USE_PROXY"] = 305] = "USE_PROXY";
|
|
524
|
+
HttpStatusCode2[HttpStatusCode2["SWITCH_PROXY"] = 306] = "SWITCH_PROXY";
|
|
525
|
+
HttpStatusCode2[HttpStatusCode2["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
526
|
+
HttpStatusCode2[HttpStatusCode2["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
527
|
+
HttpStatusCode2[HttpStatusCode2["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
528
|
+
HttpStatusCode2[HttpStatusCode2["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
529
|
+
HttpStatusCode2[HttpStatusCode2["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
530
|
+
HttpStatusCode2[HttpStatusCode2["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
531
|
+
HttpStatusCode2[HttpStatusCode2["FILE_NOT_FOUND"] = 404] = "FILE_NOT_FOUND";
|
|
532
|
+
HttpStatusCode2[HttpStatusCode2["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
533
|
+
HttpStatusCode2[HttpStatusCode2["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
534
|
+
HttpStatusCode2[HttpStatusCode2["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
535
|
+
HttpStatusCode2[HttpStatusCode2["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
536
|
+
HttpStatusCode2[HttpStatusCode2["CONFLICT"] = 409] = "CONFLICT";
|
|
537
|
+
HttpStatusCode2[HttpStatusCode2["GONE"] = 410] = "GONE";
|
|
538
|
+
HttpStatusCode2[HttpStatusCode2["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
539
|
+
HttpStatusCode2[HttpStatusCode2["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
540
|
+
HttpStatusCode2[HttpStatusCode2["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
541
|
+
HttpStatusCode2[HttpStatusCode2["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
542
|
+
HttpStatusCode2[HttpStatusCode2["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
543
|
+
HttpStatusCode2[HttpStatusCode2["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
|
|
544
|
+
HttpStatusCode2[HttpStatusCode2["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
545
|
+
HttpStatusCode2[HttpStatusCode2["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
|
|
546
|
+
HttpStatusCode2[HttpStatusCode2["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
547
|
+
HttpStatusCode2[HttpStatusCode2["LOCKED"] = 423] = "LOCKED";
|
|
548
|
+
HttpStatusCode2[HttpStatusCode2["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
549
|
+
HttpStatusCode2[HttpStatusCode2["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
|
|
550
|
+
HttpStatusCode2[HttpStatusCode2["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
551
|
+
HttpStatusCode2[HttpStatusCode2["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
552
|
+
HttpStatusCode2[HttpStatusCode2["HEADER_FIELDS_TOO_LARGE"] = 431] = "HEADER_FIELDS_TOO_LARGE";
|
|
553
|
+
HttpStatusCode2[HttpStatusCode2["LEGALLY_UNAVAILABLE"] = 451] = "LEGALLY_UNAVAILABLE";
|
|
554
|
+
HttpStatusCode2[HttpStatusCode2["SERVER_ERROR"] = 500] = "SERVER_ERROR";
|
|
555
|
+
HttpStatusCode2[HttpStatusCode2["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
556
|
+
HttpStatusCode2[HttpStatusCode2["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
557
|
+
HttpStatusCode2[HttpStatusCode2["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
558
|
+
HttpStatusCode2[HttpStatusCode2["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
559
|
+
HttpStatusCode2[HttpStatusCode2["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
560
|
+
HttpStatusCode2[HttpStatusCode2["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
|
|
561
|
+
HttpStatusCode2[HttpStatusCode2["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
562
|
+
HttpStatusCode2[HttpStatusCode2["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
563
|
+
HttpStatusCode2[HttpStatusCode2["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
564
|
+
HttpStatusCode2[HttpStatusCode2["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
565
|
+
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
566
|
+
exports.default = HttpStatusCode;
|
|
567
|
+
}
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
// node_modules/@fc3/network/dist/src/enum/connection-status.js
|
|
571
|
+
var require_connection_status = __commonJS({
|
|
572
|
+
"node_modules/@fc3/network/dist/src/enum/connection-status.js"(exports) {
|
|
573
|
+
"use strict";
|
|
574
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
575
|
+
var ConnectionStatus;
|
|
576
|
+
(function(ConnectionStatus2) {
|
|
577
|
+
ConnectionStatus2["NOT_CONNECTED"] = "not_connected";
|
|
578
|
+
ConnectionStatus2["SEARCHING"] = "searching";
|
|
579
|
+
ConnectionStatus2["CONNECTING"] = "connecting";
|
|
580
|
+
ConnectionStatus2["CONNECTED"] = "connected";
|
|
581
|
+
ConnectionStatus2["NOT_AUTHENTICATED"] = "not_authenticated";
|
|
582
|
+
ConnectionStatus2["AUTHENTICATING"] = "authenticating";
|
|
583
|
+
ConnectionStatus2["AUTHENTICATED"] = "authenticated";
|
|
584
|
+
ConnectionStatus2["DISCONNECTING"] = "disconnecting";
|
|
585
|
+
ConnectionStatus2["DISCONNECTED"] = "disconnected";
|
|
586
|
+
ConnectionStatus2["FAILED_TO_CONNECT"] = "failed_to_connect";
|
|
587
|
+
})(ConnectionStatus || (ConnectionStatus = {}));
|
|
588
|
+
exports.default = ConnectionStatus;
|
|
589
|
+
}
|
|
590
|
+
});
|
|
591
|
+
|
|
592
|
+
// node_modules/@fc3/network/dist/src/utility/get-protocol-from-url.js
|
|
593
|
+
var require_get_protocol_from_url = __commonJS({
|
|
594
|
+
"node_modules/@fc3/network/dist/src/utility/get-protocol-from-url.js"(exports) {
|
|
595
|
+
"use strict";
|
|
596
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
597
|
+
function getProtocolFromUrl(url) {
|
|
598
|
+
const match = url.match(/^([^:]+):/);
|
|
599
|
+
if (match === null) {
|
|
600
|
+
throw new Error(`No protocol found on URL: ${url}`);
|
|
601
|
+
}
|
|
602
|
+
const protocol = match[1];
|
|
603
|
+
return protocol;
|
|
604
|
+
}
|
|
605
|
+
exports.default = getProtocolFromUrl;
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
// node_modules/@fc3/network/dist/src/event-emitter.js
|
|
610
|
+
var require_event_emitter = __commonJS({
|
|
611
|
+
"node_modules/@fc3/network/dist/src/event-emitter.js"(exports) {
|
|
612
|
+
"use strict";
|
|
613
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
614
|
+
var EventEmitter = class {
|
|
615
|
+
constructor() {
|
|
616
|
+
this.listener_map = {};
|
|
617
|
+
}
|
|
618
|
+
on(event, listener) {
|
|
619
|
+
const listeners = this.getListenersForEvent(event);
|
|
620
|
+
listeners.push(listener);
|
|
621
|
+
}
|
|
622
|
+
removeListener(event, listener) {
|
|
623
|
+
const listeners = this.getListenersForEvent(event);
|
|
624
|
+
const index = listeners.indexOf(listener);
|
|
625
|
+
if (index === -1) {
|
|
626
|
+
throw new Error(`Could not find listener in list of listeners for event: ${event}`);
|
|
627
|
+
}
|
|
628
|
+
listeners.splice(index, 1);
|
|
629
|
+
}
|
|
630
|
+
removeAllListeners(event) {
|
|
631
|
+
delete this.listener_map[event];
|
|
632
|
+
}
|
|
633
|
+
emit(event, value) {
|
|
634
|
+
const listeners = this.getListenersForEvent(event);
|
|
635
|
+
listeners.forEach((listener) => {
|
|
636
|
+
listener(value);
|
|
637
|
+
});
|
|
638
|
+
}
|
|
639
|
+
getListenersForEvent(event) {
|
|
640
|
+
const listener_map = this.getListenerMap();
|
|
641
|
+
if (listener_map[event] === void 0) {
|
|
642
|
+
listener_map[event] = [];
|
|
643
|
+
}
|
|
644
|
+
return listener_map[event];
|
|
645
|
+
}
|
|
646
|
+
getListenerMap() {
|
|
647
|
+
return this.listener_map;
|
|
648
|
+
}
|
|
649
|
+
};
|
|
650
|
+
exports.default = EventEmitter;
|
|
651
|
+
}
|
|
652
|
+
});
|
|
653
|
+
|
|
654
|
+
// node_modules/@fc3/network/dist/src/index.js
|
|
655
|
+
var require_src = __commonJS({
|
|
656
|
+
"node_modules/@fc3/network/dist/src/index.js"(exports) {
|
|
657
|
+
"use strict";
|
|
658
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
659
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
660
|
+
};
|
|
661
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
662
|
+
exports.EventEmitter = exports.getProtocolFromUrl = exports.ConnectionStatus = exports.HttpStatusCode = exports.NetworkProtocol = void 0;
|
|
663
|
+
var network_protocol_1 = require_network_protocol();
|
|
664
|
+
Object.defineProperty(exports, "NetworkProtocol", { enumerable: true, get: function() {
|
|
665
|
+
return __importDefault(network_protocol_1).default;
|
|
666
|
+
} });
|
|
667
|
+
var http_status_code_1 = require_http_status_code();
|
|
668
|
+
Object.defineProperty(exports, "HttpStatusCode", { enumerable: true, get: function() {
|
|
669
|
+
return __importDefault(http_status_code_1).default;
|
|
670
|
+
} });
|
|
671
|
+
var connection_status_1 = require_connection_status();
|
|
672
|
+
Object.defineProperty(exports, "ConnectionStatus", { enumerable: true, get: function() {
|
|
673
|
+
return __importDefault(connection_status_1).default;
|
|
674
|
+
} });
|
|
675
|
+
var get_protocol_from_url_1 = require_get_protocol_from_url();
|
|
676
|
+
Object.defineProperty(exports, "getProtocolFromUrl", { enumerable: true, get: function() {
|
|
677
|
+
return __importDefault(get_protocol_from_url_1).default;
|
|
678
|
+
} });
|
|
679
|
+
var event_emitter_1 = require_event_emitter();
|
|
680
|
+
Object.defineProperty(exports, "EventEmitter", { enumerable: true, get: function() {
|
|
681
|
+
return __importDefault(event_emitter_1).default;
|
|
682
|
+
} });
|
|
683
|
+
}
|
|
684
|
+
});
|
|
685
|
+
|
|
686
|
+
// node_modules/@fc3/errors/dist/src/utility/get-error-type-for-status-code.js
|
|
687
|
+
var require_get_error_type_for_status_code = __commonJS({
|
|
688
|
+
"node_modules/@fc3/errors/dist/src/utility/get-error-type-for-status-code.js"(exports) {
|
|
689
|
+
"use strict";
|
|
690
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
691
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
692
|
+
};
|
|
693
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
694
|
+
var network_1 = require_src();
|
|
695
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
696
|
+
function getErrorTypeForStatusCode(status_code) {
|
|
697
|
+
switch (status_code) {
|
|
698
|
+
case network_1.HttpStatusCode.CONFLICT:
|
|
699
|
+
return error_type_1.default.CONFLICT;
|
|
700
|
+
case network_1.HttpStatusCode.BAD_REQUEST:
|
|
701
|
+
return error_type_1.default.INVALID;
|
|
702
|
+
case network_1.HttpStatusCode.FORBIDDEN:
|
|
703
|
+
return error_type_1.default.NOT_ALLOWED;
|
|
704
|
+
case network_1.HttpStatusCode.FILE_NOT_FOUND:
|
|
705
|
+
return error_type_1.default.NOT_FOUND;
|
|
706
|
+
case network_1.HttpStatusCode.NOT_IMPLEMENTED:
|
|
707
|
+
return error_type_1.default.NOT_IMPLEMENTED;
|
|
708
|
+
case network_1.HttpStatusCode.REQUEST_TIMEOUT:
|
|
709
|
+
case network_1.HttpStatusCode.GATEWAY_TIMEOUT:
|
|
710
|
+
return error_type_1.default.TIMEOUT;
|
|
711
|
+
case network_1.HttpStatusCode.UNAUTHORIZED:
|
|
712
|
+
return error_type_1.default.UNAUTHORIZED;
|
|
713
|
+
default:
|
|
714
|
+
if (status_code >= network_1.HttpStatusCode.SERVER_ERROR) {
|
|
715
|
+
return error_type_1.default.GENERIC;
|
|
716
|
+
}
|
|
717
|
+
return error_type_1.default.INVALID;
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
exports.default = getErrorTypeForStatusCode;
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
|
|
724
|
+
// node_modules/@fc3/errors/dist/src/utility/create-error-from-ambiguous-json-data.js
|
|
725
|
+
var require_create_error_from_ambiguous_json_data = __commonJS({
|
|
726
|
+
"node_modules/@fc3/errors/dist/src/utility/create-error-from-ambiguous-json-data.js"(exports) {
|
|
727
|
+
"use strict";
|
|
728
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
729
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
730
|
+
};
|
|
731
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
732
|
+
var error_type_1 = __importDefault(require_error_type());
|
|
733
|
+
var create_error_for_error_type_1 = __importDefault(require_create_error_for_error_type());
|
|
734
|
+
var get_error_type_for_status_code_1 = __importDefault(require_get_error_type_for_status_code());
|
|
735
|
+
function createErrorFromAmbiguousJsonData(data, status_code) {
|
|
736
|
+
const error_data = data;
|
|
737
|
+
let error_type;
|
|
738
|
+
if (Object.values(error_type_1.default).includes(error_data.error_type)) {
|
|
739
|
+
error_type = error_data.error_type;
|
|
740
|
+
} else {
|
|
741
|
+
error_type = (0, get_error_type_for_status_code_1.default)(status_code);
|
|
742
|
+
}
|
|
743
|
+
return (0, create_error_for_error_type_1.default)(error_type, null, error_data.message);
|
|
744
|
+
}
|
|
745
|
+
exports.default = createErrorFromAmbiguousJsonData;
|
|
746
|
+
}
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
// node_modules/@fc3/errors/dist/src/utility/matches-posix-error-code.js
|
|
750
|
+
var require_matches_posix_error_code = __commonJS({
|
|
751
|
+
"node_modules/@fc3/errors/dist/src/utility/matches-posix-error-code.js"(exports) {
|
|
752
|
+
"use strict";
|
|
753
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
754
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
755
|
+
};
|
|
756
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
757
|
+
var wrap_error_1 = __importDefault(require_wrap_error());
|
|
758
|
+
function matchesPosixErrorCode(error, posix_error_code) {
|
|
759
|
+
const wrapped_error = (0, wrap_error_1.default)(error);
|
|
760
|
+
return wrapped_error.code === posix_error_code;
|
|
761
|
+
}
|
|
762
|
+
exports.default = matchesPosixErrorCode;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
// node_modules/@fc3/errors/dist/src/sugar/invariant.js
|
|
767
|
+
var require_invariant = __commonJS({
|
|
768
|
+
"node_modules/@fc3/errors/dist/src/sugar/invariant.js"(exports) {
|
|
769
|
+
"use strict";
|
|
770
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
771
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
772
|
+
};
|
|
773
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
774
|
+
var invariant_violation_1 = __importDefault(require_invariant_violation());
|
|
775
|
+
function invariant(message) {
|
|
776
|
+
throw new invariant_violation_1.default(message);
|
|
777
|
+
}
|
|
778
|
+
exports.default = invariant;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
// node_modules/@fc3/errors/dist/src/index.js
|
|
783
|
+
var require_src2 = __commonJS({
|
|
784
|
+
"node_modules/@fc3/errors/dist/src/index.js"(exports) {
|
|
785
|
+
"use strict";
|
|
786
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
787
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
788
|
+
};
|
|
789
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
790
|
+
exports.invariant = exports.createErrorForErrorType = exports.getErrorTypeForStatusCode = exports.matchesPosixErrorCode = exports.createErrorFromAmbiguousJsonData = exports.ErrorType = exports.errorMatches = exports.wrapError = exports.InvariantViolation = exports.UnauthorizedError = exports.TimeoutError = exports.NotImplementedError = exports.NotFoundError = exports.InvalidError = exports.GenericError = exports.ConflictError = exports.BaseError = void 0;
|
|
791
|
+
var base_1 = require_base();
|
|
792
|
+
Object.defineProperty(exports, "BaseError", { enumerable: true, get: function() {
|
|
793
|
+
return __importDefault(base_1).default;
|
|
794
|
+
} });
|
|
795
|
+
var conflict_1 = require_conflict();
|
|
796
|
+
Object.defineProperty(exports, "ConflictError", { enumerable: true, get: function() {
|
|
797
|
+
return __importDefault(conflict_1).default;
|
|
798
|
+
} });
|
|
799
|
+
var generic_1 = require_generic();
|
|
800
|
+
Object.defineProperty(exports, "GenericError", { enumerable: true, get: function() {
|
|
801
|
+
return __importDefault(generic_1).default;
|
|
802
|
+
} });
|
|
803
|
+
var invalid_1 = require_invalid();
|
|
804
|
+
Object.defineProperty(exports, "InvalidError", { enumerable: true, get: function() {
|
|
805
|
+
return __importDefault(invalid_1).default;
|
|
806
|
+
} });
|
|
807
|
+
var not_found_1 = require_not_found();
|
|
808
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function() {
|
|
809
|
+
return __importDefault(not_found_1).default;
|
|
810
|
+
} });
|
|
811
|
+
var not_implemented_1 = require_not_implemented();
|
|
812
|
+
Object.defineProperty(exports, "NotImplementedError", { enumerable: true, get: function() {
|
|
813
|
+
return __importDefault(not_implemented_1).default;
|
|
814
|
+
} });
|
|
815
|
+
var timeout_1 = require_timeout();
|
|
816
|
+
Object.defineProperty(exports, "TimeoutError", { enumerable: true, get: function() {
|
|
817
|
+
return __importDefault(timeout_1).default;
|
|
818
|
+
} });
|
|
819
|
+
var unauthorized_1 = require_unauthorized();
|
|
820
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function() {
|
|
821
|
+
return __importDefault(unauthorized_1).default;
|
|
822
|
+
} });
|
|
823
|
+
var invariant_violation_1 = require_invariant_violation();
|
|
824
|
+
Object.defineProperty(exports, "InvariantViolation", { enumerable: true, get: function() {
|
|
825
|
+
return __importDefault(invariant_violation_1).default;
|
|
826
|
+
} });
|
|
827
|
+
var wrap_error_1 = require_wrap_error();
|
|
828
|
+
Object.defineProperty(exports, "wrapError", { enumerable: true, get: function() {
|
|
829
|
+
return __importDefault(wrap_error_1).default;
|
|
830
|
+
} });
|
|
831
|
+
var error_matches_1 = require_error_matches();
|
|
832
|
+
Object.defineProperty(exports, "errorMatches", { enumerable: true, get: function() {
|
|
833
|
+
return __importDefault(error_matches_1).default;
|
|
834
|
+
} });
|
|
835
|
+
var error_type_1 = require_error_type();
|
|
836
|
+
Object.defineProperty(exports, "ErrorType", { enumerable: true, get: function() {
|
|
837
|
+
return __importDefault(error_type_1).default;
|
|
838
|
+
} });
|
|
839
|
+
var create_error_from_ambiguous_json_data_1 = require_create_error_from_ambiguous_json_data();
|
|
840
|
+
Object.defineProperty(exports, "createErrorFromAmbiguousJsonData", { enumerable: true, get: function() {
|
|
841
|
+
return __importDefault(create_error_from_ambiguous_json_data_1).default;
|
|
842
|
+
} });
|
|
843
|
+
var matches_posix_error_code_1 = require_matches_posix_error_code();
|
|
844
|
+
Object.defineProperty(exports, "matchesPosixErrorCode", { enumerable: true, get: function() {
|
|
845
|
+
return __importDefault(matches_posix_error_code_1).default;
|
|
846
|
+
} });
|
|
847
|
+
var get_error_type_for_status_code_1 = require_get_error_type_for_status_code();
|
|
848
|
+
Object.defineProperty(exports, "getErrorTypeForStatusCode", { enumerable: true, get: function() {
|
|
849
|
+
return __importDefault(get_error_type_for_status_code_1).default;
|
|
850
|
+
} });
|
|
851
|
+
var create_error_for_error_type_1 = require_create_error_for_error_type();
|
|
852
|
+
Object.defineProperty(exports, "createErrorForErrorType", { enumerable: true, get: function() {
|
|
853
|
+
return __importDefault(create_error_for_error_type_1).default;
|
|
854
|
+
} });
|
|
855
|
+
var invariant_1 = require_invariant();
|
|
856
|
+
Object.defineProperty(exports, "invariant", { enumerable: true, get: function() {
|
|
857
|
+
return __importDefault(invariant_1).default;
|
|
858
|
+
} });
|
|
859
|
+
}
|
|
860
|
+
});
|
|
861
|
+
|
|
862
|
+
// node_modules/@fc3/array/dist/src/clone.js
|
|
863
|
+
var require_clone = __commonJS({
|
|
864
|
+
"node_modules/@fc3/array/dist/src/clone.js"(exports) {
|
|
865
|
+
"use strict";
|
|
866
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
867
|
+
function clone(array) {
|
|
868
|
+
return Array.prototype.slice.call(array);
|
|
869
|
+
}
|
|
870
|
+
exports.default = clone;
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
// node_modules/@fc3/array/dist/src/get-last-value.js
|
|
875
|
+
var require_get_last_value = __commonJS({
|
|
876
|
+
"node_modules/@fc3/array/dist/src/get-last-value.js"(exports) {
|
|
877
|
+
"use strict";
|
|
878
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
879
|
+
function getLastValue2(array) {
|
|
880
|
+
return array[array.length - 1];
|
|
881
|
+
}
|
|
882
|
+
exports.default = getLastValue2;
|
|
883
|
+
}
|
|
884
|
+
});
|
|
885
|
+
|
|
886
|
+
// node_modules/@fc3/array/dist/src/get-first-value.js
|
|
887
|
+
var require_get_first_value = __commonJS({
|
|
888
|
+
"node_modules/@fc3/array/dist/src/get-first-value.js"(exports) {
|
|
889
|
+
"use strict";
|
|
890
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
891
|
+
function getFirstValue3(array) {
|
|
892
|
+
return array[0];
|
|
893
|
+
}
|
|
894
|
+
exports.default = getFirstValue3;
|
|
895
|
+
}
|
|
896
|
+
});
|
|
897
|
+
|
|
898
|
+
// node_modules/@fc3/array/dist/src/get-max-value.js
|
|
899
|
+
var require_get_max_value = __commonJS({
|
|
900
|
+
"node_modules/@fc3/array/dist/src/get-max-value.js"(exports) {
|
|
901
|
+
"use strict";
|
|
902
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
903
|
+
function getMaxValue(values) {
|
|
904
|
+
return Math.max.apply(Math, values);
|
|
905
|
+
}
|
|
906
|
+
exports.default = getMaxValue;
|
|
907
|
+
}
|
|
908
|
+
});
|
|
909
|
+
|
|
910
|
+
// node_modules/@fc3/array/dist/src/equal.js
|
|
911
|
+
var require_equal = __commonJS({
|
|
912
|
+
"node_modules/@fc3/array/dist/src/equal.js"(exports) {
|
|
913
|
+
"use strict";
|
|
914
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
915
|
+
function equal(array_a, array_b) {
|
|
916
|
+
if (array_a.length !== array_b.length) {
|
|
917
|
+
return false;
|
|
918
|
+
}
|
|
919
|
+
let index = 0;
|
|
920
|
+
while (index < array_a.length) {
|
|
921
|
+
const array_a_value = array_a[index];
|
|
922
|
+
const array_b_value = array_b[index];
|
|
923
|
+
if (array_a_value !== array_b_value) {
|
|
924
|
+
return false;
|
|
925
|
+
}
|
|
926
|
+
index++;
|
|
927
|
+
}
|
|
928
|
+
return true;
|
|
929
|
+
}
|
|
930
|
+
exports.default = equal;
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
|
|
934
|
+
// node_modules/@fc3/array/dist/src/index.js
|
|
935
|
+
var require_src3 = __commonJS({
|
|
936
|
+
"node_modules/@fc3/array/dist/src/index.js"(exports) {
|
|
937
|
+
"use strict";
|
|
938
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
939
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
940
|
+
};
|
|
941
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
942
|
+
exports.equal = exports.getMaxValue = exports.getFirstValue = exports.getLastValue = exports.clone = void 0;
|
|
943
|
+
var clone_1 = require_clone();
|
|
944
|
+
Object.defineProperty(exports, "clone", { enumerable: true, get: function() {
|
|
945
|
+
return __importDefault(clone_1).default;
|
|
946
|
+
} });
|
|
947
|
+
var get_last_value_1 = require_get_last_value();
|
|
948
|
+
Object.defineProperty(exports, "getLastValue", { enumerable: true, get: function() {
|
|
949
|
+
return __importDefault(get_last_value_1).default;
|
|
950
|
+
} });
|
|
951
|
+
var get_first_value_1 = require_get_first_value();
|
|
952
|
+
Object.defineProperty(exports, "getFirstValue", { enumerable: true, get: function() {
|
|
953
|
+
return __importDefault(get_first_value_1).default;
|
|
954
|
+
} });
|
|
955
|
+
var get_max_value_1 = require_get_max_value();
|
|
956
|
+
Object.defineProperty(exports, "getMaxValue", { enumerable: true, get: function() {
|
|
957
|
+
return __importDefault(get_max_value_1).default;
|
|
958
|
+
} });
|
|
959
|
+
var equal_1 = require_equal();
|
|
960
|
+
Object.defineProperty(exports, "equal", { enumerable: true, get: function() {
|
|
961
|
+
return __importDefault(equal_1).default;
|
|
962
|
+
} });
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
// src/client/client.ts
|
|
967
|
+
var import_errors12 = __toESM(require_src2());
|
|
74
968
|
|
|
75
969
|
// src/client/enum/page-type.ts
|
|
76
970
|
var PageType = /* @__PURE__ */ ((PageType2) => {
|
|
77
971
|
PageType2["HOME"] = "home";
|
|
972
|
+
PageType2["HISTORY"] = "history";
|
|
78
973
|
PageType2["LOGIN"] = "login";
|
|
79
974
|
PageType2["LOGOUT"] = "logout";
|
|
80
975
|
PageType2["DAY"] = "day";
|
|
@@ -82,29 +977,24 @@
|
|
|
82
977
|
PageType2["MONTH"] = "month";
|
|
83
978
|
PageType2["YEAR"] = "year";
|
|
84
979
|
PageType2["SELECT_BLOCK_TYPE"] = "select_block_type";
|
|
980
|
+
PageType2["SELECT_BLOCK_DESTINATION"] = "select_block_destination";
|
|
85
981
|
PageType2["CREATE_BLOCK"] = "create_block";
|
|
86
982
|
PageType2["EDIT_BLOCK"] = "edit_block";
|
|
87
983
|
PageType2["VIEW_CUSTOM"] = "view_custom";
|
|
88
984
|
PageType2["EDIT_CUSTOM"] = "edit_custom";
|
|
89
985
|
PageType2["CONFIRM_DELETE_BLOCK"] = "confirm_delete_block";
|
|
986
|
+
PageType2["CONFIRM_HIDE_BLOCK"] = "confirm_hide_block";
|
|
90
987
|
PageType2["MOVE_BLOCK"] = "move_block";
|
|
91
988
|
PageType2["SETTINGS"] = "settings";
|
|
92
989
|
PageType2["ROLE"] = "role";
|
|
990
|
+
PageType2["ADD_BLOCK_TO_PLAYLIST"] = "add_block_to_playlist";
|
|
991
|
+
PageType2["VIEW_PLAYLIST"] = "view_playlist";
|
|
93
992
|
return PageType2;
|
|
94
993
|
})(PageType || {});
|
|
95
994
|
var page_type_default = PageType;
|
|
96
995
|
|
|
97
|
-
// src/
|
|
98
|
-
|
|
99
|
-
return array[array.length - 1];
|
|
100
|
-
}
|
|
101
|
-
var get_last_value_default = getLastValue;
|
|
102
|
-
|
|
103
|
-
// src/lib/array/get-first-value.ts
|
|
104
|
-
function getFirstValue(array) {
|
|
105
|
-
return array[0];
|
|
106
|
-
}
|
|
107
|
-
var get_first_value_default = getFirstValue;
|
|
996
|
+
// src/client/page.ts
|
|
997
|
+
var import_array = __toESM(require_src3());
|
|
108
998
|
|
|
109
999
|
// src/client/enum/key-code.ts
|
|
110
1000
|
var KeyCode = /* @__PURE__ */ ((KeyCode2) => {
|
|
@@ -151,6 +1041,7 @@
|
|
|
151
1041
|
start() {
|
|
152
1042
|
this.logStarting();
|
|
153
1043
|
this.initEvents();
|
|
1044
|
+
this.clearToast();
|
|
154
1045
|
this.bindLoadEvent();
|
|
155
1046
|
this.logStarted();
|
|
156
1047
|
}
|
|
@@ -182,7 +1073,7 @@
|
|
|
182
1073
|
focusElement(element) {
|
|
183
1074
|
const rectangle = element.getBoundingClientRect();
|
|
184
1075
|
const headers = Array.from(document.getElementsByTagName("header"));
|
|
185
|
-
const header =
|
|
1076
|
+
const header = (0, import_array.getFirstValue)(headers);
|
|
186
1077
|
const header_offset = header === void 0 ? 0 : header.clientHeight;
|
|
187
1078
|
if (rectangle.top < header_offset) {
|
|
188
1079
|
if (header_offset === 0) {
|
|
@@ -222,6 +1113,12 @@
|
|
|
222
1113
|
url.searchParams.delete("toast_color");
|
|
223
1114
|
window.location.href = url.toString();
|
|
224
1115
|
}
|
|
1116
|
+
clearToast() {
|
|
1117
|
+
const url = new URL(window.location.href);
|
|
1118
|
+
url.searchParams.delete("toast_message");
|
|
1119
|
+
url.searchParams.delete("toast_color");
|
|
1120
|
+
history.replaceState(null, "", url);
|
|
1121
|
+
}
|
|
225
1122
|
logStarting() {
|
|
226
1123
|
const name = this.getName();
|
|
227
1124
|
console.log(`[${name}] starting...`);
|
|
@@ -243,6 +1140,172 @@
|
|
|
243
1140
|
};
|
|
244
1141
|
var home_default = HomePage;
|
|
245
1142
|
|
|
1143
|
+
// src/client/page/history.ts
|
|
1144
|
+
var import_errors3 = __toESM(require_src2());
|
|
1145
|
+
|
|
1146
|
+
// src/enum/block-type.ts
|
|
1147
|
+
var BlockType = /* @__PURE__ */ ((BlockType2) => {
|
|
1148
|
+
BlockType2["HEADER"] = "header";
|
|
1149
|
+
BlockType2["NOTE"] = "note";
|
|
1150
|
+
BlockType2["IMAGE"] = "image";
|
|
1151
|
+
BlockType2["VIDEO"] = "video";
|
|
1152
|
+
BlockType2["AUDIO"] = "audio";
|
|
1153
|
+
BlockType2["EPHEMERAL"] = "ephemeral";
|
|
1154
|
+
BlockType2["CALENDAR"] = "calendar";
|
|
1155
|
+
BlockType2["DIRECTORY"] = "directory";
|
|
1156
|
+
BlockType2["FOLDER"] = "folder";
|
|
1157
|
+
BlockType2["MULTI_COLUMN"] = "multi_column";
|
|
1158
|
+
BlockType2["LINK"] = "link";
|
|
1159
|
+
BlockType2["TODO"] = "todo";
|
|
1160
|
+
BlockType2["LIST"] = "list";
|
|
1161
|
+
BlockType2["BACKGROUND"] = "background";
|
|
1162
|
+
BlockType2["WHITESPACE"] = "whitespace";
|
|
1163
|
+
BlockType2["PARAMETER"] = "parameter";
|
|
1164
|
+
return BlockType2;
|
|
1165
|
+
})(BlockType || {});
|
|
1166
|
+
var block_type_default = BlockType;
|
|
1167
|
+
|
|
1168
|
+
// src/client/utility/get-block-activation-href.ts
|
|
1169
|
+
var import_errors2 = __toESM(require_src2());
|
|
1170
|
+
function getBlockActivationHref(block_element) {
|
|
1171
|
+
const link_nodes = block_element.getElementsByTagName("a");
|
|
1172
|
+
const links = Array.from(link_nodes);
|
|
1173
|
+
const matching_link = links.find((link) => {
|
|
1174
|
+
const role = link.getAttribute("data-role");
|
|
1175
|
+
return role === "block_activation";
|
|
1176
|
+
});
|
|
1177
|
+
if (matching_link === void 0) {
|
|
1178
|
+
throw new import_errors2.InvariantViolation(`
|
|
1179
|
+
Tried to activate link for folder block, but it was not set
|
|
1180
|
+
`);
|
|
1181
|
+
}
|
|
1182
|
+
const href = matching_link.getAttribute("href");
|
|
1183
|
+
if (href === null) {
|
|
1184
|
+
throw new import_errors2.InvariantViolation(`
|
|
1185
|
+
Tried to activate link for folder block, but its href was not set
|
|
1186
|
+
`);
|
|
1187
|
+
}
|
|
1188
|
+
return href;
|
|
1189
|
+
}
|
|
1190
|
+
var get_block_activation_href_default = getBlockActivationHref;
|
|
1191
|
+
|
|
1192
|
+
// src/client/page/history.ts
|
|
1193
|
+
var HistoryPage = class extends page_default {
|
|
1194
|
+
handleKey(key_code) {
|
|
1195
|
+
switch (key_code) {
|
|
1196
|
+
case key_code_default.ENTER:
|
|
1197
|
+
case key_code_default.O:
|
|
1198
|
+
return this.activateBlock();
|
|
1199
|
+
case key_code_default.J:
|
|
1200
|
+
return this.selectNextBlock();
|
|
1201
|
+
case key_code_default.K:
|
|
1202
|
+
return this.selectPreviousBlock();
|
|
1203
|
+
default:
|
|
1204
|
+
return super.handleKey(key_code);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1207
|
+
activateBlock() {
|
|
1208
|
+
const block_element = this.getCurrentBlockElement();
|
|
1209
|
+
if (block_element === null) {
|
|
1210
|
+
return;
|
|
1211
|
+
}
|
|
1212
|
+
const attribute = block_element.getAttribute("data-block-type");
|
|
1213
|
+
if (attribute === null) {
|
|
1214
|
+
throw new import_errors3.InvariantViolation(`
|
|
1215
|
+
Tried to activate current block, but it did not have a block type
|
|
1216
|
+
`);
|
|
1217
|
+
}
|
|
1218
|
+
const block_type = attribute;
|
|
1219
|
+
const block_types = Object.values(block_type_default);
|
|
1220
|
+
if (!block_types.includes(block_type)) {
|
|
1221
|
+
throw new import_errors3.InvariantViolation(`
|
|
1222
|
+
Invalid block type: ${block_type}
|
|
1223
|
+
`);
|
|
1224
|
+
}
|
|
1225
|
+
if (block_type !== block_type_default.FOLDER) {
|
|
1226
|
+
return console.warn(`no-op activation for block of type ${block_type}`);
|
|
1227
|
+
}
|
|
1228
|
+
const href = get_block_activation_href_default(block_element);
|
|
1229
|
+
window.location.href = href;
|
|
1230
|
+
}
|
|
1231
|
+
selectPreviousBlock() {
|
|
1232
|
+
this.navigateToIndex(this.getPreviousBlockIndex());
|
|
1233
|
+
this.focusCurrentBlockElement();
|
|
1234
|
+
}
|
|
1235
|
+
selectNextBlock() {
|
|
1236
|
+
this.navigateToIndex(this.getNextBlockIndex());
|
|
1237
|
+
this.focusCurrentBlockElement();
|
|
1238
|
+
}
|
|
1239
|
+
navigateToIndex(index) {
|
|
1240
|
+
if (index === null) {
|
|
1241
|
+
return;
|
|
1242
|
+
}
|
|
1243
|
+
const block_elements = this.getBlockElements();
|
|
1244
|
+
block_elements.forEach((block_element, block_index) => {
|
|
1245
|
+
const is_match = block_index === index;
|
|
1246
|
+
block_element.classList.toggle("selected", is_match);
|
|
1247
|
+
});
|
|
1248
|
+
const url = new URL(window.location.href);
|
|
1249
|
+
url.searchParams.set("index", index.toString());
|
|
1250
|
+
window.history.replaceState({}, "", url);
|
|
1251
|
+
}
|
|
1252
|
+
getPreviousBlockIndex() {
|
|
1253
|
+
const block_elements = this.getBlockElements();
|
|
1254
|
+
const current_index = this.getCurrentIndex();
|
|
1255
|
+
const previous_block = block_elements[current_index - 1];
|
|
1256
|
+
if (previous_block === void 0) {
|
|
1257
|
+
return null;
|
|
1258
|
+
}
|
|
1259
|
+
return current_index - 1;
|
|
1260
|
+
}
|
|
1261
|
+
getNextBlockIndex() {
|
|
1262
|
+
const block_elements = this.getBlockElements();
|
|
1263
|
+
const current_index = this.getCurrentIndex();
|
|
1264
|
+
const next_block = block_elements[current_index + 1];
|
|
1265
|
+
if (next_block === void 0) {
|
|
1266
|
+
return null;
|
|
1267
|
+
}
|
|
1268
|
+
return current_index + 1;
|
|
1269
|
+
}
|
|
1270
|
+
getCurrentIndex() {
|
|
1271
|
+
const current_block = this.getCurrentBlockElement();
|
|
1272
|
+
const blocks = this.getBlockElements();
|
|
1273
|
+
const current_index = current_block ? blocks.indexOf(current_block) : -1;
|
|
1274
|
+
return current_index;
|
|
1275
|
+
}
|
|
1276
|
+
focusCurrentBlockElement() {
|
|
1277
|
+
const element = this.getCurrentBlockElement();
|
|
1278
|
+
if (element === null) {
|
|
1279
|
+
return;
|
|
1280
|
+
}
|
|
1281
|
+
this.focusElement(element);
|
|
1282
|
+
}
|
|
1283
|
+
getCurrentBlockElement() {
|
|
1284
|
+
const block_elements = this.getBlockElements();
|
|
1285
|
+
const selected_element = block_elements.find((element2) => {
|
|
1286
|
+
return element2.classList.contains("selected");
|
|
1287
|
+
});
|
|
1288
|
+
if (selected_element !== void 0) {
|
|
1289
|
+
return selected_element;
|
|
1290
|
+
}
|
|
1291
|
+
const index = (() => {
|
|
1292
|
+
const parameter = this.getQueryParameter("index");
|
|
1293
|
+
if (parameter === void 0) {
|
|
1294
|
+
return 0;
|
|
1295
|
+
}
|
|
1296
|
+
const parsed_parameter = parseInt(parameter);
|
|
1297
|
+
return parsed_parameter || 0;
|
|
1298
|
+
})();
|
|
1299
|
+
const element = block_elements[index];
|
|
1300
|
+
return element || null;
|
|
1301
|
+
}
|
|
1302
|
+
getBlockElements() {
|
|
1303
|
+
const elements = document.getElementsByClassName("block");
|
|
1304
|
+
return Array.from(elements);
|
|
1305
|
+
}
|
|
1306
|
+
};
|
|
1307
|
+
var history_default = HistoryPage;
|
|
1308
|
+
|
|
246
1309
|
// src/client/page/login.ts
|
|
247
1310
|
var LoginPage = class extends page_default {
|
|
248
1311
|
initEvents() {
|
|
@@ -292,28 +1355,8 @@
|
|
|
292
1355
|
};
|
|
293
1356
|
var year_default = YearPage;
|
|
294
1357
|
|
|
295
|
-
// src/enum/block-type.ts
|
|
296
|
-
var BlockType = /* @__PURE__ */ ((BlockType2) => {
|
|
297
|
-
BlockType2["HEADER"] = "header";
|
|
298
|
-
BlockType2["NOTE"] = "note";
|
|
299
|
-
BlockType2["IMAGE"] = "image";
|
|
300
|
-
BlockType2["AUDIO"] = "audio";
|
|
301
|
-
BlockType2["EPHEMERAL"] = "ephemeral";
|
|
302
|
-
BlockType2["CALENDAR"] = "calendar";
|
|
303
|
-
BlockType2["DIRECTORY"] = "directory";
|
|
304
|
-
BlockType2["FOLDER"] = "folder";
|
|
305
|
-
BlockType2["MULTI_COLUMN"] = "multi_column";
|
|
306
|
-
BlockType2["LINK"] = "link";
|
|
307
|
-
BlockType2["TODO"] = "todo";
|
|
308
|
-
BlockType2["LIST"] = "list";
|
|
309
|
-
BlockType2["BACKGROUND"] = "background";
|
|
310
|
-
BlockType2["WHITESPACE"] = "whitespace";
|
|
311
|
-
BlockType2["PARAMETER"] = "parameter";
|
|
312
|
-
return BlockType2;
|
|
313
|
-
})(BlockType || {});
|
|
314
|
-
var block_type_default = BlockType;
|
|
315
|
-
|
|
316
1358
|
// src/client/page/select-block-type.ts
|
|
1359
|
+
var import_errors4 = __toESM(require_src2());
|
|
317
1360
|
var SelectBlockTypePage = class extends page_default {
|
|
318
1361
|
handleKey(key_code) {
|
|
319
1362
|
switch (key_code) {
|
|
@@ -341,14 +1384,14 @@
|
|
|
341
1384
|
const id = `add-block-${block_type}`;
|
|
342
1385
|
const element = document.getElementById(id);
|
|
343
1386
|
if (element === null) {
|
|
344
|
-
throw new
|
|
1387
|
+
throw new import_errors4.InvariantViolation(`
|
|
345
1388
|
Tried to create block of type ${block_type},
|
|
346
1389
|
but the creation link was not found
|
|
347
1390
|
`);
|
|
348
1391
|
}
|
|
349
1392
|
const href = element.getAttribute("href");
|
|
350
1393
|
if (href === null) {
|
|
351
|
-
throw new
|
|
1394
|
+
throw new import_errors4.InvariantViolation(`
|
|
352
1395
|
Tried to create block of type ${block_type},
|
|
353
1396
|
but the creation href was not present on the link element
|
|
354
1397
|
`);
|
|
@@ -358,53 +1401,21 @@
|
|
|
358
1401
|
};
|
|
359
1402
|
var select_block_type_default = SelectBlockTypePage;
|
|
360
1403
|
|
|
361
|
-
// src/client/page/
|
|
362
|
-
var
|
|
363
|
-
|
|
364
|
-
var create_block_default = CreateBlockPage;
|
|
365
|
-
|
|
366
|
-
// src/client/page/edit-block.ts
|
|
367
|
-
var EditBlockPage = class extends page_default {
|
|
368
|
-
initEvents() {
|
|
369
|
-
super.initEvents();
|
|
370
|
-
const textarea_nodes = document.getElementsByTagName("textarea");
|
|
371
|
-
const textareas = Array.from(textarea_nodes);
|
|
372
|
-
textareas.forEach((textarea) => {
|
|
373
|
-
let form;
|
|
374
|
-
let current_node = textarea;
|
|
375
|
-
while (current_node) {
|
|
376
|
-
current_node = current_node.parentNode;
|
|
377
|
-
if (current_node instanceof HTMLFormElement) {
|
|
378
|
-
form = current_node;
|
|
379
|
-
break;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (form === void 0) {
|
|
383
|
-
throw new invariant_violation_default(`
|
|
384
|
-
Tried to read form for textarea, but it was not set
|
|
385
|
-
`);
|
|
386
|
-
}
|
|
387
|
-
textarea.addEventListener("keydown", (event) => {
|
|
388
|
-
const key_code = event.keyCode || event.charCode;
|
|
389
|
-
if (key_code === key_code_default.ENTER && event.shiftKey) {
|
|
390
|
-
event.preventDefault();
|
|
391
|
-
}
|
|
392
|
-
});
|
|
393
|
-
});
|
|
394
|
-
}
|
|
395
|
-
};
|
|
396
|
-
var edit_block_default = EditBlockPage;
|
|
1404
|
+
// src/client/page/cursor.ts
|
|
1405
|
+
var import_errors7 = __toESM(require_src2());
|
|
1406
|
+
var import_array2 = __toESM(require_src3());
|
|
397
1407
|
|
|
398
1408
|
// src/client/utility/get-meta-value.ts
|
|
1409
|
+
var import_errors5 = __toESM(require_src2());
|
|
399
1410
|
function getMetaValue(name) {
|
|
400
1411
|
const element = document.querySelector(`meta[name="${name}"]`);
|
|
401
1412
|
if (element === null) {
|
|
402
|
-
throw new
|
|
1413
|
+
throw new import_errors5.InvariantViolation(`
|
|
403
1414
|
Tried to read ${name} meta tag, but it was not set
|
|
404
1415
|
`);
|
|
405
1416
|
}
|
|
406
1417
|
if (!(element instanceof HTMLMetaElement)) {
|
|
407
|
-
throw new
|
|
1418
|
+
throw new import_errors5.InvariantViolation(`
|
|
408
1419
|
Got wrong element for ${name} meta tag: ${element.tagName}
|
|
409
1420
|
`);
|
|
410
1421
|
}
|
|
@@ -414,9 +1425,10 @@
|
|
|
414
1425
|
var get_meta_value_default = getMetaValue;
|
|
415
1426
|
|
|
416
1427
|
// src/server/utility/validate-path.ts
|
|
1428
|
+
var import_errors6 = __toESM(require_src2());
|
|
417
1429
|
function validatePath(path) {
|
|
418
1430
|
if (!path.startsWith("/")) {
|
|
419
|
-
throw new
|
|
1431
|
+
throw new import_errors6.InvalidError(`Invalid path: ${path}`);
|
|
420
1432
|
}
|
|
421
1433
|
}
|
|
422
1434
|
var validate_path_default = validatePath;
|
|
@@ -442,49 +1454,51 @@
|
|
|
442
1454
|
}
|
|
443
1455
|
var get_parent_path_default = getParentPath;
|
|
444
1456
|
|
|
445
|
-
// src/client/
|
|
1457
|
+
// src/client/enum/media-ready-state.ts
|
|
1458
|
+
var MediaReadyState = /* @__PURE__ */ ((MediaReadyState2) => {
|
|
1459
|
+
MediaReadyState2[MediaReadyState2["HAVE_NOTHING"] = 0] = "HAVE_NOTHING";
|
|
1460
|
+
MediaReadyState2[MediaReadyState2["HAVE_METADATA"] = 1] = "HAVE_METADATA";
|
|
1461
|
+
MediaReadyState2[MediaReadyState2["HAVE_CURRENT_DATA"] = 2] = "HAVE_CURRENT_DATA";
|
|
1462
|
+
MediaReadyState2[MediaReadyState2["HAVE_FUTURE_DATA"] = 3] = "HAVE_FUTURE_DATA";
|
|
1463
|
+
MediaReadyState2[MediaReadyState2["HAVE_ENOUGH_DATA"] = 4] = "HAVE_ENOUGH_DATA";
|
|
1464
|
+
return MediaReadyState2;
|
|
1465
|
+
})(MediaReadyState || {});
|
|
1466
|
+
var media_ready_state_default = MediaReadyState;
|
|
1467
|
+
|
|
1468
|
+
// src/client/page/cursor.ts
|
|
446
1469
|
function getAttributeForElement(element, attribute) {
|
|
447
1470
|
const value = element.getAttribute(attribute);
|
|
448
1471
|
if (value === null) {
|
|
449
|
-
throw new
|
|
1472
|
+
throw new import_errors7.InvariantViolation(`
|
|
450
1473
|
Tried to read ${attribute} for element, but it was not set
|
|
451
1474
|
`);
|
|
452
1475
|
}
|
|
453
1476
|
return value;
|
|
454
1477
|
}
|
|
455
|
-
function getBlockActivationHref(block_element) {
|
|
456
|
-
const link_nodes = block_element.getElementsByTagName("a");
|
|
457
|
-
const links = Array.from(link_nodes);
|
|
458
|
-
const matching_link = links.find((link) => {
|
|
459
|
-
const role = link.getAttribute("data-role");
|
|
460
|
-
return role === "block_activation";
|
|
461
|
-
});
|
|
462
|
-
if (matching_link === void 0) {
|
|
463
|
-
throw new invariant_violation_default(`
|
|
464
|
-
Tried to activate link for folder block, but it was not set
|
|
465
|
-
`);
|
|
466
|
-
}
|
|
467
|
-
const href = matching_link.getAttribute("href");
|
|
468
|
-
if (href === null) {
|
|
469
|
-
throw new invariant_violation_default(`
|
|
470
|
-
Tried to activate link for folder block, but its href was not set
|
|
471
|
-
`);
|
|
472
|
-
}
|
|
473
|
-
return href;
|
|
474
|
-
}
|
|
475
1478
|
function getIndexPathForElement(element) {
|
|
476
1479
|
return getAttributeForElement(element, "data-index-path");
|
|
477
1480
|
}
|
|
478
|
-
var
|
|
1481
|
+
var CursorPage = class extends page_default {
|
|
479
1482
|
constructor() {
|
|
480
|
-
super(
|
|
1483
|
+
super();
|
|
481
1484
|
this.logged_in = false;
|
|
1485
|
+
this.queued_media = null;
|
|
1486
|
+
this.ready_media = [];
|
|
482
1487
|
}
|
|
483
1488
|
initView() {
|
|
484
1489
|
this.focusCurrentBlockElement();
|
|
485
1490
|
const meta_value = get_meta_value_default("logged_in");
|
|
486
1491
|
this.logged_in = meta_value === "true";
|
|
487
1492
|
}
|
|
1493
|
+
initEvents() {
|
|
1494
|
+
super.initEvents();
|
|
1495
|
+
document.addEventListener("canplay", (event) => {
|
|
1496
|
+
this.handleMediaCanPlay(event);
|
|
1497
|
+
}, true);
|
|
1498
|
+
document.addEventListener("ended", (event) => {
|
|
1499
|
+
this.handleMediaPlaybackEnded(event);
|
|
1500
|
+
}, true);
|
|
1501
|
+
}
|
|
488
1502
|
focusCurrentBlockElement() {
|
|
489
1503
|
const element = this.getCurrentBlockElement();
|
|
490
1504
|
if (element === null) {
|
|
@@ -494,89 +1508,28 @@
|
|
|
494
1508
|
}
|
|
495
1509
|
handleKey(key_code) {
|
|
496
1510
|
switch (key_code) {
|
|
497
|
-
case key_code_default.ENTER:
|
|
498
|
-
case key_code_default.O:
|
|
499
|
-
return this.activateBlock();
|
|
500
|
-
case key_code_default.
|
|
501
|
-
return this.
|
|
502
|
-
case key_code_default.
|
|
503
|
-
return this.
|
|
504
|
-
case key_code_default.
|
|
505
|
-
return this.
|
|
506
|
-
case key_code_default.
|
|
507
|
-
return this.
|
|
508
|
-
case key_code_default.
|
|
509
|
-
return this.
|
|
510
|
-
case key_code_default.
|
|
511
|
-
return this.
|
|
512
|
-
case key_code_default.
|
|
513
|
-
return this.
|
|
514
|
-
|
|
515
|
-
return
|
|
516
|
-
case key_code_default.E:
|
|
517
|
-
return this.beginEditingBlock();
|
|
518
|
-
default:
|
|
519
|
-
return super.handleKey(key_code);
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
beginEditingBlock() {
|
|
523
|
-
if (!this.isLoggedIn()) {
|
|
524
|
-
return;
|
|
525
|
-
}
|
|
526
|
-
const block_element = this.getCurrentBlockElement();
|
|
527
|
-
if (block_element === null) {
|
|
528
|
-
return;
|
|
529
|
-
}
|
|
530
|
-
const block_id = block_element.id;
|
|
531
|
-
const link_id = `${block_id}-edit`;
|
|
532
|
-
const link_element = document.getElementById(link_id);
|
|
533
|
-
if (link_element === null) {
|
|
534
|
-
throw new invariant_violation_default(`
|
|
535
|
-
Unable to find edit link element for block: ${block_id}
|
|
536
|
-
`);
|
|
537
|
-
}
|
|
538
|
-
const href = link_element.getAttribute("href");
|
|
539
|
-
if (href === null) {
|
|
540
|
-
throw new invariant_violation_default(`
|
|
541
|
-
Unable to find edit link href for block: ${block_id}
|
|
542
|
-
`);
|
|
543
|
-
}
|
|
544
|
-
window.location.href = href;
|
|
545
|
-
}
|
|
546
|
-
addBlock() {
|
|
547
|
-
if (!this.isLoggedIn()) {
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
const current_path = this.getCurrentBlockIndex();
|
|
551
|
-
const top_level_index = parseInt(current_path, 10);
|
|
552
|
-
if (isNaN(top_level_index)) {
|
|
553
|
-
throw new invariant_violation_default(`Invalid index path: ${current_path}`);
|
|
554
|
-
}
|
|
555
|
-
const add_block_links = document.querySelectorAll('[data-role="add_block_link"]');
|
|
556
|
-
const link_index = (() => {
|
|
557
|
-
if (this.shiftIsPressed()) {
|
|
558
|
-
return top_level_index;
|
|
559
|
-
} else {
|
|
560
|
-
return top_level_index + 1;
|
|
561
|
-
}
|
|
562
|
-
})();
|
|
563
|
-
const link = add_block_links[link_index];
|
|
564
|
-
if (link === void 0) {
|
|
565
|
-
throw new invariant_violation_default(`
|
|
566
|
-
Tried to read link at index ${link_index},
|
|
567
|
-
but it was not found
|
|
568
|
-
`);
|
|
569
|
-
}
|
|
570
|
-
const href = link.getAttribute("href");
|
|
571
|
-
if (href === null) {
|
|
572
|
-
throw new invariant_violation_default(`
|
|
573
|
-
Tried to read href for link at index ${link_index},
|
|
574
|
-
but it was not set
|
|
575
|
-
`);
|
|
1511
|
+
case key_code_default.ENTER:
|
|
1512
|
+
case key_code_default.O:
|
|
1513
|
+
return this.activateBlock();
|
|
1514
|
+
case key_code_default.G:
|
|
1515
|
+
return this.performPageJump();
|
|
1516
|
+
case key_code_default.J:
|
|
1517
|
+
return this.selectNextBlock();
|
|
1518
|
+
case key_code_default.K:
|
|
1519
|
+
return this.selectPreviousBlock();
|
|
1520
|
+
case key_code_default.U:
|
|
1521
|
+
return this.navigateToParentPage();
|
|
1522
|
+
case key_code_default.D:
|
|
1523
|
+
return this.deleteCurrentBlock();
|
|
1524
|
+
case key_code_default.H:
|
|
1525
|
+
return this.navigateToHistory();
|
|
1526
|
+
case key_code_default.P:
|
|
1527
|
+
return this.addBlockToPlaylist();
|
|
1528
|
+
default:
|
|
1529
|
+
return super.handleKey(key_code);
|
|
576
1530
|
}
|
|
577
|
-
window.location.href = href;
|
|
578
1531
|
}
|
|
579
|
-
|
|
1532
|
+
addBlockToPlaylist() {
|
|
580
1533
|
if (!this.isLoggedIn()) {
|
|
581
1534
|
return;
|
|
582
1535
|
}
|
|
@@ -585,21 +1538,31 @@
|
|
|
585
1538
|
return;
|
|
586
1539
|
}
|
|
587
1540
|
const block_id = block_element.id;
|
|
588
|
-
const link_id = `${block_id}-
|
|
1541
|
+
const link_id = `${block_id}-add-to-playlist`;
|
|
589
1542
|
const link_element = document.getElementById(link_id);
|
|
590
1543
|
if (link_element === null) {
|
|
591
|
-
throw new
|
|
592
|
-
Unable to find
|
|
1544
|
+
throw new import_errors7.InvariantViolation(`
|
|
1545
|
+
Unable to find playlist link element for block: ${block_id}
|
|
593
1546
|
`);
|
|
594
1547
|
}
|
|
595
1548
|
const href = link_element.getAttribute("href");
|
|
596
1549
|
if (href === null) {
|
|
597
|
-
throw new
|
|
598
|
-
Unable to find
|
|
1550
|
+
throw new import_errors7.InvariantViolation(`
|
|
1551
|
+
Unable to find playlist link href for block: ${block_id}
|
|
599
1552
|
`);
|
|
600
1553
|
}
|
|
601
1554
|
window.location.href = href;
|
|
602
1555
|
}
|
|
1556
|
+
deleteCurrentBlock() {
|
|
1557
|
+
if (!this.isLoggedIn()) {
|
|
1558
|
+
return;
|
|
1559
|
+
}
|
|
1560
|
+
const block_element = this.getCurrentBlockElement();
|
|
1561
|
+
if (block_element === null) {
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
this.deleteBlockElement(block_element);
|
|
1565
|
+
}
|
|
603
1566
|
promoteCurrentBlock() {
|
|
604
1567
|
if (!this.isLoggedIn()) {
|
|
605
1568
|
return;
|
|
@@ -612,7 +1575,7 @@
|
|
|
612
1575
|
const form_id = `${block_id}-promote`;
|
|
613
1576
|
const form_element = document.getElementById(form_id);
|
|
614
1577
|
if (form_element === null) {
|
|
615
|
-
throw new
|
|
1578
|
+
throw new import_errors7.InvariantViolation(`
|
|
616
1579
|
Unable to find promotion form element for block: ${block_id}
|
|
617
1580
|
`);
|
|
618
1581
|
}
|
|
@@ -630,7 +1593,7 @@
|
|
|
630
1593
|
const form_id = `${block_id}-demote`;
|
|
631
1594
|
const form_element = document.getElementById(form_id);
|
|
632
1595
|
if (form_element === null) {
|
|
633
|
-
throw new
|
|
1596
|
+
throw new import_errors7.InvariantViolation(`
|
|
634
1597
|
Unable to find demotion form element for block: ${block_id}
|
|
635
1598
|
`);
|
|
636
1599
|
}
|
|
@@ -659,6 +1622,9 @@
|
|
|
659
1622
|
const parent_path = get_parent_path_default(window.location.pathname);
|
|
660
1623
|
window.location.href = parent_path;
|
|
661
1624
|
}
|
|
1625
|
+
navigateToHistory() {
|
|
1626
|
+
window.location.href = "/history";
|
|
1627
|
+
}
|
|
662
1628
|
navigateToIndex(index_path) {
|
|
663
1629
|
if (index_path === null) {
|
|
664
1630
|
return;
|
|
@@ -674,7 +1640,7 @@
|
|
|
674
1640
|
}
|
|
675
1641
|
});
|
|
676
1642
|
if (!found) {
|
|
677
|
-
throw new
|
|
1643
|
+
throw new import_errors7.InvariantViolation(`
|
|
678
1644
|
Tried to navigate to element at index path ${index_path},
|
|
679
1645
|
but matching element was not found
|
|
680
1646
|
`);
|
|
@@ -699,12 +1665,6 @@
|
|
|
699
1665
|
this.focusCurrentBlockElement();
|
|
700
1666
|
}
|
|
701
1667
|
}
|
|
702
|
-
toggleEditMode() {
|
|
703
|
-
const editing_flag = this.getQueryParameter("editing");
|
|
704
|
-
const editing = editing_flag === "true";
|
|
705
|
-
const new_value = editing ? "false" : "true";
|
|
706
|
-
this.setQueryParameter("editing", new_value);
|
|
707
|
-
}
|
|
708
1668
|
getCurrentBlockIndex() {
|
|
709
1669
|
const element = this.getCurrentBlockElement();
|
|
710
1670
|
if (element === null) {
|
|
@@ -746,7 +1706,7 @@
|
|
|
746
1706
|
}
|
|
747
1707
|
getFirstBlockIndex() {
|
|
748
1708
|
const blocks = this.getBlockElements();
|
|
749
|
-
const first_block =
|
|
1709
|
+
const first_block = (0, import_array2.getFirstValue)(blocks);
|
|
750
1710
|
if (first_block === void 0) {
|
|
751
1711
|
return null;
|
|
752
1712
|
}
|
|
@@ -754,7 +1714,7 @@
|
|
|
754
1714
|
}
|
|
755
1715
|
getLastBlockIndex() {
|
|
756
1716
|
const blocks = this.getBlockElements();
|
|
757
|
-
const last_block =
|
|
1717
|
+
const last_block = (0, import_array2.getLastValue)(blocks);
|
|
758
1718
|
if (last_block === void 0) {
|
|
759
1719
|
return null;
|
|
760
1720
|
}
|
|
@@ -787,14 +1747,14 @@
|
|
|
787
1747
|
}
|
|
788
1748
|
const attribute = block_element.getAttribute("data-block-type");
|
|
789
1749
|
if (attribute === null) {
|
|
790
|
-
throw new
|
|
1750
|
+
throw new import_errors7.InvariantViolation(`
|
|
791
1751
|
Tried to activate current block, but it did not have a block type
|
|
792
1752
|
`);
|
|
793
1753
|
}
|
|
794
1754
|
const block_type = attribute;
|
|
795
1755
|
const block_types = Object.values(block_type_default);
|
|
796
1756
|
if (!block_types.includes(block_type)) {
|
|
797
|
-
throw new
|
|
1757
|
+
throw new import_errors7.InvariantViolation(`
|
|
798
1758
|
Invalid block type: ${block_type}
|
|
799
1759
|
`);
|
|
800
1760
|
}
|
|
@@ -805,6 +1765,8 @@
|
|
|
805
1765
|
return this.activateTodoBlock(block_element);
|
|
806
1766
|
case block_type_default.IMAGE:
|
|
807
1767
|
return this.activateImageBlock(block_element);
|
|
1768
|
+
case block_type_default.AUDIO:
|
|
1769
|
+
return this.activateAudioBlock(block_element);
|
|
808
1770
|
default:
|
|
809
1771
|
return console.warn(`no-op activation for block of type ${block_type}`);
|
|
810
1772
|
}
|
|
@@ -813,26 +1775,320 @@
|
|
|
813
1775
|
const forms = block_element.getElementsByTagName("form");
|
|
814
1776
|
const form = forms[0];
|
|
815
1777
|
if (form === void 0) {
|
|
816
|
-
throw new
|
|
1778
|
+
throw new import_errors7.InvariantViolation(`
|
|
817
1779
|
Tried to activate form for todo block, but it was not set
|
|
818
1780
|
`);
|
|
819
1781
|
}
|
|
820
1782
|
form.submit();
|
|
821
1783
|
}
|
|
822
1784
|
activateFolderBlock(block_element) {
|
|
823
|
-
const href =
|
|
1785
|
+
const href = get_block_activation_href_default(block_element);
|
|
824
1786
|
window.location.href = href;
|
|
825
1787
|
}
|
|
826
1788
|
activateImageBlock(block_element) {
|
|
827
|
-
const href =
|
|
1789
|
+
const href = get_block_activation_href_default(block_element);
|
|
828
1790
|
window.location.href = href;
|
|
829
1791
|
}
|
|
830
|
-
|
|
1792
|
+
activateAudioBlock(block_element) {
|
|
1793
|
+
const audio_element = block_element.querySelectorAll("audio")[0];
|
|
1794
|
+
if (audio_element === void 0) {
|
|
1795
|
+
throw new import_errors7.InvariantViolation(`
|
|
1796
|
+
Tried to read audio element for block, but it was not present
|
|
1797
|
+
`);
|
|
1798
|
+
}
|
|
1799
|
+
this.enqueueMedia(audio_element);
|
|
1800
|
+
}
|
|
1801
|
+
enqueueMedia(element) {
|
|
1802
|
+
this.pauseActiveMedia();
|
|
1803
|
+
this.setQueuedMedia(element);
|
|
1804
|
+
}
|
|
1805
|
+
setQueuedMedia(element) {
|
|
1806
|
+
this.queued_media = element;
|
|
1807
|
+
if (element === null) {
|
|
1808
|
+
return;
|
|
1809
|
+
}
|
|
1810
|
+
const media_block = element.closest("section.block");
|
|
1811
|
+
if (media_block !== null) {
|
|
1812
|
+
const index_path = getIndexPathForElement(media_block);
|
|
1813
|
+
this.navigateToIndex(index_path);
|
|
1814
|
+
this.focusCurrentBlockElement();
|
|
1815
|
+
}
|
|
1816
|
+
if (element.readyState >= media_ready_state_default.HAVE_CURRENT_DATA) {
|
|
1817
|
+
element.currentTime = 0;
|
|
1818
|
+
element.play();
|
|
1819
|
+
return;
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
handleMediaCanPlay(event) {
|
|
1823
|
+
const target = event.target;
|
|
1824
|
+
if (!(target instanceof HTMLMediaElement)) {
|
|
1825
|
+
return;
|
|
1826
|
+
}
|
|
1827
|
+
const media_target = target;
|
|
1828
|
+
if (this.queued_media !== media_target) {
|
|
1829
|
+
return;
|
|
1830
|
+
}
|
|
1831
|
+
if (this.ready_media.includes(media_target)) {
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
this.ready_media.push(media_target);
|
|
1835
|
+
media_target.currentTime = 0;
|
|
1836
|
+
media_target.play();
|
|
1837
|
+
}
|
|
1838
|
+
handleMediaPlaybackEnded(event) {
|
|
1839
|
+
const target = event.target;
|
|
1840
|
+
if (!(target instanceof HTMLMediaElement)) {
|
|
1841
|
+
return;
|
|
1842
|
+
}
|
|
1843
|
+
const media_target = target;
|
|
1844
|
+
if (this.queued_media !== null && this.queued_media !== media_target) {
|
|
1845
|
+
return;
|
|
1846
|
+
}
|
|
1847
|
+
this.setQueuedMedia(null);
|
|
1848
|
+
media_target.currentTime = 0;
|
|
1849
|
+
const media_elements = document.querySelectorAll("audio,video");
|
|
1850
|
+
let index = 0;
|
|
1851
|
+
while (index < media_elements.length) {
|
|
1852
|
+
const element = media_elements[index++];
|
|
1853
|
+
if (element === media_target) {
|
|
1854
|
+
const next_element = media_elements[index];
|
|
1855
|
+
if (next_element) {
|
|
1856
|
+
return this.setQueuedMedia(next_element);
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
1861
|
+
pauseActiveMedia() {
|
|
1862
|
+
this.setQueuedMedia(null);
|
|
1863
|
+
const elements = document.querySelectorAll("audio,video");
|
|
1864
|
+
const media_elements = Array.from(elements);
|
|
1865
|
+
media_elements.forEach((media_element) => {
|
|
1866
|
+
if (media_element.paused || media_element.ended) {
|
|
1867
|
+
return;
|
|
1868
|
+
}
|
|
1869
|
+
if (media_element.readyState < media_ready_state_default.HAVE_CURRENT_DATA) {
|
|
1870
|
+
return;
|
|
1871
|
+
}
|
|
1872
|
+
media_element.pause();
|
|
1873
|
+
});
|
|
831
1874
|
}
|
|
832
1875
|
isLoggedIn() {
|
|
833
1876
|
return this.logged_in;
|
|
834
1877
|
}
|
|
835
1878
|
};
|
|
1879
|
+
var cursor_default = CursorPage;
|
|
1880
|
+
|
|
1881
|
+
// src/client/page/view-playlist.ts
|
|
1882
|
+
var ViewPlaylistPage = class extends cursor_default {
|
|
1883
|
+
deleteBlockElement(block_element) {
|
|
1884
|
+
if (!this.isLoggedIn()) {
|
|
1885
|
+
return;
|
|
1886
|
+
}
|
|
1887
|
+
alert("implement: playlist deletions");
|
|
1888
|
+
}
|
|
1889
|
+
};
|
|
1890
|
+
var view_playlist_default = ViewPlaylistPage;
|
|
1891
|
+
|
|
1892
|
+
// src/client/page/add-block-to-playlist.ts
|
|
1893
|
+
var AddBlockToPlaylistPage = class extends page_default {
|
|
1894
|
+
initEvents() {
|
|
1895
|
+
}
|
|
1896
|
+
};
|
|
1897
|
+
var add_block_to_playlist_default = AddBlockToPlaylistPage;
|
|
1898
|
+
|
|
1899
|
+
// src/client/page/select-block-destination.ts
|
|
1900
|
+
var SelectBlockDestinationPage = class extends page_default {
|
|
1901
|
+
initEvents() {
|
|
1902
|
+
}
|
|
1903
|
+
};
|
|
1904
|
+
var select_block_destination_default = SelectBlockDestinationPage;
|
|
1905
|
+
|
|
1906
|
+
// src/client/page/create-block.ts
|
|
1907
|
+
var CreateBlockPage = class extends page_default {
|
|
1908
|
+
};
|
|
1909
|
+
var create_block_default = CreateBlockPage;
|
|
1910
|
+
|
|
1911
|
+
// src/client/page/edit-block.ts
|
|
1912
|
+
var import_errors8 = __toESM(require_src2());
|
|
1913
|
+
var EditBlockPage = class extends page_default {
|
|
1914
|
+
initEvents() {
|
|
1915
|
+
super.initEvents();
|
|
1916
|
+
const textarea_nodes = document.getElementsByTagName("textarea");
|
|
1917
|
+
const textareas = Array.from(textarea_nodes);
|
|
1918
|
+
textareas.forEach((textarea) => {
|
|
1919
|
+
let form;
|
|
1920
|
+
let current_node = textarea;
|
|
1921
|
+
while (current_node) {
|
|
1922
|
+
current_node = current_node.parentNode;
|
|
1923
|
+
if (current_node instanceof HTMLFormElement) {
|
|
1924
|
+
form = current_node;
|
|
1925
|
+
break;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
1928
|
+
if (form === void 0) {
|
|
1929
|
+
throw new import_errors8.InvariantViolation(`
|
|
1930
|
+
Tried to read form for textarea, but it was not set
|
|
1931
|
+
`);
|
|
1932
|
+
}
|
|
1933
|
+
textarea.addEventListener("keydown", (event) => {
|
|
1934
|
+
const key_code = event.keyCode || event.charCode;
|
|
1935
|
+
if (key_code === key_code_default.ENTER && event.shiftKey) {
|
|
1936
|
+
event.preventDefault();
|
|
1937
|
+
}
|
|
1938
|
+
});
|
|
1939
|
+
});
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
var edit_block_default = EditBlockPage;
|
|
1943
|
+
|
|
1944
|
+
// src/client/page/view-custom.ts
|
|
1945
|
+
var import_errors9 = __toESM(require_src2());
|
|
1946
|
+
var ViewCustomPage = class extends cursor_default {
|
|
1947
|
+
handleKey(key_code) {
|
|
1948
|
+
switch (key_code) {
|
|
1949
|
+
case key_code_default.L:
|
|
1950
|
+
return this.toggleEditMode();
|
|
1951
|
+
case key_code_default.M:
|
|
1952
|
+
return this.moveCurrentBlock();
|
|
1953
|
+
case key_code_default.A:
|
|
1954
|
+
return this.addBlock();
|
|
1955
|
+
case key_code_default.E:
|
|
1956
|
+
return this.beginEditingBlock();
|
|
1957
|
+
case key_code_default.I:
|
|
1958
|
+
return this.hideCurrentBlock();
|
|
1959
|
+
default:
|
|
1960
|
+
return super.handleKey(key_code);
|
|
1961
|
+
}
|
|
1962
|
+
}
|
|
1963
|
+
beginEditingBlock() {
|
|
1964
|
+
if (!this.isLoggedIn()) {
|
|
1965
|
+
return;
|
|
1966
|
+
}
|
|
1967
|
+
const block_element = this.getCurrentBlockElement();
|
|
1968
|
+
if (block_element === null) {
|
|
1969
|
+
return;
|
|
1970
|
+
}
|
|
1971
|
+
const block_id = block_element.id;
|
|
1972
|
+
const link_id = `${block_id}-edit`;
|
|
1973
|
+
const link_element = document.getElementById(link_id);
|
|
1974
|
+
if (link_element === null) {
|
|
1975
|
+
throw new import_errors9.InvariantViolation(`
|
|
1976
|
+
Unable to find edit link element for block: ${block_id}
|
|
1977
|
+
`);
|
|
1978
|
+
}
|
|
1979
|
+
const href = link_element.getAttribute("href");
|
|
1980
|
+
if (href === null) {
|
|
1981
|
+
throw new import_errors9.InvariantViolation(`
|
|
1982
|
+
Unable to find edit link href for block: ${block_id}
|
|
1983
|
+
`);
|
|
1984
|
+
}
|
|
1985
|
+
window.location.href = href;
|
|
1986
|
+
}
|
|
1987
|
+
addBlock() {
|
|
1988
|
+
if (!this.isLoggedIn()) {
|
|
1989
|
+
return;
|
|
1990
|
+
}
|
|
1991
|
+
const current_path = this.getCurrentBlockIndex();
|
|
1992
|
+
const top_level_index = parseInt(current_path, 10);
|
|
1993
|
+
if (isNaN(top_level_index)) {
|
|
1994
|
+
throw new import_errors9.InvariantViolation(`Invalid index path: ${current_path}`);
|
|
1995
|
+
}
|
|
1996
|
+
const add_block_links = document.querySelectorAll('[data-role="add_block_link"]');
|
|
1997
|
+
const link_index = (() => {
|
|
1998
|
+
if (this.shiftIsPressed()) {
|
|
1999
|
+
return top_level_index;
|
|
2000
|
+
} else {
|
|
2001
|
+
return top_level_index + 1;
|
|
2002
|
+
}
|
|
2003
|
+
})();
|
|
2004
|
+
const link = add_block_links[link_index];
|
|
2005
|
+
if (link === void 0) {
|
|
2006
|
+
throw new import_errors9.InvariantViolation(`
|
|
2007
|
+
Tried to read link at index ${link_index},
|
|
2008
|
+
but it was not found
|
|
2009
|
+
`);
|
|
2010
|
+
}
|
|
2011
|
+
const href = link.getAttribute("href");
|
|
2012
|
+
if (href === null) {
|
|
2013
|
+
throw new import_errors9.InvariantViolation(`
|
|
2014
|
+
Tried to read href for link at index ${link_index},
|
|
2015
|
+
but it was not set
|
|
2016
|
+
`);
|
|
2017
|
+
}
|
|
2018
|
+
window.location.href = href;
|
|
2019
|
+
}
|
|
2020
|
+
moveCurrentBlock() {
|
|
2021
|
+
if (!this.isLoggedIn()) {
|
|
2022
|
+
return;
|
|
2023
|
+
}
|
|
2024
|
+
const block_element = this.getCurrentBlockElement();
|
|
2025
|
+
if (block_element === null) {
|
|
2026
|
+
return;
|
|
2027
|
+
}
|
|
2028
|
+
const block_id = block_element.id;
|
|
2029
|
+
const link_id = `${block_id}-move`;
|
|
2030
|
+
const link_element = document.getElementById(link_id);
|
|
2031
|
+
if (link_element === null) {
|
|
2032
|
+
throw new import_errors9.InvariantViolation(`
|
|
2033
|
+
Unable to find move link element for block: ${block_id}
|
|
2034
|
+
`);
|
|
2035
|
+
}
|
|
2036
|
+
const href = link_element.getAttribute("href");
|
|
2037
|
+
if (href === null) {
|
|
2038
|
+
throw new import_errors9.InvariantViolation(`
|
|
2039
|
+
Unable to find move link href for block: ${block_id}
|
|
2040
|
+
`);
|
|
2041
|
+
}
|
|
2042
|
+
window.location.href = href;
|
|
2043
|
+
}
|
|
2044
|
+
hideCurrentBlock() {
|
|
2045
|
+
if (!this.isLoggedIn()) {
|
|
2046
|
+
return;
|
|
2047
|
+
}
|
|
2048
|
+
const block_element = this.getCurrentBlockElement();
|
|
2049
|
+
if (block_element === null) {
|
|
2050
|
+
return;
|
|
2051
|
+
}
|
|
2052
|
+
const block_id = block_element.id;
|
|
2053
|
+
const link_id = `${block_id}-hide`;
|
|
2054
|
+
const link_element = document.getElementById(link_id);
|
|
2055
|
+
if (link_element === null) {
|
|
2056
|
+
throw new import_errors9.InvariantViolation(`
|
|
2057
|
+
Unable to find hide link element for block: ${block_id}
|
|
2058
|
+
`);
|
|
2059
|
+
}
|
|
2060
|
+
const href = link_element.getAttribute("href");
|
|
2061
|
+
if (href === null) {
|
|
2062
|
+
throw new import_errors9.InvariantViolation(`
|
|
2063
|
+
Unable to find hide link href for block: ${block_id}
|
|
2064
|
+
`);
|
|
2065
|
+
}
|
|
2066
|
+
window.location.href = href;
|
|
2067
|
+
}
|
|
2068
|
+
deleteBlockElement(block_element) {
|
|
2069
|
+
const block_id = block_element.id;
|
|
2070
|
+
const link_id = `${block_id}-delete`;
|
|
2071
|
+
const link_element = document.getElementById(link_id);
|
|
2072
|
+
if (link_element === null) {
|
|
2073
|
+
throw new import_errors9.InvariantViolation(`
|
|
2074
|
+
Unable to find deletion link element for block: ${block_id}
|
|
2075
|
+
`);
|
|
2076
|
+
}
|
|
2077
|
+
const href = link_element.getAttribute("href");
|
|
2078
|
+
if (href === null) {
|
|
2079
|
+
throw new import_errors9.InvariantViolation(`
|
|
2080
|
+
Unable to find deletion link href for block: ${block_id}
|
|
2081
|
+
`);
|
|
2082
|
+
}
|
|
2083
|
+
window.location.href = href;
|
|
2084
|
+
}
|
|
2085
|
+
toggleEditMode() {
|
|
2086
|
+
const editing_flag = this.getQueryParameter("editing");
|
|
2087
|
+
const editing = editing_flag === "true";
|
|
2088
|
+
const new_value = editing ? "false" : "true";
|
|
2089
|
+
this.setQueryParameter("editing", new_value);
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
836
2092
|
var view_custom_default = ViewCustomPage;
|
|
837
2093
|
|
|
838
2094
|
// src/client/page/edit-custom.ts
|
|
@@ -849,6 +2105,7 @@
|
|
|
849
2105
|
var edit_custom_default = EditCustomPage;
|
|
850
2106
|
|
|
851
2107
|
// src/client/page/confirm-delete-block.ts
|
|
2108
|
+
var import_errors10 = __toESM(require_src2());
|
|
852
2109
|
var ConfirmDeleteBlockPage = class extends page_default {
|
|
853
2110
|
handleKey(key_code) {
|
|
854
2111
|
switch (key_code) {
|
|
@@ -861,7 +2118,7 @@
|
|
|
861
2118
|
submitDeletionForm() {
|
|
862
2119
|
const element = document.getElementById("deletion-form");
|
|
863
2120
|
if (element === null) {
|
|
864
|
-
throw new
|
|
2121
|
+
throw new import_errors10.InvariantViolation("Could not find deletion form element");
|
|
865
2122
|
}
|
|
866
2123
|
const form = element;
|
|
867
2124
|
form.submit();
|
|
@@ -869,6 +2126,28 @@
|
|
|
869
2126
|
};
|
|
870
2127
|
var confirm_delete_block_default = ConfirmDeleteBlockPage;
|
|
871
2128
|
|
|
2129
|
+
// src/client/page/confirm-hide-block.ts
|
|
2130
|
+
var import_errors11 = __toESM(require_src2());
|
|
2131
|
+
var ConfirmHideBlockPage = class extends page_default {
|
|
2132
|
+
handleKey(key_code) {
|
|
2133
|
+
switch (key_code) {
|
|
2134
|
+
case key_code_default.I:
|
|
2135
|
+
return this.submitHideForm();
|
|
2136
|
+
default:
|
|
2137
|
+
return super.handleKey(key_code);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
submitHideForm() {
|
|
2141
|
+
const element = document.getElementById("hide-form");
|
|
2142
|
+
if (element === null) {
|
|
2143
|
+
throw new import_errors11.InvariantViolation("Could not find hide form element");
|
|
2144
|
+
}
|
|
2145
|
+
const form = element;
|
|
2146
|
+
form.submit();
|
|
2147
|
+
}
|
|
2148
|
+
};
|
|
2149
|
+
var confirm_hide_block_default = ConfirmHideBlockPage;
|
|
2150
|
+
|
|
872
2151
|
// src/client/page/move-block.ts
|
|
873
2152
|
var MoveBlockPage = class extends page_default {
|
|
874
2153
|
initEvents() {
|
|
@@ -886,6 +2165,7 @@
|
|
|
886
2165
|
// src/client/factory/page.ts
|
|
887
2166
|
var PageConstructors = {
|
|
888
2167
|
[page_type_default.HOME]: home_default,
|
|
2168
|
+
[page_type_default.HISTORY]: history_default,
|
|
889
2169
|
[page_type_default.LOGIN]: login_default,
|
|
890
2170
|
[page_type_default.LOGOUT]: logout_default,
|
|
891
2171
|
[page_type_default.DAY]: day_default,
|
|
@@ -893,14 +2173,18 @@
|
|
|
893
2173
|
[page_type_default.MONTH]: month_default,
|
|
894
2174
|
[page_type_default.YEAR]: year_default,
|
|
895
2175
|
[page_type_default.SELECT_BLOCK_TYPE]: select_block_type_default,
|
|
2176
|
+
[page_type_default.SELECT_BLOCK_DESTINATION]: select_block_destination_default,
|
|
896
2177
|
[page_type_default.CREATE_BLOCK]: create_block_default,
|
|
897
2178
|
[page_type_default.EDIT_BLOCK]: edit_block_default,
|
|
898
2179
|
[page_type_default.VIEW_CUSTOM]: view_custom_default,
|
|
899
2180
|
[page_type_default.EDIT_CUSTOM]: edit_custom_default,
|
|
900
2181
|
[page_type_default.CONFIRM_DELETE_BLOCK]: confirm_delete_block_default,
|
|
2182
|
+
[page_type_default.CONFIRM_HIDE_BLOCK]: confirm_hide_block_default,
|
|
901
2183
|
[page_type_default.MOVE_BLOCK]: move_block_default,
|
|
902
2184
|
[page_type_default.SETTINGS]: settings_default,
|
|
903
|
-
[page_type_default.ROLE]: role_default
|
|
2185
|
+
[page_type_default.ROLE]: role_default,
|
|
2186
|
+
[page_type_default.ADD_BLOCK_TO_PLAYLIST]: add_block_to_playlist_default,
|
|
2187
|
+
[page_type_default.VIEW_PLAYLIST]: view_playlist_default
|
|
904
2188
|
};
|
|
905
2189
|
var PageFactory = class {
|
|
906
2190
|
constructor(page_type) {
|
|
@@ -949,7 +2233,7 @@
|
|
|
949
2233
|
const page_type = meta_value;
|
|
950
2234
|
const page_types = Object.values(page_type_default);
|
|
951
2235
|
if (!page_types.includes(page_type)) {
|
|
952
|
-
throw new
|
|
2236
|
+
throw new import_errors12.InvariantViolation(`
|
|
953
2237
|
Invalid page type: ${page_type}
|
|
954
2238
|
`);
|
|
955
2239
|
}
|