cabloy 5.1.239 → 5.1.241
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/.cabloy-version +1 -1
- package/CHANGELOG.md +19 -0
- package/package.json +1 -1
- package/repo-docs/backend/openapi-guide.md +18 -0
- package/repo-docs/backend/rate-limit-guide.md +54 -9
- package/repo-e2e/specs/home-user-account.spec.ts +53 -8
- package/vona/packages-vona/vona/package.json +1 -1
- package/vona/pnpm-lock.yaml +16 -141
- package/vona/src/suite/a-commerce/modules/commerce-siteadmin/src/dto/operatorContext.ts +4 -1
- package/vona/src/suite/a-commerce/modules/commerce-siteadmin/src/service/operator.ts +1 -0
- package/vona/src/suite/a-commerce/modules/commerce-siteadmin/test/operatorAccess.test.ts +1 -0
- package/vona/src/suite/a-home/modules/home-user/src/bean/meta.version.ts +1 -0
- package/vona/src/suite/a-home/modules/home-user/src/controller/passport.ts +1 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountCurrent.ts +3 -0
- package/vona/src/suite/a-home/modules/home-user/src/dto/accountProfileUpdate.ts +9 -2
- package/vona/src/suite/a-home/modules/home-user/src/dto/passportUser.ts +3 -0
- package/vona/src/suite/a-home/modules/home-user/src/entity/user.ts +3 -0
- package/vona/src/suite/a-home/modules/home-user/src/service/account.ts +7 -3
- package/vona/src/suite/a-home/modules/home-user/src/service/userAdapter.ts +1 -0
- package/vona/src/suite/a-home/modules/home-user/test/account.test.ts +133 -8
- package/vona/src/suite/a-home/modules/home-user/test/accountOpenapi.test.ts +32 -5
- package/vona/src/suite/a-home/modules/home-user/test/passport.test.ts +159 -1
- package/vona/src/suite-vendor/a-cabloy/modules/a-rbac/package.json +1 -1
- package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-hmr/src/service/hmr.ts +5 -12
- package/vona/src/suite-vendor/a-vona/modules/a-permission/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-permission/src/bean/bean.permission.ts +54 -8
- package/vona/src/suite-vendor/a-vona/modules/a-permission/test/permission.test.ts +228 -16
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/src/.metadata/index.ts +26 -0
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/src/bean/middlewareSystem.aggregate.ts +58 -0
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/src/service/rateLimit.ts +25 -5
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/src/types/rateLimit.ts +5 -0
- package/vona/src/suite-vendor/a-vona/modules/a-ratelimit/test/aggregate.test.ts +247 -0
- package/vona/src/suite-vendor/a-vona/modules/a-user/package.json +1 -1
- package/vona/src/suite-vendor/a-vona/modules/a-user/src/types/user.ts +1 -0
- package/vona/src/suite-vendor/a-vona/package.json +1 -1
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/api/openapi/schemas.ts +68 -52
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/api/openapi/types.ts +530 -344
- package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/page/dashboard/controller.tsx +7 -1
- package/zova/src/suite/a-home/modules/home-api/src/api/openapi/types.ts +6 -1
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-home/modules/home-base/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-home/modules/home-layoutadmin/src/component/layoutAdmin/render.user.tsx +1 -1
- package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.user.tsx +3 -1
- package/zova/src/suite/a-home/modules/home-passport/src/model/passport.ts +4 -0
- package/zova/src/suite/a-home/modules/home-user/src/config/locale/en-us.ts +1 -0
- package/zova/src/suite/a-home/modules/home-user/src/config/locale/zh-cn.ts +1 -0
- package/zova/src/suite/a-home/modules/home-user/src/model/account.ts +2 -1
- package/zova/src/suite/a-home/modules/home-user/src/page/account/controller.tsx +17 -3
package/zova/src/suite/a-commerce/modules/commerce-siteadmin/src/page/dashboard/controller.tsx
CHANGED
|
@@ -19,12 +19,18 @@ export class ControllerPageDashboard extends BeanControllerPageBase {
|
|
|
19
19
|
|
|
20
20
|
protected render() {
|
|
21
21
|
const query = this.queryOperatorContext;
|
|
22
|
+
const operator = query.data!;
|
|
23
|
+
const user = this.$passport.user;
|
|
24
|
+
const displayName =
|
|
25
|
+
user && String(user.id) === String(operator.userId)
|
|
26
|
+
? this.$passport.displayName
|
|
27
|
+
: operator.displayName || operator.userName;
|
|
22
28
|
return (
|
|
23
29
|
<div class="p-6">
|
|
24
30
|
<h1 class="text-2xl font-semibold">{this.scope.locale.CommerceAdministration()}</h1>
|
|
25
31
|
<dl class="mt-4 grid max-w-xl grid-cols-[auto_1fr] gap-x-4 gap-y-2">
|
|
26
32
|
<dt>{this.scope.locale.Operator()}</dt>
|
|
27
|
-
<dd>{
|
|
33
|
+
<dd>{displayName}</dd>
|
|
28
34
|
<dt>{this.scope.locale.Instance()}</dt>
|
|
29
35
|
<dd>{query.data!.instanceName || 'default'}</dd>
|
|
30
36
|
</dl>
|
|
@@ -2596,6 +2596,7 @@ export interface components {
|
|
|
2596
2596
|
| undefined;
|
|
2597
2597
|
'home-user.dto.accountCurrent': {
|
|
2598
2598
|
name: string;
|
|
2599
|
+
displayName?: string | undefined;
|
|
2599
2600
|
avatar?: string | undefined;
|
|
2600
2601
|
locale?: unknown;
|
|
2601
2602
|
tz?: string | undefined;
|
|
@@ -2605,7 +2606,7 @@ export interface components {
|
|
|
2605
2606
|
};
|
|
2606
2607
|
'home-user.dto.accountProfileUpdate': {
|
|
2607
2608
|
/** @description Display name */
|
|
2608
|
-
|
|
2609
|
+
displayName?: string | undefined;
|
|
2609
2610
|
/**
|
|
2610
2611
|
* Avatar
|
|
2611
2612
|
* @description Absolute HTTPS avatar URL or API delivery URL
|
|
@@ -2673,6 +2674,7 @@ export interface components {
|
|
|
2673
2674
|
'home-user.dto.passportUser': {
|
|
2674
2675
|
id: number | string;
|
|
2675
2676
|
name: string;
|
|
2677
|
+
displayName?: string | undefined;
|
|
2676
2678
|
avatar?: string | undefined;
|
|
2677
2679
|
email?: string | undefined;
|
|
2678
2680
|
mobile?: string | undefined;
|
|
@@ -2783,6 +2785,7 @@ export interface components {
|
|
|
2783
2785
|
instanceName: string;
|
|
2784
2786
|
userId: string;
|
|
2785
2787
|
userName: string;
|
|
2788
|
+
displayName?: string | undefined;
|
|
2786
2789
|
};
|
|
2787
2790
|
'commerce-promotion.dto.couponMineItem': {
|
|
2788
2791
|
id: number | string;
|
|
@@ -3215,7 +3218,9 @@ export interface components {
|
|
|
3215
3218
|
shippedAt: Date;
|
|
3216
3219
|
};
|
|
3217
3220
|
'commerce-trade.dto.orderShip': {
|
|
3221
|
+
/** @description Carrier */
|
|
3218
3222
|
carrier: string;
|
|
3223
|
+
/** @description Tracking number */
|
|
3219
3224
|
trackingNumber: string;
|
|
3220
3225
|
};
|
|
3221
3226
|
'commerce-trade.dto.orderSelectRes': {
|
|
@@ -5,6 +5,7 @@ export default {
|
|
|
5
5
|
LanguageEnglish: 'English',
|
|
6
6
|
LanguageChinese: 'Chinese',
|
|
7
7
|
LanguageJapanese: 'Japanese',
|
|
8
|
+
LanguageTraditionalChinese: 'Traditional Chinese',
|
|
8
9
|
VonaIntegratedSsr: 'Vona integrated SSR',
|
|
9
10
|
ZovaStandaloneSsr: 'Zova standalone SSR',
|
|
10
11
|
SsrSite: 'SSR Site',
|
package/zova/src/suite/a-home/modules/home-layoutweb/src/component/layoutWeb/render.user.tsx
CHANGED
|
@@ -21,7 +21,9 @@ export class RenderUser extends BeanRenderBase {
|
|
|
21
21
|
) || this.$scopeBase.config.avatar.empty
|
|
22
22
|
}
|
|
23
23
|
/>
|
|
24
|
-
{this.$passport.
|
|
24
|
+
{this.$passport.isAuthenticated
|
|
25
|
+
? this.$passport.displayName
|
|
26
|
+
: this.scope.locale.NotLoggedIn()}
|
|
25
27
|
</summary>
|
|
26
28
|
<ul class="bg-base-100 rounded-t-none p-2 w-40">
|
|
27
29
|
{this.$passport.isAuthenticated ? (
|
|
@@ -187,6 +187,10 @@ export class ModelPassport extends BeanModelBase {
|
|
|
187
187
|
return this.passport?.user;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
|
+
get displayName(): string | undefined {
|
|
191
|
+
return this.user?.displayName || this.user?.name;
|
|
192
|
+
}
|
|
193
|
+
|
|
190
194
|
get roles() {
|
|
191
195
|
return this.passport?.roles;
|
|
192
196
|
}
|
|
@@ -21,8 +21,9 @@ export interface IModelOptionsAccount extends IDecoratorModelOptions {}
|
|
|
21
21
|
|
|
22
22
|
export type AccountProfileUpdateCommand = Omit<
|
|
23
23
|
ApiApiHomeUserAccountupdateProfileRequestBody,
|
|
24
|
-
'avatar' | 'locale' | 'tz'
|
|
24
|
+
'displayName' | 'avatar' | 'locale' | 'tz'
|
|
25
25
|
> & {
|
|
26
|
+
displayName?: string | null;
|
|
26
27
|
avatar?: string | null;
|
|
27
28
|
locale?: string | null;
|
|
28
29
|
tz?: string | null;
|
|
@@ -81,7 +81,11 @@ export class ControllerPageAccount extends BeanControllerPageBase {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
async submitProfile(data: TypeFormOnSubmitData<ProfileDraft>) {
|
|
84
|
-
const
|
|
84
|
+
const displayName = data.value.displayName;
|
|
85
|
+
const current = await this.$$modelAccount.updateProfile().mutateAsync({
|
|
86
|
+
...data.value,
|
|
87
|
+
displayName: displayName === undefined ? undefined : displayName?.trim() || null,
|
|
88
|
+
});
|
|
85
89
|
this._resetProfileDraft(current);
|
|
86
90
|
this.profileMessage = this.scope.locale.AccountProfileSaved();
|
|
87
91
|
}
|
|
@@ -119,7 +123,7 @@ export class ControllerPageAccount extends BeanControllerPageBase {
|
|
|
119
123
|
private _resetProfileDraft(current = this.queryCurrent?.data) {
|
|
120
124
|
if (!current) return;
|
|
121
125
|
this.profileDraft = {
|
|
122
|
-
|
|
126
|
+
displayName: current.displayName ?? '',
|
|
123
127
|
avatar: current.avatar ?? undefined,
|
|
124
128
|
locale: typeof current.locale === 'string' ? current.locale : undefined,
|
|
125
129
|
tz: current.tz ?? undefined,
|
|
@@ -254,8 +258,18 @@ export class ControllerPageAccount extends BeanControllerPageBase {
|
|
|
254
258
|
);
|
|
255
259
|
}}
|
|
256
260
|
/>
|
|
261
|
+
<label class="form-control gap-2">
|
|
262
|
+
<span class="label-text">{this.scope.locale.AccountUserName()}</span>
|
|
263
|
+
<input
|
|
264
|
+
class="input"
|
|
265
|
+
type="text"
|
|
266
|
+
readonly
|
|
267
|
+
autocomplete="username"
|
|
268
|
+
value={this.queryCurrent?.data?.name}
|
|
269
|
+
/>
|
|
270
|
+
</label>
|
|
257
271
|
<ZFormFieldPreset
|
|
258
|
-
name="
|
|
272
|
+
name="displayName"
|
|
259
273
|
render="basic-input:formFieldInput"
|
|
260
274
|
options={{ type: 'text' }}
|
|
261
275
|
/>
|