@budibase/backend-core 2.17.8 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,41 +20,3 @@ export function cleanup() {
20
20
  }
21
21
  intervals = []
22
22
  }
23
-
24
- export class ExecutionTimeoutError extends Error {
25
- public readonly name = "ExecutionTimeoutError"
26
- }
27
-
28
- export class ExecutionTimeTracker {
29
- static withLimit(limitMs: number) {
30
- return new ExecutionTimeTracker(limitMs)
31
- }
32
-
33
- constructor(readonly limitMs: number) {}
34
-
35
- private totalTimeMs = 0
36
-
37
- track<T>(f: () => T): T {
38
- this.checkLimit()
39
- const start = process.hrtime.bigint()
40
- try {
41
- return f()
42
- } finally {
43
- const end = process.hrtime.bigint()
44
- this.totalTimeMs += Number(end - start) / 1e6
45
- this.checkLimit()
46
- }
47
- }
48
-
49
- get elapsedMS() {
50
- return this.totalTimeMs
51
- }
52
-
53
- checkLimit() {
54
- if (this.totalTimeMs > this.limitMs) {
55
- throw new ExecutionTimeoutError(
56
- `Execution time limit of ${this.limitMs}ms exceeded: ${this.totalTimeMs}ms`
57
- )
58
- }
59
- }
60
- }
@@ -44,11 +44,11 @@ describe("utils", () => {
44
44
 
45
45
  it("gets appId from url", async () => {
46
46
  await config.doInTenant(async () => {
47
- const url = "http://test.com"
47
+ const url = "http://example.com"
48
48
  env._set("PLATFORM_URL", url)
49
49
 
50
50
  const ctx = structures.koa.newContext()
51
- ctx.host = `${config.tenantId}.test.com`
51
+ ctx.host = `${config.tenantId}.example.com`
52
52
 
53
53
  const expected = db.generateAppID(config.tenantId)
54
54
  const app = structures.apps.app(expected)
@@ -89,7 +89,7 @@ describe("utils", () => {
89
89
  const ctx = structures.koa.newContext()
90
90
  const expected = db.generateAppID()
91
91
  ctx.request.headers = {
92
- referer: `http://test.com/builder/app/${expected}/design/screen_123/screens`,
92
+ referer: `http://example.com/builder/app/${expected}/design/screen_123/screens`,
93
93
  }
94
94
 
95
95
  const actual = await utils.getAppIdFromCtx(ctx)
@@ -100,7 +100,7 @@ describe("utils", () => {
100
100
  const ctx = structures.koa.newContext()
101
101
  const appId = db.generateAppID()
102
102
  ctx.request.headers = {
103
- referer: `http://test.com/foo/app/${appId}/bar`,
103
+ referer: `http://example.com/foo/app/${appId}/bar`,
104
104
  }
105
105
 
106
106
  const actual = await utils.getAppIdFromCtx(ctx)
@@ -3,5 +3,5 @@ import { v4 as uuid } from "uuid"
3
3
  export { v4 as uuid } from "uuid"
4
4
 
5
5
  export const email = () => {
6
- return `${uuid()}@test.com`
6
+ return `${uuid()}@example.com`
7
7
  }
@@ -61,7 +61,7 @@ export function ssoProfile(user?: User): SSOProfile {
61
61
  },
62
62
  _json: {
63
63
  email: user.email,
64
- picture: "http://test.com",
64
+ picture: "http://example.com",
65
65
  },
66
66
  provider: generator.string(),
67
67
  }
@@ -25,7 +25,7 @@ export const user = (userProps?: Partial<Omit<User, "userId">>): User => {
25
25
  roles: { app_test: "admin" },
26
26
  firstName: generator.first(),
27
27
  lastName: generator.last(),
28
- pictureUrl: "http://test.com",
28
+ pictureUrl: "http://example.com",
29
29
  tenantId: tenant.id(),
30
30
  ...userProps,
31
31
  }