Repository navigation
SK-3321 add file element support in skyvault sdk - #340
Open
skyflow-bharti wants to merge 1 commit into
Open
skyflow-bharti wants to merge 1 commit into
skyflow-bharti wants to merge 1 commit into
Conversation
|
✅ Gitleaks Findings: No secrets detected. Safe to proceed! |
Promptless documentation updates
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR implements
File elements in the SkyVault (Skyflow) iOS SDK: FILE_INPUT (single file) and MULTI_FILE_INPUT (multiple files), as in skyflow-js.
Creating an element: container.create(fileInput: CollectElementInput(table:column:type:appearance:), options: CollectElementOptions(...))
Two layouts:
.FIELD (default) is a bordered box with "Choose File" and the selected file.
.CUSTOM draws no SDK button. The app uses its own button and calls openPicker().
File sources: Files app, Photos library and camera.
File options:
required, allowedFileType, blockEmptyFiles, preserveFileName, returnFileMetadata, maxFileSize, maxFileCount, sources.
Validation on the device: file type, size, count, empty files and file name. Archive and executable files are always blocked.
Upload:
container.uploadFiles(callback:) uploads each file as its own record to /v2/vaults/{vaultID}/files/upload. Failed files stay selected so the user can retry.
Element API: on(eventName:), setError, resetError, clearValue, unmount, openPicker().
Privacy:
the app never gets file bytes, paths or names, only fileCount, isValid and isEmpty. Temporary copies the SDK makes are deleted after use.
Tests: a new skyflow-iOS-fileTests target with 167 tests, all passing.