cabloy 5.1.141 → 5.1.142

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 (92) hide show
  1. package/.cabloy-version +1 -1
  2. package/.github/workflows/playwright-e2e.yml +2 -2
  3. package/CHANGELOG.md +21 -0
  4. package/cabloy-docs/frontend/form-guide.md +47 -0
  5. package/cabloy-docs/frontend/markdown-guide.md +50 -17
  6. package/cabloy-docs/frontend/route-alias-guide.md +20 -0
  7. package/cabloy-docs/frontend/scripts.md +9 -11
  8. package/cabloy-docs/frontend/zova-form-under-the-hood.md +25 -0
  9. package/cabloy-docs/fullstack/parallel-worktree-environment.md +1 -1
  10. package/cabloy-docs/fullstack/quickstart.md +5 -4
  11. package/cabloy-docs/reference/repo-scripts.md +29 -42
  12. package/e2e/config/playwright.config.ts +34 -0
  13. package/e2e/scripts/e2e.ts +2 -27
  14. package/e2e/scripts/runE2e.ts +62 -0
  15. package/e2e/scripts/runE2eArgs.test.ts +75 -0
  16. package/e2e/scripts/runE2eArgs.ts +158 -0
  17. package/e2e/specs/{a-commerce/commerce.spec.ts → a-commerce.spec.ts} +361 -30
  18. package/e2e/specs/{cabloy-basic/account.spec.ts → account.spec.ts} +1 -2
  19. package/oxlint.config.ts +3 -0
  20. package/package.json +3 -9
  21. package/scripts/upgrade.ts +63 -68
  22. package/vona/packages-utils/lint/package.json +1 -1
  23. package/vona/packages-utils/lint/src/oxc/lint.ts +1 -1
  24. package/vona/packages-utils/lint/src/oxc/lintVue.ts +1 -1
  25. package/vona/pnpm-lock.yaml +41 -41
  26. package/vona/src/suite/a-commerce/modules/commerce-trade/src/dto/refundRecoveryView.tsx +7 -2
  27. package/vona/src/suite/a-commerce/modules/commerce-trade/src/service/order.ts +31 -15
  28. package/vona/src/suite/a-home/modules/home-user/package.json +1 -0
  29. package/vona/src/suite/a-home/modules/home-user/src/service/account.ts +15 -2
  30. package/vona/src/suite/a-home/modules/home-user/test/accountActivation.test.ts +34 -4
  31. package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/package.json +2 -1
  32. package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/.metadata/index.ts +26 -0
  33. package/vona/src/suite-vendor/a-cabloy/modules/a-markdown/src/bean/imageScene.markdown.ts +13 -0
  34. package/vona/src/suite-vendor/a-cabloy/package.json +2 -2
  35. package/vona/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
  36. package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/providerOperation.ts +23 -0
  37. package/vona/src/suite-vendor/a-pay/modules/a-pay/src/service/refundOperation.ts +7 -0
  38. package/vona/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
  39. package/vona/src/suite-vendor/a-pay/modules/pay-paypal/package.json +1 -1
  40. package/vona/src/suite-vendor/a-pay/modules/pay-stripe/package.json +1 -1
  41. package/vona/src/suite-vendor/a-pay/package.json +5 -5
  42. package/zova/packages-utils/zova-jsx/package.json +2 -2
  43. package/zova/packages-zova/zova/package.json +3 -3
  44. package/zova/packages-zova/zova-core/package.json +1 -1
  45. package/zova/packages-zova/zova-core/src/bean/resource/locale/type.ts +1 -0
  46. package/zova/pnpm-lock.yaml +63 -18
  47. package/zova/src/front/config/config/config.cabloyBasicWeb.ts +3 -1
  48. package/zova/src/front/config/config/config.cabloyCommerce.ts +4 -2
  49. package/zova/src/suite/a-commerce/modules/commerce-member/src/page/address/controller.tsx +64 -63
  50. package/zova/src/suite/a-commerce/modules/commerce-trade/src/api/openapi/types.ts +6 -1
  51. package/zova/src/suite/a-commerce/modules/commerce-trade/src/component/tableCellActionRefund/controller.tsx +413 -134
  52. package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/en-us.ts +76 -0
  53. package/zova/src/suite/a-commerce/modules/commerce-trade/src/config/locale/zh-cn.ts +67 -0
  54. package/zova/src/suite/a-commerce/modules/commerce-trade/src/model/order.ts +1 -0
  55. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/cart/controller.tsx +1 -1
  56. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/checkout/controller.tsx +7 -7
  57. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/order/controller.tsx +46 -9
  58. package/zova/src/suite/a-commerce/modules/commerce-trade/src/page/payment/controller.tsx +50 -30
  59. package/zova/src/suite/cabloy-basic/modules/basic-captcha/src/component/formFieldCaptcha/controller.tsx +6 -2
  60. package/zova/src/suite/cabloy-basic/modules/basic-image/src/component/formFieldImage/controller.tsx +9 -15
  61. package/zova/src/suite/cabloy-basic/modules/basic-markdown/package.json +10 -2
  62. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/index.ts +11 -2
  63. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/.metadata/locales.ts +7 -0
  64. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/controller.tsx +723 -5
  65. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/component/formFieldMarkdown/render.tsx +461 -2
  66. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/config/locale/en-us.ts +59 -0
  67. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/config/locale/zh-cn.ts +59 -0
  68. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/index.ts +1 -0
  69. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/lib/codeBlockLanguages.ts +42 -0
  70. package/zova/src/suite/cabloy-basic/modules/basic-markdown/src/lib/richTextContentStyle.ts +20 -0
  71. package/zova/src/suite/cabloy-basic/modules/basic-markdown/test/lib/codeBlockLanguages.test.ts +25 -0
  72. package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/package.json +1 -1
  73. package/zova/src/suite-vendor/a-cabloy/modules/rest-resource/src/model/resource.ts +1 -0
  74. package/zova/src/suite-vendor/a-cabloy/package.json +2 -2
  75. package/zova/src/suite-vendor/a-pay/modules/a-pay/package.json +1 -1
  76. package/zova/src/suite-vendor/a-pay/modules/a-pay/src/component/paymentNextAction/controller.tsx +26 -12
  77. package/zova/src/suite-vendor/a-pay/modules/pay-mock/cli/openapi.config.ts +1 -1
  78. package/zova/src/suite-vendor/a-pay/modules/pay-mock/package.json +1 -1
  79. package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/api/payMockMockPayment.ts +26 -0
  80. package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/apiSchema/payMockMockPayment.ts +8 -1
  81. package/zova/src/suite-vendor/a-pay/modules/pay-mock/src/model/payMockPayment.ts +13 -1
  82. package/zova/src/suite-vendor/a-pay/package.json +3 -3
  83. package/zova/src/suite-vendor/a-zova/modules/a-form/package.json +1 -1
  84. package/zova/src/suite-vendor/a-zova/modules/a-form/src/component/formField/controller.tsx +2 -0
  85. package/zova/src/suite-vendor/a-zova/modules/a-form/src/types/formField.ts +7 -6
  86. package/zova/src/suite-vendor/a-zova/modules/a-zova/package.json +2 -2
  87. package/zova/src/suite-vendor/a-zova/package.json +3 -3
  88. package/e2e/config/playwright.basic.config.ts +0 -3
  89. package/e2e/config/playwright.commerce.config.ts +0 -3
  90. package/e2e/config/playwright.shared.config.ts +0 -38
  91. package/e2e/scripts/testE2eClean.ts +0 -56
  92. /package/e2e/specs/{cabloy-basic/basic.spec.ts → cabloy-basic.spec.ts} +0 -0
@@ -1,8 +1,11 @@
1
+ import type { SchemaObject } from 'openapi3-ts/oas31';
1
2
  import type { TableIdentity } from 'table-identity';
3
+ import type { TypeFormOnSubmitData } from 'zova-module-a-form';
2
4
 
3
5
  import { z } from 'zod';
4
6
  import { BeanControllerPageBase, Use } from 'zova';
5
7
  import { Controller } from 'zova-module-a-bean';
8
+ import { ZForm } from 'zova-module-a-form';
6
9
  import { $QueryEnsureLoaded } from 'zova-module-a-model';
7
10
  import { ZPage } from 'zova-module-home-base';
8
11
 
@@ -37,9 +40,27 @@ export class ControllerPageAddress extends BeanControllerPageBase {
37
40
 
38
41
  editingId?: TableIdentity;
39
42
  draft: AddressDraft = emptyDraft();
43
+ schemaAddress?: SchemaObject;
44
+
45
+ get apiSchemasAddressCreate() {
46
+ return this.scope.apiSchema.commerceMemberAddress.createMine();
47
+ }
48
+
49
+ get apiSchemasAddressUpdate() {
50
+ return this.scope.apiSchema.commerceMemberAddress.updateMine();
51
+ }
40
52
 
41
53
  protected async __init__() {
42
- await $QueryEnsureLoaded(() => this.queryAddresses);
54
+ await Promise.all([
55
+ $QueryEnsureLoaded(() => this.queryAddresses),
56
+ $QueryEnsureLoaded(() => this.apiSchemasAddressCreate.sdk),
57
+ $QueryEnsureLoaded(() => this.apiSchemasAddressUpdate.sdk),
58
+ ]);
59
+ this.schemaAddress = this.$computed(() => {
60
+ return this.editingId === undefined
61
+ ? this.apiSchemasAddressCreate.requestBody
62
+ : this.apiSchemasAddressUpdate.requestBody;
63
+ });
43
64
  }
44
65
 
45
66
  get queryAddresses() {
@@ -65,13 +86,13 @@ export class ControllerPageAddress extends BeanControllerPageBase {
65
86
  this.draft = emptyDraft();
66
87
  }
67
88
 
68
- async submit() {
89
+ async submit(data: TypeFormOnSubmitData<AddressDraft>) {
69
90
  if (this.editingId === undefined) {
70
- await this.$$modelAddressMine.createMine().mutateAsync(this.draft);
91
+ await this.$$modelAddressMine.createMine().mutateAsync(data.value);
71
92
  } else {
72
93
  await this.$$modelAddressMine.updateMine().mutateAsync({
73
94
  id: this.editingId,
74
- body: this.draft,
95
+ body: data.value,
75
96
  });
76
97
  }
77
98
  this.resetDraft();
@@ -124,68 +145,48 @@ export class ControllerPageAddress extends BeanControllerPageBase {
124
145
  </article>
125
146
  ))}
126
147
  </div>
127
- <form
128
- class="card bg-base-100 border border-base-300 shadow-sm"
129
- onSubmit={event => event.preventDefault()}
130
- >
148
+ <div class="card bg-base-100 border border-base-300 shadow-sm">
131
149
  <div class="card-body gap-3">
132
- <h2 class="card-title">
133
- {this.editingId === undefined
134
- ? this.scope.locale.AddAddress()
135
- : this.scope.locale.EditAddress()}
136
- </h2>
137
- <input
138
- class="input input-bordered"
139
- placeholder={this.scope.locale.RecipientName()}
140
- v-model={this.draft.recipientName}
141
- />
142
- <input
143
- class="input input-bordered"
144
- placeholder={this.scope.locale.Phone()}
145
- v-model={this.draft.phone}
146
- />
147
- <input
148
- class="input input-bordered"
149
- placeholder={this.scope.locale.CountryCode()}
150
- v-model={this.draft.countryCode}
151
- />
152
- <input
153
- class="input input-bordered"
154
- placeholder={this.scope.locale.Region()}
155
- v-model={this.draft.region}
156
- />
157
- <input
158
- class="input input-bordered"
159
- placeholder={this.scope.locale.City()}
160
- v-model={this.draft.city}
161
- />
162
- <input
163
- class="input input-bordered"
164
- placeholder={this.scope.locale.PostalCode()}
165
- v-model={this.draft.postalCode}
166
- />
167
- <input
168
- class="input input-bordered"
169
- placeholder={this.scope.locale.AddressLine1()}
170
- v-model={this.draft.addressLine1}
171
- />
172
- <input
173
- class="input input-bordered"
174
- placeholder={this.scope.locale.AddressLine2()}
175
- v-model={this.draft.addressLine2}
176
- />
177
- <div class="flex gap-2">
178
- <button class="btn btn-primary" type="submit" onClick={() => this.submit()}>
179
- {this.scope.locale.SaveAddress()}
180
- </button>
181
- {this.editingId !== undefined && (
182
- <button class="btn btn-outline" type="button" onClick={() => this.resetDraft()}>
183
- {this.scope.locale.CancelAddressEdit()}
184
- </button>
150
+ <ZForm
151
+ data={this.draft}
152
+ schema={this.schemaAddress}
153
+ onSubmitData={data => this.submit(data)}
154
+ onShowError={async ({ error }) => {
155
+ await this.$performCommand('basic-commands:alert', {
156
+ type: 'error',
157
+ text: error.message,
158
+ });
159
+ }}
160
+ slotHeader={() => (
161
+ <h2 class="card-title">
162
+ {this.editingId === undefined
163
+ ? this.scope.locale.AddAddress()
164
+ : this.scope.locale.EditAddress()}
165
+ </h2>
166
+ )}
167
+ slotFooter={$$form => (
168
+ <div class="flex gap-2">
169
+ <button
170
+ class="btn btn-primary"
171
+ disabled={$$form.formState.isSubmitting}
172
+ type="submit"
173
+ >
174
+ {this.scope.locale.SaveAddress()}
175
+ </button>
176
+ {this.editingId !== undefined && (
177
+ <button
178
+ class="btn btn-outline"
179
+ type="button"
180
+ onClick={() => this.resetDraft()}
181
+ >
182
+ {this.scope.locale.CancelAddressEdit()}
183
+ </button>
184
+ )}
185
+ </div>
185
186
  )}
186
- </div>
187
+ ></ZForm>
187
188
  </div>
188
- </form>
189
+ </div>
189
190
  </div>
190
191
  {query?.error && (
191
192
  <div role="alert" class="alert alert-error mt-6">
@@ -3133,7 +3133,12 @@ export interface components {
3133
3133
  /** Format: date-time */
3134
3134
  finalizedAt?: Date;
3135
3135
  /** @enum {string} */
3136
- recoveryDisposition: 'none' | 'reconcile_only' | 'query_only' | 'retry_same_key';
3136
+ recoveryDisposition:
3137
+ | 'none'
3138
+ | 'await_webhook'
3139
+ | 'reconcile_only'
3140
+ | 'query_only'
3141
+ | 'retry_same_key';
3137
3142
  recoveryMessage: string;
3138
3143
  };
3139
3144
  'commerce-trade.dto.refundRecoveryAction': {