@dcl/content-validator 6.2.0 → 7.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/dist/validations/content.d.ts +14 -2
- package/dist/validations/content.d.ts.map +1 -1
- package/dist/validations/content.js +16 -40
- package/dist/validations/content.js.map +1 -1
- package/dist/validations/profile.d.ts +27 -5
- package/dist/validations/profile.d.ts.map +1 -1
- package/dist/validations/profile.js +157 -57
- package/dist/validations/profile.js.map +1 -1
- package/dist/validations/timestamps.d.ts +6 -0
- package/dist/validations/timestamps.d.ts.map +1 -1
- package/dist/validations/timestamps.js +12 -1
- package/dist/validations/timestamps.js.map +1 -1
- package/dist/validations/validations.d.ts +7 -1
- package/dist/validations/validations.d.ts.map +1 -1
- package/dist/validations/validations.js +23 -5
- package/dist/validations/validations.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { ContentValidatorComponents, DeploymentToValidate, ValidateFn, ValidationResponse } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Validates that all hashes that belong to the entity's content are actually uploaded or stored.
|
|
4
|
+
* If no content is present, this validation will not produce an error.
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
2
7
|
export declare function createAllHashesWereUploadedOrStoredValidateFn({ externalCalls }: Pick<ContentValidatorComponents, 'externalCalls'>): ValidateFn;
|
|
8
|
+
/**
|
|
9
|
+
* Validates that all hashes that belong to uploaded files are actually reported on the entity
|
|
10
|
+
* by checking that the entity's content hashes are correspond to the uploaded files.
|
|
11
|
+
* @public
|
|
12
|
+
*/
|
|
3
13
|
export declare function allHashesInUploadedFilesAreReportedInTheEntityValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
4
|
-
|
|
5
|
-
|
|
14
|
+
/**
|
|
15
|
+
* Validate that uploaded and reported hashes are corrects and files corresponds to snapshots
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
6
18
|
export declare function createContentValidateFn(components: ContentValidatorComponents): ValidateFn;
|
|
7
19
|
//# sourceMappingURL=content.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,oBAAoB,EAAc,UAAU,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAGvH;;;;GAIG;AACH,wBAAgB,6CAA6C,CAAC,EAC5D,aAAa,EACd,EAAE,IAAI,CAAC,0BAA0B,EAAE,eAAe,CAAC,GAAG,UAAU,CAkBhE;AAED;;;;GAIG;AACH,wBAAsB,wDAAwD,CAAC,UAAU,EAAE,oBAAoB,+BAW9G;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,0BAA0B,GAAG,UAAU,CAK1F"}
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createContentValidateFn = exports.
|
|
4
|
-
const schemas_1 = require("@dcl/schemas");
|
|
3
|
+
exports.createContentValidateFn = exports.allHashesInUploadedFilesAreReportedInTheEntityValidateFn = exports.createAllHashesWereUploadedOrStoredValidateFn = void 0;
|
|
5
4
|
const types_1 = require("../types");
|
|
6
5
|
const validations_1 = require("./validations");
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
6
|
+
/**
|
|
7
|
+
* Validates that all hashes that belong to the entity's content are actually uploaded or stored.
|
|
8
|
+
* If no content is present, this validation will not produce an error.
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
13
11
|
function createAllHashesWereUploadedOrStoredValidateFn({ externalCalls }) {
|
|
14
12
|
return async function validateFn(deployment) {
|
|
15
13
|
const { entity, files } = deployment;
|
|
@@ -27,6 +25,11 @@ function createAllHashesWereUploadedOrStoredValidateFn({ externalCalls }) {
|
|
|
27
25
|
};
|
|
28
26
|
}
|
|
29
27
|
exports.createAllHashesWereUploadedOrStoredValidateFn = createAllHashesWereUploadedOrStoredValidateFn;
|
|
28
|
+
/**
|
|
29
|
+
* Validates that all hashes that belong to uploaded files are actually reported on the entity
|
|
30
|
+
* by checking that the entity's content hashes are correspond to the uploaded files.
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
30
33
|
async function allHashesInUploadedFilesAreReportedInTheEntityValidateFn(deployment) {
|
|
31
34
|
const { entity, files } = deployment;
|
|
32
35
|
const errors = [];
|
|
@@ -40,39 +43,12 @@ async function allHashesInUploadedFilesAreReportedInTheEntityValidateFn(deployme
|
|
|
40
43
|
return (0, types_1.fromErrors)(...errors);
|
|
41
44
|
}
|
|
42
45
|
exports.allHashesInUploadedFilesAreReportedInTheEntityValidateFn = allHashesInUploadedFilesAreReportedInTheEntityValidateFn;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// Validate all content files correspond to at least one avatar snapshot
|
|
48
|
-
if (entity.type === schemas_1.EntityType.PROFILE) {
|
|
49
|
-
if (!correspondsToASnapshot(file, hash, entity.metadata)) {
|
|
50
|
-
errors.push(`This file is not expected: '${file}' or its hash is invalid: '${hash}'. Please, include only valid snapshot files.`);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return (0, types_1.fromErrors)(...errors);
|
|
55
|
-
});
|
|
56
|
-
exports.allMandatoryContentFilesArePresentValidateFn = (0, validations_1.validateAfterADR158)(async function validateFn(deployment) {
|
|
57
|
-
const { entity } = deployment;
|
|
58
|
-
const errors = [];
|
|
59
|
-
if (entity.type === schemas_1.EntityType.PROFILE) {
|
|
60
|
-
const fileNames = entity.content.map((a) => a.file.toLowerCase());
|
|
61
|
-
if (!fileNames.includes('body.png')) {
|
|
62
|
-
errors.push(`Profile entity is missing file 'body.png'`);
|
|
63
|
-
}
|
|
64
|
-
if (!fileNames.includes('face256.png')) {
|
|
65
|
-
errors.push(`Profile entity is missing file 'face256.png'`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
return (0, types_1.fromErrors)(...errors);
|
|
69
|
-
});
|
|
46
|
+
/**
|
|
47
|
+
* Validate that uploaded and reported hashes are corrects and files corresponds to snapshots
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
70
50
|
function createContentValidateFn(components) {
|
|
71
|
-
|
|
72
|
-
* Validate that uploaded and reported hashes are corrects and files corresponds to snapshots
|
|
73
|
-
* @public
|
|
74
|
-
*/
|
|
75
|
-
return (0, validations_1.validateAll)(createAllHashesWereUploadedOrStoredValidateFn(components), allHashesInUploadedFilesAreReportedInTheEntityValidateFn, exports.allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn, exports.allMandatoryContentFilesArePresentValidateFn);
|
|
51
|
+
return (0, validations_1.validateAll)(createAllHashesWereUploadedOrStoredValidateFn(components), allHashesInUploadedFilesAreReportedInTheEntityValidateFn);
|
|
76
52
|
}
|
|
77
53
|
exports.createContentValidateFn = createContentValidateFn;
|
|
78
54
|
//# sourceMappingURL=content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"content.js","sourceRoot":"","sources":["../../src/validations/content.ts"],"names":[],"mappings":";;;AAAA,oCAAuH;AACvH,+CAA2C;AAE3C;;;;GAIG;AACH,SAAgB,6CAA6C,CAAC,EAC5D,aAAa,EACqC;IAClD,OAAO,KAAK,UAAU,UAAU,CAAC,UAAgC;QAC/D,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAA;QACpC,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,IAAI,MAAM,CAAC,OAAO,EAAE;YAClB,MAAM,mB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AAA,yBAAW,EAChB,6CAA6C,CAAC,UAAU,CAAC,EACzD,wDAAwD,CACzD,CAAA;AACH,CAAC;AALD,0DAKC"}
|
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import { ContentValidatorComponents, DeploymentToValidate, ValidateFn, ValidationResponse } from '../types';
|
|
2
2
|
export declare const isOldEmote: (wearable: string) => boolean;
|
|
3
3
|
export declare function createFaceThumbnailValidateFn(components: ContentValidatorComponents): ValidateFn;
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
4
|
+
export declare function wearableUrnsValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
5
|
+
export declare function emoteUrnsValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
6
|
+
export declare function profileMustHaveEmotesValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
7
7
|
export declare function profileSlotsAreNotRepeatedValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
8
|
-
export declare
|
|
9
|
-
export declare function createProfileImagesValidateFn(components: ContentValidatorComponents):
|
|
8
|
+
export declare function profileWearablesNotRepeatedValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
9
|
+
export declare function createProfileImagesValidateFn(components: ContentValidatorComponents): ValidateFn;
|
|
10
|
+
export declare function profileMustNotHaveSnapshotsValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
11
|
+
/**
|
|
12
|
+
* Conditionally validates that all content uploaded with the profile entity belongs to a snapshot
|
|
13
|
+
* before the ADR_45_TIMESTAMP or in the optional period of the ADR 290.
|
|
14
|
+
* This validation is only applied to profile entities.
|
|
15
|
+
* If no content is present, this validation will not produce an error.
|
|
16
|
+
* @public
|
|
17
|
+
*/
|
|
18
|
+
export declare function allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Conditionally validates that all mandatory content files are present for the profile entity
|
|
21
|
+
* before the ADR_158_TIMESTAMP or in the optional period of the ADR 290.
|
|
22
|
+
* If no content is present, this validation will not produce an error.
|
|
23
|
+
* @public
|
|
24
|
+
*/
|
|
25
|
+
export declare function allMandatoryContentFilesArePresentValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Conditionally validates that the profile entity should not have content files after the rejected ADR 290 timestamp.
|
|
28
|
+
* This validation is only applied to profile entities.
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export declare function entityShouldNotHaveContentFilesValidateFn(deployment: DeploymentToValidate): Promise<ValidationResponse>;
|
|
10
32
|
export declare function createProfileValidateFn(components: ContentValidatorComponents): ValidateFn;
|
|
11
33
|
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/validations/profile.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/validations/profile.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,0BAA0B,EAC1B,oBAAoB,EAGpB,UAAU,EAEV,kBAAkB,EACnB,MAAM,UAAU,CAAA;AAejB,eAAO,MAAM,UAAU,aAAc,MAAM,KAAG,OAAqC,CAAA;AAUnF,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,0BAA0B,cAgCnF;AAED,wBAAsB,sBAAsB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAyB1G;AAED,wBAAsB,mBAAmB,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2BvG;AAYD,wBAAsB,+BAA+B,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAQnH;AAED,wBAAsB,oCAAoC,CACxD,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAW7B;AAED,wBAAsB,qCAAqC,CACzD,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAY7B;AAED,wBAAgB,6BAA6B,CAAC,UAAU,EAAE,0BAA0B,cA0BnF;AAED,wBAAsB,qCAAqC,CACzD,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAW7B;AAED;;;;;;GAMG;AACH,wBAAsB,uEAAuE,CAC3F,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAiB7B;AAED;;;;;GAKG;AACH,wBAAsB,4CAA4C,CAChE,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAc7B;AAED;;;;GAIG;AACH,wBAAsB,yCAAyC,CAC7D,UAAU,EAAE,oBAAoB,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CAc7B;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,0BAA0B,GAAG,UAAU,CAqB1F"}
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createProfileValidateFn = exports.createProfileImagesValidateFn = exports.profileWearablesNotRepeatedValidateFn = exports.profileSlotsAreNotRepeatedValidateFn = exports.profileMustHaveEmotesValidateFn = exports.emoteUrnsValidateFn = exports.wearableUrnsValidateFn = exports.createFaceThumbnailValidateFn = exports.isOldEmote = void 0;
|
|
6
|
+
exports.createProfileValidateFn = exports.entityShouldNotHaveContentFilesValidateFn = exports.allMandatoryContentFilesArePresentValidateFn = exports.allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn = exports.profileMustNotHaveSnapshotsValidateFn = exports.createProfileImagesValidateFn = exports.profileWearablesNotRepeatedValidateFn = exports.profileSlotsAreNotRepeatedValidateFn = exports.profileMustHaveEmotesValidateFn = exports.emoteUrnsValidateFn = exports.wearableUrnsValidateFn = exports.createFaceThumbnailValidateFn = exports.isOldEmote = void 0;
|
|
7
7
|
const schemas_1 = require("@dcl/schemas");
|
|
8
8
|
const urn_resolver_1 = require("@dcl/urn-resolver");
|
|
9
9
|
const sharp_1 = __importDefault(require("sharp"));
|
|
@@ -14,12 +14,16 @@ const validations_1 = require("./validations");
|
|
|
14
14
|
const defaultThumbnailSize = 256;
|
|
15
15
|
const isOldEmote = (wearable) => /^[a-z]+$/i.test(wearable);
|
|
16
16
|
exports.isOldEmote = isOldEmote;
|
|
17
|
+
function correspondsToASnapshot(fileName, hash, metadata) {
|
|
18
|
+
const fileNameWithoutExtension = fileName.replace(/.[^/.]+$/, '');
|
|
19
|
+
return metadata.avatars.some((avatar) => Object.entries(avatar.avatar?.snapshots ?? {}).some((key) => key[0] === fileNameWithoutExtension && key[1] === hash));
|
|
20
|
+
}
|
|
17
21
|
function createFaceThumbnailValidateFn(components) {
|
|
18
22
|
async function validateFn(deployment) {
|
|
19
23
|
const errors = [];
|
|
20
24
|
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
21
25
|
for (const avatar of allAvatars) {
|
|
22
|
-
const hash = avatar.avatar
|
|
26
|
+
const hash = avatar.avatar?.snapshots?.face256;
|
|
23
27
|
if (!hash)
|
|
24
28
|
return (0, types_1.validationFailed)(`Couldn't find hash for face256 thumbnail file with name: 'face256'`);
|
|
25
29
|
const isAlreadyStored = (await components.externalCalls.isContentStoredAlready([hash])).get(hash) ?? false;
|
|
@@ -45,52 +49,60 @@ function createFaceThumbnailValidateFn(components) {
|
|
|
45
49
|
errors.push(`Couldn't parse face256 thumbnail, please check image format.`);
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
|
-
return
|
|
52
|
+
return (0, types_1.fromErrors)(...errors);
|
|
49
53
|
}
|
|
50
|
-
return (0, validations_1.
|
|
54
|
+
return (0, validations_1.validateUpToADR290OptionalityTimestamp)(timestamps_1.ADR_45_TIMESTAMP, validateFn);
|
|
51
55
|
}
|
|
52
56
|
exports.createFaceThumbnailValidateFn = createFaceThumbnailValidateFn;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
for (const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
|
|
57
|
+
async function wearableUrnsValidateFn(deployment) {
|
|
58
|
+
async function validateFn(deployment) {
|
|
59
|
+
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
60
|
+
for (const avatar of allAvatars) {
|
|
61
|
+
for (const pointer of avatar.avatar.wearables) {
|
|
62
|
+
if ((0, exports.isOldEmote)(pointer))
|
|
63
|
+
continue;
|
|
64
|
+
const parsed = await (0, urn_resolver_1.parseUrn)(pointer);
|
|
65
|
+
if (!parsed) {
|
|
66
|
+
return (0, types_1.validationFailed)(`Each profile wearable pointer should be a urn, for example (urn:decentraland:{protocol}:collections-v2:{contract(0x[a-fA-F0-9]+)}:{name}). Invalid pointer: (${pointer})`);
|
|
67
|
+
}
|
|
68
|
+
if (deployment.entity.timestamp >= timestamps_1.ADR_244_TIMESTAMP) {
|
|
69
|
+
if (parsed.type === 'blockchain-collection-v1-asset' || parsed.type === 'blockchain-collection-v2-asset') {
|
|
70
|
+
return (0, types_1.validationFailed)(`Wearable pointer ${pointer} should be an item, not an asset. The URN must include the tokenId.`);
|
|
71
|
+
}
|
|
66
72
|
}
|
|
67
73
|
}
|
|
68
74
|
}
|
|
75
|
+
return types_1.OK;
|
|
69
76
|
}
|
|
70
|
-
return
|
|
71
|
-
}
|
|
72
|
-
exports.
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const
|
|
76
|
-
for (const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
return (0, validations_1.validateAfterADR75)(validateFn)(deployment);
|
|
78
|
+
}
|
|
79
|
+
exports.wearableUrnsValidateFn = wearableUrnsValidateFn;
|
|
80
|
+
async function emoteUrnsValidateFn(deployment) {
|
|
81
|
+
async function validateFn(deployment) {
|
|
82
|
+
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
83
|
+
for (const avatar of allAvatars) {
|
|
84
|
+
const allEmotes = avatar.avatar.emotes ?? [];
|
|
85
|
+
for (const { slot, urn } of allEmotes) {
|
|
86
|
+
if ((0, exports.isOldEmote)(urn))
|
|
87
|
+
continue;
|
|
88
|
+
const parsed = await (0, urn_resolver_1.parseUrn)(urn);
|
|
89
|
+
if (!parsed)
|
|
90
|
+
return (0, types_1.validationFailed)(`Each profile emote pointer should be a urn, for example (urn:decentraland:{protocol}:collections-v2:{contract(0x[a-fA-F0-9]+)}:{name}). Invalid pointer: (${urn})`);
|
|
91
|
+
if (deployment.entity.timestamp >= timestamps_1.ADR_244_TIMESTAMP) {
|
|
92
|
+
if (parsed.type === 'blockchain-collection-v1-asset' || parsed.type === 'blockchain-collection-v2-asset') {
|
|
93
|
+
return (0, types_1.validationFailed)(`Emote pointer ${urn} should be an item, not an asset. The URN must include the tokenId.`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
if (slot < 0 || slot > 9) {
|
|
97
|
+
return (0, types_1.validationFailed)(`The slot ${slot} of the emote ${urn} must be a number between 0 and 9 (inclusive).`);
|
|
85
98
|
}
|
|
86
|
-
}
|
|
87
|
-
if (slot < 0 || slot > 9) {
|
|
88
|
-
return (0, types_1.validationFailed)(`The slot ${slot} of the emote ${urn} must be a number between 0 and 9 (inclusive).`);
|
|
89
99
|
}
|
|
90
100
|
}
|
|
101
|
+
return types_1.OK;
|
|
91
102
|
}
|
|
92
|
-
return
|
|
93
|
-
}
|
|
103
|
+
return (0, validations_1.validateAfterADR74)(validateFn)(deployment);
|
|
104
|
+
}
|
|
105
|
+
exports.emoteUrnsValidateFn = emoteUrnsValidateFn;
|
|
94
106
|
function profileHasEmotes(deployment) {
|
|
95
107
|
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
96
108
|
for (const avatar of allAvatars) {
|
|
@@ -100,63 +112,151 @@ function profileHasEmotes(deployment) {
|
|
|
100
112
|
}
|
|
101
113
|
return false;
|
|
102
114
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
115
|
+
async function profileMustHaveEmotesValidateFn(deployment) {
|
|
116
|
+
async function validateFn(deployment) {
|
|
117
|
+
if (!profileHasEmotes(deployment)) {
|
|
118
|
+
return (0, types_1.validationFailed)('Profile must have emotes after ADR 74.');
|
|
119
|
+
}
|
|
120
|
+
return types_1.OK;
|
|
106
121
|
}
|
|
107
|
-
return
|
|
108
|
-
}
|
|
122
|
+
return (0, validations_1.validateAfterADR74)(validateFn)(deployment);
|
|
123
|
+
}
|
|
124
|
+
exports.profileMustHaveEmotesValidateFn = profileMustHaveEmotesValidateFn;
|
|
109
125
|
async function profileSlotsAreNotRepeatedValidateFn(deployment) {
|
|
110
126
|
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
111
127
|
const allEmotes = allAvatars.flatMap((avatar) => avatar.avatar.emotes ?? []);
|
|
112
128
|
const usedSlots = new Set();
|
|
113
129
|
for (const { slot } of allEmotes) {
|
|
114
130
|
if (usedSlots.has(slot)) {
|
|
115
|
-
return (0, types_1.validationFailed)(
|
|
131
|
+
return (0, types_1.validationFailed)(`Emote slot ${slot} should not be repeated.`);
|
|
116
132
|
}
|
|
117
133
|
usedSlots.add(slot);
|
|
118
134
|
}
|
|
119
135
|
return types_1.OK;
|
|
120
136
|
}
|
|
121
137
|
exports.profileSlotsAreNotRepeatedValidateFn = profileSlotsAreNotRepeatedValidateFn;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
async function profileWearablesNotRepeatedValidateFn(deployment) {
|
|
139
|
+
async function validateFn(deployment) {
|
|
140
|
+
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
141
|
+
for (const avatar of allAvatars) {
|
|
142
|
+
const wearables = avatar.avatar.wearables;
|
|
143
|
+
if (new Set(wearables).size !== wearables.length) {
|
|
144
|
+
return (0, types_1.validationFailed)('Wearables should not be repeated.');
|
|
145
|
+
}
|
|
128
146
|
}
|
|
147
|
+
return types_1.OK;
|
|
129
148
|
}
|
|
130
|
-
return
|
|
131
|
-
}
|
|
149
|
+
return (0, validations_1.validateAfterADR232)(validateFn)(deployment);
|
|
150
|
+
}
|
|
151
|
+
exports.profileWearablesNotRepeatedValidateFn = profileWearablesNotRepeatedValidateFn;
|
|
132
152
|
function createProfileImagesValidateFn(components) {
|
|
133
153
|
async function validateFn(deployment) {
|
|
134
154
|
const errors = [];
|
|
135
155
|
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
136
156
|
for (const avatar of allAvatars) {
|
|
137
|
-
const faceHash = avatar.avatar
|
|
138
|
-
const bodyHash = avatar.avatar
|
|
157
|
+
const faceHash = avatar.avatar?.snapshots?.face256;
|
|
158
|
+
const bodyHash = avatar.avatar?.snapshots?.body;
|
|
139
159
|
if (!faceHash || !bodyHash)
|
|
140
160
|
return (0, types_1.validationFailed)(`Couldn't find hash for face or body thumbnails on profile metadata`);
|
|
141
161
|
const calculatedHashes = await components.externalCalls.calculateFilesHashes(deployment.files);
|
|
142
162
|
// validate all hashes
|
|
143
163
|
Array.from(calculatedHashes.entries()).forEach(([key, entry]) => {
|
|
144
164
|
if (!(key === entry.calculatedHash)) {
|
|
145
|
-
errors.push(`
|
|
165
|
+
errors.push(`Mismatch of hash found for file. Expected: ${key} but got ${entry.calculatedHash}`);
|
|
146
166
|
}
|
|
147
167
|
});
|
|
148
168
|
}
|
|
149
|
-
return
|
|
169
|
+
return (0, types_1.fromErrors)(...errors);
|
|
150
170
|
}
|
|
151
|
-
return validateFn;
|
|
171
|
+
return (0, validations_1.validateUpToADR290OptionalityTimestamp)(timestamps_1.ADR_45_TIMESTAMP, validateFn);
|
|
152
172
|
}
|
|
153
173
|
exports.createProfileImagesValidateFn = createProfileImagesValidateFn;
|
|
174
|
+
async function profileMustNotHaveSnapshotsValidateFn(deployment) {
|
|
175
|
+
async function validateFn(deployment) {
|
|
176
|
+
const allAvatars = deployment.entity.metadata?.avatars ?? [];
|
|
177
|
+
for (const avatar of allAvatars) {
|
|
178
|
+
if (avatar.avatar?.snapshots) {
|
|
179
|
+
return (0, types_1.validationFailed)('Avatars must not have snapshots.');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return types_1.OK;
|
|
183
|
+
}
|
|
184
|
+
return (0, validations_1.validateAfterADR290RejectedTimestamp)(validateFn)(deployment);
|
|
185
|
+
}
|
|
186
|
+
exports.profileMustNotHaveSnapshotsValidateFn = profileMustNotHaveSnapshotsValidateFn;
|
|
187
|
+
/**
|
|
188
|
+
* Conditionally validates that all content uploaded with the profile entity belongs to a snapshot
|
|
189
|
+
* before the ADR_45_TIMESTAMP or in the optional period of the ADR 290.
|
|
190
|
+
* This validation is only applied to profile entities.
|
|
191
|
+
* If no content is present, this validation will not produce an error.
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
async function allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn(deployment) {
|
|
195
|
+
async function validateFn(deployment) {
|
|
196
|
+
const { entity } = deployment;
|
|
197
|
+
const errors = [];
|
|
198
|
+
for (const { file, hash } of entity.content ?? []) {
|
|
199
|
+
// Validate all content files correspond to at least one avatar snapshot
|
|
200
|
+
if (!entity.metadata || !entity.metadata.avatars || entity.metadata.avatars?.length === 0) {
|
|
201
|
+
errors.push(`Entity is missing metadata or avatars`);
|
|
202
|
+
}
|
|
203
|
+
else if (!correspondsToASnapshot(file, hash, entity.metadata)) {
|
|
204
|
+
errors.push(`This file is not expected: '${file}' or its hash is invalid: '${hash}'. Please, include only valid snapshot files.`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
return (0, types_1.fromErrors)(...errors);
|
|
208
|
+
}
|
|
209
|
+
return (0, validations_1.validateUpToADR290OptionalityTimestamp)(timestamps_1.ADR_45_TIMESTAMP, validateFn)(deployment);
|
|
210
|
+
}
|
|
211
|
+
exports.allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn = allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn;
|
|
212
|
+
/**
|
|
213
|
+
* Conditionally validates that all mandatory content files are present for the profile entity
|
|
214
|
+
* before the ADR_158_TIMESTAMP or in the optional period of the ADR 290.
|
|
215
|
+
* If no content is present, this validation will not produce an error.
|
|
216
|
+
* @public
|
|
217
|
+
*/
|
|
218
|
+
async function allMandatoryContentFilesArePresentValidateFn(deployment) {
|
|
219
|
+
async function validateFn(deployment) {
|
|
220
|
+
const { entity } = deployment;
|
|
221
|
+
const errors = [];
|
|
222
|
+
const fileNames = entity.content.map((a) => a.file.toLowerCase());
|
|
223
|
+
if (!fileNames.includes('body.png')) {
|
|
224
|
+
errors.push(`Profile entity is missing file 'body.png'`);
|
|
225
|
+
}
|
|
226
|
+
if (!fileNames.includes('face256.png')) {
|
|
227
|
+
errors.push(`Profile entity is missing file 'face256.png'`);
|
|
228
|
+
}
|
|
229
|
+
return (0, types_1.fromErrors)(...errors);
|
|
230
|
+
}
|
|
231
|
+
return (0, validations_1.validateUpToADR290OptionalityTimestamp)(timestamps_1.ADR_158_TIMESTAMP, validateFn)(deployment);
|
|
232
|
+
}
|
|
233
|
+
exports.allMandatoryContentFilesArePresentValidateFn = allMandatoryContentFilesArePresentValidateFn;
|
|
234
|
+
/**
|
|
235
|
+
* Conditionally validates that the profile entity should not have content files after the rejected ADR 290 timestamp.
|
|
236
|
+
* This validation is only applied to profile entities.
|
|
237
|
+
* @public
|
|
238
|
+
*/
|
|
239
|
+
async function entityShouldNotHaveContentFilesValidateFn(deployment) {
|
|
240
|
+
async function validateFn(deployment) {
|
|
241
|
+
const { entity } = deployment;
|
|
242
|
+
const errors = [];
|
|
243
|
+
if (entity.content.length > 0) {
|
|
244
|
+
errors.push(`Entity has content files when it should not: ${entity.content.map((a) => a.file).join(', ')}`);
|
|
245
|
+
}
|
|
246
|
+
if (deployment.files.size > 0) {
|
|
247
|
+
errors.push(`Entity has uploaded files when it should not: ${Array.from(deployment.files.keys()).join(', ')}`);
|
|
248
|
+
}
|
|
249
|
+
return (0, types_1.fromErrors)(...errors);
|
|
250
|
+
}
|
|
251
|
+
return (0, validations_1.validateAfterADR290RejectedTimestamp)(validateFn)(deployment);
|
|
252
|
+
}
|
|
253
|
+
exports.entityShouldNotHaveContentFilesValidateFn = entityShouldNotHaveContentFilesValidateFn;
|
|
154
254
|
function createProfileValidateFn(components) {
|
|
155
255
|
/**
|
|
156
256
|
* Validate that given profile deployment includes the face256 file with the correct size
|
|
157
257
|
* * @public
|
|
158
258
|
*/
|
|
159
|
-
return (0, validations_1.validateIfTypeMatches)(schemas_1.EntityType.PROFILE, (0, validations_1.validateAll)(createFaceThumbnailValidateFn(components), createProfileImagesValidateFn(components),
|
|
259
|
+
return (0, validations_1.validateIfTypeMatches)(schemas_1.EntityType.PROFILE, (0, validations_1.validateAll)(profileMustNotHaveSnapshotsValidateFn, createFaceThumbnailValidateFn(components), createProfileImagesValidateFn(components), wearableUrnsValidateFn, emoteUrnsValidateFn, profileMustHaveEmotesValidateFn, profileSlotsAreNotRepeatedValidateFn, profileWearablesNotRepeatedValidateFn, allContentFilesCorrespondToAtLeastOneAvatarSnapshotAfterADR45ValidateFn, allMandatoryContentFilesArePresentValidateFn, entityShouldNotHaveContentFilesValidateFn));
|
|
160
260
|
}
|
|
161
261
|
exports.createProfileValidateFn = createProfileValidateFn;
|
|
162
262
|
//# sourceMappingURL=profile.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/validations/profile.ts"],"names":[],"mappings":";;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/validations/profile.ts"],"names":[],"mappings":";;;;;;AAAA,0CAA0D;AAC1D,oDAA4C;AAC5C,kDAAyB;AACzB,oCAQiB;AACjB,6CAAqF;AACrF,+CAQsB;AAEtB,0FAA0F;AAC1F,MAAM,oBAAoB,GAAG,GAAG,CAAA;AAEzB,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAW,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAA;AAAtE,QAAA,UAAU,cAA4D;AAEnF,SAAS,sBAAsB,CAAC,QAAgB,EAAE,IAAY,EAAE,QAAiB;IAC/E,MAAM,wBAAwB,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAA;IAEjE,OAAO,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAc,EAAE,EAAE,CAC9C,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,wBAAwB,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CACrH,CAAA;AACH,CAAC;AAED,SAAgB,6BAA6B,CAAC,UAAsC;IAClF,KAAK,UAAU,UAAU,CAAC,UAAgC;QACxD,MAAM,MAAM,GAAa,EAAE,CAAA;QAC3B,MAAM,UAAU,GAAU,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,IAAI,EAAE,CAAA;QAEnE,KAAK,MAAM,MAAM,IAAI,UAAU,EAAE;YAC/B,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,CAAA;YAC9C,IAAI,CAAC,IAAI;gBAAE,OAAO,IAAA,wBAAgB,EAAC,oEAAoE,CAAC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AAM,CAAC,CAAA;IAC9B,CAAC;IAED,OAAO,IAAA,kDAAoC,EAAC,UAAU,CAAC,CAAC,UAAU,CAAC,CAAA;AACrE,CAAC;AAhBD,8FAgBC;AAED,SAAgB,uBAAuB,CAAC,UAAsC;IAC5E;;;OAGG;IACH,OAAO,IAAA,mCAAqB,EAC1B,oBAAU,CAAC,OAAO,EAClB,IAAA,yBAAW,EACT,qCAAqC,EACrC,6BAA6B,CAAC,UAAU,CAAC,EACzC,6BAA6B,CAAC,UAAU,CAAC,EACzC,sBAAsB,EACtB,mBAAmB,EACnB,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,EACrC,uEAAuE,EACvE,4CAA4C,EAC5C,yCAAyC,CAC1C,CACF,CAAA;AACH,CAAC;AArBD,0DAqBC"}
|
|
@@ -38,6 +38,12 @@ export declare const ADR_236_TIMESTAMP: number;
|
|
|
38
38
|
* @public
|
|
39
39
|
*/
|
|
40
40
|
export declare const ADR_244_TIMESTAMP: number;
|
|
41
|
+
/**
|
|
42
|
+
* 1762743600000 = 2025-11-10T00:00:00Z
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export declare const ADR_290_OPTIONAL_TIMESTAMP: number;
|
|
46
|
+
export declare const ADR_290_REJECTED_TIMESTAMP: number;
|
|
41
47
|
/**
|
|
42
48
|
* DCL Launch Day
|
|
43
49
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamps.d.ts","sourceRoot":"","sources":["../../src/validations/timestamps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;
|
|
1
|
+
{"version":3,"file":"timestamps.d.ts","sourceRoot":"","sources":["../../src/validations/timestamps.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,gBAAgB,QAAwF,CAAA;AAErH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAExH;;;GAGG;AACH,eAAO,MAAM,iBAAiB,QAA0F,CAAA;AAIxH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QAEtB,CAAA;AAEjB,eAAO,MAAM,0BAA0B,QAEY,CAAA;AAEnD;;;GAGG;AACH,eAAO,MAAM,kCAAkC,gBAAgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LEGACY_CONTENT_MIGRATION_TIMESTAMP = exports.ADR_244_TIMESTAMP = exports.ADR_236_TIMESTAMP = exports.ADR_232_TIMESTAMP = exports.ADR_173_TIMESTAMP = exports.ADR_158_TIMESTAMP = exports.ADR_74_TIMESTAMP = exports.ADR_75_TIMESTAMP = exports.ADR_45_TIMESTAMP = void 0;
|
|
3
|
+
exports.LEGACY_CONTENT_MIGRATION_TIMESTAMP = exports.ADR_290_REJECTED_TIMESTAMP = exports.ADR_290_OPTIONAL_TIMESTAMP = exports.ADR_244_TIMESTAMP = exports.ADR_236_TIMESTAMP = exports.ADR_232_TIMESTAMP = exports.ADR_173_TIMESTAMP = exports.ADR_158_TIMESTAMP = exports.ADR_74_TIMESTAMP = exports.ADR_75_TIMESTAMP = exports.ADR_45_TIMESTAMP = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 1652191200000 = 2022-05-10T14:00:00Z
|
|
6
6
|
* @public
|
|
@@ -41,6 +41,17 @@ exports.ADR_236_TIMESTAMP = process.env.ADR_236_TIMESTAMP ? parseInt(process.env
|
|
|
41
41
|
* @public
|
|
42
42
|
*/
|
|
43
43
|
exports.ADR_244_TIMESTAMP = process.env.ADR_244_TIMESTAMP ? parseInt(process.env.ADR_244_TIMESTAMP) : 1710428400000;
|
|
44
|
+
const THREE_MONTHS_IN_MS = 3 * 30 * 24 * 60 * 60 * 1000;
|
|
45
|
+
/**
|
|
46
|
+
* 1762743600000 = 2025-11-10T00:00:00Z
|
|
47
|
+
* @public
|
|
48
|
+
*/
|
|
49
|
+
exports.ADR_290_OPTIONAL_TIMESTAMP = process.env.ADR_290_TIMESTAMP
|
|
50
|
+
? parseInt(process.env.ADR_290_TIMESTAMP)
|
|
51
|
+
: 1762743600000;
|
|
52
|
+
exports.ADR_290_REJECTED_TIMESTAMP = process.env.ADR_290_REJECTED_TIMESTAMP
|
|
53
|
+
? parseInt(process.env.ADR_290_REJECTED_TIMESTAMP)
|
|
54
|
+
: exports.ADR_290_OPTIONAL_TIMESTAMP + THREE_MONTHS_IN_MS;
|
|
44
55
|
/**
|
|
45
56
|
* DCL Launch Day
|
|
46
57
|
* @public
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"timestamps.js","sourceRoot":"","sources":["../../src/validations/timestamps.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,gB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AC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAA;AAExH;;;GAGG;AACU,QAAA,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,aAAa,CAAA;AAExH,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAA;AAEvD;;;GAGG;AACU,QAAA,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB;IACrE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC;IACzC,CAAC,CAAC,aAAa,CAAA;AAEJ,QAAA,0BAA0B,GAAG,OAAO,CAAC,GAAG,CAAC,0BAA0B;IAC9E,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAClD,CAAC,CAAC,kCAA0B,GAAG,kBAAkB,CAAA;AAEnD;;;GAGG;AACU,QAAA,kCAAkC,GAAG,aAAa,CAAA"}
|
|
@@ -5,10 +5,16 @@ export declare function validateIfConditionMet(condition: (deployment: Deploymen
|
|
|
5
5
|
export declare function validateAfterADR45(validate: ValidateFn): ValidateFn;
|
|
6
6
|
export declare function validateAfterADR75(validate: ValidateFn): ValidateFn;
|
|
7
7
|
export declare function validateAfterADR74(validate: ValidateFn): ValidateFn;
|
|
8
|
-
export declare function validateAfterADR158(validate: ValidateFn): ValidateFn;
|
|
9
8
|
export declare function validateAfterADR173(validate: ValidateFn): ValidateFn;
|
|
10
9
|
export declare function validateAfterADR232(validate: ValidateFn): ValidateFn;
|
|
11
10
|
export declare function validateAfterADR236(validate: ValidateFn): ValidateFn;
|
|
12
11
|
export declare function validateAfterADR244(validate: ValidateFn): ValidateFn;
|
|
13
12
|
export declare function validateIfTypeMatches(entityType: EntityType, validate: ValidateFn): ValidateFn;
|
|
13
|
+
export declare function validateAfterADR290RejectedTimestamp(validate: ValidateFn): ValidateFn;
|
|
14
|
+
/**
|
|
15
|
+
* Validates only for profile entities after the provided timestamp and before the rejected timestamp.
|
|
16
|
+
* In the optionality period, validate only for profiles that have content files, files uploaded or snapshots present.
|
|
17
|
+
* @public
|
|
18
|
+
*/
|
|
19
|
+
export declare function validateUpToADR290OptionalityTimestamp(fromTimestamp: number, validate: ValidateFn): ValidateFn;
|
|
14
20
|
//# sourceMappingURL=validations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/validations/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAM,UAAU,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"validations.d.ts","sourceRoot":"","sources":["../../src/validations/validations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAM,UAAU,EAAE,MAAM,UAAU,CAAA;AAa/D,wBAAgB,WAAW,CAAC,GAAG,aAAa,EAAE,UAAU,EAAE,GAAG,UAAU,CAUtE;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,CAAC,UAAU,EAAE,oBAAoB,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAC3E,UAAU,EAAE,UAAU,GACrB,UAAU,CAQZ;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEnE;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAEpE;AAED,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,cAEjF;AAED,wBAAgB,oCAAoC,CAAC,QAAQ,EAAE,UAAU,GAAG,UAAU,CAErF;AAED;;;;GAIG;AACH,wBAAgB,sCAAsC,CAAC,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,UAAU,CAc9G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateIfTypeMatches = exports.validateAfterADR244 = exports.validateAfterADR236 = exports.validateAfterADR232 = exports.validateAfterADR173 = exports.
|
|
3
|
+
exports.validateUpToADR290OptionalityTimestamp = exports.validateAfterADR290RejectedTimestamp = exports.validateIfTypeMatches = exports.validateAfterADR244 = exports.validateAfterADR236 = exports.validateAfterADR232 = exports.validateAfterADR173 = exports.validateAfterADR74 = exports.validateAfterADR75 = exports.validateAfterADR45 = exports.validateIfConditionMet = exports.validateAll = void 0;
|
|
4
4
|
const types_1 = require("../types");
|
|
5
5
|
const timestamps_1 = require("./timestamps");
|
|
6
6
|
function validateAll(...validationFns) {
|
|
@@ -37,10 +37,6 @@ function validateAfterADR74(validate) {
|
|
|
37
37
|
return validateIfConditionMet((deployment) => deployment.entity.timestamp >= timestamps_1.ADR_74_TIMESTAMP, validate);
|
|
38
38
|
}
|
|
39
39
|
exports.validateAfterADR74 = validateAfterADR74;
|
|
40
|
-
function validateAfterADR158(validate) {
|
|
41
|
-
return validateIfConditionMet((deployment) => deployment.entity.timestamp >= timestamps_1.ADR_158_TIMESTAMP, validate);
|
|
42
|
-
}
|
|
43
|
-
exports.validateAfterADR158 = validateAfterADR158;
|
|
44
40
|
function validateAfterADR173(validate) {
|
|
45
41
|
return validateIfConditionMet((deployment) => deployment.entity.timestamp >= timestamps_1.ADR_173_TIMESTAMP, validate);
|
|
46
42
|
}
|
|
@@ -61,4 +57,26 @@ function validateIfTypeMatches(entityType, validate) {
|
|
|
61
57
|
return validateIfConditionMet((deployment) => deployment.entity.type === entityType, validate);
|
|
62
58
|
}
|
|
63
59
|
exports.validateIfTypeMatches = validateIfTypeMatches;
|
|
60
|
+
function validateAfterADR290RejectedTimestamp(validate) {
|
|
61
|
+
return validateIfConditionMet((deployment) => deployment.entity.timestamp >= timestamps_1.ADR_290_REJECTED_TIMESTAMP, validate);
|
|
62
|
+
}
|
|
63
|
+
exports.validateAfterADR290RejectedTimestamp = validateAfterADR290RejectedTimestamp;
|
|
64
|
+
/**
|
|
65
|
+
* Validates only for profile entities after the provided timestamp and before the rejected timestamp.
|
|
66
|
+
* In the optionality period, validate only for profiles that have content files, files uploaded or snapshots present.
|
|
67
|
+
* @public
|
|
68
|
+
*/
|
|
69
|
+
function validateUpToADR290OptionalityTimestamp(fromTimestamp, validate) {
|
|
70
|
+
return validateIfConditionMet((deployment) =>
|
|
71
|
+
// Validate before the rejected timestamp
|
|
72
|
+
deployment.entity.timestamp < timestamps_1.ADR_290_REJECTED_TIMESTAMP &&
|
|
73
|
+
// Validate after the optional timestamp
|
|
74
|
+
((deployment.entity.timestamp >= timestamps_1.ADR_290_OPTIONAL_TIMESTAMP &&
|
|
75
|
+
(deployment.entity.content.length > 0 ||
|
|
76
|
+
deployment.files.size > 0 ||
|
|
77
|
+
deployment.entity.metadata?.avatars?.[0]?.avatar?.snapshots)) ||
|
|
78
|
+
// Validate from the provided timestamp
|
|
79
|
+
(deployment.entity.timestamp >= fromTimestamp && deployment.entity.timestamp < timestamps_1.ADR_290_REJECTED_TIMESTAMP)), validate);
|
|
80
|
+
}
|
|
81
|
+
exports.validateUpToADR290OptionalityTimestamp = validateUpToADR290OptionalityTimestamp;
|
|
64
82
|
//# sourceMappingURL=validations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../src/validations/validations.ts"],"names":[],"mappings":";;;AACA,oCAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"validations.js","sourceRoot":"","sources":["../../src/validations/validations.ts"],"names":[],"mappings":";;;AACA,oCAA+D;AAC/D,6CAUqB;AAErB,SAAgB,WAAW,CAAC,GAAG,aAA2B;IACxD,OAAO,KAAK,EAAE,UAAgC,EAAE,EAAE;QAChD,KAAK,MAAM,UAAU,IAAI,aAAa,EAAE;YACtC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,CAAA;YAC7C,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;gBAChB,OAAO,QAAQ,CAAA;aAChB;SACF;QACD,OAAO,UAAE,CAAA;IACX,CAAC,CAAA;AACH,CAAC;AAVD,kCAUC;AAED,SAAgB,sBAAsB,CACpC,SAA2E,EAC3E,UAAsB;IAEtB,OAAO,KAAK,EAAE,UAAgC,EAAE,EAAE;QAChD,MAAM,cAAc,GAAG,MAAM,SAAS,CAAC,UAAU,CAAC,CAAA;QAClD,IAAI,cAAc,EAAE;YAClB,OAAO,UAAU,CAAC,UAAU,CAAC,CAAA;SAC9B;QACD,OAAO,UAAE,CAAA;IACX,CAAC,CAAA;AACH,CAAC;AAXD,wDAWC;AAED,SAAgB,kBAAkB,CAAC,QAAoB;IACrD,OAAO,sBAAsB,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,6BAAgB,EAAE,QAAQ,CAAC,CAAA;AAC1G,CAAC;AAFD,gDAEC;AAED,SAAgB,kBAAkB,CAAC,QAAoB;IACrD,OAAO,sBAAsB,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AA;AAChG,CAAC;AAFD,sDAEC;AAED,SAAgB,oCAAoC,CAAC,QAAoB;IACvE,OAAO,sBAAsB,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,uCAA0B,EAAE,QAAQ,CAAC,CAAA;AACpH,CAAC;AAFD,oFAEC;AAED;;;;GAIG;AACH,SAAgB,sCAAsC,CAAC,aAAqB,EAAE,QAAoB;IAChG,OAAO,sBAAsB,CAC3B,CAAC,UAAU,EAAE,EAAE;IACb,yCAAyC;IACzC,UAAU,CAAC,MAAM,CAAC,SAAS,GAAG,uCAA0B;QACxD,wCAAwC;QACxC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,uCAA0B;YACzD,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC;gBACnC,UAAU,CAAC,KAAK,CAAC,IAAI,GAAG,CAAC;gBACzB,UAAU,CAAC,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;YAC/D,uCAAuC;YACvC,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,IAAI,aAAa,IAAI,UAAU,CAAC,MAAM,CAAC,SAAS,GAAG,uCAA0B,CAAC,CAAC,EAC/G,QAAQ,CACT,CAAA;AACH,CAAC;AAdD,wFAcC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/content-validator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0",
|
|
4
4
|
"description": "Catalyst content validations",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"@dcl/block-indexer": "^1.1.2",
|
|
43
43
|
"@dcl/content-hash-tree": "^1.1.4",
|
|
44
44
|
"@dcl/hashing": "^3.0.4",
|
|
45
|
-
"@dcl/schemas": "^
|
|
45
|
+
"@dcl/schemas": "^20.0.0",
|
|
46
46
|
"@dcl/urn-resolver": "^3.6.0",
|
|
47
47
|
"@well-known-components/interfaces": "^1.4.3",
|
|
48
48
|
"@well-known-components/thegraph-component": "^1.6.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"files": [
|
|
54
54
|
"dist"
|
|
55
55
|
],
|
|
56
|
-
"commit": "
|
|
56
|
+
"commit": "d640d8bce4f081ad45065592be40f743642b3638"
|
|
57
57
|
}
|