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