offline license sdk module

This commit is contained in:
Rory Powell 2023-07-10 12:48:52 +01:00
parent 974b7d8514
commit 6ae59d767b
5 changed files with 21 additions and 4 deletions

View File

@ -55,6 +55,18 @@ export class HTTPError extends BudibaseError {
}
}
export class NotFoundError extends HTTPError {
constructor(message: string) {
super(message, 404)
}
}
export class BadRequestError extends HTTPError {
constructor(message: string) {
super(message, 400)
}
}
// LICENSING
export class UsageLimitError extends HTTPError {

View File

@ -51,6 +51,7 @@ export interface Account extends CreateAccount {
licenseRequestedAt?: number
licenseOverrides?: LicenseOverrides
quotaUsage?: QuotaUsage
offlineLicenseToken?: string
}
export interface PasswordAccount extends Account {

View File

@ -9,6 +9,7 @@ export enum Feature {
BRANDING = "branding",
SCIM = "scim",
SYNC_AUTOMATIONS = "syncAutomations",
OFFLINE = "offline",
}
export type PlanFeatures = { [key in PlanType]: Feature[] | undefined }

View File

@ -1,14 +1,15 @@
import { PurchasedPlan, Quotas, Feature, Billing } from "."
import { ISO8601 } from "../../shared"
export interface OfflineIdentifier {
installId: string,
tenantId: string
}
// export interface OfflineLicense extends License {
// identifier?: OfflineIdentifier
// identifierBase64: string
// }
export interface OfflineLicense extends License {
identifier: OfflineIdentifier
expireAt: ISO8601
}
export interface License {
features: Feature[]

View File

@ -1,3 +1,5 @@
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P]
}
export type ISO8601 = string