skyflow-js 1.31.0 → 1.32.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,10 @@
1
1
  # Changelog
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
+ ## [1.31.1] - 2023-10-17
5
+ ### Fixed
6
+ - Expiration-year max-length based on format.
7
+ - Card icon render with setValue method.
4
8
 
5
9
  ## [1.31.0] - 2023-10-06
6
10
  ### Added
package/README.md CHANGED
@@ -2362,6 +2362,106 @@ container.uploadFiles();
2362
2362
  ]
2363
2363
  }
2364
2364
  ```
2365
+ ### File upload with options:
2366
+
2367
+ Along with fileElementInput, you can define other options in the Options object as described below:
2368
+ ```js
2369
+ const options = {
2370
+ allowedFileType: String[], // Optional, indicates the allowed file types for upload
2371
+ }
2372
+ ```
2373
+ `allowedFileType`: An array of string value that indicates the allowedFileTypes to be uploaded.
2374
+
2375
+ #### File upload with options example
2376
+
2377
+ ```javascript
2378
+ // Create collect Container.
2379
+ const collectContainer = skyflow.container(Skyflow.ContainerType.COLLECT);
2380
+
2381
+ // Create collect elements.
2382
+ const cardNumberElement = collectContainer.create({
2383
+ table: 'newTable',
2384
+ column: 'card_number',
2385
+ inputstyles: {
2386
+ base: {
2387
+ color: '#1d1d1d',
2388
+ },
2389
+ },
2390
+ labelStyles: {
2391
+ base: {
2392
+ fontSize: '12px',
2393
+ fontWeight: 'bold',
2394
+ },
2395
+ },
2396
+ errorTextStyles: {
2397
+ base: {
2398
+ color: '#f44336',
2399
+ },
2400
+ },
2401
+ placeholder: 'card number',
2402
+ label: 'Card Number',
2403
+ type: Skyflow.ElementType.CARD_NUMBER,
2404
+ });
2405
+ const options = {
2406
+ allowedFileType: [".pdf",".png"];
2407
+ };
2408
+ const fileElement = collectContainer.create({
2409
+ table: 'newTable',
2410
+ column: 'file',
2411
+ skyflowID: '431eaa6c-5c15-4513-aa15-29f50babe882',
2412
+ inputstyles: {
2413
+ base: {
2414
+ color: '#1d1d1d',
2415
+ },
2416
+ },
2417
+ labelStyles: {
2418
+ base: {
2419
+ fontSize: '12px',
2420
+ fontWeight: 'bold',
2421
+ },
2422
+ },
2423
+ errorTextStyles: {
2424
+ base: {
2425
+ color: '#f44336',
2426
+ },
2427
+ },
2428
+ type: Skyflow.ElementType.FILE_INPUT,
2429
+ },
2430
+ options
2431
+ );
2432
+
2433
+ // Mount the elements.
2434
+ cardNumberElement.mount('#collectCardNumber');
2435
+ fileElement.mount('#collectFile');
2436
+
2437
+ // Collect and upload methods.
2438
+ collectContainer.collect({});
2439
+ collectContainer.uploadFiles();
2440
+
2441
+ ```
2442
+ **Sample Response for collect():**
2443
+ ```javascript
2444
+ {
2445
+ "records": [
2446
+ {
2447
+ "table": "newTable",
2448
+ "fields": {
2449
+ "card_number": "f3907186-e7e2-466f-91e5-48e12c2bcbc1",
2450
+ }
2451
+ }
2452
+ ]
2453
+ }
2454
+ ```
2455
+ **Sample Response for file uploadFiles() :**
2456
+ ```javascript
2457
+ {
2458
+ "fileUploadResponse": [
2459
+ {
2460
+ "skyflow_id": "431eaa6c-5c15-4513-aa15-29f50babe882"
2461
+ }
2462
+ ]
2463
+ }
2464
+ ```
2365
2465
  #### File upload with additional elements
2366
2466
 
2367
2467
  ```javascript