@localazy/strapi-plugin 0.2.12 → 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 -60
- 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 -77
- 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,61 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
save: "Save",
|
|
3
|
-
cancel: "Cancel",
|
|
4
|
-
close: "Close",
|
|
5
|
-
off: "Off",
|
|
6
|
-
on: "On",
|
|
7
|
-
clear: "Clear",
|
|
8
|
-
|
|
9
|
-
/* Global Settings */
|
|
10
|
-
global_settings: "Global Settings",
|
|
11
|
-
global_settings_description: "Setup the Localazy plugin upload/download options.",
|
|
12
|
-
|
|
13
|
-
upload_settings: "Upload settings",
|
|
14
|
-
allow_automated_upload_to_localazy: "Allow automated upload to Localazy",
|
|
15
|
-
allow_automated_upload_to_localazy_info: "Content will be automatically uploaded to Localazy after its creation or update.",
|
|
16
|
-
automated_upload_triggers: "Automated upload triggers",
|
|
17
|
-
automated_upload_triggers_placeholder: "Select triggers",
|
|
18
|
-
creating_new_data_entry: "Creating new data entry",
|
|
19
|
-
editing_data_entry: "Editing data entry",
|
|
20
|
-
automated_upload_triggers_info: "Select actions that will trigger an upload of Strapi data to Localazy.",
|
|
21
|
-
|
|
22
|
-
deprecate_source_keys_on_delete: "Deprecate source keys on deletion",
|
|
23
|
-
deprecate_source_keys_on_delete_info: "Source keys will be automatically set as deprecated if an entry in source language is deleted in Strapi",
|
|
24
|
-
|
|
25
|
-
download_settings: "Download settings",
|
|
26
|
-
processing_of_download_webhook: "Processing of download webhook",
|
|
27
|
-
processing_of_download_webhook_info: "You can temporarily disable the webhook processing and the information will be scrapped.",
|
|
28
|
-
webhook_author: "Webhook actions author",
|
|
29
|
-
webhook_author_info: "Select the author signed under the webhook actions (required by Strapi for certain actions, e.g. creating a locale).",
|
|
30
|
-
webhook_author_placeholder: "Select webhook actions author",
|
|
31
|
-
webhook_languages: "Allowed webhook languages",
|
|
32
|
-
webhook_languages_info: "Select the languages from Localazy. Translations of selected languages would be downloaded. If no language is selected, all translations will be downloaded.",
|
|
33
|
-
webhook_languages_placeholder: "Download all languages",
|
|
34
|
-
|
|
35
|
-
global_settings_saved_successfully: "Global Settings were saved",
|
|
36
|
-
|
|
37
|
-
/* Content Transfer Setup */
|
|
38
|
-
content_transfer_setup: "Content Transfer Setup",
|
|
39
|
-
content_transfer_setup_description:
|
|
40
|
-
"Select which content type fields will be uploaded to Localazy",
|
|
41
|
-
|
|
42
|
-
content_transfer_setup_saved: "Content Transfer Setup saved",
|
|
43
|
-
content_transfer_setup_saved_successfully:
|
|
44
|
-
"Content Transfer Setup saved successfully",
|
|
45
|
-
content_types_model_changed: "Content Types Model Changed",
|
|
46
|
-
please_update_your_content:
|
|
47
|
-
"Please update your content transfer setup before proceeding to upload/download",
|
|
48
|
-
you_can_upload_download: "You can upload/download ",
|
|
49
|
-
only_text_based_content: "only text based content.",
|
|
50
|
-
learn_more_in_docs_message_a: "If you want to learn more about how to setup your Content Transfer settings read the ",
|
|
51
|
-
learn_more_in_docs_message_b: "Localazy documentation.",
|
|
52
|
-
there_is_nothing_to_transfer: "There is nothing to transfer.",
|
|
53
|
-
please_check_that_you_have_entered_a_valid_collection: "To finish the content transfer setup, you must enable localization for at least one Content-Type.",
|
|
54
|
-
step_1: "Go to the <1>Content-Type Builder</1>",
|
|
55
|
-
step_2: "Click on <1>Edit</1> and select the <1>Advanced Settings</1> tab",
|
|
56
|
-
step_3: "Check <1>Enable localization for this Content-Type</1>",
|
|
57
|
-
step_4: "Repeat for all Content-Types you want to translate",
|
|
58
|
-
step_5: "Return to this screen and finish the transfer setup",
|
|
59
|
-
|
|
60
|
-
general: "General",
|
|
61
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const BASE_PATH = "/plugin-settings";
|
|
5
|
-
const axiosInstance = createAxiosInstance();
|
|
6
|
-
|
|
7
|
-
export default class PluginSettingsService {
|
|
8
|
-
static async getContentTransferSetup() {
|
|
9
|
-
try {
|
|
10
|
-
const result = await axiosInstance.get(
|
|
11
|
-
`${BASE_PATH}/content-transfer-setup`
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
return result.data;
|
|
15
|
-
} catch (e) {
|
|
16
|
-
throw e;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
static async updateContentTransferSetup(data) {
|
|
21
|
-
try {
|
|
22
|
-
const result = await axiosInstance.put(
|
|
23
|
-
`${BASE_PATH}/content-transfer-setup`,
|
|
24
|
-
data
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
return result.data;
|
|
28
|
-
} catch (e) {
|
|
29
|
-
throw e;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
static async getPluginSettings() {
|
|
34
|
-
try {
|
|
35
|
-
const result = await axiosInstance.get(`${BASE_PATH}/plugin-settings`);
|
|
36
|
-
|
|
37
|
-
return result.data;
|
|
38
|
-
} catch (e) {
|
|
39
|
-
throw e;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
static async updatePluginSettings(data) {
|
|
44
|
-
try {
|
|
45
|
-
const result = await axiosInstance.put(
|
|
46
|
-
`${BASE_PATH}/plugin-settings`,
|
|
47
|
-
data
|
|
48
|
-
);
|
|
49
|
-
|
|
50
|
-
return result.data;
|
|
51
|
-
} catch (e) {
|
|
52
|
-
throw e;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
2
|
-
|
|
3
|
-
const BASE_PATH = "/strapi";
|
|
4
|
-
const axiosInstance = createAxiosInstance();
|
|
5
|
-
|
|
6
|
-
export default class StrapiModelService {
|
|
7
|
-
static async getModels() {
|
|
8
|
-
try {
|
|
9
|
-
const result = await axiosInstance.get(`${BASE_PATH}/models`);
|
|
10
|
-
|
|
11
|
-
return result.data;
|
|
12
|
-
} catch (e) {
|
|
13
|
-
throw e.message;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
static async getLocalizableModels() {
|
|
18
|
-
try {
|
|
19
|
-
const result = await axiosInstance.get(`${BASE_PATH}/localizable-models`);
|
|
20
|
-
|
|
21
|
-
return result.data;
|
|
22
|
-
} catch (e) {
|
|
23
|
-
throw e.message;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const axiosInstance = createAxiosInstance("/admin/users");
|
|
5
|
-
|
|
6
|
-
export default class PluginSettingsService {
|
|
7
|
-
static async getAdminPanelUsers() {
|
|
8
|
-
try {
|
|
9
|
-
// TODO: update to return all users; not just the first 100
|
|
10
|
-
const result = await axiosInstance.get(
|
|
11
|
-
"",
|
|
12
|
-
{
|
|
13
|
-
params: {
|
|
14
|
-
"pageSize": 100,
|
|
15
|
-
"page": 1,
|
|
16
|
-
"sort": "firstname"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return result.data.data.results;
|
|
22
|
-
} catch (e) {
|
|
23
|
-
throw e;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import getModelsTree from "../get-models-tree";
|
|
2
|
-
|
|
3
|
-
const allModels = require("../../../../tests/fixtures/all-models");
|
|
4
|
-
const restaurantModel = require("../../../../tests/fixtures/restaurant-model");
|
|
5
|
-
|
|
6
|
-
it("should return the tree for restaurants", () => {
|
|
7
|
-
// SETUP
|
|
8
|
-
const object = allModels;
|
|
9
|
-
const localizableModels = [restaurantModel];
|
|
10
|
-
|
|
11
|
-
// EXECUTE
|
|
12
|
-
const result = getModelsTree(object, localizableModels);
|
|
13
|
-
|
|
14
|
-
// VERIFY
|
|
15
|
-
const restaurantModelsTree = result.find((model) => model.restaurants);
|
|
16
|
-
const expected = {
|
|
17
|
-
restaurants: {
|
|
18
|
-
__model__: true,
|
|
19
|
-
title: false,
|
|
20
|
-
description: false,
|
|
21
|
-
books: null,
|
|
22
|
-
recipes: {
|
|
23
|
-
name: false,
|
|
24
|
-
ingredients: {
|
|
25
|
-
name: false,
|
|
26
|
-
pcs: null,
|
|
27
|
-
required: null,
|
|
28
|
-
},
|
|
29
|
-
variants: {
|
|
30
|
-
name: false,
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
descs: {
|
|
34
|
-
rich_description: false,
|
|
35
|
-
history: false,
|
|
36
|
-
excerpt: false,
|
|
37
|
-
test_variants: {
|
|
38
|
-
name: false,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
street: false,
|
|
42
|
-
city: false,
|
|
43
|
-
country: false,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
expect(restaurantModelsTree).toEqual(expected);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
it("should return a tree for all models", () => {
|
|
50
|
-
// SETUP
|
|
51
|
-
const localizableModels = allModels.filter(
|
|
52
|
-
(model) => model.modelType === "contentType"
|
|
53
|
-
);
|
|
54
|
-
const object = allModels;
|
|
55
|
-
|
|
56
|
-
// EXECUTE
|
|
57
|
-
const result = getModelsTree(object, localizableModels);
|
|
58
|
-
|
|
59
|
-
// VERIFY
|
|
60
|
-
const expected = [
|
|
61
|
-
{
|
|
62
|
-
tokens: {
|
|
63
|
-
__model__: true,
|
|
64
|
-
access_token: null,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
testtokens: {
|
|
69
|
-
__model__: true,
|
|
70
|
-
at: null,
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
up_users: {
|
|
75
|
-
__model__: true,
|
|
76
|
-
username: null,
|
|
77
|
-
email: null,
|
|
78
|
-
provider: null,
|
|
79
|
-
password: null,
|
|
80
|
-
resetPasswordToken: null,
|
|
81
|
-
confirmationToken: null,
|
|
82
|
-
confirmed: null,
|
|
83
|
-
blocked: null,
|
|
84
|
-
role: null,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
books: {
|
|
89
|
-
__model__: true,
|
|
90
|
-
Title: false,
|
|
91
|
-
Author: null,
|
|
92
|
-
Pages: null,
|
|
93
|
-
additional_info: {
|
|
94
|
-
rich_description: null,
|
|
95
|
-
history: null,
|
|
96
|
-
excerpt: null,
|
|
97
|
-
test_variants: {
|
|
98
|
-
name: null,
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
restaurants: {
|
|
105
|
-
__model__: true,
|
|
106
|
-
title: false,
|
|
107
|
-
description: false,
|
|
108
|
-
books: null,
|
|
109
|
-
recipes: {
|
|
110
|
-
name: false,
|
|
111
|
-
ingredients: {
|
|
112
|
-
name: false,
|
|
113
|
-
pcs: null,
|
|
114
|
-
required: null,
|
|
115
|
-
},
|
|
116
|
-
variants: {
|
|
117
|
-
name: false,
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
descs: {
|
|
121
|
-
rich_description: false,
|
|
122
|
-
history: false,
|
|
123
|
-
excerpt: false,
|
|
124
|
-
test_variants: {
|
|
125
|
-
name: false,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
street: false,
|
|
129
|
-
city: false,
|
|
130
|
-
country: false,
|
|
131
|
-
},
|
|
132
|
-
},
|
|
133
|
-
];
|
|
134
|
-
expect(result).toEqual(expected);
|
|
135
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import SUPPORTED_CONTENT_TYPE_FIELDS from "../../@common/models/supported-content-type-fields";
|
|
2
|
-
import SUPPORTED_CUSTOM_FIELD_PLUGINS from "../../@common/models/supported-custom-field-plugins";
|
|
3
|
-
|
|
4
|
-
export default (models) => {
|
|
5
|
-
if (!models) {
|
|
6
|
-
return [];
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
return models.map((model) => {
|
|
10
|
-
const attributesKeys = Object.keys(model.__schema__.attributes);
|
|
11
|
-
|
|
12
|
-
const attributes = attributesKeys.map((attributeKey) => {
|
|
13
|
-
const type = model.__schema__.attributes[attributeKey].type;
|
|
14
|
-
const customField = model.__schema__.attributes[attributeKey].customField;
|
|
15
|
-
|
|
16
|
-
if (!(SUPPORTED_CONTENT_TYPE_FIELDS.includes(type.toLowerCase())
|
|
17
|
-
|| (type.toLowerCase() === "customfield" && SUPPORTED_CUSTOM_FIELD_PLUGINS.includes(customField)))) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return attributeKey;
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
return {
|
|
25
|
-
modelUid: model.uid,
|
|
26
|
-
collectionName: model.collectionName,
|
|
27
|
-
displayName: model.info.displayName,
|
|
28
|
-
attributes: attributes.filter((attribute) => !!attribute),
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import SUPPORTED_CONTENT_TYPE_FIELDS from "../../@common/models/supported-content-type-fields";
|
|
2
|
-
import SUPPORTED_CUSTOM_FIELD_PLUGINS from "../../@common/models/supported-custom-field-plugins";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Supported kinds of models are expected by the function, needs to be checked before calling the function
|
|
6
|
-
*/
|
|
7
|
-
const getModelsTree = (allModels, localizableModels = []) => {
|
|
8
|
-
const modelsTree = [];
|
|
9
|
-
|
|
10
|
-
const getModelTree = (
|
|
11
|
-
attributes,
|
|
12
|
-
isComponentAttributes = false,
|
|
13
|
-
isComponentAttributesObjectTranslatable = null
|
|
14
|
-
) => {
|
|
15
|
-
const currentModelTree = {};
|
|
16
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
17
|
-
for (const attribute in attributes) {
|
|
18
|
-
if (attributes[attribute].type === "component") {
|
|
19
|
-
const nestedModel = allModels.find(
|
|
20
|
-
(model) => model.uid === attributes[attribute].component
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
currentModelTree[attribute] = {
|
|
24
|
-
...getModelTree(
|
|
25
|
-
nestedModel.__schema__.attributes,
|
|
26
|
-
true,
|
|
27
|
-
isComponentAttributesObjectTranslatable === null
|
|
28
|
-
? attributes[attribute].pluginOptions?.i18n?.localized || false
|
|
29
|
-
: isComponentAttributesObjectTranslatable
|
|
30
|
-
),
|
|
31
|
-
};
|
|
32
|
-
} else if (attributes[attribute].type === "dynamiczone") {
|
|
33
|
-
const components = attributes[attribute].components;
|
|
34
|
-
currentModelTree[attribute] = [];
|
|
35
|
-
components.forEach((c) => {
|
|
36
|
-
const nestedModel = allModels.find((model) => model.uid === c);
|
|
37
|
-
|
|
38
|
-
const modelTree = getModelTree(
|
|
39
|
-
nestedModel.__schema__.attributes,
|
|
40
|
-
true,
|
|
41
|
-
isComponentAttributesObjectTranslatable === null
|
|
42
|
-
? attributes[attribute].pluginOptions?.i18n?.localized || false
|
|
43
|
-
: isComponentAttributesObjectTranslatable
|
|
44
|
-
);
|
|
45
|
-
currentModelTree[attribute].push({
|
|
46
|
-
"__component__": c,
|
|
47
|
-
...modelTree,
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
} else if (
|
|
51
|
-
SUPPORTED_CONTENT_TYPE_FIELDS.includes(attributes[attribute].type)
|
|
52
|
-
|| (attributes[attribute].type === "customField" && SUPPORTED_CUSTOM_FIELD_PLUGINS.includes(attributes[attribute].customField))) {
|
|
53
|
-
// field might not be localizable
|
|
54
|
-
if (isComponentAttributes) {
|
|
55
|
-
if (isComponentAttributesObjectTranslatable) {
|
|
56
|
-
currentModelTree[attribute] = false;
|
|
57
|
-
} else {
|
|
58
|
-
currentModelTree[attribute] = null;
|
|
59
|
-
}
|
|
60
|
-
} else if (
|
|
61
|
-
!isComponentAttributes &&
|
|
62
|
-
(!attributes[attribute].pluginOptions ||
|
|
63
|
-
!attributes[attribute].pluginOptions.i18n ||
|
|
64
|
-
!attributes[attribute].pluginOptions.i18n.localized)
|
|
65
|
-
) {
|
|
66
|
-
currentModelTree[attribute] = null;
|
|
67
|
-
} else {
|
|
68
|
-
currentModelTree[attribute] = false;
|
|
69
|
-
}
|
|
70
|
-
} else {
|
|
71
|
-
currentModelTree[attribute] = null;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return currentModelTree;
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
// eslint-disable-next-line no-restricted-syntax
|
|
79
|
-
for (const model of localizableModels) {
|
|
80
|
-
if (model.__schema__.collectionName) {
|
|
81
|
-
const modelTree = {
|
|
82
|
-
[model.__schema__.collectionName]: {
|
|
83
|
-
__model__: true,
|
|
84
|
-
...getModelTree(model.__schema__.attributes),
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
modelsTree.push(modelTree);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return modelsTree;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export default getModelsTree;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* OverviewItem
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { GridItem } from '@strapi/design-system/Grid';
|
|
9
|
-
import { Box } from "@strapi/design-system/Box";
|
|
10
|
-
import { Typography } from "@strapi/design-system/Typography";
|
|
11
|
-
import PropTypes from "prop-types";
|
|
12
|
-
|
|
13
|
-
function OverviewItem(props) {
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<GridItem padding={1} col={6} s={12}>
|
|
17
|
-
<Box>
|
|
18
|
-
<Typography
|
|
19
|
-
variant="sigma"
|
|
20
|
-
textColor="neutral600"
|
|
21
|
-
textTransform="uppercase"
|
|
22
|
-
>
|
|
23
|
-
{props.label}
|
|
24
|
-
</Typography>
|
|
25
|
-
</Box>
|
|
26
|
-
<Box>
|
|
27
|
-
<Typography
|
|
28
|
-
variant="omega"
|
|
29
|
-
textColor="neutral800"
|
|
30
|
-
fontWeight="semiBold"
|
|
31
|
-
>
|
|
32
|
-
{props.value}
|
|
33
|
-
</Typography>
|
|
34
|
-
</Box>
|
|
35
|
-
</GridItem>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
OverviewItem.propTypes = {
|
|
40
|
-
label: PropTypes.string.isRequired,
|
|
41
|
-
value: PropTypes.string.isRequired,
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export default OverviewItem;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
*
|
|
3
|
-
* OpenProjectInLocalalazy
|
|
4
|
-
*
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import React from "react";
|
|
8
|
-
import { GridItem } from '@strapi/design-system/Grid';
|
|
9
|
-
import { Typography } from "@strapi/design-system/Typography";
|
|
10
|
-
import { Link } from "@strapi/design-system/Link";
|
|
11
|
-
import PropTypes from "prop-types";
|
|
12
|
-
|
|
13
|
-
function OverviewItemLink(props) {
|
|
14
|
-
return (
|
|
15
|
-
<GridItem padding={1} col={6} s={12}>
|
|
16
|
-
<Link href={props.to} isExternal>
|
|
17
|
-
<Typography
|
|
18
|
-
variant="sigma"
|
|
19
|
-
textColor="primary600"
|
|
20
|
-
textTransform="uppercase"
|
|
21
|
-
>
|
|
22
|
-
{props.label}
|
|
23
|
-
</Typography>
|
|
24
|
-
</Link>
|
|
25
|
-
</GridItem>
|
|
26
|
-
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
OverviewItemLink.propTypes = {
|
|
30
|
-
label: PropTypes.string.isRequired,
|
|
31
|
-
to: PropTypes.string.isRequired,
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default OverviewItemLink;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { Box } from "@strapi/design-system/Box";
|
|
3
|
-
import { useTranslation } from "react-i18next";
|
|
4
|
-
import { Typography } from "@strapi/design-system/Typography";
|
|
5
|
-
|
|
6
|
-
function PrerequisitiesInfo() {
|
|
7
|
-
const { t } = useTranslation();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Box>
|
|
11
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
12
|
-
{t("settings.internationalization_plugin")}
|
|
13
|
-
</Typography>
|
|
14
|
-
<Typography variant="omega">
|
|
15
|
-
{t("settings.has_to_be_installed")}
|
|
16
|
-
</Typography>
|
|
17
|
-
<br />
|
|
18
|
-
<Typography variant="omega">
|
|
19
|
-
{t("settings.transfer_setup_message_a")}
|
|
20
|
-
</Typography>
|
|
21
|
-
<Typography variant="omega" fontWeight="semiBold">
|
|
22
|
-
{t("settings.transfer_setup_message_b")}
|
|
23
|
-
</Typography>
|
|
24
|
-
</Box>
|
|
25
|
-
);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export default PrerequisitiesInfo;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
description: "Overview of the connected Localazy account and project.",
|
|
3
|
-
localazy_account_details: "Localazy Account Details",
|
|
4
|
-
connected_user: "Connected User",
|
|
5
|
-
connected_project: "Connected Project",
|
|
6
|
-
connected_organization: "Connected Organization",
|
|
7
|
-
remaining_organization_keys: "Remaining Organization Keys",
|
|
8
|
-
open_project_in_localazy: "Open project in Localazy",
|
|
9
|
-
internationalization_plugin: "Internationalization Plugin ",
|
|
10
|
-
has_to_be_installed: "has to be installed.",
|
|
11
|
-
transfer_setup_message_a: "Select which parts of your project you want to upload in ",
|
|
12
|
-
transfer_setup_message_b: "Settings > Localazy Settings > Content Transfer Setup."
|
|
13
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-useless-catch */
|
|
2
|
-
import createAxiosInstance from "../../../utils/createAxiosInstance";
|
|
3
|
-
|
|
4
|
-
const BASE_PATH = "/user";
|
|
5
|
-
const axiosInstance = createAxiosInstance();
|
|
6
|
-
|
|
7
|
-
export default class LocalazyUserService {
|
|
8
|
-
static async getIdentity() {
|
|
9
|
-
try {
|
|
10
|
-
const result = await axiosInstance.get(`${BASE_PATH}`);
|
|
11
|
-
|
|
12
|
-
return result.data;
|
|
13
|
-
} catch (e) {
|
|
14
|
-
throw e;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static async updateIdentity(localazyIdentity) {
|
|
19
|
-
try {
|
|
20
|
-
// store in DB plugin settings
|
|
21
|
-
const result = await axiosInstance.put(`${BASE_PATH}`, localazyIdentity);
|
|
22
|
-
|
|
23
|
-
return result.data;
|
|
24
|
-
} catch (e) {
|
|
25
|
-
throw e;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static async deleteIdentity() {
|
|
30
|
-
try {
|
|
31
|
-
const result = await axiosInstance.delete(`${BASE_PATH}`);
|
|
32
|
-
|
|
33
|
-
return result.data;
|
|
34
|
-
} catch (e) {
|
|
35
|
-
throw e;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|