Skip to content

Commit

Permalink
Removed request
Browse files Browse the repository at this point in the history
  • Loading branch information
klein0r committed Jan 11, 2024
1 parent a0e8fa9 commit b5bd95d
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 7 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Since v5.5.0 of the JavaScript adapter the following locations (relative to the
<!--
### **WORK IN PROGRESS**
-->
### **WORK IN PROGRESS**

* (klein0r) Breaking change: Removed `request` package (replaced with `axios`)

### 7.6.2 (2024-01-02)

* (klein0r) Added missing console.info()
Expand Down
40 changes: 40 additions & 0 deletions io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,46 @@
"agree",
"cancel"
]
},
{
"condition": {
"operand": "and",
"rules": [
"oldVersion<7.7.0",
"newVersion>=7.7.0"
]
},
"title": {
"en": "Package 'request' has been removed",
"de": "Paket 'request' wurde entfernt",
"ru": "Удалено 'request' пакета",
"pt": "Pacote 'request' foi removido",
"nl": "Pakket 'request' is verwijderd",
"fr": "Le paquet 'request' a été supprimé",
"it": "Il pacchetto 'request' è stato rimosso",
"es": "El paquete 'request' ha sido eliminado",
"pl": "Pakiet 'request' został usunięty",
"uk": "Видалено пакет 'request'",
"zh-cn": "软件包 'request' 已被删除"
},
"text": {
"en": "The default package for HTTP-Request has beed removed and replaces with another library (axios). Please check your JavaScript-Code. Blockly users have to open and save all scripts with request-Blocks.",
"de": "Das Standardpaket für HTTP-Abfragen wurde entfernt und durch eine andere Bibliothek ersetzt (axios). Bitte überprüfe sämtlichen JavaScript-Code. Blockly-Benutzer müssen alle Skripte mit Request-Blocks öffnen und speichern.",
"ru": "Пакет по умолчанию для HTTP-Request был удален и заменен другой библиотекой (axios). Пожалуйста, проверьте JavaScript-код. Заблокированные пользователи должны открывать и сохранять все скрипты с запрос-блоками.",
"pt": "O pacote padrão para HTTP-Request foi removido e substituído por outra biblioteca (axios). Por favor, verifique o seu código JavaScript. Usuários bloqueados têm que abrir e salvar todos os scripts com request-Blocks.",
"nl": "Het standaardpakket voor HTTP-Request is verwijderd en vervangen door een andere bibliotheek (axios). Controleer uw JavaScript-Code. Blockly gebruikers moeten alle scripts openen en opslaan met request-Blocks.",
"fr": "Le paquet par défaut pour HTTP-Request a été supprimé et remplacé par une autre bibliothèque (axios). Veuillez vérifier votre code JavaScript. Les utilisateurs doivent ouvrir et enregistrer tous les scripts avec request-Blocks.",
"it": "Il pacchetto predefinito per HTTP-Request è stato rimosso e sostituito con un'altra libreria (assios). Controlla il codice JavaScript. Gli utenti Blockly devono aprire e salvare tutti gli script con request-Blocks.",
"es": "El paquete predeterminado para HTTP-Request ha sido eliminado y reemplazado por otra biblioteca (axios). Por favor, compruebe su código JavaScript. Los usuarios tienen que abrir y guardar todos los scripts con request-Blocks.",
"pl": "Domyślny pakiet HTTP- Request został usunięty i zastąpiony inną biblioteką (axios). Proszę sprawdzić kod JavaScript-. Blockly użytkownicy muszą otworzyć i zapisać wszystkie skrypty z request- Blocks.",
"uk": "Пакет за замовчуванням для HTTP-запиту видалено та замінює з іншою бібліотекою (axios). Будь ласка, перевірте свій JavaScript-Code. Заблокувати користувачів потрібно відкрити і зберегти всі скрипти з запитом-блоками.",
"zh-cn": "HTTP- Request 的默认包已删除, 并替换为另一个库( xios) 。 请检查access-date=中的日期值 (帮助) JavaScript-Code. Blockly用户必须打开并保存所有带有请求-Block的脚本."
},
"level": "warn",
"buttons": [
"agree",
"cancel"
]
}
]
},
Expand Down
4 changes: 0 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const mods = {
url: require('node:url'),
zlib: require('node:zlib'),
suncalc: require('suncalc2'),
request: require('./lib/request'),
wake_on_lan: require('wake_on_lan'),
nodeSchedule: require('node-schedule')
};
Expand Down Expand Up @@ -197,7 +196,6 @@ function loadTypeScriptDeclarations() {
// try to load the typings on disk for all 3rd party modules
const packages = [
'node', // this provides auto-completion for most builtins
'request', // preloaded by the adapter
];
// Also include user-selected libraries (but only those that are also installed)
if (
Expand Down Expand Up @@ -670,8 +668,6 @@ function startAdapter(options) {
},

ready: () => {
mods.request.setLogger(adapter.log);

adapter.config.maxSetStatePerMinute = parseInt(adapter.config.maxSetStatePerMinute, 10) || 1000;
if (adapter.supportsFeature && adapter.supportsFeature('PLUGINS')) {
const sentryInstance = adapter.getPluginInstance('sentry');
Expand Down
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,12 @@
"dependencies": {
"@iobroker/adapter-core": "^3.0.4",
"@types/node": "^20.10.6",
"@types/request": "^2.48.12",
"axios": "^1.6.5",
"coffeescript": "^2.7.0",
"jsonata": "^2.0.3",
"jszip": "^3.10.1",
"node-inspect": "^2.0.0",
"node-schedule": "2.1.1",
"request": "^2.88.2",
"semver": "^7.5.4",
"suncalc2": "^1.8.1",
"typescript": "~5.3.3",
Expand Down
2 changes: 1 addition & 1 deletion src/public/google-blockly/own/blocks_words.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b5bd95d

Please sign in to comment.