@wix/auto_sdk_app-management_app-permissions 1.0.47 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +8 -4
- package/build/cjs/index.js +12 -12
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +47 -3
- package/build/cjs/index.typings.js +12 -12
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +41 -1
- package/build/cjs/meta.js +11 -12
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +8 -4
- package/build/es/index.mjs +12 -12
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +47 -3
- package/build/es/index.typings.mjs +12 -12
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +41 -1
- package/build/es/meta.mjs +11 -12
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +8 -4
- package/build/internal/cjs/index.typings.d.ts +47 -3
- package/build/internal/cjs/meta.d.ts +41 -1
- package/build/internal/es/index.d.mts +8 -4
- package/build/internal/es/index.typings.d.mts +47 -3
- package/build/internal/es/meta.d.mts +41 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
-
import { AppPermission, ListAppPermissionsOptions, ListAppPermissionsResponse } from './index.typings.js';
|
|
2
|
+
import { AppPermission, CreateAppPermissionApplicationErrors, ListAppPermissionsOptions, ListAppPermissionsResponse, DeleteAppPermissionApplicationErrors } from './index.typings.js';
|
|
3
3
|
export { AccountInfo, Action, ActionEvent, ActionWithLiterals, CloneAppPermissionsRequest, CloneAppPermissionsResponse, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DeletePermissionsByAppRequest, DeletePermissionsByAppResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, RestoreInfo, V1Permission, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
4
|
|
|
5
5
|
declare function createAppPermission$1(httpClient: HttpClient): CreateAppPermissionSignature;
|
|
@@ -13,7 +13,9 @@ interface CreateAppPermissionSignature {
|
|
|
13
13
|
* @param - Permission to add to the specified app.
|
|
14
14
|
* @returns Details of permission that was added to the app.
|
|
15
15
|
*/
|
|
16
|
-
(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 1>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1
|
|
16
|
+
(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 1>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1> & {
|
|
17
|
+
__applicationErrorsType?: CreateAppPermissionApplicationErrors;
|
|
18
|
+
}>;
|
|
17
19
|
}
|
|
18
20
|
declare function listAppPermissions$1(httpClient: HttpClient): ListAppPermissionsSignature;
|
|
19
21
|
interface ListAppPermissionsSignature {
|
|
@@ -42,11 +44,13 @@ interface DeleteAppPermissionSignature {
|
|
|
42
44
|
*
|
|
43
45
|
* 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).
|
|
44
46
|
*/
|
|
45
|
-
(appId: string, permissionId: string): Promise<void
|
|
47
|
+
(appId: string, permissionId: string): Promise<void & {
|
|
48
|
+
__applicationErrorsType?: DeleteAppPermissionApplicationErrors;
|
|
49
|
+
}>;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
declare const createAppPermission: MaybeContext<BuildRESTFunction<typeof createAppPermission$1> & typeof createAppPermission$1>;
|
|
49
53
|
declare const listAppPermissions: MaybeContext<BuildRESTFunction<typeof listAppPermissions$1> & typeof listAppPermissions$1>;
|
|
50
54
|
declare const deleteAppPermission: MaybeContext<BuildRESTFunction<typeof deleteAppPermission$1> & typeof deleteAppPermission$1>;
|
|
51
55
|
|
|
52
|
-
export { AppPermission, ListAppPermissionsOptions, ListAppPermissionsResponse, createAppPermission, deleteAppPermission, listAppPermissions };
|
|
56
|
+
export { AppPermission, CreateAppPermissionApplicationErrors, DeleteAppPermissionApplicationErrors, ListAppPermissionsOptions, ListAppPermissionsResponse, createAppPermission, deleteAppPermission, listAppPermissions };
|
package/build/cjs/index.js
CHANGED
|
@@ -38,6 +38,14 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
38
38
|
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
39
39
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
40
40
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
41
|
+
var TRANSFORM_PATHS_0 = [
|
|
42
|
+
{ path: "appPermission.createdDate" },
|
|
43
|
+
{ path: "appPermission.updatedDate" }
|
|
44
|
+
];
|
|
45
|
+
var TRANSFORM_PATHS_1 = [
|
|
46
|
+
{ path: "appPermissions.createdDate" },
|
|
47
|
+
{ path: "appPermissions.updatedDate" }
|
|
48
|
+
];
|
|
41
49
|
function resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(opts) {
|
|
42
50
|
const domainToMappings = {
|
|
43
51
|
"dev._base_domain_": [
|
|
@@ -103,10 +111,7 @@ function createAppPermission(payload) {
|
|
|
103
111
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
104
112
|
{
|
|
105
113
|
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
106
|
-
paths:
|
|
107
|
-
{ path: "appPermission.createdDate" },
|
|
108
|
-
{ path: "appPermission.updatedDate" }
|
|
109
|
-
]
|
|
114
|
+
paths: TRANSFORM_PATHS_0
|
|
110
115
|
}
|
|
111
116
|
]);
|
|
112
117
|
const metadata = {
|
|
@@ -126,10 +131,7 @@ function createAppPermission(payload) {
|
|
|
126
131
|
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
127
132
|
{
|
|
128
133
|
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
129
|
-
paths:
|
|
130
|
-
{ path: "appPermission.createdDate" },
|
|
131
|
-
{ path: "appPermission.updatedDate" }
|
|
132
|
-
]
|
|
134
|
+
paths: TRANSFORM_PATHS_0
|
|
133
135
|
}
|
|
134
136
|
])
|
|
135
137
|
};
|
|
@@ -156,10 +158,7 @@ function listAppPermissions(payload) {
|
|
|
156
158
|
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
157
159
|
{
|
|
158
160
|
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
159
|
-
paths:
|
|
160
|
-
{ path: "appPermissions.createdDate" },
|
|
161
|
-
{ path: "appPermissions.updatedDate" }
|
|
162
|
-
]
|
|
161
|
+
paths: TRANSFORM_PATHS_1
|
|
163
162
|
}
|
|
164
163
|
])
|
|
165
164
|
};
|
|
@@ -271,6 +270,7 @@ async function deleteAppPermission2(appId, permissionId) {
|
|
|
271
270
|
try {
|
|
272
271
|
const result = await httpClient.request(reqOpts);
|
|
273
272
|
sideEffects?.onSuccess?.(result);
|
|
273
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
274
274
|
} catch (err) {
|
|
275
275
|
const transformedError = (0, import_transform_error.transformError)(
|
|
276
276
|
err,
|
package/build/cjs/index.js.map
CHANGED
|
@@ -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 * Total number of items matching the filter.\n * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n * @internal\n */\n total?: number | 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 CloneAppPermissionsRequest {\n /**\n * Source app ID to clone permissions from.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * Target app ID to clone permissions to.\n * @format GUID\n */\n targetAppId?: string;\n}\n\nexport interface CloneAppPermissionsResponse {}\n\nexport interface DeletePermissionsByAppRequest {\n /**\n * App ID to delete all permissions for.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface DeletePermissionsByAppResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\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 1\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1>\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 3\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 'bo._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\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 1\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 1\n >\n ): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1>\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 3\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 AccountInfo,\n Action,\n ActionEvent,\n AppPermission,\n CloneAppPermissionsRequest,\n CloneAppPermissionsResponse,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DeletePermissionsByAppRequest,\n DeletePermissionsByAppResponse,\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 CloneAppPermissionsRequest,\n CloneAppPermissionsResponse,\n DeletePermissionsByAppRequest,\n DeletePermissionsByAppResponse,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\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,U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wB;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 * Total number of items matching the filter.\n * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n * @internal\n */\n total?: number | 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 CloneAppPermissionsRequest {\n /**\n * Source app ID to clone permissions from.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * Target app ID to clone permissions to.\n * @format GUID\n */\n targetAppId?: string;\n}\n\nexport interface CloneAppPermissionsResponse {}\n\nexport interface DeletePermissionsByAppRequest {\n /**\n * App ID to delete all permissions for.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface DeletePermissionsByAppResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateAppPermissionApplicationErrors =\n | {\n code?: 'PERMISSION_OR_SCOPE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_RESTRICTED_TO_WIX_APPS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'HOST_APP_PERMISSION_REVIEW_REQUIRED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_NOT_PERMITTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_APPROVAL_REQUESTED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeleteAppPermissionApplicationErrors =\n | {\n code?: 'APP_PERMISSION_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_WEBHOOK';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_SPI_COMPONENT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_SPI_OVERRIDE';\n description?: string;\n data?: Record<string, any>;\n };\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 1\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1> & {\n __applicationErrorsType?: CreateAppPermissionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 3\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<\n void & {\n __applicationErrorsType?: DeleteAppPermissionApplicationErrors;\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 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\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\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\nconst TRANSFORM_PATHS_0 = [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n];\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 'bo._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\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: TRANSFORM_PATHS_0,\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: TRANSFORM_PATHS_0,\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: TRANSFORM_PATHS_1,\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 CreateAppPermissionApplicationErrors,\n DeleteAppPermissionApplicationErrors,\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 1\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 1\n >\n ): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1> & {\n __applicationErrorsType?: CreateAppPermissionApplicationErrors;\n }\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 3\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<\n void & {\n __applicationErrorsType?: DeleteAppPermissionApplicationErrors;\n }\n >;\n}\n\nexport {\n AccountInfo,\n Action,\n ActionEvent,\n AppPermission,\n CloneAppPermissionsRequest,\n CloneAppPermissionsResponse,\n CreateAppPermissionRequest,\n CreateAppPermissionResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteAppPermissionRequest,\n DeleteAppPermissionResponse,\n DeletePermissionsByAppRequest,\n DeletePermissionsByAppResponse,\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 CloneAppPermissionsRequest,\n CloneAppPermissionsResponse,\n DeletePermissionsByAppRequest,\n DeletePermissionsByAppResponse,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ListAppPermissionsOptions,\n} from './devcenter-apps-v1-app-permission-app-permissions.universal.js';\nexport {\n ActionWithLiterals,\n WebhookIdentityTypeWithLiterals,\n CreateAppPermissionApplicationErrors,\n DeleteAppPermissionApplicationErrors,\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,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,4BAA4B;AAAA,EACpC,EAAE,MAAM,4BAA4B;AACtC;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,6BAA6B;AAAA,EACrC,EAAE,MAAM,6BAA6B;AACvC;AAEA,SAAS,6DACP,MACA;AACA,QAAM,m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DAAiBA,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"]}
|
|
@@ -340,6 +340,46 @@ interface AccountInfo {
|
|
|
340
340
|
*/
|
|
341
341
|
siteId?: string | null;
|
|
342
342
|
}
|
|
343
|
+
/** @docsIgnore */
|
|
344
|
+
type CreateAppPermissionApplicationErrors = {
|
|
345
|
+
code?: 'PERMISSION_OR_SCOPE_NOT_FOUND';
|
|
346
|
+
description?: string;
|
|
347
|
+
data?: Record<string, any>;
|
|
348
|
+
} | {
|
|
349
|
+
code?: 'PERMISSION_RESTRICTED_TO_WIX_APPS';
|
|
350
|
+
description?: string;
|
|
351
|
+
data?: Record<string, any>;
|
|
352
|
+
} | {
|
|
353
|
+
code?: 'HOST_APP_PERMISSION_REVIEW_REQUIRED';
|
|
354
|
+
description?: string;
|
|
355
|
+
data?: Record<string, any>;
|
|
356
|
+
} | {
|
|
357
|
+
code?: 'APP_PERMISSION_NOT_PERMITTED';
|
|
358
|
+
description?: string;
|
|
359
|
+
data?: Record<string, any>;
|
|
360
|
+
} | {
|
|
361
|
+
code?: 'APP_PERMISSION_APPROVAL_REQUESTED';
|
|
362
|
+
description?: string;
|
|
363
|
+
data?: Record<string, any>;
|
|
364
|
+
};
|
|
365
|
+
/** @docsIgnore */
|
|
366
|
+
type DeleteAppPermissionApplicationErrors = {
|
|
367
|
+
code?: 'APP_PERMISSION_NOT_FOUND';
|
|
368
|
+
description?: string;
|
|
369
|
+
data?: Record<string, any>;
|
|
370
|
+
} | {
|
|
371
|
+
code?: 'APP_PERMISSION_REQUIRED_BY_WEBHOOK';
|
|
372
|
+
description?: string;
|
|
373
|
+
data?: Record<string, any>;
|
|
374
|
+
} | {
|
|
375
|
+
code?: 'APP_PERMISSION_REQUIRED_BY_SPI_COMPONENT';
|
|
376
|
+
description?: string;
|
|
377
|
+
data?: Record<string, any>;
|
|
378
|
+
} | {
|
|
379
|
+
code?: 'APP_PERMISSION_REQUIRED_BY_SPI_OVERRIDE';
|
|
380
|
+
description?: string;
|
|
381
|
+
data?: Record<string, any>;
|
|
382
|
+
};
|
|
343
383
|
/**
|
|
344
384
|
* Adds a permission to the specified app.
|
|
345
385
|
*
|
|
@@ -357,7 +397,9 @@ interface AccountInfo {
|
|
|
357
397
|
* @returns Details of permission that was added to the app.
|
|
358
398
|
* @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission
|
|
359
399
|
*/
|
|
360
|
-
declare function createAppPermission(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 1>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1
|
|
400
|
+
declare function createAppPermission(appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`, 1>): Promise<NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1> & {
|
|
401
|
+
__applicationErrorsType?: CreateAppPermissionApplicationErrors;
|
|
402
|
+
}>;
|
|
361
403
|
/**
|
|
362
404
|
* Lists all permissions for the specified app.
|
|
363
405
|
*
|
|
@@ -400,6 +442,8 @@ interface ListAppPermissionsOptions {
|
|
|
400
442
|
* @applicableIdentity APP
|
|
401
443
|
* @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission
|
|
402
444
|
*/
|
|
403
|
-
declare function deleteAppPermission(appId: string, permissionId: string): Promise<void
|
|
445
|
+
declare function deleteAppPermission(appId: string, permissionId: string): Promise<void & {
|
|
446
|
+
__applicationErrorsType?: DeleteAppPermissionApplicationErrors;
|
|
447
|
+
}>;
|
|
404
448
|
|
|
405
|
-
export { type AccountInfo, Action, type ActionEvent, type ActionWithLiterals, type AppPermission, type CloneAppPermissionsRequest, type CloneAppPermissionsResponse, type CreateAppPermissionRequest, type CreateAppPermissionResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteAppPermissionRequest, type DeleteAppPermissionResponse, type DeletePermissionsByAppRequest, type DeletePermissionsByAppResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetAppPermissionRequest, type GetAppPermissionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListAppPermissionsOptions, type ListAppPermissionsRequest, type ListAppPermissionsResponse, type MessageEnvelope, type OldPermissionChangedEvent, type Permission, type RestoreInfo, type V1Permission, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createAppPermission, deleteAppPermission, listAppPermissions };
|
|
449
|
+
export { type AccountInfo, Action, type ActionEvent, type ActionWithLiterals, type AppPermission, type CloneAppPermissionsRequest, type CloneAppPermissionsResponse, type CreateAppPermissionApplicationErrors, type CreateAppPermissionRequest, type CreateAppPermissionResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteAppPermissionApplicationErrors, type DeleteAppPermissionRequest, type DeleteAppPermissionResponse, type DeletePermissionsByAppRequest, type DeletePermissionsByAppResponse, type DomainEvent, type DomainEventBodyOneOf, type Empty, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetAppPermissionRequest, type GetAppPermissionResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListAppPermissionsOptions, type ListAppPermissionsRequest, type ListAppPermissionsResponse, type MessageEnvelope, type OldPermissionChangedEvent, type Permission, type RestoreInfo, type V1Permission, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, createAppPermission, deleteAppPermission, listAppPermissions };
|
|
@@ -38,6 +38,14 @@ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
|
38
38
|
var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
|
|
39
39
|
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
40
40
|
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
41
|
+
var TRANSFORM_PATHS_0 = [
|
|
42
|
+
{ path: "appPermission.createdDate" },
|
|
43
|
+
{ path: "appPermission.updatedDate" }
|
|
44
|
+
];
|
|
45
|
+
var TRANSFORM_PATHS_1 = [
|
|
46
|
+
{ path: "appPermissions.createdDate" },
|
|
47
|
+
{ path: "appPermissions.updatedDate" }
|
|
48
|
+
];
|
|
41
49
|
function resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(opts) {
|
|
42
50
|
const domainToMappings = {
|
|
43
51
|
"dev._base_domain_": [
|
|
@@ -103,10 +111,7 @@ function createAppPermission(payload) {
|
|
|
103
111
|
const serializedData = (0, import_transform_paths.transformPaths)(payload, [
|
|
104
112
|
{
|
|
105
113
|
transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
|
|
106
|
-
paths:
|
|
107
|
-
{ path: "appPermission.createdDate" },
|
|
108
|
-
{ path: "appPermission.updatedDate" }
|
|
109
|
-
]
|
|
114
|
+
paths: TRANSFORM_PATHS_0
|
|
110
115
|
}
|
|
111
116
|
]);
|
|
112
117
|
const metadata = {
|
|
@@ -126,10 +131,7 @@ function createAppPermission(payload) {
|
|
|
126
131
|
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
127
132
|
{
|
|
128
133
|
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
129
|
-
paths:
|
|
130
|
-
{ path: "appPermission.createdDate" },
|
|
131
|
-
{ path: "appPermission.updatedDate" }
|
|
132
|
-
]
|
|
134
|
+
paths: TRANSFORM_PATHS_0
|
|
133
135
|
}
|
|
134
136
|
])
|
|
135
137
|
};
|
|
@@ -156,10 +158,7 @@ function listAppPermissions(payload) {
|
|
|
156
158
|
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
157
159
|
{
|
|
158
160
|
transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
|
|
159
|
-
paths:
|
|
160
|
-
{ path: "appPermissions.createdDate" },
|
|
161
|
-
{ path: "appPermissions.updatedDate" }
|
|
162
|
-
]
|
|
161
|
+
paths: TRANSFORM_PATHS_1
|
|
163
162
|
}
|
|
164
163
|
])
|
|
165
164
|
};
|
|
@@ -271,6 +270,7 @@ async function deleteAppPermission2(appId, permissionId) {
|
|
|
271
270
|
try {
|
|
272
271
|
const result = await httpClient.request(reqOpts);
|
|
273
272
|
sideEffects?.onSuccess?.(result);
|
|
273
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
274
274
|
} catch (err) {
|
|
275
275
|
const transformedError = (0, import_transform_error.transformError)(
|
|
276
276
|
err,
|
|
@@ -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 * Total number of items matching the filter.\n * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n * @internal\n */\n total?: number | 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 CloneAppPermissionsRequest {\n /**\n * Source app ID to clone permissions from.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * Target app ID to clone permissions to.\n * @format GUID\n */\n targetAppId?: string;\n}\n\nexport interface CloneAppPermissionsResponse {}\n\nexport interface DeletePermissionsByAppRequest {\n /**\n * App ID to delete all permissions for.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface DeletePermissionsByAppResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\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 1\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1>\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 3\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 'bo._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\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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AAM,UACsC,mBAAmB,OAAO;AAEtE,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAD;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B;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;AAgCA,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 * Total number of items matching the filter.\n * Available only on the first page of *Search* results, not included in *Query* or *List* results.\n * If the Search results span multiple pages, the value of `total` will exceed the number of items returned on the first page.\n * @internal\n */\n total?: number | 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 CloneAppPermissionsRequest {\n /**\n * Source app ID to clone permissions from.\n * @format GUID\n */\n sourceAppId?: string;\n /**\n * Target app ID to clone permissions to.\n * @format GUID\n */\n targetAppId?: string;\n}\n\nexport interface CloneAppPermissionsResponse {}\n\nexport interface DeletePermissionsByAppRequest {\n /**\n * App ID to delete all permissions for.\n * @format GUID\n */\n appId?: string;\n}\n\nexport interface DeletePermissionsByAppResponse {}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/** @docsIgnore */\nexport type CreateAppPermissionApplicationErrors =\n | {\n code?: 'PERMISSION_OR_SCOPE_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'PERMISSION_RESTRICTED_TO_WIX_APPS';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'HOST_APP_PERMISSION_REVIEW_REQUIRED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_NOT_PERMITTED';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_APPROVAL_REQUESTED';\n description?: string;\n data?: Record<string, any>;\n };\n/** @docsIgnore */\nexport type DeleteAppPermissionApplicationErrors =\n | {\n code?: 'APP_PERMISSION_NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_WEBHOOK';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_SPI_COMPONENT';\n description?: string;\n data?: Record<string, any>;\n }\n | {\n code?: 'APP_PERMISSION_REQUIRED_BY_SPI_OVERRIDE';\n description?: string;\n data?: Record<string, any>;\n };\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 1\n >\n): Promise<\n NonNullablePaths<AppPermission, `appId` | `permission.permissionId`, 1> & {\n __applicationErrorsType?: CreateAppPermissionApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n 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 3\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<\n void & {\n __applicationErrorsType?: DeleteAppPermissionApplicationErrors;\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 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\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\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\nconst TRANSFORM_PATHS_0 = [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n];\nconst TRANSFORM_PATHS_1 = [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n];\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 'bo._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\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: TRANSFORM_PATHS_0,\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: TRANSFORM_PATHS_0,\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: TRANSFORM_PATHS_1,\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,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,4BAA4B;AAAA,EACpC,EAAE,MAAM,4BAA4B;AACtC;AACA,IAAM,oBAAoB;AAAA,EACxB,EAAE,MAAM,6BAA6B;AAAA,EACrC,EAAE,MAAM,6BAA6B;AACvC;AAEA,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,IACA,oBAAoB;AAAA,MAClB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,YAAY;AAAA,MACV;AAAA,QACE,SAAS;AAAA,Q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,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"]}
|