import base from "./base"; const { field, required } = base; const appIcon = { type: "object", properties: { type: { type: "string", enum: ["cdn"] }, filename: { type: "string" }, url: { type: "string" }, size: { type: "string" }, }, required: ["type", "url", "size"], }; module.exports = { type: "object", properties: { ...field, appName: { type: "string", maxLength: 100, pattern: "^([a-z]|[0-9])[a-z0-9]?", }, annotations: { type: "object", }, supportedPlatform: { type: "array", items: { type: "string", enum: ["DESKTOP", "MOBILE"] }, }, universalId: { type: "string" }, appEngine: { type: "string", enum: [ "SAAS-OEM-APP", "WEB", "NATIVE", "TUYA-MINI-PROGRAM", "WX-MINI-PROGRAM", ], }, dependencies: { type: "array", items: { type: "string" } }, entries: { type: "array", items: { type: "object", properties: { type: { type: "string", enum: ["QuickEntry", "Widget", "Menu"] }, name: { type: "string" }, path: { type: "string" }, code: { type: "string" }, appIcon, ratio: { type: "number", minimum: 0.5, maximum: 2, exclusiveMaximum: true, }, }, required: ["type", "name", "path", "code"], }, }, appIcon, }, required: [...required, "appName", "appEngine"], };