@dcl/content-validator 4.0.27-20230106194717.commit-dd49367 → 4.1.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/dist/content-validator.api.json +73 -180
- package/dist/the-graph-client/the-graph-client.d.ts +1 -5
- package/dist/the-graph-client/the-graph-client.d.ts.map +1 -1
- package/dist/the-graph-client/the-graph-client.js +83 -49
- package/dist/the-graph-client/the-graph-client.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/types.d.ts +23 -38
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/validations/ADR45.d.ts +7 -0
- package/dist/validations/ADR45.d.ts.map +1 -0
- package/dist/validations/ADR45.js +20 -0
- package/dist/validations/ADR45.js.map +1 -0
- package/dist/validations/ADR51.d.ts +1 -1
- package/dist/validations/ADR51.d.ts.map +1 -1
- package/dist/validations/access-checker/items/collection-asset.d.ts +2 -2
- package/dist/validations/access-checker/items/collection-asset.d.ts.map +1 -1
- package/dist/validations/access-checker/items/collection-asset.js +106 -43
- package/dist/validations/access-checker/items/collection-asset.js.map +1 -1
- package/dist/validations/access-checker/items/items.d.ts +3 -3
- package/dist/validations/access-checker/items/items.d.ts.map +1 -1
- package/dist/validations/access-checker/items/third-party-asset.d.ts.map +1 -1
- package/dist/validations/access-checker/items/third-party-asset.js +80 -21
- package/dist/validations/access-checker/items/third-party-asset.js.map +1 -1
- package/dist/validations/access-checker/scenes.d.ts.map +1 -1
- package/dist/validations/access-checker/scenes.js +227 -29
- package/dist/validations/access-checker/scenes.js.map +1 -1
- package/dist/validations/index.d.ts +2 -2
- package/dist/validations/index.d.ts.map +1 -1
- package/dist/validations/index.js +2 -1
- package/dist/validations/index.js.map +1 -1
- package/dist/validations/timestamps.d.ts +1 -1
- package/dist/validations/timestamps.js +2 -2
- package/package.json +4 -9
|
@@ -6,58 +6,256 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.scenes = void 0;
|
|
7
7
|
const ms_1 = __importDefault(require("ms"));
|
|
8
8
|
const types_1 = require("../../types");
|
|
9
|
-
const SCENE_LOOKBACK_TIME = (0, ms_1.default)('5m');
|
|
10
9
|
/**
|
|
11
10
|
* Checks if the given address has access to the given parcel at the given timestamp.
|
|
12
11
|
* @public
|
|
13
12
|
*/
|
|
14
13
|
exports.scenes = {
|
|
15
|
-
validate: async ({ externalCalls,
|
|
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
|
+
}
|
|
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
|
|
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}`);
|
|
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');
|
|
16
209
|
const { entity } = deployment;
|
|
17
210
|
const { pointers, timestamp } = entity;
|
|
18
|
-
const logger = logs.getLogger('scenes-validator');
|
|
19
|
-
let block;
|
|
20
|
-
try {
|
|
21
|
-
// 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)
|
|
22
|
-
const blockInfo = await subGraphs.l1BlockSearch.findBlockForTimestamp(timestamp - SCENE_LOOKBACK_TIME);
|
|
23
|
-
if (blockInfo === undefined) {
|
|
24
|
-
return (0, types_1.fromErrors)('Deployment timestamp is invalid, no matching block found');
|
|
25
|
-
}
|
|
26
|
-
block = blockInfo.block;
|
|
27
|
-
}
|
|
28
|
-
catch (err) {
|
|
29
|
-
return (0, types_1.fromErrors)(`Deployment timestamp is invalid, no matching block found: ${err}`);
|
|
30
|
-
}
|
|
31
211
|
const ethAddress = externalCalls.ownerAddress(deployment.auditInfo);
|
|
32
212
|
const errors = [];
|
|
33
213
|
const lowerCasePointers = pointers.map((pointer) => pointer.toLowerCase());
|
|
34
|
-
const batch = [];
|
|
35
214
|
for (const pointer of lowerCasePointers) {
|
|
36
215
|
const pointerParts = pointer.split(',');
|
|
37
216
|
if (pointerParts.length === 2) {
|
|
38
217
|
const x = parseInt(pointerParts[0], 10);
|
|
39
218
|
const y = parseInt(pointerParts[1], 10);
|
|
40
|
-
|
|
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}`);
|
|
229
|
+
}
|
|
41
230
|
}
|
|
42
231
|
else {
|
|
43
232
|
errors.push(`Scene pointers should only contain two integers separated by a comma, for example (10,10) or (120,-45). Invalid pointer: ${pointer}`);
|
|
44
233
|
}
|
|
45
234
|
}
|
|
235
|
+
return (0, types_1.fromErrors)(...errors);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
/** @internal */
|
|
239
|
+
async function retry(execution, attempts, waitTime = '1s', failedAttemptCallback) {
|
|
240
|
+
while (attempts > 0) {
|
|
46
241
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
242
|
+
return await execution();
|
|
243
|
+
// ^^^^^ never remove this "await" keyword, otherwise this function won't
|
|
244
|
+
// catch the exception and perform the retries
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
attempts--;
|
|
248
|
+
if (attempts > 0) {
|
|
249
|
+
if (failedAttemptCallback) {
|
|
250
|
+
failedAttemptCallback(attempts);
|
|
53
251
|
}
|
|
252
|
+
await new Promise((res) => setTimeout(res, (0, ms_1.default)(waitTime)));
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
throw error;
|
|
54
256
|
}
|
|
55
257
|
}
|
|
56
|
-
catch (err) {
|
|
57
|
-
logger.error(err);
|
|
58
|
-
return (0, types_1.fromErrors)(`Cannot validate deployment`);
|
|
59
|
-
}
|
|
60
|
-
return (0, types_1.fromErrors)(...errors);
|
|
61
258
|
}
|
|
62
|
-
|
|
259
|
+
throw new Error('Please specify more than one attempt for the retry function');
|
|
260
|
+
}
|
|
63
261
|
//# sourceMappingURL=scenes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scenes.js","sourceRoot":"","sources":["../../../src/validations/access-checker/scenes.ts"],"names":[],"mappings":";;;;;;
|
|
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,GAAG,KAAK,EAC7B,KAAiB,EACjB,QAAoB,EACpB,SAAoB,EACM,EAAE;YAC5B,MAAM,KAAK,GAAG;;;;;;;;;;;;;;cAcN,CAAA;YAER,MAAM,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C,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"}
|
|
@@ -12,10 +12,10 @@ export declare const statefulValidations: readonly [import("../types").Validatio
|
|
|
12
12
|
* Stateless validations that are run on a deployment.
|
|
13
13
|
* @public
|
|
14
14
|
*/
|
|
15
|
-
export declare const statelessValidations: readonly [import("../types").Validation, import("../types").Validation, import("../types").Validation];
|
|
15
|
+
export declare const statelessValidations: readonly [import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation];
|
|
16
16
|
/**
|
|
17
17
|
* All validations that are run on a deployment.
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
|
-
export declare const validations: readonly [import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation];
|
|
20
|
+
export declare const validations: readonly [import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation, import("../types").Validation];
|
|
21
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAa9D;;GAEG;AACH,eAAO,MAAM,uBAAuB,eACtB,oBAAoB,iBACjB,aAAa,KAC3B,QAAQ,MAAM,GAAG,MAAM,CAazB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,mBAAmB,oOAAwE,CAAA;AAExG;;;GAGG;AACH,eAAO,MAAM,oBAAoB,uIAA2D,CAAA;AAE5F;;;GAGG;AACH,eAAO,MAAM,WAAW,gWAA6D,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validations = exports.statelessValidations = exports.statefulValidations = exports.calculateDeploymentSize = void 0;
|
|
4
|
+
const ADR45_1 = require("./ADR45");
|
|
4
5
|
const access_1 = require("./access-checker/access");
|
|
5
6
|
const content_1 = require("./content");
|
|
6
7
|
const entity_structure_1 = require("./entity-structure");
|
|
@@ -40,7 +41,7 @@ exports.statefulValidations = [signature_1.signature, access_1.access, size_1.si
|
|
|
40
41
|
* Stateless validations that are run on a deployment.
|
|
41
42
|
* @public
|
|
42
43
|
*/
|
|
43
|
-
exports.statelessValidations = [entity_structure_1.entityStructure, ipfs_hashing_1.ipfsHashing, metadata_schema_1.metadata];
|
|
44
|
+
exports.statelessValidations = [entity_structure_1.entityStructure, ipfs_hashing_1.ipfsHashing, metadata_schema_1.metadata, ADR45_1.adr45];
|
|
44
45
|
/**
|
|
45
46
|
* All validations that are run on a deployment.
|
|
46
47
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/validations/index.ts"],"names":[],"mappings":";;;AACA,oDAAgD;AAChD,uCAAmC;AACnC,yDAAoD;AACpD,iDAA4C;AAC5C,2CAAsC;AACtC,iDAA4C;AAC5C,uDAA4C;AAC5C,uCAAmC;AACnC,2CAAuC;AACvC,iCAA6B;AAE7B;;GAEG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAC1C,UAAgC,EAChC,aAA4B,EACF,EAAE;IAC5B,IAAI,SAAS,GAAG,CAAC,CAAA;IACjB,KAAK,MAAM,IAAI,IAAI,IAAI,GAAG,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE;QACrF,MAAM,YAAY,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/C,IAAI,YAAY,EAAE;YAChB,SAAS,IAAI,YAAY,CAAC,UAAU,CAAA;SACrC;aAAM;YACL,MAAM,WAAW,GAAG,MAAM,aAAa,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAA;YAClE,IAAI,WAAW,KAAK,SAAS;gBAAE,OAAO,0CAA0C,IAAI,EAAE,CAAA;YACtF,SAAS,IAAI,WAAW,CAAA;SACzB;KACF;IACD,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAhBY,QAAA,uBAAuB,2BAgBnC;AAED;;;GAGG;AACU,QAAA,mBAAmB,GAAG,CAAC,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E,cAAK,EAAE,iBAAO,EAAE,iBAAO,CAAU,CAAA;AAExG;;;GAGG;AACU,QAAA,oBAAoB,GAAG,CAAC,kCAAe,EAAE,0BAAW,EAAE,0BAAQ,EAAE,aAAK,CAAU,CAAA;AAE5F;;;GAGG;AACU,QAAA,WAAW,GAAG,CAAC,GAAG,4BAAoB,EAAE,GAAG,2BAAmB,CAAU,CAAA"}
|
|
@@ -14,7 +14,7 @@ export declare const ADR_75_TIMESTAMP: number;
|
|
|
14
14
|
*/
|
|
15
15
|
export declare const ADR_74_TIMESTAMP: number;
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* 1674576000000 = 2023-01-24T15:00:00Z
|
|
18
18
|
* @public
|
|
19
19
|
*/
|
|
20
20
|
export declare const ADR_158_TIMESTAMP: number;
|
|
@@ -17,10 +17,10 @@ exports.ADR_75_TIMESTAMP = process.env.ADR_75_TIMESTAMP ? parseInt(process.env.A
|
|
|
17
17
|
*/
|
|
18
18
|
exports.ADR_74_TIMESTAMP = process.env.ADR_74_TIMESTAMP ? parseInt(process.env.ADR_74_TIMESTAMP) : 1662987600000;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* 1674576000000 = 2023-01-24T15:00:00Z
|
|
21
21
|
* @public
|
|
22
22
|
*/
|
|
23
|
-
exports.ADR_158_TIMESTAMP = process.env.ADR_158_TIMESTAMP ? parseInt(process.env.ADR_158_TIMESTAMP) :
|
|
23
|
+
exports.ADR_158_TIMESTAMP = process.env.ADR_158_TIMESTAMP ? parseInt(process.env.ADR_158_TIMESTAMP) : 1674576000000;
|
|
24
24
|
/**
|
|
25
25
|
* DCL Launch Day
|
|
26
26
|
* @public
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/content-validator",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "Catalyst content validations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
"api-extractor": "yarn clean-api-extractor && api-extractor run --local --verbose --diagnostics --typescript-compiler-folder ./node_modules/typescript",
|
|
10
10
|
"api-extractor-ci": "yarn clean-api-extractor && api-extractor run --typescript-compiler-folder ./node_modules/typescript",
|
|
11
11
|
"build": "tsc -p tsconfig.json",
|
|
12
|
-
"build:watch": "tsc -p tsconfig.json --watch",
|
|
13
12
|
"lint:check": "eslint '**/*.{js,ts}'",
|
|
14
13
|
"lint:fix": "eslint '**/*.{js,ts}' --fix",
|
|
15
14
|
"test": "jest --runInBand --detectOpenHandles --colors --coverage",
|
|
@@ -41,7 +40,6 @@
|
|
|
41
40
|
"@typescript-eslint/eslint-plugin": "5.21.0",
|
|
42
41
|
"@typescript-eslint/parser": "5.21.0",
|
|
43
42
|
"@well-known-components/env-config-provider": "^1.1.1",
|
|
44
|
-
"@well-known-components/http-server": "^1.1.6",
|
|
45
43
|
"eslint": "8.14.0",
|
|
46
44
|
"eslint-config-prettier": "8.5.0",
|
|
47
45
|
"eslint-plugin-prettier": "4.0.0",
|
|
@@ -51,14 +49,11 @@
|
|
|
51
49
|
"typescript": "^4.7.3"
|
|
52
50
|
},
|
|
53
51
|
"dependencies": {
|
|
54
|
-
"@dcl/
|
|
55
|
-
"@dcl/content-hash-tree": "^1.1.4",
|
|
52
|
+
"@dcl/content-hash-tree": "^1.1.3",
|
|
56
53
|
"@dcl/hashing": "1.1.3",
|
|
57
54
|
"@dcl/schemas": "^5.4.2",
|
|
58
55
|
"@dcl/urn-resolver": "2.0.3",
|
|
59
|
-
"@well-known-components/interfaces": "
|
|
60
|
-
"@well-known-components/logger": "^3.0.0",
|
|
61
|
-
"@well-known-components/metrics": "^2.0.1",
|
|
56
|
+
"@well-known-components/interfaces": "1.1.3",
|
|
62
57
|
"@well-known-components/thegraph-component": "^1.2.0",
|
|
63
58
|
"ms": "2.1.3",
|
|
64
59
|
"sharp": "^0.30.6"
|
|
@@ -66,5 +61,5 @@
|
|
|
66
61
|
"files": [
|
|
67
62
|
"dist"
|
|
68
63
|
],
|
|
69
|
-
"commit": "
|
|
64
|
+
"commit": "000a2852e5cbb58accd44495384fb83d3712eea9"
|
|
70
65
|
}
|