@halo-dev/api-client 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -11
- package/dist/entry/api-client.d.ts +348 -0
- package/dist/entry/index.d.ts +2 -0
- package/dist/halo-api-client.es.js +20971 -0
- package/dist/halo-api-client.es.js.map +1 -0
- package/dist/halo-api-client.iife.js +2 -0
- package/dist/halo-api-client.iife.js.map +1 -0
- package/dist/src/api/annotation-setting-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/api-notification-halo-run-v1alpha1-subscription-api.d.ts +80 -0
- package/dist/src/api/attachment-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/attachment-v1alpha1-console-api.d.ts +187 -0
- package/dist/src/api/attachment-v1alpha1-uc-api.d.ts +97 -0
- package/dist/src/api/auth-provider-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/auth-provider-v1alpha1-console-api.d.ts +140 -0
- package/dist/src/api/backup-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/category-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/category-v1alpha1-public-api.d.ts +229 -0
- package/dist/src/api/comment-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/comment-v1alpha1-console-api.d.ts +221 -0
- package/dist/src/api/comment-v1alpha1-public-api.d.ts +329 -0
- package/dist/src/api/config-map-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/counter-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/device-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/device-v1alpha1-uc-api.d.ts +98 -0
- package/dist/src/api/extension-definition-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/extension-point-definition-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/group-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/index-v1alpha1-public-api.d.ts +143 -0
- package/dist/src/api/indices-v1alpha1-console-api.d.ts +84 -0
- package/dist/src/api/login-api.d.ts +56 -0
- package/dist/src/api/menu-item-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/menu-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/menu-v1alpha1-public-api.d.ts +98 -0
- package/dist/src/api/metrics-v1alpha1-public-api.d.ts +157 -0
- package/dist/src/api/migration-v1alpha1-console-api.d.ts +138 -0
- package/dist/src/api/notification-template-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/notification-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/notification-v1alpha1-uc-api.d.ts +363 -0
- package/dist/src/api/notifier-descriptor-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/notifier-v1alpha1-console-api.d.ts +165 -0
- package/dist/src/api/notifier-v1alpha1-uc-api.d.ts +122 -0
- package/dist/src/api/personal-access-token-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/personal-access-token-v1alpha1-uc-api.d.ts +266 -0
- package/dist/src/api/plugin-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/plugin-v1alpha1-console-api.d.ts +698 -0
- package/dist/src/api/plugin-v1alpha1-public-api.d.ts +72 -0
- package/dist/src/api/policy-template-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/policy-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/post-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/post-v1alpha1-console-api.d.ts +699 -0
- package/dist/src/api/post-v1alpha1-public-api.d.ts +189 -0
- package/dist/src/api/post-v1alpha1-uc-api.d.ts +457 -0
- package/dist/src/api/reason-type-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/reason-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/remember-me-token-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/reply-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/reply-v1alpha1-console-api.d.ts +113 -0
- package/dist/src/api/reverse-proxy-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/role-binding-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/role-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/search-engine-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/secret-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/setting-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/single-page-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/single-page-v1alpha1-console-api.d.ts +616 -0
- package/dist/src/api/single-page-v1alpha1-public-api.d.ts +147 -0
- package/dist/src/api/snapshot-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/snapshot-v1alpha1-uc-api.d.ts +89 -0
- package/dist/src/api/subscription-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/system-v1alpha1-console-api.d.ts +98 -0
- package/dist/src/api/system-v1alpha1-public-api.d.ts +56 -0
- package/dist/src/api/tag-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/tag-v1alpha1-console-api.d.ts +113 -0
- package/dist/src/api/tag-v1alpha1-public-api.d.ts +229 -0
- package/dist/src/api/theme-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/theme-v1alpha1-console-api.d.ts +599 -0
- package/dist/src/api/two-factor-auth-v1alpha1-uc-api.d.ts +249 -0
- package/dist/src/api/user-connection-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/user-v1alpha1-api.d.ts +331 -0
- package/dist/src/api/user-v1alpha1-console-api.d.ts +632 -0
- package/dist/src/api/user-v1alpha1-public-api.d.ts +207 -0
- package/dist/src/api.d.ts +85 -0
- package/dist/src/base.d.ts +56 -0
- package/dist/src/common.d.ts +55 -0
- package/dist/src/configuration.d.ts +91 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/models/add-operation.d.ts +40 -0
- package/dist/src/models/annotation-setting-list.d.ts +63 -0
- package/dist/src/models/annotation-setting-spec.d.ts +21 -0
- package/dist/src/models/annotation-setting.d.ts +34 -0
- package/dist/src/models/attachment-list.d.ts +63 -0
- package/dist/src/models/attachment-spec.d.ts +60 -0
- package/dist/src/models/attachment-status.d.ts +24 -0
- package/dist/src/models/attachment.d.ts +41 -0
- package/dist/src/models/auth-provider-list.d.ts +63 -0
- package/dist/src/models/auth-provider-spec.d.ts +76 -0
- package/dist/src/models/auth-provider.d.ts +34 -0
- package/dist/src/models/author.d.ts +30 -0
- package/dist/src/models/backup-list.d.ts +63 -0
- package/dist/src/models/backup-spec.d.ts +30 -0
- package/dist/src/models/backup-status.d.ts +67 -0
- package/dist/src/models/backup.d.ts +41 -0
- package/dist/src/models/category-list.d.ts +63 -0
- package/dist/src/models/category-spec.d.ts +78 -0
- package/dist/src/models/category-status.d.ts +36 -0
- package/dist/src/models/category-vo-list.d.ts +63 -0
- package/dist/src/models/category-vo.d.ts +35 -0
- package/dist/src/models/category.d.ts +41 -0
- package/dist/src/models/change-own-password-request.d.ts +30 -0
- package/dist/src/models/change-password-request.d.ts +24 -0
- package/dist/src/models/comment-email-owner.d.ts +42 -0
- package/dist/src/models/comment-list.d.ts +63 -0
- package/dist/src/models/comment-owner.d.ts +44 -0
- package/dist/src/models/comment-request.d.ts +40 -0
- package/dist/src/models/comment-spec.d.ts +94 -0
- package/dist/src/models/comment-stats-vo.d.ts +24 -0
- package/dist/src/models/comment-stats.d.ts +24 -0
- package/dist/src/models/comment-status.d.ts +54 -0
- package/dist/src/models/comment-vo-list.d.ts +63 -0
- package/dist/src/models/comment-vo.d.ts +43 -0
- package/dist/src/models/comment-with-reply-vo-list.d.ts +63 -0
- package/dist/src/models/comment-with-reply-vo.d.ts +50 -0
- package/dist/src/models/comment.d.ts +41 -0
- package/dist/src/models/condition.d.ts +54 -0
- package/dist/src/models/config-map-list.d.ts +63 -0
- package/dist/src/models/config-map-ref.d.ts +24 -0
- package/dist/src/models/config-map.d.ts +35 -0
- package/dist/src/models/content-update-param.d.ts +42 -0
- package/dist/src/models/content-vo.d.ts +30 -0
- package/dist/src/models/content-wrapper.d.ts +42 -0
- package/dist/src/models/content.d.ts +36 -0
- package/dist/src/models/contributor-vo.d.ts +45 -0
- package/dist/src/models/contributor.d.ts +36 -0
- package/dist/src/models/copy-operation.d.ts +40 -0
- package/dist/src/models/counter-list.d.ts +63 -0
- package/dist/src/models/counter-request.d.ts +60 -0
- package/dist/src/models/counter.d.ts +57 -0
- package/dist/src/models/create-user-request.d.ts +74 -0
- package/dist/src/models/custom-templates.d.ts +27 -0
- package/dist/src/models/dashboard-stats.d.ts +54 -0
- package/dist/src/models/detailed-user.d.ts +22 -0
- package/dist/src/models/device-list.d.ts +63 -0
- package/dist/src/models/device-spec.d.ts +60 -0
- package/dist/src/models/device-status.d.ts +30 -0
- package/dist/src/models/device.d.ts +41 -0
- package/dist/src/models/email-config-validation-request.d.ts +66 -0
- package/dist/src/models/email-verify-request.d.ts +24 -0
- package/dist/src/models/excerpt.d.ts +30 -0
- package/dist/src/models/extension-definition-list.d.ts +63 -0
- package/dist/src/models/extension-definition.d.ts +34 -0
- package/dist/src/models/extension-point-definition-list.d.ts +63 -0
- package/dist/src/models/extension-point-definition.d.ts +34 -0
- package/dist/src/models/extension-point-spec.d.ts +53 -0
- package/dist/src/models/extension-spec.d.ts +48 -0
- package/dist/src/models/extension.d.ts +27 -0
- package/dist/src/models/file-reverse-proxy-provider.d.ts +30 -0
- package/dist/src/models/grant-request.d.ts +24 -0
- package/dist/src/models/group-kind.d.ts +30 -0
- package/dist/src/models/group-list.d.ts +63 -0
- package/dist/src/models/group-spec.d.ts +24 -0
- package/dist/src/models/group-status.d.ts +30 -0
- package/dist/src/models/group.d.ts +41 -0
- package/dist/src/models/halo-document.d.ts +116 -0
- package/dist/src/models/index.d.ts +249 -0
- package/dist/src/models/install-from-uri-request.d.ts +24 -0
- package/dist/src/models/interest-reason-subject.d.ts +36 -0
- package/dist/src/models/interest-reason.d.ts +27 -0
- package/dist/src/models/json-patch-inner.d.ts +12 -0
- package/dist/src/models/license.d.ts +30 -0
- package/dist/src/models/list-result-reply-vo.d.ts +63 -0
- package/dist/src/models/listed-auth-provider.d.ts +96 -0
- package/dist/src/models/listed-comment-list.d.ts +63 -0
- package/dist/src/models/listed-comment.d.ts +36 -0
- package/dist/src/models/listed-post-list.d.ts +63 -0
- package/dist/src/models/listed-post-vo-list.d.ts +63 -0
- package/dist/src/models/listed-post-vo.d.ts +63 -0
- package/dist/src/models/listed-post.d.ts +49 -0
- package/dist/src/models/listed-reply-list.d.ts +63 -0
- package/dist/src/models/listed-reply.d.ts +29 -0
- package/dist/src/models/listed-single-page-list.d.ts +63 -0
- package/dist/src/models/listed-single-page-vo-list.d.ts +63 -0
- package/dist/src/models/listed-single-page-vo.d.ts +49 -0
- package/dist/src/models/listed-single-page.d.ts +35 -0
- package/dist/src/models/listed-snapshot-dto.d.ts +22 -0
- package/dist/src/models/listed-snapshot-spec.d.ts +30 -0
- package/dist/src/models/listed-user.d.ts +22 -0
- package/dist/src/models/login-history.d.ts +48 -0
- package/dist/src/models/mark-specified-request.d.ts +24 -0
- package/dist/src/models/menu-item-list.d.ts +63 -0
- package/dist/src/models/menu-item-spec.d.ts +52 -0
- package/dist/src/models/menu-item-status.d.ts +30 -0
- package/dist/src/models/menu-item-vo.d.ts +41 -0
- package/dist/src/models/menu-item.d.ts +41 -0
- package/dist/src/models/menu-list.d.ts +63 -0
- package/dist/src/models/menu-spec.d.ts +30 -0
- package/dist/src/models/menu-vo.d.ts +29 -0
- package/dist/src/models/menu.d.ts +34 -0
- package/dist/src/models/metadata.d.ts +70 -0
- package/dist/src/models/move-operation.d.ts +40 -0
- package/dist/src/models/navigation-post-vo.d.ts +27 -0
- package/dist/src/models/notification-list.d.ts +63 -0
- package/dist/src/models/notification-spec.d.ts +60 -0
- package/dist/src/models/notification-template-list.d.ts +63 -0
- package/dist/src/models/notification-template-spec.d.ts +22 -0
- package/dist/src/models/notification-template.d.ts +34 -0
- package/dist/src/models/notification.d.ts +34 -0
- package/dist/src/models/notifier-descriptor-list.d.ts +63 -0
- package/dist/src/models/notifier-descriptor-spec.d.ts +39 -0
- package/dist/src/models/notifier-descriptor.d.ts +34 -0
- package/dist/src/models/notifier-info.d.ts +36 -0
- package/dist/src/models/notifier-setting-ref.d.ts +30 -0
- package/dist/src/models/owner-info.d.ts +48 -0
- package/dist/src/models/password-request.d.ts +24 -0
- package/dist/src/models/password-reset-email-request.d.ts +30 -0
- package/dist/src/models/pat-spec.d.ts +78 -0
- package/dist/src/models/personal-access-token-list.d.ts +63 -0
- package/dist/src/models/personal-access-token.d.ts +34 -0
- package/dist/src/models/plugin-author.d.ts +30 -0
- package/dist/src/models/plugin-list.d.ts +63 -0
- package/dist/src/models/plugin-running-state-request.d.ts +30 -0
- package/dist/src/models/plugin-spec.d.ts +103 -0
- package/dist/src/models/plugin-status.d.ts +80 -0
- package/dist/src/models/plugin.d.ts +41 -0
- package/dist/src/models/policy-list.d.ts +63 -0
- package/dist/src/models/policy-rule.d.ts +48 -0
- package/dist/src/models/policy-spec.d.ts +36 -0
- package/dist/src/models/policy-template-list.d.ts +63 -0
- package/dist/src/models/policy-template-spec.d.ts +30 -0
- package/dist/src/models/policy-template.d.ts +34 -0
- package/dist/src/models/policy.d.ts +34 -0
- package/dist/src/models/post-list.d.ts +63 -0
- package/dist/src/models/post-request.d.ts +22 -0
- package/dist/src/models/post-spec.d.ts +131 -0
- package/dist/src/models/post-status.d.ts +69 -0
- package/dist/src/models/post-vo.d.ts +70 -0
- package/dist/src/models/post.d.ts +41 -0
- package/dist/src/models/public-key-response.d.ts +24 -0
- package/dist/src/models/reason-list.d.ts +63 -0
- package/dist/src/models/reason-property.d.ts +42 -0
- package/dist/src/models/reason-selector.d.ts +30 -0
- package/dist/src/models/reason-spec-attributes.d.ts +24 -0
- package/dist/src/models/reason-spec.d.ts +34 -0
- package/dist/src/models/reason-subject.d.ts +48 -0
- package/dist/src/models/reason-type-info.d.ts +42 -0
- package/dist/src/models/reason-type-list.d.ts +63 -0
- package/dist/src/models/reason-type-notifier-collection-request.d.ts +15 -0
- package/dist/src/models/reason-type-notifier-matrix.d.ts +28 -0
- package/dist/src/models/reason-type-notifier-request.d.ts +30 -0
- package/dist/src/models/reason-type-spec.d.ts +27 -0
- package/dist/src/models/reason-type.d.ts +34 -0
- package/dist/src/models/reason.d.ts +34 -0
- package/dist/src/models/ref.d.ts +42 -0
- package/dist/src/models/register-verify-email-request.d.ts +24 -0
- package/dist/src/models/remember-me-token-list.d.ts +63 -0
- package/dist/src/models/remember-me-token-spec.d.ts +42 -0
- package/dist/src/models/remember-me-token.d.ts +34 -0
- package/dist/src/models/remove-operation.d.ts +34 -0
- package/dist/src/models/replace-operation.d.ts +40 -0
- package/dist/src/models/reply-list.d.ts +63 -0
- package/dist/src/models/reply-request.d.ts +39 -0
- package/dist/src/models/reply-spec.d.ts +93 -0
- package/dist/src/models/reply-status.d.ts +24 -0
- package/dist/src/models/reply-vo-list.d.ts +63 -0
- package/dist/src/models/reply-vo.d.ts +36 -0
- package/dist/src/models/reply.d.ts +41 -0
- package/dist/src/models/reset-password-request.d.ts +30 -0
- package/dist/src/models/reverse-proxy-list.d.ts +63 -0
- package/dist/src/models/reverse-proxy-rule.d.ts +21 -0
- package/dist/src/models/reverse-proxy.d.ts +34 -0
- package/dist/src/models/revert-snapshot-for-post-param.d.ts +24 -0
- package/dist/src/models/revert-snapshot-for-single-param.d.ts +24 -0
- package/dist/src/models/role-binding-list.d.ts +63 -0
- package/dist/src/models/role-binding.d.ts +41 -0
- package/dist/src/models/role-list.d.ts +63 -0
- package/dist/src/models/role-ref.d.ts +36 -0
- package/dist/src/models/role.d.ts +34 -0
- package/dist/src/models/search-engine-list.d.ts +63 -0
- package/dist/src/models/search-engine-spec.d.ts +45 -0
- package/dist/src/models/search-engine.d.ts +34 -0
- package/dist/src/models/search-option.d.ts +92 -0
- package/dist/src/models/search-result.d.ts +39 -0
- package/dist/src/models/secret-list.d.ts +63 -0
- package/dist/src/models/secret.d.ts +49 -0
- package/dist/src/models/setting-form.d.ts +36 -0
- package/dist/src/models/setting-list.d.ts +63 -0
- package/dist/src/models/setting-ref.d.ts +30 -0
- package/dist/src/models/setting-spec.d.ts +15 -0
- package/dist/src/models/setting.d.ts +34 -0
- package/dist/src/models/sign-up-request.d.ts +27 -0
- package/dist/src/models/single-page-list.d.ts +63 -0
- package/dist/src/models/single-page-request.d.ts +22 -0
- package/dist/src/models/single-page-spec.d.ts +119 -0
- package/dist/src/models/single-page-status.d.ts +69 -0
- package/dist/src/models/single-page-vo.d.ts +56 -0
- package/dist/src/models/single-page.d.ts +41 -0
- package/dist/src/models/site-stats-vo.d.ts +48 -0
- package/dist/src/models/snap-shot-spec.d.ts +57 -0
- package/dist/src/models/snapshot-list.d.ts +63 -0
- package/dist/src/models/snapshot.d.ts +34 -0
- package/dist/src/models/stats-vo.d.ts +36 -0
- package/dist/src/models/stats.d.ts +42 -0
- package/dist/src/models/subject.d.ts +36 -0
- package/dist/src/models/subscription-list.d.ts +63 -0
- package/dist/src/models/subscription-spec.d.ts +34 -0
- package/dist/src/models/subscription-subscriber.d.ts +24 -0
- package/dist/src/models/subscription.d.ts +34 -0
- package/dist/src/models/system-initialization-request.d.ts +42 -0
- package/dist/src/models/tag-list.d.ts +63 -0
- package/dist/src/models/tag-spec.d.ts +42 -0
- package/dist/src/models/tag-status.d.ts +42 -0
- package/dist/src/models/tag-vo-list.d.ts +63 -0
- package/dist/src/models/tag-vo.d.ts +35 -0
- package/dist/src/models/tag.d.ts +41 -0
- package/dist/src/models/template-content.d.ts +36 -0
- package/dist/src/models/template-descriptor.d.ts +42 -0
- package/dist/src/models/test-operation.d.ts +40 -0
- package/dist/src/models/theme-list.d.ts +63 -0
- package/dist/src/models/theme-spec.d.ts +103 -0
- package/dist/src/models/theme-status.d.ts +33 -0
- package/dist/src/models/theme.d.ts +41 -0
- package/dist/src/models/totp-auth-link-response.d.ts +30 -0
- package/dist/src/models/totp-request.d.ts +36 -0
- package/dist/src/models/two-factor-auth-settings.d.ts +42 -0
- package/dist/src/models/upgrade-from-uri-request.d.ts +24 -0
- package/dist/src/models/user-connection-list.d.ts +63 -0
- package/dist/src/models/user-connection-spec.d.ts +78 -0
- package/dist/src/models/user-connection.d.ts +34 -0
- package/dist/src/models/user-device.d.ts +27 -0
- package/dist/src/models/user-endpoint-listed-user-list.d.ts +63 -0
- package/dist/src/models/user-list.d.ts +63 -0
- package/dist/src/models/user-permission.d.ts +27 -0
- package/dist/src/models/user-spec.d.ts +90 -0
- package/dist/src/models/user-status.d.ts +27 -0
- package/dist/src/models/user.d.ts +41 -0
- package/dist/src/models/verify-code-request.d.ts +30 -0
- package/dist/src/models/vote-request.d.ts +36 -0
- package/package.json +28 -30
- package/dist/index.cjs +0 -13783
- package/dist/index.d.ts +0 -30557
- package/dist/index.mjs +0 -13464
package/README.md
CHANGED
|
@@ -2,23 +2,68 @@
|
|
|
2
2
|
|
|
3
3
|
Halo 2.0 的 JavaScript API 客户端请求库。使用 [OpenAPI Generator](https://openapi-generator.tech/) 生成。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 使用
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
7
|
+
```javascript
|
|
8
|
+
import {
|
|
9
|
+
coreApiClient,
|
|
10
|
+
consoleApiClient,
|
|
11
|
+
ucApiClient,
|
|
12
|
+
publicApiClient,
|
|
13
|
+
createCoreApiClient,
|
|
14
|
+
createConsoleApiClient,
|
|
15
|
+
createUcApiClient,
|
|
16
|
+
createPublicApiClient,
|
|
17
|
+
axiosInstance
|
|
18
|
+
} from "@halo-dev/api-client"
|
|
9
19
|
```
|
|
10
20
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
- **coreApiClient**: 为 Halo 所有自定义模型的 CRUD 接口封装的 api client。
|
|
22
|
+
- **consoleApiClient**: 为 Halo 针对 Console 提供的接口封装的 api client。
|
|
23
|
+
- **ucApiClient**: 为 Halo 针对 UC 提供的接口封装的 api client。
|
|
24
|
+
- **publicApiClient**: 为 Halo 所有公开访问的接口封装的 api client。
|
|
25
|
+
- **createCoreApiClient**: 用于创建自定义模型的 CRUD 接口封装的 api client,需要传入 axios 实例。
|
|
26
|
+
- **createConsoleApiClient**: 用于创建 Console 接口封装的 api client,需要传入 axios 实例。
|
|
27
|
+
- **createUcApiClient**: 用于创建 UC 接口封装的 api client,需要传入 axios 实例。
|
|
28
|
+
- **createPublicApiClient**: 用于创建公开访问接口封装的 api client,需要传入 axios 实例。
|
|
29
|
+
- **axiosInstance**: 内部默认创建的 axios 实例。
|
|
30
|
+
|
|
31
|
+
### 在插件中使用
|
|
32
|
+
|
|
33
|
+
```shell
|
|
34
|
+
pnpm install @halo-dev/api-client axios
|
|
14
35
|
```
|
|
15
36
|
|
|
16
|
-
|
|
17
|
-
|
|
37
|
+
由于已经在 Console 和 UC 项目中引入并设置好了 Axios 拦截器,所以直接使用即可:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { coreApiClient } from "@halo-dev/api-client"
|
|
41
|
+
|
|
42
|
+
coreApiClient.content.post.listPost().then(response => {
|
|
43
|
+
// handle response
|
|
44
|
+
})
|
|
18
45
|
```
|
|
19
46
|
|
|
20
|
-
|
|
47
|
+
此外,在最新的 `@halo-dev/ui-plugin-bundler-kit@2.17.0` 中,已经排除了 `@halo-dev/api-client`、`axios` 依赖,所以最终产物中的相关依赖会自动使用 Halo 本身提供的依赖,无需关心最终产物大小。
|
|
48
|
+
|
|
49
|
+
详细文档可查阅:[插件开发 / API 请求](https://docs.halo.run/developer-guide/plugin/api-reference/ui/api-request)
|
|
50
|
+
|
|
51
|
+
### 在外部项目中使用
|
|
52
|
+
|
|
53
|
+
```shell
|
|
54
|
+
pnpm install @halo-dev/api-client axios
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
```javascript
|
|
58
|
+
import axios from "axios"
|
|
59
|
+
|
|
60
|
+
const axiosInstance = axios.create({
|
|
61
|
+
baseURL: "http://localhost:8090"
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
const coreApiClient = createCoreApiClient(axiosInstance)
|
|
21
65
|
|
|
22
|
-
|
|
23
|
-
|
|
66
|
+
coreApiClient.content.post.listPost().then(response => {
|
|
67
|
+
// handle response
|
|
68
|
+
})
|
|
24
69
|
```
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { AnnotationSettingV1alpha1Api, AttachmentV1alpha1Api, AttachmentV1alpha1ConsoleApi, AttachmentV1alpha1UcApi, AuthProviderV1alpha1Api, AuthProviderV1alpha1ConsoleApi, BackupV1alpha1Api, CategoryV1alpha1Api, CommentV1alpha1Api, CommentV1alpha1ConsoleApi, CommentV1alpha1PublicApi, ConfigMapV1alpha1Api, CounterV1alpha1Api, DeviceV1alpha1UcApi, ExtensionDefinitionV1alpha1Api, ExtensionPointDefinitionV1alpha1Api, GroupV1alpha1Api, IndicesV1alpha1ConsoleApi, LoginApi, MenuItemV1alpha1Api, MenuV1alpha1Api, MenuV1alpha1PublicApi, MetricsV1alpha1PublicApi, MigrationV1alpha1ConsoleApi, NotificationTemplateV1alpha1Api, NotificationV1alpha1Api, NotificationV1alpha1UcApi, NotifierDescriptorV1alpha1Api, NotifierV1alpha1ConsoleApi, PersonalAccessTokenV1alpha1Api, PersonalAccessTokenV1alpha1UcApi, PluginV1alpha1Api, PluginV1alpha1ConsoleApi, PolicyTemplateV1alpha1Api, PolicyV1alpha1Api, PostV1alpha1Api, PostV1alpha1ConsoleApi, PostV1alpha1PublicApi, PostV1alpha1UcApi, ReasonTypeV1alpha1Api, ReasonV1alpha1Api, ReplyV1alpha1Api, ReplyV1alpha1ConsoleApi, ReverseProxyV1alpha1Api, RoleBindingV1alpha1Api, RoleV1alpha1Api, SearchEngineV1alpha1Api, SecretV1alpha1Api, SettingV1alpha1Api, SinglePageV1alpha1Api, SinglePageV1alpha1ConsoleApi, SnapshotV1alpha1Api, SnapshotV1alpha1UcApi, SubscriptionV1alpha1Api, SystemV1alpha1ConsoleApi, SystemV1alpha1PublicApi, TagV1alpha1Api, TagV1alpha1ConsoleApi, ThemeV1alpha1Api, ThemeV1alpha1ConsoleApi, TwoFactorAuthV1alpha1UcApi, UserConnectionV1alpha1Api, UserV1alpha1Api, UserV1alpha1ConsoleApi, UserV1alpha1PublicApi } from '../src';
|
|
3
|
+
|
|
4
|
+
declare const defaultAxiosInstance: AxiosInstance;
|
|
5
|
+
/**
|
|
6
|
+
* Create a core api client
|
|
7
|
+
*
|
|
8
|
+
* This is the API client for the CRUD interface that is automatically generated for Halo's core extensions.
|
|
9
|
+
*
|
|
10
|
+
* @see <https://github.com/halo-dev/rfcs/tree/main/extension>
|
|
11
|
+
* @param baseURL Halo backend base URL
|
|
12
|
+
* @param axiosInstance Axios instance
|
|
13
|
+
* @returns Core api client
|
|
14
|
+
* @example
|
|
15
|
+
* const axiosInstance = axios.create({
|
|
16
|
+
* baseURL: "https://demo.halo.run",
|
|
17
|
+
* withCredentials: true,
|
|
18
|
+
* })
|
|
19
|
+
*
|
|
20
|
+
* axiosInstance.interceptors.request.use((config) => {
|
|
21
|
+
* // do something before request
|
|
22
|
+
* return config;
|
|
23
|
+
* }, (error) => {
|
|
24
|
+
* // do something with request error
|
|
25
|
+
* return Promise.reject(error);
|
|
26
|
+
* });
|
|
27
|
+
*
|
|
28
|
+
* const coreApiClient = createCoreApiClient(axiosInstance);
|
|
29
|
+
*
|
|
30
|
+
* coreApiClient.content.post.listContentHaloRunV1alpha1Post().then(response => {
|
|
31
|
+
* // handle response
|
|
32
|
+
* })
|
|
33
|
+
*/
|
|
34
|
+
declare function createCoreApiClient(axiosInstance: AxiosInstance): {
|
|
35
|
+
annotationSetting: AnnotationSettingV1alpha1Api;
|
|
36
|
+
menu: MenuV1alpha1Api;
|
|
37
|
+
menuItem: MenuItemV1alpha1Api;
|
|
38
|
+
setting: SettingV1alpha1Api;
|
|
39
|
+
configMap: ConfigMapV1alpha1Api;
|
|
40
|
+
secret: SecretV1alpha1Api;
|
|
41
|
+
user: UserV1alpha1Api;
|
|
42
|
+
role: RoleV1alpha1Api;
|
|
43
|
+
roleBinding: RoleBindingV1alpha1Api;
|
|
44
|
+
content: {
|
|
45
|
+
category: CategoryV1alpha1Api;
|
|
46
|
+
comment: CommentV1alpha1Api;
|
|
47
|
+
post: PostV1alpha1Api;
|
|
48
|
+
reply: ReplyV1alpha1Api;
|
|
49
|
+
singlePage: SinglePageV1alpha1Api;
|
|
50
|
+
snapshot: SnapshotV1alpha1Api;
|
|
51
|
+
tag: TagV1alpha1Api;
|
|
52
|
+
};
|
|
53
|
+
auth: {
|
|
54
|
+
authProvider: AuthProviderV1alpha1Api;
|
|
55
|
+
userConnection: UserConnectionV1alpha1Api;
|
|
56
|
+
};
|
|
57
|
+
storage: {
|
|
58
|
+
attachment: AttachmentV1alpha1Api;
|
|
59
|
+
group: GroupV1alpha1Api;
|
|
60
|
+
policy: PolicyV1alpha1Api;
|
|
61
|
+
policyTemplate: PolicyTemplateV1alpha1Api;
|
|
62
|
+
};
|
|
63
|
+
plugin: {
|
|
64
|
+
extensionDefinition: ExtensionDefinitionV1alpha1Api;
|
|
65
|
+
extensionPointDefinition: ExtensionPointDefinitionV1alpha1Api;
|
|
66
|
+
plugin: PluginV1alpha1Api;
|
|
67
|
+
reverseProxy: ReverseProxyV1alpha1Api;
|
|
68
|
+
searchEngine: SearchEngineV1alpha1Api;
|
|
69
|
+
};
|
|
70
|
+
metrics: {
|
|
71
|
+
counter: CounterV1alpha1Api;
|
|
72
|
+
};
|
|
73
|
+
theme: {
|
|
74
|
+
theme: ThemeV1alpha1Api;
|
|
75
|
+
};
|
|
76
|
+
notification: {
|
|
77
|
+
notification: NotificationV1alpha1Api;
|
|
78
|
+
notificationTemplate: NotificationTemplateV1alpha1Api;
|
|
79
|
+
notifierDescriptor: NotifierDescriptorV1alpha1Api;
|
|
80
|
+
reason: ReasonV1alpha1Api;
|
|
81
|
+
reasonType: ReasonTypeV1alpha1Api;
|
|
82
|
+
subscription: SubscriptionV1alpha1Api;
|
|
83
|
+
};
|
|
84
|
+
migration: {
|
|
85
|
+
backup: BackupV1alpha1Api;
|
|
86
|
+
};
|
|
87
|
+
security: {
|
|
88
|
+
personalAccessToken: PersonalAccessTokenV1alpha1Api;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Create a console api client
|
|
93
|
+
*
|
|
94
|
+
* Console api client is used for console related operations
|
|
95
|
+
*
|
|
96
|
+
* @param baseURL Halo backend base URL
|
|
97
|
+
* @param axiosInstance Axios instance
|
|
98
|
+
* @returns Console api client
|
|
99
|
+
* @example
|
|
100
|
+
* const axiosInstance = axios.create({
|
|
101
|
+
* baseURL: "https://demo.halo.run",
|
|
102
|
+
* withCredentials: true,
|
|
103
|
+
* })
|
|
104
|
+
*
|
|
105
|
+
* axiosInstance.interceptors.request.use((config) => {
|
|
106
|
+
* // do something before request
|
|
107
|
+
* return config;
|
|
108
|
+
* }, (error) => {
|
|
109
|
+
* // do something with request error
|
|
110
|
+
* return Promise.reject(error);
|
|
111
|
+
* });
|
|
112
|
+
*
|
|
113
|
+
* const consoleApiClient = createConsoleApiClient(axiosInstance);
|
|
114
|
+
*
|
|
115
|
+
* consoleApiClient.content.post.listPosts().then(response => {
|
|
116
|
+
* // handle response
|
|
117
|
+
* })
|
|
118
|
+
*/
|
|
119
|
+
declare function createConsoleApiClient(axiosInstance: AxiosInstance): {
|
|
120
|
+
user: UserV1alpha1ConsoleApi;
|
|
121
|
+
system: SystemV1alpha1ConsoleApi;
|
|
122
|
+
migration: MigrationV1alpha1ConsoleApi;
|
|
123
|
+
login: LoginApi;
|
|
124
|
+
storage: {
|
|
125
|
+
attachment: AttachmentV1alpha1ConsoleApi;
|
|
126
|
+
};
|
|
127
|
+
auth: {
|
|
128
|
+
authProvider: AuthProviderV1alpha1ConsoleApi;
|
|
129
|
+
};
|
|
130
|
+
content: {
|
|
131
|
+
comment: CommentV1alpha1ConsoleApi;
|
|
132
|
+
reply: ReplyV1alpha1ConsoleApi;
|
|
133
|
+
indices: IndicesV1alpha1ConsoleApi;
|
|
134
|
+
post: PostV1alpha1ConsoleApi;
|
|
135
|
+
singlePage: SinglePageV1alpha1ConsoleApi;
|
|
136
|
+
tag: TagV1alpha1ConsoleApi;
|
|
137
|
+
};
|
|
138
|
+
notification: {
|
|
139
|
+
notifier: NotifierV1alpha1ConsoleApi;
|
|
140
|
+
};
|
|
141
|
+
plugin: {
|
|
142
|
+
plugin: PluginV1alpha1ConsoleApi;
|
|
143
|
+
};
|
|
144
|
+
theme: {
|
|
145
|
+
theme: ThemeV1alpha1ConsoleApi;
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Create a uc api client
|
|
150
|
+
*
|
|
151
|
+
* Uc api client is used for user content related operations
|
|
152
|
+
*
|
|
153
|
+
* @param baseURL Halo backend base URL
|
|
154
|
+
* @param axiosInstance Axios instance
|
|
155
|
+
* @returns Uc api client
|
|
156
|
+
* @example
|
|
157
|
+
* const axiosInstance = axios.create({
|
|
158
|
+
* baseURL: "https://demo.halo.run",
|
|
159
|
+
* withCredentials: true,
|
|
160
|
+
* })
|
|
161
|
+
*
|
|
162
|
+
* axiosInstance.interceptors.request.use((config) => {
|
|
163
|
+
* // do something before request
|
|
164
|
+
* return config;
|
|
165
|
+
* }, (error) => {
|
|
166
|
+
* // do something with request error
|
|
167
|
+
* return Promise.reject(error);
|
|
168
|
+
* });
|
|
169
|
+
*
|
|
170
|
+
* const ucApiClient = createUcApiClient(axiosInstance);
|
|
171
|
+
*
|
|
172
|
+
* ucApiClient.content.post.listMyPosts().then(response => {
|
|
173
|
+
* // handle response
|
|
174
|
+
* })
|
|
175
|
+
*/
|
|
176
|
+
declare function createUcApiClient(axiosInstance: AxiosInstance): {
|
|
177
|
+
storage: {
|
|
178
|
+
attachment: AttachmentV1alpha1UcApi;
|
|
179
|
+
};
|
|
180
|
+
content: {
|
|
181
|
+
post: PostV1alpha1UcApi;
|
|
182
|
+
snapshot: SnapshotV1alpha1UcApi;
|
|
183
|
+
};
|
|
184
|
+
security: {
|
|
185
|
+
twoFactor: TwoFactorAuthV1alpha1UcApi;
|
|
186
|
+
personalAccessToken: PersonalAccessTokenV1alpha1UcApi;
|
|
187
|
+
device: DeviceV1alpha1UcApi;
|
|
188
|
+
};
|
|
189
|
+
notification: {
|
|
190
|
+
notification: NotificationV1alpha1UcApi;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
/**
|
|
194
|
+
* Create a public api client
|
|
195
|
+
*
|
|
196
|
+
* Public api client is used for public content related operations, no need authentication
|
|
197
|
+
*
|
|
198
|
+
* @param baseURL Halo backend base URL
|
|
199
|
+
* @param axiosInstance Axios instance
|
|
200
|
+
* @returns Public api client
|
|
201
|
+
* @example
|
|
202
|
+
* const axiosInstance = axios.create({
|
|
203
|
+
* baseURL: "https://demo.halo.run",
|
|
204
|
+
* withCredentials: true,
|
|
205
|
+
* })
|
|
206
|
+
*
|
|
207
|
+
* axiosInstance.interceptors.request.use((config) => {
|
|
208
|
+
* // do something before request
|
|
209
|
+
* return config;
|
|
210
|
+
* }, (error) => {
|
|
211
|
+
* // do something with request error
|
|
212
|
+
* return Promise.reject(error);
|
|
213
|
+
* });
|
|
214
|
+
*
|
|
215
|
+
* const publicApiClient = createPublicApiClient(axiosInstance);
|
|
216
|
+
*
|
|
217
|
+
* publicApiClient.content.post.searchPost({ keyword: "foo" }).then(response => {
|
|
218
|
+
* // handle response
|
|
219
|
+
* })
|
|
220
|
+
*/
|
|
221
|
+
declare function createPublicApiClient(axiosInstance: AxiosInstance): {
|
|
222
|
+
menu: MenuV1alpha1PublicApi;
|
|
223
|
+
stats: SystemV1alpha1PublicApi;
|
|
224
|
+
user: UserV1alpha1PublicApi;
|
|
225
|
+
content: {
|
|
226
|
+
post: PostV1alpha1PublicApi;
|
|
227
|
+
comment: CommentV1alpha1PublicApi;
|
|
228
|
+
};
|
|
229
|
+
metrics: {
|
|
230
|
+
metrics: MetricsV1alpha1PublicApi;
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
declare const defaultCoreApiClient: {
|
|
234
|
+
annotationSetting: AnnotationSettingV1alpha1Api;
|
|
235
|
+
menu: MenuV1alpha1Api;
|
|
236
|
+
menuItem: MenuItemV1alpha1Api;
|
|
237
|
+
setting: SettingV1alpha1Api;
|
|
238
|
+
configMap: ConfigMapV1alpha1Api;
|
|
239
|
+
secret: SecretV1alpha1Api;
|
|
240
|
+
user: UserV1alpha1Api;
|
|
241
|
+
role: RoleV1alpha1Api;
|
|
242
|
+
roleBinding: RoleBindingV1alpha1Api;
|
|
243
|
+
content: {
|
|
244
|
+
category: CategoryV1alpha1Api;
|
|
245
|
+
comment: CommentV1alpha1Api;
|
|
246
|
+
post: PostV1alpha1Api;
|
|
247
|
+
reply: ReplyV1alpha1Api;
|
|
248
|
+
singlePage: SinglePageV1alpha1Api;
|
|
249
|
+
snapshot: SnapshotV1alpha1Api;
|
|
250
|
+
tag: TagV1alpha1Api;
|
|
251
|
+
};
|
|
252
|
+
auth: {
|
|
253
|
+
authProvider: AuthProviderV1alpha1Api;
|
|
254
|
+
userConnection: UserConnectionV1alpha1Api;
|
|
255
|
+
};
|
|
256
|
+
storage: {
|
|
257
|
+
attachment: AttachmentV1alpha1Api;
|
|
258
|
+
group: GroupV1alpha1Api;
|
|
259
|
+
policy: PolicyV1alpha1Api;
|
|
260
|
+
policyTemplate: PolicyTemplateV1alpha1Api;
|
|
261
|
+
};
|
|
262
|
+
plugin: {
|
|
263
|
+
extensionDefinition: ExtensionDefinitionV1alpha1Api;
|
|
264
|
+
extensionPointDefinition: ExtensionPointDefinitionV1alpha1Api;
|
|
265
|
+
plugin: PluginV1alpha1Api;
|
|
266
|
+
reverseProxy: ReverseProxyV1alpha1Api;
|
|
267
|
+
searchEngine: SearchEngineV1alpha1Api;
|
|
268
|
+
};
|
|
269
|
+
metrics: {
|
|
270
|
+
counter: CounterV1alpha1Api;
|
|
271
|
+
};
|
|
272
|
+
theme: {
|
|
273
|
+
theme: ThemeV1alpha1Api;
|
|
274
|
+
};
|
|
275
|
+
notification: {
|
|
276
|
+
notification: NotificationV1alpha1Api;
|
|
277
|
+
notificationTemplate: NotificationTemplateV1alpha1Api;
|
|
278
|
+
notifierDescriptor: NotifierDescriptorV1alpha1Api;
|
|
279
|
+
reason: ReasonV1alpha1Api;
|
|
280
|
+
reasonType: ReasonTypeV1alpha1Api;
|
|
281
|
+
subscription: SubscriptionV1alpha1Api;
|
|
282
|
+
};
|
|
283
|
+
migration: {
|
|
284
|
+
backup: BackupV1alpha1Api;
|
|
285
|
+
};
|
|
286
|
+
security: {
|
|
287
|
+
personalAccessToken: PersonalAccessTokenV1alpha1Api;
|
|
288
|
+
};
|
|
289
|
+
};
|
|
290
|
+
declare const defaultConsoleApiClient: {
|
|
291
|
+
user: UserV1alpha1ConsoleApi;
|
|
292
|
+
system: SystemV1alpha1ConsoleApi;
|
|
293
|
+
migration: MigrationV1alpha1ConsoleApi;
|
|
294
|
+
login: LoginApi;
|
|
295
|
+
storage: {
|
|
296
|
+
attachment: AttachmentV1alpha1ConsoleApi;
|
|
297
|
+
};
|
|
298
|
+
auth: {
|
|
299
|
+
authProvider: AuthProviderV1alpha1ConsoleApi;
|
|
300
|
+
};
|
|
301
|
+
content: {
|
|
302
|
+
comment: CommentV1alpha1ConsoleApi;
|
|
303
|
+
reply: ReplyV1alpha1ConsoleApi;
|
|
304
|
+
indices: IndicesV1alpha1ConsoleApi;
|
|
305
|
+
post: PostV1alpha1ConsoleApi;
|
|
306
|
+
singlePage: SinglePageV1alpha1ConsoleApi;
|
|
307
|
+
tag: TagV1alpha1ConsoleApi;
|
|
308
|
+
};
|
|
309
|
+
notification: {
|
|
310
|
+
notifier: NotifierV1alpha1ConsoleApi;
|
|
311
|
+
};
|
|
312
|
+
plugin: {
|
|
313
|
+
plugin: PluginV1alpha1ConsoleApi;
|
|
314
|
+
};
|
|
315
|
+
theme: {
|
|
316
|
+
theme: ThemeV1alpha1ConsoleApi;
|
|
317
|
+
};
|
|
318
|
+
};
|
|
319
|
+
declare const defaultUcApiClient: {
|
|
320
|
+
storage: {
|
|
321
|
+
attachment: AttachmentV1alpha1UcApi;
|
|
322
|
+
};
|
|
323
|
+
content: {
|
|
324
|
+
post: PostV1alpha1UcApi;
|
|
325
|
+
snapshot: SnapshotV1alpha1UcApi;
|
|
326
|
+
};
|
|
327
|
+
security: {
|
|
328
|
+
twoFactor: TwoFactorAuthV1alpha1UcApi;
|
|
329
|
+
personalAccessToken: PersonalAccessTokenV1alpha1UcApi;
|
|
330
|
+
device: DeviceV1alpha1UcApi;
|
|
331
|
+
};
|
|
332
|
+
notification: {
|
|
333
|
+
notification: NotificationV1alpha1UcApi;
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
declare const defaultPublicApiClient: {
|
|
337
|
+
menu: MenuV1alpha1PublicApi;
|
|
338
|
+
stats: SystemV1alpha1PublicApi;
|
|
339
|
+
user: UserV1alpha1PublicApi;
|
|
340
|
+
content: {
|
|
341
|
+
post: PostV1alpha1PublicApi;
|
|
342
|
+
comment: CommentV1alpha1PublicApi;
|
|
343
|
+
};
|
|
344
|
+
metrics: {
|
|
345
|
+
metrics: MetricsV1alpha1PublicApi;
|
|
346
|
+
};
|
|
347
|
+
};
|
|
348
|
+
export { defaultAxiosInstance as axiosInstance, defaultConsoleApiClient as consoleApiClient, defaultCoreApiClient as coreApiClient, createConsoleApiClient, createCoreApiClient, createPublicApiClient, createUcApiClient, defaultPublicApiClient as publicApiClient, defaultUcApiClient as ucApiClient };
|