@dqc.ai/fiori-sdk
v0.1.0
Published
DQC Validation SDK for SAP Fiori — real-time data quality validation in UI5 apps
Maintainers
Readme
@dqc.ai/fiori-sdk
Real-time data quality validation for SAP Fiori applications — powered by DQC.
Overview
The DQC Fiori SDK is a UI5 library that integrates DQC's Validation API directly into SAP Fiori apps. It enables inline, real-time validation of form data against centrally managed DQC rulesets — before the data is saved to SAP.
- ✅ Catch data quality issues at the point of entry — not days later in a batch run
- ✅ Central rule management — rules are maintained in DQC, not hard-coded in Fiori apps
- ✅ No ABAP changes required — the SDK calls the DQC Validation API over HTTPS
- ✅ Works with any Fiori app — Freestyle, Fiori Elements, or custom UI5 apps
Installation
Please reach out to the DQC team to get access.
Add the DQC Fiori SDK to your UI5 project:
{
"dependencies": {
"@dqc.ai/fiori-sdk": "^0.1.0"
}
}Or load directly in manifest.json:
{
"sap.ui5": {
"resourceRoots": {
"dqc.validation": "https://cdn.dqc.ai/<customer-id>/fiori-sdk/1.0/"
}
}
}Quick Start
// Component.js
sap.ui.define([
"sap/ui/core/UIComponent",
"dqc/validation/DQCClient"
], function(UIComponent, DQCClient) {
"use strict";
return UIComponent.extend("my.app.Component", {
init: function() {
UIComponent.prototype.init.apply(this, arguments);
// Initialize DQC Client
this._dqcClient = new DQCClient({
baseUrl: "https://your-dqc-instance.dqc.ai",
tenantId: "your-tenant-uuid",
apiKey: "your-api-key",
rulesetId: "your-ruleset-uuid"
});
}
});
});Validate Form Data
// In your controller
onValidatePress: async function() {
var oModel = this.getView().getModel();
var oData = oModel.getProperty("/materialData");
try {
var oResult = await this._dqcClient.validate({
data: [
{
"MaterialNumber": { type: "string", value: oData.MaterialNumber },
"Description": { type: "string", value: oData.Description },
"Weight": { type: "number", value: oData.Weight },
"CreatedDate": { type: "date", value: oData.CreatedDate, date_format: "YYYY-MM-DD" }
}
]
});
if (oResult.passed) {
MessageToast.show("Alle Prüfungen bestanden ✓");
} else {
this._dqcClient.applyIssues(this.getView(), oResult);
}
} catch (oError) {
MessageBox.error("Validierung fehlgeschlagen: " + oError.message);
}
}API Reference
DQCClient(config)
new DQCClient({
baseUrl: string, // DQC platform URL
tenantId: string, // Tenant UUID
apiKey?: string, // API key authentication
destination?: string, // SAP BTP Destination name (alternative to baseUrl + apiKey)
rulesetId?: string, // Default ruleset (can override per call)
timeout?: number // Request timeout in ms (default: 30000)
})validate(payload, options?)
Validates data against a DQC ruleset.
| Parameter | Type | Description |
|-----------|------|-------------|
| payload.data | Array<Object> | Row objects. Each field: { type, value, date_format? } |
| payload.rules_to_apply | string[] | (Optional) Specific rule IDs. Empty = all rules |
| options.rulesetId | string | (Optional) Override default ruleset |
| options.detailed | boolean | (Optional) Detailed results (default: true) |
Returns: Promise<ValidationResponse>
{
request_id: "req-123",
passed: false,
total_rows_validated: 1,
total_issues: 2,
rule_results: [{
rule_id: "uuid",
rule_name: "Material Number Format",
rule_description: "Must match pattern MAT-XXXXXX",
total_issues: 1,
passed: false,
issues: [{
row_index: 0,
column_name: "MaterialNumber",
value: "12345",
expected_pattern: "MAT-\\d{6}",
error_message: "Material number does not match required format"
}]
}]
}applyIssues(view, validationResponse)
Sets ValueState.Error and ValueStateText on matching UI5 input controls automatically.
clearIssues(view)
Resets all ValueState on controls previously marked by applyIssues.
validateField(fieldName, value, type)
Validates a single field. Returns only issues for that field. Useful for liveChange handlers.
Authentication
API Key
new DQCClient({
baseUrl: "https://your-instance.dqc.ai",
tenantId: "...",
apiKey: "dqc_ak_xxxxxxxxxxxx"
});⚠️ API keys in frontend code are visible to users. Use only for internal/intranet Fiori apps or combine with SAP BTP Destination Service.
SAP BTP Destination (Recommended for Production)
Route requests through SAP BTP Destination Service — keeps credentials server-side.
- Create a Destination in SAP BTP Cockpit (
DQC_VALIDATION, OAuth2ClientCredentials) - Use in SDK:
new DQCClient({
destination: "DQC_VALIDATION",
rulesetId: "your-ruleset-uuid"
});Supported Environments
| Environment | Support | |-------------|---------| | SAP Fiori Launchpad (on-premise) | ✅ | | SAP BTP / Fiori Launchpad (cloud) | ✅ | | SAP Work Zone | ✅ | | Standalone UI5 app | ✅ | | SAP Mobile Start | ✅ (via BTP Destination) | | SAPUI5 1.96+ / OpenUI5 | ✅ |
Documentation
Full documentation: docs.dqc.ai/fiori-sdk
Status
🚧 Early Access — This package is under active development. Contact [email protected] for early access and integration support.
License
Proprietary — see LICENSE for details.
