From 8efca4e63f1e7ad86b031e55d46a60bc316e64fd Mon Sep 17 00:00:00 2001 From: domantassniezkawix Date: Fri, 19 Apr 2024 17:42:18 +0300 Subject: [PATCH] Added forums subscribe functions --- .../wix-forum-v2/Categories.service.json | 245 ++++++++++++++++-- wix-forum-v2/wix-forum-v2/Events.service.json | 76 ++++++ 2 files changed, 303 insertions(+), 18 deletions(-) diff --git a/wix-forum-v2/wix-forum-v2/Categories.service.json b/wix-forum-v2/wix-forum-v2/Categories.service.json index 14e7ad0451..b099877fbc 100644 --- a/wix-forum-v2/wix-forum-v2/Categories.service.json +++ b/wix-forum-v2/wix-forum-v2/Categories.service.json @@ -208,7 +208,145 @@ " } catch (error) {", " console.error(error);", " // Handle the error", - " }", + { + "name": "subscribeContactToCategory", + "params": [ + { + "name": "categoryId", + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Category ID.", + "required": true + }, + { + "name": "options", + "type": [ + { + "referenceType": "wix-forum-v2.Categories.SubscribeContactToCategoryOptions" + } + ], + "doc": "Options for subscribing the contact.", + "required": false + } + ], + "requiredFields": [ + "categoryId" + ], + "ret": { + "type": [ + { + "complexType": { + "nativeType": "Promise", + "typeParams": [ + { + "nativeType": "void" + } + ] + } + } + ], + "doc": null + }, + "docs": { + "summary": "Subscribes a contact to a specific forum category.", + "description": [ + "By default a contact isn't subscribed to any forum categories.\n\nBy subscribing a contact to a category, the contact receives notifications for that category.\n\nIf `contactId` is not provided, it is implicitly resolved from the caller's context." + ], + "examples": [ + { + "title": "subscribeContactToCategory example", + "body": [ + "import { categories } from '@wix/wix-forum.v2';", + " ", + " async function subscribeContactToCategory(categoryId, options) {", + " try {", + " const result = await categories.subscribeContactToCategory(categoryId, options);", + "", + " return result;", + " } catch (error) {", + " console.error(error);", + " // Handle the error", + " }", + " }", + " " + ] + } + ] + }, + "isVeloEvent": false, + "customLabels": [ + { + "id": "maturity-beta" + } + ], + "syntaxName": "subscribeContactToCategory", + "isAdminMethod": true + }, + { + "name": "unsubscribeContactFromCategory", + "params": [ + { + "name": "categoryId", + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Category ID.", + "required": true + }, + { + "name": "options", + "type": [ + { + "referenceType": "wix-forum-v2.Categories.UnsubscribeContactFromCategoryOptions" + } + ], + "doc": "Options for unsubscribing the contact.", + "required": false + } + ], + "requiredFields": [ + "categoryId" + ], + "ret": { + "type": [ + { + "complexType": { + "nativeType": "Promise", + "typeParams": [ + { + "nativeType": "void" + } + ] + } + } + ], + "doc": null + }, + "docs": { + "summary": "Unsubscribes a contact from a specific forum category.", + "description": [ + "By default a contact isn't subscribed to any forum categories.\n\nBy unsubscribing a contact from a category, the contact won’t receive notifications for that category.\n\nIf `contactId` is not provided, it is implicitly resolved from the caller's context." + ], + "examples": [ + { + "title": "unsubscribeContactFromCategory example", + "body": [ + "import { categories } from '@wix/wix-forum.v2';", + " ", + " async function unsubscribeContactFromCategory(categoryId, options) {", + " try {", + " const result = await categories.unsubscribeContactFromCategory(categoryId, options);", + "", + " return result;", + " } catch (error) {", + " console.error(error);", + " // Handle the error", + " }", " }", " " ] @@ -220,7 +358,9 @@ { "id": "maturity-beta" } - ] + ], + "syntaxName": "unsubscribeContactFromCategory", + "isAdminMethod": true } ], "messages": [ @@ -1190,18 +1330,85 @@ } }, { - "name": "UpdateCategoryRequest", + "name": "SubscribeContactToCategoryOptions", "members": [ { - "name": "category", + "name": "contactId", "optional": true, "type": [ { - "referenceType": "wix-forum-v2.Categories.Category" + "nativeType": "string" } ], - "doc": "Editable category data." + "doc": "Contact ID." + } + ], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "SubscribeContactToCategoryRequest", + "members": [ + { + "name": "categoryId", + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Category ID." }, + { + "name": "contactId", + "optional": true, + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Contact ID." + } + ], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "SubscribeContactToCategoryResponse", + "members": [], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "UnsubscribeContactFromCategoryOptions", + "members": [ + { + "name": "contactId", + "optional": true, + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Contact ID." + } + ], + "docs": { + "description": [ + "" + ] + } + { + "name": "UnsubscribeContactFromCategoryRequest", + "members": [ { "name": "categoryId", "type": [ @@ -1209,24 +1416,17 @@ "nativeType": "string" } ], - "doc": "ID of category." + "doc": "Category ID." }, { - "name": "fieldMask", + "name": "contactId", "optional": true, "type": [ { - "complexType": { - "nativeType": "Array", - "typeParams": [ - { - "nativeType": "string" - } - ] - } + "nativeType": "string" } ], - "doc": "Field mask of fields to update." + "doc": "Contact ID." } ], "docs": { @@ -1234,6 +1434,15 @@ "" ] } - } + }, + { + "name": "UnsubscribeContactFromCategoryResponse", + "members": [], + "docs": { + "description": [ + "" + ] + } + }, ] } diff --git a/wix-forum-v2/wix-forum-v2/Events.service.json b/wix-forum-v2/wix-forum-v2/Events.service.json index 5f9647cb34..329aac6739 100644 --- a/wix-forum-v2/wix-forum-v2/Events.service.json +++ b/wix-forum-v2/wix-forum-v2/Events.service.json @@ -1719,6 +1719,82 @@ ] } }, + { + "name": "forumV1CategorySubscribeContactToCategoryRequest", + "members": [ + { + "name": "categoryId", + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Category ID." + }, + { + "name": "contactId", + "optional": true, + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Contact ID." + } + ], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "forumV1CategorySubscribeContactToCategoryResponse", + "members": [], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "forumV1CategoryUnsubscribeContactFromCategoryRequest", + "members": [ + { + "name": "categoryId", + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Category ID." + }, + { + "name": "contactId", + "optional": true, + "type": [ + { + "nativeType": "string" + } + ], + "doc": "Contact ID." + } + ], + "docs": { + "description": [ + "" + ] + } + }, + { + "name": "forumV1CategoryUnsubscribeContactFromCategoryResponse", + "members": [], + "docs": { + "description": [ + "" + ] + } + }, { "name": "forumV1CategoryUpdateCategoryRequest", "members": [