@contember/client-content-generator 2.0.1 → 2.1.0-alpha.2
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/dist/development/src/EntityTypeSchemaGenerator.cjs +29 -24
- package/dist/development/src/EntityTypeSchemaGenerator.cjs.map +1 -1
- package/dist/development/src/EntityTypeSchemaGenerator.js +29 -24
- package/dist/development/src/EntityTypeSchemaGenerator.js.map +1 -1
- package/dist/production/src/EntityTypeSchemaGenerator.cjs +29 -24
- package/dist/production/src/EntityTypeSchemaGenerator.cjs.map +1 -1
- package/dist/production/src/EntityTypeSchemaGenerator.js +29 -24
- package/dist/production/src/EntityTypeSchemaGenerator.js.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dist/types/utils.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/EntityTypeSchemaGenerator.ts +29 -24
|
@@ -129,30 +129,35 @@ const uniqueType = (model, entity, field) => {
|
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
131
|
const columnToTsType = (column) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
132
|
+
const baseType = (() => {
|
|
133
|
+
switch (column.type) {
|
|
134
|
+
case schema.Model.ColumnType.Enum:
|
|
135
|
+
return utils.getEnumTypeName(column.columnType);
|
|
136
|
+
case schema.Model.ColumnType.String:
|
|
137
|
+
return "string";
|
|
138
|
+
case schema.Model.ColumnType.Int:
|
|
139
|
+
return "number";
|
|
140
|
+
case schema.Model.ColumnType.Double:
|
|
141
|
+
return "number";
|
|
142
|
+
case schema.Model.ColumnType.Bool:
|
|
143
|
+
return "boolean";
|
|
144
|
+
case schema.Model.ColumnType.DateTime:
|
|
145
|
+
return "string";
|
|
146
|
+
case schema.Model.ColumnType.Time:
|
|
147
|
+
return "string";
|
|
148
|
+
case schema.Model.ColumnType.Date:
|
|
149
|
+
return "string";
|
|
150
|
+
case schema.Model.ColumnType.Json:
|
|
151
|
+
return "JSONValue";
|
|
152
|
+
case schema.Model.ColumnType.Uuid:
|
|
153
|
+
return "string";
|
|
154
|
+
default:
|
|
155
|
+
((_) => {
|
|
156
|
+
throw new Error(`Unknown type ${_}`);
|
|
157
|
+
})(column.type);
|
|
158
|
+
}
|
|
159
|
+
})();
|
|
160
|
+
return column.list ? `readonly ${baseType}[]` : baseType;
|
|
156
161
|
};
|
|
157
162
|
const getFieldsForUniqueWhere = (schema2, entity) => {
|
|
158
163
|
const relations = Object.values(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypeSchemaGenerator.cjs","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tswitch (column.type) {\n\t\tcase Model.ColumnType.Enum:\n\t\t\treturn getEnumTypeName(column.columnType)\n\t\tcase Model.ColumnType.String:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Int:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Double:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Bool:\n\t\t\treturn 'boolean'\n\t\tcase Model.ColumnType.DateTime:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Date:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Json:\n\t\t\treturn 'JSONValue'\n\t\tcase Model.ColumnType.Uuid:\n\t\t\treturn 'string'\n\t\tdefault:\n\t\t\t((_: never) => {\n\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t})(column.type)\n\t}\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["getEnumTypeName","acceptEveryFieldVisitor","Model","entity","acceptFieldVisitor","schema"],"mappings":";;;;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiBA,MAAgB,gBAAA,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,cAAQ,IAAK,OAAO,IAAI,KAAK,OAAO,IAAI;AAAA;AAAA,IAAA;AAEjC,YAAA;AACA,YAAA;AAAA;AACA,YAAA;AACA,YAAA;AACD,WAAA;AAAA,EAAA;AAAA,EAGA,uBAAuB,OAAqB,QAA8B;AAC7E,QAAA,OAAO,eAAe,OAAO,IAAI;AAAA;AAC7B,YAAA,aAAe,OAAO,OAAO;AAC7B,YAAA;AACA,YAAA,KAAK,mBAAmB,OAAO,MAAM;AAC7C,QAAI,cAAc;AAClB,QAAI,aAAa;AACjB,QAAI,cAAc;AAClBC,gBAAA,wBAAwB,OAAO,QAAQ;AAAA,MACtC,cAAc,CAAO,QAAA;AACL,uBAAA,KAAO,IAAI,SAAS,IAAI,KAAK,IAAI,aAAa,IAAI,GAAG,IAAI,gBAAgB,SAASC,OAAA,MAAM,aAAa,aAAa,KAAK,IAAI,eAAe,IAAI,OAAO,EAAE;AAAA;AAAA,MACvK;AAAA,MACA,aAAa,CAA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U;AAAA,IACzC,KAAKE,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR;AACC,OAAC,CAAC,MAAa;AACd,cAAM,IAAI,MAAM,gBAAgB,CAAC,EAAE;AAAA,MAAA,GACjC,OAAO,IAAI;AAAA,EAAA;AAEjB;AAEA,MAAM,0BAA0B,CAACG,SAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxBJ,YAAA,wBAA8CI,SAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;;"}
|
|
1
|
+
{"version":3,"file":"EntityTypeSchemaGenerator.cjs","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tconst baseType = (() => {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\treturn getEnumTypeName(column.columnType)\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn 'boolean'\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Time:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn 'JSONValue'\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn 'string'\n\t\t\tdefault:\n\t\t\t\t((_: never) => {\n\t\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t\t})(column.type)\n\t\t}\n\t})()\n\treturn column.list ? `readonly ${baseType}[]` : baseType\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["getEnumTypeName","acceptEveryFieldVisitor","Model","entity","acceptFieldVisitor","schema"],"mappings":";;;;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiBA,MAAgB,gBAAA,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAu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gBAAgB,CAAC,EAAE;AAAA,QAAA,GACjC,OAAO,IAAI;AAAA,IAAA;AAAA,EAChB,GACE;AACH,SAAO,OAAO,OAAO,YAAY,QAAQ,OAAO;AACjD;AAEA,MAAM,0BAA0B,CAACG,SAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxBJ,YAAA,wBAA8CI,SAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;;"}
|
|
@@ -127,30 +127,35 @@ const uniqueType = (model, entity, field) => {
|
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
129
|
const columnToTsType = (column) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
130
|
+
const baseType = (() => {
|
|
131
|
+
switch (column.type) {
|
|
132
|
+
case Model.ColumnType.Enum:
|
|
133
|
+
return getEnumTypeName(column.columnType);
|
|
134
|
+
case Model.ColumnType.String:
|
|
135
|
+
return "string";
|
|
136
|
+
case Model.ColumnType.Int:
|
|
137
|
+
return "number";
|
|
138
|
+
case Model.ColumnType.Double:
|
|
139
|
+
return "number";
|
|
140
|
+
case Model.ColumnType.Bool:
|
|
141
|
+
return "boolean";
|
|
142
|
+
case Model.ColumnType.DateTime:
|
|
143
|
+
return "string";
|
|
144
|
+
case Model.ColumnType.Time:
|
|
145
|
+
return "string";
|
|
146
|
+
case Model.ColumnType.Date:
|
|
147
|
+
return "string";
|
|
148
|
+
case Model.ColumnType.Json:
|
|
149
|
+
return "JSONValue";
|
|
150
|
+
case Model.ColumnType.Uuid:
|
|
151
|
+
return "string";
|
|
152
|
+
default:
|
|
153
|
+
((_) => {
|
|
154
|
+
throw new Error(`Unknown type ${_}`);
|
|
155
|
+
})(column.type);
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
return column.list ? `readonly ${baseType}[]` : baseType;
|
|
154
159
|
};
|
|
155
160
|
const getFieldsForUniqueWhere = (schema, entity) => {
|
|
156
161
|
const relations = Object.values(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypeSchemaGenerator.js","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tswitch (column.type) {\n\t\tcase Model.ColumnType.Enum:\n\t\t\treturn getEnumTypeName(column.columnType)\n\t\tcase Model.ColumnType.String:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Int:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Double:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Bool:\n\t\t\treturn 'boolean'\n\t\tcase Model.ColumnType.DateTime:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Date:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Json:\n\t\t\treturn 'JSONValue'\n\t\tcase Model.ColumnType.Uuid:\n\t\t\treturn 'string'\n\t\tdefault:\n\t\t\t((_: never) => {\n\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t})(column.type)\n\t}\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["entity"],"mappings":";;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiB,gBAAgB,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,cAAQ,IAAK,OAAO,IAAI,KAAK,OAAO,IAAI;AAAA;AAAA,IAAA;AAEjC,YAAA;AACA,YAAA;AAAA;AACA,YAAA;AACA,YAAA;AACD,WAAA;AAAA,EAAA;AAAA,EAGA,uBAAuB,OAAqB,QAA8B;AAC7E,QAAA,OAAO,eAAe,OAAO,IAAI;AAAA;AAC7B,YAAA,aAAe,OAAO,OAAO;AAC7B,YAAA;AACA,YAAA,KAAK,mBAAmB,OAAO,MAAM;AAC7C,QAAI,cAAc;AAClB,QAAI,aAAa;AACjB,QAAI,cAAc;AAClB,4BAAwB,OAAO,QAAQ;AAAA,MACtC,cAAc,CAAO,QAAA;AACL,uBAAA,KAAO,IAAI,SAAS,IAAI,KAAK,IAAI,aAAa,IAAI,GAAG,IAAI,gBAAgB,SAAS,MAAM,aAAa,aAAa,KAAK,IAAI,e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,WAAW;AACd,aAAA,gBAAgB,OAAO,UAAU;AAAA,IACzC,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR;AACC,OAAC,CAAC,MAAa;AACd,cAAM,IAAI,MAAM,gBAAgB,CAAC,EAAE;AAAA,MAAA,GACjC,OAAO,IAAI;AAAA,EAAA;AAEjB;AAEA,MAAM,0BAA0B,CAAC,QAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxB,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;"}
|
|
1
|
+
{"version":3,"file":"EntityTypeSchemaGenerator.js","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tconst baseType = (() => {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\treturn getEnumTypeName(column.columnType)\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn 'boolean'\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Time:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn 'JSONValue'\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn 'string'\n\t\t\tdefault:\n\t\t\t\t((_: never) => {\n\t\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t\t})(column.type)\n\t\t}\n\t})()\n\treturn column.list ? `readonly ${baseType}[]` : baseType\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["entity"],"mappings":";;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiB,gBAAgB,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAA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Q,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;"}
|
|
@@ -129,30 +129,35 @@ const uniqueType = (model, entity, field) => {
|
|
|
129
129
|
});
|
|
130
130
|
};
|
|
131
131
|
const columnToTsType = (column) => {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
132
|
+
const baseType = (() => {
|
|
133
|
+
switch (column.type) {
|
|
134
|
+
case schema.Model.ColumnType.Enum:
|
|
135
|
+
return utils.getEnumTypeName(column.columnType);
|
|
136
|
+
case schema.Model.ColumnType.String:
|
|
137
|
+
return "string";
|
|
138
|
+
case schema.Model.ColumnType.Int:
|
|
139
|
+
return "number";
|
|
140
|
+
case schema.Model.ColumnType.Double:
|
|
141
|
+
return "number";
|
|
142
|
+
case schema.Model.ColumnType.Bool:
|
|
143
|
+
return "boolean";
|
|
144
|
+
case schema.Model.ColumnType.DateTime:
|
|
145
|
+
return "string";
|
|
146
|
+
case schema.Model.ColumnType.Time:
|
|
147
|
+
return "string";
|
|
148
|
+
case schema.Model.ColumnType.Date:
|
|
149
|
+
return "string";
|
|
150
|
+
case schema.Model.ColumnType.Json:
|
|
151
|
+
return "JSONValue";
|
|
152
|
+
case schema.Model.ColumnType.Uuid:
|
|
153
|
+
return "string";
|
|
154
|
+
default:
|
|
155
|
+
((_) => {
|
|
156
|
+
throw new Error(`Unknown type ${_}`);
|
|
157
|
+
})(column.type);
|
|
158
|
+
}
|
|
159
|
+
})();
|
|
160
|
+
return column.list ? `readonly ${baseType}[]` : baseType;
|
|
156
161
|
};
|
|
157
162
|
const getFieldsForUniqueWhere = (schema2, entity) => {
|
|
158
163
|
const relations = Object.values(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypeSchemaGenerator.cjs","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tswitch (column.type) {\n\t\tcase Model.ColumnType.Enum:\n\t\t\treturn getEnumTypeName(column.columnType)\n\t\tcase Model.ColumnType.String:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Int:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Double:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Bool:\n\t\t\treturn 'boolean'\n\t\tcase Model.ColumnType.DateTime:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Date:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Json:\n\t\t\treturn 'JSONValue'\n\t\tcase Model.ColumnType.Uuid:\n\t\t\treturn 'string'\n\t\tdefault:\n\t\t\t((_: never) => {\n\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t})(column.type)\n\t}\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["getEnumTypeName","acceptEveryFieldVisitor","Model","entity","acceptFieldVisitor","schema"],"mappings":";;;;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiBA,MAAgB,gBAAA,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,cAAQ,IAAK,OAAO,IAAI,KAAK,OAAO,IAAI;AAAA;AAAA,IAAA;AAEjC,YAAA;AACA,YAAA;AAAA;AACA,YAAA;AACA,YAAA;AACD,WAAA;AAAA,EAAA;AAAA,EAGA,uBAAuB,OAAqB,QAA8B;AAC7E,QAAA,OAAO,eAAe,OAAO,IAAI;AAAA;AAC7B,YAAA,aAAe,OAAO,OAAO;AAC7B,YAAA;AACA,YAAA,KAAK,mBAAmB,OAAO,MAAM;AAC7C,QAAI,cAAc;AAClB,QAAI,aAAa;AACjB,QAAI,cAAc;AAClBC,gBAAA,wBAAwB,OAAO,QAAQ;AAAA,MACtC,cAAc,CAAO,QAAA;AACL,uBAAA,KAAO,IAAI,SAAS,IAAI,KAAK,IAAI,aAAa,IAAI,GAAG,IAAI,gBAAgB,SAASC,OAAA,MAAM,aAAa,aAAa,KAAK,IAAI,eAAe,IAAI,OAAO,EAAE;AAAA;AAAA,MACvK;AAAA,MACA,aAAa,CAAO,QAAA;AACnB,sBAAc,KAAO,IAAI,SAAS,IAAI,KAAK,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AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAKA,OAAAA,MAAM,WAAW;AACd,aAAA;AAAA,IACR;AACC,OAAC,CAAC,MAAa;AACd,cAAM,IAAI,MAAM,gBAAgB,CAAC,EAAE;AAAA,MAAA,GACjC,OAAO,IAAI;AAAA,EAAA;AAEjB;AAEA,MAAM,0BAA0B,CAACG,SAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxBJ,YAAA,wBAA8CI,SAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;;"}
|
|
1
|
+
{"version":3,"file":"EntityTypeSchemaGenerator.cjs","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tconst baseType = (() => {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\treturn getEnumTypeName(column.columnType)\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn 'boolean'\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Time:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn 'JSONValue'\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn 'string'\n\t\t\tdefault:\n\t\t\t\t((_: never) => {\n\t\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t\t})(column.type)\n\t\t}\n\t})()\n\treturn column.list ? `readonly ${baseType}[]` : baseType\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["getEnumTypeName","acceptEveryFieldVisitor","Model","entity","acceptFieldVisitor","schema"],"mappings":";;;;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiBA,MAAgB,gBAAA,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;A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AAA,IAAA;AAAA,EAChB,GACE;AACH,SAAO,OAAO,OAAO,YAAY,QAAQ,OAAO;AACjD;AAEA,MAAM,0BAA0B,CAACG,SAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxBJ,YAAA,wBAA8CI,SAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;;"}
|
|
@@ -127,30 +127,35 @@ const uniqueType = (model, entity, field) => {
|
|
|
127
127
|
});
|
|
128
128
|
};
|
|
129
129
|
const columnToTsType = (column) => {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
130
|
+
const baseType = (() => {
|
|
131
|
+
switch (column.type) {
|
|
132
|
+
case Model.ColumnType.Enum:
|
|
133
|
+
return getEnumTypeName(column.columnType);
|
|
134
|
+
case Model.ColumnType.String:
|
|
135
|
+
return "string";
|
|
136
|
+
case Model.ColumnType.Int:
|
|
137
|
+
return "number";
|
|
138
|
+
case Model.ColumnType.Double:
|
|
139
|
+
return "number";
|
|
140
|
+
case Model.ColumnType.Bool:
|
|
141
|
+
return "boolean";
|
|
142
|
+
case Model.ColumnType.DateTime:
|
|
143
|
+
return "string";
|
|
144
|
+
case Model.ColumnType.Time:
|
|
145
|
+
return "string";
|
|
146
|
+
case Model.ColumnType.Date:
|
|
147
|
+
return "string";
|
|
148
|
+
case Model.ColumnType.Json:
|
|
149
|
+
return "JSONValue";
|
|
150
|
+
case Model.ColumnType.Uuid:
|
|
151
|
+
return "string";
|
|
152
|
+
default:
|
|
153
|
+
((_) => {
|
|
154
|
+
throw new Error(`Unknown type ${_}`);
|
|
155
|
+
})(column.type);
|
|
156
|
+
}
|
|
157
|
+
})();
|
|
158
|
+
return column.list ? `readonly ${baseType}[]` : baseType;
|
|
154
159
|
};
|
|
155
160
|
const getFieldsForUniqueWhere = (schema, entity) => {
|
|
156
161
|
const relations = Object.values(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EntityTypeSchemaGenerator.js","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tswitch (column.type) {\n\t\tcase Model.ColumnType.Enum:\n\t\t\treturn getEnumTypeName(column.columnType)\n\t\tcase Model.ColumnType.String:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Int:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Double:\n\t\t\treturn 'number'\n\t\tcase Model.ColumnType.Bool:\n\t\t\treturn 'boolean'\n\t\tcase Model.ColumnType.DateTime:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Date:\n\t\t\treturn 'string'\n\t\tcase Model.ColumnType.Json:\n\t\t\treturn 'JSONValue'\n\t\tcase Model.ColumnType.Uuid:\n\t\t\treturn 'string'\n\t\tdefault:\n\t\t\t((_: never) => {\n\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t})(column.type)\n\t}\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["entity"],"mappings":";;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiB,gBAAgB,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,cAAQ,IAAK,OAAO,IAAI,KAAK,OAAO,IAAI;AAAA;AAAA,IAAA;AAEjC,YAAA;AACA,YAAA;AAAA;AACA,YAAA;AACA,YAAA;AACD,WAAA;AAAA,EAAA;AAAA,EAGA,uBAAuB,OAAqB,QAA8B;AAC7E,QAAA,OAAO,eAAe,OAAO,IAAI;AAAA;AAC7B,YAAA,aAAe,OAAO,OAAO;AAC7B,YAAA;AACA,YAAA,KAAK,mBAAmB,OAAO,MAAM;AAC7C,QAAI,cAAc;AAClB,QAAI,aAAa;AACjB,QAAI,cAAc;AAClB,4BAAwB,OAAO,QAAQ;AAAA,MACtC,cAAc,CAAO,QAAA;AACL,uBAAA,KAAO,IAAI,SAAS,IAAI,KAAK,IAAI,aAAa,IAAI,GAAG,IAAI,gBAAgB,SAAS,MAAM,aAAa,aAAa,KAAK,IAAI,eAAe,IAAI,OAAO,EAAE;AAAA;AAAA,MACvK;AAAA,MACA,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AAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR,KAAK,MAAM,WAAW;AACd,aAAA;AAAA,IACR;AACC,OAAC,CAAC,MAAa;AACd,cAAM,IAAI,MAAM,gBAAgB,CAAC,EAAE;AAAA,MAAA,GACjC,OAAO,IAAI;AAAA,EAAA;AAEjB;AAEA,MAAM,0BAA0B,CAAC,QAAsB,WAAyD;AAC/G,QAAM,YAAY,OAAO;AAAA,IACxB,wBAA8C,QAAQ,QAAQ;AAAA,MAC7D,aAAa,MAAM;AAAA,MACnB,yBAAyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;"}
|
|
1
|
+
{"version":3,"file":"EntityTypeSchemaGenerator.js","sources":["../../../../packages/client-content-generator/src/EntityTypeSchemaGenerator.ts"],"sourcesContent":["import { Model } from '@contember/schema'\nimport { acceptEveryFieldVisitor, acceptFieldVisitor } from '@contember/schema-utils'\n\nimport { getEnumTypeName } from './utils'\n\nexport class EntityTypeSchemaGenerator {\n\tgenerate(model: Model.Schema): string {\n\t\tlet code = ''\n\t\tfor (const enumName of Object.keys(model.enums)) {\n\t\t\tcode += `import type { ${getEnumTypeName(enumName)} } from './enums'\\n`\n\t\t}\n\n\t\tcode += `\nexport type JSONPrimitive = string | number | boolean | null\nexport type JSONValue = JSONPrimitive | JSONObject | JSONArray\nexport type JSONObject = { readonly [K in string]?: JSONValue }\nexport type JSONArray = readonly JSONValue[]\n\n`\n\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += this.generateTypeEntityCode(model, entity)\n\t\t}\n\t\tcode += '\\n'\n\t\tcode += `export type ContemberClientEntities = {\\n`\n\t\tfor (const entity of Object.values(model.entities)) {\n\t\t\tcode += `\\t${entity.name}: ${entity.name}\\n`\n\t\t}\n\t\tcode += '}\\n\\n'\n\t\tcode += `export type ContemberClientSchema = {\\n`\n\t\tcode += '\\tentities: ContemberClientEntities\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate generateTypeEntityCode(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = `export type ${entity.name} <OverRelation extends string | never = never> = {\\n`\n\t\tcode += '\\tname: \\'' + entity.name + '\\'\\n'\n\t\tcode += '\\tunique:\\n'\n\t\tcode += this.formatUniqueFields(model, entity)\n\t\tlet columnsCode = ''\n\t\tlet hasOneCode = ''\n\t\tlet hasManyCode = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitHasMany: ctx => {\n\t\t\t\thasManyCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}${ctx.targetRelation?.type === Model.RelationType.ManyHasOne ? `<'${ctx.targetRelation.name}'>` : ''}\\n`\n\t\t\t},\n\t\t\tvisitHasOne: ctx => {\n\t\t\t\thasOneCode += `\\t\\t${ctx.relation.name}: ${ctx.targetEntity.name}\\n`\n\t\t\t},\n\t\t\tvisitColumn: ctx => {\n\t\t\t\tcolumnsCode += `\\t\\t${ctx.column.name}: ${columnToTsType(ctx.column)}${ctx.column.nullable ? ` | null` : ''}\\n`\n\t\t\t},\n\t\t})\n\n\t\tcode += '\\tcolumns: {\\n'\n\t\tcode += columnsCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasOne: {\\n'\n\t\tcode += hasOneCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasMany: {\\n'\n\t\tcode += hasManyCode\n\t\tcode += '\\t}\\n'\n\t\tcode += '\\thasManyBy: {\\n'\n\t\tcode += this.formatReducedFields(model, entity)\n\t\tcode += '\\t}\\n'\n\t\tcode += '}\\n'\n\t\treturn code\n\t}\n\n\tprivate formatReducedFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tlet code = ''\n\t\tacceptEveryFieldVisitor(model, entity, {\n\t\t\tvisitOneHasMany: ({ entity, relation, targetEntity, targetRelation }) => {\n\t\t\t\tif (!targetRelation) {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tconst uniqueConstraints = getFieldsForUniqueWhere(model, targetEntity)\n\t\t\t\tconst composedUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 2) //todo support all uniques\n\t\t\t\t\t.filter(fields => fields.includes(targetRelation.name))\n\t\t\t\t\t.map(fields => fields.filter(it => it !== targetRelation.name))\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\tconst singleUnique = uniqueConstraints\n\t\t\t\t\t.filter(fields => fields.length === 1 && fields[0] !== targetEntity.primary)\n\t\t\t\t\t.map(fields => fields[0])\n\t\t\t\t\t.filter(it => it !== targetRelation.name)\n\n\t\t\t\t;[...composedUnique, ...singleUnique].forEach(fieldName => {\n\t\t\t\t\tconst capitalizeFirstLetter = (value: string) => {\n\t\t\t\t\t\treturn value.charAt(0).toUpperCase() + value.slice(1)\n\t\t\t\t\t}\n\t\t\t\t\tconst name = `${relation.name}By${capitalizeFirstLetter(fieldName)}`\n\n\t\t\t\t\tconst targetUnique = targetEntity.fields[fieldName]\n\n\t\t\t\t\tcode += `\\t\\t${name}: { entity: ${targetEntity.name}; by: {${fieldName}: ${uniqueType(model, targetEntity, targetUnique)}} }\\n`\n\n\t\t\t\t})\n\t\t\t},\n\t\t\tvisitColumn: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyInverse: () => {\n\t\t\t},\n\t\t\tvisitManyHasManyOwning: () => {\n\t\t\t},\n\t\t\tvisitManyHasOne: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneInverse: () => {\n\t\t\t},\n\t\t\tvisitOneHasOneOwning: () => {\n\t\t\t},\n\t\t})\n\t\treturn code\n\t}\n\n\tprivate formatUniqueFields(model: Model.Schema, entity: Model.Entity): string {\n\t\tconst fields = getFieldsForUniqueWhere(model, entity)\n\t\tlet code = ''\n\t\tfor (const field of fields) {\n\t\t\tcode += '\\t\\t| Omit<{ '\n\t\t\tcode += field.map(it => `${it}: ${uniqueType(model, entity, entity.fields[it])}`).join(', ')\n\t\t\tcode += '}, OverRelation>\\n'\n\t\t}\n\t\treturn code\n\t}\n}\n\n\nconst uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyField): string => {\n\treturn acceptFieldVisitor(model, entity, field, {\n\t\tvisitColumn: ctx => {\n\t\t\treturn columnToTsType(ctx.column)\n\t\t},\n\t\tvisitRelation: ctx => {\n\t\t\treturn ctx.targetEntity.name + `['unique']`\n\t\t},\n\t})\n}\n\n\nconst columnToTsType = (column: Model.AnyColumn): string => {\n\tconst baseType = (() => {\n\t\tswitch (column.type) {\n\t\t\tcase Model.ColumnType.Enum:\n\t\t\t\treturn getEnumTypeName(column.columnType)\n\t\t\tcase Model.ColumnType.String:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Int:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Double:\n\t\t\t\treturn 'number'\n\t\t\tcase Model.ColumnType.Bool:\n\t\t\t\treturn 'boolean'\n\t\t\tcase Model.ColumnType.DateTime:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Time:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Date:\n\t\t\t\treturn 'string'\n\t\t\tcase Model.ColumnType.Json:\n\t\t\t\treturn 'JSONValue'\n\t\t\tcase Model.ColumnType.Uuid:\n\t\t\t\treturn 'string'\n\t\t\tdefault:\n\t\t\t\t((_: never) => {\n\t\t\t\t\tthrow new Error(`Unknown type ${_}`)\n\t\t\t\t})(column.type)\n\t\t}\n\t})()\n\treturn column.list ? `readonly ${baseType}[]` : baseType\n}\n\nconst getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {\n\tconst relations = Object.values(\n\t\tacceptEveryFieldVisitor<undefined | [string]>(schema, entity, {\n\t\t\tvisitColumn: () => undefined,\n\t\t\tvisitManyHasManyInverse: () => undefined,\n\t\t\tvisitManyHasManyOwning: () => undefined,\n\t\t\tvisitOneHasMany: ({ relation }) => [relation.name],\n\t\t\tvisitManyHasOne: () => undefined,\n\t\t\tvisitOneHasOneInverse: ({ relation }) => [relation.name],\n\t\t\tvisitOneHasOneOwning: ({ relation }) => [relation.name],\n\t\t}),\n\t).filter((it): it is [string] => !!it)\n\n\treturn [[entity.primary], ...Object.values(entity.unique).map(it => it.fields), ...relations]\n}\n"],"names":["entity"],"mappings":";;;AAKO,MAAM,0BAA0B;AAAA,EACtC,SAAS,OAA6B;AACrC,QAAI,OAAO;AACX,eAAW,YAAY,OAAO,KAAK,MAAM,KAAK,GAAG;AACxC,cAAA,iBAAiB,gBAAgB,QAAQ,CAAC;AAAA;AAAA,IAAA;AAG3C,YAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AAC3C,cAAA,KAAK,uBAAuB,OAAO,MAAM;AAAA,IAAA;AAE1C,YAAA;AACA,YAAA;AAAA;AACR,eAAW,UAAU,OAAO,OAAO,MAAM,QAAQ,GAAG;AACnD,cAAQ,IAAK,OAAO,IAAI,KAAK,OAAO,IAAI;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AyB,MAAM;AAAA,MAC/B,wBAAwB,MAAM;AAAA,MAC9B,iBAAiB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACjD,iBAAiB,MAAM;AAAA,MACvB,uBAAuB,CAAC,EAAE,SAAe,MAAA,CAAC,SAAS,IAAI;AAAA,MACvD,sBAAsB,CAAC,EAAE,eAAe,CAAC,SAAS,IAAI;AAAA,IACtD,CAAA;AAAA,IACA,OAAO,CAAC,OAAuB,CAAC,CAAC,EAAE;AAErC,SAAO,CAAC,CAAC,OAAO,OAAO,GAAG,GAAG,OAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAA,OAAM,GAAG,MAAM,GAAG,GAAG,SAAS;AAC7F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.string.d.ts","../../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../../../node_modules/typescript/lib/lib.esnext.regexp.d.ts","../../../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../../schema/dist/types/schema/value.d.ts","../../../schema/dist/types/schema/input.d.ts","../../../schema/dist/types/schema/json.d.ts","../../../schema/dist/types/schema/acl.d.ts","../../../schema/dist/types/schema/actions.d.ts","../../../schema/dist/types/schema/actionsPayload.d.ts","../../../schema/dist/types/schema/model.d.ts","../../../schema/dist/types/schema/result.d.ts","../../../schema/dist/types/schema/settings.d.ts","../../../schema/dist/types/schema/validation.d.ts","../../../schema/dist/types/schema/index.d.ts","../../../schema/dist/types/ProjectRole.d.ts","../../../schema/dist/types/index.d.ts","../../src/utils.ts","../../src/EnumTypeSchemaGenerator.ts","../../../typesafe/dist/types/index.d.ts","../../../schema-utils/dist/types/model/modelUtils.d.ts","../../../schema-utils/dist/types/model/resolveDefaultColumnType.d.ts","../../../schema-utils/dist/types/model/NamingConventions.d.ts","../../../schema-utils/dist/types/model/index.d.ts","../../../schema-utils/dist/types/definition-generator/TsDefinitionGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/DefinitionNamingConventions.d.ts","../../../schema-utils/dist/types/definition-generator/AclDefinitionCodeGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/DefinitionCodeGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/index.d.ts","../../../schema-utils/dist/types/lax/schema.d.ts","../../../schema-utils/dist/types/lax/LaxSchemaConverter.d.ts","../../../schema-utils/dist/types/lax/index.d.ts","../../../schema-utils/dist/types/acl/AllowAllPermissionFactory.d.ts","../../../schema-utils/dist/types/acl/PredicateDefinitionProcessor.d.ts","../../../schema-utils/dist/types/acl/schemaUtils.d.ts","../../../schema-utils/dist/types/acl/index.d.ts","../../../schema-utils/dist/types/dataUtils.d.ts","../../../schema-utils/dist/types/validation/errors.d.ts","../../../schema-utils/dist/types/validation/AclValidator.d.ts","../../../schema-utils/dist/types/validation/ModelValidator.d.ts","../../../schema-utils/dist/types/validation/ValidationValidator.d.ts","../../../schema-utils/dist/types/validation/SchemaValidator.d.ts","../../../schema-utils/dist/types/validation/MembershipResolver.d.ts","../../../schema-utils/dist/types/validation/index.d.ts","../../../schema-utils/dist/types/schemaNormalizer.d.ts","../../../schema-utils/dist/types/schemaFilter.d.ts","../../../schema-utils/dist/types/schemaChecksum.d.ts","../../../schema-utils/dist/types/utils/assertNever.d.ts","../../../schema-utils/dist/types/utils/isIt.d.ts","../../../schema-utils/dist/types/utils/deepCompare.d.ts","../../../schema-utils/dist/types/utils/index.d.ts","../../../schema-utils/dist/types/index.d.ts","../../src/EntityTypeSchemaGenerator.ts","../../../graphql-client/dist/types/GraphQlClientRequestOptions.d.ts","../../../graphql-client/dist/types/GraphQlClient.d.ts","../../../graphql-client/dist/types/GraphQlClientError.d.ts","../../../graphql-client/dist/types/index.d.ts","../../../client-content/dist/types/types/Schema.d.ts","../../../client-content/dist/types/types/Input.d.ts","../../../client-content/dist/types/types/Result.d.ts","../../../client-content/dist/types/types/index.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlFragmentSpread.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlInlineFragment.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlField.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlFragment.d.ts","../../../graphql-builder/dist/types/nodes/index.d.ts","../../../graphql-builder/dist/types/GraphQlQueryPrinter.d.ts","../../../graphql-builder/dist/types/index.d.ts","../../../client-content/dist/types/nodes/ContentEntitySelection.d.ts","../../../client-content/dist/types/nodes/ContentOperation.d.ts","../../../client-content/dist/types/nodes/TypedEntitySelection.d.ts","../../../client-content/dist/types/nodes/index.d.ts","../../../client-content/dist/types/ContentClient.d.ts","../../../client-content/dist/types/ContentQueryBuilder.d.ts","../../../client-content/dist/types/TypedContentQueryBuilder.d.ts","../../../client-content/dist/types/utils/mutationFragments.d.ts","../../../client-content/dist/types/index.d.ts","../../src/NameSchemaGenerator.ts","../../src/ContemberClientGenerator.ts","../../src/generate.ts","../../src/index.ts","../../../../node_modules/@types/node/ts5.6/globals.typedarray.d.ts","../../../../node_modules/@types/node/ts5.6/buffer.buffer.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/buffer/index.d.ts","../../../../node_modules/undici-types/header.d.ts","../../../../node_modules/undici-types/readable.d.ts","../../../../node_modules/undici-types/file.d.ts","../../../../node_modules/undici-types/fetch.d.ts","../../../../node_modules/undici-types/formdata.d.ts","../../../../node_modules/undici-types/connector.d.ts","../../../../node_modules/undici-types/client.d.ts","../../../../node_modules/undici-types/errors.d.ts","../../../../node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/undici-types/global-origin.d.ts","../../../../node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/undici-types/pool.d.ts","../../../../node_modules/undici-types/handlers.d.ts","../../../../node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/undici-types/agent.d.ts","../../../../node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/undici-types/mock-client.d.ts","../../../../node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/undici-types/api.d.ts","../../../../node_modules/undici-types/interceptors.d.ts","../../../../node_modules/undici-types/util.d.ts","../../../../node_modules/undici-types/cookies.d.ts","../../../../node_modules/undici-types/patch.d.ts","../../../../node_modules/undici-types/websocket.d.ts","../../../../node_modules/undici-types/eventsource.d.ts","../../../../node_modules/undici-types/filereader.d.ts","../../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/undici-types/content-type.d.ts","../../../../node_modules/undici-types/cache.d.ts","../../../../node_modules/undici-types/index.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/dom-events.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/sea.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/test.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/globals.global.d.ts","../../../../node_modules/@types/node/ts5.6/index.d.ts"],"fileIdsList":[[158,159,201],[158,200,201],[158,201,206,235],[158,201,202,207,213,214,221,232,243],[158,201,202,203,213,221],[158,201,204,244],[158,201,205,206,214,222],[158,201,206,232,240],[158,201,207,209,213,221],[158,200,201,208],[158,201,209,210],[158,201,213],[158,201,211,213],[158,200,201,213],[158,201,213,214,215,232,243],[158,201,213,214,215,228,232,235],[158,198,201,248],[158,201],[158,201,209,213,216,221,232,243],[158,201,213,214,216,217,221,232,240,243],[158,201,216,218,232,240,243],[158,201,213,219],[158,201,220,243,248],[158,201,209,213,221,232],[158,201,222],[158,201,223],[158,200,201,224],[158,159,160,200,201,202,203,204,205,206,207,208,209,210,211,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249],[158,201,226],[158,201,227],[158,201,213,228,229],[158,201,228,230,244,246],[158,201,213,232,233,234,235],[158,201,232,234],[158,201,232,233],[158,201,235],[158,201,236],[158,159,201,232],[158,201,213,238,239],[158,201,238,239],[158,201,206,221,232,240],[158,201,241],[201],[157,158,159,160,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250],[158,201,221,242],[158,201,216,227,243],[158,201,206,244],[158,201,232,245],[158,201,220,246],[158,201,247],[158,201,206,213,215,224,232,243,246,248],[158,201,232,249],[75,76,77,158,201],[78,158,201],[158,170,174,201,243],[158,170,201,232,243],[158,165,201],[158,167,170,201,240,243],[158,201,221,240],[158,201,251],[158,165,201,251],[158,167,170,201,221,243],[158,162,163,166,169,201,213,232,243],[158,170,177,201],[158,162,168,201],[158,170,191,192,201],[158,166,170,201,235,243,251],[158,191,201,251],[158,164,165,201,251],[158,170,201],[158,164,165,166,167,168,169,170,171,172,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,192,193,194,195,196,197,201],[158,170,185,201],[158,170,177,178,201],[158,168,170,178,179,201],[158,169,201],[158,162,165,170,201],[158,170,174,178,179,201],[158,174,201],[158,168,170,173,201,243],[158,162,167,170,177,201],[158,201,232],[158,165,170,191,201,248,251],[79,92,94,128,153,158,201],[79,92,93,127,158,201],[79,92,93,158,201],[79,92,127,152,158,201],[79,154,158,201,215,223],[79,94,128,153,154,158,201],[79,158,201],[132,147,158,201],[92,136,147,158,201],[136,147,149,158,201],[136,147,148,149,150,151,158,201],[92,136,143,158,201],[143,158,201],[136,144,158,201],[144,145,146,158,201],[92,133,158,201],[92,158,201],[133,134,135,158,201],[92,141,158,201],[141,142,158,201],[92,137,138,158,201],[139,158,201],[137,138,139,140,158,201],[129,158,201],[129,130,131,158,201],[108,109,110,158,201],[92,101,158,201],[92,99,101,102,158,201],[92,99,158,201],[100,101,102,103,158,201],[92,95,99,104,107,111,112,119,120,121,122,126,158,201],[92,99,105,158,201],[105,106,158,201],[95,158,201],[96,97,98,158,201],[123,124,125,158,201],[92,113,158,201],[113,114,115,116,117,118,158,201],[90,91,158,201],[81,82,158,201],[82,158,201],[80,81,82,83,84,85,86,87,88,89,158,201],[80,158,201],[81,158,201]],"fileInfos":[{"version":"44e584d4f6444f58791784f1d530875970993129442a847597db702a073ca68c","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"abee51ebffafd50c07d76be5848a34abfe4d791b5745ef1e5648718722fab924","impliedFormat":1},{"version":"9e8ca8ed051c2697578c023d9c29d6df689a083561feba5c14aedee895853999","affectsGlobalScope":true,"impliedFormat":1},{"version":"69e65d976bf166ce4a9e6f6c18f94d2424bf116e90837ace179610dbccad9b42","affectsGlobalScope":true,"impliedFormat":1},{"version":"6920e1448680767498a0b77c6a00a8e77d14d62c3da8967b171f1ddffa3c18e4","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"45d8ccb3dfd57355eb29749919142d4321a0aa4df6acdfc54e30433d7176600a","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true,"impliedFormat":1},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true,"impliedFormat":1},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1a94697425a99354df73d9c8291e2ecd4dddd370aed4023c2d6dee6cccb32666","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3f9fc0ec0b96a9e642f11eda09c0be83a61c7b336977f8b9fdb1e9788e925fe","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"479553e3779be7d4f68e9f40cdb82d038e5ef7592010100410723ceced22a0f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3d7b04b45033f57351c8434f60b6be1ea71a2dfec2d0a0c3c83badbb0e3e693","affectsGlobalScope":true,"impliedFormat":1},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true,"impliedFormat":1},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true,"impliedFormat":1},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true,"impliedFormat":1},{"version":"15c1c3d7b2e46e0025417ed6d5f03f419e57e6751f87925ca19dc88297053fe6","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"9d540251809289a05349b70ab5f4b7b99f922af66ab3c39ba56a475dcf95d5ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"0b11f3ca66aa33124202c80b70cd203219c3d4460cfc165e0707aa9ec710fc53","affectsGlobalScope":true,"impliedFormat":1},{"version":"6a3f5a0129cc80cf439ab71164334d649b47059a4f5afca90282362407d0c87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"36a2e4c9a67439aca5f91bb304611d5ae6e20d420503e96c230cf8fcdc948d94","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"65ff5a0aefd7817a03c1ad04fee85c9cdd3ec415cc3c9efec85d8008d4d5e4ee","impliedFormat":1},{"version":"aea201321e7df78b294c9c39c61503ed81fb73b1b1703240013b557dfa25b016","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},"67070445e9cb6a031953839e5f673d751255409d0ecd2ce8a8bd8f09bb4a07f2","8e86b98b3e0df46d3f83c303661824d1965ddd63e674fc0b6849f7869f5b86f0","b1296831e111197bd9ebd73f0d15ad0fe2e11fcc51a6302edb23ffd93794db36","2a3c0a7b4dd551ceb2f73212408e6ce4f2ee39e937908d091dc36e0bc3ff3816","ec0b1ad8de385d526b4e16c7ab8da4b84c1fb15a680d4c82b0e0b5f70e9f80c5","462c0b72a4911d6356ebbfed5dedd9682edf2bd60bcf6ea025539f1cd8c64bf4","5c3f0890ecc492ada4fa62824b8db132adbf9757e918cdc7421a586474b7cb16","f42116e2e8ad600dc90bdf8ceade9dcf593c35812d8aaba9c03a3f1dbb87330e","0f9bf85206211db137cc12ffeb6c442d5d05a7686859860204f148618832a3cb","dff2fee737ebe5174f549c9f28e114c0cabac4b5fe4e364654465ba528979ba4","ad1f130d5fb49665e218d5366db67ead55593335a2c02733ae5f8466a99def53","466df547af9cf3861658b08baf3ecbd41c0eaad2101378fadfa54ab24db103e6","92404f0f42ffd8d939cf6fb1a911235e931981f94dcab0e85f9ae5faf876ea3c",{"version":"0c233f23fa6aef75de3cd8bb708114545ba1aaf976c1275cc76a4507e9614e02","signature":"a404413d55ace912b644189eebdf890f75a936ad34b6650e1f17f20615be89eb"},{"version":"754f98fb2d9246645d79ce8b7697cafe8173283be94a9f5200048f6645980600","signature":"f0b0d83cf814e2d1f3cbe11a382f307774f4527d4c5c97cb37a9d7d96958ac60"},"5dba60c20c6ba4771fced29dae4f4f3e5b9506b11b07457019d4dab99bccabad","1090a100fefe5c21a36fe36b0c83dd566ac8c3d9b3fa1f2c2733e173c599614c","1208b368dc1c1e92d8fcbd3eac3f37dfea25672dc37134cce620455559e4da96","fb76be343c21f4e9dc23ddbb69f7a4a81dab90e9586c303668081dd3b4e30e58","daa9330eda367a2de8034fe1c11a387f25c1fb9c7b1a694facda6114bb22fef0","6c8f26d28cdb6bd0edc2d9d5b7040654b84776e85b2fb2da9ff5d23de67ff17c","bd25f7cb1c87f89392b2e5c6ed6846c4acc016e959783f1bc2d1c529b804492c","dc0b794be4f93caea87286e4f8a1b9bb1c8f2d6b26f35a3ea9f366b0b13478b6","2fa776928692b8d0cf9363ee7fd815b1539f207c91cae851639623e923174ae7","1120c659d2214c93367b3d93336d28a3ab1a45fccecd0ba3599ea99a20295af3","2d994cd941265041b7ab04efd9f9628a0ddaa7eb3ca13bc53c1f73f0b8954a74","9dfd6d6aa56e7f5ab521b038c35b8c42fbf789abe3316cd917cebc5e9117d7e0","9ac8296db617c4ae910ee4b618bb78bb130cdfca956ad8c4502e8d3283381c99","aa03a6771a194845f7d08c94a5927aaf0b67d0c0c4d9ab06167c1d36eda18f2b","2e3f3ef49948c5ddaa9bc1187af0cefb685b8cc529460264548c434de625f5bc","7777d96bf1dd9d4a21853f1db7f8ac76b362f1534a882692c9fc8f7b3850dcab","8da1c5a41069f9cbcae8690056768f4d315ee9e020d3162fd1703013cf8c0325","34318c640ec76c3a91d0156143c0b97255701612441ad96bf44914a3eef097c8","1ab55d65db2bc181e91481b6ce92a2285eda09ccfea566f047c055d2ff0cb03c","d5bb605f28707fe26e7c87836418abc6fba7679cf5ee99a49ecf532c93846bf9","e9124ac92fb22b3e867d40dc8d9c1d9d1502fa69b3611d05ace7258be72f9777","a29fee10a827a80f5c211a21e5513185349ba264ea8b04a382a451982e23b294","f4fefa0f2c0e1a5587c1d698d5ded77e6c8695ab2eff6c7b28c3d3d18d58f731","3fa52693f21eed67e1bd50be0d25c7055d326580d78ceef9cca0c287e224656e","05ebf96323766ec1a492a055ada17f8e540142335b9467e1f430023c40f4592d","8b9c51e573464bff3b83adf232405f01a87447d1266b1a1a93a02fe3b713b588","8cf3d80aa530218e59750d58f63922099c102514ff34255480cc5ba24099711d","e846789af23154545cd9025760a9d063d1bfed8fd5022aac5874c241d9058864","a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804","2e8b4d5b4a88c5cb82edc4585e7615641f7714676a8d92bf36884dcc7c975f12","c51e163a5110087ff0e59381f117d97fd23d275a80aa9c7bb4c7a58f52a3943a","b7f4d30efff05ede0b6358ded8aedefb29802ed4cf6fbd16e3921f9cf76780ae","3a6e1f99acca4b9d262c1b9ac7931c50c86bb525a6c397c2769d21e08cf5c1dd",{"version":"29306372d317b50f852270690d6ed8026ef371bfb478fd5292ab360f8c0f08b9","signature":"360b9a2f734bdda3c3877cd6e5dd92fae9f3e914cf2c14d935dc8c9cc29ff4ce"},"063a16a89e56dc3a27c4c353ff81f80e4a5074817db8f8989f6d4553df2f3850","8ef2193f6663c97e78c2a1b304b315620665bde3d5ec88cb9e6cdebbeab88291","4d023a0827a63ad5e6b498f92830d79e40e6fd487ed6b7c6fc2528eb9b3c0937","e17fbde86ef68adc663fff12c63cce11175482b3f108afd90fa3c11754afe6c6","e7899ed2786c9741e938d5264867f578606f0939f66a7446404920f7ada404bd","33491243e9e60504ee3d733817b089c90d639dc3f1238a3d6417083e9dd5b683","f289c5204b0819632486cefeec845a20a7a9c769180fb6bede63b0d7f24839d2","feaceef383869ce3addd7d620c89fa6ff1d5753f7b451cffb1e926998df2b5e4","34e5c5b2be8aa1b3f75ccd21529ae8b9163f510dbdabae4caae3fec3010cc33b","45fb3525f5c652416e54f91bd8378464d41e22b0ccc108de7db918cf8e92ffd3","e2402a646d4471b0985495b6bfca6c9c731d335195bf206e8c982d8ca362692f","08d34fcbf615950f6d3dd6858437159f0c0af08d5af645ec415ebfeaeacf3bd0","13ce162c8088b92a985e41a2ddf61cbb191101c280214a74dd9e8d2fd3c9c905","d2689735d2498972d6f02fbaff989b1fa500b5a140af7e7c08a15fbc36c1d3d3","4b47e095287cc1351b5fa9c5112d1d2d255bd8916ce76347225837b244e97ed5","496eb121a6f0ff31e1c54ddfcf49587483da30e34b326bbe95339cf2db084091","06c1e22ce1921cfd383c800f9e191972c5dfaca8996cca54d85c4b4cb41db49d","d3c47fc4a9c87d314c5556fc002f3413a4d812152ddeabbf00c9e2deaa93b387","6c7327831239ec38e57c18eb15c5b191aa258ada0528de8dc93092efcba20896","3c4de8d194c64b484827151ff14582884166268c345cbb13f9c19e4be3912f54","62ca877d3c090576b3ca1cd3e576c931eaedefc3af1b5ef405e41fd22c8b2955","5e8c7ad4619cc15007aa5bc3f4e1a30cb01540c14beaa609fb8d17d21acaceba","016e695348eb662b9adead21973e3da689bbff9c65811491644e2ed594fca800","1702404293385fb18761a3cf716b3c2888c6fa95d3ef96bc8e4e8f5a6e679689",{"version":"3ea13e244f295a9545cc6cfb98f0a8ad82c9db063b549e10b3a256b1c7b1713b","signature":"d5efb5060898d1f076715772c3480d4ce727be55e2167fb299bd6556ae70eeae"},{"version":"6eea1cd7302667f74cf05794d56316644f2a94156c43f39ab56940c2ed9ac50c","signature":"64fc8e10187e3facc023e41fafcd45a40b767a607e41270184e0585efe894d81"},{"version":"2b0504be8aa9ecd9bbf990abc07e4ce2eda3abf248e0451a5c3d94bbcd4b9b07","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},{"version":"675668049a0b4175aa1ad4fd80c751267db0053152755a7fac646eef592c3882","signature":"5cb53013b1adc504c16bed8523675d1efdeab8e7b22cd9a880d1d074cd5357e4"},{"version":"613b21ccdf3be6329d56e6caa13b258c842edf8377be7bc9f014ed14cdcfc308","affectsGlobalScope":true,"impliedFormat":1},{"version":"2d1319e6b5d0efd8c5eae07eb864a00102151e8b9afddd2d45db52e9aae002c4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2db0dd3aaa2ed285950273ce96ae8a450b45423aa9da2d10e194570f1233fa6b","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"4eedea23b8a843ec0fd51a384fb6b9fe1bc89198f713d0465c2c8392a9d51271","affectsGlobalScope":true,"impliedFormat":1},{"version":"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36","impliedFormat":1},{"version":"d674383111e06b6741c4ad2db962131b5b0fa4d0294b998566c635e86195a453","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"c521f961c1606c94dc831992e659f426b6def6e2e6e327ee25d3c642eb393f95","affectsGlobalScope":true,"impliedFormat":1},{"version":"b0c0d1d13be149f790a75b381b413490f98558649428bb916fd2d71a3f47a134","impliedFormat":1},{"version":"3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","impliedFormat":1},{"version":"5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","impliedFormat":1},{"version":"e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"f0de0233242682db9ac13efa0ddbb456a41abe6f291211b40ba3aa766b03e9b3","affectsGlobalScope":true,"impliedFormat":1},{"version":"596572d40c1f13d8b57920d6d1a77c5ec6fe4952dc157f416f04a801cd3e2678","impliedFormat":1},{"version":"ad23fd126ff06e72728dd7bfc84326a8ca8cec2b9d2dac0193d42a777df0e7d8","impliedFormat":1},{"version":"a55fd4d49da86d2cc19de575beb1515184e55f5f3165e1482ff02fd99f900b5c","impliedFormat":1},{"version":"93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e","impliedFormat":1},{"version":"7edec695cdb707c7146ac34c44ca364469c7ea504344b3206c686e79f61b61a2","affectsGlobalScope":true,"impliedFormat":1},{"version":"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"d1b1295af3667779be43eb6d4fbaa342e656aa2c4b77a4ad3cf42ec55baeea00","impliedFormat":1},{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"a20f1e119615bf7632729fd89b6c0b5ffdc2df3b512d6304146294528e3ebe19","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","impliedFormat":1},{"version":"dd9492e12a57068f08d70cb5eb5ceb39fa5bcf23be01af574270aeee95b982af","impliedFormat":1},{"version":"e432b0e3761ca9ba734bdd41e19a75fec1454ca8e9769bfdf8b31011854cf06a","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"78955c9259da94920609be3e589fc9253268b3fffa822e1e31d28ee2ce0b8a74","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"73aa178e8fb1449ef3666093d8dca25f96302a80ee45f8ff027df8e4792bf9fd","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"fdedf82878e4c744bc2a1c1e802ae407d63474da51f14a54babe039018e53d8f","affectsGlobalScope":true,"impliedFormat":1},{"version":"08353b04a3501d84fc8d7b49de99f6c1cc26026e6d9d697a18315f3bfe92ed03","affectsGlobalScope":true,"impliedFormat":1},{"version":"578d8bb6dcb2a1c03c4c3f8eb71abc9677e1a5c788b7f24848e3138ce17f3400","impliedFormat":1},{"version":"4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"710ad93f8de29dc15e5892aa735e72348b62f40a6d1220f2849837d332f92885","affectsGlobalScope":true,"impliedFormat":1},{"version":"1f1da5d682cdb628890e4a8578fb9e8ab332e6a1a4b3a13fce08b7b4d45d192a","affectsGlobalScope":true,"impliedFormat":1},{"version":"efeedd8bbc5c0d53e760d8b120a010470722982e6ae14de8d1bcff66ebc2ae71","impliedFormat":1},{"version":"b718a94332858862943630649a310d6f8e9a09f86ae7215d8554e75bbbfd7817","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"483bb10b755f3572526fd76d9481221e8dc30568edcc1a9cc73479d8874bd16d","impliedFormat":1}],"root":[93,94,128,[153,156]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[159,1],[160,1],[200,2],[201,3],[202,4],[203,5],[204,6],[205,7],[206,8],[207,9],[208,10],[209,11],[210,11],[212,12],[211,13],[213,14],[214,15],[215,16],[199,17],[250,18],[216,19],[217,20],[218,21],[219,22],[220,23],[221,24],[222,25],[223,26],[224,27],[225,28],[226,29],[227,30],[228,31],[229,31],[230,32],[231,18],[232,33],[234,34],[233,35],[235,36],[236,37],[237,38],[238,39],[239,40],[240,41],[241,42],[158,43],[157,18],[251,44],[242,45],[243,46],[244,47],[245,48],[246,49],[247,50],[248,51],[249,52],[77,18],[75,18],[78,53],[79,54],[161,18],[76,18],[73,18],[74,18],[12,18],[13,18],[15,18],[14,18],[2,18],[16,18],[17,18],[18,18],[19,18],[20,18],[21,18],[22,18],[23,18],[3,18],[24,18],[4,18],[25,18],[29,18],[26,18],[27,18],[28,18],[30,18],[31,18],[32,18],[5,18],[33,18],[34,18],[35,18],[36,18],[6,18],[40,18],[37,18],[38,18],[39,18],[41,18],[7,18],[42,18],[47,18],[48,18],[43,18],[44,18],[45,18],[46,18],[8,18],[52,18],[49,18],[50,18],[51,18],[53,18],[9,18],[54,18],[55,18],[56,18],[59,18],[57,18],[58,18],[60,18],[61,18],[10,18],[62,18],[1,18],[63,18],[64,18],[11,18],[69,18],[66,18],[65,18],[72,18],[70,18],[68,18],[71,18],[67,18],[177,55],[187,56],[176,55],[197,57],[168,58],[167,59],[196,60],[190,61],[195,62],[170,63],[184,64],[169,65],[193,66],[165,67],[164,60],[194,68],[166,69],[171,70],[172,18],[175,70],[162,18],[198,71],[188,72],[179,73],[180,74],[182,75],[178,76],[181,77],[191,60],[173,78],[174,79],[183,80],[163,81],[186,72],[185,70],[189,18],[192,82],[154,83],[128,84],[94,85],[153,86],[155,87],[156,88],[93,89],[148,90],[149,91],[150,92],[152,93],[144,94],[145,95],[146,96],[147,97],[134,98],[135,99],[133,99],[136,100],[151,95],[142,101],[143,102],[139,103],[140,104],[137,18],[138,104],[141,105],[130,106],[131,18],[129,18],[132,107],[108,99],[109,99],[111,108],[110,99],[112,99],[102,109],[103,110],[101,18],[100,111],[104,112],[127,113],[106,114],[107,115],[105,116],[98,18],[99,117],[96,99],[97,99],[122,99],[121,99],[120,99],[123,18],[125,18],[126,118],[124,18],[114,119],[118,99],[115,119],[117,119],[116,119],[113,18],[119,120],[91,18],[92,121],[83,122],[84,123],[85,122],[90,124],[81,125],[82,18],[86,126],[87,125],[88,18],[89,123],[80,18],[95,18]],"latestChangedDtsFile":"./index.d.ts","version":"5.6.3"}
|
|
1
|
+
{"fileNames":["../../../../node_modules/typescript/lib/lib.es5.d.ts","../../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../../node_modules/typescript/lib/lib.es2021.d.ts","../../../../node_modules/typescript/lib/lib.es2022.d.ts","../../../../node_modules/typescript/lib/lib.es2023.d.ts","../../../../node_modules/typescript/lib/lib.es2024.d.ts","../../../../node_modules/typescript/lib/lib.esnext.d.ts","../../../../node_modules/typescript/lib/lib.dom.d.ts","../../../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../../../node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../../../node_modules/typescript/lib/lib.esnext.float16.d.ts","../../../../node_modules/typescript/lib/lib.decorators.d.ts","../../../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../../../node_modules/@types/react/global.d.ts","../../../../node_modules/csstype/index.d.ts","../../../../node_modules/@types/prop-types/index.d.ts","../../../../node_modules/@types/react/index.d.ts","../../../../node_modules/@types/react/jsx-runtime.d.ts","../../../schema/dist/types/schema/value.d.ts","../../../schema/dist/types/schema/input.d.ts","../../../schema/dist/types/schema/json.d.ts","../../../schema/dist/types/schema/acl.d.ts","../../../schema/dist/types/schema/actions.d.ts","../../../schema/dist/types/schema/actionsPayload.d.ts","../../../schema/dist/types/schema/model.d.ts","../../../schema/dist/types/schema/result.d.ts","../../../schema/dist/types/schema/settings.d.ts","../../../schema/dist/types/schema/validation.d.ts","../../../schema/dist/types/schema/index.d.ts","../../../schema/dist/types/ProjectRole.d.ts","../../../schema/dist/types/index.d.ts","../../src/utils.ts","../../src/EnumTypeSchemaGenerator.ts","../../../typesafe/dist/types/index.d.ts","../../../schema-utils/dist/types/model/modelUtils.d.ts","../../../schema-utils/dist/types/model/resolveDefaultColumnType.d.ts","../../../schema-utils/dist/types/model/NamingConventions.d.ts","../../../schema-utils/dist/types/model/index.d.ts","../../../schema-utils/dist/types/definition-generator/TsDefinitionGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/DefinitionNamingConventions.d.ts","../../../schema-utils/dist/types/definition-generator/AclDefinitionCodeGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/DefinitionCodeGenerator.d.ts","../../../schema-utils/dist/types/definition-generator/index.d.ts","../../../schema-utils/dist/types/lax/schema.d.ts","../../../schema-utils/dist/types/lax/LaxSchemaConverter.d.ts","../../../schema-utils/dist/types/lax/index.d.ts","../../../schema-utils/dist/types/acl/AllowAllPermissionFactory.d.ts","../../../schema-utils/dist/types/acl/PredicateDefinitionProcessor.d.ts","../../../schema-utils/dist/types/acl/schemaUtils.d.ts","../../../schema-utils/dist/types/acl/index.d.ts","../../../schema-utils/dist/types/dataUtils.d.ts","../../../schema-utils/dist/types/validation/errors.d.ts","../../../schema-utils/dist/types/validation/AclValidator.d.ts","../../../schema-utils/dist/types/validation/ModelValidator.d.ts","../../../schema-utils/dist/types/validation/ValidationValidator.d.ts","../../../schema-utils/dist/types/validation/SchemaValidator.d.ts","../../../schema-utils/dist/types/validation/MembershipResolver.d.ts","../../../schema-utils/dist/types/validation/index.d.ts","../../../schema-utils/dist/types/schemaNormalizer.d.ts","../../../schema-utils/dist/types/schemaFilter.d.ts","../../../schema-utils/dist/types/schemaChecksum.d.ts","../../../schema-utils/dist/types/utils/assertNever.d.ts","../../../schema-utils/dist/types/utils/isIt.d.ts","../../../schema-utils/dist/types/utils/deepCompare.d.ts","../../../schema-utils/dist/types/utils/index.d.ts","../../../schema-utils/dist/types/index.d.ts","../../src/EntityTypeSchemaGenerator.ts","../../../graphql-client/dist/types/GraphQlClientRequestOptions.d.ts","../../../graphql-client/dist/types/GraphQlClient.d.ts","../../../graphql-client/dist/types/GraphQlClientError.d.ts","../../../graphql-client/dist/types/index.d.ts","../../../client-content/dist/types/types/Schema.d.ts","../../../client-content/dist/types/types/Input.d.ts","../../../client-content/dist/types/types/Result.d.ts","../../../client-content/dist/types/types/index.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlFragmentSpread.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlInlineFragment.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlField.d.ts","../../../graphql-builder/dist/types/nodes/GraphQlFragment.d.ts","../../../graphql-builder/dist/types/nodes/index.d.ts","../../../graphql-builder/dist/types/GraphQlQueryPrinter.d.ts","../../../graphql-builder/dist/types/index.d.ts","../../../client-content/dist/types/nodes/ContentEntitySelection.d.ts","../../../client-content/dist/types/nodes/ContentOperation.d.ts","../../../client-content/dist/types/nodes/TypedEntitySelection.d.ts","../../../client-content/dist/types/nodes/index.d.ts","../../../client-content/dist/types/ContentClient.d.ts","../../../client-content/dist/types/ContentQueryBuilder.d.ts","../../../client-content/dist/types/TypedContentQueryBuilder.d.ts","../../../client-content/dist/types/utils/mutationFragments.d.ts","../../../client-content/dist/types/index.d.ts","../../src/NameSchemaGenerator.ts","../../src/ContemberClientGenerator.ts","../../src/generate.ts","../../src/index.ts","../../../../node_modules/@types/node/compatibility/disposable.d.ts","../../../../node_modules/@types/node/compatibility/indexable.d.ts","../../../../node_modules/@types/node/compatibility/iterators.d.ts","../../../../node_modules/@types/node/compatibility/index.d.ts","../../../../node_modules/@types/node/globals.typedarray.d.ts","../../../../node_modules/@types/node/buffer.buffer.d.ts","../../../../node_modules/buffer/index.d.ts","../../../../node_modules/undici-types/header.d.ts","../../../../node_modules/undici-types/readable.d.ts","../../../../node_modules/undici-types/file.d.ts","../../../../node_modules/undici-types/fetch.d.ts","../../../../node_modules/undici-types/formdata.d.ts","../../../../node_modules/undici-types/connector.d.ts","../../../../node_modules/undici-types/client.d.ts","../../../../node_modules/undici-types/errors.d.ts","../../../../node_modules/undici-types/dispatcher.d.ts","../../../../node_modules/undici-types/global-dispatcher.d.ts","../../../../node_modules/undici-types/global-origin.d.ts","../../../../node_modules/undici-types/pool-stats.d.ts","../../../../node_modules/undici-types/pool.d.ts","../../../../node_modules/undici-types/handlers.d.ts","../../../../node_modules/undici-types/balanced-pool.d.ts","../../../../node_modules/undici-types/agent.d.ts","../../../../node_modules/undici-types/mock-interceptor.d.ts","../../../../node_modules/undici-types/mock-agent.d.ts","../../../../node_modules/undici-types/mock-client.d.ts","../../../../node_modules/undici-types/mock-pool.d.ts","../../../../node_modules/undici-types/mock-errors.d.ts","../../../../node_modules/undici-types/proxy-agent.d.ts","../../../../node_modules/undici-types/env-http-proxy-agent.d.ts","../../../../node_modules/undici-types/retry-handler.d.ts","../../../../node_modules/undici-types/retry-agent.d.ts","../../../../node_modules/undici-types/api.d.ts","../../../../node_modules/undici-types/interceptors.d.ts","../../../../node_modules/undici-types/util.d.ts","../../../../node_modules/undici-types/cookies.d.ts","../../../../node_modules/undici-types/patch.d.ts","../../../../node_modules/undici-types/websocket.d.ts","../../../../node_modules/undici-types/eventsource.d.ts","../../../../node_modules/undici-types/filereader.d.ts","../../../../node_modules/undici-types/diagnostics-channel.d.ts","../../../../node_modules/undici-types/content-type.d.ts","../../../../node_modules/undici-types/cache.d.ts","../../../../node_modules/undici-types/index.d.ts","../../../../node_modules/@types/node/globals.d.ts","../../../../node_modules/@types/node/assert.d.ts","../../../../node_modules/@types/node/assert/strict.d.ts","../../../../node_modules/@types/node/async_hooks.d.ts","../../../../node_modules/@types/node/buffer.d.ts","../../../../node_modules/@types/node/child_process.d.ts","../../../../node_modules/@types/node/cluster.d.ts","../../../../node_modules/@types/node/console.d.ts","../../../../node_modules/@types/node/constants.d.ts","../../../../node_modules/@types/node/crypto.d.ts","../../../../node_modules/@types/node/dgram.d.ts","../../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../../node_modules/@types/node/dns.d.ts","../../../../node_modules/@types/node/dns/promises.d.ts","../../../../node_modules/@types/node/domain.d.ts","../../../../node_modules/@types/node/dom-events.d.ts","../../../../node_modules/@types/node/events.d.ts","../../../../node_modules/@types/node/fs.d.ts","../../../../node_modules/@types/node/fs/promises.d.ts","../../../../node_modules/@types/node/http.d.ts","../../../../node_modules/@types/node/http2.d.ts","../../../../node_modules/@types/node/https.d.ts","../../../../node_modules/@types/node/inspector.d.ts","../../../../node_modules/@types/node/module.d.ts","../../../../node_modules/@types/node/net.d.ts","../../../../node_modules/@types/node/os.d.ts","../../../../node_modules/@types/node/path.d.ts","../../../../node_modules/@types/node/perf_hooks.d.ts","../../../../node_modules/@types/node/process.d.ts","../../../../node_modules/@types/node/punycode.d.ts","../../../../node_modules/@types/node/querystring.d.ts","../../../../node_modules/@types/node/readline.d.ts","../../../../node_modules/@types/node/readline/promises.d.ts","../../../../node_modules/@types/node/repl.d.ts","../../../../node_modules/@types/node/sea.d.ts","../../../../node_modules/@types/node/stream.d.ts","../../../../node_modules/@types/node/stream/promises.d.ts","../../../../node_modules/@types/node/stream/consumers.d.ts","../../../../node_modules/@types/node/stream/web.d.ts","../../../../node_modules/@types/node/string_decoder.d.ts","../../../../node_modules/@types/node/test.d.ts","../../../../node_modules/@types/node/timers.d.ts","../../../../node_modules/@types/node/timers/promises.d.ts","../../../../node_modules/@types/node/tls.d.ts","../../../../node_modules/@types/node/trace_events.d.ts","../../../../node_modules/@types/node/tty.d.ts","../../../../node_modules/@types/node/url.d.ts","../../../../node_modules/@types/node/util.d.ts","../../../../node_modules/@types/node/v8.d.ts","../../../../node_modules/@types/node/vm.d.ts","../../../../node_modules/@types/node/wasi.d.ts","../../../../node_modules/@types/node/worker_threads.d.ts","../../../../node_modules/@types/node/zlib.d.ts","../../../../node_modules/@types/node/index.d.ts"],"fileIdsList":[[168,208,211],[168,210,211],[211],[168,211,216,245],[168,211,212,217,223,224,231,242,253],[168,211,212,213,223,231],[168,211],[163,164,165,168,211],[168,211,214,254],[168,211,215,216,224,232],[168,211,216,242,250],[168,211,217,219,223,231],[168,210,211,218],[168,211,219,220],[168,211,223],[168,211,221,223],[168,210,211,223],[168,211,223,224,225,242,253],[168,211,223,224,225,238,242,245],[168,206,211,258],[168,211,219,223,226,231,242,253],[168,211,223,224,226,227,231,242,250,253],[168,211,226,228,242,250,253],[166,167,168,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259],[168,211,223,229],[168,211,230,253,258],[168,211,219,223,231,242],[168,211,232],[168,211,233],[168,210,211,234],[168,208,209,210,211,212,213,214,215,216,217,218,219,220,221,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259],[168,211,236],[168,211,237],[168,211,223,238,239],[168,211,238,240,254,256],[168,211,223,242,243,245],[168,211,242,244],[168,211,242,243],[168,211,245],[168,211,246],[168,208,211,242],[168,211,223,248,249],[168,211,248,249],[168,211,216,231,242,250],[168,211,251],[168,211,231,252],[168,211,226,237,253],[168,211,216,254],[168,211,242,255],[168,211,230,256],[168,211,257],[168,211,216,223,225,234,242,253,256,258],[168,211,242,259],[81,82,83,168,211],[84,168,211],[168,178,182,211,253],[168,178,211,242,253],[168,173,211],[168,175,178,211,250,253],[168,211,231,250],[168,211,260],[168,173,211,260],[168,175,178,211,231,253],[168,170,171,174,177,211,223,242,253],[168,178,185,211],[168,170,176,211],[168,178,199,200,211],[168,174,178,211,245,253,260],[168,199,211,260],[168,172,173,211,260],[168,178,211],[168,172,173,174,175,176,177,178,179,180,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,200,201,202,203,204,205,211],[168,178,193,211],[168,178,185,186,211],[168,176,178,186,187,211],[168,177,211],[168,170,173,178,211],[168,178,182,186,187,211],[168,182,211],[168,176,178,181,211,253],[168,170,175,178,185,211],[168,211,242],[168,173,178,199,211,258,260],[85,98,100,134,159,168,211],[85,98,99,133,168,211],[85,98,99,168,211],[85,98,133,158,168,211],[85,160,168,211,225,233],[85,100,134,159,160,168,211],[85,168,211],[138,153,168,211],[98,142,153,168,211],[142,153,155,168,211],[142,153,154,155,156,157,168,211],[98,142,149,168,211],[149,168,211],[142,150,168,211],[150,151,152,168,211],[98,139,168,211],[98,168,211],[139,140,141,168,211],[98,147,168,211],[147,148,168,211],[98,143,144,168,211],[145,168,211],[143,144,145,146,168,211],[135,168,211],[135,136,137,168,211],[114,115,116,168,211],[98,107,168,211],[98,105,107,108,168,211],[98,105,168,211],[106,107,108,109,168,211],[98,101,105,110,113,117,118,125,126,127,128,132,168,211],[98,105,111,168,211],[111,112,168,211],[101,168,211],[102,103,104,168,211],[129,130,131,168,211],[98,119,168,211],[119,120,121,122,123,124,168,211],[96,97,168,211],[87,88,168,211],[88,168,211],[86,87,88,89,90,91,92,93,94,95,168,211],[86,168,211]],"fileInfos":[{"version":"69684132aeb9b5642cbcd9e22dff7818ff0ee1aa831728af0ecf97d3364d5546","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"8bf8b5e44e3c9c36f98e1007e8b7018c0f38d8adc07aecef42f5200114547c70","impliedFormat":1},{"version":"092c2bfe125ce69dbb1223c85d68d4d2397d7d8411867b5cc03cec902c233763","affectsGlobalScope":true,"impliedFormat":1},{"version":"07f073f19d67f74d732b1adea08e1dc66b1b58d77cb5b43931dee3d798a2fd53","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"df83c2a6c73228b625b0beb6669c7ee2a09c914637e2d35170723ad49c0f5cd4","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"60037901da1a425516449b9a20073aa03386cce92f7a1fd902d7602be3a7c2e9","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"22adec94ef7047a6c9d1af3cb96be87a335908bf9ef386ae9fd50eeb37f44c47","affectsGlobalScope":true,"impliedFormat":1},{"version":"4245fee526a7d1754529d19227ecbf3be066ff79ebb6a380d78e41648f2f224d","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"36a2e4c9a67439aca5f91bb304611d5ae6e20d420503e96c230cf8fcdc948d94","affectsGlobalScope":true,"impliedFormat":1},{"version":"8a8eb4ebffd85e589a1cc7c178e291626c359543403d58c9cd22b81fab5b1fb9","impliedFormat":1},{"version":"65ff5a0aefd7817a03c1ad04fee85c9cdd3ec415cc3c9efec85d8008d4d5e4ee","impliedFormat":1},{"version":"aea201321e7df78b294c9c39c61503ed81fb73b1b1703240013b557dfa25b016","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},"67070445e9cb6a031953839e5f673d751255409d0ecd2ce8a8bd8f09bb4a07f2","91789a99e4f308f5f34ac7dd87445c81ff6ecd2d1255c991b3961a91ae7adb9d","b1296831e111197bd9ebd73f0d15ad0fe2e11fcc51a6302edb23ffd93794db36","f1eff102a645ac08cbd3774a8853585007bc6cac147771df34f35fc4253daba6","ec0b1ad8de385d526b4e16c7ab8da4b84c1fb15a680d4c82b0e0b5f70e9f80c5","462c0b72a4911d6356ebbfed5dedd9682edf2bd60bcf6ea025539f1cd8c64bf4","85fa570b595ee21d9c853453fd2d5a529012b2a231b4ded46a4355ca09ac9035","f42116e2e8ad600dc90bdf8ceade9dcf593c35812d8aaba9c03a3f1dbb87330e","54410f2253354330ff63801044c8d826de679724d9b60d5d3053d3af6aee993f","dff2fee737ebe5174f549c9f28e114c0cabac4b5fe4e364654465ba528979ba4","ad1f130d5fb49665e218d5366db67ead55593335a2c02733ae5f8466a99def53","466df547af9cf3861658b08baf3ecbd41c0eaad2101378fadfa54ab24db103e6","92404f0f42ffd8d939cf6fb1a911235e931981f94dcab0e85f9ae5faf876ea3c",{"version":"0c233f23fa6aef75de3cd8bb708114545ba1aaf976c1275cc76a4507e9614e02","signature":"a404413d55ace912b644189eebdf890f75a936ad34b6650e1f17f20615be89eb"},{"version":"754f98fb2d9246645d79ce8b7697cafe8173283be94a9f5200048f6645980600","signature":"f0b0d83cf814e2d1f3cbe11a382f307774f4527d4c5c97cb37a9d7d96958ac60"},"5dba60c20c6ba4771fced29dae4f4f3e5b9506b11b07457019d4dab99bccabad","1090a100fefe5c21a36fe36b0c83dd566ac8c3d9b3fa1f2c2733e173c599614c","1208b368dc1c1e92d8fcbd3eac3f37dfea25672dc37134cce620455559e4da96","fb76be343c21f4e9dc23ddbb69f7a4a81dab90e9586c303668081dd3b4e30e58","daa9330eda367a2de8034fe1c11a387f25c1fb9c7b1a694facda6114bb22fef0","6c8f26d28cdb6bd0edc2d9d5b7040654b84776e85b2fb2da9ff5d23de67ff17c","bd25f7cb1c87f89392b2e5c6ed6846c4acc016e959783f1bc2d1c529b804492c","dc0b794be4f93caea87286e4f8a1b9bb1c8f2d6b26f35a3ea9f366b0b13478b6","2fa776928692b8d0cf9363ee7fd815b1539f207c91cae851639623e923174ae7","1120c659d2214c93367b3d93336d28a3ab1a45fccecd0ba3599ea99a20295af3","2d994cd941265041b7ab04efd9f9628a0ddaa7eb3ca13bc53c1f73f0b8954a74","9dfd6d6aa56e7f5ab521b038c35b8c42fbf789abe3316cd917cebc5e9117d7e0","9ac8296db617c4ae910ee4b618bb78bb130cdfca956ad8c4502e8d3283381c99","aa03a6771a194845f7d08c94a5927aaf0b67d0c0c4d9ab06167c1d36eda18f2b","2e3f3ef49948c5ddaa9bc1187af0cefb685b8cc529460264548c434de625f5bc","7777d96bf1dd9d4a21853f1db7f8ac76b362f1534a882692c9fc8f7b3850dcab","8da1c5a41069f9cbcae8690056768f4d315ee9e020d3162fd1703013cf8c0325","6bf9a70b5fc754f12a7b13e44f1cefd89b5957bc66b97b6e508227b456073cc8","a8c66d62845dd72d87bfe41f1a66e3063c886b1740fc01617824eefad0fa9f8b","d5bb605f28707fe26e7c87836418abc6fba7679cf5ee99a49ecf532c93846bf9","e9124ac92fb22b3e867d40dc8d9c1d9d1502fa69b3611d05ace7258be72f9777","a29fee10a827a80f5c211a21e5513185349ba264ea8b04a382a451982e23b294","f4fefa0f2c0e1a5587c1d698d5ded77e6c8695ab2eff6c7b28c3d3d18d58f731","3fa52693f21eed67e1bd50be0d25c7055d326580d78ceef9cca0c287e224656e","05ebf96323766ec1a492a055ada17f8e540142335b9467e1f430023c40f4592d","8b9c51e573464bff3b83adf232405f01a87447d1266b1a1a93a02fe3b713b588","8cf3d80aa530218e59750d58f63922099c102514ff34255480cc5ba24099711d","e846789af23154545cd9025760a9d063d1bfed8fd5022aac5874c241d9058864","a95c25e1f9146dd90f7cb36c7e306a25a67bdef1eaae7319a60d2f9d3ff66804","2e8b4d5b4a88c5cb82edc4585e7615641f7714676a8d92bf36884dcc7c975f12","c51e163a5110087ff0e59381f117d97fd23d275a80aa9c7bb4c7a58f52a3943a","b7f4d30efff05ede0b6358ded8aedefb29802ed4cf6fbd16e3921f9cf76780ae","3a6e1f99acca4b9d262c1b9ac7931c50c86bb525a6c397c2769d21e08cf5c1dd",{"version":"14d07f286d32ec7c421a8eb856bca41b8ff84311001ae9b2b2a79613e59d7f57","signature":"360b9a2f734bdda3c3877cd6e5dd92fae9f3e914cf2c14d935dc8c9cc29ff4ce"},"063a16a89e56dc3a27c4c353ff81f80e4a5074817db8f8989f6d4553df2f3850","8ef2193f6663c97e78c2a1b304b315620665bde3d5ec88cb9e6cdebbeab88291","4d023a0827a63ad5e6b498f92830d79e40e6fd487ed6b7c6fc2528eb9b3c0937","e17fbde86ef68adc663fff12c63cce11175482b3f108afd90fa3c11754afe6c6","e7899ed2786c9741e938d5264867f578606f0939f66a7446404920f7ada404bd","33491243e9e60504ee3d733817b089c90d639dc3f1238a3d6417083e9dd5b683","f289c5204b0819632486cefeec845a20a7a9c769180fb6bede63b0d7f24839d2","feaceef383869ce3addd7d620c89fa6ff1d5753f7b451cffb1e926998df2b5e4","34e5c5b2be8aa1b3f75ccd21529ae8b9163f510dbdabae4caae3fec3010cc33b","45fb3525f5c652416e54f91bd8378464d41e22b0ccc108de7db918cf8e92ffd3","e2402a646d4471b0985495b6bfca6c9c731d335195bf206e8c982d8ca362692f","08d34fcbf615950f6d3dd6858437159f0c0af08d5af645ec415ebfeaeacf3bd0","13ce162c8088b92a985e41a2ddf61cbb191101c280214a74dd9e8d2fd3c9c905","d2689735d2498972d6f02fbaff989b1fa500b5a140af7e7c08a15fbc36c1d3d3","4b47e095287cc1351b5fa9c5112d1d2d255bd8916ce76347225837b244e97ed5","496eb121a6f0ff31e1c54ddfcf49587483da30e34b326bbe95339cf2db084091","06c1e22ce1921cfd383c800f9e191972c5dfaca8996cca54d85c4b4cb41db49d","d3c47fc4a9c87d314c5556fc002f3413a4d812152ddeabbf00c9e2deaa93b387","6c7327831239ec38e57c18eb15c5b191aa258ada0528de8dc93092efcba20896","3c4de8d194c64b484827151ff14582884166268c345cbb13f9c19e4be3912f54","62ca877d3c090576b3ca1cd3e576c931eaedefc3af1b5ef405e41fd22c8b2955","5e8c7ad4619cc15007aa5bc3f4e1a30cb01540c14beaa609fb8d17d21acaceba","016e695348eb662b9adead21973e3da689bbff9c65811491644e2ed594fca800","1702404293385fb18761a3cf716b3c2888c6fa95d3ef96bc8e4e8f5a6e679689",{"version":"3ea13e244f295a9545cc6cfb98f0a8ad82c9db063b549e10b3a256b1c7b1713b","signature":"d5efb5060898d1f076715772c3480d4ce727be55e2167fb299bd6556ae70eeae"},{"version":"6eea1cd7302667f74cf05794d56316644f2a94156c43f39ab56940c2ed9ac50c","signature":"64fc8e10187e3facc023e41fafcd45a40b767a607e41270184e0585efe894d81"},{"version":"2b0504be8aa9ecd9bbf990abc07e4ce2eda3abf248e0451a5c3d94bbcd4b9b07","signature":"43e818adf60173644896298637f47b01d5819b17eda46eaa32d0c7d64724d012"},{"version":"675668049a0b4175aa1ad4fd80c751267db0053152755a7fac646eef592c3882","signature":"5cb53013b1adc504c16bed8523675d1efdeab8e7b22cd9a880d1d074cd5357e4"},{"version":"70521b6ab0dcba37539e5303104f29b721bfb2940b2776da4cc818c07e1fefc1","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab41ef1f2cdafb8df48be20cd969d875602483859dc194e9c97c8a576892c052","affectsGlobalScope":true,"impliedFormat":1},{"version":"d153a11543fd884b596587ccd97aebbeed950b26933ee000f94009f1ab142848","affectsGlobalScope":true,"impliedFormat":1},{"version":"21d819c173c0cf7cc3ce57c3276e77fd9a8a01d35a06ad87158781515c9a438a","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"6b80c6175da9de59bace50a72c2d68490d4ab5b07016ff5367bc7ba33cf2f219","affectsGlobalScope":true,"impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"08faa97886e71757779428dd4c69a545c32c85fd629d1116d42710b32c6378bc","affectsGlobalScope":true,"impliedFormat":1},{"version":"6b042aa5d277ad6963e2837179fd2f8fbb01968ac67115b0833c0244e93d1d50","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"3d77c73be94570813f8cadd1f05ebc3dc5e2e4fdefe4d340ca20cd018724ee36","impliedFormat":1},{"version":"23cfd70b42094e54cc3c5dab996d81b97e2b6f38ccb24ead85454b8ddfe2fc4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"f3e58c4c18a031cbb17abec7a4ad0bd5ae9fc70c1f4ba1e7fb921ad87c504aca","impliedFormat":1},{"version":"a3e8bafb2af8e850c644f4be7f5156cf7d23b7bfdc3b786bd4d10ed40329649c","impliedFormat":1},{"version":"35ec8b6760fd7138bbf5809b84551e31028fb2ba7b6dc91d95d098bf212ca8b4","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"f77d9188e41291acf14f476e931972460a303e1952538f9546e7b370cb8d0d20","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d04e3640dd9eb67f7f1e5bd3d0bf96c784666f7aefc8ac1537af6f2d38d4c29","impliedFormat":1},{"version":"3c884d9d9ec454bdf0d5a0b8465bf8297d2caa4d853851d92cc417ac6f30b969","impliedFormat":1},{"version":"5a369483ac4cfbdf0331c248deeb36140e6907db5e1daed241546b4a2055f82c","impliedFormat":1},{"version":"e8f5b5cc36615c17d330eaf8eebbc0d6bdd942c25991f96ef122f246f4ff722f","impliedFormat":1},{"version":"f0bd7e6d931657b59605c44112eaf8b980ba7f957a5051ed21cb93d978cf2f45","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"0ada07543808f3b967624645a8e1ccd446f8b01ade47842acf1328aec899fed0","affectsGlobalScope":true,"impliedFormat":1},{"version":"c4a806152acbef81593f96cae6f2b04784d776457d97adbe2694478b243fcf03","impliedFormat":1},{"version":"71adf5dbc59568663d252a46179e71e4d544c053978bfc526d11543a3f716f42","impliedFormat":1},{"version":"c60db41f7bee80fb80c0b12819f5e465c8c8b465578da43e36d04f4a4646f57d","impliedFormat":1},{"version":"93bd413918fa921c8729cef45302b24d8b6c7855d72d5bf82d3972595ae8dcbf","impliedFormat":1},{"version":"4ff41188773cbf465807dd2f7059c7494cbee5115608efc297383832a1150c43","impliedFormat":1},{"version":"dccdf1677e531e33f8ac961a68bc537418c9a414797c1ea7e91307501cdc3f5e","impliedFormat":1},{"version":"e184c4b8918ef56c8c9e68bd79f3f3780e2d0d75bf2b8a41da1509a40c2deb46","affectsGlobalScope":true,"impliedFormat":1},{"version":"d206b4baf4ddcc15d9d69a9a2f4999a72a2c6adeaa8af20fa7a9960816287555","impliedFormat":1},{"version":"93f437e1398a4f06a984f441f7fa7a9f0535c04399619b5c22e0b87bdee182cb","impliedFormat":1},{"version":"afbe24ab0d74694372baa632ecb28bb375be53f3be53f9b07ecd7fc994907de5","impliedFormat":1},{"version":"70731d10d5311bd4cf710ef7f6539b62660f4b0bfdbb3f9fbe1d25fe6366a7fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"6b19db3600a17af69d4f33d08cc7076a7d19fb65bb36e442cac58929ec7c9482","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e043a1bc8fbf2a255bccf9bf27e0f1caf916c3b0518ea34aa72357c0afd42ec","impliedFormat":1},{"version":"137c2894e8f3e9672d401cc0a305dc7b1db7c69511cf6d3970fb53302f9eae09","impliedFormat":1},{"version":"3bc2f1e2c95c04048212c569ed38e338873f6a8593930cf5a7ef24ffb38fc3b6","impliedFormat":1},{"version":"8145e07aad6da5f23f2fcd8c8e4c5c13fb26ee986a79d03b0829b8fce152d8b2","impliedFormat":1},{"version":"f9d9d753d430ed050dc1bf2667a1bab711ccbb1c1507183d794cc195a5b085cc","impliedFormat":1},{"version":"9eece5e586312581ccd106d4853e861aaaa1a39f8e3ea672b8c3847eedd12f6e","impliedFormat":1},{"version":"ba1f814c22fd970255ddd60d61fb7e00c28271c933ab5d5cc19cd3ca66b8f57c","impliedFormat":1},{"version":"37ba7b45141a45ce6e80e66f2a96c8a5ab1bcef0fc2d0f56bb58df96ec67e972","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"295f068af94245ee9d780555351bef98adfd58f8baf0b9dadbc31a489b881f8b","affectsGlobalScope":true,"impliedFormat":1},{"version":"1851a3b4db78664f83901bb9cac9e45e03a37bb5933cc5bf37e10bb7e91ab4eb","impliedFormat":1},{"version":"09d479208911ac3ac6a7c2fe86217fc1abe6c4f04e2d52e4890e500699eeab32","affectsGlobalScope":true,"impliedFormat":1},{"version":"27d8987fd22d92efe6560cf0ce11767bf089903ffe26047727debfd1f3bf438b","affectsGlobalScope":true,"impliedFormat":1},{"version":"578d8bb6dcb2a1c03c4c3f8eb71abc9677e1a5c788b7f24848e3138ce17f3400","impliedFormat":1},{"version":"4f029899f9bae07e225c43aef893590541b2b43267383bf5e32e3a884d219ed5","impliedFormat":1},{"version":"ae56f65caf3be91108707bd8dfbccc2a57a91feb5daabf7165a06a945545ed26","impliedFormat":1},{"version":"a136d5de521da20f31631a0a96bf712370779d1c05b7015d7019a9b2a0446ca9","impliedFormat":1},{"version":"5b566927cad2ed2139655d55d690ffa87df378b956e7fe1c96024c4d9f75c4cf","affectsGlobalScope":true,"impliedFormat":1},{"version":"bce947017cb7a2deebcc4f5ba04cead891ce6ad1602a4438ae45ed9aa1f39104","affectsGlobalScope":true,"impliedFormat":1},{"version":"d3dffd70e6375b872f0b4e152de4ae682d762c61a24881ecc5eb9f04c5caf76f","impliedFormat":1},{"version":"e2c72c065a36bc9ab2a00ac6a6f51e71501619a72c0609defd304d46610487a4","impliedFormat":1},{"version":"d91a7d8b5655c42986f1bdfe2105c4408f472831c8f20cf11a8c3345b6b56c8c","impliedFormat":1},{"version":"616075a6ac578cf5a013ee12964188b4412823796ce0b202c6f1d2e4ca8480d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"e8a979b8af001c9fc2e774e7809d233c8ca955a28756f52ee5dee88ccb0611d2","impliedFormat":1},{"version":"cac793cc47c29e26e4ac3601dcb00b4435ebed26203485790e44f2ad8b6ad847","impliedFormat":1}],"root":[99,100,134,[159,162]],"options":{"allowSyntheticDefaultImports":true,"composite":true,"declaration":true,"declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":true,"experimentalDecorators":true,"jsx":4,"module":99,"noEmitOnError":true,"noImplicitOverride":true,"outDir":"./","skipLibCheck":true,"sourceMap":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[208,1],[209,1],[210,2],[168,3],[211,4],[212,5],[213,6],[163,7],[166,8],[164,7],[165,7],[214,9],[215,10],[216,11],[217,12],[218,13],[219,14],[220,14],[222,15],[221,16],[223,17],[224,18],[225,19],[207,20],[167,7],[226,21],[227,22],[228,23],[260,24],[229,25],[230,26],[231,27],[232,28],[233,29],[234,30],[235,31],[236,32],[237,33],[238,34],[239,34],[240,35],[241,7],[242,36],[244,37],[243,38],[245,39],[246,40],[247,41],[248,42],[249,43],[250,44],[251,45],[252,46],[253,47],[254,48],[255,49],[256,50],[257,51],[258,52],[259,53],[83,7],[81,7],[84,54],[85,55],[169,7],[82,7],[79,7],[80,7],[13,7],[14,7],[16,7],[15,7],[2,7],[17,7],[18,7],[19,7],[20,7],[21,7],[22,7],[23,7],[24,7],[3,7],[25,7],[26,7],[4,7],[27,7],[31,7],[28,7],[29,7],[30,7],[32,7],[33,7],[34,7],[5,7],[35,7],[36,7],[37,7],[38,7],[6,7],[42,7],[39,7],[40,7],[41,7],[43,7],[7,7],[44,7],[49,7],[50,7],[45,7],[46,7],[47,7],[48,7],[8,7],[54,7],[51,7],[52,7],[53,7],[55,7],[9,7],[56,7],[57,7],[58,7],[60,7],[59,7],[61,7],[62,7],[10,7],[63,7],[64,7],[65,7],[11,7],[66,7],[67,7],[68,7],[69,7],[70,7],[1,7],[71,7],[72,7],[12,7],[76,7],[74,7],[78,7],[73,7],[77,7],[75,7],[185,56],[195,57],[184,56],[205,58],[176,59],[175,60],[204,61],[198,62],[203,63],[178,64],[192,65],[177,66],[201,67],[173,68],[172,61],[202,69],[174,70],[179,71],[180,7],[183,71],[170,7],[206,72],[196,73],[187,74],[188,75],[190,76],[186,77],[189,78],[199,61],[181,79],[182,80],[191,81],[171,82],[194,73],[193,71],[197,7],[200,83],[160,84],[134,85],[100,86],[159,87],[161,88],[162,89],[99,90],[154,91],[155,92],[156,93],[158,94],[150,95],[151,96],[152,97],[153,98],[140,99],[141,100],[139,100],[142,101],[157,96],[148,102],[149,103],[145,104],[146,105],[143,7],[144,105],[147,106],[136,107],[137,7],[135,7],[138,108],[114,100],[115,100],[117,109],[116,100],[118,100],[108,110],[109,111],[107,7],[106,112],[110,113],[133,114],[112,115],[113,116],[111,117],[104,7],[105,118],[102,100],[103,100],[128,100],[127,100],[126,100],[129,7],[131,7],[132,119],[130,7],[120,120],[124,100],[121,120],[123,120],[122,120],[119,7],[125,121],[97,7],[98,122],[89,123],[90,124],[91,123],[96,125],[87,126],[88,7],[92,123],[93,126],[94,7],[95,124],[86,7],[101,7]],"latestChangedDtsFile":"./index.d.ts","version":"5.8.2"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,GAAI,UAAU,MAAM,KAAG,MAAwC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/client-content-generator",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.0.
|
|
4
|
+
"version": "2.1.0-alpha.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/production/index.js",
|
|
@@ -33,13 +33,13 @@
|
|
|
33
33
|
"ae:test": "api-extractor run"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@contember/client-content": "2.0.
|
|
37
|
-
"@contember/schema": "2.0.
|
|
38
|
-
"@contember/schema-utils": "2.0.
|
|
36
|
+
"@contember/client-content": "2.1.0-alpha.2",
|
|
37
|
+
"@contember/schema": "2.1.0-alpha.2",
|
|
38
|
+
"@contember/schema-utils": "2.1.0-alpha.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@contember/schema-definition": "2.0.
|
|
42
|
-
"@types/node": "^20.
|
|
41
|
+
"@contember/schema-definition": "2.1.0-alpha.2",
|
|
42
|
+
"@types/node": "^20.17.22"
|
|
43
43
|
},
|
|
44
44
|
"repository": {
|
|
45
45
|
"type": "git",
|
|
@@ -141,30 +141,35 @@ const uniqueType = (model: Model.Schema, entity: Model.Entity, field: Model.AnyF
|
|
|
141
141
|
|
|
142
142
|
|
|
143
143
|
const columnToTsType = (column: Model.AnyColumn): string => {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
144
|
+
const baseType = (() => {
|
|
145
|
+
switch (column.type) {
|
|
146
|
+
case Model.ColumnType.Enum:
|
|
147
|
+
return getEnumTypeName(column.columnType)
|
|
148
|
+
case Model.ColumnType.String:
|
|
149
|
+
return 'string'
|
|
150
|
+
case Model.ColumnType.Int:
|
|
151
|
+
return 'number'
|
|
152
|
+
case Model.ColumnType.Double:
|
|
153
|
+
return 'number'
|
|
154
|
+
case Model.ColumnType.Bool:
|
|
155
|
+
return 'boolean'
|
|
156
|
+
case Model.ColumnType.DateTime:
|
|
157
|
+
return 'string'
|
|
158
|
+
case Model.ColumnType.Time:
|
|
159
|
+
return 'string'
|
|
160
|
+
case Model.ColumnType.Date:
|
|
161
|
+
return 'string'
|
|
162
|
+
case Model.ColumnType.Json:
|
|
163
|
+
return 'JSONValue'
|
|
164
|
+
case Model.ColumnType.Uuid:
|
|
165
|
+
return 'string'
|
|
166
|
+
default:
|
|
167
|
+
((_: never) => {
|
|
168
|
+
throw new Error(`Unknown type ${_}`)
|
|
169
|
+
})(column.type)
|
|
170
|
+
}
|
|
171
|
+
})()
|
|
172
|
+
return column.list ? `readonly ${baseType}[]` : baseType
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
const getFieldsForUniqueWhere = (schema: Model.Schema, entity: Model.Entity): readonly (readonly string[])[] => {
|