{"id":20156043,"url":"https://github.com/max-kut/amocrm-widget-installer","last_synced_at":"2025-04-09T22:20:55.874Z","repository":{"id":48955156,"uuid":"365491906","full_name":"max-kut/amocrm-widget-installer","owner":"max-kut","description":"Automatic installation of a widget in amoCRM","archived":false,"fork":false,"pushed_at":"2022-06-12T15:03:18.000Z","size":12,"stargazers_count":5,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-06T06:08:51.791Z","etag":null,"topics":["amocrm","widget"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/max-kut.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-05-08T11:02:25.000Z","updated_at":"2023-08-16T08:12:58.000Z","dependencies_parsed_at":"2022-09-01T06:41:07.627Z","dependency_job_id":null,"html_url":"https://github.com/max-kut/amocrm-widget-installer","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-kut%2Famocrm-widget-installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-kut%2Famocrm-widget-installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-kut%2Famocrm-widget-installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/max-kut%2Famocrm-widget-installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/max-kut","download_url":"https://codeload.github.com/max-kut/amocrm-widget-installer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248120059,"owners_count":21050886,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amocrm","widget"],"created_at":"2024-11-13T23:37:20.760Z","updated_at":"2025-04-09T22:20:55.833Z","avatar_url":"https://github.com/max-kut.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# amoCRM widget installer\n\nСервис, который упаковывает директорию в zip-архив и загружает в аккаунт amoCRM. \nЕсли в amoCRM виджет не существует, он будет создан, иначе будет обновлен.\n\nОбратите внимание, что с 2022-06-08 amoCRM добавила amoМаркет. Если аккаунт обновился и имеет доступ к маркету (вместо раздела Настройки -\u003e Интеграции), то в объекте параметров конструктора `WidgetInstaller` можете указать `amoMarket: true`. Иначе укажате `amoMarket: false`.\n\n## Установка\n```bash\n# npm\nnpm install --save-dev @amopro/widget-installer\n# or yarn\nyarn add --dev @amopro/widget-installer\n```\n\n## Использование\n\nВы можете посмотреть заготовку виджета в репозитории [amocrm-widget-starter-kit](https://github.com/max-kut/amocrm-widget-starter-kit)\n\n\n```javascript\nconst path = require('path');\nconst WIDGET_DIR = path.resolve('widget');\n\n// ...\n// Здесь вы собираете виджет в папку \"widget\"\n// ...\n\ntry {\n    const installer = require('@amopro/widget-installer');\n    const {WidgetInstaller, makeZipArchive} = installer;\n\n    console.log('Make widget archive...');\n    \n    const widgetZipPath = await makeZipArchive(WIDGET_DIR);\n    \n    console.log('Widget uploading...');\n    const installerParams = {\n        subDomain: process.env.AMO_SUBDOMAIN,\n        login: process.env.AMO_LOGIN,\n        password: process.env.AMO_PASSWORD,\n        widgetZipPath: widgetZipPath,\n        redirectUri: process.env.APP_URL + '/amocrm/auth',\n        revokeAccessHookUri: process.env.APP_URL + '/amocrm/destroy',\n        amoMarket: true, // true - если аккаунт имеет доступ к amoМаркет (с 2022-06-08)\n    };\n    const wi = new WidgetInstaller(installerParams);\n    \n    await wi.upload();\n    console.log('Widget uploaded!');\n\n    // после загрузки можно удалить архив\n    const fse = require('fs-extra'); \n    fse.removeSync(path.resolve('widget.zip'));\n} catch (e) {\n    console.error('uploading error', e.toString());\n    throw e;\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-kut%2Famocrm-widget-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmax-kut%2Famocrm-widget-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmax-kut%2Famocrm-widget-installer/lists"}