@dcl/content-validator 4.2.4-4064084886.commit-5f698c4 → 4.2.4-4135566596.commit-6ae9fb8
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/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -9
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validations/ADR45.d.ts +2 -2
- package/dist/validations/ADR45.d.ts.map +1 -1
- package/dist/validations/ADR45.js +7 -8
- package/dist/validations/ADR45.js.map +1 -1
- package/dist/validations/access-checker/access.d.ts +2 -2
- package/dist/validations/access-checker/access.d.ts.map +1 -1
- package/dist/validations/access-checker/access.js +15 -17
- package/dist/validations/access-checker/access.js.map +1 -1
- package/dist/validations/access-checker/emotes.d.ts +2 -2
- package/dist/validations/access-checker/emotes.d.ts.map +1 -1
- package/dist/validations/access-checker/emotes.js +7 -8
- package/dist/validations/access-checker/emotes.js.map +1 -1
- package/dist/validations/access-checker/items/collection-asset.js +2 -2
- package/dist/validations/access-checker/items/collection-asset.js.map +1 -1
- package/dist/validations/access-checker/items/items.d.ts +1 -3
- package/dist/validations/access-checker/items/items.d.ts.map +1 -1
- package/dist/validations/access-checker/items/items.js +23 -24
- package/dist/validations/access-checker/items/items.js.map +1 -1
- package/dist/validations/access-checker/profiles.d.ts +6 -6
- package/dist/validations/access-checker/profiles.d.ts.map +1 -1
- package/dist/validations/access-checker/profiles.js +59 -61
- package/dist/validations/access-checker/profiles.js.map +1 -1
- package/dist/validations/access-checker/scenes.d.ts +2 -2
- package/dist/validations/access-checker/scenes.d.ts.map +1 -1
- package/dist/validations/access-checker/scenes.js +216 -216
- package/dist/validations/access-checker/scenes.js.map +1 -1
- package/dist/validations/access-checker/stores.d.ts +2 -2
- package/dist/validations/access-checker/stores.d.ts.map +1 -1
- package/dist/validations/access-checker/stores.js +14 -15
- package/dist/validations/access-checker/stores.js.map +1 -1
- package/dist/validations/access-checker/wearables.d.ts +2 -2
- package/dist/validations/access-checker/wearables.d.ts.map +1 -1
- package/dist/validations/access-checker/wearables.js +9 -10
- package/dist/validations/access-checker/wearables.js.map +1 -1
- package/dist/validations/content.d.ts +6 -6
- package/dist/validations/content.d.ts.map +1 -1
- package/dist/validations/content.js +44 -50
- package/dist/validations/content.js.map +1 -1
- package/dist/validations/entity-structure.d.ts +2 -2
- package/dist/validations/entity-structure.d.ts.map +1 -1
- package/dist/validations/entity-structure.js +10 -11
- package/dist/validations/entity-structure.js.map +1 -1
- package/dist/validations/index.d.ts +9 -4
- package/dist/validations/index.d.ts.map +1 -1
- package/dist/validations/index.js +7 -7
- package/dist/validations/index.js.map +1 -1
- package/dist/validations/ipfs-hashing.d.ts +2 -2
- package/dist/validations/ipfs-hashing.d.ts.map +1 -1
- package/dist/validations/ipfs-hashing.js +8 -10
- package/dist/validations/ipfs-hashing.js.map +1 -1
- package/dist/validations/items/emotes.d.ts +4 -4
- package/dist/validations/items/emotes.d.ts.map +1 -1
- package/dist/validations/items/emotes.js +22 -24
- package/dist/validations/items/emotes.js.map +1 -1
- package/dist/validations/items/items.d.ts +4 -4
- package/dist/validations/items/items.d.ts.map +1 -1
- package/dist/validations/items/items.js +54 -55
- package/dist/validations/items/items.js.map +1 -1
- package/dist/validations/items/wearables.d.ts +4 -3
- package/dist/validations/items/wearables.d.ts.map +1 -1
- package/dist/validations/items/wearables.js +16 -17
- package/dist/validations/items/wearables.js.map +1 -1
- package/dist/validations/metadata-schema.d.ts +2 -2
- package/dist/validations/metadata-schema.d.ts.map +1 -1
- package/dist/validations/metadata-schema.js +17 -21
- package/dist/validations/metadata-schema.js.map +1 -1
- package/dist/validations/profile.d.ts +6 -6
- package/dist/validations/profile.d.ts.map +1 -1
- package/dist/validations/profile.js +55 -63
- package/dist/validations/profile.js.map +1 -1
- package/dist/validations/scene.d.ts +3 -3
- package/dist/validations/scene.d.ts.map +1 -1
- package/dist/validations/scene.js +5 -7
- package/dist/validations/scene.js.map +1 -1
- package/dist/validations/signature.d.ts +2 -2
- package/dist/validations/signature.d.ts.map +1 -1
- package/dist/validations/signature.js +6 -8
- package/dist/validations/signature.js.map +1 -1
- package/dist/validations/size.d.ts +2 -2
- package/dist/validations/size.d.ts.map +1 -1
- package/dist/validations/size.js +28 -29
- package/dist/validations/size.js.map +1 -1
- package/dist/validations/validations.d.ts +9 -9
- package/dist/validations/validations.d.ts.map +1 -1
- package/dist/validations/validations.js +34 -38
- package/dist/validations/validations.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"scenes.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAA6B,MAAM,aAAa,CAAA;AAgCzG;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,GAAG,MAAM,GAAG,WAAW,CAAC,EACpF,UAAU,EAAE,oBAAoB,qDAsSjC"}
|
|
@@ -10,231 +10,231 @@ const types_1 = require("../../types");
|
|
|
10
10
|
* Checks if the given address has access to the given parcel at the given timestamp.
|
|
11
11
|
* @public
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
};
|
|
37
|
-
try {
|
|
38
|
-
return (await subGraphs.L1.landManager.query(query, variables)).authorizations;
|
|
39
|
-
}
|
|
40
|
-
catch (error) {
|
|
41
|
-
logger.error(`Error fetching authorizations for ${owner}`);
|
|
42
|
-
throw error;
|
|
43
|
-
}
|
|
13
|
+
async function scenes(components, deployment) {
|
|
14
|
+
const { externalCalls, subGraphs, logs } = components;
|
|
15
|
+
const logger = logs.getLogger('scenes access validator');
|
|
16
|
+
const getAuthorizations = async (owner, operator, timestamp) => {
|
|
17
|
+
const query = `
|
|
18
|
+
query GetAuthorizations($owner: String!, $operator: String!, $timestamp: Int!) {
|
|
19
|
+
authorizations(
|
|
20
|
+
where: {
|
|
21
|
+
owner: $owner,
|
|
22
|
+
operator: $operator,
|
|
23
|
+
createdAt_lte: $timestamp
|
|
24
|
+
},
|
|
25
|
+
orderBy: timestamp,
|
|
26
|
+
orderDirection: desc
|
|
27
|
+
) {
|
|
28
|
+
type
|
|
29
|
+
isApproved
|
|
30
|
+
}
|
|
31
|
+
}`;
|
|
32
|
+
const variables = {
|
|
33
|
+
owner,
|
|
34
|
+
operator,
|
|
35
|
+
timestamp: Math.floor(timestamp / 1000) // js(ms) -> UNIX(s)
|
|
44
36
|
};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
const getParcel = async (x, y, timestamp) => {
|
|
94
|
-
/**
|
|
95
|
-
* You can use `owner`, `operator` and `updateOperator` to check the current value for that parcel.
|
|
96
|
-
* Keep in mind that each association (owners, operators, etc) is capped to a thousand (1000) results.
|
|
97
|
-
* For more information, you can use the query explorer at https://thegraph.com/explorer/subgraph/decentraland/land-manager
|
|
98
|
-
*/
|
|
99
|
-
const query = `
|
|
100
|
-
query GetParcel($x: Int!, $y: Int!, $timestamp: Int!) {
|
|
101
|
-
parcels(where:{ x: $x, y: $y }) {
|
|
102
|
-
estates(
|
|
103
|
-
where: { createdAt_lte: $timestamp },
|
|
104
|
-
orderBy: createdAt,
|
|
105
|
-
orderDirection: desc,
|
|
106
|
-
first: 1
|
|
107
|
-
) {
|
|
108
|
-
estateId
|
|
109
|
-
}
|
|
110
|
-
owners(
|
|
111
|
-
where: { createdAt_lte: $timestamp },
|
|
112
|
-
orderBy: timestamp,
|
|
113
|
-
orderDirection: desc,
|
|
114
|
-
first: 1
|
|
115
|
-
) {
|
|
116
|
-
address
|
|
117
|
-
}
|
|
118
|
-
operators(
|
|
119
|
-
where: { createdAt_lte: $timestamp },
|
|
120
|
-
orderBy: timestamp,
|
|
121
|
-
orderDirection: desc,
|
|
122
|
-
first: 1
|
|
123
|
-
) {
|
|
124
|
-
address
|
|
125
|
-
}
|
|
126
|
-
updateOperators(
|
|
127
|
-
where: { createdAt_lte: $timestamp },
|
|
128
|
-
orderBy: timestamp,
|
|
129
|
-
orderDirection: desc,
|
|
130
|
-
first: 1
|
|
131
|
-
) {
|
|
132
|
-
address
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}`;
|
|
136
|
-
const variables = {
|
|
137
|
-
x,
|
|
138
|
-
y,
|
|
139
|
-
timestamp: Math.floor(timestamp / 1000) // UNIX
|
|
140
|
-
};
|
|
141
|
-
try {
|
|
142
|
-
const r = await subGraphs.L1.landManager.query(query, variables);
|
|
143
|
-
if (r.parcels && r.parcels.length)
|
|
144
|
-
return r.parcels[0];
|
|
145
|
-
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp}): ${JSON.stringify(r)}`);
|
|
146
|
-
throw new Error(`Error fetching parcel (${x}, ${y}), ${timestamp}`);
|
|
147
|
-
}
|
|
148
|
-
catch (error) {
|
|
149
|
-
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp})`);
|
|
150
|
-
throw error;
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
const hasAccessThroughAuthorizations = async (owner, ethAddress, timestamp) => {
|
|
154
|
-
/* You also get access if you received:
|
|
155
|
-
* - an authorization with isApproved and type Operator, ApprovalForAll or UpdateManager
|
|
156
|
-
* at that time
|
|
157
|
-
*/
|
|
158
|
-
const authorizations = await getAuthorizations(owner.toLowerCase(), ethAddress.toLowerCase(), timestamp);
|
|
159
|
-
const firstOperatorAuthorization = authorizations.find((authorization) => authorization.type === 'Operator');
|
|
160
|
-
const firstApprovalForAllAuthorization = authorizations.find((authorization) => authorization.type === 'ApprovalForAll');
|
|
161
|
-
const firstUpdateManagerAuthorization = authorizations.find((authorization) => authorization.type === 'UpdateManager');
|
|
162
|
-
if (firstOperatorAuthorization?.isApproved ||
|
|
163
|
-
firstApprovalForAllAuthorization?.isApproved ||
|
|
164
|
-
firstUpdateManagerAuthorization?.isApproved) {
|
|
165
|
-
return true;
|
|
166
|
-
}
|
|
167
|
-
return false;
|
|
168
|
-
};
|
|
169
|
-
const hasAccessThroughFirstLevelAuthorities = async (target, ethAddress) => {
|
|
170
|
-
const firstLevelAuthorities = [...target.owners, ...target.operators, ...target.updateOperators]
|
|
171
|
-
.filter((addressSnapshot) => addressSnapshot.address)
|
|
172
|
-
.map((addressSnapshot) => addressSnapshot.address.toLowerCase());
|
|
173
|
-
return firstLevelAuthorities.includes(ethAddress.toLowerCase());
|
|
174
|
-
};
|
|
175
|
-
const isEstateUpdateAuthorized = async (estateId, timestamp, ethAddress) => {
|
|
176
|
-
const estate = await getEstate(estateId.toString(), timestamp);
|
|
177
|
-
if (estate) {
|
|
178
|
-
return ((await hasAccessThroughFirstLevelAuthorities(estate, ethAddress)) ||
|
|
179
|
-
(await hasAccessThroughAuthorizations(estate.owners[0].address, ethAddress, timestamp)));
|
|
180
|
-
}
|
|
181
|
-
throw new Error(`Couldn\'t find the state ${estateId}`);
|
|
37
|
+
try {
|
|
38
|
+
return (await subGraphs.L1.landManager.query(query, variables)).authorizations;
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
logger.error(`Error fetching authorizations for ${owner}`);
|
|
42
|
+
throw error;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const getEstate = async (estateId, timestamp) => {
|
|
46
|
+
/**
|
|
47
|
+
* You can use `owner`, `operator` and `updateOperator` to check the current value for that estate.
|
|
48
|
+
* Keep in mind that each association (owners, operators, etc) is capped to a thousand (1000) results.
|
|
49
|
+
* For more information, you can use the query explorer at https://thegraph.com/explorer/subgraph/decentraland/land-manager
|
|
50
|
+
*/
|
|
51
|
+
const query = `
|
|
52
|
+
query GetEstate($estateId: String!, $timestamp: Int!) {
|
|
53
|
+
estates(where:{ id: $estateId }) {
|
|
54
|
+
id
|
|
55
|
+
owners(
|
|
56
|
+
where: { createdAt_lte: $timestamp },
|
|
57
|
+
orderBy: timestamp,
|
|
58
|
+
orderDirection: desc,
|
|
59
|
+
first: 1
|
|
60
|
+
) {
|
|
61
|
+
address
|
|
62
|
+
}
|
|
63
|
+
operators(
|
|
64
|
+
where: { createdAt_lte: $timestamp },
|
|
65
|
+
orderBy: timestamp,
|
|
66
|
+
orderDirection: desc,
|
|
67
|
+
first: 1
|
|
68
|
+
) {
|
|
69
|
+
address
|
|
70
|
+
}
|
|
71
|
+
updateOperators(
|
|
72
|
+
where: { createdAt_lte: $timestamp },
|
|
73
|
+
orderBy: timestamp,
|
|
74
|
+
orderDirection: desc,
|
|
75
|
+
first: 1
|
|
76
|
+
) {
|
|
77
|
+
address
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}`;
|
|
81
|
+
const variables = {
|
|
82
|
+
estateId,
|
|
83
|
+
timestamp: Math.floor(timestamp / 1000) // UNIX
|
|
182
84
|
};
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
85
|
+
try {
|
|
86
|
+
return (await subGraphs.L1.landManager.query(query, variables)).estates[0];
|
|
87
|
+
}
|
|
88
|
+
catch (error) {
|
|
89
|
+
logger.error(`Error fetching estate (${estateId})`);
|
|
90
|
+
throw error;
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const getParcel = async (x, y, timestamp) => {
|
|
94
|
+
/**
|
|
95
|
+
* You can use `owner`, `operator` and `updateOperator` to check the current value for that parcel.
|
|
96
|
+
* Keep in mind that each association (owners, operators, etc) is capped to a thousand (1000) results.
|
|
97
|
+
* For more information, you can use the query explorer at https://thegraph.com/explorer/subgraph/decentraland/land-manager
|
|
98
|
+
*/
|
|
99
|
+
const query = `
|
|
100
|
+
query GetParcel($x: Int!, $y: Int!, $timestamp: Int!) {
|
|
101
|
+
parcels(where:{ x: $x, y: $y }) {
|
|
102
|
+
estates(
|
|
103
|
+
where: { createdAt_lte: $timestamp },
|
|
104
|
+
orderBy: createdAt,
|
|
105
|
+
orderDirection: desc,
|
|
106
|
+
first: 1
|
|
107
|
+
) {
|
|
108
|
+
estateId
|
|
109
|
+
}
|
|
110
|
+
owners(
|
|
111
|
+
where: { createdAt_lte: $timestamp },
|
|
112
|
+
orderBy: timestamp,
|
|
113
|
+
orderDirection: desc,
|
|
114
|
+
first: 1
|
|
115
|
+
) {
|
|
116
|
+
address
|
|
117
|
+
}
|
|
118
|
+
operators(
|
|
119
|
+
where: { createdAt_lte: $timestamp },
|
|
120
|
+
orderBy: timestamp,
|
|
121
|
+
orderDirection: desc,
|
|
122
|
+
first: 1
|
|
123
|
+
) {
|
|
124
|
+
address
|
|
125
|
+
}
|
|
126
|
+
updateOperators(
|
|
127
|
+
where: { createdAt_lte: $timestamp },
|
|
128
|
+
orderBy: timestamp,
|
|
129
|
+
orderDirection: desc,
|
|
130
|
+
first: 1
|
|
131
|
+
) {
|
|
132
|
+
address
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}`;
|
|
136
|
+
const variables = {
|
|
137
|
+
x,
|
|
138
|
+
y,
|
|
139
|
+
timestamp: Math.floor(timestamp / 1000) // UNIX
|
|
198
140
|
};
|
|
199
|
-
|
|
141
|
+
try {
|
|
142
|
+
const r = await subGraphs.L1.landManager.query(query, variables);
|
|
143
|
+
if (r.parcels && r.parcels.length)
|
|
144
|
+
return r.parcels[0];
|
|
145
|
+
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp}): ${JSON.stringify(r)}`);
|
|
146
|
+
throw new Error(`Error fetching parcel (${x}, ${y}), ${timestamp}`);
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
logger.error(`Error fetching parcel (${x}, ${y}, ${timestamp})`);
|
|
150
|
+
throw error;
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
const hasAccessThroughAuthorizations = async (owner, ethAddress, timestamp) => {
|
|
154
|
+
/* You also get access if you received:
|
|
155
|
+
* - an authorization with isApproved and type Operator, ApprovalForAll or UpdateManager
|
|
156
|
+
* at that time
|
|
157
|
+
*/
|
|
158
|
+
const authorizations = await getAuthorizations(owner.toLowerCase(), ethAddress.toLowerCase(), timestamp);
|
|
159
|
+
const firstOperatorAuthorization = authorizations.find((authorization) => authorization.type === 'Operator');
|
|
160
|
+
const firstApprovalForAllAuthorization = authorizations.find((authorization) => authorization.type === 'ApprovalForAll');
|
|
161
|
+
const firstUpdateManagerAuthorization = authorizations.find((authorization) => authorization.type === 'UpdateManager');
|
|
162
|
+
if (firstOperatorAuthorization?.isApproved ||
|
|
163
|
+
firstApprovalForAllAuthorization?.isApproved ||
|
|
164
|
+
firstUpdateManagerAuthorization?.isApproved) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
return false;
|
|
168
|
+
};
|
|
169
|
+
const hasAccessThroughFirstLevelAuthorities = async (target, ethAddress) => {
|
|
170
|
+
const firstLevelAuthorities = [...target.owners, ...target.operators, ...target.updateOperators]
|
|
171
|
+
.filter((addressSnapshot) => addressSnapshot.address)
|
|
172
|
+
.map((addressSnapshot) => addressSnapshot.address.toLowerCase());
|
|
173
|
+
return firstLevelAuthorities.includes(ethAddress.toLowerCase());
|
|
174
|
+
};
|
|
175
|
+
const isEstateUpdateAuthorized = async (estateId, timestamp, ethAddress) => {
|
|
176
|
+
const estate = await getEstate(estateId.toString(), timestamp);
|
|
177
|
+
if (estate) {
|
|
178
|
+
return ((await hasAccessThroughFirstLevelAuthorities(estate, ethAddress)) ||
|
|
179
|
+
(await hasAccessThroughAuthorizations(estate.owners[0].address, ethAddress, timestamp)));
|
|
180
|
+
}
|
|
181
|
+
throw new Error(`Couldn\'t find the state ${estateId}`);
|
|
182
|
+
};
|
|
183
|
+
const isParcelUpdateAuthorized = async (x, y, timestamp, ethAddress, _externalCalls) => {
|
|
184
|
+
/* You get direct access if you were the:
|
|
185
|
+
* - owner
|
|
186
|
+
* - operator
|
|
187
|
+
* - update operator
|
|
188
|
+
* at that time
|
|
189
|
+
*/
|
|
190
|
+
const parcel = await getParcel(x, y, timestamp);
|
|
191
|
+
if (parcel) {
|
|
192
|
+
const belongsToEstate = parcel.estates != undefined && parcel.estates.length > 0 && parcel.estates[0].estateId != undefined;
|
|
193
|
+
return ((await hasAccessThroughFirstLevelAuthorities(parcel, ethAddress)) ||
|
|
194
|
+
(await hasAccessThroughAuthorizations(parcel.owners[0].address, ethAddress, timestamp)) ||
|
|
195
|
+
(belongsToEstate && (await isEstateUpdateAuthorized(parcel.estates[0].estateId, timestamp, ethAddress))));
|
|
196
|
+
}
|
|
197
|
+
throw new Error(`Parcel(${x},${y},${timestamp}) not found`);
|
|
198
|
+
};
|
|
199
|
+
const checkParcelAccess = async (x, y, timestamp, ethAddress, externalCalls) => {
|
|
200
|
+
try {
|
|
201
|
+
return await retry(() => isParcelUpdateAuthorized(x, y, timestamp, ethAddress, externalCalls), 5, '0.1s');
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
logger.error(`Error checking parcel access (${x}, ${y}, ${timestamp}, ${ethAddress}).`);
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
const SCENE_LOOKBACK_TIME = (0, ms_1.default)('5m');
|
|
209
|
+
const { entity } = deployment;
|
|
210
|
+
const { pointers, timestamp } = entity;
|
|
211
|
+
const ethAddress = externalCalls.ownerAddress(deployment.auditInfo);
|
|
212
|
+
const errors = [];
|
|
213
|
+
const lowerCasePointers = pointers.map((pointer) => pointer.toLowerCase());
|
|
214
|
+
for (const pointer of lowerCasePointers) {
|
|
215
|
+
const pointerParts = pointer.split(',');
|
|
216
|
+
if (pointerParts.length === 2) {
|
|
217
|
+
const x = parseInt(pointerParts[0], 10);
|
|
218
|
+
const y = parseInt(pointerParts[1], 10);
|
|
200
219
|
try {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
};
|
|
208
|
-
const SCENE_LOOKBACK_TIME = (0, ms_1.default)('5m');
|
|
209
|
-
const { entity } = deployment;
|
|
210
|
-
const { pointers, timestamp } = entity;
|
|
211
|
-
const ethAddress = externalCalls.ownerAddress(deployment.auditInfo);
|
|
212
|
-
const errors = [];
|
|
213
|
-
const lowerCasePointers = pointers.map((pointer) => pointer.toLowerCase());
|
|
214
|
-
for (const pointer of lowerCasePointers) {
|
|
215
|
-
const pointerParts = pointer.split(',');
|
|
216
|
-
if (pointerParts.length === 2) {
|
|
217
|
-
const x = parseInt(pointerParts[0], 10);
|
|
218
|
-
const y = parseInt(pointerParts[1], 10);
|
|
219
|
-
try {
|
|
220
|
-
// Check that the address has access (we check both the present and the 5 min into the past to avoid synchronization issues in the blockchain)
|
|
221
|
-
const hasAccess = (await checkParcelAccess(x, y, timestamp, ethAddress, externalCalls)) ||
|
|
222
|
-
(await checkParcelAccess(x, y, timestamp - SCENE_LOOKBACK_TIME, ethAddress, externalCalls));
|
|
223
|
-
if (!hasAccess) {
|
|
224
|
-
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y})`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
catch (e) {
|
|
228
|
-
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y}). ${e}`);
|
|
220
|
+
// Check that the address has access (we check both the present and the 5 min into the past to avoid synchronization issues in the blockchain)
|
|
221
|
+
const hasAccess = (await checkParcelAccess(x, y, timestamp, ethAddress, externalCalls)) ||
|
|
222
|
+
(await checkParcelAccess(x, y, timestamp - SCENE_LOOKBACK_TIME, ethAddress, externalCalls));
|
|
223
|
+
if (!hasAccess) {
|
|
224
|
+
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y})`);
|
|
229
225
|
}
|
|
230
226
|
}
|
|
231
|
-
|
|
232
|
-
errors.push(`
|
|
227
|
+
catch (e) {
|
|
228
|
+
errors.push(`The provided Eth Address does not have access to the following parcel: (${x},${y}). ${e}`);
|
|
233
229
|
}
|
|
234
230
|
}
|
|
235
|
-
|
|
231
|
+
else {
|
|
232
|
+
errors.push(`Scene pointers should only contain two integers separated by a comma, for example (10,10) or (120,-45). Invalid pointer: ${pointer}`);
|
|
233
|
+
}
|
|
236
234
|
}
|
|
237
|
-
|
|
235
|
+
return (0, types_1.fromErrors)(...errors);
|
|
236
|
+
}
|
|
237
|
+
exports.scenes = scenes;
|
|
238
238
|
/** @internal */
|
|
239
239
|
async function retry(execution, attempts, waitTime = '1s', failedAttemptCallback) {
|
|
240
240
|
while (attempts > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":";;;;;;AACA,4CAAmB;AACnB,
|
|
1
|
+
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":";;;;;;AACA,4CAAmB;AACnB,uCAAyG;AAgCzG;;;GAGG;AACI,KAAK,UAAU,MAAM,CAC1B,UAAoF,EACpF,UAAgC;IAEhC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,UAAU,CAAA;IACrD,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;IACxD,MAAM,iBAAiB,GAAG,KAAK,EAC7B,KAAiB,EACjB,QAAoB,EACpB,SAAoB,EACM,EAAE;QAC5B,MAAM,KAAK,GAAG;;;;;;;;;;;;;;YAcN,CAAA;QAER,MAAM,SAAS,GAAG;YAChB,KAAK;YACL,QAAQ;YACR,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC,oBAAoB;SAC7D,CAAA;QAED,IAAI;YACF,OAAO,CACL,MAAM,SAAS,CAAC,EAAE,CAAC,WAAW,CAAC,KAAK,CAEjC,KAAK,EAAE,SAAS,CAAC,CACrB,CAAC,cAAc,CAAA;SACjB;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,CAAC,KAAK,CAAC,qCAAqC,KAAK,EAAE,CAAC,CAAA;YAC1D,MAAM,KAAK,CAAA;SACZ;IACH,CAAC,CAAA;IAED,MAAM,SAAS,GAAG,KAAK,EAAE,QAAgB,EAAE,SAAoB,EAA+B,EAAE;QAC9F;;;;WAIG;QAEH,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA6BN,CAAA;QAER,MAAM,SAAS,GAAG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AAE,CAAC,UAAU,CAAC,GAAG,EAAE,IAAA,YAAE,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAA;aAChE;iBAAM;gBACL,MAAM,KAAK,CAAA;aACZ;SACF;KACF;IACD,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAA;AAChF,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ContentValidatorComponents, DeploymentToValidate } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Validate that the pointers are valid, and that the Ethereum address has write access to them
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
|
-
export declare
|
|
6
|
+
export declare function stores(components: Pick<ContentValidatorComponents, 'externalCalls' | 'logs' | 'theGraphClient'>, deployment: DeploymentToValidate): Promise<import("../../types").ValidationResponse>;
|
|
7
7
|
//# sourceMappingURL=stores.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/stores.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"stores.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/stores.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAwB,MAAM,aAAa,CAAA;AAUpG;;;GAGG;AACH,wBAAsB,MAAM,CAC1B,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,GAAG,MAAM,GAAG,gBAAgB,CAAC,EACzF,UAAU,EAAE,oBAAoB,qDAsBjC"}
|
|
@@ -16,19 +16,18 @@ const parseUrnNoFail = async (pointer) => {
|
|
|
16
16
|
* Validate that the pointers are valid, and that the Ethereum address has write access to them
|
|
17
17
|
* @public
|
|
18
18
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
19
|
+
async function stores(components, deployment) {
|
|
20
|
+
const pointers = deployment.entity.pointers;
|
|
21
|
+
const ethAddress = components.externalCalls.ownerAddress(deployment.auditInfo);
|
|
22
|
+
if (pointers.length !== 1)
|
|
23
|
+
return (0, types_1.validationFailed)(`Only one pointer is allowed when you create a Store. Received: ${pointers}`);
|
|
24
|
+
const pointer = pointers[0].toLowerCase();
|
|
25
|
+
const offchainAsset = await parseUrnNoFail(pointer);
|
|
26
|
+
if (!offchainAsset)
|
|
27
|
+
return (0, types_1.validationFailed)(`Store pointers should be a urn, for example (urn:decentraland:off-chain:marketplace-stores:{address}). Invalid pointer: ${pointer}`);
|
|
28
|
+
if (offchainAsset.id !== ethAddress)
|
|
29
|
+
return (0, types_1.validationFailed)(`You can only alter your own store. The pointer address and the signer address are different (address:${offchainAsset.id.toLowerCase()} signer: ${ethAddress.toLowerCase()}).`);
|
|
30
|
+
return types_1.OK;
|
|
31
|
+
}
|
|
32
|
+
exports.stores = stores;
|
|
34
33
|
//# sourceMappingURL=stores.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stores.js","sourceRoot":"","sources":["../../../src/validations/access-checker/stores.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,
|
|
1
|
+
{"version":3,"file":"stores.js","sourceRoot":"","sources":["../../../src/validations/access-checker/stores.ts"],"names":[],"mappings":";;;AAAA,oDAA2D;AAC3D,uCAAoG;AAEpG,MAAM,cAAc,GAAG,KAAK,EAAE,OAAe,EAAsC,EAAE;IACnF,IAAI;QACF,MAAM,MAAM,GAAG,MAAM,IAAA,uBAAQ,EAAC,OAAO,CAAC,CAAA;QACtC,IAAI,CAAC,MAAM,IAAI,MAAM,EAAE,IAAI,KAAK,WAAW;YAAE,OAAO,SAAS,CAAA;QAC7D,OAAO,MAAM,CAAA;KACd;IAAC,MAAM,GAAE;AACZ,CAAC,CAAA;AAED;;;GAGG;AACI,KAAK,UAAU,MAAM,CAC1B,UAAyF,EACzF,UAAgC;IAEhC,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAA;IAC3C,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAE9E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QACvB,OAAO,IAAA,wBAAgB,EAAC,kEAAkE,QAAQ,EAAE,CAAC,CAAA;IAEvG,MAAM,OAAO,GAAW,QAAQ,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;IACjD,MAAM,aAAa,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAA;IAEnD,IAAI,CAAC,aAAa;QAChB,OAAO,IAAA,wBAAgB,EACrB,2HAA2H,OAAO,EAAE,CACrI,CAAA;IAEH,IAAI,aAAa,CAAC,EAAE,KAAK,UAAU;QACjC,OAAO,IAAA,wBAAgB,EACrB,wGAAwG,aAAa,CAAC,EAAE,CAAC,WAAW,EAAE,YAAY,UAAU,CAAC,WAAW,EAAE,IAAI,CAC/K,CAAA;IAEH,OAAO,UAAE,CAAA;AACX,CAAC;AAxBD,wBAwBC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
1
|
+
import { ContentValidatorComponents, DeploymentToValidate } from '../../types';
|
|
2
|
+
export declare function wearables(components: Pick<ContentValidatorComponents, 'externalCalls' | 'logs' | 'theGraphClient'>, deployment: DeploymentToValidate): Promise<import("../../types").ValidationResponse>;
|
|
3
3
|
//# sourceMappingURL=wearables.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wearables.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/wearables.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"wearables.d.ts","sourceRoot":"","sources":["../../../src/validations/access-checker/wearables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAG9E,wBAAsB,SAAS,CAC7B,UAAU,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,GAAG,MAAM,GAAG,gBAAgB,CAAC,EACzF,UAAU,EAAE,oBAAoB,qDAQjC"}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.wearables = void 0;
|
|
4
4
|
const items_1 = require("./items/items");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
5
|
+
async function wearables(components, deployment) {
|
|
6
|
+
return (0, items_1.itemsValidation)(components, deployment, [
|
|
7
|
+
'off-chain',
|
|
8
|
+
'blockchain-collection-v1-asset',
|
|
9
|
+
'blockchain-collection-v2-asset',
|
|
10
|
+
'blockchain-collection-third-party'
|
|
11
|
+
]);
|
|
12
|
+
}
|
|
13
|
+
exports.wearables = wearables;
|
|
15
14
|
//# sourceMappingURL=wearables.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wearables.js","sourceRoot":"","sources":["../../../src/validations/access-checker/wearables.ts"],"names":[],"mappings":";;;AACA,yCAA+C;
|
|
1
|
+
{"version":3,"file":"wearables.js","sourceRoot":"","sources":["../../../src/validations/access-checker/wearables.ts"],"names":[],"mappings":";;;AACA,yCAA+C;AAExC,KAAK,UAAU,SAAS,CAC7B,UAAyF,EACzF,UAAgC;IAEhC,OAAO,IAAA,uBAAe,EAAC,UAAU,EAAE,UAAU,EAAE;QAC7C,WAAW;QACX,gCAAgC;QAChC,gCAAgC;QAChC,mCAAmC;KACpC,CAAC,CAAA;AACJ,CAAC;AAVD,8BAUC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare
|
|
3
|
-
export declare
|
|
4
|
-
export declare const allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45:
|
|
5
|
-
export declare const allMandatoryContentFilesArePresent:
|
|
1
|
+
import { ContentValidatorComponents, DeploymentToValidate, ValidateFn } from '../types';
|
|
2
|
+
export declare function allHashesWereUploadedOrStored(components: ContentValidatorComponents, deployment: DeploymentToValidate): Promise<import("../types").ValidationResponse>;
|
|
3
|
+
export declare function allHashesInUploadedFilesAreReportedInTheEntity(components: ContentValidatorComponents, deployment: DeploymentToValidate): Promise<import("../types").ValidationResponse>;
|
|
4
|
+
export declare const allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45: ValidateFn;
|
|
5
|
+
export declare const allMandatoryContentFilesArePresent: ValidateFn;
|
|
6
6
|
/**
|
|
7
7
|
* Validate that uploaded and reported hashes are corrects and files corresponds to snapshots
|
|
8
8
|
* @public
|
|
9
9
|
*/
|
|
10
|
-
export declare const content:
|
|
10
|
+
export declare const content: ValidateFn;
|
|
11
11
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAc,UAAU,EAAE,MAAM,UAAU,CAAA;AAYnG,wBAAsB,6BAA6B,CACjD,UAAU,EAAE,0BAA0B,EACtC,UAAU,EAAE,oBAAoB,kDAiBjC;AAED,wBAAsB,8CAA8C,CAClE,UAAU,EAAE,0BAA0B,EACtC,UAAU,EAAE,oBAAoB,kDAYjC;AAED,eAAO,MAAM,6DAA6D,EAAE,UAgB3E,CAAA;AAED,eAAO,MAAM,kCAAkC,EAAE,UAehD,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,UAKrB,CAAA"}
|