@budibase/frontend-core 3.13.26 → 3.13.28

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/frontend-core",
3
- "version": "3.13.26",
3
+ "version": "3.13.28",
4
4
  "description": "Budibase frontend core libraries used in builder and client",
5
5
  "author": "Budibase",
6
6
  "license": "MPL-2.0",
@@ -17,5 +17,5 @@
17
17
  "shortid": "2.2.15",
18
18
  "socket.io-client": "^4.7.5"
19
19
  },
20
- "gitHead": "9a55f2f9e6b196e6779a01425bb17a00b3643431"
20
+ "gitHead": "de8a462d540b26a2040f4c8059d0a2395234c628"
21
21
  }
package/src/api/index.ts CHANGED
@@ -52,6 +52,7 @@ import { buildNavigationEndpoints } from "./navigation"
52
52
  import { buildWorkspaceAppEndpoints } from "./workspaceApps"
53
53
  import { buildResourceEndpoints } from "./resource"
54
54
  import { buildDeploymentEndpoints } from "./deploy"
55
+ import { buildRecaptchaEndpoints } from "./recaptcha"
55
56
 
56
57
  export type { APIClient } from "./types"
57
58
 
@@ -304,5 +305,6 @@ export const createAPIClient = (config: APIClientConfig = {}): APIClient => {
304
305
  navigation: buildNavigationEndpoints(API),
305
306
  workspaceApp: buildWorkspaceAppEndpoints(API),
306
307
  resource: buildResourceEndpoints(API),
308
+ recaptcha: buildRecaptchaEndpoints(API),
307
309
  }
308
310
  }
@@ -3,6 +3,7 @@ import {
3
3
  ActivateLicenseKeyResponse,
4
4
  ActivateOfflineLicenseTokenRequest,
5
5
  ActivateOfflineLicenseTokenResponse,
6
+ GetInstallInfo,
6
7
  GetLicenseKeyResponse,
7
8
  GetOfflineIdentifierResponse,
8
9
  GetOfflineLicenseTokenResponse,
@@ -25,6 +26,7 @@ export interface LicensingEndpoints {
25
26
  getOfflineLicenseIdentifier: () => Promise<GetOfflineIdentifierResponse>
26
27
  refreshLicense: () => Promise<RefreshOfflineLicenseResponse>
27
28
  getQuotaUsage: () => Promise<QuotaUsage>
29
+ getInstallInfo: () => Promise<GetInstallInfo | void>
28
30
  }
29
31
 
30
32
  export const buildLicensingEndpoints = (
@@ -54,6 +56,19 @@ export const buildLicensingEndpoints = (
54
56
  }
55
57
  },
56
58
 
59
+ // INSTALL ID
60
+ getInstallInfo: async () => {
61
+ try {
62
+ return await API.get({
63
+ url: "/api/global/install",
64
+ })
65
+ } catch (e: any) {
66
+ if (e.status !== 404) {
67
+ throw e
68
+ }
69
+ }
70
+ },
71
+
57
72
  // OFFLINE LICENSE
58
73
  activateOfflineLicense: async offlineLicenseToken => {
59
74
  return API.post<
@@ -0,0 +1,30 @@
1
+ import { BaseAPIClient } from "./types"
2
+ import {
3
+ VerifyRecaptchaRequest,
4
+ VerifyRecaptchaResponse,
5
+ CheckRecaptchaResponse,
6
+ } from "@budibase/types"
7
+
8
+ export interface RecaptchaEndpoints {
9
+ verify: (token: string) => Promise<VerifyRecaptchaResponse>
10
+ check: () => Promise<CheckRecaptchaResponse>
11
+ }
12
+
13
+ export const buildRecaptchaEndpoints = (
14
+ API: BaseAPIClient
15
+ ): RecaptchaEndpoints => ({
16
+ verify: async (token: string) => {
17
+ return await API.post<VerifyRecaptchaRequest, VerifyRecaptchaResponse>({
18
+ url: "/api/recaptcha/verify",
19
+ body: {
20
+ token,
21
+ },
22
+ })
23
+ },
24
+
25
+ check: async () => {
26
+ return await API.get<CheckRecaptchaResponse>({
27
+ url: "/api/recaptcha/check",
28
+ })
29
+ },
30
+ })
package/src/api/types.ts CHANGED
@@ -39,6 +39,7 @@ import { NavigationEndpoints } from "./navigation"
39
39
  import { WorkspaceAppEndpoints } from "./workspaceApps"
40
40
  import { ResourceEndpoints } from "./resource"
41
41
  import { DeploymentEndpoints } from "./deploy"
42
+ import { RecaptchaEndpoints } from "./recaptcha"
42
43
 
43
44
  export enum HTTPMethod {
44
45
  POST = "POST",
@@ -149,4 +150,5 @@ export type APIClient = BaseAPIClient &
149
150
  navigation: NavigationEndpoints
150
151
  workspaceApp: WorkspaceAppEndpoints
151
152
  deployment: DeploymentEndpoints
153
+ recaptcha: RecaptchaEndpoints
152
154
  }