@wix/auto_sdk_data_permissions 1.0.20 → 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 +3 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.typings.ts","../../src/data-v1-data-permissions-permissions.universal.ts","../../src/data-v1-data-permissions-permissions.http.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as 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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AAYA,eAAsBK,kBAAiB,kBAOrC;AAEA,QAAM,EAAE,YAAY,YAAY,IAAI,UAAU,CAAC;AAK/C,QAAM,cAAU,qEAAsC;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA6C,iBAAiB,OAAO;AAE3E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAL;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,kBAAkB,OAAO;AAAA,QACrD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","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"]}
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/data-v1-data-permissions-permissions.universal.ts","../../src/data-v1-data-permissions-permissions.http.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.universal.js';\n","import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient, NonNullablePaths } from '@wix/sdk-types';\nimport * as 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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA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C;AAAA,IACpD;AAAA,EACF,CAAC;AAED,QAAM,UAA6C,iBAAiB,OAAO;AAE3E,eAAa,aAAa;AAC1B,MAAI;AACF,UAAM,SAAS,MAAM,WAAW,QAAQ,OAAO;AAC/C,iBAAa,YAAY,MAAM;AAE/B,eAAO,uEAAwC,OAAO,IAAI;AAAA,EAC5D,SAAS,KAAU;AACjB,UAAM,uBAAmB,uBAAAL;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,EAAE,kBAAkB,OAAO;AAAA,QACrD,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC,kBAAkB;AAAA,IACrB;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","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"]}
|
package/build/cjs/meta.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { GetPermissionsRequest as GetPermissionsRequest$1, GetPermissionsResponse as GetPermissionsResponse$1, UpdatePermissionsRequest as UpdatePermissionsRequest$1, UpdatePermissionsResponse as UpdatePermissionsResponse$1, AddSpecialPermissionsRequest as AddSpecialPermissionsRequest$1, AddSpecialPermissionsResponse as AddSpecialPermissionsResponse$1, UpdateSpecialPermissionsRequest as UpdateSpecialPermissionsRequest$1, UpdateSpecialPermissionsResponse as UpdateSpecialPermissionsResponse$1, RemoveSpecialPermissionsRequest as RemoveSpecialPermissionsRequest$1, RemoveSpecialPermissionsResponse as RemoveSpecialPermissionsResponse$1, GetMyPermissionsRequest as GetMyPermissionsRequest$1, GetMyPermissionsResponse as GetMyPermissionsResponse$1 } from './index.typings.js';
|
|
2
2
|
import '@wix/sdk-types';
|
|
3
3
|
|
|
4
|
-
/** Permissions
|
|
4
|
+
/** Permissions for a data collection. */
|
|
5
5
|
interface DataPermissions {
|
|
6
6
|
/**
|
|
7
|
-
* ID of the
|
|
7
|
+
* ID of the collection to which these permissions apply.
|
|
8
8
|
* @immutable
|
|
9
9
|
* @maxLength 255
|
|
10
10
|
*/
|
|
@@ -18,7 +18,7 @@ interface DataPermissions {
|
|
|
18
18
|
/** Remove items from the collection. */
|
|
19
19
|
itemRemove?: AccessLevelWithLiterals;
|
|
20
20
|
}
|
|
21
|
-
/**
|
|
21
|
+
/** Minimal access level required to perform an action on collection items. Each access level includes the permissions of the access levels below it. */
|
|
22
22
|
declare enum AccessLevel {
|
|
23
23
|
/** Access level is not set. */
|
|
24
24
|
UNKNOWN = "UNKNOWN",
|
|
@@ -26,9 +26,13 @@ declare enum AccessLevel {
|
|
|
26
26
|
ANYONE = "ANYONE",
|
|
27
27
|
/** 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). */
|
|
28
28
|
SITE_MEMBER = "SITE_MEMBER",
|
|
29
|
-
/**
|
|
29
|
+
/**
|
|
30
|
+
* 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).
|
|
31
|
+
*
|
|
32
|
+
* Members can only access items they created.
|
|
33
|
+
*/
|
|
30
34
|
SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
|
|
31
|
-
/** Site [collaborators with
|
|
35
|
+
/** Site [collaborators with CMS roles](https://support.wix.com/en/article/roles-permissions-overview#roles-for-integrated-wix-apps). */
|
|
32
36
|
CMS_EDITOR = "CMS_EDITOR",
|
|
33
37
|
/**
|
|
34
38
|
* Site administrators, users, or roles with special permissions.
|
|
@@ -47,7 +51,11 @@ interface SpecialPermissions extends SpecialPermissionsSubjectOneOf {
|
|
|
47
51
|
*/
|
|
48
52
|
userId?: string;
|
|
49
53
|
/**
|
|
50
|
-
* ID of the
|
|
54
|
+
* ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.
|
|
55
|
+
*
|
|
56
|
+
* 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.
|
|
57
|
+
*
|
|
58
|
+
* Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).
|
|
51
59
|
* @immutable
|
|
52
60
|
* @maxLength 64
|
|
53
61
|
*/
|
|
@@ -76,29 +84,33 @@ interface SpecialPermissionsSubjectOneOf {
|
|
|
76
84
|
*/
|
|
77
85
|
userId?: string;
|
|
78
86
|
/**
|
|
79
|
-
* ID of the
|
|
87
|
+
* ID of the [role](https://dev.wix.com/docs/rest/business-solutions/cms/data-permissions/introduction#user-roles) to grant these special permissions to.
|
|
88
|
+
*
|
|
89
|
+
* 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.
|
|
90
|
+
*
|
|
91
|
+
* Learn more about [roles and permissions for site management](https://support.wix.com/en/article/roles-permissions-overview#roles-and-permissions).
|
|
80
92
|
* @immutable
|
|
81
93
|
* @maxLength 64
|
|
82
94
|
*/
|
|
83
95
|
policyId?: string;
|
|
84
96
|
}
|
|
85
97
|
declare enum Access {
|
|
86
|
-
/** No special permissions
|
|
98
|
+
/** 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. */
|
|
87
99
|
UNSPECIFIED = "UNSPECIFIED",
|
|
88
|
-
/** Special permission is granted to perform this action
|
|
100
|
+
/** 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). */
|
|
89
101
|
ALLOWED = "ALLOWED"
|
|
90
102
|
}
|
|
91
103
|
/** @enumType */
|
|
92
104
|
type AccessWithLiterals = Access | 'UNSPECIFIED' | 'ALLOWED';
|
|
93
105
|
interface GetPermissionsRequest {
|
|
94
106
|
/**
|
|
95
|
-
* ID of the
|
|
107
|
+
* ID of the collection to retrieve permissions of.
|
|
96
108
|
* @maxLength 256
|
|
97
109
|
*/
|
|
98
110
|
dataCollectionId: string;
|
|
99
111
|
}
|
|
100
112
|
interface GetPermissionsResponse {
|
|
101
|
-
/** Permissions
|
|
113
|
+
/** Permissions of the specified collection. */
|
|
102
114
|
dataPermissions?: DataPermissions;
|
|
103
115
|
}
|
|
104
116
|
interface UpdatePermissionsRequest {
|
|
@@ -106,28 +118,28 @@ interface UpdatePermissionsRequest {
|
|
|
106
118
|
dataPermissions: DataPermissions;
|
|
107
119
|
}
|
|
108
120
|
interface UpdatePermissionsResponse {
|
|
109
|
-
/** Updated permissions
|
|
121
|
+
/** Updated permissions of the specified collection. */
|
|
110
122
|
dataPermissions?: DataPermissions;
|
|
111
123
|
}
|
|
112
124
|
interface AddSpecialPermissionsRequest {
|
|
113
125
|
/**
|
|
114
|
-
* ID of the
|
|
126
|
+
* ID of the collection for which to grant special permissions.
|
|
115
127
|
* @maxLength 256
|
|
116
128
|
*/
|
|
117
129
|
dataCollectionId: string;
|
|
118
|
-
/** Special permissions to
|
|
130
|
+
/** Special permissions to grant to the user or role for the specified collection. */
|
|
119
131
|
specialPermissions: SpecialPermissions;
|
|
120
132
|
}
|
|
121
133
|
interface AddSpecialPermissionsResponse {
|
|
122
|
-
/** Special permissions
|
|
134
|
+
/** Special permissions granted to the user or role for the specified collection. */
|
|
123
135
|
specialPermissions?: SpecialPermissions;
|
|
124
136
|
}
|
|
125
137
|
interface UpdateSpecialPermissionsRequest {
|
|
126
|
-
/** Special permissions to update. */
|
|
138
|
+
/** Special permissions to update for the specified user or role. */
|
|
127
139
|
specialPermissions: SpecialPermissions;
|
|
128
140
|
}
|
|
129
141
|
interface UpdateSpecialPermissionsResponse {
|
|
130
|
-
/**
|
|
142
|
+
/** Special permissions updated for the specified user or role. */
|
|
131
143
|
specialPermissions?: SpecialPermissions;
|
|
132
144
|
}
|
|
133
145
|
interface RemoveSpecialPermissionsRequest {
|
|
@@ -141,7 +153,7 @@ interface RemoveSpecialPermissionsResponse {
|
|
|
141
153
|
}
|
|
142
154
|
interface GetMyPermissionsRequest {
|
|
143
155
|
/**
|
|
144
|
-
* ID of the
|
|
156
|
+
* ID of the collection for which to check the current user's permissions.
|
|
145
157
|
* @maxLength 256
|
|
146
158
|
*/
|
|
147
159
|
dataCollectionId: string;
|
package/build/cjs/meta.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../meta.ts","../../src/data-v1-data-permissions-permissions.http.ts","../../src/data-v1-data-permissions-permissions.meta.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.meta.js';\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 * as ambassadorWixDataV1DataPermissions from './data-v1-data-permissions-permissions.http.js';\nimport * as ambassadorWixDataV1DataPermissionsTypes from './data-v1-data-permissions-permissions.types.js';\nimport * as ambassadorWixDataV1DataPermissionsUniversalTypes from './data-v1-data-permissions-permissions.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getPermissions(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.GetPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.GetPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.getPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/permissions',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updatePermissions(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdatePermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.UpdatePermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdatePermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.UpdatePermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.updatePermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function addSpecialPermissions(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.AddSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.AddSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.AddSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.AddSpecialPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.addSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions/special',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateSpecialPermissions(): __PublicMethodMetaInfo<\n 'POST',\n { specialPermissionsId: string },\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdateSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.UpdateSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdateSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.UpdateSpecialPermissionsResponse\n> {\n const payload = {\n specialPermissions: { id: ':specialPermissionsId' },\n } as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.updateSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions/special/{specialPermissions.id}',\n pathParams: { specialPermissionsId: 'specialPermissionsId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function removeSpecialPermissions(): __PublicMethodMetaInfo<\n 'DELETE',\n { specialPermissionsId: string },\n ambassadorWixDataV1DataPermissionsUniversalTypes.RemoveSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.RemoveSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.RemoveSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.RemoveSpecialPermissionsResponse\n> {\n const payload = { specialPermissionsId: ':specialPermissionsId' } as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.removeSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'DELETE',\n path: '/v1/permissions/special/{specialPermissionsId}',\n pathParams: { specialPermissionsId: 'specialPermissionsId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getMyPermissions(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetMyPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.GetMyPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetMyPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.GetMyPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.getMyPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/permissions/current',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,wBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,gCAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,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;AA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AAwB;AAAA,EAC1B;AACF;AAEO,SAASC,4BAOd;AACA,QAAM,UAAU,EAAE,sBAAsB,wBAAwB;AAEhE,QAAM,oBAC+B,yBAAyB,OAAO;AAErE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,oBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC+B,iBAAiB,OAAO;AAE7D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["addSpecialPermissions","getMyPermissions","getPermissions","removeSpecialPermissions","updatePermissions","updateSpecialPermissions","import_rest_modules","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions"]}
|
|
1
|
+
{"version":3,"sources":["../../meta.ts","../../src/data-v1-data-permissions-permissions.http.ts","../../src/data-v1-data-permissions-permissions.meta.ts"],"sourcesContent":["export * from './src/data-v1-data-permissions-permissions.meta.js';\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 * as ambassadorWixDataV1DataPermissions from './data-v1-data-permissions-permissions.http.js';\nimport * as ambassadorWixDataV1DataPermissionsTypes from './data-v1-data-permissions-permissions.types.js';\nimport * as ambassadorWixDataV1DataPermissionsUniversalTypes from './data-v1-data-permissions-permissions.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function getPermissions(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.GetPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.GetPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.getPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/permissions',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updatePermissions(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdatePermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.UpdatePermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdatePermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.UpdatePermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.updatePermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function addSpecialPermissions(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.AddSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.AddSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.AddSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.AddSpecialPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.addSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions/special',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function updateSpecialPermissions(): __PublicMethodMetaInfo<\n 'POST',\n { specialPermissionsId: string },\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdateSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.UpdateSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.UpdateSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.UpdateSpecialPermissionsResponse\n> {\n const payload = {\n specialPermissions: { id: ':specialPermissionsId' },\n } as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.updateSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/permissions/special/{specialPermissions.id}',\n pathParams: { specialPermissionsId: 'specialPermissionsId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function removeSpecialPermissions(): __PublicMethodMetaInfo<\n 'DELETE',\n { specialPermissionsId: string },\n ambassadorWixDataV1DataPermissionsUniversalTypes.RemoveSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.RemoveSpecialPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.RemoveSpecialPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.RemoveSpecialPermissionsResponse\n> {\n const payload = { specialPermissionsId: ':specialPermissionsId' } as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.removeSpecialPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'DELETE',\n path: '/v1/permissions/special/{specialPermissionsId}',\n pathParams: { specialPermissionsId: 'specialPermissionsId' },\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function getMyPermissions(): __PublicMethodMetaInfo<\n 'GET',\n {},\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetMyPermissionsRequest,\n ambassadorWixDataV1DataPermissionsTypes.GetMyPermissionsRequest,\n ambassadorWixDataV1DataPermissionsUniversalTypes.GetMyPermissionsResponse,\n ambassadorWixDataV1DataPermissionsTypes.GetMyPermissionsResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixDataV1DataPermissions.getMyPermissions(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'GET',\n path: '/v1/permissions/current',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA,+BAAAA;AAAA,EAAA,wBAAAC;AAAA,EAAA,sBAAAC;AAAA,EAAA,gCAAAC;AAAA,EAAA,yBAAAC;AAAA,EAAA,gCAAAC;AAAA;AAAA;;;ACAA,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,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EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,4BAOd;AACA,QAAM,UAAU,EAAE,sBAAsB,wBAAwB;AAEhE,QAAM,oBAC+B,yBAAyB,OAAO;AAErE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,EAAE,sBAAsB,uBAAuB;AAAA,IAC3D,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,oBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBAC+B,iBAAiB,OAAO;AAE7D,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["addSpecialPermissions","getMyPermissions","getPermissions","removeSpecialPermissions","updatePermissions","updateSpecialPermissions","import_rest_modules","getPermissions","updatePermissions","addSpecialPermissions","updateSpecialPermissions","removeSpecialPermissions","getMyPermissions"]}
|
package/build/es/index.d.mts
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;
|