@memberjunction/react-test-harness 2.105.0 → 2.107.0
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component-linter.d.ts","sourceRoot":"","sources":["../../src/lib/component-linter.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAiC,MAAM,6CAA6C,CAAC;AAG3G,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAErD,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAG/D,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,SAAS,EAAE,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,UAAU,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,gBAAgB,GAAG,iBAAiB,GAAG,iBAAiB,GAAG,cAAc,CAAC;IACnF,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAiFD,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAC,cAAc,CAAqB;IAGlD,OAAO,CAA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1582
|
+
// - CategoryPath, CategoryID, Parameters (optional)`
|
|
1583
1583
|
};
|
|
1584
1584
|
break;
|
|
1585
1585
|
case 'component-props-validation':
|
|
@@ -4312,6 +4312,7 @@ Valid properties: EntityName, ExtraFilter, Fields, OrderBy, MaxRows, StartRow, R
|
|
|
4312
4312
|
message: `RunQuery requires a RunQueryParams object as the first parameter.
|
|
4313
4313
|
Use: RunQuery({
|
|
4314
4314
|
QueryName: 'YourQuery', // Or use QueryID: 'uuid'
|
|
4315
|
+
CategoryPath: 'Category/Subcategory', // Optional. Used when QueryName is provided to provide a better filter
|
|
4315
4316
|
Parameters: { // Optional query parameters
|
|
4316
4317
|
param1: 'value1'
|
|
4317
4318
|
},
|
|
@@ -4334,6 +4335,7 @@ Use: RunQuery({
|
|
|
4334
4335
|
message: `RunQuery expects a RunQueryParams object, not a ${argType}.
|
|
4335
4336
|
Use: RunQuery({
|
|
4336
4337
|
QueryName: 'YourQuery', // Or use QueryID: 'uuid'
|
|
4338
|
+
CategoryPath: 'Category/Subcategory', // Optional. Used when QueryName is provided to provide a better filter
|
|
4337
4339
|
Parameters: { // Optional query parameters
|
|
4338
4340
|
startDate: '2024-01-01',
|
|
4339
4341
|
endDate: '2024-12-31'
|
|
@@ -4350,13 +4352,18 @@ Valid properties: QueryID, QueryName, CategoryID, CategoryPath, Parameters, MaxR
|
|
|
4350
4352
|
// Check for required properties (must have QueryID or QueryName)
|
|
4351
4353
|
let hasQueryID = false;
|
|
4352
4354
|
let hasQueryName = false;
|
|
4355
|
+
let hasCategoryPath = false;
|
|
4356
|
+
const foundProps = [];
|
|
4353
4357
|
for (const prop of config.properties) {
|
|
4354
4358
|
if (t.isObjectProperty(prop) && t.isIdentifier(prop.key)) {
|
|
4355
4359
|
const propName = prop.key.name;
|
|
4360
|
+
foundProps.push(propName);
|
|
4356
4361
|
if (propName === 'QueryID')
|
|
4357
4362
|
hasQueryID = true;
|
|
4358
4363
|
if (propName === 'QueryName')
|
|
4359
4364
|
hasQueryName = true;
|
|
4365
|
+
if (propName === 'CategoryPath')
|
|
4366
|
+
hasCategoryPath = true;
|
|
4360
4367
|
if (!validRunQueryProps.has(propName)) {
|
|
4361
4368
|
let message = `Invalid property '${propName}' on RunQuery. Valid properties: ${Array.from(validRunQueryProps).join(', ')}`;
|
|
4362
4369
|
let fix = `Remove '${propName}' property`;
|
|
@@ -4490,13 +4497,45 @@ Valid properties: QueryID, QueryName, CategoryID, CategoryPath, Parameters, MaxR
|
|
|
4490
4497
|
}
|
|
4491
4498
|
// Check that at least one required property is present
|
|
4492
4499
|
if (!hasQueryID && !hasQueryName) {
|
|
4500
|
+
// Build helpful context about what properties were found
|
|
4501
|
+
const propsContext = foundProps.length > 0
|
|
4502
|
+
? ` Found properties: ${foundProps.join(', ')}.`
|
|
4503
|
+
: '';
|
|
4504
|
+
// Special message if CategoryPath was provided without QueryName
|
|
4505
|
+
const message = hasCategoryPath
|
|
4506
|
+
? `RunQuery requires QueryName (or QueryID). CategoryPath alone is insufficient - it's only used to help filter when QueryName is ambiguous.${propsContext}`
|
|
4507
|
+
: `RunQuery requires either QueryID or QueryName property to identify which query to run.${propsContext}`;
|
|
4508
|
+
// Suggest QueryName from spec if available
|
|
4509
|
+
const exampleQueryName = componentSpec?.dataRequirements?.queries?.[0]?.name || 'YourQueryName';
|
|
4493
4510
|
violations.push({
|
|
4494
4511
|
rule: 'runview-runquery-valid-properties',
|
|
4495
4512
|
severity: 'critical',
|
|
4496
4513
|
line: config.loc?.start.line || 0,
|
|
4497
4514
|
column: config.loc?.start.column || 0,
|
|
4498
|
-
message
|
|
4499
|
-
code: `RunQuery({ ... })
|
|
4515
|
+
message,
|
|
4516
|
+
code: `RunQuery({ QueryName: '${exampleQueryName}', ... })`,
|
|
4517
|
+
suggestion: {
|
|
4518
|
+
text: 'Add QueryName property to identify the query',
|
|
4519
|
+
example: `await utilities.rq.RunQuery({\n QueryName: '${exampleQueryName}',${hasCategoryPath ? '\n CategoryPath: \'...\', // Optional, helps disambiguate' : ''}\n Parameters: { ... } // Optional query parameters\n})`
|
|
4520
|
+
}
|
|
4521
|
+
});
|
|
4522
|
+
}
|
|
4523
|
+
// Special check for CategoryPath-only calls (common Skip generation issue)
|
|
4524
|
+
// This provides a more targeted error for this specific anti-pattern
|
|
4525
|
+
if (!hasQueryID && !hasQueryName && hasCategoryPath) {
|
|
4526
|
+
const exampleQueryName = componentSpec?.dataRequirements?.queries?.[0]?.name || 'YourQueryName';
|
|
4527
|
+
const categoryPathProp = config.properties.find(p => t.isObjectProperty(p) && t.isIdentifier(p.key) && p.key.name === 'CategoryPath');
|
|
4528
|
+
violations.push({
|
|
4529
|
+
rule: 'runquery-categorypath-without-queryname',
|
|
4530
|
+
severity: 'critical',
|
|
4531
|
+
line: categoryPathProp?.loc?.start.line || config.loc?.start.line || 0,
|
|
4532
|
+
column: categoryPathProp?.loc?.start.column || config.loc?.start.column || 0,
|
|
4533
|
+
message: `CategoryPath cannot be used alone - it requires QueryName. CategoryPath is only used to disambiguate when multiple queries share the same name. You must specify which query to run using QueryName.`,
|
|
4534
|
+
code: `CategoryPath: '...' // Missing: QueryName`,
|
|
4535
|
+
suggestion: {
|
|
4536
|
+
text: 'Add QueryName property alongside CategoryPath. The query name should come from your dataRequirements.queries[].name',
|
|
4537
|
+
example: `// Query name from your spec: "${exampleQueryName}"\nawait utilities.rq.RunQuery({\n QueryName: '${exampleQueryName}', // Required: identifies which query to run\n CategoryPath: '...', // Optional: helps disambiguate if multiple queries have same name\n Parameters: {\n // Your query parameters here\n }\n})`
|
|
4538
|
+
}
|
|
4500
4539
|
});
|
|
4501
4540
|
}
|
|
4502
4541
|
}
|