@wix/auto_sdk_comments_votes 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/comments-v1-vote-votes.universal.ts","../../src/comments-v1-vote-votes.http.ts"],"sourcesContent":["export * from './src/comments-v1-vote-votes.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCommentsV1Vote from './comments-v1-vote-votes.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/** An upvote or downvote cast by one identity on a resource in an app context. */\nexport interface Vote {\n /**\n * Vote resource ID\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Resource fully qualified domain name\n * @maxLength 300\n */\n resourceFqdn?: string;\n /**\n * Vote ID\n * @format GUID\n * @readonly\n */\n voteId?: string;\n /**\n * Type of vote\n * @readonly\n */\n type?: TypeWithLiterals;\n /**\n * Vote author\n * @readonly\n */\n createdBy?: SocialIdentity;\n /**\n * Vote created date\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Vote updated date\n * @readonly\n */\n _updatedDate?: Date | null;\n /** Vote context, defining where the vote belongs to */\n context?: VoteContext;\n /**\n * Vote revision\n * @readonly\n */\n revision?: string;\n}\n\n/** Type of vote */\nexport enum Type {\n UNKNOWN = 'UNKNOWN',\n UPVOTE = 'UPVOTE',\n DOWNVOTE = 'DOWNVOTE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNKNOWN' | 'UPVOTE' | 'DOWNVOTE';\n\nexport interface SocialIdentity {\n /** @format GUID */\n identityId?: string;\n identityType?: IdentityTypeWithLiterals;\n}\n\nexport enum IdentityType {\n ANONYMOUS = 'ANONYMOUS',\n MEMBER = 'MEMBER',\n USER = 'USER',\n SERVICE = 'SERVICE',\n /** indicates everyone who is a member of a group */\n MEMBER_GROUP = 'MEMBER_GROUP',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n | IdentityType\n | 'ANONYMOUS'\n | 'MEMBER'\n | 'USER'\n | 'SERVICE'\n | 'MEMBER_GROUP';\n\nexport interface VoteContext {\n /**\n * Context ID\n * @maxLength 128\n */\n contextId?: string;\n /** Context type */\n contextType?: string | null;\n /**\n * Vote app ID\n * @format GUID\n * @readonly\n */\n appDefId?: string;\n /**\n * MetaSite ID\n * @format GUID\n * @readonly\n */\n metaSiteId?: string;\n}\n\nexport interface UpvoteRequest {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * resource identifier for vote be cast on\n * @maxLength 128\n */\n resourceId: string;\n /**\n * resource name\n * @maxLength 300\n */\n resourceFqdn: string;\n /** context data */\n contextData?: ContextData;\n}\n\n/**\n * Identifies the app and context containing the resource.\n * When provided, contextData takes precedence over the deprecated contextToken.\n */\nexport interface ContextData {\n /**\n * ID of the app that owns the context.\n * @format GUID\n */\n appDefId?: string;\n /**\n * ID of the context containing the resource.\n * @maxLength 128\n */\n contextId?: string;\n /** Optional type used by the app to resolve its context. */\n contextType?: string | null;\n}\n\nexport interface UpvoteResponse {\n /** created vote */\n vote?: Vote;\n}\n\nexport interface ContextResourceVoteChange {\n /**\n * Resource ID\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Resource fully qualified domain name\n * @maxLength 300\n */\n resourceFqdn?: string;\n /** Score of votes */\n score?: number;\n /** Upvote count */\n upvoteCount?: number;\n /** Downvote count */\n downvoteCount?: number;\n /** Vote context */\n context?: VoteContext;\n}\n\nexport interface VoteCast {\n /** Vote */\n vote?: Vote;\n}\n\nexport interface DownvoteRequest {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * resource identifier for vote be cast on\n * @maxLength 128\n */\n resourceId: string;\n /**\n * resource name\n * @maxLength 300\n */\n resourceFqdn: string;\n /** context data */\n contextData?: ContextData;\n}\n\nexport interface DownvoteResponse {\n /** created vote */\n vote?: Vote;\n}\n\nexport interface UpdateVoteRequest {\n /** vote to be updated, may be partial and include only VoteId and the field to change */\n vote?: Vote;\n /**\n * explicit list of fields to update\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdateVoteResponse {\n /** updated vote */\n vote?: Vote;\n}\n\nexport interface RemoveVoteRequest {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** id of the vote which will be deleted */\n voteId: string;\n /** context data */\n contextData?: ContextData;\n}\n\nexport interface RemoveVoteResponse {\n /** removed vote */\n vote?: Vote;\n}\n\nexport interface VoteDeleted {\n /** Vote */\n vote?: Vote;\n}\n\nexport interface QueryVotesRequest {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** query request. Filter supports only \"resourceId\" field. Fields and Fieldset are not supported */\n query?: QueryV2;\n /** context data */\n contextData?: ContextData;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n */\n sort?: Sorting[];\n /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */\n fields?: string[];\n /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n /**\n * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n *\n * If multiple filters are provided, they are combined with AND operator.\n *\n * Example:\n * Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n * { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] }\n * @internal\n * @maxSize 10\n */\n selectItemsBy?: Record<string, any>[] | null;\n /**\n * Origin point for geo-distance sorting on a GEO field\n * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).\n */\n origin?: AddressLocation;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryVotesResponse {\n /** matching votes */\n votes?: Vote[];\n /** paging metadata. Only contains cursors */\n paging?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n * @internal\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetResourceVoteSummaryRequest {\n /** appDef ID */\n appDefId?: string;\n /** context ID */\n contextId?: string;\n /** resource ID */\n resourceId?: string;\n}\n\nexport interface GetResourceVoteSummaryResponse {\n /** Resource vote summary */\n summary?: ResourceVoteSummary;\n}\n\nexport interface ResourceVoteSummary {\n /** vote context */\n context?: VoteContext;\n /** resource ID */\n resourceId?: string;\n /** vote score */\n score?: number;\n /** upvote count */\n upvoteCount?: number;\n /** downvote count */\n downvoteCount?: number;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface ImportVoteRequest {\n /** metaSite ID */\n metaSiteId?: string;\n /** vote to import */\n vote?: ImportVote;\n}\n\nexport interface ImportVote {\n /**\n * Resource ID\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Resource fully qualified domain name\n * @maxLength 300\n */\n resourceFqdn?: string;\n /**\n * Vote ID\n * @format GUID\n */\n voteId?: string;\n /** Type of vote */\n type?: TypeWithLiterals;\n /** Vote author */\n createdBy?: SocialIdentity;\n /** Vote creation date */\n _createdDate?: Date | null;\n /** Vote update date */\n _updatedDate?: Date | null;\n /** Vote context */\n context?: VoteContext;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type UpvoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DownvoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type RemoveVoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'VOTE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type QueryVotesApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_FIELDS';\n description?: string;\n data?: Record<string, any>;\n };\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface VoteContextResourceVoteChangeEnvelope {\n data: ContextResourceVoteChange;\n metadata: EventMetadata;\n}\n\n/** @webhook\n * @eventType wix.comments.v1.vote_context_resource_vote_change\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug context_resource_vote_change\n * @documentationMaturity preview\n */\nexport declare function onVoteContextResourceVoteChange(\n handler: (\n event: VoteContextResourceVoteChangeEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface VoteCastEnvelope {\n data: VoteCast;\n metadata: EventMetadata;\n}\n\n/** @webhook\n * @eventType wix.comments.v1.vote_vote_cast\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug vote_cast\n * @documentationMaturity preview\n */\nexport declare function onVoteCast(\n handler: (event: VoteCastEnvelope) => void | Promise<void>\n): void;\n\nexport interface VoteDeletedEnvelope {\n data: VoteDeleted;\n metadata: EventMetadata;\n}\n\n/** @webhook\n * @eventType wix.comments.v1.vote_vote_deleted\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug vote_deleted\n * @documentationMaturity preview\n */\nexport declare function onVoteDeleted(\n handler: (event: VoteDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Casts an upvote on a resource for the current identity.\n * Changes an existing downvote to an upvote. Repeating an upvote does not remove it.\n * Provide contextData for the app and context. Context voting permissions apply.\n * Authorization is enforced by the service for the current identity and context.\n * @public\n * @documentationMaturity preview\n * @requiredField options.resourceFqdn\n * @requiredField options.resourceId\n * @fqn com.wixpress.comments.Votes.Upvote\n */\nexport async function upvote(\n options?: NonNullablePaths<UpvoteOptions, `resourceFqdn` | `resourceId`, 2>\n): Promise<\n NonNullablePaths<\n UpvoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 4\n > & {\n __applicationErrorsType?: UpvoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contextToken: options?.contextToken,\n resourceId: options?.resourceId,\n resourceFqdn: options?.resourceFqdn,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.upvote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n contextToken: '$[0].contextToken',\n resourceId: '$[0].resourceId',\n resourceFqdn: '$[0].resourceFqdn',\n contextData: '$[0].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpvoteOptions {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * resource identifier for vote be cast on\n * @maxLength 128\n */\n resourceId: string;\n /**\n * resource name\n * @maxLength 300\n */\n resourceFqdn: string;\n /** context data */\n contextData?: ContextData;\n}\n\n/**\n * Casts a downvote on a resource for the current identity.\n * Changes an existing upvote to a downvote. Use RemoveVote to clear a vote.\n * Provide contextData for the app and context. Context voting permissions apply.\n * Authorization is enforced by the service for the current identity and context.\n * @public\n * @documentationMaturity preview\n * @requiredField options.resourceFqdn\n * @requiredField options.resourceId\n * @fqn com.wixpress.comments.Votes.Downvote\n */\nexport async function downvote(\n options?: NonNullablePaths<DownvoteOptions, `resourceFqdn` | `resourceId`, 2>\n): Promise<\n NonNullablePaths<\n DownvoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 4\n > & {\n __applicationErrorsType?: DownvoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contextToken: options?.contextToken,\n resourceId: options?.resourceId,\n resourceFqdn: options?.resourceFqdn,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.downvote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n contextToken: '$[0].contextToken',\n resourceId: '$[0].resourceId',\n resourceFqdn: '$[0].resourceFqdn',\n contextData: '$[0].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DownvoteOptions {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * resource identifier for vote be cast on\n * @maxLength 128\n */\n resourceId: string;\n /**\n * resource name\n * @maxLength 300\n */\n resourceFqdn: string;\n /** context data */\n contextData?: ContextData;\n}\n\n/**\n * Removes the current identity's vote in the specified context and returns it.\n * Obtain voteId from a vote response or QueryVotes. A repeated removal can fail.\n * Authorization is enforced by the service for the current identity and context.\n * @param voteId - id of the vote which will be deleted\n * @public\n * @documentationMaturity preview\n * @requiredField voteId\n * @fqn com.wixpress.comments.Votes.RemoveVote\n */\nexport async function removeVote(\n voteId: string,\n options?: RemoveVoteOptions\n): Promise<\n NonNullablePaths<\n RemoveVoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 4\n > & {\n __applicationErrorsType?: RemoveVoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n voteId: voteId,\n contextToken: options?.contextToken,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.removeVote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n voteId: '$[0]',\n contextToken: '$[1].contextToken',\n contextData: '$[1].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['voteId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RemoveVoteOptions {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** context data */\n contextData?: ContextData;\n}\n\n/**\n * Retrieves votes in the specified app and context.\n * Visitor and member callers receive only their own votes. Application callers\n * can query all votes only when granted WIX_COMMENTS.VOTE_QUERY.\n * Filter on resourceId, including $in for a batch of comment IDs.\n * Continue with query.cursorPaging.cursor from paging.cursors.next.\n * Authorization is enforced by the service for the current identity and context.\n * @public\n * @documentationMaturity preview\n * @fqn com.wixpress.comments.Votes.QueryVotes\n */\nexport function queryVotes(options?: QueryVotesOptions): VotesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Vote, 'CURSOR', QueryVotesRequest, QueryVotesResponse>({\n func: async (payload: QueryVotesRequest) => {\n const reqOpts = ambassadorWixCommentsV1Vote.queryVotes({\n ...payload,\n ...(options ?? {}),\n });\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryVotesRequest['query']) => {\n const args = [query, options] as [\n QueryVotesRequest['query'],\n QueryVotesOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryVotesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.votes,\n pagingMetadata: transformedData?.paging,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\nexport interface QueryVotesOptions {\n /**\n * context token to be passed\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string | undefined;\n /** context data */\n contextData?: ContextData | undefined;\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface VotesQueryResult extends QueryCursorResult {\n items: Vote[];\n query: VotesQueryBuilder;\n next: () => Promise<VotesQueryResult>;\n prev: () => Promise<VotesQueryResult>;\n}\n\nexport interface VotesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => VotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => VotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<VotesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn com.wixpress.comments.Votes.QueryVotes\n * @requiredField query\n */\nexport async function typedQueryVotes(\n query: VoteQuery,\n options?: QueryVotesOptions\n): Promise<\n NonNullablePaths<\n QueryVotesResponse,\n | `votes`\n | `votes.${number}.resourceId`\n | `votes.${number}.resourceFqdn`\n | `votes.${number}.voteId`\n | `votes.${number}.type`\n | `votes.${number}.createdBy.identityId`\n | `votes.${number}.createdBy.identityType`\n | `votes.${number}.context.contextId`\n | `votes.${number}.context.appDefId`\n | `votes.${number}.context.metaSiteId`\n | `votes.${number}.revision`,\n 5\n > & {\n __applicationErrorsType?: QueryVotesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.queryVotes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface VoteQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['resourceId'];\n operators: ['$eq', '$in', '$ne'];\n sort: 'NONE';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Vote, VoteQuerySpec>;\nexport type VoteQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting). \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n /** \n When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n\n If multiple filters are provided, they are combined with AND operator.\n\n Example:\n Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] } \n @internal: undefined,\n @maxSize: 10 \n */\n selectItemsBy?:\n | NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['selectItemsBy']\n | null;\n /** \n Origin point for geo-distance sorting on a GEO field\n results are ordered by distance from this point (ASC = nearest first, DESC = farthest first). \n */\n origin?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['origin'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<Vote, VoteQuerySpec, VoteQuery>(),\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressCommentsVotesUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/votes',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/votes',\n destPath: '/v1/votes',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/v1/votes',\n destPath: '/v1/votes',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/votes',\n destPath: '/v1/votes',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_comments_votes';\n\n/**\n * Casts an upvote on a resource for the current identity.\n * Changes an existing downvote to an upvote. Repeating an upvote does not remove it.\n * Provide contextData for the app and context. Context voting permissions apply.\n * Authorization is enforced by the service for the current identity and context.\n */\nexport function upvote(payload: object): RequestOptionsFactory<any> {\n function __upvote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.Upvote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/upvote',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __upvote;\n}\n\n/**\n * Casts a downvote on a resource for the current identity.\n * Changes an existing upvote to a downvote. Use RemoveVote to clear a vote.\n * Provide contextData for the app and context. Context voting permissions apply.\n * Authorization is enforced by the service for the current identity and context.\n */\nexport function downvote(payload: object): RequestOptionsFactory<any> {\n function __downvote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.Downvote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/downvote',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __downvote;\n}\n\n/**\n * Removes the current identity's vote in the specified context and returns it.\n * Obtain voteId from a vote response or QueryVotes. A repeated removal can fail.\n * Authorization is enforced by the service for the current identity and context.\n */\nexport function removeVote(payload: object): RequestOptionsFactory<any> {\n function __removeVote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'DELETE' as any,\n methodFqn: 'com.wixpress.comments.Votes.RemoveVote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/{voteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __removeVote;\n}\n\n/**\n * Retrieves votes in the specified app and context.\n * Visitor and member callers receive only their own votes. Application callers\n * can query all votes only when granted WIX_COMMENTS.VOTE_QUERY.\n * Filter on resourceId, including $in for a batch of comment IDs.\n * Continue with query.cursorPaging.cursor from paging.cursors.next.\n * Authorization is enforced by the service for the current identity and context.\n */\nexport function queryVotes(payload: object): RequestOptionsFactory<any> {\n function __queryVotes({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'query.sort.origin.latitude' },\n { path: 'query.sort.origin.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.QueryVotes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'votes.createdDate' },\n { path: 'votes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryVotes;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA,gBAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,mCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAQd,SAAS,OAAO,SAA6C;AAClE,WAAS,SAAS,EAAE,KAA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EA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AAED,QAAM,UAAsC,WAAW,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAA;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,OAAO;AAAA,QAC1C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAwFO,IAAM,QAAQ;AAAA,EACnB,OAAqB,iEAAiD;AACxE;","names":["downvote","queryVotes","removeVote","upvote","import_rest_modules","payload","import_transform_paths","Type","IdentityType","SortOrder","WebhookIdentityType","upvote","sdkTransformError","downvote","removeVote","queryVotes"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/comments-v1-vote-votes.universal.ts","../../src/comments-v1-vote-votes.http.ts"],"sourcesContent":["export * from './src/comments-v1-vote-votes.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { queryBuilder } from '@wix/sdk-runtime/query-builder';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport {\n HttpClient,\n HttpResponse,\n NonNullablePaths,\n QuerySpec,\n Query as QuerySdkType,\n} from '@wix/sdk-types';\nimport * as ambassadorWixCommentsV1Vote from './comments-v1-vote-votes.http.js';\n// @ts-ignore\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { createQueryUtils } from '@wix/sdk-runtime/query-builder-utils';\n\n/** An upvote or downvote cast by one identity on a resource in an app context. */\nexport interface Vote {\n /**\n * ID of the resource receiving the vote. For comments, this is the comment ID.\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn?: string;\n /**\n * Vote ID.\n * @format GUID\n * @readonly\n */\n voteId?: string;\n /**\n * Vote type.\n * @readonly\n */\n type?: TypeWithLiterals;\n /**\n * Identity that cast the vote.\n * @readonly\n */\n createdBy?: SocialIdentity;\n /**\n * Date and time the vote was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * Date and time the vote was updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n /** App and context containing the resource. */\n context?: VoteContext;\n /**\n * Revision number, which increments when the vote is updated.\n * @readonly\n */\n revision?: string;\n}\n\n/** Vote type. */\nexport enum Type {\n /** Unknown vote type. */\n UNKNOWN = 'UNKNOWN',\n /** Vote in favor of the resource. */\n UPVOTE = 'UPVOTE',\n /** Vote against the resource. */\n DOWNVOTE = 'DOWNVOTE',\n}\n\n/** @enumType */\nexport type TypeWithLiterals = Type | 'UNKNOWN' | 'UPVOTE' | 'DOWNVOTE';\n\nexport interface SocialIdentity {\n /** @format GUID */\n identityId?: string;\n identityType?: IdentityTypeWithLiterals;\n}\n\nexport enum IdentityType {\n ANONYMOUS = 'ANONYMOUS',\n MEMBER = 'MEMBER',\n USER = 'USER',\n SERVICE = 'SERVICE',\n /** indicates everyone who is a member of a group */\n MEMBER_GROUP = 'MEMBER_GROUP',\n}\n\n/** @enumType */\nexport type IdentityTypeWithLiterals =\n | IdentityType\n | 'ANONYMOUS'\n | 'MEMBER'\n | 'USER'\n | 'SERVICE'\n | 'MEMBER_GROUP';\n\nexport interface VoteContext {\n /**\n * ID of the context containing the resource.\n * @maxLength 128\n */\n contextId?: string;\n /** Type used by the app to identify the context. */\n contextType?: string | null;\n /**\n * ID of the app that owns the context.\n * @format GUID\n * @readonly\n */\n appDefId?: string;\n /**\n * Site ID.\n * @format GUID\n * @readonly\n */\n metaSiteId?: string;\n}\n\nexport interface UpvoteRequest {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * ID of the resource receiving the vote. For a comment, specify the comment ID.\n * @maxLength 128\n */\n resourceId: string;\n /**\n * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\n/**\n * Identifies the app and context containing the resource.\n * When provided, `contextData` takes precedence over the deprecated `contextToken`.\n */\nexport interface ContextData {\n /**\n * ID of the app that owns the context.\n * @format GUID\n */\n appDefId?: string;\n /**\n * ID of the context containing the resource.\n * @maxLength 128\n */\n contextId?: string;\n /** Optional type used by the app to resolve its context. */\n contextType?: string | null;\n}\n\nexport interface UpvoteResponse {\n /** Vote cast or updated. */\n vote?: Vote;\n}\n\nexport interface ContextResourceVoteChange {\n /**\n * ID of the resource receiving the vote.\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn?: string;\n /** Net score: upvote count minus downvote count. */\n score?: number;\n /** Number of upvotes. */\n upvoteCount?: number;\n /** Number of downvotes. */\n downvoteCount?: number;\n /** App and context containing the resource. */\n context?: VoteContext;\n}\n\nexport interface VoteCast {\n /** Vote associated with the event. */\n vote?: Vote;\n}\n\nexport interface DownvoteRequest {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * ID of the resource receiving the vote. For a comment, specify the comment ID.\n * @maxLength 128\n */\n resourceId: string;\n /**\n * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\nexport interface DownvoteResponse {\n /** Vote cast or updated. */\n vote?: Vote;\n}\n\nexport interface UpdateVoteRequest {\n /** vote to be updated, may be partial and include only VoteId and the field to change */\n vote?: Vote;\n /**\n * explicit list of fields to update\n * @internal\n */\n fieldMask?: string[];\n}\n\nexport interface UpdateVoteResponse {\n /** updated vote */\n vote?: Vote;\n}\n\nexport interface RemoveVoteRequest {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** ID of the vote to remove. */\n voteId: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\nexport interface RemoveVoteResponse {\n /** Vote removed. */\n vote?: Vote;\n}\n\nexport interface VoteDeleted {\n /** Vote associated with the event. */\n vote?: Vote;\n}\n\nexport interface QueryVotesRequest {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** Query options. Filter by `resourceId`. Field projection and fieldsets aren't supported. */\n query?: QueryV2;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\nexport interface QueryV2 extends QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n /**\n * Filter object.\n *\n * Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters).\n */\n filter?: Record<string, any> | null;\n /**\n * Sort object.\n *\n * Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting).\n */\n sort?: Sorting[];\n /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */\n fields?: string[];\n /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */\n fieldsets?: string[];\n}\n\n/** @oneof */\nexport interface QueryV2PagingMethodOneOf {\n /** Paging options to limit and offset the number of items. */\n paging?: Paging;\n /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */\n cursorPaging?: CursorPaging;\n}\n\nexport interface Sorting {\n /**\n * Name of the field to sort by.\n * @maxLength 512\n */\n fieldName?: string;\n /** Sort order. */\n order?: SortOrderWithLiterals;\n /**\n * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n *\n * If multiple filters are provided, they are combined with AND operator.\n *\n * Example:\n * Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n * { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] }\n * @internal\n * @maxSize 10\n */\n selectItemsBy?: Record<string, any>[] | null;\n /**\n * Origin point for geo-distance sorting on a GEO field\n * results are ordered by distance from this point (ASC = nearest first, DESC = farthest first).\n */\n origin?: AddressLocation;\n}\n\nexport enum SortOrder {\n ASC = 'ASC',\n DESC = 'DESC',\n}\n\n/** @enumType */\nexport type SortOrderWithLiterals = SortOrder | 'ASC' | 'DESC';\n\nexport interface AddressLocation {\n /** Address latitude. */\n latitude?: number | null;\n /** Address longitude. */\n longitude?: number | null;\n}\n\nexport interface Paging {\n /** Number of items to load. */\n limit?: number | null;\n /** Number of items to skip in the current sort order. */\n offset?: number | null;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface QueryVotesResponse {\n /** Votes matching the query. */\n votes?: Vote[];\n /** Paging metadata containing cursors for retrieving additional results. */\n paging?: PagingMetadataV2;\n}\n\nexport interface PagingMetadataV2 {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Offset that was requested. */\n offset?: number | null;\n /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */\n total?: number | null;\n /** Flag that indicates the server failed to calculate the `total` field. */\n tooManyToCount?: boolean | null;\n /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */\n cursors?: Cursors;\n /**\n * Indicates if there are more results after the current page.\n * If `true`, another page of results can be retrieved.\n * If `false`, this is the last page.\n * @internal\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface GetResourceVoteSummaryRequest {\n /** appDef ID */\n appDefId?: string;\n /** context ID */\n contextId?: string;\n /** resource ID */\n resourceId?: string;\n}\n\nexport interface GetResourceVoteSummaryResponse {\n /** Resource vote summary */\n summary?: ResourceVoteSummary;\n}\n\nexport interface ResourceVoteSummary {\n /** vote context */\n context?: VoteContext;\n /** resource ID */\n resourceId?: string;\n /** vote score */\n score?: number;\n /** upvote count */\n upvoteCount?: number;\n /** downvote count */\n downvoteCount?: number;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface ImportVoteRequest {\n /** metaSite ID */\n metaSiteId?: string;\n /** vote to import */\n vote?: ImportVote;\n}\n\nexport interface ImportVote {\n /**\n * Resource ID\n * @maxLength 128\n */\n resourceId?: string;\n /**\n * Resource fully qualified domain name\n * @maxLength 300\n */\n resourceFqdn?: string;\n /**\n * Vote ID\n * @format GUID\n */\n voteId?: string;\n /** Type of vote */\n type?: TypeWithLiterals;\n /** Vote author */\n createdBy?: SocialIdentity;\n /** Vote creation date */\n _createdDate?: Date | null;\n /** Vote update date */\n _updatedDate?: Date | null;\n /** Vote context */\n context?: VoteContext;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type UpvoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DownvoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type RemoveVoteApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'VOTE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type QueryVotesApplicationErrors =\n | {\n code?: 'MISSING_METASITE_CONTEXT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_DENIED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'UNSUPPORTED_FILTER_FIELDS';\n description?: string;\n data?: Record<string, any>;\n };\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface VoteContextResourceVoteChangeEnvelope {\n data: ContextResourceVoteChange;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a vote changes the totals for a resource.\n * @webhook\n * @eventType wix.comments.v1.vote_context_resource_vote_change\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug context_resource_vote_change\n * @documentationMaturity preview\n */\nexport declare function onVoteContextResourceVoteChange(\n handler: (\n event: VoteContextResourceVoteChangeEnvelope\n ) => void | Promise<void>\n): void;\n\nexport interface VoteCastEnvelope {\n data: VoteCast;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an upvote or downvote is cast, including changes to an existing vote.\n * @webhook\n * @eventType wix.comments.v1.vote_vote_cast\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug vote_cast\n * @documentationMaturity preview\n */\nexport declare function onVoteCast(\n handler: (event: VoteCastEnvelope) => void | Promise<void>\n): void;\n\nexport interface VoteDeletedEnvelope {\n data: VoteDeleted;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a vote is removed.\n * @webhook\n * @eventType wix.comments.v1.vote_vote_deleted\n * @serviceIdentifier com.wixpress.comments.Votes\n * @slug vote_deleted\n * @documentationMaturity preview\n */\nexport declare function onVoteDeleted(\n handler: (event: VoteDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Casts an upvote on a resource for the current identity.\n *\n * Changes the current identity's existing downvote to an upvote.\n * Repeating the same vote doesn't remove it. To clear a vote, call\n * [Remove Vote](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/remove-vote).\n * Specify the resource's app and context in `contextData`. Voting must be enabled for that context.\n * @public\n * @documentationMaturity preview\n * @requiredField options.resourceFqdn\n * @requiredField options.resourceId\n * @permissionId comments:v1:vote:upvote\n * @fqn com.wixpress.comments.Votes.Upvote\n */\nexport async function upvote(\n options?: NonNullablePaths<UpvoteOptions, `resourceFqdn` | `resourceId`, 0>\n): Promise<\n NonNullablePaths<\n UpvoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 2\n > & {\n __applicationErrorsType?: UpvoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contextToken: options?.contextToken,\n resourceId: options?.resourceId,\n resourceFqdn: options?.resourceFqdn,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.upvote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n contextToken: '$[0].contextToken',\n resourceId: '$[0].resourceId',\n resourceFqdn: '$[0].resourceFqdn',\n contextData: '$[0].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpvoteOptions {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * ID of the resource receiving the vote. For a comment, specify the comment ID.\n * @maxLength 128\n */\n resourceId: string;\n /**\n * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\n/**\n * Casts a downvote on a resource for the current identity.\n *\n * Changes the current identity's existing upvote to a downvote.\n * Repeating the same vote doesn't remove it. To clear a vote, call\n * [Remove Vote](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/remove-vote).\n * Specify the resource's app and context in `contextData`. Voting must be enabled for that context.\n * @public\n * @documentationMaturity preview\n * @requiredField options.resourceFqdn\n * @requiredField options.resourceId\n * @permissionId comments:v1:vote:downvote\n * @fqn com.wixpress.comments.Votes.Downvote\n */\nexport async function downvote(\n options?: NonNullablePaths<DownvoteOptions, `resourceFqdn` | `resourceId`, 0>\n): Promise<\n NonNullablePaths<\n DownvoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 2\n > & {\n __applicationErrorsType?: DownvoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n contextToken: options?.contextToken,\n resourceId: options?.resourceId,\n resourceFqdn: options?.resourceFqdn,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.downvote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n contextToken: '$[0].contextToken',\n resourceId: '$[0].resourceId',\n resourceFqdn: '$[0].resourceFqdn',\n contextData: '$[0].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface DownvoteOptions {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /**\n * ID of the resource receiving the vote. For a comment, specify the comment ID.\n * @maxLength 128\n */\n resourceId: string;\n /**\n * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.\n * @maxLength 300\n */\n resourceFqdn: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\n/**\n * Removes the current identity's vote and returns the removed vote.\n *\n * Specify the `voteId` returned by a vote response or\n * [Query Votes](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/query-votes) and the same `contextData` used to cast the vote.\n * A repeated removal fails when the vote no longer exists.\n * @param voteId - ID of the vote to remove.\n * @public\n * @documentationMaturity preview\n * @requiredField voteId\n * @permissionId comments:v1:vote:remove_vote\n * @fqn com.wixpress.comments.Votes.RemoveVote\n */\nexport async function removeVote(\n voteId: string,\n options?: RemoveVoteOptions\n): Promise<\n NonNullablePaths<\n RemoveVoteResponse,\n | `vote.resourceId`\n | `vote.resourceFqdn`\n | `vote.voteId`\n | `vote.type`\n | `vote.createdBy.identityId`\n | `vote.createdBy.identityType`\n | `vote.context.contextId`\n | `vote.context.appDefId`\n | `vote.context.metaSiteId`\n | `vote.revision`,\n 2\n > & {\n __applicationErrorsType?: RemoveVoteApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n voteId: voteId,\n contextToken: options?.contextToken,\n contextData: options?.contextData,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.removeVote(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n voteId: '$[0]',\n contextToken: '$[1].contextToken',\n contextData: '$[1].contextData',\n },\n singleArgumentUnchanged: false,\n },\n ['voteId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface RemoveVoteOptions {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string;\n /** App and context containing the resource. */\n contextData?: ContextData;\n}\n\n/**\n * Retrieves a list of votes, given the provided paging and filtering.\n *\n * Visitor and member callers receive their own votes in the specified app and context.\n * Authorized application callers can retrieve votes from multiple identities in that context.\n * Filter by `resourceId`, using `$in` to retrieve votes for multiple comment IDs.\n * Results don't include comments without a matching vote.\n *\n * Specify `query.cursorPaging.limit` to control the page size. To retrieve the next page,\n * set `query.cursorPaging.cursor` to the returned `paging.cursors.next` and keep the same context.\n * Offset paging and field projection aren't supported. Don't depend on a particular result order.\n *\n * To learn about working with Query methods, see\n * [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language) and\n * [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging).\n * Retain the permission checked by RequestContextResolver for app identities.\n * @public\n * @documentationMaturity preview\n * @permissionId WIX_COMMENTS.VOTE_QUERY\n * @applicableIdentity APP\n * @fqn com.wixpress.comments.Votes.QueryVotes\n */\nexport function queryVotes(options?: QueryVotesOptions): VotesQueryBuilder {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n return queryBuilder<Vote, 'CURSOR', QueryVotesRequest, QueryVotesResponse>({\n func: async (payload: QueryVotesRequest) => {\n const reqOpts = ambassadorWixCommentsV1Vote.queryVotes({\n ...payload,\n ...(options ?? {}),\n });\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n return result;\n } catch (err) {\n sideEffects?.onError?.(err);\n throw err;\n }\n },\n requestTransformer: (query: QueryVotesRequest['query']) => {\n const args = [query, options] as [\n QueryVotesRequest['query'],\n QueryVotesOptions\n ];\n return renameKeysFromSDKRequestToRESTRequest({\n ...args?.[1],\n query: args?.[0],\n });\n },\n responseTransformer: ({ data }: HttpResponse<QueryVotesResponse>) => {\n const transformedData = renameKeysFromRESTResponseToSDKResponse(\n transformPaths(data, [])\n );\n\n return {\n items: transformedData?.votes,\n pagingMetadata: transformedData?.paging,\n };\n },\n errorTransformer: (err: unknown) => {\n const transformedError = sdkTransformError(err, {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n });\n\n throw transformedError;\n },\n pagingMethod: 'CURSOR',\n transformationPaths: {},\n });\n}\n\nexport interface QueryVotesOptions {\n /**\n * Legacy context token. Use `contextData` instead.\n * @deprecated\n * @replacedBy context_data\n */\n contextToken?: string | undefined;\n /** App and context containing the resource. */\n contextData?: ContextData | undefined;\n}\n\ninterface QueryCursorResult {\n cursors: Cursors;\n hasNext: () => boolean;\n hasPrev: () => boolean;\n length: number;\n pageSize: number;\n}\n\nexport interface VotesQueryResult extends QueryCursorResult {\n items: Vote[];\n query: VotesQueryBuilder;\n next: () => Promise<VotesQueryResult>;\n prev: () => Promise<VotesQueryResult>;\n}\n\nexport interface VotesQueryBuilder {\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n eq: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @param propertyName - Property whose value is compared with `value`.\n * @param value - Value to compare against.\n * @documentationMaturity preview\n */\n ne: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @documentationMaturity preview */\n in: (propertyName: 'resourceId', value: any) => VotesQueryBuilder;\n /** @param limit - Number of items to return, which is also the `pageSize` of the results object.\n * @documentationMaturity preview\n */\n limit: (limit: number) => VotesQueryBuilder;\n /** @param cursor - A pointer to specific record\n * @documentationMaturity preview\n */\n skipTo: (cursor: string) => VotesQueryBuilder;\n /** @documentationMaturity preview */\n find: () => Promise<VotesQueryResult>;\n}\n\n/**\n * @hidden\n * @fqn com.wixpress.comments.Votes.QueryVotes\n * @requiredField query\n */\nexport async function typedQueryVotes(\n query: VoteQuery,\n options?: QueryVotesOptions\n): Promise<\n NonNullablePaths<\n QueryVotesResponse,\n | `votes`\n | `votes.${number}.resourceId`\n | `votes.${number}.resourceFqdn`\n | `votes.${number}.voteId`\n | `votes.${number}.type`\n | `votes.${number}.createdBy.identityId`\n | `votes.${number}.createdBy.identityType`\n | `votes.${number}.context.contextId`\n | `votes.${number}.context.appDefId`\n | `votes.${number}.context.metaSiteId`\n | `votes.${number}.revision`,\n 3\n > & {\n __applicationErrorsType?: QueryVotesApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n query: query,\n ...options,\n });\n\n const reqOpts = ambassadorWixCommentsV1Vote.queryVotes(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { query: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['query', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface VoteQuerySpec extends QuerySpec {\n paging: 'cursor';\n wql: [\n {\n fields: ['resourceId'];\n operators: ['$eq', '$in', '$ne'];\n sort: 'NONE';\n }\n ];\n}\n\nexport type CommonQueryWithEntityContext = QuerySdkType<Vote, VoteQuerySpec>;\nexport type VoteQuery = {\n /** \n Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. \n */\n cursorPaging?: {\n /** \n Maximum number of items to return in the results. \n @max: 100 \n */\n limit?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit']\n | null;\n /** \n Pointer to the next or previous page in the list of results.\n\n Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n Not relevant for the first request. \n @maxLength: 16000 \n */\n cursor?:\n | NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor']\n | null;\n };\n /** \n Filter object.\n\n Learn more about [filtering](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#filters). \n */\n filter?: CommonQueryWithEntityContext['filter'] | null;\n /** \n Sort object.\n\n Learn more about [sorting](https://dev.wix.com/docs/rest/articles/getting-started/api-query-language#sorting). \n */\n sort?: {\n /** \n Name of the field to sort by. \n @maxLength: 512 \n */\n fieldName?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['fieldName'];\n /** \n Sort order. \n */\n order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];\n /** \n When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by\n a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.\n\n If multiple filters are provided, they are combined with AND operator.\n\n Example:\n Given we have document like {\"id\": \"1\", \"nestedField\": [{\"price\": 10, \"region\": \"EU\"}, {\"price\": 20, \"region\": \"US\"}]}\n and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be\n { fieldName: \"nestedField.price\", \"select_items_by\": [{\"nestedField.region\": \"US\"}] } \n @internal: undefined,\n @maxSize: 10 \n */\n selectItemsBy?:\n | NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['selectItemsBy']\n | null;\n /** \n Origin point for geo-distance sorting on a GEO field\n results are ordered by distance from this point (ASC = nearest first, DESC = farthest first). \n */\n origin?: NonNullable<\n CommonQueryWithEntityContext['sort']\n >[number]['origin'];\n }[];\n};\n\nexport const utils = {\n query: /*#__PURE__*/ createQueryUtils<Vote, VoteQuerySpec, VoteQuery>(),\n};\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKFloatToRESTFloat } from '@wix/sdk-runtime/transformations/float';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressCommentsVotesUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/votes',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/votes',\n destPath: '/v1/votes',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/v1/votes',\n destPath: '/v1/votes',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/votes',\n destPath: '/v1/votes',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_comments_votes';\n\n/**\n * Casts an upvote on a resource for the current identity.\n *\n * Changes the current identity's existing downvote to an upvote.\n * Repeating the same vote doesn't remove it. To clear a vote, call\n * [Remove Vote](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/remove-vote).\n * Specify the resource's app and context in `contextData`. Voting must be enabled for that context.\n */\nexport function upvote(payload: object): RequestOptionsFactory<any> {\n function __upvote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.Upvote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/upvote',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __upvote;\n}\n\n/**\n * Casts a downvote on a resource for the current identity.\n *\n * Changes the current identity's existing upvote to a downvote.\n * Repeating the same vote doesn't remove it. To clear a vote, call\n * [Remove Vote](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/remove-vote).\n * Specify the resource's app and context in `contextData`. Voting must be enabled for that context.\n */\nexport function downvote(payload: object): RequestOptionsFactory<any> {\n function __downvote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.Downvote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/downvote',\n data: payload,\n host,\n }),\n data: payload,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __downvote;\n}\n\n/**\n * Removes the current identity's vote and returns the removed vote.\n *\n * Specify the `voteId` returned by a vote response or\n * [Query Votes](https://dev.wix.com/docs/api-reference/crm/community/feedback-moderation/comments/vote-v1/query-votes) and the same `contextData` used to cast the vote.\n * A repeated removal fails when the vote no longer exists.\n */\nexport function removeVote(payload: object): RequestOptionsFactory<any> {\n function __removeVote({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'DELETE' as any,\n methodFqn: 'com.wixpress.comments.Votes.RemoveVote',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes/{voteId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'vote.createdDate' }, { path: 'vote.updatedDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __removeVote;\n}\n\n/**\n * Retrieves a list of votes, given the provided paging and filtering.\n *\n * Visitor and member callers receive their own votes in the specified app and context.\n * Authorized application callers can retrieve votes from multiple identities in that context.\n * Filter by `resourceId`, using `$in` to retrieve votes for multiple comment IDs.\n * Results don't include comments without a matching vote.\n *\n * Specify `query.cursorPaging.limit` to control the page size. To retrieve the next page,\n * set `query.cursorPaging.cursor` to the returned `paging.cursors.next` and keep the same context.\n * Offset paging and field projection aren't supported. Don't depend on a particular result order.\n *\n * To learn about working with Query methods, see\n * [API Query Language](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-the-wix-api-query-language) and\n * [Sorting and Paging](https://dev.wix.com/docs/api-reference/articles/work-with-wix-apis/data-retrieval/about-sorting-and-paging).\n * Retain the permission checked by RequestContextResolver for app identities.\n */\nexport function queryVotes(payload: object): RequestOptionsFactory<any> {\n function __queryVotes({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKFloatToRESTFloat,\n paths: [\n { path: 'query.sort.origin.latitude' },\n { path: 'query.sort.origin.longitude' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.comments.v1.vote',\n method: 'POST' as any,\n methodFqn: 'com.wixpress.comments.Votes.QueryVotes',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressCommentsVotesUrl({\n protoPath: '/v1/votes',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'votes.createdDate' },\n { path: 'votes.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __queryVotes;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAAA;AAAA,EAAA,kBAAAC;AAAA,EAAA,kBAAAC;AAAA,EAAA;AAAA,gBAAAC;AAAA,EAAA;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,2BAA6B;AAC7B,oCAGO;;;ACLP,0BAAkC;AAClC,mBAA6C;AAC7C,uBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,mCACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,OAAO,SAA6C;AAClE,WAA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BACpB,OACA,SAmBA;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AAED,QAAM,UAAsC,WAAW,OAAO;AAE9D,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAA;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,OAAO;AAAA,QAC1C,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAwFO,IAAM,QAAQ;AAAA,EACnB,OAAqB,iEAAiD;AACxE;","names":["downvote","queryVotes","removeVote","upvote","import_rest_modules","payload","import_transform_paths","Type","IdentityType","SortOrder","WebhookIdentityType","upvote","sdkTransformError","downvote","removeVote","queryVotes"]}
@@ -4,53 +4,56 @@ import '@wix/sdk-types';
4
4
  /** An upvote or downvote cast by one identity on a resource in an app context. */
5
5
  interface Vote {
6
6
  /**
7
- * Vote resource ID
7
+ * ID of the resource receiving the vote. For comments, this is the comment ID.
8
8
  * @maxLength 128
9
9
  */
10
10
  resourceId?: string;
11
11
  /**
12
- * Resource fully qualified domain name
12
+ * Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.
13
13
  * @maxLength 300
14
14
  */
15
15
  resourceFqdn?: string;
16
16
  /**
17
- * Vote ID
17
+ * Vote ID.
18
18
  * @format GUID
19
19
  * @readonly
20
20
  */
21
21
  voteId?: string;
22
22
  /**
23
- * Type of vote
23
+ * Vote type.
24
24
  * @readonly
25
25
  */
26
26
  type?: TypeWithLiterals;
27
27
  /**
28
- * Vote author
28
+ * Identity that cast the vote.
29
29
  * @readonly
30
30
  */
31
31
  createdBy?: SocialIdentity;
32
32
  /**
33
- * Vote created date
33
+ * Date and time the vote was created.
34
34
  * @readonly
35
35
  */
36
36
  createdDate?: Date | null;
37
37
  /**
38
- * Vote updated date
38
+ * Date and time the vote was updated.
39
39
  * @readonly
40
40
  */
41
41
  updatedDate?: Date | null;
42
- /** Vote context, defining where the vote belongs to */
42
+ /** App and context containing the resource. */
43
43
  context?: VoteContext;
44
44
  /**
45
- * Vote revision
45
+ * Revision number, which increments when the vote is updated.
46
46
  * @readonly
47
47
  */
48
48
  revision?: string;
49
49
  }
50
- /** Type of vote */
50
+ /** Vote type. */
51
51
  declare enum Type {
52
+ /** Unknown vote type. */
52
53
  UNKNOWN = "UNKNOWN",
54
+ /** Vote in favor of the resource. */
53
55
  UPVOTE = "UPVOTE",
56
+ /** Vote against the resource. */
54
57
  DOWNVOTE = "DOWNVOTE"
55
58
  }
56
59
  /** @enumType */
@@ -72,20 +75,20 @@ declare enum IdentityType {
72
75
  type IdentityTypeWithLiterals = IdentityType | 'ANONYMOUS' | 'MEMBER' | 'USER' | 'SERVICE' | 'MEMBER_GROUP';
73
76
  interface VoteContext {
74
77
  /**
75
- * Context ID
78
+ * ID of the context containing the resource.
76
79
  * @maxLength 128
77
80
  */
78
81
  contextId?: string;
79
- /** Context type */
82
+ /** Type used by the app to identify the context. */
80
83
  contextType?: string | null;
81
84
  /**
82
- * Vote app ID
85
+ * ID of the app that owns the context.
83
86
  * @format GUID
84
87
  * @readonly
85
88
  */
86
89
  appDefId?: string;
87
90
  /**
88
- * MetaSite ID
91
+ * Site ID.
89
92
  * @format GUID
90
93
  * @readonly
91
94
  */
@@ -93,27 +96,27 @@ interface VoteContext {
93
96
  }
94
97
  interface UpvoteRequest {
95
98
  /**
96
- * context token to be passed
99
+ * Legacy context token. Use `contextData` instead.
97
100
  * @deprecated
98
101
  * @replacedBy context_data
99
102
  */
100
103
  contextToken?: string;
101
104
  /**
102
- * resource identifier for vote be cast on
105
+ * ID of the resource receiving the vote. For a comment, specify the comment ID.
103
106
  * @maxLength 128
104
107
  */
105
108
  resourceId: string;
106
109
  /**
107
- * resource name
110
+ * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.
108
111
  * @maxLength 300
109
112
  */
110
113
  resourceFqdn: string;
111
- /** context data */
114
+ /** App and context containing the resource. */
112
115
  contextData?: ContextData;
113
116
  }
114
117
  /**
115
118
  * Identifies the app and context containing the resource.
116
- * When provided, contextData takes precedence over the deprecated contextToken.
119
+ * When provided, `contextData` takes precedence over the deprecated `contextToken`.
117
120
  */
118
121
  interface ContextData {
119
122
  /**
@@ -130,55 +133,55 @@ interface ContextData {
130
133
  contextType?: string | null;
131
134
  }
132
135
  interface UpvoteResponse {
133
- /** created vote */
136
+ /** Vote cast or updated. */
134
137
  vote?: Vote;
135
138
  }
136
139
  interface ContextResourceVoteChange {
137
140
  /**
138
- * Resource ID
141
+ * ID of the resource receiving the vote.
139
142
  * @maxLength 128
140
143
  */
141
144
  resourceId?: string;
142
145
  /**
143
- * Resource fully qualified domain name
146
+ * Entity type receiving the vote. For comments, this is `wix.comments.v2.comment`.
144
147
  * @maxLength 300
145
148
  */
146
149
  resourceFqdn?: string;
147
- /** Score of votes */
150
+ /** Net score: upvote count minus downvote count. */
148
151
  score?: number;
149
- /** Upvote count */
152
+ /** Number of upvotes. */
150
153
  upvoteCount?: number;
151
- /** Downvote count */
154
+ /** Number of downvotes. */
152
155
  downvoteCount?: number;
153
- /** Vote context */
156
+ /** App and context containing the resource. */
154
157
  context?: VoteContext;
155
158
  }
156
159
  interface VoteCast {
157
- /** Vote */
160
+ /** Vote associated with the event. */
158
161
  vote?: Vote;
159
162
  }
160
163
  interface DownvoteRequest {
161
164
  /**
162
- * context token to be passed
165
+ * Legacy context token. Use `contextData` instead.
163
166
  * @deprecated
164
167
  * @replacedBy context_data
165
168
  */
166
169
  contextToken?: string;
167
170
  /**
168
- * resource identifier for vote be cast on
171
+ * ID of the resource receiving the vote. For a comment, specify the comment ID.
169
172
  * @maxLength 128
170
173
  */
171
174
  resourceId: string;
172
175
  /**
173
- * resource name
176
+ * Entity type receiving the vote. For comments, specify `wix.comments.v2.comment`.
174
177
  * @maxLength 300
175
178
  */
176
179
  resourceFqdn: string;
177
- /** context data */
180
+ /** App and context containing the resource. */
178
181
  contextData?: ContextData;
179
182
  }
180
183
  interface DownvoteResponse {
181
- /** created vote */
184
+ /** Vote cast or updated. */
182
185
  vote?: Vote;
183
186
  }
184
187
  interface UpdateVoteRequest {
@@ -191,34 +194,34 @@ interface UpdateVoteResponse {
191
194
  }
192
195
  interface RemoveVoteRequest {
193
196
  /**
194
- * context token to be passed
197
+ * Legacy context token. Use `contextData` instead.
195
198
  * @deprecated
196
199
  * @replacedBy context_data
197
200
  */
198
201
  contextToken?: string;
199
- /** id of the vote which will be deleted */
202
+ /** ID of the vote to remove. */
200
203
  voteId: string;
201
- /** context data */
204
+ /** App and context containing the resource. */
202
205
  contextData?: ContextData;
203
206
  }
204
207
  interface RemoveVoteResponse {
205
- /** removed vote */
208
+ /** Vote removed. */
206
209
  vote?: Vote;
207
210
  }
208
211
  interface VoteDeleted {
209
- /** Vote */
212
+ /** Vote associated with the event. */
210
213
  vote?: Vote;
211
214
  }
212
215
  interface QueryVotesRequest {
213
216
  /**
214
- * context token to be passed
217
+ * Legacy context token. Use `contextData` instead.
215
218
  * @deprecated
216
219
  * @replacedBy context_data
217
220
  */
218
221
  contextToken?: string;
219
- /** query request. Filter supports only "resourceId" field. Fields and Fieldset are not supported */
222
+ /** Query options. Filter by `resourceId`. Field projection and fieldsets aren't supported. */
220
223
  query?: QueryV2;
221
- /** context data */
224
+ /** App and context containing the resource. */
222
225
  contextData?: ContextData;
223
226
  }
224
227
  interface QueryV2 extends QueryV2PagingMethodOneOf {
@@ -298,9 +301,9 @@ interface CursorPaging {
298
301
  cursor?: string | null;
299
302
  }
300
303
  interface QueryVotesResponse {
301
- /** matching votes */
304
+ /** Votes matching the query. */
302
305
  votes?: Vote[];
303
- /** paging metadata. Only contains cursors */
306
+ /** Paging metadata containing cursors for retrieving additional results. */
304
307
  paging?: PagingMetadataV2;
305
308
  }
306
309
  interface PagingMetadataV2 {