@gjsify/webrtc 0.4.22 → 0.4.24

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.
@@ -1 +1 @@
1
- import"./_virtual/_rolldown/runtime.js";import e from"gi://GLib?version=2.0";var RTCCertificate=class{expires;_fingerprints;_algorithm;constructor(e,t,n){this._algorithm=e,this.expires=t,this._fingerprints=n}getFingerprints(){return[...this._fingerprints]}get _algorithmName(){return this._algorithm}};async function generateCertificate(t){let n;if(typeof t==`string`)n=t.toLowerCase();else if(t&&typeof t==`object`&&typeof t.name==`string`)n=t.name.toLowerCase();else throw new DOMException(`generateCertificate: algorithm must have a name property`,`NotSupportedError`);if(n===`ecdsa`){let e=t.namedCurve;if(e&&e!==`P-256`)throw new DOMException(`generateCertificate: unsupported ECDSA curve '${e}'`,`NotSupportedError`)}else if(n===`rsassa-pkcs1-v1_5`){let e=t.hash,n=typeof e==`string`?e:e?.name;if(n&&n.toUpperCase()===`SHA-1`)throw new DOMException(`generateCertificate: SHA-1 is not supported for RSA certificates`,`NotSupportedError`)}else throw new DOMException(`generateCertificate: unsupported algorithm '${n}'`,`NotSupportedError`);let r=e.uuid_string_random(),i=e.Checksum.new(e.ChecksumType.SHA256);i.update(new TextEncoder().encode(r+Date.now()));let a=i.get_string().slice(0,64).match(/.{2}/g).join(`:`).toUpperCase(),o=Date.now()+2592e6;return new RTCCertificate(n,o,[{algorithm:`sha-256`,value:a}])}export{RTCCertificate,generateCertificate};
1
+ import"./_virtual/_rolldown/runtime.js";import e from"gi://GLib?version=2.0";var RTCCertificate=class{expires;_fingerprints;_algorithm;constructor(e,t,n){this._algorithm=e,this.expires=t,this._fingerprints=n}getFingerprints(){return[...this._fingerprints]}get _algorithmName(){return this._algorithm}};async function generateCertificate(t){let n;if(typeof t==`string`)n=t.toLowerCase();else if(t&&typeof t==`object`&&typeof t.name==`string`)n=t.name.toLowerCase();else throw new DOMException(`generateCertificate: algorithm must have a name property`,`NotSupportedError`);let r=typeof t==`object`?t:{};if(n===`ecdsa`){let e=r.namedCurve;if(e&&e!==`P-256`)throw new DOMException(`generateCertificate: unsupported ECDSA curve '${e}'`,`NotSupportedError`)}else if(n===`rsassa-pkcs1-v1_5`){let e=r.hash,t=typeof e==`string`?e:e?.name;if(t&&t.toUpperCase()===`SHA-1`)throw new DOMException(`generateCertificate: SHA-1 is not supported for RSA certificates`,`NotSupportedError`)}else throw new DOMException(`generateCertificate: unsupported algorithm '${n}'`,`NotSupportedError`);let i=e.uuid_string_random(),a=e.Checksum.new(e.ChecksumType.SHA256);a.update(new TextEncoder().encode(i+Date.now()));let o=a.get_string().slice(0,64).match(/.{2}/g).join(`:`).toUpperCase(),s=Date.now()+2592e6;return new RTCCertificate(n,s,[{algorithm:`sha-256`,value:o}])}export{RTCCertificate,generateCertificate};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/webrtc",
3
- "version": "0.4.22",
3
+ "version": "0.4.24",
4
4
  "description": "W3C WebRTC API for GJS using GStreamer webrtcbin as the peer-connection backend",
5
5
  "type": "module",
6
6
  "module": "lib/esm/index.js",
@@ -58,10 +58,10 @@
58
58
  "peer-connection"
59
59
  ],
60
60
  "dependencies": {
61
- "@gjsify/buffer": "^0.4.22",
62
- "@gjsify/dom-events": "^0.4.22",
63
- "@gjsify/dom-exception": "^0.4.22",
64
- "@gjsify/webrtc-native": "^0.4.22"
61
+ "@gjsify/buffer": "^0.4.24",
62
+ "@gjsify/dom-events": "^0.4.24",
63
+ "@gjsify/dom-exception": "^0.4.24",
64
+ "@gjsify/webrtc-native": "^0.4.24"
65
65
  },
66
66
  "devDependencies": {
67
67
  "@girs/gjs": "4.0.1",
@@ -70,8 +70,8 @@
70
70
  "@girs/gst-1.0": "1.28.1-4.0.1",
71
71
  "@girs/gstsdp-1.0": "1.0.0-4.0.1",
72
72
  "@girs/gstwebrtc-1.0": "1.0.0-4.0.1",
73
- "@gjsify/cli": "^0.4.22",
74
- "@gjsify/unit": "^0.4.22",
73
+ "@gjsify/cli": "^0.4.24",
74
+ "@gjsify/unit": "^0.4.24",
75
75
  "@types/node": "^25.9.1",
76
76
  "typescript": "^6.0.3"
77
77
  }