@wix/auto_sdk_instagram_accounts 1.0.16 → 1.0.17

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.
@@ -349,7 +349,7 @@ function listInstagramAccounts3(httpClient) {
349
349
  { httpClient }
350
350
  );
351
351
  }
352
- var onInstagramAccountDeleted = (0, import_sdk_types.EventDefinition)(
352
+ var onInstagramAccountDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
353
353
  "wix.instagram_feed.v1.instagram_account_deleted",
354
354
  true,
355
355
  (event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
@@ -369,7 +369,7 @@ var initiateAccountConnection4 = /* @__PURE__ */ (0, import_rest_modules3.create
369
369
  var disconnectAccount4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(disconnectAccount3);
370
370
  var getInstagramAccount4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getInstagramAccount3);
371
371
  var listInstagramAccounts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listInstagramAccounts3);
372
- var onInstagramAccountDeleted2 = (0, import_event_definition_modules.createEventModule)(
372
+ var onInstagramAccountDeleted2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
373
373
  onInstagramAccountDeleted
374
374
  );
375
375
  // Annotate the CommonJS export names for ESM import in node:
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/instagram-feed-v1-instagram-account-accounts.public.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts","../../src/instagram-feed-v1-instagram-account-accounts.context.ts"],"sourcesContent":["export * from './src/instagram-feed-v1-instagram-account-accounts.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 InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n ListInstagramAccountsResponse,\n disconnectAccount as universalDisconnectAccount,\n getInstagramAccount as universalGetInstagramAccount,\n initiateAccountConnection as universalInitiateAccountConnection,\n listInstagramAccounts as universalListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/instagram' };\n\nexport function initiateAccountConnection(\n httpClient: HttpClient\n): InitiateAccountConnectionSignature {\n return () =>\n universalInitiateAccountConnection(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface InitiateAccountConnectionSignature {\n /**\n * Retrieve hash needed for connection of instagram account to a site.\n */\n (): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\n >;\n}\n\nexport function disconnectAccount(\n httpClient: HttpClient\n): DisconnectAccountSignature {\n return (connectionId: string) =>\n universalDisconnectAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DisconnectAccountSignature {\n /**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param - connection id to be disconnected\n */\n (connectionId: string): Promise<void>;\n}\n\nexport function getInstagramAccount(\n httpClient: HttpClient\n): GetInstagramAccountSignature {\n return (connectionId: string) =>\n universalGetInstagramAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetInstagramAccountSignature {\n /**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param - connection id\n * @returns instagram account information\n */\n (connectionId: string): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n >;\n}\n\nexport function listInstagramAccounts(\n httpClient: HttpClient\n): ListInstagramAccountsSignature {\n return () =>\n universalListInstagramAccounts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListInstagramAccountsSignature {\n /**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\n (): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\n >\n >;\n}\n\nexport const onInstagramAccountDeleted = EventDefinition(\n 'wix.instagram_feed.v1.instagram_account_deleted',\n true,\n (event: InstagramAccountDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<InstagramAccountDeletedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n InstagramInfo,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n MessageEnvelope,\n RestoreInfo,\n WebhookIdentityType,\n} from './instagram-feed-v1-instagram-account-accounts.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 ambassadorWixInstagramFeedV1InstagramAccount from './instagram-feed-v1-instagram-account-accounts.http.js';\n\nexport interface InstagramAccount {\n /**\n * The id of the connection\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * The revision of the connection\n * @readonly\n */\n revision?: string | null;\n /** The instagram info connected to */\n instagramInfo?: InstagramInfo;\n /** True - account is synchronized with the Meta API. False - in last successful state */\n synchronized?: boolean | null;\n}\n\nexport interface InstagramInfo {\n /**\n * The id of the instagram user\n * @immutable\n * @maxLength 30\n */\n instagramId?: string;\n /**\n * The username of the instagram user\n * @readonly\n * @maxLength 500\n */\n instagramUsername?: string;\n /**\n * Profile picture URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n profilePictureUrl?: string;\n /**\n * Follower count from Instagram\n * @readonly\n */\n followersCount?: number | null;\n /**\n * Media count from Instagram\n * @readonly\n */\n mediaCount?: number | null;\n /**\n * Profile biography from Instagram\n * @readonly\n * @maxLength 500\n */\n biography?: string | null;\n /**\n * Number of accounts this user follows\n * @readonly\n */\n followsCount?: number | null;\n /**\n * Profile name from Instagram\n * @readonly\n * @maxLength 500\n */\n name?: string | null;\n /**\n * Profile website URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n website?: string | null;\n}\n\nexport interface InitiateAccountConnectionRequest {}\n\nexport interface InitiateAccountConnectionResponse {\n /**\n * State parameter for authorization callback\n * @maxLength 256\n */\n connectionParams?: string[];\n}\n\nexport interface CreateAccountRequest {\n /**\n * connection id\n * @readonly\n * @maxLength 256\n */\n authorizationCode?: string;\n /**\n * redirect url\n * @maxLength 256\n */\n redirectUrl?: string;\n}\n\nexport interface CreateAccountResponse {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface DisconnectAccountRequest {\n /**\n * connection id to be disconnected\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface DisconnectAccountResponse {}\n\nexport interface GetInstagramAccountRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface GetInstagramAccountResponse {\n /** instagram account information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ListInstagramAccountsRequest {}\n\nexport interface ListInstagramAccountsResponse {\n /** instagram account profile information */\n instagramAccounts?: InstagramAccount[];\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 MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectAccountByTokenRequest {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n accessToken?: string;\n}\n\nexport interface ConnectAccountByTokenResponse {\n /** instagram account profile information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ChangeTokenExpirationDateRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n /** new expiration date */\n expirationDate?: Date | null;\n}\n\nexport interface ChangeTokenExpirationDateResponse {}\n\nexport interface GetLongLivedTokenRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface GetLongLivedTokenResponse {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n token?: string;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface InstagramAccountDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/** @permissionScope Instagram external scope\n * @permissionScopeId SCOPE.GROUPS.INSTAGRAM_ACCOUNTS\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @webhook\n * @eventType wix.instagram_feed.v1.instagram_account_deleted\n * @serviceIdentifier wix.instagram.v1.InstagramAccountService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onInstagramAccountDeleted(\n handler: (event: InstagramAccountDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieve hash needed for connection of instagram account to a site.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.INITIATE_CONNECTION\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.InitiateAccountConnection\n */\nexport async function initiateAccountConnection(): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\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 ambassadorWixInstagramFeedV1InstagramAccount.initiateAccountConnection(\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\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param connectionId - connection id to be disconnected\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.DISCONNECT\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.DisconnectAccount\n */\nexport async function disconnectAccount(connectionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.disconnectAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param connectionId - connection id\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @applicableIdentity APP\n * @returns instagram account information\n * @fqn wix.instagram.v1.InstagramAccountService.GetInstagramAccount\n */\nexport async function getInstagramAccount(\n connectionId: string\n): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.getInstagramAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.instagramAccount!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.LIST_PROFILES\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.ListInstagramAccounts\n */\nexport async function listInstagramAccounts(): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\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 ambassadorWixInstagramFeedV1InstagramAccount.listInstagramAccounts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n 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 { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInstagramV1InstagramAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'instagram_integration.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/instagram-accounts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_instagram_accounts';\n\n/** Retrieve hash needed for connection of instagram account to a site. */\nexport function initiateAccountConnection(\n payload: object\n): RequestOptionsFactory<any> {\n function __initiateAccountConnection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.InitiateAccountConnection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/initiate-connection',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __initiateAccountConnection;\n}\n\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n */\nexport function disconnectAccount(payload: object): RequestOptionsFactory<any> {\n function __disconnectAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'DELETE' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.DisconnectAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __disconnectAccount;\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n */\nexport function getInstagramAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __getInstagramAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.GetInstagramAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getInstagramAccount;\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\nexport function listInstagramAccounts(\n payload: object\n): RequestOptionsFactory<any> {\n function __listInstagramAccounts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.ListInstagramAccounts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listInstagramAccounts;\n}\n","import {\n initiateAccountConnection as publicInitiateAccountConnection,\n disconnectAccount as publicDisconnectAccount,\n getInstagramAccount as publicGetInstagramAccount,\n listInstagramAccounts as publicListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.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 { onInstagramAccountDeleted as publicOnInstagramAccountDeleted } from './instagram-feed-v1-instagram-account-accounts.public.js';\n\nexport const initiateAccountConnection: MaybeContext<\n BuildRESTFunction<typeof publicInitiateAccountConnection> &\n typeof publicInitiateAccountConnection\n> = /*#__PURE__*/ createRESTModule(publicInitiateAccountConnection);\nexport const disconnectAccount: MaybeContext<\n BuildRESTFunction<typeof publicDisconnectAccount> &\n typeof publicDisconnectAccount\n> = /*#__PURE__*/ createRESTModule(publicDisconnectAccount);\nexport const getInstagramAccount: MaybeContext<\n BuildRESTFunction<typeof publicGetInstagramAccount> &\n typeof publicGetInstagramAccount\n> = /*#__PURE__*/ createRESTModule(publicGetInstagramAccount);\nexport const listInstagramAccounts: MaybeContext<\n BuildRESTFunction<typeof publicListInstagramAccounts> &\n typeof publicListInstagramAccounts\n> = /*#__PURE__*/ createRESTModule(publicListInstagramAccounts);\n/** */\nexport const onInstagramAccountDeleted: BuildEventDefinition<\n typeof publicOnInstagramAccountDeleted\n> &\n typeof publicOnInstagramAccountDeleted = createEventModule(\n publicOnInstagramAccountDeleted\n);\n\nexport { WebhookIdentityType } from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport {\n InstagramAccount,\n InstagramInfo,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n InstagramAccountDeletedEnvelope,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './instagram-feed-v1-instagram-account-accounts.universal.js';\n"],"mappings":";;;;;;;;;;;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AiBA,0BAA+B;AAC3D,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,yBAGK,2DAAiBA,sBAA2B;AAEvD,IAAMC,iCAG8B;AAAA,EACzC;AACF;","names":["disconnectAccount","getInstagramAccount","initiateAccountConnection","listInstagramAccounts","onInstagramAccountDeleted","import_rename_all_nested_keys","import_rest_modules","WebhookIdentityType","initiateAccountConnection","sdkTransformError","disconnectAccount","getInstagramAccount","listInstagramAccounts","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","import_rest_modules","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","onInstagramAccountDeleted"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/instagram-feed-v1-instagram-account-accounts.public.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts","../../src/instagram-feed-v1-instagram-account-accounts.context.ts"],"sourcesContent":["export * from './src/instagram-feed-v1-instagram-account-accounts.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 InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n ListInstagramAccountsResponse,\n disconnectAccount as universalDisconnectAccount,\n getInstagramAccount as universalGetInstagramAccount,\n initiateAccountConnection as universalInitiateAccountConnection,\n listInstagramAccounts as universalListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/instagram' };\n\nexport function initiateAccountConnection(\n httpClient: HttpClient\n): InitiateAccountConnectionSignature {\n return () =>\n universalInitiateAccountConnection(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface InitiateAccountConnectionSignature {\n /**\n * Retrieve hash needed for connection of instagram account to a site.\n */\n (): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\n >;\n}\n\nexport function disconnectAccount(\n httpClient: HttpClient\n): DisconnectAccountSignature {\n return (connectionId: string) =>\n universalDisconnectAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DisconnectAccountSignature {\n /**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param - connection id to be disconnected\n */\n (connectionId: string): Promise<void>;\n}\n\nexport function getInstagramAccount(\n httpClient: HttpClient\n): GetInstagramAccountSignature {\n return (connectionId: string) =>\n universalGetInstagramAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetInstagramAccountSignature {\n /**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param - connection id\n * @returns instagram account information\n */\n (connectionId: string): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n >;\n}\n\nexport function listInstagramAccounts(\n httpClient: HttpClient\n): ListInstagramAccountsSignature {\n return () =>\n universalListInstagramAccounts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListInstagramAccountsSignature {\n /**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\n (): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\n >\n >;\n}\n\nexport const onInstagramAccountDeleted = /*#__PURE__*/ EventDefinition(\n 'wix.instagram_feed.v1.instagram_account_deleted',\n true,\n (event: InstagramAccountDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<InstagramAccountDeletedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n InstagramInfo,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n MessageEnvelope,\n RestoreInfo,\n WebhookIdentityType,\n} from './instagram-feed-v1-instagram-account-accounts.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 ambassadorWixInstagramFeedV1InstagramAccount from './instagram-feed-v1-instagram-account-accounts.http.js';\n\nexport interface InstagramAccount {\n /**\n * The id of the connection\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * The revision of the connection\n * @readonly\n */\n revision?: string | null;\n /** The instagram info connected to */\n instagramInfo?: InstagramInfo;\n /** True - account is synchronized with the Meta API. False - in last successful state */\n synchronized?: boolean | null;\n}\n\nexport interface InstagramInfo {\n /**\n * The id of the instagram user\n * @immutable\n * @maxLength 30\n */\n instagramId?: string;\n /**\n * The username of the instagram user\n * @readonly\n * @maxLength 500\n */\n instagramUsername?: string;\n /**\n * Profile picture URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n profilePictureUrl?: string;\n /**\n * Follower count from Instagram\n * @readonly\n */\n followersCount?: number | null;\n /**\n * Media count from Instagram\n * @readonly\n */\n mediaCount?: number | null;\n /**\n * Profile biography from Instagram\n * @readonly\n * @maxLength 500\n */\n biography?: string | null;\n /**\n * Number of accounts this user follows\n * @readonly\n */\n followsCount?: number | null;\n /**\n * Profile name from Instagram\n * @readonly\n * @maxLength 500\n */\n name?: string | null;\n /**\n * Profile website URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n website?: string | null;\n}\n\nexport interface InitiateAccountConnectionRequest {}\n\nexport interface InitiateAccountConnectionResponse {\n /**\n * State parameter for authorization callback\n * @maxLength 256\n */\n connectionParams?: string[];\n}\n\nexport interface CreateAccountRequest {\n /**\n * connection id\n * @readonly\n * @maxLength 256\n */\n authorizationCode?: string;\n /**\n * redirect url\n * @maxLength 256\n */\n redirectUrl?: string;\n}\n\nexport interface CreateAccountResponse {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface DisconnectAccountRequest {\n /**\n * connection id to be disconnected\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface DisconnectAccountResponse {}\n\nexport interface GetInstagramAccountRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface GetInstagramAccountResponse {\n /** instagram account information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ListInstagramAccountsRequest {}\n\nexport interface ListInstagramAccountsResponse {\n /** instagram account profile information */\n instagramAccounts?: InstagramAccount[];\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 MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectAccountByTokenRequest {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n accessToken?: string;\n}\n\nexport interface ConnectAccountByTokenResponse {\n /** instagram account profile information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ChangeTokenExpirationDateRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n /** new expiration date */\n expirationDate?: Date | null;\n}\n\nexport interface ChangeTokenExpirationDateResponse {}\n\nexport interface GetLongLivedTokenRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface GetLongLivedTokenResponse {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n token?: string;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface InstagramAccountDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/** @permissionScope Instagram external scope\n * @permissionScopeId SCOPE.GROUPS.INSTAGRAM_ACCOUNTS\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @webhook\n * @eventType wix.instagram_feed.v1.instagram_account_deleted\n * @serviceIdentifier wix.instagram.v1.InstagramAccountService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onInstagramAccountDeleted(\n handler: (event: InstagramAccountDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieve hash needed for connection of instagram account to a site.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.INITIATE_CONNECTION\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.InitiateAccountConnection\n */\nexport async function initiateAccountConnection(): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\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 ambassadorWixInstagramFeedV1InstagramAccount.initiateAccountConnection(\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\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param connectionId - connection id to be disconnected\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.DISCONNECT\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.DisconnectAccount\n */\nexport async function disconnectAccount(connectionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.disconnectAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param connectionId - connection id\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @applicableIdentity APP\n * @returns instagram account information\n * @fqn wix.instagram.v1.InstagramAccountService.GetInstagramAccount\n */\nexport async function getInstagramAccount(\n connectionId: string\n): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.getInstagramAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.instagramAccount!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.LIST_PROFILES\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.ListInstagramAccounts\n */\nexport async function listInstagramAccounts(): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\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 ambassadorWixInstagramFeedV1InstagramAccount.listInstagramAccounts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n 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 { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInstagramV1InstagramAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'instagram_integration.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/instagram-accounts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_instagram_accounts';\n\n/** Retrieve hash needed for connection of instagram account to a site. */\nexport function initiateAccountConnection(\n payload: object\n): RequestOptionsFactory<any> {\n function __initiateAccountConnection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.InitiateAccountConnection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/initiate-connection',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __initiateAccountConnection;\n}\n\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n */\nexport function disconnectAccount(payload: object): RequestOptionsFactory<any> {\n function __disconnectAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'DELETE' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.DisconnectAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __disconnectAccount;\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n */\nexport function getInstagramAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __getInstagramAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.GetInstagramAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getInstagramAccount;\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\nexport function listInstagramAccounts(\n payload: object\n): RequestOptionsFactory<any> {\n function __listInstagramAccounts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.ListInstagramAccounts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listInstagramAccounts;\n}\n","import {\n initiateAccountConnection as publicInitiateAccountConnection,\n disconnectAccount as publicDisconnectAccount,\n getInstagramAccount as publicGetInstagramAccount,\n listInstagramAccounts as publicListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.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 { onInstagramAccountDeleted as publicOnInstagramAccountDeleted } from './instagram-feed-v1-instagram-account-accounts.public.js';\n\nexport const initiateAccountConnection: MaybeContext<\n BuildRESTFunction<typeof publicInitiateAccountConnection> &\n typeof publicInitiateAccountConnection\n> = /*#__PURE__*/ createRESTModule(publicInitiateAccountConnection);\nexport const disconnectAccount: MaybeContext<\n BuildRESTFunction<typeof publicDisconnectAccount> &\n typeof publicDisconnectAccount\n> = /*#__PURE__*/ createRESTModule(publicDisconnectAccount);\nexport const getInstagramAccount: MaybeContext<\n BuildRESTFunction<typeof publicGetInstagramAccount> &\n typeof publicGetInstagramAccount\n> = /*#__PURE__*/ createRESTModule(publicGetInstagramAccount);\nexport const listInstagramAccounts: MaybeContext<\n BuildRESTFunction<typeof publicListInstagramAccounts> &\n typeof publicListInstagramAccounts\n> = /*#__PURE__*/ createRESTModule(publicListInstagramAccounts);\n/** */\nexport const onInstagramAccountDeleted: BuildEventDefinition<\n typeof publicOnInstagramAccountDeleted\n> &\n typeof publicOnInstagramAccountDeleted = /*#__PURE__*/ createEventModule(\n publicOnInstagramAccountDeleted\n);\n\nexport { WebhookIdentityType } from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport {\n InstagramAccount,\n InstagramInfo,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n InstagramAccountDeletedEnvelope,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './instagram-feed-v1-instagram-account-accounts.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,iCAAAC;AAAA,EAAA,6BAAAC;AAAA,EAAA,iCAAAC;AAAA;AAAA;;;ACAA,IAAAC,iCAAwD;AACxD,uBAAqD;AACrD,6BAA+B;AAC/B,uBAA8D;;;ACH9D,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;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;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD/mBO,SAASI,2BACd,YACoC;AACpC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAWO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CAAC,iBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,iBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,SAASC,uBACd,YACgC;AAChC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,IAAM,4BAA0C;AAAA,EACrD;AAAA,EACA;AAAA,EACA,CAAC,cACC;AAAA,QACE,uCAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAmC;;;AG3HnC,IAAAC,uBAAiC;AACjC,sCAAkC;AAQ3B,IAAMC,6BAGK,2DAAiBA,0BAA+B;AAC3D,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,yBAGK,2DAAiBA,sBAA2B;AAEvD,IAAMC,6BAG4C;AAAA,EACvD;AACF;","names":["disconnectAccount","getInstagramAccount","initiateAccountConnection","listInstagramAccounts","onInstagramAccountDeleted","import_rename_all_nested_keys","import_rest_modules","WebhookIdentityType","initiateAccountConnection","sdkTransformError","disconnectAccount","getInstagramAccount","listInstagramAccounts","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","import_rest_modules","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","onInstagramAccountDeleted"]}
@@ -321,7 +321,7 @@ function listInstagramAccounts3(httpClient) {
321
321
  { httpClient }
322
322
  );
323
323
  }
324
- var onInstagramAccountDeleted = EventDefinition(
324
+ var onInstagramAccountDeleted = /* @__PURE__ */ EventDefinition(
325
325
  "wix.instagram_feed.v1.instagram_account_deleted",
326
326
  true,
327
327
  (event) => renameKeysFromRESTResponseToSDKResponse2(
@@ -341,7 +341,7 @@ var initiateAccountConnection4 = /* @__PURE__ */ createRESTModule(initiateAccoun
341
341
  var disconnectAccount4 = /* @__PURE__ */ createRESTModule(disconnectAccount3);
342
342
  var getInstagramAccount4 = /* @__PURE__ */ createRESTModule(getInstagramAccount3);
343
343
  var listInstagramAccounts4 = /* @__PURE__ */ createRESTModule(listInstagramAccounts3);
344
- var onInstagramAccountDeleted2 = createEventModule(
344
+ var onInstagramAccountDeleted2 = /* @__PURE__ */ createEventModule(
345
345
  onInstagramAccountDeleted
346
346
  );
347
347
  export {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/instagram-feed-v1-instagram-account-accounts.public.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts","../../src/instagram-feed-v1-instagram-account-accounts.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 InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n ListInstagramAccountsResponse,\n disconnectAccount as universalDisconnectAccount,\n getInstagramAccount as universalGetInstagramAccount,\n initiateAccountConnection as universalInitiateAccountConnection,\n listInstagramAccounts as universalListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/instagram' };\n\nexport function initiateAccountConnection(\n httpClient: HttpClient\n): InitiateAccountConnectionSignature {\n return () =>\n universalInitiateAccountConnection(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface InitiateAccountConnectionSignature {\n /**\n * Retrieve hash needed for connection of instagram account to a site.\n */\n (): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\n >;\n}\n\nexport function disconnectAccount(\n httpClient: HttpClient\n): DisconnectAccountSignature {\n return (connectionId: string) =>\n universalDisconnectAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DisconnectAccountSignature {\n /**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param - connection id to be disconnected\n */\n (connectionId: string): Promise<void>;\n}\n\nexport function getInstagramAccount(\n httpClient: HttpClient\n): GetInstagramAccountSignature {\n return (connectionId: string) =>\n universalGetInstagramAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetInstagramAccountSignature {\n /**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param - connection id\n * @returns instagram account information\n */\n (connectionId: string): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n >;\n}\n\nexport function listInstagramAccounts(\n httpClient: HttpClient\n): ListInstagramAccountsSignature {\n return () =>\n universalListInstagramAccounts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListInstagramAccountsSignature {\n /**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\n (): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\n >\n >;\n}\n\nexport const onInstagramAccountDeleted = EventDefinition(\n 'wix.instagram_feed.v1.instagram_account_deleted',\n true,\n (event: InstagramAccountDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<InstagramAccountDeletedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n InstagramInfo,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n MessageEnvelope,\n RestoreInfo,\n WebhookIdentityType,\n} from './instagram-feed-v1-instagram-account-accounts.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 ambassadorWixInstagramFeedV1InstagramAccount from './instagram-feed-v1-instagram-account-accounts.http.js';\n\nexport interface InstagramAccount {\n /**\n * The id of the connection\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * The revision of the connection\n * @readonly\n */\n revision?: string | null;\n /** The instagram info connected to */\n instagramInfo?: InstagramInfo;\n /** True - account is synchronized with the Meta API. False - in last successful state */\n synchronized?: boolean | null;\n}\n\nexport interface InstagramInfo {\n /**\n * The id of the instagram user\n * @immutable\n * @maxLength 30\n */\n instagramId?: string;\n /**\n * The username of the instagram user\n * @readonly\n * @maxLength 500\n */\n instagramUsername?: string;\n /**\n * Profile picture URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n profilePictureUrl?: string;\n /**\n * Follower count from Instagram\n * @readonly\n */\n followersCount?: number | null;\n /**\n * Media count from Instagram\n * @readonly\n */\n mediaCount?: number | null;\n /**\n * Profile biography from Instagram\n * @readonly\n * @maxLength 500\n */\n biography?: string | null;\n /**\n * Number of accounts this user follows\n * @readonly\n */\n followsCount?: number | null;\n /**\n * Profile name from Instagram\n * @readonly\n * @maxLength 500\n */\n name?: string | null;\n /**\n * Profile website URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n website?: string | null;\n}\n\nexport interface InitiateAccountConnectionRequest {}\n\nexport interface InitiateAccountConnectionResponse {\n /**\n * State parameter for authorization callback\n * @maxLength 256\n */\n connectionParams?: string[];\n}\n\nexport interface CreateAccountRequest {\n /**\n * connection id\n * @readonly\n * @maxLength 256\n */\n authorizationCode?: string;\n /**\n * redirect url\n * @maxLength 256\n */\n redirectUrl?: string;\n}\n\nexport interface CreateAccountResponse {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface DisconnectAccountRequest {\n /**\n * connection id to be disconnected\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface DisconnectAccountResponse {}\n\nexport interface GetInstagramAccountRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface GetInstagramAccountResponse {\n /** instagram account information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ListInstagramAccountsRequest {}\n\nexport interface ListInstagramAccountsResponse {\n /** instagram account profile information */\n instagramAccounts?: InstagramAccount[];\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 MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectAccountByTokenRequest {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n accessToken?: string;\n}\n\nexport interface ConnectAccountByTokenResponse {\n /** instagram account profile information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ChangeTokenExpirationDateRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n /** new expiration date */\n expirationDate?: Date | null;\n}\n\nexport interface ChangeTokenExpirationDateResponse {}\n\nexport interface GetLongLivedTokenRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface GetLongLivedTokenResponse {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n token?: string;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface InstagramAccountDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/** @permissionScope Instagram external scope\n * @permissionScopeId SCOPE.GROUPS.INSTAGRAM_ACCOUNTS\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @webhook\n * @eventType wix.instagram_feed.v1.instagram_account_deleted\n * @serviceIdentifier wix.instagram.v1.InstagramAccountService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onInstagramAccountDeleted(\n handler: (event: InstagramAccountDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieve hash needed for connection of instagram account to a site.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.INITIATE_CONNECTION\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.InitiateAccountConnection\n */\nexport async function initiateAccountConnection(): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\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 ambassadorWixInstagramFeedV1InstagramAccount.initiateAccountConnection(\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\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param connectionId - connection id to be disconnected\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.DISCONNECT\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.DisconnectAccount\n */\nexport async function disconnectAccount(connectionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.disconnectAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param connectionId - connection id\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @applicableIdentity APP\n * @returns instagram account information\n * @fqn wix.instagram.v1.InstagramAccountService.GetInstagramAccount\n */\nexport async function getInstagramAccount(\n connectionId: string\n): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.getInstagramAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.instagramAccount!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.LIST_PROFILES\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.ListInstagramAccounts\n */\nexport async function listInstagramAccounts(): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\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 ambassadorWixInstagramFeedV1InstagramAccount.listInstagramAccounts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n 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 { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInstagramV1InstagramAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'instagram_integration.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/instagram-accounts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_instagram_accounts';\n\n/** Retrieve hash needed for connection of instagram account to a site. */\nexport function initiateAccountConnection(\n payload: object\n): RequestOptionsFactory<any> {\n function __initiateAccountConnection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.InitiateAccountConnection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/initiate-connection',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __initiateAccountConnection;\n}\n\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n */\nexport function disconnectAccount(payload: object): RequestOptionsFactory<any> {\n function __disconnectAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'DELETE' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.DisconnectAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __disconnectAccount;\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n */\nexport function getInstagramAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __getInstagramAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.GetInstagramAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getInstagramAccount;\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\nexport function listInstagramAccounts(\n payload: object\n): RequestOptionsFactory<any> {\n function __listInstagramAccounts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.ListInstagramAccounts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listInstagramAccounts;\n}\n","import {\n initiateAccountConnection as publicInitiateAccountConnection,\n disconnectAccount as publicDisconnectAccount,\n getInstagramAccount as publicGetInstagramAccount,\n listInstagramAccounts as publicListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.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 { onInstagramAccountDeleted as publicOnInstagramAccountDeleted } from './instagram-feed-v1-instagram-account-accounts.public.js';\n\nexport const initiateAccountConnection: MaybeContext<\n BuildRESTFunction<typeof publicInitiateAccountConnection> &\n typeof publicInitiateAccountConnection\n> = /*#__PURE__*/ createRESTModule(publicInitiateAccountConnection);\nexport const disconnectAccount: MaybeContext<\n BuildRESTFunction<typeof publicDisconnectAccount> &\n typeof publicDisconnectAccount\n> = /*#__PURE__*/ createRESTModule(publicDisconnectAccount);\nexport const getInstagramAccount: MaybeContext<\n BuildRESTFunction<typeof publicGetInstagramAccount> &\n typeof publicGetInstagramAccount\n> = /*#__PURE__*/ createRESTModule(publicGetInstagramAccount);\nexport const listInstagramAccounts: MaybeContext<\n BuildRESTFunction<typeof publicListInstagramAccounts> &\n typeof publicListInstagramAccounts\n> = /*#__PURE__*/ createRESTModule(publicListInstagramAccounts);\n/** */\nexport const onInstagramAccountDeleted: BuildEventDefinition<\n typeof publicOnInstagramAccountDeleted\n> &\n typeof publicOnInstagramAccountDeleted = createEventModule(\n publicOnInstagramAccountDeleted\n);\n\nexport { WebhookIdentityType } from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport {\n InstagramAccount,\n InstagramInfo,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n InstagramAccountDeletedEnvelope,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './instagram-feed-v1-instagram-account-accounts.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA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,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AD/mBO,SAASC,2BACd,YACoC;AACpC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAWO,SAASC,mBACd,YAC4B;AAC5B,SAAO,CAAC,iBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAYO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,iBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,SAASC,uBACd,YACgC;AAChC,SAAO,MACLA;AAAA;AAAA,IAEE,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,IAAM,4BAA4B;AAAA,EACvC;AAAA,EACA;AAAA,EACA,CAAC,UACCC;AAAA,IACE,eAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAmC;;;AG3HnC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,qBAGK,iCAAiBA,kBAAuB;AACnD,IAAMC,uBAGK,iCAAiBA,oBAAyB;AACrD,IAAMC,yBAGK,iCAAiBA,sBAA2B;AAEvD,IAAMC,6BAG8B;AAAA,EACzC;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","renameKeysFromRESTResponseToSDKResponse","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","onInstagramAccountDeleted"]}
1
+ {"version":3,"sources":["../../src/instagram-feed-v1-instagram-account-accounts.public.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts","../../src/instagram-feed-v1-instagram-account-accounts.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 InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n ListInstagramAccountsResponse,\n disconnectAccount as universalDisconnectAccount,\n getInstagramAccount as universalGetInstagramAccount,\n initiateAccountConnection as universalInitiateAccountConnection,\n listInstagramAccounts as universalListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/instagram' };\n\nexport function initiateAccountConnection(\n httpClient: HttpClient\n): InitiateAccountConnectionSignature {\n return () =>\n universalInitiateAccountConnection(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface InitiateAccountConnectionSignature {\n /**\n * Retrieve hash needed for connection of instagram account to a site.\n */\n (): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\n >;\n}\n\nexport function disconnectAccount(\n httpClient: HttpClient\n): DisconnectAccountSignature {\n return (connectionId: string) =>\n universalDisconnectAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DisconnectAccountSignature {\n /**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param - connection id to be disconnected\n */\n (connectionId: string): Promise<void>;\n}\n\nexport function getInstagramAccount(\n httpClient: HttpClient\n): GetInstagramAccountSignature {\n return (connectionId: string) =>\n universalGetInstagramAccount(\n connectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetInstagramAccountSignature {\n /**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param - connection id\n * @returns instagram account information\n */\n (connectionId: string): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n >;\n}\n\nexport function listInstagramAccounts(\n httpClient: HttpClient\n): ListInstagramAccountsSignature {\n return () =>\n universalListInstagramAccounts(\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListInstagramAccountsSignature {\n /**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\n (): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\n >\n >;\n}\n\nexport const onInstagramAccountDeleted = /*#__PURE__*/ EventDefinition(\n 'wix.instagram_feed.v1.instagram_account_deleted',\n true,\n (event: InstagramAccountDeletedEnvelope) =>\n renameKeysFromRESTResponseToSDKResponse(\n transformPaths(event, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [{ path: 'metadata.eventTime' }],\n },\n ])\n )\n)<InstagramAccountDeletedEnvelope>();\n\nexport {\n AccountInfo,\n AccountInfoMetadata,\n ActionEvent,\n BaseEventMetadata,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EventMetadata,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n InstagramAccount,\n InstagramAccountDeletedEnvelope,\n InstagramInfo,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n MessageEnvelope,\n RestoreInfo,\n WebhookIdentityType,\n} from './instagram-feed-v1-instagram-account-accounts.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 ambassadorWixInstagramFeedV1InstagramAccount from './instagram-feed-v1-instagram-account-accounts.http.js';\n\nexport interface InstagramAccount {\n /**\n * The id of the connection\n * @format GUID\n * @readonly\n */\n _id?: string;\n /**\n * The revision of the connection\n * @readonly\n */\n revision?: string | null;\n /** The instagram info connected to */\n instagramInfo?: InstagramInfo;\n /** True - account is synchronized with the Meta API. False - in last successful state */\n synchronized?: boolean | null;\n}\n\nexport interface InstagramInfo {\n /**\n * The id of the instagram user\n * @immutable\n * @maxLength 30\n */\n instagramId?: string;\n /**\n * The username of the instagram user\n * @readonly\n * @maxLength 500\n */\n instagramUsername?: string;\n /**\n * Profile picture URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n profilePictureUrl?: string;\n /**\n * Follower count from Instagram\n * @readonly\n */\n followersCount?: number | null;\n /**\n * Media count from Instagram\n * @readonly\n */\n mediaCount?: number | null;\n /**\n * Profile biography from Instagram\n * @readonly\n * @maxLength 500\n */\n biography?: string | null;\n /**\n * Number of accounts this user follows\n * @readonly\n */\n followsCount?: number | null;\n /**\n * Profile name from Instagram\n * @readonly\n * @maxLength 500\n */\n name?: string | null;\n /**\n * Profile website URL from Instagram\n * @readonly\n * @maxLength 2000\n */\n website?: string | null;\n}\n\nexport interface InitiateAccountConnectionRequest {}\n\nexport interface InitiateAccountConnectionResponse {\n /**\n * State parameter for authorization callback\n * @maxLength 256\n */\n connectionParams?: string[];\n}\n\nexport interface CreateAccountRequest {\n /**\n * connection id\n * @readonly\n * @maxLength 256\n */\n authorizationCode?: string;\n /**\n * redirect url\n * @maxLength 256\n */\n redirectUrl?: string;\n}\n\nexport interface CreateAccountResponse {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface DisconnectAccountRequest {\n /**\n * connection id to be disconnected\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface DisconnectAccountResponse {}\n\nexport interface GetInstagramAccountRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId: string;\n}\n\nexport interface GetInstagramAccountResponse {\n /** instagram account information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ListInstagramAccountsRequest {}\n\nexport interface ListInstagramAccountsResponse {\n /** instagram account profile information */\n instagramAccounts?: InstagramAccount[];\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 MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\nexport interface ConnectAccountByTokenRequest {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n accessToken?: string;\n}\n\nexport interface ConnectAccountByTokenResponse {\n /** instagram account profile information */\n instagramAccount?: InstagramAccount;\n}\n\nexport interface ChangeTokenExpirationDateRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n /** new expiration date */\n expirationDate?: Date | null;\n}\n\nexport interface ChangeTokenExpirationDateResponse {}\n\nexport interface GetLongLivedTokenRequest {\n /**\n * connection id\n * @readonly\n * @format GUID\n */\n connectionId?: string;\n}\n\nexport interface GetLongLivedTokenResponse {\n /**\n * access token received from instagram api\n * @maxLength 255\n */\n token?: string;\n}\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n accountInfo?: AccountInfoMetadata;\n}\n\nexport interface AccountInfoMetadata {\n /** ID of the Wix account associated with the event */\n accountId: string;\n /** ID of the Wix site associated with the event. Only included when the event is tied to a specific site. */\n siteId?: string;\n /** ID of the parent Wix account. Only included when 'accountId' belongs to a child account. */\n parentAccountId?: string;\n}\n\nexport interface InstagramAccountDeletedEnvelope {\n metadata: EventMetadata;\n}\n\n/** @permissionScope Instagram external scope\n * @permissionScopeId SCOPE.GROUPS.INSTAGRAM_ACCOUNTS\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @webhook\n * @eventType wix.instagram_feed.v1.instagram_account_deleted\n * @serviceIdentifier wix.instagram.v1.InstagramAccountService\n * @slug deleted\n * @documentationMaturity preview\n */\nexport declare function onInstagramAccountDeleted(\n handler: (event: InstagramAccountDeletedEnvelope) => void | Promise<void>\n): void;\n\n/**\n * Retrieve hash needed for connection of instagram account to a site.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.INITIATE_CONNECTION\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.InitiateAccountConnection\n */\nexport async function initiateAccountConnection(): Promise<\n NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 2>\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 ambassadorWixInstagramFeedV1InstagramAccount.initiateAccountConnection(\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\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n * @param connectionId - connection id to be disconnected\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.DISCONNECT\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.DisconnectAccount\n */\nexport async function disconnectAccount(connectionId: string): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.disconnectAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n * @param connectionId - connection id\n * @public\n * @documentationMaturity preview\n * @requiredField connectionId\n * @permissionId INSTAGRAM_ACCOUNTS.GET_PROFILE\n * @applicableIdentity APP\n * @returns instagram account information\n * @fqn wix.instagram.v1.InstagramAccountService.GetInstagramAccount\n */\nexport async function getInstagramAccount(\n connectionId: string\n): Promise<\n NonNullablePaths<\n InstagramAccount,\n | `_id`\n | `instagramInfo.instagramId`\n | `instagramInfo.instagramUsername`\n | `instagramInfo.profilePictureUrl`,\n 3\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n connectionId: connectionId,\n });\n\n const reqOpts =\n ambassadorWixInstagramFeedV1InstagramAccount.getInstagramAccount(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)\n ?.instagramAccount!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { connectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['connectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n * @public\n * @documentationMaturity preview\n * @permissionId INSTAGRAM_ACCOUNTS.LIST_PROFILES\n * @applicableIdentity APP\n * @fqn wix.instagram.v1.InstagramAccountService.ListInstagramAccounts\n */\nexport async function listInstagramAccounts(): Promise<\n NonNullablePaths<\n ListInstagramAccountsResponse,\n | `instagramAccounts`\n | `instagramAccounts.${number}._id`\n | `instagramAccounts.${number}.instagramInfo.instagramId`\n | `instagramAccounts.${number}.instagramInfo.instagramUsername`\n | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,\n 5\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 ambassadorWixInstagramFeedV1InstagramAccount.listInstagramAccounts(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n 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 { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixInstagramV1InstagramAccountServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'bo._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'instagram_integration.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/instagram-accounts',\n destPath: '',\n },\n {\n srcPath: '/_api/instagram-accounts',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/_api/instagram-accounts/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_instagram_accounts';\n\n/** Retrieve hash needed for connection of instagram account to a site. */\nexport function initiateAccountConnection(\n payload: object\n): RequestOptionsFactory<any> {\n function __initiateAccountConnection({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.InitiateAccountConnection',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/initiate-connection',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __initiateAccountConnection;\n}\n\n/**\n * Disconnect instagram account from a site.\n *\n * Removes stored Long-life token corresponding to the instagram user id.\n */\nexport function disconnectAccount(payload: object): RequestOptionsFactory<any> {\n function __disconnectAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'DELETE' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.DisconnectAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __disconnectAccount;\n}\n\n/**\n * Get instagram account profile.\n *\n * Returns instagram account profile corresponding to account id.\n */\nexport function getInstagramAccount(\n payload: object\n): RequestOptionsFactory<any> {\n function __getInstagramAccount({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn: 'wix.instagram.v1.InstagramAccountService.GetInstagramAccount',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts/{connectionId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getInstagramAccount;\n}\n\n/**\n * List instagram accounts connected to the site.\n *\n * Returns list of instagram user ids connected to app instance.\n */\nexport function listInstagramAccounts(\n payload: object\n): RequestOptionsFactory<any> {\n function __listInstagramAccounts({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.instagram_feed.v1.instagram_account',\n method: 'GET' as any,\n methodFqn:\n 'wix.instagram.v1.InstagramAccountService.ListInstagramAccounts',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveWixInstagramV1InstagramAccountServiceUrl({\n protoPath: '/v1/instagram-accounts',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __listInstagramAccounts;\n}\n","import {\n initiateAccountConnection as publicInitiateAccountConnection,\n disconnectAccount as publicDisconnectAccount,\n getInstagramAccount as publicGetInstagramAccount,\n listInstagramAccounts as publicListInstagramAccounts,\n} from './instagram-feed-v1-instagram-account-accounts.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 { onInstagramAccountDeleted as publicOnInstagramAccountDeleted } from './instagram-feed-v1-instagram-account-accounts.public.js';\n\nexport const initiateAccountConnection: MaybeContext<\n BuildRESTFunction<typeof publicInitiateAccountConnection> &\n typeof publicInitiateAccountConnection\n> = /*#__PURE__*/ createRESTModule(publicInitiateAccountConnection);\nexport const disconnectAccount: MaybeContext<\n BuildRESTFunction<typeof publicDisconnectAccount> &\n typeof publicDisconnectAccount\n> = /*#__PURE__*/ createRESTModule(publicDisconnectAccount);\nexport const getInstagramAccount: MaybeContext<\n BuildRESTFunction<typeof publicGetInstagramAccount> &\n typeof publicGetInstagramAccount\n> = /*#__PURE__*/ createRESTModule(publicGetInstagramAccount);\nexport const listInstagramAccounts: MaybeContext<\n BuildRESTFunction<typeof publicListInstagramAccounts> &\n typeof publicListInstagramAccounts\n> = /*#__PURE__*/ createRESTModule(publicListInstagramAccounts);\n/** */\nexport const onInstagramAccountDeleted: BuildEventDefinition<\n typeof publicOnInstagramAccountDeleted\n> &\n typeof publicOnInstagramAccountDeleted = /*#__PURE__*/ createEventModule(\n publicOnInstagramAccountDeleted\n);\n\nexport { WebhookIdentityType } from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport {\n InstagramAccount,\n InstagramInfo,\n InitiateAccountConnectionRequest,\n InitiateAccountConnectionResponse,\n CreateAccountRequest,\n CreateAccountResponse,\n DisconnectAccountRequest,\n DisconnectAccountResponse,\n GetInstagramAccountRequest,\n GetInstagramAccountResponse,\n ListInstagramAccountsRequest,\n ListInstagramAccountsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ConnectAccountByTokenRequest,\n ConnectAccountByTokenResponse,\n ChangeTokenExpirationDateRequest,\n ChangeTokenExpirationDateResponse,\n GetLongLivedTokenRequest,\n GetLongLivedTokenResponse,\n BaseEventMetadata,\n EventMetadata,\n AccountInfoMetadata,\n InstagramAccountDeletedEnvelope,\n} from './instagram-feed-v1-instagram-account-accounts.universal.js';\nexport { WebhookIdentityTypeWithLiterals } from './instagram-feed-v1-instagram-account-accounts.universal.js';\n"],"mappings":";AAAA,SAAS,2CAAAA,gDAA+C;AACxD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,uBAAqD;;;ACH9D,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,kBAAkB;AAI3B,SAAS,gDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,cAAc;AAAA,MACZ;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qCAAqC;AAAA,MACnC;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,sBAAsB;AAAA,MACpB;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,Q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C,UACCC;AAAA,IACE,eAAe,OAAO;AAAA,MACpB;AAAA,QACE,aAAa;AAAA,QACb,OAAO,CAAC,EAAE,MAAM,qBAAqB,CAAC;AAAA,MACxC;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAmC;;;AG3HnC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAQ3B,IAAMC,6BAGK,iCAAiBA,0BAA+B;AAC3D,IAAMC,qBAGK,iCAAiBA,kBAAuB;AACnD,IAAMC,uBAGK,iCAAiBA,oBAAyB;AACrD,IAAMC,yBAGK,iCAAiBA,sBAA2B;AAEvD,IAAMC,6BAG4C;AAAA,EACvD;AACF;","names":["renameKeysFromRESTResponseToSDKResponse","WebhookIdentityType","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","renameKeysFromRESTResponseToSDKResponse","initiateAccountConnection","disconnectAccount","getInstagramAccount","listInstagramAccounts","onInstagramAccountDeleted"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_instagram_accounts",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/",
@@ -21,23 +21,16 @@
21
21
  "import": "./build/es/meta.mjs",
22
22
  "require": "./build/cjs/meta.js",
23
23
  "types": "./build/es/meta.d.mts"
24
- },
25
- "./schemas": {
26
- "import": "./build/es/schemas.mjs",
27
- "require": "./build/cjs/schemas.js",
28
- "types": "./build/es/schemas.d.mts"
29
24
  }
30
25
  },
31
26
  "files": [
32
27
  "build",
33
28
  "meta",
34
- "service-plugins",
35
- "schemas"
29
+ "service-plugins"
36
30
  ],
37
31
  "dependencies": {
38
- "@wix/sdk-runtime": "^1.0.19",
39
- "@wix/sdk-types": "^1.17.11",
40
- "zod": "^4.3.6"
32
+ "@wix/sdk-runtime": "^1.0.24",
33
+ "@wix/sdk-types": "^1.17.11"
41
34
  },
42
35
  "devDependencies": {
43
36
  "tsup": "^8.4.0",
@@ -57,5 +50,5 @@
57
50
  "fqdn": "wix.instagram_feed.v1.instagram_account"
58
51
  }
59
52
  },
60
- "falconPackageHash": "c9b43adeb9c27c4d67472d36c2a9cfc6b7cb89b265ec78e2f9da3215"
53
+ "falconPackageHash": "7a2a53c54c5dc5b01e9ff3c3f4d54414d146c5b2ec2ba161cfa14918"
61
54
  }
@@ -1,50 +0,0 @@
1
- import * as z from 'zod';
2
-
3
- declare const InitiateAccountConnectionRequest: z.ZodObject<{}, z.core.$strip>;
4
- declare const InitiateAccountConnectionResponse: z.ZodObject<{
5
- connectionParams: z.ZodOptional<z.ZodArray<z.ZodString>>;
6
- }, z.core.$strip>;
7
- declare const DisconnectAccountRequest: z.ZodObject<{
8
- connectionId: z.ZodString;
9
- }, z.core.$strip>;
10
- declare const DisconnectAccountResponse: z.ZodObject<{}, z.core.$strip>;
11
- declare const GetInstagramAccountRequest: z.ZodObject<{
12
- connectionId: z.ZodString;
13
- }, z.core.$strip>;
14
- declare const GetInstagramAccountResponse: z.ZodObject<{
15
- _id: z.ZodOptional<z.ZodString>;
16
- revision: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
- instagramInfo: z.ZodOptional<z.ZodObject<{
18
- instagramId: z.ZodOptional<z.ZodString>;
19
- instagramUsername: z.ZodOptional<z.ZodString>;
20
- profilePictureUrl: z.ZodOptional<z.ZodString>;
21
- followersCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
22
- mediaCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
23
- biography: z.ZodNullable<z.ZodOptional<z.ZodString>>;
24
- followsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
25
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
26
- website: z.ZodNullable<z.ZodOptional<z.ZodString>>;
27
- }, z.core.$strip>>;
28
- synchronized: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
29
- }, z.core.$strip>;
30
- declare const ListInstagramAccountsRequest: z.ZodObject<{}, z.core.$strip>;
31
- declare const ListInstagramAccountsResponse: z.ZodObject<{
32
- instagramAccounts: z.ZodOptional<z.ZodArray<z.ZodObject<{
33
- _id: z.ZodOptional<z.ZodString>;
34
- revision: z.ZodNullable<z.ZodOptional<z.ZodString>>;
35
- instagramInfo: z.ZodOptional<z.ZodObject<{
36
- instagramId: z.ZodOptional<z.ZodString>;
37
- instagramUsername: z.ZodOptional<z.ZodString>;
38
- profilePictureUrl: z.ZodOptional<z.ZodString>;
39
- followersCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
40
- mediaCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
41
- biography: z.ZodNullable<z.ZodOptional<z.ZodString>>;
42
- followsCount: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
43
- name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
44
- website: z.ZodNullable<z.ZodOptional<z.ZodString>>;
45
- }, z.core.$strip>>;
46
- synchronized: z.ZodNullable<z.ZodOptional<z.ZodBoolean>>;
47
- }, z.core.$strip>>>;
48
- }, z.core.$strip>;
49
-
50
- export { DisconnectAccountRequest, DisconnectAccountResponse, GetInstagramAccountRequest, GetInstagramAccountResponse, InitiateAccountConnectionRequest, InitiateAccountConnectionResponse, ListInstagramAccountsRequest, ListInstagramAccountsResponse };