complete refactor and total type safety of test suite - making use of OpenAPI types throughout
This commit is contained in:
parent
10387a3061
commit
3c0b9344d8
|
@ -45,8 +45,8 @@
|
||||||
"lint:eslint": "eslint packages",
|
"lint:eslint": "eslint packages",
|
||||||
"lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\"",
|
"lint:prettier": "prettier --check \"packages/**/*.{js,ts,svelte}\"",
|
||||||
"lint": "yarn run lint:eslint && yarn run lint:prettier",
|
"lint": "yarn run lint:eslint && yarn run lint:prettier",
|
||||||
"lint:fix:eslint": "eslint --fix packages",
|
"lint:fix:eslint": "eslint --fix packages qa-core",
|
||||||
"lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\"",
|
"lint:fix:prettier": "prettier --write \"packages/**/*.{js,ts,svelte}\" && prettier --write \"examples/**/*.{js,ts,svelte}\" && prettier --write \"qa-core/**/*.{js,ts,svelte}\"",
|
||||||
"lint:fix": "yarn run lint:fix:prettier && yarn run lint:fix:eslint",
|
"lint:fix": "yarn run lint:fix:prettier && yarn run lint:fix:eslint",
|
||||||
"test:e2e": "lerna run cy:test --stream",
|
"test:e2e": "lerna run cy:test --stream",
|
||||||
"test:e2e:ci": "lerna run cy:ci --stream",
|
"test:e2e:ci": "lerna run cy:ci --stream",
|
||||||
|
|
|
@ -4,10 +4,18 @@ export type Query = components["schemas"]["query"]
|
||||||
export type ExecuteQuery = components["schemas"]["executeQueryOutput"]
|
export type ExecuteQuery = components["schemas"]["executeQueryOutput"]
|
||||||
|
|
||||||
export type Application = components["schemas"]["applicationOutput"]["data"]
|
export type Application = components["schemas"]["applicationOutput"]["data"]
|
||||||
|
export type CreateApplicationParams = components["schemas"]["application"]
|
||||||
|
|
||||||
export type Table = components["schemas"]["tableOutput"]["data"]
|
export type Table = components["schemas"]["tableOutput"]["data"]
|
||||||
|
export type CreateTableParams = components["schemas"]["table"]
|
||||||
|
|
||||||
export type Row = components["schemas"]["rowOutput"]["data"]
|
export type Row = components["schemas"]["rowOutput"]["data"]
|
||||||
export type RowSearch = components["schemas"]["searchOutput"]
|
export type RowSearch = components["schemas"]["searchOutput"]
|
||||||
|
export type CreateRowParams = components["schemas"]["row"]
|
||||||
|
|
||||||
export type User = components["schemas"]["userOutput"]["data"]
|
export type User = components["schemas"]["userOutput"]["data"]
|
||||||
|
export type CreateUserParams = components["schemas"]["user"]
|
||||||
|
|
||||||
|
export type SearchInputParams =
|
||||||
|
| components["schemas"]["nameSearch"]
|
||||||
|
| components["schemas"]["querySearch"]
|
||||||
|
|
|
@ -23,6 +23,7 @@ describe("/users", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("fetch", () => {
|
describe("fetch", () => {
|
||||||
|
|
||||||
it("returns a list of users from an instance db", async () => {
|
it("returns a list of users from an instance db", async () => {
|
||||||
await config.createUser("uuidx")
|
await config.createUser("uuidx")
|
||||||
await config.createUser("uuidy")
|
await config.createUser("uuidy")
|
||||||
|
|
|
@ -21,8 +21,6 @@
|
||||||
"preset": "ts-jest",
|
"preset": "ts-jest",
|
||||||
"testEnvironment": "node",
|
"testEnvironment": "node",
|
||||||
"moduleNameMapper": {
|
"moduleNameMapper": {
|
||||||
"@budibase/backend-core/(.*)": "<rootDir>/../packages/backend-core/$1",
|
|
||||||
"@budibase/backend-core": "<rootDir>/../packages/backend-core/src",
|
|
||||||
"@budibase/types": "<rootDir>/../packages/types/src"
|
"@budibase/types": "<rootDir>/../packages/types/src"
|
||||||
},
|
},
|
||||||
"setupFiles": [
|
"setupFiles": [
|
||||||
|
@ -33,18 +31,18 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@budibase/types": "^1.3.4",
|
"@budibase/types": "1.3.4",
|
||||||
"@types/jest": "^29.0.0",
|
"@types/jest": "29.0.0",
|
||||||
"@types/node-fetch": "^2.6.2",
|
"@types/node-fetch": "2.6.2",
|
||||||
"chance": "^1.1.8",
|
"chance": "1.1.8",
|
||||||
"jest": "^28.0.2",
|
"jest": "28.0.2",
|
||||||
"prettier": "^2.7.1",
|
"prettier": "2.7.1",
|
||||||
"start-server-and-test": "^1.14.0",
|
"start-server-and-test": "1.14.0",
|
||||||
"timekeeper": "^2.2.0",
|
"timekeeper": "2.2.0",
|
||||||
"ts-jest": "28.0.8",
|
"ts-jest": "28.0.8",
|
||||||
"ts-node": "^10.9.1",
|
"ts-node": "10.9.1",
|
||||||
"tsconfig-paths": "^4.1.0",
|
"tsconfig-paths": "4.1.0",
|
||||||
"typescript": "^4.8.2"
|
"typescript": "4.7.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"node-fetch": "2"
|
"node-fetch": "2"
|
||||||
|
|
|
@ -1,12 +1,14 @@
|
||||||
const env = require("../src/environment")
|
const env = require("../src/environment")
|
||||||
|
|
||||||
env._set("BUDIBASE_SERVER_URL", "http://localhost:4100")
|
env._set("BUDIBASE_SERVER_URL", "http://localhost:4100")
|
||||||
env._set("BUDIBASE_PUBLIC_API_KEY", "a65722f06bee5caeadc5d7ca2f543a43-d610e627344210c643bb726f")
|
env._set(
|
||||||
|
"BUDIBASE_PUBLIC_API_KEY",
|
||||||
|
"a65722f06bee5caeadc5d7ca2f543a43-d610e627344210c643bb726f"
|
||||||
|
)
|
||||||
|
|
||||||
// mock all dates to 2020-01-01T00:00:00.000Z
|
// mock all dates to 2020-01-01T00:00:00.000Z
|
||||||
// use tk.reset() to use real dates in individual tests
|
// use tk.reset() to use real dates in individual tests
|
||||||
const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
|
const MOCK_DATE = new Date("2020-01-01T00:00:00.000Z")
|
||||||
const MOCK_DATE_TIMESTAMP = 1577836800000
|
|
||||||
const tk = require("timekeeper")
|
const tk = require("timekeeper")
|
||||||
tk.freeze(MOCK_DATE)
|
tk.freeze(MOCK_DATE)
|
||||||
|
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
import env from "../../environment"
|
import env from "../../../environment"
|
||||||
import fetch from "node-fetch"
|
import fetch, { HeadersInit } from "node-fetch"
|
||||||
|
|
||||||
interface HeaderOptions {
|
|
||||||
headers?: object;
|
|
||||||
body?: object;
|
|
||||||
json?: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
type APIMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
|
type APIMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
|
||||||
|
|
||||||
|
interface ApiOptions {
|
||||||
|
method?: APIMethod
|
||||||
|
body?: object
|
||||||
|
headers?: HeadersInit | undefined
|
||||||
|
}
|
||||||
|
|
||||||
class PublicAPIClient {
|
class PublicAPIClient {
|
||||||
host: string
|
host: string
|
||||||
apiKey: string
|
apiKey: string
|
||||||
|
@ -16,7 +16,9 @@ class PublicAPIClient {
|
||||||
|
|
||||||
constructor(appId?: string) {
|
constructor(appId?: string) {
|
||||||
if (!env.BUDIBASE_PUBLIC_API_KEY || !env.BUDIBASE_SERVER_URL) {
|
if (!env.BUDIBASE_PUBLIC_API_KEY || !env.BUDIBASE_SERVER_URL) {
|
||||||
throw new Error("Must set BUDIBASE_PUBLIC_API_KEY and BUDIBASE_SERVER_URL env vars")
|
throw new Error(
|
||||||
|
"Must set BUDIBASE_PUBLIC_API_KEY and BUDIBASE_SERVER_URL env vars"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
this.host = `${env.BUDIBASE_SERVER_URL}/api/public/v1`
|
this.host = `${env.BUDIBASE_SERVER_URL}/api/public/v1`
|
||||||
this.apiKey = env.BUDIBASE_PUBLIC_API_KEY
|
this.apiKey = env.BUDIBASE_PUBLIC_API_KEY
|
||||||
|
@ -25,9 +27,9 @@ class PublicAPIClient {
|
||||||
|
|
||||||
apiCall =
|
apiCall =
|
||||||
(method: APIMethod) =>
|
(method: APIMethod) =>
|
||||||
async (url = "", options: HeaderOptions = {}) => {
|
async (url = "", options: ApiOptions = {}) => {
|
||||||
const requestOptions = {
|
const requestOptions = {
|
||||||
method: method,
|
method,
|
||||||
body: JSON.stringify(options.body),
|
body: JSON.stringify(options.body),
|
||||||
headers: {
|
headers: {
|
||||||
"x-budibase-api-key": this.apiKey,
|
"x-budibase-api-key": this.apiKey,
|
||||||
|
@ -55,4 +57,4 @@ class PublicAPIClient {
|
||||||
put = this.apiCall("PUT")
|
put = this.apiCall("PUT")
|
||||||
}
|
}
|
||||||
|
|
||||||
export default PublicAPIClient
|
export default PublicAPIClient
|
|
@ -0,0 +1,49 @@
|
||||||
|
import PublicAPIClient from "./PublicAPIClient"
|
||||||
|
import {
|
||||||
|
Application,
|
||||||
|
SearchInputParams,
|
||||||
|
CreateApplicationParams,
|
||||||
|
} from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import { Response } from "node-fetch"
|
||||||
|
import generateApp from "../fixtures/applications"
|
||||||
|
|
||||||
|
export default class AppApi {
|
||||||
|
api: PublicAPIClient
|
||||||
|
|
||||||
|
constructor(apiClient: PublicAPIClient) {
|
||||||
|
this.api = apiClient
|
||||||
|
}
|
||||||
|
|
||||||
|
async seed(): Promise<[Response, Application]> {
|
||||||
|
return this.create(generateApp())
|
||||||
|
}
|
||||||
|
|
||||||
|
async create(
|
||||||
|
body: CreateApplicationParams
|
||||||
|
): Promise<[Response, Application]> {
|
||||||
|
const response = await this.api.post(`/applications`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async read(id: string): Promise<[Response, Application]> {
|
||||||
|
const response = await this.api.get(`/applications/${id}`)
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async search(body: SearchInputParams): Promise<[Response, Application]> {
|
||||||
|
const response = await this.api.post(`/applications/search`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(
|
||||||
|
id: string,
|
||||||
|
body: Application
|
||||||
|
): Promise<[Response, Application]> {
|
||||||
|
const response = await this.api.put(`/applications/${id}`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
const Chance = require("chance")
|
const Chance = require("chance")
|
||||||
|
|
||||||
export default new Chance()
|
export default new Chance()
|
|
@ -0,0 +1,27 @@
|
||||||
|
import PublicAPIClient from "./PublicAPIClient"
|
||||||
|
import ApplicationApi from "./applications"
|
||||||
|
import TableApi from "./tables"
|
||||||
|
import UserApi from "./users"
|
||||||
|
import RowApi from "./rows"
|
||||||
|
|
||||||
|
export default class TestConfiguration<T> {
|
||||||
|
applications: ApplicationApi
|
||||||
|
users: UserApi
|
||||||
|
tables: TableApi
|
||||||
|
rows: RowApi
|
||||||
|
context: T
|
||||||
|
|
||||||
|
constructor(apiClient: PublicAPIClient) {
|
||||||
|
this.applications = new ApplicationApi(apiClient)
|
||||||
|
this.users = new UserApi(apiClient)
|
||||||
|
this.tables = new TableApi(apiClient)
|
||||||
|
this.rows = new RowApi(apiClient)
|
||||||
|
this.context = <T>{}
|
||||||
|
}
|
||||||
|
|
||||||
|
async beforeAll() {}
|
||||||
|
|
||||||
|
async afterAll() {
|
||||||
|
this.context = <T>{}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
import PublicAPIClient from "./PublicAPIClient"
|
||||||
|
import {
|
||||||
|
CreateRowParams,
|
||||||
|
Row,
|
||||||
|
SearchInputParams,
|
||||||
|
} from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import { HeadersInit, Response } from "node-fetch"
|
||||||
|
|
||||||
|
export default class RowApi {
|
||||||
|
api: PublicAPIClient
|
||||||
|
headers?: HeadersInit
|
||||||
|
tableId?: string
|
||||||
|
|
||||||
|
constructor(apiClient: PublicAPIClient) {
|
||||||
|
this.api = apiClient
|
||||||
|
}
|
||||||
|
|
||||||
|
set appId(appId: string) {
|
||||||
|
this.headers = {
|
||||||
|
"x-budibase-app-id": appId,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async create(body: CreateRowParams): Promise<[Response, Row]> {
|
||||||
|
const response = await this.api.post(`/tables/${this.tableId}/rows`, {
|
||||||
|
body,
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async read(id: string): Promise<[Response, Row]> {
|
||||||
|
const response = await this.api.get(`/tables/${this.tableId}/rows/${id}`, {
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async search(body: SearchInputParams): Promise<[Response, Row]> {
|
||||||
|
const response = await this.api.post(
|
||||||
|
`/tables/${this.tableId}/rows/search`,
|
||||||
|
{ body, headers: this.headers }
|
||||||
|
)
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(id: string, body: Row): Promise<[Response, Row]> {
|
||||||
|
const response = await this.api.put(`/tables/${this.tableId}/rows/${id}`, {
|
||||||
|
body,
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,62 @@
|
||||||
|
import PublicAPIClient from "./PublicAPIClient"
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
SearchInputParams,
|
||||||
|
CreateTableParams,
|
||||||
|
} from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import { HeadersInit, Response } from "node-fetch"
|
||||||
|
import { generateTable } from "../fixtures/tables"
|
||||||
|
|
||||||
|
export default class TableApi {
|
||||||
|
api: PublicAPIClient
|
||||||
|
headers?: HeadersInit
|
||||||
|
|
||||||
|
constructor(apiClient: PublicAPIClient) {
|
||||||
|
this.api = apiClient
|
||||||
|
}
|
||||||
|
|
||||||
|
async seed() {
|
||||||
|
return this.create(generateTable())
|
||||||
|
}
|
||||||
|
|
||||||
|
set appId(appId: string) {
|
||||||
|
this.headers = {
|
||||||
|
"x-budibase-app-id": appId,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async create(body: CreateTableParams): Promise<[Response, Table]> {
|
||||||
|
const response = await this.api.post(`/tables`, {
|
||||||
|
body,
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async read(id: string): Promise<[Response, Table]> {
|
||||||
|
const response = await this.api.get(`/tables/${id}`, {
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async search(body: SearchInputParams): Promise<[Response, Table]> {
|
||||||
|
const response = await this.api.post(`/tables/search`, {
|
||||||
|
body,
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(id: string, body: Table): Promise<[Response, Table]> {
|
||||||
|
const response = await this.api.put(`/tables/${id}`, {
|
||||||
|
body,
|
||||||
|
headers: this.headers,
|
||||||
|
})
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
import PublicAPIClient from "./PublicAPIClient"
|
||||||
|
import {
|
||||||
|
CreateUserParams,
|
||||||
|
SearchInputParams,
|
||||||
|
User,
|
||||||
|
} from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import { Response } from "node-fetch"
|
||||||
|
|
||||||
|
export default class UserApi {
|
||||||
|
api: PublicAPIClient
|
||||||
|
|
||||||
|
constructor(apiClient: PublicAPIClient) {
|
||||||
|
this.api = apiClient
|
||||||
|
}
|
||||||
|
|
||||||
|
async seed() {}
|
||||||
|
|
||||||
|
async create(body: CreateUserParams): Promise<[Response, User]> {
|
||||||
|
const response = await this.api.post(`/users`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async read(id: string): Promise<[Response, User]> {
|
||||||
|
const response = await this.api.get(`/users/${id}`)
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async search(body: SearchInputParams): Promise<[Response, User]> {
|
||||||
|
const response = await this.api.post(`/users/search`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
|
||||||
|
async update(id: string, body: User): Promise<[Response, User]> {
|
||||||
|
const response = await this.api.put(`/users/${id}`, { body })
|
||||||
|
const json = await response.json()
|
||||||
|
return [response, json.data]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
import generator from "../TestConfiguration/generator"
|
||||||
|
import { CreateApplicationParams } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
|
||||||
|
const generate = (overrides = {}): CreateApplicationParams => ({
|
||||||
|
name: generator.word(),
|
||||||
|
url: `/${generator.word()}`,
|
||||||
|
...overrides,
|
||||||
|
})
|
||||||
|
|
||||||
|
export default generate
|
|
@ -0,0 +1,56 @@
|
||||||
|
import {
|
||||||
|
CreateRowParams,
|
||||||
|
CreateTableParams,
|
||||||
|
} from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import generator from "../TestConfiguration/generator"
|
||||||
|
|
||||||
|
export const generateTable = (overrides = {}): CreateTableParams => ({
|
||||||
|
name: generator.word(),
|
||||||
|
primaryDisplay: "sasa",
|
||||||
|
schema: {
|
||||||
|
"Auto ID": {
|
||||||
|
autocolumn: true,
|
||||||
|
name: "Auto ID",
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
"Created At": {
|
||||||
|
autocolumn: true,
|
||||||
|
name: "Created At",
|
||||||
|
type: "datetime",
|
||||||
|
},
|
||||||
|
"Created By": {
|
||||||
|
autocolumn: true,
|
||||||
|
fieldName: "test12-Created By",
|
||||||
|
name: "Created By",
|
||||||
|
relationshipType: "many-to-many",
|
||||||
|
tableId: "ta_users",
|
||||||
|
type: "link",
|
||||||
|
},
|
||||||
|
sasa: {
|
||||||
|
name: "sasa",
|
||||||
|
type: "string",
|
||||||
|
},
|
||||||
|
"Updated At": {
|
||||||
|
autocolumn: true,
|
||||||
|
name: "Updated At",
|
||||||
|
type: "datetime",
|
||||||
|
},
|
||||||
|
"Updated By": {
|
||||||
|
autocolumn: true,
|
||||||
|
fieldName: "test12-Updated By",
|
||||||
|
name: "Updated By",
|
||||||
|
relationshipType: "many-to-many",
|
||||||
|
tableId: "ta_users",
|
||||||
|
type: "link",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
...overrides,
|
||||||
|
})
|
||||||
|
|
||||||
|
export const generateRow = (overrides = {}): CreateRowParams => ({
|
||||||
|
type: "row",
|
||||||
|
tableId: "seed_table",
|
||||||
|
sasa: "Mike",
|
||||||
|
relationship: ["ro_ta_"],
|
||||||
|
...overrides,
|
||||||
|
})
|
|
@ -0,0 +1,22 @@
|
||||||
|
import { CreateUserParams } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
import generator from "../TestConfiguration/generator"
|
||||||
|
|
||||||
|
const generate = (overrides = {}): CreateUserParams => ({
|
||||||
|
email: generator.email(),
|
||||||
|
roles: {
|
||||||
|
[generator.string({ length: 32, alpha: true, numeric: true })]:
|
||||||
|
generator.word(),
|
||||||
|
},
|
||||||
|
password: generator.word(),
|
||||||
|
status: "active",
|
||||||
|
forceResetPassword: generator.bool(),
|
||||||
|
builder: {
|
||||||
|
global: generator.bool(),
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
global: generator.bool(),
|
||||||
|
},
|
||||||
|
...overrides,
|
||||||
|
})
|
||||||
|
|
||||||
|
export default generate
|
|
@ -1,8 +1,10 @@
|
||||||
export = {
|
const env = {
|
||||||
BUDIBASE_SERVER_URL: process.env.BUDIBASE_SERVER_URL,
|
BUDIBASE_SERVER_URL: process.env.BUDIBASE_SERVER_URL,
|
||||||
BUDIBASE_PUBLIC_API_KEY: process.env.BUDIBASE_PUBLIC_API_KEY,
|
BUDIBASE_PUBLIC_API_KEY: process.env.BUDIBASE_PUBLIC_API_KEY,
|
||||||
_set(key: any, value: any) {
|
_set(key: any, value: any) {
|
||||||
process.env[key] = value
|
process.env[key] = value
|
||||||
module.exports[key] = value
|
module.exports[key] = value
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export = env
|
||||||
|
|
|
@ -1,21 +1,22 @@
|
||||||
|
import { Response } from "node-fetch"
|
||||||
|
|
||||||
// boilerplate to allow TS updates to the global scope
|
// boilerplate to allow TS updates to the global scope
|
||||||
export {};
|
export {}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
namespace jest {
|
namespace jest {
|
||||||
interface Matchers<R> {
|
interface Matchers<R> {
|
||||||
toHaveStatusCode(code: number): R;
|
toHaveStatusCode(code: number): R
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Expect extensions
|
// Expect extensions
|
||||||
expect.extend({
|
expect.extend({
|
||||||
toHaveStatusCode(received, code) {
|
toHaveStatusCode(received: Response, code: number) {
|
||||||
const pass = received.status === code
|
const pass = received.status === code
|
||||||
return {
|
return {
|
||||||
message: () =>
|
message: () => `expected ${received.status} to match status code ${code}`,
|
||||||
`expected ${received.status} to match status code ${code}`,
|
|
||||||
pass,
|
pass,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
import PublicAPIClient from "./PublicAPIClient";
|
|
||||||
import generateApp from "./applications/fixtures/generate"
|
|
||||||
|
|
||||||
class TestConfiguration {
|
|
||||||
testContext: Record<string, any>;
|
|
||||||
apiClient: PublicAPIClient;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.testContext = {}
|
|
||||||
this.apiClient = new PublicAPIClient()
|
|
||||||
}
|
|
||||||
|
|
||||||
async beforeAll() {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
async afterAll() {
|
|
||||||
}
|
|
||||||
|
|
||||||
async seedTable(appId: string) {
|
|
||||||
const response = await this.apiClient.post("/tables", {
|
|
||||||
body: require("./tables/fixtures/seed.json"),
|
|
||||||
headers: {
|
|
||||||
"x-budibase-app-id": appId
|
|
||||||
}
|
|
||||||
})
|
|
||||||
const json = await response.json()
|
|
||||||
return json.data
|
|
||||||
}
|
|
||||||
|
|
||||||
async seedApp() {
|
|
||||||
const response = await this.apiClient.post("/applications", {
|
|
||||||
body: generateApp()
|
|
||||||
})
|
|
||||||
return response.json()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TestConfiguration
|
|
|
@ -1,10 +1,11 @@
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import TestConfiguration from "../../../config/public-api/TestConfiguration"
|
||||||
import PublicAPIClient from "../PublicAPIClient"
|
import PublicAPIClient from "../../../config/public-api/TestConfiguration/PublicAPIClient"
|
||||||
import generateApp from "./fixtures/generate"
|
import generateApp from "../../../config/public-api/fixtures/applications"
|
||||||
|
import { Application } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
|
||||||
describe("Public API - /applications endpoints", () => {
|
describe("Public API - /applications endpoints", () => {
|
||||||
const api = new PublicAPIClient()
|
const api = new PublicAPIClient()
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration<Application>(api)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
|
@ -14,34 +15,30 @@ describe("Public API - /applications endpoints", () => {
|
||||||
await config.afterAll()
|
await config.afterAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Create a application", async () => {
|
it("POST - Create an application", async () => {
|
||||||
const response = await api.post(`/applications`, {
|
const [response, app] = await config.applications.create(generateApp())
|
||||||
body: generateApp()
|
config.context = app
|
||||||
})
|
|
||||||
const json = await response.json()
|
|
||||||
config.testContext.application = json.data
|
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Search applications", async () => {
|
it("POST - Search applications", async () => {
|
||||||
const response = await api.post(`/applications/search`, {
|
const [response, app] = await config.applications.search({
|
||||||
body: {
|
name: config.context.name,
|
||||||
name: config.testContext.application.name
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("GET - Retrieve a application", async () => {
|
it("GET - Retrieve an application", async () => {
|
||||||
const response = await api.get(`/applications/${config.testContext.application._id}`)
|
const [response, app] = await config.applications.read(config.context._id)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("PUT - update an application", async () => {
|
||||||
it("PUT - update a application", async () => {
|
config.context.name = "UpdatedName"
|
||||||
const response = await api.put(`/applications/${config.testContext.application._id}`, {
|
const [response, app] = await config.applications.update(
|
||||||
body: require("./fixtures/update_application.json")
|
config.context._id,
|
||||||
})
|
config.context
|
||||||
|
)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"name": "TestApp",
|
|
||||||
"url": "/testapp"
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
import generator from "../../generator"
|
|
||||||
|
|
||||||
const generate = (overrides = {}) => ({
|
|
||||||
name: generator.word(),
|
|
||||||
url: `/${generator.word()}`,
|
|
||||||
...overrides
|
|
||||||
})
|
|
||||||
|
|
||||||
export default generate
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"name": "SeedApp",
|
|
||||||
"url": "/seedapp"
|
|
||||||
}
|
|
|
@ -1,4 +0,0 @@
|
||||||
{
|
|
||||||
"name": "UpdatedTestApp",
|
|
||||||
"url": "/updatedtestapp"
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"type": "row",
|
|
||||||
"tableId": "seed_table",
|
|
||||||
"sasa": "Mike",
|
|
||||||
"relationship": [
|
|
||||||
"ro_ta_"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"primaryDisplay": "sasa",
|
|
||||||
"schema": {
|
|
||||||
"Auto ID": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"numericality": {
|
|
||||||
"greaterThanOrEqualTo": "",
|
|
||||||
"lessThanOrEqualTo": ""
|
|
||||||
},
|
|
||||||
"presence": false,
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Auto ID",
|
|
||||||
"subtype": "autoID",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Created At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created At",
|
|
||||||
"subtype": "createdAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Created By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Created By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "createdBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
},
|
|
||||||
"sasa": {
|
|
||||||
"constraints": {
|
|
||||||
"length": {
|
|
||||||
"maximum": null
|
|
||||||
},
|
|
||||||
"presence": {
|
|
||||||
"allowEmpty": false
|
|
||||||
},
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": "sasa",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Updated At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated At",
|
|
||||||
"subtype": "updatedAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Updated By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Updated By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "updatedBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
{
|
|
||||||
"name": "test",
|
|
||||||
"primaryDisplay": "sasa",
|
|
||||||
"schema": {
|
|
||||||
"Auto ID": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"numericality": {
|
|
||||||
"greaterThanOrEqualTo": "",
|
|
||||||
"lessThanOrEqualTo": ""
|
|
||||||
},
|
|
||||||
"presence": false,
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Auto ID",
|
|
||||||
"subtype": "autoID",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Created At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created At",
|
|
||||||
"subtype": "createdAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Created By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Created By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "createdBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
},
|
|
||||||
"sasa": {
|
|
||||||
"constraints": {
|
|
||||||
"length": {
|
|
||||||
"maximum": null
|
|
||||||
},
|
|
||||||
"presence": {
|
|
||||||
"allowEmpty": false
|
|
||||||
},
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": "sasa",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Updated At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated At",
|
|
||||||
"subtype": "updatedAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Updated By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Updated By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "updatedBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
{
|
|
||||||
"type": "row",
|
|
||||||
"tableId": "seed_table",
|
|
||||||
"sasa": "MikeIsTheBest",
|
|
||||||
"relationship": [
|
|
||||||
"ro_ta_..."
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -1,94 +0,0 @@
|
||||||
{
|
|
||||||
"name": "test123",
|
|
||||||
"primaryDisplay": "sasa",
|
|
||||||
"schema": {
|
|
||||||
"Auto ID": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"numericality": {
|
|
||||||
"greaterThanOrEqualTo": "",
|
|
||||||
"lessThanOrEqualTo": ""
|
|
||||||
},
|
|
||||||
"presence": false,
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Auto ID",
|
|
||||||
"subtype": "autoID",
|
|
||||||
"type": "number"
|
|
||||||
},
|
|
||||||
"Created At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created At",
|
|
||||||
"subtype": "createdAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Created By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Created By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Created By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "createdBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
},
|
|
||||||
"sasa": {
|
|
||||||
"constraints": {
|
|
||||||
"length": {
|
|
||||||
"maximum": null
|
|
||||||
},
|
|
||||||
"presence": {
|
|
||||||
"allowEmpty": false
|
|
||||||
},
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"name": "sasa",
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"Updated At": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"datetime": {
|
|
||||||
"earliest": "",
|
|
||||||
"latest": ""
|
|
||||||
},
|
|
||||||
"length": {},
|
|
||||||
"presence": false,
|
|
||||||
"type": "string"
|
|
||||||
},
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated At",
|
|
||||||
"subtype": "updatedAt",
|
|
||||||
"type": "datetime"
|
|
||||||
},
|
|
||||||
"Updated By": {
|
|
||||||
"autocolumn": true,
|
|
||||||
"constraints": {
|
|
||||||
"presence": false,
|
|
||||||
"type": "array"
|
|
||||||
},
|
|
||||||
"fieldName": "test12-Updated By",
|
|
||||||
"icon": "ri-magic-line",
|
|
||||||
"name": "Updated By",
|
|
||||||
"relationshipType": "many-to-many",
|
|
||||||
"subtype": "updatedBy",
|
|
||||||
"tableId": "ta_users",
|
|
||||||
"type": "link"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,17 +1,22 @@
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import { Row } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
import PublicAPIClient from "../PublicAPIClient"
|
import { generateRow } from "../../../config/public-api/fixtures/tables"
|
||||||
|
import TestConfiguration from "../../../config/public-api/TestConfiguration"
|
||||||
|
import PublicAPIClient from "../../../config/public-api/TestConfiguration/PublicAPIClient"
|
||||||
|
|
||||||
describe("Public API - /rows endpoints", () => {
|
describe("Public API - /rows endpoints", () => {
|
||||||
let api: PublicAPIClient
|
let api = new PublicAPIClient()
|
||||||
|
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration<Row>(api)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
const app = await config.seedApp()
|
const [appResp, app] = await config.applications.seed()
|
||||||
|
|
||||||
config.testContext.table = await config.seedTable(app.data._id)
|
config.tables.appId = app._id
|
||||||
api = new PublicAPIClient(app.data._id)
|
const [tableResp, table] = await config.tables.seed()
|
||||||
|
|
||||||
|
config.rows.appId = app._id
|
||||||
|
config.rows.tableId = table._id
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
|
@ -19,33 +24,29 @@ describe("Public API - /rows endpoints", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Create a row", async () => {
|
it("POST - Create a row", async () => {
|
||||||
const response = await api.post(`/tables/${config.testContext.table._id}/rows`, {
|
const [response, row] = await config.rows.create(generateRow())
|
||||||
body: require("./fixtures/row.json")
|
config.context = row
|
||||||
})
|
|
||||||
const json = await response.json()
|
|
||||||
config.testContext.row = json.data
|
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Search rows", async () => {
|
it("POST - Search rows", async () => {
|
||||||
const response = await api.post(`/tables/${config.testContext.table._id}/rows/search`, {
|
const [response, row] = await config.rows.search({
|
||||||
body: {
|
name: config.context.name as string,
|
||||||
name: config.testContext.row.name
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("GET - Retrieve a row", async () => {
|
it("GET - Retrieve a row", async () => {
|
||||||
const response = await api.get(`/tables/${config.testContext.table._id}/rows/${config.testContext.row._id}`)
|
const [response, row] = await config.rows.read(config.context._id)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it("PUT - update a row", async () => {
|
it("PUT - update a row", async () => {
|
||||||
const response = await api.put(`/tables/${config.testContext.table._id}/rows/${config.testContext.row._id}`, {
|
config.context.name = "UpdatedName"
|
||||||
body: require("./fixtures/update_row.json")
|
const [response, row] = await config.rows.update(
|
||||||
})
|
config.context._id,
|
||||||
|
config.context
|
||||||
|
)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,14 +1,16 @@
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import { Table } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
import PublicAPIClient from "../PublicAPIClient"
|
import { generateTable } from "../../../config/public-api/fixtures/tables"
|
||||||
|
import TestConfiguration from "../../../config/public-api/TestConfiguration"
|
||||||
|
import PublicAPIClient from "../../../config/public-api/TestConfiguration/PublicAPIClient"
|
||||||
|
|
||||||
describe("Public API - /tables endpoints", () => {
|
describe("Public API - /tables endpoints", () => {
|
||||||
let api: PublicAPIClient
|
let api = new PublicAPIClient()
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration<Table>(api)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
const app = await config.seedApp()
|
const [_, app] = await config.applications.seed()
|
||||||
api = new PublicAPIClient(app.data._id)
|
config.tables.appId = app._id
|
||||||
})
|
})
|
||||||
|
|
||||||
afterAll(async () => {
|
afterAll(async () => {
|
||||||
|
@ -16,33 +18,29 @@ describe("Public API - /tables endpoints", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Create a table", async () => {
|
it("POST - Create a table", async () => {
|
||||||
const response = await api.post(`/tables`, {
|
const [response, table] = await config.tables.create(generateTable())
|
||||||
body: require("./fixtures/table.json")
|
config.context = table
|
||||||
})
|
|
||||||
const json = await response.json()
|
|
||||||
config.testContext.table = json.data
|
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Search tables", async () => {
|
it("POST - Search tables", async () => {
|
||||||
const response = await api.post(`/tables/search`, {
|
const [response, table] = await config.tables.search({
|
||||||
body: {
|
name: config.context.name,
|
||||||
name: config.testContext.table.name
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("GET - Retrieve a table", async () => {
|
it("GET - Retrieve a table", async () => {
|
||||||
const response = await api.get(`/tables/${config.testContext.table._id}`)
|
const [response, table] = await config.tables.read(config.context._id)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it("PUT - update a table", async () => {
|
it("PUT - update a table", async () => {
|
||||||
const response = await api.put(`/tables/${config.testContext.table._id}`, {
|
config.context.name = "updatedName"
|
||||||
body: require("./fixtures/update_table.json")
|
const [response, table] = await config.tables.update(
|
||||||
})
|
config.context._id,
|
||||||
|
config.context
|
||||||
|
)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
import generator from "../../generator"
|
|
||||||
import { User } from "@budibase/types"
|
|
||||||
|
|
||||||
const generate = (overrides = {}): User => ({
|
|
||||||
tenantId: generator.word(),
|
|
||||||
email: generator.email(),
|
|
||||||
roles: {
|
|
||||||
[generator.string({ length: 32, alpha: true, numeric: true })]: generator.word(),
|
|
||||||
},
|
|
||||||
password: generator.word(),
|
|
||||||
status: "active",
|
|
||||||
forceResetPassword: generator.bool(),
|
|
||||||
builder: {
|
|
||||||
global: generator.bool()
|
|
||||||
},
|
|
||||||
admin: {
|
|
||||||
global: generator.bool()
|
|
||||||
},
|
|
||||||
...overrides
|
|
||||||
})
|
|
||||||
|
|
||||||
export default generate
|
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
"email": "test@budibase.com",
|
|
||||||
"roles": {
|
|
||||||
"sed_6d7": "sit ea amet",
|
|
||||||
"cupidatat_e16": "fugiat proident sed"
|
|
||||||
},
|
|
||||||
"password": "cupidatat Lorem ad",
|
|
||||||
"status": "active",
|
|
||||||
"firstName": "QA",
|
|
||||||
"lastName": "Updated",
|
|
||||||
"forceResetPassword": true,
|
|
||||||
"builder": {
|
|
||||||
"global": true
|
|
||||||
},
|
|
||||||
"admin": {
|
|
||||||
"global": false
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,18 +0,0 @@
|
||||||
{
|
|
||||||
"email": "test@budibase.com",
|
|
||||||
"roles": {
|
|
||||||
"sed_6d7": "sit ea amet",
|
|
||||||
"cupidatat_e16": "fugiat proident sed"
|
|
||||||
},
|
|
||||||
"password": "cupidatat Lorem ad",
|
|
||||||
"status": "active",
|
|
||||||
"firstName": "QA",
|
|
||||||
"lastName": "Test",
|
|
||||||
"forceResetPassword": true,
|
|
||||||
"builder": {
|
|
||||||
"global": true
|
|
||||||
},
|
|
||||||
"admin": {
|
|
||||||
"global": false
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,9 +1,11 @@
|
||||||
import TestConfiguration from "../TestConfiguration"
|
import TestConfiguration from "../../../config/public-api/TestConfiguration"
|
||||||
import PublicAPIClient from "../PublicAPIClient"
|
import PublicAPIClient from "../../../config/public-api/TestConfiguration/PublicAPIClient"
|
||||||
|
import generateUser from "../../../config/public-api/fixtures/users"
|
||||||
|
import { User } from "../../../../../packages/server/src/api/controllers/public/mapping/types"
|
||||||
|
|
||||||
describe("Public API - /users endpoints", () => {
|
describe("Public API - /users endpoints", () => {
|
||||||
const api = new PublicAPIClient()
|
const api = new PublicAPIClient()
|
||||||
const config = new TestConfiguration()
|
const config = new TestConfiguration<User>(api)
|
||||||
|
|
||||||
beforeAll(async () => {
|
beforeAll(async () => {
|
||||||
await config.beforeAll()
|
await config.beforeAll()
|
||||||
|
@ -14,33 +16,29 @@ describe("Public API - /users endpoints", () => {
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Create a user", async () => {
|
it("POST - Create a user", async () => {
|
||||||
const response = await api.post(`/users`, {
|
const [response, user] = await config.users.create(generateUser())
|
||||||
body: require("./fixtures/user.json")
|
config.context = user
|
||||||
})
|
|
||||||
const json = await response.json()
|
|
||||||
config.testContext.user = json.data
|
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("POST - Search users", async () => {
|
it("POST - Search users", async () => {
|
||||||
const response = await api.post(`/users/search`, {
|
const [response, user] = await config.users.search({
|
||||||
body: {
|
name: config.context.email,
|
||||||
name: config.testContext.user.email
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("GET - Retrieve a user", async () => {
|
it("GET - Retrieve a user", async () => {
|
||||||
const response = await api.get(`/users/${config.testContext.user._id}`)
|
const [response, user] = await config.users.read(config.context._id)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
it("PUT - update a user", async () => {
|
it("PUT - update a user", async () => {
|
||||||
const response = await api.put(`/users/${config.testContext.user._id}`, {
|
config.context.firstName = "Updated First Name"
|
||||||
body: require("./fixtures/update_user.json")
|
const [response, user] = await config.users.update(
|
||||||
})
|
config.context._id,
|
||||||
|
config.context
|
||||||
|
)
|
||||||
expect(response).toHaveStatusCode(200)
|
expect(response).toHaveStatusCode(200)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -14,8 +14,6 @@
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
"@budibase/types": ["../packages/types/src"],
|
"@budibase/types": ["../packages/types/src"],
|
||||||
"@budibase/backend-core": ["../packages/backend-core/src"],
|
|
||||||
"@budibase/backend-core/*": ["../packages/backend-core/*"]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ts-node": {
|
"ts-node": {
|
||||||
|
@ -23,7 +21,6 @@
|
||||||
},
|
},
|
||||||
"references": [
|
"references": [
|
||||||
{ "path": "../packages/types" },
|
{ "path": "../packages/types" },
|
||||||
{ "path": "../packages/backend-core" },
|
|
||||||
],
|
],
|
||||||
"include": [
|
"include": [
|
||||||
"src/**/*",
|
"src/**/*",
|
||||||
|
|
|
@ -290,7 +290,7 @@
|
||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@budibase/types@^1.3.4":
|
"@budibase/types@1.3.4":
|
||||||
version "1.3.4"
|
version "1.3.4"
|
||||||
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4.tgz#25f087b024e843eb372e50c81f8f925fb39f1dfd"
|
resolved "https://registry.yarnpkg.com/@budibase/types/-/types-1.3.4.tgz#25f087b024e843eb372e50c81f8f925fb39f1dfd"
|
||||||
integrity sha512-ndyWs8yeCS7cpZjApDB1HhY6UUM2SRBUgAMCZOZaWABG9JHeCbx7x0e/pA2SZjswdMXqS5WmnEd3br5wuvUzJw==
|
integrity sha512-ndyWs8yeCS7cpZjApDB1HhY6UUM2SRBUgAMCZOZaWABG9JHeCbx7x0e/pA2SZjswdMXqS5WmnEd3br5wuvUzJw==
|
||||||
|
@ -342,7 +342,7 @@
|
||||||
jest-util "^28.1.3"
|
jest-util "^28.1.3"
|
||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
|
|
||||||
"@jest/core@^28.1.3":
|
"@jest/core@^28.0.2", "@jest/core@^28.1.3":
|
||||||
version "28.1.3"
|
version "28.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.3.tgz#0ebf2bd39840f1233cd5f2d1e6fc8b71bd5a1ac7"
|
resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.3.tgz#0ebf2bd39840f1233cd5f2d1e6fc8b71bd5a1ac7"
|
||||||
integrity sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==
|
integrity sha512-CIKBrlaKOzA7YG19BEqCw3SLIsEwjZkeJzf5bdooVnW4bH5cktqe3JX+G2YV1aK5vP8N9na1IGWFzYaTp6k6NA==
|
||||||
|
@ -712,7 +712,7 @@
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/istanbul-lib-report" "*"
|
"@types/istanbul-lib-report" "*"
|
||||||
|
|
||||||
"@types/jest@^29.0.0":
|
"@types/jest@29.0.0":
|
||||||
version "29.0.0"
|
version "29.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.0.0.tgz#bc66835bf6b09d6a47e22c21d7f5b82692e60e72"
|
resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.0.0.tgz#bc66835bf6b09d6a47e22c21d7f5b82692e60e72"
|
||||||
integrity sha512-X6Zjz3WO4cT39Gkl0lZ2baFRaEMqJl5NC1OjElkwtNzAlbkr2K/WJXkBkH5VP0zx4Hgsd2TZYdOEfvp2Dxia+Q==
|
integrity sha512-X6Zjz3WO4cT39Gkl0lZ2baFRaEMqJl5NC1OjElkwtNzAlbkr2K/WJXkBkH5VP0zx4Hgsd2TZYdOEfvp2Dxia+Q==
|
||||||
|
@ -720,7 +720,7 @@
|
||||||
expect "^29.0.0"
|
expect "^29.0.0"
|
||||||
pretty-format "^29.0.0"
|
pretty-format "^29.0.0"
|
||||||
|
|
||||||
"@types/node-fetch@^2.6.2":
|
"@types/node-fetch@2.6.2":
|
||||||
version "2.6.2"
|
version "2.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da"
|
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.6.2.tgz#d1a9c5fd049d9415dce61571557104dec3ec81da"
|
||||||
integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==
|
integrity sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==
|
||||||
|
@ -979,7 +979,7 @@ chalk@^4.0.0:
|
||||||
ansi-styles "^4.1.0"
|
ansi-styles "^4.1.0"
|
||||||
supports-color "^7.1.0"
|
supports-color "^7.1.0"
|
||||||
|
|
||||||
chance@^1.1.8:
|
chance@1.1.8:
|
||||||
version "1.1.8"
|
version "1.1.8"
|
||||||
resolved "https://registry.yarnpkg.com/chance/-/chance-1.1.8.tgz#5d6c2b78c9170bf6eb9df7acdda04363085be909"
|
resolved "https://registry.yarnpkg.com/chance/-/chance-1.1.8.tgz#5d6c2b78c9170bf6eb9df7acdda04363085be909"
|
||||||
integrity sha512-v7fi5Hj2VbR6dJEGRWLmJBA83LJMS47pkAbmROFxHWd9qmE1esHRZW8Clf1Fhzr3rjxnNZVCjOEv/ivFxeIMtg==
|
integrity sha512-v7fi5Hj2VbR6dJEGRWLmJBA83LJMS47pkAbmROFxHWd9qmE1esHRZW8Clf1Fhzr3rjxnNZVCjOEv/ivFxeIMtg==
|
||||||
|
@ -1499,7 +1499,7 @@ jest-circus@^28.1.3:
|
||||||
slash "^3.0.0"
|
slash "^3.0.0"
|
||||||
stack-utils "^2.0.3"
|
stack-utils "^2.0.3"
|
||||||
|
|
||||||
jest-cli@^28.1.3:
|
jest-cli@^28.0.2:
|
||||||
version "28.1.3"
|
version "28.1.3"
|
||||||
resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.3.tgz#558b33c577d06de55087b8448d373b9f654e46b2"
|
resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.3.tgz#558b33c577d06de55087b8448d373b9f654e46b2"
|
||||||
integrity sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==
|
integrity sha512-roY3kvrv57Azn1yPgdTebPAXvdR2xfezaKKYzVxZ6It/5NCxzJym6tUI5P1zkdWhfUYkxEI9uZWcQdaFLo8mJQ==
|
||||||
|
@ -1866,15 +1866,14 @@ jest-worker@^28.1.3:
|
||||||
merge-stream "^2.0.0"
|
merge-stream "^2.0.0"
|
||||||
supports-color "^8.0.0"
|
supports-color "^8.0.0"
|
||||||
|
|
||||||
jest@^28.0.2:
|
jest@28.0.2:
|
||||||
version "28.1.3"
|
version "28.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.3.tgz#e9c6a7eecdebe3548ca2b18894a50f45b36dfc6b"
|
resolved "https://registry.yarnpkg.com/jest/-/jest-28.0.2.tgz#41385ca21d009708bb9fc65e08663110e08e2cc0"
|
||||||
integrity sha512-N4GT5on8UkZgH0O5LUavMRV1EDEhNTL0KEfRmDIeZHSV7p2XgLoY9t9VDUgL6o+yfdgYHVxuz81G8oB9VG5uyA==
|
integrity sha512-COUtjybolW4koQvO7kCfq5kgbeeU5WbSJfVZprz4zbS8AL32+RAZZTUjBEyRRdpsXqss/pHIvSL7/P+LyMYHXg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@jest/core" "^28.1.3"
|
"@jest/core" "^28.0.2"
|
||||||
"@jest/types" "^28.1.3"
|
|
||||||
import-local "^3.0.2"
|
import-local "^3.0.2"
|
||||||
jest-cli "^28.1.3"
|
jest-cli "^28.0.2"
|
||||||
|
|
||||||
joi@^17.4.0:
|
joi@^17.4.0:
|
||||||
version "17.6.0"
|
version "17.6.0"
|
||||||
|
@ -2163,7 +2162,7 @@ pkg-dir@^4.2.0:
|
||||||
dependencies:
|
dependencies:
|
||||||
find-up "^4.0.0"
|
find-up "^4.0.0"
|
||||||
|
|
||||||
prettier@^2.7.1:
|
prettier@2.7.1:
|
||||||
version "2.7.1"
|
version "2.7.1"
|
||||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
|
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"
|
||||||
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
|
integrity sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==
|
||||||
|
@ -2328,7 +2327,7 @@ stack-utils@^2.0.3:
|
||||||
dependencies:
|
dependencies:
|
||||||
escape-string-regexp "^2.0.0"
|
escape-string-regexp "^2.0.0"
|
||||||
|
|
||||||
start-server-and-test@^1.14.0:
|
start-server-and-test@1.14.0:
|
||||||
version "1.14.0"
|
version "1.14.0"
|
||||||
resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3"
|
resolved "https://registry.yarnpkg.com/start-server-and-test/-/start-server-and-test-1.14.0.tgz#c57f04f73eac15dd51733b551d775b40837fdde3"
|
||||||
integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw==
|
integrity sha512-on5ELuxO2K0t8EmNj9MtVlFqwBMxfWOhu4U7uZD1xccVpFlOQKR93CSe0u98iQzfNxRyaNTb/CdadbNllplTsw==
|
||||||
|
@ -2448,7 +2447,7 @@ through@2, through@~2.3, through@~2.3.1:
|
||||||
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5"
|
||||||
integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
|
integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==
|
||||||
|
|
||||||
timekeeper@^2.2.0:
|
timekeeper@2.2.0:
|
||||||
version "2.2.0"
|
version "2.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.2.0.tgz#9645731fce9e3280a18614a57a9d1b72af3ca368"
|
resolved "https://registry.yarnpkg.com/timekeeper/-/timekeeper-2.2.0.tgz#9645731fce9e3280a18614a57a9d1b72af3ca368"
|
||||||
integrity sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A==
|
integrity sha512-W3AmPTJWZkRwu+iSNxPIsLZ2ByADsOLbbLxe46UJyWj3mlYLlwucKiq+/dPm0l9wTzqoF3/2PH0AGFCebjq23A==
|
||||||
|
@ -2489,7 +2488,7 @@ ts-jest@28.0.8:
|
||||||
semver "7.x"
|
semver "7.x"
|
||||||
yargs-parser "^21.0.1"
|
yargs-parser "^21.0.1"
|
||||||
|
|
||||||
ts-node@^10.9.1:
|
ts-node@10.9.1:
|
||||||
version "10.9.1"
|
version "10.9.1"
|
||||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
|
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b"
|
||||||
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
|
integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==
|
||||||
|
@ -2508,7 +2507,7 @@ ts-node@^10.9.1:
|
||||||
v8-compile-cache-lib "^3.0.1"
|
v8-compile-cache-lib "^3.0.1"
|
||||||
yn "3.1.1"
|
yn "3.1.1"
|
||||||
|
|
||||||
tsconfig-paths@^4.1.0:
|
tsconfig-paths@4.1.0:
|
||||||
version "4.1.0"
|
version "4.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz#f8ef7d467f08ae3a695335bf1ece088c5538d2c1"
|
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.0.tgz#f8ef7d467f08ae3a695335bf1ece088c5538d2c1"
|
||||||
integrity sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==
|
integrity sha512-AHx4Euop/dXFC+Vx589alFba8QItjF+8hf8LtmuiCwHyI4rHXQtOOENaM8kvYf5fR0dRChy3wzWIZ9WbB7FWow==
|
||||||
|
@ -2532,10 +2531,10 @@ type-fest@^0.21.3:
|
||||||
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
|
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37"
|
||||||
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
|
integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==
|
||||||
|
|
||||||
typescript@^4.8.2:
|
typescript@4.7.3:
|
||||||
version "4.8.2"
|
version "4.7.3"
|
||||||
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.2.tgz#e3b33d5ccfb5914e4eeab6699cf208adee3fd790"
|
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d"
|
||||||
integrity sha512-C0I1UsrrDHo2fYI5oaCGbSejwX4ch+9Y5jTQELvovfmFkK3HHSZJB8MSJcWLmCUBzQBchCrZ9rMRV6GuNrvGtw==
|
integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==
|
||||||
|
|
||||||
update-browserslist-db@^1.0.5:
|
update-browserslist-db@^1.0.5:
|
||||||
version "1.0.7"
|
version "1.0.7"
|
||||||
|
|
Loading…
Reference in New Issue