Skip to content

Commit

Permalink
add system model 114. adjust code generator to avoid reformatting.
Browse files Browse the repository at this point in the history
We still have to rerun rustfmt manually because it's not possible to
disable it partially on stable.
  • Loading branch information
charlag committed Nov 25, 2024
1 parent 2a3544e commit 5b64a54
Show file tree
Hide file tree
Showing 49 changed files with 17,729 additions and 17,664 deletions.
13 changes: 7 additions & 6 deletions buildSrc/RustGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ pub struct ${typeName} {\n`

buf += "}"
buf += `
impl Entity for ${typeName} {
fn type_ref() -> TypeRef {
TypeRef {
app: "${modelName}",
type_: "${typeName}",
}
}
}
`
}`

return buf + "\n\n"
return buf
}

export function generateRustServiceDefinition(appName, appVersion, services) {
Expand Down Expand Up @@ -134,7 +134,7 @@ crate::service_impl!(declare, ${s.name}, "${appName}/${s.name.toLowerCase()}", $
return serviceDefinition
})
.join("\n")
return Array.from(imports).join("\n") + code
return "// @generated\n" + Array.from(imports).join("\n") + code
}

/**
Expand All @@ -143,9 +143,10 @@ crate::service_impl!(declare, ${s.name}, "${appName}/${s.name.toLowerCase()}", $
*/
export function combineRustTypes(types) {
if (types.length === 0) return "\n"
return `#![allow(non_snake_case, unused_imports)]
use crate::*;
return `// @generated
#![allow(non_snake_case, unused_imports)]
use super::super::*;
use crate::*;
use serde::{Deserialize, Serialize};
${types.join("\n\n")}
Expand Down
10 changes: 10 additions & 0 deletions schemas/sys.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,16 @@
"info": "RemoveAssociation CustomerServerProperties/whitelistedDomains."
}
]
},
{
"version": 114,
"changes": [
{
"name": "AddValue",
"sourceType": "PlanConfiguration",
"info": "AddValue PlanConfiguration/unlimitedLabels/2494."
}
]
}
]
}
2 changes: 1 addition & 1 deletion src/common/api/entities/accounting/ModelInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ const modelInfo = {
version: 7,
compatibleSince: 0,
}

export default modelInfo
4 changes: 2 additions & 2 deletions src/common/api/entities/accounting/Services.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import {CustomerAccountReturnTypeRef} from "./TypeRefs.js"
import { CustomerAccountReturnTypeRef } from "./TypeRefs.js"

export const CustomerAccountService = Object.freeze({
app: "accounting",
name: "CustomerAccountService",
get: {data: null, return: CustomerAccountReturnTypeRef},
get: { data: null, return: CustomerAccountReturnTypeRef },
post: null,
put: null,
delete: null,
Expand Down
276 changes: 138 additions & 138 deletions src/common/api/entities/accounting/TypeModels.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,142 +6,142 @@

/** @type {any} */
export const typeModels = {
"CustomerAccountPosting": {
"name": "CustomerAccountPosting",
"since": 3,
"type": "AGGREGATED_TYPE",
"id": 79,
"rootId": "CmFjY291bnRpbmcATw",
"versioned": false,
"encrypted": false,
"values": {
"_id": {
"final": true,
"name": "_id",
"id": 80,
"since": 3,
"type": "CustomId",
"cardinality": "One",
"encrypted": false
},
"amount": {
"final": true,
"name": "amount",
"id": 84,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"invoiceNumber": {
"final": true,
"name": "invoiceNumber",
"id": 83,
"since": 3,
"type": "String",
"cardinality": "ZeroOrOne",
"encrypted": true
},
"type": {
"final": true,
"name": "type",
"id": 81,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"valueDate": {
"final": true,
"name": "valueDate",
"id": 82,
"since": 3,
"type": "Date",
"cardinality": "One",
"encrypted": true
}
},
"associations": {},
"app": "accounting",
"version": "7"
},
"CustomerAccountReturn": {
"name": "CustomerAccountReturn",
"since": 3,
"type": "DATA_TRANSFER_TYPE",
"id": 86,
"rootId": "CmFjY291bnRpbmcAVg",
"versioned": false,
"encrypted": true,
"values": {
"_format": {
"final": false,
"name": "_format",
"id": 87,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": false
},
"_ownerGroup": {
"final": true,
"name": "_ownerGroup",
"id": 88,
"since": 3,
"type": "GeneratedId",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"_ownerPublicEncSessionKey": {
"final": true,
"name": "_ownerPublicEncSessionKey",
"id": 89,
"since": 3,
"type": "Bytes",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"_publicCryptoProtocolVersion": {
"final": true,
"name": "_publicCryptoProtocolVersion",
"id": 96,
"since": 7,
"type": "Number",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"balance": {
"final": true,
"name": "balance",
"id": 94,
"since": 5,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"outstandingBookingsPrice": {
"final": false,
"name": "outstandingBookingsPrice",
"id": 92,
"since": 4,
"type": "Number",
"cardinality": "One",
"encrypted": false
}
},
"associations": {
"postings": {
"final": false,
"name": "postings",
"id": 90,
"since": 3,
"type": "AGGREGATION",
"cardinality": "Any",
"refType": "CustomerAccountPosting",
"dependency": null
}
},
"app": "accounting",
"version": "7"
}
"CustomerAccountPosting": {
"name": "CustomerAccountPosting",
"since": 3,
"type": "AGGREGATED_TYPE",
"id": 79,
"rootId": "CmFjY291bnRpbmcATw",
"versioned": false,
"encrypted": false,
"values": {
"_id": {
"final": true,
"name": "_id",
"id": 80,
"since": 3,
"type": "CustomId",
"cardinality": "One",
"encrypted": false
},
"amount": {
"final": true,
"name": "amount",
"id": 84,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"invoiceNumber": {
"final": true,
"name": "invoiceNumber",
"id": 83,
"since": 3,
"type": "String",
"cardinality": "ZeroOrOne",
"encrypted": true
},
"type": {
"final": true,
"name": "type",
"id": 81,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"valueDate": {
"final": true,
"name": "valueDate",
"id": 82,
"since": 3,
"type": "Date",
"cardinality": "One",
"encrypted": true
}
},
"associations": {},
"app": "accounting",
"version": "7"
},
"CustomerAccountReturn": {
"name": "CustomerAccountReturn",
"since": 3,
"type": "DATA_TRANSFER_TYPE",
"id": 86,
"rootId": "CmFjY291bnRpbmcAVg",
"versioned": false,
"encrypted": true,
"values": {
"_format": {
"final": false,
"name": "_format",
"id": 87,
"since": 3,
"type": "Number",
"cardinality": "One",
"encrypted": false
},
"_ownerGroup": {
"final": true,
"name": "_ownerGroup",
"id": 88,
"since": 3,
"type": "GeneratedId",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"_ownerPublicEncSessionKey": {
"final": true,
"name": "_ownerPublicEncSessionKey",
"id": 89,
"since": 3,
"type": "Bytes",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"_publicCryptoProtocolVersion": {
"final": true,
"name": "_publicCryptoProtocolVersion",
"id": 96,
"since": 7,
"type": "Number",
"cardinality": "ZeroOrOne",
"encrypted": false
},
"balance": {
"final": true,
"name": "balance",
"id": 94,
"since": 5,
"type": "Number",
"cardinality": "One",
"encrypted": true
},
"outstandingBookingsPrice": {
"final": false,
"name": "outstandingBookingsPrice",
"id": 92,
"since": 4,
"type": "Number",
"cardinality": "One",
"encrypted": false
}
},
"associations": {
"postings": {
"final": false,
"name": "postings",
"id": 90,
"since": 3,
"type": "AGGREGATION",
"cardinality": "Any",
"refType": "CustomerAccountPosting",
"dependency": null
}
},
"app": "accounting",
"version": "7"
}
}
4 changes: 2 additions & 2 deletions src/common/api/entities/accounting/TypeRefs.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { create, Stripped, StrippedEntity } from "../../common/utils/EntityUtils.js"
import {TypeRef} from "@tutao/tutanota-utils"
import {typeModels} from "./TypeModels.js"
import { TypeRef } from "@tutao/tutanota-utils"
import { typeModels } from "./TypeModels.js"


export const CustomerAccountPostingTypeRef: TypeRef<CustomerAccountPosting> = new TypeRef("accounting", "CustomerAccountPosting")
Expand Down
2 changes: 1 addition & 1 deletion src/common/api/entities/base/ModelInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ const modelInfo = {
version: 1,
compatibleSince: 0,
}

export default modelInfo
Loading

0 comments on commit 5b64a54

Please sign in to comment.