Skip to content

Commit

Permalink
feat(conversion, IConversion): Add new parameters to be passed in the…
Browse files Browse the repository at this point in the history
… request to configure the conversion.
  • Loading branch information
CrazyTales committed Jun 6, 2017
1 parent 3d1fa69 commit b9b47b6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/models/IConversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface IConversion {
code: string;
assetBundleName: string;
assetUrls: string[];
conversionOptions: string[];

azure: {
host: string;
Expand Down
11 changes: 10 additions & 1 deletion src/models/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const ConversionSchema = new Schema({
}
},

conversionOptions: {
type: Array,
required: true,
validate(options: any[]) {
return options.every(value => typeof value === 'string');
}
},

azure: {
host: { type: String, required: true },
sharedAccessSignatureToken: { type: String, required: true },
Expand Down Expand Up @@ -54,10 +62,11 @@ const ConversionSchema = new Schema({
export function safeData({
assetBundleName,
assetUrls,
conversionOptions,
azure,
compilerOptions
}: IConversion): Partial<IConversion> {
return { assetBundleName, assetUrls, azure, compilerOptions };
return { assetBundleName, assetUrls, conversionOptions, azure, compilerOptions };
}

export const Conversion = mongoose.model<IConversionModel>('Conversion', ConversionSchema);

0 comments on commit b9b47b6

Please sign in to comment.