@wix/auto_sdk_loyalty_social-media 1.0.19 → 1.0.20

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":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.public.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n FollowedChannel,\n FollowedChannelCreatedEnvelope,\n ListFollowedChannelsResponse,\n createFollowedChannel as universalCreateFollowedChannel,\n listFollowedChannels as universalListFollowedChannels,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createFollowedChannel(\n httpClient: HttpClient\n): CreateFollowedChannelSignature {\n return (followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>) =>\n universalCreateFollowedChannel(\n followedChannel,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateFollowedChannelSignature {\n /**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param - Followed social media channel details.\n * @returns Followed social media channel details.\n */\n (followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n >;\n}\n\nexport function listFollowedChannels(\n httpClient: HttpClient\n): ListFollowedChannelsSignature {\n return () =>\n universalListFollowedChannels(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListFollowedChannelsSignature {\n /**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\n (): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n >;\n}\n\nexport const onFollowedChannelCreated = EventDefinition(\n 'wix.loyalty.socialmedia.v1.followed_channel_created',\n true,\n (event: FollowedChannelCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<FollowedChannelCreatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n CreateFollowedChannelRequest,\n CreateFollowedChannelResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FollowedChannel,\n FollowedChannelCreatedEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListFollowedChannelsRequest,\n ListFollowedChannelsResponse,\n MessageEnvelope,\n RestoreInfo,\n Type,\n WebhookIdentityType,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\n\nexport interface FollowedChannel {\n /**\n * Followed social media channel ID.\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the account that has followed a social media channel.\n * @readonly\n * @format GUID\n */\n accountId?: string;\n /** Followed social media channel. */\n channel?: TypeWithLiterals;\n /**\n * Date and time when an entity for following a social media channel was created.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\nexport enum Type {\n /** Unknown social media channel type. */\n UNKNOWN_CHANNEL = 'UNKNOWN_CHANNEL',\n /** Facebook social media channel. */\n FACEBOOK = 'FACEBOOK',\n /** Instagram social media channel. */\n INSTAGRAM = 'INSTAGRAM',\n /** LinkedIn social media channel. */\n LINKEDIN = 'LINKEDIN',\n /** X social media channel. */\n X = 'X',\n /** TikTok social media channel. */\n TIKTOK = 'TIKTOK',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_CHANNEL'\n | 'FACEBOOK'\n | 'INSTAGRAM'\n | 'LINKEDIN'\n | 'X'\n | 'TIKTOK';\n\nexport interface CreateFollowedChannelRequest {\n /** Followed social media channel details. */\n followedChannel: FollowedChannel;\n}\n\nexport interface CreateFollowedChannelResponse {\n /** Followed social media channel details. */\n followedChannel?: FollowedChannel;\n}\n\nexport interface ListFollowedChannelsRequest {}\n\nexport interface ListFollowedChannelsResponse {\n /**\n * List of followed social media channels.\n * @maxSize 5\n */\n followedChannels?: FollowedChannel[];\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 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}\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 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}\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}\n\nexport interface FollowedChannelCreatedEnvelope {\n entity: FollowedChannel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an account follows a new channel.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @webhook\n * @eventType wix.loyalty.socialmedia.v1.followed_channel_created\n * @slug created\n */\nexport declare function onFollowedChannelCreated(\n handler: (event: FollowedChannelCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param followedChannel - Followed social media channel details.\n * @public\n * @requiredField followedChannel\n * @requiredField followedChannel.channel\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_CREATE\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Followed social media channel details.\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel\n */\nexport async function createFollowedChannel(\n followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>\n): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n followedChannel: followedChannel,\n });\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.followedChannel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { followedChannel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['followedChannel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @public\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels\n */\nexport async function listFollowedChannels(): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n","import {\n createFollowedChannel as publicCreateFollowedChannel,\n listFollowedChannels as publicListFollowedChannels,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onFollowedChannelCreated as publicOnFollowedChannelCreated } from './loyalty-socialmedia-v1-followed-channel-social-media.public.js';\n\nexport const createFollowedChannel: MaybeContext<\n BuildRESTFunction<typeof publicCreateFollowedChannel> &\n typeof publicCreateFollowedChannel\n> = /*#__PURE__*/ createRESTModule(publicCreateFollowedChannel);\nexport const listFollowedChannels: MaybeContext<\n BuildRESTFunction<typeof publicListFollowedChannels> &\n typeof publicListFollowedChannels\n> = /*#__PURE__*/ createRESTModule(publicListFollowedChannels);\n/**\n * Triggered when an account follows a new channel.\n */\nexport const onFollowedChannelCreated: BuildEventDefinition<\n typeof publicOnFollowedChannelCreated\n> &\n typeof publicOnFollowedChannelCreated = createEventModule(\n publicOnFollowedChannelCreated\n);\n\nexport {\n Type,\n WebhookIdentityType,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\nexport {\n FollowedChannel,\n CreateFollowedChannelRequest,\n CreateFollowedChannelResponse,\n ListFollowedChannelsRequest,\n ListFollowedChannelsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n FollowedChannelCreatedEnvelope,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\nexport {\n TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SA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CAAC,UACCC;AAAA,IACEC,gBAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAaC;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAkC;;;AGjFlC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,yBAGK,iCAAiBA,sBAA2B;AACvD,IAAMC,wBAGK,iCAAiBA,qBAA0B;AAItD,IAAMC,4BAG6B;AAAA,EACxC;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","Type","WebhookIdentityType","createFollowedChannel","listFollowedChannels","createFollowedChannel","listFollowedChannels","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","createFollowedChannel","listFollowedChannels","onFollowedChannelCreated"]}
1
+ {"version":3,"sources":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.public.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.context.ts"],"sourcesContent":["import { renameKeysFromRESTResponseToSDKResponse } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { EventDefinition, HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n FollowedChannel,\n FollowedChannelCreatedEnvelope,\n ListFollowedChannelsResponse,\n createFollowedChannel as universalCreateFollowedChannel,\n listFollowedChannels as universalListFollowedChannels,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/loyalty' };\n\nexport function createFollowedChannel(\n httpClient: HttpClient\n): CreateFollowedChannelSignature {\n return (followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>) =>\n universalCreateFollowedChannel(\n followedChannel,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateFollowedChannelSignature {\n /**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param - Followed social media channel details.\n * @returns Followed social media channel details.\n */\n (followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n >;\n}\n\nexport function listFollowedChannels(\n httpClient: HttpClient\n): ListFollowedChannelsSignature {\n return () =>\n universalListFollowedChannels(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListFollowedChannelsSignature {\n /**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\n (): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n >;\n}\n\nexport const onFollowedChannelCreated = EventDefinition(\n 'wix.loyalty.socialmedia.v1.followed_channel_created',\n true,\n (event: FollowedChannelCreatedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'entity.createdDate' },\n { path: 'metadata.eventTime' },\n ],\n },\n ])\n )\n)<FollowedChannelCreatedEnvelope>();\n\nexport {\n ActionEvent,\n BaseEventMetadata,\n CreateFollowedChannelRequest,\n CreateFollowedChannelResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n FollowedChannel,\n FollowedChannelCreatedEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListFollowedChannelsRequest,\n ListFollowedChannelsResponse,\n MessageEnvelope,\n RestoreInfo,\n Type,\n WebhookIdentityType,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\n\nexport interface FollowedChannel {\n /**\n * Followed social media channel ID.\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the account that has followed a social media channel.\n * @readonly\n * @format GUID\n */\n accountId?: string;\n /** Followed social media channel. */\n channel?: TypeWithLiterals;\n /**\n * Date and time when an entity for following a social media channel was created.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\nexport enum Type {\n /** Unknown social media channel type. */\n UNKNOWN_CHANNEL = 'UNKNOWN_CHANNEL',\n /** Facebook social media channel. */\n FACEBOOK = 'FACEBOOK',\n /** Instagram social media channel. */\n INSTAGRAM = 'INSTAGRAM',\n /** LinkedIn social media channel. */\n LINKEDIN = 'LINKEDIN',\n /** X social media channel. */\n X = 'X',\n /** TikTok social media channel. */\n TIKTOK = 'TIKTOK',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_CHANNEL'\n | 'FACEBOOK'\n | 'INSTAGRAM'\n | 'LINKEDIN'\n | 'X'\n | 'TIKTOK';\n\nexport interface CreateFollowedChannelRequest {\n /** Followed social media channel details. */\n followedChannel: FollowedChannel;\n}\n\nexport interface CreateFollowedChannelResponse {\n /** Followed social media channel details. */\n followedChannel?: FollowedChannel;\n}\n\nexport interface ListFollowedChannelsRequest {}\n\nexport interface ListFollowedChannelsResponse {\n /**\n * List of followed social media channels.\n * @maxSize 5\n */\n followedChannels?: FollowedChannel[];\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 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}\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 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}\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}\n\nexport interface FollowedChannelCreatedEnvelope {\n entity: FollowedChannel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an account follows a new channel.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @webhook\n * @eventType wix.loyalty.socialmedia.v1.followed_channel_created\n * @slug created\n */\nexport declare function onFollowedChannelCreated(\n handler: (event: FollowedChannelCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param followedChannel - Followed social media channel details.\n * @public\n * @requiredField followedChannel\n * @requiredField followedChannel.channel\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_CREATE\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Followed social media channel details.\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel\n */\nexport async function createFollowedChannel(\n followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>\n): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n followedChannel: followedChannel,\n });\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.followedChannel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { followedChannel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['followedChannel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @public\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels\n */\nexport async function listFollowedChannels(): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n","import {\n createFollowedChannel as publicCreateFollowedChannel,\n listFollowedChannels as publicListFollowedChannels,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { createEventModule } from '@wix/sdk-runtime/event-definition-modules';\nimport {\n BuildRESTFunction,\n MaybeContext,\n BuildEventDefinition,\n} from '@wix/sdk-types';\nimport { onFollowedChannelCreated as publicOnFollowedChannelCreated } from './loyalty-socialmedia-v1-followed-channel-social-media.public.js';\n\nexport const createFollowedChannel: MaybeContext<\n BuildRESTFunction<typeof publicCreateFollowedChannel> &\n typeof publicCreateFollowedChannel\n> = /*#__PURE__*/ createRESTModule(publicCreateFollowedChannel);\nexport const listFollowedChannels: MaybeContext<\n BuildRESTFunction<typeof publicListFollowedChannels> &\n typeof publicListFollowedChannels\n> = /*#__PURE__*/ createRESTModule(publicListFollowedChannels);\n/**\n * Triggered when an account follows a new channel.\n */\nexport const onFollowedChannelCreated: BuildEventDefinition<\n typeof publicOnFollowedChannelCreated\n> &\n typeof publicOnFollowedChannelCreated = createEventModule(\n publicOnFollowedChannelCreated\n);\n\nexport {\n Type,\n WebhookIdentityType,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\nexport {\n FollowedChannel,\n CreateFollowedChannelRequest,\n CreateFollowedChannelResponse,\n ListFollowedChannelsRequest,\n ListFollowedChannelsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n BaseEventMetadata,\n EventMetadata,\n FollowedChannelCreatedEnvelope,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\nexport {\n TypeWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,wCAAAC,6CAA4C;AACrD,SAAS,kBAAAC,uBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;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,sBAAsB;AAAA,MACpB;AAAA,QACE,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AEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD7YO,SAASC,uBACd,YACgC;AAChC,SAAO,CAAC,oBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAkBO,SAASC,sBACd,YAC+B;AAC/B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,IAAM,2BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA,CAAC,UACCC;AAAA,IACEC,gBAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAaC;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,qBAAqB;AAAA,UAC7B,EAAE,MAAM,qBAAqB;AAAA,QAC/B;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAkC;;;AGjFlC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,yBAGK,iCAAiBA,sBAA2B;AACvD,IAAMC,wBAGK,iCAAiBA,qBAA0B;AAItD,IAAMC,4BAG6B;AAAA,EACxC;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","transformRESTTimestampToSDKTimestamp","transformPaths","payload","Type","WebhookIdentityType","createFollowedChannel","listFollowedChannels","createFollowedChannel","listFollowedChannels","renameKeysFromRESTResponseToSDKResponse","transformPaths","transformRESTTimestampToSDKTimestamp","createFollowedChannel","listFollowedChannels","onFollowedChannelCreated"]}
@@ -66,6 +66,9 @@ function createFollowedChannel(payload) {
66
66
  method: "POST",
67
67
  methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel",
68
68
  packageName: PACKAGE_NAME,
69
+ migrationOptions: {
70
+ optInTransformResponse: true
71
+ },
69
72
  url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
70
73
  protoPath: "/v1/followed-channels",
71
74
  data: serializedData,
@@ -90,6 +93,9 @@ function listFollowedChannels(payload) {
90
93
  method: "GET",
91
94
  methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels",
92
95
  packageName: PACKAGE_NAME,
96
+ migrationOptions: {
97
+ optInTransformResponse: true
98
+ },
93
99
  url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
94
100
  protoPath: "/v1/followed-channels",
95
101
  data: payload,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\n\nexport interface FollowedChannel {\n /**\n * Followed social media channel ID.\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the account that has followed a social media channel.\n * @readonly\n * @format GUID\n */\n accountId?: string;\n /** Followed social media channel. */\n channel?: TypeWithLiterals;\n /**\n * Date and time when an entity for following a social media channel was created.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\nexport enum Type {\n /** Unknown social media channel type. */\n UNKNOWN_CHANNEL = 'UNKNOWN_CHANNEL',\n /** Facebook social media channel. */\n FACEBOOK = 'FACEBOOK',\n /** Instagram social media channel. */\n INSTAGRAM = 'INSTAGRAM',\n /** LinkedIn social media channel. */\n LINKEDIN = 'LINKEDIN',\n /** X social media channel. */\n X = 'X',\n /** TikTok social media channel. */\n TIKTOK = 'TIKTOK',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_CHANNEL'\n | 'FACEBOOK'\n | 'INSTAGRAM'\n | 'LINKEDIN'\n | 'X'\n | 'TIKTOK';\n\nexport interface CreateFollowedChannelRequest {\n /** Followed social media channel details. */\n followedChannel: FollowedChannel;\n}\n\nexport interface CreateFollowedChannelResponse {\n /** Followed social media channel details. */\n followedChannel?: FollowedChannel;\n}\n\nexport interface ListFollowedChannelsRequest {}\n\nexport interface ListFollowedChannelsResponse {\n /**\n * List of followed social media channels.\n * @maxSize 5\n */\n followedChannels?: FollowedChannel[];\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 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}\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 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}\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}\n\nexport interface FollowedChannelCreatedEnvelope {\n entity: FollowedChannel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an account follows a new channel.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @webhook\n * @eventType wix.loyalty.socialmedia.v1.followed_channel_created\n * @slug created\n */\nexport declare function onFollowedChannelCreated(\n handler: (event: FollowedChannelCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param followedChannel - Followed social media channel details.\n * @public\n * @requiredField followedChannel\n * @requiredField followedChannel.channel\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_CREATE\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Followed social media channel details.\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel\n */\nexport async function createFollowedChannel(\n followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>\n): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n followedChannel: followedChannel,\n });\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.followedChannel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { followedChannel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['followedChannel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @public\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels\n */\nexport async function listFollowedChannels(): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF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BAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAaA,eAAsBC,wBASpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,CAAC,CAAC;AAExD,QAAM,UAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","Type","WebhookIdentityType","createFollowedChannel","listFollowedChannels"]}
1
+ {"version":3,"sources":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\n\nexport interface FollowedChannel {\n /**\n * Followed social media channel ID.\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * ID of the account that has followed a social media channel.\n * @readonly\n * @format GUID\n */\n accountId?: string;\n /** Followed social media channel. */\n channel?: TypeWithLiterals;\n /**\n * Date and time when an entity for following a social media channel was created.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\nexport enum Type {\n /** Unknown social media channel type. */\n UNKNOWN_CHANNEL = 'UNKNOWN_CHANNEL',\n /** Facebook social media channel. */\n FACEBOOK = 'FACEBOOK',\n /** Instagram social media channel. */\n INSTAGRAM = 'INSTAGRAM',\n /** LinkedIn social media channel. */\n LINKEDIN = 'LINKEDIN',\n /** X social media channel. */\n X = 'X',\n /** TikTok social media channel. */\n TIKTOK = 'TIKTOK',\n}\n\n/** @enumType */\nexport type TypeWithLiterals =\n | Type\n | 'UNKNOWN_CHANNEL'\n | 'FACEBOOK'\n | 'INSTAGRAM'\n | 'LINKEDIN'\n | 'X'\n | 'TIKTOK';\n\nexport interface CreateFollowedChannelRequest {\n /** Followed social media channel details. */\n followedChannel: FollowedChannel;\n}\n\nexport interface CreateFollowedChannelResponse {\n /** Followed social media channel details. */\n followedChannel?: FollowedChannel;\n}\n\nexport interface ListFollowedChannelsRequest {}\n\nexport interface ListFollowedChannelsResponse {\n /**\n * List of followed social media channels.\n * @maxSize 5\n */\n followedChannels?: FollowedChannel[];\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 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}\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 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}\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}\n\nexport interface FollowedChannelCreatedEnvelope {\n entity: FollowedChannel;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when an account follows a new channel.\n * @permissionScope Read Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.READ-LOYALTY\n * @permissionScope Manage Loyalty\n * @permissionScopeId SCOPE.DC-LOYALTY.MANAGE-LOYALTY\n * @permissionScope Manage Restaurants - all permissions\n * @permissionScopeId SCOPE.RESTAURANTS.MEGA-SCOPES\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @webhook\n * @eventType wix.loyalty.socialmedia.v1.followed_channel_created\n * @slug created\n */\nexport declare function onFollowedChannelCreated(\n handler: (event: FollowedChannelCreatedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @param followedChannel - Followed social media channel details.\n * @public\n * @requiredField followedChannel\n * @requiredField followedChannel.channel\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_CREATE\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @returns Followed social media channel details.\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel\n */\nexport async function createFollowedChannel(\n followedChannel: NonNullablePaths<FollowedChannel, `channel`, 2>\n): Promise<\n NonNullablePaths<FollowedChannel, `_id` | `accountId` | `channel`, 2>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n followedChannel: followedChannel,\n });\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.followedChannel!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { followedChannel: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['followedChannel']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n * @public\n * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ\n * @applicableIdentity APP\n * @applicableIdentity MEMBER\n * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels\n */\nexport async function listFollowedChannels(): Promise<\n NonNullablePaths<\n ListFollowedChannelsResponse,\n | `followedChannels`\n | `followedChannels.${number}._id`\n | `followedChannels.${number}.accountId`\n | `followedChannels.${number}.channel`,\n 4\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\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 singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QAC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AAO,wCAAwC,OAAO,IAAI,GACtD;AAAA,EACN,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,iBAAiB,OAAO;AAAA,QACpD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,iBAAiB;AAAA,IACpB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAaA,eAAsBC,wBASpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC,CAAC,CAAC;AAExD,QAAM,UAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,WAAO,wCAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["payload","Type","WebhookIdentityType","createFollowedChannel","listFollowedChannels"]}
@@ -59,6 +59,9 @@ function createFollowedChannel(payload) {
59
59
  method: "POST",
60
60
  methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel",
61
61
  packageName: PACKAGE_NAME,
62
+ migrationOptions: {
63
+ optInTransformResponse: true
64
+ },
62
65
  url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
63
66
  protoPath: "/v1/followed-channels",
64
67
  data: serializedData,
@@ -83,6 +86,9 @@ function listFollowedChannels(payload) {
83
86
  method: "GET",
84
87
  methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels",
85
88
  packageName: PACKAGE_NAME,
89
+ migrationOptions: {
90
+ optInTransformResponse: true
91
+ },
86
92
  url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
87
93
  protoPath: "/v1/followed-channels",
88
94
  data: payload,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n","import * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes from './loyalty-socialmedia-v1-followed-channel-social-media.types.js';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function createFollowedChannel(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.CreateFollowedChannelRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.CreateFollowedChannelRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.CreateFollowedChannelResponse,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.CreateFollowedChannelResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/followed-channels',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function listFollowedChannels(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.ListFollowedChannelsRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.ListFollowedChannelsRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.ListFollowedChannelsResponse,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.ListFollowedChannelsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/followed-channels',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;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,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,sBACd,SAC4B;AAC5B,WAAS,wBAAwB,EAAE,KAAK,GAAQ;AAC9C,UAAM,iBAAiB,eAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AA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;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,wBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","createFollowedChannel","listFollowedChannels"]}
1
+ {"version":3,"sources":["../../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts","../../../src/loyalty-socialmedia-v1-followed-channel-social-media.meta.ts"],"sourcesContent":["import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\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 resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n _: [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/loyalty-social-media',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/loyalty-social-media',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_loyalty_social-media';\n\n/**\n * Creates an entity for the specified account ID when the account follows a social media channel.\n *\n * Members can only follow enabled channels. A Wix user has to enable channels in the dashboard.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function createFollowedChannel(\n payload: object\n): RequestOptionsFactory<any> {\n function __createFollowedChannel({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'POST' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannel.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createFollowedChannel;\n}\n\n/**\n * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.\n *\n * >**Note:**\n * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).\n */\nexport function listFollowedChannels(\n payload: object\n): RequestOptionsFactory<any> {\n function __listFollowedChannels({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.loyalty.socialmedia.v1.followed_channel',\n method: 'GET' as any,\n methodFqn:\n 'wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({\n protoPath: '/v1/followed-channels',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'followedChannels.createdDate' }],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listFollowedChannels;\n}\n","import * as ambassadorWixLoyaltySocialmediaV1FollowedChannel from './loyalty-socialmedia-v1-followed-channel-social-media.http.js';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes from './loyalty-socialmedia-v1-followed-channel-social-media.types.js';\nimport * as ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function createFollowedChannel(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.CreateFollowedChannelRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.CreateFollowedChannelRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.CreateFollowedChannelResponse,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.CreateFollowedChannelResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.createFollowedChannel(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/followed-channels',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function listFollowedChannels(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.ListFollowedChannelsRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.ListFollowedChannelsRequest,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelUniversalTypes.ListFollowedChannelsResponse,\n ambassadorWixLoyaltySocialmediaV1FollowedChannelTypes.ListFollowedChannelsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixLoyaltySocialmediaV1FollowedChannel.listFollowedChannels(\n payload\n );\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/followed-channels',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,oDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAA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ClB,eAAeA,UAAS;AAAA,QACtB;AAAA,UACE,aAAa;AAAA,UACb,OAAO,CAAC,EAAE,MAAM,+BAA+B,CAAC;AAAA,QAClD;AAAA,MACF,CAAC;AAAA,IACL;AAEA,WAAO;AAAA,EACT;AAEA,SAAO;AACT;;;ACvHO,SAASC,yBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,wBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC6C;AAAA,IAC/C;AAAA,EACF;AAEF,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["payload","createFollowedChannel","listFollowedChannels"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_loyalty_social-media",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -50,5 +50,5 @@
50
50
  "fqdn": "wix.loyalty.socialmedia.v1.followed_channel"
51
51
  }
52
52
  },
53
- "falconPackageHash": "14e5fdca2f64d216c818c16f396ee30a232173953fbc1f1e689aea18"
53
+ "falconPackageHash": "1e53980fdac9520be975daf3e40f74a85d16b144410f04ee7c31858c"
54
54
  }