Projektstart
This commit is contained in:
11
backend/node_modules/libbase64/.eslintrc
generated
vendored
Normal file
11
backend/node_modules/libbase64/.eslintrc
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"rules": {
|
||||
"indent": 0,
|
||||
"global-require": 0,
|
||||
"no-await-in-loop": 0
|
||||
},
|
||||
"extends": ["nodemailer", "prettier"],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017
|
||||
}
|
||||
}
|
||||
4
backend/node_modules/libbase64/.github/FUNDING.yml
generated
vendored
Normal file
4
backend/node_modules/libbase64/.github/FUNDING.yml
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: [andris9] # enable once enrolled
|
||||
custom: ['https://www.paypal.me/nodemailer']
|
||||
37
backend/node_modules/libbase64/.github/workflows/release.yaml
generated
vendored
Normal file
37
backend/node_modules/libbase64/.github/workflows/release.yaml
generated
vendored
Normal file
@@ -0,0 +1,37 @@
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
id-token: write
|
||||
|
||||
name: release
|
||||
jobs:
|
||||
release-please:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: google-github-actions/release-please-action@v3
|
||||
id: release
|
||||
with:
|
||||
release-type: node
|
||||
package-name: ${{vars.NPM_MODULE_NAME}}
|
||||
pull-request-title-pattern: 'chore${scope}: release ${version} [skip-ci]'
|
||||
# The logic below handles the npm publication:
|
||||
- uses: actions/checkout@v4
|
||||
# these if statements ensure that a publication only occurs when
|
||||
# a new release is created:
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 20
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
- run: npm ci
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
- run: npm publish --provenance --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
|
||||
if: ${{ steps.release.outputs.release_created }}
|
||||
21
backend/node_modules/libbase64/.github/workflows/test.yml
generated
vendored
Normal file
21
backend/node_modules/libbase64/.github/workflows/test.yml
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Run tests
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
node: [16.x, 18.x, 20.x, 21.x]
|
||||
os: [ubuntu-latest]
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node }}
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: npm install
|
||||
- run: npm test
|
||||
7
backend/node_modules/libbase64/.ncurc.js
generated
vendored
Normal file
7
backend/node_modules/libbase64/.ncurc.js
generated
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
upgrade: true,
|
||||
reject: [
|
||||
// 5x is esm only
|
||||
'chai'
|
||||
]
|
||||
};
|
||||
8
backend/node_modules/libbase64/.prettierrc.js
generated
vendored
Normal file
8
backend/node_modules/libbase64/.prettierrc.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
module.exports = {
|
||||
printWidth: 160,
|
||||
tabWidth: 4,
|
||||
singleQuote: true,
|
||||
endOfLine: 'lf',
|
||||
trailingComma: 'none',
|
||||
arrowParens: 'avoid'
|
||||
};
|
||||
8
backend/node_modules/libbase64/CHANGELOG.md
generated
vendored
Normal file
8
backend/node_modules/libbase64/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Changelog
|
||||
|
||||
## [1.3.0](https://github.com/nodemailer/libbase64/compare/v1.2.1...v1.3.0) (2024-02-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **deploy:** Added autodeploy system ([f53cb2e](https://github.com/nodemailer/libbase64/commit/f53cb2e8ea3c4900288a96284914da2c35bffe9f))
|
||||
19
backend/node_modules/libbase64/LICENSE
generated
vendored
Normal file
19
backend/node_modules/libbase64/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
Copyright (c) 2014-2017 Andris Reinman
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
113
backend/node_modules/libbase64/README.md
generated
vendored
Normal file
113
backend/node_modules/libbase64/README.md
generated
vendored
Normal file
@@ -0,0 +1,113 @@
|
||||
# libbase64
|
||||
|
||||
Encode and decode base64 strings.
|
||||
|
||||
## Usage
|
||||
|
||||
Install with npm
|
||||
|
||||
npm install libbase64
|
||||
|
||||
Require in your script
|
||||
|
||||
```javascript
|
||||
const libbase64 = require('libbase64');
|
||||
```
|
||||
|
||||
### Encode values
|
||||
|
||||
Encode Buffer objects or unicode strings with
|
||||
|
||||
libbase64.encode(val) → String
|
||||
|
||||
Where
|
||||
|
||||
- **val** is a Buffer or an unicode string
|
||||
|
||||
**Example**
|
||||
|
||||
```javascript
|
||||
libbase64.encode('jõgeva');
|
||||
// asO1Z2V2YQ==
|
||||
```
|
||||
|
||||
### Wrap encoded values
|
||||
|
||||
To enforce soft line breaks on lines longer than selected amount of characters, use `wrap`
|
||||
|
||||
libbase64.wrap(str[, lineLength]) → String
|
||||
|
||||
Where
|
||||
|
||||
- **str** is a base64 encoded string
|
||||
- **lineLength** (defaults to 76) is the maximum allowed line length
|
||||
|
||||
**Example**
|
||||
|
||||
```javascript
|
||||
libbase64.wrap('asO1Z2V2asO1Z2V2asO1Z2V2YQ==', 10);
|
||||
// asO1Z2V2as\r\n
|
||||
// O1Z2V2asO1\r\n
|
||||
// Z2V2YQ==
|
||||
```
|
||||
|
||||
### Transform Streams
|
||||
|
||||
`libbase64` makes it possible to encode and decode streams with `libbase64.Encoder` and `libbase64.Decoder` constructors.
|
||||
|
||||
### Encoder Stream
|
||||
|
||||
Create new Encoder Stream with
|
||||
|
||||
const encoder = new libbase64.Encoder([options])
|
||||
|
||||
Where
|
||||
|
||||
- **options** is the optional stream options object
|
||||
- **options.lineLength** (Number) if you want to use any other line length than the default 76
|
||||
characters (or set to `false` to turn the soft wrapping off completely)
|
||||
- **options.skipStartBytes** (Number) Optional. How many bytes to skip from output (default to 0)
|
||||
- **options.limitOutbutBytes** (Number) Optional. How many bytes to return (defaults to all bytes)
|
||||
- **options.startPadding** (String) Optional. Fills first line with provided padding string. Usually goes together with skipStartBytes to get line folding correct.
|
||||
|
||||
**Example**
|
||||
|
||||
The following example script reads in a file, encodes it to base64 and saves the output to a file.
|
||||
|
||||
```javascript
|
||||
const libbase64 = require('libbase64');
|
||||
const fs = require('fs');
|
||||
const source = fs.createReadStream('source.txt');
|
||||
const encoded = fs.createReadStream('encoded.txt');
|
||||
const encoder = new libbase64.Encoder();
|
||||
|
||||
source.pipe(encoder).pipe(encoded);
|
||||
```
|
||||
|
||||
### Decoder Stream
|
||||
|
||||
Create new Decoder Stream with
|
||||
|
||||
const decoder = new libbase64.Decoder([options])
|
||||
|
||||
Where
|
||||
|
||||
- **options** is the optional stream options object
|
||||
|
||||
**Example**
|
||||
|
||||
The following example script reads in a file in base64 encoding, decodes it and saves the output to a file.
|
||||
|
||||
```javascript
|
||||
const libbase64 = require('libbase64');
|
||||
const fs = require('fs');
|
||||
const encoded = fs.createReadStream('encoded.txt');
|
||||
const dest = fs.createReadStream('dest.txt');
|
||||
const decoder = new libbase64.Decoder();
|
||||
|
||||
encoded.pipe(decoder).pipe(dest);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
**MIT**
|
||||
253
backend/node_modules/libbase64/lib/libbase64.js
generated
vendored
Normal file
253
backend/node_modules/libbase64/lib/libbase64.js
generated
vendored
Normal file
@@ -0,0 +1,253 @@
|
||||
'use strict';
|
||||
|
||||
const { Buffer } = require('node:buffer');
|
||||
const stream = require('node:stream');
|
||||
const Transform = stream.Transform;
|
||||
|
||||
/**
|
||||
* Encodes a Buffer into a base64 encoded string
|
||||
*
|
||||
* @param {Buffer} buffer Buffer to convert
|
||||
* @returns {String} base64 encoded string
|
||||
*/
|
||||
function encode(buffer) {
|
||||
if (typeof buffer === 'string') {
|
||||
buffer = Buffer.from(buffer, 'utf-8');
|
||||
}
|
||||
|
||||
return buffer.toString('base64');
|
||||
}
|
||||
|
||||
/**
|
||||
* Decodes a base64 encoded string to a Buffer object
|
||||
*
|
||||
* @param {String} str base64 encoded string
|
||||
* @returns {Buffer} Decoded value
|
||||
*/
|
||||
function decode(str) {
|
||||
str = str || '';
|
||||
return Buffer.from(str, 'base64');
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds soft line breaks to a base64 string
|
||||
*
|
||||
* @param {String} str base64 encoded string that might need line wrapping
|
||||
* @param {Number} [lineLength=76] Maximum allowed length for a line
|
||||
* @returns {String} Soft-wrapped base64 encoded string
|
||||
*/
|
||||
function wrap(str, lineLength) {
|
||||
str = (str || '').toString();
|
||||
lineLength = lineLength || 76;
|
||||
|
||||
if (str.length <= lineLength) {
|
||||
return str;
|
||||
}
|
||||
|
||||
let result = [];
|
||||
let pos = 0;
|
||||
let chunkLength = lineLength * 1024;
|
||||
while (pos < str.length) {
|
||||
let wrappedLines = str
|
||||
.substr(pos, chunkLength)
|
||||
.replace(new RegExp('.{' + lineLength + '}', 'g'), '$&\r\n')
|
||||
.trim();
|
||||
result.push(wrappedLines);
|
||||
pos += chunkLength;
|
||||
}
|
||||
|
||||
return result.join('\r\n').trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a transform stream for encoding data to base64 encoding
|
||||
*
|
||||
* @constructor
|
||||
* @param {Object} options Stream options
|
||||
* @param {Number} [options.lineLength=76] Maximum lenght for lines, set to false to disable wrapping
|
||||
*/
|
||||
class Encoder extends Transform {
|
||||
constructor(options) {
|
||||
super();
|
||||
// init Transform
|
||||
this.options = options || {};
|
||||
|
||||
if (this.options.lineLength !== false) {
|
||||
this.options.lineLength = Number(this.options.lineLength) || 76;
|
||||
}
|
||||
|
||||
this.skipStartBytes = Number(this.options.skipStartBytes) || 0;
|
||||
this.limitOutbutBytes = Number(this.options.limitOutbutBytes) || 0;
|
||||
|
||||
// startPadding can be used together with skipStartBytes
|
||||
this._curLine = this.options.startPadding || '';
|
||||
this._remainingBytes = false;
|
||||
|
||||
this.inputBytes = 0;
|
||||
this.outputBytes = 0;
|
||||
}
|
||||
|
||||
_writeChunk(chunk /*, isFinal */) {
|
||||
if (this.skipStartBytes) {
|
||||
if (chunk.length <= this.skipStartBytes) {
|
||||
this.skipStartBytes -= chunk.length;
|
||||
return;
|
||||
}
|
||||
|
||||
chunk = chunk.slice(this.skipStartBytes);
|
||||
this.skipStartBytes = 0;
|
||||
}
|
||||
|
||||
if (this.limitOutbutBytes) {
|
||||
if (this.outputBytes + chunk.length <= this.limitOutbutBytes) {
|
||||
// ignore, can use entire chunk
|
||||
} else if (this.outputBytes >= this.limitOutbutBytes) {
|
||||
// chunks already processed
|
||||
return;
|
||||
} else {
|
||||
// use partial chunk
|
||||
chunk = chunk.slice(0, this.limitOutbutBytes - this.outputBytes);
|
||||
}
|
||||
}
|
||||
|
||||
this.outputBytes += chunk.length;
|
||||
this.push(chunk);
|
||||
}
|
||||
|
||||
_getWrapped(str, isFinal) {
|
||||
str = wrap(str, this.options.lineLength);
|
||||
if (!isFinal && str.length === this.options.lineLength) {
|
||||
str += '\r\n';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, done) {
|
||||
if (encoding !== 'buffer') {
|
||||
chunk = Buffer.from(chunk, encoding);
|
||||
}
|
||||
|
||||
if (!chunk || !chunk.length) {
|
||||
return setImmediate(done);
|
||||
}
|
||||
|
||||
this.inputBytes += chunk.length;
|
||||
|
||||
if (this._remainingBytes && this._remainingBytes.length) {
|
||||
chunk = Buffer.concat([this._remainingBytes, chunk], this._remainingBytes.length + chunk.length);
|
||||
this._remainingBytes = false;
|
||||
}
|
||||
|
||||
if (chunk.length % 3) {
|
||||
this._remainingBytes = chunk.slice(chunk.length - (chunk.length % 3));
|
||||
chunk = chunk.slice(0, chunk.length - (chunk.length % 3));
|
||||
} else {
|
||||
this._remainingBytes = false;
|
||||
}
|
||||
|
||||
let b64 = this._curLine + encode(chunk);
|
||||
|
||||
if (this.options.lineLength) {
|
||||
b64 = this._getWrapped(b64);
|
||||
|
||||
// remove last line as it is still most probably incomplete
|
||||
let lastLF = b64.lastIndexOf('\n');
|
||||
if (lastLF < 0) {
|
||||
this._curLine = b64;
|
||||
b64 = '';
|
||||
} else if (lastLF === b64.length - 1) {
|
||||
this._curLine = '';
|
||||
} else {
|
||||
this._curLine = b64.substr(lastLF + 1);
|
||||
b64 = b64.substr(0, lastLF + 1);
|
||||
}
|
||||
}
|
||||
|
||||
if (b64) {
|
||||
this._writeChunk(Buffer.from(b64, 'ascii'), false);
|
||||
}
|
||||
|
||||
setImmediate(done);
|
||||
}
|
||||
|
||||
_flush(done) {
|
||||
if (this._remainingBytes && this._remainingBytes.length) {
|
||||
this._curLine += encode(this._remainingBytes);
|
||||
}
|
||||
|
||||
if (this._curLine) {
|
||||
this._curLine = this._getWrapped(this._curLine, true);
|
||||
this._writeChunk(Buffer.from(this._curLine, 'ascii'), true);
|
||||
this._curLine = '';
|
||||
}
|
||||
done();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a transform stream for decoding base64 encoded strings
|
||||
*
|
||||
* @constructor
|
||||
* @param {Object} options Stream options
|
||||
*/
|
||||
class Decoder extends Transform {
|
||||
constructor(options) {
|
||||
super();
|
||||
// init Transform
|
||||
this.options = options || {};
|
||||
this._curLine = '';
|
||||
|
||||
this.inputBytes = 0;
|
||||
this.outputBytes = 0;
|
||||
}
|
||||
|
||||
_transform(chunk, encoding, done) {
|
||||
if (!chunk || !chunk.length) {
|
||||
return setImmediate(done);
|
||||
}
|
||||
|
||||
this.inputBytes += chunk.length;
|
||||
|
||||
let b64 = this._curLine + chunk.toString('ascii');
|
||||
this._curLine = '';
|
||||
|
||||
if (/[^a-zA-Z0-9+/=]/.test(b64)) {
|
||||
b64 = b64.replace(/[^a-zA-Z0-9+/=]/g, '');
|
||||
}
|
||||
|
||||
if (b64.length < 4) {
|
||||
this._curLine = b64;
|
||||
b64 = '';
|
||||
} else if (b64.length % 4) {
|
||||
this._curLine = b64.substr(-b64.length % 4);
|
||||
b64 = b64.substr(0, b64.length - this._curLine.length);
|
||||
}
|
||||
|
||||
if (b64) {
|
||||
let buf = decode(b64);
|
||||
this.outputBytes += buf.length;
|
||||
this.push(buf);
|
||||
}
|
||||
|
||||
setImmediate(done);
|
||||
}
|
||||
|
||||
_flush(done) {
|
||||
if (this._curLine) {
|
||||
let buf = decode(this._curLine);
|
||||
this.outputBytes += buf.length;
|
||||
this.push(buf);
|
||||
this._curLine = '';
|
||||
}
|
||||
setImmediate(done);
|
||||
}
|
||||
}
|
||||
|
||||
// expose to the world
|
||||
module.exports = {
|
||||
encode,
|
||||
decode,
|
||||
wrap,
|
||||
Encoder,
|
||||
Decoder
|
||||
};
|
||||
35
backend/node_modules/libbase64/package.json
generated
vendored
Normal file
35
backend/node_modules/libbase64/package.json
generated
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"name": "libbase64",
|
||||
"version": "1.3.0",
|
||||
"description": "Encode and decode base64 encoded strings",
|
||||
"main": "lib/libbase64.js",
|
||||
"scripts": {
|
||||
"test": "grunt",
|
||||
"update": "rm -rf node_modules package-lock.json && ncu -u && npm install"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/nodemailer/libbase64.git"
|
||||
},
|
||||
"keywords": [
|
||||
"base64",
|
||||
"mime"
|
||||
],
|
||||
"author": "Andris Reinman",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/nodemailer/libbase64/issues"
|
||||
},
|
||||
"homepage": "https://github.com/nodemailer/libbase64",
|
||||
"devDependencies": {
|
||||
"chai": "4.4.1",
|
||||
"eslint-config-nodemailer": "1.2.0",
|
||||
"eslint-config-prettier": "9.1.0",
|
||||
"grunt": "1.6.1",
|
||||
"grunt-cli": "1.4.3",
|
||||
"grunt-eslint": "24.3.0",
|
||||
"grunt-mocha-test": "0.13.3",
|
||||
"mocha": "10.3.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
Reference in New Issue
Block a user