From 242335981869d35056896696a7453fcd2bc318ab Mon Sep 17 00:00:00 2001 From: chrisdengso <8185683+chrisdengso@users.noreply.github.com> Date: Thu, 12 Nov 2026 18:55:30 +0000 Subject: [PATCH] feat: v5.4.0, API changes --- .speakeasy/gen.lock | 98 ++++-- .speakeasy/gen.yaml | 2 +- .speakeasy/openapi.json | 326 +++++++++++++----- CHANGELOG.md | 11 + README.md | 10 +- .../operations/delete-wordlist-request.md | 18 + .../operations/delete-wordlist-response.md | 25 ++ .../operations/resolve-queue-item-request.md | 10 +- .../resolve-queue-items-request-body.md | 6 +- .../resolve-queue-items-response.md | 8 +- docs/models/operations/sort.md | 2 +- docs/models/operations/unicode-spoofing.md | 12 +- .../unresolve-queue-item-request.md | 10 +- docs/models/queue-item.md | 28 +- docs/sdks/actions/README.md | 10 +- docs/sdks/content/README.md | 2 +- docs/sdks/items/README.md | 40 +-- docs/sdks/wordlist/README.md | 74 ++++ jsr.json | 2 +- package.json | 2 +- src/funcs/actions-create.ts | 2 +- src/funcs/actions-execute.ts | 2 +- src/funcs/actions-list.ts | 2 +- src/funcs/actions-retrieve.ts | 2 +- src/funcs/actions-update.ts | 2 +- src/funcs/content-submit.ts | 3 + src/funcs/queue-items-list.ts | 2 +- src/funcs/queue-items-resolve-many.ts | 2 +- src/funcs/queue-items-resolve.ts | 2 +- src/funcs/queue-items-unresolve.ts | 2 +- src/funcs/wordlist-delete.ts | 197 +++++++++++ src/lib/config.ts | 4 +- src/models/operations/delete-wordlist.ts | 81 +++++ src/models/operations/index.ts | 1 + src/models/operations/list-queue-items.ts | 1 + src/models/operations/resolve-queue-item.ts | 2 +- src/models/operations/resolve-queue-items.ts | 4 +- src/models/operations/submit-content.ts | 2 +- src/models/operations/unresolve-queue-item.ts | 2 +- src/models/queue-item.ts | 4 +- src/sdk/actions.ts | 10 +- src/sdk/content.ts | 3 + src/sdk/items.ts | 8 +- src/sdk/wordlist.ts | 20 ++ 44 files changed, 843 insertions(+), 213 deletions(-) create mode 100644 docs/models/operations/delete-wordlist-request.md create mode 100644 docs/models/operations/delete-wordlist-response.md create mode 100644 src/funcs/wordlist-delete.ts create mode 100644 src/models/operations/delete-wordlist.ts diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 49cb0eb..cd76a3d 100644 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -1,12 +1,12 @@ lockVersion: 2.0.0 id: 2331670b-5789-4489-85ed-fb316d2d6d7e management: - docChecksum: d6bce8a263f0ec11d54bdf026957ba2f + docChecksum: d1c7a760d4c00f34fad01646ab23b9eb docVersion: 1.1.0 speakeasyVersion: internal generationVersion: internal - releaseVersion: 5.3.0 - configChecksum: 4db92c10204c0001d42fcc5e63b9d1e6 + releaseVersion: 5.4.0 + configChecksum: 6f4100834c807476f2270412b950122c repoURL: https://github.com/moderation-api/sdk-typescript installationURL: https://github.com/moderation-api/sdk-typescript published: true @@ -259,6 +259,10 @@ trackedFiles: last_write_checksum: sha1:fee7a3d1a2289bf9ab340685711b8ea0a3b20cc8 docs/models/operations/delete-webhook-response.md: last_write_checksum: sha1:3f8bc3d81daac532d4f63bb291139ab5c10c8f89 + docs/models/operations/delete-wordlist-request.md: + last_write_checksum: sha1:20661bf3f6aee26ae8b3526b0c96eadcacd597b7 + docs/models/operations/delete-wordlist-response.md: + last_write_checksum: sha1:00680f1d79f60e2a751a350f9a12620e81b5486a docs/models/operations/drugs.md: last_write_checksum: sha1:ca5cca5f16d2a8a2cff3d0eaf7a6018fd6613cc2 docs/models/operations/duplicate-channel-request-body.md: @@ -546,15 +550,15 @@ trackedFiles: docs/models/operations/remove-wordlist-words-response.md: last_write_checksum: sha1:e23252b42245e21a8ef0934a68b7cb04de441274 docs/models/operations/resolve-queue-item-request.md: - last_write_checksum: sha1:c0fc47730a6eb1d6897463d0ec1ac2e722d81fab + last_write_checksum: sha1:cc99ce523c4a6d5f9600590b0033ffa16df2d941 docs/models/operations/resolve-queue-item-response.md: last_write_checksum: sha1:b8520e9effc3834840068b5198ae8f8121656e6f docs/models/operations/resolve-queue-items-request-body.md: - last_write_checksum: sha1:cfc86a24bf0df27b60782185ecfff09e7f9efd22 + last_write_checksum: sha1:1d2212c3f9cd432131aad2f5056e0d75b3de7ba0 docs/models/operations/resolve-queue-items-request.md: last_write_checksum: sha1:fc11bbc90ae968ccf192a0fd5cad362da5847d2e docs/models/operations/resolve-queue-items-response.md: - last_write_checksum: sha1:417bfdf7a8e4db709c26bf2be811b369a44bb6fb + last_write_checksum: sha1:c8ec6d2fcbfe3679b6c1d0f143517661798ec39b docs/models/operations/respect-insight.md: last_write_checksum: sha1:4b1a6f187a513f87358067533f2daf28f27c38be docs/models/operations/review-stats.md: @@ -584,7 +588,7 @@ trackedFiles: docs/models/operations/sort-direction.md: last_write_checksum: sha1:1b7b85096a9455025e1ef1cc6018279d0bee9ee2 docs/models/operations/sort.md: - last_write_checksum: sha1:410b2f69e4e04be7fb3d5c8b4ef816a8ca98a80a + last_write_checksum: sha1:ee30bb68d8a5ddcc3f6fc5ca56adf8a0e51c4023 docs/models/operations/source.md: last_write_checksum: sha1:d4ec80710bbb63e1c3447704275cd0f700b2f5e5 docs/models/operations/spam.md: @@ -634,9 +638,9 @@ trackedFiles: docs/models/operations/unblock-author-response.md: last_write_checksum: sha1:d2815f1bfccd8b2a758bd6a6283f19b9a9405ac7 docs/models/operations/unicode-spoofing.md: - last_write_checksum: sha1:46001ecb3e3d7cceb9d0bda3687ce1cf001ab296 + last_write_checksum: sha1:c17d33a123421873b32aa9cf81c7fd13ce482655 docs/models/operations/unresolve-queue-item-request.md: - last_write_checksum: sha1:6fc38de44a4181b6a9ba7b8ca7e40a70af60a9e3 + last_write_checksum: sha1:8605e41728ddb0d7e2490930c8e50f4b622e0f00 docs/models/operations/unresolve-queue-item-response.md: last_write_checksum: sha1:27c007356cb2e365f5e54da0429d6ae5f6a77502 docs/models/operations/unresolve-queue-item-status.md: @@ -766,7 +770,7 @@ trackedFiles: docs/models/queue-item-video.md: last_write_checksum: sha1:04761ec0f349c7e26f5a11b293ebe8b50a9eef7c docs/models/queue-item.md: - last_write_checksum: sha1:9038f1cf671820407f2a561c2d6fb786234ed2df + last_write_checksum: sha1:591fd857f2f38544f10d3341d651c34e0e25c53c docs/models/queue-with-counts.md: last_write_checksum: sha1:82df58d0f4093b31351bf31ea3ea2b134767e2b4 docs/models/queue.md: @@ -784,7 +788,7 @@ trackedFiles: docs/sdks/account/README.md: last_write_checksum: sha1:059fed03cb41253ac7d36f0683b67d68d584c974 docs/sdks/actions/README.md: - last_write_checksum: sha1:efb3e4aaa786d2f6f8f9b9496685c04c1db3af48 + last_write_checksum: sha1:c3a3c72eecf124491d98e2effdd10c6702f7a9b7 docs/sdks/analytics/README.md: last_write_checksum: sha1:4b69eb107c5f39db87bf4182612e2f092aab25b3 docs/sdks/apikeys/README.md: @@ -794,11 +798,11 @@ trackedFiles: docs/sdks/channels/README.md: last_write_checksum: sha1:0dc23f6f60598b2cbd22b0437e671cfda686562c docs/sdks/content/README.md: - last_write_checksum: sha1:9e9abd673525af4df450c9b153ac89d2459bf3bd + last_write_checksum: sha1:d97dd893c9f9d188b7c5c6c6f9a65f5cd0705782 docs/sdks/feedback/README.md: last_write_checksum: sha1:209a6ea1eab58021ca88d175ca9304087eef15f8 docs/sdks/items/README.md: - last_write_checksum: sha1:f527557054ae862320fb15adf1610a2bb2597114 + last_write_checksum: sha1:a952ab8ded80ac95fca106993a43e9e2b29d9247 docs/sdks/projects/README.md: last_write_checksum: sha1:5099f84c9c94c5588cc8c8b646ae74054d4be863 docs/sdks/queue/README.md: @@ -808,7 +812,7 @@ trackedFiles: docs/sdks/webhooksecret/README.md: last_write_checksum: sha1:cab757440af86a7d567f79312b737d9845e0d6a2 docs/sdks/wordlist/README.md: - last_write_checksum: sha1:8835b8497ca8ace37e6f0a3211e40f0843638b27 + last_write_checksum: sha1:b087ac3f90d3308ed874cb3698bb8ce3f731bd3f docs/sdks/words/README.md: last_write_checksum: sha1:04f7705c5f43e60d149f5a4d1f519bfbe728c4bd examples/.env.template: @@ -820,25 +824,25 @@ trackedFiles: examples/package.json: last_write_checksum: sha1:72d702bad23c84698d27164ca08d5f0ff931af65 jsr.json: - last_write_checksum: sha1:c08dd2de7d37fbb01aaa3255378f71d68683a9eb + last_write_checksum: sha1:7618a494bf1a3a1439ee435b4f75c53ff50cf621 package.json: - last_write_checksum: sha1:027f40f096049bc8c4c80810d48c67e1a7c99382 + last_write_checksum: sha1:5e659c4f1df4b8fbc6869715a6c6acea08349f8a src/core.ts: last_write_checksum: sha1:72b4c09e9228c63a9cc3335baa0ae5be47c2bc9c src/funcs/account-retrieve.ts: last_write_checksum: sha1:f57bf974c15da45a521e31f73de568b3c6abbffa src/funcs/actions-create.ts: - last_write_checksum: sha1:67272b456cbe1512dc771132f779755ca03980fa + last_write_checksum: sha1:6b5a56bd865e43f5030e954a4bc0077ea7a29f47 src/funcs/actions-delete.ts: last_write_checksum: sha1:5f2505a3ada18c2ea0a4932952297e7c20236388 src/funcs/actions-execute.ts: - last_write_checksum: sha1:0e9d2cfe64a9109c1cf68802fb43c26da02649f2 + last_write_checksum: sha1:31257cd3d195ec7048fbe5f06ce60dacf94a52fe src/funcs/actions-list.ts: - last_write_checksum: sha1:0dea40faff481938b555819bdcc61f0b9ab78857 + last_write_checksum: sha1:565ab0cdf73f25bae53a9390ff6b63b97ae164b1 src/funcs/actions-retrieve.ts: - last_write_checksum: sha1:352c4bc9b37efc482a45cb06fa66ac73c2bdcef4 + last_write_checksum: sha1:3a3d7b5b9b5c5ba17cf09b9f720916265856c8d1 src/funcs/actions-update.ts: - last_write_checksum: sha1:2efd3a0254a88bdfab2400094668acbb5c55afbc + last_write_checksum: sha1:494f19336dd8440f065e28f10fdb9c63ccf97f6f src/funcs/analytics-authors.ts: last_write_checksum: sha1:f6b3a01407d3073d9b60ff1972c5671130bbe090 src/funcs/analytics-automation.ts: @@ -884,7 +888,7 @@ trackedFiles: src/funcs/content-reject.ts: last_write_checksum: sha1:197ff4634c40bab554454b386f29383ff04a1123 src/funcs/content-submit.ts: - last_write_checksum: sha1:fdca5b9045341128939058fb21071d48d2c01eb0 + last_write_checksum: sha1:470e0df85805f584da9cdd7bc60bdf406802ed50 src/funcs/feedback-create.ts: last_write_checksum: sha1:2af67a5a1a2ce4186dbe3ac33760fe9735e9a808 src/funcs/projects-api-keys-create.ts: @@ -904,13 +908,13 @@ trackedFiles: src/funcs/queue-get-stats.ts: last_write_checksum: sha1:801c6ca33c1d877de0eb56091c22e704ad5cfb2c src/funcs/queue-items-list.ts: - last_write_checksum: sha1:ea9e8def9e2cec9f8520e70038ad4c1228ac7186 + last_write_checksum: sha1:f502f72d926d029f1b2988483bf75ee9e6b3de74 src/funcs/queue-items-resolve-many.ts: - last_write_checksum: sha1:202289781cddcc4ce13153e3ee86b87a65bbbe7c + last_write_checksum: sha1:9b753b0a85877ecc392f89943c05c26b78e5fa1b src/funcs/queue-items-resolve.ts: - last_write_checksum: sha1:0805245dbc3a8bbf6858c7257c4a46be60996c98 + last_write_checksum: sha1:3a4dfdf9569949d277848d974a7ac873bfeb76c2 src/funcs/queue-items-unresolve.ts: - last_write_checksum: sha1:b1edda3eb427580e272988f8f8430887b9e4c993 + last_write_checksum: sha1:74a862fa898e76caa175805fd7d32d9e3fa9578b src/funcs/queue-list.ts: last_write_checksum: sha1:614b769cc2e06fdbac173fdeed67679e212da08c src/funcs/queue-retrieve.ts: @@ -929,6 +933,8 @@ trackedFiles: last_write_checksum: sha1:4d3f0ae4628a57342d8a7c4bbf727787c7346f23 src/funcs/wordlist-create.ts: last_write_checksum: sha1:a919a6d383a431a3958e3b27b1ba9f21cd6f32a2 + src/funcs/wordlist-delete.ts: + last_write_checksum: sha1:60ce1d114586a9c33542b9d206afdb7991b28c42 src/funcs/wordlist-get-embedding-status.ts: last_write_checksum: sha1:738292d954d7d25e91906d4e53df02f7671da44a src/funcs/wordlist-list.ts: @@ -952,7 +958,7 @@ trackedFiles: src/lib/base64.ts: last_write_checksum: sha1:8c94164f2f78e6041c853186fa01f659591f5913 src/lib/config.ts: - last_write_checksum: sha1:09f9426a004967ef918057af692641868b6659e4 + last_write_checksum: sha1:d6ce540bc9950bdc49720ed2bcfe73c171cf21cf src/lib/encodings.ts: last_write_checksum: sha1:4481b2a380f8a16856ef92c66fb370299f56d135 src/lib/env.ts: @@ -1051,6 +1057,8 @@ trackedFiles: last_write_checksum: sha1:1b89d788b30bda054ddb0832e8099ed31b78a2a0 src/models/operations/delete-webhook.ts: last_write_checksum: sha1:ec5c079025ca28b92c865f42493fc728a37bb3aa + src/models/operations/delete-wordlist.ts: + last_write_checksum: sha1:24fea59e7df5854cd20a6b59a4979056ed41c842 src/models/operations/duplicate-channel.ts: last_write_checksum: sha1:1992ab1dec599b6c6751fa259119fc6ccf4d2974 src/models/operations/duplicate-project.ts: @@ -1092,7 +1100,7 @@ trackedFiles: src/models/operations/get-wordlist.ts: last_write_checksum: sha1:0cfd3f20b74b9dafa1c2ab8159bf165bc99ae830 src/models/operations/index.ts: - last_write_checksum: sha1:b31c360b2106982c2875c35819b79fcc74663973 + last_write_checksum: sha1:ded13f36235daa82d9a1f5bd1e68ab5d497f1319 src/models/operations/list-actions.ts: last_write_checksum: sha1:2d872ead1fa82d0e580eae92cfcb6593b71972cb src/models/operations/list-authors.ts: @@ -1102,7 +1110,7 @@ trackedFiles: src/models/operations/list-projects.ts: last_write_checksum: sha1:0c1cf0e09f7c0ae20c42b1707947474386d11ab9 src/models/operations/list-queue-items.ts: - last_write_checksum: sha1:1771d05789d49fd2e81023c86350fdcde9910713 + last_write_checksum: sha1:b387a9220bd02e7e70fbb17956be2594cb75b978 src/models/operations/list-queues.ts: last_write_checksum: sha1:15e04b75447d297b9358dce77b8f170237e15d16 src/models/operations/list-webhooks.ts: @@ -1114,17 +1122,17 @@ trackedFiles: src/models/operations/remove-wordlist-words.ts: last_write_checksum: sha1:494ac821a6346f6b08e16b57b95b895300c887a1 src/models/operations/resolve-queue-item.ts: - last_write_checksum: sha1:f01edb613a78312ab0ec62654f75aca858bee0b7 + last_write_checksum: sha1:24b3442b7cc9923e89ccbf2431648255ab9cf1b5 src/models/operations/resolve-queue-items.ts: - last_write_checksum: sha1:36c6625998810befaf0dc01f6b0f9bd080376beb + last_write_checksum: sha1:56ee903022858da5a7fe69db2a837e1e314ce2ae src/models/operations/submit-content.ts: - last_write_checksum: sha1:74f926880df58f87473373c25f10f31bf052272d + last_write_checksum: sha1:af7cc6d3d2c1d2b0a1d3779632f00843e3e74ce5 src/models/operations/suspend-author.ts: last_write_checksum: sha1:05f2fdd6cb81b91ce569a898714d00e9809f69bd src/models/operations/unblock-author.ts: last_write_checksum: sha1:38abae3ee704f300d903f44301fc64b576e81600 src/models/operations/unresolve-queue-item.ts: - last_write_checksum: sha1:1a8c9d9bed905a703b8ac81a2d486a70ee014760 + last_write_checksum: sha1:3dd9b0eac252f143b7dfcd364ee6b8853afe2cfb src/models/operations/update-action.ts: last_write_checksum: sha1:835852cd8092e2ec95ec1ad43071ee792647c49a src/models/operations/update-author.ts: @@ -1150,7 +1158,7 @@ trackedFiles: src/models/public-author.ts: last_write_checksum: sha1:ff635e9ed284567e3580b5787fb1f293c088629e src/models/queue-item.ts: - last_write_checksum: sha1:d9c5481bc6fd8d8f3c811f68b84f45ef34d048d1 + last_write_checksum: sha1:9e869e3a2bc2d3d0ad853bfd6e2f30de8b7ab824 src/models/queue-with-counts.ts: last_write_checksum: sha1:ea9b1238c047a7dd712729bad27cf53a9b863d8e src/models/queue.ts: @@ -1162,7 +1170,7 @@ trackedFiles: src/sdk/account.ts: last_write_checksum: sha1:af45ed201b0dba505aa28dd9669afeb5ad9a9fb9 src/sdk/actions.ts: - last_write_checksum: sha1:7533f896c27b4343d8ae84ba15399fda3569abb3 + last_write_checksum: sha1:426c172bb27c45060a3e07f8b97e1abec8c5b908 src/sdk/analytics.ts: last_write_checksum: sha1:44bd573cb4f17fc2fd6cc4c8652b3d67b25dd72d src/sdk/api-keys.ts: @@ -1172,13 +1180,13 @@ trackedFiles: src/sdk/channels.ts: last_write_checksum: sha1:30ea1fc231cc208918a776570e51d37b21969e01 src/sdk/content.ts: - last_write_checksum: sha1:b1b8b75e2c99656eb9606d0204d0bddc468e6b27 + last_write_checksum: sha1:0bd5bad3140fdb533ffcae6a849c9c91c12830d9 src/sdk/feedback.ts: last_write_checksum: sha1:cfc19d13959b3e43a97772382809ee2561187d96 src/sdk/index.ts: last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f src/sdk/items.ts: - last_write_checksum: sha1:3a8e7e952201f3dc7232b0234a92762a8d7f3192 + last_write_checksum: sha1:4972941e5ca5e5833e440b2af507c042b2fc19f8 src/sdk/projects.ts: last_write_checksum: sha1:096e08f34b6f2b9c04001f41fddef32218ebdde5 src/sdk/queue.ts: @@ -1190,7 +1198,7 @@ trackedFiles: src/sdk/webhooks.ts: last_write_checksum: sha1:f881d70a682584be49f29e421c23b1c1e0ba0a79 src/sdk/wordlist.ts: - last_write_checksum: sha1:3d21518dcac32f2f6ea53a06b28cedcacccc3f5f + last_write_checksum: sha1:28f743d1ef8a7ab736c31ed7b4b771e74f6de52b src/sdk/words.ts: last_write_checksum: sha1:6ee7d96e5571a9d5bea929d3b49a252d522879f6 src/types/async.ts: @@ -2272,4 +2280,18 @@ examples: application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://confused-bell.org"} "429": application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://nervous-partridge.org/"} + deleteWordlist: + speakeasy-default-delete-wordlist: + parameters: + path: + id: "" + responses: + "200": + application/json: {"id": "", "deleted": true, "detachedChannelIds": ["", "", ""]} + "401": + application/json: {"type": "authentication_error", "code": "unauthorized", "message": "Authorization not provided", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://rotating-exterior.biz/"} + "404": + application/json: {"type": "not_found_error", "code": "resource_not_found", "message": "Not found", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://flickering-airmail.org/"} + "429": + application/json: {"type": "rate_limit_error", "code": "rate_limit_exceeded", "message": "Rate limit exceeded", "request_id": "h8fkz6kkzoa446ffve37atys", "doc_url": "https://decent-millet.biz"} examplesVersion: 1.0.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index e2b89ef..26f8d65 100644 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -32,7 +32,7 @@ generation: generateNewTests: true skipResponseBodyAssertions: false typescript: - version: 5.3.0 + version: 5.4.0 acceptHeaderEnum: false additionalDependencies: dependencies: {} diff --git a/.speakeasy/openapi.json b/.speakeasy/openapi.json index 9a2cf7e..81ffb54 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -394,7 +394,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -591,7 +592,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -790,7 +792,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -972,7 +975,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -1179,7 +1183,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -1433,7 +1438,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -1624,7 +1630,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -1874,7 +1881,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -1993,7 +2001,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { @@ -2234,7 +2243,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } }, "delete": { @@ -2360,7 +2370,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -2510,7 +2521,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -2658,7 +2670,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -2805,7 +2818,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -3025,7 +3039,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -3033,7 +3048,7 @@ "get": { "operationId": "listQueueItems", "summary": "List queue items", - "description": "List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item.", + "description": "List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` or `contentId` to resolve or unresolve an item.", "tags": [ "Review queues" ], @@ -3084,7 +3099,8 @@ "FIFO", "LIFO", "RANDOM", - "SEVERITY_DESC" + "SEVERITY_DESC", + "ROBOCALL_DESC" ] } }, @@ -3254,7 +3270,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -3281,7 +3298,7 @@ "post": { "operationId": "resolveQueueItem", "summary": "Resolve a queue item", - "description": "Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`.", + "description": "Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. `itemId` is the item `id` or your `contentId`. To also take a moderation action, use `POST /actions/execute`.", "tags": [ "Review queues" ], @@ -3306,10 +3323,10 @@ "name": "itemId", "schema": { "type": "string", - "description": "The item ID to resolve." + "description": "The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it." }, "required": true, - "description": "The item ID to resolve." + "description": "The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it." }, { "in": "header", @@ -3406,7 +3423,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -3414,7 +3432,7 @@ "post": { "operationId": "resolveQueueItems", "summary": "Resolve queue items", - "description": "Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`.", + "description": "Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`, and each ID is an item `id` or your `contentId`. IDs that match no item in the project are skipped and returned in `notFoundIds`.", "tags": [ "Review queues" ], @@ -3459,7 +3477,7 @@ "items": { "type": "string" }, - "description": "The item IDs to resolve. Up to 100." + "description": "The items to resolve, up to 100. Each is the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it." } }, "required": [ @@ -3492,7 +3510,7 @@ "items": { "type": "string" }, - "description": "Item IDs that do not exist in the project." + "description": "IDs from `itemIds` that match no item or content ID in the project." } }, "required": [ @@ -3563,7 +3581,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -3571,7 +3590,7 @@ "post": { "operationId": "unresolveQueueItem", "summary": "Unresolve a queue item", - "description": "Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list.", + "description": "Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. `itemId` is the item `id` or your `contentId`.", "tags": [ "Review queues" ], @@ -3596,10 +3615,10 @@ "name": "itemId", "schema": { "type": "string", - "description": "The item ID to unresolve." + "description": "The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it." }, "required": true, - "description": "The item ID to unresolve." + "description": "The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it." }, { "in": "header", @@ -3705,7 +3724,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -3713,7 +3733,7 @@ "get": { "operationId": "listActions", "summary": "List moderation actions", - "description": "List the moderation actions of the project. The list is paginated.", + "description": "List the moderation actions of the project, with their webhooks. An action is a decision that a reviewer or a rule can take on content or an author. Built-in actions (for example reject an item or block an author) change the item or author in Moderation API. Custom actions record the decision and send it to the webhooks of the action, where the customer platform acts on it. The list is paginated.", "tags": [ "Actions" ], @@ -3988,7 +4008,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -4013,7 +4034,7 @@ "post": { "operationId": "createAction", "summary": "Create an action", - "description": "Create an action.", + "description": "Create an action that reviewers and rules can take. `type` sets what it does: a built-in type changes the item or author in Moderation API, and a custom type (`ITEM_CUSTOM`, `AUTHOR_CUSTOM`) only records the decision for the webhooks to deliver. Creating an action does not execute it.", "tags": [ "Actions" ], @@ -4347,7 +4368,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -4355,7 +4377,7 @@ "get": { "operationId": "getAction", "summary": "Get an action", - "description": "Get an action by ID.", + "description": "Get an action by ID: its type, where it shows in the review queues, the values it takes and its webhooks.", "tags": [ "Actions" ], @@ -4574,13 +4596,14 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { "operationId": "updateAction", "summary": "Update an action", - "description": "Update an action.", + "description": "Update the settings of an action: its name, type, queues and values. The new settings apply the next time the action is executed. Updating an action does not execute it.", "tags": [ "Actions" ], @@ -4925,7 +4948,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } }, "delete": { @@ -5037,7 +5061,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -5045,7 +5070,7 @@ "post": { "operationId": "executeAction", "summary": "Execute moderation action", - "description": "Execute a moderation action on one or more content items.", + "description": "Execute one action of the project, by ID or key, on content items or authors. A built-in action changes them in Moderation API (for example rejects the items or blocks the authors). Every executed action is recorded, and the project sends it to the webhooks of the action and to its other webhook endpoints, where the customer platform can act on it. List the actions first to see what each one does.", "tags": [ "Actions" ], @@ -5198,7 +5223,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": true } } }, @@ -5206,7 +5232,7 @@ "post": { "operationId": "executeActionById", "summary": "Execute an action", - "description": "Execute an action on a set of content items in a queue.", + "description": "Execute an action on a set of content items in a queue. The project sends the result to the webhooks of the action. Use `POST /actions/execute` instead.", "tags": [ "Actions" ], @@ -5487,7 +5513,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": true } } }, @@ -5625,7 +5652,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -5751,7 +5779,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": true } } }, @@ -5886,7 +5915,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": true } } }, @@ -6012,7 +6042,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -6183,7 +6214,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -6405,7 +6437,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -6557,7 +6590,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { @@ -6767,7 +6801,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": true } }, "delete": { @@ -6869,7 +6904,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -7664,7 +7700,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -8066,7 +8103,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -8255,7 +8293,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -8431,7 +8470,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { @@ -8620,7 +8660,119 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false + } + }, + "delete": { + "operationId": "deleteWordlist", + "summary": "Delete wordlist", + "description": "Delete a wordlist and its words. Channels that use the wordlist do not block the delete: the wordlist is removed from their policies. `detachedChannelIds` lists those channels. This cannot be undone.", + "tags": [ + "Wordlists" + ], + "security": [ + { + "Authorization": [] + } + ], + "parameters": [ + { + "in": "path", + "name": "id", + "schema": { + "type": "string", + "description": "ID of the wordlist to delete" + }, + "required": true, + "description": "ID of the wordlist to delete" + }, + { + "in": "header", + "name": "Project-Id", + "required": false, + "schema": { + "type": "string" + }, + "description": "The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error.", + "x-speakeasy-name-override": "projectId" + } + ], + "responses": { + "200": { + "description": "Wordlist deleted successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "ID of the deleted wordlist" + }, + "deleted": { + "type": "boolean", + "description": "Whether the wordlist was deleted" + }, + "detachedChannelIds": { + "type": "array", + "items": { + "type": "string" + }, + "description": "IDs of the channels that used the wordlist. It was removed from them." + } + }, + "required": [ + "id", + "deleted", + "detachedChannelIds" + ], + "additionalProperties": false + } + } + } + }, + "401": { + "description": "Authorization not provided", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthenticationError" + } + } + } + }, + "404": { + "description": "Not found", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/NotFoundError" + } + } + } + }, + "429": { + "description": "Too many requests. Retry after the number of seconds in the `Retry-After` header.", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RateLimitError" + } + } + } + } + }, + "x-speakeasy-group": "wordlist", + "x-speakeasy-name-override": "delete", + "x-speakeasy-mcp": { + "title": "Delete wordlist", + "scopes": [ + "destructive" + ], + "readOnlyHint": false, + "destructiveHint": true, + "openWorldHint": false } } }, @@ -8760,7 +8912,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -8910,7 +9063,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "delete": { @@ -9043,7 +9197,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -9051,6 +9206,7 @@ "post": { "operationId": "submitContent", "summary": "Submit content", + "description": "Moderate one piece of content: text, an image, a video, audio or an object with several fields. The project checks it against the policies of its channel and returns the result. Act on `recommendation.action` (allow, review or reject). The content is stored in the project unless `doNotStore` is set, and items to review go to the review queue. The project can send the result to its webhook endpoints.", "tags": [ "Content" ], @@ -10174,13 +10330,15 @@ "const": "unicode_spoofing" }, "signals": { - "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy.", + "description": "Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled.", "type": "object", "propertyNames": { "type": "string", "enum": [ "mixed_script", "confusable_word", + "hidden_lookalike", + "leetspeak", "invisible", "zalgo", "illegal", @@ -11440,7 +11598,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": true } } }, @@ -11548,7 +11707,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -11684,7 +11844,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -11773,7 +11934,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { @@ -11940,7 +12102,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } }, "delete": { @@ -12042,7 +12205,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -12159,7 +12323,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -12277,7 +12442,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -12405,7 +12571,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false }, "x-speakeasy-pagination": { "type": "offsetLimit", @@ -12569,7 +12736,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -12658,7 +12826,8 @@ "read" ], "readOnlyHint": true, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } }, "put": { @@ -12868,7 +13037,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } }, "delete": { @@ -12980,7 +13150,8 @@ "destructive" ], "readOnlyHint": false, - "destructiveHint": true + "destructiveHint": true, + "openWorldHint": false } } }, @@ -13104,7 +13275,8 @@ "write" ], "readOnlyHint": false, - "destructiveHint": false + "destructiveHint": false, + "openWorldHint": false } } }, @@ -13528,11 +13700,11 @@ "properties": { "id": { "type": "string", - "description": "The item ID. Use it to resolve or unresolve the item in this queue." + "description": "The item ID: the ID of this submission. Use it, or `contentId`, to resolve or unresolve the item in this queue." }, "contentId": { "type": "string", - "description": "Your content ID, as you sent it to `POST /moderate`." + "description": "Your content ID, as you sent it to `POST /moderate`. Webhooks send it as `item.id`. The resolve endpoints accept it in place of `id`." }, "content": { "anyOf": [ diff --git a/CHANGELOG.md b/CHANGELOG.md index f78e53b..a02402d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## 5.4.0 (2026-11-12) + +Full Changelog: [v5.3.0...v5.4.0](https://github.com/moderation-api/sdk-typescript/compare/v5.3.0...v5.4.0) + +### API changes + +- `POST /moderate`: added the new `hidden_lookalike` enum value to the request property `policies/items/oneOf[subschema #36: Unicode Spoofing]/signals/propertyNames/` +- `POST /moderate`: added the new `leetspeak` enum value to the request property `policies/items/oneOf[subschema #36: Unicode Spoofing]/signals/propertyNames/` +- `GET /queue/{id}/items`: added the new enum value `ROBOCALL_DESC` to the `query` request parameter `sort` +- `DELETE /wordlist/{id}`: endpoint added + ## 5.3.0 (2026-10-28) Full Changelog: [v5.2.0...v5.3.0](https://github.com/moderation-api/sdk-typescript/compare/v5.2.0...v5.3.0) diff --git a/README.md b/README.md index d6cc533..6bf19d9 100644 --- a/README.md +++ b/README.md @@ -470,6 +470,7 @@ Create the organization client only where you manage projects and channels, for * [create](docs/sdks/wordlist/README.md#create) - Create wordlist * [retrieve](docs/sdks/wordlist/README.md#retrieve) - Get wordlist * [update](docs/sdks/wordlist/README.md#update) - Update wordlist +* [delete](docs/sdks/wordlist/README.md#delete) - Delete wordlist * [getEmbeddingStatus](docs/sdks/wordlist/README.md#getembeddingstatus) - Get embedding status #### [Wordlist.Words](docs/sdks/words/README.md) @@ -547,6 +548,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md). - [`webhooksRetrieve`](docs/sdks/webhooks/README.md#retrieve) - Get a webhook - [`webhooksUpdate`](docs/sdks/webhooks/README.md#update) - Update a webhook - [`wordlistCreate`](docs/sdks/wordlist/README.md#create) - Create wordlist +- [`wordlistDelete`](docs/sdks/wordlist/README.md#delete) - Delete wordlist - [`wordlistGetEmbeddingStatus`](docs/sdks/wordlist/README.md#getembeddingstatus) - Get embedding status - [`wordlistList`](docs/sdks/wordlist/README.md#list) - List wordlists - [`wordlistRetrieve`](docs/sdks/wordlist/README.md#retrieve) - Get wordlist @@ -729,10 +731,10 @@ run(); **Inherit from [`ModerationAPIError`](./src/models/errors/moderation-api-error.ts)**: -* [`NotFoundError`](./src/models/errors/not-found-error.ts): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 44 of 58 methods.* -* [`PermissionDeniedError`](./src/models/errors/permission-denied-error.ts): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 36 of 58 methods.* -* [`InternalServerError`](./src/models/errors/internal-server-error.ts): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 23 of 58 methods.* -* [`ConflictError`](./src/models/errors/conflict-error.ts): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 58 methods.* +* [`NotFoundError`](./src/models/errors/not-found-error.ts): The resource does not exist or the key cannot see it. Status code `404`. Applicable to 45 of 59 methods.* +* [`PermissionDeniedError`](./src/models/errors/permission-denied-error.ts): The API key cannot do this, or the plan limit for this resource is reached. Status code `403`. Applicable to 36 of 59 methods.* +* [`InternalServerError`](./src/models/errors/internal-server-error.ts): Something went wrong on our side. Retry with backoff. Status code `500`. Applicable to 23 of 59 methods.* +* [`ConflictError`](./src/models/errors/conflict-error.ts): The request conflicts with the current state of a resource. Status code `409`. Applicable to 2 of 59 methods.* * [`ResponseValidationError`](./src/models/errors/response-validation-error.ts): Type mismatch between the data returned from the server and the structure expected by the SDK. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string. diff --git a/docs/models/operations/delete-wordlist-request.md b/docs/models/operations/delete-wordlist-request.md new file mode 100644 index 0000000..1786f3e --- /dev/null +++ b/docs/models/operations/delete-wordlist-request.md @@ -0,0 +1,18 @@ +# DeleteWordlistRequest + +## Example Usage + +```typescript +import { DeleteWordlistRequest } from "@moderation-api/sdk/models/operations"; + +let value: DeleteWordlistRequest = { + id: "", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to delete | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/operations/delete-wordlist-response.md b/docs/models/operations/delete-wordlist-response.md new file mode 100644 index 0000000..21497c1 --- /dev/null +++ b/docs/models/operations/delete-wordlist-response.md @@ -0,0 +1,25 @@ +# DeleteWordlistResponse + +Wordlist deleted successfully + +## Example Usage + +```typescript +import { DeleteWordlistResponse } from "@moderation-api/sdk/models/operations"; + +let value: DeleteWordlistResponse = { + id: "", + deleted: false, + detachedChannelIds: [ + "", + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the deleted wordlist | +| `deleted` | *boolean* | :heavy_check_mark: | Whether the wordlist was deleted | +| `detachedChannelIds` | *string*[] | :heavy_check_mark: | IDs of the channels that used the wordlist. It was removed from them. | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-item-request.md b/docs/models/operations/resolve-queue-item-request.md index 7fd56e3..90eef17 100644 --- a/docs/models/operations/resolve-queue-item-request.md +++ b/docs/models/operations/resolve-queue-item-request.md @@ -13,8 +13,8 @@ let value: ResolveQueueItemRequest = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID. | -| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve. | -| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-items-request-body.md b/docs/models/operations/resolve-queue-items-request-body.md index 24570a0..2dddd3b 100644 --- a/docs/models/operations/resolve-queue-items-request-body.md +++ b/docs/models/operations/resolve-queue-items-request-body.md @@ -14,6 +14,6 @@ let value: ResolveQueueItemsRequestBody = { ## Fields -| Field | Type | Required | Description | -| ----------------------------------- | ----------------------------------- | ----------------------------------- | ----------------------------------- | -| `itemIds` | *string*[] | :heavy_check_mark: | The item IDs to resolve. Up to 100. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `itemIds` | *string*[] | :heavy_check_mark: | The items to resolve, up to 100. Each is the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. | \ No newline at end of file diff --git a/docs/models/operations/resolve-queue-items-response.md b/docs/models/operations/resolve-queue-items-response.md index 1be5900..942ad35 100644 --- a/docs/models/operations/resolve-queue-items-response.md +++ b/docs/models/operations/resolve-queue-items-response.md @@ -17,7 +17,7 @@ let value: ResolveQueueItemsResponse = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | ------------------------------------------ | -| `resolved` | *number* | :heavy_check_mark: | Number of items resolved. | -| `notFoundIds` | *string*[] | :heavy_check_mark: | Item IDs that do not exist in the project. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `resolved` | *number* | :heavy_check_mark: | Number of items resolved. | +| `notFoundIds` | *string*[] | :heavy_check_mark: | IDs from `itemIds` that match no item or content ID in the project. | \ No newline at end of file diff --git a/docs/models/operations/sort.md b/docs/models/operations/sort.md index bbccf14..09bf47e 100644 --- a/docs/models/operations/sort.md +++ b/docs/models/operations/sort.md @@ -11,5 +11,5 @@ let value: Sort = "LIFO"; ## Values ```typescript -"FIFO" | "LIFO" | "RANDOM" | "SEVERITY_DESC" +"FIFO" | "LIFO" | "RANDOM" | "SEVERITY_DESC" | "ROBOCALL_DESC" ``` \ No newline at end of file diff --git a/docs/models/operations/unicode-spoofing.md b/docs/models/operations/unicode-spoofing.md index 03ac709..5fe37fd 100644 --- a/docs/models/operations/unicode-spoofing.md +++ b/docs/models/operations/unicode-spoofing.md @@ -13,9 +13,9 @@ let value: UnicodeSpoofing = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `flag` | *boolean* | :heavy_check_mark: | N/A | -| `threshold` | *number* | :heavy_minus_sign: | N/A | -| `id` | *"unicode_spoofing"* | :heavy_check_mark: | N/A | -| `signals` | Record | :heavy_minus_sign: | Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. | \ No newline at end of file +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `flag` | *boolean* | :heavy_check_mark: | N/A | +| `threshold` | *number* | :heavy_minus_sign: | N/A | +| `id` | *"unicode_spoofing"* | :heavy_check_mark: | N/A | +| `signals` | Record | :heavy_minus_sign: | Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled. | \ No newline at end of file diff --git a/docs/models/operations/unresolve-queue-item-request.md b/docs/models/operations/unresolve-queue-item-request.md index 6881b1c..9783698 100644 --- a/docs/models/operations/unresolve-queue-item-request.md +++ b/docs/models/operations/unresolve-queue-item-request.md @@ -13,8 +13,8 @@ let value: UnresolveQueueItemRequest = { ## Fields -| Field | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID. | -| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve. | -| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | \ No newline at end of file diff --git a/docs/models/queue-item.md b/docs/models/queue-item.md index 762613d..c523054 100644 --- a/docs/models/queue-item.md +++ b/docs/models/queue-item.md @@ -31,17 +31,17 @@ let value: QueueItem = { ## Fields -| Field | Type | Required | Description | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The item ID. Use it to resolve or unresolve the item in this queue. | -| `contentId` | *string* | :heavy_check_mark: | Your content ID, as you sent it to `POST /moderate`. | -| `content` | *models.QueueItemContent* | :heavy_check_mark: | The submitted content. | -| `labels` | [models.Label](../models/label.md)[] | :heavy_check_mark: | The moderation labels of the content. | -| `flagged` | *boolean* | :heavy_check_mark: | Whether moderation flagged the content. | -| `severity` | *number* | :heavy_check_mark: | Severity score from 0 to 1, if available. | -| `status` | [models.QueueItemStatus](../models/queue-item-status.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | -| `timestamp` | *number* | :heavy_check_mark: | When the content was submitted, as Unix time in milliseconds. | -| `language` | *string* | :heavy_check_mark: | Detected ISO language code. | -| `conversationId` | *string* | :heavy_check_mark: | Conversation ID, if any. | -| `authorId` | *string* | :heavy_check_mark: | Your author ID, if any. | -| `contentType` | *string* | :heavy_check_mark: | Content type, for example `message` or `profile`. | \ No newline at end of file +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The item ID: the ID of this submission. Use it, or `contentId`, to resolve or unresolve the item in this queue. | +| `contentId` | *string* | :heavy_check_mark: | Your content ID, as you sent it to `POST /moderate`. Webhooks send it as `item.id`. The resolve endpoints accept it in place of `id`. | +| `content` | *models.QueueItemContent* | :heavy_check_mark: | The submitted content. | +| `labels` | [models.Label](../models/label.md)[] | :heavy_check_mark: | The moderation labels of the content. | +| `flagged` | *boolean* | :heavy_check_mark: | Whether moderation flagged the content. | +| `severity` | *number* | :heavy_check_mark: | Severity score from 0 to 1, if available. | +| `status` | [models.QueueItemStatus](../models/queue-item-status.md) | :heavy_check_mark: | `pending` waits for review. `resolved` is reviewed. | +| `timestamp` | *number* | :heavy_check_mark: | When the content was submitted, as Unix time in milliseconds. | +| `language` | *string* | :heavy_check_mark: | Detected ISO language code. | +| `conversationId` | *string* | :heavy_check_mark: | Conversation ID, if any. | +| `authorId` | *string* | :heavy_check_mark: | Your author ID, if any. | +| `contentType` | *string* | :heavy_check_mark: | Content type, for example `message` or `profile`. | \ No newline at end of file diff --git a/docs/sdks/actions/README.md b/docs/sdks/actions/README.md index 4abff2c..4c71e00 100644 --- a/docs/sdks/actions/README.md +++ b/docs/sdks/actions/README.md @@ -13,7 +13,7 @@ ## list -List the moderation actions of the project. The list is paginated. +List the moderation actions of the project, with their webhooks. An action is a decision that a reviewer or a rule can take on content or an author. Built-in actions (for example reject an item or block an author) change the item or author in Moderation API. Custom actions record the decision and send it to the webhooks of the action, where the customer platform acts on it. The list is paginated. ### Example Usage @@ -95,7 +95,7 @@ run(); ## create -Create an action. +Create an action that reviewers and rules can take. `type` sets what it does: a built-in type changes the item or author in Moderation API, and a custom type (`ITEM_CUSTOM`, `AUTHOR_CUSTOM`) only records the decision for the webhooks to deliver. Creating an action does not execute it. ### Example Usage @@ -179,7 +179,7 @@ run(); ## retrieve -Get an action by ID. +Get an action by ID: its type, where it shows in the review queues, the values it takes and its webhooks. ### Example Usage @@ -253,7 +253,7 @@ run(); ## update -Update an action. +Update the settings of an action: its name, type, queues and values. The new settings apply the next time the action is executed. Updating an action does not execute it. ### Example Usage @@ -403,7 +403,7 @@ run(); ## execute -Execute a moderation action on one or more content items. +Execute one action of the project, by ID or key, on content items or authors. A built-in action changes them in Moderation API (for example rejects the items or blocks the authors). Every executed action is recorded, and the project sends it to the webhooks of the action and to its other webhook endpoints, where the customer platform can act on it. List the actions first to see what each one does. ### Example Usage diff --git a/docs/sdks/content/README.md b/docs/sdks/content/README.md index fe78ae0..7a80a7e 100644 --- a/docs/sdks/content/README.md +++ b/docs/sdks/content/README.md @@ -164,7 +164,7 @@ run(); ## submit -Submit content +Moderate one piece of content: text, an image, a video, audio or an object with several fields. The project checks it against the policies of its channel and returns the result. Act on `recommendation.action` (allow, review or reject). The content is stored in the project unless `doNotStore` is set, and items to review go to the review queue. The project can send the result to its webhook endpoints. ### Example Usage diff --git a/docs/sdks/items/README.md b/docs/sdks/items/README.md index 89ece4e..e053a6a 100644 --- a/docs/sdks/items/README.md +++ b/docs/sdks/items/README.md @@ -11,7 +11,7 @@ ## list -List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. +List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` or `contentId` to resolve or unresolve an item. ### Example Usage @@ -94,7 +94,7 @@ run(); ## resolve -Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. +Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. `itemId` is the item `id` or your `contentId`. To also take a moderation action, use `POST /actions/execute`. ### Example Usage @@ -144,14 +144,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID. | -| `itemId` | *string* | :heavy_check_mark: | The item ID to resolve. | -| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response @@ -170,7 +170,7 @@ run(); ## resolveMany -Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. +Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`, and each ID is an item `id` or your `contentId`. IDs that match no item in the project are skipped and returned in `notFoundIds`. ### Example Usage @@ -256,7 +256,7 @@ run(); ## unresolve -Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. +Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. `itemId` is the item `id` or your `contentId`. ### Example Usage @@ -306,14 +306,14 @@ run(); ### Parameters -| Parameter | Type | Required | Description | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | The queue ID. | -| `itemId` | *string* | :heavy_check_mark: | The item ID to unresolve. | -| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `id` | *string* | :heavy_check_mark: | The queue ID. | +| `itemId` | *string* | :heavy_check_mark: | The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | ### Response diff --git a/docs/sdks/wordlist/README.md b/docs/sdks/wordlist/README.md index 64ca4b9..b5a9c9a 100644 --- a/docs/sdks/wordlist/README.md +++ b/docs/sdks/wordlist/README.md @@ -8,6 +8,7 @@ * [create](#create) - Create wordlist * [retrieve](#retrieve) - Get wordlist * [update](#update) - Update wordlist +* [delete](#delete) - Delete wordlist * [getEmbeddingStatus](#getembeddingstatus) - Get embedding status ## list @@ -319,6 +320,79 @@ run(); | errors.RateLimitError | 429 | application/json | | errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | +## delete + +Delete a wordlist and its words. Channels that use the wordlist do not block the delete: the wordlist is removed from their policies. `detachedChannelIds` lists those channels. This cannot be undone. + +### Example Usage + + +```typescript +import { ModerationApi } from "@moderation-api/sdk"; + +const moderationApi = new ModerationApi({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const result = await moderationApi.wordlist.delete(""); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { ModerationApiCore } from "@moderation-api/sdk/core.js"; +import { wordlistDelete } from "@moderation-api/sdk/funcs/wordlist-delete.js"; + +// Use `ModerationApiCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const moderationApi = new ModerationApiCore({ + secretKey: process.env["MODAPI_SECRET_KEY"] ?? "", +}); + +async function run() { + const res = await wordlistDelete(moderationApi, ""); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("wordlistDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | ID of the wordlist to delete | +| `projectId` | *string* | :heavy_minus_sign: | The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.DeleteWordlistResponse](../../models/operations/delete-wordlist-response.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| -------------------------------- | -------------------------------- | -------------------------------- | +| errors.AuthenticationError | 401 | application/json | +| errors.NotFoundError | 404 | application/json | +| errors.RateLimitError | 429 | application/json | +| errors.ModerationAPIDefaultError | 4XX, 5XX | \*/\* | + ## getEmbeddingStatus Get the current embedding progress status for a wordlist diff --git a/jsr.json b/jsr.json index 59ea71b..579b487 100644 --- a/jsr.json +++ b/jsr.json @@ -2,7 +2,7 @@ { "name": "@moderation-api/sdk", - "version": "5.3.0", + "version": "5.4.0", "exports": { ".": "./src/index.ts", "./models/errors": "./src/models/errors/index.ts", diff --git a/package.json b/package.json index 0f2156d..6728e0d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moderation-api/sdk", - "version": "5.3.0", + "version": "5.4.0", "author": "Moderation API", "license": "Apache-2.0", "type": "module", diff --git a/src/funcs/actions-create.ts b/src/funcs/actions-create.ts index b590830..cc6ad67 100644 --- a/src/funcs/actions-create.ts +++ b/src/funcs/actions-create.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Create an action * * @remarks - * Create an action. + * Create an action that reviewers and rules can take. `type` sets what it does: a built-in type changes the item or author in Moderation API, and a custom type (`ITEM_CUSTOM`, `AUTHOR_CUSTOM`) only records the decision for the webhooks to deliver. Creating an action does not execute it. */ export function actionsCreate( client: ModerationApiCore, diff --git a/src/funcs/actions-execute.ts b/src/funcs/actions-execute.ts index 46ed705..a2a17be 100644 --- a/src/funcs/actions-execute.ts +++ b/src/funcs/actions-execute.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Execute moderation action * * @remarks - * Execute a moderation action on one or more content items. + * Execute one action of the project, by ID or key, on content items or authors. A built-in action changes them in Moderation API (for example rejects the items or blocks the authors). Every executed action is recorded, and the project sends it to the webhooks of the action and to its other webhook endpoints, where the customer platform can act on it. List the actions first to see what each one does. */ export function actionsExecute( client: ModerationApiCore, diff --git a/src/funcs/actions-list.ts b/src/funcs/actions-list.ts index 11b66df..2e91f14 100644 --- a/src/funcs/actions-list.ts +++ b/src/funcs/actions-list.ts @@ -37,7 +37,7 @@ import { * List moderation actions * * @remarks - * List the moderation actions of the project. The list is paginated. + * List the moderation actions of the project, with their webhooks. An action is a decision that a reviewer or a rule can take on content or an author. Built-in actions (for example reject an item or block an author) change the item or author in Moderation API. Custom actions record the decision and send it to the webhooks of the action, where the customer platform acts on it. The list is paginated. */ export function actionsList( client: ModerationApiCore, diff --git a/src/funcs/actions-retrieve.ts b/src/funcs/actions-retrieve.ts index 38a706e..11d64b1 100644 --- a/src/funcs/actions-retrieve.ts +++ b/src/funcs/actions-retrieve.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Get an action * * @remarks - * Get an action by ID. + * Get an action by ID: its type, where it shows in the review queues, the values it takes and its webhooks. */ export function actionsRetrieve( client: ModerationApiCore, diff --git a/src/funcs/actions-update.ts b/src/funcs/actions-update.ts index 46b9b67..3366c12 100644 --- a/src/funcs/actions-update.ts +++ b/src/funcs/actions-update.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Update an action * * @remarks - * Update an action. + * Update the settings of an action: its name, type, queues and values. The new settings apply the next time the action is executed. Updating an action does not execute it. */ export function actionsUpdate( client: ModerationApiCore, diff --git a/src/funcs/content-submit.ts b/src/funcs/content-submit.ts index 5913733..4bfaf49 100644 --- a/src/funcs/content-submit.ts +++ b/src/funcs/content-submit.ts @@ -29,6 +29,9 @@ import { Result } from "../types/fp.js"; /** * Submit content + * + * @remarks + * Moderate one piece of content: text, an image, a video, audio or an object with several fields. The project checks it against the policies of its channel and returns the result. Act on `recommendation.action` (allow, review or reject). The content is stored in the project unless `doNotStore` is set, and items to review go to the review queue. The project can send the result to its webhook endpoints. */ export function contentSubmit( client: ModerationApiCore, diff --git a/src/funcs/queue-items-list.ts b/src/funcs/queue-items-list.ts index 8f10da8..6e68b41 100644 --- a/src/funcs/queue-items-list.ts +++ b/src/funcs/queue-items-list.ts @@ -37,7 +37,7 @@ import { * List queue items * * @remarks - * List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. + * List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` or `contentId` to resolve or unresolve an item. */ export function queueItemsList( client: ModerationApiCore, diff --git a/src/funcs/queue-items-resolve-many.ts b/src/funcs/queue-items-resolve-many.ts index dd5e84d..bf55052 100644 --- a/src/funcs/queue-items-resolve-many.ts +++ b/src/funcs/queue-items-resolve-many.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Resolve queue items * * @remarks - * Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. + * Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`, and each ID is an item `id` or your `contentId`. IDs that match no item in the project are skipped and returned in `notFoundIds`. */ export function queueItemsResolveMany( client: ModerationApiCore, diff --git a/src/funcs/queue-items-resolve.ts b/src/funcs/queue-items-resolve.ts index 7e78626..15e3d41 100644 --- a/src/funcs/queue-items-resolve.ts +++ b/src/funcs/queue-items-resolve.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Resolve a queue item * * @remarks - * Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. + * Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. `itemId` is the item `id` or your `contentId`. To also take a moderation action, use `POST /actions/execute`. */ export function queueItemsResolve( client: ModerationApiCore, diff --git a/src/funcs/queue-items-unresolve.ts b/src/funcs/queue-items-unresolve.ts index 4a8d75c..8b5ecaa 100644 --- a/src/funcs/queue-items-unresolve.ts +++ b/src/funcs/queue-items-unresolve.ts @@ -31,7 +31,7 @@ import { Result } from "../types/fp.js"; * Unresolve a queue item * * @remarks - * Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. + * Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. `itemId` is the item `id` or your `contentId`. */ export function queueItemsUnresolve( client: ModerationApiCore, diff --git a/src/funcs/wordlist-delete.ts b/src/funcs/wordlist-delete.ts new file mode 100644 index 0000000..15b7663 --- /dev/null +++ b/src/funcs/wordlist-delete.ts @@ -0,0 +1,197 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { ModerationApiCore } from "../core.js"; +import { encodeSimple } from "../lib/encodings.js"; +import { matchStatusCode } from "../lib/http.js"; +import * as M from "../lib/matchers.js"; +import { compactMap } from "../lib/primitives.js"; +import { safeParse } from "../lib/schemas.js"; +import { RequestOptions } from "../lib/sdks.js"; +import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; +import { pathToFunc } from "../lib/url.js"; +import { + ConnectionError, + InvalidRequestError, + RequestAbortedError, + RequestTimeoutError, + UnexpectedClientError, +} from "../models/errors/http-client-errors.js"; +import * as errors from "../models/errors/index.js"; +import { ModerationAPIError } from "../models/errors/moderation-api-error.js"; +import { ResponseValidationError } from "../models/errors/response-validation-error.js"; +import { SDKValidationError } from "../models/errors/sdk-validation-error.js"; +import * as operations from "../models/operations/index.js"; +import { APICall, APIPromise } from "../types/async.js"; +import { Result } from "../types/fp.js"; + +/** + * Delete wordlist + * + * @remarks + * Delete a wordlist and its words. Channels that use the wordlist do not block the delete: the wordlist is removed from their policies. `detachedChannelIds` lists those channels. This cannot be undone. + */ +export function wordlistDelete( + client: ModerationApiCore, + id: string, + projectId?: string | undefined, + options?: RequestOptions, +): APIPromise< + Result< + operations.DeleteWordlistResponse, + | errors.AuthenticationError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + > +> { + return new APIPromise($do( + client, + id, + projectId, + options, + )); +} + +async function $do( + client: ModerationApiCore, + id: string, + projectId?: string | undefined, + options?: RequestOptions, +): Promise< + [ + Result< + operations.DeleteWordlistResponse, + | errors.AuthenticationError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >, + APICall, + ] +> { + const input: operations.DeleteWordlistRequest = { + id: id, + projectId: projectId, + }; + + const parsed = safeParse( + input, + (value) => z.parse(operations.DeleteWordlistRequest$outboundSchema, value), + "Input validation failed", + ); + if (!parsed.ok) { + return [parsed, { status: "invalid" }]; + } + const payload = parsed.value; + const body = null; + + const pathParams = { + id: encodeSimple("id", payload.id, { + explode: false, + charEncoding: "percent", + }), + }; + const path = pathToFunc("/wordlist/{id}")(pathParams); + + const headers = new Headers(compactMap({ + Accept: "application/json", + "Project-Id": encodeSimple("Project-Id", payload.projectId, { + explode: false, + charEncoding: "none", + }), + })); + + const secConfig = await extractSecurity(client._options.secretKey); + const securityInput = secConfig == null ? {} : { secretKey: secConfig }; + const requestSecurity = resolveGlobalSecurity(securityInput); + + const context = { + options: client._options, + baseURL: options?.serverURL ?? client._baseURL ?? "", + operationID: "deleteWordlist", + oAuth2Scopes: null, + + resolvedSecurity: requestSecurity, + + securitySource: client._options.secretKey, + retryConfig: options?.retries + || client._options.retryConfig + || { strategy: "none" }, + retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"], + }; + + const requestRes = client._createRequest(context, { + security: requestSecurity, + method: "DELETE", + baseURL: options?.serverURL, + path: path, + headers: headers, + body: body, + userAgent: client._options.userAgent, + timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, + }, options); + if (!requestRes.ok) { + return [requestRes, { status: "invalid" }]; + } + const req = requestRes.value; + + const doResult = await client._do(req, { + context, + isErrorStatusCode: (statusCode: number) => + matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]), + retryConfig: context.retryConfig, + retryCodes: context.retryCodes, + }); + if (!doResult.ok) { + return [doResult, { status: "request-error", request: req }]; + } + const response = doResult.value; + + const responseFields = { + HttpMeta: { Response: response, Request: req }, + }; + + const [result] = await M.match< + operations.DeleteWordlistResponse, + | errors.AuthenticationError + | errors.NotFoundError + | errors.RateLimitError + | ModerationAPIError + | ResponseValidationError + | ConnectionError + | RequestAbortedError + | RequestTimeoutError + | InvalidRequestError + | UnexpectedClientError + | SDKValidationError + >( + M.json(200, operations.DeleteWordlistResponse$inboundSchema), + M.jsonErr(401, errors.AuthenticationError$inboundSchema), + M.jsonErr(404, errors.NotFoundError$inboundSchema), + M.jsonErr(429, errors.RateLimitError$inboundSchema), + M.fail("4XX"), + M.fail("5XX"), + )(response, req, { extraFields: responseFields }); + if (!result.ok) { + return [result, { status: "complete", request: req, response }]; + } + + return [result, { status: "complete", request: req, response }]; +} diff --git a/src/lib/config.ts b/src/lib/config.ts index 44bd41a..ce2e828 100644 --- a/src/lib/config.ts +++ b/src/lib/config.ts @@ -58,8 +58,8 @@ export function serverURLFromOptions(options: SDKOptions): URL | null { export const SDK_METADATA = { language: "typescript", openapiDocVersion: "1.1.0", - sdkVersion: "5.3.0", + sdkVersion: "5.4.0", genVersion: "internal", userAgent: - "speakeasy-sdk/typescript 5.3.0 internal 1.1.0 @moderation-api/sdk", + "speakeasy-sdk/typescript 5.4.0 internal 1.1.0 @moderation-api/sdk", } as const; diff --git a/src/models/operations/delete-wordlist.ts b/src/models/operations/delete-wordlist.ts new file mode 100644 index 0000000..e28bc21 --- /dev/null +++ b/src/models/operations/delete-wordlist.ts @@ -0,0 +1,81 @@ +/* + * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. + */ + +import * as z from "zod/v4-mini"; +import { safeParse } from "../../lib/schemas.js"; +import { Result as SafeParseResult } from "../../types/fp.js"; +import * as types from "../../types/primitives.js"; +import { SDKValidationError } from "../errors/sdk-validation-error.js"; + +export type DeleteWordlistRequest = { + /** + * ID of the wordlist to delete + */ + id: string; + /** + * The project to act on, by ID or name. Required with an organization key unless the key reaches only one project; list projects with GET /projects. A project key acts on its own project and needs no value: naming another one is an error. + */ + projectId?: string | undefined; +}; + +/** + * Wordlist deleted successfully + */ +export type DeleteWordlistResponse = { + /** + * ID of the deleted wordlist + */ + id: string; + /** + * Whether the wordlist was deleted + */ + deleted: boolean; + /** + * IDs of the channels that used the wordlist. It was removed from them. + */ + detachedChannelIds: Array; +}; + +/** @internal */ +export type DeleteWordlistRequest$Outbound = { + id: string; + projectId?: string | undefined; +}; + +/** @internal */ +export const DeleteWordlistRequest$outboundSchema: z.ZodMiniType< + DeleteWordlistRequest$Outbound, + DeleteWordlistRequest +> = z.object({ + id: z.string(), + projectId: z.optional(z.string()), +}); + +export function deleteWordlistRequestToJSON( + deleteWordlistRequest: DeleteWordlistRequest, +): string { + return JSON.stringify( + DeleteWordlistRequest$outboundSchema.parse(deleteWordlistRequest), + ); +} + +/** @internal */ +export const DeleteWordlistResponse$inboundSchema: z.ZodMiniType< + DeleteWordlistResponse, + unknown +> = z.object({ + id: types.string(), + deleted: types.boolean(), + detachedChannelIds: z.array(types.string()), +}); + +export function deleteWordlistResponseFromJSON( + jsonString: string, +): SafeParseResult { + return safeParse( + jsonString, + (x) => DeleteWordlistResponse$inboundSchema.parse(JSON.parse(x)), + `Failed to parse 'DeleteWordlistResponse' from JSON`, + ); +} diff --git a/src/models/operations/index.ts b/src/models/operations/index.ts index ae9bcf3..5122be5 100644 --- a/src/models/operations/index.ts +++ b/src/models/operations/index.ts @@ -18,6 +18,7 @@ export * from "./delete-author.js"; export * from "./delete-channel.js"; export * from "./delete-project.js"; export * from "./delete-webhook.js"; +export * from "./delete-wordlist.js"; export * from "./duplicate-channel.js"; export * from "./duplicate-project.js"; export * from "./execute-action.js"; diff --git a/src/models/operations/list-queue-items.ts b/src/models/operations/list-queue-items.ts index 0779fb4..5fc85cf 100644 --- a/src/models/operations/list-queue-items.ts +++ b/src/models/operations/list-queue-items.ts @@ -15,6 +15,7 @@ export const Sort = { Lifo: "LIFO", Random: "RANDOM", SeverityDesc: "SEVERITY_DESC", + RobocallDesc: "ROBOCALL_DESC", } as const; export type Sort = ClosedEnum; diff --git a/src/models/operations/resolve-queue-item.ts b/src/models/operations/resolve-queue-item.ts index 64f387a..562ea5e 100644 --- a/src/models/operations/resolve-queue-item.ts +++ b/src/models/operations/resolve-queue-item.ts @@ -14,7 +14,7 @@ export type ResolveQueueItemRequest = { */ id: string; /** - * The item ID to resolve. + * The item to resolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. */ itemId: string; /** diff --git a/src/models/operations/resolve-queue-items.ts b/src/models/operations/resolve-queue-items.ts index afa2327..ccca704 100644 --- a/src/models/operations/resolve-queue-items.ts +++ b/src/models/operations/resolve-queue-items.ts @@ -10,7 +10,7 @@ import { SDKValidationError } from "../errors/sdk-validation-error.js"; export type ResolveQueueItemsRequestBody = { /** - * The item IDs to resolve. Up to 100. + * The items to resolve, up to 100. Each is the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. */ itemIds: Array; }; @@ -36,7 +36,7 @@ export type ResolveQueueItemsResponse = { */ resolved: number; /** - * Item IDs that do not exist in the project. + * IDs from `itemIds` that match no item or content ID in the project. */ notFoundIds: Array; }; diff --git a/src/models/operations/submit-content.ts b/src/models/operations/submit-content.ts index eec194c..69450f0 100644 --- a/src/models/operations/submit-content.ts +++ b/src/models/operations/submit-content.ts @@ -260,7 +260,7 @@ export type UnicodeSpoofing = { threshold?: number | undefined; id: "unicode_spoofing"; /** - * Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. + * Per-signal flag toggles. Omitted spoofing signals are enabled; encoding_damage defaults to off because decode damage (U+FFFD) marks a broken pipeline, not an attack, and hidden_lookalike and leetspeak default to off because they are opt-in. A disabled signal is still detected and reported as a label, but does not by itself flag the policy. Lookalike words are only spelled out in the cleaned text when their signal is enabled. */ signals?: { [k: string]: SignalsRequest } | undefined; }; diff --git a/src/models/operations/unresolve-queue-item.ts b/src/models/operations/unresolve-queue-item.ts index ef9359d..15da8f2 100644 --- a/src/models/operations/unresolve-queue-item.ts +++ b/src/models/operations/unresolve-queue-item.ts @@ -16,7 +16,7 @@ export type UnresolveQueueItemRequest = { */ id: string; /** - * The item ID to unresolve. + * The item to unresolve: the item `id` from `GET /queue/{id}/items`, or the `contentId` you sent to `POST /moderate` (webhooks send it as `item.id`). For a content ID, the newest submission with that content ID is used, as the queue shows it. */ itemId: string; /** diff --git a/src/models/queue-item.ts b/src/models/queue-item.ts index e8ce75e..a925657 100644 --- a/src/models/queue-item.ts +++ b/src/models/queue-item.ts @@ -218,11 +218,11 @@ export type QueueItemStatus = OpenEnum; export type QueueItem = { /** - * The item ID. Use it to resolve or unresolve the item in this queue. + * The item ID: the ID of this submission. Use it, or `contentId`, to resolve or unresolve the item in this queue. */ id: string; /** - * Your content ID, as you sent it to `POST /moderate`. + * Your content ID, as you sent it to `POST /moderate`. Webhooks send it as `item.id`. The resolve endpoints accept it in place of `id`. */ contentId: string; /** diff --git a/src/sdk/actions.ts b/src/sdk/actions.ts index 613bffc..14b6769 100644 --- a/src/sdk/actions.ts +++ b/src/sdk/actions.ts @@ -18,7 +18,7 @@ export class Actions extends ClientSDK { * List moderation actions * * @remarks - * List the moderation actions of the project. The list is paginated. + * List the moderation actions of the project, with their webhooks. An action is a decision that a reviewer or a rule can take on content or an author. Built-in actions (for example reject an item or block an author) change the item or author in Moderation API. Custom actions record the decision and send it to the webhooks of the action, where the customer platform acts on it. The list is paginated. */ async list( queueId?: string | undefined, @@ -41,7 +41,7 @@ export class Actions extends ClientSDK { * Create an action * * @remarks - * Create an action. + * Create an action that reviewers and rules can take. `type` sets what it does: a built-in type changes the item or author in Moderation API, and a custom type (`ITEM_CUSTOM`, `AUTHOR_CUSTOM`) only records the decision for the webhooks to deliver. Creating an action does not execute it. */ async create( body: operations.CreateActionRequestBody, @@ -60,7 +60,7 @@ export class Actions extends ClientSDK { * Get an action * * @remarks - * Get an action by ID. + * Get an action by ID: its type, where it shows in the review queues, the values it takes and its webhooks. */ async retrieve( id: string, @@ -79,7 +79,7 @@ export class Actions extends ClientSDK { * Update an action * * @remarks - * Update an action. + * Update the settings of an action: its name, type, queues and values. The new settings apply the next time the action is executed. Updating an action does not execute it. */ async update( id: string, @@ -119,7 +119,7 @@ export class Actions extends ClientSDK { * Execute moderation action * * @remarks - * Execute a moderation action on one or more content items. + * Execute one action of the project, by ID or key, on content items or authors. A built-in action changes them in Moderation API (for example rejects the items or blocks the authors). Every executed action is recorded, and the project sends it to the webhooks of the action and to its other webhook endpoints, where the customer platform can act on it. List the actions first to see what each one does. */ async execute( body: operations.ExecuteActionRequestBody, diff --git a/src/sdk/content.ts b/src/sdk/content.ts index 67d84e6..5e69b59 100644 --- a/src/sdk/content.ts +++ b/src/sdk/content.ts @@ -54,6 +54,9 @@ export class Content extends ClientSDK { /** * Submit content + * + * @remarks + * Moderate one piece of content: text, an image, a video, audio or an object with several fields. The project checks it against the policies of its channel and returns the result. Act on `recommendation.action` (allow, review or reject). The content is stored in the project unless `doNotStore` is set, and items to review go to the review queue. The project can send the result to its webhook endpoints. */ async submit( body: operations.SubmitContentRequestBody, diff --git a/src/sdk/items.ts b/src/sdk/items.ts index 1cb42f2..a204e6f 100644 --- a/src/sdk/items.ts +++ b/src/sdk/items.ts @@ -16,7 +16,7 @@ export class Items extends ClientSDK { * List queue items * * @remarks - * List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` to resolve or unresolve an item. + * List the items of a review queue, with the filters and the date window of the queue applied. By default only pending items. The list is paginated. Use the item `id` or `contentId` to resolve or unresolve an item. */ async list( request: operations.ListQueueItemsRequest, @@ -35,7 +35,7 @@ export class Items extends ClientSDK { * Resolve a queue item * * @remarks - * Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. To also take a moderation action, use `POST /actions/execute`. + * Mark an item of a queue as resolved. It is the same as a check-off in the dashboard: the item leaves the pending list and a QUEUE_ITEM_COMPLETED webhook is sent. `itemId` is the item `id` or your `contentId`. To also take a moderation action, use `POST /actions/execute`. */ async resolve( id: string, @@ -56,7 +56,7 @@ export class Items extends ClientSDK { * Resolve queue items * * @remarks - * Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`. IDs that do not exist in the project are skipped and returned in `notFoundIds`. + * Mark up to 100 items of a queue as resolved in one request. Each item is resolved the same as with `POST /queue/{id}/items/{itemId}/resolve`, and each ID is an item `id` or your `contentId`. IDs that match no item in the project are skipped and returned in `notFoundIds`. */ async resolveMany( id: string, @@ -77,7 +77,7 @@ export class Items extends ClientSDK { * Unresolve a queue item * * @remarks - * Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. + * Mark a resolved item of a queue as pending again. It is the same as removing a check-off in the dashboard: the item comes back in the pending list. `itemId` is the item `id` or your `contentId`. */ async unresolve( id: string, diff --git a/src/sdk/wordlist.ts b/src/sdk/wordlist.ts index 0905e10..80e4fc4 100644 --- a/src/sdk/wordlist.ts +++ b/src/sdk/wordlist.ts @@ -3,6 +3,7 @@ */ import { wordlistCreate } from "../funcs/wordlist-create.js"; +import { wordlistDelete } from "../funcs/wordlist-delete.js"; import { wordlistGetEmbeddingStatus } from "../funcs/wordlist-get-embedding-status.js"; import { wordlistList } from "../funcs/wordlist-list.js"; import { wordlistRetrieve } from "../funcs/wordlist-retrieve.js"; @@ -99,6 +100,25 @@ export class Wordlist extends ClientSDK { )); } + /** + * Delete wordlist + * + * @remarks + * Delete a wordlist and its words. Channels that use the wordlist do not block the delete: the wordlist is removed from their policies. `detachedChannelIds` lists those channels. This cannot be undone. + */ + async delete( + id: string, + projectId?: string | undefined, + options?: RequestOptions, + ): Promise { + return unwrapAsync(wordlistDelete( + this, + id, + projectId, + options, + )); + } + /** * Get embedding status *