SK-3004: Beta Release changes for flowDB suppport - #719
Conversation
* SK-3004:Add flowdb implementation for collect & composable elements. * SK-3004:Add flowdb implementation for Reveal elements. * SK-3004:Update flowdb upsert options in collect options. * SK-3004:Update response & error parsing. * SK-3004:Update response & error parsing for reveal elements. * SK-3004:Update SkyflowID to SkyflowId. * SK-3004:Update Reveal response structure. * SK-3004:Update FlowDB support changes w.r.t latest contract. * SK-3004:Update & skip tests cases w.r.t privacyDB changes.
* SK-3004:Update README with flowdb changes. * SK-3004:Expose missing flowDB response types. * SK-3004:Update samples w.r.t flowDB changes. * SK-3004:Update upsert type table to tableName. * SK-3004:Update samples with SkyflowError type.
* SK-3004:Update table to tableName in Collect Element. * SK-3004:Add Mock CVV token support in collect elements. * SK-3004:Update samples with tableName key update.
|
🔐 Gitleaks Findings: 14 issue(s) detected 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: 🔸 Rule: ...and more. Only showing first 10 findings. |
|
Semgrep Findings: Issues with Error level severity are found (Error is Highest severity in Semgrep), Please resolve the issues before merging. |
|
Will address while refactoring test coverage. |
9e3bd1b
into
beta-release/26.7.4
SK-3004: FlowDB support for Collect & Reveal elements
Summary
Adds support for the new flowDB (
/v2) vault API across the Elements (iframe) flows — Collect, Composable Collect, and Reveal — alongside the existing privacyDB implementation. Introduces flowDB-specific request/responseconstruction, a dedicated error contract, and updated upsert options, and restricts the client-level CRUD/file APIs to internal use.
Why
flowDB uses a different request/response and error contract than privacyDB (new record shape, inline per-record errors, new upsert semantics). The SDK's Element flows needed to speak this contract while keeping existing behaviour
intact.
Key changes
Response / error contract (flowDB)
{ tableName, skyflowId, tokens, httpCode }(vs privacyDB
{ table, fields: { skyflow_id, ... } }).recordsas{ error, tableName, httpCode }.{ error }object, surfaced via the newSkyflowFlowDBError.errors[]array (the privacyDB shape).New error type —
src/libs/skyflow-flowdb-error.tsSkyflowFlowDBError+normalizeFlowDBError()normalize the flowDB errorbody (snake_case
grpc_code/http_code/http_status) into the SDK'scamelCase convention, tolerating SkyflowError and bare-string inputs.
Collect / Reveal core-utils
src/core-utils/collect.ts: flowDB insert/update request builders andresponse/error parsers (
constructFlowDBInsertRequest/Response/Error,insertDataInCollectFlowDB,updateDataInCollectFlowDB).src/core-utils/reveal.ts: flowDB detokenize/reveal request + responseparsing, including composable reveal formatting.
Upsert options (flowDB)
{ table, uniqueColumns }(+ optionalupdateType) instead ofprivacyDB's
{ table, column }.MISSING_UNIQUE_COLUMNS_IN_UPSERT_OPTION,INVALID_UNIQUE_COLUMNS_IN_UPSERT_OPTION,INVALID_UPDATE_TYPE_IN_UPSERT_OPTION.Skyflow.UpdateTypeenum exposed on the client.Reveal redaction
(
INVALID_TOKEN_GROUP_REDACTIONS_REVEAL,INVALID_TOKEN_GROUP_REDACTION_ENTRY_REVEAL).API surface
#insert,#update,#detokenize,#get,#getById,#delete) — these flows are driven throughElements, not called directly on the client.
Tests
collect.flowdb.test.js,reveal.flowdb.test.js,frame-element-init.flowdb.test.js,composable-frame-element-init.flowdb.test.js,skyflow-frame-controller.detokenize.flowdb.test.js,skyflow-frame-controller-upload-tokenize.test.js.