Skip to content

Commit

Permalink
BC-7879 - refactor authorization-api-client to use fetch and be `…
Browse files Browse the repository at this point in the history
…node16` compatible
  • Loading branch information
bergatco committed Oct 14, 2024
1 parent 55d58da commit 619228d
Show file tree
Hide file tree
Showing 23 changed files with 1,198 additions and 611 deletions.
3 changes: 3 additions & 0 deletions openapitools-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"apiPackage": "api",
"enumNameSuffix": "",
"enumPropertyNaming": "UPPERCASE",
"fileNaming": "kebab-case",
"generateAliasAsModel": true,
"importFileExtension": ".js",
"modelPackage": "models",
"supportsES6": true,
"withInterfaces": true,
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const getOpenApiCommand = (params) => {
const { url, path, config, filter } = params;
const configFile = config ? `-c ${config}` : '';
const filterString = filter ? `--openapi-normalizer FILTER="${filter}"` : '';
const command = `openapi-generator-cli generate -i ${url} -g typescript-axios -o ${path} ${configFile} --skip-validate-spec ${filterString}`;
const command = `openapi-generator-cli generate -i ${url} -g typescript-fetch -o ${path} ${configFile} --skip-validate-spec ${filterString}`;

return command;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ models/*

# list of allowed files in the "models" folder
!models/action.ts
!models/api-validation-error.ts
!models/authorization-body-params.ts
!models/authorization-context-params.ts
!models/authorized-reponse.ts
!models/index.ts
!models/index.ts
!models/permission.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,295 @@
api.ts
api/authorization-api.ts
base.ts
common.ts
configuration.ts
apis/authorization-api.ts
apis/index.ts
index.ts
models/account-by-id-body-params.ts
models/account-response.ts
models/account-search-list-response.ts
models/action.ts
models/alert-response.ts
models/api-validation-error.ts
models/authorization-body-params.ts
models/authorization-context-params.ts
models/authorized-reponse.ts
models/basic-tool-config-params.ts
models/board-column-board-response.ts
models/board-context-response.ts
models/board-element-response-content.ts
models/board-element-response.ts
models/board-external-reference-type.ts
models/board-layout.ts
models/board-lesson-response.ts
models/board-parent-type.ts
models/board-response.ts
models/board-submission-controller-create-element201-response.ts
models/board-task-response.ts
models/board-task-status-response.ts
models/card-controller-create-element201-response.ts
models/card-list-response.ts
models/card-response-elements-inner.ts
models/card-response.ts
models/card-skeleton-response.ts
models/change-language-params.ts
models/class-info-response.ts
models/class-info-search-list-response.ts
models/class-request-context.ts
models/class-response.ts
models/class-sort-query-type.ts
models/collaborative-text-editor-element-response.ts
models/collaborative-text-editor-parent-type.ts
models/collaborative-text-editor-response.ts
models/collapsable-body-params.ts
models/color-body-params.ts
models/column-response.ts
models/config-response.ts
models/consent-request-body.ts
models/consent-response.ts
models/consent-session-response.ts
models/consents-response.ts
models/content-element-type.ts
models/context-external-tool-body-params.ts
models/context-external-tool-configuration-status-response.ts
models/context-external-tool-configuration-template-list-response.ts
models/context-external-tool-configuration-template-response.ts
models/context-external-tool-count-per-context-response.ts
models/context-external-tool-post-params.ts
models/context-external-tool-response.ts
models/context-external-tool-search-list-response.ts
models/copy-api-response.ts
models/county-response.ts
models/course-common-cartridge-metadata-response.ts
models/course-export-body-params.ts
models/course-info-data-response.ts
models/course-info-list-response.ts
models/course-info-response.ts
models/course-metadata-list-response.ts
models/course-metadata-response.ts
models/course-sort-props.ts
models/course-status.ts
models/course-sync-body-params.ts
models/create-board-body-params.ts
models/create-board-response.ts
models/create-card-body-params.ts
models/create-content-element-body-params.ts
models/create-media-element-body-params.ts
models/create-news-params.ts
models/create-room-body-params.ts
models/create-submission-item-body-params.ts
models/custom-parameter-entry-param.ts
models/custom-parameter-entry-response.ts
models/custom-parameter-post-params.ts
models/custom-parameter-response.ts
models/dashboard-grid-element-response.ts
models/dashboard-grid-sub-element-response.ts
models/dashboard-response.ts
models/deleted-element-content.ts
models/deleted-element-response.ts
models/drawing-content-body.ts
models/drawing-element-content-body.ts
models/drawing-element-content.ts
models/drawing-element-response.ts
models/element-controller-update-element201-response.ts
models/entity-not-found-error.ts
models/external-source-response.ts
models/external-tool-bulk-create-params.ts
models/external-tool-content-body.ts
models/external-tool-create-params.ts
models/external-tool-element-content-body.ts
models/external-tool-element-content.ts
models/external-tool-element-response.ts
models/external-tool-medium-params.ts
models/external-tool-medium-response.ts
models/external-tool-metadata-response.ts
models/external-tool-response-config.ts
models/external-tool-response.ts
models/external-tool-search-list-response.ts
models/external-tool-update-params-config.ts
models/external-tool-update-params.ts
models/federal-state-response.ts
models/file-content-body.ts
models/file-element-content-body.ts
models/file-element-content.ts
models/file-element-response.ts
models/file-storage-type.ts
models/forbidden-operation-error.ts
models/force-migration-params.ts
models/get-meta-tag-data-body.ts
models/group-list-response.ts
models/group-response.ts
models/group-user-response.ts
models/import-user-list-response.ts
models/import-user-response.ts
models/index.ts
models/instance-feature.ts
models/language-type.ts
models/layout-body-params.ts
models/ldap-authorization-body-params.ts
models/lesson-content-response.ts
models/lesson-copy-api-params.ts
models/lesson-linked-task-response.ts
models/lesson-metadata-list-response.ts
models/lesson-metadata-response.ts
models/lesson-response.ts
models/link-content-body.ts
models/link-element-content-body.ts
models/link-element-content.ts
models/link-element-response.ts
models/local-authorization-body-params.ts
models/login-request-body.ts
models/login-response.ts
models/lti-message-type.ts
models/lti-privacy-permission.ts
models/lti11-tool-config-create-params.ts
models/lti11-tool-config-update-params.ts
models/material-response.ts
models/me-account-response.ts
models/me-response.ts
models/me-role-response.ts
models/me-school-logo-response.ts
models/me-school-response.ts
models/me-user-response.ts
models/media-available-line-element-response.ts
models/media-available-line-response.ts
models/media-board-colors.ts
models/media-board-layout-type.ts
models/media-board-response.ts
models/media-external-tool-element-content.ts
models/media-external-tool-element-response.ts
models/media-line-response-elements-inner.ts
models/media-line-response.ts
models/message-origin.ts
models/message.ts
models/meta-tag-extractor-response.ts
models/move-card-body-params.ts
models/move-column-body-params.ts
models/move-content-element-body.ts
models/move-element-body-params.ts
models/move-element-params.ts
models/move-element-position-params.ts
models/news-list-response.ts
models/news-response.ts
models/news-target-model.ts
models/o-auth-token-dto.ts
models/oauth-client-create-body.ts
models/oauth-client-response.ts
models/oauth-client-update-body.ts
models/oauth-config-response.ts
models/oauth-provider-login-response.ts
models/oauth2-authorization-body-params.ts
models/oauth2-migration-params.ts
models/oauth2-tool-config-create-params.ts
models/oauth2-tool-config-update-params.ts
models/oidc-context-response.ts
models/parent-consent-response.ts
models/patch-group-params.ts
models/patch-my-account-params.ts
models/patch-my-password-params.ts
models/patch-order-params.ts
models/patch-visibility-params.ts
models/period-response.ts
models/permission.ts
models/provider-config-response.ts
models/pseudonym-response.ts
models/public-system-list-response.ts
models/public-system-response.ts
models/redirect-response.ts
models/rename-body-params.ts
models/resolved-user-response.ts
models/rich-text-content-body.ts
models/rich-text-element-content-body.ts
models/rich-text-element-content.ts
models/rich-text-element-response.ts
models/rich-text.ts
models/role-name.ts
models/room-color.ts
models/room-details-response.ts
models/room-item-response.ts
models/room-list-response.ts
models/school-controller-get-provisioning-options200-response.ts
models/school-exists-response.ts
models/school-external-tool-configuration-status-response.ts
models/school-external-tool-configuration-template-list-response.ts
models/school-external-tool-configuration-template-response.ts
models/school-external-tool-metadata-response.ts
models/school-external-tool-post-params.ts
models/school-external-tool-response.ts
models/school-external-tool-search-list-response.ts
models/school-feature.ts
models/school-for-external-invite-response.ts
models/school-for-ldap-login-response.ts
models/school-info-response.ts
models/school-logo.ts
models/school-permissions-params.ts
models/school-purpose.ts
models/school-response.ts
models/school-system-response.ts
models/school-update-body-params.ts
models/school-year-query-type.ts
models/school-year-response.ts
models/schul-conne-x-provisioning-options-params.ts
models/schul-conne-x-provisioning-options-response.ts
models/schulcloud-theme.ts
models/set-height-body-params.ts
models/share-token-body-params.ts
models/share-token-import-body-params.ts
models/share-token-info-response.ts
models/share-token-payload-response.ts
models/share-token-response.ts
models/single-column-board-response.ts
models/student-permission-params.ts
models/submission-container-content-body.ts
models/submission-container-element-content-body.ts
models/submission-container-element-content.ts
models/submission-container-element-response.ts
models/submission-item-response-elements-inner.ts
models/submission-item-response.ts
models/submission-status-list-response.ts
models/submission-status-response.ts
models/submissions-response.ts
models/successful-response.ts
models/system-for-ldap-login-response.ts
models/system-type.ts
models/target-info-response.ts
models/target-user-id-params.ts
models/task-copy-api-params.ts
models/task-list-response.ts
models/task-response.ts
models/task-status-response.ts
models/teacher-permission-params.ts
models/team-permissions-body.ts
models/timestamps-response.ts
models/timezone.ts
models/tool-config-type.ts
models/tool-context-type.ts
models/tool-context-types-list-response.ts
models/tool-launch-request-response.ts
models/tool-reference-list-response.ts
models/tool-reference-response.ts
models/update-board-title-params.ts
models/update-element-content-body-params-data.ts
models/update-element-content-body-params.ts
models/update-flag-params.ts
models/update-match-params.ts
models/update-news-params.ts
models/update-room-body-params.ts
models/update-submission-item-body-params.ts
models/user-consent-response.ts
models/user-data-response.ts
models/user-info-response.ts
models/user-list-response.ts
models/user-login-migration-mandatory-params.ts
models/user-login-migration-response.ts
models/user-login-migration-search-list-response.ts
models/user-match-list-response.ts
models/user-match-response.ts
models/user-response.ts
models/validation-error.ts
models/video-conference-create-params.ts
models/video-conference-info-response.ts
models/video-conference-join-response.ts
models/video-conference-options-response.ts
models/video-conference-scope.ts
models/video-conference-state-response.ts
models/visibility-body-params.ts
models/visibility-settings-response.ts
models/years-response.ts
runtime.ts
18 changes: 0 additions & 18 deletions src/infra/authorization/authorization-api-client/api.ts

This file was deleted.

Loading

0 comments on commit 619228d

Please sign in to comment.