calmlens 0.18.3 → 0.19.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 +4 -4
- data/README.md +3 -1
- data/lib/calmlens/assets.rb +137 -38
- data/lib/calmlens/cdn.rb +14 -7
- data/lib/calmlens/error_codes.rb +28 -2
- data/lib/calmlens/events.rb +5 -2
- data/lib/calmlens/folders.rb +9 -6
- data/lib/calmlens/hash_lists.rb +11 -8
- data/lib/calmlens/lenses.rb +5 -2
- data/lib/calmlens/option_keys.rb +66 -0
- data/lib/calmlens/policies.rb +100 -0
- data/lib/calmlens/resource.rb +26 -1
- data/lib/calmlens/server_client.rb +23 -6
- data/lib/calmlens/session.rb +6 -3
- data/lib/calmlens/testing/classification.rb +3 -0
- data/lib/calmlens/testing/fake_api.rb +138 -12
- data/lib/calmlens/testing/test_image_grid.rb +161 -0
- data/lib/calmlens/testing/test_input_scenario.rb +127 -0
- data/lib/calmlens/testing/test_inputs.rb +156 -0
- data/lib/calmlens/testing.rb +6 -1
- data/lib/calmlens/text.rb +5 -4
- data/lib/calmlens/transforms.rb +22 -29
- data/lib/calmlens/upload_body.rb +14 -0
- data/lib/calmlens/upload_tokens.rb +4 -1
- data/lib/calmlens/version.rb +1 -1
- data/lib/calmlens.rb +2 -0
- data/sig/calmlens.rbs +57 -2
- data/sig/error_codes.rbs +14 -1
- data/sig/types.rbs +102 -20
- metadata +7 -2
data/sig/calmlens.rbs
CHANGED
|
@@ -109,10 +109,14 @@ module CalmLens
|
|
|
109
109
|
RETRY_MAX_DELAY: Integer
|
|
110
110
|
RETRY_AFTER_MAX: Integer
|
|
111
111
|
DEFAULT_MAX_RESPONSE_BYTES: Integer
|
|
112
|
+
DEFAULT_PART_SIZE_BYTES: Integer
|
|
113
|
+
MIN_PART_SIZE_BYTES: Integer
|
|
114
|
+
MAX_PART_SIZE_BYTES: Integer
|
|
112
115
|
ENSURE_LENSES_MAX_PER_REQUEST: Integer
|
|
113
116
|
attr_reader assets: Assets
|
|
114
117
|
attr_reader folders: Folders
|
|
115
118
|
attr_reader hash_lists: HashLists
|
|
119
|
+
attr_reader policies: Policies
|
|
116
120
|
attr_reader text: Text
|
|
117
121
|
attr_reader upload_tokens: UploadTokens
|
|
118
122
|
attr_reader events: Events
|
|
@@ -122,7 +126,7 @@ module CalmLens
|
|
|
122
126
|
attr_reader cdn_base_url: String
|
|
123
127
|
def initialize: (api_key: String, project_id: String, ?base_url: String, ?cdn_base_url: String, ?timeout: number,
|
|
124
128
|
?open_timeout: number, ?upload_timeout: number?, ?max_retries: Integer, ?retry_base_delay: number,
|
|
125
|
-
?max_response_bytes: Integer, ?transport: Transport::_Transport?) -> void
|
|
129
|
+
?max_response_bytes: Integer, ?part_size_bytes: Integer, ?transport: Transport::_Transport?) -> void
|
|
126
130
|
def close: () -> nil
|
|
127
131
|
def ensure_lenses: (ensure_lenses_options options) -> Array[lens]
|
|
128
132
|
def ensure_lens: (ensure_lens_options options) -> lens
|
|
@@ -200,6 +204,17 @@ module CalmLens
|
|
|
200
204
|
def remove_entry: (hash_list_entry_id_options options) -> nil
|
|
201
205
|
end
|
|
202
206
|
|
|
207
|
+
class Policies < Resource
|
|
208
|
+
def list: (?list_policies_options options) -> policy_list
|
|
209
|
+
def retrieve: (policy_id_options options) -> policy
|
|
210
|
+
def create: (create_policy_options options) -> policy
|
|
211
|
+
def update: (update_policy_options options) -> policy
|
|
212
|
+
def apply_preset: (apply_policy_preset_options options) -> policy
|
|
213
|
+
def set_automatic_updates: (set_policy_automatic_updates_options options) -> policy
|
|
214
|
+
def delete: (policy_id_options options) -> nil
|
|
215
|
+
def assign: (assign_policy_options options) -> policy
|
|
216
|
+
end
|
|
217
|
+
|
|
203
218
|
class UploadTokens < Resource
|
|
204
219
|
TOKEN_PREFIX: String
|
|
205
220
|
SIGNING_CONTEXT: String
|
|
@@ -338,7 +353,7 @@ module CalmLens
|
|
|
338
353
|
def initialize: (?project_id: String, ?api_key: String, ?base_url: String, ?cdn_base_url: String, ?now: _Clock, ?create_id: _IdFactory,
|
|
339
354
|
?moderate: _Moderate?, ?timeout: number,
|
|
340
355
|
?open_timeout: number, ?upload_timeout: number?, ?max_retries: Integer, ?retry_base_delay: number,
|
|
341
|
-
?max_response_bytes: Integer) -> void
|
|
356
|
+
?max_response_bytes: Integer, ?part_size_bytes: Integer) -> void
|
|
342
357
|
# Replaces the mock API key's grants for later requests; the key stays the same.
|
|
343
358
|
def api_key_grants=: (Array[Hash[Symbol | String, untyped]] grants) -> Array[Hash[Symbol | String, untyped]]
|
|
344
359
|
# Fails the next request (or the next one `operation` sends) with `transport-error`, `timeout`, an
|
|
@@ -398,5 +413,45 @@ module CalmLens
|
|
|
398
413
|
module MockClassification
|
|
399
414
|
CATEGORIES: Array[String]
|
|
400
415
|
QUALIFIERS: Hash[String, Array[String]]
|
|
416
|
+
# Qualifiers the input type sets, which a TestInputs scenario cannot list.
|
|
417
|
+
INPUT_QUALIFIERS: Array[String]
|
|
418
|
+
end
|
|
419
|
+
|
|
420
|
+
# Signed test inputs: text codes, test images and media phrases signed with a project's secret
|
|
421
|
+
# test input key from the portal.
|
|
422
|
+
module TestInputs
|
|
423
|
+
type action = "allow" | "limit" | "age-restrict" | "block"
|
|
424
|
+
type region = "DE" | "AT" | "FR" | "GB" | "EU" | "AU" | "BR"
|
|
425
|
+
type regional_action = { "region" => region, "action" => "limit" | "age-restrict" | "block" }
|
|
426
|
+
# One qualifying instance; set an action on every instance or on none.
|
|
427
|
+
type test_instance = { "category" => classification_category, ?"score" => number, ?"action" => action, "qualifiers" => Array[String] }
|
|
428
|
+
# A scenario with String keys; Symbol and snake_case keys are accepted as a plain Hash.
|
|
429
|
+
type scenario = { ?"regionalActions" => Array[regional_action], ?"unassessedCategories" => Array[classification_category],
|
|
430
|
+
"instances" => Array[test_instance] }
|
|
431
|
+
type signal = classification_category | "sexual.involving-minors" | "harassment.insult" | "sexual.adult"
|
|
432
|
+
| "hate.regional-symbol" | "violence.graphic"
|
|
433
|
+
type media_signal = classification_category | "violence.graphic"
|
|
434
|
+
type input = scenario | Hash[String | Symbol, untyped] | signal
|
|
435
|
+
|
|
436
|
+
# A painted test image: width by height pixels of 8-bit RGBA in the binary String `rgba`, and
|
|
437
|
+
# the same image as binary PNG bytes in `png`.
|
|
438
|
+
class Image < Struct[untyped]
|
|
439
|
+
attr_accessor width: Integer
|
|
440
|
+
attr_accessor height: Integer
|
|
441
|
+
attr_accessor rgba: String
|
|
442
|
+
attr_accessor png: String
|
|
443
|
+
def initialize: (width: Integer, height: Integer, rgba: String, png: String) -> void
|
|
444
|
+
end
|
|
445
|
+
|
|
446
|
+
REGIONS: Array[region]
|
|
447
|
+
SIGNALS: Array[signal]
|
|
448
|
+
MEDIA_SIGNALS: Array[media_signal]
|
|
449
|
+
# clean, limited, adult_image, adult_text, regional_delivery, germany and mixed (deeply frozen).
|
|
450
|
+
PRESETS: Hash[Symbol, scenario]
|
|
451
|
+
|
|
452
|
+
def self.for_signal: (signal signal, ?("text" | "image") kind) -> scenario
|
|
453
|
+
def self.generate_text_code: (input input, String test_input_key) -> String
|
|
454
|
+
def self.paint_image: (input input, String test_input_key) -> Image
|
|
455
|
+
def self.generate_media_code: (media_signal signal, String test_input_key) -> String
|
|
401
456
|
end
|
|
402
457
|
end
|
data/sig/error_codes.rbs
CHANGED
|
@@ -7,6 +7,8 @@ module CalmLens
|
|
|
7
7
|
INVALID_VIEWER_REGION: String
|
|
8
8
|
VIEWER_REGION_REQUIRED: String
|
|
9
9
|
REGIONAL_EVIDENCE_REQUIRED: String
|
|
10
|
+
SIGNED_URL_EXPIRED: String
|
|
11
|
+
SIGNED_URL_INVALID: String
|
|
10
12
|
INVALID_TYPE: String
|
|
11
13
|
TOO_SMALL: String
|
|
12
14
|
TOO_BIG: String
|
|
@@ -34,9 +36,11 @@ module CalmLens
|
|
|
34
36
|
API_KEY_NOT_ACCEPTED: String
|
|
35
37
|
PERMISSION_DENIED: String
|
|
36
38
|
FILE_TOO_LARGE: String
|
|
37
|
-
MULTIPART_IMAGE_TOO_SMALL: String
|
|
38
39
|
MULTIPART_IMAGE_TOO_LARGE: String
|
|
39
40
|
IMAGE_EXCEEDED_MAX_DIMENSIONS: String
|
|
41
|
+
IMAGE_INVALID_INPUT: String
|
|
42
|
+
IMAGE_UNSUPPORTED_FORMAT: String
|
|
43
|
+
IMAGE_INPUT_LIMIT: String
|
|
40
44
|
UPLOAD_LIMIT_EXCEEDED: String
|
|
41
45
|
SPEND_LIMIT_REACHED: String
|
|
42
46
|
INVALID_UPLOAD_MIME_TYPE: String
|
|
@@ -77,6 +81,15 @@ module CalmLens
|
|
|
77
81
|
HASH_LIST_LIMIT_REACHED: String
|
|
78
82
|
HASH_LIST_ENTRY_LIMIT_REACHED: String
|
|
79
83
|
HASH_LIST_ASSET_NOT_HASHED: String
|
|
84
|
+
POLICY_NOT_FOUND: String
|
|
85
|
+
POLICY_REVISION_CONFLICT: String
|
|
86
|
+
POLICY_PROJECTS_CHANGED: String
|
|
87
|
+
POLICY_IN_USE: String
|
|
88
|
+
POLICY_USED_BY_ANOTHER_PROJECT: String
|
|
89
|
+
POLICY_NO_PRESET: String
|
|
90
|
+
POLICY_PRESET_VERSION_CONFLICT: String
|
|
91
|
+
POLICY_PRESET_UPDATE_UNAVAILABLE: String
|
|
92
|
+
POLICY_AUTOMATIC_UPDATES_UNAVAILABLE: String
|
|
80
93
|
UPLOAD_PRESET_NOT_FOUND: String
|
|
81
94
|
UPLOAD_PRESET_DISABLED: String
|
|
82
95
|
UPLOAD_PRESET_TOKEN_REQUIRED: String
|
data/sig/types.rbs
CHANGED
|
@@ -60,8 +60,8 @@ module CalmLens
|
|
|
60
60
|
# Earlier posts to send, oldest first; only the posts CalmLens uses are sent.
|
|
61
61
|
type moderation_context_input = { items: Array[moderation_context_item_input] }
|
|
62
62
|
|
|
63
|
-
# ProcessingFeatures.ts: optional analyses to run, keyed by feature.
|
|
64
|
-
# `enabled` is true.
|
|
63
|
+
# ProcessingFeatures.ts: optional analyses to run, keyed by feature. Link detection runs unless
|
|
64
|
+
# `enabled` is false; every other feature is off unless `enabled` is true.
|
|
65
65
|
type processing_features_input = {
|
|
66
66
|
?ocr: { enabled: bool }?,
|
|
67
67
|
?person_detection: { enabled: bool }?,
|
|
@@ -308,21 +308,25 @@ module CalmLens
|
|
|
308
308
|
# Link safety (preview, LinkSafety.ts).
|
|
309
309
|
# What a link's destination is: `safe` when every reputation check passed, `adult` or `gambling`
|
|
310
310
|
# from its domain's content categories, `phishing` or `malware` from a threat list or the domain's
|
|
311
|
-
# security risks, and `unresolved` when a short link could not be followed or a
|
|
311
|
+
# security risks, and `unresolved` when a short link or redirect chain could not be followed or a
|
|
312
|
+
# check failed. Every address on a link's way is checked, and the most severe verdict is the
|
|
313
|
+
# link's.
|
|
312
314
|
type link_safety_verdict = "safe" | "adult" | "gambling" | "phishing" | "malware" | "unresolved"
|
|
313
315
|
# The verdicts a policy can act on.
|
|
314
316
|
type flagged_link_verdict = "phishing" | "malware" | "adult" | "gambling" | "unresolved"
|
|
315
317
|
# What a link does to its asset, weakest first. Purging content over a link is never offered.
|
|
316
318
|
type link_safety_action = "allow" | "limit" | "age-restrict" | "block"
|
|
317
|
-
# One reputation check of a link
|
|
318
|
-
# of
|
|
319
|
+
# One reputation check of a link, every address it redirects through and its destination: their
|
|
320
|
+
# domain categories, or a threat-list lookup of their URLs. `failed` makes the link `unresolved`;
|
|
321
|
+
# `labels` is what the check reported for any of the addresses.
|
|
319
322
|
type link_safety_evidence = {
|
|
320
323
|
"check" => "domain-categories" | "threat-lists",
|
|
321
324
|
"status" => "checked" | "failed",
|
|
322
325
|
"labels" => Array[String]
|
|
323
326
|
}
|
|
324
327
|
# A link in the asset and what its destination is. `finalUrl` is where it leads after `redirects`
|
|
325
|
-
# redirects, or `null` when a short link could not be
|
|
328
|
+
# redirects, or `null` when a short link or redirect chain could not be
|
|
329
|
+
# followed.
|
|
326
330
|
type checked_link = {
|
|
327
331
|
"url" => String,
|
|
328
332
|
"finalUrl" => String?,
|
|
@@ -450,7 +454,8 @@ module CalmLens
|
|
|
450
454
|
?blur: number,
|
|
451
455
|
?redact: {
|
|
452
456
|
?text: bool,
|
|
453
|
-
?personalInformation: bool
|
|
457
|
+
?personalInformation: bool,
|
|
458
|
+
?faces: bool
|
|
454
459
|
},
|
|
455
460
|
?border: {
|
|
456
461
|
?color: String,
|
|
@@ -496,7 +501,8 @@ module CalmLens
|
|
|
496
501
|
?"blur" => number,
|
|
497
502
|
?"redact" => {
|
|
498
503
|
?"text" => bool,
|
|
499
|
-
?"personalInformation" => bool
|
|
504
|
+
?"personalInformation" => bool,
|
|
505
|
+
?"faces" => bool
|
|
500
506
|
},
|
|
501
507
|
?"border" => {
|
|
502
508
|
?"color" => String,
|
|
@@ -533,12 +539,9 @@ module CalmLens
|
|
|
533
539
|
}
|
|
534
540
|
# </generated: image-transform-options>
|
|
535
541
|
|
|
536
|
-
#
|
|
537
|
-
|
|
538
|
-
type
|
|
539
|
-
# A selector String with one step per path segment, such as `fit=cover,width=1024/blur=12`, or
|
|
540
|
-
# structured steps, which the SDK serializes into a selector.
|
|
541
|
-
type transform_input = String | transform_step_input | Array[transform_step_input]
|
|
542
|
+
# Transform options applied in one pass: a selector String such as `width=1024,fit=cover`, or
|
|
543
|
+
# structured options, which the SDK serializes into a selector.
|
|
544
|
+
type transform_input = String | image_transform_options_input
|
|
542
545
|
|
|
543
546
|
type lens_type = "image" | "video" | "audio" | "document" | "website"
|
|
544
547
|
# ENSURE_LENS_BODY_SCHEMA. Changing a saved lens needs a greater `version` (default 1).
|
|
@@ -549,7 +552,7 @@ module CalmLens
|
|
|
549
552
|
active: bool,
|
|
550
553
|
?description: String?,
|
|
551
554
|
?version: Integer,
|
|
552
|
-
?
|
|
555
|
+
?transform: image_transform_options_input?
|
|
553
556
|
}
|
|
554
557
|
type lens = {
|
|
555
558
|
"id" => String,
|
|
@@ -560,7 +563,7 @@ module CalmLens
|
|
|
560
563
|
?"description" => String?,
|
|
561
564
|
"type" => lens_type,
|
|
562
565
|
"active" => bool,
|
|
563
|
-
?"
|
|
566
|
+
?"transform" => image_transform_options?,
|
|
564
567
|
"createdAt" => Integer,
|
|
565
568
|
?"updatedAt" => Integer
|
|
566
569
|
}
|
|
@@ -619,6 +622,47 @@ module CalmLens
|
|
|
619
622
|
"ordering" => Array[order]
|
|
620
623
|
}
|
|
621
624
|
|
|
625
|
+
# ---- Policies (Policy.ts) ---------------------------------------------------------------------
|
|
626
|
+
|
|
627
|
+
type policy_preset_id = "general-community" | "children-platform" | "education-support" | "wholesome-community"
|
|
628
|
+
# What a policy does with one category: `action` when its policy score reaches 0.5 (default
|
|
629
|
+
# `block`), allowances that let covered content through or act on it more softly, and
|
|
630
|
+
# restrictions, which outweigh allowances.
|
|
631
|
+
type category_policy_settings = {
|
|
632
|
+
?"action" => flagged_content_action,
|
|
633
|
+
?"allowances" => Array[policy_rule_snapshot],
|
|
634
|
+
?"restrictions" => Array[policy_rule_snapshot]
|
|
635
|
+
}
|
|
636
|
+
# Settings by category (`sexual`, `violence`, ...), and optionally link safety.
|
|
637
|
+
type policy_settings = {
|
|
638
|
+
"categorySettings" => Hash[String, category_policy_settings],
|
|
639
|
+
?"linkSafety" => link_safety_settings
|
|
640
|
+
}
|
|
641
|
+
# Where a policy started from a built-in preset. `version` is the release it is pinned to,
|
|
642
|
+
# `latestVersion` the newest; `projectId` is the project whose preset policy it is, or nil for a copy.
|
|
643
|
+
type policy_preset_origin = {
|
|
644
|
+
"id" => policy_preset_id,
|
|
645
|
+
"version" => Integer,
|
|
646
|
+
"latestVersion" => Integer,
|
|
647
|
+
"projectId" => String?
|
|
648
|
+
}
|
|
649
|
+
# A moderation policy. Policies belong to the project's organisation and its projects share them.
|
|
650
|
+
# Send `revision` with each change; a policy changed since is refused with `policy/revision-conflict`.
|
|
651
|
+
type policy = {
|
|
652
|
+
"id" => String,
|
|
653
|
+
"name" => String,
|
|
654
|
+
"description" => String,
|
|
655
|
+
"settings" => policy_settings,
|
|
656
|
+
"revision" => Integer,
|
|
657
|
+
"automaticUpdates" => bool,
|
|
658
|
+
"preset" => policy_preset_origin?,
|
|
659
|
+
"projectIds" => Array[String],
|
|
660
|
+
"createdAt" => Integer,
|
|
661
|
+
"updatedAt" => Integer
|
|
662
|
+
}
|
|
663
|
+
# Every policy of the project's organisation, oldest first, and the one the project moderates with.
|
|
664
|
+
type policy_list = { "policies" => Array[policy], "projectPolicyId" => String }
|
|
665
|
+
|
|
622
666
|
# ---- Events and webhooks (Event.ts, EventCatalog.ts, WebhookPayload.ts) ----------------------
|
|
623
667
|
|
|
624
668
|
# EVENT_TYPES in EventCatalog.ts. Ignore types your code does not handle. Webhook, Slack and email
|
|
@@ -661,7 +705,14 @@ module CalmLens
|
|
|
661
705
|
"createdAt" => Integer
|
|
662
706
|
}
|
|
663
707
|
# Unlike other lists, `nextCursor` is never nil: keep it to receive later events.
|
|
664
|
-
|
|
708
|
+
# `excludedTypes` are the event types the feed never includes, because the API key lacks the permission
|
|
709
|
+
# to see them.
|
|
710
|
+
type events_page = {
|
|
711
|
+
"items" => Array[event],
|
|
712
|
+
"nextCursor" => String,
|
|
713
|
+
"hasMore" => bool,
|
|
714
|
+
"excludedTypes" => Array[event_type]
|
|
715
|
+
}
|
|
665
716
|
|
|
666
717
|
# ---- Method options -------------------------------------------------------------------------
|
|
667
718
|
|
|
@@ -720,7 +771,7 @@ module CalmLens
|
|
|
720
771
|
# Defaults to `rendered` on the server; `original` takes no lens or transform.
|
|
721
772
|
?resource: "original" | "rendered",
|
|
722
773
|
?expires_in_seconds: Integer,
|
|
723
|
-
#
|
|
774
|
+
# Transform options replace the lens's options of the same name.
|
|
724
775
|
?lens: String,
|
|
725
776
|
?transform: transform_input,
|
|
726
777
|
?request_options: request_options
|
|
@@ -859,6 +910,37 @@ module CalmLens
|
|
|
859
910
|
?request_options: request_options }
|
|
860
911
|
type hash_list_entry_id_options = { entry_id: String, ?request_options: request_options }
|
|
861
912
|
|
|
913
|
+
# Policy settings as options: snake_case Symbol keys, or a policy's `settings` as the API returned it.
|
|
914
|
+
type policy_rule_input = { when: Array[String], action: flagged_content_action, ?name: String, ?match: "all", ?unless: Array[String] }
|
|
915
|
+
type category_policy_settings_input = {
|
|
916
|
+
?action: flagged_content_action,
|
|
917
|
+
?allowances: Array[policy_rule_input],
|
|
918
|
+
?restrictions: Array[policy_rule_input]
|
|
919
|
+
}
|
|
920
|
+
type link_safety_settings_input = {
|
|
921
|
+
verdict_actions: Hash[String | Symbol, link_safety_action],
|
|
922
|
+
?off_platform_links: { action: "limit" | "age-restrict" | "block", allowed_domains: Array[String] }
|
|
923
|
+
}
|
|
924
|
+
type policy_settings_input = policy_settings | {
|
|
925
|
+
category_settings: Hash[String | Symbol, category_policy_settings_input],
|
|
926
|
+
?link_safety: link_safety_settings_input
|
|
927
|
+
}
|
|
928
|
+
type list_policies_options = { ?request_options: request_options }
|
|
929
|
+
type policy_id_options = { policy_id: String, ?request_options: request_options }
|
|
930
|
+
# Send `settings` (defining every category) with a `name`, or `preset_id` to copy the latest
|
|
931
|
+
# release of a built-in preset, named after it unless you give a `name`.
|
|
932
|
+
type create_policy_options = { ?name: String, ?description: String, ?settings: policy_settings_input,
|
|
933
|
+
?preset_id: policy_preset_id, ?request_options: request_options }
|
|
934
|
+
type update_policy_options = { policy_id: String, revision: Integer, ?name: String, ?description: String,
|
|
935
|
+
?settings: policy_settings_input, ?request_options: request_options }
|
|
936
|
+
# `reset` restores the pinned preset version (send `preset.version`); `update` moves an unchanged
|
|
937
|
+
# copy to the latest release (send `preset.latestVersion`).
|
|
938
|
+
type apply_policy_preset_options = { policy_id: String, operation: "reset" | "update", revision: Integer,
|
|
939
|
+
preset_version: Integer, ?request_options: request_options }
|
|
940
|
+
type set_policy_automatic_updates_options = { policy_id: String, enabled: bool, revision: Integer,
|
|
941
|
+
preset_version: Integer, ?request_options: request_options }
|
|
942
|
+
type assign_policy_options = { policy_id: String, ?request_options: request_options }
|
|
943
|
+
|
|
862
944
|
# `page_size` is 1 to 100, default 50.
|
|
863
945
|
type list_events_options = { ?cursor: String, ?page_size: Integer, ?request_options: request_options }
|
|
864
946
|
|
|
@@ -870,7 +952,7 @@ module CalmLens
|
|
|
870
952
|
active: bool,
|
|
871
953
|
?description: String?,
|
|
872
954
|
?version: Integer,
|
|
873
|
-
?
|
|
955
|
+
?transform: image_transform_options_input?,
|
|
874
956
|
?request_options: request_options
|
|
875
957
|
}
|
|
876
958
|
|
|
@@ -881,7 +963,7 @@ module CalmLens
|
|
|
881
963
|
# `rendered` is the default. `original` takes no lens or transform; `placeholder` is a small blurred PNG
|
|
882
964
|
# that takes no lens or transform.
|
|
883
965
|
?resource: "original" | "rendered" | "placeholder",
|
|
884
|
-
#
|
|
966
|
+
# Transform options replace the lens's options of the same name.
|
|
885
967
|
?lens: String,
|
|
886
968
|
?transform: transform_input,
|
|
887
969
|
# Appends `?ageConfirmed=true`, so a public `age-restricted` asset is served from this URL. Set it
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: calmlens
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.19.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- CalmLens
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: 'Server-side client for the CalmLens API: moderation, uploads, events,
|
|
14
14
|
webhooks and CDN delivery.'
|
|
@@ -30,6 +30,8 @@ files:
|
|
|
30
30
|
- lib/calmlens/internal.rb
|
|
31
31
|
- lib/calmlens/lenses.rb
|
|
32
32
|
- lib/calmlens/moderation_context.rb
|
|
33
|
+
- lib/calmlens/option_keys.rb
|
|
34
|
+
- lib/calmlens/policies.rb
|
|
33
35
|
- lib/calmlens/resource.rb
|
|
34
36
|
- lib/calmlens/response.rb
|
|
35
37
|
- lib/calmlens/server_client.rb
|
|
@@ -39,6 +41,9 @@ files:
|
|
|
39
41
|
- lib/calmlens/testing/fake_api.rb
|
|
40
42
|
- lib/calmlens/testing/mock_decision.rb
|
|
41
43
|
- lib/calmlens/testing/placeholder.rb
|
|
44
|
+
- lib/calmlens/testing/test_image_grid.rb
|
|
45
|
+
- lib/calmlens/testing/test_input_scenario.rb
|
|
46
|
+
- lib/calmlens/testing/test_inputs.rb
|
|
42
47
|
- lib/calmlens/text.rb
|
|
43
48
|
- lib/calmlens/transforms.rb
|
|
44
49
|
- lib/calmlens/transport.rb
|