@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,22 @@
|
|
|
1
|
+
import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
4
|
+
|
|
5
|
+
import type { ApiClientArguments } from '../../types';
|
|
6
|
+
import type { ApiRequestArgs, SupportedApiVersion } from './types';
|
|
7
|
+
|
|
8
|
+
/** function for creating http client arguments */
|
|
9
|
+
export const generateParameters = <
|
|
10
|
+
TResult,
|
|
11
|
+
TVersion extends SupportedApiVersion,
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
|
+
>(
|
|
14
|
+
version: TVersion,
|
|
15
|
+
args: ApiRequestArgs<TVersion>,
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
18
|
+
const path = generateEndpoint(version, args);
|
|
19
|
+
return [path, init];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default generateParameters;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ApiVersion } from '../static';
|
|
2
|
+
import type { ApiManager } from '../api-models';
|
|
3
|
+
import type {
|
|
4
|
+
ApiCompanyInfo_v4,
|
|
5
|
+
ApiPersonContract_v4,
|
|
6
|
+
ApiPerson_v4,
|
|
7
|
+
ApiPersonPosition_v4,
|
|
8
|
+
ApiPersonRole_v4,
|
|
9
|
+
} from '../api-models.v4';
|
|
10
|
+
import { ClientMethod } from '../../types';
|
|
11
|
+
|
|
12
|
+
export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v4'>;
|
|
13
|
+
|
|
14
|
+
type ApiRequestArgsMap = {
|
|
15
|
+
[ApiVersion.v4]: {
|
|
16
|
+
azureId: string;
|
|
17
|
+
expand?: Array<keyof ExpandMap[ApiVersion.v4]>;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
|
|
22
|
+
|
|
23
|
+
type ExpandMap = {
|
|
24
|
+
[ApiVersion.v4]: {
|
|
25
|
+
roles: Array<ApiPersonRole_v4>;
|
|
26
|
+
positions: Array<ApiPersonPosition_v4>;
|
|
27
|
+
contracts: Array<ApiPersonContract_v4>;
|
|
28
|
+
manager: ApiManager;
|
|
29
|
+
companies: Array<ApiCompanyInfo_v4>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type ApiRequestArgs<T extends SupportedApiVersion> =
|
|
34
|
+
ApiRequestArgsMap[(typeof ApiVersion)[T]];
|
|
35
|
+
|
|
36
|
+
type ApiResponseTypes<TArgs extends AllowedArgs> = {
|
|
37
|
+
[ApiVersion.v4]: TArgs['expand'] extends Array<keyof ExpandMap[ApiVersion.v4]>
|
|
38
|
+
? ApiPerson_v4 & {
|
|
39
|
+
[K in TArgs['expand'][number]]: ExpandMap[ApiVersion.v4][K];
|
|
40
|
+
}
|
|
41
|
+
: ApiPerson_v4;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type ApiResponse<
|
|
45
|
+
T extends SupportedApiVersion,
|
|
46
|
+
TArgs extends AllowedArgs,
|
|
47
|
+
> = ApiResponseTypes<TArgs>[(typeof ApiVersion)[T]];
|
|
48
|
+
|
|
49
|
+
export type ApiResult<
|
|
50
|
+
TVersion extends SupportedApiVersion,
|
|
51
|
+
TArgs extends ApiRequestArgs<TVersion>,
|
|
52
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
53
|
+
TResult = ApiResponse<TVersion, TArgs>,
|
|
54
|
+
> = ClientMethod<TResult>[TMethod];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { generateParameters } from './generate-parameters';
|
|
4
|
+
|
|
5
|
+
import type { ClientDataMethod } from '../../types';
|
|
6
|
+
import type { ApiResponse, ApiRequestArgs, SupportedApiVersion } from './types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Method for fetching context item from context service
|
|
10
|
+
* @param client - client for execution of request
|
|
11
|
+
* @param version - version of API to call
|
|
12
|
+
* @param method - client method to call
|
|
13
|
+
*/
|
|
14
|
+
export const client =
|
|
15
|
+
<
|
|
16
|
+
TVersion extends SupportedApiVersion,
|
|
17
|
+
TMethod extends keyof ClientDataMethod = keyof ClientDataMethod,
|
|
18
|
+
TClient extends IHttpClient = IHttpClient,
|
|
19
|
+
TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>,
|
|
20
|
+
>(
|
|
21
|
+
client: TClient,
|
|
22
|
+
version: TVersion,
|
|
23
|
+
method: TMethod = 'blob' as TMethod,
|
|
24
|
+
) =>
|
|
25
|
+
<T extends Blob = ApiResponse<TVersion>>(
|
|
26
|
+
args: TArgs,
|
|
27
|
+
init?: ClientRequestInit<TClient, T>,
|
|
28
|
+
): ClientDataMethod[TMethod] =>
|
|
29
|
+
client[method](
|
|
30
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
31
|
+
) as ClientDataMethod[TMethod];
|
|
32
|
+
|
|
33
|
+
export default client;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { UnsupportedApiVersion } from '../../errors';
|
|
2
|
+
import { ApiVersion } from '../static';
|
|
3
|
+
|
|
4
|
+
import type { ApiRequestArgs, SupportedApiVersion } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Method for generating endpoint for getting context by id
|
|
8
|
+
*/
|
|
9
|
+
export const generateEndpoint = <TVersion extends SupportedApiVersion>(
|
|
10
|
+
version: TVersion,
|
|
11
|
+
args: ApiRequestArgs<TVersion>,
|
|
12
|
+
) => {
|
|
13
|
+
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
14
|
+
switch (apiVersion) {
|
|
15
|
+
case ApiVersion.v2: {
|
|
16
|
+
const { azureId } = args;
|
|
17
|
+
const params = new URLSearchParams();
|
|
18
|
+
params.append('api-version', apiVersion);
|
|
19
|
+
return `/persons/${azureId}/photo?${String(params)}`;
|
|
20
|
+
}
|
|
21
|
+
default: {
|
|
22
|
+
throw new UnsupportedApiVersion(version);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
4
|
+
|
|
5
|
+
import type { ApiClientArguments } from '../../types';
|
|
6
|
+
import type { ApiRequestArgs, SupportedApiVersion } from './types';
|
|
7
|
+
|
|
8
|
+
/** function for creating http client arguments */
|
|
9
|
+
export const generateParameters = <
|
|
10
|
+
TResult,
|
|
11
|
+
TVersion extends SupportedApiVersion,
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
|
+
>(
|
|
14
|
+
version: TVersion,
|
|
15
|
+
args: ApiRequestArgs<TVersion>,
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
18
|
+
const path = generateEndpoint(version, args);
|
|
19
|
+
return [path, init];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default generateParameters;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ApiVersion } from '../static';
|
|
2
|
+
import { ClientDataMethod } from '../../types';
|
|
3
|
+
|
|
4
|
+
export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v2'>;
|
|
5
|
+
|
|
6
|
+
type ApiRequestArgsMap = {
|
|
7
|
+
[ApiVersion.v2]: {
|
|
8
|
+
azureId: string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
|
|
13
|
+
|
|
14
|
+
export type ApiRequestArgs<T extends SupportedApiVersion> =
|
|
15
|
+
ApiRequestArgsMap[(typeof ApiVersion)[T]];
|
|
16
|
+
|
|
17
|
+
type ApiResponseTypes = {
|
|
18
|
+
[ApiVersion.v2]: Blob;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export type ApiResponse<T extends SupportedApiVersion> = ApiResponseTypes[(typeof ApiVersion)[T]];
|
|
22
|
+
|
|
23
|
+
export type ApiResult<TMethod extends keyof ClientDataMethod = keyof ClientDataMethod> =
|
|
24
|
+
ClientDataMethod[TMethod];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { generateParameters } from './generate-parameters';
|
|
4
|
+
|
|
5
|
+
import type { ClientMethod } from '../../types';
|
|
6
|
+
import type { ApiResponse, ApiResult, ApiRequestArgs, SupportedApiVersion } from './types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Method for fetching context item from context service
|
|
10
|
+
* @param client - client for execution of request
|
|
11
|
+
* @param version - version of API to call
|
|
12
|
+
* @param method - client method to call
|
|
13
|
+
*/
|
|
14
|
+
export const client =
|
|
15
|
+
<
|
|
16
|
+
TVersion extends SupportedApiVersion,
|
|
17
|
+
TMethod extends keyof ClientMethod = keyof ClientMethod,
|
|
18
|
+
TClient extends IHttpClient = IHttpClient,
|
|
19
|
+
TArgs extends ApiRequestArgs<TVersion> = ApiRequestArgs<TVersion>,
|
|
20
|
+
>(
|
|
21
|
+
client: TClient,
|
|
22
|
+
version: TVersion,
|
|
23
|
+
method: TMethod = 'json' as TMethod,
|
|
24
|
+
) =>
|
|
25
|
+
<T = ApiResponse<TVersion>>(
|
|
26
|
+
args: TArgs,
|
|
27
|
+
init?: ClientRequestInit<TClient, T>,
|
|
28
|
+
): ApiResult<TVersion, TMethod, T> =>
|
|
29
|
+
client[method](
|
|
30
|
+
...generateParameters<T, TVersion, TClient>(version, args, init),
|
|
31
|
+
) as ApiResult<TVersion, TMethod, T>;
|
|
32
|
+
|
|
33
|
+
export default client;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UnsupportedApiVersion } from '../../errors';
|
|
2
|
+
import { ApiVersion } from '../static';
|
|
3
|
+
|
|
4
|
+
import type { ApiRequestArgs, SupportedApiVersion } from './types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Method for generating endpoint for getting context by id
|
|
8
|
+
*/
|
|
9
|
+
export const generateEndpoint = <TVersion extends SupportedApiVersion>(
|
|
10
|
+
version: TVersion,
|
|
11
|
+
args: ApiRequestArgs<TVersion>,
|
|
12
|
+
) => {
|
|
13
|
+
const apiVersion = ApiVersion[version as keyof typeof ApiVersion] ?? version;
|
|
14
|
+
switch (apiVersion) {
|
|
15
|
+
case ApiVersion.v2: {
|
|
16
|
+
const { search } = args;
|
|
17
|
+
const params = new URLSearchParams();
|
|
18
|
+
params.append('api-version', apiVersion);
|
|
19
|
+
params.append('$search', search);
|
|
20
|
+
return `/persons?${String(params)}`;
|
|
21
|
+
}
|
|
22
|
+
default: {
|
|
23
|
+
throw new UnsupportedApiVersion(version);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClientRequestInit, IHttpClient } from '@equinor/fusion-framework-module-http/client';
|
|
2
|
+
|
|
3
|
+
import { generateEndpoint } from './generate-endpoint';
|
|
4
|
+
|
|
5
|
+
import type { ApiClientArguments } from '../../types';
|
|
6
|
+
import type { ApiRequestArgs, SupportedApiVersion } from './types';
|
|
7
|
+
|
|
8
|
+
/** function for creating http client arguments */
|
|
9
|
+
export const generateParameters = <
|
|
10
|
+
TResult,
|
|
11
|
+
TVersion extends SupportedApiVersion,
|
|
12
|
+
TClient extends IHttpClient = IHttpClient,
|
|
13
|
+
>(
|
|
14
|
+
version: TVersion,
|
|
15
|
+
args: ApiRequestArgs<TVersion>,
|
|
16
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
17
|
+
): ApiClientArguments<TClient, TResult> => {
|
|
18
|
+
const path = generateEndpoint(version, args);
|
|
19
|
+
return [path, init];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export default generateParameters;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ApiVersion } from '../static';
|
|
2
|
+
import { ApiPerson_v2 } from '../api-models.v2';
|
|
3
|
+
import { ClientMethod } from '../../types';
|
|
4
|
+
|
|
5
|
+
export type SupportedApiVersion = Extract<keyof typeof ApiVersion, 'v2'>;
|
|
6
|
+
|
|
7
|
+
type ApiRequestArgsMap = {
|
|
8
|
+
[ApiVersion.v2]: {
|
|
9
|
+
search: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export type AllowedArgs = ApiRequestArgsMap[keyof ApiRequestArgsMap];
|
|
14
|
+
|
|
15
|
+
export type ApiRequestArgs<T extends SupportedApiVersion> =
|
|
16
|
+
ApiRequestArgsMap[(typeof ApiVersion)[T]];
|
|
17
|
+
|
|
18
|
+
type ApiResponseTypes = {
|
|
19
|
+
[ApiVersion.v2]: Array<ApiPerson_v2>;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type ApiResponse<T extends SupportedApiVersion> = ApiResponseTypes[(typeof ApiVersion)[T]];
|
|
23
|
+
|
|
24
|
+
export type ApiResult<
|
|
25
|
+
TVersion extends SupportedApiVersion,
|
|
26
|
+
TMethod extends keyof ClientMethod<unknown> = keyof ClientMethod<unknown>,
|
|
27
|
+
TResult = ApiResponse<TVersion>,
|
|
28
|
+
> = ClientMethod<TResult>[TMethod];
|
package/src/provider.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { IHttpClient } from '@equinor/fusion-framework-module-http';
|
|
2
|
+
import { ClientMethod } from './types';
|
|
3
|
+
|
|
4
|
+
import { ApiClientFactory } from './types';
|
|
5
|
+
import { ContextApiClient } from './context';
|
|
6
|
+
import BookmarksApiClient from './bookmarks/client';
|
|
7
|
+
import { NotificationApiClient } from './notification';
|
|
8
|
+
import { PeopleApiClient } from './people/client';
|
|
9
|
+
|
|
10
|
+
export interface IApiProvider<TClient extends IHttpClient = IHttpClient> {
|
|
11
|
+
/**
|
|
12
|
+
* @param method - Version of the service to use
|
|
13
|
+
*/
|
|
14
|
+
createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(
|
|
15
|
+
method: TMethod,
|
|
16
|
+
): Promise<BookmarksApiClient<TMethod, TClient, TPayload>>;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* @param method - Version of the service to use
|
|
20
|
+
*/
|
|
21
|
+
createContextClient<TMethod extends keyof ClientMethod>(
|
|
22
|
+
method: TMethod,
|
|
23
|
+
): Promise<ContextApiClient<TMethod, TClient>>;
|
|
24
|
+
/**
|
|
25
|
+
* @param method - Version of the service to use
|
|
26
|
+
*/
|
|
27
|
+
createNotificationClient<TMethod extends keyof ClientMethod>(
|
|
28
|
+
method: TMethod,
|
|
29
|
+
): Promise<NotificationApiClient<TMethod, TClient>>;
|
|
30
|
+
/**
|
|
31
|
+
* @param method - Version of the service to use
|
|
32
|
+
*/
|
|
33
|
+
createPeopleClient(): Promise<PeopleApiClient<TClient>>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ApiProviderCtorArgs<TClient extends IHttpClient = IHttpClient> = {
|
|
37
|
+
/** method for creating IHttpClients for api clients */
|
|
38
|
+
createClient: ApiClientFactory<TClient>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// TODO move to own file
|
|
42
|
+
type ApiProviderErrorResponse = {
|
|
43
|
+
type: ResponseType;
|
|
44
|
+
status: number;
|
|
45
|
+
statusText: string;
|
|
46
|
+
headers: Headers;
|
|
47
|
+
url: string;
|
|
48
|
+
data: unknown;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
// TODO move to own file
|
|
52
|
+
export class ApiProviderError extends Error {
|
|
53
|
+
readonly response: ApiProviderErrorResponse;
|
|
54
|
+
|
|
55
|
+
constructor(msg: string, response: ApiProviderErrorResponse, options?: ErrorOptions) {
|
|
56
|
+
super(msg, options);
|
|
57
|
+
this.response = response;
|
|
58
|
+
this.name = 'ApiProviderError';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// TODO move to own file
|
|
63
|
+
const validateResponse = async (response: Response) => {
|
|
64
|
+
if (!response.ok) {
|
|
65
|
+
const { headers, status, statusText, type, url, bodyUsed } = response;
|
|
66
|
+
const isJson = headers.get('content-type')?.match(/application\/(\w*)?[+]?json/);
|
|
67
|
+
const data = !bodyUsed && (await (isJson ? response.json() : response.text()));
|
|
68
|
+
throw new ApiProviderError('failed to execute request, response was not ok', {
|
|
69
|
+
headers,
|
|
70
|
+
status,
|
|
71
|
+
statusText,
|
|
72
|
+
type,
|
|
73
|
+
url,
|
|
74
|
+
data,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export class ApiProvider<TClient extends IHttpClient = IHttpClient>
|
|
80
|
+
implements IApiProvider<TClient>
|
|
81
|
+
{
|
|
82
|
+
protected _createClientFn: ApiClientFactory<TClient>;
|
|
83
|
+
constructor({ createClient }: ApiProviderCtorArgs<TClient>) {
|
|
84
|
+
this._createClientFn = createClient;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public async createNotificationClient<TMethod extends keyof ClientMethod>(
|
|
88
|
+
method: TMethod,
|
|
89
|
+
): Promise<NotificationApiClient<TMethod, TClient>> {
|
|
90
|
+
const httpClient = await this._createClientFn('notification');
|
|
91
|
+
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
92
|
+
return new NotificationApiClient(httpClient, method);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
public async createBookmarksClient<TMethod extends keyof ClientMethod, TPayload = unknown>(
|
|
96
|
+
method: TMethod,
|
|
97
|
+
): Promise<BookmarksApiClient<TMethod, TClient, TPayload>> {
|
|
98
|
+
const httpClient = await this._createClientFn('bookmarks');
|
|
99
|
+
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
100
|
+
return new BookmarksApiClient(httpClient, method);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
public async createContextClient<TMethod extends keyof ClientMethod>(
|
|
104
|
+
method: TMethod,
|
|
105
|
+
): Promise<ContextApiClient<TMethod, TClient>> {
|
|
106
|
+
const httpClient = await this._createClientFn('context');
|
|
107
|
+
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
108
|
+
return new ContextApiClient(httpClient, method);
|
|
109
|
+
}
|
|
110
|
+
public async createPeopleClient(): Promise<PeopleApiClient<TClient>> {
|
|
111
|
+
const httpClient = await this._createClientFn('people');
|
|
112
|
+
httpClient.responseHandler.add('validate_api_request', validateResponse);
|
|
113
|
+
return new PeopleApiClient(httpClient);
|
|
114
|
+
}
|
|
115
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClientRequestInit,
|
|
3
|
+
IHttpClient,
|
|
4
|
+
FetchResponse,
|
|
5
|
+
StreamResponse,
|
|
6
|
+
} from '@equinor/fusion-framework-module-http/client';
|
|
7
|
+
|
|
8
|
+
export type ApiClientFactory<TClient extends IHttpClient = IHttpClient> = (
|
|
9
|
+
name: string,
|
|
10
|
+
) => Promise<TClient>;
|
|
11
|
+
|
|
12
|
+
export type ApiClientArguments<TClient extends IHttpClient, TResult = unknown> = [
|
|
13
|
+
path: string,
|
|
14
|
+
init?: ClientRequestInit<TClient, TResult>,
|
|
15
|
+
];
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Execute methods on the IHttpClient
|
|
19
|
+
*/
|
|
20
|
+
export type ClientMethod<T = unknown> = {
|
|
21
|
+
/**
|
|
22
|
+
* Fetch data async
|
|
23
|
+
* NOTE: data needs to be extracted from the response
|
|
24
|
+
*/
|
|
25
|
+
fetch: Promise<FetchResponse<T>>;
|
|
26
|
+
/**
|
|
27
|
+
* Fetch JSON data from a service
|
|
28
|
+
*/
|
|
29
|
+
json: Promise<T>;
|
|
30
|
+
/**
|
|
31
|
+
* Fetch data as an observable
|
|
32
|
+
* NOTE: data needs to be extracted from the response
|
|
33
|
+
*/
|
|
34
|
+
fetch$: StreamResponse<FetchResponse<T>>;
|
|
35
|
+
/**
|
|
36
|
+
* Fetch JSON data from a service as observable
|
|
37
|
+
*/
|
|
38
|
+
json$: StreamResponse<T>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export type ClientDataMethod = {
|
|
42
|
+
blob: Blob;
|
|
43
|
+
blob$: StreamResponse<Blob>;
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export type ClientMethodType = keyof ClientMethod;
|
package/src/version.ts
ADDED
package/tsconfig.json
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist/esm",
|
|
5
|
+
"rootDir": "src",
|
|
6
|
+
"declarationDir": "./dist/types",
|
|
7
|
+
|
|
8
|
+
"paths": {
|
|
9
|
+
"@equinor/fusion-framework-module-services": [
|
|
10
|
+
"."
|
|
11
|
+
],
|
|
12
|
+
"@equinor/fusion-framework-module-services/*": [
|
|
13
|
+
"./*"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"references": [
|
|
18
|
+
{
|
|
19
|
+
"path": "../../utils/observable"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"path": "../module"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "../http"
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
"path": "../service-discovery"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
"include": [
|
|
32
|
+
"src/**/*",
|
|
33
|
+
],
|
|
34
|
+
"exclude": [
|
|
35
|
+
"node_modules",
|
|
36
|
+
"lib"
|
|
37
|
+
]
|
|
38
|
+
}
|