@wix/auto_sdk_app-management_app-permissions 1.0.19 → 1.0.21

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.
Files changed (29) hide show
  1. package/build/cjs/index.d.ts +9 -11
  2. package/build/cjs/index.js +2 -21
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/{devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.d.ts → index.typings.d.ts} +65 -4
  5. package/build/cjs/index.typings.js +275 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +2 -1
  8. package/build/es/index.d.mts +9 -11
  9. package/build/es/index.mjs +1 -19
  10. package/build/es/index.mjs.map +1 -1
  11. package/build/es/{devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.d.mts → index.typings.d.mts} +65 -4
  12. package/build/es/index.typings.mjs +246 -0
  13. package/build/es/index.typings.mjs.map +1 -0
  14. package/build/es/meta.d.mts +2 -1
  15. package/build/internal/cjs/index.d.ts +9 -11
  16. package/build/internal/cjs/index.js +2 -21
  17. package/build/internal/cjs/index.js.map +1 -1
  18. package/build/internal/cjs/{devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.d.ts → index.typings.d.ts} +65 -4
  19. package/build/internal/cjs/index.typings.js +275 -0
  20. package/build/internal/cjs/index.typings.js.map +1 -0
  21. package/build/internal/cjs/meta.d.ts +2 -1
  22. package/build/internal/es/index.d.mts +9 -11
  23. package/build/internal/es/index.mjs +1 -19
  24. package/build/internal/es/index.mjs.map +1 -1
  25. package/build/internal/es/{devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.d.mts → index.typings.d.mts} +65 -4
  26. package/build/internal/es/index.typings.mjs +246 -0
  27. package/build/internal/es/index.typings.mjs.map +1 -0
  28. package/build/internal/es/meta.d.mts +2 -1
  29. package/package.json +3 -3
@@ -0,0 +1,275 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // index.typings.ts
21
+ var index_typings_exports = {};
22
+ __export(index_typings_exports, {
23
+ Action: () => Action,
24
+ ActionType: () => ActionType,
25
+ WebhookIdentityType: () => WebhookIdentityType,
26
+ createAppPermission: () => createAppPermission2,
27
+ deleteAppPermission: () => deleteAppPermission2,
28
+ listAppPermissions: () => listAppPermissions2
29
+ });
30
+ module.exports = __toCommonJS(index_typings_exports);
31
+
32
+ // src/devcenter-apps-v1-app-permission-app-permissions.universal.ts
33
+ var import_transform_error = require("@wix/sdk-runtime/transform-error");
34
+ var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
35
+
36
+ // src/devcenter-apps-v1-app-permission-app-permissions.http.ts
37
+ var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
38
+ var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
39
+ var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
40
+ var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
41
+ var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
42
+ function resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(opts) {
43
+ const domainToMappings = {
44
+ "dev._base_domain_": [
45
+ {
46
+ srcPath: "/app-permissions-service",
47
+ destPath: ""
48
+ }
49
+ ],
50
+ "manage._base_domain_": [
51
+ {
52
+ srcPath: "/_api/app-permissions-service",
53
+ destPath: ""
54
+ }
55
+ ],
56
+ "www._base_domain_": [
57
+ {
58
+ srcPath: "/_api/app-permissions-service",
59
+ destPath: ""
60
+ }
61
+ ],
62
+ "www.wixapis.com": [
63
+ {
64
+ srcPath: "/apps/v1/app-permissions",
65
+ destPath: ""
66
+ }
67
+ ],
68
+ "*.dev.wix-code.com": [
69
+ {
70
+ srcPath: "/_api/app-permissions-service",
71
+ destPath: ""
72
+ }
73
+ ],
74
+ _: [
75
+ {
76
+ srcPath: "/_api/app-permissions-service",
77
+ destPath: ""
78
+ }
79
+ ]
80
+ };
81
+ return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
82
+ }
83
+ var PACKAGE_NAME = "@wix/auto_sdk_app-management_app-permissions";
84
+ function createAppPermission(payload) {
85
+ function __createAppPermission({ host }) {
86
+ const serializedData = (0, import_transform_paths.transformPaths)(payload, [
87
+ {
88
+ transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
89
+ paths: [
90
+ { path: "appPermission.createdDate" },
91
+ { path: "appPermission.updatedDate" }
92
+ ]
93
+ }
94
+ ]);
95
+ const metadata = {
96
+ entityFqdn: "wix.devcenter.apps.v1.app_permission",
97
+ method: "POST",
98
+ methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission",
99
+ packageName: PACKAGE_NAME,
100
+ url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
101
+ protoPath: "/v1/app-permissions",
102
+ data: serializedData,
103
+ host
104
+ }),
105
+ data: serializedData,
106
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
107
+ {
108
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
109
+ paths: [
110
+ { path: "appPermission.createdDate" },
111
+ { path: "appPermission.updatedDate" }
112
+ ]
113
+ }
114
+ ])
115
+ };
116
+ return metadata;
117
+ }
118
+ return __createAppPermission;
119
+ }
120
+ function listAppPermissions(payload) {
121
+ function __listAppPermissions({ host }) {
122
+ const metadata = {
123
+ entityFqdn: "wix.devcenter.apps.v1.app_permission",
124
+ method: "GET",
125
+ methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions",
126
+ packageName: PACKAGE_NAME,
127
+ url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
128
+ protoPath: "/v1/app-permissions",
129
+ data: payload,
130
+ host
131
+ }),
132
+ params: (0, import_rest_modules.toURLSearchParams)(payload),
133
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
134
+ {
135
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
136
+ paths: [
137
+ { path: "appPermissions.createdDate" },
138
+ { path: "appPermissions.updatedDate" }
139
+ ]
140
+ }
141
+ ])
142
+ };
143
+ return metadata;
144
+ }
145
+ return __listAppPermissions;
146
+ }
147
+ function deleteAppPermission(payload) {
148
+ function __deleteAppPermission({ host }) {
149
+ const metadata = {
150
+ entityFqdn: "wix.devcenter.apps.v1.app_permission",
151
+ method: "DELETE",
152
+ methodFqn: "wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission",
153
+ packageName: PACKAGE_NAME,
154
+ url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({
155
+ protoPath: "/v1/app-permissions",
156
+ data: payload,
157
+ host
158
+ }),
159
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
160
+ };
161
+ return metadata;
162
+ }
163
+ return __deleteAppPermission;
164
+ }
165
+
166
+ // src/devcenter-apps-v1-app-permission-app-permissions.universal.ts
167
+ var ActionType = /* @__PURE__ */ ((ActionType2) => {
168
+ ActionType2["APP_PERMISSION_DELETED"] = "APP_PERMISSION_DELETED";
169
+ return ActionType2;
170
+ })(ActionType || {});
171
+ var Action = /* @__PURE__ */ ((Action2) => {
172
+ Action2["CREATED"] = "CREATED";
173
+ Action2["UPDATED"] = "UPDATED";
174
+ Action2["DELETED"] = "DELETED";
175
+ return Action2;
176
+ })(Action || {});
177
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
178
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
179
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
180
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
181
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
182
+ WebhookIdentityType2["APP"] = "APP";
183
+ return WebhookIdentityType2;
184
+ })(WebhookIdentityType || {});
185
+ async function createAppPermission2(appPermission) {
186
+ const { httpClient, sideEffects } = arguments[1];
187
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
188
+ appPermission
189
+ });
190
+ const reqOpts = createAppPermission(payload);
191
+ sideEffects?.onSiteCall?.();
192
+ try {
193
+ const result = await httpClient.request(reqOpts);
194
+ sideEffects?.onSuccess?.(result);
195
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data)?.appPermission;
196
+ } catch (err) {
197
+ const transformedError = (0, import_transform_error.transformError)(
198
+ err,
199
+ {
200
+ spreadPathsToArguments: {},
201
+ explicitPathsToArguments: { appPermission: "$[0]" },
202
+ singleArgumentUnchanged: false
203
+ },
204
+ ["appPermission"]
205
+ );
206
+ sideEffects?.onError?.(err);
207
+ throw transformedError;
208
+ }
209
+ }
210
+ async function listAppPermissions2(appId, options) {
211
+ const { httpClient, sideEffects } = arguments[2];
212
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
213
+ appId,
214
+ consistent: options?.consistent,
215
+ paging: options?.paging
216
+ });
217
+ const reqOpts = listAppPermissions(payload);
218
+ sideEffects?.onSiteCall?.();
219
+ try {
220
+ const result = await httpClient.request(reqOpts);
221
+ sideEffects?.onSuccess?.(result);
222
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
223
+ } catch (err) {
224
+ const transformedError = (0, import_transform_error.transformError)(
225
+ err,
226
+ {
227
+ spreadPathsToArguments: {},
228
+ explicitPathsToArguments: {
229
+ appId: "$[0]",
230
+ consistent: "$[1].consistent",
231
+ paging: "$[1].paging"
232
+ },
233
+ singleArgumentUnchanged: false
234
+ },
235
+ ["appId", "options"]
236
+ );
237
+ sideEffects?.onError?.(err);
238
+ throw transformedError;
239
+ }
240
+ }
241
+ async function deleteAppPermission2(appId, permissionId) {
242
+ const { httpClient, sideEffects } = arguments[2];
243
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
244
+ appId,
245
+ permissionId
246
+ });
247
+ const reqOpts = deleteAppPermission(payload);
248
+ sideEffects?.onSiteCall?.();
249
+ try {
250
+ const result = await httpClient.request(reqOpts);
251
+ sideEffects?.onSuccess?.(result);
252
+ } catch (err) {
253
+ const transformedError = (0, import_transform_error.transformError)(
254
+ err,
255
+ {
256
+ spreadPathsToArguments: {},
257
+ explicitPathsToArguments: { appId: "$[0]", permissionId: "$[1]" },
258
+ singleArgumentUnchanged: false
259
+ },
260
+ ["appId", "permissionId"]
261
+ );
262
+ sideEffects?.onError?.(err);
263
+ throw transformedError;
264
+ }
265
+ }
266
+ // Annotate the CommonJS export names for ESM import in node:
267
+ 0 && (module.exports = {
268
+ Action,
269
+ ActionType,
270
+ WebhookIdentityType,
271
+ createAppPermission,
272
+ deleteAppPermission,
273
+ listAppPermissions
274
+ });
275
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../index.typings.ts","../../../src/devcenter-apps-v1-app-permission-app-permissions.universal.ts","../../../src/devcenter-apps-v1-app-permission-app-permissions.http.ts"],"sourcesContent":["export * from './src/devcenter-apps-v1-app-permission-app-permissions.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDevcenterAppsV1AppPermission from './devcenter-apps-v1-app-permission-app-permissions.http.js';\n\nexport interface AppPermission {\n /**\n * App ID.\n *\n * You can find the app ID in the app's dashboard's [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home).\n * @format GUID\n */\n appId?: string;\n /**\n * Permission the app requests when installed on a site.\n *\n * Learn more [about permissions for Wix apps](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/about-permissions).\n */\n permission?: V1Permission;\n /**\n * When the permission was created.\n * @readonly\n */\n _createdDate?: Date | null;\n /**\n * When the permission was last updated.\n * @readonly\n */\n _updatedDate?: Date | null;\n}\n\nexport interface V1Permission {\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface CreateAppPermissionRequest {\n /** Permission to add to the specified app. */\n appPermission: AppPermission;\n}\n\nexport interface CreateAppPermissionResponse {\n /** Details of permission that was added to the app. */\n appPermission?: AppPermission;\n}\n\nexport interface GetAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId?: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId?: string;\n}\n\nexport interface GetAppPermissionResponse {\n /** Details of the retrieved app permission. */\n appPermission?: AppPermission;\n}\n\nexport interface ListAppPermissionsRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\nexport interface CursorPaging {\n /**\n * Maximum number of items to return in the results.\n * @max 100\n */\n limit?: number | null;\n /**\n * Pointer to the next or previous page in the list of results.\n *\n * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\n * Not relevant for the first request.\n * @maxLength 16000\n */\n cursor?: string | null;\n}\n\nexport interface ListAppPermissionsResponse {\n /** List of permissions for the specified app. */\n appPermissions?: AppPermission[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in current page. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /**\n * Whether there are more pages to retrieve following the current page.\n *\n * + `true`: Another page of results can be retrieved.\n * + `false`: This is the last page.\n */\n hasNext?: boolean | null;\n}\n\nexport interface Cursors {\n /**\n * Cursor string pointing to the next page in the list of results.\n * @maxLength 16000\n */\n next?: string | null;\n /**\n * Cursor pointing to the previous page in the list of results.\n * @maxLength 16000\n */\n prev?: string | null;\n}\n\nexport interface DeleteAppPermissionRequest {\n /**\n * App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @format GUID\n */\n appId: string;\n /**\n * Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @minLength 1\n * @maxLength 164\n */\n permissionId: string;\n}\n\nexport interface DeleteAppPermissionResponse {}\n\nexport interface PermissionActionDomainEventEntity {\n /** The permission that had an event */\n appPermission?: AppPermission;\n /** The action which happened */\n actionType?: ActionTypeWithLiterals;\n}\n\nexport enum ActionType {\n APP_PERMISSION_DELETED = 'APP_PERMISSION_DELETED',\n}\n\n/** @enumType */\nexport type ActionTypeWithLiterals = ActionType | 'APP_PERMISSION_DELETED';\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface Empty {}\n\nexport interface OldPermissionChangedEvent {\n /** @format GUID */\n appId?: string;\n permission?: Permission;\n action?: ActionWithLiterals;\n}\n\nexport interface Permission {\n permissionId?: string;\n}\n\nexport enum Action {\n CREATED = 'CREATED',\n UPDATED = 'UPDATED',\n DELETED = 'DELETED',\n}\n\n/** @enumType */\nexport type ActionWithLiterals = Action | 'CREATED' | 'UPDATED' | 'DELETED';\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface BaseEventMetadata {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n}\n\nexport interface EventMetadata extends BaseEventMetadata {\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at 16:00 and then again at 16:01, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\nexport interface AppPermissionCreatedEnvelope {\n entity: AppPermission;\n metadata: EventMetadata;\n}\n\n/**\n * Triggered when a permission is added to an app.\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @webhook\n * @eventType wix.devcenter.apps.v1.app_permission_created\n * @slug created\n * @documentationMaturity preview\n */\nexport declare function onAppPermissionCreated(\n handler: (event: AppPermissionCreatedEnvelope) => void | Promise<void>\n): void;\n\ntype AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n * @param appPermission - Permission to add to the specified app.\n * @public\n * @documentationMaturity preview\n * @requiredField appPermission\n * @requiredField appPermission.appId\n * @requiredField appPermission.permission\n * @requiredField appPermission.permission.permissionId\n * @permissionId DEV_CENTER.CREATE_APP_PERMISSION\n * @applicableIdentity APP\n * @returns Details of permission that was added to the app.\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission\n */\nexport async function createAppPermission(\n appPermission: NonNullablePaths<\n AppPermission,\n `appId` | `permission` | `permission.permissionId`\n >\n): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appPermission: appPermission,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.createAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)?.appPermission!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appPermission: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['appPermission']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @permissionId DEV_CENTER.READ_APP_PERMISSIONS\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions\n */\nexport async function listAppPermissions(\n appId: string,\n options?: ListAppPermissionsOptions\n): Promise<\n NonNullablePaths<\n ListAppPermissionsResponse,\n {\n [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;\n }[AppPermissionNonNullablePaths]\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n consistent: options?.consistent,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.listAppPermissions(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n\n return renameKeysFromRESTResponseToSDKResponse(result.data)!;\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {\n appId: '$[0]',\n consistent: '$[1].consistent',\n paging: '$[1].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['appId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListAppPermissionsOptions {\n /**\n * Whether to retrieve the most recent permissions information. This decreases performance but ensures that the retrieved information is up-to-date, even immediately after an update.\n *\n * Default: `false`.\n */\n consistent?: boolean;\n /** Paging configuration. */\n paging?: CursorPaging;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n * @param appId - App ID.\n *\n * You can find the app ID on the [Home page](https://manage.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%home) in the app's dashboard.\n * @param permissionId - Permission ID.\n *\n * To find the permission ID, navigate to the [Permissions page](https://dev.wix.com/app-selector?title=Select+an+App&primaryButtonText=Select+Site&actionUrl=https%3A%2F%2Fdev.wix.com%2Fapps%2F%7BappId%7D%2Fdev-center-permissions/add) in the app's dashboard and search for the [permission you want to configure](https://dev.wix.com/docs/build-apps/develop-your-app/access/authorization/configure-permissions-for-your-app#step-1--identify-required-permissions).\n * @public\n * @documentationMaturity preview\n * @requiredField appId\n * @requiredField permissionId\n * @permissionId DEV_CENTER.DELETE_APP_PERMISSION\n * @applicableIdentity APP\n * @fqn wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission\n */\nexport async function deleteAppPermission(\n appId: string,\n permissionId: string\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[2] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n appId: appId,\n permissionId: permissionId,\n });\n\n const reqOpts =\n ambassadorWixDevcenterAppsV1AppPermission.deleteAppPermission(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { appId: '$[0]', permissionId: '$[1]' },\n singleArgumentUnchanged: false,\n },\n ['appId', 'permissionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { transformSDKTimestampToRESTTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformRESTTimestampToSDKTimestamp } from '@wix/sdk-runtime/transformations/timestamp';\nimport { transformPaths } from '@wix/sdk-runtime/transformations/transform-paths';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'dev._base_domain_': [\n {\n srcPath: '/app-permissions-service',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www._base_domain_': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/apps/v1/app-permissions',\n destPath: '',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/app-permissions-service',\n destPath: '',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_app-management_app-permissions';\n\n/**\n * Adds a permission to the specified app.\n *\n * When users install your app on a site, it requests this permission.\n */\nexport function createAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __createAppPermission({ host }: any) {\n const serializedData = transformPaths(payload, [\n {\n transformFn: transformSDKTimestampToRESTTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]);\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'POST' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.CreateAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: serializedData,\n host,\n }),\n data: serializedData,\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermission.createdDate' },\n { path: 'appPermission.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __createAppPermission;\n}\n\n/**\n * Lists all permissions for the specified app.\n *\n * These are the permissions your app requests when users install it on a site.\n */\nexport function listAppPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __listAppPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'GET' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.ListAppPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n transformResponse: (payload: any) =>\n transformPaths(payload, [\n {\n transformFn: transformRESTTimestampToSDKTimestamp,\n paths: [\n { path: 'appPermissions.createdDate' },\n { path: 'appPermissions.updatedDate' },\n ],\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listAppPermissions;\n}\n\n/**\n * Deletes a permission from the specified app.\n *\n * After deleting a permission, your app no longer requests it when users install it on a site. As a result, the app can no longer make calls to APIs that require this permission.\n */\nexport function deleteAppPermission(\n payload: object\n): RequestOptionsFactory<any> {\n function __deleteAppPermission({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.devcenter.apps.v1.app_permission',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.devcenter.apps.permissions.v1.AppPermissionsService.DeleteAppPermission',\n packageName: PACKAGE_NAME,\n url: resolveWixDevcenterAppsPermissionsV1AppPermissionsServiceUrl({\n protoPath: '/v1/app-permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __deleteAppPermission;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAAAA;AAAA,EAAA,2BAAAC;AAAA,EAAA,0BAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,uBAAqD;AACrD,IAAAC,oBAAqD;AACrD,6BAA+B;AAC/B,IAAAC,uBAA2B;AAI3B,SAAS,6DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,qBAAqB;AAAA,MACnB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,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AAO,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","ActionType","Action","WebhookIdentityType","createAppPermission","sdkTransformError","listAppPermissions","deleteAppPermission"]}
@@ -1,4 +1,5 @@
1
- import { C as CreateAppPermissionRequest$1, f as CreateAppPermissionResponse$1, h as ListAppPermissionsRequest$1, a as ListAppPermissionsResponse$1, D as DeleteAppPermissionRequest$1, l as DeleteAppPermissionResponse$1 } from './devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.js';
1
+ import { CreateAppPermissionRequest as CreateAppPermissionRequest$1, CreateAppPermissionResponse as CreateAppPermissionResponse$1, ListAppPermissionsRequest as ListAppPermissionsRequest$1, ListAppPermissionsResponse as ListAppPermissionsResponse$1, DeleteAppPermissionRequest as DeleteAppPermissionRequest$1, DeleteAppPermissionResponse as DeleteAppPermissionResponse$1 } from './index.typings.js';
2
+ import '@wix/sdk-types';
2
3
 
3
4
  interface AppPermission {
4
5
  /**
@@ -1,7 +1,8 @@
1
- import { HttpClient, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { A as AppPermission, L as ListAppPermissionsOptions, a as ListAppPermissionsResponse, b as AppPermissionCreatedEnvelope, c as AppPermissionDeletedEnvelope } from './devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.mjs';
3
- export { e as Action, q as ActionEvent, d as ActionType, B as BaseEventMetadata, C as CreateAppPermissionRequest, f as CreateAppPermissionResponse, i as CursorPaging, j as CursorPagingMetadata, k as Cursors, D as DeleteAppPermissionRequest, l as DeleteAppPermissionResponse, m as DomainEvent, n as DomainEventBodyOneOf, r as Empty, E as EntityCreatedEvent, p as EntityDeletedEvent, o as EntityUpdatedEvent, u as EventMetadata, G as GetAppPermissionRequest, g as GetAppPermissionResponse, I as IdentificationData, t as IdentificationDataIdOneOf, h as ListAppPermissionsRequest, M as MessageEnvelope, O as OldPermissionChangedEvent, s as Permission, P as PermissionActionDomainEventEntity, R as RestoreInfo, V as V1Permission, W as WebhookIdentityType } from './devcenter-apps-v1-app-permission-app-permissions.universal-BrjAb5-h.mjs';
1
+ import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
+ import { AppPermission, ListAppPermissionsOptions, ListAppPermissionsResponse, AppPermissionCreatedEnvelope } from './index.typings.mjs';
3
+ export { Action, ActionEvent, ActionType, BaseEventMetadata, CreateAppPermissionRequest, CreateAppPermissionResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteAppPermissionRequest, DeleteAppPermissionResponse, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EventMetadata, GetAppPermissionRequest, GetAppPermissionResponse, IdentificationData, IdentificationDataIdOneOf, ListAppPermissionsRequest, MessageEnvelope, OldPermissionChangedEvent, Permission, PermissionActionDomainEventEntity, RestoreInfo, V1Permission, WebhookIdentityType } from './index.typings.mjs';
4
4
 
5
+ type AppPermissionNonNullablePaths = `appId` | `permission.permissionId`;
5
6
  declare function createAppPermission$1(httpClient: HttpClient): CreateAppPermissionSignature;
6
7
  interface CreateAppPermissionSignature {
7
8
  /**
@@ -11,7 +12,7 @@ interface CreateAppPermissionSignature {
11
12
  * @param - Permission to add to the specified app.
12
13
  * @returns Details of permission that was added to the app.
13
14
  */
14
- (appPermission: AppPermission): Promise<AppPermission>;
15
+ (appPermission: NonNullablePaths<AppPermission, `appId` | `permission` | `permission.permissionId`>): Promise<NonNullablePaths<AppPermission, AppPermissionNonNullablePaths>>;
15
16
  }
16
17
  declare function listAppPermissions$1(httpClient: HttpClient): ListAppPermissionsSignature;
17
18
  interface ListAppPermissionsSignature {
@@ -23,7 +24,9 @@ interface ListAppPermissionsSignature {
23
24
  *
24
25
  * 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.
25
26
  */
26
- (appId: string, options?: ListAppPermissionsOptions | undefined): Promise<ListAppPermissionsResponse>;
27
+ (appId: string, options?: ListAppPermissionsOptions): Promise<NonNullablePaths<ListAppPermissionsResponse, {
28
+ [P in AppPermissionNonNullablePaths]: `appPermissions.${number}.${P}`;
29
+ }[AppPermissionNonNullablePaths]>>;
27
30
  }
28
31
  declare function deleteAppPermission$1(httpClient: HttpClient): DeleteAppPermissionSignature;
29
32
  interface DeleteAppPermissionSignature {
@@ -41,7 +44,6 @@ interface DeleteAppPermissionSignature {
41
44
  (appId: string, permissionId: string): Promise<void>;
42
45
  }
43
46
  declare const onAppPermissionCreated$1: EventDefinition<AppPermissionCreatedEnvelope, "wix.devcenter.apps.v1.app_permission_created">;
44
- declare const onAppPermissionDeleted$1: EventDefinition<AppPermissionDeletedEnvelope, "wix.devcenter.apps.v1.app_permission_deleted">;
45
47
 
46
48
  declare const createAppPermission: MaybeContext<BuildRESTFunction<typeof createAppPermission$1> & typeof createAppPermission$1>;
47
49
  declare const listAppPermissions: MaybeContext<BuildRESTFunction<typeof listAppPermissions$1> & typeof listAppPermissions$1>;
@@ -50,9 +52,5 @@ declare const deleteAppPermission: MaybeContext<BuildRESTFunction<typeof deleteA
50
52
  * Triggered when a permission is added to an app.
51
53
  */
52
54
  declare const onAppPermissionCreated: BuildEventDefinition<typeof onAppPermissionCreated$1>;
53
- /**
54
- * Triggered when a permission is deleted from an app.
55
- */
56
- declare const onAppPermissionDeleted: BuildEventDefinition<typeof onAppPermissionDeleted$1>;
57
55
 
58
- export { AppPermission, AppPermissionCreatedEnvelope, AppPermissionDeletedEnvelope, ListAppPermissionsOptions, ListAppPermissionsResponse, createAppPermission, deleteAppPermission, listAppPermissions, onAppPermissionCreated, onAppPermissionDeleted };
56
+ export { AppPermission, AppPermissionCreatedEnvelope, ListAppPermissionsOptions, ListAppPermissionsResponse, createAppPermission, deleteAppPermission, listAppPermissions, onAppPermissionCreated };
@@ -282,22 +282,6 @@ var onAppPermissionCreated = EventDefinition(
282
282
  ])
283
283
  )
284
284
  )();
285
- var onAppPermissionDeleted = EventDefinition(
286
- "wix.devcenter.apps.v1.app_permission_deleted",
287
- true,
288
- (event) => renameKeysFromRESTResponseToSDKResponse2(
289
- transformPaths2(event, [
290
- {
291
- transformFn: transformRESTTimestampToSDKTimestamp2,
292
- paths: [
293
- { path: "undefined.createdDate" },
294
- { path: "undefined.updatedDate" },
295
- { path: "metadata.eventTime" }
296
- ]
297
- }
298
- ])
299
- )
300
- )();
301
285
 
302
286
  // src/devcenter-apps-v1-app-permission-app-permissions.context.ts
303
287
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
@@ -306,7 +290,6 @@ var createAppPermission4 = /* @__PURE__ */ createRESTModule(createAppPermission3
306
290
  var listAppPermissions4 = /* @__PURE__ */ createRESTModule(listAppPermissions3);
307
291
  var deleteAppPermission4 = /* @__PURE__ */ createRESTModule(deleteAppPermission3);
308
292
  var onAppPermissionCreated2 = createEventModule(onAppPermissionCreated);
309
- var onAppPermissionDeleted2 = createEventModule(onAppPermissionDeleted);
310
293
  export {
311
294
  Action,
312
295
  ActionType,
@@ -314,7 +297,6 @@ export {
314
297
  createAppPermission4 as createAppPermission,
315
298
  deleteAppPermission4 as deleteAppPermission,
316
299
  listAppPermissions4 as listAppPermissions,
317
- onAppPermissionCreated2 as onAppPermissionCreated,
318
- onAppPermissionDeleted2 as onAppPermissionDeleted
300
+ onAppPermissionCreated2 as onAppPermissionCreated
319
301
  };
320
302
  //# sourceMappingURL=index.mjs.map