@wix/auto_sdk_data_permissions 1.0.21 → 1.0.22
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 +9 -9
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +45 -29
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +30 -18
- package/build/cjs/meta.js.map +1 -1
- package/build/es/index.d.mts +9 -9
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +45 -29
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +30 -18
- package/build/es/meta.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +9 -9
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +45 -29
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +30 -18
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/es/index.d.mts +9 -9
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +45 -29
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +30 -18
- package/build/internal/es/meta.mjs.map +1 -1
- package/package.json +2 -2
package/build/cjs/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ declare function getPermissions$1(httpClient: HttpClient): GetPermissionsSignatu
|
|
|
7
7
|
interface GetPermissionsSignature {
|
|
8
8
|
/**
|
|
9
9
|
* Retrieves the current permissions configuration for a data collection.
|
|
10
|
-
* @param - ID of the
|
|
10
|
+
* @param - ID of the collection to retrieve permissions of.
|
|
11
11
|
*/
|
|
12
12
|
(dataCollectionId: string): Promise<NonNullablePaths<GetPermissionsResponse, {
|
|
13
13
|
[P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;
|
|
@@ -18,7 +18,7 @@ interface GetPermissionsSignature {
|
|
|
18
18
|
declare function updatePermissions$1(httpClient: HttpClient): UpdatePermissionsSignature;
|
|
19
19
|
interface UpdatePermissionsSignature {
|
|
20
20
|
/**
|
|
21
|
-
* Updates permissions
|
|
21
|
+
* Updates permissions for the specified data collection.
|
|
22
22
|
*
|
|
23
23
|
* > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).
|
|
24
24
|
* @param - Permissions to update.
|
|
@@ -34,8 +34,8 @@ interface AddSpecialPermissionsSignature {
|
|
|
34
34
|
/**
|
|
35
35
|
* Adds special permissions to a specific user or role for the specified data collection.
|
|
36
36
|
*
|
|
37
|
-
* Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection
|
|
38
|
-
* @param - ID of the
|
|
37
|
+
* Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).
|
|
38
|
+
* @param - ID of the collection for which to grant special permissions.
|
|
39
39
|
*/
|
|
40
40
|
(dataCollectionId: string, options: NonNullablePaths<AddSpecialPermissionsOptions, `specialPermissions`>): Promise<NonNullablePaths<AddSpecialPermissionsResponse, `specialPermissions.userId` | `specialPermissions.policyId` | `specialPermissions._id` | `specialPermissions.itemRead` | `specialPermissions.itemInsert` | `specialPermissions.itemUpdate` | `specialPermissions.itemRemove`> & {
|
|
41
41
|
__applicationErrorsType?: AddSpecialPermissionsApplicationErrors;
|
|
@@ -44,9 +44,9 @@ interface AddSpecialPermissionsSignature {
|
|
|
44
44
|
declare function updateSpecialPermissions$1(httpClient: HttpClient): UpdateSpecialPermissionsSignature;
|
|
45
45
|
interface UpdateSpecialPermissionsSignature {
|
|
46
46
|
/**
|
|
47
|
-
* Updates the special permissions for
|
|
47
|
+
* Updates the special permissions for the specified user or role.
|
|
48
48
|
*
|
|
49
|
-
* > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by
|
|
49
|
+
* > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).
|
|
50
50
|
* @param - ID of the special permissions.
|
|
51
51
|
*/
|
|
52
52
|
(_id: string, specialPermissions: UpdateSpecialPermissions): Promise<NonNullablePaths<UpdateSpecialPermissionsResponse, `specialPermissions.userId` | `specialPermissions.policyId` | `specialPermissions._id` | `specialPermissions.itemRead` | `specialPermissions.itemInsert` | `specialPermissions.itemUpdate` | `specialPermissions.itemRemove`> & {
|
|
@@ -58,7 +58,7 @@ interface RemoveSpecialPermissionsSignature {
|
|
|
58
58
|
/**
|
|
59
59
|
* Removes special permissions from a specific user or role.
|
|
60
60
|
*
|
|
61
|
-
*
|
|
61
|
+
* When special permissions are removed, the user or role is subject to collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)) for all actions.
|
|
62
62
|
* @param - ID of the special permissions to remove.
|
|
63
63
|
*/
|
|
64
64
|
(specialPermissionsId: string): Promise<void & {
|
|
@@ -68,8 +68,8 @@ interface RemoveSpecialPermissionsSignature {
|
|
|
68
68
|
declare function getMyPermissions$1(httpClient: HttpClient): GetMyPermissionsSignature;
|
|
69
69
|
interface GetMyPermissionsSignature {
|
|
70
70
|
/**
|
|
71
|
-
* Retrieves the current user's permissions for
|
|
72
|
-
* @param - ID of the
|
|
71
|
+
* Retrieves the current user's permissions for the specified data collection.
|
|
72
|
+
* @param - ID of the collection for which to check the current user's permissions.
|
|
73
73
|
*/
|
|
74
74
|
(dataCollectionId: string): Promise<NonNullablePaths<GetMyPermissionsResponse, `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`> & {
|
|
75
75
|
__applicationErrorsType?: GetMyPermissionsApplicationErrors;
|
package/build/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../src/data-v1-data-permissions-permissions.universal.ts","../../src/data-v1-data-permissions-permissions.http.ts","../../src/data-v1-data-permissions-permissions.public.ts","../../src/data-v1-data-permissions-permissions.context.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDataV1DataPermissions from './data-v1-data-permissions-permissions.http.js';\n\n/** Permissions configuration for a data collection. */\nexport interface DataPermissions {\n /**\n * ID of the data collection these permissions apply to.\n * @immutable\n * @maxLength 255\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessLevelWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessLevelWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessLevelWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessLevelWithLiterals;\n}\n\n/** Minimum access level required to perform an action on collection items. Each access level includes the permissions of lower restriction levels */\nexport enum AccessLevel {\n /** Access level is not set. */\n UNKNOWN = 'UNKNOWN',\n /** Any user, including site visitors ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-visitor) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-visitor)). */\n ANYONE = 'ANYONE',\n /** Logged-in users, including site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */\n SITE_MEMBER = 'SITE_MEMBER',\n /** Logged-in site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). Members can only access items they created. */\n SITE_MEMBER_AUTHOR = 'SITE_MEMBER_AUTHOR',\n /** Site [collaborators with a CMS role](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps) permissions. */\n CMS_EDITOR = 'CMS_EDITOR',\n /**\n * Site administrators, users, or roles with special permissions.\n *\n * Learn more about [roles for site management](https://support.wix.com/en/article/roles-permissions-overview#general-roles-for-site-management).\n */\n PRIVILEGED = 'PRIVILEGED',\n}\n\n/** @enumType */\nexport type AccessLevelWithLiterals =\n | AccessLevel\n | 'UNKNOWN'\n | 'ANYONE'\n | 'SITE_MEMBER'\n | 'SITE_MEMBER_AUTHOR'\n | 'CMS_EDITOR'\n | 'PRIVILEGED';\n\nexport interface SpecialPermissions extends SpecialPermissionsSubjectOneOf {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the policy or role to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n /**\n * ID of the special permissions.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessWithLiterals;\n}\n\n/** @oneof */\nexport interface SpecialPermissionsSubjectOneOf {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the policy or role to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n}\n\nexport enum Access {\n /** No special permissions are specified for this action. The collection's default access level applies. */\n UNSPECIFIED = 'UNSPECIFIED',\n /** Special permission is granted to perform this action. This overrides the collection's access level configuration. */\n ALLOWED = 'ALLOWED',\n}\n\n/** @enumType */\nexport type AccessWithLiterals = Access | 'UNSPECIFIED' | 'ALLOWED';\n\nexport interface GetPermissionsRequest {\n /**\n * ID of the data collection to retrieve permissions for.\n * @maxLength 256\n */\n dataCollectionId: string;\n}\n\nexport interface GetPermissionsResponse {\n /** Permissions for the specified collection. */\n dataPermissions?: DataPermissions;\n}\n\nexport interface UpdatePermissionsRequest {\n /** Permissions to update. */\n dataPermissions: DataPermissions;\n}\n\nexport interface UpdatePermissionsResponse {\n /** Updated permissions for the specified collection. */\n dataPermissions?: DataPermissions;\n}\n\nexport interface AddSpecialPermissionsRequest {\n /**\n * ID of the data collection to grant special permissions for.\n * @maxLength 256\n */\n dataCollectionId: string;\n /** Special permissions to add to the user or role. */\n specialPermissions: SpecialPermissions;\n}\n\nexport interface AddSpecialPermissionsResponse {\n /** Special permissions added to the user or role. */\n specialPermissions?: SpecialPermissions;\n}\n\nexport interface UpdateSpecialPermissionsRequest {\n /** Special permissions to update. */\n specialPermissions: SpecialPermissions;\n}\n\nexport interface UpdateSpecialPermissionsResponse {\n /** Updated special permissions for the specified user or role. */\n specialPermissions?: SpecialPermissions;\n}\n\nexport interface RemoveSpecialPermissionsRequest {\n /**\n * ID of the special permissions to remove.\n * @format GUID\n */\n specialPermissionsId: string;\n}\n\nexport interface RemoveSpecialPermissionsResponse {}\n\nexport interface GetMyPermissionsRequest {\n /**\n * ID of the data collection to check permissions for.\n * @maxLength 256\n */\n dataCollectionId: string;\n}\n\nexport interface GetMyPermissionsResponse {\n /** Whether the current user can read items from the collection. */\n itemRead?: boolean;\n /** Whether the current user can create new items in the collection. */\n itemInsert?: boolean;\n /** Whether the current user can update existing items in the collection. */\n itemUpdate?: boolean;\n /** Whether the current user can remove items from the collection. */\n itemRemove?: boolean;\n}\n\nexport interface MigrateCustomRolesRequest {\n /**\n * ID of the role to update. If empty, all roles in the site are updated.\n * @format GUID\n */\n policyId?: string | null;\n}\n\nexport interface MigrateCustomRolesResponse {}\n\nexport interface PolicyAssignmentsUpdated\n extends PolicyAssignmentsUpdatedEventOneOf {\n policyAssigned?: PolicyAssigned;\n policyUnassigned?: PolicyUnassigned;\n policyAssignmentUpdated?: PolicyAssignmentUpdated;\n}\n\n/** @oneof */\nexport interface PolicyAssignmentsUpdatedEventOneOf {\n policyAssigned?: PolicyAssigned;\n policyUnassigned?: PolicyUnassigned;\n policyAssignmentUpdated?: PolicyAssignmentUpdated;\n}\n\nexport interface PolicyAssigned {\n subject?: Subject;\n assignment?: PolicyAssignment[];\n}\n\nexport interface Subject {\n /** ID of identity assigned to the asset. */\n _id?: string;\n /** Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs. */\n subjectType?: SubjectTypeWithLiterals;\n /** Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`. */\n context?: SubjectContext;\n}\n\nexport enum SubjectType {\n UNKNOWN = 'UNKNOWN',\n ACCOUNT = 'ACCOUNT',\n USER = 'USER',\n USER_GROUP = 'USER_GROUP',\n MEMBER_GROUP = 'MEMBER_GROUP',\n VISITOR_GROUP = 'VISITOR_GROUP',\n EXTERNAL_APP = 'EXTERNAL_APP',\n ACCOUNT_GROUP = 'ACCOUNT_GROUP',\n WIX_APP = 'WIX_APP',\n}\n\n/** @enumType */\nexport type SubjectTypeWithLiterals =\n | SubjectType\n | 'UNKNOWN'\n | 'ACCOUNT'\n | 'USER'\n | 'USER_GROUP'\n | 'MEMBER_GROUP'\n | 'VISITOR_GROUP'\n | 'EXTERNAL_APP'\n | 'ACCOUNT_GROUP'\n | 'WIX_APP';\n\nexport interface SubjectContext {\n _id?: string;\n contextType?: SubjectContextTypeWithLiterals;\n}\n\nexport enum SubjectContextType {\n UNKNOWN_CTX = 'UNKNOWN_CTX',\n ORG_CTX = 'ORG_CTX',\n ACCOUNT_CTX = 'ACCOUNT_CTX',\n}\n\n/** @enumType */\nexport type SubjectContextTypeWithLiterals =\n | SubjectContextType\n | 'UNKNOWN_CTX'\n | 'ORG_CTX'\n | 'ACCOUNT_CTX';\n\nexport interface PolicyAssignment {\n policyId?: string;\n resource?: ResourcePath;\n condition?: PolicyCondition;\n assignmentId?: string | null;\n}\n\nexport interface ResourcePath {\n organization?: string | null;\n account?: string | null;\n site?: string | null;\n resource?: Resource;\n}\n\n/**\n * A custom resource. Is used to represent some asset that is not a direct resource context (site or account), but something custom.\n * For example: payment method, blog post, domain, logo.\n */\nexport interface Resource {\n /** The resource id. */\n _id?: string | null;\n /** The resource type */\n type?: string | null;\n}\n\nexport interface PolicyCondition {\n /** The type of the condition */\n condition?: ConditionType;\n}\n\nexport interface ConditionType extends ConditionTypeOfOneOf {\n /** @deprecated */\n simpleCondition?: SimpleCondition;\n /** A logic combination between several conditions, with an operator between them */\n joinedConditions?: JoinedCondition;\n /** @deprecated */\n environmentCondition?: EnvironmentCondition;\n /** A single condition */\n condition?: Condition;\n}\n\n/** @oneof */\nexport interface ConditionTypeOfOneOf {\n /** @deprecated */\n simpleCondition?: SimpleCondition;\n /** A logic combination between several conditions, with an operator between them */\n joinedConditions?: JoinedCondition;\n /** @deprecated */\n environmentCondition?: EnvironmentCondition;\n /** A single condition */\n condition?: Condition;\n}\n\nexport interface SimpleCondition {\n attrName?: string;\n value?: SimpleConditionValue;\n op?: SimpleConditionOperatorWithLiterals;\n conditionModelId?: string;\n}\n\nexport interface SimpleConditionValue extends SimpleConditionValueValueOneOf {\n attrName?: string;\n stringValue?: string;\n boolValue?: boolean;\n}\n\n/** @oneof */\nexport interface SimpleConditionValueValueOneOf {\n attrName?: string;\n stringValue?: string;\n boolValue?: boolean;\n}\n\nexport enum SimpleConditionOperator {\n UNKNOWN_SIMPLE_OP = 'UNKNOWN_SIMPLE_OP',\n EQUAL = 'EQUAL',\n}\n\n/** @enumType */\nexport type SimpleConditionOperatorWithLiterals =\n | SimpleConditionOperator\n | 'UNKNOWN_SIMPLE_OP'\n | 'EQUAL';\n\nexport interface JoinedCondition {\n /** The operator that should be used when evaluating the condition */\n op?: JoinedConditionOperatorWithLiterals;\n /** The conditions that should be evaluated, and then joined using the operator provided */\n conditions?: ConditionType[];\n}\n\nexport enum JoinedConditionOperator {\n UNKNOWN_JOIN_OP = 'UNKNOWN_JOIN_OP',\n OR = 'OR',\n AND = 'AND',\n}\n\n/** @enumType */\nexport type JoinedConditionOperatorWithLiterals =\n | JoinedConditionOperator\n | 'UNKNOWN_JOIN_OP'\n | 'OR'\n | 'AND';\n\nexport interface EnvironmentCondition\n extends EnvironmentConditionConditionOneOf {\n experimentCondition?: ExperimentCondition;\n}\n\n/** @oneof */\nexport interface EnvironmentConditionConditionOneOf {\n experimentCondition?: ExperimentCondition;\n}\n\nexport interface ExperimentCondition {\n spec?: string;\n fallbackValue?: string;\n expectedValue?: string;\n}\n\nexport interface Condition {\n /** The unique identifier of the condition model. Indicates which actions the condition is working on */\n conditionModelId?: string;\n /** The operator that should be evaluated */\n operator?: ConditionOperator;\n}\n\nexport interface ConditionOperator extends ConditionOperatorOperatorsOneOf {\n /** Comparison of equality - will be evaluated to true if the given parties are equal */\n equals?: EqualOperator;\n /** Regex operator - will be evaluated to true if the given value matches the provided regex */\n like?: LikeOperator;\n /** Petri experiment - will be evaluated using petri. */\n experiment?: ExperimentOperator;\n /** Operator that indicates a dependency on another subject being allowed to perform something. */\n dependOn?: DependOnOperator;\n}\n\n/** @oneof */\nexport interface ConditionOperatorOperatorsOneOf {\n /** Comparison of equality - will be evaluated to true if the given parties are equal */\n equals?: EqualOperator;\n /** Regex operator - will be evaluated to true if the given value matches the provided regex */\n like?: LikeOperator;\n /** Petri experiment - will be evaluated using petri. */\n experiment?: ExperimentOperator;\n /** Operator that indicates a dependency on another subject being allowed to perform something. */\n dependOn?: DependOnOperator;\n}\n\nexport interface EqualOperator {\n /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the other side (attribute/value) */\n attrName?: string;\n /** The value to compare to. If the two parties are equal - we will return true. */\n value?: ConditionValue;\n}\n\nexport interface ConditionValue extends ConditionValueValueOneOf {\n /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */\n attrName?: string;\n /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */\n stringValue?: string;\n /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */\n boolValue?: boolean;\n}\n\n/** @oneof */\nexport interface ConditionValueValueOneOf {\n /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */\n attrName?: string;\n /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */\n stringValue?: string;\n /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */\n boolValue?: boolean;\n}\n\nexport interface LikeOperator {\n /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the regex values provided. */\n attrName?: string;\n /** The regex values which the attribute value should be evaluated on. If the attribute value matches at least one of the regular expressions provided - we will return true */\n values?: string[];\n}\n\nexport interface ExperimentOperator {\n /** The spec to conduct the experiment on. */\n spec?: string;\n /** The value to use if the experiment could not be conducted */\n fallbackValue?: string;\n /** The expected value of the experiment conduction. If it matches the actual value - true will be returned. Otherwise - false. */\n expectedValue?: string;\n}\n\n/** Implies that the policy takes affect only if the depend on subject is permitted as well. */\nexport interface DependOnOperator {\n /** The subject on which the current entry depends on. If the subject is allowed to perform what the query was about - the condition will be evaluated to true. Otherwise - false */\n dependOnSubject?: Subject;\n}\n\nexport interface PolicyUnassigned {\n subject?: Subject;\n assignment?: PolicyAssignment[];\n}\n\nexport interface PolicyAssignmentUpdated {\n subject?: Subject;\n fromAssignment?: PolicyAssignment[];\n toAssignment?: PolicyAssignment[];\n}\n\nexport interface Empty {}\n\nexport interface PolicyAuthorizationDataUpdated {\n policyId?: string;\n fromPolicyStatements?: PolicyStatement[];\n toPolicyStatements?: PolicyStatement[];\n policyType?: PolicyTypeWithLiterals;\n policyOwner?: PolicyOwner;\n}\n\nexport interface PolicyStatement {\n /** @readonly */\n _id?: string | null;\n permissions?: string[];\n scopes?: string[];\n effect?: EffectWithLiterals;\n condition?: PolicyCondition;\n}\n\nexport enum Effect {\n UNKNOWN_EFFECT = 'UNKNOWN_EFFECT',\n ALLOW = 'ALLOW',\n DENY = 'DENY',\n}\n\n/** @enumType */\nexport type EffectWithLiterals = Effect | 'UNKNOWN_EFFECT' | 'ALLOW' | 'DENY';\n\nexport enum PolicyType {\n UNKNOWN_STATUS = 'UNKNOWN_STATUS',\n PREDEFINED = 'PREDEFINED',\n CUSTOM = 'CUSTOM',\n INLINE_CUSTOM = 'INLINE_CUSTOM',\n}\n\n/** @enumType */\nexport type PolicyTypeWithLiterals =\n | PolicyType\n | 'UNKNOWN_STATUS'\n | 'PREDEFINED'\n | 'CUSTOM'\n | 'INLINE_CUSTOM';\n\nexport interface PolicyOwner {\n type?: PolicyOwnerTypeWithLiterals;\n _id?: string;\n}\n\nexport enum PolicyOwnerType {\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n WIX = 'WIX',\n WIX_ACCOUNT = 'WIX_ACCOUNT',\n}\n\n/** @enumType */\nexport type PolicyOwnerTypeWithLiterals =\n | PolicyOwnerType\n | 'UNKNOWN_TYPE'\n | 'WIX'\n | 'WIX_ACCOUNT';\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 type GetPermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\nexport type UpdatePermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\nexport type AddSpecialPermissionsApplicationErrors = {\n code?: 'ALREADY_EXISTS';\n description?: string;\n data?: Record<string, any>;\n};\nexport type UpdateSpecialPermissionsApplicationErrors = {\n code?: 'NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\nexport type RemoveSpecialPermissionsApplicationErrors = {\n code?: 'NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\nexport type GetMyPermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\n\ntype DataPermissionsNonNullablePaths =\n | `_id`\n | `itemRead`\n | `itemInsert`\n | `itemUpdate`\n | `itemRemove`;\n\n/**\n * Retrieves the current permissions configuration for a data collection.\n * @param dataCollectionId - ID of the data collection to retrieve permissions for.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @permissionId WIX_DATA.PERMISSIONS_READ\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetPermissions\n */\nexport async function getPermissions(dataCollectionId: string): Promise<\n NonNullablePaths<\n GetPermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: GetPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataCollectionId: dataCollectionId,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.getPermissions(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: { dataCollectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates permissions configuration for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n * @param dataPermissions - Permissions to update.\n * @public\n * @documentationMaturity preview\n * @requiredField dataPermissions\n * @requiredField dataPermissions._id\n * @requiredField dataPermissions.itemInsert\n * @requiredField dataPermissions.itemRead\n * @requiredField dataPermissions.itemRemove\n * @requiredField dataPermissions.itemUpdate\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions\n */\nexport async function updatePermissions(\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n): Promise<\n NonNullablePaths<\n UpdatePermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: UpdatePermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataPermissions: dataPermissions,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.updatePermissions(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: { dataPermissions: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataPermissions']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection's access levels ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param dataCollectionId - ID of the data collection to grant special permissions for.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @requiredField options\n * @requiredField options.specialPermissions\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions\n */\nexport async function addSpecialPermissions(\n dataCollectionId: string,\n options: NonNullablePaths<AddSpecialPermissionsOptions, `specialPermissions`>\n): Promise<\n NonNullablePaths<\n AddSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: AddSpecialPermissionsApplicationErrors;\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 dataCollectionId: dataCollectionId,\n specialPermissions: options?.specialPermissions,\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.addSpecialPermissions(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 dataCollectionId: '$[0]',\n specialPermissions: '$[1].specialPermissions',\n },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface AddSpecialPermissionsOptions {\n /** Special permissions to add to the user or role. */\n specialPermissions: SpecialPermissions;\n}\n\n/**\n * Updates the special permissions for a specific user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by the collection's general access levels.\n * @param _id - ID of the special permissions.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField specialPermissions\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions\n */\nexport async function updateSpecialPermissions(\n _id: string,\n specialPermissions: UpdateSpecialPermissions\n): Promise<\n NonNullablePaths<\n UpdateSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: UpdateSpecialPermissionsApplicationErrors;\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 specialPermissions: { ...specialPermissions, id: _id },\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.updateSpecialPermissions(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: { specialPermissions: '$[1]' },\n explicitPathsToArguments: { 'specialPermissions.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'specialPermissions']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateSpecialPermissions {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the policy or role to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n /**\n * ID of the special permissions.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessWithLiterals;\n}\n\n/**\n * Removes special permissions from a specific user or role.\n *\n * After special permissions are removed, the user or role is subject to the collection's general access levels for all actions.\n * @param specialPermissionsId - ID of the special permissions to remove.\n * @public\n * @documentationMaturity preview\n * @requiredField specialPermissionsId\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions\n */\nexport async function removeSpecialPermissions(\n specialPermissionsId: string\n): Promise<\n void & {\n __applicationErrorsType?: RemoveSpecialPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n specialPermissionsId: specialPermissionsId,\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.removeSpecialPermissions(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: { specialPermissionsId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['specialPermissionsId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves the current user's permissions for a data collection.\n * @param dataCollectionId - ID of the data collection to check permissions for.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @permissionId WIX_DATA.PERMISSIONS_GET_ALLOWED\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions\n */\nexport async function getMyPermissions(dataCollectionId: string): Promise<\n NonNullablePaths<\n GetMyPermissionsResponse,\n `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`\n > & {\n __applicationErrorsType?: GetMyPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataCollectionId: dataCollectionId,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.getMyPermissions(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: { dataCollectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCloudPermissionsV1DataPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wix-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n _: [\n {\n srcPath: '/_api/data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_data_permissions';\n\n/** Retrieves the current permissions configuration for a data collection. */\nexport function getPermissions(payload: object): RequestOptionsFactory<any> {\n function __getPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'GET' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.GetPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getPermissions;\n}\n\n/**\n * Updates permissions configuration for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n */\nexport function updatePermissions(payload: object): RequestOptionsFactory<any> {\n function __updatePermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updatePermissions;\n}\n\n/**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection's access levels ([SDK](ADDLINK) | [REST](ADDLINK)).\n */\nexport function addSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __addSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __addSpecialPermissions;\n}\n\n/**\n * Updates the special permissions for a specific user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by the collection's general access levels.\n */\nexport function updateSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special/{specialPermissions.id}',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateSpecialPermissions;\n}\n\n/**\n * Removes special permissions from a specific user or role.\n *\n * After special permissions are removed, the user or role is subject to the collection's general access levels for all actions.\n */\nexport function removeSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __removeSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special/{specialPermissionsId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __removeSpecialPermissions;\n}\n\n/** Retrieves the current user's permissions for a data collection. */\nexport function getMyPermissions(payload: object): RequestOptionsFactory<any> {\n function __getMyPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'GET' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/current',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getMyPermissions;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AddSpecialPermissionsApplicationErrors,\n AddSpecialPermissionsOptions,\n AddSpecialPermissionsResponse,\n DataPermissions,\n GetMyPermissionsApplicationErrors,\n GetMyPermissionsResponse,\n GetPermissionsApplicationErrors,\n GetPermissionsResponse,\n RemoveSpecialPermissionsApplicationErrors,\n UpdatePermissionsApplicationErrors,\n UpdatePermissionsResponse,\n UpdateSpecialPermissions,\n UpdateSpecialPermissionsApplicationErrors,\n UpdateSpecialPermissionsResponse,\n addSpecialPermissions as universalAddSpecialPermissions,\n getMyPermissions as universalGetMyPermissions,\n getPermissions as universalGetPermissions,\n removeSpecialPermissions as universalRemoveSpecialPermissions,\n updatePermissions as universalUpdatePermissions,\n updateSpecialPermissions as universalUpdateSpecialPermissions,\n} from './data-v1-data-permissions-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/data' };\n\ntype DataPermissionsNonNullablePaths =\n | `_id`\n | `itemRead`\n | `itemInsert`\n | `itemUpdate`\n | `itemRemove`;\n\nexport function getPermissions(\n httpClient: HttpClient\n): GetPermissionsSignature {\n return (dataCollectionId: string) =>\n universalGetPermissions(\n dataCollectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetPermissionsSignature {\n /**\n * Retrieves the current permissions configuration for a data collection.\n * @param - ID of the data collection to retrieve permissions for.\n */\n (dataCollectionId: string): Promise<\n NonNullablePaths<\n GetPermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: GetPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function updatePermissions(\n httpClient: HttpClient\n): UpdatePermissionsSignature {\n return (\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n ) =>\n universalUpdatePermissions(\n dataPermissions,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdatePermissionsSignature {\n /**\n * Updates permissions configuration for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n * @param - Permissions to update.\n */\n (\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n ): Promise<\n NonNullablePaths<\n UpdatePermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: UpdatePermissionsApplicationErrors;\n }\n >;\n}\n\nexport function addSpecialPermissions(\n httpClient: HttpClient\n): AddSpecialPermissionsSignature {\n return (\n dataCollectionId: string,\n options: NonNullablePaths<\n AddSpecialPermissionsOptions,\n `specialPermissions`\n >\n ) =>\n universalAddSpecialPermissions(\n dataCollectionId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface AddSpecialPermissionsSignature {\n /**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection's access levels ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param - ID of the data collection to grant special permissions for.\n */\n (\n dataCollectionId: string,\n options: NonNullablePaths<\n AddSpecialPermissionsOptions,\n `specialPermissions`\n >\n ): Promise<\n NonNullablePaths<\n AddSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: AddSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function updateSpecialPermissions(\n httpClient: HttpClient\n): UpdateSpecialPermissionsSignature {\n return (_id: string, specialPermissions: UpdateSpecialPermissions) =>\n universalUpdateSpecialPermissions(\n _id,\n specialPermissions,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateSpecialPermissionsSignature {\n /**\n * Updates the special permissions for a specific user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by the collection's general access levels.\n * @param - ID of the special permissions.\n */\n (_id: string, specialPermissions: UpdateSpecialPermissions): Promise<\n NonNullablePaths<\n UpdateSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: UpdateSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function removeSpecialPermissions(\n httpClient: HttpClient\n): RemoveSpecialPermissionsSignature {\n return (specialPermissionsId: string) =>\n universalRemoveSpecialPermissions(\n specialPermissionsId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RemoveSpecialPermissionsSignature {\n /**\n * Removes special permissions from a specific user or role.\n *\n * After special permissions are removed, the user or role is subject to the collection's general access levels for all actions.\n * @param - ID of the special permissions to remove.\n */\n (specialPermissionsId: string): Promise<\n void & {\n __applicationErrorsType?: RemoveSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function getMyPermissions(\n httpClient: HttpClient\n): GetMyPermissionsSignature {\n return (dataCollectionId: string) =>\n universalGetMyPermissions(\n dataCollectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetMyPermissionsSignature {\n /**\n * Retrieves the current user's permissions for a data collection.\n * @param - ID of the data collection to check permissions for.\n */\n (dataCollectionId: string): Promise<\n NonNullablePaths<\n GetMyPermissionsResponse,\n `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`\n > & {\n __applicationErrorsType?: GetMyPermissionsApplicationErrors;\n }\n >;\n}\n\nexport {\n Access,\n AccessLevel,\n ActionEvent,\n AddSpecialPermissionsOptions,\n AddSpecialPermissionsRequest,\n AddSpecialPermissionsResponse,\n Condition,\n ConditionOperator,\n ConditionOperatorOperatorsOneOf,\n ConditionType,\n ConditionTypeOfOneOf,\n ConditionValue,\n ConditionValueValueOneOf,\n DataPermissions,\n DependOnOperator,\n DomainEvent,\n DomainEventBodyOneOf,\n Effect,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EnvironmentCondition,\n EnvironmentConditionConditionOneOf,\n EqualOperator,\n ExperimentCondition,\n ExperimentOperator,\n GetMyPermissionsRequest,\n GetMyPermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n JoinedCondition,\n JoinedConditionOperator,\n LikeOperator,\n MigrateCustomRolesRequest,\n MigrateCustomRolesResponse,\n PolicyAssigned,\n PolicyAssignment,\n PolicyAssignmentUpdated,\n PolicyAssignmentsUpdated,\n PolicyAssignmentsUpdatedEventOneOf,\n PolicyAuthorizationDataUpdated,\n PolicyCondition,\n PolicyOwner,\n PolicyOwnerType,\n PolicyStatement,\n PolicyType,\n PolicyUnassigned,\n RemoveSpecialPermissionsRequest,\n RemoveSpecialPermissionsResponse,\n Resource,\n ResourcePath,\n RestoreInfo,\n SimpleCondition,\n SimpleConditionOperator,\n SimpleConditionValue,\n SimpleConditionValueValueOneOf,\n SpecialPermissions,\n SpecialPermissionsSubjectOneOf,\n Subject,\n SubjectContext,\n SubjectContextType,\n SubjectType,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n UpdateSpecialPermissions,\n UpdateSpecialPermissionsRequest,\n UpdateSpecialPermissionsResponse,\n} from './data-v1-data-permissions-permissions.universal.js';\n","import {\n getPermissions as publicGetPermissions,\n updatePermissions as publicUpdatePermissions,\n addSpecialPermissions as publicAddSpecialPermissions,\n updateSpecialPermissions as publicUpdateSpecialPermissions,\n removeSpecialPermissions as publicRemoveSpecialPermissions,\n getMyPermissions as publicGetMyPermissions,\n} from './data-v1-data-permissions-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getPermissions: MaybeContext<\n BuildRESTFunction<typeof publicGetPermissions> & typeof publicGetPermissions\n> = /*#__PURE__*/ createRESTModule(publicGetPermissions);\nexport const updatePermissions: MaybeContext<\n BuildRESTFunction<typeof publicUpdatePermissions> &\n typeof publicUpdatePermissions\n> = /*#__PURE__*/ createRESTModule(publicUpdatePermissions);\nexport const addSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicAddSpecialPermissions> &\n typeof publicAddSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicAddSpecialPermissions);\nexport const updateSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicUpdateSpecialPermissions> &\n typeof publicUpdateSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicUpdateSpecialPermissions);\nexport const removeSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicRemoveSpecialPermissions> &\n typeof publicRemoveSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicRemoveSpecialPermissions);\nexport const getMyPermissions: MaybeContext<\n BuildRESTFunction<typeof publicGetMyPermissions> &\n typeof publicGetMyPermissions\n> = /*#__PURE__*/ createRESTModule(publicGetMyPermissions);\n\nexport {\n AccessLevel,\n Access,\n SubjectType,\n SubjectContextType,\n SimpleConditionOperator,\n JoinedConditionOperator,\n Effect,\n PolicyType,\n PolicyOwnerType,\n} from './data-v1-data-permissions-permissions.universal.js';\nexport {\n DataPermissions,\n SpecialPermissions,\n SpecialPermissionsSubjectOneOf,\n GetPermissionsRequest,\n GetPermissionsResponse,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n AddSpecialPermissionsRequest,\n AddSpecialPermissionsResponse,\n UpdateSpecialPermissionsRequest,\n UpdateSpecialPermissionsResponse,\n RemoveSpecialPermissionsRequest,\n RemoveSpecialPermissionsResponse,\n GetMyPermissionsRequest,\n GetMyPermissionsResponse,\n MigrateCustomRolesRequest,\n MigrateCustomRolesResponse,\n PolicyAssignmentsUpdated,\n PolicyAssignmentsUpdatedEventOneOf,\n PolicyAssigned,\n Subject,\n SubjectContext,\n PolicyAssignment,\n ResourcePath,\n Resource,\n PolicyCondition,\n ConditionType,\n ConditionTypeOfOneOf,\n SimpleCondition,\n SimpleConditionValue,\n SimpleConditionValueValueOneOf,\n JoinedCondition,\n EnvironmentCondition,\n EnvironmentConditionConditionOneOf,\n ExperimentCondition,\n Condition,\n ConditionOperator,\n ConditionOperatorOperatorsOneOf,\n EqualOperator,\n ConditionValue,\n ConditionValueValueOneOf,\n LikeOperator,\n ExperimentOperator,\n DependOnOperator,\n PolicyUnassigned,\n PolicyAssignmentUpdated,\n Empty,\n PolicyAuthorizationDataUpdated,\n PolicyStatement,\n PolicyOwner,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n AddSpecialPermissionsOptions,\n UpdateSpecialPermissions,\n} from './data-v1-data-permissions-permissions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,wBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,gCAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,6BAAoD;AACpD,oCAGO;;;ACJP,0BAAkC;AAClC,IAAAC,uBAA2B;AAI3B,SAAS,sDACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,wBAAwB;AAAA,MACtB;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,wBAAwB;AAAA,MACtB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,sBAAsB;AAAA,MACpB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,GAAG;AAAA,MACD;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EAC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KAAa,uBACnBA;AAAA,IACE;AAAA,IACA;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAyBO,SAASC,0BACd,YACmC;AACnC,SAAO,CAAC,yBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;AAgBO,SAASC,kBACd,YAC2B;AAC3B,SAAO,CAAC,qBACNA;AAAA,IACE;AAAA;AAAA,IAEA,EAAE,WAAW;AAAA,EACf;AACJ;;;ACjNA,IAAAC,uBAAiC;AAG1B,IAAMC,kBAEK,2DAAiBA,eAAoB;AAChD,IAAMC,qBAGK,2DAAiBA,kBAAuB;AACnD,IAAMC,yBAGK,2DAAiBA,sBAA2B;AACvD,IAAMC,4BAGK,2DAAiBA,yBAA8B;AAC1D,IAAMC,4BAGK,2DAAiBA,yBAA8B;AAC1D,IAAMC,oBAGK,2DAAiBA,iBAAsB;","names":["addSpecialPermissions","getMyPermissions","getPermissions","removeSpecialPermissions","updatePermissions","updateSpecialPermissions","import_rest_modules","AccessLevel","Access","SubjectType","SubjectContextType","SimpleConditionOperator","JoinedConditionOperator","Effect","PolicyType","PolicyOwnerType","getPermissions","sdkTransformError","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions","import_rest_modules","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions"]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/data-v1-data-permissions-permissions.universal.ts","../../src/data-v1-data-permissions-permissions.http.ts","../../src/data-v1-data-permissions-permissions.public.ts","../../src/data-v1-data-permissions-permissions.context.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.context.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as ambassadorWixDataV1DataPermissions from './data-v1-data-permissions-permissions.http.js';\n\n/** Permissions for a data collection. */\nexport interface DataPermissions {\n /**\n * ID of the collection to which these permissions apply.\n * @immutable\n * @maxLength 255\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessLevelWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessLevelWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessLevelWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessLevelWithLiterals;\n}\n\n/** Minimal access level required to perform an action on collection items. Each access level includes the permissions of the access levels below it. */\nexport enum AccessLevel {\n /** Access level is not set. */\n UNKNOWN = 'UNKNOWN',\n /** Any user, including site visitors ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-visitor) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-visitor)). */\n ANYONE = 'ANYONE',\n /** Logged-in users, including site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */\n SITE_MEMBER = 'SITE_MEMBER',\n /**\n * Logged-in site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).\n *\n * Members can only access items they created.\n */\n SITE_MEMBER_AUTHOR = 'SITE_MEMBER_AUTHOR',\n /** Site [collaborators with CMS roles](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps). */\n CMS_EDITOR = 'CMS_EDITOR',\n /**\n * Site administrators, users, or roles with special permissions.\n *\n * Learn more about [roles for site management](https://support.wix.com/en/article/roles-permissions-overview#general-roles-for-site-management).\n */\n PRIVILEGED = 'PRIVILEGED',\n}\n\n/** @enumType */\nexport type AccessLevelWithLiterals =\n | AccessLevel\n | 'UNKNOWN'\n | 'ANYONE'\n | 'SITE_MEMBER'\n | 'SITE_MEMBER_AUTHOR'\n | 'CMS_EDITOR'\n | 'PRIVILEGED';\n\nexport interface SpecialPermissions extends SpecialPermissionsSubjectOneOf {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.\n *\n * To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.\n *\n * Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n /**\n * ID of the special permissions.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessWithLiterals;\n}\n\n/** @oneof */\nexport interface SpecialPermissionsSubjectOneOf {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.\n *\n * To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.\n *\n * Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n}\n\nexport enum Access {\n /** No special permissions for this action. [Collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply for this action. */\n UNSPECIFIED = 'UNSPECIFIED',\n /** Special permission is granted to perform this action, overriding [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions). */\n ALLOWED = 'ALLOWED',\n}\n\n/** @enumType */\nexport type AccessWithLiterals = Access | 'UNSPECIFIED' | 'ALLOWED';\n\nexport interface GetPermissionsRequest {\n /**\n * ID of the collection to retrieve permissions of.\n * @maxLength 256\n */\n dataCollectionId: string;\n}\n\nexport interface GetPermissionsResponse {\n /** Permissions of the specified collection. */\n dataPermissions?: DataPermissions;\n}\n\nexport interface UpdatePermissionsRequest {\n /** Permissions to update. */\n dataPermissions: DataPermissions;\n}\n\nexport interface UpdatePermissionsResponse {\n /** Updated permissions of the specified collection. */\n dataPermissions?: DataPermissions;\n}\n\nexport interface AddSpecialPermissionsRequest {\n /**\n * ID of the collection for which to grant special permissions.\n * @maxLength 256\n */\n dataCollectionId: string;\n /** Special permissions to grant to the user or role for the specified collection. */\n specialPermissions: SpecialPermissions;\n}\n\nexport interface AddSpecialPermissionsResponse {\n /** Special permissions granted to the user or role for the specified collection. */\n specialPermissions?: SpecialPermissions;\n}\n\nexport interface UpdateSpecialPermissionsRequest {\n /** Special permissions to update for the specified user or role. */\n specialPermissions: SpecialPermissions;\n}\n\nexport interface UpdateSpecialPermissionsResponse {\n /** Special permissions updated for the specified user or role. */\n specialPermissions?: SpecialPermissions;\n}\n\nexport interface RemoveSpecialPermissionsRequest {\n /**\n * ID of the special permissions to remove.\n * @format GUID\n */\n specialPermissionsId: string;\n}\n\nexport interface RemoveSpecialPermissionsResponse {}\n\nexport interface GetMyPermissionsRequest {\n /**\n * ID of the collection for which to check the current user's permissions.\n * @maxLength 256\n */\n dataCollectionId: string;\n}\n\nexport interface GetMyPermissionsResponse {\n /** Whether the current user can read items from the collection. */\n itemRead?: boolean;\n /** Whether the current user can create new items in the collection. */\n itemInsert?: boolean;\n /** Whether the current user can update existing items in the collection. */\n itemUpdate?: boolean;\n /** Whether the current user can remove items from the collection. */\n itemRemove?: boolean;\n}\n\nexport interface MigrateCustomRolesRequest {\n /**\n * ID of the role to update. If empty, all roles in the site are updated.\n * @format GUID\n */\n policyId?: string | null;\n}\n\nexport interface MigrateCustomRolesResponse {}\n\nexport interface PolicyAssignmentsUpdated\n extends PolicyAssignmentsUpdatedEventOneOf {\n policyAssigned?: PolicyAssigned;\n policyUnassigned?: PolicyUnassigned;\n policyAssignmentUpdated?: PolicyAssignmentUpdated;\n}\n\n/** @oneof */\nexport interface PolicyAssignmentsUpdatedEventOneOf {\n policyAssigned?: PolicyAssigned;\n policyUnassigned?: PolicyUnassigned;\n policyAssignmentUpdated?: PolicyAssignmentUpdated;\n}\n\nexport interface PolicyAssigned {\n subject?: Subject;\n assignment?: PolicyAssignment[];\n}\n\nexport interface Subject {\n /** ID of identity assigned to the asset. */\n _id?: string;\n /** Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs. */\n subjectType?: SubjectTypeWithLiterals;\n /** Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`. */\n context?: SubjectContext;\n}\n\nexport enum SubjectType {\n UNKNOWN = 'UNKNOWN',\n ACCOUNT = 'ACCOUNT',\n USER = 'USER',\n USER_GROUP = 'USER_GROUP',\n MEMBER_GROUP = 'MEMBER_GROUP',\n VISITOR_GROUP = 'VISITOR_GROUP',\n EXTERNAL_APP = 'EXTERNAL_APP',\n ACCOUNT_GROUP = 'ACCOUNT_GROUP',\n WIX_APP = 'WIX_APP',\n}\n\n/** @enumType */\nexport type SubjectTypeWithLiterals =\n | SubjectType\n | 'UNKNOWN'\n | 'ACCOUNT'\n | 'USER'\n | 'USER_GROUP'\n | 'MEMBER_GROUP'\n | 'VISITOR_GROUP'\n | 'EXTERNAL_APP'\n | 'ACCOUNT_GROUP'\n | 'WIX_APP';\n\nexport interface SubjectContext {\n _id?: string;\n contextType?: SubjectContextTypeWithLiterals;\n}\n\nexport enum SubjectContextType {\n UNKNOWN_CTX = 'UNKNOWN_CTX',\n ORG_CTX = 'ORG_CTX',\n ACCOUNT_CTX = 'ACCOUNT_CTX',\n}\n\n/** @enumType */\nexport type SubjectContextTypeWithLiterals =\n | SubjectContextType\n | 'UNKNOWN_CTX'\n | 'ORG_CTX'\n | 'ACCOUNT_CTX';\n\nexport interface PolicyAssignment {\n policyId?: string;\n resource?: ResourcePath;\n condition?: PolicyCondition;\n assignmentId?: string | null;\n}\n\nexport interface ResourcePath {\n organization?: string | null;\n account?: string | null;\n site?: string | null;\n resource?: Resource;\n}\n\n/**\n * A custom resource. Is used to represent some asset that is not a direct resource context (site or account), but something custom.\n * For example: payment method, blog post, domain, logo.\n */\nexport interface Resource {\n /** The resource id. */\n _id?: string | null;\n /** The resource type */\n type?: string | null;\n}\n\nexport interface PolicyCondition {\n /** The type of the condition */\n condition?: ConditionType;\n}\n\nexport interface ConditionType extends ConditionTypeOfOneOf {\n /** @deprecated */\n simpleCondition?: SimpleCondition;\n /** A logic combination between several conditions, with an operator between them */\n joinedConditions?: JoinedCondition;\n /** @deprecated */\n environmentCondition?: EnvironmentCondition;\n /** A single condition */\n condition?: Condition;\n}\n\n/** @oneof */\nexport interface ConditionTypeOfOneOf {\n /** @deprecated */\n simpleCondition?: SimpleCondition;\n /** A logic combination between several conditions, with an operator between them */\n joinedConditions?: JoinedCondition;\n /** @deprecated */\n environmentCondition?: EnvironmentCondition;\n /** A single condition */\n condition?: Condition;\n}\n\nexport interface SimpleCondition {\n attrName?: string;\n value?: SimpleConditionValue;\n op?: SimpleConditionOperatorWithLiterals;\n conditionModelId?: string;\n}\n\nexport interface SimpleConditionValue extends SimpleConditionValueValueOneOf {\n attrName?: string;\n stringValue?: string;\n boolValue?: boolean;\n}\n\n/** @oneof */\nexport interface SimpleConditionValueValueOneOf {\n attrName?: string;\n stringValue?: string;\n boolValue?: boolean;\n}\n\nexport enum SimpleConditionOperator {\n UNKNOWN_SIMPLE_OP = 'UNKNOWN_SIMPLE_OP',\n EQUAL = 'EQUAL',\n}\n\n/** @enumType */\nexport type SimpleConditionOperatorWithLiterals =\n | SimpleConditionOperator\n | 'UNKNOWN_SIMPLE_OP'\n | 'EQUAL';\n\nexport interface JoinedCondition {\n /** The operator that should be used when evaluating the condition */\n op?: JoinedConditionOperatorWithLiterals;\n /** The conditions that should be evaluated, and then joined using the operator provided */\n conditions?: ConditionType[];\n}\n\nexport enum JoinedConditionOperator {\n UNKNOWN_JOIN_OP = 'UNKNOWN_JOIN_OP',\n OR = 'OR',\n AND = 'AND',\n}\n\n/** @enumType */\nexport type JoinedConditionOperatorWithLiterals =\n | JoinedConditionOperator\n | 'UNKNOWN_JOIN_OP'\n | 'OR'\n | 'AND';\n\nexport interface EnvironmentCondition\n extends EnvironmentConditionConditionOneOf {\n experimentCondition?: ExperimentCondition;\n}\n\n/** @oneof */\nexport interface EnvironmentConditionConditionOneOf {\n experimentCondition?: ExperimentCondition;\n}\n\nexport interface ExperimentCondition {\n spec?: string;\n fallbackValue?: string;\n expectedValue?: string;\n}\n\nexport interface Condition {\n /** The unique identifier of the condition model. Indicates which actions the condition is working on */\n conditionModelId?: string;\n /** The operator that should be evaluated */\n operator?: ConditionOperator;\n}\n\nexport interface ConditionOperator extends ConditionOperatorOperatorsOneOf {\n /** Comparison of equality - will be evaluated to true if the given parties are equal */\n equals?: EqualOperator;\n /** Regex operator - will be evaluated to true if the given value matches the provided regex */\n like?: LikeOperator;\n /** Petri experiment - will be evaluated using petri. */\n experiment?: ExperimentOperator;\n /** Operator that indicates a dependency on another subject being allowed to perform something. */\n dependOn?: DependOnOperator;\n}\n\n/** @oneof */\nexport interface ConditionOperatorOperatorsOneOf {\n /** Comparison of equality - will be evaluated to true if the given parties are equal */\n equals?: EqualOperator;\n /** Regex operator - will be evaluated to true if the given value matches the provided regex */\n like?: LikeOperator;\n /** Petri experiment - will be evaluated using petri. */\n experiment?: ExperimentOperator;\n /** Operator that indicates a dependency on another subject being allowed to perform something. */\n dependOn?: DependOnOperator;\n}\n\nexport interface EqualOperator {\n /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the other side (attribute/value) */\n attrName?: string;\n /** The value to compare to. If the two parties are equal - we will return true. */\n value?: ConditionValue;\n}\n\nexport interface ConditionValue extends ConditionValueValueOneOf {\n /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */\n attrName?: string;\n /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */\n stringValue?: string;\n /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */\n boolValue?: boolean;\n}\n\n/** @oneof */\nexport interface ConditionValueValueOneOf {\n /** an attribute. We'll first retrieve the value of the attribute (from the request or from pre-indexed values), and then compare to what it needs to be compared with. */\n attrName?: string;\n /** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */\n stringValue?: string;\n /** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */\n boolValue?: boolean;\n}\n\nexport interface LikeOperator {\n /** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the regex values provided. */\n attrName?: string;\n /** The regex values which the attribute value should be evaluated on. If the attribute value matches at least one of the regular expressions provided - we will return true */\n values?: string[];\n}\n\nexport interface ExperimentOperator {\n /** The spec to conduct the experiment on. */\n spec?: string;\n /** The value to use if the experiment could not be conducted */\n fallbackValue?: string;\n /** The expected value of the experiment conduction. If it matches the actual value - true will be returned. Otherwise - false. */\n expectedValue?: string;\n}\n\n/** Implies that the policy takes affect only if the depend on subject is permitted as well. */\nexport interface DependOnOperator {\n /** The subject on which the current entry depends on. If the subject is allowed to perform what the query was about - the condition will be evaluated to true. Otherwise - false */\n dependOnSubject?: Subject;\n}\n\nexport interface PolicyUnassigned {\n subject?: Subject;\n assignment?: PolicyAssignment[];\n}\n\nexport interface PolicyAssignmentUpdated {\n subject?: Subject;\n fromAssignment?: PolicyAssignment[];\n toAssignment?: PolicyAssignment[];\n}\n\nexport interface Empty {}\n\nexport interface PolicyAuthorizationDataUpdated {\n policyId?: string;\n fromPolicyStatements?: PolicyStatement[];\n toPolicyStatements?: PolicyStatement[];\n policyType?: PolicyTypeWithLiterals;\n policyOwner?: PolicyOwner;\n}\n\nexport interface PolicyStatement {\n /** @readonly */\n _id?: string | null;\n permissions?: string[];\n scopes?: string[];\n effect?: EffectWithLiterals;\n condition?: PolicyCondition;\n}\n\nexport enum Effect {\n UNKNOWN_EFFECT = 'UNKNOWN_EFFECT',\n ALLOW = 'ALLOW',\n DENY = 'DENY',\n}\n\n/** @enumType */\nexport type EffectWithLiterals = Effect | 'UNKNOWN_EFFECT' | 'ALLOW' | 'DENY';\n\nexport enum PolicyType {\n UNKNOWN_STATUS = 'UNKNOWN_STATUS',\n PREDEFINED = 'PREDEFINED',\n CUSTOM = 'CUSTOM',\n INLINE_CUSTOM = 'INLINE_CUSTOM',\n}\n\n/** @enumType */\nexport type PolicyTypeWithLiterals =\n | PolicyType\n | 'UNKNOWN_STATUS'\n | 'PREDEFINED'\n | 'CUSTOM'\n | 'INLINE_CUSTOM';\n\nexport interface PolicyOwner {\n type?: PolicyOwnerTypeWithLiterals;\n _id?: string;\n}\n\nexport enum PolicyOwnerType {\n UNKNOWN_TYPE = 'UNKNOWN_TYPE',\n WIX = 'WIX',\n WIX_ACCOUNT = 'WIX_ACCOUNT',\n}\n\n/** @enumType */\nexport type PolicyOwnerTypeWithLiterals =\n | PolicyOwnerType\n | 'UNKNOWN_TYPE'\n | 'WIX'\n | 'WIX_ACCOUNT';\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 type GetPermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\nexport type UpdatePermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\nexport type AddSpecialPermissionsApplicationErrors = {\n code?: 'ALREADY_EXISTS';\n description?: string;\n data?: Record<string, any>;\n};\nexport type UpdateSpecialPermissionsApplicationErrors = {\n code?: 'NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\nexport type RemoveSpecialPermissionsApplicationErrors = {\n code?: 'NOT_FOUND';\n description?: string;\n data?: Record<string, any>;\n};\nexport type GetMyPermissionsApplicationErrors = {\n code?: 'WDE0025';\n description?: string;\n data?: Record<string, any>;\n};\n\ntype DataPermissionsNonNullablePaths =\n | `_id`\n | `itemRead`\n | `itemInsert`\n | `itemUpdate`\n | `itemRemove`;\n\n/**\n * Retrieves the current permissions configuration for a data collection.\n * @param dataCollectionId - ID of the collection to retrieve permissions of.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @permissionId WIX_DATA.PERMISSIONS_READ\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetPermissions\n */\nexport async function getPermissions(dataCollectionId: string): Promise<\n NonNullablePaths<\n GetPermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: GetPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataCollectionId: dataCollectionId,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.getPermissions(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: { dataCollectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Updates permissions for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n * @param dataPermissions - Permissions to update.\n * @public\n * @documentationMaturity preview\n * @requiredField dataPermissions\n * @requiredField dataPermissions._id\n * @requiredField dataPermissions.itemInsert\n * @requiredField dataPermissions.itemRead\n * @requiredField dataPermissions.itemRemove\n * @requiredField dataPermissions.itemUpdate\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions\n */\nexport async function updatePermissions(\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n): Promise<\n NonNullablePaths<\n UpdatePermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: UpdatePermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataPermissions: dataPermissions,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.updatePermissions(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: { dataPermissions: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataPermissions']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param dataCollectionId - ID of the collection for which to grant special permissions.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @requiredField options\n * @requiredField options.specialPermissions\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions\n */\nexport async function addSpecialPermissions(\n dataCollectionId: string,\n options: NonNullablePaths<AddSpecialPermissionsOptions, `specialPermissions`>\n): Promise<\n NonNullablePaths<\n AddSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: AddSpecialPermissionsApplicationErrors;\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 dataCollectionId: dataCollectionId,\n specialPermissions: options?.specialPermissions,\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.addSpecialPermissions(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 dataCollectionId: '$[0]',\n specialPermissions: '$[1].specialPermissions',\n },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId', 'options']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface AddSpecialPermissionsOptions {\n /** Special permissions to grant to the user or role for the specified collection. */\n specialPermissions: SpecialPermissions;\n}\n\n/**\n * Updates the special permissions for the specified user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param _id - ID of the special permissions.\n * @public\n * @documentationMaturity preview\n * @requiredField _id\n * @requiredField specialPermissions\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions\n */\nexport async function updateSpecialPermissions(\n _id: string,\n specialPermissions: UpdateSpecialPermissions\n): Promise<\n NonNullablePaths<\n UpdateSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: UpdateSpecialPermissionsApplicationErrors;\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 specialPermissions: { ...specialPermissions, id: _id },\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.updateSpecialPermissions(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: { specialPermissions: '$[1]' },\n explicitPathsToArguments: { 'specialPermissions.id': '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['_id', 'specialPermissions']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\nexport interface UpdateSpecialPermissions {\n /**\n * ID of the user to add these special permissions to.\n * @immutable\n * @maxLength 64\n */\n userId?: string;\n /**\n * ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.\n *\n * To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.\n *\n * Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).\n * @immutable\n * @maxLength 64\n */\n policyId?: string;\n /**\n * ID of the special permissions.\n * @format GUID\n * @readonly\n */\n _id?: string;\n /** Read items from the collection. */\n itemRead?: AccessWithLiterals;\n /** Create new items in the collection. */\n itemInsert?: AccessWithLiterals;\n /** Update existing items in the collection. */\n itemUpdate?: AccessWithLiterals;\n /** Remove items from the collection. */\n itemRemove?: AccessWithLiterals;\n}\n\n/**\n * Removes special permissions from a specific user or role.\n *\n * When special permissions are removed, the user or role is subject to collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)) for all actions.\n * @param specialPermissionsId - ID of the special permissions to remove.\n * @public\n * @documentationMaturity preview\n * @requiredField specialPermissionsId\n * @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions\n */\nexport async function removeSpecialPermissions(\n specialPermissionsId: string\n): Promise<\n void & {\n __applicationErrorsType?: RemoveSpecialPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n specialPermissionsId: specialPermissionsId,\n });\n\n const reqOpts =\n ambassadorWixDataV1DataPermissions.removeSpecialPermissions(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: { specialPermissionsId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['specialPermissionsId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Retrieves the current user's permissions for the specified data collection.\n * @param dataCollectionId - ID of the collection for which to check the current user's permissions.\n * @public\n * @documentationMaturity preview\n * @requiredField dataCollectionId\n * @permissionId WIX_DATA.PERMISSIONS_GET_ALLOWED\n * @applicableIdentity APP\n * @fqn wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions\n */\nexport async function getMyPermissions(dataCollectionId: string): Promise<\n NonNullablePaths<\n GetMyPermissionsResponse,\n `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`\n > & {\n __applicationErrorsType?: GetMyPermissionsApplicationErrors;\n }\n> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n dataCollectionId: dataCollectionId,\n });\n\n const reqOpts = ambassadorWixDataV1DataPermissions.getMyPermissions(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: { dataCollectionId: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['dataCollectionId']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { toURLSearchParams } from '@wix/sdk-runtime/rest-modules';\nimport { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveWixCloudPermissionsV1DataPermissionsServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'manage._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'editor._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'blocks._base_domain_': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'create.editorx': [\n {\n srcPath: '/_api/cloud-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/wix-data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n '*.dev.wix-code.com': [\n {\n srcPath: '/_api/data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n _: [\n {\n srcPath: '/_api/data/v1/permissions',\n destPath: '/v1/permissions',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_data_permissions';\n\n/** Retrieves the current permissions configuration for a data collection. */\nexport function getPermissions(payload: object): RequestOptionsFactory<any> {\n function __getPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'GET' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.GetPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getPermissions;\n}\n\n/**\n * Updates permissions for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n */\nexport function updatePermissions(payload: object): RequestOptionsFactory<any> {\n function __updatePermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updatePermissions;\n}\n\n/**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n */\nexport function addSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __addSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __addSpecialPermissions;\n}\n\n/**\n * Updates the special permissions for the specified user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n */\nexport function updateSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __updateSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'POST' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special/{specialPermissions.id}',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __updateSpecialPermissions;\n}\n\n/**\n * Removes special permissions from a specific user or role.\n *\n * When special permissions are removed, the user or role is subject to collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)) for all actions.\n */\nexport function removeSpecialPermissions(\n payload: object\n): RequestOptionsFactory<any> {\n function __removeSpecialPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'DELETE' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/special/{specialPermissionsId}',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __removeSpecialPermissions;\n}\n\n/** Retrieves the current user's permissions for the specified data collection. */\nexport function getMyPermissions(payload: object): RequestOptionsFactory<any> {\n function __getMyPermissions({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.data.v1.data_permissions',\n method: 'GET' as any,\n methodFqn:\n 'wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions',\n packageName: PACKAGE_NAME,\n url: resolveWixCloudPermissionsV1DataPermissionsServiceUrl({\n protoPath: '/v1/permissions/current',\n data: payload,\n host,\n }),\n params: toURLSearchParams(payload),\n };\n\n return metadata;\n }\n\n return __getMyPermissions;\n}\n","import { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport {\n AddSpecialPermissionsApplicationErrors,\n AddSpecialPermissionsOptions,\n AddSpecialPermissionsResponse,\n DataPermissions,\n GetMyPermissionsApplicationErrors,\n GetMyPermissionsResponse,\n GetPermissionsApplicationErrors,\n GetPermissionsResponse,\n RemoveSpecialPermissionsApplicationErrors,\n UpdatePermissionsApplicationErrors,\n UpdatePermissionsResponse,\n UpdateSpecialPermissions,\n UpdateSpecialPermissionsApplicationErrors,\n UpdateSpecialPermissionsResponse,\n addSpecialPermissions as universalAddSpecialPermissions,\n getMyPermissions as universalGetMyPermissions,\n getPermissions as universalGetPermissions,\n removeSpecialPermissions as universalRemoveSpecialPermissions,\n updatePermissions as universalUpdatePermissions,\n updateSpecialPermissions as universalUpdateSpecialPermissions,\n} from './data-v1-data-permissions-permissions.universal.js';\n\nexport const __metadata = { PACKAGE_NAME: '@wix/data' };\n\ntype DataPermissionsNonNullablePaths =\n | `_id`\n | `itemRead`\n | `itemInsert`\n | `itemUpdate`\n | `itemRemove`;\n\nexport function getPermissions(\n httpClient: HttpClient\n): GetPermissionsSignature {\n return (dataCollectionId: string) =>\n universalGetPermissions(\n dataCollectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetPermissionsSignature {\n /**\n * Retrieves the current permissions configuration for a data collection.\n * @param - ID of the collection to retrieve permissions of.\n */\n (dataCollectionId: string): Promise<\n NonNullablePaths<\n GetPermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: GetPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function updatePermissions(\n httpClient: HttpClient\n): UpdatePermissionsSignature {\n return (\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n ) =>\n universalUpdatePermissions(\n dataPermissions,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdatePermissionsSignature {\n /**\n * Updates permissions for the specified data collection.\n *\n * > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).\n * @param - Permissions to update.\n */\n (\n dataPermissions: NonNullablePaths<\n DataPermissions,\n `_id` | `itemInsert` | `itemRead` | `itemRemove` | `itemUpdate`\n >\n ): Promise<\n NonNullablePaths<\n UpdatePermissionsResponse,\n {\n [P in DataPermissionsNonNullablePaths]: `dataPermissions.${P}`;\n }[DataPermissionsNonNullablePaths]\n > & {\n __applicationErrorsType?: UpdatePermissionsApplicationErrors;\n }\n >;\n}\n\nexport function addSpecialPermissions(\n httpClient: HttpClient\n): AddSpecialPermissionsSignature {\n return (\n dataCollectionId: string,\n options: NonNullablePaths<\n AddSpecialPermissionsOptions,\n `specialPermissions`\n >\n ) =>\n universalAddSpecialPermissions(\n dataCollectionId,\n options,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface AddSpecialPermissionsSignature {\n /**\n * Adds special permissions to a specific user or role for the specified data collection.\n *\n * Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param - ID of the collection for which to grant special permissions.\n */\n (\n dataCollectionId: string,\n options: NonNullablePaths<\n AddSpecialPermissionsOptions,\n `specialPermissions`\n >\n ): Promise<\n NonNullablePaths<\n AddSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: AddSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function updateSpecialPermissions(\n httpClient: HttpClient\n): UpdateSpecialPermissionsSignature {\n return (_id: string, specialPermissions: UpdateSpecialPermissions) =>\n universalUpdateSpecialPermissions(\n _id,\n specialPermissions,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface UpdateSpecialPermissionsSignature {\n /**\n * Updates the special permissions for the specified user or role.\n *\n * > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).\n * @param - ID of the special permissions.\n */\n (_id: string, specialPermissions: UpdateSpecialPermissions): Promise<\n NonNullablePaths<\n UpdateSpecialPermissionsResponse,\n | `specialPermissions.userId`\n | `specialPermissions.policyId`\n | `specialPermissions._id`\n | `specialPermissions.itemRead`\n | `specialPermissions.itemInsert`\n | `specialPermissions.itemUpdate`\n | `specialPermissions.itemRemove`\n > & {\n __applicationErrorsType?: UpdateSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function removeSpecialPermissions(\n httpClient: HttpClient\n): RemoveSpecialPermissionsSignature {\n return (specialPermissionsId: string) =>\n universalRemoveSpecialPermissions(\n specialPermissionsId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface RemoveSpecialPermissionsSignature {\n /**\n * Removes special permissions from a specific user or role.\n *\n * When special permissions are removed, the user or role is subject to collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)) for all actions.\n * @param - ID of the special permissions to remove.\n */\n (specialPermissionsId: string): Promise<\n void & {\n __applicationErrorsType?: RemoveSpecialPermissionsApplicationErrors;\n }\n >;\n}\n\nexport function getMyPermissions(\n httpClient: HttpClient\n): GetMyPermissionsSignature {\n return (dataCollectionId: string) =>\n universalGetMyPermissions(\n dataCollectionId,\n // @ts-ignore\n { httpClient }\n );\n}\n\ninterface GetMyPermissionsSignature {\n /**\n * Retrieves the current user's permissions for the specified data collection.\n * @param - ID of the collection for which to check the current user's permissions.\n */\n (dataCollectionId: string): Promise<\n NonNullablePaths<\n GetMyPermissionsResponse,\n `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`\n > & {\n __applicationErrorsType?: GetMyPermissionsApplicationErrors;\n }\n >;\n}\n\nexport {\n Access,\n AccessLevel,\n ActionEvent,\n AddSpecialPermissionsOptions,\n AddSpecialPermissionsRequest,\n AddSpecialPermissionsResponse,\n Condition,\n ConditionOperator,\n ConditionOperatorOperatorsOneOf,\n ConditionType,\n ConditionTypeOfOneOf,\n ConditionValue,\n ConditionValueValueOneOf,\n DataPermissions,\n DependOnOperator,\n DomainEvent,\n DomainEventBodyOneOf,\n Effect,\n Empty,\n EntityCreatedEvent,\n EntityDeletedEvent,\n EntityUpdatedEvent,\n EnvironmentCondition,\n EnvironmentConditionConditionOneOf,\n EqualOperator,\n ExperimentCondition,\n ExperimentOperator,\n GetMyPermissionsRequest,\n GetMyPermissionsResponse,\n GetPermissionsRequest,\n GetPermissionsResponse,\n JoinedCondition,\n JoinedConditionOperator,\n LikeOperator,\n MigrateCustomRolesRequest,\n MigrateCustomRolesResponse,\n PolicyAssigned,\n PolicyAssignment,\n PolicyAssignmentUpdated,\n PolicyAssignmentsUpdated,\n PolicyAssignmentsUpdatedEventOneOf,\n PolicyAuthorizationDataUpdated,\n PolicyCondition,\n PolicyOwner,\n PolicyOwnerType,\n PolicyStatement,\n PolicyType,\n PolicyUnassigned,\n RemoveSpecialPermissionsRequest,\n RemoveSpecialPermissionsResponse,\n Resource,\n ResourcePath,\n RestoreInfo,\n SimpleCondition,\n SimpleConditionOperator,\n SimpleConditionValue,\n SimpleConditionValueValueOneOf,\n SpecialPermissions,\n SpecialPermissionsSubjectOneOf,\n Subject,\n SubjectContext,\n SubjectContextType,\n SubjectType,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n UpdateSpecialPermissions,\n UpdateSpecialPermissionsRequest,\n UpdateSpecialPermissionsResponse,\n} from './data-v1-data-permissions-permissions.universal.js';\n","import {\n getPermissions as publicGetPermissions,\n updatePermissions as publicUpdatePermissions,\n addSpecialPermissions as publicAddSpecialPermissions,\n updateSpecialPermissions as publicUpdateSpecialPermissions,\n removeSpecialPermissions as publicRemoveSpecialPermissions,\n getMyPermissions as publicGetMyPermissions,\n} from './data-v1-data-permissions-permissions.public.js';\nimport { createRESTModule } from '@wix/sdk-runtime/rest-modules';\nimport { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';\n\nexport const getPermissions: MaybeContext<\n BuildRESTFunction<typeof publicGetPermissions> & typeof publicGetPermissions\n> = /*#__PURE__*/ createRESTModule(publicGetPermissions);\nexport const updatePermissions: MaybeContext<\n BuildRESTFunction<typeof publicUpdatePermissions> &\n typeof publicUpdatePermissions\n> = /*#__PURE__*/ createRESTModule(publicUpdatePermissions);\nexport const addSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicAddSpecialPermissions> &\n typeof publicAddSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicAddSpecialPermissions);\nexport const updateSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicUpdateSpecialPermissions> &\n typeof publicUpdateSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicUpdateSpecialPermissions);\nexport const removeSpecialPermissions: MaybeContext<\n BuildRESTFunction<typeof publicRemoveSpecialPermissions> &\n typeof publicRemoveSpecialPermissions\n> = /*#__PURE__*/ createRESTModule(publicRemoveSpecialPermissions);\nexport const getMyPermissions: MaybeContext<\n BuildRESTFunction<typeof publicGetMyPermissions> &\n typeof publicGetMyPermissions\n> = /*#__PURE__*/ createRESTModule(publicGetMyPermissions);\n\nexport {\n AccessLevel,\n Access,\n SubjectType,\n SubjectContextType,\n SimpleConditionOperator,\n JoinedConditionOperator,\n Effect,\n PolicyType,\n PolicyOwnerType,\n} from './data-v1-data-permissions-permissions.universal.js';\nexport {\n DataPermissions,\n SpecialPermissions,\n SpecialPermissionsSubjectOneOf,\n GetPermissionsRequest,\n GetPermissionsResponse,\n UpdatePermissionsRequest,\n UpdatePermissionsResponse,\n AddSpecialPermissionsRequest,\n AddSpecialPermissionsResponse,\n UpdateSpecialPermissionsRequest,\n UpdateSpecialPermissionsResponse,\n RemoveSpecialPermissionsRequest,\n RemoveSpecialPermissionsResponse,\n GetMyPermissionsRequest,\n GetMyPermissionsResponse,\n MigrateCustomRolesRequest,\n MigrateCustomRolesResponse,\n PolicyAssignmentsUpdated,\n PolicyAssignmentsUpdatedEventOneOf,\n PolicyAssigned,\n Subject,\n SubjectContext,\n PolicyAssignment,\n ResourcePath,\n Resource,\n PolicyCondition,\n ConditionType,\n ConditionTypeOfOneOf,\n SimpleCondition,\n SimpleConditionValue,\n SimpleConditionValueValueOneOf,\n JoinedCondition,\n EnvironmentCondition,\n EnvironmentConditionConditionOneOf,\n ExperimentCondition,\n Condition,\n ConditionOperator,\n ConditionOperatorOperatorsOneOf,\n EqualOperator,\n ConditionValue,\n ConditionValueValueOneOf,\n LikeOperator,\n ExperimentOperator,\n DependOnOperator,\n PolicyUnassigned,\n PolicyAssignmentUpdated,\n Empty,\n PolicyAuthorizationDataUpdated,\n PolicyStatement,\n PolicyOwner,\n DomainEvent,\n DomainEventBodyOneOf,\n EntityCreatedEvent,\n RestoreInfo,\n EntityUpdatedEvent,\n EntityDeletedEvent,\n ActionEvent,\n AddSpecialPermissionsOptions,\n UpdateSpecialPermissions,\n} from './data-v1-data-permissions-permissions.universal.js';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,wBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,gCAAAC;AAAA,EAAA,yB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,2DAAiBA,yBAA8B;AAC1D,IAAMC,4BAGK,2DAAiBA,yBAA8B;AAC1D,IAAMC,oBAGK,2DAAiBA,iBAAsB;","names":["addSpecialPermissions","getMyPermissions","getPermissions","removeSpecialPermissions","updatePermissions","updateSpecialPermissions","import_rest_modules","AccessLevel","Access","SubjectType","SubjectContextType","SimpleConditionOperator","JoinedConditionOperator","Effect","PolicyType","PolicyOwnerType","getPermissions","sdkTransformError","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions","import_rest_modules","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { NonNullablePaths } from '@wix/sdk-types';
|
|
2
2
|
|
|
3
|
-
/** Permissions
|
|
3
|
+
/** Permissions for a data collection. */
|
|
4
4
|
interface DataPermissions {
|
|
5
5
|
/**
|
|
6
|
-
* ID of the
|
|
6
|
+
* ID of the collection to which these permissions apply.
|
|
7
7
|
* @immutable
|
|
8
8
|
* @maxLength 255
|
|
9
9
|
*/
|
|
@@ -17,7 +17,7 @@ interface DataPermissions {
|
|
|
17
17
|
/** Remove items from the collection. */
|
|
18
18
|
itemRemove?: AccessLevelWithLiterals;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
20
|
+
/** Minimal access level required to perform an action on collection items. Each access level includes the permissions of the access levels below it. */
|
|
21
21
|
declare enum AccessLevel {
|
|
22
22
|
/** Access level is not set. */
|
|
23
23
|
UNKNOWN = "UNKNOWN",
|
|
@@ -25,9 +25,13 @@ declare enum AccessLevel {
|
|
|
25
25
|
ANYONE = "ANYONE",
|
|
26
26
|
/** Logged-in users, including site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site). */
|
|
27
27
|
SITE_MEMBER = "SITE_MEMBER",
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Logged-in site members ([SDK](https://dev.wix.com/docs/sdk/articles/work-with-the-sdk/about-identities#site-member) | [REST](https://dev.wix.com/docs/rest/articles/get-started/about-identities#site-member)) and [collaborators](https://support.wix.com/en/article/inviting-people-to-contribute-to-your-site).
|
|
30
|
+
*
|
|
31
|
+
* Members can only access items they created.
|
|
32
|
+
*/
|
|
29
33
|
SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
|
|
30
|
-
/** Site [collaborators with
|
|
34
|
+
/** Site [collaborators with CMS roles](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps). */
|
|
31
35
|
CMS_EDITOR = "CMS_EDITOR",
|
|
32
36
|
/**
|
|
33
37
|
* Site administrators, users, or roles with special permissions.
|
|
@@ -46,7 +50,11 @@ interface SpecialPermissions extends SpecialPermissionsSubjectOneOf {
|
|
|
46
50
|
*/
|
|
47
51
|
userId?: string;
|
|
48
52
|
/**
|
|
49
|
-
* ID of the
|
|
53
|
+
* ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.
|
|
54
|
+
*
|
|
55
|
+
* To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.
|
|
56
|
+
*
|
|
57
|
+
* Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).
|
|
50
58
|
* @immutable
|
|
51
59
|
* @maxLength 64
|
|
52
60
|
*/
|
|
@@ -75,29 +83,33 @@ interface SpecialPermissionsSubjectOneOf {
|
|
|
75
83
|
*/
|
|
76
84
|
userId?: string;
|
|
77
85
|
/**
|
|
78
|
-
* ID of the
|
|
86
|
+
* ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.
|
|
87
|
+
*
|
|
88
|
+
* To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.
|
|
89
|
+
*
|
|
90
|
+
* Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).
|
|
79
91
|
* @immutable
|
|
80
92
|
* @maxLength 64
|
|
81
93
|
*/
|
|
82
94
|
policyId?: string;
|
|
83
95
|
}
|
|
84
96
|
declare enum Access {
|
|
85
|
-
/** No special permissions
|
|
97
|
+
/** No special permissions for this action. [Collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions) apply for this action. */
|
|
86
98
|
UNSPECIFIED = "UNSPECIFIED",
|
|
87
|
-
/** Special permission is granted to perform this action
|
|
99
|
+
/** Special permission is granted to perform this action, overriding [collection-level permissions](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#collection-level-permissions). */
|
|
88
100
|
ALLOWED = "ALLOWED"
|
|
89
101
|
}
|
|
90
102
|
/** @enumType */
|
|
91
103
|
type AccessWithLiterals = Access | 'UNSPECIFIED' | 'ALLOWED';
|
|
92
104
|
interface GetPermissionsRequest {
|
|
93
105
|
/**
|
|
94
|
-
* ID of the
|
|
106
|
+
* ID of the collection to retrieve permissions of.
|
|
95
107
|
* @maxLength 256
|
|
96
108
|
*/
|
|
97
109
|
dataCollectionId: string;
|
|
98
110
|
}
|
|
99
111
|
interface GetPermissionsResponse {
|
|
100
|
-
/** Permissions
|
|
112
|
+
/** Permissions of the specified collection. */
|
|
101
113
|
dataPermissions?: DataPermissions;
|
|
102
114
|
}
|
|
103
115
|
interface UpdatePermissionsRequest {
|
|
@@ -105,28 +117,28 @@ interface UpdatePermissionsRequest {
|
|
|
105
117
|
dataPermissions: DataPermissions;
|
|
106
118
|
}
|
|
107
119
|
interface UpdatePermissionsResponse {
|
|
108
|
-
/** Updated permissions
|
|
120
|
+
/** Updated permissions of the specified collection. */
|
|
109
121
|
dataPermissions?: DataPermissions;
|
|
110
122
|
}
|
|
111
123
|
interface AddSpecialPermissionsRequest {
|
|
112
124
|
/**
|
|
113
|
-
* ID of the
|
|
125
|
+
* ID of the collection for which to grant special permissions.
|
|
114
126
|
* @maxLength 256
|
|
115
127
|
*/
|
|
116
128
|
dataCollectionId: string;
|
|
117
|
-
/** Special permissions to
|
|
129
|
+
/** Special permissions to grant to the user or role for the specified collection. */
|
|
118
130
|
specialPermissions: SpecialPermissions;
|
|
119
131
|
}
|
|
120
132
|
interface AddSpecialPermissionsResponse {
|
|
121
|
-
/** Special permissions
|
|
133
|
+
/** Special permissions granted to the user or role for the specified collection. */
|
|
122
134
|
specialPermissions?: SpecialPermissions;
|
|
123
135
|
}
|
|
124
136
|
interface UpdateSpecialPermissionsRequest {
|
|
125
|
-
/** Special permissions to update. */
|
|
137
|
+
/** Special permissions to update for the specified user or role. */
|
|
126
138
|
specialPermissions: SpecialPermissions;
|
|
127
139
|
}
|
|
128
140
|
interface UpdateSpecialPermissionsResponse {
|
|
129
|
-
/**
|
|
141
|
+
/** Special permissions updated for the specified user or role. */
|
|
130
142
|
specialPermissions?: SpecialPermissions;
|
|
131
143
|
}
|
|
132
144
|
interface RemoveSpecialPermissionsRequest {
|
|
@@ -140,7 +152,7 @@ interface RemoveSpecialPermissionsResponse {
|
|
|
140
152
|
}
|
|
141
153
|
interface GetMyPermissionsRequest {
|
|
142
154
|
/**
|
|
143
|
-
* ID of the
|
|
155
|
+
* ID of the collection for which to check the current user's permissions.
|
|
144
156
|
* @maxLength 256
|
|
145
157
|
*/
|
|
146
158
|
dataCollectionId: string;
|
|
@@ -522,7 +534,7 @@ type GetMyPermissionsApplicationErrors = {
|
|
|
522
534
|
type DataPermissionsNonNullablePaths = `_id` | `itemRead` | `itemInsert` | `itemUpdate` | `itemRemove`;
|
|
523
535
|
/**
|
|
524
536
|
* Retrieves the current permissions configuration for a data collection.
|
|
525
|
-
* @param dataCollectionId - ID of the
|
|
537
|
+
* @param dataCollectionId - ID of the collection to retrieve permissions of.
|
|
526
538
|
* @public
|
|
527
539
|
* @documentationMaturity preview
|
|
528
540
|
* @requiredField dataCollectionId
|
|
@@ -536,7 +548,7 @@ declare function getPermissions(dataCollectionId: string): Promise<NonNullablePa
|
|
|
536
548
|
__applicationErrorsType?: GetPermissionsApplicationErrors;
|
|
537
549
|
}>;
|
|
538
550
|
/**
|
|
539
|
-
* Updates permissions
|
|
551
|
+
* Updates permissions for the specified data collection.
|
|
540
552
|
*
|
|
541
553
|
* > **Note:** To manage special permissions, call Add Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/add-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/add-special-permissions)), Update Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/update-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/update-special-permissions)), or Remove Special Permissions ([SDK](https://dev.wix.com/docs/sdk/backend-modules/data/permissions/remove-special-permissions) | [REST](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/remove-special-permissions)).
|
|
542
554
|
* @param dataPermissions - Permissions to update.
|
|
@@ -560,8 +572,8 @@ declare function updatePermissions(dataPermissions: NonNullablePaths<DataPermiss
|
|
|
560
572
|
/**
|
|
561
573
|
* Adds special permissions to a specific user or role for the specified data collection.
|
|
562
574
|
*
|
|
563
|
-
* Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection
|
|
564
|
-
* @param dataCollectionId - ID of the
|
|
575
|
+
* Special permissions allow specific users or roles to perform actions that would otherwise be restricted by the collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).
|
|
576
|
+
* @param dataCollectionId - ID of the collection for which to grant special permissions.
|
|
565
577
|
* @public
|
|
566
578
|
* @documentationMaturity preview
|
|
567
579
|
* @requiredField dataCollectionId
|
|
@@ -575,13 +587,13 @@ declare function addSpecialPermissions(dataCollectionId: string, options: NonNul
|
|
|
575
587
|
__applicationErrorsType?: AddSpecialPermissionsApplicationErrors;
|
|
576
588
|
}>;
|
|
577
589
|
interface AddSpecialPermissionsOptions {
|
|
578
|
-
/** Special permissions to
|
|
590
|
+
/** Special permissions to grant to the user or role for the specified collection. */
|
|
579
591
|
specialPermissions: SpecialPermissions;
|
|
580
592
|
}
|
|
581
593
|
/**
|
|
582
|
-
* Updates the special permissions for
|
|
594
|
+
* Updates the special permissions for the specified user or role.
|
|
583
595
|
*
|
|
584
|
-
* > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by
|
|
596
|
+
* > **Note:** Special permissions that aren't explicitly included in the request are set to `UNSPECIFIED` and are replaced by collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)).
|
|
585
597
|
* @param _id - ID of the special permissions.
|
|
586
598
|
* @public
|
|
587
599
|
* @documentationMaturity preview
|
|
@@ -602,7 +614,11 @@ interface UpdateSpecialPermissions {
|
|
|
602
614
|
*/
|
|
603
615
|
userId?: string;
|
|
604
616
|
/**
|
|
605
|
-
* ID of the
|
|
617
|
+
* ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.
|
|
618
|
+
*
|
|
619
|
+
* To find the ID of a role, call Get Roles Info ([SDK](https://dev.wix.com/docs/sdk/account-level-modules/user-management/users/get-roles-info) | [REST](https://dev.wix.com/docs/rest/account-level/user-management/accounts/users/get-roles-info)). Roles and their IDs are found in the `predefinedRoles` or the `customRoles` arrays in the method response.
|
|
620
|
+
*
|
|
621
|
+
* Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).
|
|
606
622
|
* @immutable
|
|
607
623
|
* @maxLength 64
|
|
608
624
|
*/
|
|
@@ -625,7 +641,7 @@ interface UpdateSpecialPermissions {
|
|
|
625
641
|
/**
|
|
626
642
|
* Removes special permissions from a specific user or role.
|
|
627
643
|
*
|
|
628
|
-
*
|
|
644
|
+
* When special permissions are removed, the user or role is subject to collection-level permissions ([SDK](ADDLINK) | [REST](ADDLINK)) for all actions.
|
|
629
645
|
* @param specialPermissionsId - ID of the special permissions to remove.
|
|
630
646
|
* @public
|
|
631
647
|
* @documentationMaturity preview
|
|
@@ -638,8 +654,8 @@ declare function removeSpecialPermissions(specialPermissionsId: string): Promise
|
|
|
638
654
|
__applicationErrorsType?: RemoveSpecialPermissionsApplicationErrors;
|
|
639
655
|
}>;
|
|
640
656
|
/**
|
|
641
|
-
* Retrieves the current user's permissions for
|
|
642
|
-
* @param dataCollectionId - ID of the
|
|
657
|
+
* Retrieves the current user's permissions for the specified data collection.
|
|
658
|
+
* @param dataCollectionId - ID of the collection for which to check the current user's permissions.
|
|
643
659
|
* @public
|
|
644
660
|
* @documentationMaturity preview
|
|
645
661
|
* @requiredField dataCollectionId
|