imagekitio 3.0.0 → 3.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6aa3937bea9d3b4ff1bbc6a5f7bde28eeee0de07c423ed5daf702f2bbcba00ff
4
- data.tar.gz: 3b83ee3b6a677905be5f03eb7023c53495fb0b79c7f623e5f8844fffd48d74c1
3
+ metadata.gz: f841345e7c60108adfa1daec086a76fdd194202415904c18c61c14719424b224
4
+ data.tar.gz: 658901c8ad3a60f41bd1b1740fb188fd188edc569e0822947ede150916b567b9
5
5
  SHA512:
6
- metadata.gz: 548b8b9820cea02e34a10d939c962af956fe54a25027d69c8362153a33ef936db770520b4522947cfd0fa7a7003af308c2f4eef9b39286406ea1b2a70ec3a1e0
7
- data.tar.gz: cfa61aefd6ec06f1b6b246cff9a36aebb8315dc1b9fd0b40c0f8ab595ff3060010c6df64780a707d65246de7af1ad3b44bdf07cf083c991ebfb1472f3bb3ee6a
6
+ metadata.gz: cf58e04df78c584e13b049089eb2777aab6c232c4d99c0c0e6063f05f733895eb0eaf8625bfe4cc8da919c1231c08be2d4733cb30290cf9b7c422578c2021612
7
+ data.tar.gz: e037b5e7739d131f7496cb13944ee5eb0f2face165a22ce625b2458d11e58f3cd1d2cc4bf06fb5eb3b2e43e4c7cfc2687476695e8ff10f74a5527484ed9db500
data/README.md CHANGED
@@ -443,7 +443,18 @@ imagekitio.upload_file(
443
443
  file_name: "my_file_name.jpg", # required
444
444
  response_fields: 'isPrivateFile, tags',
445
445
  tags: %w[abc def],
446
- use_unique_file_name: true
446
+ use_unique_file_name: true,
447
+ transformation: {
448
+ pre: 'l-text,i-Imagekit,fs-50,l-end',
449
+ post: [
450
+ {
451
+ type: 'transformation',
452
+ value: 'w-100'
453
+ }
454
+ ]
455
+ },
456
+ checks: "'request.folder' : '/'" # To run server side checks before uploading files. Notice the quotes around file.size and 1mb.
457
+ is_published: true
447
458
  )
448
459
 
449
460
  ```
@@ -470,6 +481,7 @@ imagekitio.list_files(
470
481
  )
471
482
  ```
472
483
  **Get File Details**
484
+
473
485
  Accepts the file ID and fetches the details as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/get-file-details)
474
486
 
475
487
  ```ruby
@@ -479,6 +491,7 @@ imagekitio.get_file_details(
479
491
  ```
480
492
 
481
493
  **Get File Metadata**
494
+
482
495
  Accepts the file ID and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files)
483
496
  ```ruby
484
497
  imagekit.get_file_metadata(
@@ -487,6 +500,7 @@ imagekit.get_file_metadata(
487
500
  ```
488
501
 
489
502
  **Get File Metadata from remote url**
503
+
490
504
  Accepts the remote file url and fetches the metadata as per the [API documentation here](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-from-remote-url)
491
505
 
492
506
  ```ruby
@@ -496,6 +510,7 @@ imagekit.get_remote_file_url_metadata(
496
510
  ```
497
511
 
498
512
  **Update File Details**
513
+
499
514
  Update parameters associated with the file as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/update-file-details).
500
515
  The first argument to the `update_field_details` method is the file ID, and a second argument is an object with the
501
516
  parameters to be updated.
@@ -508,6 +523,21 @@ imagekitio.update_file_details(
508
523
  )
509
524
  ```
510
525
 
526
+
527
+ **Update publish status**
528
+
529
+ If `publish` is included in the update options, no other parameters are allowed. If any are present, an error will be returned: `Your request cannot contain any other parameters when publish is present`.
530
+
531
+ ```ruby
532
+ imagekitio.update_file_details(
533
+ file_id: '598821f949c0a938d57563bd',
534
+ publish:{
535
+ isPublished: true,
536
+ includeFileVersions: true
537
+ }
538
+ )
539
+ ```
540
+
511
541
  **Copy File**
512
542
 
513
543
  Copy file from one path to another path using the source file path and the destination path as per the [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-file)
@@ -5,7 +5,7 @@ module ImageKitIo
5
5
 
6
6
  VALID_FILE_DETAIL_OPTIONS = ["fileID"]
7
7
 
8
- VALID_UPLOAD_OPTIONS = %w[file file_name use_unique_file_name tags folder is_private_file custom_coordinates response_fields extensions webhook_url overwrite_file overwrite_AI_tags overwrite_custom_metadata custom_metadata mime overwrite_tags content_type transformation ]
8
+ VALID_UPLOAD_OPTIONS = %w[file file_name use_unique_file_name tags folder is_private_file custom_coordinates response_fields extensions webhook_url overwrite_file overwrite_AI_tags overwrite_custom_metadata custom_metadata mime overwrite_tags content_type transformation checks is_published]
9
9
  end
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  module ImageKitIo
2
2
  module Sdk
3
- VERSION = '3.0.0'
3
+ VERSION = '3.1.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: imagekitio
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ImageKit.io team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-30 00:00:00.000000000 Z
11
+ date: 2024-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable