0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

chore(console): bump withtyped and @logto/cloud version (#4167)

This commit is contained in:
Xiao Yijun 2023-07-13 14:59:07 +08:00 committed by GitHub
parent f58595cd26
commit a030b0817f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 36 additions and 25 deletions

View file

@ -26,7 +26,7 @@
"@fontsource/roboto-mono": "^5.0.0",
"@jest/types": "^29.5.0",
"@logto/app-insights": "workspace:^1.3.1",
"@logto/cloud": "0.2.5-cbbfdc2",
"@logto/cloud": "0.2.5-4f1d80b",
"@logto/connector-kit": "workspace:^1.1.1",
"@logto/core-kit": "workspace:^2.0.1",
"@logto/language-kit": "workspace:^1.0.0",
@ -60,7 +60,7 @@
"@types/react-helmet": "^6.1.6",
"@types/react-modal": "^3.13.1",
"@types/react-syntax-highlighter": "^15.5.1",
"@withtyped/client": "^0.7.17",
"@withtyped/client": "^0.7.19",
"buffer": "^5.7.1",
"classnames": "^2.3.1",
"clean-deep": "^3.4.0",

View file

@ -1,12 +1,8 @@
import type router from '@logto/cloud/routes';
import { type RouterRoutes } from '@withtyped/client';
import { type z, type ZodType } from 'zod';
import { type GuardedResponse, type RouterRoutes } from '@withtyped/client';
export type GetRoutes = RouterRoutes<typeof router>['get'];
type RouteResponseType<T extends { search?: unknown; body?: unknown; response?: ZodType }> =
z.infer<NonNullable<T['response']>>;
export type SubscriptionPlanResponse = RouteResponseType<
export type SubscriptionPlanResponse = GuardedResponse<
GetRoutes['/api/subscription-plans']
>[number];

View file

@ -27,7 +27,6 @@ export const ticketSupportResponseTimeMap: Record<string, number | undefined> =
* `undefined` => Contact
*/
const enterprisePlanTable: SubscriptionPlanTable = {
tenantLimit: null,
basePrice: undefined,
mauUnitPrice: undefined,
mauLimit: undefined,
@ -58,7 +57,7 @@ export const enterprisePlanTableData: SubscriptionPlanTableData = {
};
export const planTableGroupKeyMap: SubscriptionPlanTableGroupKeyMap = Object.freeze({
[SubscriptionPlanTableGroupKey.base]: ['tenantLimit', 'basePrice', 'mauUnitPrice', 'mauLimit'],
[SubscriptionPlanTableGroupKey.base]: ['basePrice', 'mauUnitPrice', 'mauLimit'],
[SubscriptionPlanTableGroupKey.applications]: ['applicationsLimit', 'machineToMachineLimit'],
[SubscriptionPlanTableGroupKey.resources]: ['resourcesLimit', 'scopesPerResourceLimit'],
[SubscriptionPlanTableGroupKey.branding]: ['customDomainEnabled'],

View file

@ -9,7 +9,6 @@ const planQuotaKeyPhraseMap: {
'admin_console.subscription.quota_table'
>;
} = {
tenantLimit: 'quota.tenant_limit',
mauLimit: 'quota.mau_limit',
applicationsLimit: 'application.total',
machineToMachineLimit: 'application.m2m',

View file

@ -113,11 +113,9 @@ function PlanQuotaTable({ subscriptionPlans }: Props) {
// For mau unit price
if (Array.isArray(quotaValue)) {
if (quotaValue.length === 0) {
return <DynamicT forKey="subscription.quota_table.contact" />;
}
return (
return quotaValue.length === 0 ? (
'-'
) : (
<div>
{quotaValue.map((value) => (
<div key={value}>
@ -132,7 +130,7 @@ function PlanQuotaTable({ subscriptionPlans }: Props) {
}
if (typeof quotaValue === 'boolean') {
return quotaValue ? <Success /> : '- ';
return quotaValue ? <Success /> : '-';
}
// Note: handle number type

View file

@ -6,7 +6,7 @@ export const constructPlanTableDataArray = (
plans: SubscriptionPlan[]
): SubscriptionPlanTableData[] =>
plans.map((plan) => {
const { id, name, products, quota } = plan;
const { id, name, stripeProducts, quota } = plan;
return {
id,
@ -14,9 +14,9 @@ export const constructPlanTableDataArray = (
table: {
...quota,
basePrice: conditional(
products.find((product) => product.type === 'flat')?.price.unitAmountDecimal
stripeProducts.find((product) => product.type === 'flat')?.price.unitAmountDecimal
),
mauUnitPrice: products
mauUnitPrice: stripeProducts
.filter(({ type }) => type !== 'flat')
.map(({ price: { unitAmountDecimal } }) => conditionalString(unitAmountDecimal)),
},

View file

@ -2755,8 +2755,8 @@ importers:
specifier: workspace:^1.3.1
version: link:../app-insights
'@logto/cloud':
specifier: 0.2.5-cbbfdc2
version: 0.2.5-cbbfdc2(zod@3.20.2)
specifier: 0.2.5-4f1d80b
version: 0.2.5-4f1d80b(zod@3.20.2)
'@logto/connector-kit':
specifier: workspace:^1.1.1
version: link:../toolkit/connector-kit
@ -2857,8 +2857,8 @@ importers:
specifier: ^15.5.1
version: 15.5.1
'@withtyped/client':
specifier: ^0.7.17
version: 0.7.17(zod@3.20.2)
specifier: ^0.7.19
version: 0.7.19(zod@3.20.2)
buffer:
specifier: ^5.7.1
version: 5.7.1
@ -7185,6 +7185,16 @@ packages:
jose: 4.14.4
dev: true
/@logto/cloud@0.2.5-4f1d80b(zod@3.20.2):
resolution: {integrity: sha512-AF0YnJiXDMS3HQ2ugZcwJRBkspvNtlXk992IwTNFZxbZdinpPoVmPnDnHuekACcQY5bFRgHjMB2/o/GKkdLpWg==}
engines: {node: ^18.12.0}
dependencies:
'@silverhand/essentials': 2.7.0
'@withtyped/server': 0.12.7(zod@3.20.2)
transitivePeerDependencies:
- zod
dev: true
/@logto/cloud@0.2.5-cbbfdc2(zod@3.20.2):
resolution: {integrity: sha512-qul8lxkbAczEHJSyramQJW3BaNAdJQHlryIzTAHpcWpNGZogP3aacJuF0neBnnn8mJqAWy1rIGAGnb4d16fEFQ==}
engines: {node: ^18.12.0}
@ -9816,6 +9826,16 @@ packages:
'@withtyped/shared': 0.2.2
transitivePeerDependencies:
- zod
dev: false
/@withtyped/client@0.7.19(zod@3.20.2):
resolution: {integrity: sha512-cHmqCIsEMonrE9kDbu8YAPWWPHmy6imUGbUWQ2PGaPLTJagbgH3ABsxgnLiM0lm0LeuZFd3BHh+JYKRDUmS8cw==}
dependencies:
'@withtyped/server': 0.12.7(zod@3.20.2)
'@withtyped/shared': 0.2.2
transitivePeerDependencies:
- zod
dev: true
/@withtyped/server@0.12.5(zod@3.20.2):
resolution: {integrity: sha512-mKDPGCJzh0xna4Vi2zVsHg/ZfMNQHDV3+jvsral2PJdRzI8qU7au7I/ytU6Vr6BU1fFESkNrIuUpCmyfBAwX7g==}
@ -9834,7 +9854,6 @@ packages:
'@silverhand/essentials': 2.7.0
'@withtyped/shared': 0.2.2
zod: 3.20.2
dev: false
/@withtyped/shared@0.2.2:
resolution: {integrity: sha512-Vpcj12NqaoZ8M5Z/1kffheI9FBZEm9goed0THmgTcMKXLHjXSRbMZMp0olVxovEgaTIAydshqJOQUXKZMctIZw==}