├── .gitignore
├── package.json
└── src
├── model
├── Destinations.js
├── Enhancements.js
├── TextBackground.js
├── RotateTransformation.js
├── Offset.js
├── FlipTransformation.js
├── SkewTransformation.js
├── Transcription.js
├── Range.js
├── TransferResponseData.js
├── Size.js
├── ClipStart.js
├── ClipLength.js
├── OffsetY.js
├── OffsetX.js
├── CaptionMargin.js
├── AudioAssetVolume.js
├── VideoAssetVolume.js
├── ClipOpacity.js
├── AudioEnhancement.js
├── SkewTransformationY.js
├── SkewTransformationX.js
├── Transformation.js
├── Poster.js
├── SourceResponse.js
├── AssetResponse.js
├── UploadResponse.js
├── TransferResponse.js
├── Speed.js
├── Font.js
├── QueuedSourceResponse.js
├── Crop.js
└── MuxDestinationOptions.js
└── api
├── EndpointsApi.js
└── CreateApi.js
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "shotstack-sdk",
3 | "version": "0.2.9",
4 | "description": "Official Node SDK for the Shotstack Cloud Video Editing API",
5 | "license": "MIT",
6 | "main": "src/index.js",
7 | "repository": {
8 | "type" : "git",
9 | "url" : "https://github.com/shotstack/shotstack-sdk-node"
10 | },
11 | "keywords": [
12 | "video",
13 | "ffmpeg",
14 | "video-editing",
15 | "video-editor",
16 | "video-api",
17 | "cloud-video",
18 | "video-processing"
19 | ],
20 | "browser": {
21 | "fs": false
22 | },
23 | "dependencies": {
24 | "@babel/cli": "^7.0.0",
25 | "superagent": "^5.3.0"
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/src/model/Destinations.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
4 | var _GoogleCloudStorageDestination = _interopRequireDefault(require("./GoogleCloudStorageDestination"));
5 | var _GoogleDriveDestination = _interopRequireDefault(require("./GoogleDriveDestination"));
6 | var _MuxDestination = _interopRequireDefault(require("./MuxDestination"));
7 | var _S3Destination = _interopRequireDefault(require("./S3Destination"));
8 | var _ShotstackDestination = _interopRequireDefault(require("./ShotstackDestination"));
9 | var _VimeoDestination = _interopRequireDefault(require("./VimeoDestination"));
10 | var _VimeoDestinationOptions = _interopRequireDefault(require("./VimeoDestinationOptions"));
11 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
--------------------------------------------------------------------------------
/src/model/Enhancements.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _AudioEnhancement = _interopRequireDefault(require("./AudioEnhancement"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16 | * Shotstack
17 | * Official Node SDK for the Shotstack Cloud Video Editing API
18 | *
19 | * The version of the OpenAPI document: v1
20 | *
21 | *
22 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23 | * https://openapi-generator.tech
24 | * Do not edit the class manually.
25 | *
26 | */
27 | /**
28 | * The Enhancements model module.
29 | * @module model/Enhancements
30 | * @version 0.2.9
31 | */
32 | var Enhancements = /*#__PURE__*/function () {
33 | /**
34 | * Constructs a new Enhancements.
35 | * Enhancements that can be applied to a rendition. Currently only supports the Dolby audio enhancement.
36 | * @alias module:model/Enhancements
37 | */
38 | function Enhancements() {
39 | _classCallCheck(this, Enhancements);
40 | Enhancements.initialize(this);
41 | }
42 |
43 | /**
44 | * Initializes the fields of this object.
45 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46 | * Only for internal use.
47 | */
48 | return _createClass(Enhancements, [{
49 | key: "getAudio",
50 | value:
51 | /**
52 | * @return {module:model/AudioEnhancement}
53 | */
54 | function getAudio() {
55 | return this.audio;
56 | }
57 |
58 | /**
59 | * @param {module:model/AudioEnhancement} audio
60 | */
61 | }, {
62 | key: "setAudio",
63 | value: function setAudio(audio) {
64 | this['audio'] = audio;
65 | return this;
66 | }
67 | }], [{
68 | key: "initialize",
69 | value: function initialize(obj) {}
70 |
71 | /**
72 | * Constructs a Enhancements from a plain JavaScript object, optionally creating a new instance.
73 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
74 | * @param {Object} data The plain JavaScript object bearing properties of interest.
75 | * @param {module:model/Enhancements} obj Optional instance to populate.
76 | * @return {module:model/Enhancements} The populated Enhancements instance.
77 | */
78 | }, {
79 | key: "constructFromObject",
80 | value: function constructFromObject(data, obj) {
81 | if (data) {
82 | obj = obj || new Enhancements();
83 | if (data.hasOwnProperty('audio')) {
84 | obj['audio'] = _AudioEnhancement["default"].constructFromObject(data['audio']);
85 | }
86 | }
87 | return obj;
88 | }
89 |
90 | /**
91 | * Validates the JSON data with respect to Enhancements.
92 | * @param {Object} data The plain JavaScript object bearing properties of interest.
93 | * @return {boolean} to indicate whether the JSON data is valid with respect to Enhancements.
94 | */
95 | }, {
96 | key: "validateJSON",
97 | value: function validateJSON(data) {
98 | // validate the optional field `audio`
99 | if (data['audio']) {
100 | // data not null
101 | _AudioEnhancement["default"].validateJSON(data['audio']);
102 | }
103 | return true;
104 | }
105 | }]);
106 | }();
107 | /**
108 | * @member {module:model/AudioEnhancement} audio
109 | */
110 | Enhancements.prototype['audio'] = undefined;
111 | var _default = exports["default"] = Enhancements;
--------------------------------------------------------------------------------
/src/model/TextBackground.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The TextBackground model module.
28 | * @module model/TextBackground
29 | * @version 0.2.9
30 | */
31 | var TextBackground = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new TextBackground.
34 | * Displays a background box behind the text.
35 | * @alias module:model/TextBackground
36 | */
37 | function TextBackground() {
38 | _classCallCheck(this, TextBackground);
39 | TextBackground.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(TextBackground, [{
48 | key: "getColor",
49 | value:
50 | /**
51 | * Returns The background color using hexadecimal color notation.
52 | * @return {String}
53 | */
54 | function getColor() {
55 | return this.color;
56 | }
57 |
58 | /**
59 | * Sets The background color using hexadecimal color notation.
60 | * @param {String} color The background color using hexadecimal color notation.
61 | */
62 | }, {
63 | key: "setColor",
64 | value: function setColor(color) {
65 | this['color'] = color;
66 | return this;
67 | }
68 | }], [{
69 | key: "initialize",
70 | value: function initialize(obj) {}
71 |
72 | /**
73 | * Constructs a TextBackground from a plain JavaScript object, optionally creating a new instance.
74 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
75 | * @param {Object} data The plain JavaScript object bearing properties of interest.
76 | * @param {module:model/TextBackground} obj Optional instance to populate.
77 | * @return {module:model/TextBackground} The populated TextBackground instance.
78 | */
79 | }, {
80 | key: "constructFromObject",
81 | value: function constructFromObject(data, obj) {
82 | if (data) {
83 | obj = obj || new TextBackground();
84 | if (data.hasOwnProperty('color')) {
85 | obj['color'] = _ApiClient["default"].convertToType(data['color'], 'String');
86 | }
87 | }
88 | return obj;
89 | }
90 |
91 | /**
92 | * Validates the JSON data with respect to TextBackground.
93 | * @param {Object} data The plain JavaScript object bearing properties of interest.
94 | * @return {boolean} to indicate whether the JSON data is valid with respect to TextBackground.
95 | */
96 | }, {
97 | key: "validateJSON",
98 | value: function validateJSON(data) {
99 | // ensure the json data is a string
100 | if (data['color'] && !(typeof data['color'] === 'string' || data['color'] instanceof String)) {
101 | throw new Error("Expected the field `color` to be a primitive type in the JSON string but got " + data['color']);
102 | }
103 | return true;
104 | }
105 | }]);
106 | }();
107 | /**
108 | * The background color using hexadecimal color notation.
109 | * @member {String} color
110 | */
111 | TextBackground.prototype['color'] = undefined;
112 | var _default = exports["default"] = TextBackground;
--------------------------------------------------------------------------------
/src/model/RotateTransformation.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _RotateTransformationAngle = _interopRequireDefault(require("./RotateTransformationAngle"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16 | * Shotstack
17 | * Official Node SDK for the Shotstack Cloud Video Editing API
18 | *
19 | * The version of the OpenAPI document: v1
20 | *
21 | *
22 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23 | * https://openapi-generator.tech
24 | * Do not edit the class manually.
25 | *
26 | */
27 | /**
28 | * The RotateTransformation model module.
29 | * @module model/RotateTransformation
30 | * @version 0.2.9
31 | */
32 | var RotateTransformation = /*#__PURE__*/function () {
33 | /**
34 | * Constructs a new RotateTransformation.
35 | * Rotate a clip by the specified angle in degrees. Rotation origin is set based on the clips `position`.
36 | * @alias module:model/RotateTransformation
37 | */
38 | function RotateTransformation() {
39 | _classCallCheck(this, RotateTransformation);
40 | RotateTransformation.initialize(this);
41 | }
42 |
43 | /**
44 | * Initializes the fields of this object.
45 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46 | * Only for internal use.
47 | */
48 | return _createClass(RotateTransformation, [{
49 | key: "getAngle",
50 | value:
51 | /**
52 | * @return {module:model/RotateTransformationAngle}
53 | */
54 | function getAngle() {
55 | return this.angle;
56 | }
57 |
58 | /**
59 | * @param {module:model/RotateTransformationAngle} angle
60 | */
61 | }, {
62 | key: "setAngle",
63 | value: function setAngle(angle) {
64 | this['angle'] = angle;
65 | return this;
66 | }
67 | }], [{
68 | key: "initialize",
69 | value: function initialize(obj) {}
70 |
71 | /**
72 | * Constructs a RotateTransformation from a plain JavaScript object, optionally creating a new instance.
73 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
74 | * @param {Object} data The plain JavaScript object bearing properties of interest.
75 | * @param {module:model/RotateTransformation} obj Optional instance to populate.
76 | * @return {module:model/RotateTransformation} The populated RotateTransformation instance.
77 | */
78 | }, {
79 | key: "constructFromObject",
80 | value: function constructFromObject(data, obj) {
81 | if (data) {
82 | obj = obj || new RotateTransformation();
83 | if (data.hasOwnProperty('angle')) {
84 | obj['angle'] = _RotateTransformationAngle["default"].constructFromObject(data['angle']);
85 | }
86 | }
87 | return obj;
88 | }
89 |
90 | /**
91 | * Validates the JSON data with respect to RotateTransformation.
92 | * @param {Object} data The plain JavaScript object bearing properties of interest.
93 | * @return {boolean} to indicate whether the JSON data is valid with respect to RotateTransformation.
94 | */
95 | }, {
96 | key: "validateJSON",
97 | value: function validateJSON(data) {
98 | // validate the optional field `angle`
99 | if (data['angle']) {
100 | // data not null
101 | _RotateTransformationAngle["default"].validateJSON(data['angle']);
102 | }
103 | return true;
104 | }
105 | }]);
106 | }();
107 | /**
108 | * @member {module:model/RotateTransformationAngle} angle
109 | */
110 | RotateTransformation.prototype['angle'] = undefined;
111 | var _default = exports["default"] = RotateTransformation;
--------------------------------------------------------------------------------
/src/model/Offset.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _OffsetX = _interopRequireDefault(require("./OffsetX"));
9 | var _OffsetY = _interopRequireDefault(require("./OffsetY"));
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
17 | * Shotstack
18 | * Official Node SDK for the Shotstack Cloud Video Editing API
19 | *
20 | * The version of the OpenAPI document: v1
21 | *
22 | *
23 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24 | * https://openapi-generator.tech
25 | * Do not edit the class manually.
26 | *
27 | */
28 | /**
29 | * The Offset model module.
30 | * @module model/Offset
31 | * @version 0.2.9
32 | */
33 | var Offset = /*#__PURE__*/function () {
34 | /**
35 | * Constructs a new Offset.
36 | * Offsets the position of an asset horizontally or vertically by a relative distance.
37 | * @alias module:model/Offset
38 | */
39 | function Offset() {
40 | _classCallCheck(this, Offset);
41 | Offset.initialize(this);
42 | }
43 |
44 | /**
45 | * Initializes the fields of this object.
46 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47 | * Only for internal use.
48 | */
49 | return _createClass(Offset, [{
50 | key: "getX",
51 | value:
52 | /**
53 | * @return {module:model/OffsetX}
54 | */
55 | function getX() {
56 | return this.x;
57 | }
58 |
59 | /**
60 | * @param {module:model/OffsetX} x
61 | */
62 | }, {
63 | key: "setX",
64 | value: function setX(x) {
65 | this['x'] = x;
66 | return this;
67 | }
68 | /**
69 | * @return {module:model/OffsetY}
70 | */
71 | }, {
72 | key: "getY",
73 | value: function getY() {
74 | return this.y;
75 | }
76 |
77 | /**
78 | * @param {module:model/OffsetY} y
79 | */
80 | }, {
81 | key: "setY",
82 | value: function setY(y) {
83 | this['y'] = y;
84 | return this;
85 | }
86 | }], [{
87 | key: "initialize",
88 | value: function initialize(obj) {}
89 |
90 | /**
91 | * Constructs a Offset from a plain JavaScript object, optionally creating a new instance.
92 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
93 | * @param {Object} data The plain JavaScript object bearing properties of interest.
94 | * @param {module:model/Offset} obj Optional instance to populate.
95 | * @return {module:model/Offset} The populated Offset instance.
96 | */
97 | }, {
98 | key: "constructFromObject",
99 | value: function constructFromObject(data, obj) {
100 | if (data) {
101 | obj = obj || new Offset();
102 | if (data.hasOwnProperty('x')) {
103 | obj['x'] = _OffsetX["default"].constructFromObject(data['x']);
104 | }
105 | if (data.hasOwnProperty('y')) {
106 | obj['y'] = _OffsetY["default"].constructFromObject(data['y']);
107 | }
108 | }
109 | return obj;
110 | }
111 |
112 | /**
113 | * Validates the JSON data with respect to Offset.
114 | * @param {Object} data The plain JavaScript object bearing properties of interest.
115 | * @return {boolean} to indicate whether the JSON data is valid with respect to Offset.
116 | */
117 | }, {
118 | key: "validateJSON",
119 | value: function validateJSON(data) {
120 | // validate the optional field `x`
121 | if (data['x']) {
122 | // data not null
123 | _OffsetX["default"].validateJSON(data['x']);
124 | }
125 | // validate the optional field `y`
126 | if (data['y']) {
127 | // data not null
128 | _OffsetY["default"].validateJSON(data['y']);
129 | }
130 | return true;
131 | }
132 | }]);
133 | }();
134 | /**
135 | * @member {module:model/OffsetX} x
136 | */
137 | Offset.prototype['x'] = undefined;
138 |
139 | /**
140 | * @member {module:model/OffsetY} y
141 | */
142 | Offset.prototype['y'] = undefined;
143 | var _default = exports["default"] = Offset;
--------------------------------------------------------------------------------
/src/model/FlipTransformation.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The FlipTransformation model module.
28 | * @module model/FlipTransformation
29 | * @version 0.2.9
30 | */
31 | var FlipTransformation = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new FlipTransformation.
34 | * Flip a clip vertically or horizontally. Acts as a mirror effect of the clip along the selected plane.
35 | * @alias module:model/FlipTransformation
36 | */
37 | function FlipTransformation() {
38 | _classCallCheck(this, FlipTransformation);
39 | FlipTransformation.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(FlipTransformation, [{
48 | key: "getHorizontal",
49 | value:
50 | /**
51 | * Returns Flip a clip horizontally.
52 | * @return {Boolean}
53 | */
54 | function getHorizontal() {
55 | return this.horizontal;
56 | }
57 |
58 | /**
59 | * Sets Flip a clip horizontally.
60 | * @param {Boolean} horizontal Flip a clip horizontally.
61 | */
62 | }, {
63 | key: "setHorizontal",
64 | value: function setHorizontal(horizontal) {
65 | this['horizontal'] = horizontal;
66 | return this;
67 | }
68 | /**
69 | * Returns Flip a clip vertically.
70 | * @return {Boolean}
71 | */
72 | }, {
73 | key: "getVertical",
74 | value: function getVertical() {
75 | return this.vertical;
76 | }
77 |
78 | /**
79 | * Sets Flip a clip vertically.
80 | * @param {Boolean} vertical Flip a clip vertically.
81 | */
82 | }, {
83 | key: "setVertical",
84 | value: function setVertical(vertical) {
85 | this['vertical'] = vertical;
86 | return this;
87 | }
88 | }], [{
89 | key: "initialize",
90 | value: function initialize(obj) {}
91 |
92 | /**
93 | * Constructs a FlipTransformation from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/FlipTransformation} obj Optional instance to populate.
97 | * @return {module:model/FlipTransformation} The populated FlipTransformation instance.
98 | */
99 | }, {
100 | key: "constructFromObject",
101 | value: function constructFromObject(data, obj) {
102 | if (data) {
103 | obj = obj || new FlipTransformation();
104 | if (data.hasOwnProperty('horizontal')) {
105 | obj['horizontal'] = _ApiClient["default"].convertToType(data['horizontal'], 'Boolean');
106 | }
107 | if (data.hasOwnProperty('vertical')) {
108 | obj['vertical'] = _ApiClient["default"].convertToType(data['vertical'], 'Boolean');
109 | }
110 | }
111 | return obj;
112 | }
113 |
114 | /**
115 | * Validates the JSON data with respect to FlipTransformation.
116 | * @param {Object} data The plain JavaScript object bearing properties of interest.
117 | * @return {boolean} to indicate whether the JSON data is valid with respect to FlipTransformation.
118 | */
119 | }, {
120 | key: "validateJSON",
121 | value: function validateJSON(data) {
122 | return true;
123 | }
124 | }]);
125 | }();
126 | /**
127 | * Flip a clip horizontally.
128 | * @member {Boolean} horizontal
129 | */
130 | FlipTransformation.prototype['horizontal'] = undefined;
131 |
132 | /**
133 | * Flip a clip vertically.
134 | * @member {Boolean} vertical
135 | */
136 | FlipTransformation.prototype['vertical'] = undefined;
137 | var _default = exports["default"] = FlipTransformation;
--------------------------------------------------------------------------------
/src/model/SkewTransformation.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _SkewTransformationX = _interopRequireDefault(require("./SkewTransformationX"));
9 | var _SkewTransformationY = _interopRequireDefault(require("./SkewTransformationY"));
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
17 | * Shotstack
18 | * Official Node SDK for the Shotstack Cloud Video Editing API
19 | *
20 | * The version of the OpenAPI document: v1
21 | *
22 | *
23 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24 | * https://openapi-generator.tech
25 | * Do not edit the class manually.
26 | *
27 | */
28 | /**
29 | * The SkewTransformation model module.
30 | * @module model/SkewTransformation
31 | * @version 0.2.9
32 | */
33 | var SkewTransformation = /*#__PURE__*/function () {
34 | /**
35 | * Constructs a new SkewTransformation.
36 | * Skew a clip so its edges are sheared at an angle. Use values between 0 and 3. Over 3 the clip will be skewed almost flat.
37 | * @alias module:model/SkewTransformation
38 | */
39 | function SkewTransformation() {
40 | _classCallCheck(this, SkewTransformation);
41 | SkewTransformation.initialize(this);
42 | }
43 |
44 | /**
45 | * Initializes the fields of this object.
46 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
47 | * Only for internal use.
48 | */
49 | return _createClass(SkewTransformation, [{
50 | key: "getX",
51 | value:
52 | /**
53 | * @return {module:model/SkewTransformationX}
54 | */
55 | function getX() {
56 | return this.x;
57 | }
58 |
59 | /**
60 | * @param {module:model/SkewTransformationX} x
61 | */
62 | }, {
63 | key: "setX",
64 | value: function setX(x) {
65 | this['x'] = x;
66 | return this;
67 | }
68 | /**
69 | * @return {module:model/SkewTransformationY}
70 | */
71 | }, {
72 | key: "getY",
73 | value: function getY() {
74 | return this.y;
75 | }
76 |
77 | /**
78 | * @param {module:model/SkewTransformationY} y
79 | */
80 | }, {
81 | key: "setY",
82 | value: function setY(y) {
83 | this['y'] = y;
84 | return this;
85 | }
86 | }], [{
87 | key: "initialize",
88 | value: function initialize(obj) {}
89 |
90 | /**
91 | * Constructs a SkewTransformation from a plain JavaScript object, optionally creating a new instance.
92 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
93 | * @param {Object} data The plain JavaScript object bearing properties of interest.
94 | * @param {module:model/SkewTransformation} obj Optional instance to populate.
95 | * @return {module:model/SkewTransformation} The populated SkewTransformation instance.
96 | */
97 | }, {
98 | key: "constructFromObject",
99 | value: function constructFromObject(data, obj) {
100 | if (data) {
101 | obj = obj || new SkewTransformation();
102 | if (data.hasOwnProperty('x')) {
103 | obj['x'] = _SkewTransformationX["default"].constructFromObject(data['x']);
104 | }
105 | if (data.hasOwnProperty('y')) {
106 | obj['y'] = _SkewTransformationY["default"].constructFromObject(data['y']);
107 | }
108 | }
109 | return obj;
110 | }
111 |
112 | /**
113 | * Validates the JSON data with respect to SkewTransformation.
114 | * @param {Object} data The plain JavaScript object bearing properties of interest.
115 | * @return {boolean} to indicate whether the JSON data is valid with respect to SkewTransformation.
116 | */
117 | }, {
118 | key: "validateJSON",
119 | value: function validateJSON(data) {
120 | // validate the optional field `x`
121 | if (data['x']) {
122 | // data not null
123 | _SkewTransformationX["default"].validateJSON(data['x']);
124 | }
125 | // validate the optional field `y`
126 | if (data['y']) {
127 | // data not null
128 | _SkewTransformationY["default"].validateJSON(data['y']);
129 | }
130 | return true;
131 | }
132 | }]);
133 | }();
134 | /**
135 | * @member {module:model/SkewTransformationX} x
136 | */
137 | SkewTransformation.prototype['x'] = undefined;
138 |
139 | /**
140 | * @member {module:model/SkewTransformationY} y
141 | */
142 | SkewTransformation.prototype['y'] = undefined;
143 | var _default = exports["default"] = SkewTransformation;
--------------------------------------------------------------------------------
/src/model/Transcription.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The Transcription model module.
28 | * @module model/Transcription
29 | * @version 0.2.9
30 | */
31 | var Transcription = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new Transcription.
34 | * Generate a transcription of the audio in the video. The transcription can be output as a file in SRT or VTT format.
35 | * @alias module:model/Transcription
36 | */
37 | function Transcription() {
38 | _classCallCheck(this, Transcription);
39 | Transcription.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(Transcription, [{
48 | key: "getFormat",
49 | value:
50 | /**
51 | * Returns The output format of the transcription file. The following formats are available:
Transcription from a plain JavaScript object, optionally creating a new instance.
74 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
75 | * @param {Object} data The plain JavaScript object bearing properties of interest.
76 | * @param {module:model/Transcription} obj Optional instance to populate.
77 | * @return {module:model/Transcription} The populated Transcription instance.
78 | */
79 | }, {
80 | key: "constructFromObject",
81 | value: function constructFromObject(data, obj) {
82 | if (data) {
83 | obj = obj || new Transcription();
84 | if (data.hasOwnProperty('format')) {
85 | obj['format'] = _ApiClient["default"].convertToType(data['format'], 'String');
86 | }
87 | }
88 | return obj;
89 | }
90 |
91 | /**
92 | * Validates the JSON data with respect to Transcription.
93 | * @param {Object} data The plain JavaScript object bearing properties of interest.
94 | * @return {boolean} to indicate whether the JSON data is valid with respect to Transcription.
95 | */
96 | }, {
97 | key: "validateJSON",
98 | value: function validateJSON(data) {
99 | // ensure the json data is a string
100 | if (data['format'] && !(typeof data['format'] === 'string' || data['format'] instanceof String)) {
101 | throw new Error("Expected the field `format` to be a primitive type in the JSON string but got " + data['format']);
102 | }
103 | return true;
104 | }
105 | }]);
106 | }();
107 | /**
108 | * The output format of the transcription file. The following formats are available: format property.
115 | * @enum {String}
116 | * @readonly
117 | */
118 | Transcription['FormatEnum'] = {
119 | /**
120 | * value: "srt"
121 | * @const
122 | */
123 | "srt": "srt",
124 | /**
125 | * value: "vtt"
126 | * @const
127 | */
128 | "vtt": "vtt"
129 | };
130 | var _default = exports["default"] = Transcription;
--------------------------------------------------------------------------------
/src/model/Range.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The Range model module.
28 | * @module model/Range
29 | * @version 0.2.9
30 | */
31 | var Range = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new Range.
34 | * Specify a time range to render, i.e. to render only a portion of a video or audio file. Omit this setting to export the entire video. Range can also be used to render a frame at a specific time point - setting a range and output format as `jpg` will output a single frame image at the range `start` point.
35 | * @alias module:model/Range
36 | */
37 | function Range() {
38 | _classCallCheck(this, Range);
39 | Range.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(Range, [{
48 | key: "getStart",
49 | value:
50 | /**
51 | * Returns The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
52 | * minimum: 0
53 | * @return {Number}
54 | */
55 | function getStart() {
56 | return this.start;
57 | }
58 |
59 | /**
60 | * Sets The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
61 | * @param {Number} start The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
62 | */
63 | }, {
64 | key: "setStart",
65 | value: function setStart(start) {
66 | this['start'] = start;
67 | return this;
68 | }
69 | /**
70 | * Returns The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
71 | * minimum: 0
72 | * @return {Number}
73 | */
74 | }, {
75 | key: "getLength",
76 | value: function getLength() {
77 | return this.length;
78 | }
79 |
80 | /**
81 | * Sets The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
82 | * @param {Number} length The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
83 | */
84 | }, {
85 | key: "setLength",
86 | value: function setLength(length) {
87 | this['length'] = length;
88 | return this;
89 | }
90 | }], [{
91 | key: "initialize",
92 | value: function initialize(obj) {}
93 |
94 | /**
95 | * Constructs a Range from a plain JavaScript object, optionally creating a new instance.
96 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
97 | * @param {Object} data The plain JavaScript object bearing properties of interest.
98 | * @param {module:model/Range} obj Optional instance to populate.
99 | * @return {module:model/Range} The populated Range instance.
100 | */
101 | }, {
102 | key: "constructFromObject",
103 | value: function constructFromObject(data, obj) {
104 | if (data) {
105 | obj = obj || new Range();
106 | if (data.hasOwnProperty('start')) {
107 | obj['start'] = _ApiClient["default"].convertToType(data['start'], 'Number');
108 | }
109 | if (data.hasOwnProperty('length')) {
110 | obj['length'] = _ApiClient["default"].convertToType(data['length'], 'Number');
111 | }
112 | }
113 | return obj;
114 | }
115 |
116 | /**
117 | * Validates the JSON data with respect to Range.
118 | * @param {Object} data The plain JavaScript object bearing properties of interest.
119 | * @return {boolean} to indicate whether the JSON data is valid with respect to Range.
120 | */
121 | }, {
122 | key: "validateJSON",
123 | value: function validateJSON(data) {
124 | return true;
125 | }
126 | }]);
127 | }();
128 | /**
129 | * The point on the timeline, in seconds, to start the render from - i.e. start at second 3.
130 | * @member {Number} start
131 | */
132 | Range.prototype['start'] = undefined;
133 |
134 | /**
135 | * The length of the portion of the video or audio to render - i.e. render 6 seconds of the video.
136 | * @member {Number} length
137 | */
138 | Range.prototype['length'] = undefined;
139 | var _default = exports["default"] = Range;
--------------------------------------------------------------------------------
/src/api/EndpointsApi.js:
--------------------------------------------------------------------------------
1 | /**
2 | * Shotstack
3 | * The Shotstack API is a video editing service that allows for the automated creation of videos using JSON. You can configure an edit and POST it to the Shotstack API which will render your video and provide a file location when complete. For more details visit [shotstack.io](https://shotstack.io) or checkout our [getting started](https://shotstack.gitbook.io/docs/guides/getting-started) documentation.
4 | *
5 | * The version of the OpenAPI document: v1
6 | *
7 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
8 | * https://openapi-generator.tech
9 | *
10 | * OpenAPI Generator version: 5.0.0
11 | *
12 | * Do not edit the class manually.
13 | *
14 | */
15 |
16 | (function(root, factory) {
17 | if (typeof define === 'function' && define.amd) {
18 | // AMD. Register as an anonymous module.
19 | define(['ApiClient', 'model/Edit', 'model/QueuedResponse', 'model/RenderResponse'], factory);
20 | } else if (typeof module === 'object' && module.exports) {
21 | // CommonJS-like environments that support module.exports, like Node.
22 | module.exports = factory(require('../ApiClient'), require('../model/Edit'), require('../model/QueuedResponse'), require('../model/RenderResponse'));
23 | } else {
24 | // Browser globals (root is window)
25 | if (!root.ShotstackSdk) {
26 | root.ShotstackSdk = {};
27 | }
28 | root.ShotstackSdk.EndpointsApi = factory(root.ShotstackSdk.ApiClient, root.ShotstackSdk.Edit, root.ShotstackSdk.QueuedResponse, root.ShotstackSdk.RenderResponse);
29 | }
30 | }(this, function(ApiClient, Edit, QueuedResponse, RenderResponse) {
31 | 'use strict';
32 |
33 | /**
34 | * Endpoints service.
35 | * @module api/EndpointsApi
36 | * @version v1
37 | */
38 |
39 | /**
40 | * Constructs a new EndpointsApi.
41 | * @alias module:api/EndpointsApi
42 | * @class
43 | * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
44 | * default to {@link module:ApiClient#instance} if unspecified.
45 | */
46 | var exports = function(apiClient) {
47 | this.apiClient = apiClient || ApiClient.instance;
48 |
49 |
50 |
51 | /**
52 | * Get Render Status
53 | * Get the rendering status, video url and details of a timeline by ID.
54 | * @param {String} id The id of the timeline render task in UUID format
55 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RenderResponse} and HTTP response
56 | */
57 | this.getRenderWithHttpInfo = function(id) {
58 | var postBody = null;
59 | // verify the required parameter 'id' is set
60 | if (id === undefined || id === null) {
61 | throw new Error("Missing the required parameter 'id' when calling getRender");
62 | }
63 |
64 | var pathParams = {
65 | 'id': id
66 | };
67 | var queryParams = {
68 | };
69 | var collectionQueryParams = {
70 | };
71 | var headerParams = {
72 | };
73 | var formParams = {
74 | };
75 |
76 | var authNames = ['DeveloperKey'];
77 | var contentTypes = [];
78 | var accepts = ['application/json'];
79 | var returnType = RenderResponse;
80 | return this.apiClient.callApi(
81 | '/render/{id}', 'GET',
82 | pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
83 | authNames, contentTypes, accepts, returnType, null
84 | );
85 | }
86 |
87 | /**
88 | * Get Render Status
89 | * Get the rendering status, video url and details of a timeline by ID.
90 | * @param {String} id The id of the timeline render task in UUID format
91 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RenderResponse}
92 | */
93 | this.getRender = function(id) {
94 | return this.getRenderWithHttpInfo(id)
95 | .then(function(response_and_data) {
96 | return response_and_data.data;
97 | });
98 | }
99 |
100 |
101 | /**
102 | * Render Video
103 | * Queue and render the contents of a timeline as a video file.
104 | * @param {module:model/Edit} edit The video edit specified using JSON.
105 | * @param {Object} opts Optional parameters
106 | * @param {String} opts.xApiQueueId The id of a dedicated queue (enterprise customers only).
107 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/QueuedResponse} and HTTP response
108 | */
109 | this.postRenderWithHttpInfo = function(edit, opts) {
110 | opts = opts || {};
111 | var postBody = edit;
112 | // verify the required parameter 'edit' is set
113 | if (edit === undefined || edit === null) {
114 | throw new Error("Missing the required parameter 'edit' when calling postRender");
115 | }
116 |
117 | var pathParams = {
118 | };
119 | var queryParams = {
120 | };
121 | var collectionQueryParams = {
122 | };
123 | var headerParams = {
124 | 'x-api-queue-id': opts['xApiQueueId']
125 | };
126 | var formParams = {
127 | };
128 |
129 | var authNames = ['DeveloperKey'];
130 | var contentTypes = ['application/json'];
131 | var accepts = ['application/json'];
132 | var returnType = QueuedResponse;
133 | return this.apiClient.callApi(
134 | '/render', 'POST',
135 | pathParams, queryParams, collectionQueryParams, headerParams, formParams, postBody,
136 | authNames, contentTypes, accepts, returnType, null
137 | );
138 | }
139 |
140 | /**
141 | * Render Video
142 | * Queue and render the contents of a timeline as a video file.
143 | * @param {module:model/Edit} edit The video edit specified using JSON.
144 | * @param {Object} opts Optional parameters
145 | * @param {String} opts.xApiQueueId The id of a dedicated queue (enterprise customers only).
146 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/QueuedResponse}
147 | */
148 | this.postRender = function(edit, opts) {
149 | return this.postRenderWithHttpInfo(edit, opts)
150 | .then(function(response_and_data) {
151 | return response_and_data.data;
152 | });
153 | }
154 | };
155 |
156 | return exports;
157 | }));
158 |
--------------------------------------------------------------------------------
/src/model/TransferResponseData.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _TransferResponseAttributes = _interopRequireDefault(require("./TransferResponseAttributes"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
15 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
16 | * Shotstack
17 | * Official Node SDK for the Shotstack Cloud Video Editing API
18 | *
19 | * The version of the OpenAPI document: v1
20 | *
21 | *
22 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
23 | * https://openapi-generator.tech
24 | * Do not edit the class manually.
25 | *
26 | */
27 | /**
28 | * The TransferResponseData model module.
29 | * @module model/TransferResponseData
30 | * @version 0.2.9
31 | */
32 | var TransferResponseData = /*#__PURE__*/function () {
33 | /**
34 | * Constructs a new TransferResponseData.
35 | * The type of resource (an asset) and the transfer attributes. Returned with [TransferResponse](#tocs_transferresponse).
36 | * @alias module:model/TransferResponseData
37 | */
38 | function TransferResponseData() {
39 | _classCallCheck(this, TransferResponseData);
40 | TransferResponseData.initialize(this);
41 | }
42 |
43 | /**
44 | * Initializes the fields of this object.
45 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
46 | * Only for internal use.
47 | */
48 | return _createClass(TransferResponseData, [{
49 | key: "getType",
50 | value:
51 | /**
52 | * Returns The type of resource, in this case it is an asset.
53 | * @return {String}
54 | */
55 | function getType() {
56 | return this.type;
57 | }
58 |
59 | /**
60 | * Sets The type of resource, in this case it is an asset.
61 | * @param {String} type The type of resource, in this case it is an asset.
62 | */
63 | }, {
64 | key: "setType",
65 | value: function setType(type) {
66 | this['type'] = type;
67 | return this;
68 | }
69 | /**
70 | * @return {module:model/TransferResponseAttributes}
71 | */
72 | }, {
73 | key: "getAttributes",
74 | value: function getAttributes() {
75 | return this.attributes;
76 | }
77 |
78 | /**
79 | * @param {module:model/TransferResponseAttributes} attributes
80 | */
81 | }, {
82 | key: "setAttributes",
83 | value: function setAttributes(attributes) {
84 | this['attributes'] = attributes;
85 | return this;
86 | }
87 | }], [{
88 | key: "initialize",
89 | value: function initialize(obj) {}
90 |
91 | /**
92 | * Constructs a TransferResponseData from a plain JavaScript object, optionally creating a new instance.
93 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
94 | * @param {Object} data The plain JavaScript object bearing properties of interest.
95 | * @param {module:model/TransferResponseData} obj Optional instance to populate.
96 | * @return {module:model/TransferResponseData} The populated TransferResponseData instance.
97 | */
98 | }, {
99 | key: "constructFromObject",
100 | value: function constructFromObject(data, obj) {
101 | if (data) {
102 | obj = obj || new TransferResponseData();
103 | if (data.hasOwnProperty('type')) {
104 | obj['type'] = _ApiClient["default"].convertToType(data['type'], 'String');
105 | }
106 | if (data.hasOwnProperty('attributes')) {
107 | obj['attributes'] = _TransferResponseAttributes["default"].constructFromObject(data['attributes']);
108 | }
109 | }
110 | return obj;
111 | }
112 |
113 | /**
114 | * Validates the JSON data with respect to TransferResponseData.
115 | * @param {Object} data The plain JavaScript object bearing properties of interest.
116 | * @return {boolean} to indicate whether the JSON data is valid with respect to TransferResponseData.
117 | */
118 | }, {
119 | key: "validateJSON",
120 | value: function validateJSON(data) {
121 | // ensure the json data is a string
122 | if (data['type'] && !(typeof data['type'] === 'string' || data['type'] instanceof String)) {
123 | throw new Error("Expected the field `type` to be a primitive type in the JSON string but got " + data['type']);
124 | }
125 | // validate the optional field `attributes`
126 | if (data['attributes']) {
127 | // data not null
128 | _TransferResponseAttributes["default"].validateJSON(data['attributes']);
129 | }
130 | return true;
131 | }
132 | }]);
133 | }();
134 | /**
135 | * The type of resource, in this case it is an asset.
136 | * @member {String} type
137 | */
138 | TransferResponseData.prototype['type'] = undefined;
139 |
140 | /**
141 | * @member {module:model/TransferResponseAttributes} attributes
142 | */
143 | TransferResponseData.prototype['attributes'] = undefined;
144 | var _default = exports["default"] = TransferResponseData;
--------------------------------------------------------------------------------
/src/model/Size.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The Size model module.
28 | * @module model/Size
29 | * @version 0.2.9
30 | */
31 | var Size = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new Size.
34 | * Set a custom size for a video or image in pixels. When using a custom size omit the `resolution` and `aspectRatio`. Custom sizes must be divisible by 2 based on the encoder specifications.
35 | * @alias module:model/Size
36 | */
37 | function Size() {
38 | _classCallCheck(this, Size);
39 | Size.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(Size, [{
48 | key: "getWidth",
49 | value:
50 | /**
51 | * Returns Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
52 | * minimum: 1
53 | * maximum: 4096
54 | * @return {Number}
55 | */
56 | function getWidth() {
57 | return this.width;
58 | }
59 |
60 | /**
61 | * Sets Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
62 | * @param {Number} width Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
63 | */
64 | }, {
65 | key: "setWidth",
66 | value: function setWidth(width) {
67 | this['width'] = width;
68 | return this;
69 | }
70 | /**
71 | * Returns Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
72 | * minimum: 1
73 | * maximum: 4096
74 | * @return {Number}
75 | */
76 | }, {
77 | key: "getHeight",
78 | value: function getHeight() {
79 | return this.height;
80 | }
81 |
82 | /**
83 | * Sets Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
84 | * @param {Number} height Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
85 | */
86 | }, {
87 | key: "setHeight",
88 | value: function setHeight(height) {
89 | this['height'] = height;
90 | return this;
91 | }
92 | }], [{
93 | key: "initialize",
94 | value: function initialize(obj) {}
95 |
96 | /**
97 | * Constructs a Size from a plain JavaScript object, optionally creating a new instance.
98 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
99 | * @param {Object} data The plain JavaScript object bearing properties of interest.
100 | * @param {module:model/Size} obj Optional instance to populate.
101 | * @return {module:model/Size} The populated Size instance.
102 | */
103 | }, {
104 | key: "constructFromObject",
105 | value: function constructFromObject(data, obj) {
106 | if (data) {
107 | obj = obj || new Size();
108 | if (data.hasOwnProperty('width')) {
109 | obj['width'] = _ApiClient["default"].convertToType(data['width'], 'Number');
110 | }
111 | if (data.hasOwnProperty('height')) {
112 | obj['height'] = _ApiClient["default"].convertToType(data['height'], 'Number');
113 | }
114 | }
115 | return obj;
116 | }
117 |
118 | /**
119 | * Validates the JSON data with respect to Size.
120 | * @param {Object} data The plain JavaScript object bearing properties of interest.
121 | * @return {boolean} to indicate whether the JSON data is valid with respect to Size.
122 | */
123 | }, {
124 | key: "validateJSON",
125 | value: function validateJSON(data) {
126 | return true;
127 | }
128 | }]);
129 | }();
130 | /**
131 | * Set a custom width for the video or image file in pixels. Value must be divisible by 2. Maximum video width is 1920px, maximum image width is 4096px.
132 | * @member {Number} width
133 | */
134 | Size.prototype['width'] = undefined;
135 |
136 | /**
137 | * Set a custom height for the video or image file in pixels. Value must be divisible by 2. Maximum video height is 1920px, maximum image height is 4096px.
138 | * @member {Number} height
139 | */
140 | Size.prototype['height'] = undefined;
141 | var _default = exports["default"] = Size;
--------------------------------------------------------------------------------
/src/model/ClipStart.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _ClipStart;
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
17 | * Shotstack
18 | * Official Node SDK for the Shotstack Cloud Video Editing API
19 | *
20 | * The version of the OpenAPI document: v1
21 | *
22 | *
23 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24 | * https://openapi-generator.tech
25 | * Do not edit the class manually.
26 | *
27 | */
28 | /**
29 | * The ClipStart model module.
30 | * @module model/ClipStart
31 | * @version 0.2.9
32 | */
33 | var ClipStart = /*#__PURE__*/function () {
34 | /**
35 | * Constructs a new ClipStart.
36 | * The start position of the Clip on the timeline.
37 | * @alias module:model/ClipStart
38 | * @param {(module:model/Number|module:model/String)} instance The actual instance to initialize ClipStart.
39 | */
40 | function ClipStart() {
41 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
42 | _classCallCheck(this, ClipStart);
43 | /**
44 | * Returns the JSON representation of the actual instance.
45 | * @return {string}
46 | */
47 | _defineProperty(this, "toJSON", function () {
48 | return this.getActualInstance();
49 | });
50 | if (instance === null) {
51 | this.actualInstance = null;
52 | return;
53 | }
54 | var match = 0;
55 | var errorMessages = [];
56 | // The start position of the Clip on the timeline, in seconds. For example, to start the Clip at 2 seconds, set the start value to 2.
57 | try {
58 | // validate number
59 | if (!(typeof instance === 'number' && instance % 1 != 0)) {
60 | throw new Error("Invalid value. Must be number. Input: " + JSON.stringify(instance));
61 | }
62 | this.actualInstance = instance;
63 | match++;
64 | } catch (err) {
65 | // json data failed to deserialize into Number
66 | errorMessages.push("Failed to construct Number: " + err);
67 | }
68 |
69 | // The start position using a [smart clip property](/docs/guide/architecting-an-application/smart-clips/). Set to `auto` to automatically play the clip after the previous clip finishes.
70 | try {
71 | // validate string
72 | if (!(typeof instance === 'string')) {
73 | throw new Error("Invalid value. Must be string. Input: " + JSON.stringify(instance));
74 | }
75 | this.actualInstance = instance;
76 | match++;
77 | } catch (err) {
78 | // json data failed to deserialize into String
79 | errorMessages.push("Failed to construct String: " + err);
80 | }
81 | if (match > 1) {
82 | throw new Error("Multiple matches found constructing `ClipStart` with oneOf schemas Number, String. Input: " + JSON.stringify(instance));
83 | } else if (match === 0) {
84 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
85 | throw new Error("No match found constructing `ClipStart` with oneOf schemas Number, String. Details: " + errorMessages.join(", "));
86 | } else {// only 1 match
87 | // the input is valid
88 | }
89 | }
90 |
91 | /**
92 | * Constructs a ClipStart from a plain JavaScript object, optionally creating a new instance.
93 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
94 | * @param {Object} data The plain JavaScript object bearing properties of interest.
95 | * @param {module:model/ClipStart} obj Optional instance to populate.
96 | * @return {module:model/ClipStart} The populated ClipStart instance.
97 | */
98 | return _createClass(ClipStart, [{
99 | key: "getActualInstance",
100 | value:
101 | /**
102 | * Gets the actual instance, which can be Number, String.
103 | * @return {(module:model/Number|module:model/String)} The actual instance.
104 | */
105 | function getActualInstance() {
106 | return this.actualInstance;
107 | }
108 |
109 | /**
110 | * Sets the actual instance, which can be Number, String.
111 | * @param {(module:model/Number|module:model/String)} obj The actual instance.
112 | */
113 | }, {
114 | key: "setActualInstance",
115 | value: function setActualInstance(obj) {
116 | this.actualInstance = ClipStart.constructFromObject(obj).getActualInstance();
117 | }
118 | }], [{
119 | key: "constructFromObject",
120 | value: function constructFromObject(data, obj) {
121 | return new ClipStart(data);
122 | }
123 | }]);
124 | }();
125 | _ClipStart = ClipStart;
126 | /**
127 | * Create an instance of ClipStart from a JSON string.
128 | * @param {string} json_string JSON string.
129 | * @return {module:model/ClipStart} An instance of ClipStart.
130 | */
131 | _defineProperty(ClipStart, "fromJSON", function (json_string) {
132 | return _ClipStart.constructFromObject(JSON.parse(json_string));
133 | });
134 | ClipStart.OneOf = ["Number", "String"];
135 | var _default = exports["default"] = ClipStart;
--------------------------------------------------------------------------------
/src/model/ClipLength.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _ClipLength;
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
12 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
13 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
14 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
15 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
16 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
17 | * Shotstack
18 | * Official Node SDK for the Shotstack Cloud Video Editing API
19 | *
20 | * The version of the OpenAPI document: v1
21 | *
22 | *
23 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
24 | * https://openapi-generator.tech
25 | * Do not edit the class manually.
26 | *
27 | */
28 | /**
29 | * The ClipLength model module.
30 | * @module model/ClipLength
31 | * @version 0.2.9
32 | */
33 | var ClipLength = /*#__PURE__*/function () {
34 | /**
35 | * Constructs a new ClipLength.
36 | * The duration the Clip should play for.
37 | * @alias module:model/ClipLength
38 | * @param {(module:model/Number|module:model/String)} instance The actual instance to initialize ClipLength.
39 | */
40 | function ClipLength() {
41 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
42 | _classCallCheck(this, ClipLength);
43 | /**
44 | * Returns the JSON representation of the actual instance.
45 | * @return {string}
46 | */
47 | _defineProperty(this, "toJSON", function () {
48 | return this.getActualInstance();
49 | });
50 | if (instance === null) {
51 | this.actualInstance = null;
52 | return;
53 | }
54 | var match = 0;
55 | var errorMessages = [];
56 | // The duration the Clip should play for, in seconds. For example, to play the Clip for 5 seconds, set the length value to 5.
57 | try {
58 | // validate number
59 | if (!(typeof instance === 'number' && instance % 1 != 0)) {
60 | throw new Error("Invalid value. Must be number. Input: " + JSON.stringify(instance));
61 | }
62 | this.actualInstance = instance;
63 | match++;
64 | } catch (err) {
65 | // json data failed to deserialize into Number
66 | errorMessages.push("Failed to construct Number: " + err);
67 | }
68 |
69 | // The duration the Clip should play for using a [smart clip property](/docs/guide/architecting-an-application/smart-clips/). Set to `auto` to play the Clip for the duration of the asset. Set to `end` to display or play the clip to the end of the timeline.
70 | try {
71 | // validate string
72 | if (!(typeof instance === 'string')) {
73 | throw new Error("Invalid value. Must be string. Input: " + JSON.stringify(instance));
74 | }
75 | this.actualInstance = instance;
76 | match++;
77 | } catch (err) {
78 | // json data failed to deserialize into String
79 | errorMessages.push("Failed to construct String: " + err);
80 | }
81 | if (match > 1) {
82 | throw new Error("Multiple matches found constructing `ClipLength` with oneOf schemas Number, String. Input: " + JSON.stringify(instance));
83 | } else if (match === 0) {
84 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
85 | throw new Error("No match found constructing `ClipLength` with oneOf schemas Number, String. Details: " + errorMessages.join(", "));
86 | } else {// only 1 match
87 | // the input is valid
88 | }
89 | }
90 |
91 | /**
92 | * Constructs a ClipLength from a plain JavaScript object, optionally creating a new instance.
93 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
94 | * @param {Object} data The plain JavaScript object bearing properties of interest.
95 | * @param {module:model/ClipLength} obj Optional instance to populate.
96 | * @return {module:model/ClipLength} The populated ClipLength instance.
97 | */
98 | return _createClass(ClipLength, [{
99 | key: "getActualInstance",
100 | value:
101 | /**
102 | * Gets the actual instance, which can be Number, String.
103 | * @return {(module:model/Number|module:model/String)} The actual instance.
104 | */
105 | function getActualInstance() {
106 | return this.actualInstance;
107 | }
108 |
109 | /**
110 | * Sets the actual instance, which can be Number, String.
111 | * @param {(module:model/Number|module:model/String)} obj The actual instance.
112 | */
113 | }, {
114 | key: "setActualInstance",
115 | value: function setActualInstance(obj) {
116 | this.actualInstance = ClipLength.constructFromObject(obj).getActualInstance();
117 | }
118 | }], [{
119 | key: "constructFromObject",
120 | value: function constructFromObject(data, obj) {
121 | return new ClipLength(data);
122 | }
123 | }]);
124 | }();
125 | _ClipLength = ClipLength;
126 | /**
127 | * Create an instance of ClipLength from a JSON string.
128 | * @param {string} json_string JSON string.
129 | * @return {module:model/ClipLength} An instance of ClipLength.
130 | */
131 | _defineProperty(ClipLength, "fromJSON", function (json_string) {
132 | return _ClipLength.constructFromObject(JSON.parse(json_string));
133 | });
134 | ClipLength.OneOf = ["Number", "String"];
135 | var _default = exports["default"] = ClipLength;
--------------------------------------------------------------------------------
/src/model/OffsetY.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _OffsetY;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The OffsetY model module.
31 | * @module model/OffsetY
32 | * @version 0.2.9
33 | */
34 | var OffsetY = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new OffsetY.
37 | * Offset an asset on the vertical axis (up or down). Use a number or an array of [Tween](./#tocs_tween) objects to create a custom animation.
38 | * @alias module:model/OffsetY
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize OffsetY.
40 | */
41 | function OffsetY() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, OffsetY);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // Range varies from -10 to 10. Positive numbers move the asset up, negative down. The distance moved is relative to the height of the viewport - i.e. an Y offset of 0.5 will move the asset half the screen height up.
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom animation. Animate the Y offset of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `OffsetY` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `OffsetY` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a OffsetY from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/OffsetY} obj Optional instance to populate.
97 | * @return {module:model/OffsetY} The populated OffsetY instance.
98 | */
99 | return _createClass(OffsetY, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = OffsetY.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new OffsetY(data);
123 | }
124 | }]);
125 | }();
126 | _OffsetY = OffsetY;
127 | /**
128 | * Create an instance of OffsetY from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/OffsetY} An instance of OffsetY.
131 | */
132 | _defineProperty(OffsetY, "fromJSON", function (json_string) {
133 | return _OffsetY.constructFromObject(JSON.parse(json_string));
134 | });
135 | OffsetY.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = OffsetY;
--------------------------------------------------------------------------------
/src/model/OffsetX.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _OffsetX;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The OffsetX model module.
31 | * @module model/OffsetX
32 | * @version 0.2.9
33 | */
34 | var OffsetX = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new OffsetX.
37 | * Offset an asset on the horizontal axis (left or right). Use a number or an array of [Tween](./#tocs_tween) objects to create a custom animation.
38 | * @alias module:model/OffsetX
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize OffsetX.
40 | */
41 | function OffsetX() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, OffsetX);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // Range varies from -10 to 10. Positive numbers move the asset right, negative left. The distance moved is relative to the width of the viewport - i.e. an X offset of 0.5 will move the asset half the screen width to the right.
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom animation. Animate the X offset of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `OffsetX` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `OffsetX` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a OffsetX from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/OffsetX} obj Optional instance to populate.
97 | * @return {module:model/OffsetX} The populated OffsetX instance.
98 | */
99 | return _createClass(OffsetX, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = OffsetX.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new OffsetX(data);
123 | }
124 | }]);
125 | }();
126 | _OffsetX = OffsetX;
127 | /**
128 | * Create an instance of OffsetX from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/OffsetX} An instance of OffsetX.
131 | */
132 | _defineProperty(OffsetX, "fromJSON", function (json_string) {
133 | return _OffsetX.constructFromObject(JSON.parse(json_string));
134 | });
135 | OffsetX.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = OffsetX;
--------------------------------------------------------------------------------
/src/model/CaptionMargin.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The CaptionMargin model module.
28 | * @module model/CaptionMargin
29 | * @version 0.2.9
30 | */
31 | var CaptionMargin = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new CaptionMargin.
34 | * The margin properties for captions. Margins are used to position the caption text and background on the screen.
35 | * @alias module:model/CaptionMargin
36 | */
37 | function CaptionMargin() {
38 | _classCallCheck(this, CaptionMargin);
39 | CaptionMargin.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(CaptionMargin, [{
48 | key: "getTop",
49 | value:
50 | /**
51 | * Returns The margin above the text. Pushes captions down the screen.
52 | * @return {Number}
53 | */
54 | function getTop() {
55 | return this.top;
56 | }
57 |
58 | /**
59 | * Sets The margin above the text. Pushes captions down the screen.
60 | * @param {Number} top The margin above the text. Pushes captions down the screen.
61 | */
62 | }, {
63 | key: "setTop",
64 | value: function setTop(top) {
65 | this['top'] = top;
66 | return this;
67 | }
68 | /**
69 | * Returns The margin to the left of the text. Pushes captions to the right.
70 | * @return {Number}
71 | */
72 | }, {
73 | key: "getLeft",
74 | value: function getLeft() {
75 | return this.left;
76 | }
77 |
78 | /**
79 | * Sets The margin to the left of the text. Pushes captions to the right.
80 | * @param {Number} left The margin to the left of the text. Pushes captions to the right.
81 | */
82 | }, {
83 | key: "setLeft",
84 | value: function setLeft(left) {
85 | this['left'] = left;
86 | return this;
87 | }
88 | /**
89 | * Returns The margin to the right of the text. Pushes captions to the left.
90 | * @return {Number}
91 | */
92 | }, {
93 | key: "getRight",
94 | value: function getRight() {
95 | return this.right;
96 | }
97 |
98 | /**
99 | * Sets The margin to the right of the text. Pushes captions to the left.
100 | * @param {Number} right The margin to the right of the text. Pushes captions to the left.
101 | */
102 | }, {
103 | key: "setRight",
104 | value: function setRight(right) {
105 | this['right'] = right;
106 | return this;
107 | }
108 | }], [{
109 | key: "initialize",
110 | value: function initialize(obj) {}
111 |
112 | /**
113 | * Constructs a CaptionMargin from a plain JavaScript object, optionally creating a new instance.
114 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
115 | * @param {Object} data The plain JavaScript object bearing properties of interest.
116 | * @param {module:model/CaptionMargin} obj Optional instance to populate.
117 | * @return {module:model/CaptionMargin} The populated CaptionMargin instance.
118 | */
119 | }, {
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | if (data) {
123 | obj = obj || new CaptionMargin();
124 | if (data.hasOwnProperty('top')) {
125 | obj['top'] = _ApiClient["default"].convertToType(data['top'], 'Number');
126 | }
127 | if (data.hasOwnProperty('left')) {
128 | obj['left'] = _ApiClient["default"].convertToType(data['left'], 'Number');
129 | }
130 | if (data.hasOwnProperty('right')) {
131 | obj['right'] = _ApiClient["default"].convertToType(data['right'], 'Number');
132 | }
133 | }
134 | return obj;
135 | }
136 |
137 | /**
138 | * Validates the JSON data with respect to CaptionMargin.
139 | * @param {Object} data The plain JavaScript object bearing properties of interest.
140 | * @return {boolean} to indicate whether the JSON data is valid with respect to CaptionMargin.
141 | */
142 | }, {
143 | key: "validateJSON",
144 | value: function validateJSON(data) {
145 | return true;
146 | }
147 | }]);
148 | }();
149 | /**
150 | * The margin above the text. Pushes captions down the screen.
151 | * @member {Number} top
152 | */
153 | CaptionMargin.prototype['top'] = undefined;
154 |
155 | /**
156 | * The margin to the left of the text. Pushes captions to the right.
157 | * @member {Number} left
158 | */
159 | CaptionMargin.prototype['left'] = undefined;
160 |
161 | /**
162 | * The margin to the right of the text. Pushes captions to the left.
163 | * @member {Number} right
164 | */
165 | CaptionMargin.prototype['right'] = undefined;
166 | var _default = exports["default"] = CaptionMargin;
--------------------------------------------------------------------------------
/src/model/AudioAssetVolume.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _AudioAssetVolume;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The AudioAssetVolume model module.
31 | * @module model/AudioAssetVolume
32 | * @version 0.2.9
33 | */
34 | var AudioAssetVolume = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new AudioAssetVolume.
37 | * Set the volume of the audio clip. Use a number or an array of [Tween](./#tocs_tween) objects to create custom volume transitions.
38 | * @alias module:model/AudioAssetVolume
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize AudioAssetVolume.
40 | */
41 | function AudioAssetVolume() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, AudioAssetVolume);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // The volume level for the audio clip. Range varies from 0 to 1 where 0 is muted and 1 is full volume (defaults to 1).
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom volume effect. Modify the volume of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `AudioAssetVolume` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `AudioAssetVolume` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a AudioAssetVolume from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/AudioAssetVolume} obj Optional instance to populate.
97 | * @return {module:model/AudioAssetVolume} The populated AudioAssetVolume instance.
98 | */
99 | return _createClass(AudioAssetVolume, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = AudioAssetVolume.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new AudioAssetVolume(data);
123 | }
124 | }]);
125 | }();
126 | _AudioAssetVolume = AudioAssetVolume;
127 | /**
128 | * Create an instance of AudioAssetVolume from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/AudioAssetVolume} An instance of AudioAssetVolume.
131 | */
132 | _defineProperty(AudioAssetVolume, "fromJSON", function (json_string) {
133 | return _AudioAssetVolume.constructFromObject(JSON.parse(json_string));
134 | });
135 | AudioAssetVolume.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = AudioAssetVolume;
--------------------------------------------------------------------------------
/src/model/VideoAssetVolume.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _VideoAssetVolume;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The VideoAssetVolume model module.
31 | * @module model/VideoAssetVolume
32 | * @version 0.2.9
33 | */
34 | var VideoAssetVolume = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new VideoAssetVolume.
37 | * Set the volume of the video clip. Use a number or an array of [Tween](./#tocs_tween) objects to create custom volume transitions.
38 | * @alias module:model/VideoAssetVolume
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize VideoAssetVolume.
40 | */
41 | function VideoAssetVolume() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, VideoAssetVolume);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // The volume level for the video clip. Range varies from 0 to 1 where 0 is muted and 1 is full volume (defaults to 1).
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom volume effect. Modify the volume of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `VideoAssetVolume` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `VideoAssetVolume` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a VideoAssetVolume from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/VideoAssetVolume} obj Optional instance to populate.
97 | * @return {module:model/VideoAssetVolume} The populated VideoAssetVolume instance.
98 | */
99 | return _createClass(VideoAssetVolume, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = VideoAssetVolume.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new VideoAssetVolume(data);
123 | }
124 | }]);
125 | }();
126 | _VideoAssetVolume = VideoAssetVolume;
127 | /**
128 | * Create an instance of VideoAssetVolume from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/VideoAssetVolume} An instance of VideoAssetVolume.
131 | */
132 | _defineProperty(VideoAssetVolume, "fromJSON", function (json_string) {
133 | return _VideoAssetVolume.constructFromObject(JSON.parse(json_string));
134 | });
135 | VideoAssetVolume.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = VideoAssetVolume;
--------------------------------------------------------------------------------
/src/model/ClipOpacity.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _ClipOpacity;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The ClipOpacity model module.
31 | * @module model/ClipOpacity
32 | * @version 0.2.9
33 | */
34 | var ClipOpacity = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new ClipOpacity.
37 | * Offset an asset on the horizontal axis (left or right). Use a number or an array of [Tween](./#tocs_tween) objects to create a custom animation.
38 | * @alias module:model/ClipOpacity
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize ClipOpacity.
40 | */
41 | function ClipOpacity() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, ClipOpacity);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // Sets the opacity of the Clip where 1 is opaque and 0 is transparent.
58 | try {
59 | // validate number
60 | if (!(typeof instance === 'number' && instance % 1 != 0)) {
61 | throw new Error("Invalid value. Must be number. Input: " + JSON.stringify(instance));
62 | }
63 | this.actualInstance = instance;
64 | match++;
65 | } catch (err) {
66 | // json data failed to deserialize into Number
67 | errorMessages.push("Failed to construct Number: " + err);
68 | }
69 |
70 | // An array of [Tween](./#tocs_tween) objects used to create a custom animation. Animate the opacity of an asset over time.
71 | try {
72 | if (typeof instance === "[Tween]") {
73 | this.actualInstance = instance;
74 | } else {
75 | // plain JS object
76 | // validate the object
77 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
78 | // create [Tween] from JS object
79 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
80 | }
81 | match++;
82 | } catch (err) {
83 | // json data failed to deserialize into [Tween]
84 | errorMessages.push("Failed to construct [Tween]: " + err);
85 | }
86 | if (match > 1) {
87 | throw new Error("Multiple matches found constructing `ClipOpacity` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
88 | } else if (match === 0) {
89 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
90 | throw new Error("No match found constructing `ClipOpacity` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
91 | } else {// only 1 match
92 | // the input is valid
93 | }
94 | }
95 |
96 | /**
97 | * Constructs a ClipOpacity from a plain JavaScript object, optionally creating a new instance.
98 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
99 | * @param {Object} data The plain JavaScript object bearing properties of interest.
100 | * @param {module:model/ClipOpacity} obj Optional instance to populate.
101 | * @return {module:model/ClipOpacity} The populated ClipOpacity instance.
102 | */
103 | return _createClass(ClipOpacity, [{
104 | key: "getActualInstance",
105 | value:
106 | /**
107 | * Gets the actual instance, which can be Number, [Tween].
108 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
109 | */
110 | function getActualInstance() {
111 | return this.actualInstance;
112 | }
113 |
114 | /**
115 | * Sets the actual instance, which can be Number, [Tween].
116 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
117 | */
118 | }, {
119 | key: "setActualInstance",
120 | value: function setActualInstance(obj) {
121 | this.actualInstance = ClipOpacity.constructFromObject(obj).getActualInstance();
122 | }
123 | }], [{
124 | key: "constructFromObject",
125 | value: function constructFromObject(data, obj) {
126 | return new ClipOpacity(data);
127 | }
128 | }]);
129 | }();
130 | _ClipOpacity = ClipOpacity;
131 | /**
132 | * Create an instance of ClipOpacity from a JSON string.
133 | * @param {string} json_string JSON string.
134 | * @return {module:model/ClipOpacity} An instance of ClipOpacity.
135 | */
136 | _defineProperty(ClipOpacity, "fromJSON", function (json_string) {
137 | return _ClipOpacity.constructFromObject(JSON.parse(json_string));
138 | });
139 | ClipOpacity.OneOf = ["Number", "[Tween]"];
140 | var _default = exports["default"] = ClipOpacity;
--------------------------------------------------------------------------------
/src/model/AudioEnhancement.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _DolbyEnhancement = _interopRequireDefault(require("./DolbyEnhancement"));
9 | var _DolbyEnhancementOptions = _interopRequireDefault(require("./DolbyEnhancementOptions"));
10 | var _AudioEnhancement;
11 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The AudioEnhancement model module.
32 | * @module model/AudioEnhancement
33 | * @version 0.2.9
34 | */
35 | var AudioEnhancement = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new AudioEnhancement.
38 | * An audio enhancement that can be applied to the audio content of a rendition. The following providers are available: <ul> <li><a href=\"#tocs_dolbyenhancement\">DolbyEnhancement</a></li> </ul>
39 | * @alias module:model/AudioEnhancement
40 | * @param {(module:model/DolbyEnhancement)} instance The actual instance to initialize AudioEnhancement.
41 | */
42 | function AudioEnhancement() {
43 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
44 | _classCallCheck(this, AudioEnhancement);
45 | /**
46 | * Returns the JSON representation of the actual instance.
47 | * @return {string}
48 | */
49 | _defineProperty(this, "toJSON", function () {
50 | return this.getActualInstance();
51 | });
52 | if (instance === null) {
53 | this.actualInstance = null;
54 | return;
55 | }
56 | var match = 0;
57 | var errorMessages = [];
58 | try {
59 | if (typeof instance === "DolbyEnhancement") {
60 | this.actualInstance = instance;
61 | } else {
62 | // plain JS object
63 | // validate the object
64 | _DolbyEnhancement["default"].validateJSON(instance); // throw an exception if no match
65 | // create DolbyEnhancement from JS object
66 | this.actualInstance = _DolbyEnhancement["default"].constructFromObject(instance);
67 | }
68 | match++;
69 | } catch (err) {
70 | // json data failed to deserialize into DolbyEnhancement
71 | errorMessages.push("Failed to construct DolbyEnhancement: " + err);
72 | }
73 | if (match > 1) {
74 | throw new Error("Multiple matches found constructing `AudioEnhancement` with oneOf schemas DolbyEnhancement. Input: " + JSON.stringify(instance));
75 | } else if (match === 0) {
76 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
77 | throw new Error("No match found constructing `AudioEnhancement` with oneOf schemas DolbyEnhancement. Details: " + errorMessages.join(", "));
78 | } else {// only 1 match
79 | // the input is valid
80 | }
81 | }
82 |
83 | /**
84 | * Constructs a AudioEnhancement from a plain JavaScript object, optionally creating a new instance.
85 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
86 | * @param {Object} data The plain JavaScript object bearing properties of interest.
87 | * @param {module:model/AudioEnhancement} obj Optional instance to populate.
88 | * @return {module:model/AudioEnhancement} The populated AudioEnhancement instance.
89 | */
90 | return _createClass(AudioEnhancement, [{
91 | key: "getActualInstance",
92 | value:
93 | /**
94 | * Gets the actual instance, which can be DolbyEnhancement.
95 | * @return {(module:model/DolbyEnhancement)} The actual instance.
96 | */
97 | function getActualInstance() {
98 | return this.actualInstance;
99 | }
100 |
101 | /**
102 | * Sets the actual instance, which can be DolbyEnhancement.
103 | * @param {(module:model/DolbyEnhancement)} obj The actual instance.
104 | */
105 | }, {
106 | key: "setActualInstance",
107 | value: function setActualInstance(obj) {
108 | this.actualInstance = AudioEnhancement.constructFromObject(obj).getActualInstance();
109 | }
110 | }], [{
111 | key: "constructFromObject",
112 | value: function constructFromObject(data, obj) {
113 | return new AudioEnhancement(data);
114 | }
115 | }]);
116 | }();
117 | /**
118 | * The enhancement provider to use - set to `dolby` for Dolby.
119 | * @member {String} provider
120 | * @default 'dolby'
121 | */
122 | _AudioEnhancement = AudioEnhancement;
123 | /**
124 | * Create an instance of AudioEnhancement from a JSON string.
125 | * @param {string} json_string JSON string.
126 | * @return {module:model/AudioEnhancement} An instance of AudioEnhancement.
127 | */
128 | _defineProperty(AudioEnhancement, "fromJSON", function (json_string) {
129 | return _AudioEnhancement.constructFromObject(JSON.parse(json_string));
130 | });
131 | AudioEnhancement.prototype['provider'] = 'dolby';
132 |
133 | /**
134 | * @member {module:model/DolbyEnhancementOptions} options
135 | */
136 | AudioEnhancement.prototype['options'] = undefined;
137 | AudioEnhancement.OneOf = ["DolbyEnhancement"];
138 | var _default = exports["default"] = AudioEnhancement;
--------------------------------------------------------------------------------
/src/model/SkewTransformationY.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _SkewTransformationY;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The SkewTransformationY model module.
31 | * @module model/SkewTransformationY
32 | * @version 0.2.9
33 | */
34 | var SkewTransformationY = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new SkewTransformationY.
37 | * Skew the clip along it's y axis.
38 | * @alias module:model/SkewTransformationY
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize SkewTransformationY.
40 | */
41 | function SkewTransformationY() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, SkewTransformationY);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // Range varies from 0 to 3. Positive numbers skew the asset up, negative down. The distance moved is relative to the height of the viewport - i.e. an Y skew of 0.5 will skew the asset half the screen height up.
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom animation. Animate the Y skew of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `SkewTransformationY` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `SkewTransformationY` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a SkewTransformationY from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/SkewTransformationY} obj Optional instance to populate.
97 | * @return {module:model/SkewTransformationY} The populated SkewTransformationY instance.
98 | */
99 | return _createClass(SkewTransformationY, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = SkewTransformationY.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new SkewTransformationY(data);
123 | }
124 | }]);
125 | }();
126 | _SkewTransformationY = SkewTransformationY;
127 | /**
128 | * Create an instance of SkewTransformationY from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/SkewTransformationY} An instance of SkewTransformationY.
131 | */
132 | _defineProperty(SkewTransformationY, "fromJSON", function (json_string) {
133 | return _SkewTransformationY.constructFromObject(JSON.parse(json_string));
134 | });
135 | SkewTransformationY.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = SkewTransformationY;
--------------------------------------------------------------------------------
/src/model/SkewTransformationX.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _Tween = _interopRequireDefault(require("./Tween"));
9 | var _SkewTransformationX;
10 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
11 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
12 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
13 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
14 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
15 | function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The SkewTransformationX model module.
31 | * @module model/SkewTransformationX
32 | * @version 0.2.9
33 | */
34 | var SkewTransformationX = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new SkewTransformationX.
37 | * Skew the clip along it's x axis.
38 | * @alias module:model/SkewTransformationX
39 | * @param {(module:model/Number|module:model/[Tween])} instance The actual instance to initialize SkewTransformationX.
40 | */
41 | function SkewTransformationX() {
42 | var instance = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
43 | _classCallCheck(this, SkewTransformationX);
44 | /**
45 | * Returns the JSON representation of the actual instance.
46 | * @return {string}
47 | */
48 | _defineProperty(this, "toJSON", function () {
49 | return this.getActualInstance();
50 | });
51 | if (instance === null) {
52 | this.actualInstance = null;
53 | return;
54 | }
55 | var match = 0;
56 | var errorMessages = [];
57 | // Range varies from 0 to 3. Positive numbers skew the asset right, negative left. The distance moved is relative to the width of the viewport - i.e. an X skew of 0.5 will skew the asset half the screen width to the right.
58 | try {
59 | this.actualInstance = instance;
60 | match++;
61 | } catch (err) {
62 | // json data failed to deserialize into Number
63 | errorMessages.push("Failed to construct Number: " + err);
64 | }
65 |
66 | // An array of [Tween](./#tocs_tween) objects used to create a custom animation. Animate the X skew of an asset over time.
67 | try {
68 | if (typeof instance === "[Tween]") {
69 | this.actualInstance = instance;
70 | } else {
71 | // plain JS object
72 | // validate the object
73 | [_Tween["default"]].validateJSON(instance); // throw an exception if no match
74 | // create [Tween] from JS object
75 | this.actualInstance = [_Tween["default"]].constructFromObject(instance);
76 | }
77 | match++;
78 | } catch (err) {
79 | // json data failed to deserialize into [Tween]
80 | errorMessages.push("Failed to construct [Tween]: " + err);
81 | }
82 | if (match > 1) {
83 | throw new Error("Multiple matches found constructing `SkewTransformationX` with oneOf schemas Number, [Tween]. Input: " + JSON.stringify(instance));
84 | } else if (match === 0) {
85 | this.actualInstance = null; // clear the actual instance in case there are multiple matches
86 | throw new Error("No match found constructing `SkewTransformationX` with oneOf schemas Number, [Tween]. Details: " + errorMessages.join(", "));
87 | } else {// only 1 match
88 | // the input is valid
89 | }
90 | }
91 |
92 | /**
93 | * Constructs a SkewTransformationX from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/SkewTransformationX} obj Optional instance to populate.
97 | * @return {module:model/SkewTransformationX} The populated SkewTransformationX instance.
98 | */
99 | return _createClass(SkewTransformationX, [{
100 | key: "getActualInstance",
101 | value:
102 | /**
103 | * Gets the actual instance, which can be Number, [Tween].
104 | * @return {(module:model/Number|module:model/[Tween])} The actual instance.
105 | */
106 | function getActualInstance() {
107 | return this.actualInstance;
108 | }
109 |
110 | /**
111 | * Sets the actual instance, which can be Number, [Tween].
112 | * @param {(module:model/Number|module:model/[Tween])} obj The actual instance.
113 | */
114 | }, {
115 | key: "setActualInstance",
116 | value: function setActualInstance(obj) {
117 | this.actualInstance = SkewTransformationX.constructFromObject(obj).getActualInstance();
118 | }
119 | }], [{
120 | key: "constructFromObject",
121 | value: function constructFromObject(data, obj) {
122 | return new SkewTransformationX(data);
123 | }
124 | }]);
125 | }();
126 | _SkewTransformationX = SkewTransformationX;
127 | /**
128 | * Create an instance of SkewTransformationX from a JSON string.
129 | * @param {string} json_string JSON string.
130 | * @return {module:model/SkewTransformationX} An instance of SkewTransformationX.
131 | */
132 | _defineProperty(SkewTransformationX, "fromJSON", function (json_string) {
133 | return _SkewTransformationX.constructFromObject(JSON.parse(json_string));
134 | });
135 | SkewTransformationX.OneOf = ["Number", "[Tween]"];
136 | var _default = exports["default"] = SkewTransformationX;
--------------------------------------------------------------------------------
/src/model/Transformation.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _FlipTransformation = _interopRequireDefault(require("./FlipTransformation"));
9 | var _RotateTransformation = _interopRequireDefault(require("./RotateTransformation"));
10 | var _SkewTransformation = _interopRequireDefault(require("./SkewTransformation"));
11 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The Transformation model module.
31 | * @module model/Transformation
32 | * @version 0.2.9
33 | */
34 | var Transformation = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new Transformation.
37 | * Apply one or more transformations to a clip. Transformations alter the visual properties of a clip and can be combined to create new shapes and effects.
38 | * @alias module:model/Transformation
39 | */
40 | function Transformation() {
41 | _classCallCheck(this, Transformation);
42 | Transformation.initialize(this);
43 | }
44 |
45 | /**
46 | * Initializes the fields of this object.
47 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
48 | * Only for internal use.
49 | */
50 | return _createClass(Transformation, [{
51 | key: "getRotate",
52 | value:
53 | /**
54 | * @return {module:model/RotateTransformation}
55 | */
56 | function getRotate() {
57 | return this.rotate;
58 | }
59 |
60 | /**
61 | * @param {module:model/RotateTransformation} rotate
62 | */
63 | }, {
64 | key: "setRotate",
65 | value: function setRotate(rotate) {
66 | this['rotate'] = rotate;
67 | return this;
68 | }
69 | /**
70 | * @return {module:model/SkewTransformation}
71 | */
72 | }, {
73 | key: "getSkew",
74 | value: function getSkew() {
75 | return this.skew;
76 | }
77 |
78 | /**
79 | * @param {module:model/SkewTransformation} skew
80 | */
81 | }, {
82 | key: "setSkew",
83 | value: function setSkew(skew) {
84 | this['skew'] = skew;
85 | return this;
86 | }
87 | /**
88 | * @return {module:model/FlipTransformation}
89 | */
90 | }, {
91 | key: "getFlip",
92 | value: function getFlip() {
93 | return this.flip;
94 | }
95 |
96 | /**
97 | * @param {module:model/FlipTransformation} flip
98 | */
99 | }, {
100 | key: "setFlip",
101 | value: function setFlip(flip) {
102 | this['flip'] = flip;
103 | return this;
104 | }
105 | }], [{
106 | key: "initialize",
107 | value: function initialize(obj) {}
108 |
109 | /**
110 | * Constructs a Transformation from a plain JavaScript object, optionally creating a new instance.
111 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
112 | * @param {Object} data The plain JavaScript object bearing properties of interest.
113 | * @param {module:model/Transformation} obj Optional instance to populate.
114 | * @return {module:model/Transformation} The populated Transformation instance.
115 | */
116 | }, {
117 | key: "constructFromObject",
118 | value: function constructFromObject(data, obj) {
119 | if (data) {
120 | obj = obj || new Transformation();
121 | if (data.hasOwnProperty('rotate')) {
122 | obj['rotate'] = _RotateTransformation["default"].constructFromObject(data['rotate']);
123 | }
124 | if (data.hasOwnProperty('skew')) {
125 | obj['skew'] = _SkewTransformation["default"].constructFromObject(data['skew']);
126 | }
127 | if (data.hasOwnProperty('flip')) {
128 | obj['flip'] = _FlipTransformation["default"].constructFromObject(data['flip']);
129 | }
130 | }
131 | return obj;
132 | }
133 |
134 | /**
135 | * Validates the JSON data with respect to Transformation.
136 | * @param {Object} data The plain JavaScript object bearing properties of interest.
137 | * @return {boolean} to indicate whether the JSON data is valid with respect to Transformation.
138 | */
139 | }, {
140 | key: "validateJSON",
141 | value: function validateJSON(data) {
142 | // validate the optional field `rotate`
143 | if (data['rotate']) {
144 | // data not null
145 | _RotateTransformation["default"].validateJSON(data['rotate']);
146 | }
147 | // validate the optional field `skew`
148 | if (data['skew']) {
149 | // data not null
150 | _SkewTransformation["default"].validateJSON(data['skew']);
151 | }
152 | // validate the optional field `flip`
153 | if (data['flip']) {
154 | // data not null
155 | _FlipTransformation["default"].validateJSON(data['flip']);
156 | }
157 | return true;
158 | }
159 | }]);
160 | }();
161 | /**
162 | * @member {module:model/RotateTransformation} rotate
163 | */
164 | Transformation.prototype['rotate'] = undefined;
165 |
166 | /**
167 | * @member {module:model/SkewTransformation} skew
168 | */
169 | Transformation.prototype['skew'] = undefined;
170 |
171 | /**
172 | * @member {module:model/FlipTransformation} flip
173 | */
174 | Transformation.prototype['flip'] = undefined;
175 | var _default = exports["default"] = Transformation;
--------------------------------------------------------------------------------
/src/model/Poster.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The Poster model module.
31 | * @module model/Poster
32 | * @version 0.2.9
33 | */
34 | var Poster = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new Poster.
37 | * Generate a poster image for the video at a specific point from the timeline. The poster image size will match the size of the output video.
38 | * @alias module:model/Poster
39 | * @param capture {Number} The point on the timeline in seconds to capture a single frame to use as the poster image.
40 | */
41 | function Poster(capture) {
42 | _classCallCheck(this, Poster);
43 | Poster.initialize(this, capture);
44 | }
45 |
46 | /**
47 | * Initializes the fields of this object.
48 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49 | * Only for internal use.
50 | */
51 | return _createClass(Poster, [{
52 | key: "getCapture",
53 | value:
54 | /**
55 | * Returns The point on the timeline in seconds to capture a single frame to use as the poster image.
56 | * @return {Number}
57 | */
58 | function getCapture() {
59 | return this.capture;
60 | }
61 |
62 | /**
63 | * Sets The point on the timeline in seconds to capture a single frame to use as the poster image.
64 | * @param {Number} capture The point on the timeline in seconds to capture a single frame to use as the poster image.
65 | */
66 | }, {
67 | key: "setCapture",
68 | value: function setCapture(capture) {
69 | this['capture'] = capture;
70 | return this;
71 | }
72 | }], [{
73 | key: "initialize",
74 | value: function initialize(obj, capture) {
75 | obj['capture'] = capture;
76 | }
77 |
78 | /**
79 | * Constructs a Poster from a plain JavaScript object, optionally creating a new instance.
80 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
81 | * @param {Object} data The plain JavaScript object bearing properties of interest.
82 | * @param {module:model/Poster} obj Optional instance to populate.
83 | * @return {module:model/Poster} The populated Poster instance.
84 | */
85 | }, {
86 | key: "constructFromObject",
87 | value: function constructFromObject(data, obj) {
88 | if (data) {
89 | obj = obj || new Poster();
90 | if (data.hasOwnProperty('capture')) {
91 | obj['capture'] = _ApiClient["default"].convertToType(data['capture'], 'Number');
92 | }
93 | }
94 | return obj;
95 | }
96 |
97 | /**
98 | * Validates the JSON data with respect to Poster.
99 | * @param {Object} data The plain JavaScript object bearing properties of interest.
100 | * @return {boolean} to indicate whether the JSON data is valid with respect to Poster.
101 | */
102 | }, {
103 | key: "validateJSON",
104 | value: function validateJSON(data) {
105 | // check to make sure all required properties are present in the JSON string
106 | var _iterator = _createForOfIteratorHelper(Poster.RequiredProperties),
107 | _step;
108 | try {
109 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
110 | var property = _step.value;
111 | if (!data.hasOwnProperty(property)) {
112 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
113 | }
114 | }
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | return true;
121 | }
122 | }]);
123 | }();
124 | Poster.RequiredProperties = ["capture"];
125 |
126 | /**
127 | * The point on the timeline in seconds to capture a single frame to use as the poster image.
128 | * @member {Number} capture
129 | */
130 | Poster.prototype['capture'] = undefined;
131 | var _default = exports["default"] = Poster;
--------------------------------------------------------------------------------
/src/model/SourceResponse.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _SourceResponseData = _interopRequireDefault(require("./SourceResponseData"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The SourceResponse model module.
32 | * @module model/SourceResponse
33 | * @version 0.2.9
34 | */
35 | var SourceResponse = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new SourceResponse.
38 | * The response returned by the Ingest API [get source](#get-source) request. Includes details of the ingested source file. The response follows the [json:api](https://jsonapi.org/) specification.
39 | * @alias module:model/SourceResponse
40 | * @param data {module:model/SourceResponseData}
41 | */
42 | function SourceResponse(data) {
43 | _classCallCheck(this, SourceResponse);
44 | SourceResponse.initialize(this, data);
45 | }
46 |
47 | /**
48 | * Initializes the fields of this object.
49 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50 | * Only for internal use.
51 | */
52 | return _createClass(SourceResponse, [{
53 | key: "getData",
54 | value:
55 | /**
56 | * @return {module:model/SourceResponseData}
57 | */
58 | function getData() {
59 | return this.data;
60 | }
61 |
62 | /**
63 | * @param {module:model/SourceResponseData} data
64 | */
65 | }, {
66 | key: "setData",
67 | value: function setData(data) {
68 | this['data'] = data;
69 | return this;
70 | }
71 | }], [{
72 | key: "initialize",
73 | value: function initialize(obj, data) {
74 | obj['data'] = data;
75 | }
76 |
77 | /**
78 | * Constructs a SourceResponse from a plain JavaScript object, optionally creating a new instance.
79 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
80 | * @param {Object} data The plain JavaScript object bearing properties of interest.
81 | * @param {module:model/SourceResponse} obj Optional instance to populate.
82 | * @return {module:model/SourceResponse} The populated SourceResponse instance.
83 | */
84 | }, {
85 | key: "constructFromObject",
86 | value: function constructFromObject(data, obj) {
87 | if (data) {
88 | obj = obj || new SourceResponse();
89 | if (data.hasOwnProperty('data')) {
90 | obj['data'] = _SourceResponseData["default"].constructFromObject(data['data']);
91 | }
92 | }
93 | return obj;
94 | }
95 |
96 | /**
97 | * Validates the JSON data with respect to SourceResponse.
98 | * @param {Object} data The plain JavaScript object bearing properties of interest.
99 | * @return {boolean} to indicate whether the JSON data is valid with respect to SourceResponse.
100 | */
101 | }, {
102 | key: "validateJSON",
103 | value: function validateJSON(data) {
104 | // check to make sure all required properties are present in the JSON string
105 | var _iterator = _createForOfIteratorHelper(SourceResponse.RequiredProperties),
106 | _step;
107 | try {
108 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
109 | var property = _step.value;
110 | if (!data.hasOwnProperty(property)) {
111 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
112 | }
113 | }
114 | // validate the optional field `data`
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | if (data['data']) {
121 | // data not null
122 | _SourceResponseData["default"].validateJSON(data['data']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | SourceResponse.RequiredProperties = ["data"];
129 |
130 | /**
131 | * @member {module:model/SourceResponseData} data
132 | */
133 | SourceResponse.prototype['data'] = undefined;
134 | var _default = exports["default"] = SourceResponse;
--------------------------------------------------------------------------------
/src/model/AssetResponse.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _AssetResponseData = _interopRequireDefault(require("./AssetResponseData"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The AssetResponse model module.
32 | * @module model/AssetResponse
33 | * @version 0.2.9
34 | */
35 | var AssetResponse = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new AssetResponse.
38 | * The response returned by the Serve API [get asset](#get-asset) request. Includes details of a hosted video, image, audio file, thumbnail or poster image. The response follows the [json:api](https://jsonapi.org/) specification.
39 | * @alias module:model/AssetResponse
40 | * @param data {module:model/AssetResponseData}
41 | */
42 | function AssetResponse(data) {
43 | _classCallCheck(this, AssetResponse);
44 | AssetResponse.initialize(this, data);
45 | }
46 |
47 | /**
48 | * Initializes the fields of this object.
49 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50 | * Only for internal use.
51 | */
52 | return _createClass(AssetResponse, [{
53 | key: "getData",
54 | value:
55 | /**
56 | * @return {module:model/AssetResponseData}
57 | */
58 | function getData() {
59 | return this.data;
60 | }
61 |
62 | /**
63 | * @param {module:model/AssetResponseData} data
64 | */
65 | }, {
66 | key: "setData",
67 | value: function setData(data) {
68 | this['data'] = data;
69 | return this;
70 | }
71 | }], [{
72 | key: "initialize",
73 | value: function initialize(obj, data) {
74 | obj['data'] = data;
75 | }
76 |
77 | /**
78 | * Constructs a AssetResponse from a plain JavaScript object, optionally creating a new instance.
79 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
80 | * @param {Object} data The plain JavaScript object bearing properties of interest.
81 | * @param {module:model/AssetResponse} obj Optional instance to populate.
82 | * @return {module:model/AssetResponse} The populated AssetResponse instance.
83 | */
84 | }, {
85 | key: "constructFromObject",
86 | value: function constructFromObject(data, obj) {
87 | if (data) {
88 | obj = obj || new AssetResponse();
89 | if (data.hasOwnProperty('data')) {
90 | obj['data'] = _AssetResponseData["default"].constructFromObject(data['data']);
91 | }
92 | }
93 | return obj;
94 | }
95 |
96 | /**
97 | * Validates the JSON data with respect to AssetResponse.
98 | * @param {Object} data The plain JavaScript object bearing properties of interest.
99 | * @return {boolean} to indicate whether the JSON data is valid with respect to AssetResponse.
100 | */
101 | }, {
102 | key: "validateJSON",
103 | value: function validateJSON(data) {
104 | // check to make sure all required properties are present in the JSON string
105 | var _iterator = _createForOfIteratorHelper(AssetResponse.RequiredProperties),
106 | _step;
107 | try {
108 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
109 | var property = _step.value;
110 | if (!data.hasOwnProperty(property)) {
111 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
112 | }
113 | }
114 | // validate the optional field `data`
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | if (data['data']) {
121 | // data not null
122 | _AssetResponseData["default"].validateJSON(data['data']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | AssetResponse.RequiredProperties = ["data"];
129 |
130 | /**
131 | * @member {module:model/AssetResponseData} data
132 | */
133 | AssetResponse.prototype['data'] = undefined;
134 | var _default = exports["default"] = AssetResponse;
--------------------------------------------------------------------------------
/src/model/UploadResponse.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _UploadResponseData = _interopRequireDefault(require("./UploadResponseData"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The UploadResponse model module.
32 | * @module model/UploadResponse
33 | * @version 0.2.9
34 | */
35 | var UploadResponse = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new UploadResponse.
38 | * The response returned by the Ingest API [direct upload](#direct-upload) request. Includes the id of the file and the signed url to send the binary file to. The response follows the [json:api](https://jsonapi.org/) specification.
39 | * @alias module:model/UploadResponse
40 | * @param data {module:model/UploadResponseData}
41 | */
42 | function UploadResponse(data) {
43 | _classCallCheck(this, UploadResponse);
44 | UploadResponse.initialize(this, data);
45 | }
46 |
47 | /**
48 | * Initializes the fields of this object.
49 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50 | * Only for internal use.
51 | */
52 | return _createClass(UploadResponse, [{
53 | key: "getData",
54 | value:
55 | /**
56 | * @return {module:model/UploadResponseData}
57 | */
58 | function getData() {
59 | return this.data;
60 | }
61 |
62 | /**
63 | * @param {module:model/UploadResponseData} data
64 | */
65 | }, {
66 | key: "setData",
67 | value: function setData(data) {
68 | this['data'] = data;
69 | return this;
70 | }
71 | }], [{
72 | key: "initialize",
73 | value: function initialize(obj, data) {
74 | obj['data'] = data;
75 | }
76 |
77 | /**
78 | * Constructs a UploadResponse from a plain JavaScript object, optionally creating a new instance.
79 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
80 | * @param {Object} data The plain JavaScript object bearing properties of interest.
81 | * @param {module:model/UploadResponse} obj Optional instance to populate.
82 | * @return {module:model/UploadResponse} The populated UploadResponse instance.
83 | */
84 | }, {
85 | key: "constructFromObject",
86 | value: function constructFromObject(data, obj) {
87 | if (data) {
88 | obj = obj || new UploadResponse();
89 | if (data.hasOwnProperty('data')) {
90 | obj['data'] = _UploadResponseData["default"].constructFromObject(data['data']);
91 | }
92 | }
93 | return obj;
94 | }
95 |
96 | /**
97 | * Validates the JSON data with respect to UploadResponse.
98 | * @param {Object} data The plain JavaScript object bearing properties of interest.
99 | * @return {boolean} to indicate whether the JSON data is valid with respect to UploadResponse.
100 | */
101 | }, {
102 | key: "validateJSON",
103 | value: function validateJSON(data) {
104 | // check to make sure all required properties are present in the JSON string
105 | var _iterator = _createForOfIteratorHelper(UploadResponse.RequiredProperties),
106 | _step;
107 | try {
108 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
109 | var property = _step.value;
110 | if (!data.hasOwnProperty(property)) {
111 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
112 | }
113 | }
114 | // validate the optional field `data`
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | if (data['data']) {
121 | // data not null
122 | _UploadResponseData["default"].validateJSON(data['data']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | UploadResponse.RequiredProperties = ["data"];
129 |
130 | /**
131 | * @member {module:model/UploadResponseData} data
132 | */
133 | UploadResponse.prototype['data'] = undefined;
134 | var _default = exports["default"] = UploadResponse;
--------------------------------------------------------------------------------
/src/model/TransferResponse.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _TransferResponseData = _interopRequireDefault(require("./TransferResponseData"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The TransferResponse model module.
32 | * @module model/TransferResponse
33 | * @version 0.2.9
34 | */
35 | var TransferResponse = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new TransferResponse.
38 | * The response returned by the Serve API [transfer asset](#transfer-asset) request. The response includes the ID and transfer status. The response follows the [json:api](https://jsonapi.org/) specification.
39 | * @alias module:model/TransferResponse
40 | * @param data {module:model/TransferResponseData}
41 | */
42 | function TransferResponse(data) {
43 | _classCallCheck(this, TransferResponse);
44 | TransferResponse.initialize(this, data);
45 | }
46 |
47 | /**
48 | * Initializes the fields of this object.
49 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50 | * Only for internal use.
51 | */
52 | return _createClass(TransferResponse, [{
53 | key: "getData",
54 | value:
55 | /**
56 | * @return {module:model/TransferResponseData}
57 | */
58 | function getData() {
59 | return this.data;
60 | }
61 |
62 | /**
63 | * @param {module:model/TransferResponseData} data
64 | */
65 | }, {
66 | key: "setData",
67 | value: function setData(data) {
68 | this['data'] = data;
69 | return this;
70 | }
71 | }], [{
72 | key: "initialize",
73 | value: function initialize(obj, data) {
74 | obj['data'] = data;
75 | }
76 |
77 | /**
78 | * Constructs a TransferResponse from a plain JavaScript object, optionally creating a new instance.
79 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
80 | * @param {Object} data The plain JavaScript object bearing properties of interest.
81 | * @param {module:model/TransferResponse} obj Optional instance to populate.
82 | * @return {module:model/TransferResponse} The populated TransferResponse instance.
83 | */
84 | }, {
85 | key: "constructFromObject",
86 | value: function constructFromObject(data, obj) {
87 | if (data) {
88 | obj = obj || new TransferResponse();
89 | if (data.hasOwnProperty('data')) {
90 | obj['data'] = _TransferResponseData["default"].constructFromObject(data['data']);
91 | }
92 | }
93 | return obj;
94 | }
95 |
96 | /**
97 | * Validates the JSON data with respect to TransferResponse.
98 | * @param {Object} data The plain JavaScript object bearing properties of interest.
99 | * @return {boolean} to indicate whether the JSON data is valid with respect to TransferResponse.
100 | */
101 | }, {
102 | key: "validateJSON",
103 | value: function validateJSON(data) {
104 | // check to make sure all required properties are present in the JSON string
105 | var _iterator = _createForOfIteratorHelper(TransferResponse.RequiredProperties),
106 | _step;
107 | try {
108 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
109 | var property = _step.value;
110 | if (!data.hasOwnProperty(property)) {
111 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
112 | }
113 | }
114 | // validate the optional field `data`
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | if (data['data']) {
121 | // data not null
122 | _TransferResponseData["default"].validateJSON(data['data']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | TransferResponse.RequiredProperties = ["data"];
129 |
130 | /**
131 | * @member {module:model/TransferResponseData} data
132 | */
133 | TransferResponse.prototype['data'] = undefined;
134 | var _default = exports["default"] = TransferResponse;
--------------------------------------------------------------------------------
/src/model/Speed.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The Speed model module.
28 | * @module model/Speed
29 | * @version 0.2.9
30 | */
31 | var Speed = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new Speed.
34 | * Set the playback speed of a video or audio file. Allows you to preserve the pitch of the audio so that it is sped up without sounding too high pitched or too low.
35 | * @alias module:model/Speed
36 | */
37 | function Speed() {
38 | _classCallCheck(this, Speed);
39 | Speed.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(Speed, [{
48 | key: "getSpeed",
49 | value:
50 | /**
51 | * Returns Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Set values less than 1 to slow down the playback speed, i.e. set speed to 0.5 to play back at half speed. Set values greater than 1 to speed up the playback speed, i.e. set speed to 2 to play back at double speed.
52 | * minimum: 0
53 | * maximum: 10
54 | * @return {Number}
55 | */
56 | function getSpeed() {
57 | return this.speed;
58 | }
59 |
60 | /**
61 | * Sets Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Set values less than 1 to slow down the playback speed, i.e. set speed to 0.5 to play back at half speed. Set values greater than 1 to speed up the playback speed, i.e. set speed to 2 to play back at double speed.
62 | * @param {Number} speed Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Set values less than 1 to slow down the playback speed, i.e. set speed to 0.5 to play back at half speed. Set values greater than 1 to speed up the playback speed, i.e. set speed to 2 to play back at double speed.
63 | */
64 | }, {
65 | key: "setSpeed",
66 | value: function setSpeed(speed) {
67 | this['speed'] = speed;
68 | return this;
69 | }
70 | /**
71 | * Returns Set whether to adjust the audio pitch or not. Set to false to make the audio sound higher or lower pitched. By default the pitch is preserved.
72 | * @return {Boolean}
73 | */
74 | }, {
75 | key: "getPreservePitch",
76 | value: function getPreservePitch() {
77 | return this.preservePitch;
78 | }
79 |
80 | /**
81 | * Sets Set whether to adjust the audio pitch or not. Set to false to make the audio sound higher or lower pitched. By default the pitch is preserved.
82 | * @param {Boolean} preservePitch Set whether to adjust the audio pitch or not. Set to false to make the audio sound higher or lower pitched. By default the pitch is preserved.
83 | */
84 | }, {
85 | key: "setPreservePitch",
86 | value: function setPreservePitch(preservePitch) {
87 | this['preservePitch'] = preservePitch;
88 | return this;
89 | }
90 | }], [{
91 | key: "initialize",
92 | value: function initialize(obj) {}
93 |
94 | /**
95 | * Constructs a Speed from a plain JavaScript object, optionally creating a new instance.
96 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
97 | * @param {Object} data The plain JavaScript object bearing properties of interest.
98 | * @param {module:model/Speed} obj Optional instance to populate.
99 | * @return {module:model/Speed} The populated Speed instance.
100 | */
101 | }, {
102 | key: "constructFromObject",
103 | value: function constructFromObject(data, obj) {
104 | if (data) {
105 | obj = obj || new Speed();
106 | if (data.hasOwnProperty('speed')) {
107 | obj['speed'] = _ApiClient["default"].convertToType(data['speed'], 'Number');
108 | }
109 | if (data.hasOwnProperty('preservePitch')) {
110 | obj['preservePitch'] = _ApiClient["default"].convertToType(data['preservePitch'], 'Boolean');
111 | }
112 | }
113 | return obj;
114 | }
115 |
116 | /**
117 | * Validates the JSON data with respect to Speed.
118 | * @param {Object} data The plain JavaScript object bearing properties of interest.
119 | * @return {boolean} to indicate whether the JSON data is valid with respect to Speed.
120 | */
121 | }, {
122 | key: "validateJSON",
123 | value: function validateJSON(data) {
124 | return true;
125 | }
126 | }]);
127 | }();
128 | /**
129 | * Adjust the playback speed of the video clip between 0 (paused) and 10 (10x normal speed) where 1 is normal speed (defaults to 1). Set values less than 1 to slow down the playback speed, i.e. set speed to 0.5 to play back at half speed. Set values greater than 1 to speed up the playback speed, i.e. set speed to 2 to play back at double speed.
130 | * @member {Number} speed
131 | */
132 | Speed.prototype['speed'] = undefined;
133 |
134 | /**
135 | * Set whether to adjust the audio pitch or not. Set to false to make the audio sound higher or lower pitched. By default the pitch is preserved.
136 | * @member {Boolean} preservePitch
137 | */
138 | Speed.prototype['preservePitch'] = undefined;
139 | var _default = exports["default"] = Speed;
--------------------------------------------------------------------------------
/src/api/CreateApi.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _GeneratedAsset = _interopRequireDefault(require("../model/GeneratedAsset"));
9 | var _GeneratedAssetErrorResponse = _interopRequireDefault(require("../model/GeneratedAssetErrorResponse"));
10 | var _GeneratedAssetResponse = _interopRequireDefault(require("../model/GeneratedAssetResponse"));
11 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
12 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
13 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * Create service.
31 | * @module api/CreateApi
32 | * @version 0.2.9
33 | */
34 | var CreateApi = exports["default"] = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new CreateApi.
37 | * @alias module:api/CreateApi
38 | * @class
39 | * @param {module:ApiClient} [apiClient] Optional API client implementation to use,
40 | * default to {@link module:ApiClient#instance} if unspecified.
41 | */
42 | function CreateApi(apiClient) {
43 | _classCallCheck(this, CreateApi);
44 | this.apiClient = apiClient || _ApiClient["default"].instance;
45 | }
46 |
47 | /**
48 | * Get Generated Asset
49 | * Get the generated assets status, url and details by ID. **Base URL:** https://api.shotstack.io/create/{version}
50 | * @param {String} id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.
51 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GeneratedAssetResponse} and HTTP response
52 | */
53 | return _createClass(CreateApi, [{
54 | key: "getGeneratedAssetWithHttpInfo",
55 | value: function getGeneratedAssetWithHttpInfo(id) {
56 | var postBody = null;
57 | // verify the required parameter 'id' is set
58 | if (id === undefined || id === null) {
59 | throw new Error("Missing the required parameter 'id' when calling getGeneratedAsset");
60 | }
61 | var pathParams = {
62 | 'id': id
63 | };
64 | var queryParams = {};
65 | var headerParams = {};
66 | var formParams = {};
67 | var authNames = ['DeveloperKey'];
68 | var contentTypes = [];
69 | var accepts = ['application/json'];
70 | var returnType = _GeneratedAssetResponse["default"];
71 | return this.apiClient.callApi('/assets/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
72 | }
73 |
74 | /**
75 | * Get Generated Asset
76 | * Get the generated assets status, url and details by ID. **Base URL:** https://api.shotstack.io/create/{version}
77 | * @param {String} id The id of the source file in [KSUID](https://github.com/segmentio/ksuid#what-is-a-ksuid) format.
78 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GeneratedAssetResponse}
79 | */
80 | }, {
81 | key: "getGeneratedAsset",
82 | value: function getGeneratedAsset(id) {
83 | return this.getGeneratedAssetWithHttpInfo(id).then(function (response_and_data) {
84 | return response_and_data.data;
85 | });
86 | }
87 |
88 | /**
89 | * Generate Asset
90 | * Generate an asset using a Shotstack or third party provider. Chose the provider, type of asset and provide prompts, inputs and options to generate the asset. Once generated the asset can be used with the [Edit](#tocs_edit) API or downloaded. **Base URL:** https://api.shotstack.io/create/{version}
91 | * @param {module:model/GeneratedAsset} generatedAsset Generate an asset using the specified provider, type and options.
92 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/GeneratedAssetResponse} and HTTP response
93 | */
94 | }, {
95 | key: "postGenerateAssetWithHttpInfo",
96 | value: function postGenerateAssetWithHttpInfo(generatedAsset) {
97 | var postBody = generatedAsset;
98 | // verify the required parameter 'generatedAsset' is set
99 | if (generatedAsset === undefined || generatedAsset === null) {
100 | throw new Error("Missing the required parameter 'generatedAsset' when calling postGenerateAsset");
101 | }
102 | var pathParams = {};
103 | var queryParams = {};
104 | var headerParams = {};
105 | var formParams = {};
106 | var authNames = ['DeveloperKey'];
107 | var contentTypes = ['application/json'];
108 | var accepts = ['application/json'];
109 | var returnType = _GeneratedAssetResponse["default"];
110 | return this.apiClient.callApi('/assets', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null);
111 | }
112 |
113 | /**
114 | * Generate Asset
115 | * Generate an asset using a Shotstack or third party provider. Chose the provider, type of asset and provide prompts, inputs and options to generate the asset. Once generated the asset can be used with the [Edit](#tocs_edit) API or downloaded. **Base URL:** https://api.shotstack.io/create/{version}
116 | * @param {module:model/GeneratedAsset} generatedAsset Generate an asset using the specified provider, type and options.
117 | * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/GeneratedAssetResponse}
118 | */
119 | }, {
120 | key: "postGenerateAsset",
121 | value: function postGenerateAsset(generatedAsset) {
122 | return this.postGenerateAssetWithHttpInfo(generatedAsset).then(function (response_and_data) {
123 | return response_and_data.data;
124 | });
125 | }
126 | }]);
127 | }();
--------------------------------------------------------------------------------
/src/model/Font.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
11 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
12 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
13 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
14 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
15 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
16 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
17 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
18 | * Shotstack
19 | * Official Node SDK for the Shotstack Cloud Video Editing API
20 | *
21 | * The version of the OpenAPI document: v1
22 | *
23 | *
24 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
25 | * https://openapi-generator.tech
26 | * Do not edit the class manually.
27 | *
28 | */
29 | /**
30 | * The Font model module.
31 | * @module model/Font
32 | * @version 0.2.9
33 | */
34 | var Font = /*#__PURE__*/function () {
35 | /**
36 | * Constructs a new Font.
37 | * Download a custom font to use with the HTML asset type, using the font name in the CSS or font tag. See our [custom fonts](https://shotstack.io/learn/html-custom-fonts/) getting started guide for more details.
38 | * @alias module:model/Font
39 | * @param src {String} The URL of the font file. The URL must be publicly accessible or include credentials.
40 | */
41 | function Font(src) {
42 | _classCallCheck(this, Font);
43 | Font.initialize(this, src);
44 | }
45 |
46 | /**
47 | * Initializes the fields of this object.
48 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
49 | * Only for internal use.
50 | */
51 | return _createClass(Font, [{
52 | key: "getSrc",
53 | value:
54 | /**
55 | * Returns The URL of the font file. The URL must be publicly accessible or include credentials.
56 | * @return {String}
57 | */
58 | function getSrc() {
59 | return this.src;
60 | }
61 |
62 | /**
63 | * Sets The URL of the font file. The URL must be publicly accessible or include credentials.
64 | * @param {String} src The URL of the font file. The URL must be publicly accessible or include credentials.
65 | */
66 | }, {
67 | key: "setSrc",
68 | value: function setSrc(src) {
69 | this['src'] = src;
70 | return this;
71 | }
72 | }], [{
73 | key: "initialize",
74 | value: function initialize(obj, src) {
75 | obj['src'] = src;
76 | }
77 |
78 | /**
79 | * Constructs a Font from a plain JavaScript object, optionally creating a new instance.
80 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
81 | * @param {Object} data The plain JavaScript object bearing properties of interest.
82 | * @param {module:model/Font} obj Optional instance to populate.
83 | * @return {module:model/Font} The populated Font instance.
84 | */
85 | }, {
86 | key: "constructFromObject",
87 | value: function constructFromObject(data, obj) {
88 | if (data) {
89 | obj = obj || new Font();
90 | if (data.hasOwnProperty('src')) {
91 | obj['src'] = _ApiClient["default"].convertToType(data['src'], 'String');
92 | }
93 | }
94 | return obj;
95 | }
96 |
97 | /**
98 | * Validates the JSON data with respect to Font.
99 | * @param {Object} data The plain JavaScript object bearing properties of interest.
100 | * @return {boolean} to indicate whether the JSON data is valid with respect to Font.
101 | */
102 | }, {
103 | key: "validateJSON",
104 | value: function validateJSON(data) {
105 | // check to make sure all required properties are present in the JSON string
106 | var _iterator = _createForOfIteratorHelper(Font.RequiredProperties),
107 | _step;
108 | try {
109 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
110 | var property = _step.value;
111 | if (!data.hasOwnProperty(property)) {
112 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
113 | }
114 | }
115 | // ensure the json data is a string
116 | } catch (err) {
117 | _iterator.e(err);
118 | } finally {
119 | _iterator.f();
120 | }
121 | if (data['src'] && !(typeof data['src'] === 'string' || data['src'] instanceof String)) {
122 | throw new Error("Expected the field `src` to be a primitive type in the JSON string but got " + data['src']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | Font.RequiredProperties = ["src"];
129 |
130 | /**
131 | * The URL of the font file. The URL must be publicly accessible or include credentials.
132 | * @member {String} src
133 | */
134 | Font.prototype['src'] = undefined;
135 | var _default = exports["default"] = Font;
--------------------------------------------------------------------------------
/src/model/QueuedSourceResponse.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | var _QueuedSourceResponseData = _interopRequireDefault(require("./QueuedSourceResponseData"));
9 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
10 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
11 | function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
12 | function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
13 | function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
15 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
16 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
17 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
18 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
19 | * Shotstack
20 | * Official Node SDK for the Shotstack Cloud Video Editing API
21 | *
22 | * The version of the OpenAPI document: v1
23 | *
24 | *
25 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
26 | * https://openapi-generator.tech
27 | * Do not edit the class manually.
28 | *
29 | */
30 | /**
31 | * The QueuedSourceResponse model module.
32 | * @module model/QueuedSourceResponse
33 | * @version 0.2.9
34 | */
35 | var QueuedSourceResponse = /*#__PURE__*/function () {
36 | /**
37 | * Constructs a new QueuedSourceResponse.
38 | * The response returned by the Ingest API [fetch source](#fetch-source) request. Includes the id of the source file. The response follows the [json:api](https://jsonapi.org/) specification.
39 | * @alias module:model/QueuedSourceResponse
40 | * @param data {module:model/QueuedSourceResponseData}
41 | */
42 | function QueuedSourceResponse(data) {
43 | _classCallCheck(this, QueuedSourceResponse);
44 | QueuedSourceResponse.initialize(this, data);
45 | }
46 |
47 | /**
48 | * Initializes the fields of this object.
49 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
50 | * Only for internal use.
51 | */
52 | return _createClass(QueuedSourceResponse, [{
53 | key: "getData",
54 | value:
55 | /**
56 | * @return {module:model/QueuedSourceResponseData}
57 | */
58 | function getData() {
59 | return this.data;
60 | }
61 |
62 | /**
63 | * @param {module:model/QueuedSourceResponseData} data
64 | */
65 | }, {
66 | key: "setData",
67 | value: function setData(data) {
68 | this['data'] = data;
69 | return this;
70 | }
71 | }], [{
72 | key: "initialize",
73 | value: function initialize(obj, data) {
74 | obj['data'] = data;
75 | }
76 |
77 | /**
78 | * Constructs a QueuedSourceResponse from a plain JavaScript object, optionally creating a new instance.
79 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
80 | * @param {Object} data The plain JavaScript object bearing properties of interest.
81 | * @param {module:model/QueuedSourceResponse} obj Optional instance to populate.
82 | * @return {module:model/QueuedSourceResponse} The populated QueuedSourceResponse instance.
83 | */
84 | }, {
85 | key: "constructFromObject",
86 | value: function constructFromObject(data, obj) {
87 | if (data) {
88 | obj = obj || new QueuedSourceResponse();
89 | if (data.hasOwnProperty('data')) {
90 | obj['data'] = _QueuedSourceResponseData["default"].constructFromObject(data['data']);
91 | }
92 | }
93 | return obj;
94 | }
95 |
96 | /**
97 | * Validates the JSON data with respect to QueuedSourceResponse.
98 | * @param {Object} data The plain JavaScript object bearing properties of interest.
99 | * @return {boolean} to indicate whether the JSON data is valid with respect to QueuedSourceResponse.
100 | */
101 | }, {
102 | key: "validateJSON",
103 | value: function validateJSON(data) {
104 | // check to make sure all required properties are present in the JSON string
105 | var _iterator = _createForOfIteratorHelper(QueuedSourceResponse.RequiredProperties),
106 | _step;
107 | try {
108 | for (_iterator.s(); !(_step = _iterator.n()).done;) {
109 | var property = _step.value;
110 | if (!data.hasOwnProperty(property)) {
111 | throw new Error("The required field `" + property + "` is not found in the JSON data: " + JSON.stringify(data));
112 | }
113 | }
114 | // validate the optional field `data`
115 | } catch (err) {
116 | _iterator.e(err);
117 | } finally {
118 | _iterator.f();
119 | }
120 | if (data['data']) {
121 | // data not null
122 | _QueuedSourceResponseData["default"].validateJSON(data['data']);
123 | }
124 | return true;
125 | }
126 | }]);
127 | }();
128 | QueuedSourceResponse.RequiredProperties = ["data"];
129 |
130 | /**
131 | * @member {module:model/QueuedSourceResponseData} data
132 | */
133 | QueuedSourceResponse.prototype['data'] = undefined;
134 | var _default = exports["default"] = QueuedSourceResponse;
--------------------------------------------------------------------------------
/src/model/Crop.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The Crop model module.
28 | * @module model/Crop
29 | * @version 0.2.9
30 | */
31 | var Crop = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new Crop.
34 | * Crop the sides of an asset by a relative amount. The size of the crop is specified using a scale between 0 and 1, relative to the screen width - i.e a left crop of 0.5 will crop half of the asset from the left, a top crop of 0.25 will crop the top by quarter of the asset.
35 | * @alias module:model/Crop
36 | */
37 | function Crop() {
38 | _classCallCheck(this, Crop);
39 | Crop.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(Crop, [{
48 | key: "getTop",
49 | value:
50 | /**
51 | * Returns Crop from the top of the asset
52 | * minimum: 0
53 | * maximum: 1
54 | * @return {Number}
55 | */
56 | function getTop() {
57 | return this.top;
58 | }
59 |
60 | /**
61 | * Sets Crop from the top of the asset
62 | * @param {Number} top Crop from the top of the asset
63 | */
64 | }, {
65 | key: "setTop",
66 | value: function setTop(top) {
67 | this['top'] = top;
68 | return this;
69 | }
70 | /**
71 | * Returns Crop from the bottom of the asset
72 | * minimum: 0
73 | * maximum: 1
74 | * @return {Number}
75 | */
76 | }, {
77 | key: "getBottom",
78 | value: function getBottom() {
79 | return this.bottom;
80 | }
81 |
82 | /**
83 | * Sets Crop from the bottom of the asset
84 | * @param {Number} bottom Crop from the bottom of the asset
85 | */
86 | }, {
87 | key: "setBottom",
88 | value: function setBottom(bottom) {
89 | this['bottom'] = bottom;
90 | return this;
91 | }
92 | /**
93 | * Returns Crop from the left of the asset
94 | * minimum: 0
95 | * maximum: 1
96 | * @return {Number}
97 | */
98 | }, {
99 | key: "getLeft",
100 | value: function getLeft() {
101 | return this.left;
102 | }
103 |
104 | /**
105 | * Sets Crop from the left of the asset
106 | * @param {Number} left Crop from the left of the asset
107 | */
108 | }, {
109 | key: "setLeft",
110 | value: function setLeft(left) {
111 | this['left'] = left;
112 | return this;
113 | }
114 | /**
115 | * Returns Crop from the left of the asset
116 | * minimum: 0
117 | * maximum: 1
118 | * @return {Number}
119 | */
120 | }, {
121 | key: "getRight",
122 | value: function getRight() {
123 | return this.right;
124 | }
125 |
126 | /**
127 | * Sets Crop from the left of the asset
128 | * @param {Number} right Crop from the left of the asset
129 | */
130 | }, {
131 | key: "setRight",
132 | value: function setRight(right) {
133 | this['right'] = right;
134 | return this;
135 | }
136 | }], [{
137 | key: "initialize",
138 | value: function initialize(obj) {}
139 |
140 | /**
141 | * Constructs a Crop from a plain JavaScript object, optionally creating a new instance.
142 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
143 | * @param {Object} data The plain JavaScript object bearing properties of interest.
144 | * @param {module:model/Crop} obj Optional instance to populate.
145 | * @return {module:model/Crop} The populated Crop instance.
146 | */
147 | }, {
148 | key: "constructFromObject",
149 | value: function constructFromObject(data, obj) {
150 | if (data) {
151 | obj = obj || new Crop();
152 | if (data.hasOwnProperty('top')) {
153 | obj['top'] = _ApiClient["default"].convertToType(data['top'], 'Number');
154 | }
155 | if (data.hasOwnProperty('bottom')) {
156 | obj['bottom'] = _ApiClient["default"].convertToType(data['bottom'], 'Number');
157 | }
158 | if (data.hasOwnProperty('left')) {
159 | obj['left'] = _ApiClient["default"].convertToType(data['left'], 'Number');
160 | }
161 | if (data.hasOwnProperty('right')) {
162 | obj['right'] = _ApiClient["default"].convertToType(data['right'], 'Number');
163 | }
164 | }
165 | return obj;
166 | }
167 |
168 | /**
169 | * Validates the JSON data with respect to Crop.
170 | * @param {Object} data The plain JavaScript object bearing properties of interest.
171 | * @return {boolean} to indicate whether the JSON data is valid with respect to Crop.
172 | */
173 | }, {
174 | key: "validateJSON",
175 | value: function validateJSON(data) {
176 | return true;
177 | }
178 | }]);
179 | }();
180 | /**
181 | * Crop from the top of the asset
182 | * @member {Number} top
183 | */
184 | Crop.prototype['top'] = undefined;
185 |
186 | /**
187 | * Crop from the bottom of the asset
188 | * @member {Number} bottom
189 | */
190 | Crop.prototype['bottom'] = undefined;
191 |
192 | /**
193 | * Crop from the left of the asset
194 | * @member {Number} left
195 | */
196 | Crop.prototype['left'] = undefined;
197 |
198 | /**
199 | * Crop from the left of the asset
200 | * @member {Number} right
201 | */
202 | Crop.prototype['right'] = undefined;
203 | var _default = exports["default"] = Crop;
--------------------------------------------------------------------------------
/src/model/MuxDestinationOptions.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | Object.defineProperty(exports, "__esModule", {
4 | value: true
5 | });
6 | exports["default"] = void 0;
7 | var _ApiClient = _interopRequireDefault(require("../ApiClient"));
8 | function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
9 | function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10 | function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
11 | function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
12 | function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
13 | function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
14 | function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
15 | * Shotstack
16 | * Official Node SDK for the Shotstack Cloud Video Editing API
17 | *
18 | * The version of the OpenAPI document: v1
19 | *
20 | *
21 | * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
22 | * https://openapi-generator.tech
23 | * Do not edit the class manually.
24 | *
25 | */
26 | /**
27 | * The MuxDestinationOptions model module.
28 | * @module model/MuxDestinationOptions
29 | * @version 0.2.9
30 | */
31 | var MuxDestinationOptions = /*#__PURE__*/function () {
32 | /**
33 | * Constructs a new MuxDestinationOptions.
34 | * Pass additional options to control how Mux processes video. Currently supports playback_policy and passthrough options.
35 | * @alias module:model/MuxDestinationOptions
36 | */
37 | function MuxDestinationOptions() {
38 | _classCallCheck(this, MuxDestinationOptions);
39 | MuxDestinationOptions.initialize(this);
40 | }
41 |
42 | /**
43 | * Initializes the fields of this object.
44 | * This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
45 | * Only for internal use.
46 | */
47 | return _createClass(MuxDestinationOptions, [{
48 | key: "getPlaybackPolicy",
49 | value:
50 | /**
51 | * Returns Sets the Mux `playback_policy` option. Value is an array of strings - use `public`, `signed`, or both.
52 | * @return {Array.MuxDestinationOptions from a plain JavaScript object, optionally creating a new instance.
94 | * Copies all relevant properties from data to obj if supplied or a new instance if not.
95 | * @param {Object} data The plain JavaScript object bearing properties of interest.
96 | * @param {module:model/MuxDestinationOptions} obj Optional instance to populate.
97 | * @return {module:model/MuxDestinationOptions} The populated MuxDestinationOptions instance.
98 | */
99 | }, {
100 | key: "constructFromObject",
101 | value: function constructFromObject(data, obj) {
102 | if (data) {
103 | obj = obj || new MuxDestinationOptions();
104 | if (data.hasOwnProperty('playbackPolicy')) {
105 | obj['playbackPolicy'] = _ApiClient["default"].convertToType(data['playbackPolicy'], ['String']);
106 | }
107 | if (data.hasOwnProperty('passthrough')) {
108 | obj['passthrough'] = _ApiClient["default"].convertToType(data['passthrough'], 'String');
109 | }
110 | }
111 | return obj;
112 | }
113 |
114 | /**
115 | * Validates the JSON data with respect to MuxDestinationOptions.
116 | * @param {Object} data The plain JavaScript object bearing properties of interest.
117 | * @return {boolean} to indicate whether the JSON data is valid with respect to MuxDestinationOptions.
118 | */
119 | }, {
120 | key: "validateJSON",
121 | value: function validateJSON(data) {
122 | // ensure the json data is an array
123 | if (!Array.isArray(data['playbackPolicy'])) {
124 | throw new Error("Expected the field `playbackPolicy` to be an array in the JSON data but got " + data['playbackPolicy']);
125 | }
126 | // ensure the json data is a string
127 | if (data['passthrough'] && !(typeof data['passthrough'] === 'string' || data['passthrough'] instanceof String)) {
128 | throw new Error("Expected the field `passthrough` to be a primitive type in the JSON string but got " + data['passthrough']);
129 | }
130 | return true;
131 | }
132 | }]);
133 | }();
134 | /**
135 | * Sets the Mux `playback_policy` option. Value is an array of strings - use `public`, `signed`, or both.
136 | * @member {Array.playbackPolicy property.
148 | * @enum {String}
149 | * @readonly
150 | */
151 | MuxDestinationOptions['PlaybackPolicyEnum'] = {
152 | /**
153 | * value: "public"
154 | * @const
155 | */
156 | "public": "public",
157 | /**
158 | * value: "signed"
159 | * @const
160 | */
161 | "signed": "signed"
162 | };
163 | var _default = exports["default"] = MuxDestinationOptions;
--------------------------------------------------------------------------------