@budibase/frontend-core 3.12.10 → 3.12.12

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.12.10",
3
+ "version": "3.12.12",
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": "9de98cbeb3441ce32f5cc05573fff655c7c758e9"
20
+ "gitHead": "77b10df86f5e46825b5e894f9eec9b8f401e4a45"
21
21
  }
package/src/api/app.ts CHANGED
@@ -38,7 +38,7 @@ export interface AppEndpoints {
38
38
  revertAppClientVersion: (appId: string) => Promise<RevertAppClientResponse>
39
39
  releaseAppLock: (appId: string) => Promise<ClearDevLockResponse>
40
40
  getAppDeployments: () => Promise<FetchDeploymentResponse>
41
- createApp: (app: CreateAppRequest) => Promise<CreateAppResponse>
41
+ createApp: (app: CreateAppRequest | FormData) => Promise<CreateAppResponse>
42
42
  deleteApp: (appId: string) => Promise<DeleteAppResponse>
43
43
  duplicateApp: (
44
44
  appId: string,
@@ -136,6 +136,14 @@ export const buildAppEndpoints = (API: BaseAPIClient): AppEndpoints => ({
136
136
  * @param app the app to create
137
137
  */
138
138
  createApp: async app => {
139
+ if (app instanceof FormData) {
140
+ return await API.post({
141
+ url: "/api/applications",
142
+ body: app,
143
+ json: false,
144
+ })
145
+ }
146
+
139
147
  return await API.post({
140
148
  url: "/api/applications",
141
149
  body: app,
package/src/constants.ts CHANGED
@@ -48,6 +48,7 @@ export const BudibaseRoleOptionsOld = [
48
48
  {
49
49
  label: "Developer",
50
50
  value: BudibaseRoles.Developer,
51
+ sortOrder: 2,
51
52
  },
52
53
  ]
53
54
  export const BudibaseRoleOptions = [
@@ -11,6 +11,9 @@ import {
11
11
  interface UserFetchQuery {
12
12
  appId?: string
13
13
  paginated?: boolean
14
+ string?: {
15
+ email: string
16
+ }
14
17
  }
15
18
 
16
19
  interface UserDefinition {
@@ -59,15 +59,19 @@ export const sequential = <
59
59
  * @param minDelay the minimum delay between invocations
60
60
  * @returns a debounced version of the callback
61
61
  */
62
- export const debounce = (callback: Function, minDelay = 1000) => {
62
+ export const debounce = <T extends (...args: any[]) => any>(
63
+ callback: T,
64
+ minDelay = 1000
65
+ ) => {
63
66
  let timeout: ReturnType<typeof setTimeout>
64
- return async (...params: any[]) => {
67
+ return async (...params: Parameters<T>): Promise<ReturnType<T>> => {
65
68
  return new Promise(resolve => {
66
69
  if (timeout) {
67
70
  clearTimeout(timeout)
68
71
  }
69
72
  timeout = setTimeout(async () => {
70
- resolve(await callback(...params))
73
+ const result = await callback(...params)
74
+ resolve(result)
71
75
  }, minDelay)
72
76
  })
73
77
  }