@equinor/fusion-framework-module-services 0.0.0-next-20230915111233
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/.turbo/turbo-build.log +4 -0
- package/CHANGELOG.md +1470 -0
- package/LICENSE +21 -0
- package/dist/esm/bookmarks/api-models.js +2 -0
- package/dist/esm/bookmarks/api-models.js.map +1 -0
- package/dist/esm/bookmarks/client.js +48 -0
- package/dist/esm/bookmarks/client.js.map +1 -0
- package/dist/esm/bookmarks/delete/client.js +4 -0
- package/dist/esm/bookmarks/delete/client.js.map +1 -0
- package/dist/esm/bookmarks/delete/generate-endpoint.js +17 -0
- package/dist/esm/bookmarks/delete/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/delete/generate-parameters.js +7 -0
- package/dist/esm/bookmarks/delete/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/delete/index.js +5 -0
- package/dist/esm/bookmarks/delete/index.js.map +1 -0
- package/dist/esm/bookmarks/delete/types-v1.js +2 -0
- package/dist/esm/bookmarks/delete/types-v1.js.map +1 -0
- package/dist/esm/bookmarks/delete/types.js +2 -0
- package/dist/esm/bookmarks/delete/types.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/client.js +4 -0
- package/dist/esm/bookmarks/favorites/delete/client.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/generate-endpoint.js +12 -0
- package/dist/esm/bookmarks/favorites/delete/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/generate-parameters.js +7 -0
- package/dist/esm/bookmarks/favorites/delete/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/index.js +5 -0
- package/dist/esm/bookmarks/favorites/delete/index.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/types-v1.js +2 -0
- package/dist/esm/bookmarks/favorites/delete/types-v1.js.map +1 -0
- package/dist/esm/bookmarks/favorites/delete/types.js +2 -0
- package/dist/esm/bookmarks/favorites/delete/types.js.map +1 -0
- package/dist/esm/bookmarks/favorites/head/client.js +4 -0
- package/dist/esm/bookmarks/favorites/head/client.js.map +1 -0
- package/dist/esm/bookmarks/favorites/head/generate-endpoint.js +12 -0
- package/dist/esm/bookmarks/favorites/head/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/favorites/head/generate-parameters.js +9 -0
- package/dist/esm/bookmarks/favorites/head/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/favorites/head/index.js +5 -0
- package/dist/esm/bookmarks/favorites/head/index.js.map +1 -0
- package/dist/esm/bookmarks/favorites/head/types.js +2 -0
- package/dist/esm/bookmarks/favorites/head/types.js.map +1 -0
- package/dist/esm/bookmarks/favorites/post/client.js +4 -0
- package/dist/esm/bookmarks/favorites/post/client.js.map +1 -0
- package/dist/esm/bookmarks/favorites/post/generate-endpoint.js +11 -0
- package/dist/esm/bookmarks/favorites/post/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/favorites/post/generate-parameters.js +9 -0
- package/dist/esm/bookmarks/favorites/post/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/favorites/post/index.js +5 -0
- package/dist/esm/bookmarks/favorites/post/index.js.map +1 -0
- package/dist/esm/bookmarks/favorites/post/types.js +2 -0
- package/dist/esm/bookmarks/favorites/post/types.js.map +1 -0
- package/dist/esm/bookmarks/get/client.js +4 -0
- package/dist/esm/bookmarks/get/client.js.map +1 -0
- package/dist/esm/bookmarks/get/generate-endpoint.js +17 -0
- package/dist/esm/bookmarks/get/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/get/generate-parameters.js +6 -0
- package/dist/esm/bookmarks/get/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/get/index.js +5 -0
- package/dist/esm/bookmarks/get/index.js.map +1 -0
- package/dist/esm/bookmarks/get/types.js +2 -0
- package/dist/esm/bookmarks/get/types.js.map +1 -0
- package/dist/esm/bookmarks/getAll/client.js +4 -0
- package/dist/esm/bookmarks/getAll/client.js.map +1 -0
- package/dist/esm/bookmarks/getAll/generate-endpoint.js +11 -0
- package/dist/esm/bookmarks/getAll/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/getAll/generate-parameters.js +6 -0
- package/dist/esm/bookmarks/getAll/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/getAll/index.js +5 -0
- package/dist/esm/bookmarks/getAll/index.js.map +1 -0
- package/dist/esm/bookmarks/getAll/types.js +2 -0
- package/dist/esm/bookmarks/getAll/types.js.map +1 -0
- package/dist/esm/bookmarks/index.js +4 -0
- package/dist/esm/bookmarks/index.js.map +1 -0
- package/dist/esm/bookmarks/patch/client.js +4 -0
- package/dist/esm/bookmarks/patch/client.js.map +1 -0
- package/dist/esm/bookmarks/patch/generate-endpoint.js +11 -0
- package/dist/esm/bookmarks/patch/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/patch/generate-parameters.js +9 -0
- package/dist/esm/bookmarks/patch/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/patch/index.js +5 -0
- package/dist/esm/bookmarks/patch/index.js.map +1 -0
- package/dist/esm/bookmarks/patch/types.js +2 -0
- package/dist/esm/bookmarks/patch/types.js.map +1 -0
- package/dist/esm/bookmarks/post/client.js +4 -0
- package/dist/esm/bookmarks/post/client.js.map +1 -0
- package/dist/esm/bookmarks/post/generate-endpoint.js +11 -0
- package/dist/esm/bookmarks/post/generate-endpoint.js.map +1 -0
- package/dist/esm/bookmarks/post/generate-parameters.js +9 -0
- package/dist/esm/bookmarks/post/generate-parameters.js.map +1 -0
- package/dist/esm/bookmarks/post/index.js +5 -0
- package/dist/esm/bookmarks/post/index.js.map +1 -0
- package/dist/esm/bookmarks/post/types.js +2 -0
- package/dist/esm/bookmarks/post/types.js.map +1 -0
- package/dist/esm/bookmarks/types.js +2 -0
- package/dist/esm/bookmarks/types.js.map +1 -0
- package/dist/esm/configurator.js +3 -0
- package/dist/esm/configurator.js.map +1 -0
- package/dist/esm/context/api-models.js +2 -0
- package/dist/esm/context/api-models.js.map +1 -0
- package/dist/esm/context/client.js +27 -0
- package/dist/esm/context/client.js.map +1 -0
- package/dist/esm/context/get/client.js +4 -0
- package/dist/esm/context/get/client.js.map +1 -0
- package/dist/esm/context/get/generate-endpoint.js +18 -0
- package/dist/esm/context/get/generate-endpoint.js.map +1 -0
- package/dist/esm/context/get/generate-parameters.js +7 -0
- package/dist/esm/context/get/generate-parameters.js.map +1 -0
- package/dist/esm/context/get/index.js +6 -0
- package/dist/esm/context/get/index.js.map +1 -0
- package/dist/esm/context/get/types.js +2 -0
- package/dist/esm/context/get/types.js.map +1 -0
- package/dist/esm/context/index.js +5 -0
- package/dist/esm/context/index.js.map +1 -0
- package/dist/esm/context/query/client.js +4 -0
- package/dist/esm/context/query/client.js.map +1 -0
- package/dist/esm/context/query/generate-endpoint.js +49 -0
- package/dist/esm/context/query/generate-endpoint.js.map +1 -0
- package/dist/esm/context/query/generate-parameters.js +7 -0
- package/dist/esm/context/query/generate-parameters.js.map +1 -0
- package/dist/esm/context/query/index.js +6 -0
- package/dist/esm/context/query/index.js.map +1 -0
- package/dist/esm/context/query/types.js +2 -0
- package/dist/esm/context/query/types.js.map +1 -0
- package/dist/esm/context/related/client.js +4 -0
- package/dist/esm/context/related/client.js.map +1 -0
- package/dist/esm/context/related/generate-endpoint.js +46 -0
- package/dist/esm/context/related/generate-endpoint.js.map +1 -0
- package/dist/esm/context/related/generate-parameters.js +7 -0
- package/dist/esm/context/related/generate-parameters.js.map +1 -0
- package/dist/esm/context/related/index.js +6 -0
- package/dist/esm/context/related/index.js.map +1 -0
- package/dist/esm/context/related/types.js +2 -0
- package/dist/esm/context/related/types.js.map +1 -0
- package/dist/esm/context/static.js +6 -0
- package/dist/esm/context/static.js.map +1 -0
- package/dist/esm/context/types.js +2 -0
- package/dist/esm/context/types.js.map +1 -0
- package/dist/esm/errors.js +7 -0
- package/dist/esm/errors.js.map +1 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/module.js +51 -0
- package/dist/esm/module.js.map +1 -0
- package/dist/esm/notification/api-models.js +2 -0
- package/dist/esm/notification/api-models.js.map +1 -0
- package/dist/esm/notification/client.js +43 -0
- package/dist/esm/notification/client.js.map +1 -0
- package/dist/esm/notification/index.js +5 -0
- package/dist/esm/notification/index.js.map +1 -0
- package/dist/esm/notification/notification/delete/client.js +4 -0
- package/dist/esm/notification/notification/delete/client.js.map +1 -0
- package/dist/esm/notification/notification/delete/generate-endpoint.js +18 -0
- package/dist/esm/notification/notification/delete/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/notification/delete/generate-parameters.js +10 -0
- package/dist/esm/notification/notification/delete/generate-parameters.js.map +1 -0
- package/dist/esm/notification/notification/delete/index.js +6 -0
- package/dist/esm/notification/notification/delete/index.js.map +1 -0
- package/dist/esm/notification/notification/delete/types.js +2 -0
- package/dist/esm/notification/notification/delete/types.js.map +1 -0
- package/dist/esm/notification/notification/get/client.js +4 -0
- package/dist/esm/notification/notification/get/client.js.map +1 -0
- package/dist/esm/notification/notification/get/generate-endpoint.js +18 -0
- package/dist/esm/notification/notification/get/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/notification/get/generate-parameters.js +7 -0
- package/dist/esm/notification/notification/get/generate-parameters.js.map +1 -0
- package/dist/esm/notification/notification/get/index.js +6 -0
- package/dist/esm/notification/notification/get/index.js.map +1 -0
- package/dist/esm/notification/notification/get/types.js +2 -0
- package/dist/esm/notification/notification/get/types.js.map +1 -0
- package/dist/esm/notification/notification/getAll/client.js +4 -0
- package/dist/esm/notification/notification/getAll/client.js.map +1 -0
- package/dist/esm/notification/notification/getAll/generate-endpoint.js +18 -0
- package/dist/esm/notification/notification/getAll/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/notification/getAll/generate-parameters.js +7 -0
- package/dist/esm/notification/notification/getAll/generate-parameters.js.map +1 -0
- package/dist/esm/notification/notification/getAll/index.js +6 -0
- package/dist/esm/notification/notification/getAll/index.js.map +1 -0
- package/dist/esm/notification/notification/getAll/types.js +2 -0
- package/dist/esm/notification/notification/getAll/types.js.map +1 -0
- package/dist/esm/notification/notification/index.js +6 -0
- package/dist/esm/notification/notification/index.js.map +1 -0
- package/dist/esm/notification/notification/patch/client.js +4 -0
- package/dist/esm/notification/notification/patch/client.js.map +1 -0
- package/dist/esm/notification/notification/patch/generate-endpoint.js +18 -0
- package/dist/esm/notification/notification/patch/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/notification/patch/generate-parameters.js +10 -0
- package/dist/esm/notification/notification/patch/generate-parameters.js.map +1 -0
- package/dist/esm/notification/notification/patch/index.js +6 -0
- package/dist/esm/notification/notification/patch/index.js.map +1 -0
- package/dist/esm/notification/notification/patch/types.js +2 -0
- package/dist/esm/notification/notification/patch/types.js.map +1 -0
- package/dist/esm/notification/notification/post/client.js +4 -0
- package/dist/esm/notification/notification/post/client.js.map +1 -0
- package/dist/esm/notification/notification/post/generate-endpoint.js +18 -0
- package/dist/esm/notification/notification/post/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/notification/post/generate-parameters.js +10 -0
- package/dist/esm/notification/notification/post/generate-parameters.js.map +1 -0
- package/dist/esm/notification/notification/post/index.js +6 -0
- package/dist/esm/notification/notification/post/index.js.map +1 -0
- package/dist/esm/notification/notification/post/types.js +2 -0
- package/dist/esm/notification/notification/post/types.js.map +1 -0
- package/dist/esm/notification/settings/get/client.js +4 -0
- package/dist/esm/notification/settings/get/client.js.map +1 -0
- package/dist/esm/notification/settings/get/generate-endpoint.js +18 -0
- package/dist/esm/notification/settings/get/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/settings/get/generate-parameters.js +7 -0
- package/dist/esm/notification/settings/get/generate-parameters.js.map +1 -0
- package/dist/esm/notification/settings/get/index.js +6 -0
- package/dist/esm/notification/settings/get/index.js.map +1 -0
- package/dist/esm/notification/settings/get/types.js +2 -0
- package/dist/esm/notification/settings/get/types.js.map +1 -0
- package/dist/esm/notification/settings/put/client.js +4 -0
- package/dist/esm/notification/settings/put/client.js.map +1 -0
- package/dist/esm/notification/settings/put/generate-endpoint.js +18 -0
- package/dist/esm/notification/settings/put/generate-endpoint.js.map +1 -0
- package/dist/esm/notification/settings/put/generate-parameters.js +10 -0
- package/dist/esm/notification/settings/put/generate-parameters.js.map +1 -0
- package/dist/esm/notification/settings/put/index.js +6 -0
- package/dist/esm/notification/settings/put/index.js.map +1 -0
- package/dist/esm/notification/settings/put/types.js +2 -0
- package/dist/esm/notification/settings/put/types.js.map +1 -0
- package/dist/esm/notification/static.js +6 -0
- package/dist/esm/notification/static.js.map +1 -0
- package/dist/esm/notification/types.js +2 -0
- package/dist/esm/notification/types.js.map +1 -0
- package/dist/esm/people/api-models.js +2 -0
- package/dist/esm/people/api-models.js.map +1 -0
- package/dist/esm/people/api-models.v2.js +2 -0
- package/dist/esm/people/api-models.v2.js.map +1 -0
- package/dist/esm/people/api-models.v4.js +2 -0
- package/dist/esm/people/api-models.v4.js.map +1 -0
- package/dist/esm/people/client.js +26 -0
- package/dist/esm/people/client.js.map +1 -0
- package/dist/esm/people/index.js +4 -0
- package/dist/esm/people/index.js.map +1 -0
- package/dist/esm/people/person-details/client.js +4 -0
- package/dist/esm/people/person-details/client.js.map +1 -0
- package/dist/esm/people/person-details/generate-endpoint.js +21 -0
- package/dist/esm/people/person-details/generate-endpoint.js.map +1 -0
- package/dist/esm/people/person-details/generate-parameters.js +7 -0
- package/dist/esm/people/person-details/generate-parameters.js.map +1 -0
- package/dist/esm/people/person-details/index.js +5 -0
- package/dist/esm/people/person-details/index.js.map +1 -0
- package/dist/esm/people/person-details/types.js +2 -0
- package/dist/esm/people/person-details/types.js.map +1 -0
- package/dist/esm/people/person-photo/client.js +4 -0
- package/dist/esm/people/person-photo/client.js.map +1 -0
- package/dist/esm/people/person-photo/generate-endpoint.js +18 -0
- package/dist/esm/people/person-photo/generate-endpoint.js.map +1 -0
- package/dist/esm/people/person-photo/generate-parameters.js +7 -0
- package/dist/esm/people/person-photo/generate-parameters.js.map +1 -0
- package/dist/esm/people/person-photo/index.js +5 -0
- package/dist/esm/people/person-photo/index.js.map +1 -0
- package/dist/esm/people/person-photo/types.js +2 -0
- package/dist/esm/people/person-photo/types.js.map +1 -0
- package/dist/esm/people/query/client.js +4 -0
- package/dist/esm/people/query/client.js.map +1 -0
- package/dist/esm/people/query/generate-endpoint.js +19 -0
- package/dist/esm/people/query/generate-endpoint.js.map +1 -0
- package/dist/esm/people/query/generate-parameters.js +7 -0
- package/dist/esm/people/query/generate-parameters.js.map +1 -0
- package/dist/esm/people/query/index.js +5 -0
- package/dist/esm/people/query/index.js.map +1 -0
- package/dist/esm/people/query/types.js +2 -0
- package/dist/esm/people/query/types.js.map +1 -0
- package/dist/esm/people/static.js +6 -0
- package/dist/esm/people/static.js.map +1 -0
- package/dist/esm/provider.js +70 -0
- package/dist/esm/provider.js.map +1 -0
- package/dist/esm/types.js +2 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/bookmarks/api-models.d.ts +42 -0
- package/dist/types/bookmarks/client.d.ts +24 -0
- package/dist/types/bookmarks/delete/client.d.ts +5 -0
- package/dist/types/bookmarks/delete/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/delete/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/delete/index.d.ts +4 -0
- package/dist/types/bookmarks/delete/types-v1.d.ts +3 -0
- package/dist/types/bookmarks/delete/types.d.ts +15 -0
- package/dist/types/bookmarks/favorites/delete/client.d.ts +5 -0
- package/dist/types/bookmarks/favorites/delete/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/favorites/delete/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/favorites/delete/index.d.ts +4 -0
- package/dist/types/bookmarks/favorites/delete/types-v1.d.ts +3 -0
- package/dist/types/bookmarks/favorites/delete/types.d.ts +15 -0
- package/dist/types/bookmarks/favorites/head/client.d.ts +5 -0
- package/dist/types/bookmarks/favorites/head/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/favorites/head/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/favorites/head/index.d.ts +4 -0
- package/dist/types/bookmarks/favorites/head/types.d.ts +17 -0
- package/dist/types/bookmarks/favorites/post/client.d.ts +5 -0
- package/dist/types/bookmarks/favorites/post/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/favorites/post/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/favorites/post/index.d.ts +4 -0
- package/dist/types/bookmarks/favorites/post/types.d.ts +17 -0
- package/dist/types/bookmarks/get/client.d.ts +5 -0
- package/dist/types/bookmarks/get/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/get/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/get/index.d.ts +4 -0
- package/dist/types/bookmarks/get/types.d.ts +19 -0
- package/dist/types/bookmarks/getAll/client.d.ts +5 -0
- package/dist/types/bookmarks/getAll/generate-endpoint.d.ts +1 -0
- package/dist/types/bookmarks/getAll/generate-parameters.d.ts +3 -0
- package/dist/types/bookmarks/getAll/index.d.ts +4 -0
- package/dist/types/bookmarks/getAll/types.d.ts +10 -0
- package/dist/types/bookmarks/index.d.ts +3 -0
- package/dist/types/bookmarks/patch/client.d.ts +5 -0
- package/dist/types/bookmarks/patch/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/patch/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/patch/index.d.ts +4 -0
- package/dist/types/bookmarks/patch/types.d.ts +19 -0
- package/dist/types/bookmarks/post/client.d.ts +5 -0
- package/dist/types/bookmarks/post/generate-endpoint.d.ts +2 -0
- package/dist/types/bookmarks/post/generate-parameters.d.ts +4 -0
- package/dist/types/bookmarks/post/index.d.ts +4 -0
- package/dist/types/bookmarks/post/types.d.ts +28 -0
- package/dist/types/bookmarks/types.d.ts +1 -0
- package/dist/types/configurator.d.ts +6 -0
- package/dist/types/context/api-models.d.ts +31 -0
- package/dist/types/context/client.d.ts +16 -0
- package/dist/types/context/get/client.d.ts +4 -0
- package/dist/types/context/get/generate-endpoint.d.ts +2 -0
- package/dist/types/context/get/generate-parameters.d.ts +4 -0
- package/dist/types/context/get/index.d.ts +5 -0
- package/dist/types/context/get/types.d.ts +19 -0
- package/dist/types/context/index.d.ts +4 -0
- package/dist/types/context/query/client.d.ts +4 -0
- package/dist/types/context/query/generate-endpoint.d.ts +3 -0
- package/dist/types/context/query/generate-parameters.d.ts +4 -0
- package/dist/types/context/query/index.d.ts +5 -0
- package/dist/types/context/query/types.d.ts +32 -0
- package/dist/types/context/related/client.d.ts +4 -0
- package/dist/types/context/related/generate-endpoint.d.ts +3 -0
- package/dist/types/context/related/generate-parameters.d.ts +4 -0
- package/dist/types/context/related/index.d.ts +5 -0
- package/dist/types/context/related/types.d.ts +33 -0
- package/dist/types/context/static.d.ts +4 -0
- package/dist/types/context/types.d.ts +1 -0
- package/dist/types/errors.d.ts +4 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/module.d.ts +20 -0
- package/dist/types/notification/api-models.d.ts +54 -0
- package/dist/types/notification/client.d.ts +24 -0
- package/dist/types/notification/index.d.ts +4 -0
- package/dist/types/notification/notification/delete/client.d.ts +5 -0
- package/dist/types/notification/notification/delete/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/notification/delete/generate-parameters.d.ts +5 -0
- package/dist/types/notification/notification/delete/index.d.ts +5 -0
- package/dist/types/notification/notification/delete/types.d.ts +21 -0
- package/dist/types/notification/notification/get/client.d.ts +5 -0
- package/dist/types/notification/notification/get/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/notification/get/generate-parameters.d.ts +5 -0
- package/dist/types/notification/notification/get/index.d.ts +5 -0
- package/dist/types/notification/notification/get/types.d.ts +21 -0
- package/dist/types/notification/notification/getAll/client.d.ts +5 -0
- package/dist/types/notification/notification/getAll/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/notification/getAll/generate-parameters.d.ts +5 -0
- package/dist/types/notification/notification/getAll/index.d.ts +5 -0
- package/dist/types/notification/notification/getAll/types.d.ts +21 -0
- package/dist/types/notification/notification/index.d.ts +5 -0
- package/dist/types/notification/notification/patch/client.d.ts +5 -0
- package/dist/types/notification/notification/patch/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/notification/patch/generate-parameters.d.ts +5 -0
- package/dist/types/notification/notification/patch/index.d.ts +5 -0
- package/dist/types/notification/notification/patch/types.d.ts +22 -0
- package/dist/types/notification/notification/post/client.d.ts +5 -0
- package/dist/types/notification/notification/post/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/notification/post/generate-parameters.d.ts +5 -0
- package/dist/types/notification/notification/post/index.d.ts +5 -0
- package/dist/types/notification/notification/post/types.d.ts +33 -0
- package/dist/types/notification/settings/get/client.d.ts +5 -0
- package/dist/types/notification/settings/get/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/settings/get/generate-parameters.d.ts +5 -0
- package/dist/types/notification/settings/get/index.d.ts +5 -0
- package/dist/types/notification/settings/get/types.d.ts +21 -0
- package/dist/types/notification/settings/put/client.d.ts +5 -0
- package/dist/types/notification/settings/put/generate-endpoint.d.ts +2 -0
- package/dist/types/notification/settings/put/generate-parameters.d.ts +5 -0
- package/dist/types/notification/settings/put/index.d.ts +5 -0
- package/dist/types/notification/settings/put/types.d.ts +17 -0
- package/dist/types/notification/static.d.ts +4 -0
- package/dist/types/notification/types.d.ts +1 -0
- package/dist/types/people/api-models.d.ts +34 -0
- package/dist/types/people/api-models.v2.d.ts +25 -0
- package/dist/types/people/api-models.v4.d.ts +81 -0
- package/dist/types/people/client.d.ts +15 -0
- package/dist/types/people/index.d.ts +3 -0
- package/dist/types/people/person-details/client.d.ts +5 -0
- package/dist/types/people/person-details/generate-endpoint.d.ts +2 -0
- package/dist/types/people/person-details/generate-parameters.d.ts +5 -0
- package/dist/types/people/person-details/index.d.ts +4 -0
- package/dist/types/people/person-details/types.d.ts +30 -0
- package/dist/types/people/person-photo/client.d.ts +5 -0
- package/dist/types/people/person-photo/generate-endpoint.d.ts +2 -0
- package/dist/types/people/person-photo/generate-parameters.d.ts +5 -0
- package/dist/types/people/person-photo/index.d.ts +4 -0
- package/dist/types/people/person-photo/types.d.ts +16 -0
- package/dist/types/people/query/client.d.ts +5 -0
- package/dist/types/people/query/generate-endpoint.d.ts +2 -0
- package/dist/types/people/query/generate-parameters.d.ts +5 -0
- package/dist/types/people/query/index.d.ts +4 -0
- package/dist/types/people/query/types.d.ts +17 -0
- package/dist/types/people/static.d.ts +4 -0
- package/dist/types/provider.d.ts +37 -0
- package/dist/types/types.d.ts +17 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +85 -0
- package/src/bookmarks/api-models.ts +46 -0
- package/src/bookmarks/client.ts +132 -0
- package/src/bookmarks/delete/client.ts +35 -0
- package/src/bookmarks/delete/generate-endpoint.ts +24 -0
- package/src/bookmarks/delete/generate-parameters.ts +25 -0
- package/src/bookmarks/delete/index.ts +6 -0
- package/src/bookmarks/delete/types-v1.ts +2 -0
- package/src/bookmarks/delete/types.ts +35 -0
- package/src/bookmarks/favorites/delete/client.ts +35 -0
- package/src/bookmarks/favorites/delete/generate-endpoint.ts +19 -0
- package/src/bookmarks/favorites/delete/generate-parameters.ts +25 -0
- package/src/bookmarks/favorites/delete/index.ts +6 -0
- package/src/bookmarks/favorites/delete/types-v1.ts +2 -0
- package/src/bookmarks/favorites/delete/types.ts +33 -0
- package/src/bookmarks/favorites/head/client.ts +35 -0
- package/src/bookmarks/favorites/head/generate-endpoint.ts +19 -0
- package/src/bookmarks/favorites/head/generate-parameters.ts +28 -0
- package/src/bookmarks/favorites/head/index.ts +6 -0
- package/src/bookmarks/favorites/head/types.ts +35 -0
- package/src/bookmarks/favorites/post/client.ts +35 -0
- package/src/bookmarks/favorites/post/generate-endpoint.ts +18 -0
- package/src/bookmarks/favorites/post/generate-parameters.ts +28 -0
- package/src/bookmarks/favorites/post/index.ts +6 -0
- package/src/bookmarks/favorites/post/types.ts +35 -0
- package/src/bookmarks/get/client.ts +30 -0
- package/src/bookmarks/get/generate-endpoint.ts +24 -0
- package/src/bookmarks/get/generate-parameters.ts +18 -0
- package/src/bookmarks/get/index.ts +6 -0
- package/src/bookmarks/get/types.ts +39 -0
- package/src/bookmarks/getAll/client.ts +30 -0
- package/src/bookmarks/getAll/generate-endpoint.ts +15 -0
- package/src/bookmarks/getAll/generate-parameters.ts +18 -0
- package/src/bookmarks/getAll/index.ts +6 -0
- package/src/bookmarks/getAll/types.ts +21 -0
- package/src/bookmarks/index.ts +4 -0
- package/src/bookmarks/patch/client.ts +30 -0
- package/src/bookmarks/patch/generate-endpoint.ts +18 -0
- package/src/bookmarks/patch/generate-parameters.ts +28 -0
- package/src/bookmarks/patch/index.ts +6 -0
- package/src/bookmarks/patch/types.ts +45 -0
- package/src/bookmarks/post/client.ts +30 -0
- package/src/bookmarks/post/generate-endpoint.ts +18 -0
- package/src/bookmarks/post/generate-parameters.ts +28 -0
- package/src/bookmarks/post/index.ts +6 -0
- package/src/bookmarks/post/types.ts +58 -0
- package/src/bookmarks/types.ts +1 -0
- package/src/configurator.ts +8 -0
- package/src/context/api-models.ts +42 -0
- package/src/context/client.ts +76 -0
- package/src/context/get/client.ts +33 -0
- package/src/context/get/generate-endpoint.ts +25 -0
- package/src/context/get/generate-parameters.ts +23 -0
- package/src/context/get/index.ts +8 -0
- package/src/context/get/types.ts +45 -0
- package/src/context/index.ts +6 -0
- package/src/context/query/client.ts +35 -0
- package/src/context/query/generate-endpoint.ts +67 -0
- package/src/context/query/generate-parameters.ts +23 -0
- package/src/context/query/index.ts +8 -0
- package/src/context/query/types.ts +56 -0
- package/src/context/related/client.ts +35 -0
- package/src/context/related/generate-endpoint.ts +63 -0
- package/src/context/related/generate-parameters.ts +23 -0
- package/src/context/related/index.ts +8 -0
- package/src/context/related/types.ts +61 -0
- package/src/context/static.ts +6 -0
- package/src/context/types.ts +1 -0
- package/src/errors.ts +8 -0
- package/src/index.ts +6 -0
- package/src/module.ts +104 -0
- package/src/notification/api-models.ts +70 -0
- package/src/notification/client.ts +170 -0
- package/src/notification/index.ts +6 -0
- package/src/notification/notification/delete/client.ts +37 -0
- package/src/notification/notification/delete/generate-endpoint.ts +24 -0
- package/src/notification/notification/delete/generate-parameters.ts +32 -0
- package/src/notification/notification/delete/index.ts +8 -0
- package/src/notification/notification/delete/types.ts +44 -0
- package/src/notification/notification/get/client.ts +33 -0
- package/src/notification/notification/get/generate-endpoint.ts +25 -0
- package/src/notification/notification/get/generate-parameters.ts +22 -0
- package/src/notification/notification/get/index.ts +8 -0
- package/src/notification/notification/get/types.ts +44 -0
- package/src/notification/notification/getAll/client.ts +37 -0
- package/src/notification/notification/getAll/generate-endpoint.ts +25 -0
- package/src/notification/notification/getAll/generate-parameters.ts +22 -0
- package/src/notification/notification/getAll/index.ts +8 -0
- package/src/notification/notification/getAll/types.ts +44 -0
- package/src/notification/notification/index.ts +5 -0
- package/src/notification/notification/patch/client.ts +37 -0
- package/src/notification/notification/patch/generate-endpoint.ts +24 -0
- package/src/notification/notification/patch/generate-parameters.ts +32 -0
- package/src/notification/notification/patch/index.ts +8 -0
- package/src/notification/notification/patch/types.ts +45 -0
- package/src/notification/notification/post/client.ts +37 -0
- package/src/notification/notification/post/generate-endpoint.ts +25 -0
- package/src/notification/notification/post/generate-parameters.ts +32 -0
- package/src/notification/notification/post/index.ts +8 -0
- package/src/notification/notification/post/types.ts +57 -0
- package/src/notification/settings/get/client.ts +37 -0
- package/src/notification/settings/get/generate-endpoint.ts +25 -0
- package/src/notification/settings/get/generate-parameters.ts +22 -0
- package/src/notification/settings/get/index.ts +8 -0
- package/src/notification/settings/get/types.ts +44 -0
- package/src/notification/settings/put/client.ts +37 -0
- package/src/notification/settings/put/generate-endpoint.ts +25 -0
- package/src/notification/settings/put/generate-parameters.ts +34 -0
- package/src/notification/settings/put/index.ts +8 -0
- package/src/notification/settings/put/types.ts +38 -0
- package/src/notification/static.ts +6 -0
- package/src/notification/types.ts +1 -0
- package/src/people/api-models.ts +52 -0
- package/src/people/api-models.v2.ts +31 -0
- package/src/people/api-models.v4.ts +100 -0
- package/src/people/client.ts +109 -0
- package/src/people/index.ts +5 -0
- package/src/people/person-details/client.ts +33 -0
- package/src/people/person-details/generate-endpoint.ts +28 -0
- package/src/people/person-details/generate-parameters.ts +22 -0
- package/src/people/person-details/index.ts +6 -0
- package/src/people/person-details/types.ts +54 -0
- package/src/people/person-photo/client.ts +33 -0
- package/src/people/person-photo/generate-endpoint.ts +25 -0
- package/src/people/person-photo/generate-parameters.ts +22 -0
- package/src/people/person-photo/index.ts +6 -0
- package/src/people/person-photo/types.ts +24 -0
- package/src/people/query/client.ts +33 -0
- package/src/people/query/generate-endpoint.ts +26 -0
- package/src/people/query/generate-parameters.ts +22 -0
- package/src/people/query/index.ts +6 -0
- package/src/people/query/types.ts +28 -0
- package/src/people/static.ts +4 -0
- package/src/provider.ts +115 -0
- package/src/types.ts +46 -0
- package/src/version.ts +2 -0
- package/tsconfig.json +38 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { ApiVersion } from '..';
|
|
4
|
+
|
|
5
|
+
import { generateParameters } from './generate-parameters';
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
RelatedContextArgs,
|
|
9
|
+
RelatedContextResponse,
|
|
10
|
+
RelatedContextResult,
|
|
11
|
+
ClientMethod,
|
|
12
|
+
} from './types';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Function for querying the context service
|
|
16
|
+
*/
|
|
17
|
+
export const relatedContexts =
|
|
18
|
+
<
|
|
19
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
20
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
21
|
+
TClient extends IHttpClient = IHttpClient,
|
|
22
|
+
>(
|
|
23
|
+
client: TClient,
|
|
24
|
+
version: TVersion,
|
|
25
|
+
method: TMethod = 'json' as TMethod,
|
|
26
|
+
) =>
|
|
27
|
+
<T = RelatedContextResponse<TVersion>>(
|
|
28
|
+
args: RelatedContextArgs<TVersion>,
|
|
29
|
+
init?: ClientRequestInit<TClient, T>,
|
|
30
|
+
): RelatedContextResult<TVersion, TMethod, T> =>
|
|
31
|
+
client[method](
|
|
32
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
33
|
+
) as RelatedContextResult<TVersion, TMethod, T>;
|
|
34
|
+
|
|
35
|
+
export default relatedContexts;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import buildOdataQuery from 'odata-query';
|
|
2
|
+
|
|
3
|
+
import { UnsupportedApiVersion } from '../../errors';
|
|
4
|
+
|
|
5
|
+
import { ApiVersion } from '..';
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
RelatedContextArgs,
|
|
9
|
+
RelatedContextOdataFilter,
|
|
10
|
+
RelatedContextOdataParameters,
|
|
11
|
+
} from './types';
|
|
12
|
+
|
|
13
|
+
const buildOdataFilter = (filterObj: RelatedContextOdataFilter) => {
|
|
14
|
+
return Object.keys(filterObj).reduce((acc, key) => {
|
|
15
|
+
switch (key) {
|
|
16
|
+
case 'type':
|
|
17
|
+
return filterObj[key]?.length ? { ...acc, [key]: { in: filterObj[key] } } : acc;
|
|
18
|
+
default:
|
|
19
|
+
return { ...acc, [key]: filterObj[key as keyof typeof filterObj] };
|
|
20
|
+
}
|
|
21
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
22
|
+
}, {} as any);
|
|
23
|
+
};
|
|
24
|
+
const buildOdataObject = (parameters: RelatedContextOdataParameters) => {
|
|
25
|
+
return Object.entries(parameters)
|
|
26
|
+
.filter(([_, value]) => !!value)
|
|
27
|
+
.reduce((acc, [key, value]) => {
|
|
28
|
+
switch (key) {
|
|
29
|
+
case 'filter':
|
|
30
|
+
return {
|
|
31
|
+
...acc,
|
|
32
|
+
[key]: buildOdataFilter(value as RelatedContextOdataFilter),
|
|
33
|
+
};
|
|
34
|
+
default:
|
|
35
|
+
return { ...acc, [key]: parameters[key as keyof typeof parameters] };
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
}, {} as any);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const createSearchParameters = (args: string | RelatedContextOdataParameters) => {
|
|
42
|
+
return typeof args === 'string' ? args : buildOdataQuery(buildOdataObject(args));
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const generateEndpoint = <TVersion extends string = keyof typeof ApiVersion>(
|
|
46
|
+
version: TVersion,
|
|
47
|
+
args: RelatedContextArgs<TVersion>,
|
|
48
|
+
) => {
|
|
49
|
+
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
50
|
+
switch (apiVersion) {
|
|
51
|
+
case ApiVersion.v2:
|
|
52
|
+
throw new UnsupportedApiVersion(version);
|
|
53
|
+
case ApiVersion.v1:
|
|
54
|
+
default: {
|
|
55
|
+
const { id, query } = args as RelatedContextArgs<'v1'>;
|
|
56
|
+
const params = new URLSearchParams(createSearchParameters(query || ''));
|
|
57
|
+
params.append('api-version', apiVersion);
|
|
58
|
+
return `/contexts/${id}/relations?${String(params)}`;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export default generateEndpoint;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { ApiVersion } from '..';
|
|
4
|
+
|
|
5
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
6
|
+
|
|
7
|
+
import type { RelatedContextArgs, ApiClientArguments } from './types';
|
|
8
|
+
|
|
9
|
+
/** Function for generating parameter for querying context service */
|
|
10
|
+
export const generateParameters = <
|
|
11
|
+
TResult,
|
|
12
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
13
|
+
TClient extends IHttpClient = IHttpClient,
|
|
14
|
+
>(
|
|
15
|
+
version: TVersion,
|
|
16
|
+
args: RelatedContextArgs<TVersion>,
|
|
17
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
18
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
19
|
+
const path = generateEndpoint(version, args);
|
|
20
|
+
return [path, init];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export default generateParameters;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { IHttpClient, ClientRequestInit } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { ApiVersion, ApiContextEntity, ClientMethod } from '..';
|
|
4
|
+
|
|
5
|
+
export { ApiClientArguments, ClientMethod } from '..';
|
|
6
|
+
|
|
7
|
+
export type ApiRelatedContextEntity<T extends ApiVersion> = ApiContextEntity<T> & {
|
|
8
|
+
relationSource: string; // "ProjectMaster|OrgChart",
|
|
9
|
+
relationType: unknown;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type RelatedContextOdataFilter = {
|
|
13
|
+
type?: string[];
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type RelatedContextOdataParameters = {
|
|
17
|
+
search?: string;
|
|
18
|
+
filter?: RelatedContextOdataFilter;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
type RelatedContextArgs_v1 = {
|
|
22
|
+
/** context id */
|
|
23
|
+
id: string;
|
|
24
|
+
query?: string | RelatedContextOdataParameters;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
type RelatedContextArgs_v2 = RelatedContextArgs_v1;
|
|
28
|
+
|
|
29
|
+
type RelatedContextArgTypes = {
|
|
30
|
+
[ApiVersion.v1]: RelatedContextArgs_v1;
|
|
31
|
+
[ApiVersion.v2]: RelatedContextArgs_v2;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export type RelatedContextArgs<T> = T extends keyof typeof ApiVersion
|
|
35
|
+
? RelatedContextArgTypes[(typeof ApiVersion)[T]]
|
|
36
|
+
: { id: string };
|
|
37
|
+
|
|
38
|
+
type RelatedContextResponseTypes = {
|
|
39
|
+
[ApiVersion.v1]: Array<ApiRelatedContextEntity<ApiVersion.v1>>;
|
|
40
|
+
[ApiVersion.v2]: Array<ApiRelatedContextEntity<ApiVersion.v2>>;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export type RelatedContextResponse<T> = T extends keyof typeof ApiVersion
|
|
44
|
+
? RelatedContextResponseTypes[(typeof ApiVersion)[T]]
|
|
45
|
+
: unknown;
|
|
46
|
+
|
|
47
|
+
export type RelatedContextFn<
|
|
48
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
49
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
50
|
+
TClient extends IHttpClient = IHttpClient,
|
|
51
|
+
TResult = RelatedContextResponse<TVersion>,
|
|
52
|
+
> = (
|
|
53
|
+
args: RelatedContextArgs<TVersion>,
|
|
54
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
55
|
+
) => RelatedContextResult<TVersion, TMethod, TResult>;
|
|
56
|
+
|
|
57
|
+
export type RelatedContextResult<
|
|
58
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
59
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
60
|
+
TResult = RelatedContextResponse<TVersion>,
|
|
61
|
+
> = ClientMethod<TResult>[TMethod];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ClientMethodType, ClientMethod, ApiClientArguments } from '..';
|
package/src/errors.ts
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export type { ServicesModule, ServicesModuleKey } from './module';
|
|
3
|
+
|
|
4
|
+
export { ApiConfigurator, IApiConfigurator } from './configurator';
|
|
5
|
+
export { ApiProvider, IApiProvider } from './provider';
|
|
6
|
+
export { default, module, enableServices, configureServices } from './module';
|
package/src/module.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
IModuleConfigurator,
|
|
3
|
+
IModulesConfigurator,
|
|
4
|
+
Module,
|
|
5
|
+
} from '@equinor/fusion-framework-module';
|
|
6
|
+
import type { HttpModule, IHttpClientProvider } from '@equinor/fusion-framework-module-http';
|
|
7
|
+
import type {
|
|
8
|
+
ServiceDiscoveryModule,
|
|
9
|
+
ServiceDiscoveryProvider,
|
|
10
|
+
} from '@equinor/fusion-framework-module-service-discovery';
|
|
11
|
+
|
|
12
|
+
import { IApiConfigurator, ApiConfigurator } from './configurator';
|
|
13
|
+
import { IApiProvider, ApiProvider } from './provider';
|
|
14
|
+
|
|
15
|
+
import type { ApiClientFactory } from './types';
|
|
16
|
+
|
|
17
|
+
export type ServicesModuleKey = 'services';
|
|
18
|
+
|
|
19
|
+
export const moduleKey: ServicesModuleKey = 'services';
|
|
20
|
+
|
|
21
|
+
export type ServicesModule = Module<
|
|
22
|
+
ServicesModuleKey,
|
|
23
|
+
IApiProvider,
|
|
24
|
+
IApiConfigurator,
|
|
25
|
+
[HttpModule, ServiceDiscoveryModule]
|
|
26
|
+
>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Method to trying to resolve method for creating an IHttpClient
|
|
30
|
+
*/
|
|
31
|
+
const createDefaultClient =
|
|
32
|
+
(http: IHttpClientProvider, serviceDiscovery?: ServiceDiscoveryProvider): ApiClientFactory =>
|
|
33
|
+
async (name: string) => {
|
|
34
|
+
if (http.hasClient(name)) {
|
|
35
|
+
return http.createClient(name);
|
|
36
|
+
}
|
|
37
|
+
if (serviceDiscovery) {
|
|
38
|
+
return serviceDiscovery.createClient(name);
|
|
39
|
+
}
|
|
40
|
+
throw Error(`failed to create http client for service ${name}`);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Configure http-client
|
|
45
|
+
*/
|
|
46
|
+
export const module: ServicesModule = {
|
|
47
|
+
name: moduleKey,
|
|
48
|
+
configure: () => new ApiConfigurator(),
|
|
49
|
+
initialize: async ({ ref, config, requireInstance, hasModule }) => {
|
|
50
|
+
/** we can not create this callback within the configuration, since it might require other modules. */
|
|
51
|
+
if (!config.createClient) {
|
|
52
|
+
const http = await requireInstance('http');
|
|
53
|
+
const serviceDiscovery: ServiceDiscoveryProvider | undefined = hasModule(
|
|
54
|
+
'serviceDiscovery',
|
|
55
|
+
)
|
|
56
|
+
? /** if the module is within module, await creation */
|
|
57
|
+
await requireInstance('serviceDiscovery')
|
|
58
|
+
: /** try to load parent service discovery provider */
|
|
59
|
+
ref?.serviceDiscovery;
|
|
60
|
+
|
|
61
|
+
config.createClient = createDefaultClient(http, serviceDiscovery);
|
|
62
|
+
}
|
|
63
|
+
if (!config.createClient) {
|
|
64
|
+
throw Error('missing configuration for creating API client');
|
|
65
|
+
}
|
|
66
|
+
return new ApiProvider(config as Required<IApiConfigurator>);
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Method for enabling the Service module
|
|
72
|
+
* @param config - configuration object
|
|
73
|
+
*/
|
|
74
|
+
export const enableServices = (
|
|
75
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
76
|
+
config: IModulesConfigurator<any, any>,
|
|
77
|
+
): void => {
|
|
78
|
+
config.addConfig({ module });
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* config.addConfig(x => x.createClient(...));
|
|
85
|
+
* ```
|
|
86
|
+
* @param configure - Callback for configuring the module
|
|
87
|
+
* @returns Configuration object
|
|
88
|
+
*/
|
|
89
|
+
export const configureServices = (
|
|
90
|
+
configure: (configurator: IApiConfigurator) => void,
|
|
91
|
+
): IModuleConfigurator<ServicesModule> => {
|
|
92
|
+
return {
|
|
93
|
+
module,
|
|
94
|
+
configure,
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
declare module '@equinor/fusion-framework-module' {
|
|
99
|
+
interface Modules {
|
|
100
|
+
services: ServicesModule;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export default module;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ApiVersion } from './static';
|
|
2
|
+
|
|
3
|
+
type ApiNotificationEntity_v1 = {
|
|
4
|
+
id: string;
|
|
5
|
+
appKey: string;
|
|
6
|
+
emailPriority: number;
|
|
7
|
+
fallbackHtml: string;
|
|
8
|
+
targetAzureUniqueId: string;
|
|
9
|
+
title: string;
|
|
10
|
+
card: string;
|
|
11
|
+
created: string;
|
|
12
|
+
createdBy: CreatedBy_v1;
|
|
13
|
+
createdByApplication: CreatedByApplication_v1;
|
|
14
|
+
seenByUser: boolean;
|
|
15
|
+
seen: string;
|
|
16
|
+
sourceSystem: SourceSystem_v1;
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type SourceSystem_v1 = {
|
|
20
|
+
name: string;
|
|
21
|
+
subSystem: string;
|
|
22
|
+
identifier: string;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
type CreatedByApplication_v1 = {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type CreatedBy_v1 = {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
jobTitle: string;
|
|
34
|
+
mail: string;
|
|
35
|
+
accountType: string;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
type ApiNotificationEntity_v2 = unknown;
|
|
39
|
+
|
|
40
|
+
type ApiNotificationEntityTypes = {
|
|
41
|
+
[ApiVersion.v1]: ApiNotificationEntity_v1;
|
|
42
|
+
[ApiVersion.v2]: ApiNotificationEntity_v2;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export type ApiNotificationEntity<T extends string = ApiVersion> = T extends ApiVersion
|
|
46
|
+
? ApiNotificationEntityTypes[T]
|
|
47
|
+
: unknown;
|
|
48
|
+
|
|
49
|
+
/**User notification Settings */
|
|
50
|
+
type ApiNotificationSettingsEntity_v1 = {
|
|
51
|
+
email: boolean;
|
|
52
|
+
delayInMinutes: number;
|
|
53
|
+
appConfig: AppConfig_v1[];
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type AppConfig_v1 = {
|
|
57
|
+
appKey: string;
|
|
58
|
+
enabled: boolean;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
type ApiNotificationSettingsEntity_v2 = unknown;
|
|
62
|
+
|
|
63
|
+
type ApiNotificationSettingEntityTypes = {
|
|
64
|
+
[ApiVersion.v1]: ApiNotificationSettingsEntity_v1;
|
|
65
|
+
[ApiVersion.v2]: ApiNotificationSettingsEntity_v2;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export type ApiNotificationSettingsEntity<T extends string = ApiVersion> = T extends ApiVersion
|
|
69
|
+
? ApiNotificationSettingEntityTypes[T]
|
|
70
|
+
: unknown;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
|
+
import { ClientMethod } from '../types';
|
|
3
|
+
import { GetNotificationFn, GetNotificationResult } from './notification/get';
|
|
4
|
+
import {
|
|
5
|
+
createNotification,
|
|
6
|
+
deleteNotification,
|
|
7
|
+
getNotificationById,
|
|
8
|
+
getNotifications,
|
|
9
|
+
updateSeenByUser,
|
|
10
|
+
} from './notification';
|
|
11
|
+
import { ApiVersion } from './static';
|
|
12
|
+
import { PatchNotificationFn, PatchNotificationResult } from './notification/patch';
|
|
13
|
+
import { GetNotificationsFn, GetNotificationsResult } from './notification/getAll';
|
|
14
|
+
import { PostNotificationResult, PostNotificationFn } from './notification/post';
|
|
15
|
+
import { DeleteNotificationFn, DeleteNotificationResult } from './notification/delete';
|
|
16
|
+
import updateUserNotificationSettings, {
|
|
17
|
+
PutUserNotificationSettingsFn,
|
|
18
|
+
PutUserNotificationSettingsResult,
|
|
19
|
+
} from './settings/put';
|
|
20
|
+
import getUserNotificationSettings, {
|
|
21
|
+
GetUserNotificationSettingsFn,
|
|
22
|
+
GetUserNotificationsSettingsResult,
|
|
23
|
+
} from './settings/get';
|
|
24
|
+
|
|
25
|
+
export class NotificationApiClient<
|
|
26
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
27
|
+
TClient extends IHttpClient = IHttpClient,
|
|
28
|
+
> {
|
|
29
|
+
get Version(): typeof ApiVersion {
|
|
30
|
+
return ApiVersion;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
constructor(
|
|
34
|
+
protected _client: TClient,
|
|
35
|
+
protected _method: TMethod,
|
|
36
|
+
) {}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Fetch all notifications
|
|
40
|
+
* @see {@link getAll/client}
|
|
41
|
+
*/
|
|
42
|
+
public getAll<
|
|
43
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
44
|
+
TResult = GetNotificationsResult<TVersion>,
|
|
45
|
+
>(
|
|
46
|
+
version: TVersion,
|
|
47
|
+
...args: Parameters<GetNotificationsFn<TVersion, TMethod, TClient, TResult>>
|
|
48
|
+
): GetNotificationsResult<TVersion, TMethod, TResult> {
|
|
49
|
+
const fn = getNotifications<TVersion, TMethod, TClient>(
|
|
50
|
+
this._client,
|
|
51
|
+
version,
|
|
52
|
+
this._method,
|
|
53
|
+
);
|
|
54
|
+
return fn<TResult>(...args);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Fetch notification by id
|
|
59
|
+
* @see {@link getById/client}
|
|
60
|
+
*/
|
|
61
|
+
public getById<
|
|
62
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
63
|
+
TResult = GetNotificationResult<TVersion>,
|
|
64
|
+
>(
|
|
65
|
+
version: TVersion,
|
|
66
|
+
...args: Parameters<GetNotificationFn<TVersion, TMethod, TClient, TResult>>
|
|
67
|
+
): GetNotificationResult<TVersion, TMethod, TResult> {
|
|
68
|
+
const fn = getNotificationById<TVersion, TMethod, TClient>(
|
|
69
|
+
this._client,
|
|
70
|
+
version,
|
|
71
|
+
this._method,
|
|
72
|
+
);
|
|
73
|
+
return fn<TResult>(...args);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Set notification seen by user
|
|
78
|
+
* @see {@link setSeenByUser/client}
|
|
79
|
+
*/
|
|
80
|
+
public setSeenByUser<
|
|
81
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
82
|
+
TResult = PatchNotificationResult<TVersion>,
|
|
83
|
+
>(
|
|
84
|
+
version: TVersion,
|
|
85
|
+
...args: Parameters<PatchNotificationFn<TVersion, TMethod, TClient, TResult>>
|
|
86
|
+
): PatchNotificationResult<TVersion, TMethod, TResult> {
|
|
87
|
+
const fn = updateSeenByUser<TVersion, TMethod, TClient>(
|
|
88
|
+
this._client,
|
|
89
|
+
version,
|
|
90
|
+
this._method,
|
|
91
|
+
);
|
|
92
|
+
return fn<TResult>(...args);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Create a notification
|
|
97
|
+
* @see {@link create/client}
|
|
98
|
+
*/
|
|
99
|
+
public create<
|
|
100
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
101
|
+
TResult = PostNotificationResult<TVersion>,
|
|
102
|
+
>(
|
|
103
|
+
version: TVersion,
|
|
104
|
+
...args: Parameters<PostNotificationFn<TVersion, TMethod, TClient, TResult>>
|
|
105
|
+
): PostNotificationResult<TVersion, TMethod, TResult> {
|
|
106
|
+
const fn = createNotification<TVersion, TMethod, TClient>(
|
|
107
|
+
this._client,
|
|
108
|
+
version,
|
|
109
|
+
this._method,
|
|
110
|
+
);
|
|
111
|
+
return fn<TResult>(...args);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Delete a notification
|
|
116
|
+
* @see {@link delete/client}
|
|
117
|
+
*/
|
|
118
|
+
public delete<
|
|
119
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
120
|
+
TResult = PostNotificationResult<TVersion>,
|
|
121
|
+
>(
|
|
122
|
+
version: TVersion,
|
|
123
|
+
...args: Parameters<DeleteNotificationFn<TVersion, TMethod, TClient, TResult>>
|
|
124
|
+
): DeleteNotificationResult<TVersion, TMethod, TResult> {
|
|
125
|
+
const fn = deleteNotification<TVersion, TMethod, TClient>(
|
|
126
|
+
this._client,
|
|
127
|
+
version,
|
|
128
|
+
this._method,
|
|
129
|
+
);
|
|
130
|
+
return fn<TResult>(...args);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Get users notification settings
|
|
134
|
+
* @see {@link getSettings/client}
|
|
135
|
+
*/
|
|
136
|
+
public getSettings<
|
|
137
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
138
|
+
TResult = PostNotificationResult<TVersion>,
|
|
139
|
+
>(
|
|
140
|
+
version: TVersion,
|
|
141
|
+
...args: Parameters<GetUserNotificationSettingsFn<TVersion, TMethod, TClient, TResult>>
|
|
142
|
+
): GetUserNotificationsSettingsResult<TVersion, TMethod, TResult> {
|
|
143
|
+
const fn = getUserNotificationSettings<TVersion, TMethod, TClient>(
|
|
144
|
+
this._client,
|
|
145
|
+
version,
|
|
146
|
+
this._method,
|
|
147
|
+
);
|
|
148
|
+
return fn<TResult>(...args);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Update user notification settings
|
|
152
|
+
* @see {@link updateSettings/client}
|
|
153
|
+
*/
|
|
154
|
+
public updateSettings<
|
|
155
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
156
|
+
TResult = PostNotificationResult<TVersion>,
|
|
157
|
+
>(
|
|
158
|
+
version: TVersion,
|
|
159
|
+
...args: Parameters<PutUserNotificationSettingsFn<TVersion, TMethod, TClient, TResult>>
|
|
160
|
+
): PutUserNotificationSettingsResult<TVersion, TMethod, TResult> {
|
|
161
|
+
const fn = updateUserNotificationSettings<TVersion, TMethod, TClient>(
|
|
162
|
+
this._client,
|
|
163
|
+
version,
|
|
164
|
+
this._method,
|
|
165
|
+
);
|
|
166
|
+
return fn<TResult>(...args);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export default NotificationApiClient;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
import { ClientMethod } from '../../../types';
|
|
3
|
+
import { ApiVersion } from '../../static';
|
|
4
|
+
|
|
5
|
+
import { generateParameters } from './generate-parameters';
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
DeleteNotificationArgs,
|
|
9
|
+
DeleteNotificationResponse,
|
|
10
|
+
DeleteNotificationResult,
|
|
11
|
+
} from './types';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Method for deleting notification item from notifications service
|
|
15
|
+
* @param client - client for execution of request
|
|
16
|
+
* @param version - version of API to call
|
|
17
|
+
* @param method - client method to call
|
|
18
|
+
*/
|
|
19
|
+
export const deleteNotification =
|
|
20
|
+
<
|
|
21
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
22
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
23
|
+
TClient extends IHttpClient = IHttpClient,
|
|
24
|
+
>(
|
|
25
|
+
client: TClient,
|
|
26
|
+
version: TVersion,
|
|
27
|
+
method: TMethod = 'json' as TMethod,
|
|
28
|
+
) =>
|
|
29
|
+
<T = DeleteNotificationResponse<TVersion>>(
|
|
30
|
+
args: DeleteNotificationArgs<TVersion>,
|
|
31
|
+
init?: ClientRequestInit<TClient, T>,
|
|
32
|
+
): DeleteNotificationResult<TVersion, TMethod, T> =>
|
|
33
|
+
client[method](
|
|
34
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
35
|
+
) as DeleteNotificationResult<TVersion, TMethod, T>;
|
|
36
|
+
|
|
37
|
+
export default deleteNotification;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { UnsupportedApiVersion } from '../../../errors';
|
|
2
|
+
import { ApiVersion } from '../..';
|
|
3
|
+
import type { DeleteNotificationArgs } from './types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Method for generating endpoint for getting notification by id
|
|
7
|
+
*/
|
|
8
|
+
export const generateEndpoint = <TVersion extends string = keyof typeof ApiVersion>(
|
|
9
|
+
version: TVersion,
|
|
10
|
+
args: DeleteNotificationArgs<TVersion>,
|
|
11
|
+
) => {
|
|
12
|
+
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
13
|
+
switch (apiVersion) {
|
|
14
|
+
case ApiVersion.v2:
|
|
15
|
+
throw new UnsupportedApiVersion(version);
|
|
16
|
+
case ApiVersion.v1:
|
|
17
|
+
default: {
|
|
18
|
+
const { id } = args as { id: string };
|
|
19
|
+
const params = new URLSearchParams();
|
|
20
|
+
params.append('api-version', apiVersion);
|
|
21
|
+
return `/notification/${id}/?${String(params)}`;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
import { ApiVersion } from '../../static';
|
|
3
|
+
import { ApiClientArguments } from '../../types';
|
|
4
|
+
|
|
5
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
6
|
+
import { DeleteNotificationArgs } from './types';
|
|
7
|
+
|
|
8
|
+
/** function for creating http client arguments */
|
|
9
|
+
export const generateParameters = <
|
|
10
|
+
TResult,
|
|
11
|
+
TVersion extends string = keyof typeof ApiVersion,
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
|
+
>(
|
|
14
|
+
version: TVersion,
|
|
15
|
+
args: DeleteNotificationArgs<TVersion>,
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
18
|
+
const path = generateEndpoint(version, args);
|
|
19
|
+
|
|
20
|
+
const headers = new Headers();
|
|
21
|
+
headers.append('content-type', 'application/json');
|
|
22
|
+
|
|
23
|
+
const requestParams: ClientRequestInit<TClient, TResult> = Object.assign(
|
|
24
|
+
{},
|
|
25
|
+
{ method: 'delete', headers: headers },
|
|
26
|
+
init,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return [path, requestParams];
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default generateParameters;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ApiVersion } from '../..';
|
|
2
|
+
|
|
3
|
+
export { generateEndpoint } from './generate-endpoint';
|
|
4
|
+
export { generateParameters } from './generate-parameters';
|
|
5
|
+
|
|
6
|
+
export * from './types';
|
|
7
|
+
|
|
8
|
+
export { deleteNotification as getNotificationById, default } from './client';
|