zova-module-a-layoutprofile 5.0.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/cli/openapi.config.ts +9 -0
- package/dist/.metadata/index.d.ts +104 -0
- package/dist/.metadata/index.d.ts.map +1 -0
- package/dist/.metadata/this.d.ts +3 -0
- package/dist/.metadata/this.d.ts.map +1 -0
- package/dist/api/layoutprofile.d.ts +47 -0
- package/dist/api/layoutprofile.d.ts.map +1 -0
- package/dist/api/openapi/baseURL.d.ts +3 -0
- package/dist/api/openapi/baseURL.d.ts.map +1 -0
- package/dist/api/openapi/index.d.ts +4 -0
- package/dist/api/openapi/index.d.ts.map +1 -0
- package/dist/api/openapi/schemas.d.ts +368 -0
- package/dist/api/openapi/schemas.d.ts.map +1 -0
- package/dist/api/openapi/types.d.ts +9937 -0
- package/dist/api/openapi/types.d.ts.map +1 -0
- package/dist/apiSchema/layoutprofile.d.ts +8 -0
- package/dist/apiSchema/layoutprofile.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +111 -0
- package/dist/index.js.map +1 -0
- package/dist/model/layoutprofile.d.ts +37 -0
- package/dist/model/layoutprofile.d.ts.map +1 -0
- package/package.json +31 -0
- package/src/.metadata/index.ts +140 -0
- package/src/.metadata/this.ts +2 -0
- package/src/api/layoutprofile.ts +67 -0
- package/src/api/openapi/baseURL.ts +5 -0
- package/src/api/openapi/index.ts +3 -0
- package/src/api/openapi/schemas.ts +663 -0
- package/src/api/openapi/types.ts +10150 -0
- package/src/apiSchema/layoutprofile.ts +25 -0
- package/src/index.ts +1 -0
- package/src/model/layoutprofile.ts +76 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IApiSchemaOptions } from 'zova-module-a-api';
|
|
2
|
+
|
|
3
|
+
import { BeanBase } from 'zova';
|
|
4
|
+
import { ApiSchema } from 'zova-module-a-api';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ApiApiLayoutprofileloadPath,
|
|
8
|
+
ApiApiLayoutprofilesavePath,
|
|
9
|
+
ApiApiLayoutprofileresetPath,
|
|
10
|
+
} from '../api/layoutprofile.js';
|
|
11
|
+
|
|
12
|
+
@ApiSchema()
|
|
13
|
+
export class ApiSchemaLayoutprofile extends BeanBase {
|
|
14
|
+
load(options?: IApiSchemaOptions) {
|
|
15
|
+
return this.$sdk.createApiSchemas(ApiApiLayoutprofileloadPath, 'get', options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
save(options?: IApiSchemaOptions) {
|
|
19
|
+
return this.$sdk.createApiSchemas(ApiApiLayoutprofilesavePath, 'post', options);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
reset(options?: IApiSchemaOptions) {
|
|
23
|
+
return this.$sdk.createApiSchemas(ApiApiLayoutprofileresetPath, 'delete', options);
|
|
24
|
+
}
|
|
25
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './.metadata/index.js';
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { IDecoratorModelOptions } from 'zova-module-a-model';
|
|
2
|
+
|
|
3
|
+
import { BeanModelBase, Model } from 'zova-module-a-model';
|
|
4
|
+
|
|
5
|
+
import type {
|
|
6
|
+
ApiApiLayoutprofileloadResponseBody,
|
|
7
|
+
ApiApiLayoutprofileresetResponseBody,
|
|
8
|
+
ApiApiLayoutprofilesaveRequestBody,
|
|
9
|
+
ApiApiLayoutprofilesaveResponseBody,
|
|
10
|
+
} from '../api/layoutprofile.js';
|
|
11
|
+
|
|
12
|
+
export interface IModelOptionsLayoutProfile extends IDecoratorModelOptions {
|
|
13
|
+
enableSelector: true;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@Model<IModelOptionsLayoutProfile>({
|
|
17
|
+
enableSelector: true,
|
|
18
|
+
})
|
|
19
|
+
export class ModelLayoutProfile extends BeanModelBase {
|
|
20
|
+
layoutKey: string;
|
|
21
|
+
|
|
22
|
+
protected async __init__(layoutKey: string) {
|
|
23
|
+
if (!layoutKey) throw new Error('layout key not specified');
|
|
24
|
+
await super.__init__(layoutKey);
|
|
25
|
+
this.layoutKey = layoutKey;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
load() {
|
|
29
|
+
if (this.$ssr.cookieDisabledOnServer || !this.$passport.isAuthenticated) return;
|
|
30
|
+
if (process.env.CLIENT && this.$ssr.profile === 'public' && this.$ssr.isRuntimeSsrPreHydration)
|
|
31
|
+
return;
|
|
32
|
+
return this.$useStateData<ApiApiLayoutprofileloadResponseBody>({
|
|
33
|
+
queryKey: ['load'],
|
|
34
|
+
queryFn: async () => {
|
|
35
|
+
return await this.scope.api.layoutprofile.load({
|
|
36
|
+
query: { layoutKey: this.layoutKey },
|
|
37
|
+
});
|
|
38
|
+
},
|
|
39
|
+
meta: {
|
|
40
|
+
disableErrorEffect: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
save() {
|
|
46
|
+
return this.$useMutationData<
|
|
47
|
+
ApiApiLayoutprofilesaveResponseBody,
|
|
48
|
+
ApiApiLayoutprofilesaveRequestBody['profile']
|
|
49
|
+
>({
|
|
50
|
+
mutationKey: ['save'],
|
|
51
|
+
mutationFn: async profile => {
|
|
52
|
+
return await this.scope.api.layoutprofile.save({
|
|
53
|
+
layoutKey: this.layoutKey,
|
|
54
|
+
profile,
|
|
55
|
+
});
|
|
56
|
+
},
|
|
57
|
+
onSuccess: profile => {
|
|
58
|
+
this.$setQueryData<ApiApiLayoutprofilesaveResponseBody>(['load'], profile);
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
reset() {
|
|
64
|
+
return this.$useMutationData<ApiApiLayoutprofileresetResponseBody>({
|
|
65
|
+
mutationKey: ['reset'],
|
|
66
|
+
mutationFn: async () => {
|
|
67
|
+
return await this.scope.api.layoutprofile.reset({
|
|
68
|
+
query: { layoutKey: this.layoutKey },
|
|
69
|
+
});
|
|
70
|
+
},
|
|
71
|
+
onSuccess: async () => {
|
|
72
|
+
this.$setQueryData<ApiApiLayoutprofileloadResponseBody>(['load'], undefined);
|
|
73
|
+
},
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
}
|