@wix/auto_sdk_instagram_accounts 1.0.16 → 1.0.18
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.
- package/build/cjs/index.d.ts +3 -3
- package/build/cjs/index.js +4 -3
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +3 -3
- package/build/cjs/index.typings.js.map +1 -1
- package/build/es/index.d.mts +3 -3
- package/build/es/index.mjs +4 -3
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +3 -3
- package/build/es/index.typings.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +3 -3
- package/build/internal/cjs/index.typings.d.ts +3 -3
- package/build/internal/es/index.d.mts +3 -3
- package/build/internal/es/index.typings.d.mts +3 -3
- package/package.json +5 -12
- package/build/cjs/schemas.d.ts +0 -50
- package/build/cjs/schemas.js +0 -121
- package/build/cjs/schemas.js.map +0 -1
- package/build/es/schemas.d.mts +0 -50
- package/build/es/schemas.mjs +0 -77
- package/build/es/schemas.mjs.map +0 -1
- package/build/internal/cjs/index.js +0 -384
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.js +0 -325
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.js +0 -300
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/schemas.d.ts +0 -50
- package/build/internal/cjs/schemas.js +0 -121
- package/build/internal/cjs/schemas.js.map +0 -1
- package/build/internal/es/index.mjs +0 -355
- package/build/internal/es/index.mjs.map +0 -1
- package/build/internal/es/index.typings.mjs +0 -297
- package/build/internal/es/index.typings.mjs.map +0 -1
- package/build/internal/es/meta.mjs +0 -269
- package/build/internal/es/meta.mjs.map +0 -1
- package/build/internal/es/schemas.d.mts +0 -50
- package/build/internal/es/schemas.mjs +0 -77
- package/build/internal/es/schemas.mjs.map +0 -1
- package/schemas/package.json +0 -3
package/build/cjs/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ interface InitiateAccountConnectionSignature {
|
|
|
7
7
|
/**
|
|
8
8
|
* Retrieve hash needed for connection of instagram account to a site.
|
|
9
9
|
*/
|
|
10
|
-
(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`,
|
|
10
|
+
(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 0>>;
|
|
11
11
|
}
|
|
12
12
|
declare function disconnectAccount$1(httpClient: HttpClient): DisconnectAccountSignature;
|
|
13
13
|
interface DisconnectAccountSignature {
|
|
@@ -28,7 +28,7 @@ interface GetInstagramAccountSignature {
|
|
|
28
28
|
* @param - connection id
|
|
29
29
|
* @returns instagram account information
|
|
30
30
|
*/
|
|
31
|
-
(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`,
|
|
31
|
+
(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`, 1>>;
|
|
32
32
|
}
|
|
33
33
|
declare function listInstagramAccounts$1(httpClient: HttpClient): ListInstagramAccountsSignature;
|
|
34
34
|
interface ListInstagramAccountsSignature {
|
|
@@ -37,7 +37,7 @@ interface ListInstagramAccountsSignature {
|
|
|
37
37
|
*
|
|
38
38
|
* Returns list of instagram user ids connected to app instance.
|
|
39
39
|
*/
|
|
40
|
-
(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,
|
|
40
|
+
(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`, 3>>;
|
|
41
41
|
}
|
|
42
42
|
declare const onInstagramAccountDeleted$1: EventDefinition<InstagramAccountDeletedEnvelope, "wix.instagram_feed.v1.instagram_account_deleted">;
|
|
43
43
|
|
package/build/cjs/index.js
CHANGED
|
@@ -323,6 +323,7 @@ async function listInstagramAccounts2() {
|
|
|
323
323
|
}
|
|
324
324
|
|
|
325
325
|
// src/instagram-feed-v1-instagram-account-accounts.public.ts
|
|
326
|
+
var TRANSFORM_PATHS_0 = [{ path: "metadata.eventTime" }];
|
|
326
327
|
function initiateAccountConnection3(httpClient) {
|
|
327
328
|
return () => initiateAccountConnection2(
|
|
328
329
|
// @ts-ignore
|
|
@@ -349,14 +350,14 @@ function listInstagramAccounts3(httpClient) {
|
|
|
349
350
|
{ httpClient }
|
|
350
351
|
);
|
|
351
352
|
}
|
|
352
|
-
var onInstagramAccountDeleted = (0, import_sdk_types.EventDefinition)(
|
|
353
|
+
var onInstagramAccountDeleted = /* @__PURE__ */ (0, import_sdk_types.EventDefinition)(
|
|
353
354
|
"wix.instagram_feed.v1.instagram_account_deleted",
|
|
354
355
|
true,
|
|
355
356
|
(event) => (0, import_rename_all_nested_keys2.renameKeysFromRESTResponseToSDKResponse)(
|
|
356
357
|
(0, import_transform_paths.transformPaths)(event, [
|
|
357
358
|
{
|
|
358
359
|
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
359
|
-
paths:
|
|
360
|
+
paths: TRANSFORM_PATHS_0
|
|
360
361
|
}
|
|
361
362
|
])
|
|
362
363
|
)
|
|
@@ -369,7 +370,7 @@ var initiateAccountConnection4 = /* @__PURE__ */ (0, import_rest_modules3.create
|
|
|
369
370
|
var disconnectAccount4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(disconnectAccount3);
|
|
370
371
|
var getInstagramAccount4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getInstagramAccount3);
|
|
371
372
|
var listInstagramAccounts4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listInstagramAccounts3);
|
|
372
|
-
var onInstagramAccountDeleted2 = (0, import_event_definition_modules.createEventModule)(
|
|
373
|
+
var onInstagramAccountDeleted2 = /* @__PURE__ */ (0, import_event_definition_modules.createEventModule)(
|
|
373
374
|
onInstagramAccountDeleted
|
|
374
375
|
);
|
|
375
376
|
// Annotate the CommonJS export names for ESM import in node:
|
package/build/cjs/index.js.map
CHANGED
|
@@ -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":";;;;;;;;;;;;;;;;;;;;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;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;A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O,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,gCAA4B;AAAA,EACvC;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,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\nconst TRANSFORM_PATHS_0 = [{ path: 'metadata.eventTime' }];\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`, 0>\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 1\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 3\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: TRANSFORM_PATHS_0,\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`, 0>\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 1\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 3\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;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,IAC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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;AAAA,MACT;AAAA,IACF,CAAC;AAAA,EACH;AACJ,EAAmC;;;AG5HnC,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"]}
|
|
@@ -395,7 +395,7 @@ declare function onInstagramAccountDeleted(handler: (event: InstagramAccountDele
|
|
|
395
395
|
* @applicableIdentity APP
|
|
396
396
|
* @fqn wix.instagram.v1.InstagramAccountService.InitiateAccountConnection
|
|
397
397
|
*/
|
|
398
|
-
declare function initiateAccountConnection(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`,
|
|
398
|
+
declare function initiateAccountConnection(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 0>>;
|
|
399
399
|
/**
|
|
400
400
|
* Disconnect instagram account from a site.
|
|
401
401
|
*
|
|
@@ -422,7 +422,7 @@ declare function disconnectAccount(connectionId: string): Promise<void>;
|
|
|
422
422
|
* @returns instagram account information
|
|
423
423
|
* @fqn wix.instagram.v1.InstagramAccountService.GetInstagramAccount
|
|
424
424
|
*/
|
|
425
|
-
declare function getInstagramAccount(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`,
|
|
425
|
+
declare function getInstagramAccount(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`, 1>>;
|
|
426
426
|
/**
|
|
427
427
|
* List instagram accounts connected to the site.
|
|
428
428
|
*
|
|
@@ -433,6 +433,6 @@ declare function getInstagramAccount(connectionId: string): Promise<NonNullableP
|
|
|
433
433
|
* @applicableIdentity APP
|
|
434
434
|
* @fqn wix.instagram.v1.InstagramAccountService.ListInstagramAccounts
|
|
435
435
|
*/
|
|
436
|
-
declare function listInstagramAccounts(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,
|
|
436
|
+
declare function listInstagramAccounts(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`, 3>>;
|
|
437
437
|
|
|
438
438
|
export { type AccountInfo, type AccountInfoMetadata, type ActionEvent, type BaseEventMetadata, type ChangeTokenExpirationDateRequest, type ChangeTokenExpirationDateResponse, type ConnectAccountByTokenRequest, type ConnectAccountByTokenResponse, type CreateAccountRequest, type CreateAccountResponse, type DisconnectAccountRequest, type DisconnectAccountResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type EventMetadata, type GetInstagramAccountRequest, type GetInstagramAccountResponse, type GetLongLivedTokenRequest, type GetLongLivedTokenResponse, type IdentificationData, type IdentificationDataIdOneOf, type InitiateAccountConnectionRequest, type InitiateAccountConnectionResponse, type InstagramAccount, type InstagramAccountDeletedEnvelope, type InstagramInfo, type ListInstagramAccountsRequest, type ListInstagramAccountsResponse, type MessageEnvelope, type RestoreInfo, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, disconnectAccount, getInstagramAccount, initiateAccountConnection, listInstagramAccounts, onInstagramAccountDeleted };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts"],"sourcesContent":["export * from './src/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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,iCAAAC;AAAA,EAAA,6BAAAC;AAAA;AAAA;;;ACAA,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;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,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA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jB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAYA,eAAsBG,yBAUpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,CAAC,CAAC;AAExD,QAAM,UACyC,sBAAsB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAH;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["disconnectAccount","getInstagramAccount","initiateAccountConnection","listInstagramAccounts","import_rest_modules","WebhookIdentityType","initiateAccountConnection","sdkTransformError","disconnectAccount","getInstagramAccount","listInstagramAccounts"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/instagram-feed-v1-instagram-account-accounts.universal.ts","../../src/instagram-feed-v1-instagram-account-accounts.http.ts"],"sourcesContent":["export * from './src/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`, 0>\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 1\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 3\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA,2BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,iCAAAC;AAAA,EAAA,6BAAAC;AAAA;AAAA;;;ACAA,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;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,IAC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AoB,OAAO;AAE1E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI,GACtD;AAAA,EACN,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,cAAc,OAAO;AAAA,QACjD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,cAAc;AAAA,IACjB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAYA,eAAsBG,yBAUpB;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC,CAAC,CAAC;AAExD,QAAM,UACyC,sBAAsB,OAAO;AAE5E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAH;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["disconnectAccount","getInstagramAccount","initiateAccountConnection","listInstagramAccounts","import_rest_modules","WebhookIdentityType","initiateAccountConnection","sdkTransformError","disconnectAccount","getInstagramAccount","listInstagramAccounts"]}
|
package/build/es/index.d.mts
CHANGED
|
@@ -7,7 +7,7 @@ interface InitiateAccountConnectionSignature {
|
|
|
7
7
|
/**
|
|
8
8
|
* Retrieve hash needed for connection of instagram account to a site.
|
|
9
9
|
*/
|
|
10
|
-
(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`,
|
|
10
|
+
(): Promise<NonNullablePaths<InitiateAccountConnectionResponse, `connectionParams`, 0>>;
|
|
11
11
|
}
|
|
12
12
|
declare function disconnectAccount$1(httpClient: HttpClient): DisconnectAccountSignature;
|
|
13
13
|
interface DisconnectAccountSignature {
|
|
@@ -28,7 +28,7 @@ interface GetInstagramAccountSignature {
|
|
|
28
28
|
* @param - connection id
|
|
29
29
|
* @returns instagram account information
|
|
30
30
|
*/
|
|
31
|
-
(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`,
|
|
31
|
+
(connectionId: string): Promise<NonNullablePaths<InstagramAccount, `_id` | `instagramInfo.instagramId` | `instagramInfo.instagramUsername` | `instagramInfo.profilePictureUrl`, 1>>;
|
|
32
32
|
}
|
|
33
33
|
declare function listInstagramAccounts$1(httpClient: HttpClient): ListInstagramAccountsSignature;
|
|
34
34
|
interface ListInstagramAccountsSignature {
|
|
@@ -37,7 +37,7 @@ interface ListInstagramAccountsSignature {
|
|
|
37
37
|
*
|
|
38
38
|
* Returns list of instagram user ids connected to app instance.
|
|
39
39
|
*/
|
|
40
|
-
(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`,
|
|
40
|
+
(): Promise<NonNullablePaths<ListInstagramAccountsResponse, `instagramAccounts` | `instagramAccounts.${number}._id` | `instagramAccounts.${number}.instagramInfo.instagramId` | `instagramAccounts.${number}.instagramInfo.instagramUsername` | `instagramAccounts.${number}.instagramInfo.profilePictureUrl`, 3>>;
|
|
41
41
|
}
|
|
42
42
|
declare const onInstagramAccountDeleted$1: EventDefinition<InstagramAccountDeletedEnvelope, "wix.instagram_feed.v1.instagram_account_deleted">;
|
|
43
43
|
|
package/build/es/index.mjs
CHANGED
|
@@ -295,6 +295,7 @@ async function listInstagramAccounts2() {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// src/instagram-feed-v1-instagram-account-accounts.public.ts
|
|
298
|
+
var TRANSFORM_PATHS_0 = [{ path: "metadata.eventTime" }];
|
|
298
299
|
function initiateAccountConnection3(httpClient) {
|
|
299
300
|
return () => initiateAccountConnection2(
|
|
300
301
|
// @ts-ignore
|
|
@@ -321,14 +322,14 @@ function listInstagramAccounts3(httpClient) {
|
|
|
321
322
|
{ httpClient }
|
|
322
323
|
);
|
|
323
324
|
}
|
|
324
|
-
var onInstagramAccountDeleted = EventDefinition(
|
|
325
|
+
var onInstagramAccountDeleted = /* @__PURE__ */ EventDefinition(
|
|
325
326
|
"wix.instagram_feed.v1.instagram_account_deleted",
|
|
326
327
|
true,
|
|
327
328
|
(event) => renameKeysFromRESTResponseToSDKResponse2(
|
|
328
329
|
transformPaths(event, [
|
|
329
330
|
{
|
|
330
331
|
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
331
|
-
paths:
|
|
332
|
+
paths: TRANSFORM_PATHS_0
|
|
332
333
|
}
|
|
333
334
|
])
|
|
334
335
|
)
|
|
@@ -341,7 +342,7 @@ var initiateAccountConnection4 = /* @__PURE__ */ createRESTModule(initiateAccoun
|
|
|
341
342
|
var disconnectAccount4 = /* @__PURE__ */ createRESTModule(disconnectAccount3);
|
|
342
343
|
var getInstagramAccount4 = /* @__PURE__ */ createRESTModule(getInstagramAccount3);
|
|
343
344
|
var listInstagramAccounts4 = /* @__PURE__ */ createRESTModule(listInstagramAccounts3);
|
|
344
|
-
var onInstagramAccountDeleted2 = createEventModule(
|
|
345
|
+
var onInstagramAccountDeleted2 = /* @__PURE__ */ createEventModule(
|
|
345
346
|
onInstagramAccountDeleted
|
|
346
347
|
);
|
|
347
348
|
export {
|