Explorar o código

refactor: removed v6 schema, replaced V4-V6 and V4-V5 with V4-V5

Kristian Vos %!s(int64=5) %!d(string=hai) anos
pai
achega
8026baec3c

+ 0 - 416
backend/schemas/accountSchemaV6.js

@@ -1,416 +0,0 @@
-module.exports = {
-	name: "Account",
-	description: "Account schema (experimental, use V5 for normal usecases)",
-	version: 6,
-	fields: [
-		{
-			name: "Name",
-			fieldId: "name",
-			fieldTypes: [
-				{
-					type: "text",
-					fill: true,
-					fieldTypeId: "name"
-				}
-			],
-			minEntries: 1,
-			maxEntries: 1
-		},
-		{
-			name: "Domain",
-			fieldId: "domain",
-			fieldTypes: [
-				{
-					type: "text",
-					fill: true,
-					fieldTypeId: "domain",
-					autosuggestGroup: "domain"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "App",
-			fieldId: "newapp",
-			fieldTypes: [
-				{
-					type: "select",
-					options: [
-						{
-							value: "android",
-							text: "Android"
-						},
-						{
-							value: "ios",
-							text: "iOS"
-						},
-						{
-							value: "windows",
-							text: "Windows"
-						}
-					],
-					fieldTypeId: "newappType"
-				},
-				{
-					type: "text",
-					fill: true,
-					fieldTypeId: "newappName"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Account exists",
-			fieldId: "accountExists",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "accountExists"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "E-mail",
-			fieldId: "newemail",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "newemail",
-					fill: true,
-					autosuggestGroup: "email"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Username",
-			fieldId: "username",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "username",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Login name",
-			fieldId: "loginName",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "loginName",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Category",
-			fieldId: "category",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "category",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Uses password",
-			fieldId: "newusesPassword",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "newusesPassword"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Password last changed",
-			fieldId: "passwordLastChanged",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "passwordLastChanged",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "2FA possible",
-			fieldId: "newtwofaPossible",
-			fieldTypes: [
-				{
-					type: "select",
-					options: [
-						{
-							value: "otp",
-							text: "OTP"
-						},
-						{
-							value: "sms",
-							text: "SMS"
-						}
-					],
-					fieldTypeId: "newtwofaPossibleType",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "2FA used",
-			fieldId: "twofaUsed",
-			fieldTypes: [
-				{
-					type: "select",
-					options: [
-						{
-							value: "otp",
-							text: "OTP"
-						},
-						{
-							value: "sms",
-							text: "SMS"
-						}
-					],
-					fieldTypeId: "twofaUsedType"
-				},
-				{
-					type: "text",
-					fieldTypeId: "twofaUsedValue",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "2FA recovery method",
-			fieldId: "twofaRecovery",
-			fieldTypes: [
-				{
-					type: "select",
-					options: [
-						{
-							value: "backupCodes",
-							text: "Backup codes"
-						}
-					],
-					fieldTypeId: "twofaRecoveryMethod"
-				},
-				{
-					type: "text",
-					fieldTypeId: "twofaRecoveryValue",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Login service",
-			fieldId: "loginService",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "loginService",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Service linked",
-			fieldId: "serviceLinked",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "serviceLinked",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Uses security questions",
-			fieldId: "usesSecurityQuestions",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "usesSecurityQuestions",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Recovery e-mail",
-			fieldId: "recoveryEmail",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "recoveryEmail",
-					fill: true,
-					autosuggestGroup: "email"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Recovery phone number",
-			fieldId: "recoveryPhoneNumber",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "recoveryPhoneNumber",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 10
-		},
-		{
-			name: "Comments",
-			fieldId: "comments",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "comments",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "In 1password",
-			fieldId: "in1password",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "in1password"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Deleted",
-			fieldId: "deleted",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "deleted"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Deleted at",
-			fieldId: "newdeletedAt",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "newdeletedAt",
-					fill: true
-				}
-			],
-			minEntries: 2,
-			maxEntries: 3
-		},
-		{
-			name: "Service accessible",
-			fieldId: "serviceAccessible",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "serviceAccessible"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Requested deletion",
-			fieldId: "requestedDeletion",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "requestedDeletion"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Requested deletion at",
-			fieldId: "requestedDeletionAt",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "requestedDeletionAt",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "To delete",
-			fieldId: "toDelete",
-			fieldTypes: [
-				{
-					type: "checkbox",
-					fieldTypeId: "toDelete"
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		},
-		{
-			name: "Created at",
-			fieldId: "createdAt",
-			fieldTypes: [
-				{
-					type: "text",
-					fieldTypeId: "newcreatedAt",
-					fill: true
-				}
-			],
-			minEntries: 0,
-			maxEntries: 1
-		}
-	],
-	dependencies: {
-		"twofaUsed": {
-			eval: "{fields}.newtwofaPossible.length > 0",
-			fieldId: "newtwofaPossible"
-		},
-		"twofaRecovery": {
-			eval: "{fields}.twofaUsed.length > 0",
-			fieldId: "twofaUsed"
-		}
-	}
-};

+ 1 - 1
backend/schemas/convertV4toV6.js → backend/schemas/convertV4toV5.js

@@ -1,6 +1,6 @@
 module.exports = {
 	versionFrom: 4,
-	versionTo: 6,
+	versionTo: 5,
 	changes: {
 		"app+appType": "newapp+newappType",
 		"app+appName": "newapp+newappName",

+ 0 - 13
backend/schemas/convertV5toV6.js

@@ -1,13 +0,0 @@
-module.exports = {
-	versionFrom: 5,
-	versionTo: 6,
-	changes: {
-		"app+appType": "newapp+newappType",
-		"app+appName": "newapp+newappName",
-		"email+email": "newemail+newemail",
-		"usesPassword+usesPassword": "newusesPassword+newusesPassword",
-		"twofaPossible+twofaPossibleType": "newtwofaPossible+newtwofaPossibleType",
-		"deletedAt+deletedAt": "newdeletedAt+newdeletedAt",
-		"createdAt+createdAt": "createdAt+newcreatedAt"
-	}
-}