@wix/auto_sdk_app-management_app-permissions 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { AppPermission, ListAppPermissionsOptions, ListAppPermissionsResponse } from './index.typings.js';
3
- export { Action, ActionEvent, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, RestoreInfo, V1Permission, WebhookIdentityType } from './index.typings.js';
3
+ export { Action, ActionEvent, ActionWithLiterals, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, RestoreInfo, V1Permission, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
- type AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;
6
5
  declare function createAppPermission$1(httpClient: HttpClient): CreateAppPermissionSignature;
7
6
  interface CreateAppPermissionSignature {
8
7
  /**
@@ -14,7 +13,7 @@ interface CreateAppPermissionSignature {
14
13
  * @param - Permission to add to the specified app.
15
14
  * @returns Details of permission that was added to the app.
16
15
  */
17
- (appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`>): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;
16
+ (appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 3>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>>;
18
17
  }
19
18
  declare function listAppPermissions$1(httpClient: HttpClient): ListAppPermissionsSignature;
20
19
  interface ListAppPermissionsSignature {
@@ -26,9 +25,7 @@ interface ListAppPermissionsSignature {
26
25
  *
27
26
  * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.
28
27
  */
29
- (appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, {
30
- [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;
31
- }[AppPermissionNonNullablePaths]>>;
28
+ (appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, `appPermissions` | `appPermissions.${number}.appId` | `appPermissions.${number}.permission.permissionId`, 5>>;
32
29
  }
33
30
  declare function deleteAppPermission$1(httpClient: HttpClient): DeleteAppPermissionSignature;
34
31
  interface DeleteAppPermissionSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.public.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.context.ts"],"sourcesContent":["export * from './src/devcenter-apps-v1-app-permission-app-permissions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppPermission,\n ListAppPermissionsOptions,\n ListAppPermissionsResponse,\n createAppPermission as universalCreateAppPermission,\n deleteAppPermission as universalDeleteAppPermission,\n listAppPermissions as universalListAppPermissions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\nexport function createAppPermission(\n httpClient: HttpClient\n): CreateAppPermissionSignature {\n return (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n ) =>\n universalCreateAppPermission(\n appPermission,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateAppPermissionSignature {\n /**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - Permission to add to the specified app.\n * @returns Details of permission that was added to the app.\n */\n (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n ): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;\n}\n\nexport function listAppPermissions(\n httpClient: HttpClient\n): ListAppPermissionsSignature {\n return (appId: string, options?: ListAppPermissionsOptions) =>\n universalListAppPermissions(\n appId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPermissionsSignature {\n /**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n */\n (appId: string, options?: ListAppPermissionsOptions): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n >;\n}\n\nexport function deleteAppPermission(\n httpClient: HttpClient\n): DeleteAppPermissionSignature {\n return (appId: string, permissionId: string) =>\n universalDeleteAppPermission(\n appId,\n permissionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAppPermissionSignature {\n /**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n */\n (appId: string, permissionId: string): Promise<void>;\n}\n\nexport {\n Action,\n ActionEvent,\n AppPermission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n ListAppPermissionsRequest,\n ListAppPermissionsResponse,\n MessageEnvelope,\n OldPermissionChangedEvent,\n Permission,\n RestoreInfo,\n V1Permission,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n","import {\n createAppPermission as publicCreateAppPermission,\n listAppPermissions as publicListAppPermissions,\n deleteAppPermission as publicDeleteAppPermission,\n} from './devcenter-apps-v1-app-permission-app-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const createAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicCreateAppPermission> &\n typeof publicCreateAppPermission\n> = /*#__PURE__*/ createRESTModule(publicCreateAppPermission);\nexport const listAppPermissions: MaybeContext<\n BuildRESTFunction<typeof publicListAppPermissions> &\n typeof publicListAppPermissions\n> = /*#__PURE__*/ createRESTModule(publicListAppPermissions);\nexport const deleteAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAppPermission> &\n typeof publicDeleteAppPermission\n> = /*#__PURE__*/ createRESTModule(publicDeleteAppPermission);\n\nexport {\n Action,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n AppPermission,\n V1Permission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n ListAppPermissionsRequest,\n CursorPaging,\n ListAppPermissionsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n OldPermissionChangedEvent,\n Permission,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;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,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO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AAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvgBO,SAASG,qBACd,YAC8B;AAC9B,SAAO,CACL,kBAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAoBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,OAAe,iBACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACpFA,IAAAC,uBAAiC;AAG1B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,uBAGK,2DAAiBA,oBAAyB;","names":["createAppPermission","deleteAppPermission","listAppPermissions","import_timestamp","import_rest_modules","payload","Action","WebhookIdentityType","createAppPermission","sdkTransformError","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission","import_rest_modules","createAppPermission","listAppPermissions","deleteAppPermission"]}
1
+ {"version":3,"sources":["../../index.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.public.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.context.ts"],"sourcesContent":["export * from './src/devcenter-apps-v1-app-permission-app-permissions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n | `appPermissions`\n | `appPermissions.${number}.appId`\n | `appPermissions.${number}.permission.permissionId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppPermission,\n ListAppPermissionsOptions,\n ListAppPermissionsResponse,\n createAppPermission as universalCreateAppPermission,\n deleteAppPermission as universalDeleteAppPermission,\n listAppPermissions as universalListAppPermissions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function createAppPermission(\n httpClient: HttpClient\n): CreateAppPermissionSignature {\n return (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n ) =>\n universalCreateAppPermission(\n appPermission,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateAppPermissionSignature {\n /**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - Permission to add to the specified app.\n * @returns Details of permission that was added to the app.\n */\n (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n ): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>\n >;\n}\n\nexport function listAppPermissions(\n httpClient: HttpClient\n): ListAppPermissionsSignature {\n return (appId: string, options?: ListAppPermissionsOptions) =>\n universalListAppPermissions(\n appId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPermissionsSignature {\n /**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n */\n (appId: string, options?: ListAppPermissionsOptions): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n | `appPermissions`\n | `appPermissions.${number}.appId`\n | `appPermissions.${number}.permission.permissionId`,\n 5\n >\n >;\n}\n\nexport function deleteAppPermission(\n httpClient: HttpClient\n): DeleteAppPermissionSignature {\n return (appId: string, permissionId: string) =>\n universalDeleteAppPermission(\n appId,\n permissionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAppPermissionSignature {\n /**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n */\n (appId: string, permissionId: string): Promise<void>;\n}\n\nexport {\n Action,\n ActionEvent,\n AppPermission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n ListAppPermissionsRequest,\n ListAppPermissionsResponse,\n MessageEnvelope,\n OldPermissionChangedEvent,\n Permission,\n RestoreInfo,\n V1Permission,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n","import {\n createAppPermission as publicCreateAppPermission,\n listAppPermissions as publicListAppPermissions,\n deleteAppPermission as publicDeleteAppPermission,\n} from './devcenter-apps-v1-app-permission-app-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const createAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicCreateAppPermission> &\n typeof publicCreateAppPermission\n> = /*#__PURE__*/ createRESTModule(publicCreateAppPermission);\nexport const listAppPermissions: MaybeContext<\n BuildRESTFunction<typeof publicListAppPermissions> &\n typeof publicListAppPermissions\n> = /*#__PURE__*/ createRESTModule(publicListAppPermissions);\nexport const deleteAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAppPermission> &\n typeof publicDeleteAppPermission\n> = /*#__PURE__*/ createRESTModule(publicDeleteAppPermission);\n\nexport {\n Action,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n AppPermission,\n V1Permission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n ListAppPermissionsRequest,\n CursorPaging,\n ListAppPermissionsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n OldPermissionChangedEvent,\n Permission,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n ActionWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;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,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB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E3gBO,SAASG,qBACd,YAC8B;AAC9B,SAAO,CACL,kBAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,OAAe,iBACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvFA,IAAAC,uBAAiC;AAG1B,IAAMC,uBAGK,2DAAiBA,oBAAyB;AACrD,IAAMC,sBAGK,2DAAiBA,mBAAwB;AACpD,IAAMC,uBAGK,2DAAiBA,oBAAyB;","names":["createAppPermission","deleteAppPermission","listAppPermissions","import_timestamp","import_rest_modules","payload","Action","WebhookIdentityType","createAppPermission","sdkTransformError","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission","import_rest_modules","createAppPermission","listAppPermissions","deleteAppPermission"]}
@@ -298,7 +298,6 @@ declare enum WebhookIdentityType {
298
298
  }
299
299
  /** @enumType */
300
300
  type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
301
- type AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;
302
301
  /**
303
302
  * Adds a permission to the specified app.
304
303
  *
@@ -317,7 +316,7 @@ type AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;
317
316
  * @returns Details of permission that was added to the app.
318
317
  * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission
319
318
  */
320
- declare function createAppPermission(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`>): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;
319
+ declare function createAppPermission(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 3>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>>;
321
320
  /**
322
321
  * Lists all permissions for the specified app.
323
322
  *
@@ -331,9 +330,7 @@ declare function createAppPermission(appPermission: NonNullablePaths<AppPermissi
331
330
  * @permissionId DEV_CENTER.READ_APP_PERMISSIONS
332
331
  * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions
333
332
  */
334
- declare function listAppPermissions(appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, {
335
- [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;
336
- }[AppPermissionNonNullablePaths]>>;
333
+ declare function listAppPermissions(appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, `appPermissions` | `appPermissions.${number}.appId` | `appPermissions.${number}.permission.permissionId`, 5>>;
337
334
  interface ListAppPermissionsOptions {
338
335
  /**
339
336
  * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.typings.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts"],"sourcesContent":["export * from './src/devcenter-apps-v1-app-permission-app-permissions.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 ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;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,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,aAAO,iCAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAA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ission","deleteAppPermission","listAppPermissions","import_timestamp","import_rest_modules","payload","Action","WebhookIdentityType","createAppPermission","sdkTransformError","listAppPermissions","deleteAppPermission"]}
1
+ {"version":3,"sources":["../../index.typings.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts"],"sourcesContent":["export * from './src/devcenter-apps-v1-app-permission-app-permissions.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 ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n | `appPermissions`\n | `appPermissions.${number}.appId`\n | `appPermissions.${number}.permission.permissionId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,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GAAG;AAE1B,UAAM;AAAA,EACR;AACF;AAiCA,eAAsBE,qBACpB,OACA,cACe;AAEf,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,UACsC,oBAAoB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAF;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,QAAQ,cAAc,OAAO;AAAA,QAChE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,cAAc;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["createAppPermission","deleteAppPermission","listAppPermissions","import_timestamp","import_rest_modules","payload","Action","WebhookIdentityType","createAppPermission","sdkTransformError","listAppPermissions","deleteAppPermission"]}
@@ -1,8 +1,7 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
2
  import { AppPermission, ListAppPermissionsOptions, ListAppPermissionsResponse } from './index.typings.mjs';
3
- export { Action, ActionEvent, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, RestoreInfo, V1Permission, WebhookIdentityType } from './index.typings.mjs';
3
+ export { Action, ActionEvent, ActionWithLiterals, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, RestoreInfo, V1Permission, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
4
4
 
5
- type AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;
6
5
  declare function createAppPermission$1(httpClient: HttpClient): CreateAppPermissionSignature;
7
6
  interface CreateAppPermissionSignature {
8
7
  /**
@@ -14,7 +13,7 @@ interface CreateAppPermissionSignature {
14
13
  * @param - Permission to add to the specified app.
15
14
  * @returns Details of permission that was added to the app.
16
15
  */
17
- (appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`>): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;
16
+ (appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 3>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>>;
18
17
  }
19
18
  declare function listAppPermissions$1(httpClient: HttpClient): ListAppPermissionsSignature;
20
19
  interface ListAppPermissionsSignature {
@@ -26,9 +25,7 @@ interface ListAppPermissionsSignature {
26
25
  *
27
26
  * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.
28
27
  */
29
- (appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, {
30
- [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;
31
- }[AppPermissionNonNullablePaths]>>;
28
+ (appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, `appPermissions` | `appPermissions.${number}.appId` | `appPermissions.${number}.permission.permissionId`, 5>>;
32
29
  }
33
30
  declare function deleteAppPermission$1(httpClient: HttpClient): DeleteAppPermissionSignature;
34
31
  interface DeleteAppPermissionSignature {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.public.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppPermission,\n ListAppPermissionsOptions,\n ListAppPermissionsResponse,\n createAppPermission as universalCreateAppPermission,\n deleteAppPermission as universalDeleteAppPermission,\n listAppPermissions as universalListAppPermissions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\nexport function createAppPermission(\n httpClient: HttpClient\n): CreateAppPermissionSignature {\n return (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n ) =>\n universalCreateAppPermission(\n appPermission,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateAppPermissionSignature {\n /**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - Permission to add to the specified app.\n * @returns Details of permission that was added to the app.\n */\n (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n ): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;\n}\n\nexport function listAppPermissions(\n httpClient: HttpClient\n): ListAppPermissionsSignature {\n return (appId: string, options?: ListAppPermissionsOptions) =>\n universalListAppPermissions(\n appId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPermissionsSignature {\n /**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n */\n (appId: string, options?: ListAppPermissionsOptions): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n >;\n}\n\nexport function deleteAppPermission(\n httpClient: HttpClient\n): DeleteAppPermissionSignature {\n return (appId: string, permissionId: string) =>\n universalDeleteAppPermission(\n appId,\n permissionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAppPermissionSignature {\n /**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n */\n (appId: string, permissionId: string): Promise<void>;\n}\n\nexport {\n Action,\n ActionEvent,\n AppPermission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n ListAppPermissionsRequest,\n ListAppPermissionsResponse,\n MessageEnvelope,\n OldPermissionChangedEvent,\n Permission,\n RestoreInfo,\n V1Permission,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n","import {\n createAppPermission as publicCreateAppPermission,\n listAppPermissions as publicListAppPermissions,\n deleteAppPermission as publicDeleteAppPermission,\n} from './devcenter-apps-v1-app-permission-app-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const createAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicCreateAppPermission> &\n typeof publicCreateAppPermission\n> = /*#__PURE__*/ createRESTModule(publicCreateAppPermission);\nexport const listAppPermissions: MaybeContext<\n BuildRESTFunction<typeof publicListAppPermissions> &\n typeof publicListAppPermissions\n> = /*#__PURE__*/ createRESTModule(publicListAppPermissions);\nexport const deleteAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAppPermission> &\n typeof publicDeleteAppPermission\n> = /*#__PURE__*/ createRESTModule(publicDeleteAppPermission);\n\nexport {\n Action,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n AppPermission,\n V1Permission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n ListAppPermissionsRequest,\n CursorPaging,\n ListAppPermissionsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n OldPermissionChangedEvent,\n Permission,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;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I,UAAU,CAAC;AAK/C,QAAM,UAAU,sCAAsC;AAAA,IACpD;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,UACsC,oBAAoB,OAAO;AAEvE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAAA,EACjC,SAAS,KAAU;AACjB,UAAM,mBAAmB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,QAAQ,cAAc,OAAO;AAAA,QAChE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,cAAc;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AEvgBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CACL,kBAKAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAoBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAqBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,OAAe,iBACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACpFA,SAAS,wBAAwB;AAG1B,IAAMC,uBAGK,iCAAiBA,oBAAyB;AACrD,IAAMC,sBAGK,iCAAiBA,mBAAwB;AACpD,IAAMC,uBAGK,iCAAiBA,oBAAyB;","names":["payload","Action","WebhookIdentityType","createAppPermission","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission"]}
1
+ {"version":3,"sources":["../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.public.ts","../../src/devcenter-apps-v1-app-permission-app-permissions.context.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n | `appPermissions`\n | `appPermissions.${number}.appId`\n | `appPermissions.${number}.permission.permissionId`,\n 5\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(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 appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(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: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AppPermission,\n ListAppPermissionsOptions,\n ListAppPermissionsResponse,\n createAppPermission as universalCreateAppPermission,\n deleteAppPermission as universalDeleteAppPermission,\n listAppPermissions as universalListAppPermissions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/app-management' };\n\nexport function createAppPermission(\n httpClient: HttpClient\n): CreateAppPermissionSignature {\n return (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n ) =>\n universalCreateAppPermission(\n appPermission,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface CreateAppPermissionSignature {\n /**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - Permission to add to the specified app.\n * @returns Details of permission that was added to the app.\n */\n (\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`,\n 3\n >\n ): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 3>\n >;\n}\n\nexport function listAppPermissions(\n httpClient: HttpClient\n): ListAppPermissionsSignature {\n return (appId: string, options?: ListAppPermissionsOptions) =>\n universalListAppPermissions(\n appId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListAppPermissionsSignature {\n /**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n */\n (appId: string, options?: ListAppPermissionsOptions): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n | `appPermissions`\n | `appPermissions.${number}.appId`\n | `appPermissions.${number}.permission.permissionId`,\n 5\n >\n >;\n}\n\nexport function deleteAppPermission(\n httpClient: HttpClient\n): DeleteAppPermissionSignature {\n return (appId: string, permissionId: string) =>\n universalDeleteAppPermission(\n appId,\n permissionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface DeleteAppPermissionSignature {\n /**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n *\n * > **Important**: Disregard the **Authentication** note below. You can only call this method by authenticating with an account-level [API key](https://dev.wix.com/docs/rest/articles/get-started/api-keys).\n * @param - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n */\n (appId: string, permissionId: string): Promise<void>;\n}\n\nexport {\n Action,\n ActionEvent,\n AppPermission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n ListAppPermissionsRequest,\n ListAppPermissionsResponse,\n MessageEnvelope,\n OldPermissionChangedEvent,\n Permission,\n RestoreInfo,\n V1Permission,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n","import {\n createAppPermission as publicCreateAppPermission,\n listAppPermissions as publicListAppPermissions,\n deleteAppPermission as publicDeleteAppPermission,\n} from './devcenter-apps-v1-app-permission-app-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const createAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicCreateAppPermission> &\n typeof publicCreateAppPermission\n> = /*#__PURE__*/ createRESTModule(publicCreateAppPermission);\nexport const listAppPermissions: MaybeContext<\n BuildRESTFunction<typeof publicListAppPermissions> &\n typeof publicListAppPermissions\n> = /*#__PURE__*/ createRESTModule(publicListAppPermissions);\nexport const deleteAppPermission: MaybeContext<\n BuildRESTFunction<typeof publicDeleteAppPermission> &\n typeof publicDeleteAppPermission\n> = /*#__PURE__*/ createRESTModule(publicDeleteAppPermission);\n\nexport {\n Action,\n WebhookIdentityType,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n AppPermission,\n V1Permission,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n GetAppPermissionRequest,\n GetAppPermissionResponse,\n ListAppPermissionsRequest,\n CursorPaging,\n ListAppPermissionsResponse,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n Empty,\n OldPermissionChangedEvent,\n Permission,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListAppPermissionsOptions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n ActionWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD;AAAA,EACE;AAAA,EACA;AAAA,OACK;;;ACJP,SAAS,yBAAyB;AAClC,SAAS,4CAA4C;AACrD,SAAS,4CAA4C;AACrD,SAAS,sBAAsB;AAC/B,SAAS,kBAAkB;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;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,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA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mB;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,OAAO,QAAQ,cAAc,OAAO;AAAA,QAChE,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,cAAc;AAAA,IAC1B;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;;;AE3gBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CACL,kBAMAA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAuBO,SAASC,oBACd,YAC6B;AAC7B,SAAO,CAAC,OAAe,YACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAsBO,SAASC,qBACd,YAC8B;AAC9B,SAAO,CAAC,OAAe,iBACrBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACvFA,SAAS,wBAAwB;AAG1B,IAAMC,uBAGK,iCAAiBA,oBAAyB;AACrD,IAAMC,sBAGK,iCAAiBA,mBAAwB;AACpD,IAAMC,uBAGK,iCAAiBA,oBAAyB;","names":["payload","Action","WebhookIdentityType","createAppPermission","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission","createAppPermission","listAppPermissions","deleteAppPermission"]}