@itwin/ecschema-rpcinterface-tests 5.1.3 → 5.1.5
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/backend/BackendInit.js.map +1 -1
- package/lib/common/Settings.js +4 -4
- package/lib/common/Settings.js.map +1 -1
- package/lib/common/SideChannels.js.map +1 -1
- package/lib/dist/_bea9.bundled-tests.js.map +1 -1
- package/lib/dist/bundled-tests.js +1045 -1034
- package/lib/dist/bundled-tests.js.map +1 -1
- package/lib/dist/core_frontend_lib_esm_ApproximateTerrainHeightsProps_js.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_cross-fetch_4_0_0_node_modules_cross-fetch_dist_browser-24291b.bundled-tests.js.map +1 -1
- package/lib/dist/vendors-common_temp_node_modules_pnpm_loaders_gl_draco_3_1_6_node_modules_loaders_gl_draco_di-0642a6.bundled-tests.js.map +1 -1
- package/lib/frontend/SchemaRpcInterface.test.js.map +1 -1
- package/lib/frontend/setup/IModelSession.js.map +1 -1
- package/lib/frontend/setup/TestContext.js.map +1 -1
- package/package.json +15 -15
|
@@ -65380,212 +65380,212 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
65380
65380
|
* WITH clauses are broken down into individual variables.
|
|
65381
65381
|
*/
|
|
65382
65382
|
const propertyType = (alias) => {
|
|
65383
|
-
return `
|
|
65384
|
-
CASE
|
|
65385
|
-
WHEN [${alias}].[Kind] = 0 THEN 'PrimitiveProperty'
|
|
65386
|
-
WHEN [${alias}].[Kind] = 1 THEN 'StructProperty'
|
|
65387
|
-
WHEN [${alias}].[Kind] = 2 THEN 'PrimitiveArrayProperty'
|
|
65388
|
-
WHEN [${alias}].[Kind] = 3 THEN 'StructArrayProperty'
|
|
65389
|
-
WHEN [${alias}].[Kind] = 4 THEN 'NavigationProperty'
|
|
65390
|
-
ELSE NULL
|
|
65391
|
-
END
|
|
65383
|
+
return `
|
|
65384
|
+
CASE
|
|
65385
|
+
WHEN [${alias}].[Kind] = 0 THEN 'PrimitiveProperty'
|
|
65386
|
+
WHEN [${alias}].[Kind] = 1 THEN 'StructProperty'
|
|
65387
|
+
WHEN [${alias}].[Kind] = 2 THEN 'PrimitiveArrayProperty'
|
|
65388
|
+
WHEN [${alias}].[Kind] = 3 THEN 'StructArrayProperty'
|
|
65389
|
+
WHEN [${alias}].[Kind] = 4 THEN 'NavigationProperty'
|
|
65390
|
+
ELSE NULL
|
|
65391
|
+
END
|
|
65392
65392
|
`;
|
|
65393
65393
|
};
|
|
65394
65394
|
const navigationDirection = (alias) => {
|
|
65395
|
-
return `
|
|
65396
|
-
CASE
|
|
65397
|
-
WHEN [${alias}].[NavigationDirection] = 1 THEN 'Forward'
|
|
65398
|
-
WHEN [${alias}].[NavigationDirection] = 2 THEN 'Backward'
|
|
65399
|
-
ELSE NULL
|
|
65400
|
-
END
|
|
65395
|
+
return `
|
|
65396
|
+
CASE
|
|
65397
|
+
WHEN [${alias}].[NavigationDirection] = 1 THEN 'Forward'
|
|
65398
|
+
WHEN [${alias}].[NavigationDirection] = 2 THEN 'Backward'
|
|
65399
|
+
ELSE NULL
|
|
65400
|
+
END
|
|
65401
65401
|
`;
|
|
65402
65402
|
};
|
|
65403
65403
|
const schemaCustomAttribute = (alias) => {
|
|
65404
|
-
return `
|
|
65405
|
-
SELECT
|
|
65406
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65407
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65408
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 1
|
|
65409
|
-
ORDER BY [ca].[Ordinal]
|
|
65404
|
+
return `
|
|
65405
|
+
SELECT
|
|
65406
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65407
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65408
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 1
|
|
65409
|
+
ORDER BY [ca].[Ordinal]
|
|
65410
65410
|
`;
|
|
65411
65411
|
};
|
|
65412
65412
|
/**
|
|
65413
65413
|
* Selects customAttribute data for each class type.
|
|
65414
65414
|
*/
|
|
65415
65415
|
const classCustomAttribute = (alias) => {
|
|
65416
|
-
return `
|
|
65417
|
-
SELECT
|
|
65418
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65419
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65420
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
65421
|
-
ORDER BY [ca].[Ordinal]
|
|
65416
|
+
return `
|
|
65417
|
+
SELECT
|
|
65418
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65419
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65420
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
65421
|
+
ORDER BY [ca].[Ordinal]
|
|
65422
65422
|
`;
|
|
65423
65423
|
};
|
|
65424
65424
|
const propertyCustomAttribute = (alias) => {
|
|
65425
|
-
return `
|
|
65426
|
-
SELECT
|
|
65427
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65428
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65429
|
-
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 992
|
|
65430
|
-
ORDER BY [ca].[Ordinal]
|
|
65425
|
+
return `
|
|
65426
|
+
SELECT
|
|
65427
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65428
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65429
|
+
WHERE [ca].[ContainerId] = [${alias}].[ECInstanceId] AND [ca].[ContainerType] = 992
|
|
65430
|
+
ORDER BY [ca].[Ordinal]
|
|
65431
65431
|
`;
|
|
65432
65432
|
};
|
|
65433
65433
|
/**
|
|
65434
65434
|
* Selects base class data for each class type.
|
|
65435
65435
|
*/
|
|
65436
|
-
const selectBaseClasses = `
|
|
65437
|
-
SELECT
|
|
65438
|
-
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
65439
|
-
FROM
|
|
65440
|
-
[meta].[ECClassDef] [baseClass]
|
|
65441
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
65442
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
65443
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
65444
|
-
LIMIT 1
|
|
65436
|
+
const selectBaseClasses = `
|
|
65437
|
+
SELECT
|
|
65438
|
+
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
65439
|
+
FROM
|
|
65440
|
+
[meta].[ECClassDef] [baseClass]
|
|
65441
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
65442
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
65443
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
65444
|
+
LIMIT 1
|
|
65445
65445
|
`;
|
|
65446
65446
|
/**
|
|
65447
65447
|
* Selects class property data for each class type. ClassProperties
|
|
65448
65448
|
* is a common table expression (CTE or WITH clause) defined below.
|
|
65449
65449
|
*/
|
|
65450
|
-
const selectProperties = `
|
|
65451
|
-
SELECT
|
|
65452
|
-
json_group_array(json([classProperties].[property]))
|
|
65453
|
-
FROM
|
|
65454
|
-
[ClassProperties] [classProperties]
|
|
65455
|
-
WHERE
|
|
65456
|
-
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
65450
|
+
const selectProperties = `
|
|
65451
|
+
SELECT
|
|
65452
|
+
json_group_array(json([classProperties].[property]))
|
|
65453
|
+
FROM
|
|
65454
|
+
[ClassProperties] [classProperties]
|
|
65455
|
+
WHERE
|
|
65456
|
+
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
65457
65457
|
`;
|
|
65458
65458
|
/**
|
|
65459
65459
|
* A CTE used to select AppliesTo from IsMixin CustomAttributes for a given Mixin.
|
|
65460
65460
|
*/
|
|
65461
|
-
const withAppliesTo = `
|
|
65462
|
-
AppliesToCTE AS (
|
|
65463
|
-
SELECT
|
|
65464
|
-
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
65465
|
-
[appliesToSchema].[name] as [AppliesToSchema],
|
|
65466
|
-
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
65467
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65468
|
-
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
65469
|
-
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
65470
|
-
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
65471
|
-
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
65472
|
-
WHERE [ca].[ContainerType] = 30
|
|
65473
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
65474
|
-
)
|
|
65461
|
+
const withAppliesTo = `
|
|
65462
|
+
AppliesToCTE AS (
|
|
65463
|
+
SELECT
|
|
65464
|
+
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
65465
|
+
[appliesToSchema].[name] as [AppliesToSchema],
|
|
65466
|
+
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
65467
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65468
|
+
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
65469
|
+
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
65470
|
+
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
65471
|
+
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
65472
|
+
WHERE [ca].[ContainerType] = 30
|
|
65473
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
65474
|
+
)
|
|
65475
65475
|
`;
|
|
65476
65476
|
/**
|
|
65477
65477
|
* A CTE used to select Schema reference data for a given Schema.
|
|
65478
65478
|
*/
|
|
65479
|
-
const withSchemaReferences = `
|
|
65480
|
-
SchemaReferences as (
|
|
65481
|
-
SELECT
|
|
65482
|
-
[ref].[SourceECInstanceId] as [SchemaId],
|
|
65483
|
-
json_object(
|
|
65484
|
-
'name', [Name],
|
|
65485
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor]))
|
|
65486
|
-
) as [reference]
|
|
65487
|
-
FROM
|
|
65488
|
-
[meta].[ECSchemaDef] as [refSchema]
|
|
65489
|
-
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
65490
|
-
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
65491
|
-
)
|
|
65479
|
+
const withSchemaReferences = `
|
|
65480
|
+
SchemaReferences as (
|
|
65481
|
+
SELECT
|
|
65482
|
+
[ref].[SourceECInstanceId] as [SchemaId],
|
|
65483
|
+
json_object(
|
|
65484
|
+
'name', [Name],
|
|
65485
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor]))
|
|
65486
|
+
) as [reference]
|
|
65487
|
+
FROM
|
|
65488
|
+
[meta].[ECSchemaDef] as [refSchema]
|
|
65489
|
+
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
65490
|
+
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
65491
|
+
)
|
|
65492
65492
|
`;
|
|
65493
65493
|
/**
|
|
65494
65494
|
* A CTE used to select Relationship constraints for a given RelationshipClass.
|
|
65495
65495
|
*/
|
|
65496
|
-
const withRelationshipConstraints = `
|
|
65497
|
-
ClassRelationshipConstraints as (
|
|
65498
|
-
SELECT
|
|
65499
|
-
[rhc].[SourceECInstanceId] as [ClassId],
|
|
65500
|
-
[constraintDef].[ECInstanceId] as [ConstraintId],
|
|
65501
|
-
[RelationshipEnd],
|
|
65502
|
-
CONCAT('(', [MultiplicityLowerLimit], '..', IIF([MultiplicityUpperLimit] IS NULL, '*', [MultiplicityUpperLimit]), ')') as [Multiplicity],
|
|
65503
|
-
[IsPolyMorphic],
|
|
65504
|
-
[RoleLabel],
|
|
65505
|
-
IIF([constraintDef].[AbstractConstraintClass] IS NOT NULL, ec_classname([constraintDef].[AbstractConstraintClass].[Id], 's.c'), null) as [AbstractConstraint],
|
|
65506
|
-
IIF ([rchc].[TargetECInstanceId] IS NOT NULL, JSON_GROUP_ARRAY(ec_classname([rchc].[TargetECInstanceId], 's.c')), null) as [ConstraintClasses]
|
|
65507
|
-
FROM
|
|
65508
|
-
[meta].[ECRelationshipConstraintDef] [constraintDef]
|
|
65509
|
-
JOIN [meta].[RelationshipHasConstraints] [rhc]
|
|
65510
|
-
ON [rhc].[TargetECInstanceId] = [constraintDef].[ECInstanceId]
|
|
65511
|
-
JOIN [meta].[RelationshipConstraintHasClasses] [rchc]
|
|
65512
|
-
ON [rchc].[SourceECInstanceId] = [constraintDef].[ECInstanceId]
|
|
65513
|
-
GROUP BY [constraintDef].[ECInstanceId]
|
|
65514
|
-
)
|
|
65496
|
+
const withRelationshipConstraints = `
|
|
65497
|
+
ClassRelationshipConstraints as (
|
|
65498
|
+
SELECT
|
|
65499
|
+
[rhc].[SourceECInstanceId] as [ClassId],
|
|
65500
|
+
[constraintDef].[ECInstanceId] as [ConstraintId],
|
|
65501
|
+
[RelationshipEnd],
|
|
65502
|
+
CONCAT('(', [MultiplicityLowerLimit], '..', IIF([MultiplicityUpperLimit] IS NULL, '*', [MultiplicityUpperLimit]), ')') as [Multiplicity],
|
|
65503
|
+
[IsPolyMorphic],
|
|
65504
|
+
[RoleLabel],
|
|
65505
|
+
IIF([constraintDef].[AbstractConstraintClass] IS NOT NULL, ec_classname([constraintDef].[AbstractConstraintClass].[Id], 's.c'), null) as [AbstractConstraint],
|
|
65506
|
+
IIF ([rchc].[TargetECInstanceId] IS NOT NULL, JSON_GROUP_ARRAY(ec_classname([rchc].[TargetECInstanceId], 's.c')), null) as [ConstraintClasses]
|
|
65507
|
+
FROM
|
|
65508
|
+
[meta].[ECRelationshipConstraintDef] [constraintDef]
|
|
65509
|
+
JOIN [meta].[RelationshipHasConstraints] [rhc]
|
|
65510
|
+
ON [rhc].[TargetECInstanceId] = [constraintDef].[ECInstanceId]
|
|
65511
|
+
JOIN [meta].[RelationshipConstraintHasClasses] [rchc]
|
|
65512
|
+
ON [rchc].[SourceECInstanceId] = [constraintDef].[ECInstanceId]
|
|
65513
|
+
GROUP BY [constraintDef].[ECInstanceId]
|
|
65514
|
+
)
|
|
65515
65515
|
`;
|
|
65516
65516
|
/**
|
|
65517
65517
|
* A CTE used to select Class property data for a given Class.
|
|
65518
65518
|
*/
|
|
65519
|
-
const withClassProperties = `
|
|
65520
|
-
ClassProperties as (
|
|
65521
|
-
SELECT
|
|
65522
|
-
[cop].[SourceECInstanceId] as [ClassId],
|
|
65523
|
-
json_object(
|
|
65524
|
-
'name', [pd].[Name],
|
|
65525
|
-
'label', [pd].[DisplayLabel],
|
|
65526
|
-
'description', [pd].[Description],
|
|
65527
|
-
'isReadOnly', IIF([pd].[IsReadOnly] = 1, json('true'), NULL),
|
|
65528
|
-
'priority', [pd].[Priority],
|
|
65529
|
-
'category', IIF([categoryDef].[Name] IS NULL, NULL, CONCAT([categorySchemaDef].[Name], '.', [categoryDef].[Name])),
|
|
65530
|
-
'kindOfQuantity', IIF([koqDef].[Name] IS NULL, NULL, CONCAT([koqSchemaDef].[Name], '.', [koqDef].[Name])),
|
|
65531
|
-
'typeName',
|
|
65532
|
-
CASE
|
|
65533
|
-
WHEN [pd].[Kind] = 0 OR [pd].[Kind] = 2 Then
|
|
65534
|
-
CASE
|
|
65535
|
-
WHEN [enumDef].[Name] IS NOT NULL Then CONCAT([enumSchemaDef].[Name], '.', [enumDef].[Name])
|
|
65536
|
-
WHEN [pd].[PrimitiveType] = 257 Then 'binary'
|
|
65537
|
-
WHEN [pd].[PrimitiveType] = 513 Then 'boolean'
|
|
65538
|
-
WHEN [pd].[PrimitiveType] = 769 Then 'dateTime'
|
|
65539
|
-
WHEN [pd].[PrimitiveType] = 1025 Then 'double'
|
|
65540
|
-
WHEN [pd].[PrimitiveType] = 1281 Then 'int'
|
|
65541
|
-
WHEN [pd].[PrimitiveType] = 1537 Then 'long'
|
|
65542
|
-
WHEN [pd].[PrimitiveType] = 1793 Then 'point2d'
|
|
65543
|
-
WHEN [pd].[PrimitiveType] = 2049 Then 'point3d'
|
|
65544
|
-
WHEN [pd].[PrimitiveType] = 2305 Then 'string'
|
|
65545
|
-
WHEN [pd].[PrimitiveType] = 2561 Then 'Bentley.Geometry.Common.IGeometry'
|
|
65546
|
-
ELSE null
|
|
65547
|
-
END
|
|
65548
|
-
WHEN [pd].[Kind] = 1 OR [pd].[Kind] = 3 Then
|
|
65549
|
-
CONCAT([structSchemaDef].[Name], '.', [structDef].[Name])
|
|
65550
|
-
ELSE null
|
|
65551
|
-
END,
|
|
65552
|
-
'type', ${propertyType("pd")},
|
|
65553
|
-
'minLength', [pd].[PrimitiveTypeMinLength],
|
|
65554
|
-
'maxLength', [pd].[PrimitiveTypeMaxLength],
|
|
65555
|
-
'minValue', [pd].[PrimitiveTypeMinValue],
|
|
65556
|
-
'maxValue', [pd].[PrimitiveTypeMaxValue],
|
|
65557
|
-
'extendedTypeName', [pd].[ExtendedTypeName],
|
|
65558
|
-
'minOccurs', [pd].[ArrayMinOccurs],
|
|
65559
|
-
'maxOccurs', [pd].[ArrayMaxOccurs],
|
|
65560
|
-
'direction', ${navigationDirection("pd")},
|
|
65561
|
-
'relationshipName', IIF([navRelDef].[Name] IS NULL, NULL, CONCAT([navSchemaDef].[Name], '.', [navRelDef].[Name])),
|
|
65562
|
-
'customAttributes', (${propertyCustomAttribute("pd")})
|
|
65563
|
-
) as [property]
|
|
65564
|
-
FROM
|
|
65565
|
-
[meta].[ECPropertyDef] as [pd]
|
|
65566
|
-
JOIN [meta].[ClassOwnsLocalProperties] [cop]
|
|
65567
|
-
ON cop.[TargetECInstanceId] = [pd].[ECInstanceId]
|
|
65568
|
-
LEFT JOIN [meta].[ECEnumerationDef] [enumDef]
|
|
65569
|
-
ON [enumDef].[ECInstanceId] = [pd].[Enumeration].[Id]
|
|
65570
|
-
LEFT JOIN [meta].[ECSchemaDef] enumSchemaDef
|
|
65571
|
-
ON [enumSchemaDef].[ECInstanceId] = [enumDef].[Schema].[Id]
|
|
65572
|
-
LEFT JOIN [meta].[PropertyCategoryDef] [categoryDef]
|
|
65573
|
-
ON [categoryDef].[ECInstanceId] = [pd].[Category].[Id]
|
|
65574
|
-
LEFT JOIN [meta].[ECSchemaDef] [categorySchemaDef]
|
|
65575
|
-
ON [categorySchemaDef].[ECInstanceId] = [categoryDef].[Schema].[Id]
|
|
65576
|
-
LEFT JOIN [meta].[KindOfQuantityDef] [koqDef]
|
|
65577
|
-
ON [koqDef].[ECInstanceId] = [pd].[KindOfQuantity].[Id]
|
|
65578
|
-
LEFT JOIN [meta].[ECSchemaDef] [koqSchemaDef]
|
|
65579
|
-
ON [koqSchemaDef].[ECInstanceId] = [koqDef].[Schema].[Id]
|
|
65580
|
-
LEFT JOIN [meta].[ECClassDef] [structDef]
|
|
65581
|
-
ON structDef.[ECInstanceId] = [pd].[StructClass].[Id]
|
|
65582
|
-
LEFT JOIN [meta].[ECSchemaDef] [structSchemaDef]
|
|
65583
|
-
ON [structSchemaDef].[ECInstanceId] = [structDef].[Schema].[Id]
|
|
65584
|
-
LEFT JOIN [meta].[ECClassDef] [navRelDef]
|
|
65585
|
-
ON [navRelDef].[ECInstanceId] = [pd].[NavigationRelationshipClass].[Id]
|
|
65586
|
-
LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
65587
|
-
ON [navSchemaDef].[ECInstanceId] = [navRelDef].[Schema].[Id]
|
|
65588
|
-
)
|
|
65519
|
+
const withClassProperties = `
|
|
65520
|
+
ClassProperties as (
|
|
65521
|
+
SELECT
|
|
65522
|
+
[cop].[SourceECInstanceId] as [ClassId],
|
|
65523
|
+
json_object(
|
|
65524
|
+
'name', [pd].[Name],
|
|
65525
|
+
'label', [pd].[DisplayLabel],
|
|
65526
|
+
'description', [pd].[Description],
|
|
65527
|
+
'isReadOnly', IIF([pd].[IsReadOnly] = 1, json('true'), NULL),
|
|
65528
|
+
'priority', [pd].[Priority],
|
|
65529
|
+
'category', IIF([categoryDef].[Name] IS NULL, NULL, CONCAT([categorySchemaDef].[Name], '.', [categoryDef].[Name])),
|
|
65530
|
+
'kindOfQuantity', IIF([koqDef].[Name] IS NULL, NULL, CONCAT([koqSchemaDef].[Name], '.', [koqDef].[Name])),
|
|
65531
|
+
'typeName',
|
|
65532
|
+
CASE
|
|
65533
|
+
WHEN [pd].[Kind] = 0 OR [pd].[Kind] = 2 Then
|
|
65534
|
+
CASE
|
|
65535
|
+
WHEN [enumDef].[Name] IS NOT NULL Then CONCAT([enumSchemaDef].[Name], '.', [enumDef].[Name])
|
|
65536
|
+
WHEN [pd].[PrimitiveType] = 257 Then 'binary'
|
|
65537
|
+
WHEN [pd].[PrimitiveType] = 513 Then 'boolean'
|
|
65538
|
+
WHEN [pd].[PrimitiveType] = 769 Then 'dateTime'
|
|
65539
|
+
WHEN [pd].[PrimitiveType] = 1025 Then 'double'
|
|
65540
|
+
WHEN [pd].[PrimitiveType] = 1281 Then 'int'
|
|
65541
|
+
WHEN [pd].[PrimitiveType] = 1537 Then 'long'
|
|
65542
|
+
WHEN [pd].[PrimitiveType] = 1793 Then 'point2d'
|
|
65543
|
+
WHEN [pd].[PrimitiveType] = 2049 Then 'point3d'
|
|
65544
|
+
WHEN [pd].[PrimitiveType] = 2305 Then 'string'
|
|
65545
|
+
WHEN [pd].[PrimitiveType] = 2561 Then 'Bentley.Geometry.Common.IGeometry'
|
|
65546
|
+
ELSE null
|
|
65547
|
+
END
|
|
65548
|
+
WHEN [pd].[Kind] = 1 OR [pd].[Kind] = 3 Then
|
|
65549
|
+
CONCAT([structSchemaDef].[Name], '.', [structDef].[Name])
|
|
65550
|
+
ELSE null
|
|
65551
|
+
END,
|
|
65552
|
+
'type', ${propertyType("pd")},
|
|
65553
|
+
'minLength', [pd].[PrimitiveTypeMinLength],
|
|
65554
|
+
'maxLength', [pd].[PrimitiveTypeMaxLength],
|
|
65555
|
+
'minValue', [pd].[PrimitiveTypeMinValue],
|
|
65556
|
+
'maxValue', [pd].[PrimitiveTypeMaxValue],
|
|
65557
|
+
'extendedTypeName', [pd].[ExtendedTypeName],
|
|
65558
|
+
'minOccurs', [pd].[ArrayMinOccurs],
|
|
65559
|
+
'maxOccurs', [pd].[ArrayMaxOccurs],
|
|
65560
|
+
'direction', ${navigationDirection("pd")},
|
|
65561
|
+
'relationshipName', IIF([navRelDef].[Name] IS NULL, NULL, CONCAT([navSchemaDef].[Name], '.', [navRelDef].[Name])),
|
|
65562
|
+
'customAttributes', (${propertyCustomAttribute("pd")})
|
|
65563
|
+
) as [property]
|
|
65564
|
+
FROM
|
|
65565
|
+
[meta].[ECPropertyDef] as [pd]
|
|
65566
|
+
JOIN [meta].[ClassOwnsLocalProperties] [cop]
|
|
65567
|
+
ON cop.[TargetECInstanceId] = [pd].[ECInstanceId]
|
|
65568
|
+
LEFT JOIN [meta].[ECEnumerationDef] [enumDef]
|
|
65569
|
+
ON [enumDef].[ECInstanceId] = [pd].[Enumeration].[Id]
|
|
65570
|
+
LEFT JOIN [meta].[ECSchemaDef] enumSchemaDef
|
|
65571
|
+
ON [enumSchemaDef].[ECInstanceId] = [enumDef].[Schema].[Id]
|
|
65572
|
+
LEFT JOIN [meta].[PropertyCategoryDef] [categoryDef]
|
|
65573
|
+
ON [categoryDef].[ECInstanceId] = [pd].[Category].[Id]
|
|
65574
|
+
LEFT JOIN [meta].[ECSchemaDef] [categorySchemaDef]
|
|
65575
|
+
ON [categorySchemaDef].[ECInstanceId] = [categoryDef].[Schema].[Id]
|
|
65576
|
+
LEFT JOIN [meta].[KindOfQuantityDef] [koqDef]
|
|
65577
|
+
ON [koqDef].[ECInstanceId] = [pd].[KindOfQuantity].[Id]
|
|
65578
|
+
LEFT JOIN [meta].[ECSchemaDef] [koqSchemaDef]
|
|
65579
|
+
ON [koqSchemaDef].[ECInstanceId] = [koqDef].[Schema].[Id]
|
|
65580
|
+
LEFT JOIN [meta].[ECClassDef] [structDef]
|
|
65581
|
+
ON structDef.[ECInstanceId] = [pd].[StructClass].[Id]
|
|
65582
|
+
LEFT JOIN [meta].[ECSchemaDef] [structSchemaDef]
|
|
65583
|
+
ON [structSchemaDef].[ECInstanceId] = [structDef].[Schema].[Id]
|
|
65584
|
+
LEFT JOIN [meta].[ECClassDef] [navRelDef]
|
|
65585
|
+
ON [navRelDef].[ECInstanceId] = [pd].[NavigationRelationshipClass].[Id]
|
|
65586
|
+
LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
65587
|
+
ON [navSchemaDef].[ECInstanceId] = [navRelDef].[Schema].[Id]
|
|
65588
|
+
)
|
|
65589
65589
|
`;
|
|
65590
65590
|
/**
|
|
65591
65591
|
* Query that provides EntityClass data and is shared by two cases:
|
|
@@ -65593,52 +65593,52 @@ LEFT JOIN [meta].[ECSchemaDef] [navSchemaDef]
|
|
|
65593
65593
|
* 2. When querying a full schema with multiple schema item queries or
|
|
65594
65594
|
* when just querying for Entity classes.
|
|
65595
65595
|
*/
|
|
65596
|
-
const baseEntityQuery = `
|
|
65597
|
-
SELECT
|
|
65598
|
-
[sd].[Name] as [schema],
|
|
65599
|
-
json_object (
|
|
65600
|
-
'schemaItemType', 'EntityClass',
|
|
65601
|
-
'name', [class].[Name],
|
|
65602
|
-
'label', [class].[DisplayLabel],
|
|
65603
|
-
'description', [class].[Description],
|
|
65604
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65605
|
-
'baseClass', (
|
|
65606
|
-
${selectBaseClasses}
|
|
65607
|
-
),
|
|
65608
|
-
'mixins', (
|
|
65609
|
-
SELECT
|
|
65610
|
-
json_group_array(
|
|
65611
|
-
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
65612
|
-
)
|
|
65613
|
-
FROM
|
|
65614
|
-
[meta].[ECClassDef] [baseClass]
|
|
65615
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
65616
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
65617
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
65618
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
65619
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
65620
|
-
),
|
|
65621
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
65622
|
-
'properties', (
|
|
65623
|
-
${selectProperties}
|
|
65624
|
-
)
|
|
65625
|
-
) AS [item]
|
|
65626
|
-
FROM [meta].[ECClassDef] [class]
|
|
65627
|
-
JOIN
|
|
65628
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65629
|
-
WHERE [class].[Type] = 0 AND
|
|
65630
|
-
[sd].[Name] = :schemaName
|
|
65631
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
65632
|
-
AND [ca].[CustomAttributeClass].Id Is ([CoreCA].[IsMixin]))
|
|
65596
|
+
const baseEntityQuery = `
|
|
65597
|
+
SELECT
|
|
65598
|
+
[sd].[Name] as [schema],
|
|
65599
|
+
json_object (
|
|
65600
|
+
'schemaItemType', 'EntityClass',
|
|
65601
|
+
'name', [class].[Name],
|
|
65602
|
+
'label', [class].[DisplayLabel],
|
|
65603
|
+
'description', [class].[Description],
|
|
65604
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65605
|
+
'baseClass', (
|
|
65606
|
+
${selectBaseClasses}
|
|
65607
|
+
),
|
|
65608
|
+
'mixins', (
|
|
65609
|
+
SELECT
|
|
65610
|
+
json_group_array(
|
|
65611
|
+
ec_classname([baseClass].[ECInstanceId], 's.c')
|
|
65612
|
+
)
|
|
65613
|
+
FROM
|
|
65614
|
+
[meta].[ECClassDef] [baseClass]
|
|
65615
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
65616
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseClass].[ECInstanceId]
|
|
65617
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
65618
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
65619
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
65620
|
+
),
|
|
65621
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
65622
|
+
'properties', (
|
|
65623
|
+
${selectProperties}
|
|
65624
|
+
)
|
|
65625
|
+
) AS [item]
|
|
65626
|
+
FROM [meta].[ECClassDef] [class]
|
|
65627
|
+
JOIN
|
|
65628
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65629
|
+
WHERE [class].[Type] = 0 AND
|
|
65630
|
+
[sd].[Name] = :schemaName
|
|
65631
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
65632
|
+
AND [ca].[CustomAttributeClass].Id Is ([CoreCA].[IsMixin]))
|
|
65633
65633
|
`;
|
|
65634
65634
|
/**
|
|
65635
65635
|
* EntityClass query used to when querying for EntityClass data only. Not used
|
|
65636
65636
|
* for full Schema load via single query.
|
|
65637
65637
|
*/
|
|
65638
|
-
const entityQuery = `
|
|
65639
|
-
WITH
|
|
65640
|
-
${withClassProperties}
|
|
65641
|
-
${baseEntityQuery}
|
|
65638
|
+
const entityQuery = `
|
|
65639
|
+
WITH
|
|
65640
|
+
${withClassProperties}
|
|
65641
|
+
${baseEntityQuery}
|
|
65642
65642
|
`;
|
|
65643
65643
|
/**
|
|
65644
65644
|
* Query that provides Mixin data and is shared by two cases:
|
|
@@ -65646,56 +65646,56 @@ const entityQuery = `
|
|
|
65646
65646
|
* 2. When querying a full schema with multiple schema item queries or
|
|
65647
65647
|
* when just querying for Mixin classes.
|
|
65648
65648
|
*/
|
|
65649
|
-
const baseMixinQuery = `
|
|
65650
|
-
SELECT
|
|
65651
|
-
[sd].[Name] as [schema],
|
|
65652
|
-
json_object (
|
|
65653
|
-
'schemaItemType', 'Mixin',
|
|
65654
|
-
'name', [class].[Name],
|
|
65655
|
-
'label', [class].[DisplayLabel],
|
|
65656
|
-
'description', [class].[Description],
|
|
65657
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65658
|
-
'baseClass', (
|
|
65659
|
-
${selectBaseClasses}
|
|
65660
|
-
),
|
|
65661
|
-
'appliesTo', (
|
|
65662
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
65663
|
-
FROM [AppliesToCTE] [atCTE]
|
|
65664
|
-
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
65665
|
-
),
|
|
65666
|
-
'customAttributes', (
|
|
65667
|
-
SELECT
|
|
65668
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65669
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65670
|
-
WHERE [ca].[ContainerId] = [class].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
65671
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') <> 'IsMixin'
|
|
65672
|
-
),
|
|
65673
|
-
'properties', (
|
|
65674
|
-
SELECT
|
|
65675
|
-
json_group_array(json([classProperties].[property]))
|
|
65676
|
-
FROM
|
|
65677
|
-
[ClassProperties] [classProperties]
|
|
65678
|
-
WHERE
|
|
65679
|
-
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
65680
|
-
)
|
|
65681
|
-
) AS [item]
|
|
65682
|
-
FROM [meta].[ECClassDef] [class]
|
|
65683
|
-
JOIN
|
|
65684
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65685
|
-
WHERE [class].[Type] = 0 AND
|
|
65686
|
-
[sd].[Name] = :schemaName
|
|
65687
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
65688
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
65649
|
+
const baseMixinQuery = `
|
|
65650
|
+
SELECT
|
|
65651
|
+
[sd].[Name] as [schema],
|
|
65652
|
+
json_object (
|
|
65653
|
+
'schemaItemType', 'Mixin',
|
|
65654
|
+
'name', [class].[Name],
|
|
65655
|
+
'label', [class].[DisplayLabel],
|
|
65656
|
+
'description', [class].[Description],
|
|
65657
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65658
|
+
'baseClass', (
|
|
65659
|
+
${selectBaseClasses}
|
|
65660
|
+
),
|
|
65661
|
+
'appliesTo', (
|
|
65662
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
65663
|
+
FROM [AppliesToCTE] [atCTE]
|
|
65664
|
+
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
65665
|
+
),
|
|
65666
|
+
'customAttributes', (
|
|
65667
|
+
SELECT
|
|
65668
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65669
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65670
|
+
WHERE [ca].[ContainerId] = [class].[ECInstanceId] AND [ca].[ContainerType] = 30
|
|
65671
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') <> 'IsMixin'
|
|
65672
|
+
),
|
|
65673
|
+
'properties', (
|
|
65674
|
+
SELECT
|
|
65675
|
+
json_group_array(json([classProperties].[property]))
|
|
65676
|
+
FROM
|
|
65677
|
+
[ClassProperties] [classProperties]
|
|
65678
|
+
WHERE
|
|
65679
|
+
[classProperties].[ClassId] = [class].[ECInstanceId]
|
|
65680
|
+
)
|
|
65681
|
+
) AS [item]
|
|
65682
|
+
FROM [meta].[ECClassDef] [class]
|
|
65683
|
+
JOIN
|
|
65684
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65685
|
+
WHERE [class].[Type] = 0 AND
|
|
65686
|
+
[sd].[Name] = :schemaName
|
|
65687
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
65688
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
65689
65689
|
`;
|
|
65690
65690
|
/**
|
|
65691
65691
|
* Mixin query used to when querying for Mixin data only. Not used
|
|
65692
65692
|
* for full Schema load via single query.
|
|
65693
65693
|
*/
|
|
65694
|
-
const mixinQuery = `
|
|
65695
|
-
WITH
|
|
65696
|
-
${withAppliesTo},
|
|
65697
|
-
${withClassProperties}
|
|
65698
|
-
${baseMixinQuery}
|
|
65694
|
+
const mixinQuery = `
|
|
65695
|
+
WITH
|
|
65696
|
+
${withAppliesTo},
|
|
65697
|
+
${withClassProperties}
|
|
65698
|
+
${baseMixinQuery}
|
|
65699
65699
|
`;
|
|
65700
65700
|
/**
|
|
65701
65701
|
* Query that provides RelationshipClass data and is shared by two cases:
|
|
@@ -65703,82 +65703,82 @@ ${baseMixinQuery}
|
|
|
65703
65703
|
* 2. When querying a full schema with multiple schema item queries or
|
|
65704
65704
|
* when just querying for Relationship classes.
|
|
65705
65705
|
*/
|
|
65706
|
-
const baseRelationshipClassQuery = `
|
|
65707
|
-
SELECT
|
|
65708
|
-
[sd].Name as schema,
|
|
65709
|
-
json_object (
|
|
65710
|
-
'schemaItemType', 'RelationshipClass',
|
|
65711
|
-
'name', [class].[Name],
|
|
65712
|
-
'label', [class].[DisplayLabel],
|
|
65713
|
-
'description', [class].[Description],
|
|
65714
|
-
'strength', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strength)("class")},
|
|
65715
|
-
'strengthDirection', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strengthDirection)("class")},
|
|
65716
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65717
|
-
'baseClass', (
|
|
65718
|
-
${selectBaseClasses}
|
|
65719
|
-
),
|
|
65720
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
65721
|
-
'properties', (
|
|
65722
|
-
${selectProperties}
|
|
65723
|
-
),
|
|
65724
|
-
'source', (
|
|
65725
|
-
SELECT
|
|
65726
|
-
json_object (
|
|
65727
|
-
'multiplicity', [sourceConst].[Multiplicity],
|
|
65728
|
-
'roleLabel', [sourceConst].[RoleLabel],
|
|
65729
|
-
'polymorphic', IIF([sourceConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
65730
|
-
'abstractConstraint', [sourceConst].[AbstractConstraint],
|
|
65731
|
-
'constraintClasses', json([sourceConst].[ConstraintClasses]),
|
|
65732
|
-
'customAttributes', (
|
|
65733
|
-
SELECT
|
|
65734
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65735
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65736
|
-
WHERE [ca].[ContainerId] = [sourceConst].[ConstraintId] AND [ca].[ContainerType] = 1024
|
|
65737
|
-
ORDER BY [ca].[Ordinal]
|
|
65738
|
-
)
|
|
65739
|
-
)
|
|
65740
|
-
FROM
|
|
65741
|
-
[ClassRelationshipConstraints] [sourceConst]
|
|
65742
|
-
WHERE [sourceConst].[relationshipEnd] = 0
|
|
65743
|
-
AND [sourceConst].[ClassId] = [class].[ECInstanceId]
|
|
65744
|
-
),
|
|
65745
|
-
'target', (
|
|
65746
|
-
SELECT
|
|
65747
|
-
json_object (
|
|
65748
|
-
'multiplicity', [targetConst].[Multiplicity],
|
|
65749
|
-
'roleLabel', [targetConst].[RoleLabel],
|
|
65750
|
-
'polymorphic', IIF([targetConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
65751
|
-
'abstractConstraint', [targetConst].[AbstractConstraint],
|
|
65752
|
-
'constraintClasses', json([targetConst].[ConstraintClasses]),
|
|
65753
|
-
'customAttributes', (
|
|
65754
|
-
SELECT
|
|
65755
|
-
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65756
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
65757
|
-
WHERE [ca].[ContainerId] = [targetConst].[ConstraintId] AND [ca].[ContainerType] = 2048
|
|
65758
|
-
ORDER BY [ca].[Ordinal]
|
|
65759
|
-
)
|
|
65760
|
-
)
|
|
65761
|
-
FROM
|
|
65762
|
-
[ClassRelationshipConstraints] [targetConst]
|
|
65763
|
-
WHERE [targetConst].[relationshipEnd] = 1
|
|
65764
|
-
AND [targetConst].[ClassId] = [class].[ECInstanceId]
|
|
65765
|
-
)
|
|
65766
|
-
) AS [item]
|
|
65767
|
-
FROM [meta].[ECClassDef] [class]
|
|
65768
|
-
JOIN
|
|
65769
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65770
|
-
WHERE [class].[Type] = 1 AND
|
|
65771
|
-
[sd].[Name] = :schemaName
|
|
65706
|
+
const baseRelationshipClassQuery = `
|
|
65707
|
+
SELECT
|
|
65708
|
+
[sd].Name as schema,
|
|
65709
|
+
json_object (
|
|
65710
|
+
'schemaItemType', 'RelationshipClass',
|
|
65711
|
+
'name', [class].[Name],
|
|
65712
|
+
'label', [class].[DisplayLabel],
|
|
65713
|
+
'description', [class].[Description],
|
|
65714
|
+
'strength', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strength)("class")},
|
|
65715
|
+
'strengthDirection', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.strengthDirection)("class")},
|
|
65716
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65717
|
+
'baseClass', (
|
|
65718
|
+
${selectBaseClasses}
|
|
65719
|
+
),
|
|
65720
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
65721
|
+
'properties', (
|
|
65722
|
+
${selectProperties}
|
|
65723
|
+
),
|
|
65724
|
+
'source', (
|
|
65725
|
+
SELECT
|
|
65726
|
+
json_object (
|
|
65727
|
+
'multiplicity', [sourceConst].[Multiplicity],
|
|
65728
|
+
'roleLabel', [sourceConst].[RoleLabel],
|
|
65729
|
+
'polymorphic', IIF([sourceConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
65730
|
+
'abstractConstraint', [sourceConst].[AbstractConstraint],
|
|
65731
|
+
'constraintClasses', json([sourceConst].[ConstraintClasses]),
|
|
65732
|
+
'customAttributes', (
|
|
65733
|
+
SELECT
|
|
65734
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65735
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65736
|
+
WHERE [ca].[ContainerId] = [sourceConst].[ConstraintId] AND [ca].[ContainerType] = 1024
|
|
65737
|
+
ORDER BY [ca].[Ordinal]
|
|
65738
|
+
)
|
|
65739
|
+
)
|
|
65740
|
+
FROM
|
|
65741
|
+
[ClassRelationshipConstraints] [sourceConst]
|
|
65742
|
+
WHERE [sourceConst].[relationshipEnd] = 0
|
|
65743
|
+
AND [sourceConst].[ClassId] = [class].[ECInstanceId]
|
|
65744
|
+
),
|
|
65745
|
+
'target', (
|
|
65746
|
+
SELECT
|
|
65747
|
+
json_object (
|
|
65748
|
+
'multiplicity', [targetConst].[Multiplicity],
|
|
65749
|
+
'roleLabel', [targetConst].[RoleLabel],
|
|
65750
|
+
'polymorphic', IIF([targetConst].[IsPolyMorphic] = 1, json('true'), json('false')),
|
|
65751
|
+
'abstractConstraint', [targetConst].[AbstractConstraint],
|
|
65752
|
+
'constraintClasses', json([targetConst].[ConstraintClasses]),
|
|
65753
|
+
'customAttributes', (
|
|
65754
|
+
SELECT
|
|
65755
|
+
json_group_array(json(XmlCAToJson([ca].[Class].[Id], [ca].[Instance])))
|
|
65756
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
65757
|
+
WHERE [ca].[ContainerId] = [targetConst].[ConstraintId] AND [ca].[ContainerType] = 2048
|
|
65758
|
+
ORDER BY [ca].[Ordinal]
|
|
65759
|
+
)
|
|
65760
|
+
)
|
|
65761
|
+
FROM
|
|
65762
|
+
[ClassRelationshipConstraints] [targetConst]
|
|
65763
|
+
WHERE [targetConst].[relationshipEnd] = 1
|
|
65764
|
+
AND [targetConst].[ClassId] = [class].[ECInstanceId]
|
|
65765
|
+
)
|
|
65766
|
+
) AS [item]
|
|
65767
|
+
FROM [meta].[ECClassDef] [class]
|
|
65768
|
+
JOIN
|
|
65769
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65770
|
+
WHERE [class].[Type] = 1 AND
|
|
65771
|
+
[sd].[Name] = :schemaName
|
|
65772
65772
|
`;
|
|
65773
65773
|
/**
|
|
65774
65774
|
* RelationshipClass query used to when querying for RelationshipClass data only. Not used
|
|
65775
65775
|
* for full Schema load via single query.
|
|
65776
65776
|
*/
|
|
65777
|
-
const relationshipClassQuery = `
|
|
65778
|
-
WITH
|
|
65779
|
-
${withClassProperties},
|
|
65780
|
-
${withRelationshipConstraints}
|
|
65781
|
-
${baseRelationshipClassQuery}
|
|
65777
|
+
const relationshipClassQuery = `
|
|
65778
|
+
WITH
|
|
65779
|
+
${withClassProperties},
|
|
65780
|
+
${withRelationshipConstraints}
|
|
65781
|
+
${baseRelationshipClassQuery}
|
|
65782
65782
|
`;
|
|
65783
65783
|
/**
|
|
65784
65784
|
* Query that provides StructClass data and is shared by two cases:
|
|
@@ -65786,37 +65786,37 @@ ${baseRelationshipClassQuery}
|
|
|
65786
65786
|
* 2. When querying a full schema with multiple schema item queries or
|
|
65787
65787
|
* when just querying for Struct classes.
|
|
65788
65788
|
*/
|
|
65789
|
-
const baseStructQuery = `
|
|
65790
|
-
SELECT
|
|
65791
|
-
[sd].Name as schema,
|
|
65792
|
-
json_object (
|
|
65793
|
-
'schemaItemType', 'StructClass',
|
|
65794
|
-
'name', [class].[Name],
|
|
65795
|
-
'label', [class].[DisplayLabel],
|
|
65796
|
-
'description', [class].[Description],
|
|
65797
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65798
|
-
'baseClass', (
|
|
65799
|
-
${selectBaseClasses}
|
|
65800
|
-
),
|
|
65801
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
65802
|
-
'properties', (
|
|
65803
|
-
${selectProperties}
|
|
65804
|
-
)
|
|
65805
|
-
) AS item
|
|
65806
|
-
FROM [meta].[ECClassDef] [class]
|
|
65807
|
-
JOIN
|
|
65808
|
-
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65809
|
-
WHERE [class].[Type] = 2 AND
|
|
65810
|
-
[sd].[Name] = :schemaName
|
|
65789
|
+
const baseStructQuery = `
|
|
65790
|
+
SELECT
|
|
65791
|
+
[sd].Name as schema,
|
|
65792
|
+
json_object (
|
|
65793
|
+
'schemaItemType', 'StructClass',
|
|
65794
|
+
'name', [class].[Name],
|
|
65795
|
+
'label', [class].[DisplayLabel],
|
|
65796
|
+
'description', [class].[Description],
|
|
65797
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65798
|
+
'baseClass', (
|
|
65799
|
+
${selectBaseClasses}
|
|
65800
|
+
),
|
|
65801
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
65802
|
+
'properties', (
|
|
65803
|
+
${selectProperties}
|
|
65804
|
+
)
|
|
65805
|
+
) AS item
|
|
65806
|
+
FROM [meta].[ECClassDef] [class]
|
|
65807
|
+
JOIN
|
|
65808
|
+
[meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65809
|
+
WHERE [class].[Type] = 2 AND
|
|
65810
|
+
[sd].[Name] = :schemaName
|
|
65811
65811
|
`;
|
|
65812
65812
|
/**
|
|
65813
65813
|
* StructClass query used to when querying for StructClass data only. Not used
|
|
65814
65814
|
* for full Schema load via single query.
|
|
65815
65815
|
*/
|
|
65816
|
-
const structQuery = `
|
|
65817
|
-
WITH
|
|
65818
|
-
${withClassProperties}
|
|
65819
|
-
${baseStructQuery}
|
|
65816
|
+
const structQuery = `
|
|
65817
|
+
WITH
|
|
65818
|
+
${withClassProperties}
|
|
65819
|
+
${baseStructQuery}
|
|
65820
65820
|
`;
|
|
65821
65821
|
/**
|
|
65822
65822
|
* Query that provides CustomAttributeClass data and is shared by two cases:
|
|
@@ -65824,141 +65824,141 @@ ${baseStructQuery}
|
|
|
65824
65824
|
* 2. When querying a full schema with multiple schema item queries or
|
|
65825
65825
|
* when just querying for CustomAttribute classes.
|
|
65826
65826
|
*/
|
|
65827
|
-
const baseCustomAttributeQuery = `
|
|
65828
|
-
SELECT
|
|
65829
|
-
[sd].Name as schema,
|
|
65830
|
-
json_object (
|
|
65831
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
65832
|
-
'name', [class].[Name],
|
|
65833
|
-
'label', [class].[DisplayLabel],
|
|
65834
|
-
'description', [class].[Description],
|
|
65835
|
-
'appliesTo', [class].[CustomAttributeContainerType],
|
|
65836
|
-
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65837
|
-
'baseClass', (
|
|
65838
|
-
${selectBaseClasses}
|
|
65839
|
-
),
|
|
65840
|
-
'customAttributes', (${classCustomAttribute("class")}),
|
|
65841
|
-
'properties', (
|
|
65842
|
-
${selectProperties}
|
|
65843
|
-
)
|
|
65844
|
-
) AS [item]
|
|
65845
|
-
FROM [meta].[ECClassDef] [class]
|
|
65846
|
-
JOIN
|
|
65847
|
-
[meta].[ECSchemaDef] sd ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65848
|
-
WHERE [class].[Type] = 3 AND
|
|
65849
|
-
[sd].[Name] = :schemaName
|
|
65827
|
+
const baseCustomAttributeQuery = `
|
|
65828
|
+
SELECT
|
|
65829
|
+
[sd].Name as schema,
|
|
65830
|
+
json_object (
|
|
65831
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
65832
|
+
'name', [class].[Name],
|
|
65833
|
+
'label', [class].[DisplayLabel],
|
|
65834
|
+
'description', [class].[Description],
|
|
65835
|
+
'appliesTo', [class].[CustomAttributeContainerType],
|
|
65836
|
+
'modifier', ${(0,_SchemaStubQueries__WEBPACK_IMPORTED_MODULE_1__.modifier)("class")},
|
|
65837
|
+
'baseClass', (
|
|
65838
|
+
${selectBaseClasses}
|
|
65839
|
+
),
|
|
65840
|
+
'customAttributes', (${classCustomAttribute("class")}),
|
|
65841
|
+
'properties', (
|
|
65842
|
+
${selectProperties}
|
|
65843
|
+
)
|
|
65844
|
+
) AS [item]
|
|
65845
|
+
FROM [meta].[ECClassDef] [class]
|
|
65846
|
+
JOIN
|
|
65847
|
+
[meta].[ECSchemaDef] sd ON [sd].[ECInstanceId] = [class].[Schema].[Id]
|
|
65848
|
+
WHERE [class].[Type] = 3 AND
|
|
65849
|
+
[sd].[Name] = :schemaName
|
|
65850
65850
|
`;
|
|
65851
65851
|
/**
|
|
65852
65852
|
* CustomAttributeClass query used to when querying for CustomAttributeClass data only. Not used
|
|
65853
65853
|
* for full Schema load via single query.
|
|
65854
65854
|
*/
|
|
65855
|
-
const customAttributeQuery = `
|
|
65856
|
-
WITH
|
|
65857
|
-
${withClassProperties}
|
|
65858
|
-
${baseCustomAttributeQuery}
|
|
65855
|
+
const customAttributeQuery = `
|
|
65856
|
+
WITH
|
|
65857
|
+
${withClassProperties}
|
|
65858
|
+
${baseCustomAttributeQuery}
|
|
65859
65859
|
`;
|
|
65860
65860
|
/**
|
|
65861
65861
|
* Used by full schema load query via single query. Allows
|
|
65862
65862
|
* all SchemaItemTypes to be queried at once.
|
|
65863
65863
|
*/
|
|
65864
|
-
const withSchemaItems = `
|
|
65865
|
-
SchemaItems AS (
|
|
65866
|
-
${baseEntityQuery}
|
|
65867
|
-
UNION ALL
|
|
65868
|
-
${baseRelationshipClassQuery}
|
|
65869
|
-
UNION ALL
|
|
65870
|
-
${baseStructQuery}
|
|
65871
|
-
UNION ALL
|
|
65872
|
-
${baseMixinQuery}
|
|
65873
|
-
UNION ALL
|
|
65874
|
-
${baseCustomAttributeQuery}
|
|
65875
|
-
UNION ALL
|
|
65876
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity(true)}
|
|
65877
|
-
UNION ALL
|
|
65878
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration(true)}
|
|
65879
|
-
UNION ALL
|
|
65880
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory(true)}
|
|
65881
|
-
UNION ALL
|
|
65882
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit(true)}
|
|
65883
|
-
UNION ALL
|
|
65884
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit(true)}
|
|
65885
|
-
UNION ALL
|
|
65886
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem(true)}
|
|
65887
|
-
UNION ALL
|
|
65888
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant(true)}
|
|
65889
|
-
UNION ALL
|
|
65890
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon(true)}
|
|
65891
|
-
UNION ALL
|
|
65892
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format(true)}
|
|
65893
|
-
)
|
|
65864
|
+
const withSchemaItems = `
|
|
65865
|
+
SchemaItems AS (
|
|
65866
|
+
${baseEntityQuery}
|
|
65867
|
+
UNION ALL
|
|
65868
|
+
${baseRelationshipClassQuery}
|
|
65869
|
+
UNION ALL
|
|
65870
|
+
${baseStructQuery}
|
|
65871
|
+
UNION ALL
|
|
65872
|
+
${baseMixinQuery}
|
|
65873
|
+
UNION ALL
|
|
65874
|
+
${baseCustomAttributeQuery}
|
|
65875
|
+
UNION ALL
|
|
65876
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity(true)}
|
|
65877
|
+
UNION ALL
|
|
65878
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration(true)}
|
|
65879
|
+
UNION ALL
|
|
65880
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory(true)}
|
|
65881
|
+
UNION ALL
|
|
65882
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit(true)}
|
|
65883
|
+
UNION ALL
|
|
65884
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit(true)}
|
|
65885
|
+
UNION ALL
|
|
65886
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem(true)}
|
|
65887
|
+
UNION ALL
|
|
65888
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant(true)}
|
|
65889
|
+
UNION ALL
|
|
65890
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon(true)}
|
|
65891
|
+
UNION ALL
|
|
65892
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format(true)}
|
|
65893
|
+
)
|
|
65894
65894
|
`;
|
|
65895
65895
|
/**
|
|
65896
65896
|
* Query for Schema data without SchemaItems
|
|
65897
65897
|
*/
|
|
65898
|
-
const schemaNoItemsQuery = `
|
|
65899
|
-
WITH
|
|
65900
|
-
${withSchemaReferences}
|
|
65901
|
-
SELECT
|
|
65902
|
-
json_object (
|
|
65903
|
-
'name', [schemaDef].[Name],
|
|
65904
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
65905
|
-
'alias', [schemaDef].[Alias],
|
|
65906
|
-
'label', [schemaDef].[DisplayLabel],
|
|
65907
|
-
'description', [schemaDef].[Description],
|
|
65908
|
-
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
65909
|
-
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
65910
|
-
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
65911
|
-
'references', (
|
|
65912
|
-
SELECT
|
|
65913
|
-
json_group_array(json([schemaReferences].[reference]))
|
|
65914
|
-
FROM
|
|
65915
|
-
[SchemaReferences] [schemaReferences]
|
|
65916
|
-
WHERE
|
|
65917
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
65918
|
-
)
|
|
65919
|
-
) as [schema]
|
|
65920
|
-
FROM
|
|
65921
|
-
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
65898
|
+
const schemaNoItemsQuery = `
|
|
65899
|
+
WITH
|
|
65900
|
+
${withSchemaReferences}
|
|
65901
|
+
SELECT
|
|
65902
|
+
json_object (
|
|
65903
|
+
'name', [schemaDef].[Name],
|
|
65904
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
65905
|
+
'alias', [schemaDef].[Alias],
|
|
65906
|
+
'label', [schemaDef].[DisplayLabel],
|
|
65907
|
+
'description', [schemaDef].[Description],
|
|
65908
|
+
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
65909
|
+
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
65910
|
+
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
65911
|
+
'references', (
|
|
65912
|
+
SELECT
|
|
65913
|
+
json_group_array(json([schemaReferences].[reference]))
|
|
65914
|
+
FROM
|
|
65915
|
+
[SchemaReferences] [schemaReferences]
|
|
65916
|
+
WHERE
|
|
65917
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
65918
|
+
)
|
|
65919
|
+
) as [schema]
|
|
65920
|
+
FROM
|
|
65921
|
+
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
65922
65922
|
`;
|
|
65923
65923
|
/**
|
|
65924
65924
|
* Query to load a full Schema via a single query.
|
|
65925
65925
|
*/
|
|
65926
|
-
const schemaQuery = `
|
|
65927
|
-
WITH
|
|
65928
|
-
${withAppliesTo},
|
|
65929
|
-
${withSchemaReferences},
|
|
65930
|
-
${withClassProperties},
|
|
65931
|
-
${withRelationshipConstraints},
|
|
65932
|
-
${withSchemaItems}
|
|
65933
|
-
SELECT
|
|
65934
|
-
json_object (
|
|
65935
|
-
'name', [schemaDef].[Name],
|
|
65936
|
-
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
65937
|
-
'alias', [schemaDef].[Alias],
|
|
65938
|
-
'label', [schemaDef].[DisplayLabel],
|
|
65939
|
-
'description', [schemaDef].[Description],
|
|
65940
|
-
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
65941
|
-
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
65942
|
-
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
65943
|
-
'references', (
|
|
65944
|
-
SELECT
|
|
65945
|
-
json_group_array(json([schemaReferences].[reference]))
|
|
65946
|
-
FROM
|
|
65947
|
-
[SchemaReferences] [schemaReferences]
|
|
65948
|
-
WHERE
|
|
65949
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
65950
|
-
),
|
|
65951
|
-
'items', (
|
|
65952
|
-
SELECT
|
|
65953
|
-
json_group_array(json(json_object(
|
|
65954
|
-
'item', json([items].[item])
|
|
65955
|
-
)))
|
|
65956
|
-
FROM
|
|
65957
|
-
[SchemaItems] [items]
|
|
65958
|
-
)
|
|
65959
|
-
) as [schema]
|
|
65960
|
-
FROM
|
|
65961
|
-
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
65926
|
+
const schemaQuery = `
|
|
65927
|
+
WITH
|
|
65928
|
+
${withAppliesTo},
|
|
65929
|
+
${withSchemaReferences},
|
|
65930
|
+
${withClassProperties},
|
|
65931
|
+
${withRelationshipConstraints},
|
|
65932
|
+
${withSchemaItems}
|
|
65933
|
+
SELECT
|
|
65934
|
+
json_object (
|
|
65935
|
+
'name', [schemaDef].[Name],
|
|
65936
|
+
'version', CONCAT(printf('%02d', [VersionMajor]), '.', printf('%02d', [VersionWrite]), '.', printf('%02d', [VersionMinor])),
|
|
65937
|
+
'alias', [schemaDef].[Alias],
|
|
65938
|
+
'label', [schemaDef].[DisplayLabel],
|
|
65939
|
+
'description', [schemaDef].[Description],
|
|
65940
|
+
'ecSpecMajorVersion', [schemaDef].[OriginalECXmlVersionMajor],
|
|
65941
|
+
'ecSpecMinorVersion', [schemaDef].[OriginalECXmlVersionMinor],
|
|
65942
|
+
'customAttributes', (${schemaCustomAttribute("schemaDef")}),
|
|
65943
|
+
'references', (
|
|
65944
|
+
SELECT
|
|
65945
|
+
json_group_array(json([schemaReferences].[reference]))
|
|
65946
|
+
FROM
|
|
65947
|
+
[SchemaReferences] [schemaReferences]
|
|
65948
|
+
WHERE
|
|
65949
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
65950
|
+
),
|
|
65951
|
+
'items', (
|
|
65952
|
+
SELECT
|
|
65953
|
+
json_group_array(json(json_object(
|
|
65954
|
+
'item', json([items].[item])
|
|
65955
|
+
)))
|
|
65956
|
+
FROM
|
|
65957
|
+
[SchemaItems] [items]
|
|
65958
|
+
)
|
|
65959
|
+
) as [schema]
|
|
65960
|
+
FROM
|
|
65961
|
+
[meta].[ECSchemaDef] [schemaDef] WHERE [Name] = :schemaName
|
|
65962
65962
|
`;
|
|
65963
65963
|
/**
|
|
65964
65964
|
* Queries for loading full Schema JSON.
|
|
@@ -66467,281 +66467,281 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66467
66467
|
* Query for SchemaItemType KindOfQuantity data.
|
|
66468
66468
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66469
66469
|
*/
|
|
66470
|
-
const kindOfQuantity = (singleSchema) => `
|
|
66471
|
-
SELECT
|
|
66472
|
-
[koq].[Schema].[Id] AS [SchemaId],
|
|
66473
|
-
json_object (
|
|
66474
|
-
'schemaItemType', 'KindOfQuantity',
|
|
66475
|
-
'name', [koq].[Name],
|
|
66476
|
-
'label', [koq].[DisplayLabel],
|
|
66477
|
-
'description', [koq].[Description]
|
|
66478
|
-
${singleSchema ? `
|
|
66479
|
-
,'relativeError', [koq].[RelativeError],
|
|
66480
|
-
'persistenceUnit', [koq].[PersistenceUnit],
|
|
66481
|
-
'presentationUnits', (
|
|
66482
|
-
SELECT json_group_array(js."value")
|
|
66483
|
-
FROM [meta].[KindOfQuantityDef] [koq1], json1.json_each([PresentationUnits]) js
|
|
66484
|
-
WHERE [koq1].[ECInstanceId] = [koq].[ECInstanceId]
|
|
66485
|
-
) ` : ""}
|
|
66486
|
-
) as [item]
|
|
66487
|
-
FROM
|
|
66488
|
-
[meta].[KindOfQuantityDef] [koq]
|
|
66489
|
-
${singleSchema ? `
|
|
66490
|
-
JOIN
|
|
66491
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [koq].[Schema].[Id]
|
|
66492
|
-
WHERE [schema].[Name] = :schemaName
|
|
66493
|
-
` : ""}
|
|
66470
|
+
const kindOfQuantity = (singleSchema) => `
|
|
66471
|
+
SELECT
|
|
66472
|
+
[koq].[Schema].[Id] AS [SchemaId],
|
|
66473
|
+
json_object (
|
|
66474
|
+
'schemaItemType', 'KindOfQuantity',
|
|
66475
|
+
'name', [koq].[Name],
|
|
66476
|
+
'label', [koq].[DisplayLabel],
|
|
66477
|
+
'description', [koq].[Description]
|
|
66478
|
+
${singleSchema ? `
|
|
66479
|
+
,'relativeError', [koq].[RelativeError],
|
|
66480
|
+
'persistenceUnit', [koq].[PersistenceUnit],
|
|
66481
|
+
'presentationUnits', (
|
|
66482
|
+
SELECT json_group_array(js."value")
|
|
66483
|
+
FROM [meta].[KindOfQuantityDef] [koq1], json1.json_each([PresentationUnits]) js
|
|
66484
|
+
WHERE [koq1].[ECInstanceId] = [koq].[ECInstanceId]
|
|
66485
|
+
) ` : ""}
|
|
66486
|
+
) as [item]
|
|
66487
|
+
FROM
|
|
66488
|
+
[meta].[KindOfQuantityDef] [koq]
|
|
66489
|
+
${singleSchema ? `
|
|
66490
|
+
JOIN
|
|
66491
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [koq].[Schema].[Id]
|
|
66492
|
+
WHERE [schema].[Name] = :schemaName
|
|
66493
|
+
` : ""}
|
|
66494
66494
|
`;
|
|
66495
66495
|
/**
|
|
66496
66496
|
* Query for SchemaItemType PropertyCategory data.
|
|
66497
66497
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66498
66498
|
*/
|
|
66499
|
-
const propertyCategory = (singleSchema) => `
|
|
66500
|
-
SELECT
|
|
66501
|
-
[pc].[Schema].[Id] AS [SchemaId],
|
|
66502
|
-
json_object (
|
|
66503
|
-
'schemaItemType', 'PropertyCategory',
|
|
66504
|
-
'name', [pc].[Name],
|
|
66505
|
-
'label', [pc].[DisplayLabel],
|
|
66506
|
-
'description', [pc].[Description],
|
|
66507
|
-
'priority', [pc].[Priority]
|
|
66508
|
-
) as [item]
|
|
66509
|
-
FROM
|
|
66510
|
-
[meta].[PropertyCategoryDef] [pc]
|
|
66511
|
-
${singleSchema ? `
|
|
66512
|
-
JOIN
|
|
66513
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pc].[Schema].[Id]
|
|
66514
|
-
WHERE [schema].[Name] = :schemaName
|
|
66515
|
-
` : ""}
|
|
66499
|
+
const propertyCategory = (singleSchema) => `
|
|
66500
|
+
SELECT
|
|
66501
|
+
[pc].[Schema].[Id] AS [SchemaId],
|
|
66502
|
+
json_object (
|
|
66503
|
+
'schemaItemType', 'PropertyCategory',
|
|
66504
|
+
'name', [pc].[Name],
|
|
66505
|
+
'label', [pc].[DisplayLabel],
|
|
66506
|
+
'description', [pc].[Description],
|
|
66507
|
+
'priority', [pc].[Priority]
|
|
66508
|
+
) as [item]
|
|
66509
|
+
FROM
|
|
66510
|
+
[meta].[PropertyCategoryDef] [pc]
|
|
66511
|
+
${singleSchema ? `
|
|
66512
|
+
JOIN
|
|
66513
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pc].[Schema].[Id]
|
|
66514
|
+
WHERE [schema].[Name] = :schemaName
|
|
66515
|
+
` : ""}
|
|
66516
66516
|
`;
|
|
66517
66517
|
/**
|
|
66518
66518
|
* Query for SchemaItemType Enumeration data.
|
|
66519
66519
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66520
66520
|
*/
|
|
66521
|
-
const enumeration = (singleSchema) => `
|
|
66522
|
-
SELECT
|
|
66523
|
-
[ed].[Schema].[Id] AS [SchemaId],
|
|
66524
|
-
json_object (
|
|
66525
|
-
'schemaItemType', 'Enumeration',
|
|
66526
|
-
'name', [ed].[Name],
|
|
66527
|
-
'label', [ed].[DisplayLabel],
|
|
66528
|
-
'description', [ed].[Description],
|
|
66529
|
-
'type', IIF([ed].[Type] = 1281, 'int', IIF([ed].[Type] = 2305, 'string', null)),
|
|
66530
|
-
'isStrict', IIF([ed].[IsStrict] = 1, json('true'), json('false')),
|
|
66531
|
-
'enumerators', (
|
|
66532
|
-
SELECT json_group_array(json(json_object(
|
|
66533
|
-
'name', json_extract(js."value", '$.Name'),
|
|
66534
|
-
'value', IFNULL(json_extract(js."value", '$.StringValue'), (json_extract(js."value", '$.IntValue'))),
|
|
66535
|
-
'label', json_extract(js."value", '$.DisplayLabel'),
|
|
66536
|
-
'description', json_extract(js."value", '$.Description')
|
|
66537
|
-
)))
|
|
66538
|
-
FROM [meta].[ECEnumerationDef] [enumerationDef], json1.json_each([EnumValues]) js
|
|
66539
|
-
WHERE [enumerationDef].[ECInstanceId] = [ed].[ECInstanceId]
|
|
66540
|
-
)
|
|
66541
|
-
) as [item]
|
|
66542
|
-
FROM
|
|
66543
|
-
[meta].[ECEnumerationDef] [ed]
|
|
66544
|
-
${singleSchema ? `
|
|
66545
|
-
JOIN
|
|
66546
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ed].[Schema].[Id]
|
|
66547
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66521
|
+
const enumeration = (singleSchema) => `
|
|
66522
|
+
SELECT
|
|
66523
|
+
[ed].[Schema].[Id] AS [SchemaId],
|
|
66524
|
+
json_object (
|
|
66525
|
+
'schemaItemType', 'Enumeration',
|
|
66526
|
+
'name', [ed].[Name],
|
|
66527
|
+
'label', [ed].[DisplayLabel],
|
|
66528
|
+
'description', [ed].[Description],
|
|
66529
|
+
'type', IIF([ed].[Type] = 1281, 'int', IIF([ed].[Type] = 2305, 'string', null)),
|
|
66530
|
+
'isStrict', IIF([ed].[IsStrict] = 1, json('true'), json('false')),
|
|
66531
|
+
'enumerators', (
|
|
66532
|
+
SELECT json_group_array(json(json_object(
|
|
66533
|
+
'name', json_extract(js."value", '$.Name'),
|
|
66534
|
+
'value', IFNULL(json_extract(js."value", '$.StringValue'), (json_extract(js."value", '$.IntValue'))),
|
|
66535
|
+
'label', json_extract(js."value", '$.DisplayLabel'),
|
|
66536
|
+
'description', json_extract(js."value", '$.Description')
|
|
66537
|
+
)))
|
|
66538
|
+
FROM [meta].[ECEnumerationDef] [enumerationDef], json1.json_each([EnumValues]) js
|
|
66539
|
+
WHERE [enumerationDef].[ECInstanceId] = [ed].[ECInstanceId]
|
|
66540
|
+
)
|
|
66541
|
+
) as [item]
|
|
66542
|
+
FROM
|
|
66543
|
+
[meta].[ECEnumerationDef] [ed]
|
|
66544
|
+
${singleSchema ? `
|
|
66545
|
+
JOIN
|
|
66546
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ed].[Schema].[Id]
|
|
66547
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66548
66548
|
`;
|
|
66549
66549
|
/**
|
|
66550
66550
|
* Query for SchemaItemType Unit data.
|
|
66551
66551
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66552
66552
|
*/
|
|
66553
|
-
const unit = (singleSchema) => `
|
|
66554
|
-
SELECT
|
|
66555
|
-
[ud].[Schema].[Id] AS [SchemaId],
|
|
66556
|
-
json_object (
|
|
66557
|
-
'schemaItemType', 'Unit',
|
|
66558
|
-
'name', [ud].[Name],
|
|
66559
|
-
'label', [ud].[DisplayLabel],
|
|
66560
|
-
'description', [ud].[Description],
|
|
66561
|
-
'definition', [ud].[Definition],
|
|
66562
|
-
'numerator', IIF([ud].[Numerator] IS NULL, NULL, json(format('%.16g', [ud].[Numerator]))),
|
|
66563
|
-
'denominator', IIF([ud].[Denominator] IS NULL, NULL, json(format('%.16g', [ud].[Denominator]))),
|
|
66564
|
-
'offset', IIF([ud].[Offset] IS NULL, NULL, json(format('%!.15f', [ud].[Offset]))),
|
|
66565
|
-
'unitSystem', CONCAT([uss].[Name],'.', [usd].[Name]),
|
|
66566
|
-
'phenomenon', CONCAT([ps].[Name],'.', [pd].[Name])
|
|
66567
|
-
) as item
|
|
66568
|
-
FROM
|
|
66569
|
-
[meta].[UnitDef] [ud]
|
|
66570
|
-
${singleSchema ? `
|
|
66571
|
-
JOIN
|
|
66572
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
66573
|
-
JOIN [meta].[UnitSystemDef] [usd]
|
|
66574
|
-
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
66575
|
-
JOIN [meta].[ECSchemaDef] [uss]
|
|
66576
|
-
ON [uss].[ECInstanceId] = [usd].[Schema].[Id]
|
|
66577
|
-
JOIN [meta].[PhenomenonDef] [pd]
|
|
66578
|
-
ON [pd].[ECInstanceId] = [ud].[Phenomenon].[Id]
|
|
66579
|
-
JOIN [meta].[ECSchemaDef] [ps]
|
|
66580
|
-
ON [ps].[ECInstanceId] = [pd].[Schema].[Id]
|
|
66581
|
-
WHERE
|
|
66582
|
-
${singleSchema ? `
|
|
66583
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
66584
|
-
[ud].[IsConstant] = 0 AND
|
|
66585
|
-
[ud].[InvertingUnit] IS NULL
|
|
66553
|
+
const unit = (singleSchema) => `
|
|
66554
|
+
SELECT
|
|
66555
|
+
[ud].[Schema].[Id] AS [SchemaId],
|
|
66556
|
+
json_object (
|
|
66557
|
+
'schemaItemType', 'Unit',
|
|
66558
|
+
'name', [ud].[Name],
|
|
66559
|
+
'label', [ud].[DisplayLabel],
|
|
66560
|
+
'description', [ud].[Description],
|
|
66561
|
+
'definition', [ud].[Definition],
|
|
66562
|
+
'numerator', IIF([ud].[Numerator] IS NULL, NULL, json(format('%.16g', [ud].[Numerator]))),
|
|
66563
|
+
'denominator', IIF([ud].[Denominator] IS NULL, NULL, json(format('%.16g', [ud].[Denominator]))),
|
|
66564
|
+
'offset', IIF([ud].[Offset] IS NULL, NULL, json(format('%!.15f', [ud].[Offset]))),
|
|
66565
|
+
'unitSystem', CONCAT([uss].[Name],'.', [usd].[Name]),
|
|
66566
|
+
'phenomenon', CONCAT([ps].[Name],'.', [pd].[Name])
|
|
66567
|
+
) as item
|
|
66568
|
+
FROM
|
|
66569
|
+
[meta].[UnitDef] [ud]
|
|
66570
|
+
${singleSchema ? `
|
|
66571
|
+
JOIN
|
|
66572
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
66573
|
+
JOIN [meta].[UnitSystemDef] [usd]
|
|
66574
|
+
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
66575
|
+
JOIN [meta].[ECSchemaDef] [uss]
|
|
66576
|
+
ON [uss].[ECInstanceId] = [usd].[Schema].[Id]
|
|
66577
|
+
JOIN [meta].[PhenomenonDef] [pd]
|
|
66578
|
+
ON [pd].[ECInstanceId] = [ud].[Phenomenon].[Id]
|
|
66579
|
+
JOIN [meta].[ECSchemaDef] [ps]
|
|
66580
|
+
ON [ps].[ECInstanceId] = [pd].[Schema].[Id]
|
|
66581
|
+
WHERE
|
|
66582
|
+
${singleSchema ? `
|
|
66583
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
66584
|
+
[ud].[IsConstant] = 0 AND
|
|
66585
|
+
[ud].[InvertingUnit] IS NULL
|
|
66586
66586
|
`;
|
|
66587
66587
|
/**
|
|
66588
66588
|
* Query for SchemaItemType InvertedUnit data.
|
|
66589
66589
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66590
66590
|
*/
|
|
66591
|
-
const invertedUnit = (singleSchema) => `
|
|
66592
|
-
SELECT
|
|
66593
|
-
[ud].[Schema].[Id] AS [SchemaId],
|
|
66594
|
-
json_object (
|
|
66595
|
-
'schemaItemType', 'InvertedUnit',
|
|
66596
|
-
'name', [ud].[Name],
|
|
66597
|
-
'label', [ud].[DisplayLabel],
|
|
66598
|
-
'description', [ud].[Description],
|
|
66599
|
-
'unitSystem', CONCAT([systemSchema].[Name],'.', [usd].[Name]),
|
|
66600
|
-
'invertsUnit', IIF([iud].[Name] IS NULL, null, CONCAT([ius].[Name],'.', [iud].[Name]))
|
|
66601
|
-
) as [item]
|
|
66602
|
-
FROM
|
|
66603
|
-
[meta].[UnitDef] [ud]
|
|
66604
|
-
${singleSchema ? `
|
|
66605
|
-
JOIN
|
|
66606
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
66607
|
-
JOIN [meta].[UnitSystemDef] [usd]
|
|
66608
|
-
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
66609
|
-
JOIN [meta].[ECSchemaDef] [systemSchema]
|
|
66610
|
-
ON [systemSchema].[ECInstanceId] = [usd].[Schema].[Id]
|
|
66611
|
-
LEFT JOIN [meta].[UnitDef] [iud]
|
|
66612
|
-
ON [iud].[ECInstanceId] = [ud].[InvertingUnit].[Id]
|
|
66613
|
-
LEFT JOIN [meta].[ECSchemaDef] [ius]
|
|
66614
|
-
ON [ius].[ECInstanceId] = [iud].[Schema].[Id]
|
|
66615
|
-
WHERE
|
|
66616
|
-
${singleSchema ? `
|
|
66617
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
66618
|
-
[ud].[IsConstant] = 0 AND
|
|
66619
|
-
[ud].[InvertingUnit] IS NOT NULL
|
|
66591
|
+
const invertedUnit = (singleSchema) => `
|
|
66592
|
+
SELECT
|
|
66593
|
+
[ud].[Schema].[Id] AS [SchemaId],
|
|
66594
|
+
json_object (
|
|
66595
|
+
'schemaItemType', 'InvertedUnit',
|
|
66596
|
+
'name', [ud].[Name],
|
|
66597
|
+
'label', [ud].[DisplayLabel],
|
|
66598
|
+
'description', [ud].[Description],
|
|
66599
|
+
'unitSystem', CONCAT([systemSchema].[Name],'.', [usd].[Name]),
|
|
66600
|
+
'invertsUnit', IIF([iud].[Name] IS NULL, null, CONCAT([ius].[Name],'.', [iud].[Name]))
|
|
66601
|
+
) as [item]
|
|
66602
|
+
FROM
|
|
66603
|
+
[meta].[UnitDef] [ud]
|
|
66604
|
+
${singleSchema ? `
|
|
66605
|
+
JOIN
|
|
66606
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [ud].[Schema].[Id]` : ""}
|
|
66607
|
+
JOIN [meta].[UnitSystemDef] [usd]
|
|
66608
|
+
ON [usd].[ECInstanceId] = [ud].[UnitSystem].[Id]
|
|
66609
|
+
JOIN [meta].[ECSchemaDef] [systemSchema]
|
|
66610
|
+
ON [systemSchema].[ECInstanceId] = [usd].[Schema].[Id]
|
|
66611
|
+
LEFT JOIN [meta].[UnitDef] [iud]
|
|
66612
|
+
ON [iud].[ECInstanceId] = [ud].[InvertingUnit].[Id]
|
|
66613
|
+
LEFT JOIN [meta].[ECSchemaDef] [ius]
|
|
66614
|
+
ON [ius].[ECInstanceId] = [iud].[Schema].[Id]
|
|
66615
|
+
WHERE
|
|
66616
|
+
${singleSchema ? `
|
|
66617
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
66618
|
+
[ud].[IsConstant] = 0 AND
|
|
66619
|
+
[ud].[InvertingUnit] IS NOT NULL
|
|
66620
66620
|
`;
|
|
66621
66621
|
/**
|
|
66622
66622
|
* Query for SchemaItemType Constant data.
|
|
66623
66623
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66624
66624
|
*/
|
|
66625
|
-
const constant = (singleSchema) => `
|
|
66626
|
-
SELECT
|
|
66627
|
-
[cd].[Schema].[Id] AS [SchemaId],
|
|
66628
|
-
json_object(
|
|
66629
|
-
'schemaItemType', 'Constant',
|
|
66630
|
-
'name', [cd].[Name],
|
|
66631
|
-
'label', [cd].[DisplayLabel],
|
|
66632
|
-
'description', [cd].[Description],
|
|
66633
|
-
'definition', [cd].[Definition],
|
|
66634
|
-
'numerator', IIF([cd].[Numerator] IS NULL, NULL, json(format('%.16g', [cd].[Numerator]))),
|
|
66635
|
-
'denominator', IIF([cd].[Denominator] IS NULL, NULL, json(format('%.16g', [cd].[Denominator]))),
|
|
66636
|
-
'phenomenon', CONCAT([phenomSchema].[Name],'.', [phenomDef].[Name])
|
|
66637
|
-
) as item
|
|
66638
|
-
FROM
|
|
66639
|
-
[meta].[UnitDef] [cd]
|
|
66640
|
-
${singleSchema ? `
|
|
66641
|
-
JOIN
|
|
66642
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [cd].[Schema].[Id]` : ""}
|
|
66643
|
-
JOIN [meta].[PhenomenonDef] [phenomDef]
|
|
66644
|
-
ON [phenomDef].[ECInstanceId] = [cd].[Phenomenon].[Id]
|
|
66645
|
-
JOIN [meta].[ECSchemaDef] [phenomSchema]
|
|
66646
|
-
ON [phenomSchema].[ECInstanceId] = [phenomDef].[Schema].[Id]
|
|
66647
|
-
WHERE
|
|
66648
|
-
${singleSchema ? `
|
|
66649
|
-
[schema].[Name] = :schemaName AND` : ""}
|
|
66650
|
-
[cd].[IsConstant] = 1
|
|
66625
|
+
const constant = (singleSchema) => `
|
|
66626
|
+
SELECT
|
|
66627
|
+
[cd].[Schema].[Id] AS [SchemaId],
|
|
66628
|
+
json_object(
|
|
66629
|
+
'schemaItemType', 'Constant',
|
|
66630
|
+
'name', [cd].[Name],
|
|
66631
|
+
'label', [cd].[DisplayLabel],
|
|
66632
|
+
'description', [cd].[Description],
|
|
66633
|
+
'definition', [cd].[Definition],
|
|
66634
|
+
'numerator', IIF([cd].[Numerator] IS NULL, NULL, json(format('%.16g', [cd].[Numerator]))),
|
|
66635
|
+
'denominator', IIF([cd].[Denominator] IS NULL, NULL, json(format('%.16g', [cd].[Denominator]))),
|
|
66636
|
+
'phenomenon', CONCAT([phenomSchema].[Name],'.', [phenomDef].[Name])
|
|
66637
|
+
) as item
|
|
66638
|
+
FROM
|
|
66639
|
+
[meta].[UnitDef] [cd]
|
|
66640
|
+
${singleSchema ? `
|
|
66641
|
+
JOIN
|
|
66642
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [cd].[Schema].[Id]` : ""}
|
|
66643
|
+
JOIN [meta].[PhenomenonDef] [phenomDef]
|
|
66644
|
+
ON [phenomDef].[ECInstanceId] = [cd].[Phenomenon].[Id]
|
|
66645
|
+
JOIN [meta].[ECSchemaDef] [phenomSchema]
|
|
66646
|
+
ON [phenomSchema].[ECInstanceId] = [phenomDef].[Schema].[Id]
|
|
66647
|
+
WHERE
|
|
66648
|
+
${singleSchema ? `
|
|
66649
|
+
[schema].[Name] = :schemaName AND` : ""}
|
|
66650
|
+
[cd].[IsConstant] = 1
|
|
66651
66651
|
`;
|
|
66652
66652
|
/**
|
|
66653
66653
|
* Query for SchemaItemType UnitSystem data.
|
|
66654
66654
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66655
66655
|
*/
|
|
66656
|
-
const unitSystem = (singleSchema) => `
|
|
66657
|
-
SELECT
|
|
66658
|
-
[us].[Schema].[Id] AS [SchemaId],
|
|
66659
|
-
json_object (
|
|
66660
|
-
'schemaItemType', 'UnitSystem',
|
|
66661
|
-
'name', [us].[Name],
|
|
66662
|
-
'label', [us].[DisplayLabel],
|
|
66663
|
-
'description', [us].[Description]
|
|
66664
|
-
) as [item]
|
|
66665
|
-
FROM
|
|
66666
|
-
[meta].[UnitSystemDef] [us]
|
|
66667
|
-
${singleSchema ? `
|
|
66668
|
-
JOIN
|
|
66669
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [us].[Schema].[Id]
|
|
66670
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66656
|
+
const unitSystem = (singleSchema) => `
|
|
66657
|
+
SELECT
|
|
66658
|
+
[us].[Schema].[Id] AS [SchemaId],
|
|
66659
|
+
json_object (
|
|
66660
|
+
'schemaItemType', 'UnitSystem',
|
|
66661
|
+
'name', [us].[Name],
|
|
66662
|
+
'label', [us].[DisplayLabel],
|
|
66663
|
+
'description', [us].[Description]
|
|
66664
|
+
) as [item]
|
|
66665
|
+
FROM
|
|
66666
|
+
[meta].[UnitSystemDef] [us]
|
|
66667
|
+
${singleSchema ? `
|
|
66668
|
+
JOIN
|
|
66669
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [us].[Schema].[Id]
|
|
66670
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66671
66671
|
`;
|
|
66672
66672
|
/**
|
|
66673
66673
|
* Query for SchemaItemType Phenomenon data.
|
|
66674
66674
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66675
66675
|
*/
|
|
66676
|
-
const phenomenon = (singleSchema) => `
|
|
66677
|
-
SELECT
|
|
66678
|
-
[pd].[Schema].[Id] AS [SchemaId],
|
|
66679
|
-
json_object(
|
|
66680
|
-
'schemaItemType', 'Phenomenon',
|
|
66681
|
-
'name', [pd].[Name],
|
|
66682
|
-
'label', [pd].[DisplayLabel],
|
|
66683
|
-
'description', [pd].[Description],
|
|
66684
|
-
'definition', [pd].[Definition]
|
|
66685
|
-
) as [item]
|
|
66686
|
-
FROM
|
|
66687
|
-
[meta].[PhenomenonDef] [pd]
|
|
66688
|
-
${singleSchema ? `
|
|
66689
|
-
JOIN
|
|
66690
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pd].[Schema].[Id]
|
|
66691
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66676
|
+
const phenomenon = (singleSchema) => `
|
|
66677
|
+
SELECT
|
|
66678
|
+
[pd].[Schema].[Id] AS [SchemaId],
|
|
66679
|
+
json_object(
|
|
66680
|
+
'schemaItemType', 'Phenomenon',
|
|
66681
|
+
'name', [pd].[Name],
|
|
66682
|
+
'label', [pd].[DisplayLabel],
|
|
66683
|
+
'description', [pd].[Description],
|
|
66684
|
+
'definition', [pd].[Definition]
|
|
66685
|
+
) as [item]
|
|
66686
|
+
FROM
|
|
66687
|
+
[meta].[PhenomenonDef] [pd]
|
|
66688
|
+
${singleSchema ? `
|
|
66689
|
+
JOIN
|
|
66690
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [pd].[Schema].[Id]
|
|
66691
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66692
66692
|
`;
|
|
66693
66693
|
/**
|
|
66694
66694
|
* Query for SchemaItemType Format data.
|
|
66695
66695
|
* @param singleSchema Indicates if a filter and join for a single Schema should be applied.
|
|
66696
66696
|
*/
|
|
66697
|
-
const format = (singleSchema) => `
|
|
66698
|
-
SELECT
|
|
66699
|
-
[fd].[Schema].[Id] AS [SchemaId],
|
|
66700
|
-
json_object(
|
|
66701
|
-
'schemaItemType', 'Format',
|
|
66702
|
-
'name', [fd].[Name],
|
|
66703
|
-
'label', [fd].[DisplayLabel],
|
|
66704
|
-
'description', [fd].[Description],
|
|
66705
|
-
'type', json_extract([fd].[NumericSpec], '$.type'),
|
|
66706
|
-
'precision', json_extract([fd].[NumericSpec], '$.precision'),
|
|
66707
|
-
'roundFactor', json_extract([fd].[NumericSpec], '$.roundFactor'),
|
|
66708
|
-
'minWidth', json_extract([fd].[NumericSpec], '$.minWidth'),
|
|
66709
|
-
'showSignOption', json_extract([fd].[NumericSpec], '$.showSignOption'),
|
|
66710
|
-
'decimalSeparator', json_extract([fd].[NumericSpec], '$.decimalSeparator'),
|
|
66711
|
-
'thousandSeparator', json_extract([fd].[NumericSpec], '$.thousandSeparator'),
|
|
66712
|
-
'uomSeparator', json_extract([fd].[NumericSpec], '$.uomSeparator'),
|
|
66713
|
-
'scientificType', json_extract([fd].[NumericSpec], '$.scientificType'),
|
|
66714
|
-
'stationOffsetSize', json_extract([fd].[NumericSpec], '$.stationOffsetSize'),
|
|
66715
|
-
'stationSeparator', json_extract([fd].[NumericSpec], '$.stationSeparator'),
|
|
66716
|
-
'formatTraits', json_extract([fd].[NumericSpec], '$.formatTraits')
|
|
66717
|
-
${singleSchema ? `
|
|
66718
|
-
,'composite', (
|
|
66719
|
-
SELECT
|
|
66720
|
-
json_object(
|
|
66721
|
-
'spacer', json_extract([fd1].[CompositeSpec], '$.spacer'),
|
|
66722
|
-
'includeZero', json(IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 1, 'true', IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 0, 'false', null))),
|
|
66723
|
-
'units', (
|
|
66724
|
-
SELECT json_group_array(json(json_object(
|
|
66725
|
-
'name', CONCAT([sd].[Name], '.', [ud].[Name]),
|
|
66726
|
-
'label', [fud].[Label]
|
|
66727
|
-
)))
|
|
66728
|
-
FROM [meta].[FormatDef] [fd2]
|
|
66729
|
-
LEFT JOIN [meta].[FormatCompositeUnitDef] [fud] ON [fud].[Format].[Id] = [fd2].[ECInstanceId]
|
|
66730
|
-
LEFT JOIN [meta].[UnitDef] [ud] ON [ud].[ECInstanceId] = [fud].[Unit].[Id]
|
|
66731
|
-
INNER JOIN [meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [ud].[Schema].[Id]
|
|
66732
|
-
WHERE [fd2].[ECInstanceId] = [fd1].[ECInstanceId]
|
|
66733
|
-
)
|
|
66734
|
-
)
|
|
66735
|
-
FROM [meta].[FormatDef] [fd1]
|
|
66736
|
-
WHERE [fd1].[ECInstanceId]= [fd].[ECInstanceId] AND [fd1].[CompositeSpec] IS NOT NULL
|
|
66737
|
-
)` : ""}
|
|
66738
|
-
) AS item
|
|
66739
|
-
FROM
|
|
66740
|
-
[meta].[FormatDef] [fd]
|
|
66741
|
-
${singleSchema ? `
|
|
66742
|
-
JOIN
|
|
66743
|
-
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [fd].[Schema].[Id]
|
|
66744
|
-
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66697
|
+
const format = (singleSchema) => `
|
|
66698
|
+
SELECT
|
|
66699
|
+
[fd].[Schema].[Id] AS [SchemaId],
|
|
66700
|
+
json_object(
|
|
66701
|
+
'schemaItemType', 'Format',
|
|
66702
|
+
'name', [fd].[Name],
|
|
66703
|
+
'label', [fd].[DisplayLabel],
|
|
66704
|
+
'description', [fd].[Description],
|
|
66705
|
+
'type', json_extract([fd].[NumericSpec], '$.type'),
|
|
66706
|
+
'precision', json_extract([fd].[NumericSpec], '$.precision'),
|
|
66707
|
+
'roundFactor', json_extract([fd].[NumericSpec], '$.roundFactor'),
|
|
66708
|
+
'minWidth', json_extract([fd].[NumericSpec], '$.minWidth'),
|
|
66709
|
+
'showSignOption', json_extract([fd].[NumericSpec], '$.showSignOption'),
|
|
66710
|
+
'decimalSeparator', json_extract([fd].[NumericSpec], '$.decimalSeparator'),
|
|
66711
|
+
'thousandSeparator', json_extract([fd].[NumericSpec], '$.thousandSeparator'),
|
|
66712
|
+
'uomSeparator', json_extract([fd].[NumericSpec], '$.uomSeparator'),
|
|
66713
|
+
'scientificType', json_extract([fd].[NumericSpec], '$.scientificType'),
|
|
66714
|
+
'stationOffsetSize', json_extract([fd].[NumericSpec], '$.stationOffsetSize'),
|
|
66715
|
+
'stationSeparator', json_extract([fd].[NumericSpec], '$.stationSeparator'),
|
|
66716
|
+
'formatTraits', json_extract([fd].[NumericSpec], '$.formatTraits')
|
|
66717
|
+
${singleSchema ? `
|
|
66718
|
+
,'composite', (
|
|
66719
|
+
SELECT
|
|
66720
|
+
json_object(
|
|
66721
|
+
'spacer', json_extract([fd1].[CompositeSpec], '$.spacer'),
|
|
66722
|
+
'includeZero', json(IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 1, 'true', IIF(json_extract([fd1].[CompositeSpec], '$.includeZero') = 0, 'false', null))),
|
|
66723
|
+
'units', (
|
|
66724
|
+
SELECT json_group_array(json(json_object(
|
|
66725
|
+
'name', CONCAT([sd].[Name], '.', [ud].[Name]),
|
|
66726
|
+
'label', [fud].[Label]
|
|
66727
|
+
)))
|
|
66728
|
+
FROM [meta].[FormatDef] [fd2]
|
|
66729
|
+
LEFT JOIN [meta].[FormatCompositeUnitDef] [fud] ON [fud].[Format].[Id] = [fd2].[ECInstanceId]
|
|
66730
|
+
LEFT JOIN [meta].[UnitDef] [ud] ON [ud].[ECInstanceId] = [fud].[Unit].[Id]
|
|
66731
|
+
INNER JOIN [meta].[ECSchemaDef] [sd] ON [sd].[ECInstanceId] = [ud].[Schema].[Id]
|
|
66732
|
+
WHERE [fd2].[ECInstanceId] = [fd1].[ECInstanceId]
|
|
66733
|
+
)
|
|
66734
|
+
)
|
|
66735
|
+
FROM [meta].[FormatDef] [fd1]
|
|
66736
|
+
WHERE [fd1].[ECInstanceId]= [fd].[ECInstanceId] AND [fd1].[CompositeSpec] IS NOT NULL
|
|
66737
|
+
)` : ""}
|
|
66738
|
+
) AS item
|
|
66739
|
+
FROM
|
|
66740
|
+
[meta].[FormatDef] [fd]
|
|
66741
|
+
${singleSchema ? `
|
|
66742
|
+
JOIN
|
|
66743
|
+
[meta].[ECSchemaDef] [schema] ON [schema].[ECInstanceId] = [fd].[Schema].[Id]
|
|
66744
|
+
WHERE [schema].[Name] = :schemaName` : ""}
|
|
66745
66745
|
`;
|
|
66746
66746
|
/**
|
|
66747
66747
|
* Queries for each SchemaItemType
|
|
@@ -66907,349 +66907,349 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
66907
66907
|
*--------------------------------------------------------------------------------------------*/
|
|
66908
66908
|
|
|
66909
66909
|
const modifier = (alias) => {
|
|
66910
|
-
return `
|
|
66911
|
-
CASE
|
|
66912
|
-
WHEN [${alias}].[modifier] = 0 THEN 'None'
|
|
66913
|
-
WHEN [${alias}].[modifier] = 1 THEN 'Abstract'
|
|
66914
|
-
WHEN [${alias}].[modifier] = 2 THEN 'Sealed'
|
|
66915
|
-
ELSE NULL
|
|
66916
|
-
END
|
|
66910
|
+
return `
|
|
66911
|
+
CASE
|
|
66912
|
+
WHEN [${alias}].[modifier] = 0 THEN 'None'
|
|
66913
|
+
WHEN [${alias}].[modifier] = 1 THEN 'Abstract'
|
|
66914
|
+
WHEN [${alias}].[modifier] = 2 THEN 'Sealed'
|
|
66915
|
+
ELSE NULL
|
|
66916
|
+
END
|
|
66917
66917
|
`;
|
|
66918
66918
|
};
|
|
66919
66919
|
const strength = (alias) => {
|
|
66920
|
-
return `
|
|
66921
|
-
CASE
|
|
66922
|
-
WHEN [${alias}].[RelationshipStrength] = 0 THEN 'Referencing'
|
|
66923
|
-
WHEN [${alias}].[RelationshipStrength] = 1 THEN 'Holding'
|
|
66924
|
-
WHEN [${alias}].[RelationshipStrength] = 2 THEN 'Embedding'
|
|
66925
|
-
ELSE NULL
|
|
66926
|
-
END
|
|
66920
|
+
return `
|
|
66921
|
+
CASE
|
|
66922
|
+
WHEN [${alias}].[RelationshipStrength] = 0 THEN 'Referencing'
|
|
66923
|
+
WHEN [${alias}].[RelationshipStrength] = 1 THEN 'Holding'
|
|
66924
|
+
WHEN [${alias}].[RelationshipStrength] = 2 THEN 'Embedding'
|
|
66925
|
+
ELSE NULL
|
|
66926
|
+
END
|
|
66927
66927
|
`;
|
|
66928
66928
|
};
|
|
66929
66929
|
const strengthDirection = (alias) => {
|
|
66930
|
-
return `
|
|
66931
|
-
CASE
|
|
66932
|
-
WHEN [${alias}].[RelationshipStrengthDirection] = 1 THEN 'Forward'
|
|
66933
|
-
WHEN [${alias}].[RelationshipStrengthDirection] = 2 THEN 'Backward'
|
|
66934
|
-
ELSE NULL
|
|
66935
|
-
END
|
|
66930
|
+
return `
|
|
66931
|
+
CASE
|
|
66932
|
+
WHEN [${alias}].[RelationshipStrengthDirection] = 1 THEN 'Forward'
|
|
66933
|
+
WHEN [${alias}].[RelationshipStrengthDirection] = 2 THEN 'Backward'
|
|
66934
|
+
ELSE NULL
|
|
66935
|
+
END
|
|
66936
66936
|
`;
|
|
66937
66937
|
};
|
|
66938
|
-
const withAppliesTo = `
|
|
66939
|
-
AppliesToCTE AS (
|
|
66940
|
-
SELECT
|
|
66941
|
-
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
66942
|
-
[appliesToSchema].[name] as [AppliesToSchema],
|
|
66943
|
-
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
66944
|
-
FROM [meta].[CustomAttribute] [ca]
|
|
66945
|
-
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
66946
|
-
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
66947
|
-
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
66948
|
-
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
66949
|
-
WHERE [ca].[ContainerType] = 30
|
|
66950
|
-
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
66951
|
-
)
|
|
66938
|
+
const withAppliesTo = `
|
|
66939
|
+
AppliesToCTE AS (
|
|
66940
|
+
SELECT
|
|
66941
|
+
[mixinAppliesTo].[ECInstanceId] AS [AppliesToId],
|
|
66942
|
+
[appliesToSchema].[name] as [AppliesToSchema],
|
|
66943
|
+
json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.IsMixin.AppliesToEntityClass') AS [AppliesTo]
|
|
66944
|
+
FROM [meta].[CustomAttribute] [ca]
|
|
66945
|
+
JOIN [meta].[ECClassDef] [mixinAppliesTo]
|
|
66946
|
+
ON [mixinAppliesTo].[ECInstanceId] = [ca].[ContainerId]
|
|
66947
|
+
JOIN [meta].[ECSchemaDef] [appliesToSchema]
|
|
66948
|
+
ON [appliesToSchema].[ECInstanceId] = [mixinAppliesTo].[Schema].[Id]
|
|
66949
|
+
WHERE [ca].[ContainerType] = 30
|
|
66950
|
+
AND json_extract(XmlCAToJson([ca].[Class].[Id], [ca].[Instance]), '$.ecClass') = 'IsMixin'
|
|
66951
|
+
)
|
|
66952
66952
|
`;
|
|
66953
|
-
const withSchemaReferences = `
|
|
66954
|
-
SchemaReferences AS (
|
|
66955
|
-
SELECT
|
|
66956
|
-
[ref].[SourceECInstanceId] AS [SchemaId],
|
|
66957
|
-
CONCAT([Name],'.',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [fullName]
|
|
66958
|
-
FROM
|
|
66959
|
-
[meta].[ECSchemaDef] AS [refSchema]
|
|
66960
|
-
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
66961
|
-
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
66962
|
-
)
|
|
66953
|
+
const withSchemaReferences = `
|
|
66954
|
+
SchemaReferences AS (
|
|
66955
|
+
SELECT
|
|
66956
|
+
[ref].[SourceECInstanceId] AS [SchemaId],
|
|
66957
|
+
CONCAT([Name],'.',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [fullName]
|
|
66958
|
+
FROM
|
|
66959
|
+
[meta].[ECSchemaDef] AS [refSchema]
|
|
66960
|
+
INNER JOIN [meta].[SchemaHasSchemaReferences] [ref]
|
|
66961
|
+
ON [ref].[TargetECInstanceId] = [refSchema].[ECInstanceId]
|
|
66962
|
+
)
|
|
66963
66963
|
`;
|
|
66964
|
-
const customAttributeQuery = `
|
|
66965
|
-
SELECT
|
|
66966
|
-
[Schema].[Id] AS [SchemaId],
|
|
66967
|
-
json_object(
|
|
66968
|
-
'name', [class].[Name],
|
|
66969
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
66970
|
-
'modifier', ${modifier("class")},
|
|
66971
|
-
'label', [class].[DisplayLabel],
|
|
66972
|
-
'description', [class].[Description],
|
|
66973
|
-
'appliesTo', [class].[CustomAttributeContainerType],
|
|
66974
|
-
'baseClasses', (
|
|
66975
|
-
SELECT
|
|
66976
|
-
json_group_array(json(json_object(
|
|
66977
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
66978
|
-
'name', [baseClass].[Name],
|
|
66979
|
-
'schemaItemType', 'CustomAttributeClass',
|
|
66980
|
-
'modifier', ${modifier("baseClass")},
|
|
66981
|
-
'label', [baseClass].[DisplayLabel],
|
|
66982
|
-
'description', [baseClass].[Description],
|
|
66983
|
-
'appliesTo', [baseClass].[CustomAttributeContainerType]
|
|
66984
|
-
)))
|
|
66985
|
-
FROM
|
|
66986
|
-
[meta].[ECClassDef] [baseClass]
|
|
66987
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
66988
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
66989
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
66990
|
-
)
|
|
66991
|
-
) AS [item]
|
|
66992
|
-
FROM [meta].[ECClassDef] [class]
|
|
66993
|
-
WHERE [class].[Type] = 3
|
|
66964
|
+
const customAttributeQuery = `
|
|
66965
|
+
SELECT
|
|
66966
|
+
[Schema].[Id] AS [SchemaId],
|
|
66967
|
+
json_object(
|
|
66968
|
+
'name', [class].[Name],
|
|
66969
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
66970
|
+
'modifier', ${modifier("class")},
|
|
66971
|
+
'label', [class].[DisplayLabel],
|
|
66972
|
+
'description', [class].[Description],
|
|
66973
|
+
'appliesTo', [class].[CustomAttributeContainerType],
|
|
66974
|
+
'baseClasses', (
|
|
66975
|
+
SELECT
|
|
66976
|
+
json_group_array(json(json_object(
|
|
66977
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
66978
|
+
'name', [baseClass].[Name],
|
|
66979
|
+
'schemaItemType', 'CustomAttributeClass',
|
|
66980
|
+
'modifier', ${modifier("baseClass")},
|
|
66981
|
+
'label', [baseClass].[DisplayLabel],
|
|
66982
|
+
'description', [baseClass].[Description],
|
|
66983
|
+
'appliesTo', [baseClass].[CustomAttributeContainerType]
|
|
66984
|
+
)))
|
|
66985
|
+
FROM
|
|
66986
|
+
[meta].[ECClassDef] [baseClass]
|
|
66987
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
66988
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
66989
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
66990
|
+
)
|
|
66991
|
+
) AS [item]
|
|
66992
|
+
FROM [meta].[ECClassDef] [class]
|
|
66993
|
+
WHERE [class].[Type] = 3
|
|
66994
66994
|
`;
|
|
66995
|
-
const structQuery = `
|
|
66996
|
-
SELECT
|
|
66997
|
-
[Schema].[Id] AS [SchemaId],
|
|
66998
|
-
json_object(
|
|
66999
|
-
'name', [class].[Name],
|
|
67000
|
-
'schemaItemType', 'StructClass',
|
|
67001
|
-
'modifier', ${modifier("class")},
|
|
67002
|
-
'label', [class].[DisplayLabel],
|
|
67003
|
-
'description', [class].[Description],
|
|
67004
|
-
'baseClasses', (
|
|
67005
|
-
SELECT
|
|
67006
|
-
json_group_array(json(json_object(
|
|
67007
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67008
|
-
'name', [baseClass].[Name],
|
|
67009
|
-
'schemaItemType', 'StructClass',
|
|
67010
|
-
'modifier', ${modifier("baseClass")},
|
|
67011
|
-
'label', [baseClass].[DisplayLabel],
|
|
67012
|
-
'description', [baseClass].[Description]
|
|
67013
|
-
)))
|
|
67014
|
-
FROM
|
|
67015
|
-
[meta].[ECClassDef] [baseClass]
|
|
67016
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67017
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67018
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67019
|
-
)
|
|
67020
|
-
) AS [item]
|
|
67021
|
-
FROM [meta].[ECClassDef] [class]
|
|
67022
|
-
WHERE [class].[Type] = 2
|
|
66995
|
+
const structQuery = `
|
|
66996
|
+
SELECT
|
|
66997
|
+
[Schema].[Id] AS [SchemaId],
|
|
66998
|
+
json_object(
|
|
66999
|
+
'name', [class].[Name],
|
|
67000
|
+
'schemaItemType', 'StructClass',
|
|
67001
|
+
'modifier', ${modifier("class")},
|
|
67002
|
+
'label', [class].[DisplayLabel],
|
|
67003
|
+
'description', [class].[Description],
|
|
67004
|
+
'baseClasses', (
|
|
67005
|
+
SELECT
|
|
67006
|
+
json_group_array(json(json_object(
|
|
67007
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67008
|
+
'name', [baseClass].[Name],
|
|
67009
|
+
'schemaItemType', 'StructClass',
|
|
67010
|
+
'modifier', ${modifier("baseClass")},
|
|
67011
|
+
'label', [baseClass].[DisplayLabel],
|
|
67012
|
+
'description', [baseClass].[Description]
|
|
67013
|
+
)))
|
|
67014
|
+
FROM
|
|
67015
|
+
[meta].[ECClassDef] [baseClass]
|
|
67016
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67017
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67018
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67019
|
+
)
|
|
67020
|
+
) AS [item]
|
|
67021
|
+
FROM [meta].[ECClassDef] [class]
|
|
67022
|
+
WHERE [class].[Type] = 2
|
|
67023
67023
|
`;
|
|
67024
|
-
const relationshipQuery = `
|
|
67025
|
-
SELECT
|
|
67026
|
-
[Schema].[Id] AS [SchemaId],
|
|
67027
|
-
json_object(
|
|
67028
|
-
'name', [class].[Name],
|
|
67029
|
-
'schemaItemType', 'RelationshipClass',
|
|
67030
|
-
'modifier', ${modifier("class")},
|
|
67031
|
-
'label', [class].[DisplayLabel],
|
|
67032
|
-
'description', [class].[Description],
|
|
67033
|
-
'strength', ${strength("class")},
|
|
67034
|
-
'strengthDirection', ${strengthDirection("class")},
|
|
67035
|
-
'baseClasses', (
|
|
67036
|
-
SELECT
|
|
67037
|
-
json_group_array(json(json_object(
|
|
67038
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67039
|
-
'name', [baseClass].[Name],
|
|
67040
|
-
'schemaItemType', 'RelationshipClass',
|
|
67041
|
-
'modifier', ${modifier("baseClass")},
|
|
67042
|
-
'label', [baseClass].[DisplayLabel],
|
|
67043
|
-
'description', [baseClass].[Description],
|
|
67044
|
-
'strength', ${strength("baseClass")},
|
|
67045
|
-
'strengthDirection', ${strengthDirection("baseClass")}
|
|
67046
|
-
)))
|
|
67047
|
-
FROM
|
|
67048
|
-
[meta].[ECClassDef] [baseClass]
|
|
67049
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67050
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67051
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67052
|
-
)
|
|
67053
|
-
) AS [item]
|
|
67054
|
-
FROM [meta].[ECClassDef] [class]
|
|
67055
|
-
WHERE [class].[Type] = 1
|
|
67024
|
+
const relationshipQuery = `
|
|
67025
|
+
SELECT
|
|
67026
|
+
[Schema].[Id] AS [SchemaId],
|
|
67027
|
+
json_object(
|
|
67028
|
+
'name', [class].[Name],
|
|
67029
|
+
'schemaItemType', 'RelationshipClass',
|
|
67030
|
+
'modifier', ${modifier("class")},
|
|
67031
|
+
'label', [class].[DisplayLabel],
|
|
67032
|
+
'description', [class].[Description],
|
|
67033
|
+
'strength', ${strength("class")},
|
|
67034
|
+
'strengthDirection', ${strengthDirection("class")},
|
|
67035
|
+
'baseClasses', (
|
|
67036
|
+
SELECT
|
|
67037
|
+
json_group_array(json(json_object(
|
|
67038
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67039
|
+
'name', [baseClass].[Name],
|
|
67040
|
+
'schemaItemType', 'RelationshipClass',
|
|
67041
|
+
'modifier', ${modifier("baseClass")},
|
|
67042
|
+
'label', [baseClass].[DisplayLabel],
|
|
67043
|
+
'description', [baseClass].[Description],
|
|
67044
|
+
'strength', ${strength("baseClass")},
|
|
67045
|
+
'strengthDirection', ${strengthDirection("baseClass")}
|
|
67046
|
+
)))
|
|
67047
|
+
FROM
|
|
67048
|
+
[meta].[ECClassDef] [baseClass]
|
|
67049
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67050
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67051
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67052
|
+
)
|
|
67053
|
+
) AS [item]
|
|
67054
|
+
FROM [meta].[ECClassDef] [class]
|
|
67055
|
+
WHERE [class].[Type] = 1
|
|
67056
67056
|
`;
|
|
67057
|
-
const entityQuery = `
|
|
67058
|
-
SELECT
|
|
67059
|
-
[Schema].[Id] AS [SchemaId],
|
|
67060
|
-
json_object(
|
|
67061
|
-
'name', [class].[Name],
|
|
67062
|
-
'schemaItemType', 'EntityClass',
|
|
67063
|
-
'modifier', ${modifier("class")},
|
|
67064
|
-
'label', [class].[DisplayLabel],
|
|
67065
|
-
'description', [class].[Description],
|
|
67066
|
-
'baseClasses', (
|
|
67067
|
-
SELECT
|
|
67068
|
-
json_group_array(json(json_object(
|
|
67069
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67070
|
-
'name', [baseClass].[Name],
|
|
67071
|
-
'schemaItemType', 'EntityClass',
|
|
67072
|
-
'modifier', ${modifier("baseClass")},
|
|
67073
|
-
'label', [baseClass].[DisplayLabel],
|
|
67074
|
-
'description', [baseClass].[Description]
|
|
67075
|
-
)))
|
|
67076
|
-
FROM
|
|
67077
|
-
[meta].[ECClassDef] [baseClass]
|
|
67078
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67079
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67080
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67081
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67082
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67083
|
-
),
|
|
67084
|
-
'mixins', (
|
|
67085
|
-
SELECT
|
|
67086
|
-
json_group_array(json(json_object(
|
|
67087
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67088
|
-
'name', [baseClass].[Name],
|
|
67089
|
-
'schemaItemType', 'Mixin',
|
|
67090
|
-
'modifier', ${modifier("baseClass")},
|
|
67091
|
-
'label', [baseClass].[DisplayLabel],
|
|
67092
|
-
'description', [baseClass].[Description],
|
|
67093
|
-
'appliesTo', (
|
|
67094
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67095
|
-
FROM [AppliesToCTE] [atCTE]
|
|
67096
|
-
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
67097
|
-
),
|
|
67098
|
-
'baseClasses', (
|
|
67099
|
-
SELECT
|
|
67100
|
-
json_group_array(json(json_object(
|
|
67101
|
-
'schema', ec_classname([mixinBaseClass].[ECInstanceId], 's'),
|
|
67102
|
-
'name', [mixinBaseClass].[Name],
|
|
67103
|
-
'schemaItemType', 'Mixin',
|
|
67104
|
-
'modifier', ${modifier("mixinBaseClass")},
|
|
67105
|
-
'label', [mixinBaseClass].[DisplayLabel],
|
|
67106
|
-
'description', [mixinBaseClass].[Description],
|
|
67107
|
-
'appliesTo', (
|
|
67108
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67109
|
-
FROM [AppliesToCTE] [atCTE]
|
|
67110
|
-
WHERE [atCTE].[AppliesToId] = [mixinBaseClass].[ECInstanceId]
|
|
67111
|
-
)
|
|
67112
|
-
)))
|
|
67113
|
-
FROM
|
|
67114
|
-
[meta].[ECClassDef] [mixinBaseClass]
|
|
67115
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [mixinBaseClassMap]
|
|
67116
|
-
ON [mixinBaseClassMap].[TargetECInstanceId] = [mixinBaseClass].[ECInstanceId]
|
|
67117
|
-
WHERE [mixinBaseClassMap].[SourceECInstanceId] = [baseClass].[ECInstanceId]
|
|
67118
|
-
)
|
|
67119
|
-
)))
|
|
67120
|
-
FROM
|
|
67121
|
-
[meta].[ECClassDef] [baseClass]
|
|
67122
|
-
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67123
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67124
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67125
|
-
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67126
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67127
|
-
)
|
|
67128
|
-
) AS [item]
|
|
67129
|
-
FROM [meta].[ECClassDef] [class]
|
|
67130
|
-
WHERE [class].[Type] = 0
|
|
67131
|
-
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67132
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67057
|
+
const entityQuery = `
|
|
67058
|
+
SELECT
|
|
67059
|
+
[Schema].[Id] AS [SchemaId],
|
|
67060
|
+
json_object(
|
|
67061
|
+
'name', [class].[Name],
|
|
67062
|
+
'schemaItemType', 'EntityClass',
|
|
67063
|
+
'modifier', ${modifier("class")},
|
|
67064
|
+
'label', [class].[DisplayLabel],
|
|
67065
|
+
'description', [class].[Description],
|
|
67066
|
+
'baseClasses', (
|
|
67067
|
+
SELECT
|
|
67068
|
+
json_group_array(json(json_object(
|
|
67069
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67070
|
+
'name', [baseClass].[Name],
|
|
67071
|
+
'schemaItemType', 'EntityClass',
|
|
67072
|
+
'modifier', ${modifier("baseClass")},
|
|
67073
|
+
'label', [baseClass].[DisplayLabel],
|
|
67074
|
+
'description', [baseClass].[Description]
|
|
67075
|
+
)))
|
|
67076
|
+
FROM
|
|
67077
|
+
[meta].[ECClassDef] [baseClass]
|
|
67078
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67079
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67080
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67081
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67082
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67083
|
+
),
|
|
67084
|
+
'mixins', (
|
|
67085
|
+
SELECT
|
|
67086
|
+
json_group_array(json(json_object(
|
|
67087
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67088
|
+
'name', [baseClass].[Name],
|
|
67089
|
+
'schemaItemType', 'Mixin',
|
|
67090
|
+
'modifier', ${modifier("baseClass")},
|
|
67091
|
+
'label', [baseClass].[DisplayLabel],
|
|
67092
|
+
'description', [baseClass].[Description],
|
|
67093
|
+
'appliesTo', (
|
|
67094
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67095
|
+
FROM [AppliesToCTE] [atCTE]
|
|
67096
|
+
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
67097
|
+
),
|
|
67098
|
+
'baseClasses', (
|
|
67099
|
+
SELECT
|
|
67100
|
+
json_group_array(json(json_object(
|
|
67101
|
+
'schema', ec_classname([mixinBaseClass].[ECInstanceId], 's'),
|
|
67102
|
+
'name', [mixinBaseClass].[Name],
|
|
67103
|
+
'schemaItemType', 'Mixin',
|
|
67104
|
+
'modifier', ${modifier("mixinBaseClass")},
|
|
67105
|
+
'label', [mixinBaseClass].[DisplayLabel],
|
|
67106
|
+
'description', [mixinBaseClass].[Description],
|
|
67107
|
+
'appliesTo', (
|
|
67108
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67109
|
+
FROM [AppliesToCTE] [atCTE]
|
|
67110
|
+
WHERE [atCTE].[AppliesToId] = [mixinBaseClass].[ECInstanceId]
|
|
67111
|
+
)
|
|
67112
|
+
)))
|
|
67113
|
+
FROM
|
|
67114
|
+
[meta].[ECClassDef] [mixinBaseClass]
|
|
67115
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [mixinBaseClassMap]
|
|
67116
|
+
ON [mixinBaseClassMap].[TargetECInstanceId] = [mixinBaseClass].[ECInstanceId]
|
|
67117
|
+
WHERE [mixinBaseClassMap].[SourceECInstanceId] = [baseClass].[ECInstanceId]
|
|
67118
|
+
)
|
|
67119
|
+
)))
|
|
67120
|
+
FROM
|
|
67121
|
+
[meta].[ECClassDef] [baseClass]
|
|
67122
|
+
INNER JOIN [meta].[ClassHasBaseClasses] [baseClassMap]
|
|
67123
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67124
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67125
|
+
AND EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [baseClass].[ECInstanceId] = [ca].[Class].[Id]
|
|
67126
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67127
|
+
)
|
|
67128
|
+
) AS [item]
|
|
67129
|
+
FROM [meta].[ECClassDef] [class]
|
|
67130
|
+
WHERE [class].[Type] = 0
|
|
67131
|
+
AND NOT EXISTS(SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67132
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67133
67133
|
`;
|
|
67134
|
-
const mixinQuery = `
|
|
67135
|
-
SELECT
|
|
67136
|
-
[Schema].[Id] AS [SchemaId],
|
|
67137
|
-
json_object(
|
|
67138
|
-
'name', [class].[Name],
|
|
67139
|
-
'schemaItemType', 'Mixin',
|
|
67140
|
-
'modifier', ${modifier("class")},
|
|
67141
|
-
'label', [class].[DisplayLabel],
|
|
67142
|
-
'description', [class].[Description],
|
|
67143
|
-
'appliesTo', (
|
|
67144
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67145
|
-
FROM [AppliesToCTE] [atCTE]
|
|
67146
|
-
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
67147
|
-
),
|
|
67148
|
-
'baseClasses', (
|
|
67149
|
-
SELECT
|
|
67150
|
-
json_group_array(json(json_object(
|
|
67151
|
-
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67152
|
-
'name', [baseClass].[Name],
|
|
67153
|
-
'schemaItemType', 'Mixin',
|
|
67154
|
-
'modifier', ${modifier("baseClass")},
|
|
67155
|
-
'label', [baseClass].[DisplayLabel],
|
|
67156
|
-
'description', [baseClass].[Description],
|
|
67157
|
-
'appliesTo', (
|
|
67158
|
-
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67159
|
-
FROM [AppliesToCTE] [atCTE]
|
|
67160
|
-
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
67161
|
-
)
|
|
67162
|
-
)))
|
|
67163
|
-
FROM
|
|
67164
|
-
[meta].[ECClassDef] [baseClass]
|
|
67165
|
-
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67166
|
-
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67167
|
-
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67168
|
-
)
|
|
67169
|
-
) AS [item]
|
|
67170
|
-
FROM [meta].[ECClassDef] [class]
|
|
67171
|
-
WHERE [class].[Type] = 0 AND EXISTS (SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67172
|
-
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67134
|
+
const mixinQuery = `
|
|
67135
|
+
SELECT
|
|
67136
|
+
[Schema].[Id] AS [SchemaId],
|
|
67137
|
+
json_object(
|
|
67138
|
+
'name', [class].[Name],
|
|
67139
|
+
'schemaItemType', 'Mixin',
|
|
67140
|
+
'modifier', ${modifier("class")},
|
|
67141
|
+
'label', [class].[DisplayLabel],
|
|
67142
|
+
'description', [class].[Description],
|
|
67143
|
+
'appliesTo', (
|
|
67144
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67145
|
+
FROM [AppliesToCTE] [atCTE]
|
|
67146
|
+
WHERE [atCTE].[AppliesToId] = [class].[ECInstanceId]
|
|
67147
|
+
),
|
|
67148
|
+
'baseClasses', (
|
|
67149
|
+
SELECT
|
|
67150
|
+
json_group_array(json(json_object(
|
|
67151
|
+
'schema', ec_classname([baseClass].[ECInstanceId], 's'),
|
|
67152
|
+
'name', [baseClass].[Name],
|
|
67153
|
+
'schemaItemType', 'Mixin',
|
|
67154
|
+
'modifier', ${modifier("baseClass")},
|
|
67155
|
+
'label', [baseClass].[DisplayLabel],
|
|
67156
|
+
'description', [baseClass].[Description],
|
|
67157
|
+
'appliesTo', (
|
|
67158
|
+
SELECT IIF(instr([atCTE].[AppliesTo], ':') > 1, ec_classname(ec_classId([atCTE].[AppliesTo]), 's.c'), CONCAT([atCTE].[AppliesToSchema], '.', [atCTE].[AppliesTo]))
|
|
67159
|
+
FROM [AppliesToCTE] [atCTE]
|
|
67160
|
+
WHERE [atCTE].[AppliesToId] = [baseClass].[ECInstanceId]
|
|
67161
|
+
)
|
|
67162
|
+
)))
|
|
67163
|
+
FROM
|
|
67164
|
+
[meta].[ECClassDef] [baseClass]
|
|
67165
|
+
INNER JOIN [meta].[ClassHasAllBaseClasses] [baseClassMap]
|
|
67166
|
+
ON [baseClassMap].[TargetECInstanceId] = [baseclass].[ECInstanceId]
|
|
67167
|
+
WHERE [baseClassMap].[SourceECInstanceId] = [class].[ECInstanceId]
|
|
67168
|
+
)
|
|
67169
|
+
) AS [item]
|
|
67170
|
+
FROM [meta].[ECClassDef] [class]
|
|
67171
|
+
WHERE [class].[Type] = 0 AND EXISTS (SELECT 1 FROM [meta].[ClassCustomAttribute] [ca] WHERE [class].[ECInstanceId] = [ca].[Class].[Id]
|
|
67172
|
+
AND [ca].[CustomAttributeClass].[Id] Is ([CoreCA].[IsMixin]))
|
|
67173
67173
|
`;
|
|
67174
|
-
const withSchemaItems = `
|
|
67175
|
-
SchemaItems AS (
|
|
67176
|
-
${customAttributeQuery}
|
|
67177
|
-
UNION ALL
|
|
67178
|
-
${structQuery}
|
|
67179
|
-
UNION ALL
|
|
67180
|
-
${relationshipQuery}
|
|
67181
|
-
UNION ALL
|
|
67182
|
-
${entityQuery}
|
|
67183
|
-
UNION ALL
|
|
67184
|
-
${mixinQuery}
|
|
67185
|
-
UNION ALL
|
|
67186
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration()}
|
|
67187
|
-
UNION ALL
|
|
67188
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity()}
|
|
67189
|
-
UNION ALL
|
|
67190
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory()}
|
|
67191
|
-
UNION ALL
|
|
67192
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit()}
|
|
67193
|
-
UNION ALL
|
|
67194
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit()}
|
|
67195
|
-
UNION ALL
|
|
67196
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant()}
|
|
67197
|
-
UNION ALL
|
|
67198
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon()}
|
|
67199
|
-
UNION ALL
|
|
67200
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem()}
|
|
67201
|
-
UNION ALL
|
|
67202
|
-
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format()}
|
|
67203
|
-
)
|
|
67174
|
+
const withSchemaItems = `
|
|
67175
|
+
SchemaItems AS (
|
|
67176
|
+
${customAttributeQuery}
|
|
67177
|
+
UNION ALL
|
|
67178
|
+
${structQuery}
|
|
67179
|
+
UNION ALL
|
|
67180
|
+
${relationshipQuery}
|
|
67181
|
+
UNION ALL
|
|
67182
|
+
${entityQuery}
|
|
67183
|
+
UNION ALL
|
|
67184
|
+
${mixinQuery}
|
|
67185
|
+
UNION ALL
|
|
67186
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.enumeration()}
|
|
67187
|
+
UNION ALL
|
|
67188
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.kindOfQuantity()}
|
|
67189
|
+
UNION ALL
|
|
67190
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.propertyCategory()}
|
|
67191
|
+
UNION ALL
|
|
67192
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unit()}
|
|
67193
|
+
UNION ALL
|
|
67194
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.invertedUnit()}
|
|
67195
|
+
UNION ALL
|
|
67196
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.constant()}
|
|
67197
|
+
UNION ALL
|
|
67198
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.phenomenon()}
|
|
67199
|
+
UNION ALL
|
|
67200
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.unitSystem()}
|
|
67201
|
+
UNION ALL
|
|
67202
|
+
${_SchemaItemQueries__WEBPACK_IMPORTED_MODULE_0__.SchemaItemQueries.format()}
|
|
67203
|
+
)
|
|
67204
67204
|
`;
|
|
67205
|
-
const schemaStubQuery = `
|
|
67206
|
-
WITH
|
|
67207
|
-
${withSchemaReferences},
|
|
67208
|
-
${withAppliesTo},
|
|
67209
|
-
${withSchemaItems}
|
|
67210
|
-
SELECT
|
|
67211
|
-
[Name] as [name],
|
|
67212
|
-
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
67213
|
-
[Alias] as [alias],
|
|
67214
|
-
[DisplayLabel] as [displayLabel],
|
|
67215
|
-
[Description] as [description],
|
|
67216
|
-
(
|
|
67217
|
-
SELECT
|
|
67218
|
-
json_group_array([schemaReferences].[fullName])
|
|
67219
|
-
FROM
|
|
67220
|
-
[SchemaReferences] [schemaReferences]
|
|
67221
|
-
WHERE
|
|
67222
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67223
|
-
) AS [references],
|
|
67224
|
-
(
|
|
67225
|
-
SELECT
|
|
67226
|
-
json_group_array(json([items].[item]))
|
|
67227
|
-
FROM
|
|
67228
|
-
[SchemaItems] [items]
|
|
67229
|
-
WHERE
|
|
67230
|
-
[items].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67231
|
-
) AS [items]
|
|
67232
|
-
FROM
|
|
67233
|
-
[meta].[ECSchemaDef] [schemaDef]
|
|
67234
|
-
WHERE [Name] = :schemaName
|
|
67205
|
+
const schemaStubQuery = `
|
|
67206
|
+
WITH
|
|
67207
|
+
${withSchemaReferences},
|
|
67208
|
+
${withAppliesTo},
|
|
67209
|
+
${withSchemaItems}
|
|
67210
|
+
SELECT
|
|
67211
|
+
[Name] as [name],
|
|
67212
|
+
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
67213
|
+
[Alias] as [alias],
|
|
67214
|
+
[DisplayLabel] as [displayLabel],
|
|
67215
|
+
[Description] as [description],
|
|
67216
|
+
(
|
|
67217
|
+
SELECT
|
|
67218
|
+
json_group_array([schemaReferences].[fullName])
|
|
67219
|
+
FROM
|
|
67220
|
+
[SchemaReferences] [schemaReferences]
|
|
67221
|
+
WHERE
|
|
67222
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67223
|
+
) AS [references],
|
|
67224
|
+
(
|
|
67225
|
+
SELECT
|
|
67226
|
+
json_group_array(json([items].[item]))
|
|
67227
|
+
FROM
|
|
67228
|
+
[SchemaItems] [items]
|
|
67229
|
+
WHERE
|
|
67230
|
+
[items].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67231
|
+
) AS [items]
|
|
67232
|
+
FROM
|
|
67233
|
+
[meta].[ECSchemaDef] [schemaDef]
|
|
67234
|
+
WHERE [Name] = :schemaName
|
|
67235
67235
|
`;
|
|
67236
|
-
const schemaInfoQuery = `
|
|
67237
|
-
WITH
|
|
67238
|
-
${withSchemaReferences}
|
|
67239
|
-
SELECT
|
|
67240
|
-
[Name] as [name],
|
|
67241
|
-
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
67242
|
-
[Alias] as [alias],
|
|
67243
|
-
(
|
|
67244
|
-
SELECT
|
|
67245
|
-
json_group_array([schemaReferences].[fullName])
|
|
67246
|
-
FROM
|
|
67247
|
-
[SchemaReferences] [schemaReferences]
|
|
67248
|
-
WHERE
|
|
67249
|
-
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67250
|
-
) AS [references]
|
|
67251
|
-
FROM
|
|
67252
|
-
[meta].[ECSchemaDef] [schemaDef]
|
|
67236
|
+
const schemaInfoQuery = `
|
|
67237
|
+
WITH
|
|
67238
|
+
${withSchemaReferences}
|
|
67239
|
+
SELECT
|
|
67240
|
+
[Name] as [name],
|
|
67241
|
+
CONCAT('',[VersionMajor],'.',[VersionWrite],'.',[VersionMinor]) AS [version],
|
|
67242
|
+
[Alias] as [alias],
|
|
67243
|
+
(
|
|
67244
|
+
SELECT
|
|
67245
|
+
json_group_array([schemaReferences].[fullName])
|
|
67246
|
+
FROM
|
|
67247
|
+
[SchemaReferences] [schemaReferences]
|
|
67248
|
+
WHERE
|
|
67249
|
+
[schemaReferences].[SchemaId] = [schemaDef].[ECInstanceId]
|
|
67250
|
+
) AS [references]
|
|
67251
|
+
FROM
|
|
67252
|
+
[meta].[ECSchemaDef] [schemaDef]
|
|
67253
67253
|
`;
|
|
67254
67254
|
/**
|
|
67255
67255
|
* Partial Schema queries.
|
|
@@ -94924,10 +94924,21 @@ class RenderContext {
|
|
|
94924
94924
|
class DynamicsContext extends RenderContext {
|
|
94925
94925
|
_foreground;
|
|
94926
94926
|
_overlay;
|
|
94927
|
-
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
|
|
94927
|
+
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
|
|
94928
|
+
* These graphics are drawn as [[GraphicType.Scene]].
|
|
94929
|
+
* @see [[addOverlay]] to add a graphic to be drawn as an overlay instead.
|
|
94930
|
+
*/
|
|
94928
94931
|
addGraphic(graphic) {
|
|
94929
94932
|
this.add(graphic, false);
|
|
94930
94933
|
}
|
|
94934
|
+
/** Add a graphic to the list of dynamic graphics to be drawn in this context's [[Viewport]].
|
|
94935
|
+
* These graphics are drawn as part of the viewport's scene as described by [[GraphicType.Scene]], except
|
|
94936
|
+
* that they always draw on top of other graphics as with [[GraphicType.WorldOverlay]].
|
|
94937
|
+
* @see [[addGraphic]] to add an ordinary scene graphic instead.
|
|
94938
|
+
*/
|
|
94939
|
+
addOverlay(graphic) {
|
|
94940
|
+
this.add(graphic, true);
|
|
94941
|
+
}
|
|
94931
94942
|
/** @internal */
|
|
94932
94943
|
add(graphic, isOverlay) {
|
|
94933
94944
|
const key = isOverlay ? "_overlay" : "_foreground";
|
|
@@ -114373,7 +114384,7 @@ class BackgroundMapDrape extends _TextureDrape__WEBPACK_IMPORTED_MODULE_13__.Tex
|
|
|
114373
114384
|
const prevPlan = target.plan;
|
|
114374
114385
|
const drawingParams = _PlanarTextureProjection__WEBPACK_IMPORTED_MODULE_9__.PlanarTextureProjection.getTextureDrawingParams(target);
|
|
114375
114386
|
const stack = new _BranchStack__WEBPACK_IMPORTED_MODULE_6__.BranchStack();
|
|
114376
|
-
stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline);
|
|
114387
|
+
stack.changeRenderPlan(drawingParams.viewFlags, prevPlan.is3d, prevPlan.hline, prevPlan.contours);
|
|
114377
114388
|
stack.setSymbologyOverrides(this._symbologyOverrides);
|
|
114378
114389
|
const batchState = new _BatchState__WEBPACK_IMPORTED_MODULE_5__.BatchState(stack);
|
|
114379
114390
|
_System__WEBPACK_IMPORTED_MODULE_11__.System.instance.applyRenderState(drawingParams.state);
|
|
@@ -122731,7 +122742,7 @@ class PlanarClassifier extends _RenderPlanarClassifier__WEBPACK_IMPORTED_MODULE_
|
|
|
122731
122742
|
this._anyTranslucent = false;
|
|
122732
122743
|
const prevProjMatrix = target.uniforms.frustum.projectionMatrix;
|
|
122733
122744
|
target.uniforms.frustum.changeProjectionMatrix(PlanarClassifier._postProjectionMatrix.multiplyMatrixMatrix(prevProjMatrix));
|
|
122734
|
-
target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline);
|
|
122745
|
+
target.uniforms.branch.changeRenderPlan(vf, target.plan.is3d, target.plan.hline, target.plan.contours);
|
|
122735
122746
|
const addCmds = (oldCmds, newCmds) => {
|
|
122736
122747
|
if (undefined === newCmds)
|
|
122737
122748
|
return oldCmds;
|
|
@@ -305500,10 +305511,10 @@ class Settings {
|
|
|
305500
305511
|
});
|
|
305501
305512
|
}
|
|
305502
305513
|
toString() {
|
|
305503
|
-
return `Configurations:
|
|
305504
|
-
oidc client id: ${this.oidcClientId},
|
|
305505
|
-
oidc scopes: ${this.oidcScopes},
|
|
305506
|
-
applicationId: ${this.gprid},
|
|
305514
|
+
return `Configurations:
|
|
305515
|
+
oidc client id: ${this.oidcClientId},
|
|
305516
|
+
oidc scopes: ${this.oidcScopes},
|
|
305517
|
+
applicationId: ${this.gprid},
|
|
305507
305518
|
log level: ${this.logLevel}`;
|
|
305508
305519
|
}
|
|
305509
305520
|
}
|
|
@@ -318314,7 +318325,7 @@ var loadLanguages = instance.loadLanguages;
|
|
|
318314
318325
|
/***/ ((module) => {
|
|
318315
318326
|
|
|
318316
318327
|
"use strict";
|
|
318317
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.
|
|
318328
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@itwin/core-frontend","version":"5.1.5","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","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","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","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":{"@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/eslint-plugin":"5.2.2-dev.2","@types/chai-as-promised":"^7","@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.3.12","playwright":"~1.47.1","rimraf":"^6.0.1","sinon":"^17.0.2","source-map-loader":"^5.0.0","typescript":"~5.6.2","typemoq":"^2.1.0","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/cloud-agnostic-core":"^2.2.4","@itwin/object-storage-core":"^2.3.0","@itwin/core-i18n":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"}}');
|
|
318318
318329
|
|
|
318319
318330
|
/***/ })
|
|
318320
318331
|
|