@itwin/ecschema-rpcinterface-tests 5.10.0-dev.10 → 5.10.0-dev.12
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/lib/dist/bundled-tests.js +1025 -1022
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -67399,213 +67399,213 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
67399
67399
|
* WITH clauses are broken down into individual variables.
|
|
67400
67400
|
*/
|
|
67401
67401
|
const propertyType = (alias) => {
|
|
67402
|
-
return `
|
|
67403
|
-
CASE
|
|
67404
|
-
WHEN [${alias}].[Kind] = 0 THEN 'PrimitiveProperty'
|
|
67405
|
-
WHEN [${alias}].[Kind] = 1 THEN 'StructProperty'
|
|
67406
|
-
WHEN [${alias}].[Kind] = 2 THEN 'PrimitiveArrayProperty'
|
|
67407
|
-
WHEN [${alias}].[Kind] = 3 THEN 'StructArrayProperty'
|
|
67408
|
-
WHEN [${alias}].[Kind] = 4 THEN 'NavigationProperty'
|
|
67409
|
-
ELSE NULL
|
|
67410
|
-
END
|
|
67402
|
+
return `
|
|
67403
|
+
CASE
|
|
67404
|
+
WHEN [${alias}].[Kind] = 0 THEN 'PrimitiveProperty'
|
|
67405
|
+
WHEN [${alias}].[Kind] = 1 THEN 'StructProperty'
|
|
67406
|
+
WHEN [${alias}].[Kind] = 2 THEN 'PrimitiveArrayProperty'
|
|
67407
|
+
WHEN [${alias}].[Kind] = 3 THEN 'StructArrayProperty'
|
|
67408
|
+
WHEN [${alias}].[Kind] = 4 THEN 'NavigationProperty'
|
|
67409
|
+
ELSE NULL
|
|
67410
|
+
END
|
|
67411
67411
|
`;
|
|
67412
67412
|
};
|
|
67413
67413
|
const navigationDirection = (alias) => {
|
|
67414
|
-
return `
|
|
67415
|
-
CASE
|
|
67416
|
-
WHEN [${alias}].[NavigationDirection] = 1 THEN 'Forward'
|
|
67417
|
-
WHEN [${alias}].[NavigationDirection] = 2 THEN 'Backward'
|
|
67418
|
-
ELSE NULL
|
|
67419
|
-
END
|
|
67414
|
+
return `
|
|
67415
|
+
CASE
|
|
67416
|
+
WHEN [${alias}].[NavigationDirection] = 1 THEN 'Forward'
|
|
67417
|
+
WHEN [${alias}].[NavigationDirection] = 2 THEN 'Backward'
|
|
67418
|
+
ELSE NULL
|
|
67419
|
+
END
|
|
67420
67420
|
`;
|
|
67421
67421
|
};
|
|
67422
67422
|
const schemaCustomAttribute = (alias) => {
|
|
67423
|
-
return `
|
|
67424
|
-
SELECT
|
|
67425
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67426
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67427
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 1
|
|
67428
|
-
ORDER BY [ca].[Ordinal]
|
|
67423
|
+
return `
|
|
67424
|
+
SELECT
|
|
67425
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67426
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67427
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 1
|
|
67428
|
+
ORDER BY [ca].[Ordinal]
|
|
67429
67429
|
`;
|
|
67430
67430
|
};
|
|
67431
67431
|
/**
|
|
67432
67432
|
* Selects customAttribute data for each class type.
|
|
67433
67433
|
*/
|
|
67434
67434
|
const classCustomAttribute = (alias) => {
|
|
67435
|
-
return `
|
|
67436
|
-
SELECT
|
|
67437
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67438
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67439
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
67440
|
-
ORDER BY [ca].[Ordinal]
|
|
67435
|
+
return `
|
|
67436
|
+
SELECT
|
|
67437
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67438
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67439
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
67440
|
+
ORDER BY [ca].[Ordinal]
|
|
67441
67441
|
`;
|
|
67442
67442
|
};
|
|
67443
67443
|
const propertyCustomAttribute = (alias) => {
|
|
67444
|
-
return `
|
|
67445
|
-
SELECT
|
|
67446
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67447
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67448
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 992
|
|
67449
|
-
ORDER BY [ca].[Ordinal]
|
|
67444
|
+
return `
|
|
67445
|
+
SELECT
|
|
67446
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67447
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67448
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 992
|
|
67449
|
+
ORDER BY [ca].[Ordinal]
|
|
67450
67450
|
`;
|
|
67451
67451
|
};
|
|
67452
67452
|
/**
|
|
67453
67453
|
* Selects base class data for each class type.
|
|
67454
67454
|
*/
|
|
67455
|
-
const selectBaseClasses = `
|
|
67456
|
-
SELECT
|
|
67457
|
-
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
67458
|
-
FROM
|
|
67459
|
-
[meta].[ECClassDef] [baseClass]
|
|
67460
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67461
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
67462
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67463
|
-
ORDER BY [baseClassMap].[Ordinal] ASC
|
|
67464
|
-
LIMIT 1
|
|
67455
|
+
const selectBaseClasses = `
|
|
67456
|
+
SELECT
|
|
67457
|
+
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
67458
|
+
FROM
|
|
67459
|
+
[meta].[ECClassDef] [baseClass]
|
|
67460
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67461
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
67462
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67463
|
+
ORDER BY [baseClassMap].[Ordinal] ASC
|
|
67464
|
+
LIMIT 1
|
|
67465
67465
|
`;
|
|
67466
67466
|
/**
|
|
67467
67467
|
* Selects class property data for each class type. ClassProperties
|
|
67468
67468
|
* is a common table expression (CTE or WITH clause) defined below.
|
|
67469
67469
|
*/
|
|
67470
|
-
const selectProperties = `
|
|
67471
|
-
SELECT
|
|
67472
|
-
json_group_array(json([classProperties].[property]))
|
|
67473
|
-
FROM
|
|
67474
|
-
[ClassProperties] [classProperties]
|
|
67475
|
-
WHERE
|
|
67476
|
-
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
67470
|
+
const selectProperties = `
|
|
67471
|
+
SELECT
|
|
67472
|
+
json_group_array(json([classProperties].[property]))
|
|
67473
|
+
FROM
|
|
67474
|
+
[ClassProperties] [classProperties]
|
|
67475
|
+
WHERE
|
|
67476
|
+
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
67477
67477
|
`;
|
|
67478
67478
|
/**
|
|
67479
67479
|
* A CTE used to select AppliesTo from IsMixin CustomAttributes for a given Mixin.
|
|
67480
67480
|
*/
|
|
67481
|
-
const withAppliesTo = `
|
|
67482
|
-
AppliesToCTE AS (
|
|
67483
|
-
SELECT
|
|
67484
|
-
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
67485
|
-
[appliesToSchema].[name] as [AppliesToSchema],
|
|
67486
|
-
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
67487
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67488
|
-
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
67489
|
-
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
67490
|
-
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
67491
|
-
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
67492
|
-
WHERE [ca].[ContainerType] = 30
|
|
67493
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
67494
|
-
)
|
|
67481
|
+
const withAppliesTo = `
|
|
67482
|
+
AppliesToCTE AS (
|
|
67483
|
+
SELECT
|
|
67484
|
+
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
67485
|
+
[appliesToSchema].[name] as [AppliesToSchema],
|
|
67486
|
+
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
67487
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67488
|
+
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
67489
|
+
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
67490
|
+
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
67491
|
+
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
67492
|
+
WHERE [ca].[ContainerType] = 30
|
|
67493
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
67494
|
+
)
|
|
67495
67495
|
`;
|
|
67496
67496
|
/**
|
|
67497
67497
|
* A CTE used to select Schema reference data for a given Schema.
|
|
67498
67498
|
*/
|
|
67499
|
-
const withSchemaReferences = `
|
|
67500
|
-
SchemaReferences as (
|
|
67501
|
-
SELECT
|
|
67502
|
-
[ref].[SourceECInstanceId] as [SchemaId],
|
|
67503
|
-
json_object(
|
|
67504
|
-
'name', [Name],
|
|
67505
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor]))
|
|
67506
|
-
) as [reference]
|
|
67507
|
-
FROM
|
|
67508
|
-
[meta].[ECSchemaDef] as [refSchema]
|
|
67509
|
-
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
67510
|
-
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
67511
|
-
)
|
|
67499
|
+
const withSchemaReferences = `
|
|
67500
|
+
SchemaReferences as (
|
|
67501
|
+
SELECT
|
|
67502
|
+
[ref].[SourceECInstanceId] as [SchemaId],
|
|
67503
|
+
json_object(
|
|
67504
|
+
'name', [Name],
|
|
67505
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor]))
|
|
67506
|
+
) as [reference]
|
|
67507
|
+
FROM
|
|
67508
|
+
[meta].[ECSchemaDef] as [refSchema]
|
|
67509
|
+
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
67510
|
+
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
67511
|
+
)
|
|
67512
67512
|
`;
|
|
67513
67513
|
/**
|
|
67514
67514
|
* A CTE used to select Relationship constraints for a given RelationshipClass.
|
|
67515
67515
|
*/
|
|
67516
|
-
const withRelationshipConstraints = `
|
|
67517
|
-
ClassRelationshipConstraints as (
|
|
67518
|
-
SELECT
|
|
67519
|
-
[rhc].[SourceECInstanceId] as [ClassId],
|
|
67520
|
-
[constraintDef].[ECInstanceId] as [ConstraintId],
|
|
67521
|
-
[RelationshipEnd],
|
|
67522
|
-
CONCAT('(', [MultiplicityLowerLimit], '..', IIF([MultiplicityUpperLimit] IS NULL, '*', [MultiplicityUpperLimit]), ')') as [Multiplicity],
|
|
67523
|
-
[IsPolyMorphic],
|
|
67524
|
-
[RoleLabel],
|
|
67525
|
-
IIF([constraintDef].[AbstractConstraintClass] IS NOT NULL, ec_classname([constraintDef].[AbstractConstraintClass].[Id], 's.c'), null) as [AbstractConstraint],
|
|
67526
|
-
IIF ([rchc].[TargetECInstanceId] IS NOT NULL, JSON_GROUP_ARRAY(ec_classname([rchc].[TargetECInstanceId], 's.c')), null) as [ConstraintClasses]
|
|
67527
|
-
FROM
|
|
67528
|
-
[meta].[ECRelationshipConstraintDef] [constraintDef]
|
|
67529
|
-
JOIN [meta].[RelationshipHasConstraints] [rhc]
|
|
67530
|
-
ON [rhc].[TargetECInstanceId] = [constraintDef].[ECInstanceId]
|
|
67531
|
-
JOIN [meta].[RelationshipConstraintHasClasses] [rchc]
|
|
67532
|
-
ON [rchc].[SourceECInstanceId] = [constraintDef].[ECInstanceId]
|
|
67533
|
-
GROUP BY [constraintDef].[ECInstanceId]
|
|
67534
|
-
)
|
|
67516
|
+
const withRelationshipConstraints = `
|
|
67517
|
+
ClassRelationshipConstraints as (
|
|
67518
|
+
SELECT
|
|
67519
|
+
[rhc].[SourceECInstanceId] as [ClassId],
|
|
67520
|
+
[constraintDef].[ECInstanceId] as [ConstraintId],
|
|
67521
|
+
[RelationshipEnd],
|
|
67522
|
+
CONCAT('(', [MultiplicityLowerLimit], '..', IIF([MultiplicityUpperLimit] IS NULL, '*', [MultiplicityUpperLimit]), ')') as [Multiplicity],
|
|
67523
|
+
[IsPolyMorphic],
|
|
67524
|
+
[RoleLabel],
|
|
67525
|
+
IIF([constraintDef].[AbstractConstraintClass] IS NOT NULL, ec_classname([constraintDef].[AbstractConstraintClass].[Id], 's.c'), null) as [AbstractConstraint],
|
|
67526
|
+
IIF ([rchc].[TargetECInstanceId] IS NOT NULL, JSON_GROUP_ARRAY(ec_classname([rchc].[TargetECInstanceId], 's.c')), null) as [ConstraintClasses]
|
|
67527
|
+
FROM
|
|
67528
|
+
[meta].[ECRelationshipConstraintDef] [constraintDef]
|
|
67529
|
+
JOIN [meta].[RelationshipHasConstraints] [rhc]
|
|
67530
|
+
ON [rhc].[TargetECInstanceId] = [constraintDef].[ECInstanceId]
|
|
67531
|
+
JOIN [meta].[RelationshipConstraintHasClasses] [rchc]
|
|
67532
|
+
ON [rchc].[SourceECInstanceId] = [constraintDef].[ECInstanceId]
|
|
67533
|
+
GROUP BY [constraintDef].[ECInstanceId]
|
|
67534
|
+
)
|
|
67535
67535
|
`;
|
|
67536
67536
|
/**
|
|
67537
67537
|
* A CTE used to select Class property data for a given Class.
|
|
67538
67538
|
*/
|
|
67539
|
-
const withClassProperties = `
|
|
67540
|
-
ClassProperties as (
|
|
67541
|
-
SELECT
|
|
67542
|
-
[cop].[SourceECInstanceId] as [ClassId],
|
|
67543
|
-
json_object(
|
|
67544
|
-
'name', [pd].[Name],
|
|
67545
|
-
'label', [pd].[DisplayLabel],
|
|
67546
|
-
'description', [pd].[Description],
|
|
67547
|
-
'isReadOnly', IIF([pd].[IsReadOnly] = 1, json('true'), NULL),
|
|
67548
|
-
'priority', [pd].[Priority],
|
|
67549
|
-
'category', IIF([categoryDef].[Name] IS NULL, NULL, CONCAT([categorySchemaDef].[Name], '.', [categoryDef].[Name])),
|
|
67550
|
-
'kindOfQuantity', IIF([koqDef].[Name] IS NULL, NULL, CONCAT([koqSchemaDef].[Name], '.', [koqDef].[Name])),
|
|
67551
|
-
'typeName',
|
|
67552
|
-
CASE
|
|
67553
|
-
WHEN [pd].[Kind] = 0 OR [pd].[Kind] = 2 Then
|
|
67554
|
-
CASE
|
|
67555
|
-
WHEN [enumDef].[Name] IS NOT NULL Then CONCAT([enumSchemaDef].[Name], '.', [enumDef].[Name])
|
|
67556
|
-
WHEN [pd].[PrimitiveType] = 257 Then 'binary'
|
|
67557
|
-
WHEN [pd].[PrimitiveType] = 513 Then 'boolean'
|
|
67558
|
-
WHEN [pd].[PrimitiveType] = 769 Then 'dateTime'
|
|
67559
|
-
WHEN [pd].[PrimitiveType] = 1025 Then 'double'
|
|
67560
|
-
WHEN [pd].[PrimitiveType] = 1281 Then 'int'
|
|
67561
|
-
WHEN [pd].[PrimitiveType] = 1537 Then 'long'
|
|
67562
|
-
WHEN [pd].[PrimitiveType] = 1793 Then 'point2d'
|
|
67563
|
-
WHEN [pd].[PrimitiveType] = 2049 Then 'point3d'
|
|
67564
|
-
WHEN [pd].[PrimitiveType] = 2305 Then 'string'
|
|
67565
|
-
WHEN [pd].[PrimitiveType] = 2561 Then 'Bentley.Geometry.Common.IGeometry'
|
|
67566
|
-
ELSE null
|
|
67567
|
-
END
|
|
67568
|
-
WHEN [pd].[Kind] = 1 OR [pd].[Kind] = 3 Then
|
|
67569
|
-
CONCAT([structSchemaDef].[Name], '.', [structDef].[Name])
|
|
67570
|
-
ELSE null
|
|
67571
|
-
END,
|
|
67572
|
-
'type', ${propertyType("pd")},
|
|
67573
|
-
'minLength', [pd].[PrimitiveTypeMinLength],
|
|
67574
|
-
'maxLength', [pd].[PrimitiveTypeMaxLength],
|
|
67575
|
-
'minValue', [pd].[PrimitiveTypeMinValue],
|
|
67576
|
-
'maxValue', [pd].[PrimitiveTypeMaxValue],
|
|
67577
|
-
'extendedTypeName', [pd].[ExtendedTypeName],
|
|
67578
|
-
'minOccurs', [pd].[ArrayMinOccurs],
|
|
67579
|
-
'maxOccurs', [pd].[ArrayMaxOccurs],
|
|
67580
|
-
'direction', ${navigationDirection("pd")},
|
|
67581
|
-
'relationshipName', IIF([navRelDef].[Name] IS NULL, NULL, CONCAT([navSchemaDef].[Name], '.', [navRelDef].[Name])),
|
|
67582
|
-
'customAttributes', (${propertyCustomAttribute("pd")})
|
|
67583
|
-
) as [property]
|
|
67584
|
-
FROM
|
|
67585
|
-
[meta].[ECPropertyDef] as [pd]
|
|
67586
|
-
JOIN [meta].[ClassOwnsLocalProperties] [cop]
|
|
67587
|
-
ON cop.[TargetECInstanceId] = [pd].[ECInstanceId]
|
|
67588
|
-
LEFT JOIN [meta].[ECEnumerationDef] [enumDef]
|
|
67589
|
-
ON [enumDef].[ECInstanceId] = [pd].[Enumeration].[Id]
|
|
67590
|
-
LEFT JOIN [meta].[ECSchemaDef] enumSchemaDef
|
|
67591
|
-
ON [enumSchemaDef].[ECInstanceId] = [enumDef].[Schema].[Id]
|
|
67592
|
-
LEFT JOIN [meta].[PropertyCategoryDef] [categoryDef]
|
|
67593
|
-
ON [categoryDef].[ECInstanceId] = [pd].[Category].[Id]
|
|
67594
|
-
LEFT JOIN [meta].[ECSchemaDef] [categorySchemaDef]
|
|
67595
|
-
ON [categorySchemaDef].[ECInstanceId] = [categoryDef].[Schema].[Id]
|
|
67596
|
-
LEFT JOIN [meta].[KindOfQuantityDef] [koqDef]
|
|
67597
|
-
ON [koqDef].[ECInstanceId] = [pd].[KindOfQuantity].[Id]
|
|
67598
|
-
LEFT JOIN [meta].[ECSchemaDef] [koqSchemaDef]
|
|
67599
|
-
ON [koqSchemaDef].[ECInstanceId] = [koqDef].[Schema].[Id]
|
|
67600
|
-
LEFT JOIN [meta].[ECClassDef] [structDef]
|
|
67601
|
-
ON structDef.[ECInstanceId] = [pd].[StructClass].[Id]
|
|
67602
|
-
LEFT JOIN [meta].[ECSchemaDef] [structSchemaDef]
|
|
67603
|
-
ON [structSchemaDef].[ECInstanceId] = [structDef].[Schema].[Id]
|
|
67604
|
-
LEFT JOIN [meta].[ECClassDef] [navRelDef]
|
|
67605
|
-
ON [navRelDef].[ECInstanceId] = [pd].[NavigationRelationshipClass].[Id]
|
|
67606
|
-
LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
67607
|
-
ON [navSchemaDef].[ECInstanceId] = [navRelDef].[Schema].[Id]
|
|
67608
|
-
)
|
|
67539
|
+
const withClassProperties = `
|
|
67540
|
+
ClassProperties as (
|
|
67541
|
+
SELECT
|
|
67542
|
+
[cop].[SourceECInstanceId] as [ClassId],
|
|
67543
|
+
json_object(
|
|
67544
|
+
'name', [pd].[Name],
|
|
67545
|
+
'label', [pd].[DisplayLabel],
|
|
67546
|
+
'description', [pd].[Description],
|
|
67547
|
+
'isReadOnly', IIF([pd].[IsReadOnly] = 1, json('true'), NULL),
|
|
67548
|
+
'priority', [pd].[Priority],
|
|
67549
|
+
'category', IIF([categoryDef].[Name] IS NULL, NULL, CONCAT([categorySchemaDef].[Name], '.', [categoryDef].[Name])),
|
|
67550
|
+
'kindOfQuantity', IIF([koqDef].[Name] IS NULL, NULL, CONCAT([koqSchemaDef].[Name], '.', [koqDef].[Name])),
|
|
67551
|
+
'typeName',
|
|
67552
|
+
CASE
|
|
67553
|
+
WHEN [pd].[Kind] = 0 OR [pd].[Kind] = 2 Then
|
|
67554
|
+
CASE
|
|
67555
|
+
WHEN [enumDef].[Name] IS NOT NULL Then CONCAT([enumSchemaDef].[Name], '.', [enumDef].[Name])
|
|
67556
|
+
WHEN [pd].[PrimitiveType] = 257 Then 'binary'
|
|
67557
|
+
WHEN [pd].[PrimitiveType] = 513 Then 'boolean'
|
|
67558
|
+
WHEN [pd].[PrimitiveType] = 769 Then 'dateTime'
|
|
67559
|
+
WHEN [pd].[PrimitiveType] = 1025 Then 'double'
|
|
67560
|
+
WHEN [pd].[PrimitiveType] = 1281 Then 'int'
|
|
67561
|
+
WHEN [pd].[PrimitiveType] = 1537 Then 'long'
|
|
67562
|
+
WHEN [pd].[PrimitiveType] = 1793 Then 'point2d'
|
|
67563
|
+
WHEN [pd].[PrimitiveType] = 2049 Then 'point3d'
|
|
67564
|
+
WHEN [pd].[PrimitiveType] = 2305 Then 'string'
|
|
67565
|
+
WHEN [pd].[PrimitiveType] = 2561 Then 'Bentley.Geometry.Common.IGeometry'
|
|
67566
|
+
ELSE null
|
|
67567
|
+
END
|
|
67568
|
+
WHEN [pd].[Kind] = 1 OR [pd].[Kind] = 3 Then
|
|
67569
|
+
CONCAT([structSchemaDef].[Name], '.', [structDef].[Name])
|
|
67570
|
+
ELSE null
|
|
67571
|
+
END,
|
|
67572
|
+
'type', ${propertyType("pd")},
|
|
67573
|
+
'minLength', [pd].[PrimitiveTypeMinLength],
|
|
67574
|
+
'maxLength', [pd].[PrimitiveTypeMaxLength],
|
|
67575
|
+
'minValue', [pd].[PrimitiveTypeMinValue],
|
|
67576
|
+
'maxValue', [pd].[PrimitiveTypeMaxValue],
|
|
67577
|
+
'extendedTypeName', [pd].[ExtendedTypeName],
|
|
67578
|
+
'minOccurs', [pd].[ArrayMinOccurs],
|
|
67579
|
+
'maxOccurs', [pd].[ArrayMaxOccurs],
|
|
67580
|
+
'direction', ${navigationDirection("pd")},
|
|
67581
|
+
'relationshipName', IIF([navRelDef].[Name] IS NULL, NULL, CONCAT([navSchemaDef].[Name], '.', [navRelDef].[Name])),
|
|
67582
|
+
'customAttributes', (${propertyCustomAttribute("pd")})
|
|
67583
|
+
) as [property]
|
|
67584
|
+
FROM
|
|
67585
|
+
[meta].[ECPropertyDef] as [pd]
|
|
67586
|
+
JOIN [meta].[ClassOwnsLocalProperties] [cop]
|
|
67587
|
+
ON cop.[TargetECInstanceId] = [pd].[ECInstanceId]
|
|
67588
|
+
LEFT JOIN [meta].[ECEnumerationDef] [enumDef]
|
|
67589
|
+
ON [enumDef].[ECInstanceId] = [pd].[Enumeration].[Id]
|
|
67590
|
+
LEFT JOIN [meta].[ECSchemaDef] enumSchemaDef
|
|
67591
|
+
ON [enumSchemaDef].[ECInstanceId] = [enumDef].[Schema].[Id]
|
|
67592
|
+
LEFT JOIN [meta].[PropertyCategoryDef] [categoryDef]
|
|
67593
|
+
ON [categoryDef].[ECInstanceId] = [pd].[Category].[Id]
|
|
67594
|
+
LEFT JOIN [meta].[ECSchemaDef] [categorySchemaDef]
|
|
67595
|
+
ON [categorySchemaDef].[ECInstanceId] = [categoryDef].[Schema].[Id]
|
|
67596
|
+
LEFT JOIN [meta].[KindOfQuantityDef] [koqDef]
|
|
67597
|
+
ON [koqDef].[ECInstanceId] = [pd].[KindOfQuantity].[Id]
|
|
67598
|
+
LEFT JOIN [meta].[ECSchemaDef] [koqSchemaDef]
|
|
67599
|
+
ON [koqSchemaDef].[ECInstanceId] = [koqDef].[Schema].[Id]
|
|
67600
|
+
LEFT JOIN [meta].[ECClassDef] [structDef]
|
|
67601
|
+
ON structDef.[ECInstanceId] = [pd].[StructClass].[Id]
|
|
67602
|
+
LEFT JOIN [meta].[ECSchemaDef] [structSchemaDef]
|
|
67603
|
+
ON [structSchemaDef].[ECInstanceId] = [structDef].[Schema].[Id]
|
|
67604
|
+
LEFT JOIN [meta].[ECClassDef] [navRelDef]
|
|
67605
|
+
ON [navRelDef].[ECInstanceId] = [pd].[NavigationRelationshipClass].[Id]
|
|
67606
|
+
LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
67607
|
+
ON [navSchemaDef].[ECInstanceId] = [navRelDef].[Schema].[Id]
|
|
67608
|
+
)
|
|
67609
67609
|
`;
|
|
67610
67610
|
/**
|
|
67611
67611
|
* Query that provides EntityClass data and is shared by two cases:
|
|
@@ -67613,52 +67613,52 @@ LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
|
67613
67613
|
* 2. When querying a full schema with multiple schema item queries or
|
|
67614
67614
|
* when just querying for Entity classes.
|
|
67615
67615
|
*/
|
|
67616
|
-
const baseEntityQuery = `
|
|
67617
|
-
SELECT
|
|
67618
|
-
[sd].[Name] as [schema],
|
|
67619
|
-
json_object (
|
|
67620
|
-
'schemaItemType', 'EntityClass',
|
|
67621
|
-
'name', [class].[Name],
|
|
67622
|
-
'label', [class].[DisplayLabel],
|
|
67623
|
-
'description', [class].[Description],
|
|
67624
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67625
|
-
'baseClass', (
|
|
67626
|
-
${selectBaseClasses}
|
|
67627
|
-
),
|
|
67628
|
-
'mixins', (
|
|
67629
|
-
SELECT
|
|
67630
|
-
json_group_array(
|
|
67631
|
-
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
67632
|
-
)
|
|
67633
|
-
FROM
|
|
67634
|
-
[meta].[ECClassDef] [baseClass]
|
|
67635
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67636
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
67637
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67638
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67639
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67640
|
-
),
|
|
67641
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
67642
|
-
'properties', (
|
|
67643
|
-
${selectProperties}
|
|
67644
|
-
)
|
|
67645
|
-
) AS [item]
|
|
67646
|
-
FROM [meta].[ECClassDef] [class]
|
|
67647
|
-
JOIN
|
|
67648
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67649
|
-
WHERE [class].[Type] = 0 AND
|
|
67650
|
-
[sd].[Name] = :schemaName
|
|
67651
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67652
|
-
AND [ca].[CustomAttributeClass].Id Is ([CoreCA].[IsMixin]))
|
|
67616
|
+
const baseEntityQuery = `
|
|
67617
|
+
SELECT
|
|
67618
|
+
[sd].[Name] as [schema],
|
|
67619
|
+
json_object (
|
|
67620
|
+
'schemaItemType', 'EntityClass',
|
|
67621
|
+
'name', [class].[Name],
|
|
67622
|
+
'label', [class].[DisplayLabel],
|
|
67623
|
+
'description', [class].[Description],
|
|
67624
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67625
|
+
'baseClass', (
|
|
67626
|
+
${selectBaseClasses}
|
|
67627
|
+
),
|
|
67628
|
+
'mixins', (
|
|
67629
|
+
SELECT
|
|
67630
|
+
json_group_array(
|
|
67631
|
+
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
67632
|
+
)
|
|
67633
|
+
FROM
|
|
67634
|
+
[meta].[ECClassDef] [baseClass]
|
|
67635
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67636
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
67637
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67638
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67639
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67640
|
+
),
|
|
67641
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
67642
|
+
'properties', (
|
|
67643
|
+
${selectProperties}
|
|
67644
|
+
)
|
|
67645
|
+
) AS [item]
|
|
67646
|
+
FROM [meta].[ECClassDef] [class]
|
|
67647
|
+
JOIN
|
|
67648
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67649
|
+
WHERE [class].[Type] = 0 AND
|
|
67650
|
+
[sd].[Name] = :schemaName
|
|
67651
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67652
|
+
AND [ca].[CustomAttributeClass].Id Is ([CoreCA].[IsMixin]))
|
|
67653
67653
|
`;
|
|
67654
67654
|
/**
|
|
67655
67655
|
* EntityClass query used to when querying for EntityClass data only. Not used
|
|
67656
67656
|
* for full Schema load via single query.
|
|
67657
67657
|
*/
|
|
67658
|
-
const entityQuery = `
|
|
67659
|
-
WITH
|
|
67660
|
-
${withClassProperties}
|
|
67661
|
-
${baseEntityQuery}
|
|
67658
|
+
const entityQuery = `
|
|
67659
|
+
WITH
|
|
67660
|
+
${withClassProperties}
|
|
67661
|
+
${baseEntityQuery}
|
|
67662
67662
|
`;
|
|
67663
67663
|
/**
|
|
67664
67664
|
* Query that provides Mixin data and is shared by two cases:
|
|
@@ -67666,56 +67666,56 @@ const entityQuery = `
|
|
|
67666
67666
|
* 2. When querying a full schema with multiple schema item queries or
|
|
67667
67667
|
* when just querying for Mixin classes.
|
|
67668
67668
|
*/
|
|
67669
|
-
const baseMixinQuery = `
|
|
67670
|
-
SELECT
|
|
67671
|
-
[sd].[Name] as [schema],
|
|
67672
|
-
json_object (
|
|
67673
|
-
'schemaItemType', 'Mixin',
|
|
67674
|
-
'name', [class].[Name],
|
|
67675
|
-
'label', [class].[DisplayLabel],
|
|
67676
|
-
'description', [class].[Description],
|
|
67677
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67678
|
-
'baseClass', (
|
|
67679
|
-
${selectBaseClasses}
|
|
67680
|
-
),
|
|
67681
|
-
'appliesTo', (
|
|
67682
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67683
|
-
FROM [AppliesToCTE] [atCTE]
|
|
67684
|
-
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
67685
|
-
),
|
|
67686
|
-
'customAttributes', (
|
|
67687
|
-
SELECT
|
|
67688
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67689
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67690
|
-
WHERE [ca].[ContainerId] = [class].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
67691
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') <> 'IsMixin'
|
|
67692
|
-
),
|
|
67693
|
-
'properties', (
|
|
67694
|
-
SELECT
|
|
67695
|
-
json_group_array(json([classProperties].[property]))
|
|
67696
|
-
FROM
|
|
67697
|
-
[ClassProperties] [classProperties]
|
|
67698
|
-
WHERE
|
|
67699
|
-
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
67700
|
-
)
|
|
67701
|
-
) AS [item]
|
|
67702
|
-
FROM [meta].[ECClassDef] [class]
|
|
67703
|
-
JOIN
|
|
67704
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67705
|
-
WHERE [class].[Type] = 0 AND
|
|
67706
|
-
[sd].[Name] = :schemaName
|
|
67707
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67708
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67669
|
+
const baseMixinQuery = `
|
|
67670
|
+
SELECT
|
|
67671
|
+
[sd].[Name] as [schema],
|
|
67672
|
+
json_object (
|
|
67673
|
+
'schemaItemType', 'Mixin',
|
|
67674
|
+
'name', [class].[Name],
|
|
67675
|
+
'label', [class].[DisplayLabel],
|
|
67676
|
+
'description', [class].[Description],
|
|
67677
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67678
|
+
'baseClass', (
|
|
67679
|
+
${selectBaseClasses}
|
|
67680
|
+
),
|
|
67681
|
+
'appliesTo', (
|
|
67682
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67683
|
+
FROM [AppliesToCTE] [atCTE]
|
|
67684
|
+
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
67685
|
+
),
|
|
67686
|
+
'customAttributes', (
|
|
67687
|
+
SELECT
|
|
67688
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67689
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67690
|
+
WHERE [ca].[ContainerId] = [class].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
67691
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') <> 'IsMixin'
|
|
67692
|
+
),
|
|
67693
|
+
'properties', (
|
|
67694
|
+
SELECT
|
|
67695
|
+
json_group_array(json([classProperties].[property]))
|
|
67696
|
+
FROM
|
|
67697
|
+
[ClassProperties] [classProperties]
|
|
67698
|
+
WHERE
|
|
67699
|
+
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
67700
|
+
)
|
|
67701
|
+
) AS [item]
|
|
67702
|
+
FROM [meta].[ECClassDef] [class]
|
|
67703
|
+
JOIN
|
|
67704
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67705
|
+
WHERE [class].[Type] = 0 AND
|
|
67706
|
+
[sd].[Name] = :schemaName
|
|
67707
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67708
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67709
67709
|
`;
|
|
67710
67710
|
/**
|
|
67711
67711
|
* Mixin query used to when querying for Mixin data only. Not used
|
|
67712
67712
|
* for full Schema load via single query.
|
|
67713
67713
|
*/
|
|
67714
|
-
const mixinQuery = `
|
|
67715
|
-
WITH
|
|
67716
|
-
${withAppliesTo},
|
|
67717
|
-
${withClassProperties}
|
|
67718
|
-
${baseMixinQuery}
|
|
67714
|
+
const mixinQuery = `
|
|
67715
|
+
WITH
|
|
67716
|
+
${withAppliesTo},
|
|
67717
|
+
${withClassProperties}
|
|
67718
|
+
${baseMixinQuery}
|
|
67719
67719
|
`;
|
|
67720
67720
|
/**
|
|
67721
67721
|
* Query that provides RelationshipClass data and is shared by two cases:
|
|
@@ -67723,82 +67723,82 @@ ${baseMixinQuery}
|
|
|
67723
67723
|
* 2. When querying a full schema with multiple schema item queries or
|
|
67724
67724
|
* when just querying for Relationship classes.
|
|
67725
67725
|
*/
|
|
67726
|
-
const baseRelationshipClassQuery = `
|
|
67727
|
-
SELECT
|
|
67728
|
-
[sd].Name as schema,
|
|
67729
|
-
json_object (
|
|
67730
|
-
'schemaItemType', 'RelationshipClass',
|
|
67731
|
-
'name', [class].[Name],
|
|
67732
|
-
'label', [class].[DisplayLabel],
|
|
67733
|
-
'description', [class].[Description],
|
|
67734
|
-
'strength', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strength)("class")},
|
|
67735
|
-
'strengthDirection', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strengthDirection)("class")},
|
|
67736
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67737
|
-
'baseClass', (
|
|
67738
|
-
${selectBaseClasses}
|
|
67739
|
-
),
|
|
67740
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
67741
|
-
'properties', (
|
|
67742
|
-
${selectProperties}
|
|
67743
|
-
),
|
|
67744
|
-
'source', (
|
|
67745
|
-
SELECT
|
|
67746
|
-
json_object (
|
|
67747
|
-
'multiplicity', [sourceConst].[Multiplicity],
|
|
67748
|
-
'roleLabel', [sourceConst].[RoleLabel],
|
|
67749
|
-
'polymorphic', IIF([sourceConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
67750
|
-
'abstractConstraint', [sourceConst].[AbstractConstraint],
|
|
67751
|
-
'constraintClasses', json([sourceConst].[ConstraintClasses]),
|
|
67752
|
-
'customAttributes', (
|
|
67753
|
-
SELECT
|
|
67754
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67755
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67756
|
-
WHERE [ca].[ContainerId] = [sourceConst].[ConstraintId] AND [ca].[ContainerType] = 1024
|
|
67757
|
-
ORDER BY [ca].[Ordinal]
|
|
67758
|
-
)
|
|
67759
|
-
)
|
|
67760
|
-
FROM
|
|
67761
|
-
[ClassRelationshipConstraints] [sourceConst]
|
|
67762
|
-
WHERE [sourceConst].[relationshipEnd] = 0
|
|
67763
|
-
AND [sourceConst].[ClassId] = [class].[ECInstanceId]
|
|
67764
|
-
),
|
|
67765
|
-
'target', (
|
|
67766
|
-
SELECT
|
|
67767
|
-
json_object (
|
|
67768
|
-
'multiplicity', [targetConst].[Multiplicity],
|
|
67769
|
-
'roleLabel', [targetConst].[RoleLabel],
|
|
67770
|
-
'polymorphic', IIF([targetConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
67771
|
-
'abstractConstraint', [targetConst].[AbstractConstraint],
|
|
67772
|
-
'constraintClasses', json([targetConst].[ConstraintClasses]),
|
|
67773
|
-
'customAttributes', (
|
|
67774
|
-
SELECT
|
|
67775
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67776
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
67777
|
-
WHERE [ca].[ContainerId] = [targetConst].[ConstraintId] AND [ca].[ContainerType] = 2048
|
|
67778
|
-
ORDER BY [ca].[Ordinal]
|
|
67779
|
-
)
|
|
67780
|
-
)
|
|
67781
|
-
FROM
|
|
67782
|
-
[ClassRelationshipConstraints] [targetConst]
|
|
67783
|
-
WHERE [targetConst].[relationshipEnd] = 1
|
|
67784
|
-
AND [targetConst].[ClassId] = [class].[ECInstanceId]
|
|
67785
|
-
)
|
|
67786
|
-
) AS [item]
|
|
67787
|
-
FROM [meta].[ECClassDef] [class]
|
|
67788
|
-
JOIN
|
|
67789
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67790
|
-
WHERE [class].[Type] = 1 AND
|
|
67791
|
-
[sd].[Name] = :schemaName
|
|
67726
|
+
const baseRelationshipClassQuery = `
|
|
67727
|
+
SELECT
|
|
67728
|
+
[sd].Name as schema,
|
|
67729
|
+
json_object (
|
|
67730
|
+
'schemaItemType', 'RelationshipClass',
|
|
67731
|
+
'name', [class].[Name],
|
|
67732
|
+
'label', [class].[DisplayLabel],
|
|
67733
|
+
'description', [class].[Description],
|
|
67734
|
+
'strength', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strength)("class")},
|
|
67735
|
+
'strengthDirection', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strengthDirection)("class")},
|
|
67736
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67737
|
+
'baseClass', (
|
|
67738
|
+
${selectBaseClasses}
|
|
67739
|
+
),
|
|
67740
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
67741
|
+
'properties', (
|
|
67742
|
+
${selectProperties}
|
|
67743
|
+
),
|
|
67744
|
+
'source', (
|
|
67745
|
+
SELECT
|
|
67746
|
+
json_object (
|
|
67747
|
+
'multiplicity', [sourceConst].[Multiplicity],
|
|
67748
|
+
'roleLabel', [sourceConst].[RoleLabel],
|
|
67749
|
+
'polymorphic', IIF([sourceConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
67750
|
+
'abstractConstraint', [sourceConst].[AbstractConstraint],
|
|
67751
|
+
'constraintClasses', json([sourceConst].[ConstraintClasses]),
|
|
67752
|
+
'customAttributes', (
|
|
67753
|
+
SELECT
|
|
67754
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67755
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67756
|
+
WHERE [ca].[ContainerId] = [sourceConst].[ConstraintId] AND [ca].[ContainerType] = 1024
|
|
67757
|
+
ORDER BY [ca].[Ordinal]
|
|
67758
|
+
)
|
|
67759
|
+
)
|
|
67760
|
+
FROM
|
|
67761
|
+
[ClassRelationshipConstraints] [sourceConst]
|
|
67762
|
+
WHERE [sourceConst].[relationshipEnd] = 0
|
|
67763
|
+
AND [sourceConst].[ClassId] = [class].[ECInstanceId]
|
|
67764
|
+
),
|
|
67765
|
+
'target', (
|
|
67766
|
+
SELECT
|
|
67767
|
+
json_object (
|
|
67768
|
+
'multiplicity', [targetConst].[Multiplicity],
|
|
67769
|
+
'roleLabel', [targetConst].[RoleLabel],
|
|
67770
|
+
'polymorphic', IIF([targetConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
67771
|
+
'abstractConstraint', [targetConst].[AbstractConstraint],
|
|
67772
|
+
'constraintClasses', json([targetConst].[ConstraintClasses]),
|
|
67773
|
+
'customAttributes', (
|
|
67774
|
+
SELECT
|
|
67775
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
67776
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
67777
|
+
WHERE [ca].[ContainerId] = [targetConst].[ConstraintId] AND [ca].[ContainerType] = 2048
|
|
67778
|
+
ORDER BY [ca].[Ordinal]
|
|
67779
|
+
)
|
|
67780
|
+
)
|
|
67781
|
+
FROM
|
|
67782
|
+
[ClassRelationshipConstraints] [targetConst]
|
|
67783
|
+
WHERE [targetConst].[relationshipEnd] = 1
|
|
67784
|
+
AND [targetConst].[ClassId] = [class].[ECInstanceId]
|
|
67785
|
+
)
|
|
67786
|
+
) AS [item]
|
|
67787
|
+
FROM [meta].[ECClassDef] [class]
|
|
67788
|
+
JOIN
|
|
67789
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67790
|
+
WHERE [class].[Type] = 1 AND
|
|
67791
|
+
[sd].[Name] = :schemaName
|
|
67792
67792
|
`;
|
|
67793
67793
|
/**
|
|
67794
67794
|
* RelationshipClass query used to when querying for RelationshipClass data only. Not used
|
|
67795
67795
|
* for full Schema load via single query.
|
|
67796
67796
|
*/
|
|
67797
|
-
const relationshipClassQuery = `
|
|
67798
|
-
WITH
|
|
67799
|
-
${withClassProperties},
|
|
67800
|
-
${withRelationshipConstraints}
|
|
67801
|
-
${baseRelationshipClassQuery}
|
|
67797
|
+
const relationshipClassQuery = `
|
|
67798
|
+
WITH
|
|
67799
|
+
${withClassProperties},
|
|
67800
|
+
${withRelationshipConstraints}
|
|
67801
|
+
${baseRelationshipClassQuery}
|
|
67802
67802
|
`;
|
|
67803
67803
|
/**
|
|
67804
67804
|
* Query that provides StructClass data and is shared by two cases:
|
|
@@ -67806,37 +67806,37 @@ ${baseRelationshipClassQuery}
|
|
|
67806
67806
|
* 2. When querying a full schema with multiple schema item queries or
|
|
67807
67807
|
* when just querying for Struct classes.
|
|
67808
67808
|
*/
|
|
67809
|
-
const baseStructQuery = `
|
|
67810
|
-
SELECT
|
|
67811
|
-
[sd].Name as schema,
|
|
67812
|
-
json_object (
|
|
67813
|
-
'schemaItemType', 'StructClass',
|
|
67814
|
-
'name', [class].[Name],
|
|
67815
|
-
'label', [class].[DisplayLabel],
|
|
67816
|
-
'description', [class].[Description],
|
|
67817
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67818
|
-
'baseClass', (
|
|
67819
|
-
${selectBaseClasses}
|
|
67820
|
-
),
|
|
67821
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
67822
|
-
'properties', (
|
|
67823
|
-
${selectProperties}
|
|
67824
|
-
)
|
|
67825
|
-
) AS item
|
|
67826
|
-
FROM [meta].[ECClassDef] [class]
|
|
67827
|
-
JOIN
|
|
67828
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67829
|
-
WHERE [class].[Type] = 2 AND
|
|
67830
|
-
[sd].[Name] = :schemaName
|
|
67809
|
+
const baseStructQuery = `
|
|
67810
|
+
SELECT
|
|
67811
|
+
[sd].Name as schema,
|
|
67812
|
+
json_object (
|
|
67813
|
+
'schemaItemType', 'StructClass',
|
|
67814
|
+
'name', [class].[Name],
|
|
67815
|
+
'label', [class].[DisplayLabel],
|
|
67816
|
+
'description', [class].[Description],
|
|
67817
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67818
|
+
'baseClass', (
|
|
67819
|
+
${selectBaseClasses}
|
|
67820
|
+
),
|
|
67821
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
67822
|
+
'properties', (
|
|
67823
|
+
${selectProperties}
|
|
67824
|
+
)
|
|
67825
|
+
) AS item
|
|
67826
|
+
FROM [meta].[ECClassDef] [class]
|
|
67827
|
+
JOIN
|
|
67828
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67829
|
+
WHERE [class].[Type] = 2 AND
|
|
67830
|
+
[sd].[Name] = :schemaName
|
|
67831
67831
|
`;
|
|
67832
67832
|
/**
|
|
67833
67833
|
* StructClass query used to when querying for StructClass data only. Not used
|
|
67834
67834
|
* for full Schema load via single query.
|
|
67835
67835
|
*/
|
|
67836
|
-
const structQuery = `
|
|
67837
|
-
WITH
|
|
67838
|
-
${withClassProperties}
|
|
67839
|
-
${baseStructQuery}
|
|
67836
|
+
const structQuery = `
|
|
67837
|
+
WITH
|
|
67838
|
+
${withClassProperties}
|
|
67839
|
+
${baseStructQuery}
|
|
67840
67840
|
`;
|
|
67841
67841
|
/**
|
|
67842
67842
|
* Query that provides CustomAttributeClass data and is shared by two cases:
|
|
@@ -67844,141 +67844,141 @@ ${baseStructQuery}
|
|
|
67844
67844
|
* 2. When querying a full schema with multiple schema item queries or
|
|
67845
67845
|
* when just querying for CustomAttribute classes.
|
|
67846
67846
|
*/
|
|
67847
|
-
const baseCustomAttributeQuery = `
|
|
67848
|
-
SELECT
|
|
67849
|
-
[sd].Name as schema,
|
|
67850
|
-
json_object (
|
|
67851
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
67852
|
-
'name', [class].[Name],
|
|
67853
|
-
'label', [class].[DisplayLabel],
|
|
67854
|
-
'description', [class].[Description],
|
|
67855
|
-
'appliesTo', [class].[CustomAttributeContainerType],
|
|
67856
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67857
|
-
'baseClass', (
|
|
67858
|
-
${selectBaseClasses}
|
|
67859
|
-
),
|
|
67860
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
67861
|
-
'properties', (
|
|
67862
|
-
${selectProperties}
|
|
67863
|
-
)
|
|
67864
|
-
) AS [item]
|
|
67865
|
-
FROM [meta].[ECClassDef] [class]
|
|
67866
|
-
JOIN
|
|
67867
|
-
[meta].[ECSchemaDef] sd ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67868
|
-
WHERE [class].[Type] = 3 AND
|
|
67869
|
-
[sd].[Name] = :schemaName
|
|
67847
|
+
const baseCustomAttributeQuery = `
|
|
67848
|
+
SELECT
|
|
67849
|
+
[sd].Name as schema,
|
|
67850
|
+
json_object (
|
|
67851
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
67852
|
+
'name', [class].[Name],
|
|
67853
|
+
'label', [class].[DisplayLabel],
|
|
67854
|
+
'description', [class].[Description],
|
|
67855
|
+
'appliesTo', [class].[CustomAttributeContainerType],
|
|
67856
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
67857
|
+
'baseClass', (
|
|
67858
|
+
${selectBaseClasses}
|
|
67859
|
+
),
|
|
67860
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
67861
|
+
'properties', (
|
|
67862
|
+
${selectProperties}
|
|
67863
|
+
)
|
|
67864
|
+
) AS [item]
|
|
67865
|
+
FROM [meta].[ECClassDef] [class]
|
|
67866
|
+
JOIN
|
|
67867
|
+
[meta].[ECSchemaDef] sd ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
67868
|
+
WHERE [class].[Type] = 3 AND
|
|
67869
|
+
[sd].[Name] = :schemaName
|
|
67870
67870
|
`;
|
|
67871
67871
|
/**
|
|
67872
67872
|
* CustomAttributeClass query used to when querying for CustomAttributeClass data only. Not used
|
|
67873
67873
|
* for full Schema load via single query.
|
|
67874
67874
|
*/
|
|
67875
|
-
const customAttributeQuery = `
|
|
67876
|
-
WITH
|
|
67877
|
-
${withClassProperties}
|
|
67878
|
-
${baseCustomAttributeQuery}
|
|
67875
|
+
const customAttributeQuery = `
|
|
67876
|
+
WITH
|
|
67877
|
+
${withClassProperties}
|
|
67878
|
+
${baseCustomAttributeQuery}
|
|
67879
67879
|
`;
|
|
67880
67880
|
/**
|
|
67881
67881
|
* Used by full schema load query via single query. Allows
|
|
67882
67882
|
* all SchemaItemTypes to be queried at once.
|
|
67883
67883
|
*/
|
|
67884
|
-
const withSchemaItems = `
|
|
67885
|
-
SchemaItems AS (
|
|
67886
|
-
${baseEntityQuery}
|
|
67887
|
-
UNION ALL
|
|
67888
|
-
${baseRelationshipClassQuery}
|
|
67889
|
-
UNION ALL
|
|
67890
|
-
${baseStructQuery}
|
|
67891
|
-
UNION ALL
|
|
67892
|
-
${baseMixinQuery}
|
|
67893
|
-
UNION ALL
|
|
67894
|
-
${baseCustomAttributeQuery}
|
|
67895
|
-
UNION ALL
|
|
67896
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity(true)}
|
|
67897
|
-
UNION ALL
|
|
67898
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration(true)}
|
|
67899
|
-
UNION ALL
|
|
67900
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory(true)}
|
|
67901
|
-
UNION ALL
|
|
67902
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit(true)}
|
|
67903
|
-
UNION ALL
|
|
67904
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit(true)}
|
|
67905
|
-
UNION ALL
|
|
67906
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem(true)}
|
|
67907
|
-
UNION ALL
|
|
67908
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant(true)}
|
|
67909
|
-
UNION ALL
|
|
67910
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon(true)}
|
|
67911
|
-
UNION ALL
|
|
67912
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format(true)}
|
|
67913
|
-
)
|
|
67884
|
+
const withSchemaItems = `
|
|
67885
|
+
SchemaItems AS (
|
|
67886
|
+
${baseEntityQuery}
|
|
67887
|
+
UNION ALL
|
|
67888
|
+
${baseRelationshipClassQuery}
|
|
67889
|
+
UNION ALL
|
|
67890
|
+
${baseStructQuery}
|
|
67891
|
+
UNION ALL
|
|
67892
|
+
${baseMixinQuery}
|
|
67893
|
+
UNION ALL
|
|
67894
|
+
${baseCustomAttributeQuery}
|
|
67895
|
+
UNION ALL
|
|
67896
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity(true)}
|
|
67897
|
+
UNION ALL
|
|
67898
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration(true)}
|
|
67899
|
+
UNION ALL
|
|
67900
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory(true)}
|
|
67901
|
+
UNION ALL
|
|
67902
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit(true)}
|
|
67903
|
+
UNION ALL
|
|
67904
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit(true)}
|
|
67905
|
+
UNION ALL
|
|
67906
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem(true)}
|
|
67907
|
+
UNION ALL
|
|
67908
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant(true)}
|
|
67909
|
+
UNION ALL
|
|
67910
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon(true)}
|
|
67911
|
+
UNION ALL
|
|
67912
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format(true)}
|
|
67913
|
+
)
|
|
67914
67914
|
`;
|
|
67915
67915
|
/**
|
|
67916
67916
|
* Query for Schema data without SchemaItems
|
|
67917
67917
|
*/
|
|
67918
|
-
const schemaNoItemsQuery = `
|
|
67919
|
-
WITH
|
|
67920
|
-
${withSchemaReferences}
|
|
67921
|
-
SELECT
|
|
67922
|
-
json_object (
|
|
67923
|
-
'name', [schemaDef].[Name],
|
|
67924
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
67925
|
-
'alias', [schemaDef].[Alias],
|
|
67926
|
-
'label', [schemaDef].[DisplayLabel],
|
|
67927
|
-
'description', [schemaDef].[Description],
|
|
67928
|
-
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
67929
|
-
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
67930
|
-
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
67931
|
-
'references', (
|
|
67932
|
-
SELECT
|
|
67933
|
-
json_group_array(json([schemaReferences].[reference]))
|
|
67934
|
-
FROM
|
|
67935
|
-
[SchemaReferences] [schemaReferences]
|
|
67936
|
-
WHERE
|
|
67937
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67938
|
-
)
|
|
67939
|
-
) as [schema]
|
|
67940
|
-
FROM
|
|
67941
|
-
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
67918
|
+
const schemaNoItemsQuery = `
|
|
67919
|
+
WITH
|
|
67920
|
+
${withSchemaReferences}
|
|
67921
|
+
SELECT
|
|
67922
|
+
json_object (
|
|
67923
|
+
'name', [schemaDef].[Name],
|
|
67924
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
67925
|
+
'alias', [schemaDef].[Alias],
|
|
67926
|
+
'label', [schemaDef].[DisplayLabel],
|
|
67927
|
+
'description', [schemaDef].[Description],
|
|
67928
|
+
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
67929
|
+
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
67930
|
+
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
67931
|
+
'references', (
|
|
67932
|
+
SELECT
|
|
67933
|
+
json_group_array(json([schemaReferences].[reference]))
|
|
67934
|
+
FROM
|
|
67935
|
+
[SchemaReferences] [schemaReferences]
|
|
67936
|
+
WHERE
|
|
67937
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67938
|
+
)
|
|
67939
|
+
) as [schema]
|
|
67940
|
+
FROM
|
|
67941
|
+
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
67942
67942
|
`;
|
|
67943
67943
|
/**
|
|
67944
67944
|
* Query to load a full Schema via a single query.
|
|
67945
67945
|
*/
|
|
67946
|
-
const schemaQuery = `
|
|
67947
|
-
WITH
|
|
67948
|
-
${withAppliesTo},
|
|
67949
|
-
${withSchemaReferences},
|
|
67950
|
-
${withClassProperties},
|
|
67951
|
-
${withRelationshipConstraints},
|
|
67952
|
-
${withSchemaItems}
|
|
67953
|
-
SELECT
|
|
67954
|
-
json_object (
|
|
67955
|
-
'name', [schemaDef].[Name],
|
|
67956
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
67957
|
-
'alias', [schemaDef].[Alias],
|
|
67958
|
-
'label', [schemaDef].[DisplayLabel],
|
|
67959
|
-
'description', [schemaDef].[Description],
|
|
67960
|
-
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
67961
|
-
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
67962
|
-
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
67963
|
-
'references', (
|
|
67964
|
-
SELECT
|
|
67965
|
-
json_group_array(json([schemaReferences].[reference]))
|
|
67966
|
-
FROM
|
|
67967
|
-
[SchemaReferences] [schemaReferences]
|
|
67968
|
-
WHERE
|
|
67969
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67970
|
-
),
|
|
67971
|
-
'items', (
|
|
67972
|
-
SELECT
|
|
67973
|
-
json_group_array(json(json_object(
|
|
67974
|
-
'item', json([items].[item])
|
|
67975
|
-
)))
|
|
67976
|
-
FROM
|
|
67977
|
-
[SchemaItems] [items]
|
|
67978
|
-
)
|
|
67979
|
-
) as [schema]
|
|
67980
|
-
FROM
|
|
67981
|
-
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
67946
|
+
const schemaQuery = `
|
|
67947
|
+
WITH
|
|
67948
|
+
${withAppliesTo},
|
|
67949
|
+
${withSchemaReferences},
|
|
67950
|
+
${withClassProperties},
|
|
67951
|
+
${withRelationshipConstraints},
|
|
67952
|
+
${withSchemaItems}
|
|
67953
|
+
SELECT
|
|
67954
|
+
json_object (
|
|
67955
|
+
'name', [schemaDef].[Name],
|
|
67956
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
67957
|
+
'alias', [schemaDef].[Alias],
|
|
67958
|
+
'label', [schemaDef].[DisplayLabel],
|
|
67959
|
+
'description', [schemaDef].[Description],
|
|
67960
|
+
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
67961
|
+
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
67962
|
+
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
67963
|
+
'references', (
|
|
67964
|
+
SELECT
|
|
67965
|
+
json_group_array(json([schemaReferences].[reference]))
|
|
67966
|
+
FROM
|
|
67967
|
+
[SchemaReferences] [schemaReferences]
|
|
67968
|
+
WHERE
|
|
67969
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67970
|
+
),
|
|
67971
|
+
'items', (
|
|
67972
|
+
SELECT
|
|
67973
|
+
json_group_array(json(json_object(
|
|
67974
|
+
'item', json([items].[item])
|
|
67975
|
+
)))
|
|
67976
|
+
FROM
|
|
67977
|
+
[SchemaItems] [items]
|
|
67978
|
+
)
|
|
67979
|
+
) as [schema]
|
|
67980
|
+
FROM
|
|
67981
|
+
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
67982
67982
|
`;
|
|
67983
67983
|
/**
|
|
67984
67984
|
* Queries for loading full Schema JSON.
|
|
@@ -68484,281 +68484,281 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68484
68484
|
* Query for SchemaItemType KindOfQuantity data.
|
|
68485
68485
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68486
68486
|
*/
|
|
68487
|
-
const kindOfQuantity = (singleSchema) => `
|
|
68488
|
-
SELECT
|
|
68489
|
-
[koq].[Schema].[Id] AS [SchemaId],
|
|
68490
|
-
json_object (
|
|
68491
|
-
'schemaItemType', 'KindOfQuantity',
|
|
68492
|
-
'name', [koq].[Name],
|
|
68493
|
-
'label', [koq].[DisplayLabel],
|
|
68494
|
-
'description', [koq].[Description],
|
|
68495
|
-
'relativeError', [koq].[RelativeError],
|
|
68496
|
-
'persistenceUnit', [koq].[PersistenceUnit]
|
|
68497
|
-
${singleSchema ? `
|
|
68498
|
-
,'presentationUnits', (
|
|
68499
|
-
SELECT json_group_array(js."value")
|
|
68500
|
-
FROM [meta].[KindOfQuantityDef] [koq1], json1.json_each([PresentationUnits]) js
|
|
68501
|
-
WHERE [koq1].[ECInstanceId] = [koq].[ECInstanceId]
|
|
68502
|
-
) ` : ""}
|
|
68503
|
-
) as [item]
|
|
68504
|
-
FROM
|
|
68505
|
-
[meta].[KindOfQuantityDef] [koq]
|
|
68506
|
-
${singleSchema ? `
|
|
68507
|
-
JOIN
|
|
68508
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [koq].[Schema].[Id]
|
|
68509
|
-
WHERE [schema].[Name] = :schemaName
|
|
68510
|
-
` : ""}
|
|
68487
|
+
const kindOfQuantity = (singleSchema) => `
|
|
68488
|
+
SELECT
|
|
68489
|
+
[koq].[Schema].[Id] AS [SchemaId],
|
|
68490
|
+
json_object (
|
|
68491
|
+
'schemaItemType', 'KindOfQuantity',
|
|
68492
|
+
'name', [koq].[Name],
|
|
68493
|
+
'label', [koq].[DisplayLabel],
|
|
68494
|
+
'description', [koq].[Description],
|
|
68495
|
+
'relativeError', [koq].[RelativeError],
|
|
68496
|
+
'persistenceUnit', [koq].[PersistenceUnit]
|
|
68497
|
+
${singleSchema ? `
|
|
68498
|
+
,'presentationUnits', (
|
|
68499
|
+
SELECT json_group_array(js."value")
|
|
68500
|
+
FROM [meta].[KindOfQuantityDef] [koq1], json1.json_each([PresentationUnits]) js
|
|
68501
|
+
WHERE [koq1].[ECInstanceId] = [koq].[ECInstanceId]
|
|
68502
|
+
) ` : ""}
|
|
68503
|
+
) as [item]
|
|
68504
|
+
FROM
|
|
68505
|
+
[meta].[KindOfQuantityDef] [koq]
|
|
68506
|
+
${singleSchema ? `
|
|
68507
|
+
JOIN
|
|
68508
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [koq].[Schema].[Id]
|
|
68509
|
+
WHERE [schema].[Name] = :schemaName
|
|
68510
|
+
` : ""}
|
|
68511
68511
|
`;
|
|
68512
68512
|
/**
|
|
68513
68513
|
* Query for SchemaItemType PropertyCategory data.
|
|
68514
68514
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68515
68515
|
*/
|
|
68516
|
-
const propertyCategory = (singleSchema) => `
|
|
68517
|
-
SELECT
|
|
68518
|
-
[pc].[Schema].[Id] AS [SchemaId],
|
|
68519
|
-
json_object (
|
|
68520
|
-
'schemaItemType', 'PropertyCategory',
|
|
68521
|
-
'name', [pc].[Name],
|
|
68522
|
-
'label', [pc].[DisplayLabel],
|
|
68523
|
-
'description', [pc].[Description],
|
|
68524
|
-
'priority', [pc].[Priority]
|
|
68525
|
-
) as [item]
|
|
68526
|
-
FROM
|
|
68527
|
-
[meta].[PropertyCategoryDef] [pc]
|
|
68528
|
-
${singleSchema ? `
|
|
68529
|
-
JOIN
|
|
68530
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pc].[Schema].[Id]
|
|
68531
|
-
WHERE [schema].[Name] = :schemaName
|
|
68532
|
-
` : ""}
|
|
68516
|
+
const propertyCategory = (singleSchema) => `
|
|
68517
|
+
SELECT
|
|
68518
|
+
[pc].[Schema].[Id] AS [SchemaId],
|
|
68519
|
+
json_object (
|
|
68520
|
+
'schemaItemType', 'PropertyCategory',
|
|
68521
|
+
'name', [pc].[Name],
|
|
68522
|
+
'label', [pc].[DisplayLabel],
|
|
68523
|
+
'description', [pc].[Description],
|
|
68524
|
+
'priority', [pc].[Priority]
|
|
68525
|
+
) as [item]
|
|
68526
|
+
FROM
|
|
68527
|
+
[meta].[PropertyCategoryDef] [pc]
|
|
68528
|
+
${singleSchema ? `
|
|
68529
|
+
JOIN
|
|
68530
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pc].[Schema].[Id]
|
|
68531
|
+
WHERE [schema].[Name] = :schemaName
|
|
68532
|
+
` : ""}
|
|
68533
68533
|
`;
|
|
68534
68534
|
/**
|
|
68535
68535
|
* Query for SchemaItemType Enumeration data.
|
|
68536
68536
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68537
68537
|
*/
|
|
68538
|
-
const enumeration = (singleSchema) => `
|
|
68539
|
-
SELECT
|
|
68540
|
-
[ed].[Schema].[Id] AS [SchemaId],
|
|
68541
|
-
json_object (
|
|
68542
|
-
'schemaItemType', 'Enumeration',
|
|
68543
|
-
'name', [ed].[Name],
|
|
68544
|
-
'label', [ed].[DisplayLabel],
|
|
68545
|
-
'description', [ed].[Description],
|
|
68546
|
-
'type', IIF([ed].[Type] = 1281, 'int', IIF([ed].[Type] = 2305, 'string', null)),
|
|
68547
|
-
'isStrict', IIF([ed].[IsStrict] = 1, json('true'), json('false')),
|
|
68548
|
-
'enumerators', (
|
|
68549
|
-
SELECT json_group_array(json(json_object(
|
|
68550
|
-
'name', json_extract(js."value", '$.Name'),
|
|
68551
|
-
'value', IFNULL(json_extract(js."value", '$.StringValue'), (json_extract(js."value", '$.IntValue'))),
|
|
68552
|
-
'label', json_extract(js."value", '$.DisplayLabel'),
|
|
68553
|
-
'description', json_extract(js."value", '$.Description')
|
|
68554
|
-
)))
|
|
68555
|
-
FROM [meta].[ECEnumerationDef] [enumerationDef], json1.json_each([EnumValues]) js
|
|
68556
|
-
WHERE [enumerationDef].[ECInstanceId] = [ed].[ECInstanceId]
|
|
68557
|
-
)
|
|
68558
|
-
) as [item]
|
|
68559
|
-
FROM
|
|
68560
|
-
[meta].[ECEnumerationDef] [ed]
|
|
68561
|
-
${singleSchema ? `
|
|
68562
|
-
JOIN
|
|
68563
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ed].[Schema].[Id]
|
|
68564
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68538
|
+
const enumeration = (singleSchema) => `
|
|
68539
|
+
SELECT
|
|
68540
|
+
[ed].[Schema].[Id] AS [SchemaId],
|
|
68541
|
+
json_object (
|
|
68542
|
+
'schemaItemType', 'Enumeration',
|
|
68543
|
+
'name', [ed].[Name],
|
|
68544
|
+
'label', [ed].[DisplayLabel],
|
|
68545
|
+
'description', [ed].[Description],
|
|
68546
|
+
'type', IIF([ed].[Type] = 1281, 'int', IIF([ed].[Type] = 2305, 'string', null)),
|
|
68547
|
+
'isStrict', IIF([ed].[IsStrict] = 1, json('true'), json('false')),
|
|
68548
|
+
'enumerators', (
|
|
68549
|
+
SELECT json_group_array(json(json_object(
|
|
68550
|
+
'name', json_extract(js."value", '$.Name'),
|
|
68551
|
+
'value', IFNULL(json_extract(js."value", '$.StringValue'), (json_extract(js."value", '$.IntValue'))),
|
|
68552
|
+
'label', json_extract(js."value", '$.DisplayLabel'),
|
|
68553
|
+
'description', json_extract(js."value", '$.Description')
|
|
68554
|
+
)))
|
|
68555
|
+
FROM [meta].[ECEnumerationDef] [enumerationDef], json1.json_each([EnumValues]) js
|
|
68556
|
+
WHERE [enumerationDef].[ECInstanceId] = [ed].[ECInstanceId]
|
|
68557
|
+
)
|
|
68558
|
+
) as [item]
|
|
68559
|
+
FROM
|
|
68560
|
+
[meta].[ECEnumerationDef] [ed]
|
|
68561
|
+
${singleSchema ? `
|
|
68562
|
+
JOIN
|
|
68563
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ed].[Schema].[Id]
|
|
68564
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68565
68565
|
`;
|
|
68566
68566
|
/**
|
|
68567
68567
|
* Query for SchemaItemType Unit data.
|
|
68568
68568
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68569
68569
|
*/
|
|
68570
|
-
const unit = (singleSchema) => `
|
|
68571
|
-
SELECT
|
|
68572
|
-
[ud].[Schema].[Id] AS [SchemaId],
|
|
68573
|
-
json_object (
|
|
68574
|
-
'schemaItemType', 'Unit',
|
|
68575
|
-
'name', [ud].[Name],
|
|
68576
|
-
'label', [ud].[DisplayLabel],
|
|
68577
|
-
'description', [ud].[Description],
|
|
68578
|
-
'definition', [ud].[Definition],
|
|
68579
|
-
'numerator', IIF([ud].[Numerator] IS NULL, NULL, json(format('%.16g', [ud].[Numerator]))),
|
|
68580
|
-
'denominator', IIF([ud].[Denominator] IS NULL, NULL, json(format('%.16g', [ud].[Denominator]))),
|
|
68581
|
-
'offset', IIF([ud].[Offset] IS NULL, NULL, json(format('%!.15f', [ud].[Offset]))),
|
|
68582
|
-
'unitSystem', CONCAT([uss].[Name],'.', [usd].[Name]),
|
|
68583
|
-
'phenomenon', CONCAT([ps].[Name],'.', [pd].[Name])
|
|
68584
|
-
) as item
|
|
68585
|
-
FROM
|
|
68586
|
-
[meta].[UnitDef] [ud]
|
|
68587
|
-
${singleSchema ? `
|
|
68588
|
-
JOIN
|
|
68589
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
68590
|
-
JOIN [meta].[UnitSystemDef] [usd]
|
|
68591
|
-
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
68592
|
-
JOIN [meta].[ECSchemaDef] [uss]
|
|
68593
|
-
ON [uss].[ECInstanceId] = [usd].[Schema].[Id]
|
|
68594
|
-
JOIN [meta].[PhenomenonDef] [pd]
|
|
68595
|
-
ON [pd].[ECInstanceId] = [ud].[Phenomenon].[Id]
|
|
68596
|
-
JOIN [meta].[ECSchemaDef] [ps]
|
|
68597
|
-
ON [ps].[ECInstanceId] = [pd].[Schema].[Id]
|
|
68598
|
-
WHERE
|
|
68599
|
-
${singleSchema ? `
|
|
68600
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
68601
|
-
[ud].[IsConstant] = 0 AND
|
|
68602
|
-
[ud].[InvertingUnit] IS NULL
|
|
68570
|
+
const unit = (singleSchema) => `
|
|
68571
|
+
SELECT
|
|
68572
|
+
[ud].[Schema].[Id] AS [SchemaId],
|
|
68573
|
+
json_object (
|
|
68574
|
+
'schemaItemType', 'Unit',
|
|
68575
|
+
'name', [ud].[Name],
|
|
68576
|
+
'label', [ud].[DisplayLabel],
|
|
68577
|
+
'description', [ud].[Description],
|
|
68578
|
+
'definition', [ud].[Definition],
|
|
68579
|
+
'numerator', IIF([ud].[Numerator] IS NULL, NULL, json(format('%.16g', [ud].[Numerator]))),
|
|
68580
|
+
'denominator', IIF([ud].[Denominator] IS NULL, NULL, json(format('%.16g', [ud].[Denominator]))),
|
|
68581
|
+
'offset', IIF([ud].[Offset] IS NULL, NULL, json(format('%!.15f', [ud].[Offset]))),
|
|
68582
|
+
'unitSystem', CONCAT([uss].[Name],'.', [usd].[Name]),
|
|
68583
|
+
'phenomenon', CONCAT([ps].[Name],'.', [pd].[Name])
|
|
68584
|
+
) as item
|
|
68585
|
+
FROM
|
|
68586
|
+
[meta].[UnitDef] [ud]
|
|
68587
|
+
${singleSchema ? `
|
|
68588
|
+
JOIN
|
|
68589
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
68590
|
+
JOIN [meta].[UnitSystemDef] [usd]
|
|
68591
|
+
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
68592
|
+
JOIN [meta].[ECSchemaDef] [uss]
|
|
68593
|
+
ON [uss].[ECInstanceId] = [usd].[Schema].[Id]
|
|
68594
|
+
JOIN [meta].[PhenomenonDef] [pd]
|
|
68595
|
+
ON [pd].[ECInstanceId] = [ud].[Phenomenon].[Id]
|
|
68596
|
+
JOIN [meta].[ECSchemaDef] [ps]
|
|
68597
|
+
ON [ps].[ECInstanceId] = [pd].[Schema].[Id]
|
|
68598
|
+
WHERE
|
|
68599
|
+
${singleSchema ? `
|
|
68600
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
68601
|
+
[ud].[IsConstant] = 0 AND
|
|
68602
|
+
[ud].[InvertingUnit] IS NULL
|
|
68603
68603
|
`;
|
|
68604
68604
|
/**
|
|
68605
68605
|
* Query for SchemaItemType InvertedUnit data.
|
|
68606
68606
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68607
68607
|
*/
|
|
68608
|
-
const invertedUnit = (singleSchema) => `
|
|
68609
|
-
SELECT
|
|
68610
|
-
[ud].[Schema].[Id] AS [SchemaId],
|
|
68611
|
-
json_object (
|
|
68612
|
-
'schemaItemType', 'InvertedUnit',
|
|
68613
|
-
'name', [ud].[Name],
|
|
68614
|
-
'label', [ud].[DisplayLabel],
|
|
68615
|
-
'description', [ud].[Description],
|
|
68616
|
-
'unitSystem', CONCAT([systemSchema].[Name],'.', [usd].[Name]),
|
|
68617
|
-
'invertsUnit', IIF([iud].[Name] IS NULL, null, CONCAT([ius].[Name],'.', [iud].[Name]))
|
|
68618
|
-
) as [item]
|
|
68619
|
-
FROM
|
|
68620
|
-
[meta].[UnitDef] [ud]
|
|
68621
|
-
${singleSchema ? `
|
|
68622
|
-
JOIN
|
|
68623
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
68624
|
-
JOIN [meta].[UnitSystemDef] [usd]
|
|
68625
|
-
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
68626
|
-
JOIN [meta].[ECSchemaDef] [systemSchema]
|
|
68627
|
-
ON [systemSchema].[ECInstanceId] = [usd].[Schema].[Id]
|
|
68628
|
-
LEFT JOIN [meta].[UnitDef] [iud]
|
|
68629
|
-
ON [iud].[ECInstanceId] = [ud].[InvertingUnit].[Id]
|
|
68630
|
-
LEFT JOIN [meta].[ECSchemaDef] [ius]
|
|
68631
|
-
ON [ius].[ECInstanceId] = [iud].[Schema].[Id]
|
|
68632
|
-
WHERE
|
|
68633
|
-
${singleSchema ? `
|
|
68634
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
68635
|
-
[ud].[IsConstant] = 0 AND
|
|
68636
|
-
[ud].[InvertingUnit] IS NOT NULL
|
|
68608
|
+
const invertedUnit = (singleSchema) => `
|
|
68609
|
+
SELECT
|
|
68610
|
+
[ud].[Schema].[Id] AS [SchemaId],
|
|
68611
|
+
json_object (
|
|
68612
|
+
'schemaItemType', 'InvertedUnit',
|
|
68613
|
+
'name', [ud].[Name],
|
|
68614
|
+
'label', [ud].[DisplayLabel],
|
|
68615
|
+
'description', [ud].[Description],
|
|
68616
|
+
'unitSystem', CONCAT([systemSchema].[Name],'.', [usd].[Name]),
|
|
68617
|
+
'invertsUnit', IIF([iud].[Name] IS NULL, null, CONCAT([ius].[Name],'.', [iud].[Name]))
|
|
68618
|
+
) as [item]
|
|
68619
|
+
FROM
|
|
68620
|
+
[meta].[UnitDef] [ud]
|
|
68621
|
+
${singleSchema ? `
|
|
68622
|
+
JOIN
|
|
68623
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
68624
|
+
JOIN [meta].[UnitSystemDef] [usd]
|
|
68625
|
+
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
68626
|
+
JOIN [meta].[ECSchemaDef] [systemSchema]
|
|
68627
|
+
ON [systemSchema].[ECInstanceId] = [usd].[Schema].[Id]
|
|
68628
|
+
LEFT JOIN [meta].[UnitDef] [iud]
|
|
68629
|
+
ON [iud].[ECInstanceId] = [ud].[InvertingUnit].[Id]
|
|
68630
|
+
LEFT JOIN [meta].[ECSchemaDef] [ius]
|
|
68631
|
+
ON [ius].[ECInstanceId] = [iud].[Schema].[Id]
|
|
68632
|
+
WHERE
|
|
68633
|
+
${singleSchema ? `
|
|
68634
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
68635
|
+
[ud].[IsConstant] = 0 AND
|
|
68636
|
+
[ud].[InvertingUnit] IS NOT NULL
|
|
68637
68637
|
`;
|
|
68638
68638
|
/**
|
|
68639
68639
|
* Query for SchemaItemType Constant data.
|
|
68640
68640
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68641
68641
|
*/
|
|
68642
|
-
const constant = (singleSchema) => `
|
|
68643
|
-
SELECT
|
|
68644
|
-
[cd].[Schema].[Id] AS [SchemaId],
|
|
68645
|
-
json_object(
|
|
68646
|
-
'schemaItemType', 'Constant',
|
|
68647
|
-
'name', [cd].[Name],
|
|
68648
|
-
'label', [cd].[DisplayLabel],
|
|
68649
|
-
'description', [cd].[Description],
|
|
68650
|
-
'definition', [cd].[Definition],
|
|
68651
|
-
'numerator', IIF([cd].[Numerator] IS NULL, NULL, json(format('%.16g', [cd].[Numerator]))),
|
|
68652
|
-
'denominator', IIF([cd].[Denominator] IS NULL, NULL, json(format('%.16g', [cd].[Denominator]))),
|
|
68653
|
-
'phenomenon', CONCAT([phenomSchema].[Name],'.', [phenomDef].[Name])
|
|
68654
|
-
) as item
|
|
68655
|
-
FROM
|
|
68656
|
-
[meta].[UnitDef] [cd]
|
|
68657
|
-
${singleSchema ? `
|
|
68658
|
-
JOIN
|
|
68659
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [cd].[Schema].[Id]` : ""}
|
|
68660
|
-
JOIN [meta].[PhenomenonDef] [phenomDef]
|
|
68661
|
-
ON [phenomDef].[ECInstanceId] = [cd].[Phenomenon].[Id]
|
|
68662
|
-
JOIN [meta].[ECSchemaDef] [phenomSchema]
|
|
68663
|
-
ON [phenomSchema].[ECInstanceId] = [phenomDef].[Schema].[Id]
|
|
68664
|
-
WHERE
|
|
68665
|
-
${singleSchema ? `
|
|
68666
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
68667
|
-
[cd].[IsConstant] = 1
|
|
68642
|
+
const constant = (singleSchema) => `
|
|
68643
|
+
SELECT
|
|
68644
|
+
[cd].[Schema].[Id] AS [SchemaId],
|
|
68645
|
+
json_object(
|
|
68646
|
+
'schemaItemType', 'Constant',
|
|
68647
|
+
'name', [cd].[Name],
|
|
68648
|
+
'label', [cd].[DisplayLabel],
|
|
68649
|
+
'description', [cd].[Description],
|
|
68650
|
+
'definition', [cd].[Definition],
|
|
68651
|
+
'numerator', IIF([cd].[Numerator] IS NULL, NULL, json(format('%.16g', [cd].[Numerator]))),
|
|
68652
|
+
'denominator', IIF([cd].[Denominator] IS NULL, NULL, json(format('%.16g', [cd].[Denominator]))),
|
|
68653
|
+
'phenomenon', CONCAT([phenomSchema].[Name],'.', [phenomDef].[Name])
|
|
68654
|
+
) as item
|
|
68655
|
+
FROM
|
|
68656
|
+
[meta].[UnitDef] [cd]
|
|
68657
|
+
${singleSchema ? `
|
|
68658
|
+
JOIN
|
|
68659
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [cd].[Schema].[Id]` : ""}
|
|
68660
|
+
JOIN [meta].[PhenomenonDef] [phenomDef]
|
|
68661
|
+
ON [phenomDef].[ECInstanceId] = [cd].[Phenomenon].[Id]
|
|
68662
|
+
JOIN [meta].[ECSchemaDef] [phenomSchema]
|
|
68663
|
+
ON [phenomSchema].[ECInstanceId] = [phenomDef].[Schema].[Id]
|
|
68664
|
+
WHERE
|
|
68665
|
+
${singleSchema ? `
|
|
68666
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
68667
|
+
[cd].[IsConstant] = 1
|
|
68668
68668
|
`;
|
|
68669
68669
|
/**
|
|
68670
68670
|
* Query for SchemaItemType UnitSystem data.
|
|
68671
68671
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68672
68672
|
*/
|
|
68673
|
-
const unitSystem = (singleSchema) => `
|
|
68674
|
-
SELECT
|
|
68675
|
-
[us].[Schema].[Id] AS [SchemaId],
|
|
68676
|
-
json_object (
|
|
68677
|
-
'schemaItemType', 'UnitSystem',
|
|
68678
|
-
'name', [us].[Name],
|
|
68679
|
-
'label', [us].[DisplayLabel],
|
|
68680
|
-
'description', [us].[Description]
|
|
68681
|
-
) as [item]
|
|
68682
|
-
FROM
|
|
68683
|
-
[meta].[UnitSystemDef] [us]
|
|
68684
|
-
${singleSchema ? `
|
|
68685
|
-
JOIN
|
|
68686
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [us].[Schema].[Id]
|
|
68687
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68673
|
+
const unitSystem = (singleSchema) => `
|
|
68674
|
+
SELECT
|
|
68675
|
+
[us].[Schema].[Id] AS [SchemaId],
|
|
68676
|
+
json_object (
|
|
68677
|
+
'schemaItemType', 'UnitSystem',
|
|
68678
|
+
'name', [us].[Name],
|
|
68679
|
+
'label', [us].[DisplayLabel],
|
|
68680
|
+
'description', [us].[Description]
|
|
68681
|
+
) as [item]
|
|
68682
|
+
FROM
|
|
68683
|
+
[meta].[UnitSystemDef] [us]
|
|
68684
|
+
${singleSchema ? `
|
|
68685
|
+
JOIN
|
|
68686
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [us].[Schema].[Id]
|
|
68687
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68688
68688
|
`;
|
|
68689
68689
|
/**
|
|
68690
68690
|
* Query for SchemaItemType Phenomenon data.
|
|
68691
68691
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68692
68692
|
*/
|
|
68693
|
-
const phenomenon = (singleSchema) => `
|
|
68694
|
-
SELECT
|
|
68695
|
-
[pd].[Schema].[Id] AS [SchemaId],
|
|
68696
|
-
json_object(
|
|
68697
|
-
'schemaItemType', 'Phenomenon',
|
|
68698
|
-
'name', [pd].[Name],
|
|
68699
|
-
'label', [pd].[DisplayLabel],
|
|
68700
|
-
'description', [pd].[Description],
|
|
68701
|
-
'definition', [pd].[Definition]
|
|
68702
|
-
) as [item]
|
|
68703
|
-
FROM
|
|
68704
|
-
[meta].[PhenomenonDef] [pd]
|
|
68705
|
-
${singleSchema ? `
|
|
68706
|
-
JOIN
|
|
68707
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pd].[Schema].[Id]
|
|
68708
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68693
|
+
const phenomenon = (singleSchema) => `
|
|
68694
|
+
SELECT
|
|
68695
|
+
[pd].[Schema].[Id] AS [SchemaId],
|
|
68696
|
+
json_object(
|
|
68697
|
+
'schemaItemType', 'Phenomenon',
|
|
68698
|
+
'name', [pd].[Name],
|
|
68699
|
+
'label', [pd].[DisplayLabel],
|
|
68700
|
+
'description', [pd].[Description],
|
|
68701
|
+
'definition', [pd].[Definition]
|
|
68702
|
+
) as [item]
|
|
68703
|
+
FROM
|
|
68704
|
+
[meta].[PhenomenonDef] [pd]
|
|
68705
|
+
${singleSchema ? `
|
|
68706
|
+
JOIN
|
|
68707
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pd].[Schema].[Id]
|
|
68708
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68709
68709
|
`;
|
|
68710
68710
|
/**
|
|
68711
68711
|
* Query for SchemaItemType Format data.
|
|
68712
68712
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
68713
68713
|
*/
|
|
68714
|
-
const format = (singleSchema) => `
|
|
68715
|
-
SELECT
|
|
68716
|
-
[fd].[Schema].[Id] AS [SchemaId],
|
|
68717
|
-
json_object(
|
|
68718
|
-
'schemaItemType', 'Format',
|
|
68719
|
-
'name', [fd].[Name],
|
|
68720
|
-
'label', [fd].[DisplayLabel],
|
|
68721
|
-
'description', [fd].[Description],
|
|
68722
|
-
'type', json_extract([fd].[NumericSpec], '$.type'),
|
|
68723
|
-
'precision', json_extract([fd].[NumericSpec], '$.precision'),
|
|
68724
|
-
'roundFactor', json_extract([fd].[NumericSpec], '$.roundFactor'),
|
|
68725
|
-
'minWidth', json_extract([fd].[NumericSpec], '$.minWidth'),
|
|
68726
|
-
'showSignOption', json_extract([fd].[NumericSpec], '$.showSignOption'),
|
|
68727
|
-
'decimalSeparator', json_extract([fd].[NumericSpec], '$.decimalSeparator'),
|
|
68728
|
-
'thousandSeparator', json_extract([fd].[NumericSpec], '$.thousandSeparator'),
|
|
68729
|
-
'uomSeparator', json_extract([fd].[NumericSpec], '$.uomSeparator'),
|
|
68730
|
-
'scientificType', json_extract([fd].[NumericSpec], '$.scientificType'),
|
|
68731
|
-
'stationOffsetSize', json_extract([fd].[NumericSpec], '$.stationOffsetSize'),
|
|
68732
|
-
'stationSeparator', json_extract([fd].[NumericSpec], '$.stationSeparator'),
|
|
68733
|
-
'formatTraits', json_extract([fd].[NumericSpec], '$.formatTraits')
|
|
68734
|
-
${singleSchema ? `
|
|
68735
|
-
,'composite', (
|
|
68736
|
-
SELECT
|
|
68737
|
-
json_object(
|
|
68738
|
-
'spacer', json_extract([fd1].[CompositeSpec], '$.spacer'),
|
|
68739
|
-
'includeZero', json(IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 1, 'true', IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 0, 'false', null))),
|
|
68740
|
-
'units', (
|
|
68741
|
-
SELECT json_group_array(json(json_object(
|
|
68742
|
-
'name', CONCAT([sd].[Name], '.', [ud].[Name]),
|
|
68743
|
-
'label', [fud].[Label]
|
|
68744
|
-
)))
|
|
68745
|
-
FROM [meta].[FormatDef] [fd2]
|
|
68746
|
-
LEFT JOIN [meta].[FormatCompositeUnitDef] [fud] ON [fud].[Format].[Id] = [fd2].[ECInstanceId]
|
|
68747
|
-
LEFT JOIN [meta].[UnitDef] [ud] ON [ud].[ECInstanceId] = [fud].[Unit].[Id]
|
|
68748
|
-
INNER JOIN [meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [ud].[Schema].[Id]
|
|
68749
|
-
WHERE [fd2].[ECInstanceId] = [fd1].[ECInstanceId]
|
|
68750
|
-
)
|
|
68751
|
-
)
|
|
68752
|
-
FROM [meta].[FormatDef] [fd1]
|
|
68753
|
-
WHERE [fd1].[ECInstanceId]= [fd].[ECInstanceId] AND [fd1].[CompositeSpec] IS NOT NULL
|
|
68754
|
-
)` : ""}
|
|
68755
|
-
) AS item
|
|
68756
|
-
FROM
|
|
68757
|
-
[meta].[FormatDef] [fd]
|
|
68758
|
-
${singleSchema ? `
|
|
68759
|
-
JOIN
|
|
68760
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [fd].[Schema].[Id]
|
|
68761
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68714
|
+
const format = (singleSchema) => `
|
|
68715
|
+
SELECT
|
|
68716
|
+
[fd].[Schema].[Id] AS [SchemaId],
|
|
68717
|
+
json_object(
|
|
68718
|
+
'schemaItemType', 'Format',
|
|
68719
|
+
'name', [fd].[Name],
|
|
68720
|
+
'label', [fd].[DisplayLabel],
|
|
68721
|
+
'description', [fd].[Description],
|
|
68722
|
+
'type', json_extract([fd].[NumericSpec], '$.type'),
|
|
68723
|
+
'precision', json_extract([fd].[NumericSpec], '$.precision'),
|
|
68724
|
+
'roundFactor', json_extract([fd].[NumericSpec], '$.roundFactor'),
|
|
68725
|
+
'minWidth', json_extract([fd].[NumericSpec], '$.minWidth'),
|
|
68726
|
+
'showSignOption', json_extract([fd].[NumericSpec], '$.showSignOption'),
|
|
68727
|
+
'decimalSeparator', json_extract([fd].[NumericSpec], '$.decimalSeparator'),
|
|
68728
|
+
'thousandSeparator', json_extract([fd].[NumericSpec], '$.thousandSeparator'),
|
|
68729
|
+
'uomSeparator', json_extract([fd].[NumericSpec], '$.uomSeparator'),
|
|
68730
|
+
'scientificType', json_extract([fd].[NumericSpec], '$.scientificType'),
|
|
68731
|
+
'stationOffsetSize', json_extract([fd].[NumericSpec], '$.stationOffsetSize'),
|
|
68732
|
+
'stationSeparator', json_extract([fd].[NumericSpec], '$.stationSeparator'),
|
|
68733
|
+
'formatTraits', json_extract([fd].[NumericSpec], '$.formatTraits')
|
|
68734
|
+
${singleSchema ? `
|
|
68735
|
+
,'composite', (
|
|
68736
|
+
SELECT
|
|
68737
|
+
json_object(
|
|
68738
|
+
'spacer', json_extract([fd1].[CompositeSpec], '$.spacer'),
|
|
68739
|
+
'includeZero', json(IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 1, 'true', IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 0, 'false', null))),
|
|
68740
|
+
'units', (
|
|
68741
|
+
SELECT json_group_array(json(json_object(
|
|
68742
|
+
'name', CONCAT([sd].[Name], '.', [ud].[Name]),
|
|
68743
|
+
'label', [fud].[Label]
|
|
68744
|
+
)))
|
|
68745
|
+
FROM [meta].[FormatDef] [fd2]
|
|
68746
|
+
LEFT JOIN [meta].[FormatCompositeUnitDef] [fud] ON [fud].[Format].[Id] = [fd2].[ECInstanceId]
|
|
68747
|
+
LEFT JOIN [meta].[UnitDef] [ud] ON [ud].[ECInstanceId] = [fud].[Unit].[Id]
|
|
68748
|
+
INNER JOIN [meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [ud].[Schema].[Id]
|
|
68749
|
+
WHERE [fd2].[ECInstanceId] = [fd1].[ECInstanceId]
|
|
68750
|
+
)
|
|
68751
|
+
)
|
|
68752
|
+
FROM [meta].[FormatDef] [fd1]
|
|
68753
|
+
WHERE [fd1].[ECInstanceId]= [fd].[ECInstanceId] AND [fd1].[CompositeSpec] IS NOT NULL
|
|
68754
|
+
)` : ""}
|
|
68755
|
+
) AS item
|
|
68756
|
+
FROM
|
|
68757
|
+
[meta].[FormatDef] [fd]
|
|
68758
|
+
${singleSchema ? `
|
|
68759
|
+
JOIN
|
|
68760
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [fd].[Schema].[Id]
|
|
68761
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
68762
68762
|
`;
|
|
68763
68763
|
/**
|
|
68764
68764
|
* Queries for each SchemaItemType
|
|
@@ -68924,332 +68924,332 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
68924
68924
|
*--------------------------------------------------------------------------------------------*/
|
|
68925
68925
|
|
|
68926
68926
|
const modifier = (alias) => {
|
|
68927
|
-
return `
|
|
68928
|
-
CASE
|
|
68929
|
-
WHEN [${alias}].[modifier] = 0 THEN 'None'
|
|
68930
|
-
WHEN [${alias}].[modifier] = 1 THEN 'Abstract'
|
|
68931
|
-
WHEN [${alias}].[modifier] = 2 THEN 'Sealed'
|
|
68932
|
-
ELSE NULL
|
|
68933
|
-
END
|
|
68927
|
+
return `
|
|
68928
|
+
CASE
|
|
68929
|
+
WHEN [${alias}].[modifier] = 0 THEN 'None'
|
|
68930
|
+
WHEN [${alias}].[modifier] = 1 THEN 'Abstract'
|
|
68931
|
+
WHEN [${alias}].[modifier] = 2 THEN 'Sealed'
|
|
68932
|
+
ELSE NULL
|
|
68933
|
+
END
|
|
68934
68934
|
`;
|
|
68935
68935
|
};
|
|
68936
68936
|
const strength = (alias) => {
|
|
68937
|
-
return `
|
|
68938
|
-
CASE
|
|
68939
|
-
WHEN [${alias}].[RelationshipStrength] = 0 THEN 'Referencing'
|
|
68940
|
-
WHEN [${alias}].[RelationshipStrength] = 1 THEN 'Holding'
|
|
68941
|
-
WHEN [${alias}].[RelationshipStrength] = 2 THEN 'Embedding'
|
|
68942
|
-
ELSE NULL
|
|
68943
|
-
END
|
|
68937
|
+
return `
|
|
68938
|
+
CASE
|
|
68939
|
+
WHEN [${alias}].[RelationshipStrength] = 0 THEN 'Referencing'
|
|
68940
|
+
WHEN [${alias}].[RelationshipStrength] = 1 THEN 'Holding'
|
|
68941
|
+
WHEN [${alias}].[RelationshipStrength] = 2 THEN 'Embedding'
|
|
68942
|
+
ELSE NULL
|
|
68943
|
+
END
|
|
68944
68944
|
`;
|
|
68945
68945
|
};
|
|
68946
68946
|
const strengthDirection = (alias) => {
|
|
68947
|
-
return `
|
|
68948
|
-
CASE
|
|
68949
|
-
WHEN [${alias}].[RelationshipStrengthDirection] = 1 THEN 'Forward'
|
|
68950
|
-
WHEN [${alias}].[RelationshipStrengthDirection] = 2 THEN 'Backward'
|
|
68951
|
-
ELSE NULL
|
|
68952
|
-
END
|
|
68947
|
+
return `
|
|
68948
|
+
CASE
|
|
68949
|
+
WHEN [${alias}].[RelationshipStrengthDirection] = 1 THEN 'Forward'
|
|
68950
|
+
WHEN [${alias}].[RelationshipStrengthDirection] = 2 THEN 'Backward'
|
|
68951
|
+
ELSE NULL
|
|
68952
|
+
END
|
|
68953
68953
|
`;
|
|
68954
68954
|
};
|
|
68955
|
-
const withAppliesTo = `
|
|
68956
|
-
AppliesToCTE AS (
|
|
68957
|
-
SELECT
|
|
68958
|
-
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
68959
|
-
[appliesToSchema].[name] as [AppliesToSchema],
|
|
68960
|
-
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
68961
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
68962
|
-
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
68963
|
-
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
68964
|
-
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
68965
|
-
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
68966
|
-
WHERE [ca].[ContainerType] = 30
|
|
68967
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
68968
|
-
)
|
|
68955
|
+
const withAppliesTo = `
|
|
68956
|
+
AppliesToCTE AS (
|
|
68957
|
+
SELECT
|
|
68958
|
+
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
68959
|
+
[appliesToSchema].[name] as [AppliesToSchema],
|
|
68960
|
+
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
68961
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
68962
|
+
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
68963
|
+
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
68964
|
+
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
68965
|
+
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
68966
|
+
WHERE [ca].[ContainerType] = 30
|
|
68967
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
68968
|
+
)
|
|
68969
68969
|
`;
|
|
68970
|
-
const withSchemaReferences = `
|
|
68971
|
-
SchemaReferences AS (
|
|
68972
|
-
SELECT
|
|
68973
|
-
[ref].[SourceECInstanceId] AS [SchemaId],
|
|
68974
|
-
CONCAT([Name],'.',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [fullName]
|
|
68975
|
-
FROM
|
|
68976
|
-
[meta].[ECSchemaDef] AS [refSchema]
|
|
68977
|
-
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
68978
|
-
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
68979
|
-
)
|
|
68970
|
+
const withSchemaReferences = `
|
|
68971
|
+
SchemaReferences AS (
|
|
68972
|
+
SELECT
|
|
68973
|
+
[ref].[SourceECInstanceId] AS [SchemaId],
|
|
68974
|
+
CONCAT([Name],'.',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [fullName]
|
|
68975
|
+
FROM
|
|
68976
|
+
[meta].[ECSchemaDef] AS [refSchema]
|
|
68977
|
+
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
68978
|
+
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
68979
|
+
)
|
|
68980
68980
|
`;
|
|
68981
|
-
const customAttributeQuery = `
|
|
68982
|
-
SELECT
|
|
68983
|
-
[Schema].[Id] AS [SchemaId],
|
|
68984
|
-
json_object(
|
|
68985
|
-
'name', [class].[Name],
|
|
68986
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
68987
|
-
'modifier', ${modifier("class")},
|
|
68988
|
-
'label', [class].[DisplayLabel],
|
|
68989
|
-
'description', [class].[Description],
|
|
68990
|
-
'appliesTo', [class].[CustomAttributeContainerType],
|
|
68991
|
-
'baseClasses', (
|
|
68992
|
-
SELECT
|
|
68993
|
-
json_group_array(json(json_object(
|
|
68994
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
68995
|
-
'name', [baseClass].[Name],
|
|
68996
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
68997
|
-
'modifier', ${modifier("baseClass")},
|
|
68998
|
-
'label', [baseClass].[DisplayLabel],
|
|
68999
|
-
'description', [baseClass].[Description],
|
|
69000
|
-
'appliesTo', [baseClass].[CustomAttributeContainerType]
|
|
69001
|
-
)))
|
|
69002
|
-
FROM
|
|
69003
|
-
[meta].[ECClassDef] [baseClass]
|
|
69004
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69005
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69006
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69007
|
-
)
|
|
69008
|
-
) AS [item]
|
|
69009
|
-
FROM [meta].[ECClassDef] [class]
|
|
69010
|
-
WHERE [class].[Type] = 3
|
|
68981
|
+
const customAttributeQuery = `
|
|
68982
|
+
SELECT
|
|
68983
|
+
[Schema].[Id] AS [SchemaId],
|
|
68984
|
+
json_object(
|
|
68985
|
+
'name', [class].[Name],
|
|
68986
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
68987
|
+
'modifier', ${modifier("class")},
|
|
68988
|
+
'label', [class].[DisplayLabel],
|
|
68989
|
+
'description', [class].[Description],
|
|
68990
|
+
'appliesTo', [class].[CustomAttributeContainerType],
|
|
68991
|
+
'baseClasses', (
|
|
68992
|
+
SELECT
|
|
68993
|
+
json_group_array(json(json_object(
|
|
68994
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
68995
|
+
'name', [baseClass].[Name],
|
|
68996
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
68997
|
+
'modifier', ${modifier("baseClass")},
|
|
68998
|
+
'label', [baseClass].[DisplayLabel],
|
|
68999
|
+
'description', [baseClass].[Description],
|
|
69000
|
+
'appliesTo', [baseClass].[CustomAttributeContainerType]
|
|
69001
|
+
)))
|
|
69002
|
+
FROM
|
|
69003
|
+
[meta].[ECClassDef] [baseClass]
|
|
69004
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69005
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69006
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69007
|
+
)
|
|
69008
|
+
) AS [item]
|
|
69009
|
+
FROM [meta].[ECClassDef] [class]
|
|
69010
|
+
WHERE [class].[Type] = 3
|
|
69011
69011
|
`;
|
|
69012
|
-
const structQuery = `
|
|
69013
|
-
SELECT
|
|
69014
|
-
[Schema].[Id] AS [SchemaId],
|
|
69015
|
-
json_object(
|
|
69016
|
-
'name', [class].[Name],
|
|
69017
|
-
'schemaItemType', 'StructClass',
|
|
69018
|
-
'modifier', ${modifier("class")},
|
|
69019
|
-
'label', [class].[DisplayLabel],
|
|
69020
|
-
'description', [class].[Description],
|
|
69021
|
-
'baseClasses', (
|
|
69022
|
-
SELECT
|
|
69023
|
-
json_group_array(json(json_object(
|
|
69024
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69025
|
-
'name', [baseClass].[Name],
|
|
69026
|
-
'schemaItemType', 'StructClass',
|
|
69027
|
-
'modifier', ${modifier("baseClass")},
|
|
69028
|
-
'label', [baseClass].[DisplayLabel],
|
|
69029
|
-
'description', [baseClass].[Description]
|
|
69030
|
-
)))
|
|
69031
|
-
FROM
|
|
69032
|
-
[meta].[ECClassDef] [baseClass]
|
|
69033
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69034
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69035
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69036
|
-
)
|
|
69037
|
-
) AS [item]
|
|
69038
|
-
FROM [meta].[ECClassDef] [class]
|
|
69039
|
-
WHERE [class].[Type] = 2
|
|
69012
|
+
const structQuery = `
|
|
69013
|
+
SELECT
|
|
69014
|
+
[Schema].[Id] AS [SchemaId],
|
|
69015
|
+
json_object(
|
|
69016
|
+
'name', [class].[Name],
|
|
69017
|
+
'schemaItemType', 'StructClass',
|
|
69018
|
+
'modifier', ${modifier("class")},
|
|
69019
|
+
'label', [class].[DisplayLabel],
|
|
69020
|
+
'description', [class].[Description],
|
|
69021
|
+
'baseClasses', (
|
|
69022
|
+
SELECT
|
|
69023
|
+
json_group_array(json(json_object(
|
|
69024
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69025
|
+
'name', [baseClass].[Name],
|
|
69026
|
+
'schemaItemType', 'StructClass',
|
|
69027
|
+
'modifier', ${modifier("baseClass")},
|
|
69028
|
+
'label', [baseClass].[DisplayLabel],
|
|
69029
|
+
'description', [baseClass].[Description]
|
|
69030
|
+
)))
|
|
69031
|
+
FROM
|
|
69032
|
+
[meta].[ECClassDef] [baseClass]
|
|
69033
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69034
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69035
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69036
|
+
)
|
|
69037
|
+
) AS [item]
|
|
69038
|
+
FROM [meta].[ECClassDef] [class]
|
|
69039
|
+
WHERE [class].[Type] = 2
|
|
69040
69040
|
`;
|
|
69041
|
-
const relationshipQuery = `
|
|
69042
|
-
SELECT
|
|
69043
|
-
[Schema].[Id] AS [SchemaId],
|
|
69044
|
-
json_object(
|
|
69045
|
-
'name', [class].[Name],
|
|
69046
|
-
'schemaItemType', 'RelationshipClass',
|
|
69047
|
-
'modifier', ${modifier("class")},
|
|
69048
|
-
'label', [class].[DisplayLabel],
|
|
69049
|
-
'description', [class].[Description],
|
|
69050
|
-
'strength', ${strength("class")},
|
|
69051
|
-
'strengthDirection', ${strengthDirection("class")},
|
|
69052
|
-
'baseClasses', (
|
|
69053
|
-
SELECT
|
|
69054
|
-
json_group_array(json(json_object(
|
|
69055
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69056
|
-
'name', [baseClass].[Name],
|
|
69057
|
-
'schemaItemType', 'RelationshipClass',
|
|
69058
|
-
'modifier', ${modifier("baseClass")},
|
|
69059
|
-
'label', [baseClass].[DisplayLabel],
|
|
69060
|
-
'description', [baseClass].[Description],
|
|
69061
|
-
'strength', ${strength("baseClass")},
|
|
69062
|
-
'strengthDirection', ${strengthDirection("baseClass")}
|
|
69063
|
-
)))
|
|
69064
|
-
FROM
|
|
69065
|
-
[meta].[ECClassDef] [baseClass]
|
|
69066
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69067
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69068
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69069
|
-
)
|
|
69070
|
-
) AS [item]
|
|
69071
|
-
FROM [meta].[ECClassDef] [class]
|
|
69072
|
-
WHERE [class].[Type] = 1
|
|
69041
|
+
const relationshipQuery = `
|
|
69042
|
+
SELECT
|
|
69043
|
+
[Schema].[Id] AS [SchemaId],
|
|
69044
|
+
json_object(
|
|
69045
|
+
'name', [class].[Name],
|
|
69046
|
+
'schemaItemType', 'RelationshipClass',
|
|
69047
|
+
'modifier', ${modifier("class")},
|
|
69048
|
+
'label', [class].[DisplayLabel],
|
|
69049
|
+
'description', [class].[Description],
|
|
69050
|
+
'strength', ${strength("class")},
|
|
69051
|
+
'strengthDirection', ${strengthDirection("class")},
|
|
69052
|
+
'baseClasses', (
|
|
69053
|
+
SELECT
|
|
69054
|
+
json_group_array(json(json_object(
|
|
69055
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69056
|
+
'name', [baseClass].[Name],
|
|
69057
|
+
'schemaItemType', 'RelationshipClass',
|
|
69058
|
+
'modifier', ${modifier("baseClass")},
|
|
69059
|
+
'label', [baseClass].[DisplayLabel],
|
|
69060
|
+
'description', [baseClass].[Description],
|
|
69061
|
+
'strength', ${strength("baseClass")},
|
|
69062
|
+
'strengthDirection', ${strengthDirection("baseClass")}
|
|
69063
|
+
)))
|
|
69064
|
+
FROM
|
|
69065
|
+
[meta].[ECClassDef] [baseClass]
|
|
69066
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69067
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69068
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69069
|
+
)
|
|
69070
|
+
) AS [item]
|
|
69071
|
+
FROM [meta].[ECClassDef] [class]
|
|
69072
|
+
WHERE [class].[Type] = 1
|
|
69073
69073
|
`;
|
|
69074
|
-
const entityQuery = `
|
|
69075
|
-
SELECT
|
|
69076
|
-
[Schema].[Id] AS [SchemaId],
|
|
69077
|
-
json_object(
|
|
69078
|
-
'name', [class].[Name],
|
|
69079
|
-
'schemaItemType', 'EntityClass',
|
|
69080
|
-
'modifier', ${modifier("class")},
|
|
69081
|
-
'label', [class].[DisplayLabel],
|
|
69082
|
-
'description', [class].[Description],
|
|
69083
|
-
'baseClasses', (
|
|
69084
|
-
SELECT
|
|
69085
|
-
json_group_array(json(json_object(
|
|
69086
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69087
|
-
'name', [baseClass].[Name],
|
|
69088
|
-
'schemaItemType', 'EntityClass',
|
|
69089
|
-
'modifier', ${modifier("baseClass")},
|
|
69090
|
-
'label', [baseClass].[DisplayLabel],
|
|
69091
|
-
'description', [baseClass].[Description]
|
|
69092
|
-
)))
|
|
69093
|
-
FROM
|
|
69094
|
-
[meta].[ECClassDef] [baseClass]
|
|
69095
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69096
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69097
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69098
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
69099
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69100
|
-
),
|
|
69101
|
-
'mixins', (
|
|
69102
|
-
SELECT
|
|
69103
|
-
json_group_array(json(json_object(
|
|
69104
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69105
|
-
'name', [baseClass].[Name],
|
|
69106
|
-
'schemaItemType', 'Mixin',
|
|
69107
|
-
'modifier', ${modifier("baseClass")},
|
|
69108
|
-
'label', [baseClass].[DisplayLabel],
|
|
69109
|
-
'description', [baseClass].[Description],
|
|
69110
|
-
'appliesTo', (
|
|
69111
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69112
|
-
FROM [AppliesToCTE] [atCTE]
|
|
69113
|
-
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
69114
|
-
),
|
|
69115
|
-
'baseClasses', (
|
|
69116
|
-
SELECT
|
|
69117
|
-
json_group_array(json(json_object(
|
|
69118
|
-
'schema', ec_classname([mixinBaseClass].[ECInstanceId], 's'),
|
|
69119
|
-
'name', [mixinBaseClass].[Name],
|
|
69120
|
-
'schemaItemType', 'Mixin',
|
|
69121
|
-
'modifier', ${modifier("mixinBaseClass")},
|
|
69122
|
-
'label', [mixinBaseClass].[DisplayLabel],
|
|
69123
|
-
'description', [mixinBaseClass].[Description],
|
|
69124
|
-
'appliesTo', (
|
|
69125
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69126
|
-
FROM [AppliesToCTE] [atCTE]
|
|
69127
|
-
WHERE [atCTE].[AppliesToId] = [mixinBaseClass].[ECInstanceId]
|
|
69128
|
-
)
|
|
69129
|
-
)))
|
|
69130
|
-
FROM
|
|
69131
|
-
[meta].[ECClassDef] [mixinBaseClass]
|
|
69132
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [mixinBaseClassMap]
|
|
69133
|
-
ON [mixinBaseClassMap].[TargetECInstanceId] = [mixinBaseClass].[ECInstanceId]
|
|
69134
|
-
WHERE [mixinBaseClassMap].[SourceECInstanceId] = [baseClass].[ECInstanceId]
|
|
69135
|
-
)
|
|
69136
|
-
)))
|
|
69137
|
-
FROM
|
|
69138
|
-
[meta].[ECClassDef] [baseClass]
|
|
69139
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
69140
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69141
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69142
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
69143
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69144
|
-
)
|
|
69145
|
-
) AS [item]
|
|
69146
|
-
FROM [meta].[ECClassDef] [class]
|
|
69147
|
-
WHERE [class].[Type] = 0
|
|
69148
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
69149
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69074
|
+
const entityQuery = `
|
|
69075
|
+
SELECT
|
|
69076
|
+
[Schema].[Id] AS [SchemaId],
|
|
69077
|
+
json_object(
|
|
69078
|
+
'name', [class].[Name],
|
|
69079
|
+
'schemaItemType', 'EntityClass',
|
|
69080
|
+
'modifier', ${modifier("class")},
|
|
69081
|
+
'label', [class].[DisplayLabel],
|
|
69082
|
+
'description', [class].[Description],
|
|
69083
|
+
'baseClasses', (
|
|
69084
|
+
SELECT
|
|
69085
|
+
json_group_array(json(json_object(
|
|
69086
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69087
|
+
'name', [baseClass].[Name],
|
|
69088
|
+
'schemaItemType', 'EntityClass',
|
|
69089
|
+
'modifier', ${modifier("baseClass")},
|
|
69090
|
+
'label', [baseClass].[DisplayLabel],
|
|
69091
|
+
'description', [baseClass].[Description]
|
|
69092
|
+
)))
|
|
69093
|
+
FROM
|
|
69094
|
+
[meta].[ECClassDef] [baseClass]
|
|
69095
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69096
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69097
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69098
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
69099
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69100
|
+
),
|
|
69101
|
+
'mixins', (
|
|
69102
|
+
SELECT
|
|
69103
|
+
json_group_array(json(json_object(
|
|
69104
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69105
|
+
'name', [baseClass].[Name],
|
|
69106
|
+
'schemaItemType', 'Mixin',
|
|
69107
|
+
'modifier', ${modifier("baseClass")},
|
|
69108
|
+
'label', [baseClass].[DisplayLabel],
|
|
69109
|
+
'description', [baseClass].[Description],
|
|
69110
|
+
'appliesTo', (
|
|
69111
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69112
|
+
FROM [AppliesToCTE] [atCTE]
|
|
69113
|
+
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
69114
|
+
),
|
|
69115
|
+
'baseClasses', (
|
|
69116
|
+
SELECT
|
|
69117
|
+
json_group_array(json(json_object(
|
|
69118
|
+
'schema', ec_classname([mixinBaseClass].[ECInstanceId], 's'),
|
|
69119
|
+
'name', [mixinBaseClass].[Name],
|
|
69120
|
+
'schemaItemType', 'Mixin',
|
|
69121
|
+
'modifier', ${modifier("mixinBaseClass")},
|
|
69122
|
+
'label', [mixinBaseClass].[DisplayLabel],
|
|
69123
|
+
'description', [mixinBaseClass].[Description],
|
|
69124
|
+
'appliesTo', (
|
|
69125
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69126
|
+
FROM [AppliesToCTE] [atCTE]
|
|
69127
|
+
WHERE [atCTE].[AppliesToId] = [mixinBaseClass].[ECInstanceId]
|
|
69128
|
+
)
|
|
69129
|
+
)))
|
|
69130
|
+
FROM
|
|
69131
|
+
[meta].[ECClassDef] [mixinBaseClass]
|
|
69132
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [mixinBaseClassMap]
|
|
69133
|
+
ON [mixinBaseClassMap].[TargetECInstanceId] = [mixinBaseClass].[ECInstanceId]
|
|
69134
|
+
WHERE [mixinBaseClassMap].[SourceECInstanceId] = [baseClass].[ECInstanceId]
|
|
69135
|
+
)
|
|
69136
|
+
)))
|
|
69137
|
+
FROM
|
|
69138
|
+
[meta].[ECClassDef] [baseClass]
|
|
69139
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
69140
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69141
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69142
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
69143
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69144
|
+
)
|
|
69145
|
+
) AS [item]
|
|
69146
|
+
FROM [meta].[ECClassDef] [class]
|
|
69147
|
+
WHERE [class].[Type] = 0
|
|
69148
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
69149
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69150
69150
|
`;
|
|
69151
|
-
const mixinQuery = `
|
|
69152
|
-
SELECT
|
|
69153
|
-
[Schema].[Id] AS [SchemaId],
|
|
69154
|
-
json_object(
|
|
69155
|
-
'name', [class].[Name],
|
|
69156
|
-
'schemaItemType', 'Mixin',
|
|
69157
|
-
'modifier', ${modifier("class")},
|
|
69158
|
-
'label', [class].[DisplayLabel],
|
|
69159
|
-
'description', [class].[Description],
|
|
69160
|
-
'appliesTo', (
|
|
69161
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69162
|
-
FROM [AppliesToCTE] [atCTE]
|
|
69163
|
-
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
69164
|
-
),
|
|
69165
|
-
'baseClasses', (
|
|
69166
|
-
SELECT
|
|
69167
|
-
json_group_array(json(json_object(
|
|
69168
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69169
|
-
'name', [baseClass].[Name],
|
|
69170
|
-
'schemaItemType', 'Mixin',
|
|
69171
|
-
'modifier', ${modifier("baseClass")},
|
|
69172
|
-
'label', [baseClass].[DisplayLabel],
|
|
69173
|
-
'description', [baseClass].[Description],
|
|
69174
|
-
'appliesTo', (
|
|
69175
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69176
|
-
FROM [AppliesToCTE] [atCTE]
|
|
69177
|
-
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
69178
|
-
)
|
|
69179
|
-
)))
|
|
69180
|
-
FROM
|
|
69181
|
-
[meta].[ECClassDef] [baseClass]
|
|
69182
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69183
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69184
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69185
|
-
)
|
|
69186
|
-
) AS [item]
|
|
69187
|
-
FROM [meta].[ECClassDef] [class]
|
|
69188
|
-
WHERE [class].[Type] = 0 AND EXISTS (SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
69189
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69151
|
+
const mixinQuery = `
|
|
69152
|
+
SELECT
|
|
69153
|
+
[Schema].[Id] AS [SchemaId],
|
|
69154
|
+
json_object(
|
|
69155
|
+
'name', [class].[Name],
|
|
69156
|
+
'schemaItemType', 'Mixin',
|
|
69157
|
+
'modifier', ${modifier("class")},
|
|
69158
|
+
'label', [class].[DisplayLabel],
|
|
69159
|
+
'description', [class].[Description],
|
|
69160
|
+
'appliesTo', (
|
|
69161
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69162
|
+
FROM [AppliesToCTE] [atCTE]
|
|
69163
|
+
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
69164
|
+
),
|
|
69165
|
+
'baseClasses', (
|
|
69166
|
+
SELECT
|
|
69167
|
+
json_group_array(json(json_object(
|
|
69168
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
69169
|
+
'name', [baseClass].[Name],
|
|
69170
|
+
'schemaItemType', 'Mixin',
|
|
69171
|
+
'modifier', ${modifier("baseClass")},
|
|
69172
|
+
'label', [baseClass].[DisplayLabel],
|
|
69173
|
+
'description', [baseClass].[Description],
|
|
69174
|
+
'appliesTo', (
|
|
69175
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
69176
|
+
FROM [AppliesToCTE] [atCTE]
|
|
69177
|
+
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
69178
|
+
)
|
|
69179
|
+
)))
|
|
69180
|
+
FROM
|
|
69181
|
+
[meta].[ECClassDef] [baseClass]
|
|
69182
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
69183
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
69184
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
69185
|
+
)
|
|
69186
|
+
) AS [item]
|
|
69187
|
+
FROM [meta].[ECClassDef] [class]
|
|
69188
|
+
WHERE [class].[Type] = 0 AND EXISTS (SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
69189
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
69190
69190
|
`;
|
|
69191
|
-
const withSchemaItems = `
|
|
69192
|
-
SchemaItems AS (
|
|
69193
|
-
${customAttributeQuery}
|
|
69194
|
-
UNION ALL
|
|
69195
|
-
${structQuery}
|
|
69196
|
-
UNION ALL
|
|
69197
|
-
${relationshipQuery}
|
|
69198
|
-
UNION ALL
|
|
69199
|
-
${entityQuery}
|
|
69200
|
-
UNION ALL
|
|
69201
|
-
${mixinQuery}
|
|
69202
|
-
UNION ALL
|
|
69203
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration()}
|
|
69204
|
-
UNION ALL
|
|
69205
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity()}
|
|
69206
|
-
UNION ALL
|
|
69207
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory()}
|
|
69208
|
-
UNION ALL
|
|
69209
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit()}
|
|
69210
|
-
UNION ALL
|
|
69211
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit()}
|
|
69212
|
-
UNION ALL
|
|
69213
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant()}
|
|
69214
|
-
UNION ALL
|
|
69215
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon()}
|
|
69216
|
-
UNION ALL
|
|
69217
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem()}
|
|
69218
|
-
UNION ALL
|
|
69219
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format()}
|
|
69220
|
-
)
|
|
69191
|
+
const withSchemaItems = `
|
|
69192
|
+
SchemaItems AS (
|
|
69193
|
+
${customAttributeQuery}
|
|
69194
|
+
UNION ALL
|
|
69195
|
+
${structQuery}
|
|
69196
|
+
UNION ALL
|
|
69197
|
+
${relationshipQuery}
|
|
69198
|
+
UNION ALL
|
|
69199
|
+
${entityQuery}
|
|
69200
|
+
UNION ALL
|
|
69201
|
+
${mixinQuery}
|
|
69202
|
+
UNION ALL
|
|
69203
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration()}
|
|
69204
|
+
UNION ALL
|
|
69205
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity()}
|
|
69206
|
+
UNION ALL
|
|
69207
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory()}
|
|
69208
|
+
UNION ALL
|
|
69209
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit()}
|
|
69210
|
+
UNION ALL
|
|
69211
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit()}
|
|
69212
|
+
UNION ALL
|
|
69213
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant()}
|
|
69214
|
+
UNION ALL
|
|
69215
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon()}
|
|
69216
|
+
UNION ALL
|
|
69217
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem()}
|
|
69218
|
+
UNION ALL
|
|
69219
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format()}
|
|
69220
|
+
)
|
|
69221
69221
|
`;
|
|
69222
|
-
const schemaStubQuery = `
|
|
69223
|
-
WITH
|
|
69224
|
-
${withAppliesTo},
|
|
69225
|
-
${withSchemaItems}
|
|
69226
|
-
SELECT
|
|
69227
|
-
[items].[item]
|
|
69228
|
-
FROM
|
|
69229
|
-
[SchemaItems] [items]
|
|
69230
|
-
JOIN [meta].[ECSchemaDef] [schemaDef]
|
|
69231
|
-
ON [schemaDef].[ECInstanceId] = [items].[SchemaId]
|
|
69232
|
-
WHERE [schemaDef].[Name] = :schemaName
|
|
69222
|
+
const schemaStubQuery = `
|
|
69223
|
+
WITH
|
|
69224
|
+
${withAppliesTo},
|
|
69225
|
+
${withSchemaItems}
|
|
69226
|
+
SELECT
|
|
69227
|
+
[items].[item]
|
|
69228
|
+
FROM
|
|
69229
|
+
[SchemaItems] [items]
|
|
69230
|
+
JOIN [meta].[ECSchemaDef] [schemaDef]
|
|
69231
|
+
ON [schemaDef].[ECInstanceId] = [items].[SchemaId]
|
|
69232
|
+
WHERE [schemaDef].[Name] = :schemaName
|
|
69233
69233
|
`;
|
|
69234
|
-
const schemaInfoQuery = `
|
|
69235
|
-
WITH
|
|
69236
|
-
${withSchemaReferences}
|
|
69237
|
-
SELECT
|
|
69238
|
-
[Name] as [name],
|
|
69239
|
-
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
69240
|
-
[Alias] as [alias],
|
|
69241
|
-
[DisplayLabel] as [label],
|
|
69242
|
-
[Description] as [description],
|
|
69243
|
-
(
|
|
69244
|
-
SELECT
|
|
69245
|
-
json_group_array([schemaReferences].[fullName])
|
|
69246
|
-
FROM
|
|
69247
|
-
[SchemaReferences] [schemaReferences]
|
|
69248
|
-
WHERE
|
|
69249
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
69250
|
-
) AS [references]
|
|
69251
|
-
FROM
|
|
69252
|
-
[meta].[ECSchemaDef] [schemaDef]
|
|
69234
|
+
const schemaInfoQuery = `
|
|
69235
|
+
WITH
|
|
69236
|
+
${withSchemaReferences}
|
|
69237
|
+
SELECT
|
|
69238
|
+
[Name] as [name],
|
|
69239
|
+
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
69240
|
+
[Alias] as [alias],
|
|
69241
|
+
[DisplayLabel] as [label],
|
|
69242
|
+
[Description] as [description],
|
|
69243
|
+
(
|
|
69244
|
+
SELECT
|
|
69245
|
+
json_group_array([schemaReferences].[fullName])
|
|
69246
|
+
FROM
|
|
69247
|
+
[SchemaReferences] [schemaReferences]
|
|
69248
|
+
WHERE
|
|
69249
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
69250
|
+
) AS [references]
|
|
69251
|
+
FROM
|
|
69252
|
+
[meta].[ECSchemaDef] [schemaDef]
|
|
69253
69253
|
`;
|
|
69254
69254
|
/**
|
|
69255
69255
|
* Partial Schema queries.
|
|
@@ -82677,13 +82677,13 @@ class BriefcaseConnection extends _IModelConnection__WEBPACK_IMPORTED_MODULE_5__
|
|
|
82677
82677
|
}
|
|
82678
82678
|
/** Commit pending changes to this briefcase.
|
|
82679
82679
|
* @param description Optional description of the changes.
|
|
82680
|
-
* @deprecated in 5.
|
|
82680
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.
|
|
82681
82681
|
*/
|
|
82682
82682
|
async saveChanges(description) {
|
|
82683
82683
|
await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.saveChanges(this.key, description); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
82684
82684
|
}
|
|
82685
82685
|
/** Abandon pending changes to this briefcase.
|
|
82686
|
-
* @deprecated in 5.
|
|
82686
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on EditCommand instead.
|
|
82687
82687
|
*/
|
|
82688
82688
|
async abandonChanges() {
|
|
82689
82689
|
await _IpcApp__WEBPACK_IMPORTED_MODULE_6__.IpcApp.appFunctionIpc.abandonChanges(this.key); // eslint-disable-line @typescript-eslint/no-deprecated
|
|
@@ -181297,7 +181297,7 @@ class PrimitiveTool extends _Tool__WEBPACK_IMPORTED_MODULE_4__.InteractiveTool {
|
|
|
181297
181297
|
}
|
|
181298
181298
|
/**
|
|
181299
181299
|
* If this tool is editing a briefcase, commits any elements that the tool has changed, supplying the tool flyover for the undo description.
|
|
181300
|
-
* @deprecated in 5.
|
|
181300
|
+
* @deprecated in 5.9.0 - will not be removed until after 2027-05-04. Use methods on [[EditCommand]] IPC instead.
|
|
181301
181301
|
*/
|
|
181302
181302
|
async saveChanges() {
|
|
181303
181303
|
if (this.iModel.isBriefcaseConnection())
|
|
@@ -189690,6 +189690,8 @@ class Geometry {
|
|
|
189690
189690
|
* Toleranced equality test.
|
|
189691
189691
|
* @param tolerance _relative_ tolerance. Default value is [[smallAngleRadians]].
|
|
189692
189692
|
* @returns true if and only if `a` and `b` are almost equal.
|
|
189693
|
+
* @see [[isSameFraction]], [[isSameCoordinate]], etc., which have more appropriate default absolute tolerances for
|
|
189694
|
+
* inputs known to be fractions and distances/coordinates.
|
|
189693
189695
|
*/
|
|
189694
189696
|
static isAlmostEqualNumber(a, b, tolerance = Geometry.smallAngleRadians) {
|
|
189695
189697
|
const sumAbs = 1.0 + Math.abs(a) + Math.abs(b);
|
|
@@ -198554,7 +198556,7 @@ class ClipShape extends ClipPrimitive {
|
|
|
198554
198556
|
}
|
|
198555
198557
|
/**
|
|
198556
198558
|
* Return true if this ClipShape has a local to world transform
|
|
198557
|
-
* @deprecated in 5.
|
|
198559
|
+
* @deprecated in 5.5.0 - will not be removed until after 2027-01-05. Use duplicate property [[transformValid]] or
|
|
198558
198560
|
* type guard [[hasTransformFromClip]] instead.
|
|
198559
198561
|
*/
|
|
198560
198562
|
get transformIsValid() {
|
|
@@ -214144,9 +214146,9 @@ var RegionBinaryOpType;
|
|
|
214144
214146
|
class RegionOps {
|
|
214145
214147
|
/**
|
|
214146
214148
|
* Return moment sums for a loop, parity region, or union region.
|
|
214147
|
-
* * The input region should lie in a plane parallel to the xy-plane, as z-coords
|
|
214148
|
-
* *
|
|
214149
|
-
*
|
|
214149
|
+
* * The input region should lie in a plane parallel to the xy-plane, as z-coords are ignored (assumed to be zero).
|
|
214150
|
+
* * The caller can convert the return value `rawMomentData` to principal axes and moments with
|
|
214151
|
+
* `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
214150
214152
|
* * `rawMomentData.origin` is the centroid of `region`.
|
|
214151
214153
|
* * `rawMomentData.sums.weight()` is the signed area of `region`.
|
|
214152
214154
|
* @param region any [[Loop]], [[ParityRegion]], or [[UnionRegion]].
|
|
@@ -214191,9 +214193,8 @@ class RegionOps {
|
|
|
214191
214193
|
}
|
|
214192
214194
|
/**
|
|
214193
214195
|
* Return MomentData with the sums of wire moments.
|
|
214194
|
-
* * The
|
|
214195
|
-
*
|
|
214196
|
-
* call `principalMomentData = MomentData.inertiaProductsToPrincipalAxes (rawMomentData.origin, rawMomentData.sums);`
|
|
214196
|
+
* * The caller can convert the return value `rawMomentData` to principal axes and moments with
|
|
214197
|
+
* `principalMomentData = MomentData.inertiaProductsToPrincipalAxes(rawMomentData.origin, rawMomentData.sums);`
|
|
214197
214198
|
* * `rawMomentData.origin` is the wire centroid of `curve`.
|
|
214198
214199
|
* * `rawMomentData.sums.weight()` is the signed length of `curve`.
|
|
214199
214200
|
* @param curve any [[CurveCollection]] or [[CurvePrimitive]].
|
|
@@ -214233,6 +214234,8 @@ class RegionOps {
|
|
|
214233
214234
|
const centroid = momentData.origin.clone(result?.origin);
|
|
214234
214235
|
if (!regionIsXY) // rotate centroid back (area is unchanged)
|
|
214235
214236
|
localToWorld.multiplyPoint3d(centroid, centroid);
|
|
214237
|
+
else if (localToWorld.origin.z !== 0) // horizontal region needs vertical shift
|
|
214238
|
+
centroid.z += localToWorld.origin.z;
|
|
214236
214239
|
let area = momentData.sums.weight();
|
|
214237
214240
|
if (area < 0.0) {
|
|
214238
214241
|
area = -area;
|
|
@@ -230678,7 +230681,7 @@ class Ellipsoid {
|
|
|
230678
230681
|
* @param angleB end point of arc (given as angles on this ellipsoid)
|
|
230679
230682
|
* @returns arc in the plane defined by the normal at the intermediate point. If calculation fails, return an
|
|
230680
230683
|
* arc with zero matrix.
|
|
230681
|
-
* @deprecated in 5.
|
|
230684
|
+
* @deprecated in 5.5.0 - will not be removed until after 2027-01-05. Prefer [[sectionArcInPlaneOfInterpolatedNormal]],
|
|
230682
230685
|
* which has expanded return type.
|
|
230683
230686
|
*/
|
|
230684
230687
|
sectionArcWithIntermediateNormal(angleA, intermediateNormalFraction, angleB) {
|
|
@@ -327488,7 +327491,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
327488
327491
|
/***/ ((module) => {
|
|
327489
327492
|
|
|
327490
327493
|
"use strict";
|
|
327491
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.10.0-dev.
|
|
327494
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.10.0-dev.12","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers && npm run -s copy:draco","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2022 --outDir lib/esm","clean":"rimraf -g lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","copy:draco":"cpx \\"./node_modules/@loaders.gl/draco/dist/libs/*\\" ./lib/public/scripts","docs":"betools docs --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts && npm run -s extract","extract":"betools extract --fileExt=ts --extractFrom=./src/test/example-code --recursive --out=../../generated-docs/extract","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint --no-inline-config -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-deprecation":"eslint --fix -f visualstudio --no-inline-config -c ../../common/config/eslint/eslint.config.deprecation-policy.js \\"./src/**/*.ts\\"","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run webpackTestWorker && vitest --run","cover":"npm run webpackTestWorker && vitest --run","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@bentley/aec-units-schema":"^1.0.3","@bentley/formats-schema":"^1.0.0","@bentley/units-schema":"^1.0.9","@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/ecschema-metadata":"workspace:*","@itwin/ecschema-rpcinterface-common":"workspace:*","@itwin/object-storage-core":"^3.0.4","@itwin/eslint-plugin":"^6.0.0","@types/chai-as-promised":"^7","@types/draco3d":"^1.4.10","@types/sinon":"^17.0.2","@vitest/browser":"^3.0.6","@vitest/coverage-v8":"^3.0.6","cpx2":"^8.0.0","eslint":"^9.31.0","glob":"^10.5.0","playwright":"~1.56.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","vitest":"^3.0.6","vite-multiple-assets":"^1.3.1","vite-plugin-static-copy":"2.2.0","webpack":"^5.97.1"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"~4.3.4","@loaders.gl/draco":"~4.3.4","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
327492
327495
|
|
|
327493
327496
|
/***/ })
|
|
327494
327497
|
|