@osaas/cli 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/packager/cmd.d.ts +3 -0
- package/dist/packager/cmd.d.ts.map +1 -0
- package/dist/packager/cmd.js +28 -0
- package/dist/packager/cmd.js.map +1 -0
- package/dist/transcode/cmd.d.ts.map +1 -1
- package/dist/transcode/cmd.js +4 -2
- package/dist/transcode/cmd.js.map +1 -1
- package/package.json +4 -4
- package/src/cli.ts +2 -0
- package/src/packager/cmd.ts +33 -0
- package/src/transcode/cmd.ts +7 -2
package/dist/cli.js
CHANGED
|
@@ -32,6 +32,7 @@ const cmd_1 = __importDefault(require("./admin/cmd"));
|
|
|
32
32
|
const cmdUser = __importStar(require("./user/cmd"));
|
|
33
33
|
const cmd_2 = __importDefault(require("./transcode/cmd"));
|
|
34
34
|
const cmd_3 = __importDefault(require("./vmaf/cmd"));
|
|
35
|
+
const cmd_4 = __importDefault(require("./packager/cmd"));
|
|
35
36
|
const cli = new commander_1.Command();
|
|
36
37
|
cli
|
|
37
38
|
.configureHelp({ showGlobalOptions: true })
|
|
@@ -41,6 +42,7 @@ cli.addCommand(cmdUser.cmdList());
|
|
|
41
42
|
cli.addCommand(cmdUser.cmdCreate());
|
|
42
43
|
cli.addCommand(cmdUser.cmdRemove());
|
|
43
44
|
cli.addCommand((0, cmd_2.default)());
|
|
45
|
+
cli.addCommand((0, cmd_4.default)());
|
|
44
46
|
cli.addCommand((0, cmd_3.default)());
|
|
45
47
|
cli.parse(process.argv);
|
|
46
48
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,sDAAmC;AACnC,oDAAsC;AACtC,0DAA2C;AAC3C,qDAAoC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,sDAAmC;AACnC,oDAAsC;AACtC,0DAA2C;AAC3C,qDAAoC;AACpC,yDAAyC;AAEzC,MAAM,GAAG,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE1B,GAAG;KACA,aAAa,CAAC,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;KAC1C,MAAM,CAAC,qBAAqB,EAAE,oBAAoB,CAAC,CAAC;AACvD,GAAG,CAAC,UAAU,CAAC,IAAA,aAAQ,GAAE,CAAC,CAAC;AAC3B,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AAClC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AACpC,GAAG,CAAC,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;AACpC,GAAG,CAAC,UAAU,CAAC,IAAA,aAAY,GAAE,CAAC,CAAC;AAC/B,GAAG,CAAC,UAAU,CAAC,IAAA,aAAW,GAAE,CAAC,CAAC;AAC9B,GAAG,CAAC,UAAU,CAAC,IAAA,aAAU,GAAE,CAAC,CAAC;AAC7B,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/packager/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,WAAW,YA4BlC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const client_core_1 = require("@osaas/client-core");
|
|
4
|
+
const client_transcode_1 = require("@osaas/client-transcode");
|
|
5
|
+
const commander_1 = require("commander");
|
|
6
|
+
function cmdPackager() {
|
|
7
|
+
const packager = new commander_1.Command('packager');
|
|
8
|
+
packager
|
|
9
|
+
.description('Create streaming package from ABR bundle on S3 and store on another S3 bucket')
|
|
10
|
+
.argument('<source>', 'Source Bucket URL (supported protocols: s3)')
|
|
11
|
+
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
12
|
+
.option('-v, --videos <videos...>', 'List of video files')
|
|
13
|
+
.option('-a, --audio <audio>', 'Audio file')
|
|
14
|
+
.action(async (source, dest, options, command) => {
|
|
15
|
+
try {
|
|
16
|
+
const globalOpts = command.optsWithGlobals();
|
|
17
|
+
const environment = globalOpts?.env || 'prod';
|
|
18
|
+
const ctx = new client_core_1.Context({ environment });
|
|
19
|
+
await (0, client_transcode_1.createStreamingPackage)(ctx, new URL(source), options.videos, options.audio, new URL(dest));
|
|
20
|
+
}
|
|
21
|
+
catch (err) {
|
|
22
|
+
console.log(err.message);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
return packager;
|
|
26
|
+
}
|
|
27
|
+
exports.default = cmdPackager;
|
|
28
|
+
//# sourceMappingURL=cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../src/packager/cmd.ts"],"names":[],"mappings":";;AAAA,oDAA6C;AAC7C,8DAAiE;AACjE,yCAAoC;AAEpC,SAAwB,WAAW;IACjC,MAAM,QAAQ,GAAG,IAAI,mBAAO,CAAC,UAAU,CAAC,CAAC;IAEzC,QAAQ;SACL,WAAW,CACV,+EAA+E,CAChF;SACA,QAAQ,CAAC,UAAU,EAAE,6CAA6C,CAAC;SACnE,QAAQ,CAAC,QAAQ,EAAE,2CAA2C,CAAC;SAC/D,MAAM,CAAC,0BAA0B,EAAE,qBAAqB,CAAC;SACzD,MAAM,CAAC,qBAAqB,EAAE,YAAY,CAAC;SAC3C,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;QAC/C,IAAI;YACF,MAAM,UAAU,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;YAC7C,MAAM,WAAW,GAAG,UAAU,EAAE,GAAG,IAAI,MAAM,CAAC;YAC9C,MAAM,GAAG,GAAG,IAAI,qBAAO,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;YACzC,MAAM,IAAA,yCAAsB,EAC1B,GAAG,EACH,IAAI,GAAG,CAAC,MAAM,CAAC,EACf,OAAO,CAAC,MAAM,EACd,OAAO,CAAC,KAAK,EACb,IAAI,GAAG,CAAC,IAAI,CAAC,CACd,CAAC;SACH;QAAC,OAAO,GAAG,EAAE;YACZ,OAAO,CAAC,GAAG,CAAE,GAAa,CAAC,OAAO,CAAC,CAAC;SACrC;IACH,CAAC,CAAC,CAAC;IACL,OAAO,QAAQ,CAAC;AAClB,CAAC;AA5BD,8BA4BC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/transcode/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,YAAY,
|
|
1
|
+
{"version":3,"file":"cmd.d.ts","sourceRoot":"","sources":["../../src/transcode/cmd.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,CAAC,OAAO,UAAU,YAAY,YAgCnC"}
|
package/dist/transcode/cmd.js
CHANGED
|
@@ -9,8 +9,9 @@ function cmdTranscode() {
|
|
|
9
9
|
.description('Transcode file to ABR fileset and store on S3 bucket')
|
|
10
10
|
.argument('<source>', 'Source URL (supported protocols: http, https)')
|
|
11
11
|
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
12
|
+
.argument('[packageDestination]', 'Optional destination URL for Streaming package (supported protocols: s3)')
|
|
12
13
|
.option('-d, --duration <duration>', 'Duration in seconds. If not provided will transcode entire file')
|
|
13
|
-
.action(async (source, dest, options, command) => {
|
|
14
|
+
.action(async (source, dest, packageDestination, options, command) => {
|
|
14
15
|
try {
|
|
15
16
|
const globalOpts = command.optsWithGlobals();
|
|
16
17
|
const environment = globalOpts?.env || 'prod';
|
|
@@ -18,7 +19,8 @@ function cmdTranscode() {
|
|
|
18
19
|
const pool = new client_transcode_1.QueuePool({ context: ctx, size: 1 });
|
|
19
20
|
await pool.init();
|
|
20
21
|
await pool.transcode(new URL(source), new URL(dest), {
|
|
21
|
-
duration: options.duration
|
|
22
|
+
duration: options.duration,
|
|
23
|
+
packageDestination: packageDestination
|
|
22
24
|
});
|
|
23
25
|
await pool.destroy();
|
|
24
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../src/transcode/cmd.ts"],"names":[],"mappings":";;AAAA,oDAA6C;AAC7C,8DAAoD;AACpD,yCAAoC;AAEpC,SAAwB,YAAY;IAClC,MAAM,SAAS,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC,CAAC;IAE3C,SAAS;SACN,WAAW,CAAC,sDAAsD,CAAC;SACnE,QAAQ,CAAC,UAAU,EAAE,+CAA+C,CAAC;SACrE,QAAQ,CAAC,QAAQ,EAAE,2CAA2C,CAAC;SAC/D,MAAM,CACL,2BAA2B,EAC3B,iEAAiE,CAClE;SACA,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"cmd.js","sourceRoot":"","sources":["../../src/transcode/cmd.ts"],"names":[],"mappings":";;AAAA,oDAA6C;AAC7C,8DAAoD;AACpD,yCAAoC;AAEpC,SAAwB,YAAY;IAClC,MAAM,SAAS,GAAG,IAAI,mBAAO,CAAC,WAAW,CAAC,CAAC;IAE3C,SAA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Cloud CLI",
|
|
5
5
|
"author": "Eyevinn Technology <work@eyevinn.se>",
|
|
6
6
|
"homepage": "https://www.osaas.io",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"test": "jest --pass-with-no-tests"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@osaas/client-core": "^0.
|
|
25
|
-
"@osaas/client-transcode": "^0.
|
|
24
|
+
"@osaas/client-core": "^0.6.0",
|
|
25
|
+
"@osaas/client-transcode": "^0.5.0",
|
|
26
26
|
"chalk": "4.1.2",
|
|
27
27
|
"commander": "^12.1.0",
|
|
28
28
|
"fast-jwt": "^4.0.1"
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "0d54f545a51a26df68290fc3a3bcfce2ce2851aa"
|
|
34
34
|
}
|
package/src/cli.ts
CHANGED
|
@@ -5,6 +5,7 @@ import cmdAdmin from './admin/cmd';
|
|
|
5
5
|
import * as cmdUser from './user/cmd';
|
|
6
6
|
import cmdTranscode from './transcode/cmd';
|
|
7
7
|
import cmdCompare from './vmaf/cmd';
|
|
8
|
+
import cmdPackager from './packager/cmd';
|
|
8
9
|
|
|
9
10
|
const cli = new Command();
|
|
10
11
|
|
|
@@ -16,5 +17,6 @@ cli.addCommand(cmdUser.cmdList());
|
|
|
16
17
|
cli.addCommand(cmdUser.cmdCreate());
|
|
17
18
|
cli.addCommand(cmdUser.cmdRemove());
|
|
18
19
|
cli.addCommand(cmdTranscode());
|
|
20
|
+
cli.addCommand(cmdPackager());
|
|
19
21
|
cli.addCommand(cmdCompare());
|
|
20
22
|
cli.parse(process.argv);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Context } from '@osaas/client-core';
|
|
2
|
+
import { createStreamingPackage } from '@osaas/client-transcode';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
|
|
5
|
+
export default function cmdPackager() {
|
|
6
|
+
const packager = new Command('packager');
|
|
7
|
+
|
|
8
|
+
packager
|
|
9
|
+
.description(
|
|
10
|
+
'Create streaming package from ABR bundle on S3 and store on another S3 bucket'
|
|
11
|
+
)
|
|
12
|
+
.argument('<source>', 'Source Bucket URL (supported protocols: s3)')
|
|
13
|
+
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
14
|
+
.option('-v, --videos <videos...>', 'List of video files')
|
|
15
|
+
.option('-a, --audio <audio>', 'Audio file')
|
|
16
|
+
.action(async (source, dest, options, command) => {
|
|
17
|
+
try {
|
|
18
|
+
const globalOpts = command.optsWithGlobals();
|
|
19
|
+
const environment = globalOpts?.env || 'prod';
|
|
20
|
+
const ctx = new Context({ environment });
|
|
21
|
+
await createStreamingPackage(
|
|
22
|
+
ctx,
|
|
23
|
+
new URL(source),
|
|
24
|
+
options.videos,
|
|
25
|
+
options.audio,
|
|
26
|
+
new URL(dest)
|
|
27
|
+
);
|
|
28
|
+
} catch (err) {
|
|
29
|
+
console.log((err as Error).message);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
return packager;
|
|
33
|
+
}
|
package/src/transcode/cmd.ts
CHANGED
|
@@ -9,11 +9,15 @@ export default function cmdTranscode() {
|
|
|
9
9
|
.description('Transcode file to ABR fileset and store on S3 bucket')
|
|
10
10
|
.argument('<source>', 'Source URL (supported protocols: http, https)')
|
|
11
11
|
.argument('<dest>', 'Destination URL (supported protocols: s3)')
|
|
12
|
+
.argument(
|
|
13
|
+
'[packageDestination]',
|
|
14
|
+
'Optional destination URL for Streaming package (supported protocols: s3)'
|
|
15
|
+
)
|
|
12
16
|
.option(
|
|
13
17
|
'-d, --duration <duration>',
|
|
14
18
|
'Duration in seconds. If not provided will transcode entire file'
|
|
15
19
|
)
|
|
16
|
-
.action(async (source, dest, options, command) => {
|
|
20
|
+
.action(async (source, dest, packageDestination, options, command) => {
|
|
17
21
|
try {
|
|
18
22
|
const globalOpts = command.optsWithGlobals();
|
|
19
23
|
const environment = globalOpts?.env || 'prod';
|
|
@@ -21,7 +25,8 @@ export default function cmdTranscode() {
|
|
|
21
25
|
const pool = new QueuePool({ context: ctx, size: 1 });
|
|
22
26
|
await pool.init();
|
|
23
27
|
await pool.transcode(new URL(source), new URL(dest), {
|
|
24
|
-
duration: options.duration
|
|
28
|
+
duration: options.duration,
|
|
29
|
+
packageDestination: packageDestination
|
|
25
30
|
});
|
|
26
31
|
await pool.destroy();
|
|
27
32
|
} catch (err) {
|