copyleaks 5.0.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.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/CHANGELOG.md +102 -0
- data/Gemfile +5 -0
- data/LICENSE.txt +21 -0
- data/README.md +487 -0
- data/Rakefile +13 -0
- data/bin/console +11 -0
- data/bin/setup +8 -0
- data/lib/copyleaks/ai_detection_client.rb +27 -0
- data/lib/copyleaks/ai_image_detection_client.rb +35 -0
- data/lib/copyleaks/ai_video_detection_client.rb +20 -0
- data/lib/copyleaks/api.rb +247 -0
- data/lib/copyleaks/app.config.rb +36 -0
- data/lib/copyleaks/image_plagiarism_client.rb +19 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionExplainModel.rb +26 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionMatchModel.rb +33 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionMatchTextModel.rb +31 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternMatchModel.rb +32 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternStatisticsModel.rb +46 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternsModel.rb +38 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPositionsModel.rb +39 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionResponseModel.rb +68 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionResultModel.rb +41 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionScannedDocumentModel.rb +21 -0
- data/lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionSummaryModel.rb +34 -0
- data/lib/copyleaks/models/auth_token.rb +46 -0
- data/lib/copyleaks/models/constants/CopyleaksAiImageDetectionModels.rb +5 -0
- data/lib/copyleaks/models/constants/CopyleaksAiImageMaskTypes.rb +11 -0
- data/lib/copyleaks/models/constants/CopyleaksAiVideoDetectionModels.rb +5 -0
- data/lib/copyleaks/models/constants/CopyleaksAlertCodes.rb +7 -0
- data/lib/copyleaks/models/constants/CopyleaksTextModerationConstants.rb +15 -0
- data/lib/copyleaks/models/constants/CopyleaksTextModerationLanguages.rb +6 -0
- data/lib/copyleaks/models/constants/index.rb +10 -0
- data/lib/copyleaks/models/delete_request_model.rb +50 -0
- data/lib/copyleaks/models/exceptions/auth_expired_exception.rb +7 -0
- data/lib/copyleaks/models/exceptions/command_exception.rb +13 -0
- data/lib/copyleaks/models/exceptions/copyleaks_api_exception.rb +18 -0
- data/lib/copyleaks/models/exceptions/index.rb +8 -0
- data/lib/copyleaks/models/exceptions/rate_limit_exception.rb +8 -0
- data/lib/copyleaks/models/exceptions/under_maintenance_exception.rb +8 -0
- data/lib/copyleaks/models/exports/export_crawled_version.rb +6 -0
- data/lib/copyleaks/models/exports/export_model.rb +87 -0
- data/lib/copyleaks/models/exports/export_pdf_report.rb +6 -0
- data/lib/copyleaks/models/exports/export_results.rb +30 -0
- data/lib/copyleaks/models/exports/export_target.rb +42 -0
- data/lib/copyleaks/models/exports/index.rb +8 -0
- data/lib/copyleaks/models/id_object.rb +22 -0
- data/lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionAsyncRequestModel.rb +63 -0
- data/lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionRequestModel.rb +135 -0
- data/lib/copyleaks/models/imageDetection/requests/CopyleaksAsyncWebhooksModel.rb +37 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectedObjectModel.rb +31 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionImageInfoModel.rb +31 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResponseModel.rb +79 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResultModel.rb +40 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb +46 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb +33 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksImageMetadataModel.rb +45 -0
- data/lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb +31 -0
- data/lib/copyleaks/models/imagePlagiarism/requests/CopyleaksImagePlagiarismRequestModel.rb +51 -0
- data/lib/copyleaks/models/imagePlagiarism/responses/CopyleaksImagePlagiarismResponseModel.rb +187 -0
- data/lib/copyleaks/models/index.rb +51 -0
- data/lib/copyleaks/models/start_request_model.rb +40 -0
- data/lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb +25 -0
- data/lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb +41 -0
- data/lib/copyleaks/models/submissions/file_ocr_submission_model.rb +36 -0
- data/lib/copyleaks/models/submissions/file_submission_model.rb +35 -0
- data/lib/copyleaks/models/submissions/index.rb +16 -0
- data/lib/copyleaks/models/submissions/properties/actions.rb +10 -0
- data/lib/copyleaks/models/submissions/properties/ai_generated_text.rb +40 -0
- data/lib/copyleaks/models/submissions/properties/ai_generated_text_explain.rb +6 -0
- data/lib/copyleaks/models/submissions/properties/ai_source_match.rb +6 -0
- data/lib/copyleaks/models/submissions/properties/assignment.rb +6 -0
- data/lib/copyleaks/models/submissions/properties/author.rb +18 -0
- data/lib/copyleaks/models/submissions/properties/copyleaks_db.rb +22 -0
- data/lib/copyleaks/models/submissions/properties/course.rb +6 -0
- data/lib/copyleaks/models/submissions/properties/cross_languages.rb +21 -0
- data/lib/copyleaks/models/submissions/properties/custom_metadata.rb +19 -0
- data/lib/copyleaks/models/submissions/properties/domains_mode.rb +8 -0
- data/lib/copyleaks/models/submissions/properties/enable_flag.rb +26 -0
- data/lib/copyleaks/models/submissions/properties/exclude.rb +57 -0
- data/lib/copyleaks/models/submissions/properties/exclude_code.rb +19 -0
- data/lib/copyleaks/models/submissions/properties/filter.rb +49 -0
- data/lib/copyleaks/models/submissions/properties/index.rb +43 -0
- data/lib/copyleaks/models/submissions/properties/indexing.rb +25 -0
- data/lib/copyleaks/models/submissions/properties/indexing_repository.rb +26 -0
- data/lib/copyleaks/models/submissions/properties/institution.rb +6 -0
- data/lib/copyleaks/models/submissions/properties/internal_ai_source_match.rb +7 -0
- data/lib/copyleaks/models/submissions/properties/language.rb +18 -0
- data/lib/copyleaks/models/submissions/properties/masking_policy.rb +11 -0
- data/lib/copyleaks/models/submissions/properties/overview.rb +42 -0
- data/lib/copyleaks/models/submissions/properties/pdf_colors.rb +48 -0
- data/lib/copyleaks/models/submissions/properties/pdf_properties.rb +51 -0
- data/lib/copyleaks/models/submissions/properties/pdf_report_version.rb +9 -0
- data/lib/copyleaks/models/submissions/properties/pdf_version.rb +10 -0
- data/lib/copyleaks/models/submissions/properties/references.rb +26 -0
- data/lib/copyleaks/models/submissions/properties/repository.rb +18 -0
- data/lib/copyleaks/models/submissions/properties/scan_method_algorithm.rb +8 -0
- data/lib/copyleaks/models/submissions/properties/scanning.rb +44 -0
- data/lib/copyleaks/models/submissions/properties/scanning_exclude.rb +47 -0
- data/lib/copyleaks/models/submissions/properties/scanning_include.rb +25 -0
- data/lib/copyleaks/models/submissions/properties/scanning_repository.rb +23 -0
- data/lib/copyleaks/models/submissions/properties/sensitive_data_protection.rb +42 -0
- data/lib/copyleaks/models/submissions/properties/submission_properties.rb +179 -0
- data/lib/copyleaks/models/submissions/properties/webhooks.rb +42 -0
- data/lib/copyleaks/models/submissions/properties/writing_feedback.rb +30 -0
- data/lib/copyleaks/models/submissions/submission_model.rb +24 -0
- data/lib/copyleaks/models/submissions/url_submission_model.rb +41 -0
- data/lib/copyleaks/models/submissions/webhooks/CompletedWebhook.rb +67 -0
- data/lib/copyleaks/models/submissions/webhooks/CreditsCheckedWebhook.rb +24 -0
- data/lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb +22 -0
- data/lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb +25 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/Metadata.rb +61 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/StatusWebhook.rb +23 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/Webhook.rb +25 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Notifications.rb +24 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Results.rb +54 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb +36 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb +49 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb +29 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb +22 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb +37 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsRepositories.rb +28 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb +91 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Batch.rb +26 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Database.rb +26 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Internet.rb +23 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb +36 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/RepositoryMetadata.rb +11 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Score.rb +20 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/SharedResultsModel.rb +22 -0
- data/lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Tags.rb +12 -0
- data/lib/copyleaks/models/submissions/webhooks/IndexedWebhook.rb +9 -0
- data/lib/copyleaks/models/submissions/webhooks/NewResultWebhook.rb +32 -0
- data/lib/copyleaks/models/submissions/webhooks/index.rb +34 -0
- data/lib/copyleaks/models/submissions/writing_assistant/score_weights.rb +26 -0
- data/lib/copyleaks/models/submissions/writing_assistant/writing_assistant_submission_model.rb +32 -0
- data/lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb +21 -0
- data/lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationRequestModel.rb +45 -0
- data/lib/copyleaks/models/textModeration/responses/CopyleaksTextModerationResponseModel.rb +55 -0
- data/lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb +27 -0
- data/lib/copyleaks/models/textModeration/responses/submodules/Text.rb +27 -0
- data/lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb +32 -0
- data/lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb +55 -0
- data/lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb +29 -0
- data/lib/copyleaks/models/videoDetection/requests/CopyleaksAiVideoDetectionRequestModel.rb +61 -0
- data/lib/copyleaks/models/videoDetection/responses/CopyleaksAiVideoDetectionResponseModel.rb +177 -0
- data/lib/copyleaks/text_moderation_client.rb +18 -0
- data/lib/copyleaks/utils/copyleaks_client.utils.rb +101 -0
- data/lib/copyleaks/utils/http_client.rb +164 -0
- data/lib/copyleaks/utils/multipart.rb +86 -0
- data/lib/copyleaks/utils/status-code.utils.rb +23 -0
- data/lib/copyleaks/version.rb +3 -0
- data/lib/copyleaks/writing_assistant_client.rb +26 -0
- data/lib/copyleaks.rb +11 -0
- data/lib/index.rb +4 -0
- metadata +248 -0
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
require 'net/http'
|
|
2
|
+
require 'openssl'
|
|
3
|
+
require 'uri'
|
|
4
|
+
|
|
5
|
+
module Copyleaks
|
|
6
|
+
# A small, thread-safe pool of keep-alive connections to one host.
|
|
7
|
+
# * Each request checks out its own Net::HTTP connection, so two threads never share a socket.
|
|
8
|
+
# * Requests are never retried automatically, so a submit that timed out is not uploaded twice.
|
|
9
|
+
# * A connection that failed mid-request is dropped, never reused.
|
|
10
|
+
# * After a fork, the child opens its own connections instead of sharing the parent's sockets.
|
|
11
|
+
class HttpClient
|
|
12
|
+
DEFAULT_OPEN_TIMEOUT = 10
|
|
13
|
+
DEFAULT_READ_TIMEOUT = 120
|
|
14
|
+
DEFAULT_WRITE_TIMEOUT = 120
|
|
15
|
+
DEFAULT_KEEP_ALIVE_TIMEOUT = 30
|
|
16
|
+
DEFAULT_POOL_SIZE = 5
|
|
17
|
+
|
|
18
|
+
attr_reader :address, :port, :use_ssl, :open_timeout, :read_timeout, :write_timeout,
|
|
19
|
+
:keep_alive_timeout, :pool_size
|
|
20
|
+
|
|
21
|
+
# Timeouts are in seconds, as in API#initialize.
|
|
22
|
+
# @param [String, URI] uri For example 'https://api.copyleaks.com'.
|
|
23
|
+
# @param [Integer] pool_size Maximum open connections. Extra threads wait for a free one.
|
|
24
|
+
def initialize(uri,
|
|
25
|
+
open_timeout: DEFAULT_OPEN_TIMEOUT,
|
|
26
|
+
read_timeout: DEFAULT_READ_TIMEOUT,
|
|
27
|
+
write_timeout: DEFAULT_WRITE_TIMEOUT,
|
|
28
|
+
keep_alive_timeout: DEFAULT_KEEP_ALIVE_TIMEOUT,
|
|
29
|
+
pool_size: DEFAULT_POOL_SIZE)
|
|
30
|
+
uri = URI.parse(uri.to_s) unless uri.is_a?(URI::Generic)
|
|
31
|
+
raise ArgumentError, "Copyleaks::HttpClient - uri - invalid server URI: #{uri}" if uri.host.nil?
|
|
32
|
+
|
|
33
|
+
{ open_timeout: open_timeout, read_timeout: read_timeout, write_timeout: write_timeout,
|
|
34
|
+
keep_alive_timeout: keep_alive_timeout }.each do |name, value|
|
|
35
|
+
unless value.is_a?(Numeric) && value > 0
|
|
36
|
+
raise ArgumentError, "Copyleaks::HttpClient - #{name} - #{name} must be a positive number of seconds"
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
unless pool_size.is_a?(Integer) && pool_size > 0
|
|
40
|
+
raise ArgumentError, 'Copyleaks::HttpClient - pool_size - pool_size must be a positive Integer'
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
@address = uri.host
|
|
44
|
+
@port = uri.port
|
|
45
|
+
@use_ssl = uri.scheme == 'https'
|
|
46
|
+
@open_timeout = open_timeout
|
|
47
|
+
@read_timeout = read_timeout
|
|
48
|
+
@write_timeout = write_timeout
|
|
49
|
+
@keep_alive_timeout = keep_alive_timeout
|
|
50
|
+
@pool_size = pool_size
|
|
51
|
+
|
|
52
|
+
@mutex = Mutex.new
|
|
53
|
+
@available = ConditionVariable.new
|
|
54
|
+
@idle = []
|
|
55
|
+
@owned = {}.compare_by_identity
|
|
56
|
+
@pid = Process.pid
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Wraps a Net::HTTP, as passed to the sub-clients by earlier versions.
|
|
60
|
+
def self.wrap(client)
|
|
61
|
+
return client if client.is_a?(HttpClient)
|
|
62
|
+
unless client.is_a?(Net::HTTP)
|
|
63
|
+
raise ArgumentError, 'Copyleaks::HttpClient - client - must be a Copyleaks::HttpClient or a Net::HTTP'
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
scheme = client.use_ssl? ? 'https' : 'http'
|
|
67
|
+
new(URI::Generic.build(scheme: scheme, host: client.address, port: client.port))
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Sends one request on a pooled connection and returns the Net::HTTPResponse.
|
|
71
|
+
# A block receives the response before the body is read, to stream it with read_body.
|
|
72
|
+
def request(req, &block)
|
|
73
|
+
conn = checkout
|
|
74
|
+
reusable = false
|
|
75
|
+
begin
|
|
76
|
+
conn.start unless conn.started?
|
|
77
|
+
response = conn.request(req, &block)
|
|
78
|
+
reusable = true
|
|
79
|
+
response
|
|
80
|
+
ensure
|
|
81
|
+
checkin(conn, reusable)
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Number of connections currently open or checked out.
|
|
86
|
+
def size
|
|
87
|
+
@mutex.synchronize { @owned.size }
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
# Closes the idle connections. Connections in use are closed when they are returned.
|
|
91
|
+
def close
|
|
92
|
+
idle = @mutex.synchronize do
|
|
93
|
+
list = @idle
|
|
94
|
+
@idle = []
|
|
95
|
+
list.each { |conn| @owned.delete(conn) }
|
|
96
|
+
list
|
|
97
|
+
end
|
|
98
|
+
idle.each { |conn| finish_quietly(conn) }
|
|
99
|
+
nil
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
private
|
|
103
|
+
|
|
104
|
+
def checkout
|
|
105
|
+
@mutex.synchronize do
|
|
106
|
+
reset_after_fork
|
|
107
|
+
loop do
|
|
108
|
+
return @idle.pop unless @idle.empty?
|
|
109
|
+
|
|
110
|
+
if @owned.size < @pool_size
|
|
111
|
+
conn = build_connection
|
|
112
|
+
@owned[conn] = true
|
|
113
|
+
return conn
|
|
114
|
+
end
|
|
115
|
+
@available.wait(@mutex)
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def checkin(conn, reusable)
|
|
121
|
+
finish_quietly(conn) unless reusable
|
|
122
|
+
@mutex.synchronize do
|
|
123
|
+
# A connection checked out before a fork belongs to the parent process. Drop it.
|
|
124
|
+
if @owned.key?(conn)
|
|
125
|
+
if reusable
|
|
126
|
+
@idle.push(conn)
|
|
127
|
+
else
|
|
128
|
+
@owned.delete(conn)
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
@available.signal
|
|
132
|
+
end
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
def reset_after_fork
|
|
136
|
+
return if @pid == Process.pid
|
|
137
|
+
|
|
138
|
+
# Do not close the inherited sockets: they are still used by the parent process.
|
|
139
|
+
@idle = []
|
|
140
|
+
@owned = {}.compare_by_identity
|
|
141
|
+
@pid = Process.pid
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def build_connection
|
|
145
|
+
conn = Net::HTTP.new(@address, @port)
|
|
146
|
+
conn.use_ssl = @use_ssl
|
|
147
|
+
conn.verify_mode = OpenSSL::SSL::VERIFY_PEER if @use_ssl
|
|
148
|
+
conn.open_timeout = @open_timeout
|
|
149
|
+
conn.read_timeout = @read_timeout
|
|
150
|
+
conn.write_timeout = @write_timeout if conn.respond_to?(:write_timeout=)
|
|
151
|
+
conn.keep_alive_timeout = @keep_alive_timeout
|
|
152
|
+
# Never resend a request on a timeout or a dropped connection. Net::HTTP retries idempotent
|
|
153
|
+
# verbs (including PUT) once by default, which would upload a submit twice.
|
|
154
|
+
conn.max_retries = 0
|
|
155
|
+
conn
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
def finish_quietly(conn)
|
|
159
|
+
conn.finish if conn.started?
|
|
160
|
+
rescue StandardError
|
|
161
|
+
nil
|
|
162
|
+
end
|
|
163
|
+
end
|
|
164
|
+
end
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
require 'securerandom'
|
|
2
|
+
|
|
3
|
+
module Copyleaks
|
|
4
|
+
# Builds a multipart/form-data body in memory. Files go as raw bytes, without base64 overhead.
|
|
5
|
+
class MultipartForm
|
|
6
|
+
CRLF = "\r\n".b.freeze
|
|
7
|
+
|
|
8
|
+
IMAGE_CONTENT_TYPES = {
|
|
9
|
+
'.png' => 'image/png',
|
|
10
|
+
'.jpg' => 'image/jpeg',
|
|
11
|
+
'.jpeg' => 'image/jpeg',
|
|
12
|
+
'.gif' => 'image/gif',
|
|
13
|
+
'.bmp' => 'image/bmp',
|
|
14
|
+
'.webp' => 'image/webp',
|
|
15
|
+
'.ico' => 'image/x-icon',
|
|
16
|
+
'.heic' => 'image/heic',
|
|
17
|
+
'.heif' => 'image/heif',
|
|
18
|
+
'.tif' => 'image/tiff',
|
|
19
|
+
'.tiff' => 'image/tiff',
|
|
20
|
+
'.avif' => 'image/avif'
|
|
21
|
+
}.freeze
|
|
22
|
+
|
|
23
|
+
attr_reader :boundary
|
|
24
|
+
|
|
25
|
+
def initialize(boundary = nil)
|
|
26
|
+
@boundary = boundary || "copyleaks-#{SecureRandom.hex(16)}"
|
|
27
|
+
@parts = []
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
# Adds a text field. Booleans are sent as "true" / "false".
|
|
31
|
+
def add_field(name, value)
|
|
32
|
+
@parts << [name.to_s, value.to_s, nil, nil]
|
|
33
|
+
self
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# data is a binary String or an IO. An IO is rewound first when possible, so the request can be resent.
|
|
37
|
+
def add_file(name, data, filename, content_type = nil)
|
|
38
|
+
bytes = data.respond_to?(:read) ? read_io(data) : data
|
|
39
|
+
raise ArgumentError, "Copyleaks::MultipartForm - #{name} - file data must be a String or an IO" unless bytes.is_a?(String)
|
|
40
|
+
|
|
41
|
+
content_type ||= self.class.content_type_for(filename)
|
|
42
|
+
@parts << [name.to_s, bytes, filename.to_s, content_type]
|
|
43
|
+
self
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def content_type
|
|
47
|
+
"multipart/form-data; boundary=#{@boundary}"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def body
|
|
51
|
+
out = String.new(encoding: Encoding::BINARY)
|
|
52
|
+
@parts.each do |name, value, filename, content_type|
|
|
53
|
+
out << "--#{@boundary}".b << CRLF
|
|
54
|
+
disposition = "Content-Disposition: form-data; name=\"#{escape(name)}\""
|
|
55
|
+
disposition += "; filename=\"#{escape(filename)}\"" if filename
|
|
56
|
+
out << disposition.b << CRLF
|
|
57
|
+
out << "Content-Type: #{content_type}".b << CRLF if content_type
|
|
58
|
+
out << CRLF
|
|
59
|
+
# File.binread already returns binary data, so only text values need a binary copy.
|
|
60
|
+
out << (value.encoding == Encoding::BINARY ? value : value.b) << CRLF
|
|
61
|
+
end
|
|
62
|
+
out << "--#{@boundary}--".b << CRLF
|
|
63
|
+
out
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
def self.content_type_for(filename)
|
|
67
|
+
IMAGE_CONTENT_TYPES.fetch(File.extname(filename.to_s).downcase, 'application/octet-stream')
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
private
|
|
71
|
+
|
|
72
|
+
def read_io(io)
|
|
73
|
+
begin
|
|
74
|
+
io.rewind if io.respond_to?(:rewind)
|
|
75
|
+
rescue Errno::ESPIPE
|
|
76
|
+
# Pipes and sockets cannot be rewound; they are read from where they are.
|
|
77
|
+
end
|
|
78
|
+
io.read
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Quotes and line breaks cannot appear inside a quoted header value.
|
|
82
|
+
def escape(value)
|
|
83
|
+
value.to_s.gsub('"', '%22').gsub("\r", '%0D').gsub("\n", '%0A')
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module Copyleaks
|
|
2
|
+
class Utils
|
|
3
|
+
def self.is_success_status_code(code)
|
|
4
|
+
code.to_i >= 200 && code.to_i <= 299
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def self.is_under_maintenance_response(code)
|
|
8
|
+
code.to_i == 503
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def self.is_rate_limit_response(code)
|
|
12
|
+
code.to_i == 429
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
# True for nil or an Array of [name, value] String pairs, e.g. [['Authorization', 'Bearer my-token']].
|
|
16
|
+
def self.headers_valid?(headers)
|
|
17
|
+
return true if headers.nil?
|
|
18
|
+
return false unless headers.is_a?(Array)
|
|
19
|
+
|
|
20
|
+
headers.all? { |pair| pair.is_a?(Array) && pair.length == 2 && pair.all? { |part| part.is_a?(String) } }
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module Copyleaks
|
|
2
|
+
class WritingAssistantClient
|
|
3
|
+
# @param [Copyleaks::HttpClient] api_client A Net::HTTP is also accepted.
|
|
4
|
+
def initialize(api_client)
|
|
5
|
+
@api_client = HttpClient.wrap(api_client)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
# Lists the Writing Assistant correction types. They apply to all supported languages.
|
|
9
|
+
# For more info: https://docs.copyleaks.com/reference/actions/writing-assistant/correction-types
|
|
10
|
+
# @param [String] language_code ISO 639-1 language of the returned texts. Supported: 'en'.
|
|
11
|
+
def get_correction_types(language_code)
|
|
12
|
+
path = "/v1/writing-feedback/correction-types/#{ClientUtils.escape_path(language_code)}"
|
|
13
|
+
ClientUtils.send_request(@api_client, :get, path, 'get_correction_types')
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
# Returns grammar, spelling and sentence corrections for a text.
|
|
17
|
+
# For more info: https://docs.copyleaks.com/reference/actions/writing-assistant/check
|
|
18
|
+
# @param [WritingAssistantSubmissionModel] submission
|
|
19
|
+
def submit_text(authToken, scanId, submission)
|
|
20
|
+
ClientUtils.send_authorized(@api_client, :post, '/v1/writing-feedback/%s/check', 'submit_writing_assistant',
|
|
21
|
+
authToken, ids: { 'scanId' => scanId },
|
|
22
|
+
model: [submission, WritingAssistantSubmissionModel,
|
|
23
|
+
'submission is invalid, must be an instance of WritingAssistantSubmissionModel'])
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
data/lib/copyleaks.rb
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
require_relative './copyleaks/version.rb'
|
|
2
|
+
require_relative './copyleaks/app.config.rb'
|
|
3
|
+
require_relative './copyleaks/utils/status-code.utils.rb'
|
|
4
|
+
require_relative './copyleaks/utils/http_client.rb'
|
|
5
|
+
require_relative './copyleaks/utils/multipart.rb'
|
|
6
|
+
require_relative './copyleaks/utils/copyleaks_client.utils.rb'
|
|
7
|
+
require_relative './copyleaks/models/index.rb'
|
|
8
|
+
require_relative './copyleaks/api.rb'
|
|
9
|
+
|
|
10
|
+
module Copyleaks
|
|
11
|
+
end
|
data/lib/index.rb
ADDED
metadata
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: copyleaks
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 5.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Copyleaks ltd
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-11-01 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: minitest
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '5.0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '5.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: rake
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '12.0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '12.0'
|
|
41
|
+
- !ruby/object:Gem::Dependency
|
|
42
|
+
name: webrick
|
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
|
44
|
+
requirements:
|
|
45
|
+
- - "~>"
|
|
46
|
+
- !ruby/object:Gem::Version
|
|
47
|
+
version: '1.4'
|
|
48
|
+
type: :development
|
|
49
|
+
prerelease: false
|
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
51
|
+
requirements:
|
|
52
|
+
- - "~>"
|
|
53
|
+
- !ruby/object:Gem::Version
|
|
54
|
+
version: '1.4'
|
|
55
|
+
description: 'Copyleaks is the integrity layer for your tech stack that helps organizations
|
|
56
|
+
and individuals understand what''s human-made and original, AI-generated, or manipulated
|
|
57
|
+
across text, image, audio and video. This SDK gives you access to the following
|
|
58
|
+
Copyleaks products: AI Text Detection, AI Image Detection, AI Video Detection, Plagiarism
|
|
59
|
+
Checker (Authenticity scans: file, URL, OCR), Image Plagiarism Detection, Grammar
|
|
60
|
+
Checker, Text Moderation.'
|
|
61
|
+
email:
|
|
62
|
+
- sales@copyleaks.com
|
|
63
|
+
executables: []
|
|
64
|
+
extensions: []
|
|
65
|
+
extra_rdoc_files: []
|
|
66
|
+
files:
|
|
67
|
+
- ".gitignore"
|
|
68
|
+
- CHANGELOG.md
|
|
69
|
+
- Gemfile
|
|
70
|
+
- LICENSE.txt
|
|
71
|
+
- README.md
|
|
72
|
+
- Rakefile
|
|
73
|
+
- bin/console
|
|
74
|
+
- bin/setup
|
|
75
|
+
- lib/copyleaks.rb
|
|
76
|
+
- lib/copyleaks/ai_detection_client.rb
|
|
77
|
+
- lib/copyleaks/ai_image_detection_client.rb
|
|
78
|
+
- lib/copyleaks/ai_video_detection_client.rb
|
|
79
|
+
- lib/copyleaks/api.rb
|
|
80
|
+
- lib/copyleaks/app.config.rb
|
|
81
|
+
- lib/copyleaks/image_plagiarism_client.rb
|
|
82
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionExplainModel.rb
|
|
83
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionMatchModel.rb
|
|
84
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionMatchTextModel.rb
|
|
85
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternMatchModel.rb
|
|
86
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternStatisticsModel.rb
|
|
87
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPatternsModel.rb
|
|
88
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionPositionsModel.rb
|
|
89
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionResponseModel.rb
|
|
90
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionResultModel.rb
|
|
91
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionScannedDocumentModel.rb
|
|
92
|
+
- lib/copyleaks/models/aiDetection/responses/CopyleaksAiTextDetectionSummaryModel.rb
|
|
93
|
+
- lib/copyleaks/models/auth_token.rb
|
|
94
|
+
- lib/copyleaks/models/constants/CopyleaksAiImageDetectionModels.rb
|
|
95
|
+
- lib/copyleaks/models/constants/CopyleaksAiImageMaskTypes.rb
|
|
96
|
+
- lib/copyleaks/models/constants/CopyleaksAiVideoDetectionModels.rb
|
|
97
|
+
- lib/copyleaks/models/constants/CopyleaksAlertCodes.rb
|
|
98
|
+
- lib/copyleaks/models/constants/CopyleaksTextModerationConstants.rb
|
|
99
|
+
- lib/copyleaks/models/constants/CopyleaksTextModerationLanguages.rb
|
|
100
|
+
- lib/copyleaks/models/constants/index.rb
|
|
101
|
+
- lib/copyleaks/models/delete_request_model.rb
|
|
102
|
+
- lib/copyleaks/models/exceptions/auth_expired_exception.rb
|
|
103
|
+
- lib/copyleaks/models/exceptions/command_exception.rb
|
|
104
|
+
- lib/copyleaks/models/exceptions/copyleaks_api_exception.rb
|
|
105
|
+
- lib/copyleaks/models/exceptions/index.rb
|
|
106
|
+
- lib/copyleaks/models/exceptions/rate_limit_exception.rb
|
|
107
|
+
- lib/copyleaks/models/exceptions/under_maintenance_exception.rb
|
|
108
|
+
- lib/copyleaks/models/exports/export_crawled_version.rb
|
|
109
|
+
- lib/copyleaks/models/exports/export_model.rb
|
|
110
|
+
- lib/copyleaks/models/exports/export_pdf_report.rb
|
|
111
|
+
- lib/copyleaks/models/exports/export_results.rb
|
|
112
|
+
- lib/copyleaks/models/exports/export_target.rb
|
|
113
|
+
- lib/copyleaks/models/exports/index.rb
|
|
114
|
+
- lib/copyleaks/models/id_object.rb
|
|
115
|
+
- lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionAsyncRequestModel.rb
|
|
116
|
+
- lib/copyleaks/models/imageDetection/requests/CopyleaksAiImageDetectionRequestModel.rb
|
|
117
|
+
- lib/copyleaks/models/imageDetection/requests/CopyleaksAsyncWebhooksModel.rb
|
|
118
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectedObjectModel.rb
|
|
119
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionImageInfoModel.rb
|
|
120
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResponseModel.rb
|
|
121
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionResultModel.rb
|
|
122
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionScannedDocumentModel.rb
|
|
123
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksAiImageDetectionSummaryModel.rb
|
|
124
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksImageMetadataModel.rb
|
|
125
|
+
- lib/copyleaks/models/imageDetection/responses/CopyleaksImageShapeModel.rb
|
|
126
|
+
- lib/copyleaks/models/imagePlagiarism/requests/CopyleaksImagePlagiarismRequestModel.rb
|
|
127
|
+
- lib/copyleaks/models/imagePlagiarism/responses/CopyleaksImagePlagiarismResponseModel.rb
|
|
128
|
+
- lib/copyleaks/models/index.rb
|
|
129
|
+
- lib/copyleaks/models/start_request_model.rb
|
|
130
|
+
- lib/copyleaks/models/submissions/ai_detection/ai_detection_submission_model.rb
|
|
131
|
+
- lib/copyleaks/models/submissions/ai_detection/natural_language_submission_model.rb
|
|
132
|
+
- lib/copyleaks/models/submissions/file_ocr_submission_model.rb
|
|
133
|
+
- lib/copyleaks/models/submissions/file_submission_model.rb
|
|
134
|
+
- lib/copyleaks/models/submissions/index.rb
|
|
135
|
+
- lib/copyleaks/models/submissions/properties/actions.rb
|
|
136
|
+
- lib/copyleaks/models/submissions/properties/ai_generated_text.rb
|
|
137
|
+
- lib/copyleaks/models/submissions/properties/ai_generated_text_explain.rb
|
|
138
|
+
- lib/copyleaks/models/submissions/properties/ai_source_match.rb
|
|
139
|
+
- lib/copyleaks/models/submissions/properties/assignment.rb
|
|
140
|
+
- lib/copyleaks/models/submissions/properties/author.rb
|
|
141
|
+
- lib/copyleaks/models/submissions/properties/copyleaks_db.rb
|
|
142
|
+
- lib/copyleaks/models/submissions/properties/course.rb
|
|
143
|
+
- lib/copyleaks/models/submissions/properties/cross_languages.rb
|
|
144
|
+
- lib/copyleaks/models/submissions/properties/custom_metadata.rb
|
|
145
|
+
- lib/copyleaks/models/submissions/properties/domains_mode.rb
|
|
146
|
+
- lib/copyleaks/models/submissions/properties/enable_flag.rb
|
|
147
|
+
- lib/copyleaks/models/submissions/properties/exclude.rb
|
|
148
|
+
- lib/copyleaks/models/submissions/properties/exclude_code.rb
|
|
149
|
+
- lib/copyleaks/models/submissions/properties/filter.rb
|
|
150
|
+
- lib/copyleaks/models/submissions/properties/index.rb
|
|
151
|
+
- lib/copyleaks/models/submissions/properties/indexing.rb
|
|
152
|
+
- lib/copyleaks/models/submissions/properties/indexing_repository.rb
|
|
153
|
+
- lib/copyleaks/models/submissions/properties/institution.rb
|
|
154
|
+
- lib/copyleaks/models/submissions/properties/internal_ai_source_match.rb
|
|
155
|
+
- lib/copyleaks/models/submissions/properties/language.rb
|
|
156
|
+
- lib/copyleaks/models/submissions/properties/masking_policy.rb
|
|
157
|
+
- lib/copyleaks/models/submissions/properties/overview.rb
|
|
158
|
+
- lib/copyleaks/models/submissions/properties/pdf_colors.rb
|
|
159
|
+
- lib/copyleaks/models/submissions/properties/pdf_properties.rb
|
|
160
|
+
- lib/copyleaks/models/submissions/properties/pdf_report_version.rb
|
|
161
|
+
- lib/copyleaks/models/submissions/properties/pdf_version.rb
|
|
162
|
+
- lib/copyleaks/models/submissions/properties/references.rb
|
|
163
|
+
- lib/copyleaks/models/submissions/properties/repository.rb
|
|
164
|
+
- lib/copyleaks/models/submissions/properties/scan_method_algorithm.rb
|
|
165
|
+
- lib/copyleaks/models/submissions/properties/scanning.rb
|
|
166
|
+
- lib/copyleaks/models/submissions/properties/scanning_exclude.rb
|
|
167
|
+
- lib/copyleaks/models/submissions/properties/scanning_include.rb
|
|
168
|
+
- lib/copyleaks/models/submissions/properties/scanning_repository.rb
|
|
169
|
+
- lib/copyleaks/models/submissions/properties/sensitive_data_protection.rb
|
|
170
|
+
- lib/copyleaks/models/submissions/properties/submission_properties.rb
|
|
171
|
+
- lib/copyleaks/models/submissions/properties/webhooks.rb
|
|
172
|
+
- lib/copyleaks/models/submissions/properties/writing_feedback.rb
|
|
173
|
+
- lib/copyleaks/models/submissions/submission_model.rb
|
|
174
|
+
- lib/copyleaks/models/submissions/url_submission_model.rb
|
|
175
|
+
- lib/copyleaks/models/submissions/webhooks/CompletedWebhook.rb
|
|
176
|
+
- lib/copyleaks/models/submissions/webhooks/CreditsCheckedWebhook.rb
|
|
177
|
+
- lib/copyleaks/models/submissions/webhooks/ErrorWebhook.rb
|
|
178
|
+
- lib/copyleaks/models/submissions/webhooks/ExportCompletedWebhook.rb
|
|
179
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/Metadata.rb
|
|
180
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/StatusWebhook.rb
|
|
181
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/BaseModels/Webhook.rb
|
|
182
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Notifications.rb
|
|
183
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/Results.rb
|
|
184
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/CompletedModels/ScannedDocument.rb
|
|
185
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ErrorModels/Error.rb
|
|
186
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ExportModels/Task.rb
|
|
187
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultScore.rb
|
|
188
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsInternet.rb
|
|
189
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/NewResultsModels/NewResultsRepositories.rb
|
|
190
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/NotificationsModels/Alerts.rb
|
|
191
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Batch.rb
|
|
192
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Database.rb
|
|
193
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Internet.rb
|
|
194
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Repositories.rb
|
|
195
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/RepositoryMetadata.rb
|
|
196
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Score.rb
|
|
197
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/SharedResultsModel.rb
|
|
198
|
+
- lib/copyleaks/models/submissions/webhooks/HelperModels/ResultsModels/Tags.rb
|
|
199
|
+
- lib/copyleaks/models/submissions/webhooks/IndexedWebhook.rb
|
|
200
|
+
- lib/copyleaks/models/submissions/webhooks/NewResultWebhook.rb
|
|
201
|
+
- lib/copyleaks/models/submissions/webhooks/index.rb
|
|
202
|
+
- lib/copyleaks/models/submissions/writing_assistant/score_weights.rb
|
|
203
|
+
- lib/copyleaks/models/submissions/writing_assistant/writing_assistant_submission_model.rb
|
|
204
|
+
- lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationLabel.rb
|
|
205
|
+
- lib/copyleaks/models/textModeration/requests/CopyleaksTextModerationRequestModel.rb
|
|
206
|
+
- lib/copyleaks/models/textModeration/responses/CopyleaksTextModerationResponseModel.rb
|
|
207
|
+
- lib/copyleaks/models/textModeration/responses/submodules/ModerationsModel.rb
|
|
208
|
+
- lib/copyleaks/models/textModeration/responses/submodules/Text.rb
|
|
209
|
+
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationChars.rb
|
|
210
|
+
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationScannedDocument.rb
|
|
211
|
+
- lib/copyleaks/models/textModeration/responses/submodules/TextModerationsLegend.rb
|
|
212
|
+
- lib/copyleaks/models/videoDetection/requests/CopyleaksAiVideoDetectionRequestModel.rb
|
|
213
|
+
- lib/copyleaks/models/videoDetection/responses/CopyleaksAiVideoDetectionResponseModel.rb
|
|
214
|
+
- lib/copyleaks/text_moderation_client.rb
|
|
215
|
+
- lib/copyleaks/utils/copyleaks_client.utils.rb
|
|
216
|
+
- lib/copyleaks/utils/http_client.rb
|
|
217
|
+
- lib/copyleaks/utils/multipart.rb
|
|
218
|
+
- lib/copyleaks/utils/status-code.utils.rb
|
|
219
|
+
- lib/copyleaks/version.rb
|
|
220
|
+
- lib/copyleaks/writing_assistant_client.rb
|
|
221
|
+
- lib/index.rb
|
|
222
|
+
homepage: https://api.copyleaks.com
|
|
223
|
+
licenses:
|
|
224
|
+
- MIT
|
|
225
|
+
metadata:
|
|
226
|
+
homepage_uri: https://api.copyleaks.com
|
|
227
|
+
source_code_uri: https://github.com/Copyleaks/Ruby-Plagiarism-Checker
|
|
228
|
+
changelog_uri: https://github.com/Copyleaks/Ruby-Plagiarism-Checker/blob/master/CHANGELOG.md
|
|
229
|
+
post_install_message:
|
|
230
|
+
rdoc_options: []
|
|
231
|
+
require_paths:
|
|
232
|
+
- lib
|
|
233
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
234
|
+
requirements:
|
|
235
|
+
- - ">="
|
|
236
|
+
- !ruby/object:Gem::Version
|
|
237
|
+
version: '0'
|
|
238
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
239
|
+
requirements:
|
|
240
|
+
- - ">="
|
|
241
|
+
- !ruby/object:Gem::Version
|
|
242
|
+
version: '0'
|
|
243
|
+
requirements: []
|
|
244
|
+
rubygems_version: 3.0.3.1
|
|
245
|
+
signing_key:
|
|
246
|
+
specification_version: 4
|
|
247
|
+
summary: The official Copyleaks Ruby library.
|
|
248
|
+
test_files: []
|