UNPKG

1.98 kBJavaScriptView Raw
1"use strict";
2var __extends = (this && this.__extends) || function (d, b) {
3 for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
4 function __() { this.constructor = d; }
5 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
6};
7var fileJob_1 = require("./fileJob");
8var tmp = require("tmp");
9var S3FileJob = (function (_super) {
10 __extends(S3FileJob, _super);
11 function S3FileJob(e, basename) {
12 // Create temp file
13 var tmpobj = tmp.fileSync();
14 _super.call(this, e, tmpobj.name);
15 this.rename(basename);
16 this.setLocallyAvailable(false);
17 }
18 Object.defineProperty(S3FileJob.prototype, "bucket", {
19 /**
20 * Get remote bucket location.
21 * @returns {string}
22 */
23 get: function () {
24 return this._bucket;
25 },
26 /**
27 * Set remote bucket location.
28 * @param bucket
29 */
30 set: function (bucket) {
31 this._bucket = bucket;
32 },
33 enumerable: true,
34 configurable: true
35 });
36 Object.defineProperty(S3FileJob.prototype, "key", {
37 /**
38 * Get remote key
39 * @returns {string}
40 */
41 get: function () {
42 return this._key;
43 },
44 /**
45 * Set remote key.
46 * @param key
47 */
48 set: function (key) {
49 this._key = key;
50 },
51 enumerable: true,
52 configurable: true
53 });
54 Object.defineProperty(S3FileJob.prototype, "eTag", {
55 /**
56 * Get remote ETag
57 * @returns {string}
58 */
59 get: function () {
60 return this._eTag;
61 },
62 /**
63 * Set remote ETag
64 * @param eTag
65 */
66 set: function (eTag) {
67 this._eTag = eTag;
68 },
69 enumerable: true,
70 configurable: true
71 });
72 return S3FileJob;
73}(fileJob_1.FileJob));
74exports.S3FileJob = S3FileJob;