plagiarism-checker 3.7.0 → 4.1.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.
Files changed (27) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +9 -0
  3. data/README.md +225 -31
  4. data/lib/copyleaks/ai_detection_client.rb +1 -35
  5. data/lib/copyleaks/{models/submissions/ai_detection/source_code_submission_model.rb → ai_image_detection_client.rb} +22 -23
  6. data/lib/copyleaks/api.rb +6 -9
  7. data/lib/copyleaks/models/constants/CopyleaksAiImageDetectionModels.rb +28 -0
  8. data/lib/copyleaks/models/constants/CopyleaksTextModerationConstants.rb +39 -0
  9. data/lib/copyleaks/models/constants/CopyleaksTextModerationLanguages.rb +29 -0
  10. data/lib/copyleaks/models/constants/index.rb +4 -1
  11. data/lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionRequestModel.rb +120 -0
  12. data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionImageInfoModel.rb +63 -0
  13. data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResponseModel.rb +90 -0
  14. data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResultModel.rb +63 -0
  15. data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb +77 -0
  16. data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb +65 -0
  17. data/lib/copyleaks/models/imageDetection/responses/CopyleaksImageMetadataModel.rb +70 -0
  18. data/lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb +63 -0
  19. data/lib/copyleaks/models/index.rb +10 -0
  20. data/lib/copyleaks/models/submissions/index.rb +0 -1
  21. data/lib/copyleaks/models/submissions/writing_assistant/writing_assistant_submission_model.rb +1 -1
  22. data/lib/copyleaks/{deprecationService.rb → models/textModeration/requests/CopyleaksTextModerationLabel.rb} +18 -12
  23. data/lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationRequestModel.rb +23 -0
  24. data/lib/copyleaks/version.rb +1 -1
  25. data/lib/copyleaks/writing_assistant_client.rb +1 -1
  26. metadata +14 -4
  27. data/lib/copyleaks/models/constants/supportedFilesTypes.rb +0 -31
@@ -21,19 +21,25 @@
21
21
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
22
  # SOFTWARE.
23
23
  # =
24
+ require 'json'
24
25
  module Copyleaks
25
- class DeprecationService
26
- def self.show_deprecation_message
27
-
28
- warn "DEPRECATION NOTICE: AI Code Detection will be discontinued on August 29, 2025. Please remove AI code detection integrations before the sunset date."
29
-
30
- print "\033[31m"
31
- puts "════════════════════════════════════════════════════════════════════"
32
- puts "DEPRECATION NOTICE !!!"
33
- puts "AI Code Detection will be discontinued on August 29, 2025."
34
- puts "Please remove AI code detection integrations before the sunset date."
35
- puts "════════════════════════════════════════════════════════════════════"
36
- print "\033[0m"
26
+
27
+ class CopyleaksTextModerationLabel
28
+ attr_reader :id
29
+
30
+ def initialize(id)
31
+ @id = id
32
+ end
33
+
34
+ # Convert to JSON with "id" key
35
+ def to_json(*_args)
36
+ { 'id' => @id }.to_json
37
+ end
38
+
39
+ # Build from a JSON string or a hash
40
+ def self.from_json(json)
41
+ data = json.is_a?(String) ? JSON.parse(json) : json
42
+ new(data['id'] || data[:id])
37
43
  end
38
44
  end
39
45
  end
@@ -1,3 +1,26 @@
1
+ #
2
+ # The MIT License(MIT)
3
+ #
4
+ # Copyright(c) 2016 Copyleaks LTD (https://copyleaks.com)
5
+ #
6
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ # of this software and associated documentation files (the "Software"), to deal
8
+ # in the Software without restriction, including without limitation the rights
9
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ # copies of the Software, and to permit persons to whom the Software is
11
+ # furnished to do so, subject to the following conditions:
12
+ #
13
+ # The above copyright notice and this permission notice shall be included in all
14
+ # copies or substantial portions of the Software.
15
+ #
16
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ # SOFTWARE.
23
+ # =
1
24
  require 'json'
2
25
 
3
26
  module Copyleaks
@@ -1,3 +1,3 @@
1
1
  module Copyleaks
2
- VERSION = '3.7.0'
2
+ VERSION = '4.1.0'
3
3
  end
@@ -57,7 +57,7 @@ module Copyleaks
57
57
  # https://api.copyleaks.com/documentation/v3/exponential-backoff
58
58
  # @param [CopyleaksAuthToken] authToken Copyleaks authentication token
59
59
  # @param [String] scanId Attach your own scan Id
60
- # @param [SourceCodeSubmissionModel] submission document
60
+ # @param [WritingAssistantSubmissionModel] submission document
61
61
  def submit_text(authToken, scanId, submission)
62
62
  raise 'scanId is Invalid, must be instance of String' if scanId.nil? || !scanId.instance_of?(String)
63
63
  raise 'submission is invalid, must be an instance of WritingAssistantSubmissionModel' if submission.nil? || !submission.instance_of?(Copyleaks::WritingAssistantSubmissionModel)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: plagiarism-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Copyleaks ltd
@@ -30,12 +30,14 @@ files:
30
30
  - bin/setup
31
31
  - lib/copyleaks.rb
32
32
  - lib/copyleaks/ai_detection_client.rb
33
+ - lib/copyleaks/ai_image_detection_client.rb
33
34
  - lib/copyleaks/api.rb
34
35
  - lib/copyleaks/app.config.rb
35
- - lib/copyleaks/deprecationService.rb
36
36
  - lib/copyleaks/models/auth_token.rb
37
+ - lib/copyleaks/models/constants/CopyleaksAiImageDetectionModels.rb
38
+ - lib/copyleaks/models/constants/CopyleaksTextModerationConstants.rb
39
+ - lib/copyleaks/models/constants/CopyleaksTextModerationLanguages.rb
37
40
  - lib/copyleaks/models/constants/index.rb
38
- - lib/copyleaks/models/constants/supportedFilesTypes.rb
39
41
  - lib/copyleaks/models/delete_request_model.rb
40
42
  - lib/copyleaks/models/exceptions/auth_expired_exception.rb
41
43
  - lib/copyleaks/models/exceptions/command_exception.rb
@@ -48,11 +50,18 @@ files:
48
50
  - lib/copyleaks/models/exports/export_results.rb
49
51
  - lib/copyleaks/models/exports/index.rb
50
52
  - lib/copyleaks/models/id_object.rb
53
+ - lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionRequestModel.rb
54
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionImageInfoModel.rb
55
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResponseModel.rb
56
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResultModel.rb
57
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb
58
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb
59
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksImageMetadataModel.rb
60
+ - lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb
51
61
  - lib/copyleaks/models/index.rb
52
62
  - lib/copyleaks/models/start_request_model.rb
53
63
  - lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb
54
64
  - lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb
55
- - lib/copyleaks/models/submissions/ai_detection/source_code_submission_model.rb
56
65
  - lib/copyleaks/models/submissions/file_ocr_submission_model.rb
57
66
  - lib/copyleaks/models/submissions/file_submission_model.rb
58
67
  - lib/copyleaks/models/submissions/index.rb
@@ -114,6 +123,7 @@ files:
114
123
  - lib/copyleaks/models/submissions/webhooks/index.rb
115
124
  - lib/copyleaks/models/submissions/writing_assistant/score_weights.rb
116
125
  - lib/copyleaks/models/submissions/writing_assistant/writing_assistant_submission_model.rb
126
+ - lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb
117
127
  - lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationRequestModel.rb
118
128
  - lib/copyleaks/models/textModeration/responses/CopyleaksTextModerationResponseModel.rb
119
129
  - lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb
@@ -1,31 +0,0 @@
1
- module Copyleaks
2
- class SupportedFilesTypes
3
- SUPPORTED_CODE_EXTENSIONS = [
4
- "ts",
5
- "py",
6
- "go",
7
- "cs",
8
- "c",
9
- "h",
10
- "idc",
11
- "cpp",
12
- "hpp",
13
- "c++",
14
- "h++",
15
- "cc",
16
- "hh",
17
- "java",
18
- "js",
19
- "swift",
20
- "rb",
21
- "pl",
22
- "php",
23
- "sh",
24
- "m",
25
- "scala",
26
- "rs",
27
- "vbs",
28
- "css"
29
- ].freeze
30
- end
31
- end