Ajout du choix des utilisateurs sur un événement. Ajout de fichiers dans un événement. (dropzone cassée)

This commit is contained in:
2025-05-26 22:10:40 +02:00
parent 82d77e2b8d
commit 49dffff1bf
1100 changed files with 157519 additions and 113 deletions

91
em2rp/node_modules/retry-request/CHANGELOG.md generated vendored Normal file
View File

@ -0,0 +1,91 @@
# Changelog
## [7.0.2](https://github.com/googleapis/retry-request/compare/v7.0.1...v7.0.2) (2024-01-19)
### Bug Fixes
* Get rid of debug runtime dependency ([#118](https://github.com/googleapis/retry-request/issues/118)) ([85e1bd0](https://github.com/googleapis/retry-request/commit/85e1bd0a46630876757344405a6c8620d9de6451))
## [7.0.1](https://github.com/googleapis/retry-request/compare/v7.0.0...v7.0.1) (2023-10-12)
### Bug Fixes
* Types ([#109](https://github.com/googleapis/retry-request/issues/109)) ([35c0260](https://github.com/googleapis/retry-request/commit/35c02608138a4b66cf488e4e1e90cbff05d42c2f))
## [7.0.0](https://github.com/googleapis/retry-request/compare/v6.0.0...v7.0.0) (2023-10-11)
### ⚠ BREAKING CHANGES
* Remove `request` fallback, Update Docs, Update Types ([#107](https://github.com/googleapis/retry-request/issues/107))
### Features
* Remove `request` fallback, Update Docs, Update Types ([#107](https://github.com/googleapis/retry-request/issues/107)) ([ba8abb2](https://github.com/googleapis/retry-request/commit/ba8abb242ff21921a81e3178081806e95a902a68))
## [6.0.0](https://github.com/googleapis/retry-request/compare/v5.0.2...v6.0.0) (2023-07-20)
### ⚠ BREAKING CHANGES
* Move to node 14 as the minimum version ([#97](https://github.com/googleapis/retry-request/issues/97))
* move minimum version to node 14 ([#96](https://github.com/googleapis/retry-request/issues/96))
### Features
* Move to node 14 as the minimum version ([#97](https://github.com/googleapis/retry-request/issues/97)) ([f42d074](https://github.com/googleapis/retry-request/commit/f42d0743de048fdf46c7f480f3dec59c2caefa5a))
### Miscellaneous Chores
* Move minimum version to node 14 ([#96](https://github.com/googleapis/retry-request/issues/96)) ([2167a91](https://github.com/googleapis/retry-request/commit/2167a91c36e95522ad7e7293b4744ddd81c6166e))
## [5.0.2](https://github.com/googleapis/retry-request/compare/v5.0.1...v5.0.2) (2022-09-14)
### Bug Fixes
* Delete second LICENSE ([#82](https://github.com/googleapis/retry-request/issues/82)) ([9dfaf18](https://github.com/googleapis/retry-request/commit/9dfaf1819b18b6d660924951b9cf1c509b6e9870))
* Remove pip install statements ([#1546](https://github.com/googleapis/retry-request/issues/1546)) ([#79](https://github.com/googleapis/retry-request/issues/79)) ([cb4e15d](https://github.com/googleapis/retry-request/commit/cb4e15d6e8ae9d72855ed1071957afe9d301b12e))
## [5.0.1](https://github.com/googleapis/retry-request/compare/v5.0.0...v5.0.1) (2022-06-09)
### Bug Fixes
* respect totalTimeout and do not retry if nextRetryDelay is <= 0 ([#38](https://github.com/googleapis/retry-request/issues/38)) ([9501a42](https://github.com/googleapis/retry-request/commit/9501a42d06a620282dcd2ff9990fd0b5033a990b))
## [5.0.0](https://github.com/googleapis/retry-request/compare/v4.2.2...v5.0.0) (2022-05-06)
### ⚠ BREAKING CHANGES
* drop node 10 (#68)
### Build System
* drop node 10 ([#68](https://github.com/googleapis/retry-request/issues/68)) ([00ec90c](https://github.com/googleapis/retry-request/commit/00ec90c4d3cb29245ca746e0e133fcddc22d2251))
### [4.2.1](https://github.com/googleapis/retry-request/compare/v4.2.0...v4.2.1) (2022-04-12)
### Bug Fixes
* add new retry options to types ([#36](https://github.com/googleapis/retry-request/issues/36)) ([3f10798](https://github.com/googleapis/retry-request/commit/3f10798f47c03b50f1ba352b04d09ea3d0458b9c))
* use extend instead of object.assign ([#37](https://github.com/googleapis/retry-request/issues/37)) ([8c8dcdd](https://github.com/googleapis/retry-request/commit/8c8dcdd7d6262ce305c93fa4a8a7b2630e984824))
## [4.2.0](https://github.com/googleapis/retry-request/compare/v4.1.0...v4.2.0) (2022-04-06)
### Features
* support enhanced retry settings ([#35](https://github.com/googleapis/retry-request/issues/35)) ([0184676](https://github.com/googleapis/retry-request/commit/0184676dee36596fb939fb4559af11d0a14f64bd))
### Bug Fixes
* add new retry options to types ([#36](https://github.com/googleapis/retry-request/issues/36)) ([3f10798](https://github.com/googleapis/retry-request/commit/3f10798f47c03b50f1ba352b04d09ea3d0458b9c))
* correctly calculate retry attempt ([#33](https://github.com/googleapis/retry-request/issues/33)) ([4c852e2](https://github.com/googleapis/retry-request/commit/4c852e2ba22a7f75edfb3c905bd37a7e9913e67d))
* use extend instead of object.assign ([#37](https://github.com/googleapis/retry-request/issues/37)) ([8c8dcdd](https://github.com/googleapis/retry-request/commit/8c8dcdd7d6262ce305c93fa4a8a7b2630e984824))

42
em2rp/node_modules/retry-request/index.d.ts generated vendored Normal file
View File

@ -0,0 +1,42 @@
declare module 'retry-request' {
import * as request from 'request';
import * as teenyRequest from 'teeny-request';
type teenyRequestFunction = typeof teenyRequest extends Function
? typeof teenyRequest
: never;
namespace retryRequest {
/**
* Set the defaults for `retryRequest`.
*/
const defaults: retryRequest.Options;
/**
* Determines the next retry based on the provided configuration.
*/
function getNextRetryDelay(config: Options): number;
interface Options {
objectMode?: boolean;
request: typeof request | teenyRequestFunction;
retries?: number;
noResponseRetries?: number;
currentRetryAttempt?: number;
maxRetryDelay?: number;
retryDelayMultiplier?: number;
totalTimeout?: number;
shouldRetryFn?: (response: request.RequestResponse) => boolean;
}
}
function retryRequest(
requestOpts: request.Options,
opts: retryRequest.Options,
callback?: request.RequestCallback
): {abort: () => void};
function retryRequest(
requestOpts: request.Options,
callback?: request.RequestCallback
): {abort: () => void};
export = retryRequest;
}

293
em2rp/node_modules/retry-request/index.js generated vendored Normal file
View File

@ -0,0 +1,293 @@
'use strict';
const {PassThrough} = require('stream');
const extend = require('extend');
let debug = () => {};
if (
typeof process !== 'undefined' &&
'env' in process &&
typeof process.env === 'object' &&
process.env.DEBUG === 'retry-request'
) {
debug = message => {
console.log('retry-request:', message);
};
}
const DEFAULTS = {
objectMode: false,
retries: 2,
/*
The maximum time to delay in seconds. If retryDelayMultiplier results in a
delay greater than maxRetryDelay, retries should delay by maxRetryDelay
seconds instead.
*/
maxRetryDelay: 64,
/*
The multiplier by which to increase the delay time between the completion of
failed requests, and the initiation of the subsequent retrying request.
*/
retryDelayMultiplier: 2,
/*
The length of time to keep retrying in seconds. The last sleep period will
be shortened as necessary, so that the last retry runs at deadline (and not
considerably beyond it). The total time starting from when the initial
request is sent, after which an error will be returned, regardless of the
retrying attempts made meanwhile.
*/
totalTimeout: 600,
noResponseRetries: 2,
currentRetryAttempt: 0,
shouldRetryFn: function (response) {
const retryRanges = [
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
// 1xx - Retry (Informational, request still processing)
// 2xx - Do not retry (Success)
// 3xx - Do not retry (Redirect)
// 4xx - Do not retry (Client errors)
// 429 - Retry ("Too Many Requests")
// 5xx - Retry (Server errors)
[100, 199],
[429, 429],
[500, 599],
];
const statusCode = response.statusCode;
debug(`Response status: ${statusCode}`);
let range;
while ((range = retryRanges.shift())) {
if (statusCode >= range[0] && statusCode <= range[1]) {
// Not a successful status or redirect.
return true;
}
}
},
};
function retryRequest(requestOpts, opts, callback) {
if (typeof requestOpts === 'string') {
requestOpts = {url: requestOpts};
}
const streamMode = typeof arguments[arguments.length - 1] !== 'function';
if (typeof opts === 'function') {
callback = opts;
}
const manualCurrentRetryAttemptWasSet =
opts && typeof opts.currentRetryAttempt === 'number';
opts = extend({}, DEFAULTS, opts);
if (typeof opts.request === 'undefined') {
throw new Error('A request library must be provided to retry-request.');
}
let currentRetryAttempt = opts.currentRetryAttempt;
let numNoResponseAttempts = 0;
let streamResponseHandled = false;
let retryStream;
let requestStream;
let delayStream;
let activeRequest;
const retryRequest = {
abort: function () {
if (activeRequest && activeRequest.abort) {
activeRequest.abort();
}
},
};
if (streamMode) {
retryStream = new PassThrough({objectMode: opts.objectMode});
retryStream.abort = resetStreams;
}
const timeOfFirstRequest = Date.now();
if (currentRetryAttempt > 0) {
retryAfterDelay(currentRetryAttempt);
} else {
makeRequest();
}
if (streamMode) {
return retryStream;
} else {
return retryRequest;
}
function resetStreams() {
delayStream = null;
if (requestStream) {
requestStream.abort && requestStream.abort();
requestStream.cancel && requestStream.cancel();
if (requestStream.destroy) {
requestStream.destroy();
} else if (requestStream.end) {
requestStream.end();
}
}
}
function makeRequest() {
let finishHandled = false;
currentRetryAttempt++;
debug(`Current retry attempt: ${currentRetryAttempt}`);
function handleFinish(args = []) {
if (!finishHandled) {
finishHandled = true;
retryStream.emit('complete', ...args);
}
}
if (streamMode) {
streamResponseHandled = false;
delayStream = new PassThrough({objectMode: opts.objectMode});
requestStream = opts.request(requestOpts);
setImmediate(() => {
retryStream.emit('request');
});
requestStream
// gRPC via google-cloud-node can emit an `error` as well as a `response`
// Whichever it emits, we run with-- we can't run with both. That's what
// is up with the `streamResponseHandled` tracking.
.on('error', err => {
if (streamResponseHandled) {
return;
}
streamResponseHandled = true;
onResponse(err);
})
.on('response', (resp, body) => {
if (streamResponseHandled) {
return;
}
streamResponseHandled = true;
onResponse(null, resp, body);
})
.on('complete', (...params) => handleFinish(params))
.on('finish', (...params) => handleFinish(params));
requestStream.pipe(delayStream);
} else {
activeRequest = opts.request(requestOpts, onResponse);
}
}
function retryAfterDelay(currentRetryAttempt) {
if (streamMode) {
resetStreams();
}
const nextRetryDelay = getNextRetryDelay({
maxRetryDelay: opts.maxRetryDelay,
retryDelayMultiplier: opts.retryDelayMultiplier,
retryNumber: currentRetryAttempt,
timeOfFirstRequest,
totalTimeout: opts.totalTimeout,
});
debug(`Next retry delay: ${nextRetryDelay}`);
if (nextRetryDelay <= 0) {
numNoResponseAttempts = opts.noResponseRetries + 1;
return;
}
setTimeout(makeRequest, nextRetryDelay);
}
function onResponse(err, response, body) {
// An error such as DNS resolution.
if (err) {
numNoResponseAttempts++;
if (numNoResponseAttempts <= opts.noResponseRetries) {
retryAfterDelay(numNoResponseAttempts);
} else {
if (streamMode) {
retryStream.emit('error', err);
retryStream.end();
} else {
callback(err, response, body);
}
}
return;
}
// Send the response to see if we should try again.
// NOTE: "currentRetryAttempt" isn't accurate by default, as it counts
// the very first request sent as the first "retry". It is only accurate
// when a user provides their own "currentRetryAttempt" option at
// instantiation.
const adjustedCurrentRetryAttempt = manualCurrentRetryAttemptWasSet
? currentRetryAttempt
: currentRetryAttempt - 1;
if (
adjustedCurrentRetryAttempt < opts.retries &&
opts.shouldRetryFn(response)
) {
retryAfterDelay(currentRetryAttempt);
return;
}
// No more attempts need to be made, just continue on.
if (streamMode) {
retryStream.emit('response', response);
delayStream.pipe(retryStream);
requestStream.on('error', err => {
retryStream.destroy(err);
});
} else {
callback(err, response, body);
}
}
}
module.exports = retryRequest;
function getNextRetryDelay(config) {
const {
maxRetryDelay,
retryDelayMultiplier,
retryNumber,
timeOfFirstRequest,
totalTimeout,
} = config;
const maxRetryDelayMs = maxRetryDelay * 1000;
const totalTimeoutMs = totalTimeout * 1000;
const jitter = Math.floor(Math.random() * 1000);
const calculatedNextRetryDelay =
Math.pow(retryDelayMultiplier, retryNumber) * 1000 + jitter;
const maxAllowableDelayMs =
totalTimeoutMs - (Date.now() - timeOfFirstRequest);
return Math.min(
calculatedNextRetryDelay,
maxAllowableDelayMs,
maxRetryDelayMs
);
}
module.exports.defaults = DEFAULTS;
module.exports.getNextRetryDelay = getNextRetryDelay;

20
em2rp/node_modules/retry-request/license generated vendored Normal file
View File

@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2015 Stephen Sawchuk
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.

48
em2rp/node_modules/retry-request/package.json generated vendored Normal file
View File

@ -0,0 +1,48 @@
{
"name": "retry-request",
"version": "7.0.2",
"description": "Retry a request.",
"main": "index.js",
"repository": "stephenplusplus/retry-request",
"scripts": {
"docs": "jsdoc -c .jsdoc.js",
"predocs-test": "npm run docs",
"docs-test": "linkinator docs",
"fix": "gts fix",
"lint": "gts check",
"test": "mocha --timeout 30000",
"system-test": ""
},
"files": [
"index.js",
"index.d.ts",
"license"
],
"types": "index.d.ts",
"keywords": [
"request",
"retry",
"stream"
],
"author": "Stephen Sawchuk <sawchuk@gmail.com>",
"license": "MIT",
"engines": {
"node": ">=14"
},
"dependencies": {
"@types/request": "^2.48.8",
"extend": "^3.0.2",
"teeny-request": "^9.0.0"
},
"devDependencies": {
"async": "^3.0.1",
"gts": "^5.0.0",
"jsdoc": "^4.0.0",
"jsdoc-fresh": "^3.0.0",
"jsdoc-region-tag": "^3.0.0",
"linkinator": "^4.0.0",
"lodash.range": "^3.2.0",
"mocha": "^10.2.0",
"typescript": "^5.1.6"
}
}

199
em2rp/node_modules/retry-request/readme.md generated vendored Normal file
View File

@ -0,0 +1,199 @@
|![retry-request](logo.png)
|:-:
|Retry a [request][request] with built-in [exponential backoff](https://developers.google.com/analytics/devguides/reporting/core/v3/coreErrors#backoff).
```sh
$ npm install --save teeny-request
$ npm install --save retry-request
```
```js
var request = require('retry-request', {
request: require('teeny-request'),
});
```
It should work the same as `request` and `teeny-request` in both callback mode and stream mode.
Note: This module only works when used as a readable stream, i.e. POST requests aren't supported ([#3](https://github.com/stephenplusplus/retry-request/issues/3)).
## Do I need to install `request`?
Yes! You must independently install `teeny-request` OR `request` (_deprecated_) and provide it to this library:
```js
var request = require('retry-request', {
request: require('teeny-request'),
});
```
#### Callback
`urlThatReturns503` will be requested 3 total times before giving up and executing the callback.
```js
request(urlThatReturns503, function (err, resp, body) {});
```
#### Stream
`urlThatReturns503` will be requested 3 total times before giving up and emitting the `response` and `complete` event as usual.
```js
request(urlThatReturns503)
.on('error', function () {})
.on('response', function () {})
.on('complete', function () {});
```
## Can I monitor what retry-request is doing internally?
Yes! To enable the debug mode, set the environment variable `DEBUG` to _retry-request_.
(Thanks for the implementation, @yihaozhadan!)
## request(requestOptions, [opts], [cb])
### requestOptions
Passed directly to `request` or `teeny-request`. See the list of options supported:
- https://github.com/request/request/#requestoptions-callback
- https://github.com/googleapis/teeny-request#teenyrequestoptions-callback
### opts _(optional)_
#### `opts.noResponseRetries`
Type: `Number`
Default: `2`
The number of times to retry after a response fails to come through, such as a DNS resolution error or a socket hangup.
```js
var opts = {
noResponseRetries: 0,
};
request(url, opts, function (err, resp, body) {
// url was requested 1 time before giving up and
// executing this callback.
});
```
#### `opts.objectMode`
Type: `Boolean`
Default: `false`
Set to `true` if your custom `opts.request` function returns a stream in object mode.
#### `opts.retries`
Type: `Number`
Default: `2`
```js
var opts = {
retries: 4,
};
request(urlThatReturns503, opts, function (err, resp, body) {
// urlThatReturns503 was requested a total of 5 times
// before giving up and executing this callback.
});
```
#### `opts.currentRetryAttempt`
Type: `Number`
Default: `0`
```js
var opts = {
currentRetryAttempt: 1,
};
request(urlThatReturns503, opts, function (err, resp, body) {
// urlThatReturns503 was requested as if it already failed once.
});
```
#### `opts.shouldRetryFn`
Type: `Function`
Default: Returns `true` if [http.incomingMessage](https://nodejs.org/api/http.html#http_http_incomingmessage).statusCode is < 200 or >= 400.
```js
var opts = {
shouldRetryFn: function (incomingHttpMessage) {
return incomingHttpMessage.statusMessage !== 'OK';
},
};
request(urlThatReturnsNonOKStatusMessage, opts, function (err, resp, body) {
// urlThatReturnsNonOKStatusMessage was requested a
// total of 3 times, each time using `opts.shouldRetryFn`
// to decide if it should continue before giving up and
// executing this callback.
});
```
#### `opts.request`
Type: `Function`
If we not provided we will throw an error advising you to provide it.
_NOTE: If you override the request function, and it returns a stream in object mode, be sure to set `opts.objectMode` to `true`._
```js
var originalRequest = require('teeny-request').defaults({
pool: {
maxSockets: Infinity,
},
});
var opts = {
request: originalRequest,
};
request(urlThatReturns503, opts, function (err, resp, body) {
// Your provided `originalRequest` instance was used.
});
```
#### `opts.maxRetryDelay`
Type: `Number`
Default: `64`
The maximum time to delay in seconds. If retryDelayMultiplier results in a delay greater than maxRetryDelay, retries should delay by maxRetryDelay seconds instead.
#### `opts.retryDelayMultiplier`
Type: `Number`
Default: `2`
The multiplier by which to increase the delay time between the completion of failed requests, and the initiation of the subsequent retrying request.
#### `opts.totalTimeout`
Type: `Number`
Default: `600`
The length of time to keep retrying in seconds. The last sleep period will be shortened as necessary, so that the last retry runs at deadline (and not considerably beyond it). The total time starting from when the initial request is sent, after which an error will be returned, regardless of the retrying attempts made meanwhile.
### cb _(optional)_
Passed directly to `request`. See the callback section: https://github.com/request/request/#requestoptions-callback.
[request]: https://github.com/request/request