@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.
Files changed (94) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +5 -5
  4. package/dist/index.js.map +1 -1
  5. package/dist/types.d.ts +1 -9
  6. package/dist/types.d.ts.map +1 -1
  7. package/dist/types.js.map +1 -1
  8. package/dist/validations/ADR45.d.ts +2 -2
  9. package/dist/validations/ADR45.d.ts.map +1 -1
  10. package/dist/validations/ADR45.js +7 -8
  11. package/dist/validations/ADR45.js.map +1 -1
  12. package/dist/validations/access-checker/access.d.ts +2 -2
  13. package/dist/validations/access-checker/access.d.ts.map +1 -1
  14. package/dist/validations/access-checker/access.js +15 -17
  15. package/dist/validations/access-checker/access.js.map +1 -1
  16. package/dist/validations/access-checker/emotes.d.ts +2 -2
  17. package/dist/validations/access-checker/emotes.d.ts.map +1 -1
  18. package/dist/validations/access-checker/emotes.js +7 -8
  19. package/dist/validations/access-checker/emotes.js.map +1 -1
  20. package/dist/validations/access-checker/items/collection-asset.js +2 -2
  21. package/dist/validations/access-checker/items/collection-asset.js.map +1 -1
  22. package/dist/validations/access-checker/items/items.d.ts +1 -3
  23. package/dist/validations/access-checker/items/items.d.ts.map +1 -1
  24. package/dist/validations/access-checker/items/items.js +23 -24
  25. package/dist/validations/access-checker/items/items.js.map +1 -1
  26. package/dist/validations/access-checker/profiles.d.ts +6 -6
  27. package/dist/validations/access-checker/profiles.d.ts.map +1 -1
  28. package/dist/validations/access-checker/profiles.js +59 -61
  29. package/dist/validations/access-checker/profiles.js.map +1 -1
  30. package/dist/validations/access-checker/scenes.d.ts +2 -2
  31. package/dist/validations/access-checker/scenes.d.ts.map +1 -1
  32. package/dist/validations/access-checker/scenes.js +216 -216
  33. package/dist/validations/access-checker/scenes.js.map +1 -1
  34. package/dist/validations/access-checker/stores.d.ts +2 -2
  35. package/dist/validations/access-checker/stores.d.ts.map +1 -1
  36. package/dist/validations/access-checker/stores.js +14 -15
  37. package/dist/validations/access-checker/stores.js.map +1 -1
  38. package/dist/validations/access-checker/wearables.d.ts +2 -2
  39. package/dist/validations/access-checker/wearables.d.ts.map +1 -1
  40. package/dist/validations/access-checker/wearables.js +9 -10
  41. package/dist/validations/access-checker/wearables.js.map +1 -1
  42. package/dist/validations/content.d.ts +6 -6
  43. package/dist/validations/content.d.ts.map +1 -1
  44. package/dist/validations/content.js +44 -50
  45. package/dist/validations/content.js.map +1 -1
  46. package/dist/validations/entity-structure.d.ts +2 -2
  47. package/dist/validations/entity-structure.d.ts.map +1 -1
  48. package/dist/validations/entity-structure.js +10 -11
  49. package/dist/validations/entity-structure.js.map +1 -1
  50. package/dist/validations/index.d.ts +9 -4
  51. package/dist/validations/index.d.ts.map +1 -1
  52. package/dist/validations/index.js +7 -7
  53. package/dist/validations/index.js.map +1 -1
  54. package/dist/validations/ipfs-hashing.d.ts +2 -2
  55. package/dist/validations/ipfs-hashing.d.ts.map +1 -1
  56. package/dist/validations/ipfs-hashing.js +8 -10
  57. package/dist/validations/ipfs-hashing.js.map +1 -1
  58. package/dist/validations/items/emotes.d.ts +4 -4
  59. package/dist/validations/items/emotes.d.ts.map +1 -1
  60. package/dist/validations/items/emotes.js +22 -24
  61. package/dist/validations/items/emotes.js.map +1 -1
  62. package/dist/validations/items/items.d.ts +4 -4
  63. package/dist/validations/items/items.d.ts.map +1 -1
  64. package/dist/validations/items/items.js +54 -55
  65. package/dist/validations/items/items.js.map +1 -1
  66. package/dist/validations/items/wearables.d.ts +4 -3
  67. package/dist/validations/items/wearables.d.ts.map +1 -1
  68. package/dist/validations/items/wearables.js +16 -17
  69. package/dist/validations/items/wearables.js.map +1 -1
  70. package/dist/validations/metadata-schema.d.ts +2 -2
  71. package/dist/validations/metadata-schema.d.ts.map +1 -1
  72. package/dist/validations/metadata-schema.js +17 -21
  73. package/dist/validations/metadata-schema.js.map +1 -1
  74. package/dist/validations/profile.d.ts +6 -6
  75. package/dist/validations/profile.d.ts.map +1 -1
  76. package/dist/validations/profile.js +55 -63
  77. package/dist/validations/profile.js.map +1 -1
  78. package/dist/validations/scene.d.ts +3 -3
  79. package/dist/validations/scene.d.ts.map +1 -1
  80. package/dist/validations/scene.js +5 -7
  81. package/dist/validations/scene.js.map +1 -1
  82. package/dist/validations/signature.d.ts +2 -2
  83. package/dist/validations/signature.d.ts.map +1 -1
  84. package/dist/validations/signature.js +6 -8
  85. package/dist/validations/signature.js.map +1 -1
  86. package/dist/validations/size.d.ts +2 -2
  87. package/dist/validations/size.d.ts.map +1 -1
  88. package/dist/validations/size.js +28 -29
  89. package/dist/validations/size.js.map +1 -1
  90. package/dist/validations/validations.d.ts +9 -9
  91. package/dist/validations/validations.d.ts.map +1 -1
  92. package/dist/validations/validations.js +34 -38
  93. package/dist/validations/validations.js.map +1 -1
  94. 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,EAA6B,UAAU,EAAE,MAAM,aAAa,CAAA;AAgCnE;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,UAsSpB,CAAA"}
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
- exports.scenes = {
14
- validate: async ({ externalCalls, logs, subGraphs }, deployment) => {
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)
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
- 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
84
- };
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
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
- 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`);
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
- const checkParcelAccess = async (x, y, timestamp, ethAddress, externalCalls) => {
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
- 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);
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
- 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}`);
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
- return (0, types_1.fromErrors)(...errors);
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,uCAAmE;AAgCnE;;;GAGG;AACU,QAAA,MAAM,GAAe;IAChC,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,EAAE;QACjE,MAAM,MAAM,GAAG,IAAI,CAAC,SAAS,CAAC,yBAAyB,CAAC,CAAA;QACxD,MAAM,iBAAiB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CAAC,GAAG,CAAC,CAAA;qBAClG;iBACF;gBAAC,OAAO,CAAC,EAAE;oBACV,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;iBACxG;aACF;iBAAM;gBACL,MAAM,CAAC,IAAI,CACT,4HAA4H,OAAO,EAAE,CACtI,CAAA;aACF;SACF;QAED,OAAO,IAAA,kBAAU,EAAC,GAAG,MAAM,CAAC,CAAA;IAC9B,CAAC;CACF,CAAA;AAED,gBAAgB;AAChB,KAAK,UAAU,KAAK,CAClB,SAA2B,EAC3B,QAAgB,EAChB,WAAmB,IAAI,EACvB,qBAAsD;IAEtD,OAAO,QAAQ,GAAG,CAAC,EAAE;QACnB,IAAI;YACF,OAAO,MAAM,SAAS,EAAE,CAAA;YACxB,6EAA6E;YAC7E,wDAAwD;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,QAAQ,EAAE,CAAA;YACV,IAAI,QAAQ,GAAG,CAAC,EAAE;gBAChB,IAAI,qBAAqB,EAAE;oBACzB,qBAAqB,CAAC,QAAQ,CAAC,CAAA;iBAChC;gBACD,MAAM,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,EAAE,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
+ {"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,C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2E,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;iBAClG;aACF;YAAC,OAAO,CAAC,EAAE;gBACV,MAAM,CAAC,IAAI,CAAC,2EAA2E,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;aACxG;SACF;aAAM;YACL,MAAM,CAAC,IAAI,CACT,4HAA4H,OAAO,EAAE,CACtI,CAAA;SACF;KACF;IAED,OAAO,IAAA,kBAAU,EAAC,GAAG,MAAM,CAAC,CAAA;AAC9B,CAAC;AAxSD,wBAwSC;AAED,gBAAgB;AAChB,KAAK,UAAU,KAAK,CAClB,SAA2B,EAC3B,QAAgB,EAChB,WAAmB,IAAI,EACvB,qBAAsD;IAEtD,OAAO,QAAQ,GAAG,CAAC,EAAE;QACnB,IAAI;YACF,OAAO,MAAM,SAAS,EAAE,CAAA;YACxB,6EAA6E;YAC7E,wDAAwD;SACzD;QAAC,OAAO,KAAK,EAAE;YACd,QAAQ,EAAE,CAAA;YACV,IAAI,QAAQ,GAAG,CAAC,EAAE;gBAChB,IAAI,qBAAqB,EAAE;oBACzB,qBAAqB,CAAC,QAAQ,CAAC,CAAA;iBAChC;gBACD,MAAM,IAAI,OAAO,CAAO,CAAC,GAAG,EAAE,EAAE,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 { Validation } from '../../types';
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 const stores: Validation;
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,EAAM,UAAU,EAAoB,MAAM,aAAa,CAAA;AAU9D;;;GAGG;AACH,eAAO,MAAM,MAAM,EAAE,UAuBpB,CAAA"}
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
- exports.stores = {
20
- validate: async ({ externalCalls }, deployment) => {
21
- const pointers = deployment.entity.pointers;
22
- const ethAddress = externalCalls.ownerAddress(deployment.auditInfo);
23
- if (pointers.length !== 1)
24
- return (0, types_1.validationFailed)(`Only one pointer is allowed when you create a Store. Received: ${pointers}`);
25
- const pointer = pointers[0].toLowerCase();
26
- const offchainAsset = await parseUrnNoFail(pointer);
27
- if (!offchainAsset)
28
- return (0, types_1.validationFailed)(`Store pointers should be a urn, for example (urn:decentraland:off-chain:marketplace-stores:{address}). Invalid pointer: ${pointer}`);
29
- if (offchainAsset.id !== ethAddress)
30
- 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()}).`);
31
- return types_1.OK;
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,uCAA8D;AAE9D,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;AACU,QAAA,MAAM,GAAe;IAChC,QAAQ,EAAE,KAAK,EAAE,EAAE,aAAa,EAAE,EAAE,UAAU,EAAE,EAAE;QAChD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAA;QAC3C,MAAM,UAAU,GAAG,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;QAEnE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;YACvB,OAAO,IAAA,wBAAgB,EAAC,kEAAkE,QAAQ,EAAE,CAAC,CAAA;QAEvG,MAAM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D,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 { Validation } from '../../types';
2
- export declare const wearables: Validation;
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,EAA8B,UAAU,EAAE,MAAM,aAAa,CAAA;AAGpE,eAAO,MAAM,SAAS,EAAE,UAYvB,CAAA"}
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
- exports.wearables = {
6
- validate: async (components, deployment) => {
7
- return items_1.itemsValidation.validate(components, deployment, [
8
- 'off-chain',
9
- 'blockchain-collection-v1-asset',
10
- 'blockchain-collection-v2-asset',
11
- 'blockchain-collection-third-party'
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;AAElC,QAAA,SAAS,GAAe;IACnC,QAAQ,EAAE,KAAK,EACb,UAAyF,EACzF,UAAU,EACV,EAAE;QACF,OAAO,uBAAe,CAAC,QAAQ,CAAC,UAAU,EAAE,UAAU,EAAE;YACtD,WAAW;YACX,gCAAgC;YAChC,gCAAgC;YAChC,mCAAmC;SACpC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA"}
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 { Validation } from '../types';
2
- export declare const allHashesWereUploadedOrStored: Validation;
3
- export declare const allHashesInUploadedFilesAreReportedInTheEntity: Validation;
4
- export declare const allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45: Validation;
5
- export declare const allMandatoryContentFilesArePresent: Validation;
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: Validation;
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;AAYjD,eAAO,MAAM,6BAA6B,EAAE,UAkB3C,CAAA;AAED,eAAO,MAAM,8CAA8C,EAAE,UAa5D,CAAA;AAED,eAAO,MAAM,6DAA6D,EAAE,UAgB1E,CAAA;AAEF,eAAO,MAAM,kCAAkC,EAAE,UAe/C,CAAA;AAEF;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,UAKrB,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"}