shifro 1.1.0 → 1.1.1

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.mjs CHANGED
@@ -3,7 +3,7 @@ import { parseArgs } from "node:util";
3
3
  import { ALL_FORMATS, Conversion, FilePathSource, FilePathTarget, Input, Mp4OutputFormat, Output } from "mediabunny";
4
4
  //#region package.json
5
5
  var name = "shifro";
6
- var version = "1.1.0";
6
+ var version = "1.1.1";
7
7
  var author = "Vitaly Gashkov <vitalygashkov@vk.com>";
8
8
  //#endregion
9
9
  //#region src/index.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shifro",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A lightweight library for decrypting MP4 files, directly in the browser",
5
5
  "files": [
6
6
  "dist"
@@ -9,18 +9,13 @@
9
9
  "shifro": "./dist/cli.mjs"
10
10
  },
11
11
  "type": "module",
12
- "main": "./dist/index.js",
13
- "types": "./dist/index.d.ts",
12
+ "main": "./dist/index.mjs",
13
+ "types": "./dist/index.d.mts",
14
14
  "exports": {
15
15
  ".": {
16
- "require": {
17
- "types": "./dist/index.d.cts",
18
- "default": "./dist/index.cjs"
19
- },
20
- "import": {
21
- "types": "./dist/index.d.ts",
22
- "default": "./dist/index.js"
23
- }
16
+ "types": "./dist/index.d.mts",
17
+ "module-sync": "./dist/index.mjs",
18
+ "default": "./dist/index.mjs"
24
19
  }
25
20
  },
26
21
  "repository": {
@@ -74,7 +69,7 @@
74
69
  "start": "node ./dist/cli.mjs",
75
70
  "web": "vite",
76
71
  "build": "pnpm run bundle:lib && pnpm run bundle:cli",
77
- "bundle:lib": "tsdown ./src/index.ts --format cjs --format esm --dts --platform neutral",
72
+ "bundle:lib": "tsdown ./src/index.ts --format esm --dts --platform neutral --fixed-extension",
78
73
  "bundle:cli": "tsdown ./src/cli.ts --format esm --no-clean",
79
74
  "build:cli": "pnpm run build:cli:mac && pnpm run build:cli:linux && pnpm run build:cli:win",
80
75
  "build:cli:mac": "bun build --compile --minify --bytecode --target=bun-darwin-arm64 ./src/cli.ts --outfile shifro-windows.exe",
package/dist/index.cjs DELETED
@@ -1,42 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let mediabunny = require("mediabunny");
3
- //#region src/index.ts
4
- var Input = class extends mediabunny.Input {
5
- constructor({ keys, handleEncryptionInfo, ...options }) {
6
- super({
7
- ...options,
8
- formats: mediabunny.ALL_FORMATS,
9
- formatOptions: { isobmff: { resolveKeyId: ({ keyId, psshBoxes }) => {
10
- handleEncryptionInfo?.({
11
- keyId,
12
- psshBoxes
13
- });
14
- const key = keys.get(keyId);
15
- if (!key) throw new Error("Unknown key ID.");
16
- return key;
17
- } } }
18
- });
19
- }
20
- };
21
- var Output = class extends mediabunny.Output {
22
- constructor({ ...options }) {
23
- super({
24
- ...options,
25
- format: options.format ?? new mediabunny.Mp4OutputFormat()
26
- });
27
- }
28
- };
29
- //#endregion
30
- exports.Decryption = mediabunny.Conversion;
31
- exports.FilePathSource = mediabunny.FilePathSource;
32
- exports.FilePathTarget = mediabunny.FilePathTarget;
33
- exports.Input = Input;
34
- exports.MkvOutputFormat = mediabunny.MkvOutputFormat;
35
- exports.MovOutputFormat = mediabunny.MovOutputFormat;
36
- exports.Mp3OutputFormat = mediabunny.Mp3OutputFormat;
37
- exports.Mp4OutputFormat = mediabunny.Mp4OutputFormat;
38
- exports.Output = Output;
39
- exports.ReadableStreamSource = mediabunny.ReadableStreamSource;
40
- exports.StreamSource = mediabunny.StreamSource;
41
- exports.StreamTarget = mediabunny.StreamTarget;
42
- exports.UrlSource = mediabunny.UrlSource;
package/dist/index.d.ts DELETED
@@ -1,28 +0,0 @@
1
- import { Conversion, FilePathSource, FilePathTarget, Input as Input$1, InputOptions, MkvOutputFormat, MovOutputFormat, Mp3OutputFormat, Mp4OutputFormat, Output as Output$1, OutputFormat, OutputOptions, PsshBox, ReadableStreamSource, StreamSource, StreamSourceOptions, StreamTarget, StreamTargetOptions, UrlSource } from "mediabunny";
2
-
3
- //#region src/index.d.ts
4
- type KeyId = string;
5
- type Key = string;
6
- type KeyMap = Map<KeyId, Key>;
7
- declare class Input extends Input$1 {
8
- constructor({
9
- keys,
10
- handleEncryptionInfo,
11
- ...options
12
- }: Omit<InputOptions, 'formats' | 'formatOptions'> & {
13
- keys: KeyMap;
14
- handleEncryptionInfo?: (options: {
15
- keyId: string;
16
- psshBoxes: PsshBox[];
17
- }) => void;
18
- });
19
- }
20
- declare class Output extends Output$1 {
21
- constructor({
22
- ...options
23
- }: Omit<OutputOptions, 'format'> & {
24
- format?: OutputFormat;
25
- });
26
- }
27
- //#endregion
28
- export { Conversion as Decryption, FilePathSource, FilePathTarget, Input, type InputOptions, type Key, type KeyId, type KeyMap, MkvOutputFormat, MovOutputFormat, Mp3OutputFormat, Mp4OutputFormat, Output, type OutputFormat, type OutputOptions, ReadableStreamSource, StreamSource, type StreamSourceOptions, StreamTarget, type StreamTargetOptions, UrlSource };
File without changes
File without changes