Skip to content

Commit c76c165

Browse files
committed
Merge branch 'master' of github.com:makeomatic/ms-files
2 parents fe265f8 + f755dd7 commit c76c165

File tree

6 files changed

+31
-1
lines changed

6 files changed

+31
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
"chai": "^3.4.1",
4646
"codecov.io": "^0.1.6",
4747
"cz-conventional-changelog": "^1.1.5",
48-
"eslint": "~2.2.0",
48+
"eslint": "~2.4.0",
4949
"eslint-config-airbnb": "^6.0.1",
5050
"eslint-plugin-mocha": "^2.0.0",
5151
"faker": "^3.0.1",

schemas/common.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,30 @@
6666
}
6767
}
6868
},
69+
"cappasity-archive": {
70+
"type": "object",
71+
"required": ["type", "contentType", "contentLength", "md5Hash"],
72+
"additionalProperties": false,
73+
"properties": {
74+
"type": {
75+
"type": "string",
76+
"constant": "c-archive"
77+
},
78+
"contentType": {
79+
"type": "string",
80+
"constant": "application/cappasity-archive"
81+
},
82+
"contentLength": {
83+
"type": "integer",
84+
"minimum": 1,
85+
"maximum": 2000000000
86+
},
87+
"md5Hash": {
88+
"type": "string",
89+
"pattern": "^[0-9A-Fa-f]{32}$"
90+
}
91+
}
92+
},
6993
"meta": {
7094
"type": "object",
7195
"required": ["name"],

schemas/upload.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
},
1414
{
1515
"$ref": "common#/definitions/cappasity-image"
16+
},
17+
{
18+
"$ref": "common#/definitions/cappasity-archive"
1619
}
1720
]
1821
}

src/actions/upload.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const TYPE_MAP = {
88
'c-bin': '.bin.gz',
99
'c-texture': '.jpeg',
1010
'c-preview': '.jpeg',
11+
'c-archive': '.zip',
1112
};
1213

1314
function typeToExtension(type) {

src/custom/cappasity-postprocess.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const TYPE_MAP = {
66
'c-preview': 'preview',
77
'c-bin': 'model',
88
'c-texture': 'texture',
9+
'c-archive': 'archive',
910
};
1011

1112
module.exports = function extractMetadata(data) {

src/custom/cappasity-upload-pre.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = function extractMetadata(files, username) {
1515

1616
assert.equal(fileTypes['c-bin'], 1, 'must contain exactly one binary upload');
1717
assert.equal(fileTypes['c-preview'], 1, 'must contain preview');
18+
assert.equal(fileTypes['c-archive'], 1, 'must contain prepared archive');
1819
assert.ok(fileTypes['c-texture'] >= 1, 'must contain at least one texture');
1920
})
2021
.then(() => amqp.publishAndWait(getMetadata, { username, audience }))

0 commit comments

Comments
 (0)