@wix/auto_sdk_data_permissions 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +1 -0
- package/build/cjs/index.js +18 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +1 -0
- package/build/cjs/index.typings.js +18 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/meta.d.ts +1 -0
- package/build/cjs/meta.js +18 -0
- package/build/cjs/meta.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.context.d.ts +10 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.context.js +22 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.context.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.http.d.ts +24 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.http.js +167 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.http.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.meta.d.ts +22 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.meta.js +144 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.meta.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.public.d.ts +59 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.public.js +52 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.public.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.types.d.ts +485 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.types.js +78 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.types.js.map +1 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.universal.d.ts +609 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.universal.js +348 -0
- package/build/cjs/src/data-v1-data-permissions-permissions.universal.js.map +1 -0
- package/build/es/index.d.ts +1 -0
- package/build/es/index.js +2 -0
- package/build/es/index.js.map +1 -0
- package/build/es/index.typings.d.ts +1 -0
- package/build/es/index.typings.js +2 -0
- package/build/es/index.typings.js.map +1 -0
- package/build/es/meta.d.ts +1 -0
- package/build/es/meta.js +2 -0
- package/build/es/meta.js.map +1 -0
- package/build/es/package.json +3 -0
- package/build/es/src/data-v1-data-permissions-permissions.context.d.ts +10 -0
- package/build/es/src/data-v1-data-permissions-permissions.context.js +10 -0
- package/build/es/src/data-v1-data-permissions-permissions.context.js.map +1 -0
- package/build/es/src/data-v1-data-permissions-permissions.http.d.ts +24 -0
- package/build/es/src/data-v1-data-permissions-permissions.http.js +158 -0
- package/build/es/src/data-v1-data-permissions-permissions.http.js.map +1 -0
- package/build/es/src/data-v1-data-permissions-permissions.meta.d.ts +22 -0
- package/build/es/src/data-v1-data-permissions-permissions.meta.js +112 -0
- package/build/es/src/data-v1-data-permissions-permissions.meta.js.map +1 -0
- package/build/es/src/data-v1-data-permissions-permissions.public.d.ts +59 -0
- package/build/es/src/data-v1-data-permissions-permissions.public.js +34 -0
- package/build/es/src/data-v1-data-permissions-permissions.public.js.map +1 -0
- package/build/es/src/data-v1-data-permissions-permissions.types.d.ts +485 -0
- package/build/es/src/data-v1-data-permissions-permissions.types.js +75 -0
- package/build/es/src/data-v1-data-permissions-permissions.types.js.map +1 -0
- package/build/es/src/data-v1-data-permissions-permissions.universal.d.ts +609 -0
- package/build/es/src/data-v1-data-permissions-permissions.universal.js +316 -0
- package/build/es/src/data-v1-data-permissions-permissions.universal.js.map +1 -0
- package/build/internal/cjs/index.d.ts +1 -0
- package/build/internal/cjs/index.js +18 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +1 -0
- package/build/internal/cjs/index.typings.js +18 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/meta.d.ts +1 -0
- package/build/internal/cjs/meta.js +18 -0
- package/build/internal/cjs/meta.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.context.d.ts +10 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.context.js +22 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.context.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.http.d.ts +24 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.http.js +167 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.http.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.meta.d.ts +22 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.meta.js +144 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.meta.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.public.d.ts +59 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.public.js +52 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.public.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.types.d.ts +485 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.types.js +78 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.types.js.map +1 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.universal.d.ts +609 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.universal.js +348 -0
- package/build/internal/cjs/src/data-v1-data-permissions-permissions.universal.js.map +1 -0
- package/build/internal/es/index.d.ts +1 -0
- package/build/internal/es/index.js +2 -0
- package/build/internal/es/index.js.map +1 -0
- package/build/internal/es/index.typings.d.ts +1 -0
- package/build/internal/es/index.typings.js +2 -0
- package/build/internal/es/index.typings.js.map +1 -0
- package/build/internal/es/meta.d.ts +1 -0
- package/build/internal/es/meta.js +2 -0
- package/build/internal/es/meta.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.context.d.ts +10 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.context.js +10 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.context.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.http.d.ts +24 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.http.js +158 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.http.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.meta.d.ts +22 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.meta.js +112 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.meta.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.public.d.ts +59 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.public.js +34 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.public.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.types.d.ts +485 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.types.js +75 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.types.js.map +1 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.universal.d.ts +609 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.universal.js +316 -0
- package/build/internal/es/src/data-v1-data-permissions-permissions.universal.js.map +1 -0
- package/meta/package.json +3 -0
- package/package.json +52 -0
|
@@ -0,0 +1,609 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Permissions configuration of a data collection.
|
|
3
|
+
*
|
|
4
|
+
* Describes who can perform certain data operations on a collection.
|
|
5
|
+
*/
|
|
6
|
+
export interface DataPermissions {
|
|
7
|
+
/** Data Collection ID that is subject of these permissions */
|
|
8
|
+
_id?: string;
|
|
9
|
+
/** Access level for data items read */
|
|
10
|
+
itemRead?: AccessLevel;
|
|
11
|
+
/** Access level for data items insert */
|
|
12
|
+
itemInsert?: AccessLevel;
|
|
13
|
+
/** Access level for data items update */
|
|
14
|
+
itemUpdate?: AccessLevel;
|
|
15
|
+
/** Access level for data items removal */
|
|
16
|
+
itemRemove?: AccessLevel;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Describes who can perform certain action.
|
|
20
|
+
* Each level includes all levels below it (except UNDEFINED).
|
|
21
|
+
*/
|
|
22
|
+
export declare enum AccessLevel {
|
|
23
|
+
/** Not set */
|
|
24
|
+
UNKNOWN = "UNKNOWN",
|
|
25
|
+
/** Any subject, including visitors */
|
|
26
|
+
ANYONE = "ANYONE",
|
|
27
|
+
/** Any signed-in user (both site members and collaborators) */
|
|
28
|
+
SITE_MEMBER = "SITE_MEMBER",
|
|
29
|
+
/** Any signed-in user, but site members only have access to own items */
|
|
30
|
+
SITE_MEMBER_AUTHOR = "SITE_MEMBER_AUTHOR",
|
|
31
|
+
/** Site collaborator that has a role with CMS Access permission */
|
|
32
|
+
CMS_EDITOR = "CMS_EDITOR",
|
|
33
|
+
/** CMS administrators and users or roles granted with special access */
|
|
34
|
+
PRIVILEGED = "PRIVILEGED"
|
|
35
|
+
}
|
|
36
|
+
/** Special access granted to user or role */
|
|
37
|
+
export interface SpecialPermissions extends SpecialPermissionsSubjectOneOf {
|
|
38
|
+
/** User ID that is subject of these permissions */
|
|
39
|
+
userId?: string;
|
|
40
|
+
/** Policy ID of (custom) role that is subject of these permissions */
|
|
41
|
+
policyId?: string;
|
|
42
|
+
/**
|
|
43
|
+
* ID of this special access, so it can be managed separately
|
|
44
|
+
* @readonly
|
|
45
|
+
*/
|
|
46
|
+
_id?: string;
|
|
47
|
+
/** If data item read is allowed */
|
|
48
|
+
itemRead?: Access;
|
|
49
|
+
/** If data item insert is allowed */
|
|
50
|
+
itemInsert?: Access;
|
|
51
|
+
/** If data item update is allowed */
|
|
52
|
+
itemUpdate?: Access;
|
|
53
|
+
/** If data item remove is allowed */
|
|
54
|
+
itemRemove?: Access;
|
|
55
|
+
}
|
|
56
|
+
/** @oneof */
|
|
57
|
+
export interface SpecialPermissionsSubjectOneOf {
|
|
58
|
+
/** User ID that is subject of these permissions */
|
|
59
|
+
userId?: string;
|
|
60
|
+
/** Policy ID of (custom) role that is subject of these permissions */
|
|
61
|
+
policyId?: string;
|
|
62
|
+
}
|
|
63
|
+
export declare enum Access {
|
|
64
|
+
/** Action is not specifically allowed, but can be allowed by top-level permissions */
|
|
65
|
+
UNSPECIFIED = "UNSPECIFIED",
|
|
66
|
+
/** Action is specifically allowed */
|
|
67
|
+
ALLOWED = "ALLOWED"
|
|
68
|
+
}
|
|
69
|
+
export interface GetPermissionsRequest {
|
|
70
|
+
/** Data Collection ID to get permissions for */
|
|
71
|
+
dataCollectionId: string;
|
|
72
|
+
}
|
|
73
|
+
export interface GetPermissionsResponse {
|
|
74
|
+
/** Requested data permissions */
|
|
75
|
+
dataPermissions?: DataPermissions;
|
|
76
|
+
}
|
|
77
|
+
export interface UpdatePermissionsRequest {
|
|
78
|
+
/** Data permissions to update */
|
|
79
|
+
dataPermissions: DataPermissions;
|
|
80
|
+
}
|
|
81
|
+
export interface UpdatePermissionsResponse {
|
|
82
|
+
/** Updated data permissions */
|
|
83
|
+
dataPermissions?: DataPermissions;
|
|
84
|
+
}
|
|
85
|
+
export interface AddSpecialPermissionsRequest {
|
|
86
|
+
/** Data Collection ID to add special permission for */
|
|
87
|
+
dataCollectionId: string;
|
|
88
|
+
/** Special permissions to add */
|
|
89
|
+
specialPermissions: SpecialPermissions;
|
|
90
|
+
}
|
|
91
|
+
export interface AddSpecialPermissionsResponse {
|
|
92
|
+
/** Added special data permissions */
|
|
93
|
+
specialPermissions?: SpecialPermissions;
|
|
94
|
+
}
|
|
95
|
+
export interface UpdateSpecialPermissionsRequest {
|
|
96
|
+
/** Special permissions to update */
|
|
97
|
+
specialPermissions: SpecialPermissions;
|
|
98
|
+
}
|
|
99
|
+
export interface UpdateSpecialPermissionsResponse {
|
|
100
|
+
/** Updated special data permissions */
|
|
101
|
+
specialPermissions?: SpecialPermissions;
|
|
102
|
+
}
|
|
103
|
+
export interface RemoveSpecialPermissionsRequest {
|
|
104
|
+
/** Special permissions ID to remove */
|
|
105
|
+
specialPermissionsId: string;
|
|
106
|
+
}
|
|
107
|
+
export interface RemoveSpecialPermissionsResponse {
|
|
108
|
+
}
|
|
109
|
+
export interface GetMyPermissionsRequest {
|
|
110
|
+
/** Data Collection ID to get permission for */
|
|
111
|
+
dataCollectionId: string;
|
|
112
|
+
}
|
|
113
|
+
export interface GetMyPermissionsResponse {
|
|
114
|
+
/** If data item read is allowed */
|
|
115
|
+
itemRead?: boolean;
|
|
116
|
+
/** If data item insert is allowed */
|
|
117
|
+
itemInsert?: boolean;
|
|
118
|
+
/** If data item update is allowed */
|
|
119
|
+
itemUpdate?: boolean;
|
|
120
|
+
/** If data item remove is allowed */
|
|
121
|
+
itemRemove?: boolean;
|
|
122
|
+
}
|
|
123
|
+
export interface MigrateCustomRolesRequest {
|
|
124
|
+
/** Role ID to update, if empty updates all roles in scope */
|
|
125
|
+
policyId?: string | null;
|
|
126
|
+
}
|
|
127
|
+
export interface MigrateCustomRolesResponse {
|
|
128
|
+
}
|
|
129
|
+
export interface PolicyAssignmentsUpdated extends PolicyAssignmentsUpdatedEventOneOf {
|
|
130
|
+
policyAssigned?: PolicyAssigned;
|
|
131
|
+
policyUnassigned?: PolicyUnassigned;
|
|
132
|
+
policyAssignmentUpdated?: PolicyAssignmentUpdated;
|
|
133
|
+
}
|
|
134
|
+
/** @oneof */
|
|
135
|
+
export interface PolicyAssignmentsUpdatedEventOneOf {
|
|
136
|
+
policyAssigned?: PolicyAssigned;
|
|
137
|
+
policyUnassigned?: PolicyUnassigned;
|
|
138
|
+
policyAssignmentUpdated?: PolicyAssignmentUpdated;
|
|
139
|
+
}
|
|
140
|
+
export interface PolicyAssigned {
|
|
141
|
+
subject?: Subject;
|
|
142
|
+
assignment?: PolicyAssignment[];
|
|
143
|
+
}
|
|
144
|
+
export interface Subject {
|
|
145
|
+
/** ID of identity assigned to the asset. */
|
|
146
|
+
_id?: string;
|
|
147
|
+
/** Type of identity assigned to the asset. Supported subject types include user IDs, account IDs, and app IDs. */
|
|
148
|
+
subjectType?: SubjectType;
|
|
149
|
+
/** Context of identity assigned to the asset. For example, a `subjectType` = `USER` will have `context` = `ACCOUNT`. */
|
|
150
|
+
context?: SubjectContext;
|
|
151
|
+
}
|
|
152
|
+
export declare enum SubjectType {
|
|
153
|
+
UNKNOWN = "UNKNOWN",
|
|
154
|
+
ACCOUNT = "ACCOUNT",
|
|
155
|
+
USER = "USER",
|
|
156
|
+
USER_GROUP = "USER_GROUP",
|
|
157
|
+
MEMBER_GROUP = "MEMBER_GROUP",
|
|
158
|
+
VISITOR_GROUP = "VISITOR_GROUP",
|
|
159
|
+
EXTERNAL_APP = "EXTERNAL_APP",
|
|
160
|
+
ACCOUNT_GROUP = "ACCOUNT_GROUP",
|
|
161
|
+
WIX_APP = "WIX_APP"
|
|
162
|
+
}
|
|
163
|
+
export interface SubjectContext {
|
|
164
|
+
_id?: string;
|
|
165
|
+
contextType?: SubjectContextType;
|
|
166
|
+
}
|
|
167
|
+
export declare enum SubjectContextType {
|
|
168
|
+
UNKNOWN_CTX = "UNKNOWN_CTX",
|
|
169
|
+
ORG_CTX = "ORG_CTX",
|
|
170
|
+
ACCOUNT_CTX = "ACCOUNT_CTX"
|
|
171
|
+
}
|
|
172
|
+
export interface PolicyAssignment {
|
|
173
|
+
policyId?: string;
|
|
174
|
+
resource?: ResourcePath;
|
|
175
|
+
condition?: PolicyCondition;
|
|
176
|
+
assignmentId?: string | null;
|
|
177
|
+
}
|
|
178
|
+
export interface ResourcePath {
|
|
179
|
+
organization?: string | null;
|
|
180
|
+
account?: string | null;
|
|
181
|
+
site?: string | null;
|
|
182
|
+
resource?: Resource;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A custom resource. Is used to represent some asset that is not a direct resource context (site or account), but something custom.
|
|
186
|
+
* For example: payment method, blog post, domain, logo.
|
|
187
|
+
*/
|
|
188
|
+
export interface Resource {
|
|
189
|
+
/** The resource id. */
|
|
190
|
+
_id?: string | null;
|
|
191
|
+
/** The resource type */
|
|
192
|
+
type?: string | null;
|
|
193
|
+
}
|
|
194
|
+
export interface PolicyCondition {
|
|
195
|
+
/** The type of the condition */
|
|
196
|
+
condition?: ConditionType;
|
|
197
|
+
}
|
|
198
|
+
export interface ConditionType extends ConditionTypeOfOneOf {
|
|
199
|
+
/** @deprecated */
|
|
200
|
+
simpleCondition?: SimpleCondition;
|
|
201
|
+
/** A logic combination between several conditions, with an operator between them */
|
|
202
|
+
joinedConditions?: JoinedCondition;
|
|
203
|
+
/** @deprecated */
|
|
204
|
+
environmentCondition?: EnvironmentCondition;
|
|
205
|
+
/** A single condition */
|
|
206
|
+
condition?: Condition;
|
|
207
|
+
}
|
|
208
|
+
/** @oneof */
|
|
209
|
+
export interface ConditionTypeOfOneOf {
|
|
210
|
+
/** @deprecated */
|
|
211
|
+
simpleCondition?: SimpleCondition;
|
|
212
|
+
/** A logic combination between several conditions, with an operator between them */
|
|
213
|
+
joinedConditions?: JoinedCondition;
|
|
214
|
+
/** @deprecated */
|
|
215
|
+
environmentCondition?: EnvironmentCondition;
|
|
216
|
+
/** A single condition */
|
|
217
|
+
condition?: Condition;
|
|
218
|
+
}
|
|
219
|
+
export interface SimpleCondition {
|
|
220
|
+
attrName?: string;
|
|
221
|
+
value?: SimpleConditionValue;
|
|
222
|
+
op?: SimpleConditionOperator;
|
|
223
|
+
conditionModelId?: string;
|
|
224
|
+
}
|
|
225
|
+
export interface SimpleConditionValue extends SimpleConditionValueValueOneOf {
|
|
226
|
+
attrName?: string;
|
|
227
|
+
stringValue?: string;
|
|
228
|
+
boolValue?: boolean;
|
|
229
|
+
}
|
|
230
|
+
/** @oneof */
|
|
231
|
+
export interface SimpleConditionValueValueOneOf {
|
|
232
|
+
attrName?: string;
|
|
233
|
+
stringValue?: string;
|
|
234
|
+
boolValue?: boolean;
|
|
235
|
+
}
|
|
236
|
+
export declare enum SimpleConditionOperator {
|
|
237
|
+
UNKNOWN_SIMPLE_OP = "UNKNOWN_SIMPLE_OP",
|
|
238
|
+
EQUAL = "EQUAL"
|
|
239
|
+
}
|
|
240
|
+
export interface JoinedCondition {
|
|
241
|
+
/** The operator that should be used when evaluating the condition */
|
|
242
|
+
op?: JoinedConditionOperator;
|
|
243
|
+
/** The conditions that should be evaluated, and then joined using the operator provided */
|
|
244
|
+
conditions?: ConditionType[];
|
|
245
|
+
}
|
|
246
|
+
export declare enum JoinedConditionOperator {
|
|
247
|
+
UNKNOWN_JOIN_OP = "UNKNOWN_JOIN_OP",
|
|
248
|
+
OR = "OR",
|
|
249
|
+
AND = "AND"
|
|
250
|
+
}
|
|
251
|
+
export interface EnvironmentCondition extends EnvironmentConditionConditionOneOf {
|
|
252
|
+
experimentCondition?: ExperimentCondition;
|
|
253
|
+
}
|
|
254
|
+
/** @oneof */
|
|
255
|
+
export interface EnvironmentConditionConditionOneOf {
|
|
256
|
+
experimentCondition?: ExperimentCondition;
|
|
257
|
+
}
|
|
258
|
+
export interface ExperimentCondition {
|
|
259
|
+
spec?: string;
|
|
260
|
+
fallbackValue?: string;
|
|
261
|
+
expectedValue?: string;
|
|
262
|
+
}
|
|
263
|
+
export interface Condition {
|
|
264
|
+
/** The unique identifier of the condition model. Indicates which actions the condition is working on */
|
|
265
|
+
conditionModelId?: string;
|
|
266
|
+
/** The operator that should be evaluated */
|
|
267
|
+
operator?: ConditionOperator;
|
|
268
|
+
}
|
|
269
|
+
export interface ConditionOperator extends ConditionOperatorOperatorsOneOf {
|
|
270
|
+
/** Comparison of equality - will be evaluated to true if the given parties are equal */
|
|
271
|
+
equals?: EqualOperator;
|
|
272
|
+
/** Regex operator - will be evaluated to true if the given value matches the provided regex */
|
|
273
|
+
like?: LikeOperator;
|
|
274
|
+
/** Petri experiment - will be evaluated using petri. */
|
|
275
|
+
experiment?: ExperimentOperator;
|
|
276
|
+
/** Operator that indicates a dependency on another subject being allowed to perform something. */
|
|
277
|
+
dependOn?: DependOnOperator;
|
|
278
|
+
}
|
|
279
|
+
/** @oneof */
|
|
280
|
+
export interface ConditionOperatorOperatorsOneOf {
|
|
281
|
+
/** Comparison of equality - will be evaluated to true if the given parties are equal */
|
|
282
|
+
equals?: EqualOperator;
|
|
283
|
+
/** Regex operator - will be evaluated to true if the given value matches the provided regex */
|
|
284
|
+
like?: LikeOperator;
|
|
285
|
+
/** Petri experiment - will be evaluated using petri. */
|
|
286
|
+
experiment?: ExperimentOperator;
|
|
287
|
+
/** Operator that indicates a dependency on another subject being allowed to perform something. */
|
|
288
|
+
dependOn?: DependOnOperator;
|
|
289
|
+
}
|
|
290
|
+
export interface EqualOperator {
|
|
291
|
+
/** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the other side (attribute/value) */
|
|
292
|
+
attrName?: string;
|
|
293
|
+
/** The value to compare to. If the two parties are equal - we will return true. */
|
|
294
|
+
value?: ConditionValue;
|
|
295
|
+
}
|
|
296
|
+
export interface ConditionValue extends ConditionValueValueOneOf {
|
|
297
|
+
/** 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. */
|
|
298
|
+
attrName?: string;
|
|
299
|
+
/** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */
|
|
300
|
+
stringValue?: string;
|
|
301
|
+
/** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */
|
|
302
|
+
boolValue?: boolean;
|
|
303
|
+
}
|
|
304
|
+
/** @oneof */
|
|
305
|
+
export interface ConditionValueValueOneOf {
|
|
306
|
+
/** 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. */
|
|
307
|
+
attrName?: string;
|
|
308
|
+
/** a value with a string type. Will be compared to the attribute provided, and be true only if they match the operator. */
|
|
309
|
+
stringValue?: string;
|
|
310
|
+
/** a value with a boolean type. Will be compared to the attribute provided, and be true only if they match the operator. */
|
|
311
|
+
boolValue?: boolean;
|
|
312
|
+
}
|
|
313
|
+
export interface LikeOperator {
|
|
314
|
+
/** The attribute which should be compared. The attribute will be first evaluated to a value, and then compared the regex values provided. */
|
|
315
|
+
attrName?: string;
|
|
316
|
+
/** 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 */
|
|
317
|
+
values?: string[];
|
|
318
|
+
}
|
|
319
|
+
export interface ExperimentOperator {
|
|
320
|
+
/** The spec to conduct the experiment on. */
|
|
321
|
+
spec?: string;
|
|
322
|
+
/** The value to use if the experiment could not be conducted */
|
|
323
|
+
fallbackValue?: string;
|
|
324
|
+
/** The expected value of the experiment conduction. If it matches the actual value - true will be returned. Otherwise - false. */
|
|
325
|
+
expectedValue?: string;
|
|
326
|
+
}
|
|
327
|
+
/** Implies that the policy takes affect only if the depend on subject is permitted as well. */
|
|
328
|
+
export interface DependOnOperator {
|
|
329
|
+
/** 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 */
|
|
330
|
+
dependOnSubject?: Subject;
|
|
331
|
+
}
|
|
332
|
+
export interface PolicyUnassigned {
|
|
333
|
+
subject?: Subject;
|
|
334
|
+
assignment?: PolicyAssignment[];
|
|
335
|
+
}
|
|
336
|
+
export interface PolicyAssignmentUpdated {
|
|
337
|
+
subject?: Subject;
|
|
338
|
+
fromAssignment?: PolicyAssignment[];
|
|
339
|
+
toAssignment?: PolicyAssignment[];
|
|
340
|
+
}
|
|
341
|
+
export interface Empty {
|
|
342
|
+
}
|
|
343
|
+
export interface PolicyAuthorizationDataUpdated {
|
|
344
|
+
policyId?: string;
|
|
345
|
+
fromPolicyStatements?: PolicyStatement[];
|
|
346
|
+
toPolicyStatements?: PolicyStatement[];
|
|
347
|
+
policyType?: PolicyType;
|
|
348
|
+
policyOwner?: PolicyOwner;
|
|
349
|
+
}
|
|
350
|
+
export interface PolicyStatement {
|
|
351
|
+
/** @readonly */
|
|
352
|
+
_id?: string | null;
|
|
353
|
+
permissions?: string[];
|
|
354
|
+
scopes?: string[];
|
|
355
|
+
effect?: Effect;
|
|
356
|
+
condition?: PolicyCondition;
|
|
357
|
+
}
|
|
358
|
+
export declare enum Effect {
|
|
359
|
+
UNKNOWN_EFFECT = "UNKNOWN_EFFECT",
|
|
360
|
+
ALLOW = "ALLOW",
|
|
361
|
+
DENY = "DENY"
|
|
362
|
+
}
|
|
363
|
+
export declare enum PolicyType {
|
|
364
|
+
UNKNOWN_STATUS = "UNKNOWN_STATUS",
|
|
365
|
+
PREDEFINED = "PREDEFINED",
|
|
366
|
+
CUSTOM = "CUSTOM",
|
|
367
|
+
INLINE_CUSTOM = "INLINE_CUSTOM"
|
|
368
|
+
}
|
|
369
|
+
export interface PolicyOwner {
|
|
370
|
+
type?: PolicyOwnerType;
|
|
371
|
+
_id?: string;
|
|
372
|
+
}
|
|
373
|
+
export declare enum PolicyOwnerType {
|
|
374
|
+
UNKNOWN_TYPE = "UNKNOWN_TYPE",
|
|
375
|
+
WIX = "WIX",
|
|
376
|
+
WIX_ACCOUNT = "WIX_ACCOUNT"
|
|
377
|
+
}
|
|
378
|
+
export interface DomainEvent extends DomainEventBodyOneOf {
|
|
379
|
+
createdEvent?: EntityCreatedEvent;
|
|
380
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
381
|
+
deletedEvent?: EntityDeletedEvent;
|
|
382
|
+
actionEvent?: ActionEvent;
|
|
383
|
+
/**
|
|
384
|
+
* Unique event ID.
|
|
385
|
+
* Allows clients to ignore duplicate webhooks.
|
|
386
|
+
*/
|
|
387
|
+
_id?: string;
|
|
388
|
+
/**
|
|
389
|
+
* Assumes actions are also always typed to an entity_type
|
|
390
|
+
* Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
|
|
391
|
+
*/
|
|
392
|
+
entityFqdn?: string;
|
|
393
|
+
/**
|
|
394
|
+
* This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
|
|
395
|
+
* This is although the created/updated/deleted notion is duplication of the oneof types
|
|
396
|
+
* Example: created/updated/deleted/started/completed/email_opened
|
|
397
|
+
*/
|
|
398
|
+
slug?: string;
|
|
399
|
+
/** ID of the entity associated with the event. */
|
|
400
|
+
entityId?: string;
|
|
401
|
+
/** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
|
|
402
|
+
eventTime?: Date | null;
|
|
403
|
+
/**
|
|
404
|
+
* Whether the event was triggered as a result of a privacy regulation application
|
|
405
|
+
* (for example, GDPR).
|
|
406
|
+
*/
|
|
407
|
+
triggeredByAnonymizeRequest?: boolean | null;
|
|
408
|
+
/** If present, indicates the action that triggered the event. */
|
|
409
|
+
originatedFrom?: string | null;
|
|
410
|
+
/**
|
|
411
|
+
* A sequence number defining the order of updates to the underlying entity.
|
|
412
|
+
* For example, given that some entity was updated at 16:00 and than again at 16:01,
|
|
413
|
+
* it is guaranteed that the sequence number of the second update is strictly higher than the first.
|
|
414
|
+
* As the consumer, you can use this value to ensure that you handle messages in the correct order.
|
|
415
|
+
* To do so, you will need to persist this number on your end, and compare the sequence number from the
|
|
416
|
+
* message against the one you have stored. Given that the stored number is higher, you should ignore the message.
|
|
417
|
+
*/
|
|
418
|
+
entityEventSequence?: string | null;
|
|
419
|
+
}
|
|
420
|
+
/** @oneof */
|
|
421
|
+
export interface DomainEventBodyOneOf {
|
|
422
|
+
createdEvent?: EntityCreatedEvent;
|
|
423
|
+
updatedEvent?: EntityUpdatedEvent;
|
|
424
|
+
deletedEvent?: EntityDeletedEvent;
|
|
425
|
+
actionEvent?: ActionEvent;
|
|
426
|
+
}
|
|
427
|
+
export interface EntityCreatedEvent {
|
|
428
|
+
entity?: string;
|
|
429
|
+
}
|
|
430
|
+
export interface RestoreInfo {
|
|
431
|
+
deletedDate?: Date | null;
|
|
432
|
+
}
|
|
433
|
+
export interface EntityUpdatedEvent {
|
|
434
|
+
/**
|
|
435
|
+
* Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
|
|
436
|
+
* This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
|
|
437
|
+
* We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
|
|
438
|
+
*/
|
|
439
|
+
currentEntity?: string;
|
|
440
|
+
}
|
|
441
|
+
export interface EntityDeletedEvent {
|
|
442
|
+
/** Entity that was deleted */
|
|
443
|
+
deletedEntity?: string | null;
|
|
444
|
+
}
|
|
445
|
+
export interface ActionEvent {
|
|
446
|
+
body?: string;
|
|
447
|
+
}
|
|
448
|
+
interface SpecialPermissionsNonNullableFields {
|
|
449
|
+
userId: string;
|
|
450
|
+
policyId: string;
|
|
451
|
+
_id: string;
|
|
452
|
+
itemRead: Access;
|
|
453
|
+
itemInsert: Access;
|
|
454
|
+
itemUpdate: Access;
|
|
455
|
+
itemRemove: Access;
|
|
456
|
+
}
|
|
457
|
+
interface DataPermissionsNonNullableFields {
|
|
458
|
+
_id: string;
|
|
459
|
+
itemRead: AccessLevel;
|
|
460
|
+
itemInsert: AccessLevel;
|
|
461
|
+
itemUpdate: AccessLevel;
|
|
462
|
+
itemRemove: AccessLevel;
|
|
463
|
+
specialPermissions: SpecialPermissionsNonNullableFields[];
|
|
464
|
+
}
|
|
465
|
+
export interface GetPermissionsResponseNonNullableFields {
|
|
466
|
+
dataPermissions?: DataPermissionsNonNullableFields;
|
|
467
|
+
}
|
|
468
|
+
export interface UpdatePermissionsResponseNonNullableFields {
|
|
469
|
+
dataPermissions?: DataPermissionsNonNullableFields;
|
|
470
|
+
}
|
|
471
|
+
export interface AddSpecialPermissionsResponseNonNullableFields {
|
|
472
|
+
specialPermissions?: SpecialPermissionsNonNullableFields;
|
|
473
|
+
}
|
|
474
|
+
export interface UpdateSpecialPermissionsResponseNonNullableFields {
|
|
475
|
+
specialPermissions?: SpecialPermissionsNonNullableFields;
|
|
476
|
+
}
|
|
477
|
+
export interface GetMyPermissionsResponseNonNullableFields {
|
|
478
|
+
itemRead: boolean;
|
|
479
|
+
itemInsert: boolean;
|
|
480
|
+
itemUpdate: boolean;
|
|
481
|
+
itemRemove: boolean;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Returns data permissions for a data collection
|
|
485
|
+
* @param dataCollectionId - Data Collection ID to get permissions for
|
|
486
|
+
* @public
|
|
487
|
+
* @documentationMaturity preview
|
|
488
|
+
* @requiredField dataCollectionId
|
|
489
|
+
* @permissionId WIX_DATA.PERMISSIONS_READ
|
|
490
|
+
* @permissionScope Manage All Data Resources
|
|
491
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
492
|
+
* @permissionScope Manage Data Collections
|
|
493
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
494
|
+
* @applicableIdentity APP
|
|
495
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.GetPermissions
|
|
496
|
+
*/
|
|
497
|
+
export declare function getPermissions(dataCollectionId: string): Promise<GetPermissionsResponse & GetPermissionsResponseNonNullableFields>;
|
|
498
|
+
/**
|
|
499
|
+
* Updates data permissions for a data collection
|
|
500
|
+
*
|
|
501
|
+
* NOTE that special permissions are not updated using this API, use dedicated methods for it.
|
|
502
|
+
* @param dataPermissions - Data permissions to update
|
|
503
|
+
* @public
|
|
504
|
+
* @documentationMaturity preview
|
|
505
|
+
* @requiredField dataPermissions
|
|
506
|
+
* @requiredField dataPermissions._id
|
|
507
|
+
* @requiredField dataPermissions.itemInsert
|
|
508
|
+
* @requiredField dataPermissions.itemRead
|
|
509
|
+
* @requiredField dataPermissions.itemRemove
|
|
510
|
+
* @requiredField dataPermissions.itemUpdate
|
|
511
|
+
* @permissionId WIX_DATA.PERMISSIONS_UPDATE
|
|
512
|
+
* @permissionScope Manage All Data Resources
|
|
513
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
514
|
+
* @permissionScope Manage Data Collections
|
|
515
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
516
|
+
* @applicableIdentity APP
|
|
517
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdatePermissions
|
|
518
|
+
*/
|
|
519
|
+
export declare function updatePermissions(dataPermissions: DataPermissions): Promise<UpdatePermissionsResponse & UpdatePermissionsResponseNonNullableFields>;
|
|
520
|
+
/**
|
|
521
|
+
* Adds special data permissions for particular user/group
|
|
522
|
+
* Errors:
|
|
523
|
+
* - `ALREADY_EXISTS` in case if special permission for same subject already exists
|
|
524
|
+
* @param dataCollectionId - Data Collection ID to add special permission for
|
|
525
|
+
* @public
|
|
526
|
+
* @documentationMaturity preview
|
|
527
|
+
* @requiredField dataCollectionId
|
|
528
|
+
* @requiredField options
|
|
529
|
+
* @requiredField options.specialPermissions
|
|
530
|
+
* @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL
|
|
531
|
+
* @permissionScope Manage All Data Resources
|
|
532
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
533
|
+
* @permissionScope Manage Data Collections
|
|
534
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
535
|
+
* @applicableIdentity APP
|
|
536
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.AddSpecialPermissions
|
|
537
|
+
*/
|
|
538
|
+
export declare function addSpecialPermissions(dataCollectionId: string, options: AddSpecialPermissionsOptions): Promise<AddSpecialPermissionsResponse & AddSpecialPermissionsResponseNonNullableFields>;
|
|
539
|
+
export interface AddSpecialPermissionsOptions {
|
|
540
|
+
/** Special permissions to add */
|
|
541
|
+
specialPermissions: SpecialPermissions;
|
|
542
|
+
}
|
|
543
|
+
/**
|
|
544
|
+
* Updates special data permissions for particular user/group.
|
|
545
|
+
* Any omitted permissions will be set to UNSPECIFIED.
|
|
546
|
+
* @param _id - ID of this special access, so it can be managed separately
|
|
547
|
+
* @public
|
|
548
|
+
* @documentationMaturity preview
|
|
549
|
+
* @requiredField _id
|
|
550
|
+
* @requiredField specialPermissions
|
|
551
|
+
* @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL
|
|
552
|
+
* @permissionScope Manage All Data Resources
|
|
553
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
554
|
+
* @permissionScope Manage Data Collections
|
|
555
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
556
|
+
* @applicableIdentity APP
|
|
557
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.UpdateSpecialPermissions
|
|
558
|
+
*/
|
|
559
|
+
export declare function updateSpecialPermissions(_id: string, specialPermissions: UpdateSpecialPermissions): Promise<UpdateSpecialPermissionsResponse & UpdateSpecialPermissionsResponseNonNullableFields>;
|
|
560
|
+
export interface UpdateSpecialPermissions {
|
|
561
|
+
/** User ID that is subject of these permissions */
|
|
562
|
+
userId?: string;
|
|
563
|
+
/** Policy ID of (custom) role that is subject of these permissions */
|
|
564
|
+
policyId?: string;
|
|
565
|
+
/**
|
|
566
|
+
* ID of this special access, so it can be managed separately
|
|
567
|
+
* @readonly
|
|
568
|
+
*/
|
|
569
|
+
_id?: string;
|
|
570
|
+
/** If data item read is allowed */
|
|
571
|
+
itemRead?: Access;
|
|
572
|
+
/** If data item insert is allowed */
|
|
573
|
+
itemInsert?: Access;
|
|
574
|
+
/** If data item update is allowed */
|
|
575
|
+
itemUpdate?: Access;
|
|
576
|
+
/** If data item remove is allowed */
|
|
577
|
+
itemRemove?: Access;
|
|
578
|
+
}
|
|
579
|
+
/**
|
|
580
|
+
* Deletes special data permissions for particular user/group
|
|
581
|
+
* @param specialPermissionsId - Special permissions ID to remove
|
|
582
|
+
* @public
|
|
583
|
+
* @documentationMaturity preview
|
|
584
|
+
* @requiredField specialPermissionsId
|
|
585
|
+
* @permissionId WIX_DATA.PERMISSIONS_UPDATE_SPECIAL
|
|
586
|
+
* @permissionScope Manage All Data Resources
|
|
587
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
588
|
+
* @permissionScope Manage Data Collections
|
|
589
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
590
|
+
* @applicableIdentity APP
|
|
591
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.RemoveSpecialPermissions
|
|
592
|
+
*/
|
|
593
|
+
export declare function removeSpecialPermissions(specialPermissionsId: string): Promise<void>;
|
|
594
|
+
/**
|
|
595
|
+
* Returns current user permissions for given data collection
|
|
596
|
+
* @param dataCollectionId - Data Collection ID to get permission for
|
|
597
|
+
* @public
|
|
598
|
+
* @documentationMaturity preview
|
|
599
|
+
* @requiredField dataCollectionId
|
|
600
|
+
* @permissionId WIX_DATA.PERMISSIONS_GET_ALLOWED
|
|
601
|
+
* @permissionScope Manage All Data Resources
|
|
602
|
+
* @permissionScopeId SCOPE.DC-DATA.MANAGE-ALL
|
|
603
|
+
* @permissionScope Manage Data Collections
|
|
604
|
+
* @permissionScopeId SCOPE.DC-DATA.DATA-COLLECTIONS-MANAGE
|
|
605
|
+
* @applicableIdentity APP
|
|
606
|
+
* @fqn wix.cloud.permissions.v1.DataPermissionsService.GetMyPermissions
|
|
607
|
+
*/
|
|
608
|
+
export declare function getMyPermissions(dataCollectionId: string): Promise<GetMyPermissionsResponse & GetMyPermissionsResponseNonNullableFields>;
|
|
609
|
+
export {};
|