diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index 49cb0eb..de9e877 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: 29c7bb10b9655dcfe925eacf9d5f4758 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: @@ -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: @@ -798,7 +802,7 @@ trackedFiles: 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,9 +824,9 @@ 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: @@ -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: @@ -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: @@ -1178,7 +1186,7 @@ trackedFiles: 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..e6db07f 100644 --- a/.speakeasy/openapi.json +++ b/.speakeasy/openapi.json @@ -3033,7 +3033,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" ], @@ -3281,7 +3281,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 +3306,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", @@ -3414,7 +3414,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 +3459,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 +3492,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": [ @@ -3571,7 +3571,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 +3596,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", @@ -8622,6 +8622,116 @@ "readOnlyHint": false, "destructiveHint": true } + }, + "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 + } } }, "/wordlist/{id}/embedding-status": { @@ -10174,13 +10284,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", @@ -13528,11 +13640,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..e29fdc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # Changelog +## 5.4.0 (2026-10-29) + +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/` +- `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/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/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/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/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/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 *