File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed
packages/maas/frontend/src/app Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -14,22 +14,22 @@ const isMaaSSubscriptionRef = (v: unknown): v is ModelSubscriptionRef =>
1414 isRecord ( v ) &&
1515 typeof v . name === 'string' &&
1616 typeof v . namespace === 'string' &&
17- Array . isArray ( v . tokenRateLimits ) &&
18- v . tokenRateLimits . every ( isTokenRateLimit ) &&
17+ ( v . tokenRateLimits === undefined ||
18+ ( Array . isArray ( v . tokenRateLimits ) && v . tokenRateLimits . every ( isTokenRateLimit ) ) ) &&
1919 ( v . tokenRateLimitRef === undefined || typeof v . tokenRateLimitRef === 'string' ) &&
2020 ( v . billingRate === undefined || typeof v . billingRate === 'object' ) ;
2121
2222const isMaaSSubscription = ( v : unknown ) : v is MaaSSubscription =>
2323 isRecord ( v ) &&
2424 typeof v . name === 'string' &&
2525 typeof v . namespace === 'string' &&
26- typeof v . phase === 'string' &&
26+ ( v . phase === undefined || typeof v . phase === 'string' ) &&
2727 ( v . priority === undefined || typeof v . priority === 'number' ) &&
2828 typeof v . owner === 'object' &&
2929 Array . isArray ( v . modelRefs ) &&
3030 v . modelRefs . every ( isMaaSSubscriptionRef ) &&
3131 ( v . tokenMetadata === undefined || typeof v . tokenMetadata === 'object' ) &&
32- typeof v . creationTimestamp === 'string' ;
32+ ( v . creationTimestamp === undefined || typeof v . creationTimestamp === 'string' ) ;
3333const isTokenRateLimit = ( v : unknown ) : v is TokenRateLimit =>
3434 isRecord ( v ) && typeof v . limit === 'number' && typeof v . window === 'string' ;
3535
Original file line number Diff line number Diff line change 11export type MaaSSubscription = {
22 name : string ;
33 namespace : string ;
4- phase : string ;
4+ phase ? : string ;
55 priority ?: number ;
66 owner : OwnerSpec ;
77 modelRefs : ModelSubscriptionRef [ ] ;
88 tokenMetadata ?: TokenMetadata ;
9- creationTimestamp : string ;
9+ creationTimestamp ? : string ;
1010} ;
1111
1212export type ModelSubscriptionRef = {
1313 name : string ;
1414 namespace : string ;
15- tokenRateLimits : TokenRateLimit [ ] ;
15+ tokenRateLimits ? : TokenRateLimit [ ] ;
1616 tokenRateLimitRef ?: string ;
1717 billingRate ?: BillingRate ;
1818} ;
You can’t perform that action at this time.
0 commit comments