@wix/auto_sdk_member-roles_roles 0.0.0-stage → 1.0.0
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 +39 -0
- package/build/cjs/index.js +269 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +705 -0
- package/build/cjs/index.typings.js +254 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +681 -0
- package/build/cjs/meta.js +239 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/es/index.d.mts +39 -0
- package/build/es/index.mjs +242 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +705 -0
- package/build/es/index.typings.mjs +227 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/meta.d.mts +681 -0
- package/build/es/meta.mjs +209 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/es/package.json +3 -0
- package/build/internal/cjs/index.d.ts +39 -0
- package/build/internal/cjs/index.typings.d.ts +705 -0
- package/build/internal/cjs/meta.d.ts +723 -0
- package/build/internal/es/index.d.mts +39 -0
- package/build/internal/es/index.typings.d.mts +705 -0
- package/build/internal/es/meta.d.mts +723 -0
- package/meta/package.json +3 -0
- package/package.json +51 -3
- package/README.md +0 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
|
|
2
|
+
import { ListGroupsByResourceOptions, ListGroupsByResourceResponse } from './index.typings.js';
|
|
3
|
+
export { AccountInfo, ActionEvent, AssignPermissionsRequest, AssignPermissionsResponse, AssignPermissionsToUserRequest, AssignUsersRequest, AssignUsersResponse, Color, ColorWithLiterals, CopyPermissionsRequest, CopyPermissionsResponse, CreateRequest, CreateResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteRequest, DeleteResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetCurrentUserGroupsRequest, GetCurrentUserGroupsResponse, GetRequest, GetResponse, GroupData, GroupInfo, GroupPermissions, GroupTypeFilter, GroupTypeFilterWithLiterals, Groups, GroupsCountRequest, GroupsCountResponse, GroupsData, GroupsFilter, IdentificationData, IdentificationDataIdOneOf, ListGroupsByResourceRequest, ListGroupsPermissionsRequest, ListGroupsPermissionsResponse, ListPermissionsRequest, ListPermissionsResponse, ListRequest, ListRequestListFilterOneOf, ListResponse, ListUserMembershipsRequest, ListUserMembershipsResponse, ListUsersGroupsByMetaSitesRequest, ListUsersGroupsByMetaSitesResponse, ListUsersGroupsRequest, ListUsersGroupsResponse, ListUsersPermissionsRequest, ListUsersPermissionsResponse, ListUsersRequest, ListUsersResponse, Membership, MessageEnvelope, Permission, RemovePermissionsFromUserRequest, RemovePermissionsRequest, RemovePermissionsResponse, RemoveUserFromGroupsRequest, RemoveUserFromGroupsResponse, RemoveUsersRequest, RemoveUsersResponse, RestoreInfo, SiteUser, UpdateRequest, UpdateResponse, UpdateUserMembershipDatesRequest, UpdateUserMembershipDatesResponse, UserPermissions, UserWithTenant, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
|
|
4
|
+
|
|
5
|
+
declare function listGroupsByResource$1(httpClient: HttpClient): ListGroupsByResourceSignature;
|
|
6
|
+
interface ListGroupsByResourceSignature {
|
|
7
|
+
/**
|
|
8
|
+
* Retrieves the groups of a specific type that grant access to a site resource.
|
|
9
|
+
*
|
|
10
|
+
* Groups are what the site's dashboard calls member roles, including the roles that apps create,
|
|
11
|
+
* such as one for each pricing plan. Site members get access to a resource through the groups they belong to.
|
|
12
|
+
*
|
|
13
|
+
* For example, to get the pricing plans that protect a members-only page,
|
|
14
|
+
* pass the page ID as `resourceId` and `"plan"` as `type`.
|
|
15
|
+
*
|
|
16
|
+
* Only groups of the current site are returned, sorted by title.
|
|
17
|
+
* The built-in Admin and Member groups aren't included.
|
|
18
|
+
*
|
|
19
|
+
* The list is empty if no group of the requested type grants access to the resource,
|
|
20
|
+
* for example for a page that every visitor can view, or for a resource of another site.
|
|
21
|
+
*
|
|
22
|
+
* Site visitors and members can only retrieve groups of type `"plan"`.
|
|
23
|
+
* @param - ID of the resource to retrieve groups for.
|
|
24
|
+
*
|
|
25
|
+
* This is the ID that groups grant access to, usually a site page ID, such as `"c1dmp"`.
|
|
26
|
+
* Page IDs aren't GUIDs.
|
|
27
|
+
* @param - Type of groups to retrieve. The type is set by the app that created the groups,
|
|
28
|
+
* for example `"plan"` for groups created by Wix Pricing Plans.
|
|
29
|
+
*
|
|
30
|
+
* The value is matched case-insensitively. A type that no group of the resource has returns an empty list.
|
|
31
|
+
* Some internal type values are reserved and fail with `INVALID_ARGUMENT`.
|
|
32
|
+
* Site visitors and members can only pass `"plan"`. Other values fail with `PERMISSION_DENIED`.
|
|
33
|
+
*/
|
|
34
|
+
(resourceId: string, type: string, options?: ListGroupsByResourceOptions): Promise<NonNullablePaths<ListGroupsByResourceResponse, `groups` | `groups.${number}._id` | `groups.${number}.title` | `groups.${number}.color`, 2>>;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare const listGroupsByResource: MaybeContext<BuildRESTFunction<typeof listGroupsByResource$1> & typeof listGroupsByResource$1>;
|
|
38
|
+
|
|
39
|
+
export { ListGroupsByResourceOptions, ListGroupsByResourceResponse, listGroupsByResource };
|
|
@@ -0,0 +1,269 @@
|
|
|
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.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
Color: () => Color,
|
|
24
|
+
GroupTypeFilter: () => GroupTypeFilter,
|
|
25
|
+
WebhookIdentityType: () => WebhookIdentityType,
|
|
26
|
+
listGroupsByResource: () => listGroupsByResource4
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_exports);
|
|
29
|
+
|
|
30
|
+
// src/identity-members-groups-v1-group-info-roles.universal.ts
|
|
31
|
+
var import_transform_error = require("@wix/sdk-runtime/transform-error");
|
|
32
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
33
|
+
|
|
34
|
+
// src/identity-members-groups-v1-group-info-roles.http.ts
|
|
35
|
+
var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
|
|
36
|
+
var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
|
|
37
|
+
var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
38
|
+
var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
|
|
39
|
+
var TRANSFORM_PATHS_0 = [
|
|
40
|
+
{ path: "groups.creationDate" },
|
|
41
|
+
{ path: "groups.createdDate" }
|
|
42
|
+
];
|
|
43
|
+
function resolveComWixpressMembersGroupsGroupsServiceUrl(opts) {
|
|
44
|
+
const domainToMappings = {
|
|
45
|
+
"www._base_domain_": [
|
|
46
|
+
{
|
|
47
|
+
srcPath: "/_api/members-groups-web",
|
|
48
|
+
destPath: ""
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
srcPath: "/_api/members-groups-web",
|
|
52
|
+
destPath: ""
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"api._api_base_domain_": [
|
|
56
|
+
{
|
|
57
|
+
srcPath: "/members-groups-web",
|
|
58
|
+
destPath: ""
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"editor._base_domain_": [
|
|
62
|
+
{
|
|
63
|
+
srcPath: "/_api/members-groups-web",
|
|
64
|
+
destPath: ""
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
"blocks._base_domain_": [
|
|
68
|
+
{
|
|
69
|
+
srcPath: "/_api/members-groups-web",
|
|
70
|
+
destPath: ""
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"create.editorx": [
|
|
74
|
+
{
|
|
75
|
+
srcPath: "/_api/members-groups-web",
|
|
76
|
+
destPath: ""
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
_: [
|
|
80
|
+
{
|
|
81
|
+
srcPath: "/_api/members-groups-web/v1",
|
|
82
|
+
destPath: "/v1"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"forums.wixapps.net": [
|
|
86
|
+
{
|
|
87
|
+
srcPath: "/_api/members-groups-web/v1",
|
|
88
|
+
destPath: "/v1"
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"bo._base_domain_": [
|
|
92
|
+
{
|
|
93
|
+
srcPath: "/members-groups-web",
|
|
94
|
+
destPath: ""
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
srcPath: "/wow/babel/_api/members-groups-web",
|
|
98
|
+
destPath: ""
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
srcPath: "/_api/members-groups-web",
|
|
102
|
+
destPath: ""
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
"wixbo.ai": [
|
|
106
|
+
{
|
|
107
|
+
srcPath: "/members-groups-web",
|
|
108
|
+
destPath: ""
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
srcPath: "/wow/babel/_api/members-groups-web",
|
|
112
|
+
destPath: ""
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
srcPath: "/_api/members-groups-web",
|
|
116
|
+
destPath: ""
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"wix-bo.com": [
|
|
120
|
+
{
|
|
121
|
+
srcPath: "/members-groups-web",
|
|
122
|
+
destPath: ""
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
srcPath: "/wow/babel/_api/members-groups-web",
|
|
126
|
+
destPath: ""
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
srcPath: "/_api/members-groups-web",
|
|
130
|
+
destPath: ""
|
|
131
|
+
}
|
|
132
|
+
],
|
|
133
|
+
"manage._base_domain_": [
|
|
134
|
+
{
|
|
135
|
+
srcPath: "/_api/members-groups-web",
|
|
136
|
+
destPath: ""
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
"forums._base_domain_": [
|
|
140
|
+
{
|
|
141
|
+
srcPath: "/_api/members-groups-web/v1",
|
|
142
|
+
destPath: "/v1"
|
|
143
|
+
}
|
|
144
|
+
],
|
|
145
|
+
"*.dev.wix-code.com": [
|
|
146
|
+
{
|
|
147
|
+
srcPath: "/_api/members-groups-web",
|
|
148
|
+
destPath: ""
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
"editor.wixapps.net": [
|
|
152
|
+
{
|
|
153
|
+
srcPath: "/_api/members-groups-web/v1",
|
|
154
|
+
destPath: "/v1"
|
|
155
|
+
}
|
|
156
|
+
]
|
|
157
|
+
};
|
|
158
|
+
return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
|
|
159
|
+
}
|
|
160
|
+
var PACKAGE_NAME = "@wix/auto_sdk_member-roles_roles";
|
|
161
|
+
function listGroupsByResource(payload) {
|
|
162
|
+
function __listGroupsByResource({ host }) {
|
|
163
|
+
const metadata = {
|
|
164
|
+
entityFqdn: "wix.identity.members_groups.v1.group_info",
|
|
165
|
+
method: "GET",
|
|
166
|
+
methodFqn: "com.wixpress.members.groups.GroupsService.ListGroupsByResource",
|
|
167
|
+
packageName: PACKAGE_NAME,
|
|
168
|
+
migrationOptions: {
|
|
169
|
+
optInTransformResponse: true
|
|
170
|
+
},
|
|
171
|
+
url: resolveComWixpressMembersGroupsGroupsServiceUrl({
|
|
172
|
+
protoPath: "/v1/groups/by-resource/{resourceId}",
|
|
173
|
+
data: payload,
|
|
174
|
+
host
|
|
175
|
+
}),
|
|
176
|
+
params: (0, import_rest_modules.toURLSearchParams)(payload),
|
|
177
|
+
transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
|
|
178
|
+
{
|
|
179
|
+
transformFn: import_timestamp.transformRESTTimestampToSDKTimestamp,
|
|
180
|
+
paths: TRANSFORM_PATHS_0
|
|
181
|
+
}
|
|
182
|
+
])
|
|
183
|
+
};
|
|
184
|
+
return metadata;
|
|
185
|
+
}
|
|
186
|
+
return __listGroupsByResource;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
// src/identity-members-groups-v1-group-info-roles.universal.ts
|
|
190
|
+
var Color = /* @__PURE__ */ ((Color2) => {
|
|
191
|
+
Color2["UNDEFINED"] = "UNDEFINED";
|
|
192
|
+
Color2["DARK_BLUE"] = "DARK_BLUE";
|
|
193
|
+
Color2["LIGHT_BLUE"] = "LIGHT_BLUE";
|
|
194
|
+
Color2["TEAL"] = "TEAL";
|
|
195
|
+
Color2["LIGHT_GREEN"] = "LIGHT_GREEN";
|
|
196
|
+
Color2["YELLOW"] = "YELLOW";
|
|
197
|
+
Color2["ORANGE"] = "ORANGE";
|
|
198
|
+
Color2["RED"] = "RED";
|
|
199
|
+
Color2["VIOLET"] = "VIOLET";
|
|
200
|
+
Color2["PURPLE"] = "PURPLE";
|
|
201
|
+
return Color2;
|
|
202
|
+
})(Color || {});
|
|
203
|
+
var GroupTypeFilter = /* @__PURE__ */ ((GroupTypeFilter2) => {
|
|
204
|
+
GroupTypeFilter2["NO_IMPLICITS"] = "NO_IMPLICITS";
|
|
205
|
+
GroupTypeFilter2["ALL"] = "ALL";
|
|
206
|
+
return GroupTypeFilter2;
|
|
207
|
+
})(GroupTypeFilter || {});
|
|
208
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
209
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
210
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
211
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
212
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
213
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
214
|
+
return WebhookIdentityType2;
|
|
215
|
+
})(WebhookIdentityType || {});
|
|
216
|
+
async function listGroupsByResource2(resourceId, type, options) {
|
|
217
|
+
const { httpClient, sideEffects } = arguments[3];
|
|
218
|
+
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
219
|
+
resourceId,
|
|
220
|
+
type,
|
|
221
|
+
paging: options?.paging
|
|
222
|
+
});
|
|
223
|
+
const reqOpts = listGroupsByResource(payload);
|
|
224
|
+
sideEffects?.onSiteCall?.();
|
|
225
|
+
try {
|
|
226
|
+
const result = await httpClient.request(reqOpts);
|
|
227
|
+
sideEffects?.onSuccess?.(result);
|
|
228
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
|
|
229
|
+
} catch (err) {
|
|
230
|
+
const transformedError = (0, import_transform_error.transformError)(
|
|
231
|
+
err,
|
|
232
|
+
{
|
|
233
|
+
spreadPathsToArguments: {},
|
|
234
|
+
explicitPathsToArguments: {
|
|
235
|
+
resourceId: "$[0]",
|
|
236
|
+
type: "$[1]",
|
|
237
|
+
paging: "$[2].paging"
|
|
238
|
+
},
|
|
239
|
+
singleArgumentUnchanged: false
|
|
240
|
+
},
|
|
241
|
+
["resourceId", "type", "options"]
|
|
242
|
+
);
|
|
243
|
+
sideEffects?.onError?.(err);
|
|
244
|
+
throw transformedError;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// src/identity-members-groups-v1-group-info-roles.public.ts
|
|
249
|
+
function listGroupsByResource3(httpClient) {
|
|
250
|
+
return (resourceId, type, options) => listGroupsByResource2(
|
|
251
|
+
resourceId,
|
|
252
|
+
type,
|
|
253
|
+
options,
|
|
254
|
+
// @ts-ignore
|
|
255
|
+
{ httpClient }
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
// src/identity-members-groups-v1-group-info-roles.context.ts
|
|
260
|
+
var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
|
|
261
|
+
var listGroupsByResource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listGroupsByResource3);
|
|
262
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
263
|
+
0 && (module.exports = {
|
|
264
|
+
Color,
|
|
265
|
+
GroupTypeFilter,
|
|
266
|
+
WebhookIdentityType,
|
|
267
|
+
listGroupsByResource
|
|
268
|
+
});
|
|
269
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/identity-members-groups-v1-group-info-roles.universal.ts","../../src/identity-members-groups-v1-group-info-roles.http.ts","../../src/identity-members-groups-v1-group-info-roles.public.ts","../../src/identity-members-groups-v1-group-info-roles.context.ts"],"sourcesContent":["export * from './src/identity-members-groups-v1-group-info-roles.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 ambassadorWixIdentityMembersGroupsV1GroupInfo from './identity-members-groups-v1-group-info-roles.http.js';\n\nexport interface GroupInfo {\n /**\n * Role ID.\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * Role name as defined in the site's\n * [Member Permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/roles)\n * page or one of `\"Admin\"` or `\"Member\"`.\n * @maxLength 50\n */\n title?: string;\n /**\n * Role description, if defined in the site's dashboard.\n * @maxLength 1500\n */\n description?: string | null;\n /**\n * Role color, as defined in the site's\n * [Member Permissions](https://www.wix.com/my-account/site-selector/?buttonText=Select%20Site&title=Select%20a%20Site&autoSelectOnSingleSite=true&actionUrl=https:%2F%2Fwww.wix.com%2Fdashboard%2F%7B%7BmetaSiteId%7D%7D%2Fmember-permissions/roles)\n * page.\n *\n * One of:\n *\n * - `\"DARK_BLUE\"`\n * - `\"LIGHT_BLUE\"`\n * - `\"TEAL\"`\n * - `\"LIGHT_GREEN\"`\n * - `\"YELLOW\"`\n * - `\"ORANGE\"`\n * - `\"RED\"`\n * - `\"VIOLET\"`\n * - `\"PURPLE\"`\n */\n color?: ColorWithLiterals;\n /**\n * Deprecated. Use `created_date` instead.\n * @readonly\n * @deprecated\n * @replacedBy created_date\n */\n creationDate?: Date | null;\n /**\n * Role type, set by the app that created the role, for example `\"plan\"` for roles created by Wix Pricing Plans.\n * Empty for roles created on the site.\n * @maxLength 50\n */\n type?: string | null;\n /**\n * Date and time the role was created.\n * @readonly\n */\n _createdDate?: Date | null;\n}\n\nexport enum Color {\n UNDEFINED = 'UNDEFINED',\n DARK_BLUE = 'DARK_BLUE',\n LIGHT_BLUE = 'LIGHT_BLUE',\n TEAL = 'TEAL',\n LIGHT_GREEN = 'LIGHT_GREEN',\n YELLOW = 'YELLOW',\n ORANGE = 'ORANGE',\n RED = 'RED',\n VIOLET = 'VIOLET',\n PURPLE = 'PURPLE',\n}\n\n/** @enumType */\nexport type ColorWithLiterals =\n | Color\n | 'UNDEFINED'\n | 'DARK_BLUE'\n | 'LIGHT_BLUE'\n | 'TEAL'\n | 'LIGHT_GREEN'\n | 'YELLOW'\n | 'ORANGE'\n | 'RED'\n | 'VIOLET'\n | 'PURPLE';\n\nexport interface GetCurrentUserGroupsRequest {\n /**\n * type of group (e.g `plan` group)\n * @maxLength 70\n */\n groupType?: string | null;\n /** whether to include implicits groups (e.g `Admins`, `AllMembers`) */\n includeImplicitGroups?: boolean;\n}\n\nexport interface GetCurrentUserGroupsResponse {\n /** list of groups */\n groups?: GroupInfo[];\n}\n\nexport interface ListRequest extends ListRequestListFilterOneOf {\n /** @format GUID */\n userId?: string;\n resourceId?: string;\n /** filter by group type */\n type?: string | null;\n /** filters for the groups that will be returned. Without a filter, implicit groups (\"Admins\", \"AllMembers\") won't be returned */\n filter?: GroupsFilter;\n}\n\n/** @oneof */\nexport interface ListRequestListFilterOneOf {\n /** @format GUID */\n userId?: string;\n resourceId?: string;\n}\n\nexport interface GroupsFilter {\n groupType?: GroupTypeFilterWithLiterals;\n}\n\nexport enum GroupTypeFilter {\n /** not returning implicit group types (\"Admins\", \"AllMembers\") */\n NO_IMPLICITS = 'NO_IMPLICITS',\n /** returning all groups */\n ALL = 'ALL',\n}\n\n/** @enumType */\nexport type GroupTypeFilterWithLiterals =\n | GroupTypeFilter\n | 'NO_IMPLICITS'\n | 'ALL';\n\nexport interface ListResponse {\n /** returned groups */\n groups?: GroupInfo[];\n}\n\nexport interface ListGroupsByResourceRequest {\n /**\n * ID of the resource to retrieve groups for.\n *\n * This is the ID that groups grant access to, usually a site page ID, such as `\"c1dmp\"`.\n * Page IDs aren't GUIDs.\n * @maxLength 50\n */\n resourceId: string;\n /**\n * Type of groups to retrieve. The type is set by the app that created the groups,\n * for example `\"plan\"` for groups created by Wix Pricing Plans.\n *\n * The value is matched case-insensitively. A type that no group of the resource has returns an empty list.\n * Some internal type values are reserved and fail with `INVALID_ARGUMENT`.\n * Site visitors and members can only pass `\"plan\"`. Other values fail with `PERMISSION_DENIED`.\n * @maxLength 50\n */\n type: string;\n /**\n * Cursor paging options. Returns up to 50 groups per page by default, and up to 100.\n * A `limit` of `0` returns the default page size.\n */\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 ListGroupsByResourceResponse {\n /** Groups of the requested type that grant access to the resource, sorted by title. */\n groups?: GroupInfo[];\n /** Paging metadata. */\n pagingMetadata?: CursorPagingMetadata;\n}\n\nexport interface CursorPagingMetadata {\n /** Number of items returned in the response. */\n count?: number | null;\n /** Cursor strings that point to the next page, previous page, or both. */\n cursors?: Cursors;\n /** Whether there are more pages to retrieve following the current page. */\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 GroupsCountRequest {}\n\nexport interface GroupsCountResponse {\n /** group_id to total users in group */\n idToTotalUsers?: Record<string, number>;\n}\n\nexport interface GetRequest {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n}\n\nexport interface GetResponse {\n /** returned group */\n group?: GroupInfo;\n}\n\nexport interface CreateRequest {\n /** group to create */\n group?: GroupInfo;\n}\n\nexport interface CreateResponse {\n /** group created */\n group?: GroupInfo;\n}\n\nexport interface UpdateRequest {\n /** group to update */\n group?: GroupInfo;\n /** unsupported */\n fieldMask?: string[];\n}\n\nexport interface UpdateResponse {\n /** group updated */\n group?: GroupInfo;\n}\n\nexport interface DeleteRequest {\n /**\n * group to delete\n * @format GUID\n */\n groupId?: string;\n}\n\nexport interface DeleteResponse {}\n\nexport interface ListUsersGroupsRequest {\n /**\n * list of user ids\n * @format GUID\n */\n userIds?: string[];\n}\n\nexport interface ListUsersGroupsResponse {\n /**\n * user is to groups\n * @deprecated\n */\n usersGroups?: Record<string, Groups>;\n /** user id to groups full data */\n userGroupsData?: Record<string, GroupsData>;\n}\n\nexport interface Groups {\n /** list of groups */\n group?: GroupInfo[];\n}\n\nexport interface GroupsData {\n /** group info with start and expiration date */\n groupsData?: GroupData[];\n}\n\nexport interface GroupData {\n /** group info */\n group?: GroupInfo;\n /** membership start date */\n startDate?: Date | null;\n /** membership expiry date */\n expiryDate?: Date | null;\n totalUsers?: number | null;\n}\n\nexport interface ListUsersGroupsByMetaSitesRequest {\n /** list of users and their site */\n usersWithSites?: SiteUser[];\n}\n\nexport interface SiteUser {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n /**\n * meta_site_id id\n * @format GUID\n */\n metaSiteId?: string;\n}\n\nexport interface ListUsersGroupsByMetaSitesResponse {\n /** meta site id to groups full data */\n userGroupsData?: Record<string, GroupsData>;\n}\n\nexport interface ListUsersRequest {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n /** for paging - how many records to skip - default 0 */\n offset?: number;\n /**\n * for paging - maximum number of records to retrieve - default 30\n * @max 500\n */\n limit?: number;\n}\n\nexport interface ListUsersResponse {\n /**\n * return user ids in group\n * @format GUID\n */\n userIds?: string[];\n}\n\nexport interface AssignUsersRequest {\n /**\n * list of users to be assigned to the group\n * @format GUID\n */\n userIds?: string[];\n /**\n * target group id\n * @format GUID\n */\n groupId?: string;\n /** membership start date */\n startDate?: Date | null;\n /** membership expiry date */\n expiryDate?: Date | null;\n}\n\nexport interface AssignUsersResponse {\n /**\n * assigned user ids\n * @format GUID\n */\n userIds?: string[];\n}\n\nexport interface RemoveUsersRequest {\n /**\n * list of users to be removed from the group\n * @format GUID\n */\n userIds?: string[];\n /**\n * target group id\n * @format GUID\n */\n groupId?: string;\n}\n\nexport interface RemoveUsersResponse {}\n\nexport interface ListUserMembershipsRequest {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n /** filter by group type */\n type?: string | null;\n}\n\nexport interface ListUserMembershipsResponse {\n /** returned user memberships */\n memberships?: Membership[];\n}\n\nexport interface Membership {\n /** user id */\n userId?: string;\n /** group id */\n groupId?: string;\n /** start date */\n startDate?: Date | null;\n /** expiry date */\n expiryDate?: Date | null;\n}\n\nexport interface RemoveUserFromGroupsRequest {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n}\n\nexport interface RemoveUserFromGroupsResponse {}\n\nexport interface UpdateUserMembershipDatesRequest {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n /** membership start date */\n startDate?: Date | null;\n /** membership expiry date */\n expiryDate?: Date | null;\n}\n\nexport interface UpdateUserMembershipDatesResponse {}\n\nexport interface ListPermissionsRequest {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n}\n\nexport interface ListPermissionsResponse {\n /** returned permissions */\n permissions?: Permission[];\n}\n\nexport interface Permission {\n /**\n * permission id\n * @readonly\n * @format GUID\n */\n _id?: string;\n /**\n * optional permission context, e.g. appDefId\n * @maxLength 50\n */\n context?: string;\n /** resource id */\n resourceIds?: string[];\n}\n\nexport interface ListGroupsPermissionsRequest {\n /**\n * group ids\n * @format GUID\n * @maxSize 500\n */\n groupIds?: string[];\n}\n\nexport interface ListGroupsPermissionsResponse {\n /** permissions per requested group, in request order; groups without permissions have an empty list */\n groupsPermissions?: GroupPermissions[];\n}\n\nexport interface GroupPermissions {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n /**\n * group permissions\n * @maxSize 1000\n */\n permissions?: Permission[];\n}\n\nexport interface ListUsersPermissionsRequest {\n users?: UserWithTenant[];\n}\n\nexport interface UserWithTenant {\n userId?: string;\n /** instance id */\n tenantId?: string;\n}\n\nexport interface ListUsersPermissionsResponse {\n usersPermissions?: UserPermissions[];\n}\n\nexport interface UserPermissions {\n user?: UserWithTenant;\n permissions?: Permission[];\n}\n\nexport interface AssignPermissionsRequest {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n /** permissions to be assigned to group */\n permissions?: Permission[];\n}\n\nexport interface AssignPermissionsResponse {\n /** assigned permissions */\n permissions?: Permission[];\n}\n\nexport interface RemovePermissionsRequest {\n /**\n * group id\n * @format GUID\n */\n groupId?: string;\n /** permissions to be removed from group */\n permissions?: Permission[];\n}\n\nexport interface RemovePermissionsResponse {}\n\nexport interface AssignPermissionsToUserRequest {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n /** permissions to be assigned to group */\n permissions?: Permission[];\n}\n\nexport interface RemovePermissionsFromUserRequest {\n /**\n * user id\n * @format GUID\n */\n userId?: string;\n /** permissions to be removed from group */\n permissions?: Permission[];\n}\n\nexport interface CopyPermissionsRequest {\n /** id of a resource to copy permissions from */\n sourceResourceId?: string;\n /** id of a resource to copy permissions to */\n targetResourceId?: string;\n /**\n * permission context, e.g. appDefId\n * @deprecated\n */\n context?: string;\n /** site tenant */\n tenant?: string;\n}\n\nexport interface CopyPermissionsResponse {\n copiedPermissionCount?: number;\n}\n\nexport interface DomainEvent extends DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n /** Event ID. With this ID you can easily spot duplicated events and ignore them. */\n _id?: string;\n /**\n * Fully Qualified Domain Name of an entity. This is a unique identifier assigned to the API main business entities.\n * For example, `wix.stores.catalog.product`, `wix.bookings.session`, `wix.payments.transaction`.\n */\n entityFqdn?: string;\n /**\n * Event action name, placed at the top level to make it easier for users to dispatch messages.\n * For example: `created`/`updated`/`deleted`/`started`/`completed`/`email_opened`.\n */\n slug?: string;\n /** ID of the entity associated with the event. */\n entityId?: string;\n /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example, `2020-04-26T13:57:50.699Z`. */\n eventTime?: Date | null;\n /**\n * Whether the event was triggered as a result of a privacy regulation application\n * (for example, GDPR).\n */\n triggeredByAnonymizeRequest?: boolean | null;\n /** If present, indicates the action that triggered the event. */\n originatedFrom?: string | null;\n /**\n * A sequence number that indicates the order of updates to an entity. For example, if an entity was updated at `16:00` and then again at `16:01`, the second update will always have a higher sequence number.\n * You can use this number to make sure you're handling updates in the right order. Just save the latest sequence number on your end and compare it to the one in each new message. If the new message has an older (lower) number, you can safely ignore it.\n */\n entityEventSequence?: string | null;\n}\n\n/** @oneof */\nexport interface DomainEventBodyOneOf {\n createdEvent?: EntityCreatedEvent;\n updatedEvent?: EntityUpdatedEvent;\n deletedEvent?: EntityDeletedEvent;\n actionEvent?: ActionEvent;\n}\n\nexport interface EntityCreatedEvent {\n entity?: string;\n}\n\nexport interface RestoreInfo {\n deletedDate?: Date | null;\n}\n\nexport interface EntityUpdatedEvent {\n /**\n * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.\n * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.\n * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.\n */\n currentEntity?: string;\n}\n\nexport interface EntityDeletedEvent {\n /** Entity that was deleted. */\n deletedEntity?: string | null;\n}\n\nexport interface ActionEvent {\n body?: string;\n}\n\nexport interface MessageEnvelope {\n /**\n * App instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n /**\n * Event type.\n * @maxLength 150\n */\n eventType?: string;\n /** The identification type and identity data. */\n identity?: IdentificationData;\n /** Stringify payload. */\n data?: string;\n /** Details related to the account */\n accountInfo?: AccountInfo;\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: WebhookIdentityTypeWithLiterals;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n\nexport enum WebhookIdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\n/** @enumType */\nexport type WebhookIdentityTypeWithLiterals =\n | WebhookIdentityType\n | 'UNKNOWN'\n | 'ANONYMOUS_VISITOR'\n | 'MEMBER'\n | 'WIX_USER'\n | 'APP';\n\nexport interface AccountInfo {\n /**\n * ID of the Wix account associated with the event.\n * @format GUID\n */\n accountId?: string | null;\n /**\n * ID of the parent Wix account. Only included when accountId belongs to a child account.\n * @format GUID\n */\n parentAccountId?: string | null;\n /**\n * ID of the Wix site associated with the event. Only included when the event is tied to a specific site.\n * @format GUID\n */\n siteId?: string | null;\n}\n\n/**\n * Retrieves the groups of a specific type that grant access to a site resource.\n *\n * Groups are what the site's dashboard calls member roles, including the roles that apps create,\n * such as one for each pricing plan. Site members get access to a resource through the groups they belong to.\n *\n * For example, to get the pricing plans that protect a members-only page,\n * pass the page ID as `resourceId` and `\"plan\"` as `type`.\n *\n * Only groups of the current site are returned, sorted by title.\n * The built-in Admin and Member groups aren't included.\n *\n * The list is empty if no group of the requested type grants access to the resource,\n * for example for a page that every visitor can view, or for a resource of another site.\n *\n * Site visitors and members can only retrieve groups of type `\"plan\"`.\n * @param resourceId - ID of the resource to retrieve groups for.\n *\n * This is the ID that groups grant access to, usually a site page ID, such as `\"c1dmp\"`.\n * Page IDs aren't GUIDs.\n * @param type - Type of groups to retrieve. The type is set by the app that created the groups,\n * for example `\"plan\"` for groups created by Wix Pricing Plans.\n *\n * The value is matched case-insensitively. A type that no group of the resource has returns an empty list.\n * Some internal type values are reserved and fail with `INVALID_ARGUMENT`.\n * Site visitors and members can only pass `\"plan\"`. Other values fail with `PERMISSION_DENIED`.\n * @public\n * @documentationMaturity preview\n * @requiredField resourceId\n * @requiredField type\n * @permissionId identity:members_groups:v1:group_info:list_groups_by_resource\n * @fqn com.wixpress.members.groups.GroupsService.ListGroupsByResource\n */\nexport async function listGroupsByResource(\n resourceId: string,\n type: string,\n options?: ListGroupsByResourceOptions\n): Promise<\n NonNullablePaths<\n ListGroupsByResourceResponse,\n | `groups`\n | `groups.${number}._id`\n | `groups.${number}.title`\n | `groups.${number}.color`,\n 2\n >\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[3] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n resourceId: resourceId,\n type: type,\n paging: options?.paging,\n });\n\n const reqOpts =\n ambassadorWixIdentityMembersGroupsV1GroupInfo.listGroupsByResource(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 resourceId: '$[0]',\n type: '$[1]',\n paging: '$[2].paging',\n },\n singleArgumentUnchanged: false,\n },\n ['resourceId', 'type', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface ListGroupsByResourceOptions {\n /**\n * Cursor paging options. Returns up to 50 groups per page by default, and up to 100.\n * A `limit` of `0` returns the default page size.\n */\n paging?: CursorPaging;\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\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: 'groups.creationDate' },\n { path: 'groups.createdDate' },\n];\n\nfunction resolveComWixpressMembersGroupsGroupsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'www._base_domain_': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'api._api_base_domain_': [\n {\n srcPath: '/members-groups-web',\n destPath: '',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n _: [\n {\n srcPath: '/_api/members-groups-web/v1',\n destPath: '/v1',\n },\n ],\n 'forums.wixapps.net': [\n {\n srcPath: '/_api/members-groups-web/v1',\n destPath: '/v1',\n },\n ],\n 'bo._base_domain_': [\n {\n srcPath: '/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/wow/babel/_api/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'wixbo.ai': [\n {\n srcPath: '/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/wow/babel/_api/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'wix-bo.com': [\n {\n srcPath: '/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/wow/babel/_api/members-groups-web',\n destPath: '',\n },\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'forums._base_domain_': [\n {\n srcPath: '/_api/members-groups-web/v1',\n destPath: '/v1',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/members-groups-web',\n destPath: '',\n },\n ],\n 'editor.wixapps.net': [\n {\n srcPath: '/_api/members-groups-web/v1',\n destPath: '/v1',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_member-roles_roles';\n\n/**\n * Retrieves the groups of a specific type that grant access to a site resource.\n *\n * Groups are what the site's dashboard calls member roles, including the roles that apps create,\n * such as one for each pricing plan. Site members get access to a resource through the groups they belong to.\n *\n * For example, to get the pricing plans that protect a members-only page,\n * pass the page ID as `resourceId` and `\"plan\"` as `type`.\n *\n * Only groups of the current site are returned, sorted by title.\n * The built-in Admin and Member groups aren't included.\n *\n * The list is empty if no group of the requested type grants access to the resource,\n * for example for a page that every visitor can view, or for a resource of another site.\n *\n * Site visitors and members can only retrieve groups of type `\"plan\"`.\n */\nexport function listGroupsByResource(\n payload: object\n): RequestOptionsFactory<any> {\n function __listGroupsByResource({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.identity.members_groups.v1.group_info',\n method: 'GET' as any,\n methodFqn:\n 'com.wixpress.members.groups.GroupsService.ListGroupsByResource',\n packageName: PACKAGE_NAME,\n migrationOptions: {\n optInTransformResponse: true,\n },\n url: resolveComWixpressMembersGroupsGroupsServiceUrl({\n protoPath: '/v1/groups/by-resource/{resourceId}',\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_0,\n },\n ]),\n };\n\n return metadata;\n }\n\n return __listGroupsByResource;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n ListGroupsByResourceOptions,\n ListGroupsByResourceResponse,\n listGroupsByResource as universalListGroupsByResource,\n} from './identity-members-groups-v1-group-info-roles.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/member-roles' };\n\nexport function listGroupsByResource(\n httpClient: HttpClient\n): ListGroupsByResourceSignature {\n return (\n resourceId: string,\n type: string,\n options?: ListGroupsByResourceOptions\n ) =>\n universalListGroupsByResource(\n resourceId,\n type,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface ListGroupsByResourceSignature {\n /**\n * Retrieves the groups of a specific type that grant access to a site resource.\n *\n * Groups are what the site's dashboard calls member roles, including the roles that apps create,\n * such as one for each pricing plan. Site members get access to a resource through the groups they belong to.\n *\n * For example, to get the pricing plans that protect a members-only page,\n * pass the page ID as `resourceId` and `\"plan\"` as `type`.\n *\n * Only groups of the current site are returned, sorted by title.\n * The built-in Admin and Member groups aren't included.\n *\n * The list is empty if no group of the requested type grants access to the resource,\n * for example for a page that every visitor can view, or for a resource of another site.\n *\n * Site visitors and members can only retrieve groups of type `\"plan\"`.\n * @param - ID of the resource to retrieve groups for.\n *\n * This is the ID that groups grant access to, usually a site page ID, such as `\"c1dmp\"`.\n * Page IDs aren't GUIDs.\n * @param - Type of groups to retrieve. The type is set by the app that created the groups,\n * for example `\"plan\"` for groups created by Wix Pricing Plans.\n *\n * The value is matched case-insensitively. A type that no group of the resource has returns an empty list.\n * Some internal type values are reserved and fail with `INVALID_ARGUMENT`.\n * Site visitors and members can only pass `\"plan\"`. Other values fail with `PERMISSION_DENIED`.\n */\n (\n resourceId: string,\n type: string,\n options?: ListGroupsByResourceOptions\n ): Promise<\n NonNullablePaths<\n ListGroupsByResourceResponse,\n | `groups`\n | `groups.${number}._id`\n | `groups.${number}.title`\n | `groups.${number}.color`,\n 2\n >\n >;\n}\n\nexport {\n AccountInfo,\n ActionEvent,\n AssignPermissionsRequest,\n AssignPermissionsResponse,\n AssignPermissionsToUserRequest,\n AssignUsersRequest,\n AssignUsersResponse,\n Color,\n CopyPermissionsRequest,\n CopyPermissionsResponse,\n CreateRequest,\n CreateResponse,\n CursorPaging,\n CursorPagingMetadata,\n Cursors,\n DeleteRequest,\n DeleteResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n GetCurrentUserGroupsRequest,\n GetCurrentUserGroupsResponse,\n GetRequest,\n GetResponse,\n GroupData,\n GroupInfo,\n GroupPermissions,\n GroupTypeFilter,\n Groups,\n GroupsCountRequest,\n GroupsCountResponse,\n GroupsData,\n GroupsFilter,\n IdentificationData,\n IdentificationDataIdOneOf,\n ListGroupsByResourceOptions,\n ListGroupsByResourceRequest,\n ListGroupsByResourceResponse,\n ListGroupsPermissionsRequest,\n ListGroupsPermissionsResponse,\n ListPermissionsRequest,\n ListPermissionsResponse,\n ListRequest,\n ListRequestListFilterOneOf,\n ListResponse,\n ListUserMembershipsRequest,\n ListUserMembershipsResponse,\n ListUsersGroupsByMetaSitesRequest,\n ListUsersGroupsByMetaSitesResponse,\n ListUsersGroupsRequest,\n ListUsersGroupsResponse,\n ListUsersPermissionsRequest,\n ListUsersPermissionsResponse,\n ListUsersRequest,\n ListUsersResponse,\n Membership,\n MessageEnvelope,\n Permission,\n RemovePermissionsFromUserRequest,\n RemovePermissionsRequest,\n RemovePermissionsResponse,\n RemoveUserFromGroupsRequest,\n RemoveUserFromGroupsResponse,\n RemoveUsersRequest,\n RemoveUsersResponse,\n RestoreInfo,\n SiteUser,\n UpdateRequest,\n UpdateResponse,\n UpdateUserMembershipDatesRequest,\n UpdateUserMembershipDatesResponse,\n UserPermissions,\n UserWithTenant,\n WebhookIdentityType,\n} from './identity-members-groups-v1-group-info-roles.universal.js';\n","import { listGroupsByResource as publicListGroupsByResource } from './identity-members-groups-v1-group-info-roles.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const listGroupsByResource: MaybeContext<\n BuildRESTFunction<typeof publicListGroupsByResource> &\n typeof publicListGroupsByResource\n> = /*#__PURE__*/ createRESTModule(publicListGroupsByResource);\n\nexport {\n Color,\n GroupTypeFilter,\n WebhookIdentityType,\n} from './identity-members-groups-v1-group-info-roles.universal.js';\nexport {\n GroupInfo,\n GetCurrentUserGroupsRequest,\n GetCurrentUserGroupsResponse,\n ListRequest,\n ListRequestListFilterOneOf,\n GroupsFilter,\n ListResponse,\n ListGroupsByResourceRequest,\n CursorPaging,\n ListGroupsByResourceResponse,\n CursorPagingMetadata,\n Cursors,\n GroupsCountRequest,\n GroupsCountResponse,\n GetRequest,\n GetResponse,\n CreateRequest,\n CreateResponse,\n UpdateRequest,\n UpdateResponse,\n DeleteRequest,\n DeleteResponse,\n ListUsersGroupsRequest,\n ListUsersGroupsResponse,\n Groups,\n GroupsData,\n GroupData,\n ListUsersGroupsByMetaSitesRequest,\n SiteUser,\n ListUsersGroupsByMetaSitesResponse,\n ListUsersRequest,\n ListUsersResponse,\n AssignUsersRequest,\n AssignUsersResponse,\n RemoveUsersRequest,\n RemoveUsersResponse,\n ListUserMembershipsRequest,\n ListUserMembershipsResponse,\n Membership,\n RemoveUserFromGroupsRequest,\n RemoveUserFromGroupsResponse,\n UpdateUserMembershipDatesRequest,\n UpdateUserMembershipDatesResponse,\n ListPermissionsRequest,\n ListPermissionsResponse,\n Permission,\n ListGroupsPermissionsRequest,\n ListGroupsPermissionsResponse,\n GroupPermissions,\n ListUsersPermissionsRequest,\n UserWithTenant,\n ListUsersPermissionsResponse,\n UserPermissions,\n AssignPermissionsRequest,\n AssignPermissionsResponse,\n RemovePermissionsRequest,\n RemovePermissionsResponse,\n AssignPermissionsToUserRequest,\n RemovePermissionsFromUserRequest,\n CopyPermissionsRequest,\n CopyPermissionsResponse,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n MessageEnvelope,\n IdentificationData,\n IdentificationDataIdOneOf,\n AccountInfo,\n ListGroupsByResourceOptions,\n} from './identity-members-groups-v1-group-info-roles.universal.js';\nexport {\n ColorWithLiterals,\n GroupTypeFilterWithLiterals,\n WebhookIdentityTypeWithLiterals,\n} from './identity-members-groups-v1-group-info-roles.universal.js';\n"],"mappings":"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","names":["listGroupsByResource","import_rest_modules","payload","Color","GroupTypeFilter","WebhookIdentityType","listGroupsByResource","sdkTransformError","listGroupsByResource","import_rest_modules","listGroupsByResource"]}
|