@budibase/server 2.7.25-alpha.2 → 2.7.25-alpha.3

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/server",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.7.25-alpha.2",
4
+ "version": "2.7.25-alpha.3",
5
5
  "description": "Budibase Web Server",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -46,12 +46,12 @@
46
46
  "license": "GPL-3.0",
47
47
  "dependencies": {
48
48
  "@apidevtools/swagger-parser": "10.0.3",
49
- "@budibase/backend-core": "2.7.25-alpha.2",
50
- "@budibase/client": "2.7.25-alpha.2",
51
- "@budibase/pro": "2.7.25-alpha.2",
52
- "@budibase/shared-core": "2.7.25-alpha.2",
53
- "@budibase/string-templates": "2.7.25-alpha.2",
54
- "@budibase/types": "2.7.25-alpha.2",
49
+ "@budibase/backend-core": "2.7.25-alpha.3",
50
+ "@budibase/client": "2.7.25-alpha.3",
51
+ "@budibase/pro": "2.7.25-alpha.3",
52
+ "@budibase/shared-core": "2.7.25-alpha.3",
53
+ "@budibase/string-templates": "2.7.25-alpha.3",
54
+ "@budibase/types": "2.7.25-alpha.3",
55
55
  "@bull-board/api": "3.7.0",
56
56
  "@bull-board/koa": "3.9.4",
57
57
  "@elastic/elasticsearch": "7.10.0",
@@ -195,5 +195,5 @@
195
195
  }
196
196
  }
197
197
  },
198
- "gitHead": "0dfab0d8a0f3d612f9e33ca58fa3c5f36b87ddca"
198
+ "gitHead": "1414848c482a1650c4f89e0e933ba5bcba5e79dd"
199
199
  }
@@ -115,7 +115,18 @@ function checkAppName(
115
115
  }
116
116
  }
117
117
 
118
- async function createInstance(appId: string, template: any) {
118
+ interface AppTemplate {
119
+ templateString: string
120
+ useTemplate: string
121
+ file?: {
122
+ type: string
123
+ path: string
124
+ password?: string
125
+ }
126
+ key?: string
127
+ }
128
+
129
+ async function createInstance(appId: string, template: AppTemplate) {
119
130
  const db = context.getAppDB()
120
131
  await db.put({
121
132
  _id: "_design/database",
@@ -240,19 +251,24 @@ export async function fetchAppPackage(ctx: UserCtx) {
240
251
  async function performAppCreate(ctx: UserCtx) {
241
252
  const apps = (await dbCore.getAllApps({ dev: true })) as App[]
242
253
  const name = ctx.request.body.name,
243
- possibleUrl = ctx.request.body.url
254
+ possibleUrl = ctx.request.body.url,
255
+ encryptionPassword = ctx.request.body.encryptionPassword
256
+
244
257
  checkAppName(ctx, apps, name)
245
258
  const url = sdk.applications.getAppUrl({ name, url: possibleUrl })
246
259
  checkAppUrl(ctx, apps, url)
247
260
 
248
261
  const { useTemplate, templateKey, templateString } = ctx.request.body
249
- const instanceConfig: any = {
262
+ const instanceConfig: AppTemplate = {
250
263
  useTemplate,
251
264
  key: templateKey,
252
265
  templateString,
253
266
  }
254
267
  if (ctx.request.files && ctx.request.files.templateFile) {
255
- instanceConfig.file = ctx.request.files.templateFile
268
+ instanceConfig.file = {
269
+ ...(ctx.request.files.templateFile as any),
270
+ password: encryptionPassword,
271
+ }
256
272
  }
257
273
  const tenantId = tenancy.isMultiTenant() ? tenancy.getTenantId() : null
258
274
  const appId = generateDevAppID(generateAppID(tenantId))