@wix/auto_sdk_loyalty_social-media 1.0.10 → 1.0.12

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.
Files changed (29) hide show
  1. package/build/cjs/index.d.ts +4 -9
  2. package/build/cjs/index.js +2 -27
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.d.ts → index.typings.d.ts} +36 -49
  5. package/build/cjs/index.typings.js +214 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +4 -9
  9. package/build/es/index.mjs +1 -25
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.d.mts → index.typings.d.mts} +36 -49
  12. package/build/es/index.typings.mjs +187 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +4 -9
  16. package/build/internal/cjs/index.js +2 -27
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.d.ts → index.typings.d.ts} +36 -49
  19. package/build/internal/cjs/index.typings.js +214 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +4 -9
  23. package/build/internal/es/index.mjs +1 -25
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.d.mts → index.typings.d.mts} +36 -49
  26. package/build/internal/es/index.typings.mjs +187 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { F as FollowedChannel, L as ListFollowedChannelsResponse, a as FollowedChannelCreatedEnvelope } from './loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.js';
3
- export { A as ActionEvent, B as BaseEventMetadata, C as CreateFollowedChannelRequest, b as CreateFollowedChannelResponse, D as DomainEvent, d as DomainEventBodyOneOf, g as Empty, E as EntityCreatedEvent, f as EntityDeletedEvent, e as EntityUpdatedEvent, i as EventMetadata, I as IdentificationData, h as IdentificationDataIdOneOf, c as ListFollowedChannelsRequest, M as MessageEnvelope, R as RestoreInfo, T as Type, W as WebhookIdentityType } from './loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.js';
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { FollowedChannel, ListFollowedChannelsResponse } from './index.typings.js';
3
+ export { ActionEvent, CreateFollowedChannelRequest, CreateFollowedChannelResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, IdentificationData, IdentificationDataIdOneOf, ListFollowedChannelsRequest, MessageEnvelope, RestoreInfo, Type, WebhookIdentityType } from './index.typings.js';
4
4
 
5
5
  declare function createFollowedChannel$1(httpClient: HttpClient): CreateFollowedChannelSignature;
6
6
  interface CreateFollowedChannelSignature {
@@ -26,13 +26,8 @@ interface ListFollowedChannelsSignature {
26
26
  */
27
27
  (): Promise<ListFollowedChannelsResponse>;
28
28
  }
29
- declare const onFollowedChannelCreated$1: EventDefinition<FollowedChannelCreatedEnvelope, "wix.loyalty.socialmedia.v1.followed_channel_created">;
30
29
 
31
30
  declare const createFollowedChannel: MaybeContext<BuildRESTFunction<typeof createFollowedChannel$1> & typeof createFollowedChannel$1>;
32
31
  declare const listFollowedChannels: MaybeContext<BuildRESTFunction<typeof listFollowedChannels$1> & typeof listFollowedChannels$1>;
33
- /**
34
- * Triggered when an account follows a new channel.
35
- */
36
- declare const onFollowedChannelCreated: BuildEventDefinition<typeof onFollowedChannelCreated$1>;
37
32
 
38
- export { FollowedChannel, FollowedChannelCreatedEnvelope, ListFollowedChannelsResponse, createFollowedChannel, listFollowedChannels, onFollowedChannelCreated };
33
+ export { FollowedChannel, ListFollowedChannelsResponse, createFollowedChannel, listFollowedChannels };
@@ -23,17 +23,10 @@ __export(index_exports, {
23
23
  Type: () => Type,
24
24
  WebhookIdentityType: () => WebhookIdentityType,
25
25
  createFollowedChannel: () => createFollowedChannel4,
26
- listFollowedChannels: () => listFollowedChannels4,
27
- onFollowedChannelCreated: () => onFollowedChannelCreated2
26
+ listFollowedChannels: () => listFollowedChannels4
28
27
  });
29
28
  module.exports = __toCommonJS(index_exports);
30
29
 
31
- // src/loyalty-socialmedia-v1-followed-channel-social-media.public.ts
32
- var import_rename_all_nested_keys2 = require("@wix/sdk-runtime/rename-all-nested-keys");
33
- var import_timestamp3 = require("@wix/sdk-runtime/transformations/timestamp");
34
- var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
35
- var import_sdk_types = require("@wix/sdk-types");
36
-
37
30
  // src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts
38
31
  var import_transform_error = require("@wix/sdk-runtime/transform-error");
39
32
  var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
@@ -226,34 +219,16 @@ function listFollowedChannels3(httpClient) {
226
219
  { httpClient }
227
220
  );
228
221
  }
229
- var onFollowedChannelCreated = (0, import_sdk_types.EventDefinition)(
230
- "wix.loyalty.socialmedia.v1.followed_channel_created",
231
- true,
232
- (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
233
- (0, import_transform_paths2.transformPaths)(event, [
234
- {
235
- transformFn: import_timestamp3.transformRESTTimestampToSDKTimestamp,
236
- paths: [
237
- { path: "entity.createdDate" },
238
- { path: "metadata.eventTime" }
239
- ]
240
- }
241
- ])
242
- )
243
- )();
244
222
 
245
223
  // src/loyalty-socialmedia-v1-followed-channel-social-media.context.ts
246
224
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
247
- var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
248
225
  var createFollowedChannel4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createFollowedChannel3);
249
226
  var listFollowedChannels4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listFollowedChannels3);
250
- var onFollowedChannelCreated2 = (0, import_event_definition_modules.createEventModule)(onFollowedChannelCreated);
251
227
  // Annotate the CommonJS export names for ESM import in node:
252
228
  0 && (module.exports = {
253
229
  Type,
254
230
  WebhookIdentityType,
255
231
  createFollowedChannel,
256
- listFollowedChannels,
257
- onFollowedChannelCreated
232
+ listFollowedChannels
258
233
  });
259
234
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../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":["export * from './src/loyalty-socialmedia-v1-followed-channel-social-media.context.js';\n","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`>) =>\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 site owner 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: FollowedChannel): Promise<FollowedChannel>;\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<ListFollowedChannelsResponse>;\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 type. */\n channel?: TypeWithLiterals;\n /**\n * Date 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 * @documentationMaturity preview\n */\nexport declare function onFollowedChannelCreated(\n handler: (event: FollowedChannelCreatedEnvelope) => void | Promise<void>\n): void;\n\ntype FollowedChannelNonNullablePaths = `_id` | `accountId` | `channel`;\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 site owner 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 * @documentationMaturity preview\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`>\n): Promise<NonNullablePaths<FollowedChannel, FollowedChannelNonNullablePaths>> {\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 * @documentationMaturity preview\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 {\n [P in FollowedChannelNonNullablePaths]: `followedChannels.${number}.${P}`;\n }[FollowedChannelNonNullablePaths]\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 site owner 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> = createEventModule(publicOnFollowedChannelCreated);\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';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,4BAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,IAAAC,oBAAqD;AACrD,IAAAC,0BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAUd,SAAS,sBACd,SAC4B;AAC5B,WAAS,wBAAwB,EAAE,KAAK,GAAQ;AAC9C,UAAM,qBAAiB,uCAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa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AAA,EACR;AACF;;;AD9YO,SAASE,uBACd,YACgC;AAChC,SAAO,CAAC,oBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAgBO,SAASC,sBACd,YAC+B;AAC/B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,IAAM,+BAA2B;AAAA,EACtC;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,wCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;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;;;AGtElC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,yBAGK,2DAAiBA,sBAA2B;AACvD,IAAMC,wBAGK,2DAAiBA,qBAA0B;AAItD,IAAMC,gCAET,mDAAkB,wBAA8B;","names":["createFollowedChannel","listFollowedChannels","onFollowedChannelCreated","import_rename_all_nested_keys","import_timestamp","import_transform_paths","import_timestamp","import_rest_modules","payload","Type","WebhookIdentityType","createFollowedChannel","sdkTransformError","listFollowedChannels","createFollowedChannel","listFollowedChannels","import_rest_modules","createFollowedChannel","listFollowedChannels","onFollowedChannelCreated"]}
1
+ {"version":3,"sources":["../../index.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.public.ts","../../src/loyalty-socialmedia-v1-followed-channel-social-media.context.ts"],"sourcesContent":["export * from './src/loyalty-socialmedia-v1-followed-channel-social-media.context.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 type. */\n channel?: TypeWithLiterals;\n /**\n * Date 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\ntype FollowedChannelNonNullablePaths = `_id` | `accountId` | `channel`;\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 site owner 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`>\n): Promise<NonNullablePaths<FollowedChannel, FollowedChannelNonNullablePaths>> {\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 {\n [P in FollowedChannelNonNullablePaths]: `followedChannels.${number}.${P}`;\n }[FollowedChannelNonNullablePaths]\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 site owner 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 { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n FollowedChannel,\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`>) =>\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 site owner 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: FollowedChannel): Promise<FollowedChannel>;\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<ListFollowedChannelsResponse>;\n}\n\nexport {\n ActionEvent,\n CreateFollowedChannelRequest,\n CreateFollowedChannelResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n FollowedChannel,\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 {\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 { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\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\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} from './loyalty-socialmedia-v1-followed-channel-social-media.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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,MAC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sBC,wBAOpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,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,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;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;;;AE3UO,SAASE,uBACd,YACgC;AAChC,SAAO,CAAC,oBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAgBO,SAASC,sBACd,YAC+B;AAC/B,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvCA,IAAAC,uBAAiC;AAG1B,IAAMC,yBAGK,2DAAiBA,sBAA2B;AACvD,IAAMC,wBAGK,2DAAiBA,qBAA0B;","names":["createFollowedChannel","listFollowedChannels","import_timestamp","import_rest_modules","payload","Type","WebhookIdentityType","createFollowedChannel","sdkTransformError","listFollowedChannels","createFollowedChannel","listFollowedChannels","import_rest_modules","createFollowedChannel","listFollowedChannels"]}
@@ -1,3 +1,5 @@
1
+ import { NonNullablePaths } from '@wix/sdk-types';
2
+
1
3
  interface FollowedChannel {
2
4
  /**
3
5
  * Followed social media channel ID.
@@ -188,53 +190,38 @@ declare enum WebhookIdentityType {
188
190
  }
189
191
  /** @enumType */
190
192
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
191
- interface BaseEventMetadata {
192
- /**
193
- * App instance ID.
194
- * @format GUID
195
- */
196
- instanceId?: string | null;
197
- /**
198
- * Event type.
199
- * @maxLength 150
200
- */
201
- eventType?: string;
202
- /** The identification type and identity data. */
203
- identity?: IdentificationData;
204
- }
205
- interface EventMetadata extends BaseEventMetadata {
206
- /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
207
- _id?: string;
208
- /**
209
- * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
210
- * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
211
- */
212
- entityFqdn?: string;
213
- /**
214
- * Event action name, placed at the top level to make it easier for users to dispatch messages.
215
- * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
216
- */
217
- slug?: string;
218
- /** ID of the entity associated with the event. */
219
- entityId?: string;
220
- /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
221
- eventTime?: Date | null;
222
- /**
223
- * Whether the event was triggered as a result of a privacy regulation application
224
- * (for example, GDPR).
225
- */
226
- triggeredByAnonymizeRequest?: boolean | null;
227
- /** If present, indicates the action that triggered the event. */
228
- originatedFrom?: string | null;
229
- /**
230
- * 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.
231
- * 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.
232
- */
233
- entityEventSequence?: string | null;
234
- }
235
- interface FollowedChannelCreatedEnvelope {
236
- entity: FollowedChannel;
237
- metadata: EventMetadata;
238
- }
193
+ type FollowedChannelNonNullablePaths = `_id` | `accountId` | `channel`;
194
+ /**
195
+ * Creates an entity for the specified account ID when the account follows a social media channel.
196
+ *
197
+ * Members can only follow enabled channels. A site owner has to enable channels in the dashboard.
198
+ *
199
+ * >**Note:**
200
+ * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).
201
+ * @param followedChannel - Followed social media channel details.
202
+ * @public
203
+ * @requiredField followedChannel
204
+ * @requiredField followedChannel.channel
205
+ * @permissionId LOYALTY.FOLLOWED_CHANNEL_CREATE
206
+ * @applicableIdentity APP
207
+ * @applicableIdentity MEMBER
208
+ * @returns Followed social media channel details.
209
+ * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel
210
+ */
211
+ declare function createFollowedChannel(followedChannel: NonNullablePaths<FollowedChannel, `channel`>): Promise<NonNullablePaths<FollowedChannel, FollowedChannelNonNullablePaths>>;
212
+ /**
213
+ * Retrieves a list of social media channels followed by the account. The list is ordered by creation date.
214
+ *
215
+ * >**Note:**
216
+ * >This method requires [visitor or member authentication](https://dev.wix.com/docs/build-apps/develop-your-app/access/about-identities).
217
+ * @public
218
+ * @permissionId LOYALTY.FOLLOWED_CHANNEL_READ
219
+ * @applicableIdentity APP
220
+ * @applicableIdentity MEMBER
221
+ * @fqn wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels
222
+ */
223
+ declare function listFollowedChannels(): Promise<NonNullablePaths<ListFollowedChannelsResponse, {
224
+ [P in FollowedChannelNonNullablePaths]: `followedChannels.${number}.${P}`;
225
+ }[FollowedChannelNonNullablePaths]>>;
239
226
 
240
- export { type ActionEvent as A, type BaseEventMetadata as B, type CreateFollowedChannelRequest as C, type DomainEvent as D, type EntityCreatedEvent as E, type FollowedChannel as F, type IdentificationData as I, type ListFollowedChannelsResponse as L, type MessageEnvelope as M, type RestoreInfo as R, Type as T, WebhookIdentityType as W, type FollowedChannelCreatedEnvelope as a, type CreateFollowedChannelResponse as b, type ListFollowedChannelsRequest as c, type DomainEventBodyOneOf as d, type EntityUpdatedEvent as e, type EntityDeletedEvent as f, type Empty as g, type IdentificationDataIdOneOf as h, type EventMetadata as i };
227
+ export { type ActionEvent, type CreateFollowedChannelRequest, type CreateFollowedChannelResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type FollowedChannel, type IdentificationData, type IdentificationDataIdOneOf, type ListFollowedChannelsRequest, type ListFollowedChannelsResponse, type MessageEnvelope, type RestoreInfo, Type, type TypeWithLiterals, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createFollowedChannel, listFollowedChannels };
@@ -0,0 +1,214 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ Type: () => Type,
24
+ WebhookIdentityType: () => WebhookIdentityType,
25
+ createFollowedChannel: () => createFollowedChannel2,
26
+ listFollowedChannels: () => listFollowedChannels2
27
+ });
28
+ module.exports = __toCommonJS(index_typings_exports);
29
+
30
+ // src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts
31
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
32
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
33
+
34
+ // src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts
35
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
36
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
37
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
38
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
39
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
40
+ function resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl(opts) {
41
+ const domainToMappings = {
42
+ _: [
43
+ {
44
+ srcPath: "/_api/loyalty-social-media",
45
+ destPath: ""
46
+ }
47
+ ],
48
+ "editor._base_domain_": [
49
+ {
50
+ srcPath: "/_api/loyalty-social-media",
51
+ destPath: ""
52
+ }
53
+ ],
54
+ "blocks._base_domain_": [
55
+ {
56
+ srcPath: "/_api/loyalty-social-media",
57
+ destPath: ""
58
+ }
59
+ ],
60
+ "create.editorx": [
61
+ {
62
+ srcPath: "/_api/loyalty-social-media",
63
+ destPath: ""
64
+ }
65
+ ],
66
+ "www.wixapis.com": [
67
+ {
68
+ srcPath: "/loyalty-social-media",
69
+ destPath: ""
70
+ }
71
+ ],
72
+ "*.dev.wix-code.com": [
73
+ {
74
+ srcPath: "/_api/loyalty-social-media",
75
+ destPath: ""
76
+ }
77
+ ]
78
+ };
79
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
80
+ }
81
+ var PACKAGE_NAME = "@wix/auto_sdk_loyalty_social-media";
82
+ function createFollowedChannel(payload) {
83
+ function __createFollowedChannel({ host }) {
84
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
85
+ {
86
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
87
+ paths: [{ path: "followedChannel.createdDate" }]
88
+ }
89
+ ]);
90
+ const metadata = {
91
+ entityFqdn: "wix.loyalty.socialmedia.v1.followed_channel",
92
+ method: "POST",
93
+ methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.CreateFollowedChannel",
94
+ packageName: PACKAGE_NAME,
95
+ url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
96
+ protoPath: "/v1/followed-channels",
97
+ data: serializedData,
98
+ host
99
+ }),
100
+ data: serializedData,
101
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
102
+ {
103
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
104
+ paths: [{ path: "followedChannel.createdDate" }]
105
+ }
106
+ ])
107
+ };
108
+ return metadata;
109
+ }
110
+ return __createFollowedChannel;
111
+ }
112
+ function listFollowedChannels(payload) {
113
+ function __listFollowedChannels({ host }) {
114
+ const metadata = {
115
+ entityFqdn: "wix.loyalty.socialmedia.v1.followed_channel",
116
+ method: "GET",
117
+ methodFqn: "wix.loyalty.socialmedia.v1.LoyaltySocialMedia.ListFollowedChannels",
118
+ packageName: PACKAGE_NAME,
119
+ url: resolveWixLoyaltySocialmediaV1LoyaltySocialMediaUrl({
120
+ protoPath: "/v1/followed-channels",
121
+ data: payload,
122
+ host
123
+ }),
124
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
125
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
126
+ {
127
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
128
+ paths: [{ path: "followedChannels.createdDate" }]
129
+ }
130
+ ])
131
+ };
132
+ return metadata;
133
+ }
134
+ return __listFollowedChannels;
135
+ }
136
+
137
+ // src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts
138
+ var Type = /* @__PURE__ */ ((Type2) => {
139
+ Type2["UNKNOWN_CHANNEL"] = "UNKNOWN_CHANNEL";
140
+ Type2["FACEBOOK"] = "FACEBOOK";
141
+ Type2["INSTAGRAM"] = "INSTAGRAM";
142
+ Type2["LINKEDIN"] = "LINKEDIN";
143
+ Type2["X"] = "X";
144
+ Type2["TIKTOK"] = "TIKTOK";
145
+ return Type2;
146
+ })(Type || {});
147
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
148
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
149
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
150
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
151
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
152
+ WebhookIdentityType2["APP"] = "APP";
153
+ return WebhookIdentityType2;
154
+ })(WebhookIdentityType || {});
155
+ async function createFollowedChannel2(followedChannel) {
156
+ const { httpClient, sideEffects } = arguments[1];
157
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
158
+ followedChannel
159
+ });
160
+ const reqOpts = createFollowedChannel(
161
+ payload
162
+ );
163
+ sideEffects?.onSiteCall?.();
164
+ try {
165
+ const result = await httpClient.request(reqOpts);
166
+ sideEffects?.onSuccess?.(result);
167
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.followedChannel;
168
+ } catch (err) {
169
+ const transformedError = (0, import_transform_error.transformError)(
170
+ err,
171
+ {
172
+ spreadPathsToArguments: {},
173
+ explicitPathsToArguments: { followedChannel: "$[0]" },
174
+ singleArgumentUnchanged: false
175
+ },
176
+ ["followedChannel"]
177
+ );
178
+ sideEffects?.onError?.(err);
179
+ throw transformedError;
180
+ }
181
+ }
182
+ async function listFollowedChannels2() {
183
+ const { httpClient, sideEffects } = arguments[0];
184
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
185
+ const reqOpts = listFollowedChannels(
186
+ payload
187
+ );
188
+ sideEffects?.onSiteCall?.();
189
+ try {
190
+ const result = await httpClient.request(reqOpts);
191
+ sideEffects?.onSuccess?.(result);
192
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
193
+ } catch (err) {
194
+ const transformedError = (0, import_transform_error.transformError)(
195
+ err,
196
+ {
197
+ spreadPathsToArguments: {},
198
+ explicitPathsToArguments: {},
199
+ singleArgumentUnchanged: false
200
+ },
201
+ []
202
+ );
203
+ sideEffects?.onError?.(err);
204
+ throw transformedError;
205
+ }
206
+ }
207
+ // Annotate the CommonJS export names for ESM import in node:
208
+ 0 && (module.exports = {
209
+ Type,
210
+ WebhookIdentityType,
211
+ createFollowedChannel,
212
+ listFollowedChannels
213
+ });
214
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/loyalty-socialmedia-v1-followed-channel-social-media.universal.ts","../../src/loyalty-socialmedia-v1-followed-channel-social-media.http.ts"],"sourcesContent":["export * from './src/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 type. */\n channel?: TypeWithLiterals;\n /**\n * Date 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\ntype FollowedChannelNonNullablePaths = `_id` | `accountId` | `channel`;\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 site owner 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`>\n): Promise<NonNullablePaths<FollowedChannel, FollowedChannelNonNullablePaths>> {\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 {\n [P in FollowedChannelNonNullablePaths]: `followedChannels.${number}.${P}`;\n }[FollowedChannelNonNullablePaths]\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 site owner 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;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,4BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;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;AA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AA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;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":["createFollowedChannel","listFollowedChannels","import_timestamp","import_rest_modules","payload","Type","WebhookIdentityType","createFollowedChannel","sdkTransformError","listFollowedChannels"]}
@@ -1,4 +1,5 @@
1
- import { C as CreateFollowedChannelRequest$1, b as CreateFollowedChannelResponse$1, c as ListFollowedChannelsRequest$1, L as ListFollowedChannelsResponse$1 } from './loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.js';
1
+ import { CreateFollowedChannelRequest as CreateFollowedChannelRequest$1, CreateFollowedChannelResponse as CreateFollowedChannelResponse$1, ListFollowedChannelsRequest as ListFollowedChannelsRequest$1, ListFollowedChannelsResponse as ListFollowedChannelsResponse$1 } from './index.typings.js';
2
+ import '@wix/sdk-types';
2
3
 
3
4
  interface FollowedChannel {
4
5
  /**
@@ -1,6 +1,6 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { F as FollowedChannel, L as ListFollowedChannelsResponse, a as FollowedChannelCreatedEnvelope } from './loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.mjs';
3
- export { A as ActionEvent, B as BaseEventMetadata, C as CreateFollowedChannelRequest, b as CreateFollowedChannelResponse, D as DomainEvent, d as DomainEventBodyOneOf, g as Empty, E as EntityCreatedEvent, f as EntityDeletedEvent, e as EntityUpdatedEvent, i as EventMetadata, I as IdentificationData, h as IdentificationDataIdOneOf, c as ListFollowedChannelsRequest, M as MessageEnvelope, R as RestoreInfo, T as Type, W as WebhookIdentityType } from './loyalty-socialmedia-v1-followed-channel-social-media.universal-BT5wtFYd.mjs';
1
+ import { HttpClient, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
+ import { FollowedChannel, ListFollowedChannelsResponse } from './index.typings.mjs';
3
+ export { ActionEvent, CreateFollowedChannelRequest, CreateFollowedChannelResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, IdentificationData, IdentificationDataIdOneOf, ListFollowedChannelsRequest, MessageEnvelope, RestoreInfo, Type, WebhookIdentityType } from './index.typings.mjs';
4
4
 
5
5
  declare function createFollowedChannel$1(httpClient: HttpClient): CreateFollowedChannelSignature;
6
6
  interface CreateFollowedChannelSignature {
@@ -26,13 +26,8 @@ interface ListFollowedChannelsSignature {
26
26
  */
27
27
  (): Promise<ListFollowedChannelsResponse>;
28
28
  }
29
- declare const onFollowedChannelCreated$1: EventDefinition<FollowedChannelCreatedEnvelope, "wix.loyalty.socialmedia.v1.followed_channel_created">;
30
29
 
31
30
  declare const createFollowedChannel: MaybeContext<BuildRESTFunction<typeof createFollowedChannel$1> & typeof createFollowedChannel$1>;
32
31
  declare const listFollowedChannels: MaybeContext<BuildRESTFunction<typeof listFollowedChannels$1> & typeof listFollowedChannels$1>;
33
- /**
34
- * Triggered when an account follows a new channel.
35
- */
36
- declare const onFollowedChannelCreated: BuildEventDefinition<typeof onFollowedChannelCreated$1>;
37
32
 
38
- export { FollowedChannel, FollowedChannelCreatedEnvelope, ListFollowedChannelsResponse, createFollowedChannel, listFollowedChannels, onFollowedChannelCreated };
33
+ export { FollowedChannel, ListFollowedChannelsResponse, createFollowedChannel, listFollowedChannels };