create-halo-plugin-template 1.0.0 → 1.0.2

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.
Files changed (109) hide show
  1. package/.editorconfig +520 -0
  2. package/.github/workflows/cd.yaml +20 -0
  3. package/.github/workflows/ci.yaml +32 -0
  4. package/.github/workflows/publish-npm.yaml +46 -0
  5. package/.gitignore +83 -0
  6. package/LICENSE +674 -0
  7. package/README.md +191 -0
  8. package/bin/create-halo-plugin-template.js +3 -0
  9. package/build.gradle +103 -0
  10. package/docs/first-npm-release-checklist.md +58 -0
  11. package/docs/publish-template.md +148 -0
  12. package/docs/rsbuild-switch.md +90 -0
  13. package/docs/template-pruning.md +43 -0
  14. package/gradle/wrapper/gradle-wrapper.jar +0 -0
  15. package/gradle/wrapper/gradle-wrapper.properties +7 -0
  16. package/gradle.properties +1 -0
  17. package/gradlew +248 -0
  18. package/gradlew.bat +93 -0
  19. package/package.json +67 -7
  20. package/scripts/create-project.mjs +399 -0
  21. package/scripts/init-template.mjs +281 -0
  22. package/scripts/publish-check.mjs +97 -0
  23. package/scripts/release.mjs +278 -0
  24. package/scripts/verify-template.mjs +407 -0
  25. package/settings.gradle +7 -0
  26. package/src/main/java/run/halo/plugintemplate/PluginTemplatePlugin.java +43 -0
  27. package/src/main/java/run/halo/plugintemplate/config/PluginTemplateConfig.java +14 -0
  28. package/src/main/java/run/halo/plugintemplate/dto/PluginTemplateChecklistItem.java +30 -0
  29. package/src/main/java/run/halo/plugintemplate/dto/PluginTemplateFeatureItem.java +30 -0
  30. package/src/main/java/run/halo/plugintemplate/dto/PluginTemplateOverview.java +73 -0
  31. package/src/main/java/run/halo/plugintemplate/dto/PluginTemplateStatItem.java +30 -0
  32. package/src/main/java/run/halo/plugintemplate/endpoint/PluginTemplateConsoleEndpoint.java +33 -0
  33. package/src/main/java/run/halo/plugintemplate/endpoint/PluginTemplatePublicEndpoint.java +26 -0
  34. package/src/main/java/run/halo/plugintemplate/endpoint/PluginTemplateUcEndpoint.java +33 -0
  35. package/src/main/java/run/halo/plugintemplate/endpoint/routes/PluginTemplateOverviewRoutes.java +60 -0
  36. package/src/main/java/run/halo/plugintemplate/model/PluginTemplateAudience.java +23 -0
  37. package/src/main/java/run/halo/plugintemplate/query/PluginTemplateOverviewQuery.java +26 -0
  38. package/src/main/java/run/halo/plugintemplate/reconcile/PluginTemplateSettingsReconciler.java +17 -0
  39. package/src/main/java/run/halo/plugintemplate/scheme/PluginTemplateRecord.java +43 -0
  40. package/src/main/java/run/halo/plugintemplate/service/PluginTemplateOverviewService.java +10 -0
  41. package/src/main/java/run/halo/plugintemplate/service/impl/PluginTemplateOverviewServiceImpl.java +74 -0
  42. package/src/main/java/run/halo/plugintemplate/setting/PluginTemplateGeneralSetting.java +25 -0
  43. package/src/main/java/run/halo/plugintemplate/setting/PluginTemplateSettingKeys.java +24 -0
  44. package/src/main/java/run/halo/plugintemplate/setting/PluginTemplateUiSetting.java +13 -0
  45. package/src/main/java/run/halo/plugintemplate/utils/PluginTemplateSeeds.java +197 -0
  46. package/src/main/resources/extensions/roleTemplate-console.yaml +39 -0
  47. package/src/main/resources/extensions/roleTemplate-uc.yaml +19 -0
  48. package/src/main/resources/extensions/settings.yaml +47 -0
  49. package/src/main/resources/logo.png +0 -0
  50. package/src/main/resources/plugin.yaml +24 -0
  51. package/src/test/java/run/halo/plugintemplate/PluginTemplatePluginTest.java +34 -0
  52. package/src/test/java/run/halo/plugintemplate/service/impl/PluginTemplateOverviewServiceImplTest.java +97 -0
  53. package/ui/build.gradle +41 -0
  54. package/ui/env.d.ts +2 -0
  55. package/ui/eslint.config.ts +30 -0
  56. package/ui/package.json +57 -0
  57. package/ui/pnpm-lock.yaml +5250 -0
  58. package/ui/src/api/__tests__/normalizers.spec.ts +65 -0
  59. package/ui/src/api/generated/.openapi-generator/FILES +23 -0
  60. package/ui/src/api/generated/.openapi-generator/VERSION +1 -0
  61. package/ui/src/api/generated/.openapi-generator-ignore +23 -0
  62. package/ui/src/api/generated/api/plugin-template-console-api.ts +128 -0
  63. package/ui/src/api/generated/api/plugin-template-uc-api.ts +128 -0
  64. package/ui/src/api/generated/api.ts +19 -0
  65. package/ui/src/api/generated/base.ts +86 -0
  66. package/ui/src/api/generated/common.ts +150 -0
  67. package/ui/src/api/generated/configuration.ts +110 -0
  68. package/ui/src/api/generated/git_push.sh +57 -0
  69. package/ui/src/api/generated/index.ts +18 -0
  70. package/ui/src/api/generated/models/add-operation.ts +49 -0
  71. package/ui/src/api/generated/models/copy-operation.ts +49 -0
  72. package/ui/src/api/generated/models/index.ts +11 -0
  73. package/ui/src/api/generated/models/json-patch-inner.ts +41 -0
  74. package/ui/src/api/generated/models/move-operation.ts +49 -0
  75. package/ui/src/api/generated/models/plugin-template-checklist-item.ts +54 -0
  76. package/ui/src/api/generated/models/plugin-template-feature-item.ts +54 -0
  77. package/ui/src/api/generated/models/plugin-template-overview.ts +147 -0
  78. package/ui/src/api/generated/models/plugin-template-stat-item.ts +54 -0
  79. package/ui/src/api/generated/models/remove-operation.ts +43 -0
  80. package/ui/src/api/generated/models/replace-operation.ts +49 -0
  81. package/ui/src/api/generated/models/test-operation.ts +49 -0
  82. package/ui/src/api/index.ts +42 -0
  83. package/ui/src/api/normalizers.ts +65 -0
  84. package/ui/src/assets/element.scss +24 -0
  85. package/ui/src/assets/index.css +361 -0
  86. package/ui/src/assets/logo.svg +1 -0
  87. package/ui/src/components/PluginTemplateAttachmentTab.vue +69 -0
  88. package/ui/src/components/PluginTemplateCommonTable.vue +69 -0
  89. package/ui/src/components/PluginTemplateDashboardWidget.vue +62 -0
  90. package/ui/src/components/PluginTemplateOverviewPage.vue +254 -0
  91. package/ui/src/components/ui/PluginUiProvider.vue +40 -0
  92. package/ui/src/components/ui/UiMetricCard.vue +21 -0
  93. package/ui/src/components/ui/UiSectionCard.vue +25 -0
  94. package/ui/src/components/ui/UiStatusPill.vue +18 -0
  95. package/ui/src/composables/useTemplateOverview.ts +38 -0
  96. package/ui/src/index.ts +88 -0
  97. package/ui/src/lib/__tests__/plugin-ui.spec.ts +19 -0
  98. package/ui/src/lib/plugin-ui.ts +19 -0
  99. package/ui/src/lib/template.spec.ts +24 -0
  100. package/ui/src/lib/template.ts +52 -0
  101. package/ui/src/lib/theme.ts +31 -0
  102. package/ui/src/types/index.ts +59 -0
  103. package/ui/src/views/console/ConsoleDashboardView.vue +7 -0
  104. package/ui/src/views/uc/UcDashboardView.vue +7 -0
  105. package/ui/tsconfig.app.json +12 -0
  106. package/ui/tsconfig.json +14 -0
  107. package/ui/tsconfig.node.json +15 -0
  108. package/ui/tsconfig.vitest.json +11 -0
  109. package/ui/vite.config.ts +25 -0
@@ -0,0 +1,65 @@
1
+ import { describe, expect, it } from 'vitest'
2
+ import { normalizeOverview, type RawTemplateOverview } from '@/api/normalizers'
3
+
4
+ describe('normalizeOverview', () => {
5
+ it('fills defaults for sparse backend payloads', () => {
6
+ const normalized = normalizeOverview({} as RawTemplateOverview)
7
+
8
+ expect(normalized.pluginName).toBe('halo-plugin-template')
9
+ expect(normalized.consolePath).toBe('/halo-plugin-template')
10
+ expect(normalized.enableConsoleDashboard).toBe(true)
11
+ expect(normalized.enableUcDashboard).toBe(true)
12
+ expect(normalized.enableAttachmentProvider).toBe(true)
13
+ expect(normalized.accentColor).toBe('#2457F5')
14
+ expect(normalized.density).toBe('balanced')
15
+ expect(normalized.stats).toEqual([])
16
+ expect(normalized.features).toEqual([])
17
+ expect(normalized.checklist).toEqual([])
18
+ })
19
+
20
+ it('normalizes nested collections into stable UI models', () => {
21
+ const normalized = normalizeOverview({
22
+ pluginName: 'hello-world',
23
+ displayName: 'Hello World',
24
+ audience: 'uc',
25
+ audienceLabel: 'User Center',
26
+ consolePath: '/hello-world',
27
+ ucPath: '/hello-world',
28
+ settingName: 'hello-world-settings',
29
+ configMapName: 'hello-world-configmap',
30
+ generatedClientPath: 'ui/src/api/generated',
31
+ generatedAt: '2026-04-07T12:00:00Z',
32
+ enableConsoleDashboard: false,
33
+ enableUcDashboard: true,
34
+ enableAttachmentProvider: false,
35
+ accentColor: '#102030',
36
+ density: 'compact',
37
+ supportLink: 'https://example.com/help',
38
+ stats: [{ label: 'Routes', value: '2' }],
39
+ features: [{ title: 'UC 页面', enabled: false }],
40
+ checklist: [{ title: '生成 API', status: 'done' }],
41
+ } as RawTemplateOverview)
42
+
43
+ expect(normalized.pluginName).toBe('hello-world')
44
+ expect(normalized.enableConsoleDashboard).toBe(false)
45
+ expect(normalized.enableAttachmentProvider).toBe(false)
46
+ expect(normalized.stats[0]).toMatchObject({
47
+ key: 'stat-0',
48
+ label: 'Routes',
49
+ value: '2',
50
+ tone: 'info',
51
+ })
52
+ expect(normalized.features[0]).toMatchObject({
53
+ key: 'feature-0',
54
+ title: 'UC 页面',
55
+ area: 'General',
56
+ enabled: false,
57
+ })
58
+ expect(normalized.checklist[0]).toMatchObject({
59
+ key: 'checklist-0',
60
+ title: '生成 API',
61
+ audience: 'all',
62
+ status: 'done',
63
+ })
64
+ })
65
+ })
@@ -0,0 +1,23 @@
1
+ .gitignore
2
+ .npmignore
3
+ .openapi-generator-ignore
4
+ api.ts
5
+ api/plugin-template-console-api.ts
6
+ api/plugin-template-uc-api.ts
7
+ base.ts
8
+ common.ts
9
+ configuration.ts
10
+ git_push.sh
11
+ index.ts
12
+ models/add-operation.ts
13
+ models/copy-operation.ts
14
+ models/index.ts
15
+ models/json-patch-inner.ts
16
+ models/move-operation.ts
17
+ models/plugin-template-checklist-item.ts
18
+ models/plugin-template-feature-item.ts
19
+ models/plugin-template-overview.ts
20
+ models/plugin-template-stat-item.ts
21
+ models/remove-operation.ts
22
+ models/replace-operation.ts
23
+ models/test-operation.ts
@@ -0,0 +1,23 @@
1
+ # OpenAPI Generator Ignore
2
+ # Generated by openapi-generator https://github.com/openapitools/openapi-generator
3
+
4
+ # Use this file to prevent files from being overwritten by the generator.
5
+ # The patterns follow closely to .gitignore or .dockerignore.
6
+
7
+ # As an example, the C# client generator defines ApiClient.cs.
8
+ # You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
9
+ #ApiClient.cs
10
+
11
+ # You can match any string of characters against a directory, file or extension with a single asterisk (*):
12
+ #foo/*/qux
13
+ # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
14
+
15
+ # You can recursively match patterns against a directory, file or extension with a double asterisk (**):
16
+ #foo/**/qux
17
+ # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
18
+
19
+ # You can also negate patterns with an exclamation (!).
20
+ # For example, you can ignore all files in a docs folder with the file extension .md:
21
+ #docs/*.md
22
+ # Then explicitly reverse the ignore rule for a single file:
23
+ #!docs/README.md
@@ -0,0 +1,128 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Halo
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.23.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import type { PluginTemplateOverview } from '../models';
26
+ /**
27
+ * PluginTemplateConsoleApi - axios parameter creator
28
+ * @export
29
+ */
30
+ export const PluginTemplateConsoleApiAxiosParamCreator = function (configuration?: Configuration) {
31
+ return {
32
+ /**
33
+ * 获取模板在 Console 中的默认能力概览
34
+ * @param {*} [options] Override http request option.
35
+ * @throws {RequiredError}
36
+ */
37
+ pluginTemplateOverviewForConsole: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
38
+ const localVarPath = `/apis/console.halo-plugin-template.halo.run/v1alpha1/template-overview/summary`;
39
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
40
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
41
+ let baseOptions;
42
+ if (configuration) {
43
+ baseOptions = configuration.baseOptions;
44
+ }
45
+
46
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
47
+ const localVarHeaderParameter = {} as any;
48
+ const localVarQueryParameter = {} as any;
49
+
50
+ // authentication basicAuth required
51
+ // http basic authentication required
52
+ setBasicAuthToObject(localVarRequestOptions, configuration)
53
+
54
+ // authentication bearerAuth required
55
+ // http bearer authentication required
56
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
57
+
58
+
59
+
60
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
61
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
62
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
63
+
64
+ return {
65
+ url: toPathString(localVarUrlObj),
66
+ options: localVarRequestOptions,
67
+ };
68
+ },
69
+ }
70
+ };
71
+
72
+ /**
73
+ * PluginTemplateConsoleApi - functional programming interface
74
+ * @export
75
+ */
76
+ export const PluginTemplateConsoleApiFp = function(configuration?: Configuration) {
77
+ const localVarAxiosParamCreator = PluginTemplateConsoleApiAxiosParamCreator(configuration)
78
+ return {
79
+ /**
80
+ * 获取模板在 Console 中的默认能力概览
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ */
84
+ async pluginTemplateOverviewForConsole(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginTemplateOverview>> {
85
+ const localVarAxiosArgs = await localVarAxiosParamCreator.pluginTemplateOverviewForConsole(options);
86
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
87
+ const localVarOperationServerBasePath = operationServerMap['PluginTemplateConsoleApi.pluginTemplateOverviewForConsole']?.[localVarOperationServerIndex]?.url;
88
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
89
+ },
90
+ }
91
+ };
92
+
93
+ /**
94
+ * PluginTemplateConsoleApi - factory interface
95
+ * @export
96
+ */
97
+ export const PluginTemplateConsoleApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
98
+ const localVarFp = PluginTemplateConsoleApiFp(configuration)
99
+ return {
100
+ /**
101
+ * 获取模板在 Console 中的默认能力概览
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ */
105
+ pluginTemplateOverviewForConsole(options?: RawAxiosRequestConfig): AxiosPromise<PluginTemplateOverview> {
106
+ return localVarFp.pluginTemplateOverviewForConsole(options).then((request) => request(axios, basePath));
107
+ },
108
+ };
109
+ };
110
+
111
+ /**
112
+ * PluginTemplateConsoleApi - object-oriented interface
113
+ * @export
114
+ * @class PluginTemplateConsoleApi
115
+ * @extends {BaseAPI}
116
+ */
117
+ export class PluginTemplateConsoleApi extends BaseAPI {
118
+ /**
119
+ * 获取模板在 Console 中的默认能力概览
120
+ * @param {*} [options] Override http request option.
121
+ * @throws {RequiredError}
122
+ * @memberof PluginTemplateConsoleApi
123
+ */
124
+ public pluginTemplateOverviewForConsole(options?: RawAxiosRequestConfig) {
125
+ return PluginTemplateConsoleApiFp(this.configuration).pluginTemplateOverviewForConsole(options).then((request) => request(this.axios, this.basePath));
126
+ }
127
+ }
128
+
@@ -0,0 +1,128 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Halo
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.23.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from '../configuration';
17
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
18
+ import globalAxios from 'axios';
19
+ // Some imports not used depending on template conditions
20
+ // @ts-ignore
21
+ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
22
+ // @ts-ignore
23
+ import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
+ // @ts-ignore
25
+ import type { PluginTemplateOverview } from '../models';
26
+ /**
27
+ * PluginTemplateUcApi - axios parameter creator
28
+ * @export
29
+ */
30
+ export const PluginTemplateUcApiAxiosParamCreator = function (configuration?: Configuration) {
31
+ return {
32
+ /**
33
+ * 获取模板在 UC 中的默认能力概览
34
+ * @param {*} [options] Override http request option.
35
+ * @throws {RequiredError}
36
+ */
37
+ pluginTemplateOverviewForUc: async (options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
38
+ const localVarPath = `/apis/uc.halo-plugin-template.halo.run/v1alpha1/template-overview/summary`;
39
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
40
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
41
+ let baseOptions;
42
+ if (configuration) {
43
+ baseOptions = configuration.baseOptions;
44
+ }
45
+
46
+ const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
47
+ const localVarHeaderParameter = {} as any;
48
+ const localVarQueryParameter = {} as any;
49
+
50
+ // authentication basicAuth required
51
+ // http basic authentication required
52
+ setBasicAuthToObject(localVarRequestOptions, configuration)
53
+
54
+ // authentication bearerAuth required
55
+ // http bearer authentication required
56
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
57
+
58
+
59
+
60
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
61
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
62
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
63
+
64
+ return {
65
+ url: toPathString(localVarUrlObj),
66
+ options: localVarRequestOptions,
67
+ };
68
+ },
69
+ }
70
+ };
71
+
72
+ /**
73
+ * PluginTemplateUcApi - functional programming interface
74
+ * @export
75
+ */
76
+ export const PluginTemplateUcApiFp = function(configuration?: Configuration) {
77
+ const localVarAxiosParamCreator = PluginTemplateUcApiAxiosParamCreator(configuration)
78
+ return {
79
+ /**
80
+ * 获取模板在 UC 中的默认能力概览
81
+ * @param {*} [options] Override http request option.
82
+ * @throws {RequiredError}
83
+ */
84
+ async pluginTemplateOverviewForUc(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<PluginTemplateOverview>> {
85
+ const localVarAxiosArgs = await localVarAxiosParamCreator.pluginTemplateOverviewForUc(options);
86
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
87
+ const localVarOperationServerBasePath = operationServerMap['PluginTemplateUcApi.pluginTemplateOverviewForUc']?.[localVarOperationServerIndex]?.url;
88
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
89
+ },
90
+ }
91
+ };
92
+
93
+ /**
94
+ * PluginTemplateUcApi - factory interface
95
+ * @export
96
+ */
97
+ export const PluginTemplateUcApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
98
+ const localVarFp = PluginTemplateUcApiFp(configuration)
99
+ return {
100
+ /**
101
+ * 获取模板在 UC 中的默认能力概览
102
+ * @param {*} [options] Override http request option.
103
+ * @throws {RequiredError}
104
+ */
105
+ pluginTemplateOverviewForUc(options?: RawAxiosRequestConfig): AxiosPromise<PluginTemplateOverview> {
106
+ return localVarFp.pluginTemplateOverviewForUc(options).then((request) => request(axios, basePath));
107
+ },
108
+ };
109
+ };
110
+
111
+ /**
112
+ * PluginTemplateUcApi - object-oriented interface
113
+ * @export
114
+ * @class PluginTemplateUcApi
115
+ * @extends {BaseAPI}
116
+ */
117
+ export class PluginTemplateUcApi extends BaseAPI {
118
+ /**
119
+ * 获取模板在 UC 中的默认能力概览
120
+ * @param {*} [options] Override http request option.
121
+ * @throws {RequiredError}
122
+ * @memberof PluginTemplateUcApi
123
+ */
124
+ public pluginTemplateOverviewForUc(options?: RawAxiosRequestConfig) {
125
+ return PluginTemplateUcApiFp(this.configuration).pluginTemplateOverviewForUc(options).then((request) => request(this.axios, this.basePath));
126
+ }
127
+ }
128
+
@@ -0,0 +1,19 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Halo
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.23.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+
17
+ export * from './api/plugin-template-console-api';
18
+ export * from './api/plugin-template-uc-api';
19
+
@@ -0,0 +1,86 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Halo
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.23.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from './configuration';
17
+ // Some imports not used depending on template conditions
18
+ // @ts-ignore
19
+ import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios';
20
+ import globalAxios from 'axios';
21
+
22
+ export const BASE_PATH = "http://localhost:46375".replace(/\/+$/, "");
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ */
28
+ export const COLLECTION_FORMATS = {
29
+ csv: ",",
30
+ ssv: " ",
31
+ tsv: "\t",
32
+ pipes: "|",
33
+ };
34
+
35
+ /**
36
+ *
37
+ * @export
38
+ * @interface RequestArgs
39
+ */
40
+ export interface RequestArgs {
41
+ url: string;
42
+ options: RawAxiosRequestConfig;
43
+ }
44
+
45
+ /**
46
+ *
47
+ * @export
48
+ * @class BaseAPI
49
+ */
50
+ export class BaseAPI {
51
+ protected configuration: Configuration | undefined;
52
+
53
+ constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
54
+ if (configuration) {
55
+ this.configuration = configuration;
56
+ this.basePath = configuration.basePath ?? basePath;
57
+ }
58
+ }
59
+ };
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ * @class RequiredError
65
+ * @extends {Error}
66
+ */
67
+ export class RequiredError extends Error {
68
+ constructor(public field: string, msg?: string) {
69
+ super(msg);
70
+ this.name = "RequiredError"
71
+ }
72
+ }
73
+
74
+ interface ServerMap {
75
+ [key: string]: {
76
+ url: string,
77
+ description: string,
78
+ }[];
79
+ }
80
+
81
+ /**
82
+ *
83
+ * @export
84
+ */
85
+ export const operationServerMap: ServerMap = {
86
+ }
@@ -0,0 +1,150 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Halo
5
+ * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
6
+ *
7
+ * The version of the OpenAPI document: 2.23.2
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import type { Configuration } from "./configuration";
17
+ import type { RequestArgs } from "./base";
18
+ import type { AxiosInstance, AxiosResponse } from 'axios';
19
+ import { RequiredError } from "./base";
20
+
21
+ /**
22
+ *
23
+ * @export
24
+ */
25
+ export const DUMMY_BASE_URL = 'https://example.com'
26
+
27
+ /**
28
+ *
29
+ * @throws {RequiredError}
30
+ * @export
31
+ */
32
+ export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
33
+ if (paramValue === null || paramValue === undefined) {
34
+ throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
35
+ }
36
+ }
37
+
38
+ /**
39
+ *
40
+ * @export
41
+ */
42
+ export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
43
+ if (configuration && configuration.apiKey) {
44
+ const localVarApiKeyValue = typeof configuration.apiKey === 'function'
45
+ ? await configuration.apiKey(keyParamName)
46
+ : await configuration.apiKey;
47
+ object[keyParamName] = localVarApiKeyValue;
48
+ }
49
+ }
50
+
51
+ /**
52
+ *
53
+ * @export
54
+ */
55
+ export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
56
+ if (configuration && (configuration.username || configuration.password)) {
57
+ object["auth"] = { username: configuration.username, password: configuration.password };
58
+ }
59
+ }
60
+
61
+ /**
62
+ *
63
+ * @export
64
+ */
65
+ export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
66
+ if (configuration && configuration.accessToken) {
67
+ const accessToken = typeof configuration.accessToken === 'function'
68
+ ? await configuration.accessToken()
69
+ : await configuration.accessToken;
70
+ object["Authorization"] = "Bearer " + accessToken;
71
+ }
72
+ }
73
+
74
+ /**
75
+ *
76
+ * @export
77
+ */
78
+ export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
79
+ if (configuration && configuration.accessToken) {
80
+ const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
81
+ ? await configuration.accessToken(name, scopes)
82
+ : await configuration.accessToken;
83
+ object["Authorization"] = "Bearer " + localVarAccessTokenValue;
84
+ }
85
+ }
86
+
87
+ function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
88
+ if (parameter == null) return;
89
+ if (typeof parameter === "object") {
90
+ if (Array.isArray(parameter)) {
91
+ (parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
92
+ }
93
+ else {
94
+ Object.keys(parameter).forEach(currentKey =>
95
+ setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
96
+ );
97
+ }
98
+ }
99
+ else {
100
+ if (urlSearchParams.has(key)) {
101
+ urlSearchParams.append(key, parameter);
102
+ }
103
+ else {
104
+ urlSearchParams.set(key, parameter);
105
+ }
106
+ }
107
+ }
108
+
109
+ /**
110
+ *
111
+ * @export
112
+ */
113
+ export const setSearchParams = function (url: URL, ...objects: any[]) {
114
+ const searchParams = new URLSearchParams(url.search);
115
+ setFlattenedQueryParams(searchParams, objects);
116
+ url.search = searchParams.toString();
117
+ }
118
+
119
+ /**
120
+ *
121
+ * @export
122
+ */
123
+ export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
124
+ const nonString = typeof value !== 'string';
125
+ const needsSerialization = nonString && configuration && configuration.isJsonMime
126
+ ? configuration.isJsonMime(requestOptions.headers['Content-Type'])
127
+ : nonString;
128
+ return needsSerialization
129
+ ? JSON.stringify(value !== undefined ? value : {})
130
+ : (value || "");
131
+ }
132
+
133
+ /**
134
+ *
135
+ * @export
136
+ */
137
+ export const toPathString = function (url: URL) {
138
+ return url.pathname + url.search + url.hash
139
+ }
140
+
141
+ /**
142
+ *
143
+ * @export
144
+ */
145
+ export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
146
+ return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
147
+ const axiosRequestArgs = {...axiosArgs.options, url: (axios.defaults.baseURL ? '' : configuration?.basePath ?? basePath) + axiosArgs.url};
148
+ return axios.request<T, R>(axiosRequestArgs);
149
+ };
150
+ }