core structure updates
This commit is contained in:
parent
41dc86436c
commit
3326d061f1
|
@ -1,4 +1,4 @@
|
|||
import { structures } from ".."
|
||||
import { generator } from "./generator"
|
||||
import { newid } from "../../../../src/docIds/newid"
|
||||
|
||||
export function id() {
|
||||
|
@ -6,7 +6,7 @@ export function id() {
|
|||
}
|
||||
|
||||
export function rev() {
|
||||
return `${structures.generator.character({
|
||||
return `${generator.character({
|
||||
numeric: true,
|
||||
})}-${structures.uuid().replace(/-/, "")}`
|
||||
})}-${generator.guid().replace(/-/, "")}`
|
||||
}
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
export * from "./platform"
|
|
@ -0,0 +1 @@
|
|||
export * as installation from "./installation"
|
|
@ -1,9 +1,11 @@
|
|||
import { generator } from "@budibase/backend-core/tests"
|
||||
import { Installation } from "@budibase/types"
|
||||
import * as db from "../../db"
|
||||
|
||||
export function install(): Installation {
|
||||
return {
|
||||
_id: "install",
|
||||
_rev: db.rev(),
|
||||
installId: generator.guid(),
|
||||
version: generator.string()
|
||||
}
|
|
@ -2,7 +2,7 @@ export * from "./common"
|
|||
export * as accounts from "./accounts"
|
||||
export * as apps from "./apps"
|
||||
export * as db from "./db"
|
||||
export * as installation from "./installation"
|
||||
export * as docs from "./documents"
|
||||
export * as koa from "./koa"
|
||||
export * as licenses from "./licenses"
|
||||
export * as plugins from "./plugins"
|
||||
|
|
|
@ -2,7 +2,9 @@ import {
|
|||
Billing,
|
||||
Customer,
|
||||
Feature,
|
||||
License, OfflineLicense,
|
||||
License,
|
||||
OfflineIdentifier,
|
||||
OfflineLicense,
|
||||
PlanModel,
|
||||
PlanType,
|
||||
PriceDuration,
|
||||
|
@ -154,9 +156,16 @@ export function offlineLicense (
|
|||
return {
|
||||
...base,
|
||||
expireAt: new Date().toISOString(),
|
||||
identifier: {
|
||||
installId: generator.guid(),
|
||||
tenantId: generator.guid()
|
||||
}
|
||||
identifier: offlineIdentifier()
|
||||
}
|
||||
}
|
||||
|
||||
export function offlineIdentifier(
|
||||
installId: string = generator.guid(),
|
||||
tenantId: string = generator.guid(),
|
||||
): OfflineIdentifier {
|
||||
return {
|
||||
installId,
|
||||
tenantId
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue