@hexclave/react 1.0.45 → 1.0.46
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/dist/{admin-app-impl-DKtMoehJ.d.ts → admin-app-impl-DZckHJ1C.d.ts} +8 -7
- package/dist/{admin-app-impl-DKtMoehJ.d.ts.map → admin-app-impl-DZckHJ1C.d.ts.map} +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js +8 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts.map +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js +5 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js +7 -0
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/common.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.d.ts +1 -1
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js +5 -0
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -1
- package/package.json +3 -3
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +15 -1
- package/src/lib/hexclave-app/apps/implementations/server-app-impl.ts +10 -0
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"//": "THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template (FOR package.json FILES, PLEASE EDIT package-template.json)",
|
|
3
3
|
"name": "@hexclave/react",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.46",
|
|
5
5
|
"repository": "https://github.com/hexclave/hexclave",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"tailwindcss-animate": "^1.0.7",
|
|
75
75
|
"rrweb": "^1.1.3",
|
|
76
76
|
"yup": "^1.7.1",
|
|
77
|
-
"@hexclave/shared": "1.0.
|
|
78
|
-
"@hexclave/ui": "1.0.
|
|
77
|
+
"@hexclave/shared": "1.0.46",
|
|
78
|
+
"@hexclave/ui": "1.0.46"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@types/react": ">=18.0.0",
|
|
@@ -13,7 +13,7 @@ import type { AdminGetSessionReplayChunkEventsResponse } from "@hexclave/shared/
|
|
|
13
13
|
import type { Transaction, TransactionType } from "@hexclave/shared/dist/interface/crud/transactions";
|
|
14
14
|
import type { RestrictedReason } from "@hexclave/shared/dist/schema-fields";
|
|
15
15
|
import type { MoneyAmount } from "@hexclave/shared/dist/utils/currency-constants";
|
|
16
|
-
import { HexclaveAssertionError, throwErr } from "@hexclave/shared/dist/utils/errors";
|
|
16
|
+
import { HexclaveAssertionError, captureError, throwErr } from "@hexclave/shared/dist/utils/errors";
|
|
17
17
|
import type { Json } from "@hexclave/shared/dist/utils/json";
|
|
18
18
|
import { pick, typedEntries, typedValues } from "@hexclave/shared/dist/utils/objects";
|
|
19
19
|
import { Result } from "@hexclave/shared/dist/utils/results";
|
|
@@ -883,6 +883,20 @@ export class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, Proj
|
|
|
883
883
|
allow_negative: true,
|
|
884
884
|
}
|
|
885
885
|
);
|
|
886
|
+
const [customerType, customerId] = "userId" in options
|
|
887
|
+
? ["user", options.userId] as const
|
|
888
|
+
: "teamId" in options
|
|
889
|
+
? ["team", options.teamId] as const
|
|
890
|
+
: ["custom", options.customCustomerId] as const;
|
|
891
|
+
try {
|
|
892
|
+
// Best-effort: the quantity change is already persisted at this point, so
|
|
893
|
+
// a cache refresh failure must not make the mutation look failed (a retry
|
|
894
|
+
// would apply the delta twice).
|
|
895
|
+
await this._refreshItemCache(customerType, customerId, options.itemId);
|
|
896
|
+
await this._transactionsCache.invalidateWhere(() => true);
|
|
897
|
+
} catch (error) {
|
|
898
|
+
captureError("create-item-quantity-change-cache-refresh", error);
|
|
899
|
+
}
|
|
886
900
|
}
|
|
887
901
|
|
|
888
902
|
async refundTransaction(options: {
|
|
@@ -1396,6 +1396,16 @@ export class _HexclaveServerAppImplIncomplete<HasTokenStore extends boolean, Pro
|
|
|
1396
1396
|
}
|
|
1397
1397
|
}
|
|
1398
1398
|
|
|
1399
|
+
protected async _refreshItemCache(customerType: "user" | "team" | "custom", customerId: string, itemId: string): Promise<void> {
|
|
1400
|
+
if (customerType === "user") {
|
|
1401
|
+
await this._serverUserItemsCache.refresh([customerId, itemId]);
|
|
1402
|
+
} else if (customerType === "team") {
|
|
1403
|
+
await this._serverTeamItemsCache.refresh([customerId, itemId]);
|
|
1404
|
+
} else {
|
|
1405
|
+
await this._serverCustomItemsCache.refresh([customerId, itemId]);
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1399
1409
|
async listProducts(options: CustomerProductsRequestOptions): Promise<CustomerProductsList> {
|
|
1400
1410
|
if ("userId" in options) {
|
|
1401
1411
|
const response = Result.orThrow(await this._serverUserProductsCache.getOrWait([options.userId, options.cursor ?? null, options.limit ?? null], "write-only"));
|