@localazy/strapi-plugin 0.2.13 → 1.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/_chunks/App-BSFfgZKU.mjs +5278 -0
- package/dist/_chunks/App-D1QaIMHX.js +5278 -0
- package/dist/_chunks/ContentTransferSetup-DHXJIxAp.js +1552 -0
- package/dist/_chunks/ContentTransferSetup-DtjcF_jM.mjs +1550 -0
- package/dist/_chunks/GlobalSettings-BON3kjHK.js +228 -0
- package/dist/_chunks/GlobalSettings-BcdibqNS.mjs +228 -0
- package/dist/_chunks/LanguagesSelector-BeijBEjg.js +47 -0
- package/dist/_chunks/LanguagesSelector-fyAIUp7M.mjs +48 -0
- package/dist/_chunks/en-BTf8goGM.mjs +8 -0
- package/dist/_chunks/en-CRtsEFtl.js +8 -0
- package/dist/_chunks/fr-C8Qw4iPZ.js +4 -0
- package/dist/_chunks/fr-hkSxFuzl.mjs +4 -0
- package/dist/_chunks/has-model-changed-BMCQX2Dd.js +316 -0
- package/dist/_chunks/has-model-changed-Dvtzpc9v.mjs +317 -0
- package/dist/_chunks/index-BQw2qi2G.js +2679 -0
- package/dist/_chunks/index-CN3Gyh5F.mjs +2678 -0
- package/dist/_chunks/isEqual-B-YVnzrp.js +205 -0
- package/dist/_chunks/isEqual-CEyT97-3.mjs +206 -0
- package/dist/_chunks/set-DUdH3vE5.js +54557 -0
- package/dist/_chunks/set-DulHAQhq.mjs +54542 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +5 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/config/development/index.d.ts +15 -0
- package/dist/admin/src/config/example/index.example.d.ts +15 -0
- package/dist/admin/src/config/index.d.ts +15 -0
- package/dist/admin/src/config/local/index.d.ts +15 -0
- package/dist/admin/src/config/production/index.d.ts +15 -0
- package/dist/admin/src/i18n.d.ts +2 -0
- package/dist/admin/src/index.d.ts +10 -0
- package/dist/admin/src/modules/@common/api/strapi-api-base.d.ts +6 -0
- package/dist/admin/src/modules/@common/components/Icons/House.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/Icons/Localazy.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/LanguagesSelector.d.ts +11 -0
- package/dist/admin/src/modules/@common/components/PluginPageLoader.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/SideNav.d.ts +2 -0
- package/dist/admin/src/modules/@common/components/TransferReport.d.ts +5 -0
- package/dist/admin/src/modules/@common/functions/flatten-deep.d.ts +2 -0
- package/dist/admin/src/modules/@common/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/@common/models/supported-content-type-fields.d.ts +2 -0
- package/dist/admin/src/modules/@common/models/supported-custom-field-plugins.d.ts +2 -0
- package/dist/admin/src/modules/@common/services/i18n-service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/plugin.service.d.ts +3 -0
- package/dist/admin/src/modules/@common/services/product-analytics-service.d.ts +14 -0
- package/dist/admin/src/modules/@common/services/project-service.d.ts +4 -0
- package/dist/admin/src/modules/@common/services/user-service.d.ts +5 -0
- package/dist/admin/src/modules/@common/utils/are-locales-compatible.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/format-number.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/get-default-locale.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/history.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/is-plugin-route.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/iso-locales-utils.d.ts +3 -0
- package/dist/admin/src/modules/@common/utils/redirect-to-plugin-route.d.ts +13 -0
- package/dist/admin/src/modules/@common/utils/sort-by-model-name.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-subtitle.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-header-title.d.ts +2 -0
- package/dist/admin/src/modules/@common/utils/use-nav.d.ts +11 -0
- package/dist/admin/src/modules/alerts/constants/channels.d.ts +1 -0
- package/dist/admin/src/modules/alerts/constants/events.d.ts +4 -0
- package/dist/admin/src/modules/alerts/services/alerts-service.d.ts +8 -0
- package/dist/admin/src/modules/localazy-download/locale/en.d.ts +24 -0
- package/dist/admin/src/modules/localazy-download/services/download-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/localazy-download/services/localazy-download-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/components/ReadDocsButton.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/locale/en.d.ts +19 -0
- package/dist/admin/src/modules/localazy-upload/services/localazy-upload-service.d.ts +3 -0
- package/dist/admin/src/modules/localazy-upload/services/upload-alerts-service.d.ts +5 -0
- package/dist/admin/src/modules/login/components/FetchIdentity.d.ts +3 -0
- package/dist/admin/src/modules/login/components/LoginButton.d.ts +12 -0
- package/dist/admin/src/modules/login/components/LogoutButton.d.ts +6 -0
- package/dist/admin/src/modules/login/locale/en.d.ts +8 -0
- package/dist/admin/src/modules/login/services/localazy-login-service.d.ts +4 -0
- package/dist/admin/src/modules/overview/components/OverviewItem.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/OverviewItemLink.d.ts +7 -0
- package/dist/admin/src/modules/overview/components/PrerequisitiesInfo.d.ts +3 -0
- package/dist/admin/src/modules/overview/locale/en.d.ts +14 -0
- package/dist/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/components/Tree.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/components/TreeItem.d.ts +10 -0
- package/dist/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.d.ts +8 -0
- package/dist/admin/src/modules/plugin-settings/functions/has-model-changed.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +49 -0
- package/dist/admin/src/modules/plugin-settings/services/plugin-settings-service.d.ts +6 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-model-service.d.ts +4 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-users-service.d.ts +3 -0
- package/dist/admin/src/modules/plugin-settings/utils/array-of-models-to-object.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/find-model-value-by-key.d.ts +2 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.d.ts +7 -0
- package/dist/admin/src/modules/plugin-settings/utils/get-models-tree.d.ts +5 -0
- package/dist/admin/src/modules/strapi/utils/get-default-theme.d.ts +3 -0
- package/dist/admin/src/modules/user/model/localazy-identity.d.ts +15 -0
- package/dist/admin/src/modules/user/services/localazy-user-service.d.ts +6 -0
- package/dist/admin/src/pages/App.d.ts +3 -0
- package/dist/admin/src/pages/ContentTransferSetup.d.ts +4 -0
- package/dist/admin/src/pages/Download.d.ts +7 -0
- package/dist/admin/src/pages/GlobalSettings.d.ts +4 -0
- package/dist/admin/src/pages/HomePage.d.ts +2 -0
- package/dist/admin/src/pages/Login.d.ts +8 -0
- package/dist/admin/src/pages/Overview.d.ts +8 -0
- package/dist/admin/src/pages/Upload.d.ts +7 -0
- package/dist/admin/src/pluginId.d.ts +2 -0
- package/dist/admin/src/plugins/generic-connector-client.d.ts +3 -0
- package/dist/admin/src/state/localazy-identity.d.ts +13 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/server/index.js +26000 -0
- package/dist/server/index.mjs +25989 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/core/config.d.ts +1 -0
- package/dist/server/src/config/development/index.d.ts +15 -0
- package/dist/server/src/config/example/index.example.d.ts +15 -0
- package/dist/server/src/config/index.d.ts +18 -0
- package/dist/server/src/config/local/index.d.ts +15 -0
- package/dist/server/src/config/production/index.d.ts +15 -0
- package/dist/server/src/constants/channels.d.ts +3 -0
- package/dist/server/src/constants/events.d.ts +6 -0
- package/dist/server/src/content-types/index.d.ts +2 -0
- package/dist/server/src/controllers/index.d.ts +43 -0
- package/dist/server/src/controllers/localazy-auth-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-project-controller.d.ts +7 -0
- package/dist/server/src/controllers/localazy-transfer-controller.d.ts +8 -0
- package/dist/server/src/controllers/localazy-user-controller.d.ts +9 -0
- package/dist/server/src/controllers/plugin-settings-controller.d.ts +10 -0
- package/dist/server/src/controllers/strapi-controller.d.ts +10 -0
- package/dist/server/src/core/index.d.ts +71 -0
- package/dist/server/src/db/model/content-transfer-setup.d.ts +4 -0
- package/dist/server/src/db/model/localazy-user.d.ts +17 -0
- package/dist/server/src/db/model/plugin-settings.d.ts +5 -0
- package/dist/server/src/db/model/utils/get-strapi-store.d.ts +26 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/functions/should-set-downloaded-property.d.ts +12 -0
- package/dist/server/src/index.d.ts +189 -0
- package/dist/server/src/lifecycles/deep-populate-hook.d.ts +20 -0
- package/dist/server/src/lifecycles/deprecate-event-entry-in-localazy-hook.d.ts +4 -0
- package/dist/server/src/lifecycles/upload-event-entry-to-localazy-hook.d.ts +12 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/models/plugin/content-transfer-setup.d.ts +13 -0
- package/dist/server/src/models/strapi/locale.d.ts +8 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +25 -0
- package/dist/server/src/routes/localazy-auth-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-project-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-transfer-routes.d.ts +9 -0
- package/dist/server/src/routes/localazy-user-routes.d.ts +9 -0
- package/dist/server/src/routes/plugin-settings-routes.d.ts +9 -0
- package/dist/server/src/routes/strapi-routes.d.ts +9 -0
- package/dist/server/src/services/helpers/job-notification-service.d.ts +14 -0
- package/dist/server/src/services/helpers/plugin-settings-service-helper.d.ts +16 -0
- package/dist/server/src/services/index.d.ts +92 -0
- package/dist/server/src/services/localazy-pubapi-service.d.ts +12 -0
- package/dist/server/src/services/localazy-transfer-download-service.d.ts +11 -0
- package/dist/server/src/services/localazy-transfer-upload-service.d.ts +11 -0
- package/dist/server/src/services/localazy-upload-service.d.ts +28 -0
- package/dist/server/src/services/localazy-user-service.d.ts +11 -0
- package/dist/server/src/services/plugin-settings-service.d.ts +16 -0
- package/dist/server/src/services/strapi-i18n-service.d.ts +19 -0
- package/dist/server/src/services/strapi-localazy-i18n-service.d.ts +9 -0
- package/dist/server/src/services/strapi-service.d.ts +10 -0
- package/dist/server/src/utils/delay.d.ts +1 -0
- package/dist/server/src/utils/drop-property-deep.d.ts +1 -0
- package/dist/server/src/utils/flatten-object.d.ts +2 -0
- package/dist/server/src/utils/generate-random-id.d.ts +2 -0
- package/dist/server/src/utils/get-full-populate-localazy-download-object.d.ts +17 -0
- package/dist/server/src/utils/get-full-populate-localazy-upload-object.d.ts +9 -0
- package/dist/server/src/utils/get-full-populate-object.d.ts +17 -0
- package/dist/server/src/utils/get-main-keys-of-nested-array-objects.d.ts +2 -0
- package/dist/server/src/utils/get-picked-flatten-keys-for-hook-entry.d.ts +5 -0
- package/dist/server/src/utils/intl-display-name.d.ts +1 -0
- package/dist/server/src/utils/is-generally-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/is-localazy-applicable-content-type.d.ts +2 -0
- package/dist/server/src/utils/iso-locales-utils.d.ts +3 -0
- package/dist/server/src/utils/localazy-api-client-factory.d.ts +3 -0
- package/dist/server/src/utils/localazy-generic-connector-client-factory.d.ts +3 -0
- package/dist/server/src/utils/model-utils.d.ts +7 -0
- package/dist/server/src/utils/omit-deep.d.ts +2 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-create-entry.d.ts +7 -0
- package/dist/server/src/utils/parsed-localazy-entry-to-update-entry.d.ts +1 -0
- package/dist/server/src/utils/pick-entries.d.ts +2 -0
- package/dist/server/src/utils/populate-create-update-entry-with-base-entry.d.ts +1 -0
- package/dist/server/src/utils/request-initiator-helper.d.ts +9 -0
- package/dist/server/src/utils/reset-array-keys-deep.d.ts +1 -0
- package/dist/server/src/utils/transfer-setup-utils.d.ts +7 -0
- package/install/index.mjs +88 -34
- package/install/vite.config.example.js +40 -0
- package/install/vite.config.example.ts +41 -0
- package/install/{webpack.example.js → webpack.config.example.js} +2 -2
- package/install/webpack.config.example.ts +30 -0
- package/package.json +93 -55
- package/.babelrc +0 -7
- package/.eslintrc +0 -13
- package/.github/workflows/qa.yml +0 -25
- package/.github/workflows/release.yml +0 -46
- package/.nvmrc +0 -1
- package/.strapi-updater.json +0 -4
- package/CHANGELOG.md +0 -68
- package/LICENSE +0 -21
- package/admin/src/components/Initializer/index.js +0 -26
- package/admin/src/components/PluginIcon/index.js +0 -14
- package/admin/src/config/development/index.js +0 -14
- package/admin/src/config/example/index.js +0 -14
- package/admin/src/config/index.js +0 -19
- package/admin/src/config/local/index.js +0 -14
- package/admin/src/config/production/index.js +0 -15
- package/admin/src/i18n.js +0 -41
- package/admin/src/index.js +0 -138
- package/admin/src/modules/@common/components/Icons/Localazy/index.js +0 -12
- package/admin/src/modules/@common/components/LanguagesSelector/index.js +0 -67
- package/admin/src/modules/@common/components/PluginPageLoader/index.js +0 -20
- package/admin/src/modules/@common/components/SideNav/index.js +0 -46
- package/admin/src/modules/@common/components/TransferReport/index.js +0 -53
- package/admin/src/modules/@common/locale/en.js +0 -14
- package/admin/src/modules/@common/models/supported-content-type-fields.js +0 -9
- package/admin/src/modules/@common/models/supported-custom-field-plugins.js +0 -6
- package/admin/src/modules/@common/services/i18n-service.js +0 -15
- package/admin/src/modules/@common/services/plugin.service.js +0 -16
- package/admin/src/modules/@common/services/product-analytics-service.js +0 -86
- package/admin/src/modules/@common/services/project-service.js +0 -15
- package/admin/src/modules/@common/services/user-service.js +0 -38
- package/admin/src/modules/@common/utils/__tests__/iso-locales-utils.test.js +0 -102
- package/admin/src/modules/@common/utils/are-locales-compatible.js +0 -42
- package/admin/src/modules/@common/utils/format-number.js +0 -1
- package/admin/src/modules/@common/utils/functions/flatten-deep.js +0 -23
- package/admin/src/modules/@common/utils/get-default-locale.js +0 -32
- package/admin/src/modules/@common/utils/get-header-subtitle.js +0 -21
- package/admin/src/modules/@common/utils/get-header-title.js +0 -24
- package/admin/src/modules/@common/utils/get-nav.js +0 -35
- package/admin/src/modules/@common/utils/history.js +0 -6
- package/admin/src/modules/@common/utils/is-plugin-route.js +0 -15
- package/admin/src/modules/@common/utils/iso-locales-utils.js +0 -58
- package/admin/src/modules/@common/utils/redirect-to-plugin-route.js +0 -22
- package/admin/src/modules/@common/utils/sort-by-model-name.js +0 -10
- package/admin/src/modules/alerts/constants/channels.js +0 -1
- package/admin/src/modules/alerts/constants/events.js +0 -4
- package/admin/src/modules/alerts/services/alerts-service.js +0 -41
- package/admin/src/modules/localazy-download/locale/en.js +0 -25
- package/admin/src/modules/localazy-download/services/download-alerts-service.js +0 -12
- package/admin/src/modules/localazy-download/services/localazy-download-service.js +0 -16
- package/admin/src/modules/localazy-upload/components/ReadDocsButton.js +0 -20
- package/admin/src/modules/localazy-upload/locale/en.js +0 -20
- package/admin/src/modules/localazy-upload/services/localazy-upload-service.js +0 -16
- package/admin/src/modules/localazy-upload/services/upload-alerts-service.js +0 -12
- package/admin/src/modules/login/components/LoginButton/index.js +0 -55
- package/admin/src/modules/login/components/LogoutButton/index.js +0 -49
- package/admin/src/modules/login/locale/en.js +0 -7
- package/admin/src/modules/login/services/localazy-login-service.js +0 -29
- package/admin/src/modules/plugin-settings/components/ContentTransferSetup/index.js +0 -308
- package/admin/src/modules/plugin-settings/components/ContentTransferSetupEmpty/index.js +0 -86
- package/admin/src/modules/plugin-settings/components/GlobalSettings/index.js +0 -269
- package/admin/src/modules/plugin-settings/components/Tree/index.js +0 -145
- package/admin/src/modules/plugin-settings/components/TreeItem/index.js +0 -48
- package/admin/src/modules/plugin-settings/functions/build-content-transfer-setup-schema.js +0 -57
- package/admin/src/modules/plugin-settings/functions/get-content-transfer-setup-keys-sets.js +0 -85
- package/admin/src/modules/plugin-settings/functions/has-model-changed.js +0 -75
- package/admin/src/modules/plugin-settings/locale/en.js +0 -61
- package/admin/src/modules/plugin-settings/services/plugin-settings-service.js +0 -55
- package/admin/src/modules/plugin-settings/services/strapi-model-service.js +0 -26
- package/admin/src/modules/plugin-settings/services/strapi-users-service.js +0 -26
- package/admin/src/modules/plugin-settings/utils/__tests__/get-models-tree.test.js +0 -135
- package/admin/src/modules/plugin-settings/utils/array-of-models-to-object.js +0 -6
- package/admin/src/modules/plugin-settings/utils/find-model-value-by-key.js +0 -8
- package/admin/src/modules/plugin-settings/utils/get-filtered-models-schemas.js +0 -31
- package/admin/src/modules/plugin-settings/utils/get-models-tree.js +0 -94
- package/admin/src/modules/settings/components/OverviewItem/index.js +0 -44
- package/admin/src/modules/settings/components/OverviewItemLink/index.js +0 -34
- package/admin/src/modules/settings/components/PrerequisitiesInfo/index.js +0 -28
- package/admin/src/modules/settings/locale/en.js +0 -13
- package/admin/src/modules/user/model/localazy-identity.js +0 -14
- package/admin/src/modules/user/services/localazy-user-service.js +0 -38
- package/admin/src/pages/App/index.js +0 -154
- package/admin/src/pages/Download/index.js +0 -280
- package/admin/src/pages/Index/index.js +0 -8
- package/admin/src/pages/Login/index.js +0 -109
- package/admin/src/pages/PluginSettings/index.js +0 -56
- package/admin/src/pages/Settings/index.js +0 -132
- package/admin/src/pages/Upload/index.js +0 -241
- package/admin/src/pluginId.js +0 -5
- package/admin/src/plugins/generic-connector-client.js +0 -9
- package/admin/src/state/localazy-identity.js +0 -29
- package/admin/src/tests/fixtures/all-models.js +0 -877
- package/admin/src/tests/fixtures/restaurant-model.js +0 -230
- package/admin/src/translations/en.json +0 -4
- package/admin/src/translations/fr.json +0 -1
- package/admin/src/utils/createAxiosInstance.js +0 -54
- package/admin/src/utils/getTrad.js +0 -5
- package/jest.config.js +0 -0
- package/server/bootstrap.js +0 -63
- package/server/config/development/index.js +0 -16
- package/server/config/example/index.js +0 -16
- package/server/config/index.js +0 -20
- package/server/config/local/index.js +0 -16
- package/server/config/production/index.js +0 -17
- package/server/config/schema.graphql.js +0 -21
- package/server/constants/channels.js +0 -3
- package/server/constants/events.js +0 -6
- package/server/content-types/index.js +0 -3
- package/server/controllers/index.js +0 -17
- package/server/controllers/localazy-auth-controller.js +0 -22
- package/server/controllers/localazy-project-controller.js +0 -21
- package/server/controllers/localazy-transfer-controller.js +0 -62
- package/server/controllers/localazy-user-controller.js +0 -24
- package/server/controllers/plugin-settings-controller.js +0 -31
- package/server/controllers/strapi-controller.js +0 -27
- package/server/db/model/content-transfer-setup.js +0 -13
- package/server/db/model/localazy-user.js +0 -23
- package/server/db/model/plugin-settings.js +0 -13
- package/server/db/model/utils/get-strapi-store.js +0 -9
- package/server/destroy.js +0 -5
- package/server/functions/should-set-downloaded-property.js +0 -94
- package/server/index.js +0 -25
- package/server/lifecycles/deep-populate-hook.js +0 -12
- package/server/lifecycles/deprecate-event-entry-in-localazy-hook.js +0 -73
- package/server/lifecycles/upload-event-entry-to-localazy-hook.js +0 -36
- package/server/middlewares/index.js +0 -7
- package/server/middlewares/verify-webhook.js +0 -76
- package/server/models/supported-content-type-fields.js +0 -9
- package/server/models/supported-custom-field-plugins.js +0 -6
- package/server/policies/index.js +0 -3
- package/server/register.js +0 -5
- package/server/routes/index.js +0 -28
- package/server/routes/localazy-auth.js +0 -22
- package/server/routes/localazy-project.js +0 -14
- package/server/routes/localazy-public-transfer.js +0 -20
- package/server/routes/localazy-transfer.js +0 -22
- package/server/routes/localazy-user.js +0 -30
- package/server/routes/plugin-settings.js +0 -38
- package/server/routes/strapi.js +0 -38
- package/server/services/helpers/job-notification-service.js +0 -30
- package/server/services/helpers/plugin-settings-service-helper.js +0 -52
- package/server/services/index.js +0 -23
- package/server/services/localazy-pubapi-service.js +0 -53
- package/server/services/localazy-transfer-download-service.js +0 -445
- package/server/services/localazy-transfer-upload-service.js +0 -178
- package/server/services/localazy-upload-service.js +0 -52
- package/server/services/localazy-user-service.js +0 -29
- package/server/services/plugin-settings-service.js +0 -53
- package/server/services/strapi-i18n-service.js +0 -151
- package/server/services/strapi-localazy-i18n-service.js +0 -130
- package/server/services/strapi-service.js +0 -26
- package/server/tests/fixtures/all-models.js +0 -869
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-cookbook.js +0 -5761
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-lesson-dz.js +0 -402
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-page-dz.js +0 -658
- package/server/tests/fixtures/parsed-localazy-entry-to-create-entry-restaurant-simple-menu.js +0 -536
- package/server/tests/fixtures/parsed-localazy-entry-to-update-entry.js +0 -35157
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook-empty-recipes.js +0 -202
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-cookbook.js +0 -2700
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-lesson-dz.js +0 -309
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-simple.js +0 -47
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-flat-with-media.js +0 -169
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-empty.js +0 -3003
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-restaurant-simple-menu-with-media.js +0 -2057
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json-dz.js +0 -884
- package/server/tests/fixtures/populate-create-update-entry-with-base-entry-sample-json.js +0 -46
- package/server/tests/fixtures/strapi-plugin-all-models.js +0 -7000
- package/server/utils/__tests__/build-populate.test.js +0 -85
- package/server/utils/__tests__/flatten-object.test.js +0 -171
- package/server/utils/__tests__/get-models-tree.test.js +0 -170
- package/server/utils/__tests__/iso-locales-utils.test.js +0 -104
- package/server/utils/__tests__/parsed-localazy-entry-to-create-entry.test.js +0 -258
- package/server/utils/__tests__/parsed-localazy-entry-to-update-entry.test.js +0 -456
- package/server/utils/__tests__/pick-entries.test.js +0 -963
- package/server/utils/__tests__/populate-create-update-entry-with-base-entry.test.js +0 -1176
- package/server/utils/build-populate.js +0 -48
- package/server/utils/delay.js +0 -6
- package/server/utils/flatten-object.js +0 -61
- package/server/utils/generate-random-id.js +0 -3
- package/server/utils/get-full-populate-object.js +0 -66
- package/server/utils/get-main-keys-of-nested-array-objects.js +0 -5
- package/server/utils/get-models-tree.js +0 -47
- package/server/utils/get-picked-flatten-keys-for-hook-entry.js +0 -270
- package/server/utils/intl-display-name.js +0 -4
- package/server/utils/is-generally-applicable-content-type.js +0 -33
- package/server/utils/is-localazy-applicable-content-type.js +0 -36
- package/server/utils/iso-locales-utils.js +0 -60
- package/server/utils/localazy-api-client-factory.js +0 -22
- package/server/utils/localazy-generic-connector-client-factory.js +0 -15
- package/server/utils/model-utils.js +0 -43
- package/server/utils/objectivise-entry.js +0 -41
- package/server/utils/omit-deep.js +0 -24
- package/server/utils/parsed-localazy-entry-to-create-entry.js +0 -194
- package/server/utils/parsed-localazy-entry-to-update-entry.js +0 -83
- package/server/utils/pick-deep.js +0 -22
- package/server/utils/pick-entries.js +0 -37
- package/server/utils/populate-create-update-entry-with-base-entry.js +0 -264
- package/server/utils/request-initiator-helper.js +0 -36
- package/server/utils/reset-array-keys-deep.js +0 -19
- package/server/utils/transfer-setup-utils.js +0 -93
- package/strapi-admin.js +0 -14
- package/strapi-server.js +0 -5
- package/test/helpers/mocks.js +0 -9
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
kind: "collectionType",
|
|
3
|
-
collectionName: "restaurants",
|
|
4
|
-
info: {
|
|
5
|
-
singularName: "restaurant",
|
|
6
|
-
pluralName: "restaurants",
|
|
7
|
-
displayName: "Restaurant",
|
|
8
|
-
description: "",
|
|
9
|
-
},
|
|
10
|
-
options: {
|
|
11
|
-
draftAndPublish: true,
|
|
12
|
-
},
|
|
13
|
-
pluginOptions: {
|
|
14
|
-
i18n: {
|
|
15
|
-
localized: true,
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
attributes: {
|
|
19
|
-
title: {
|
|
20
|
-
pluginOptions: {
|
|
21
|
-
i18n: {
|
|
22
|
-
localized: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
type: "string",
|
|
26
|
-
required: true,
|
|
27
|
-
},
|
|
28
|
-
description: {
|
|
29
|
-
pluginOptions: {
|
|
30
|
-
i18n: {
|
|
31
|
-
localized: true,
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
type: "text",
|
|
35
|
-
},
|
|
36
|
-
books: {
|
|
37
|
-
type: "relation",
|
|
38
|
-
relation: "oneToMany",
|
|
39
|
-
target: "api::book.book",
|
|
40
|
-
},
|
|
41
|
-
recipes: {
|
|
42
|
-
type: "component",
|
|
43
|
-
repeatable: true,
|
|
44
|
-
pluginOptions: {
|
|
45
|
-
i18n: {
|
|
46
|
-
localized: true,
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
component: "food.recipe",
|
|
50
|
-
},
|
|
51
|
-
descs: {
|
|
52
|
-
type: "component",
|
|
53
|
-
repeatable: false,
|
|
54
|
-
pluginOptions: {
|
|
55
|
-
i18n: {
|
|
56
|
-
localized: true,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
component: "food.pub-component-1",
|
|
60
|
-
},
|
|
61
|
-
street: {
|
|
62
|
-
pluginOptions: {
|
|
63
|
-
i18n: {
|
|
64
|
-
localized: true,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
type: "string",
|
|
68
|
-
},
|
|
69
|
-
city: {
|
|
70
|
-
pluginOptions: {
|
|
71
|
-
i18n: {
|
|
72
|
-
localized: true,
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
type: "string",
|
|
76
|
-
},
|
|
77
|
-
country: {
|
|
78
|
-
pluginOptions: {
|
|
79
|
-
i18n: {
|
|
80
|
-
localized: true,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
type: "string",
|
|
84
|
-
},
|
|
85
|
-
createdAt: {
|
|
86
|
-
type: "datetime",
|
|
87
|
-
},
|
|
88
|
-
updatedAt: {
|
|
89
|
-
type: "datetime",
|
|
90
|
-
},
|
|
91
|
-
publishedAt: {
|
|
92
|
-
type: "datetime",
|
|
93
|
-
configurable: false,
|
|
94
|
-
writable: true,
|
|
95
|
-
visible: false,
|
|
96
|
-
},
|
|
97
|
-
createdBy: {
|
|
98
|
-
type: "relation",
|
|
99
|
-
relation: "oneToOne",
|
|
100
|
-
target: "admin::user",
|
|
101
|
-
configurable: false,
|
|
102
|
-
writable: false,
|
|
103
|
-
visible: false,
|
|
104
|
-
useJoinTable: false,
|
|
105
|
-
private: true,
|
|
106
|
-
},
|
|
107
|
-
updatedBy: {
|
|
108
|
-
type: "relation",
|
|
109
|
-
relation: "oneToOne",
|
|
110
|
-
target: "admin::user",
|
|
111
|
-
configurable: false,
|
|
112
|
-
writable: false,
|
|
113
|
-
visible: false,
|
|
114
|
-
useJoinTable: false,
|
|
115
|
-
private: true,
|
|
116
|
-
},
|
|
117
|
-
localizations: {
|
|
118
|
-
writable: true,
|
|
119
|
-
private: false,
|
|
120
|
-
configurable: false,
|
|
121
|
-
visible: false,
|
|
122
|
-
type: "relation",
|
|
123
|
-
relation: "oneToMany",
|
|
124
|
-
target: "api::restaurant.restaurant",
|
|
125
|
-
},
|
|
126
|
-
locale: {
|
|
127
|
-
writable: true,
|
|
128
|
-
private: false,
|
|
129
|
-
configurable: false,
|
|
130
|
-
visible: false,
|
|
131
|
-
type: "string",
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
__schema__: {
|
|
135
|
-
collectionName: "restaurants",
|
|
136
|
-
info: {
|
|
137
|
-
singularName: "restaurant",
|
|
138
|
-
pluralName: "restaurants",
|
|
139
|
-
displayName: "Restaurant",
|
|
140
|
-
description: "",
|
|
141
|
-
},
|
|
142
|
-
options: {
|
|
143
|
-
draftAndPublish: true,
|
|
144
|
-
},
|
|
145
|
-
pluginOptions: {
|
|
146
|
-
i18n: {
|
|
147
|
-
localized: true,
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
attributes: {
|
|
151
|
-
title: {
|
|
152
|
-
pluginOptions: {
|
|
153
|
-
i18n: {
|
|
154
|
-
localized: true,
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
type: "string",
|
|
158
|
-
required: true,
|
|
159
|
-
},
|
|
160
|
-
description: {
|
|
161
|
-
pluginOptions: {
|
|
162
|
-
i18n: {
|
|
163
|
-
localized: true,
|
|
164
|
-
},
|
|
165
|
-
},
|
|
166
|
-
type: "text",
|
|
167
|
-
},
|
|
168
|
-
books: {
|
|
169
|
-
type: "relation",
|
|
170
|
-
relation: "oneToMany",
|
|
171
|
-
target: "api::book.book",
|
|
172
|
-
},
|
|
173
|
-
recipes: {
|
|
174
|
-
type: "component",
|
|
175
|
-
repeatable: true,
|
|
176
|
-
pluginOptions: {
|
|
177
|
-
i18n: {
|
|
178
|
-
localized: true,
|
|
179
|
-
},
|
|
180
|
-
},
|
|
181
|
-
component: "food.recipe",
|
|
182
|
-
},
|
|
183
|
-
descs: {
|
|
184
|
-
type: "component",
|
|
185
|
-
repeatable: false,
|
|
186
|
-
pluginOptions: {
|
|
187
|
-
i18n: {
|
|
188
|
-
localized: true,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
component: "food.pub-component-1",
|
|
192
|
-
},
|
|
193
|
-
street: {
|
|
194
|
-
pluginOptions: {
|
|
195
|
-
i18n: {
|
|
196
|
-
localized: true,
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
type: "string",
|
|
200
|
-
},
|
|
201
|
-
city: {
|
|
202
|
-
pluginOptions: {
|
|
203
|
-
i18n: {
|
|
204
|
-
localized: true,
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
type: "string",
|
|
208
|
-
},
|
|
209
|
-
country: {
|
|
210
|
-
pluginOptions: {
|
|
211
|
-
i18n: {
|
|
212
|
-
localized: true,
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
type: "string",
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
kind: "collectionType",
|
|
219
|
-
},
|
|
220
|
-
modelType: "contentType",
|
|
221
|
-
modelName: "restaurant",
|
|
222
|
-
connection: "default",
|
|
223
|
-
uid: "api::restaurant.restaurant",
|
|
224
|
-
apiName: "restaurant",
|
|
225
|
-
globalId: "Restaurant",
|
|
226
|
-
actions: {},
|
|
227
|
-
lifecycles: {},
|
|
228
|
-
singularName: "restaurant",
|
|
229
|
-
tableName: "restaurants",
|
|
230
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* axios with a custom config.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import axios from "axios";
|
|
6
|
-
import { auth } from "@strapi/helper-plugin";
|
|
7
|
-
import pluginId from "../pluginId";
|
|
8
|
-
|
|
9
|
-
const BASE_PLUGIN_PATH = `/${pluginId}`;
|
|
10
|
-
|
|
11
|
-
const createAxiosInstance = (baseUrl = null) => {
|
|
12
|
-
if (baseUrl === null) {
|
|
13
|
-
baseUrl = `${BASE_PLUGIN_PATH}`;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const instance = axios.create({
|
|
17
|
-
baseURL: `${process.env.STRAPI_ADMIN_BACKEND_URL}${baseUrl}`,
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
instance.interceptors.request.use(
|
|
21
|
-
async (config) => {
|
|
22
|
-
config.headers = {
|
|
23
|
-
Authorization: `Bearer ${auth.getToken()}`,
|
|
24
|
-
Accept: "application/json",
|
|
25
|
-
"Content-Type": "application/json",
|
|
26
|
-
// Add this header to identify the request as initiated by the plugin
|
|
27
|
-
"X-Localazy-Initiated-By": "strapi-plugin-localazy",
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
return config;
|
|
31
|
-
},
|
|
32
|
-
(error) => {
|
|
33
|
-
Promise.reject(error);
|
|
34
|
-
}
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
instance.interceptors.response.use(
|
|
38
|
-
(response) => response,
|
|
39
|
-
(error) => {
|
|
40
|
-
// whatever you want to do with the error
|
|
41
|
-
if (error.response?.status === 401) {
|
|
42
|
-
// force-logout from the app
|
|
43
|
-
auth.clearAppStorage();
|
|
44
|
-
window.location.reload();
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
throw error;
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
|
|
51
|
-
return instance;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default createAxiosInstance;
|
package/jest.config.js
DELETED
|
File without changes
|
package/server/bootstrap.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const deepPopulateHook = require('./lifecycles/deep-populate-hook');
|
|
4
|
-
const uploadEventEntryToLocalazyHook = require('./lifecycles/upload-event-entry-to-localazy-hook');
|
|
5
|
-
const deprecateEventEntryInLocalazyHook = require('./lifecycles/deprecate-event-entry-in-localazy-hook');
|
|
6
|
-
const RequestInitiatorHelper = require('./utils/request-initiator-helper');
|
|
7
|
-
|
|
8
|
-
module.exports = ({ strapi }) => {
|
|
9
|
-
// bootstrap phase
|
|
10
|
-
// Subscribe to the lifecycles that we are interested in.
|
|
11
|
-
strapi.db.lifecycles.subscribe(async (event) => {
|
|
12
|
-
const requestInitiatorHelper = new RequestInitiatorHelper(strapi);
|
|
13
|
-
const action = event.action;
|
|
14
|
-
switch (action) {
|
|
15
|
-
case 'beforeFindMany':
|
|
16
|
-
case 'beforeFindOne': {
|
|
17
|
-
deepPopulateHook(event);
|
|
18
|
-
break;
|
|
19
|
-
}
|
|
20
|
-
case 'afterCreate':
|
|
21
|
-
case 'afterUpdate': {
|
|
22
|
-
try {
|
|
23
|
-
if (requestInitiatorHelper.isInitiatedByLocalazyWebhook() || requestInitiatorHelper.isInitiatedByLocalazyPluginUI()) {
|
|
24
|
-
break;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
uploadEventEntryToLocalazyHook(event).then((result) => {
|
|
28
|
-
if (typeof result !== 'undefined') {
|
|
29
|
-
strapi.log.info(`${action} hook result: ${JSON.stringify(result)}`);
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
} catch (e) {
|
|
33
|
-
strapi.log.error(e);
|
|
34
|
-
} finally {
|
|
35
|
-
break;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
case 'beforeDeleteMany':
|
|
39
|
-
case 'beforeDelete': {
|
|
40
|
-
try {
|
|
41
|
-
if (requestInitiatorHelper.isInitiatedByLocalazyWebhook() || requestInitiatorHelper.isInitiatedByLocalazyPluginUI()) {
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// have to await here
|
|
46
|
-
const result = await deprecateEventEntryInLocalazyHook(event);
|
|
47
|
-
if (typeof result !== 'undefined') {
|
|
48
|
-
strapi.log.info(`${action} hook result: ${JSON.stringify(result)}`);
|
|
49
|
-
}
|
|
50
|
-
} catch (e) {
|
|
51
|
-
strapi.log.error(e);
|
|
52
|
-
} finally {
|
|
53
|
-
break;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
default:
|
|
57
|
-
break;
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
process.nextTick(() => {
|
|
61
|
-
strapi.StrapIO = (require('strapio'))(strapi);
|
|
62
|
-
});
|
|
63
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
LOCALAZY_OAUTH_URL: "https://testing.localazy.com/oauth/authorize",
|
|
5
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18503917571895066466",
|
|
6
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "https://testing.localazy.com/plugin-connector",
|
|
7
|
-
LOCALAZY_PUBLIC_API_URL: "https://testing.localazy.com/pubapi",
|
|
8
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
10
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
11
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
12
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
13
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
14
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
15
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: true,
|
|
16
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
LOCALAZY_OAUTH_URL: "",
|
|
5
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "",
|
|
6
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "",
|
|
7
|
-
LOCALAZY_PUBLIC_API_URL: "",
|
|
8
|
-
LOCALAZY_PLUGIN_ID: "",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_NAME: "",
|
|
10
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
11
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "",
|
|
12
|
-
LOCALAZY_DEFAULT_LOCALE: "",
|
|
13
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "",
|
|
14
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: -1,
|
|
15
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: false,
|
|
16
|
-
};
|
package/server/config/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// depending on the STRAPI_ADMIN_LOCALAZY_ENV, use the correct config
|
|
4
|
-
let config = require("./production/index");
|
|
5
|
-
|
|
6
|
-
if (process.env.STRAPI_ADMIN_LOCALAZY_ENV === "local") {
|
|
7
|
-
config = require("./local/index");
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
if (process.env.STRAPI_ADMIN_LOCALAZY_ENV === "development") {
|
|
11
|
-
config = require("./development/index");
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
module.exports = {
|
|
15
|
-
default: {
|
|
16
|
-
// Default plugin configuration, merged with the user configuration
|
|
17
|
-
...(config || {}),
|
|
18
|
-
},
|
|
19
|
-
validator() { },
|
|
20
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
LOCALAZY_OAUTH_URL: "https://testing.localazy.com/oauth/authorize",
|
|
5
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18503917571895066465",
|
|
6
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL: "http://localhost:3000",
|
|
7
|
-
LOCALAZY_PUBLIC_API_URL: "https://testing.localazy.com/pubapi",
|
|
8
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
9
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
10
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
11
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
12
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
13
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
14
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
15
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: false,
|
|
16
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
LOCALAZY_OAUTH_URL: "https://localazy.com/oauth/authorize",
|
|
5
|
-
LOCALAZY_OAUTH_APP_CLIENT_ID: "18395772851999073783",
|
|
6
|
-
LOCALAZY_PLUGIN_CONNECTOR_API_URL:
|
|
7
|
-
"https://plugins.localazy.com/generic-connector",
|
|
8
|
-
LOCALAZY_PUBLIC_API_URL: "https://api.localazy.com",
|
|
9
|
-
LOCALAZY_PLUGIN_ID: "1",
|
|
10
|
-
LOCALAZY_DEFAULT_FILE_NAME: "strapi.json",
|
|
11
|
-
LOCALAZY_DEFAULT_FILE_PATH: "",
|
|
12
|
-
LOCALAZY_DEFAULT_FILE_EXTENSION: "json",
|
|
13
|
-
LOCALAZY_DEFAULT_LOCALE: "en",
|
|
14
|
-
LOCALAZY_API_USER_JWT_COOKIE_NAME: "LOCALAZY-API-USER-JWT",
|
|
15
|
-
LOCALAZY_API_USER_COOKIE_EXPIRATION: 7,
|
|
16
|
-
LOCALAZY_PUBLIC_API_LIFTED_LIMITS: true,
|
|
17
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
type: {
|
|
3
|
-
Job: false
|
|
4
|
-
},
|
|
5
|
-
query: `
|
|
6
|
-
jobs (sort: String, limit: Int, start: Int, where: JSON): [Job!]!
|
|
7
|
-
jobBySlug (slug: String!, publicationState: PublicationState): Job
|
|
8
|
-
`,
|
|
9
|
-
resolver: {
|
|
10
|
-
Query: {
|
|
11
|
-
jobs: {
|
|
12
|
-
description: "Return all job",
|
|
13
|
-
resolver: "application::job.job.findGQL"
|
|
14
|
-
},
|
|
15
|
-
jobBySlug: {
|
|
16
|
-
description: "Return job by slug",
|
|
17
|
-
resolver: "application::job.job.findOneBySlug"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const localazyUserController = require("./localazy-user-controller");
|
|
4
|
-
const localazyAuthController = require("./localazy-auth-controller");
|
|
5
|
-
const strapiController = require("./strapi-controller");
|
|
6
|
-
const pluginSettingsController = require("./plugin-settings-controller");
|
|
7
|
-
const localazyTransferController = require("./localazy-transfer-controller");
|
|
8
|
-
const localazyProjectController = require("./localazy-project-controller");
|
|
9
|
-
|
|
10
|
-
module.exports = {
|
|
11
|
-
localazyUserController,
|
|
12
|
-
localazyAuthController,
|
|
13
|
-
strapiController,
|
|
14
|
-
pluginSettingsController,
|
|
15
|
-
localazyTransferController,
|
|
16
|
-
localazyProjectController,
|
|
17
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const localazyGenericConnectorClientFactory = require("../utils/localazy-generic-connector-client-factory");
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
async generateKeys(ctx) {
|
|
7
|
-
const GenericConnectorApi = await localazyGenericConnectorClientFactory();
|
|
8
|
-
ctx.body = await GenericConnectorApi.public.keys();
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
async continuousPoll(ctx) {
|
|
12
|
-
// init continuous poll
|
|
13
|
-
const { readKey } = ctx.query;
|
|
14
|
-
const GenericConnectorApi = await localazyGenericConnectorClientFactory();
|
|
15
|
-
const pollResult = await GenericConnectorApi.oauth.continuousPoll({
|
|
16
|
-
readKey,
|
|
17
|
-
});
|
|
18
|
-
const pollResultData = pollResult.data;
|
|
19
|
-
|
|
20
|
-
ctx.body = pollResultData;
|
|
21
|
-
},
|
|
22
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async getConnectedProject(ctx) {
|
|
5
|
-
const LocalazyUserService = strapi
|
|
6
|
-
.plugin("localazy")
|
|
7
|
-
.service("localazyUserService");
|
|
8
|
-
const LocalazyPubApiService = strapi
|
|
9
|
-
.plugin("localazy")
|
|
10
|
-
.service("localazyPubApiService");
|
|
11
|
-
|
|
12
|
-
const user = await LocalazyUserService.getUser();
|
|
13
|
-
const project = await LocalazyPubApiService.getProject(
|
|
14
|
-
user.project.id,
|
|
15
|
-
true,
|
|
16
|
-
true
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
ctx.body = project;
|
|
20
|
-
},
|
|
21
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const { UPLOAD_FINISHED_EVENT, DOWNLOAD_FINISHED_EVENT } = require('../constants/events');
|
|
5
|
-
const jobNotificationServiceFactory = require('../services/helpers/job-notification-service');
|
|
6
|
-
|
|
7
|
-
module.exports = {
|
|
8
|
-
async upload(ctx) {
|
|
9
|
-
const JobNotificationService = new jobNotificationServiceFactory(strapi.StrapIO);
|
|
10
|
-
try {
|
|
11
|
-
const LocalazyTransferUploadService = strapi
|
|
12
|
-
.plugin("localazy")
|
|
13
|
-
.service("localazyTransferUploadService");
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* start executing the function after a delay
|
|
17
|
-
* (to let the client receive and subscribe to the messages stream)
|
|
18
|
-
*/
|
|
19
|
-
// TODO: let the client send a message to the server to start the upload (that it's subscribed to the stream)
|
|
20
|
-
setTimeout(() => (LocalazyTransferUploadService.upload(JobNotificationService, ctx)), 1000);
|
|
21
|
-
|
|
22
|
-
ctx.body = {
|
|
23
|
-
streamIdentifier: JobNotificationService.getStreamIdentifier(),
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
} catch (e) {
|
|
27
|
-
strapi.log.error(e.message);
|
|
28
|
-
await JobNotificationService.emit(UPLOAD_FINISHED_EVENT, {
|
|
29
|
-
success: false,
|
|
30
|
-
message: e.message,
|
|
31
|
-
});
|
|
32
|
-
ctx.throw(400, e);
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
async download(ctx) {
|
|
37
|
-
const JobNotificationService = new jobNotificationServiceFactory(strapi.StrapIO);
|
|
38
|
-
try {
|
|
39
|
-
const LocalazyTransferDownloadService = strapi
|
|
40
|
-
.plugin("localazy")
|
|
41
|
-
.service("localazyTransferDownloadService");
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* start executing the function after a delay
|
|
45
|
-
* (to let the client receive and subscribe to the messages stream)
|
|
46
|
-
*/
|
|
47
|
-
// TODO: let the client send a message to the server to start the download (that it's subscribed to the stream)
|
|
48
|
-
setTimeout(() => (LocalazyTransferDownloadService.download(JobNotificationService, ctx)), 1000);
|
|
49
|
-
|
|
50
|
-
ctx.body = {
|
|
51
|
-
streamIdentifier: JobNotificationService.getStreamIdentifier(),
|
|
52
|
-
};
|
|
53
|
-
} catch (e) {
|
|
54
|
-
strapi.log.error(e.message);
|
|
55
|
-
await JobNotificationService.emit(DOWNLOAD_FINISHED_EVENT, {
|
|
56
|
-
success: false,
|
|
57
|
-
message: e.message,
|
|
58
|
-
});
|
|
59
|
-
ctx.throw(400, e);
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async getUser(ctx) {
|
|
5
|
-
ctx.body = await strapi
|
|
6
|
-
.plugin("localazy")
|
|
7
|
-
.service("localazyUserService")
|
|
8
|
-
.getUser();
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
async updateUser(ctx) {
|
|
12
|
-
ctx.body = await strapi
|
|
13
|
-
.plugin("localazy")
|
|
14
|
-
.service("localazyUserService")
|
|
15
|
-
.updateUser(ctx.request.body);
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
async deleteUser(ctx) {
|
|
19
|
-
ctx.body = await strapi
|
|
20
|
-
.plugin("localazy")
|
|
21
|
-
.service("localazyUserService")
|
|
22
|
-
.deleteUser();
|
|
23
|
-
},
|
|
24
|
-
};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
async getContentTransferSetup(ctx) {
|
|
5
|
-
ctx.body = await strapi
|
|
6
|
-
.plugin("localazy")
|
|
7
|
-
.service("pluginSettingsService")
|
|
8
|
-
.getContentTransferSetup();
|
|
9
|
-
},
|
|
10
|
-
|
|
11
|
-
async updateContentTransferSetup(ctx) {
|
|
12
|
-
ctx.body = await strapi
|
|
13
|
-
.plugin("localazy")
|
|
14
|
-
.service("pluginSettingsService")
|
|
15
|
-
.updateContentTransferSetup(ctx.request.body);
|
|
16
|
-
},
|
|
17
|
-
|
|
18
|
-
async getPluginSettings(ctx) {
|
|
19
|
-
ctx.body = await strapi
|
|
20
|
-
.plugin("localazy")
|
|
21
|
-
.service("pluginSettingsService")
|
|
22
|
-
.getPluginSettings();
|
|
23
|
-
},
|
|
24
|
-
|
|
25
|
-
async updatePluginSettings(ctx) {
|
|
26
|
-
ctx.body = await strapi
|
|
27
|
-
.plugin("localazy")
|
|
28
|
-
.service("pluginSettingsService")
|
|
29
|
-
.updatePluginSettings(ctx.request.body);
|
|
30
|
-
}
|
|
31
|
-
};
|