@budibase/types 2.9.19 → 2.9.20

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.
Files changed (258) hide show
  1. package/dist/api/account/accounts.d.ts +17 -0
  2. package/dist/api/account/index.d.ts +4 -0
  3. package/dist/api/account/license.d.ts +31 -0
  4. package/dist/api/account/status.d.ts +7 -0
  5. package/{src/api/account/user.ts → dist/api/account/user.d.ts} +3 -4
  6. package/dist/api/index.d.ts +2 -0
  7. package/dist/api/web/analytics.d.ts +9 -0
  8. package/{src/api/web/app/backup.ts → dist/api/web/app/backup.d.ts} +10 -14
  9. package/{src/api/web/app/datasource.ts → dist/api/web/app/datasource.d.ts} +13 -21
  10. package/dist/api/web/app/index.d.ts +6 -0
  11. package/dist/api/web/app/row.d.ts +8 -0
  12. package/dist/api/web/app/rows.d.ts +11 -0
  13. package/dist/api/web/app/table.d.ts +12 -0
  14. package/dist/api/web/app/view.d.ts +10 -0
  15. package/dist/api/web/auth.d.ts +22 -0
  16. package/dist/api/web/debug.d.ts +11 -0
  17. package/dist/api/web/errors.d.ts +6 -0
  18. package/dist/api/web/global/auditLogs.d.ts +39 -0
  19. package/{src/api/web/global/configs.ts → dist/api/web/global/configs.d.ts} +11 -15
  20. package/{src/api/web/global/environmentVariables.ts → dist/api/web/global/environmentVariables.d.ts} +7 -10
  21. package/dist/api/web/global/events.d.ts +6 -0
  22. package/dist/api/web/global/index.d.ts +6 -0
  23. package/{src/api/web/global/license.ts → dist/api/web/global/license.d.ts} +5 -15
  24. package/dist/api/web/global/scim/groups.d.ts +27 -0
  25. package/dist/api/web/global/scim/index.d.ts +3 -0
  26. package/dist/api/web/global/scim/shared.d.ts +12 -0
  27. package/dist/api/web/global/scim/users.d.ts +48 -0
  28. package/dist/api/web/index.d.ts +10 -0
  29. package/dist/api/web/pagination.d.ts +23 -0
  30. package/dist/api/web/schedule.d.ts +10 -0
  31. package/dist/api/web/system/environment.d.ts +8 -0
  32. package/dist/api/web/system/index.d.ts +1 -0
  33. package/dist/api/web/user.d.ts +84 -0
  34. package/dist/core/index.d.ts +1 -0
  35. package/dist/core/installation.d.ts +4 -0
  36. package/dist/documents/account/account.d.ts +78 -0
  37. package/dist/documents/account/index.d.ts +2 -0
  38. package/{src/documents/account/user.ts → dist/documents/account/user.d.ts} +5 -6
  39. package/dist/documents/app/app.d.ts +61 -0
  40. package/dist/documents/app/automation.d.ts +192 -0
  41. package/dist/documents/app/backup.d.ts +63 -0
  42. package/dist/documents/app/component.d.ts +10 -0
  43. package/dist/documents/app/datasource.d.ts +49 -0
  44. package/dist/documents/app/index.d.ts +16 -0
  45. package/dist/documents/app/layout.d.ts +4 -0
  46. package/dist/documents/app/links.d.ts +19 -0
  47. package/dist/documents/app/query.d.ts +49 -0
  48. package/dist/documents/app/role.d.ts +9 -0
  49. package/dist/documents/app/row.d.ts +31 -0
  50. package/dist/documents/app/screen.d.ts +22 -0
  51. package/dist/documents/app/table/constants.d.ts +8 -0
  52. package/dist/documents/app/table/index.d.ts +3 -0
  53. package/dist/documents/app/table/schema.d.ts +71 -0
  54. package/dist/documents/app/table/table.d.ts +33 -0
  55. package/dist/documents/app/user.d.ts +5 -0
  56. package/dist/documents/app/view.d.ts +59 -0
  57. package/dist/documents/app/webhook.d.ts +13 -0
  58. package/dist/documents/document.d.ts +47 -0
  59. package/dist/documents/global/auditLogs.d.ts +16 -0
  60. package/dist/documents/global/config.d.ts +112 -0
  61. package/dist/documents/global/environmentVariables.d.ts +12 -0
  62. package/dist/documents/global/index.d.ts +9 -0
  63. package/dist/documents/global/plugin.d.ts +34 -0
  64. package/dist/documents/global/quotas.d.ts +63 -0
  65. package/dist/documents/global/schedule.d.ts +21 -0
  66. package/dist/documents/global/templates.d.ts +8 -0
  67. package/dist/documents/global/user.d.ts +74 -0
  68. package/dist/documents/global/userGroup.d.ts +32 -0
  69. package/dist/documents/index.d.ts +6 -0
  70. package/dist/documents/platform/accounts.d.ts +4 -0
  71. package/dist/documents/platform/index.d.ts +4 -0
  72. package/dist/documents/platform/info.d.ts +8 -0
  73. package/dist/documents/platform/tenants.d.ts +4 -0
  74. package/dist/documents/platform/users.d.ts +15 -0
  75. package/dist/documents/pouch.d.ts +28 -0
  76. package/dist/index.d.ts +5 -0
  77. package/dist/index.js +1159 -0
  78. package/dist/index.js.map +7 -0
  79. package/dist/index.js.meta.json +1 -0
  80. package/dist/sdk/auditLogs.d.ts +15 -0
  81. package/dist/sdk/auth.d.ts +30 -0
  82. package/dist/sdk/automations/index.d.ts +13 -0
  83. package/dist/sdk/cli/constants.d.ts +18 -0
  84. package/dist/sdk/cli/index.d.ts +1 -0
  85. package/dist/sdk/context.d.ts +18 -0
  86. package/dist/sdk/datasources.d.ts +159 -0
  87. package/dist/sdk/db.d.ts +91 -0
  88. package/dist/sdk/environmentVariables.d.ts +4 -0
  89. package/{src/sdk/events/account.ts → dist/sdk/events/account.d.ts} +6 -9
  90. package/dist/sdk/events/app.d.ts +74 -0
  91. package/dist/sdk/events/auditLog.d.ts +8 -0
  92. package/dist/sdk/events/auth.d.ts +29 -0
  93. package/dist/sdk/events/automation.d.ts +56 -0
  94. package/{src/sdk/events/backfill.ts → dist/sdk/events/backfill.d.ts} +26 -34
  95. package/dist/sdk/events/backup.d.ts +15 -0
  96. package/dist/sdk/events/datasource.d.ts +16 -0
  97. package/dist/sdk/events/email.d.ts +5 -0
  98. package/{src/sdk/events/environmentVariable.ts → dist/sdk/events/environmentVariable.d.ts} +5 -8
  99. package/dist/sdk/events/event.d.ts +155 -0
  100. package/dist/sdk/events/identification.d.ts +45 -0
  101. package/dist/sdk/events/index.d.ts +25 -0
  102. package/{src/sdk/events/layout.ts → dist/sdk/events/layout.d.ts} +3 -5
  103. package/dist/sdk/events/license.d.ts +28 -0
  104. package/dist/sdk/events/plugin.d.ts +23 -0
  105. package/dist/sdk/events/query.d.ts +34 -0
  106. package/dist/sdk/events/role.d.ts +24 -0
  107. package/{src/sdk/events/rows.ts → dist/sdk/events/rows.d.ts} +4 -6
  108. package/dist/sdk/events/screen.d.ts +17 -0
  109. package/{src/sdk/events/serve.ts → dist/sdk/events/serve.d.ts} +7 -10
  110. package/dist/sdk/events/table.d.ts +32 -0
  111. package/dist/sdk/events/user.d.ts +79 -0
  112. package/dist/sdk/events/userGroup.d.ts +49 -0
  113. package/{src/sdk/events/version.ts → dist/sdk/events/version.d.ts} +4 -6
  114. package/{src/sdk/events/view.ts → dist/sdk/events/view.d.ts} +16 -26
  115. package/dist/sdk/featureFlag.d.ts +6 -0
  116. package/dist/sdk/hosting.d.ts +4 -0
  117. package/dist/sdk/index.d.ts +21 -0
  118. package/dist/sdk/koa.d.ts +44 -0
  119. package/dist/sdk/licensing/billing.d.ts +21 -0
  120. package/dist/sdk/licensing/feature.d.ts +16 -0
  121. package/dist/sdk/licensing/index.d.ts +5 -0
  122. package/dist/sdk/licensing/license.d.ts +17 -0
  123. package/dist/sdk/licensing/plan.d.ts +41 -0
  124. package/dist/sdk/licensing/quota.d.ts +69 -0
  125. package/dist/sdk/locks.d.ts +47 -0
  126. package/dist/sdk/middleware/index.d.ts +2 -0
  127. package/dist/sdk/middleware/matchers.d.ts +21 -0
  128. package/dist/sdk/middleware/tenancy.d.ts +12 -0
  129. package/dist/sdk/migrations.d.ts +46 -0
  130. package/dist/sdk/permissions.d.ts +17 -0
  131. package/dist/sdk/search.d.ts +94 -0
  132. package/dist/sdk/sso.d.ts +24 -0
  133. package/dist/sdk/user.d.ts +5 -0
  134. package/dist/sdk/websocket.d.ts +9 -0
  135. package/dist/shared/index.d.ts +1 -0
  136. package/dist/shared/typeUtils.d.ts +7 -0
  137. package/package.json +4 -10
  138. package/src/api/account/accounts.ts +0 -22
  139. package/src/api/account/index.ts +0 -4
  140. package/src/api/account/license.ts +0 -39
  141. package/src/api/account/status.ts +0 -7
  142. package/src/api/index.ts +0 -2
  143. package/src/api/public/.keep +0 -0
  144. package/src/api/web/analytics.ts +0 -10
  145. package/src/api/web/app/index.ts +0 -6
  146. package/src/api/web/app/row.ts +0 -11
  147. package/src/api/web/app/rows.ts +0 -13
  148. package/src/api/web/app/table.ts +0 -13
  149. package/src/api/web/app/view.ts +0 -15
  150. package/src/api/web/auth.ts +0 -26
  151. package/src/api/web/debug.ts +0 -11
  152. package/src/api/web/errors.ts +0 -6
  153. package/src/api/web/global/auditLogs.ts +0 -51
  154. package/src/api/web/global/events.ts +0 -7
  155. package/src/api/web/global/index.ts +0 -6
  156. package/src/api/web/global/scim/groups.ts +0 -30
  157. package/src/api/web/global/scim/index.ts +0 -3
  158. package/src/api/web/global/scim/shared.ts +0 -14
  159. package/src/api/web/global/scim/users.ts +0 -53
  160. package/src/api/web/index.ts +0 -10
  161. package/src/api/web/pagination.ts +0 -27
  162. package/src/api/web/schedule.ts +0 -15
  163. package/src/api/web/system/environment.ts +0 -8
  164. package/src/api/web/system/index.ts +0 -1
  165. package/src/api/web/user.ts +0 -87
  166. package/src/core/index.ts +0 -1
  167. package/src/core/installation.ts +0 -4
  168. package/src/documents/account/account.ts +0 -108
  169. package/src/documents/account/index.ts +0 -2
  170. package/src/documents/app/app.ts +0 -69
  171. package/src/documents/app/automation.ts +0 -222
  172. package/src/documents/app/backup.ts +0 -71
  173. package/src/documents/app/component.ts +0 -9
  174. package/src/documents/app/datasource.ts +0 -56
  175. package/src/documents/app/index.ts +0 -16
  176. package/src/documents/app/layout.ts +0 -5
  177. package/src/documents/app/links.ts +0 -21
  178. package/src/documents/app/query.ts +0 -51
  179. package/src/documents/app/role.ts +0 -8
  180. package/src/documents/app/row.ts +0 -35
  181. package/src/documents/app/screen.ts +0 -25
  182. package/src/documents/app/table/constants.ts +0 -9
  183. package/src/documents/app/table/index.ts +0 -3
  184. package/src/documents/app/table/schema.ts +0 -98
  185. package/src/documents/app/table/table.ts +0 -30
  186. package/src/documents/app/user.ts +0 -6
  187. package/src/documents/app/view.ts +0 -66
  188. package/src/documents/app/webhook.ts +0 -15
  189. package/src/documents/document.ts +0 -51
  190. package/src/documents/global/auditLogs.ts +0 -19
  191. package/src/documents/global/config.ts +0 -137
  192. package/src/documents/global/environmentVariables.ts +0 -20
  193. package/src/documents/global/index.ts +0 -9
  194. package/src/documents/global/plugin.ts +0 -38
  195. package/src/documents/global/quotas.ts +0 -81
  196. package/src/documents/global/schedule.ts +0 -32
  197. package/src/documents/global/templates.ts +0 -9
  198. package/src/documents/global/user.ts +0 -95
  199. package/src/documents/global/userGroup.ts +0 -36
  200. package/src/documents/index.ts +0 -6
  201. package/src/documents/platform/accounts.ts +0 -5
  202. package/src/documents/platform/index.ts +0 -4
  203. package/src/documents/platform/info.ts +0 -9
  204. package/src/documents/platform/tenants.ts +0 -5
  205. package/src/documents/platform/users.ts +0 -18
  206. package/src/documents/pouch.ts +0 -32
  207. package/src/index.ts +0 -5
  208. package/src/sdk/auditLogs.ts +0 -22
  209. package/src/sdk/auth.ts +0 -37
  210. package/src/sdk/automations/index.ts +0 -16
  211. package/src/sdk/cli/constants.ts +0 -21
  212. package/src/sdk/cli/index.ts +0 -1
  213. package/src/sdk/context.ts +0 -22
  214. package/src/sdk/datasources.ts +0 -181
  215. package/src/sdk/db.ts +0 -116
  216. package/src/sdk/environmentVariables.ts +0 -4
  217. package/src/sdk/events/app.ts +0 -85
  218. package/src/sdk/events/auditLog.ts +0 -10
  219. package/src/sdk/events/auth.ts +0 -36
  220. package/src/sdk/events/automation.ts +0 -63
  221. package/src/sdk/events/backup.ts +0 -17
  222. package/src/sdk/events/datasource.ts +0 -19
  223. package/src/sdk/events/email.ts +0 -5
  224. package/src/sdk/events/event.ts +0 -424
  225. package/src/sdk/events/identification.ts +0 -60
  226. package/src/sdk/events/index.ts +0 -25
  227. package/src/sdk/events/license.ts +0 -36
  228. package/src/sdk/events/plugin.ts +0 -26
  229. package/src/sdk/events/query.ts +0 -40
  230. package/src/sdk/events/role.ts +0 -29
  231. package/src/sdk/events/screen.ts +0 -19
  232. package/src/sdk/events/table.ts +0 -37
  233. package/src/sdk/events/user.ts +0 -92
  234. package/src/sdk/events/userGroup.ts +0 -56
  235. package/src/sdk/featureFlag.ts +0 -7
  236. package/src/sdk/hosting.ts +0 -4
  237. package/src/sdk/index.ts +0 -21
  238. package/src/sdk/koa.ts +0 -50
  239. package/src/sdk/licensing/billing.ts +0 -24
  240. package/src/sdk/licensing/feature.ts +0 -16
  241. package/src/sdk/licensing/index.ts +0 -5
  242. package/src/sdk/licensing/license.ts +0 -20
  243. package/src/sdk/licensing/plan.ts +0 -47
  244. package/src/sdk/licensing/quota.ts +0 -99
  245. package/src/sdk/locks.ts +0 -50
  246. package/src/sdk/middleware/index.ts +0 -2
  247. package/src/sdk/middleware/matchers.ts +0 -22
  248. package/src/sdk/middleware/tenancy.ts +0 -13
  249. package/src/sdk/migrations.ts +0 -55
  250. package/src/sdk/permissions.ts +0 -19
  251. package/src/sdk/search.ts +0 -101
  252. package/src/sdk/sso.ts +0 -37
  253. package/src/sdk/user.ts +0 -5
  254. package/src/sdk/websocket.ts +0 -9
  255. package/src/shared/index.ts +0 -1
  256. package/src/shared/typeUtils.ts +0 -9
  257. package/tsconfig.build.json +0 -18
  258. package/tsconfig.json +0 -10
@@ -1,92 +0,0 @@
1
- import { BaseEvent } from "./event"
2
-
3
- export interface UserCreatedEvent extends BaseEvent {
4
- userId: string
5
- viaScim?: boolean
6
- audited: {
7
- email: string
8
- }
9
- }
10
-
11
- export interface UserUpdatedEvent extends BaseEvent {
12
- userId: string
13
- viaScim?: boolean
14
- audited: {
15
- email: string
16
- }
17
- }
18
-
19
- export interface UserDeletedEvent extends BaseEvent {
20
- userId: string
21
- viaScim?: boolean
22
- audited: {
23
- email: string
24
- }
25
- }
26
-
27
- export interface UserOnboardingEvent extends BaseEvent {
28
- userId: string
29
- step?: string
30
- audited: {
31
- email: string
32
- }
33
- }
34
-
35
- export interface UserPermissionAssignedEvent extends BaseEvent {
36
- userId: string
37
- audited: {
38
- email: string
39
- }
40
- }
41
-
42
- export interface UserPermissionRemovedEvent extends BaseEvent {
43
- userId: string
44
- audited: {
45
- email: string
46
- }
47
- }
48
-
49
- export interface UserInvitedEvent extends BaseEvent {
50
- audited: {
51
- email: string
52
- }
53
- }
54
-
55
- export interface UserInviteAcceptedEvent extends BaseEvent {
56
- userId: string
57
- audited: {
58
- email: string
59
- }
60
- }
61
-
62
- export interface UserPasswordForceResetEvent extends BaseEvent {
63
- userId: string
64
- audited: {
65
- email: string
66
- }
67
- }
68
-
69
- export interface UserPasswordUpdatedEvent extends BaseEvent {
70
- userId: string
71
- audited: {
72
- email: string
73
- }
74
- }
75
-
76
- export interface UserPasswordResetRequestedEvent extends BaseEvent {
77
- userId: string
78
- audited: {
79
- email: string
80
- }
81
- }
82
-
83
- export interface UserPasswordResetEvent extends BaseEvent {
84
- userId: string
85
- audited: {
86
- email: string
87
- }
88
- }
89
-
90
- export interface UserDataCollaborationEvent extends BaseEvent {
91
- users: number
92
- }
@@ -1,56 +0,0 @@
1
- import { BaseEvent } from "./event"
2
-
3
- export interface GroupCreatedEvent extends BaseEvent {
4
- groupId: string
5
- viaScim?: boolean
6
- audited: {
7
- name: string
8
- }
9
- }
10
-
11
- export interface GroupUpdatedEvent extends BaseEvent {
12
- groupId: string
13
- viaScim?: boolean
14
- audited: {
15
- name: string
16
- }
17
- }
18
-
19
- export interface GroupDeletedEvent extends BaseEvent {
20
- groupId: string
21
- viaScim?: boolean
22
- audited: {
23
- name: string
24
- }
25
- }
26
-
27
- export interface GroupUsersAddedEvent extends BaseEvent {
28
- count: number
29
- groupId: string
30
- viaScim?: boolean
31
- audited: {
32
- name: string
33
- }
34
- }
35
-
36
- export interface GroupUsersDeletedEvent extends BaseEvent {
37
- count: number
38
- groupId: string
39
- viaScim?: boolean
40
- audited: {
41
- name: string
42
- }
43
- }
44
-
45
- export interface GroupAddedOnboardingEvent extends BaseEvent {
46
- groupId: string
47
- onboarding: boolean
48
- }
49
-
50
- export interface GroupPermissionsEditedEvent extends BaseEvent {
51
- permissions: Record<string, string>
52
- groupId: string
53
- audited: {
54
- name: string
55
- }
56
- }
@@ -1,7 +0,0 @@
1
- export enum FeatureFlag {
2
- LICENSING = "LICENSING",
3
- }
4
-
5
- export interface TenantFeatureFlags {
6
- [key: string]: FeatureFlag[]
7
- }
@@ -1,4 +0,0 @@
1
- export enum Hosting {
2
- CLOUD = "cloud",
3
- SELF = "self",
4
- }
package/src/sdk/index.ts DELETED
@@ -1,21 +0,0 @@
1
- export * from "./automations"
2
- export * from "./hosting"
3
- export * from "./context"
4
- export * from "./events"
5
- export * from "./licensing"
6
- export * from "./migrations"
7
- export * from "./datasources"
8
- export * from "./search"
9
- export * from "./koa"
10
- export * from "./auth"
11
- export * from "./locks"
12
- export * from "./db"
13
- export * from "./middleware"
14
- export * from "./featureFlag"
15
- export * from "./environmentVariables"
16
- export * from "./auditLogs"
17
- export * from "./sso"
18
- export * from "./user"
19
- export * from "./cli"
20
- export * from "./websocket"
21
- export * from "./permissions"
package/src/sdk/koa.ts DELETED
@@ -1,50 +0,0 @@
1
- import { Context, Request } from "koa"
2
- import { User, Role, UserRoles, Account } from "../documents"
3
- import { FeatureFlag, License } from "../sdk"
4
- import { Files } from "formidable"
5
-
6
- export interface ContextUser extends Omit<User, "roles"> {
7
- globalId?: string
8
- license?: License
9
- userId?: string
10
- roleId?: string | null
11
- role?: Role
12
- roles?: UserRoles
13
- csrfToken?: string
14
- featureFlags?: FeatureFlag[]
15
- accountPortalAccess?: boolean
16
- account?: Account
17
- }
18
-
19
- /**
20
- * Add support for koa-body in context.
21
- */
22
- export interface BBRequest<RequestBody> extends Request {
23
- body: RequestBody
24
- files?: Files
25
- }
26
-
27
- /**
28
- * Basic context with no user.
29
- */
30
- export interface Ctx<RequestBody = any, ResponseBody = any> extends Context {
31
- request: BBRequest<RequestBody>
32
- body: ResponseBody
33
- }
34
-
35
- /**
36
- * Authenticated context.
37
- */
38
- export interface UserCtx<RequestBody = any, ResponseBody = any>
39
- extends Ctx<RequestBody, ResponseBody> {
40
- user: ContextUser
41
- roleId?: string
42
- }
43
-
44
- /**
45
- * @deprecated: Use UserCtx / Ctx appropriately
46
- * Authenticated context.
47
- */
48
- export interface BBContext extends Ctx {
49
- user?: ContextUser
50
- }
@@ -1,24 +0,0 @@
1
- import { PriceDuration } from "./plan"
2
-
3
- export interface Customer {
4
- balance: number | null | undefined
5
- currency: string | null | undefined
6
- }
7
-
8
- export interface Subscription {
9
- amount: number
10
- currency: string
11
- quantity: number
12
- duration: PriceDuration
13
- cancelAt: number | null | undefined
14
- currentPeriodStart: number
15
- currentPeriodEnd: number
16
- status: string
17
- pastDueAt?: number | null
18
- downgradeAt?: number
19
- }
20
-
21
- export interface Billing {
22
- customer: Customer
23
- subscription?: Subscription
24
- }
@@ -1,16 +0,0 @@
1
- import { PlanType } from "./plan"
2
-
3
- export enum Feature {
4
- USER_GROUPS = "userGroups",
5
- APP_BACKUPS = "appBackups",
6
- ENVIRONMENT_VARIABLES = "environmentVariables",
7
- AUDIT_LOGS = "auditLogs",
8
- ENFORCEABLE_SSO = "enforceableSSO",
9
- BRANDING = "branding",
10
- SCIM = "scim",
11
- SYNC_AUTOMATIONS = "syncAutomations",
12
- APP_BUILDERS = "appBuilders",
13
- OFFLINE = "offline",
14
- }
15
-
16
- export type PlanFeatures = { [key in PlanType]: Feature[] | undefined }
@@ -1,5 +0,0 @@
1
- export * from "./license"
2
- export * from "./plan"
3
- export * from "./quota"
4
- export * from "./feature"
5
- export * from "./billing"
@@ -1,20 +0,0 @@
1
- import { PurchasedPlan, Quotas, Feature, Billing } from "."
2
- import { ISO8601 } from "../../shared"
3
-
4
- export interface OfflineIdentifier {
5
- installId: string
6
- tenantId: string
7
- }
8
-
9
- export interface OfflineLicense extends License {
10
- identifier: OfflineIdentifier
11
- expireAt: ISO8601
12
- }
13
-
14
- export interface License {
15
- features: Feature[]
16
- quotas: Quotas
17
- plan: PurchasedPlan
18
- billing?: Billing
19
- testClockId?: string
20
- }
@@ -1,47 +0,0 @@
1
- export enum PlanType {
2
- FREE = "free",
3
- /** @deprecated */
4
- PRO = "pro",
5
- /** @deprecated */
6
- TEAM = "team",
7
- PREMIUM = "premium",
8
- BUSINESS = "business",
9
- ENTERPRISE = "enterprise",
10
- }
11
-
12
- export enum PriceDuration {
13
- MONTHLY = "monthly",
14
- YEARLY = "yearly",
15
- }
16
-
17
- export interface AvailablePlan {
18
- type: PlanType
19
- maxUsers: number
20
- prices: AvailablePrice[]
21
- }
22
-
23
- export interface AvailablePrice {
24
- amount: number
25
- amountMonthly: number
26
- currency: string
27
- duration: PriceDuration
28
- priceId: string
29
- }
30
-
31
- export enum PlanModel {
32
- PER_USER = "perUser",
33
- DAY_PASS = "dayPass",
34
- }
35
-
36
- export interface PurchasedPlan {
37
- type: PlanType
38
- model: PlanModel
39
- usesInvoicing: boolean
40
- price?: PurchasedPrice
41
- }
42
-
43
- export interface PurchasedPrice extends AvailablePrice {
44
- dayPasses: number | undefined
45
- /** @deprecated - now at the plan level via model */
46
- isPerUser: boolean
47
- }
@@ -1,99 +0,0 @@
1
- import { PlanType } from "."
2
-
3
- export enum QuotaUsageType {
4
- STATIC = "static",
5
- MONTHLY = "monthly",
6
- }
7
-
8
- export enum QuotaType {
9
- USAGE = "usage",
10
- CONSTANT = "constant",
11
- }
12
-
13
- export enum StaticQuotaName {
14
- ROWS = "rows",
15
- APPS = "apps",
16
- USERS = "users",
17
- USER_GROUPS = "userGroups",
18
- PLUGINS = "plugins",
19
- }
20
-
21
- export enum MonthlyQuotaName {
22
- QUERIES = "queries",
23
- AUTOMATIONS = "automations",
24
- DAY_PASSES = "dayPasses",
25
- }
26
-
27
- export enum ConstantQuotaName {
28
- AUTOMATION_LOG_RETENTION_DAYS = "automationLogRetentionDays",
29
- APP_BACKUPS_RETENTION_DAYS = "appBackupRetentionDays",
30
- }
31
-
32
- export type MeteredQuotaName = StaticQuotaName | MonthlyQuotaName
33
- export type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuotaName
34
-
35
- export const isStaticQuota = (
36
- quotaType: QuotaType,
37
- usageType: QuotaUsageType,
38
- name: QuotaName
39
- ): name is StaticQuotaName => {
40
- return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.STATIC
41
- }
42
-
43
- export const isMonthlyQuota = (
44
- quotaType: QuotaType,
45
- usageType: QuotaUsageType,
46
- name: QuotaName
47
- ): name is MonthlyQuotaName => {
48
- return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.MONTHLY
49
- }
50
-
51
- export const isConstantQuota = (
52
- quotaType: QuotaType,
53
- name: QuotaName
54
- ): name is ConstantQuotaName => {
55
- return quotaType === QuotaType.CONSTANT
56
- }
57
-
58
- export type PlanQuotas = { [key in PlanType]: Quotas | undefined }
59
-
60
- export type MonthlyQuotas = {
61
- [MonthlyQuotaName.QUERIES]: Quota
62
- [MonthlyQuotaName.AUTOMATIONS]: Quota
63
- [MonthlyQuotaName.DAY_PASSES]: Quota
64
- }
65
-
66
- export type StaticQuotas = {
67
- [StaticQuotaName.ROWS]: Quota
68
- [StaticQuotaName.APPS]: Quota
69
- [StaticQuotaName.USERS]: Quota
70
- [StaticQuotaName.USER_GROUPS]: Quota
71
- [StaticQuotaName.PLUGINS]: Quota
72
- }
73
-
74
- export type ConstantQuotas = {
75
- [ConstantQuotaName.AUTOMATION_LOG_RETENTION_DAYS]: Quota
76
- [ConstantQuotaName.APP_BACKUPS_RETENTION_DAYS]: Quota
77
- }
78
-
79
- export type Quotas = {
80
- [QuotaType.USAGE]: {
81
- [QuotaUsageType.MONTHLY]: MonthlyQuotas
82
- [QuotaUsageType.STATIC]: StaticQuotas
83
- }
84
- [QuotaType.CONSTANT]: ConstantQuotas
85
- }
86
-
87
- export interface Quota {
88
- name: string
89
- value: number
90
- /**
91
- * Array of whole numbers (1-100) that dictate the percentage that this quota should trigger
92
- * at in relation to the corresponding usage inside budibase.
93
- *
94
- * Triggering results in a budibase installation sending a request to account-portal,
95
- * which can have subsequent effects such as sending emails to users.
96
- */
97
- triggers: number[]
98
- startDate?: number
99
- }
package/src/sdk/locks.ts DELETED
@@ -1,50 +0,0 @@
1
- import Redlock from "redlock"
2
-
3
- export enum LockType {
4
- /**
5
- * If this lock is already held the attempted operation will not be performed.
6
- * No retries will take place and no error will be thrown.
7
- */
8
- TRY_ONCE = "try_once",
9
- TRY_TWICE = "try_twice",
10
- DEFAULT = "default",
11
- DELAY_500 = "delay_500",
12
- CUSTOM = "custom",
13
- }
14
-
15
- export enum LockName {
16
- MIGRATIONS = "migrations",
17
- TRIGGER_QUOTA = "trigger_quota",
18
- SYNC_ACCOUNT_LICENSE = "sync_account_license",
19
- UPDATE_TENANTS_DOC = "update_tenants_doc",
20
- PERSIST_WRITETHROUGH = "persist_writethrough",
21
- QUOTA_USAGE_EVENT = "quota_usage_event",
22
- }
23
-
24
- export interface LockOptions {
25
- /**
26
- * The lock type determines which client to use
27
- */
28
- type: LockType
29
- /**
30
- * The custom options to use when creating the redlock instance
31
- * type must be set to custom for the options to be applied
32
- */
33
- customOptions?: Redlock.Options
34
- /**
35
- * The name for the lock
36
- */
37
- name: LockName
38
- /**
39
- * The ttl to auto-expire the lock if not unlocked manually
40
- */
41
- ttl: number
42
- /**
43
- * The individual resource to lock. This is useful for locking around very specific identifiers, e.g. a document that is prone to conflicts
44
- */
45
- resource?: string
46
- /**
47
- * This is a system-wide lock - don't use tenancy in lock key
48
- */
49
- systemLock?: boolean
50
- }
@@ -1,2 +0,0 @@
1
- export * from "./matchers"
2
- export * from "./tenancy"
@@ -1,22 +0,0 @@
1
- export interface EndpointMatcher {
2
- /**
3
- * The HTTP Path. e.g. /api/things/:thingId
4
- */
5
- route: string
6
- /**
7
- * The HTTP Verb. e.g. GET, POST, etc.
8
- * ALL is also accepted to cover all verbs.
9
- */
10
- method: string
11
- /**
12
- * The route must match exactly - not just begins with
13
- */
14
- strict?: boolean
15
- }
16
-
17
- export interface RegexMatcher {
18
- regex: RegExp
19
- method: string
20
- strict: boolean
21
- route: string
22
- }
@@ -1,13 +0,0 @@
1
- export interface GetTenantIdOptions {
2
- allowNoTenant?: boolean
3
- excludeStrategies?: TenantResolutionStrategy[]
4
- includeStrategies?: TenantResolutionStrategy[]
5
- }
6
-
7
- export enum TenantResolutionStrategy {
8
- USER = "user",
9
- HEADER = "header",
10
- QUERY = "query",
11
- SUBDOMAIN = "subdomain",
12
- PATH = "path",
13
- }
@@ -1,55 +0,0 @@
1
- export interface Migration extends MigrationDefinition {
2
- appOpts?: object
3
- fn: Function
4
- silent?: boolean
5
- preventRetry?: boolean
6
- }
7
-
8
- export enum MigrationType {
9
- // run once per tenant, recorded in global db, global db is provided as an argument
10
- GLOBAL = "global",
11
- // run per app, recorded in each app db, app db is provided as an argument
12
- APP = "app",
13
- // run once, recorded in global info db, global info db is provided as an argument
14
- INSTALLATION = "installation",
15
- }
16
-
17
- export interface MigrationNoOpOptions {
18
- type: MigrationType
19
- tenantId: string
20
- appId?: string
21
- }
22
-
23
- /**
24
- * e.g.
25
- * {
26
- * tenantIds: ['bb'],
27
- * force: {
28
- * global: ['quota_1']
29
- * }
30
- * }
31
- */
32
- export interface MigrationOptions {
33
- tenantIds?: string[]
34
- force?: {
35
- [type: string]: string[]
36
- }
37
- noOp?: MigrationNoOpOptions
38
- }
39
-
40
- export enum MigrationName {
41
- USER_EMAIL_VIEW_CASING = "user_email_view_casing",
42
- APP_URLS = "app_urls",
43
- EVENT_APP_BACKFILL = "event_app_backfill",
44
- EVENT_GLOBAL_BACKFILL = "event_global_backfill",
45
- EVENT_INSTALLATION_BACKFILL = "event_installation_backfill",
46
- GLOBAL_INFO_SYNC_USERS = "global_info_sync_users",
47
- TABLE_SETTINGS_LINKS_TO_ACTIONS = "table_settings_links_to_actions",
48
- // increment this number to re-activate this migration
49
- SYNC_QUOTAS = "sync_quotas_1",
50
- }
51
-
52
- export interface MigrationDefinition {
53
- type: MigrationType
54
- name: MigrationName
55
- }
@@ -1,19 +0,0 @@
1
- export enum PermissionLevel {
2
- READ = "read",
3
- WRITE = "write",
4
- EXECUTE = "execute",
5
- ADMIN = "admin",
6
- }
7
-
8
- // these are the global types, that govern the underlying default behaviour
9
- export enum PermissionType {
10
- APP = "app",
11
- TABLE = "table",
12
- USER = "user",
13
- AUTOMATION = "automation",
14
- WEBHOOK = "webhook",
15
- BUILDER = "builder",
16
- GLOBAL_BUILDER = "globalBuilder",
17
- VIEW = "view",
18
- QUERY = "query",
19
- }