@wix/auto_sdk_app-management_app-permissions 1.0.29 → 1.0.31

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.
@@ -96,6 +96,9 @@ function createAppPermission(payload) {
96
96
  method: "POST",
97
97
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission",
98
98
  packageName: PACKAGE_NAME,
99
+ migrationOptions: {
100
+ optInTransformResponse: true
101
+ },
99
102
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
100
103
  protoPath: "/v1/app-permissions",
101
104
  data: serializedData,
@@ -123,6 +126,9 @@ function listAppPermissions(payload) {
123
126
  method: "GET",
124
127
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions",
125
128
  packageName: PACKAGE_NAME,
129
+ migrationOptions: {
130
+ optInTransformResponse: true
131
+ },
126
132
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
127
133
  protoPath: "/v1/app-permissions",
128
134
  data: payload,
@@ -150,6 +156,9 @@ function deleteAppPermission(payload) {
150
156
  method: "DELETE",
151
157
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission",
152
158
  packageName: PACKAGE_NAME,
159
+ migrationOptions: {
160
+ optInTransformResponse: true
161
+ },
153
162
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
154
163
  protoPath: "/v1/app-permissions",
155
164
  data: payload,
@@ -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\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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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,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"]}
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 * @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 * @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 * @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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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;A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AAa;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;;;AExgBO,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"]}
@@ -306,7 +306,6 @@ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYM
306
306
  * > **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).
307
307
  * @param appPermission - Permission to add to the specified app.
308
308
  * @public
309
- * @documentationMaturity preview
310
309
  * @requiredField appPermission
311
310
  * @requiredField appPermission.appId
312
311
  * @requiredField appPermission.permission
@@ -325,7 +324,6 @@ declare function createAppPermission(appPermission: NonNullablePaths<AppPermissi
325
324
  *
326
325
  * 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.
327
326
  * @public
328
- * @documentationMaturity preview
329
327
  * @requiredField appId
330
328
  * @permissionId DEV_CENTER.READ_APP_PERMISSIONS
331
329
  * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions
@@ -354,7 +352,6 @@ interface ListAppPermissionsOptions {
354
352
  *
355
353
  * 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).
356
354
  * @public
357
- * @documentationMaturity preview
358
355
  * @requiredField appId
359
356
  * @requiredField permissionId
360
357
  * @permissionId DEV_CENTER.DELETE_APP_PERMISSION
@@ -96,6 +96,9 @@ function createAppPermission(payload) {
96
96
  method: "POST",
97
97
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission",
98
98
  packageName: PACKAGE_NAME,
99
+ migrationOptions: {
100
+ optInTransformResponse: true
101
+ },
99
102
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
100
103
  protoPath: "/v1/app-permissions",
101
104
  data: serializedData,
@@ -123,6 +126,9 @@ function listAppPermissions(payload) {
123
126
  method: "GET",
124
127
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions",
125
128
  packageName: PACKAGE_NAME,
129
+ migrationOptions: {
130
+ optInTransformResponse: true
131
+ },
126
132
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
127
133
  protoPath: "/v1/app-permissions",
128
134
  data: payload,
@@ -150,6 +156,9 @@ function deleteAppPermission(payload) {
150
156
  method: "DELETE",
151
157
  methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission",
152
158
  packageName: PACKAGE_NAME,
159
+ migrationOptions: {
160
+ optInTransformResponse: true
161
+ },
153
162
  url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
154
163
  protoPath: "/v1/app-permissions",
155
164
  data: payload,
@@ -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\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,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,CAAC;AAC7D;AAEA,IAAM,eAAe;AASd,SAAS,oBACd,SAC4B;AAC5B,WAAS,sBAAsB,EAAE,KAAK,GAAQ;AAC5C,UAAM,qBAAiB,uCAAe,SAAS;AAAA,MAC7C;AAAA,QACE,aAAa;AAAA,QACb,OAAO;AAAA,UACL,EAAE,MAAM,4BAA4B;AAAA,UACpC,EAAE,MAAM,4BAA4B;AAAA,QACtC;AAAA,MACF;AAAA,IACF,CAAC;AACD,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AC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;AAAA,UACxB,OAAO;AAAA,UACP,YAAY;AAAA,UACZ,QAAQ;AAAA,QACV;AAAA,QACA,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,SAAS,SAAS;AAAA,IACrB;AACA,iBAAa,UAAU,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
+ {"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 * @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 * @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 * @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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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 migrationOptions: {\n optInTransformResponse: true,\n },\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;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AAE,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"]}
@@ -44,6 +44,27 @@ interface CreateAppPermissionResponse {
44
44
  /** Details of permission that was added to the app. */
45
45
  appPermission?: AppPermission;
46
46
  }
47
+ interface GetAppPermissionRequest {
48
+ /**
49
+ * App ID.
50
+ *
51
+ * 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.
52
+ * @format GUID
53
+ */
54
+ appId?: string;
55
+ /**
56
+ * Permission ID.
57
+ *
58
+ * 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).
59
+ * @minLength 1
60
+ * @maxLength 164
61
+ */
62
+ permissionId?: string;
63
+ }
64
+ interface GetAppPermissionResponse {
65
+ /** Details of the retrieved app permission. */
66
+ appPermission?: AppPermission;
67
+ }
47
68
  interface ListAppPermissionsRequest {
48
69
  /**
49
70
  * App ID.
@@ -126,6 +147,160 @@ interface DeleteAppPermissionRequest {
126
147
  }
127
148
  interface DeleteAppPermissionResponse {
128
149
  }
150
+ interface DomainEvent extends DomainEventBodyOneOf {
151
+ createdEvent?: EntityCreatedEvent;
152
+ updatedEvent?: EntityUpdatedEvent;
153
+ deletedEvent?: EntityDeletedEvent;
154
+ actionEvent?: ActionEvent;
155
+ /** Event ID. With this ID you can easily spot duplicated events and ignore them. */
156
+ id?: string;
157
+ /**
158
+ * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.
159
+ * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.
160
+ */
161
+ entityFqdn?: string;
162
+ /**
163
+ * Event action name, placed at the top level to make it easier for users to dispatch messages.
164
+ * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.
165
+ */
166
+ slug?: string;
167
+ /** ID of the entity associated with the event. */
168
+ entityId?: string;
169
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */
170
+ eventTime?: Date | null;
171
+ /**
172
+ * Whether the event was triggered as a result of a privacy regulation application
173
+ * (for example, GDPR).
174
+ */
175
+ triggeredByAnonymizeRequest?: boolean | null;
176
+ /** If present, indicates the action that triggered the event. */
177
+ originatedFrom?: string | null;
178
+ /**
179
+ * 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.
180
+ * 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.
181
+ */
182
+ entityEventSequence?: string | null;
183
+ }
184
+ /** @oneof */
185
+ interface DomainEventBodyOneOf {
186
+ createdEvent?: EntityCreatedEvent;
187
+ updatedEvent?: EntityUpdatedEvent;
188
+ deletedEvent?: EntityDeletedEvent;
189
+ actionEvent?: ActionEvent;
190
+ }
191
+ interface EntityCreatedEvent {
192
+ entityAsJson?: string;
193
+ /** Indicates the event was triggered by a restore-from-trashbin operation for a previously deleted entity */
194
+ restoreInfo?: RestoreInfo;
195
+ }
196
+ interface RestoreInfo {
197
+ deletedDate?: Date | null;
198
+ }
199
+ interface EntityUpdatedEvent {
200
+ /**
201
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
202
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
203
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
204
+ */
205
+ currentEntityAsJson?: string;
206
+ }
207
+ interface EntityDeletedEvent {
208
+ /** Entity that was deleted. */
209
+ deletedEntityAsJson?: string | null;
210
+ }
211
+ interface ActionEvent {
212
+ bodyAsJson?: string;
213
+ }
214
+ interface Empty {
215
+ }
216
+ interface OldPermissionChangedEvent {
217
+ /** @format GUID */
218
+ appId?: string;
219
+ permission?: Permission;
220
+ action?: ActionWithLiterals;
221
+ }
222
+ interface Permission {
223
+ permissionId?: string;
224
+ }
225
+ declare enum Action {
226
+ CREATED = "CREATED",
227
+ UPDATED = "UPDATED",
228
+ DELETED = "DELETED"
229
+ }
230
+ /** @enumType */
231
+ type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';
232
+ interface MessageEnvelope {
233
+ /**
234
+ * App instance ID.
235
+ * @format GUID
236
+ */
237
+ instanceId?: string | null;
238
+ /**
239
+ * Event type.
240
+ * @maxLength 150
241
+ */
242
+ eventType?: string;
243
+ /** The identification type and identity data. */
244
+ identity?: IdentificationData;
245
+ /** Stringify payload. */
246
+ data?: string;
247
+ }
248
+ interface IdentificationData extends IdentificationDataIdOneOf {
249
+ /**
250
+ * ID of a site visitor that has not logged in to the site.
251
+ * @format GUID
252
+ */
253
+ anonymousVisitorId?: string;
254
+ /**
255
+ * ID of a site visitor that has logged in to the site.
256
+ * @format GUID
257
+ */
258
+ memberId?: string;
259
+ /**
260
+ * ID of a Wix user (site owner, contributor, etc.).
261
+ * @format GUID
262
+ */
263
+ wixUserId?: string;
264
+ /**
265
+ * ID of an app.
266
+ * @format GUID
267
+ */
268
+ appId?: string;
269
+ /** @readonly */
270
+ identityType?: WebhookIdentityTypeWithLiterals;
271
+ }
272
+ /** @oneof */
273
+ interface IdentificationDataIdOneOf {
274
+ /**
275
+ * ID of a site visitor that has not logged in to the site.
276
+ * @format GUID
277
+ */
278
+ anonymousVisitorId?: string;
279
+ /**
280
+ * ID of a site visitor that has logged in to the site.
281
+ * @format GUID
282
+ */
283
+ memberId?: string;
284
+ /**
285
+ * ID of a Wix user (site owner, contributor, etc.).
286
+ * @format GUID
287
+ */
288
+ wixUserId?: string;
289
+ /**
290
+ * ID of an app.
291
+ * @format GUID
292
+ */
293
+ appId?: string;
294
+ }
295
+ declare enum WebhookIdentityType {
296
+ UNKNOWN = "UNKNOWN",
297
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
298
+ MEMBER = "MEMBER",
299
+ WIX_USER = "WIX_USER",
300
+ APP = "APP"
301
+ }
302
+ /** @enumType */
303
+ type WebhookIdentityTypeWithLiterals = WebhookIdentityType | 'UNKNOWN' | 'ANONYMOUS_VISITOR' | 'MEMBER' | 'WIX_USER' | 'APP';
129
304
 
130
305
  type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
131
306
  getUrl: (context: any) => string;
@@ -141,4 +316,4 @@ declare function createAppPermission(): __PublicMethodMetaInfo<'POST', {}, Creat
141
316
  declare function listAppPermissions(): __PublicMethodMetaInfo<'GET', {}, ListAppPermissionsRequest$1, ListAppPermissionsRequest, ListAppPermissionsResponse$1, ListAppPermissionsResponse>;
142
317
  declare function deleteAppPermission(): __PublicMethodMetaInfo<'DELETE', {}, DeleteAppPermissionRequest$1, DeleteAppPermissionRequest, DeleteAppPermissionResponse$1, DeleteAppPermissionResponse>;
143
318
 
144
- export { type __PublicMethodMetaInfo, createAppPermission, deleteAppPermission, listAppPermissions };
319
+ export { type ActionEvent as ActionEventOriginal, Action as ActionOriginal, type ActionWithLiterals as ActionWithLiteralsOriginal, type AppPermission as AppPermissionOriginal, type CreateAppPermissionRequest as CreateAppPermissionRequestOriginal, type CreateAppPermissionResponse as CreateAppPermissionResponseOriginal, type CursorPagingMetadata as CursorPagingMetadataOriginal, type CursorPaging as CursorPagingOriginal, type Cursors as CursorsOriginal, type DeleteAppPermissionRequest as DeleteAppPermissionRequestOriginal, type DeleteAppPermissionResponse as DeleteAppPermissionResponseOriginal, type DomainEventBodyOneOf as DomainEventBodyOneOfOriginal, type DomainEvent as DomainEventOriginal, type Empty as EmptyOriginal, type EntityCreatedEvent as EntityCreatedEventOriginal, type EntityDeletedEvent as EntityDeletedEventOriginal, type EntityUpdatedEvent as EntityUpdatedEventOriginal, type GetAppPermissionRequest as GetAppPermissionRequestOriginal, type GetAppPermissionResponse as GetAppPermissionResponseOriginal, type IdentificationDataIdOneOf as IdentificationDataIdOneOfOriginal, type IdentificationData as IdentificationDataOriginal, type ListAppPermissionsRequest as ListAppPermissionsRequestOriginal, type ListAppPermissionsResponse as ListAppPermissionsResponseOriginal, type MessageEnvelope as MessageEnvelopeOriginal, type OldPermissionChangedEvent as OldPermissionChangedEventOriginal, type Permission as PermissionOriginal, type RestoreInfo as RestoreInfoOriginal, type V1Permission as V1PermissionOriginal, WebhookIdentityType as WebhookIdentityTypeOriginal, type WebhookIdentityTypeWithLiterals as WebhookIdentityTypeWithLiteralsOriginal, type __PublicMethodMetaInfo, createAppPermission, deleteAppPermission, listAppPermissions };