diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 971a684..930b219 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -1,21 +1,13 @@ -name: Cypress -on: - push: - branches: - - master - pull_request: - branches: - - master - +name: Frontend tests env: - NODE_VERSION: '16' + NODE_VERSION: '20' PYTHON_VERSION: '3.9' permissions: contents: read jobs: - cypress: + frontend-test: runs-on: ubuntu-latest services: ckan-postgres: @@ -48,6 +40,11 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Install Cypress deps + run: | + apt update + apt install -y libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libnss3 libxss1 libasound2 libxtst6 xauth xvfb + - uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} @@ -56,18 +53,18 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Install python deps - run: pip install 'ckan[requirements,dev]' -e. + run: | + git clone --depth 1 --branch ckan-2.10.4 https://github.com/ckan/ckan ../ckan + pip install '../ckan[requirements,dev]' -e. - name: Init environment run: | - sed -i -e 's/use = config:.*/use = config:\/srv\/app\/src\/ckan\/test-core.ini/' test.ini - ckan -c test.ini db upgrade - yes | ckan -c test.ini sysadmin add admin password=password123 email=admin@test.net + ckan -c test.ini db upgrade - name: Run Cypress uses: cypress-io/github-action@v6 with: - start: ckan -c test-core-cypress.ini run + start: ckan -c test.ini run - uses: actions/upload-artifact@v3 if: failure() diff --git a/.github/workflows/typing.yml b/.github/workflows/typing.yml index 13e309c..6f68dd9 100644 --- a/.github/workflows/typing.yml +++ b/.github/workflows/typing.yml @@ -1,5 +1,8 @@ name: Typing -on: [pull_request] +on: + pull_request: + branches: + - master env: NODE_VERSION: '20' PYTHON_VERSION: '3.9' diff --git a/Makefile b/Makefile index 5c128c4..c1a3ed1 100644 --- a/Makefile +++ b/Makefile @@ -10,4 +10,7 @@ changelog: ## compile changelog test-server: + yes | ckan -c test.ini db clean + ckan -c test.ini db upgrade + yes | ckan -ctest.ini sysadmin add admin password=password123 email=admin@test.net ckan -c test.ini run -t diff --git a/README.md b/README.md index b04562c..eb4aebb 100644 --- a/README.md +++ b/README.md @@ -957,6 +957,140 @@ Now file can be used normally. You can transfer file ownership to someone, stream or modify it. Pay attention to ID: completed file has its own unique ID, which is different from ID of the upload. +### JavaScript utilities + +None: ckanext-files does not provide stable CKAN JS modules at the moment. Try +creating your own widgets and share with us your examples or +requirements. We'll consider creating and including widgets into ckanext-files +if they are generic enough for majority of the users. + +ckanext-files registers few utilities inside CKAN JS namespace to help with +building UI components. + +First group of utilities registered inside CKAN Sandbox. Inside CKAN JS modules +it's accessible as `this.sandbox`. If you are writing code outside of JS +modules, Sandbox can be initialized via call to `ckan.sandbox()` + +```js +const sandbox = ckan.sandbox() +``` + +When `files` plugin loaded, sandbox contains `files` attribute with two +members: + +* `upload`: high-level helper for uploding files. +* `makeUploader`: factory for uploader-objects that gives more control over + upload process. + +The simplest way to upload the file is using `upload` helper. + +```js +await sandbox.files.upload( + new File(["file content"], "name.txt", {type: "text/plain"}), +) +``` + +This function uploads file to `default` storage via `files_file_create` +action. Extra parameters for API call can be passed using second argument of +upload. Use an object with `requestParams` key. Value of this key will be added +to standard API request parameters. For example, if you want to use `storage` +with name `memory` and `field` with value `custom`: + +```js +await sandbox.files.upload( + new File(["file content"], "name.txt", {type: "text/plain"}), + {requestParams: {storage: "memory", field: "custom"}} +) +``` + +If you need more control over upload, you can create an **uploader** and +interact with it directly, instead of using `upload` helper. + +*Uploader* is an object that extends base uploader, which defines standard +interface for this object. Uploader perfroms all the API calls internally and +returns uploaded file details. Out of the box you can use `Standard` and +`Multipart` uploaders. `Standard` uses `files_file_create` API action and +specializes on normal uploads. `Multipart` relies on `files_multipart_*` +actions and can be used to pause and continue upload. + +To create uploader instance, pass its name as a string to `makeUploader`. And +then you can call `upload` method of the uploader to perform the actual +upload. This method requires two arguments: + +* the file object +* object with additional parameters of API request, the same as `requestParams` + from example above. If you want to use default parameters, pass an empty + object. If you want to use `memory` storage, pass `{storage: "memory"}`, etc. + +```js +const uploader = sandbox.files.makeUploader("Standard") +await uploader.upload(new File(["file content"], "name.txt", {type: "text/plain"}), {}) +``` + +One of the reasons to use manually created uploader is progress +tracking. Uploader supports event subscriptions via +`uploader.addEventListener(event, callback)` and here's the list of possible +upload events: + +* `start`: file upload started. Event has `detail` property with object that + contains uploaded file as `file`. +* `progress`: another chunk of file was transferred to server. Event has + `detail` property with object that contains uploaded file as `file`, number + of loaded bytes as `loaded` and total number of bytes that must be + transferred as `total`. +* `finish`: file upload successfully finished. Event has `detail` property with + object that contains uploaded file as `file` and file details from API + response as `result`. +* `fail`: file upload failed. Event has `detail` property with object that + contains uploaded file as `file` and object with CKAN validation errors as + `reasons`. +* `error`: error unrelated to validation happened during upload, like call to + non-existing action. Event has `detail` property with object that contains + uploaded file as `file` and error as `message`. + + +If you want to use `upload` helper with customized uploader, there are two ways +to do it. + +* pass `adapter` property with uploader name inside second argument of `upload` + helper: + ```js + await sandbox.files.upload(new File(...), {adapter: "My"}) + ``` +* pass `uploader` property with uploader instance inside second argument of `upload` + helper: + ```js + const uploader = sandbox.files.makeUploader("Multipart") + await sandbox.files.upload(new File(...), {uploader}) + ``` + +The second group of ckanext-files utilities is available as +`ckan.CKANEXT_FILES` object. This object mainly serves as extension and +configuration point for `sandbox.files`. + +`ckan.CKANEXT_FILES.adapters` is a collection of all classes that can be used +to initialize uploader. It contains `Standard`, `Multipart` and `Base` +classes. `Standard` and `Multipart` can be used as is, while `Base` must be +extended by your custom uploader class. Add your custom uploader classes to +`adapters`, to make them available application-wide: + +```js + +class MyUploader extends Base { ... } + +ckan.CKANEXT_FILES.adapters["My"] = MyUploader; + +await sandbox.files.upload(new File(...), {adapter: "My"}) +``` + +`ckan.CKANEXT_FILES.defaultSettings` contain the object with default settings +available as `this.settings` inside any uploader. You can change the name of +the storage used by all uploaders using this object. Note, changes will apply +only to uploaders initialized after modification. + +```js +ckan.CKANEXT_FILES.defaultSettings.storage = "memory" +``` ## File upload strategies diff --git a/ckanext/files/assets/scripts/files--modules.js b/ckanext/files/assets/scripts/files--modules.js index 0a05dc8..f0c5320 100644 --- a/ckanext/files/assets/scripts/files--modules.js +++ b/ckanext/files/assets/scripts/files--modules.js @@ -78,7 +78,7 @@ ckan.module("files--auto-upload", function ($) { this.queue.add(file); this.refreshFormState(); const options = { - uploaderParams: [{ uploadAction: this.options.action }], + uploaderArgs: [{ uploadAction: this.options.action }], }; this.sandbox.files .upload(file, options) @@ -261,7 +261,6 @@ ckan.module("files--queue", function ($) { this.widgets.set(widget[0], info); widget.on("click", "[data-upload-resume]", this._onWidgetResume); widget.on("click", "[data-upload-pause]", this._onWidgetPause); - info.uploader.addEventListener("commit", (event) => (info.id = event.detail.id)); info.uploader.addEventListener("fail", ({ detail: { reasons, file }, }) => { this.sandbox.notify(file.name, Object.entries(reasons) .filter(([k, v]) => k[0] !== "_") @@ -347,4 +346,4 @@ ckan.module("files--queue", function ($) { }, }; }); -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLW1vZHVsZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9maWxlcy0tbW9kdWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxJQUFJLENBQUMsTUFBTSxDQUFDLHdCQUF3QixFQUFFLFVBQVUsQ0FBQztJQUM3QyxPQUFPO1FBQ0gsT0FBTyxFQUFFO1lBQ0wsWUFBWSxFQUFFLG9CQUFvQjtZQUNsQyxVQUFVLEVBQUUsbUJBQW1CO1lBQy9CLE1BQU0sRUFBRSxJQUFJO1lBQ1osWUFBWSxFQUFFLElBQUk7U0FDckI7UUFFRCxVQUFVO1lBQ04sSUFBSSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsTUFBTSxFQUFFLENBQUM7Z0JBQ3ZCLE9BQU8sQ0FBQyxLQUFLLENBQ1Qsc0VBQXNFLENBQ3pFLENBQUM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xuXG4gICAgICAgICAgICAkLnByb3h5QWxsKHRoaXMsIC9fb24vKTtcbiAgICAgICAgICAgIHRoaXMuZWwub24oe1xuICAgICAgICAgICAgICAgIFt0aGlzLm9wdGlvbnMuc3VjY2Vzc0V2ZW50XTogdGhpcy5fb25TdWNjZXNzLFxuICAgICAgICAgICAgICAgIFt0aGlzLm9wdGlvbnMuZXJyb3JFdmVudF06IHRoaXMuX29uRXJyb3IsXG4gICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgdGhpcy51cmwgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZChcImZpZWxkLXJlc291cmNlLXVybFwiKTtcbiAgICAgICAgICAgIHRoaXMuc2VsZWN0ID0gJCh0aGlzLm9wdGlvbnMuc2VsZWN0KTtcbiAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMuaW5pdGlhbFZhbHVlKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3Quc2VsZWN0MihcImRhdGFcIiwgdGhpcy5vcHRpb25zLmluaXRpYWxWYWx1ZSk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIF9vblN1Y2Nlc3MoeyBkZXRhaWwgfTogeyBkZXRhaWw6IGFueSB9KSB7XG4gICAgICAgICAgICB0aGlzLnNlbGVjdC5zZWxlY3QyKFwiZGF0YVwiLCB7IGlkOiBkZXRhaWwuaWQsIHRleHQ6IGRldGFpbC5uYW1lIH0pO1xuICAgICAgICB9LFxuICAgICAgICBfb25FcnJvcih7XG4gICAgICAgICAgICBkZXRhaWw6IGVycixcbiAgICAgICAgfToge1xuICAgICAgICAgICAgZGV0YWlsOiBzdHJpbmcgfCB7IFtrZXk6IHN0cmluZ106IHN0cmluZ1tdIH07XG4gICAgICAgIH0pIHtcbiAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5yZXBvcnRFcnJvcihcIkVycm9yXCIsIGVycik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGZvciAobGV0IFtmaWVsZCwgcHJvYmxlbXNdIG9mIE9iamVjdC5lbnRyaWVzKFxuICAgICAgICAgICAgICAgICAgICBlcnIgYXMgeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9LFxuICAgICAgICAgICAgICAgICkpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKGZpZWxkLnN0YXJ0c1dpdGgoXCJfX1wiKSkgY29udGludWU7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucmVwb3J0RXJyb3IoZmllbGQsIHByb2JsZW1zLmpvaW4oXCIsXCIpKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHJlcG9ydEVycm9yKGxhYmVsOiBzdHJpbmcsIG1lc3NhZ2U6IHN0cmluZykge1xuICAgICAgICAgICAgY29uc3QgYm94ID0gdGhpcy5zYW5kYm94Lm5vdGlmeS5pbml0aWFsaXplKFxuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkuY3JlYXRlKGxhYmVsLCBtZXNzYWdlKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB0aGlzLmVsLmNsb3Nlc3QoXCJsYWJlbFwiKS5wYXJlbnQoKS5hZnRlcihib3gpO1xuICAgICAgICB9LFxuICAgIH07XG59KTtcbi8qKlxuICogVXBsb2FkIGZpbGUgYW5kIHRyaWdnZXIgZXZlbnQgd2l0aCBmaWxlIGRhdGEgb24gc3BlY2lmaWVkIGVsZW1lbnQuXG4gKlxuICovXG5ja2FuLm1vZHVsZShcImZpbGVzLS1hdXRvLXVwbG9hZFwiLCBmdW5jdGlvbiAoJCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICAgIHNwaW5uZXI6IG51bGwsXG4gICAgICAgICAgICBhY3Rpb246IG51bGwsXG4gICAgICAgICAgICBzdWNjZXNzRXZlbnQ6IFwiZmlsZXMtZmlsZS1jcmVhdGVkXCIsXG4gICAgICAgICAgICBlcnJvckV2ZW50OiBcImZpbGVzLWZpbGUtZmFpbGVkXCIsXG4gICAgICAgICAgICBldmVudFRhcmdldDogbnVsbCxcbiAgICAgICAgICAgIGNvcHlJZEludG86IG51bGwsXG4gICAgICAgIH0sXG4gICAgICAgIHF1ZXVlOiBudWxsLFxuXG4gICAgICAgIGluaXRpYWxpemUoKSB7XG4gICAgICAgICAgICBpZiAoIXRoaXMub3B0aW9ucy5hY3Rpb24pIHtcbiAgICAgICAgICAgICAgICBjb25zb2xlLmVycm9yKFxuICAgICAgICAgICAgICAgICAgICBcImZpbGVzLS1hdXRvLXVwbG9hZCBjYW5ub3QgYmUgaW5pdGlhbGl6ZWQgd2l0aG91dCBgYWN0aW9uYCBvcHRpb25cIixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgICQucHJveHlBbGwodGhpcywgL19vbi8pO1xuXG4gICAgICAgICAgICB0aGlzLnF1ZXVlID0gbmV3IFNldCgpO1xuXG4gICAgICAgICAgICB0aGlzLmVsLm9uKFwiY2hhbmdlXCIsIChldmVudDogRXZlbnQpID0+XG4gICAgICAgICAgICAgICAgdGhpcy51cGxvYWQoLi4uKGV2ZW50LnRhcmdldCBhcyBIVE1MSW5wdXRFbGVtZW50KS5maWxlcyEpLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIHRoaXMuc3Bpbm5lciA9ICQodGhpcy5vcHRpb25zLnNwaW5uZXIpO1xuICAgICAgICAgICAgdGhpcy5maWVsZCA9ICQodGhpcy5vcHRpb25zLmZpZWxkKTtcbiAgICAgICAgICAgIHRoaXMuc3VibWl0cyA9IHRoaXMuZWxcbiAgICAgICAgICAgICAgICAuY2xvc2VzdChcImZvcm1cIilcbiAgICAgICAgICAgICAgICAuZmluZChcImlucHV0W3R5cGU9c3VibWl0XSxidXR0b25bdHlwZT1zdWJtaXRdXCIpO1xuICAgICAgICAgICAgdGhpcy5pZFRhcmdldCA9ICQodGhpcy5vcHRpb25zLmNvcHlJZEludG8pO1xuICAgICAgICB9LFxuXG4gICAgICAgIHVwbG9hZCguLi5maWxlczogRmlsZVtdKSB7XG4gICAgICAgICAgICBmaWxlcy5mb3JFYWNoKGFzeW5jIChmaWxlKSA9PiB7XG4gICAgICAgICAgICAgICAgdGhpcy5xdWV1ZS5hZGQoZmlsZSk7XG4gICAgICAgICAgICAgICAgdGhpcy5yZWZyZXNoRm9ybVN0YXRlKCk7XG4gICAgICAgICAgICAgICAgY29uc3Qgb3B0aW9uczogY2thbi5DS0FORVhUX0ZJTEVTLlVwbG9hZE9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgICAgIHVwbG9hZGVyUGFyYW1zOiBbeyB1cGxvYWRBY3Rpb246IHRoaXMub3B0aW9ucy5hY3Rpb24gfV0sXG4gICAgICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5maWxlc1xuICAgICAgICAgICAgICAgICAgICAudXBsb2FkKGZpbGUsIG9wdGlvbnMpXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKFxuICAgICAgICAgICAgICAgICAgICAgICAgKHJlc3VsdDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pZFRhcmdldC52YWwocmVzdWx0LmlkKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoUmVzdWx0KFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLm9wdGlvbnMuc3VjY2Vzc0V2ZW50LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICAoZXJyOiBhbnkpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaFJlc3VsdCh0aGlzLm9wdGlvbnMuZXJyb3JFdmVudCwgZXJyKSxcbiAgICAgICAgICAgICAgICAgICAgKVxuICAgICAgICAgICAgICAgICAgICAudGhlbigoKSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnF1ZXVlLmRlbGV0ZShmaWxlKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucmVmcmVzaEZvcm1TdGF0ZSgpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9LFxuXG4gICAgICAgIGRpc3BhdGNoUmVzdWx0KGV2ZW50OiBzdHJpbmcsIGRldGFpbDogYW55KSB7XG4gICAgICAgICAgICBjb25zdCB0YXJnZXQgPSB0aGlzLm9wdGlvbnMuZXZlbnRUYXJnZXRcbiAgICAgICAgICAgICAgICA/ICQodGhpcy5vcHRpb25zLmV2ZW50VGFyZ2V0KVxuICAgICAgICAgICAgICAgIDogdGhpcy5lbDtcbiAgICAgICAgICAgIHRhcmdldFswXS5kaXNwYXRjaEV2ZW50KG5ldyBDdXN0b21FdmVudChldmVudCwgeyBkZXRhaWwgfSkpO1xuICAgICAgICB9LFxuXG4gICAgICAgIHJlZnJlc2hGb3JtU3RhdGUoKSB7XG4gICAgICAgICAgICB0aGlzLnNwaW5uZXIucHJvcChcImhpZGRlblwiLCAhdGhpcy5xdWV1ZS5zaXplKTtcbiAgICAgICAgICAgIHRoaXMuc3VibWl0cy5wcm9wKFwiZGlzYWJsZWRcIiwgISF0aGlzLnF1ZXVlLnNpemUpO1xuICAgICAgICB9LFxuICAgIH07XG59KTtcblxuLyoqXG4gKiBBZGQgc2VsZWN0ZWQgZmlsZSB0byB1cGxvYWQgcXVldWUgd2hlbmV2ZXIgYFtkYXRhLXF1ZXVlLXNjaGVkdWxlcl1gXG4gKiBkaXNwYXRjaGVzIGBjaGFuZ2VgIGV2ZW50LlxuICpcbiAqL1xuY2thbi5tb2R1bGUoXCJmaWxlcy0tc2NoZWR1bGVyXCIsIGZ1bmN0aW9uICgkKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgICAgaW1tZWRpYXRlOiBmYWxzZSxcbiAgICAgICAgfSxcbiAgICAgICAgaW5pdGlhbGl6ZSgpIHtcbiAgICAgICAgICAgIGNvbnN0IHNjaGVkdWxlciA9IHRoaXMuJChcIltkYXRhLXF1ZXVlLXNjaGVkdWxlcl1cIik7XG4gICAgICAgICAgICBzY2hlZHVsZXIub24oXCJkcm9wXCIsIChldmVudDogRXZlbnQpID0+IGV2ZW50LnByZXZlbnREZWZhdWx0KCkpO1xuICAgICAgICAgICAgc2NoZWR1bGVyLm9uKFwiY2hhbmdlXCIsIChldmVudDogRXZlbnQpID0+XG4gICAgICAgICAgICAgICAgdGhpcy5wdXNoKC4uLihldmVudC50YXJnZXQgYXMgSFRNTElucHV0RWxlbWVudCkuZmlsZXMhKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgcHVzaCguLi5maWxlczogRmlsZVtdKSB7XG4gICAgICAgICAgICBmaWxlcy5mb3JFYWNoKChmaWxlKSA9PlxuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5wdWJsaXNoKFxuICAgICAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLmFkZEZpbGVUb1F1ZXVlLFxuICAgICAgICAgICAgICAgICAgICBmaWxlLFxuICAgICAgICAgICAgICAgICAgICB7IGltbWVkaWF0ZTogdGhpcy5vcHRpb25zLmltbWVkaWF0ZSB9LFxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgIH07XG59KTtcblxuLyoqXG4gKiBBZGQgZmlsZS9kaXJlY3RvcmllcyB0byB1cGxvYWQgcXVldWUgdmlhIGRyYWcnbidkcm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4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBmb3IgKGxldCBlbnRyeSBvZiBldmVudC5kYXRhVHJhbnNmZXIuaXRlbXMpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNjYW5FbnRyeShlbnRyeS53ZWJraXRHZXRBc0VudHJ5KCksIChmaWxlOiBGaWxlKSA9PlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnB1c2goZmlsZSksXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBzY2FuRW50cnkoXG4gICAgICAgICAgICBlbnRyeTogRmlsZVN5c3RlbUZpbGVFbnRyeSB8IEZpbGVTeXN0ZW1EaXJlY3RvcnlFbnRyeSxcbiAgICAgICAgICAgIGNiOiAoZmlsZTogRmlsZSkgPT4gdm9pZCxcbiAgICAgICAgKSB7XG4gICAgICAgICAgICBpZiAoZW50cnkuaXNGaWxlKSB7XG4gICAgICAgICAgICAgICAgKGVudHJ5IGFzIEZpbGVTeXN0ZW1GaWxlRW50cnkpLmZpbGUoY2IpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAoZW50cnkgYXMgRmlsZVN5c3RlbURpcmVjdG9yeUVudHJ5KVxuICAgICAgICAgICAgICAgICAgICAuY3JlYXRlUmVhZGVyKClcbiAgICAgICAgICAgICAgICAgICAgLnJlYWRFbnRyaWVzKChlbnRyaWVzKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgZW50cmllcy5mb3JFYWNoKChlKSA9PiB0aGlzLnNjYW5FbnRyeShlLCBjYikpLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIHB1c2goZmlsZTogRmlsZSkge1xuICAgICAgICAgICAgdGhpcy5zYW5kYm94LnB1Ymxpc2goXG4gICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5hZGRGaWxlVG9RdWV1ZSxcbiAgICAgICAgICAgICAgICBmaWxlLFxuICAgICAgICAgICAgICAgIHsgaW1tZWRpYXRlOiB0aGlzLm9wdGlvbnMuaW1tZWRpYXRlIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgIH07XG59KTtcblxuLyoqXG4gKiBBZGQgdG8gcXVldWUgYSBmaWxlLCB0aGF0IGhhcyBhc3NvY2lhdGVkIGluY29tcGxldGUgdXBsb2FkLlxuICpcbiAqIFN1cHBvcnRzIGEgbnVtYmVyIG9mIHByb3BlcnRpZXMgdG8gdmVyaWZ5IHRoYXQgdGhlIG5ldyBmaWxlIG1hdGNoZXNcbiAqIHByZXZpb3VzbHkgdXBsb2FkZWQgZmlsZS5cbiAqXG4gKlxuICovXG5ja2FuLm1vZHVsZShcImZpbGVzLS1yZXN0b3JlclwiLCBmdW5jdGlvbiAoJCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICAgIG5hbWU6IFwiXCIsXG4gICAgICAgICAgICBzaXplOiAwLFxuICAgICAgICAgICAgdXBsb2FkZWQ6IDAsXG4gICAgICAgICAgICBpZDogXCJcIixcbiAgICAgICAgICAgIGltbWVkaWF0ZTogZmFsc2UsXG4gICAgICAgIH0sXG5cbiAgICAgICAgaW5pdGlhbGl6ZSgpIHtcbiAgICAgICAgICAgICQucHJveHlBbGwodGhpcywgL19vbi8pO1xuICAgICAgICAgICAgdGhpcy5lbC5vbihcImNoYW5nZVwiLCB0aGlzLl9vbkNoYW5nZSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgX29uQ2hhbmdlKGV2ZW50OiBFdmVudCkge1xuICAgICAgICAgICAgY29uc3QgZmlsZSA9IChldmVudC50YXJnZXQgYXMgSFRNTElucHV0RWxlbWVudCkuZmlsZXM/LlswXTtcblxuICAgICAgICAgICAgaWYgKCFmaWxlKSB7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLm5hbWUgJiYgZmlsZS5uYW1lICE9PSB0aGlzLm9wdGlvbnMubmFtZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkoXG4gICAgICAgICAgICAgICAgICAgIFwiTmFtZSBtaXNtYXRjaC5cIixcbiAgICAgICAgICAgICAgICAgICAgYEV4cGVjdGVkIG5hbWU6ICR7dGhpcy5vcHRpb25zLm5hbWV9YCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkuZWxbMF0uc2Nyb2xsSW50b1ZpZXcoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMuc2l6ZSAmJiBmaWxlLnNpemUgIT09IHRoaXMub3B0aW9ucy5zaXplKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94Lm5vdGlmeShcbiAgICAgICAgICAgICAgICAgICAgXCJTaXplIG1pc21hdGNoLlwiLFxuICAgICAgICAgICAgICAgICAgICBgRXhwZWN0ZWQgc2l6ZTogJHt0aGlzLm9wdGlvbnMuc2l6ZS50b0xvY2FsZVN0cmluZygpfSBieXRlc2AsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5LmVsWzBdLnNjcm9sbEludG9WaWV3KCk7XG4gICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnNhbmRib3gucHVibGlzaChcbiAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLnJlc3RvcmVGaWxlSW5RdWV1ZSxcbiAgICAgICAgICAgICAgICBmaWxlLFxuICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHRoaXMub3B0aW9ucy5pZCxcbiAgICAgICAgICAgICAgICAgICAgdXBsb2FkZWQ6IHRoaXMub3B0aW9ucy51cGxvYWRlZCxcbiAgICAgICAgICAgICAgICAgICAgaW1tZWRpYXRlOiB0aGlzLm9wdGlvbnMuaW1tZWRpYXRlLFxuICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuICAgIH07XG59KTtcblxuY2thbi5tb2R1bGUoXCJmaWxlcy0tc2hhcmVkLXF1ZXVlXCIsIGZ1bmN0aW9uICgkKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgaW5pdGlhbGl6ZSgpIHtcbiAgICAgICAgICAgICQucHJveHlBbGwodGhpcywgL19vbi8pO1xuXG4gICAgICAgICAgICB0aGlzLndvcmtlciA9IG5ldyBTaGFyZWRXb3JrZXIoXG4gICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LnVybChcbiAgICAgICAgICAgICAgICAgICAgXCJja2FuZXh0LWZpbGVzL3NjcmlwdHMvZmlsZXMtLXNoYXJlZC11cGxvYWRlci5qc1wiLFxuICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICApO1xuXG4gICAgICAgICAgICB0aGlzLndvcmtlci5wb3J0Lm9ubWVzc2FnZSA9IGNvbnNvbGUuZGVidWc7XG4gICAgICAgIH0sXG4gICAgfTtcbn0pO1xuXG5ja2FuLm1vZHVsZShcImZpbGVzLS1xdWV1ZVwiLCBmdW5jdGlvbiAoJCkge1xuICAgIHJldHVybiB7XG4gICAgICAgIG9wdGlvbnM6IHtcbiAgICAgICAgICAgIHN0b3JhZ2U6IFwiZGVmYXVsdFwiLFxuICAgICAgICAgICAgdXBsb2FkZXI6IFwiU3RhbmRhcmRcIixcbiAgICAgICAgfSxcblxuICAgICAgICBpbml0aWFsaXplKCkge1xuICAgICAgICAgICAgJC5wcm94eUFsbCh0aGlzLCAvX29uLyk7XG4gICAgICAgICAgICBja2FuLnB1YnN1Yi5zdWJzY3JpYmUoXG4gICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5hZGRGaWxlVG9RdWV1ZSxcbiAgICAgICAgICAgICAgICB0aGlzLl9vbkZpbGUsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgY2thbi5wdWJzdWIuc3Vic2NyaWJlKFxuICAgICAgICAgICAgICAgIGNrYW4uQ0tBTkVYVF9GSUxFUy50b3BpY3MucmVzdG9yZUZpbGVJblF1ZXVlLFxuICAgICAgICAgICAgICAgIHRoaXMuX29uRmlsZSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMudHBsID0gdGhpcy4kKFwiW2RhdGEtdXBsb2FkLXRlbXBsYXRlXVwiKVxuICAgICAgICAgICAgICAgIC5yZW1vdmUoKVxuICAgICAgICAgICAgICAgIC5yZW1vdmVBdHRyKFwiZGF0YS11cGxvYWQtdGVtcGxhdGUgaGlkZGVuXCIpO1xuXG4gICAgICAgICAgICB0aGlzLndpZGdldHMgPSBuZXcgV2Vha01hcCgpO1xuICAgICAgICB9LFxuXG4gICAgICAgIHRlYXJkb3duKCkge1xuICAgICAgICAgICAgY2thbi5wdWJzdWIudW5zdWJzY3JpYmUoXG4gICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5hZGRGaWxlVG9RdWV1ZSxcbiAgICAgICAgICAgICAgICB0aGlzLl9vbkZpbGUsXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgY2thbi5wdWJzdWIudW5zdWJzY3JpYmUoXG4gICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5yZXN0b3JlRmlsZUluUXVldWUsXG4gICAgICAgICAgICAgICAgdGhpcy5fb25GaWxlLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfb25GaWxlKFxuICAgICAgICAgICAgZmlsZTogRmlsZSxcbiAgICAgICAgICAgIG9wdGlvbnMgPSB7XG4gICAgICAgICAgICAgICAgaW1tZWRpYXRlOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBpZDogXCJcIixcbiAgICAgICAgICAgICAgICB1cGxvYWRlZDogMCxcbiAgICAgICAgICAgICAgICB1cGxvYWRlckluc3RhbmNlOiBudWxsLFxuICAgICAgICAgICAgICAgIHVwbG9hZGVyOiBudWxsLFxuICAgICAgICAgICAgICAgIHN0b3JhZ2U6IG51bGwsXG4gICAgICAgICAgICB9LFxuICAgICAgICApIHtcbiAgICAgICAgICAgIGNvbnN0IHdpZGdldCA9IHRoaXMudHBsLmNsb25lKHRydWUpLmFwcGVuZFRvKHRoaXMuZWwpO1xuICAgICAgICAgICAgY29uc3QgaW5mbyA9IHtcbiAgICAgICAgICAgICAgICBmaWxlLFxuICAgICAgICAgICAgICAgIGlkOiBvcHRpb25zLmlkLFxuICAgICAgICAgICAgICAgIHVwbG9hZGVkOiBvcHRpb25zLnVwbG9hZGVkIHx8IDAsXG4gICAgICAgICAgICAgICAgdXBsb2FkZXI6XG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMudXBsb2FkZXJJbnN0YW5jZSB8fFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3guZmlsZXMubWFrZVVwbG9hZGVyKFxuICAgICAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy51cGxvYWRlciB8fCB0aGlzLm9wdGlvbnMudXBsb2FkZXIsXG4gICAgICAgICAgICAgICAgICAgICAgICB7IHN0b3JhZ2U6IG9wdGlvbnMuc3RvcmFnZSB8fCB0aGlzLm9wdGlvbnMuc3RvcmFnZSB9LFxuICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgfTtcblxuICAgICAgICAgICAgdGhpcy53aWRnZXRzLnNldCh3aWRnZXRbMF0sIGluZm8pO1xuXG4gICAgICAgICAgICB3aWRnZXQub24oXCJjbGlja1wiLCBcIltkYXRhLXVwbG9hZC1yZXN1bWVdXCIsIHRoaXMuX29uV2lkZ2V0UmVzdW1lKTtcbiAgICAgICAgICAgIHdpZGdldC5vbihcImNsaWNrXCIsIFwiW2RhdGEtdXBsb2FkLXBhdXNlXVwiLCB0aGlzLl9vbldpZGdldFBhdXNlKTtcblxuICAgICAgICAgICAgaW5mby51cGxvYWRlci5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgIFwiY29tbWl0XCIsXG4gICAgICAgICAgICAgICAgKGV2ZW50OiBDdXN0b21FdmVudCkgPT4gKGluZm8uaWQgPSBldmVudC5kZXRhaWwuaWQpLFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGluZm8udXBsb2FkZXIuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICBcImZhaWxcIixcbiAgICAgICAgICAgICAgICAoe1xuICAgICAgICAgICAgICAgICAgICBkZXRhaWw6IHsgcmVhc29ucywgZmlsZSB9LFxuICAgICAgICAgICAgICAgIH06IEN1c3RvbUV2ZW50PHtcbiAgICAgICAgICAgICAgICAgICAgcmVhc29uczogeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9O1xuICAgICAgICAgICAgICAgICAgICBmaWxlOiBGaWxlO1xuICAgICAgICAgICAgICAgIH0+KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkoXG4gICAgICAgICAgICAgICAgICAgICAgICBmaWxlLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuZW50cmllcyhyZWFzb25zKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5maWx0ZXIoKFtrLCB2XSkgPT4ga1swXSAhPT0gXCJfXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLm1hcCgoW2ssIHZdKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBBcnJheS5pc0FycmF5KHYpID8gdi5qb2luKFwiOyBcIikgOiB2LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuam9pbihcIjsgXCIpLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5LmVsWzBdLnNjcm9sbEludG9WaWV3KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgd2lkZ2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcyhcImJnLXByaW1hcnkgYmctc2Vjb25kYXJ5XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJiZy1kYW5nZXIgcHJvZ3Jlc3MtYmFyLWRhbmdlclwiKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKTtcbiAgICAgICAgICAgIGluZm8udXBsb2FkZXIuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICBcImVycm9yXCIsXG4gICAgICAgICAgICAgICAgKHtcbiAgICAgICAgICAgICAgICAgICAgZGV0YWlsOiB7IG1lc3NhZ2UsIGZpbGUgfSxcbiAgICAgICAgICAgICAgICB9OiBDdXN0b21FdmVudDx7IG1lc3NhZ2U6IHN0cmluZzsgZmlsZTogRmlsZSB9PikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KGZpbGUubmFtZSwgbWVzc2FnZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkuZWxbMF0uc2Nyb2xsSW50b1ZpZXcoKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnRvZ2dsZUFuaW1hdGlvbih3aWRnZXQsIGZhbHNlKTtcbiAgICAgICAgICAgICAgICAgICAgd2lkZ2V0XG4gICAgICAgICAgICAgICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcyhcImJnLXByaW1hcnkgYmctc2Vjb25kYXJ5XCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAuYWRkQ2xhc3MoXCJiZy1kYW5nZXIgcHJvZ3Jlc3MtYmFyLWRhbmdlclwiKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgaW5mby51cGxvYWRlci5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgIFwicHJvZ3Jlc3NcIixcbiAgICAgICAgICAgICAgICAoeyBkZXRhaWw6IHsgbG9hZGVkLCB0b3RhbCB9IH06IEN1c3RvbUV2ZW50KSA9PlxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldFdpZGdldENvbXBsZXRpb24od2lkZ2V0LCBsb2FkZWQsIHRvdGFsKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBpbmZvLnVwbG9hZGVyLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgXCJmaW5pc2hcIixcbiAgICAgICAgICAgICAgICAoeyBkZXRhaWw6IHsgZmlsZSwgcmVzdWx0IH0gfTogQ3VzdG9tRXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5IGJnLXNlY29uZGFyeVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctc3VjY2VzcyBwcm9ncmVzcy1iYXItc3VjY2Vzc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LnB1Ymxpc2goXG4gICAgICAgICAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLnF1ZXVlSXRlbVVwbG9hZGVkLFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZSxcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgdGhpcy5zZXRXaWRnZXROYW1lKHdpZGdldCwgaW5mby5maWxlLm5hbWUpO1xuICAgICAgICAgICAgdGhpcy5zZXRXaWRnZXRDb21wbGV0aW9uKHdpZGdldCwgaW5mby51cGxvYWRlZCwgaW5mby5maWxlLnNpemUpO1xuXG4gICAgICAgICAgICBpZiAob3B0aW9ucy5pbW1lZGlhdGUpIHtcbiAgICAgICAgICAgICAgICB3aWRnZXQuZmluZChcIltkYXRhLXVwbG9hZC1yZXN1bWVdXCIpLnRyaWdnZXIoXCJjbGlja1wiKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcblxuICAgICAgICBzZXRXaWRnZXROYW1lKHdpZGdldDogSlF1ZXJ5LCBuYW1lOiBzdHJpbmcpIHtcbiAgICAgICAgICAgIHdpZGdldC5maW5kKFwiW2RhdGEtaXRlbS1uYW1lXVwiKS50ZXh0KG5hbWUpO1xuICAgICAgICB9LFxuXG4gICAgICAgIHNldFdpZGdldENvbXBsZXRpb24od2lkZ2V0OiBKUXVlcnksIHVwbG9hZGVkOiBudW1iZXIsIHRvdGFsOiBudW1iZXIpIHtcbiAgICAgICAgICAgIGNvbnN0IHZhbHVlID0gKHVwbG9hZGVkICogMTAwKSAvIHRvdGFsO1xuICAgICAgICAgICAgY29uc3QgaW5mbyA9IHRoaXMud2lkZ2V0cy5nZXQod2lkZ2V0WzBdKTtcbiAgICAgICAgICAgIGluZm8udXBsb2FkZWQgPSB1cGxvYWRlZDtcblxuICAgICAgICAgICAgY29uc3QgY29tcGxldGlvbiA9IHZhbHVlLnRvRml4ZWQoMCkgKyBcIiVcIjtcbiAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgIC5maW5kKFwiW2RhdGEtdXBsb2FkLXByb2dyZXNzXVwiKVxuICAgICAgICAgICAgICAgIC50ZXh0KGNvbXBsZXRpb24pXG4gICAgICAgICAgICAgICAgLmNzcyhcIndpZHRoXCIsIGNvbXBsZXRpb24pO1xuICAgICAgICB9LFxuXG4gICAgICAgIHRvZ2dsZUFuaW1hdGlvbih3aWRnZXQ6IEpRdWVyeSwgc3RhdGU6IGJvb2xlYW4pIHtcbiAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgIC5maW5kKFwiW2RhdGEtdXBsb2FkLXByb2dyZXNzXVwiKVxuICAgICAgICAgICAgICAgIC50b2dnbGVDbGFzcyhcInByb2dyZXNzLWJhci1hbmltYXRlZCBhY3RpdmVcIiwgc3RhdGUpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9vbldpZGdldFJlc3VtZShldmVudDogSlF1ZXJ5LlRyaWdnZXJlZEV2ZW50KSB7XG4gICAgICAgICAgICBjb25zdCBpbmZvID0gdGhpcy53aWRnZXRzLmdldChldmVudC5kZWxlZ2F0ZVRhcmdldCk7XG4gICAgICAgICAgICBpZiAoaW5mby51cGxvYWRlZCA+PSBpbmZvLnRvdGFsKSByZXR1cm47XG5cbiAgICAgICAgICAgIGNvbnN0IHdpZGdldCA9ICQoZXZlbnQuZGVsZWdhdGVUYXJnZXQpO1xuICAgICAgICAgICAgd2lkZ2V0XG4gICAgICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKFwiYmctc2Vjb25kYXJ5XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctcHJpbWFyeVwiKTtcblxuICAgICAgICAgICAgaWYgKGluZm8uaWQpIHtcbiAgICAgICAgICAgICAgICBpbmZvLnVwbG9hZGVyLnJlc3VtZShpbmZvLmZpbGUsIGluZm8uaWQpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBpbmZvLnVwbG9hZGVyLnVwbG9hZChpbmZvLmZpbGUpO1xuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICB0aGlzLnRvZ2dsZUFuaW1hdGlvbih3aWRnZXQsIHRydWUpO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9vbldpZGdldFBhdXNlKGV2ZW50OiBKUXVlcnkuVHJpZ2dlcmVkRXZlbnQpIHtcbiAgICAgICAgICAgIGNvbnN0IGluZm8gPSB0aGlzLndpZGdldHMuZ2V0KGV2ZW50LmRlbGVnYXRlVGFyZ2V0KTtcbiAgICAgICAgICAgIGlmIChpbmZvLnVwbG9hZGVkID49IGluZm8udG90YWwpIHJldHVybjtcblxuICAgICAgICAgICAgY29uc3Qgd2lkZ2V0ID0gJChldmVudC5kZWxlZ2F0ZVRhcmdldCk7XG4gICAgICAgICAgICB3aWRnZXRcbiAgICAgICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5XCIpXG4gICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctc2Vjb25kYXJ5XCIpO1xuXG4gICAgICAgICAgICBpbmZvLnVwbG9hZGVyLnBhdXNlKGluZm8uZmlsZSk7XG4gICAgICAgICAgICB0aGlzLnRvZ2dsZUFuaW1hdGlvbih3aWRnZXQsIGZhbHNlKTtcbiAgICAgICAgfSxcbiAgICB9O1xufSk7XG4iXX0= \ No newline at end of file +//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmlsZXMtLW1vZH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gpIHtcbiAgICAgICAgICAgIGlmICghdGhpcy5vcHRpb25zLnNlbGVjdCkge1xuICAgICAgICAgICAgICAgIGNvbnNvbGUuZXJyb3IoXG4gICAgICAgICAgICAgICAgICAgIFwiZmlsZXMtLXJlc291cmNlLXNlbGVjdCBjYW5ub3QgYmUgaW5pdGlhbGl6ZWQgd2l0aG91dCBgc2VsZWN0YCBvcHRpb25cIixcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJC5wcm94eUFsbCh0aGlzLCAvX29uLyk7XG4gICAgICAgICAgICB0aGlzLmVsLm9uKHtcbiAgICAgICAgICAgICAgICBbdGhpcy5vcHRpb25zLnN1Y2Nlc3NFdmVudF06IHRoaXMuX29uU3VjY2VzcyxcbiAgICAgICAgICAgICAgICBbdGhpcy5vcHRpb25zLmVycm9yRXZlbnRdOiB0aGlzLl9vbkVycm9yLFxuICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgIHRoaXMudXJsID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoXCJmaWVsZC1yZXNvdXJjZS11cmxcIik7XG4gICAgICAgICAgICB0aGlzLnNlbGVjdCA9ICQodGhpcy5vcHRpb25zLnNlbGVjdCk7XG4gICAgICAgICAgICBpZiAodGhpcy5vcHRpb25zLmluaXRpYWxWYWx1ZSkge1xuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0LnNlbGVjdDIoXCJkYXRhXCIsIHRoaXMub3B0aW9ucy5pbml0aWFsVmFsdWUpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBfb25TdWNjZXNzKHsgZGV0YWlsIH06IHsgZGV0YWlsOiBhbnkgfSkge1xuICAgICAgICAgICAgdGhpcy5zZWxlY3Quc2VsZWN0MihcImRhdGFcIiwgeyBpZDogZGV0YWlsLmlkLCB0ZXh0OiBkZXRhaWwubmFtZSB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgX29uRXJyb3Ioe1xuICAgICAgICAgICAgZGV0YWlsOiBlcnIsXG4gICAgICAgIH06IHtcbiAgICAgICAgICAgIGRldGFpbDogc3RyaW5nIHwgeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9O1xuICAgICAgICB9KSB7XG4gICAgICAgICAgICBpZiAodHlwZW9mIGVyciA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgIHRoaXMucmVwb3J0RXJyb3IoXCJFcnJvclwiLCBlcnIpO1xuICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICBmb3IgKGxldCBbZmllbGQsIHByb2JsZW1zXSBvZiBPYmplY3QuZW50cmllcyhcbiAgICAgICAgICAgICAgICAgICAgZXJyIGFzIHsgW2tleTogc3RyaW5nXTogc3RyaW5nW10gfSxcbiAgICAgICAgICAgICAgICApKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmIChmaWVsZC5zdGFydHNXaXRoKFwiX19cIikpIGNvbnRpbnVlO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlcG9ydEVycm9yKGZpZWxkLCBwcm9ibGVtcy5qb2luKFwiLFwiKSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICByZXBvcnRFcnJvcihsYWJlbDogc3RyaW5nLCBtZXNzYWdlOiBzdHJpbmcpIHtcbiAgICAgICAgICAgIGNvbnN0IGJveCA9IHRoaXMuc2FuZGJveC5ub3RpZnkuaW5pdGlhbGl6ZShcbiAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5LmNyZWF0ZShsYWJlbCwgbWVzc2FnZSksXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgdGhpcy5lbC5jbG9zZXN0KFwibGFiZWxcIikucGFyZW50KCkuYWZ0ZXIoYm94KTtcbiAgICAgICAgfSxcbiAgICB9O1xufSk7XG4vKipcbiAqIFVwbG9hZCBmaWxlIGFuZCB0cmlnZ2VyIGV2ZW50IHdpdGggZmlsZSBkYXRhIG9uIHNwZWNpZmllZCBlbGVtZW50LlxuICpcbiAqL1xuY2thbi5tb2R1bGUoXCJmaWxlcy0tYXV0by11cGxvYWRcIiwgZnVuY3Rpb24gKCQpIHtcbiAgICByZXR1cm4ge1xuICAgICAgICBvcHRpb25zOiB7XG4gICAgICAgICAgICBzcGlubmVyOiBudWxsLFxuICAgICAgICAgICAgYWN0aW9uOiBudWxsLFxuICAgICAgICAgICAgc3VjY2Vzc0V2ZW50OiBcImZpbGVzLWZpbGUtY3JlYXRlZFwiLFxuICAgICAgICAgICAgZXJyb3JFdmVudDogXCJmaWxlcy1maWxlLWZhaWxlZFwiLFxuICAgICAgICAgICAgZXZlbnRUYXJnZXQ6IG51bGwsXG4gICAgICAgICAgICBjb3B5SWRJbnRvOiBudWxsLFxuICAgICAgICB9LFxuICAgICAgICBxdWV1ZTogbnVsbCxcblxuICAgICAgICBpbml0aWFsaXplKCkge1xuICAgICAgICAgICAgaWYgKCF0aGlzLm9wdGlvbnMuYWN0aW9uKSB7XG4gICAgICAgICAgICAgICAgY29uc29sZS5lcnJvcihcbiAgICAgICAgICAgICAgICAgICAgXCJmaWxlcy0tYXV0by11cGxvYWQgY2Fubm90IGJlIGluaXRpYWxpemVkIHdpdGhvdXQgYGFjdGlvbmAgb3B0aW9uXCIsXG4gICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAkLnByb3h5QWxsKHRoaXMsIC9fb24vKTtcblxuICAgICAgICAgICAgdGhpcy5xdWV1ZSA9IG5ldyBTZXQoKTtcblxuICAgICAgICAgICAgdGhpcy5lbC5vbihcImNoYW5nZVwiLCAoZXZlbnQ6IEV2ZW50KSA9PlxuICAgICAgICAgICAgICAgIHRoaXMudXBsb2FkKC4uLihldmVudC50YXJnZXQgYXMgSFRNTElucHV0RWxlbWVudCkuZmlsZXMhKSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICB0aGlzLnNwaW5uZXIgPSAkKHRoaXMub3B0aW9ucy5zcGlubmVyKTtcbiAgICAgICAgICAgIHRoaXMuZmllbGQgPSAkKHRoaXMub3B0aW9ucy5maWVsZCk7XG4gICAgICAgICAgICB0aGlzLnN1Ym1pdHMgPSB0aGlzLmVsXG4gICAgICAgICAgICAgICAgLmNsb3Nlc3QoXCJmb3JtXCIpXG4gICAgICAgICAgICAgICAgLmZpbmQoXCJpbnB1dFt0eXBlPXN1Ym1pdF0sYnV0dG9uW3R5cGU9c3VibWl0XVwiKTtcbiAgICAgICAgICAgIHRoaXMuaWRUYXJnZXQgPSAkKHRoaXMub3B0aW9ucy5jb3B5SWRJbnRvKTtcbiAgICAgICAgfSxcblxuICAgICAgICB1cGxvYWQoLi4uZmlsZXM6IEZpbGVbXSkge1xuICAgICAgICAgICAgZmlsZXMuZm9yRWFjaChhc3luYyAoZmlsZSkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMucXVldWUuYWRkKGZpbGUpO1xuICAgICAgICAgICAgICAgIHRoaXMucmVmcmVzaEZvcm1TdGF0ZSgpO1xuICAgICAgICAgICAgICAgIGNvbnN0IG9wdGlvbnM6IGNrYW4uQ0tBTkVYVF9GSUxFUy5VcGxvYWRPcHRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICB1cGxvYWRlckFyZ3M6IFt7IHVwbG9hZEFjdGlvbjogdGhpcy5vcHRpb25zLmFjdGlvbiB9XSxcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmZpbGVzXG4gICAgICAgICAgICAgICAgICAgIC51cGxvYWQoZmlsZSwgb3B0aW9ucylcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4oXG4gICAgICAgICAgICAgICAgICAgICAgICAocmVzdWx0OiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmlkVGFyZ2V0LnZhbChyZXN1bHQuaWQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hSZXN1bHQoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMub3B0aW9ucy5zdWNjZXNzRXZlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3VsdCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIChlcnI6IGFueSkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoUmVzdWx0KHRoaXMub3B0aW9ucy5lcnJvckV2ZW50LCBlcnIpLFxuICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKCgpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMucXVldWUuZGVsZXRlKGZpbGUpO1xuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5yZWZyZXNoRm9ybVN0YXRlKCk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgZGlzcGF0Y2hSZXN1bHQoZXZlbnQ6IHN0cmluZywgZGV0YWlsOiBhbnkpIHtcbiAgICAgICAgICAgIGNvbnN0IHRhcmdldCA9IHRoaXMub3B0aW9ucy5ldmVudFRhcmdldFxuICAgICAgICAgICAgICAgID8gJCh0aGlzLm9wdGlvbnMuZXZlbnRUYXJnZXQpXG4gICAgICAgICAgICAgICAgOiB0aGlzLmVsO1xuICAgICAgICAgICAgdGFyZ2V0WzBdLmRpc3BhdGNoRXZlbnQobmV3IEN1c3RvbUV2ZW50KGV2ZW50LCB7IGRldGFpbCB9KSk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgcmVmcmVzaEZvcm1TdGF0ZSgpIHtcbiAgICAgICAgICAgIHRoaXMuc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uICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgfSxcbiAgICAgICAgX29uRHJhZ0VudGVyKGV2ZW50OiBEcmFnRXZlbnQpIHt9LFxuICAgICAgICBfb25EcmFnTGVhdmUoZXZlbnQ6IERyYWdFdmVudCkge30sXG5cbiAgICAgICAgX29uRHJvcChldmVudDogRHJhZ0V2ZW50KSB7XG4gICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpO1xuICAgICAgICAgICAgaWYgKCFldmVudC5kYXRhVHJhbnNmZXIpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGZvciAobGV0IGVudHJ5IG9mIGV2ZW50LmRhdGFUcmFuc2Zlci5pdGVtcykge1xuICAgICAgICAgICAgICAgIHRoaXMuc2NhbkVudHJ5KGVudHJ5LndlYmtpdEdldEFzRW50cnkoKSwgKGZpbGU6IEZpbGUpID0+XG4gICAgICAgICAgICAgICAgICAgIHRoaXMucHVzaChmaWxlKSxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuXG4gICAgICAgIHNjYW5FbnRyeShcbiAgICAgICAgICAgIGVudHJ5OiBGaWxlU3lzdGVtRmlsZUVudHJ5IHwgRmlsZVN5c3RlbURpcmVjdG9yeUVudHJ5LFxuICAgICAgICAgICAgY2I6IChmaWxlOiBGaWxlKSA9PiB2b2lkLFxuICAgICAgICApIHtcbiAgICAgICAgICAgIGlmIChlbnRyeS5pc0ZpbGUpIHtcbiAgICAgICAgICAgICAgICAoZW50cnkgYXMgRmlsZVN5c3RlbUZpbGVFbnRyeSkuZmlsZShjYik7XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIChlbnRyeSBhcyBGaWxlU3lzdGVtRGlyZWN0b3J5RW50cnkpXG4gICAgICAgICAgICAgICAgICAgIC5jcmVhdGVSZWFkZXIoKVxuICAgICAgICAgICAgICAgICAgICAucmVhZEVudHJpZXMoKGVudHJpZXMpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICBlbnRyaWVzLmZvckVhY2goKGUpID0+IHRoaXMuc2NhbkVudHJ5KGUsIGNiKSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgcHVzaChmaWxlOiBGaWxlKSB7XG4gICAgICAgICAgICB0aGlzLnNhbmRib3gucHVibGlzaChcbiAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLmFkZEZpbGVUb1F1ZXVlLFxuICAgICAgICAgICAgICAgIGZpbGUsXG4gICAgICAgICAgICAgICAgeyBpbW1lZGlhdGU6IHRoaXMub3B0aW9ucy5pbW1lZGlhdGUgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG4gICAgfTtcbn0pO1xuXG4vKipcbiAqIEFkZCB0byBxdWV1ZSBhIGZpbGUsIHRoYXQgaGFzIGFzc29jaWF0ZWQgaW5jb21wbGV0ZSB1cGxvYWQuXG4gKlxuICogU3VwcG9ydHMgYSBudW1iZXIgb2YgcHJvcGVydGllcyB0byB2ZXJpZnkgdGhhdCB0aGUgbmV3IGZpbGUgbWF0Y2hlc1xuICogcHJldmlvdXNseSB1cGxvYWRlZCBmaWxlLlxuICpcbiAqXG4gKi9cbmNrYW4ubW9kdWxlKFwiZmlsZXMtLXJlc3RvcmVyXCIsIGZ1bmN0aW9uICgkKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgICAgbmFtZTogXCJcIixcbiAgICAgICAgICAgIHNpemU6IDAsXG4gICAgICAgICAgICB1cGxvYWRlZDogMCxcbiAgICAgICAgICAgIGlkOiBcIlwiLFxuICAgICAgICAgICAgaW1tZWRpYXRlOiBmYWxzZSxcbiAgICAgICAgfSxcblxuICAgICAgICBpbml0aWFsaXplKCkge1xuICAgICAgICAgICAgJC5wcm94eUFsbCh0aGlzLCAvX29uLyk7XG4gICAgICAgICAgICB0aGlzLmVsLm9uKFwiY2hhbmdlXCIsIHRoaXMuX29uQ2hhbmdlKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfb25DaGFuZ2UoZXZlbnQ6IEV2ZW50KSB7XG4gICAgICAgICAgICBjb25zdCBmaWxlID0gKGV2ZW50LnRhcmdldCBhcyBIVE1MSW5wdXRFbGVtZW50KS5maWxlcz8uWzBdO1xuXG4gICAgICAgICAgICBpZiAoIWZpbGUpIHtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGlmICh0aGlzLm9wdGlvbnMubmFtZSAmJiBmaWxlLm5hbWUgIT09IHRoaXMub3B0aW9ucy5uYW1lKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94Lm5vdGlmeShcbiAgICAgICAgICAgICAgICAgICAgXCJOYW1lIG1pc21hdGNoLlwiLFxuICAgICAgICAgICAgICAgICAgICBgRXhwZWN0ZWQgbmFtZTogJHt0aGlzLm9wdGlvbnMubmFtZX1gLFxuICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94Lm5vdGlmeS5lbFswXS5zY3JvbGxJbnRvVmlldygpO1xuICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgaWYgKHRoaXMub3B0aW9ucy5zaXplICYmIGZpbGUuc2l6ZSAhPT0gdGhpcy5vcHRpb25zLnNpemUpIHtcbiAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KFxuICAgICAgICAgICAgICAgICAgICBcIlNpemUgbWlzbWF0Y2guXCIsXG4gICAgICAgICAgICAgICAgICAgIGBFeHBlY3RlZCBzaXplOiAke3RoaXMub3B0aW9ucy5zaXplLnRvTG9jYWxlU3RyaW5nKCl9IGJ5dGVzYCxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5ub3RpZnkuZWxbMF0uc2Nyb2xsSW50b1ZpZXcoKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIHRoaXMuc2FuZGJveC5wdWJsaXNoKFxuICAgICAgICAgICAgICAgIGNrYW4uQ0tBTkVYVF9GSUxFUy50b3BpY3MucmVzdG9yZUZpbGVJblF1ZXVlLFxuICAgICAgICAgICAgICAgIGZpbGUsXG4gICAgICAgICAgICAgICAge1xuICAgICAgICAgICAgICAgICAgICBpZDogdGhpcy5vcHRpb25zLmlkLFxuICAgICAgICAgICAgICAgICAgICB1cGxvYWRlZDogdGhpcy5vcHRpb25zLnVwbG9hZGVkLFxuICAgICAgICAgICAgICAgICAgICBpbW1lZGlhdGU6IHRoaXMub3B0aW9ucy5pbW1lZGlhdGUsXG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgIH0sXG4gICAgfTtcbn0pO1xuXG5ja2FuLm1vZHVsZShcImZpbGVzLS1zaGFyZWQtcXVldWVcIiwgZnVuY3Rpb24gKCQpIHtcbiAgICByZXR1cm4ge1xuICAgICAgICBpbml0aWFsaXplKCkge1xuICAgICAgICAgICAgJC5wcm94eUFsbCh0aGlzLCAvX29uLyk7XG5cbiAgICAgICAgICAgIHRoaXMud29ya2VyID0gbmV3IFNoYXJlZFdvcmtlcihcbiAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gudXJsKFxuICAgICAgICAgICAgICAgICAgICBcImNrYW5leHQtZmlsZXMvc2NyaXB0cy9maWxlcy0tc2hhcmVkLXVwbG9hZGVyLmpzXCIsXG4gICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMud29ya2VyLnBvcnQub25tZXNzYWdlID0gY29uc29sZS5kZWJ1ZztcbiAgICAgICAgfSxcbiAgICB9O1xufSk7XG5cbmNrYW4ubW9kdWxlKFwiZmlsZXMtLXF1ZXVlXCIsIGZ1bmN0aW9uICgkKSB7XG4gICAgcmV0dXJuIHtcbiAgICAgICAgb3B0aW9uczoge1xuICAgICAgICAgICAgc3RvcmFnZTogXCJkZWZhdWx0XCIsXG4gICAgICAgICAgICB1cGxvYWRlcjogXCJTdGFuZGFyZFwiLFxuICAgICAgICB9LFxuXG4gICAgICAgIGluaXRpYWxpemUoKSB7XG4gICAgICAgICAgICAkLnByb3h5QWxsKHRoaXMsIC9fb24vKTtcbiAgICAgICAgICAgIGNrYW4ucHVic3ViLnN1YnNjcmliZShcbiAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLmFkZEZpbGVUb1F1ZXVlLFxuICAgICAgICAgICAgICAgIHRoaXMuX29uRmlsZSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBja2FuLnB1YnN1Yi5zdWJzY3JpYmUoXG4gICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5yZXN0b3JlRmlsZUluUXVldWUsXG4gICAgICAgICAgICAgICAgdGhpcy5fb25GaWxlLFxuICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgdGhpcy50cGwgPSB0aGlzLiQoXCJbZGF0YS11cGxvYWQtdGVtcGxhdGVdXCIpXG4gICAgICAgICAgICAgICAgLnJlbW92ZSgpXG4gICAgICAgICAgICAgICAgLnJlbW92ZUF0dHIoXCJkYXRhLXVwbG9hZC10ZW1wbGF0ZSBoaWRkZW5cIik7XG5cbiAgICAgICAgICAgIHRoaXMud2lkZ2V0cyA9IG5ldyBXZWFrTWFwKCk7XG4gICAgICAgIH0sXG5cbiAgICAgICAgdGVhcmRvd24oKSB7XG4gICAgICAgICAgICBja2FuLnB1YnN1Yi51bnN1YnNjcmliZShcbiAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLmFkZEZpbGVUb1F1ZXVlLFxuICAgICAgICAgICAgICAgIHRoaXMuX29uRmlsZSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBja2FuLnB1YnN1Yi51bnN1YnNjcmliZShcbiAgICAgICAgICAgICAgICBja2FuLkNLQU5FWFRfRklMRVMudG9waWNzLnJlc3RvcmVGaWxlSW5RdWV1ZSxcbiAgICAgICAgICAgICAgICB0aGlzLl9vbkZpbGUsXG4gICAgICAgICAgICApO1xuICAgICAgICB9LFxuXG4gICAgICAgIF9vbkZpbGUoXG4gICAgICAgICAgICBmaWxlOiBGaWxlLFxuICAgICAgICAgICAgb3B0aW9ucyA9IHtcbiAgICAgICAgICAgICAgICBpbW1lZGlhdGU6IGZhbHNlLFxuICAgICAgICAgICAgICAgIGlkOiBcIlwiLFxuICAgICAgICAgICAgICAgIHVwbG9hZGVkOiAwLFxuICAgICAgICAgICAgICAgIHVwbG9hZGVySW5zdGFuY2U6IG51bGwsXG4gICAgICAgICAgICAgICAgdXBsb2FkZXI6IG51bGwsXG4gICAgICAgICAgICAgICAgc3RvcmFnZTogbnVsbCxcbiAgICAgICAgICAgIH0sXG4gICAgICAgICkge1xuICAgICAgICAgICAgY29uc3Qgd2lkZ2V0ID0gdGhpcy50cGwuY2xvbmUodHJ1ZSkuYXBwZW5kVG8odGhpcy5lbCk7XG4gICAgICAgICAgICBjb25zdCBpbmZvID0ge1xuICAgICAgICAgICAgICAgIGZpbGUsXG4gICAgICAgICAgICAgICAgaWQ6IG9wdGlvbnMuaWQsXG4gICAgICAgICAgICAgICAgdXBsb2FkZWQ6IG9wdGlvbnMudXBsb2FkZWQgfHwgMCxcbiAgICAgICAgICAgICAgICB1cGxvYWRlcjpcbiAgICAgICAgICAgICAgICAgICAgb3B0aW9ucy51cGxvYWRlckluc3RhbmNlIHx8XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5maWxlcy5tYWtlVXBsb2FkZXIoXG4gICAgICAgICAgICAgICAgICAgICAgICBvcHRpb25zLnVwbG9hZGVyIHx8IHRoaXMub3B0aW9ucy51cGxvYWRlcixcbiAgICAgICAgICAgICAgICAgICAgICAgIHsgc3RvcmFnZTogb3B0aW9ucy5zdG9yYWdlIHx8IHRoaXMub3B0aW9ucy5zdG9yYWdlIH0sXG4gICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICB0aGlzLndpZGdldHMuc2V0KHdpZGdldFswXSwgaW5mbyk7XG5cbiAgICAgICAgICAgIHdpZGdldC5vbihcImNsaWNrXCIsIFwiW2RhdGEtdXBsb2FkLXJlc3VtZV1cIiwgdGhpcy5fb25XaWRnZXRSZXN1bWUpO1xuICAgICAgICAgICAgd2lkZ2V0Lm9uKFwiY2xpY2tcIiwgXCJbZGF0YS11cGxvYWQtcGF1c2VdXCIsIHRoaXMuX29uV2lkZ2V0UGF1c2UpO1xuXG4gICAgICAgICAgICBpbmZvLnVwbG9hZGVyLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgXCJmYWlsXCIsXG4gICAgICAgICAgICAgICAgKHtcbiAgICAgICAgICAgICAgICAgICAgZGV0YWlsOiB7IHJlYXNvbnMsIGZpbGUgfSxcbiAgICAgICAgICAgICAgICB9OiBDdXN0b21FdmVudDx7XG4gICAgICAgICAgICAgICAgICAgIHJlYXNvbnM6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nW10gfTtcbiAgICAgICAgICAgICAgICAgICAgZmlsZTogRmlsZTtcbiAgICAgICAgICAgICAgICB9PikgPT4ge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5KFxuICAgICAgICAgICAgICAgICAgICAgICAgZmlsZS5uYW1lLFxuICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmVudHJpZXMocmVhc29ucylcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAuZmlsdGVyKChbaywgdl0pID0+IGtbMF0gIT09IFwiX1wiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5tYXAoKFtrLCB2XSkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQXJyYXkuaXNBcnJheSh2KSA/IHYuam9pbihcIjsgXCIpIDogdixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLmpvaW4oXCI7IFwiKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94Lm5vdGlmeS5lbFswXS5zY3JvbGxJbnRvVmlldygpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlQW5pbWF0aW9uKHdpZGdldCwgZmFsc2UpO1xuXG4gICAgICAgICAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5IGJnLXNlY29uZGFyeVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctZGFuZ2VyIHByb2dyZXNzLWJhci1kYW5nZXJcIik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG4gICAgICAgICAgICBpbmZvLnVwbG9hZGVyLmFkZEV2ZW50TGlzdGVuZXIoXG4gICAgICAgICAgICAgICAgXCJlcnJvclwiLFxuICAgICAgICAgICAgICAgICh7XG4gICAgICAgICAgICAgICAgICAgIGRldGFpbDogeyBtZXNzYWdlLCBmaWxlIH0sXG4gICAgICAgICAgICAgICAgfTogQ3VzdG9tRXZlbnQ8eyBtZXNzYWdlOiBzdHJpbmc7IGZpbGU6IEZpbGUgfT4pID0+IHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94Lm5vdGlmeShmaWxlLm5hbWUsIG1lc3NhZ2UpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3gubm90aWZ5LmVsWzBdLnNjcm9sbEludG9WaWV3KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG4gICAgICAgICAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAgICAgICAgICAgICAucmVtb3ZlQ2xhc3MoXCJiZy1wcmltYXJ5IGJnLXNlY29uZGFyeVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgLmFkZENsYXNzKFwiYmctZGFuZ2VyIHByb2dyZXNzLWJhci1kYW5nZXJcIik7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIGluZm8udXBsb2FkZXIuYWRkRXZlbnRMaXN0ZW5lcihcbiAgICAgICAgICAgICAgICBcInByb2dyZXNzXCIsXG4gICAgICAgICAgICAgICAgKHsgZGV0YWlsOiB7IGxvYWRlZCwgdG90YWwgfSB9OiBDdXN0b21FdmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXRXaWRnZXRDb21wbGV0aW9uKHdpZGdldCwgbG9hZGVkLCB0b3RhbCksXG4gICAgICAgICAgICApO1xuICAgICAgICAgICAgaW5mby51cGxvYWRlci5hZGRFdmVudExpc3RlbmVyKFxuICAgICAgICAgICAgICAgIFwiZmluaXNoXCIsXG4gICAgICAgICAgICAgICAgKHsgZGV0YWlsOiB7IGZpbGUsIHJlc3VsdCB9IH06IEN1c3RvbUV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMudG9nZ2xlQW5pbWF0aW9uKHdpZGdldCwgZmFsc2UpO1xuICAgICAgICAgICAgICAgICAgICB3aWRnZXRcbiAgICAgICAgICAgICAgICAgICAgICAgIC5maW5kKFwiW2RhdGEtdXBsb2FkLXByb2dyZXNzXVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKFwiYmctcHJpbWFyeSBiZy1zZWNvbmRhcnlcIilcbiAgICAgICAgICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImJnLXN1Y2Nlc3MgcHJvZ3Jlc3MtYmFyLXN1Y2Nlc3NcIik7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5wdWJsaXNoKFxuICAgICAgICAgICAgICAgICAgICAgICAgY2thbi5DS0FORVhUX0ZJTEVTLnRvcGljcy5xdWV1ZUl0ZW1VcGxvYWRlZCxcbiAgICAgICAgICAgICAgICAgICAgICAgIGZpbGUsXG4gICAgICAgICAgICAgICAgICAgICAgICByZXN1bHQsXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgIHRoaXMuc2V0V2lkZ2V0TmFtZSh3aWRnZXQsIGluZm8uZmlsZS5uYW1lKTtcbiAgICAgICAgICAgIHRoaXMuc2V0V2lkZ2V0Q29tcGxldGlvbih3aWRnZXQsIGluZm8udXBsb2FkZWQsIGluZm8uZmlsZS5zaXplKTtcblxuICAgICAgICAgICAgaWYgKG9wdGlvbnMuaW1tZWRpYXRlKSB7XG4gICAgICAgICAgICAgICAgd2lkZ2V0LmZpbmQoXCJbZGF0YS11cGxvYWQtcmVzdW1lXVwiKS50cmlnZ2VyKFwiY2xpY2tcIik7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG5cbiAgICAgICAgc2V0V2lkZ2V0TmFtZSh3aWRnZXQ6IEpRdWVyeSwgbmFtZTogc3RyaW5nKSB7XG4gICAgICAgICAgICB3aWRnZXQuZmluZChcIltkYXRhLWl0ZW0tbmFtZV1cIikudGV4dChuYW1lKTtcbiAgICAgICAgfSxcblxuICAgICAgICBzZXRXaWRnZXRDb21wbGV0aW9uKHdpZGdldDogSlF1ZXJ5LCB1cGxvYWRlZDogbnVtYmVyLCB0b3RhbDogbnVtYmVyKSB7XG4gICAgICAgICAgICBjb25zdCB2YWx1ZSA9ICh1cGxvYWRlZCAqIDEwMCkgLyB0b3RhbDtcbiAgICAgICAgICAgIGNvbnN0IGluZm8gPSB0aGlzLndpZGdldHMuZ2V0KHdpZGdldFswXSk7XG4gICAgICAgICAgICBpbmZvLnVwbG9hZGVkID0gdXBsb2FkZWQ7XG5cbiAgICAgICAgICAgIGNvbnN0IGNvbXBsZXRpb24gPSB2YWx1ZS50b0ZpeGVkKDApICsgXCIlXCI7XG4gICAgICAgICAgICB3aWRnZXRcbiAgICAgICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgICAgICAudGV4dChjb21wbGV0aW9uKVxuICAgICAgICAgICAgICAgIC5jc3MoXCJ3aWR0aFwiLCBjb21wbGV0aW9uKTtcbiAgICAgICAgfSxcblxuICAgICAgICB0b2dnbGVBbmltYXRpb24od2lkZ2V0OiBKUXVlcnksIHN0YXRlOiBib29sZWFuKSB7XG4gICAgICAgICAgICB3aWRnZXRcbiAgICAgICAgICAgICAgICAuZmluZChcIltkYXRhLXVwbG9hZC1wcm9ncmVzc11cIilcbiAgICAgICAgICAgICAgICAudG9nZ2xlQ2xhc3MoXCJwcm9ncmVzcy1iYXItYW5pbWF0ZWQgYWN0aXZlXCIsIHN0YXRlKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfb25XaWRnZXRSZXN1bWUoZXZlbnQ6IEpRdWVyeS5UcmlnZ2VyZWRFdmVudCkge1xuICAgICAgICAgICAgY29uc3QgaW5mbyA9IHRoaXMud2lkZ2V0cy5nZXQoZXZlbnQuZGVsZWdhdGVUYXJnZXQpO1xuICAgICAgICAgICAgaWYgKGluZm8udXBsb2FkZWQgPj0gaW5mby50b3RhbCkgcmV0dXJuO1xuXG4gICAgICAgICAgICBjb25zdCB3aWRnZXQgPSAkKGV2ZW50LmRlbGVnYXRlVGFyZ2V0KTtcbiAgICAgICAgICAgIHdpZGdldFxuICAgICAgICAgICAgICAgIC5maW5kKFwiW2RhdGEtdXBsb2FkLXByb2dyZXNzXVwiKVxuICAgICAgICAgICAgICAgIC5yZW1vdmVDbGFzcyhcImJnLXNlY29uZGFyeVwiKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImJnLXByaW1hcnlcIik7XG5cbiAgICAgICAgICAgIGlmIChpbmZvLmlkKSB7XG4gICAgICAgICAgICAgICAgaW5mby51cGxvYWRlci5yZXN1bWUoaW5mby5maWxlLCBpbmZvLmlkKTtcbiAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgaW5mby51cGxvYWRlci51cGxvYWQoaW5mby5maWxlKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCB0cnVlKTtcbiAgICAgICAgfSxcblxuICAgICAgICBfb25XaWRnZXRQYXVzZShldmVudDogSlF1ZXJ5LlRyaWdnZXJlZEV2ZW50KSB7XG4gICAgICAgICAgICBjb25zdCBpbmZvID0gdGhpcy53aWRnZXRzLmdldChldmVudC5kZWxlZ2F0ZVRhcmdldCk7XG4gICAgICAgICAgICBpZiAoaW5mby51cGxvYWRlZCA+PSBpbmZvLnRvdGFsKSByZXR1cm47XG5cbiAgICAgICAgICAgIGNvbnN0IHdpZGdldCA9ICQoZXZlbnQuZGVsZWdhdGVUYXJnZXQpO1xuICAgICAgICAgICAgd2lkZ2V0XG4gICAgICAgICAgICAgICAgLmZpbmQoXCJbZGF0YS11cGxvYWQtcHJvZ3Jlc3NdXCIpXG4gICAgICAgICAgICAgICAgLnJlbW92ZUNsYXNzKFwiYmctcHJpbWFyeVwiKVxuICAgICAgICAgICAgICAgIC5hZGRDbGFzcyhcImJnLXNlY29uZGFyeVwiKTtcblxuICAgICAgICAgICAgaW5mby51cGxvYWRlci5wYXVzZShpbmZvLmZpbGUpO1xuICAgICAgICAgICAgdGhpcy50b2dnbGVBbmltYXRpb24od2lkZ2V0LCBmYWxzZSk7XG4gICAgICAgIH0sXG4gICAgfTtcbn0pO1xuIl19 \ No newline at end of file diff --git a/ckanext/files/assets/scripts/files--shared.js b/ckanext/files/assets/scripts/files--shared.js index 7b7d43a..a445ce2 100644 --- a/ckanext/files/assets/scripts/files--shared.js +++ b/ckanext/files/assets/scripts/files--shared.js @@ -10,9 +10,9 @@ var ckan; CKANEXT_FILES.defaultSettings = { storage: "default", }; - function upload(file, options) { + function upload(file, options = {}) { const uploader = options.uploader || - makeUploader(options.adapter || "Standard", ...(options.uploaderParams || [])); + makeUploader(options.adapter || "Standard", ...(options.uploaderArgs || [])); return uploader.upload(file, options.requestParams || {}); } function makeUploader(adapter, ...options) { @@ -51,9 +51,6 @@ var ckan; dispatchStart(file) { this.dispatchEvent(new CustomEvent("start", { detail: { file } })); } - dispatchCommit(file, id) { - this.dispatchEvent(new CustomEvent("commit", { detail: { file, id } })); - } dispatchProgress(file, loaded, total) { this.dispatchEvent(new CustomEvent("progress", { detail: { file, loaded, total }, @@ -90,7 +87,6 @@ var ckan; fail(result); } else if (result.success) { - this.dispatchCommit(file, result.result.id); this.dispatchFinish(file, result.result); done(result.result); } @@ -141,7 +137,7 @@ var ckan; this._active.add(file); let info; try { - info = await this._initializeUpload(file); + info = await this._initializeUpload(file, params); } catch (err) { if (typeof err === "string") { @@ -152,7 +148,6 @@ var ckan; } return; } - this.dispatchCommit(file, info.id); this.dispatchStart(file); this._doUpload(file, info); } @@ -199,13 +194,13 @@ var ckan; } this.dispatchFinish(file, info); } - _initializeUpload(file) { + _initializeUpload(file, params) { return new Promise((done, fail) => this.sandbox.client.call("POST", this.initializeAction, Object.assign({}, { storage: this.settings.storage, name: file.name, size: file.size, content_type: file.type, - }, this.settings.initializePayload || {}), (data) => { + }, params), (data) => { done(data.result); }, (resp) => { fail(typeof resp.responseJSON === "string" @@ -270,4 +265,4 @@ var ckan; })(adapters = CKANEXT_FILES.adapters || (CKANEXT_FILES.adapters = {})); })(CKANEXT_F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N0cmluZztcbiAgICAgICAgICAgIFtrZXk6IHN0cmluZ106IGFueTtcbiAgICAgICAgfTtcblxuICAgICAgICBleHBvcnQgaW50ZXJmYWNlIFVwbG9hZE9wdGlvbnMge1xuICAgICAgICAgICAgdXBsb2FkZXI/OiBhZGFwdGVycy5CYXNlO1xuICAgICAgICAgICAgYWRhcHRlcj86IHN0cmluZztcbiAgICAgICAgICAgIHVwbG9hZGVyUGFyYW1zPzogYW55W107XG4gICAgICAgICAgICByZXF1ZXN0UGFyYW1zPzogeyBba2V5OiBzdHJpbmddOiBhbnkgfTtcbiAgICAgICAgfVxuXG4gICAgICAgIGV4cG9ydCBjb25zdCB0b3BpY3MgPSB7XG4gICAgICAgICAgICBhZGRGaWxlVG9RdWV1ZTogXCJja2FuZXh0OmZpbGVzOnF1ZXVlOmZpbGU6YWRkXCIsXG4gICAgICAgICAgICByZXN0b3JlRmlsZUluUXVldWU6IFwiY2thbmV4dDpmaWxlczpxdWV1ZTpmaWxlOnJlc3RvcmVcIixcbiAgICAgICAgICAgIHF1ZXVlSXRlbVVwbG9hZGVkOiBcImNrYW5leHQ6ZmlsZXM6cXVldWU6ZmlsZTp1cGxvYWRlZFwiLFxuICAgICAgICB9O1xuXG4gICAgICAgIGV4cG9ydCBjb25zdCBkZWZhdWx0U2V0dGluZ3MgPSB7XG4gICAgICAgICAgICBzdG9yYWdlOiBcImRlZmF1bHRcIixcbiAgICAgICAgfTtcblxuICAgICAgICBmdW5jdGlvbiB1cGxvYWQoZmlsZTogRmlsZSwgb3B0aW9uczogVXBsb2FkT3B0aW9ucykge1xuICAgICAgICAgICAgY29uc3QgdXBsb2FkZXIgPVxuICAgICAgICAgICAgICAgIG9wdGlvbnMudXBsb2FkZXIgfHxcbiAgICAgICAgICAgICAgICBtYWtlVXBsb2FkZXIoXG4gICAgICAgICAgICAgICAgICAgIG9wdGlvbnMuYWRhcHRlciB8fCBcIlN0YW5kYXJkXCIsXG4gICAgICAgICAgICAgICAgICAgIC4uLihvcHRpb25zLnVwbG9hZGVyUGFyYW1zIHx8IFtdKSxcbiAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgcmV0dXJuIHVwbG9hZGVyLnVwbG9hZChmaWxlLCBvcHRpb25zLnJlcXVlc3RQYXJhbXMgfHwge30pO1xuICAgICAgICB9XG5cbiAgICAgICAgZnVuY3Rpb24gbWFrZVVwbG9hZGVyKGFkYXB0ZXI6IHN0cmluZywgLi4ub3B0aW9uczogYW55KSB7XG4gICAgICAgICAgICBjb25zdCBmYWN0b3J5ID0gKDx7IFtrZXk6IHN0cmluZ106IHR5cGVvZiBhZGFwdGVycy5CYXNlIH0+YWRhcHRlcnMpW1xuICAgICAgICAgICAgICAgIGFkYXB0ZXJcbiAgICAgICAgICAgIF07XG4gICAgICAgICAgICBpZiAoIWZhY3RvcnkpIHtcbiAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoYFVwbG9hZGVyICR7YWRhcHRlcn0gaXMgbm90IHJlZ2lzdGVyZWRgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgICAgIHJldHVybiBuZXcgZmFjdG9yeSguLi5vcHRpb25zKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGNrYW4uc2FuZGJveC5leHRlbmQoeyBmaWxlczogeyB1cGxvYWQsIG1ha2VVcGxvYWRlciB9IH0pO1xuXG4gICAgICAgIGV4cG9ydCBuYW1lc3BhY2UgYWRhcHRlcnMge1xuICAgICAgICAgICAgZXhwb3J0IHR5cGUgU3RvcmFnZURhdGEgPSB7IFtrZXk6IHN0cmluZ106IGFueSB9O1xuXG4gICAgICAgICAgICBleHBvcnQgdHlwZSBVcGxvYWRJbmZvID0ge1xuICAgICAgICAgICAgICAgIGlkOiBzdHJpbmc7XG4gICAgICAgICAgICAgICAgc3RvcmFnZV9kYXRhOiBTdG9yYWdlRGF0YTtcbiAgICAgICAgICAgICAgICBsb2NhdGlvbjogc3RyaW5nO1xuICAgICAgICAgICAgICAgIGhhc2g6IHN0cmluZztcbiAgICAgICAgICAgICAgICBjb250ZW50X3R5cGU6IHN0cmluZztcbiAgICAgICAgICAgICAgICBzaXplOiBudW1iZXI7XG4gICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICBleHBvcnQgY2xhc3MgQmFzZSBleHRlbmRzIEV2ZW50VGFyZ2V0IHtcbiAgICAgICAgICAgICAgICBzdGF0aWMgZGVmYXVsdFNldHRpbmdzOiBPYmplY3QgPSB7fTtcbiAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgc2V0dGluZ3M6IFVwbG9hZGVyU2V0dGluZ3M7XG4gICAgICAgICAgICAgICAgcHJvdGVjdGVkIHNhbmRib3g6IGFueTtcbiAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgY3NyZlRva2VuOiBzdHJpbmc7XG5cbiAgICAgICAgICAgICAgICBjb25zdHJ1Y3RvcihzZXR0aW5ncyA9IHt9KSB7XG4gICAgICAgICAgICAgICAgICAgIHN1cGVyKCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2V0dGluZ3MgPSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAuLi5kZWZhdWx0U2V0dGluZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAuLi4odGhpcy5jb25zdHJ1Y3RvciBhcyB0eXBlb2YgQmFzZSkuZGVmYXVsdFNldHRpbmdzLFxuICAgICAgICAgICAgICAgICAgICAgICAgLi4uc2V0dGluZ3MsXG4gICAgICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveCA9IGNrYW4uc2FuZGJveCgpO1xuXG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGNzcmZGaWVsZCA9XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5xdWVyeVNlbGVjdG9yKFwibWV0YVtuYW1lPWNzcmZfZmllbGRfbmFtZV1cIilcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/LmdldEF0dHJpYnV0ZShcImNvbnRlbnRcIikgPz8gXCJfY3NyZl90b2tlblwiO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmNzcmZUb2tlbiA9XG4gICAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC5xdWVyeVNlbGVjdG9yKGBtZXRhW25hbWU9JHtjc3JmRmllbGR9XWApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPy5nZXRBdHRyaWJ1dGUoXCJjb250ZW50XCIpIHx8IFwiXCI7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdXBsb2FkKGZpbGU6IEZpbGUsIHBhcmFtczogeyBba2V5OiBzdHJpbmddOiBhbnkgfSkge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJCYXNlLnVwbG9hZCBpcyBub3QgaW1wbGVtZW50ZWRcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgcmVzdW1lKGZpbGU6IEZpbGUsIGlkOiBzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiQmFzZS5yZXN1bWUgaXMgbm90IGltcGxlbWVudGVkXCIpO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGRpc3BhdGNoU3RhcnQoZmlsZTogRmlsZSkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXZlbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgQ3VzdG9tRXZlbnQoXCJzdGFydFwiLCB7IGRldGFpbDogeyBmaWxlIH0gfSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRpc3BhdGNoQ29tbWl0KGZpbGU6IEZpbGUsIGlkOiBzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEN1c3RvbUV2ZW50KFwiY29tbWl0XCIsIHsgZGV0YWlsOiB7IGZpbGUsIGlkIH0gfSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRpc3BhdGNoUHJvZ3Jlc3MoZmlsZTogRmlsZSwgbG9hZGVkOiBudW1iZXIsIHRvdGFsOiBudW1iZXIpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEN1c3RvbUV2ZW50KFwicHJvZ3Jlc3NcIiwge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRldGFpbDogeyBmaWxlLCBsb2FkZWQsIHRvdGFsIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGlzcGF0Y2hGaW5pc2goZmlsZTogRmlsZSwgcmVzdWx0OiBPYmplY3QpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEN1c3RvbUV2ZW50KFwiZmluaXNoXCIsIHsgZGV0YWlsOiB7IGZpbGUsIHJlc3VsdCB9IH0pLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkaXNwYXRjaEZhaWwoZmlsZTogRmlsZSwgcmVhc29uczogeyBba2V5OiBzdHJpbmddOiBzdHJpbmdbXSB9KSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudChcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDdXN0b21FdmVudChcImZhaWxcIiwgeyBkZXRhaWw6IHsgZmlsZSwgcmVhc29ucyB9IH0pLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkaXNwYXRjaEVycm9yKGZpbGU6IEZpbGUsIG1lc3NhZ2U6IHN0cmluZykge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXZlbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgQ3VzdG9tRXZlbnQoXCJlcnJvclwiLCB7IGRldGFpbDogeyBmaWxlLCBtZXNzYWdlIH0gfSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHBvcnQgY2xhc3MgU3RhbmRhcmQgZXh0ZW5kcyBCYXNlIHtcbiAgICAgICAgICAgICAgICBzdGF0aWMgZGVmYXVsdFNldHRpbmdzID0ge1xuICAgICAgICAgICAgICAgICAgICB1cGxvYWRBY3Rpb246IFwiZmlsZXNfZmlsZV9jcmVhdGVcIixcbiAgICAgICAgICAgICAgICB9O1xuXG4gICAgICAgICAgICAgICAgdXBsb2FkKGZpbGU6IEZpbGUsIHBhcmFtczogeyBba2V5OiBzdHJpbmddOiBhbnkgfSkge1xuICAgICAgICAgICAgICAgICAgICBjb25zdCByZXF1ZXN0ID0gbmV3IFhNTEh0dHBSZXF1ZXN0KCk7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHByb21pc2UgPSB0aGlzLl9hZGRMaXN0ZW5lcnMocmVxdWVzdCwgZmlsZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3ByZXBhcmVSZXF1ZXN0KHJlcXVlc3QsIGZpbGUpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLl9zZW5kUmVxdWVzdChyZXF1ZXN0LCBmaWxlLCBwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gcHJvbWlzZTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfYWRkTGlzdGVuZXJzKFxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0OiBYTUxIdHRwUmVxdWVzdCxcbiAgICAgICAgICAgICAgICAgICAgZmlsZTogRmlsZSxcbiAgICAgICAgICAgICAgICApOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC51cGxvYWQuYWRkRXZlbnRMaXN0ZW5lcihcImxvYWRzdGFydFwiLCAoZXZlbnQpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoU3RhcnQoZmlsZSksXG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC51cGxvYWQuYWRkRXZlbnRMaXN0ZW5lcihcInByb2dyZXNzXCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hQcm9ncmVzcyhmaWxlLCBldmVudC5sb2FkZWQsIGV2ZW50LnRvdGFsKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImxvYWRcIiwgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgcmVzdWx0ID0gSlNPTi5wYXJzZShyZXF1ZXN0LnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiByZXN1bHQgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEVycm9yKGZpbGUsIHJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwocmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2UgaWYgKHJlc3VsdC5zdWNjZXNzKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hDb21taXQoZmlsZSwgcmVzdWx0LnJlc3VsdC5pZCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hGaW5pc2goZmlsZSwgcmVzdWx0LnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbmUocmVzdWx0LnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEZhaWwoZmlsZSwgcmVzdWx0LmVycm9yKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlc3VsdC5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImVycm9yXCIsIChldmVudCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFcnJvcihmaWxlLCByZXF1ZXN0LnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChyZXF1ZXN0LnJlc3BvbnNlVGV4dCk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgX3ByZXBhcmVSZXF1ZXN0KHJlcXVlc3Q6IFhNTEh0dHBSZXF1ZXN0LCBmaWxlOiBGaWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub3BlbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiUE9TVFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC51cmwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgYC9hcGkvYWN0aW9uLyR7dGhpcy5zZXR0aW5ncy51cGxvYWRBY3Rpb259YCxcbiAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuY3NyZlRva2VuKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LnNldFJlcXVlc3RIZWFkZXIoXCJYLUNTUkZUb2tlblwiLCB0aGlzLmNzcmZUb2tlbik7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfc2VuZFJlcXVlc3QoXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Q6IFhNTEh0dHBSZXF1ZXN0LFxuICAgICAgICAgICAgICAgICAgICBmaWxlOiBGaWxlLFxuICAgICAgICAgICAgICAgICAgICBwYXJhbXM6IHsgW2tleTogc3RyaW5nXTogYW55IH0sXG4gICAgICAgICAgICAgICAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IGRhdGEgPSBuZXcgRm9ybURhdGEoKTtcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoXCJ1cGxvYWRcIiwgZmlsZSk7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcGFyYW1zLnN0b3JhZ2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKFwic3RvcmFnZVwiLCB0aGlzLnNldHRpbmdzLnN0b3JhZ2UpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGZvciAobGV0IFtmaWVsZCwgdmFsdWVdIG9mIE9iamVjdC5lbnRyaWVzKHBhcmFtcykpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKGZpZWxkLCB2YWx1ZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5zZW5kKGRhdGEpO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgZXhwb3J0IGNsYXNzIE11bHRpcGFydCBleHRlbmRzIEJhc2Uge1xuICAgICAgICAgICAgICAgIHN0YXRpYyBkZWZhdWx0U2V0dGluZ3MgPSB7IGNodW5rU2l6ZTogMTAyNCAqIDEwMjQgKiA1IH07XG4gICAgICAgICAgICAgICAgcHJvdGVjdGVkIGluaXRpYWxpemVBY3Rpb24gPSBcImZpbGVzX211bHRpcGFydF9zdGFydFwiO1xuXG4gICAgICAgICAgICAgICAgcHJpdmF0ZSBfYWN0aXZlID0gbmV3IFNldDxGaWxlPigpO1xuXG4gICAgICAgICAgICAgICAgY29uc3RydWN0b3Ioc2V0dGluZ3M6IE9iamVjdCkge1xuICAgICAgICAgICAgICAgICAgICBzdXBlcihzZXR0aW5ncyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYXN5bmMgdXBsb2FkKGZpbGU6IEZpbGUsIHBhcmFtczogeyBba2V5OiBzdHJpbmddOiBhbnkgfSkge1xuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5fYWN0aXZlLmhhcyhmaWxlKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS53YXJuKFwiRmlsZSB1cGxvYWQgaW4gcHJvZ3Jlc3NcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fYWN0aXZlLmFkZChmaWxlKTtcblxuICAgICAgICAgICAgICAgICAgICBsZXQgaW5mbztcblxuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGF3YWl0IHRoaXMuX2luaXRpYWxpemVVcGxvYWQoZmlsZSk7XG4gICAgICAgICAgICAgICAgICAgIH0gY2F0Y2ggKGVycikge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBlcnIgPT09IFwic3RyaW5nXCIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXJyb3IoZmlsZSwgZXJyKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEZhaWwoZmlsZSwgZXJyIGFzIGFueSk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoQ29tbWl0KGZpbGUsIGluZm8uaWQpO1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoU3RhcnQoZmlsZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fZG9VcGxvYWQoZmlsZSwgaW5mbyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYXN5bmMgcmVzdW1lKGZpbGU6IEZpbGUsIGlkOiBzdHJpbmcpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHRoaXMuX2FjdGl2ZS5oYXMoZmlsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUud2FybihcIkZpbGUgdXBsb2FkIGluIHByb2dyZXNzXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2FjdGl2ZS5hZGQoZmlsZSk7XG5cbiAgICAgICAgICAgICAgICAgICAgbGV0IGluZm8gPSBhd2FpdCB0aGlzLl9zaG93VXBsb2FkKGlkKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaFN0YXJ0KGZpbGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2RvVXBsb2FkKGZpbGUsIGluZm8pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHBhdXNlKGZpbGU6IEZpbGUpIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fYWN0aXZlLmRlbGV0ZShmaWxlKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBhc3luYyBfZG9VcGxvYWQoZmlsZTogRmlsZSwgaW5mbzogVXBsb2FkSW5mbykge1xuICAgICAgICAgICAgICAgICAgICBsZXQgc3RhcnQgPSBpbmZvLnN0b3JhZ2VfZGF0YVtcInVwbG9hZGVkXCJdIHx8IDA7XG5cbiAgICAgICAgICAgICAgICAgICAgd2hpbGUgKHN0YXJ0IDwgZmlsZS5zaXplKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIXRoaXMuX2FjdGl2ZS5oYXMoZmlsZSkpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmluZm8oXCJGaWxlIHVwbG9hZCBpcyBwYXVzZWRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZvID0gYXdhaXQgdGhpcy5fdXBsb2FkQ2h1bmsoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5mbyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWxlLnNsaWNlKHN0YXJ0LCBzdGFydCArIHRoaXMuc2V0dGluZ3MuY2h1bmtTaXplKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGFydCxcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHVwbG9hZGVkID0gaW5mby5zdG9yYWdlX2RhdGEudXBsb2FkZWQ7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodXBsb2FkZWQgPD0gc3RhcnQpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJVcGxvYWRlZCBzaXplIGlzIHJlZHVjZWRcIik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hQcm9ncmVzcyhmaWxlLCB1cGxvYWRlZCwgZmlsZS5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHN0YXJ0ID0gdXBsb2FkZWQ7XG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoUHJvZ3Jlc3MoZmlsZSwgZmlsZS5zaXplLCBmaWxlLnNpemUpO1xuICAgICAgICAgICAgICAgICAgICB0cnkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGF3YWl0IHRoaXMuX2NvbXBsZXRlVXBsb2FkKGluZm8pO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEVycm9yKGZpbGUsIGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hGYWlsKGZpbGUsIGVyciBhcyBhbnkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEZpbmlzaChmaWxlLCBpbmZvKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfaW5pdGlhbGl6ZVVwbG9hZChmaWxlOiBGaWxlKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgoZG9uZSwgZmFpbCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuc2FuZGJveC5jbGllbnQuY2FsbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBcIlBPU1RcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmluaXRpYWxpemVBY3Rpb24sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmFzc2lnbihcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0b3JhZ2U6IHRoaXMuc2V0dGluZ3Muc3RvcmFnZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWU6IGZpbGUubmFtZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNpemU6IGZpbGUuc2l6ZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnRlbnRfdHlwZTogZmlsZS50eXBlLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzLmluaXRpYWxpemVQYXlsb2FkIHx8IHt9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJlc3AucmVzcG9uc2VKU09OLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIF9zaG93VXBsb2FkKGlkOiBzdHJpbmcpOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiR0VUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmaWxlc19tdWx0aXBhcnRfcmVmcmVzaFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGA/aWQ9JHtpZH1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkYXRhOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVzcDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlb2YgcmVzcC5yZXNwb25zZUpTT04gPT09IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJlc3AucmVzcG9uc2VUZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfdXBsb2FkQ2h1bmsoXG4gICAgICAgICAgICAgICAgICAgIGluZm86IFVwbG9hZEluZm8sXG4gICAgICAgICAgICAgICAgICAgIHBhcnQ6IEJsb2IsXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBudW1iZXIsXG4gICAgICAgICAgICAgICAgKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcGFydC5zaXplKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCIwLWxlbmd0aCBjaHVua3MgYXJlIG5vdCBhbGxvd2VkXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBuZXcgUHJvbWlzZTxVcGxvYWRJbmZvPigoZG9uZSwgZmFpbCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hZGRFdmVudExpc3RlbmVyKFwibG9hZFwiLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShyZXN1bHQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlc3VsdC5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImVycm9yXCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlcXVlc3QucmVzcG9uc2VUZXh0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub3BlbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiUE9TVFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC51cmwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCIvYXBpL2FjdGlvbi9maWxlc19tdWx0aXBhcnRfdXBkYXRlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmNzcmZUb2tlbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5zZXRSZXF1ZXN0SGVhZGVyKFwiWC1DU1JGVG9rZW5cIiwgdGhpcy5jc3JmVG9rZW4pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VuZFJlcXVlc3QocmVxdWVzdCwgcGFydCwgc3RhcnQsIGluZm8uaWQpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgX3NlbmRSZXF1ZXN0KFxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0OiBYTUxIdHRwUmVxdWVzdCxcbiAgICAgICAgICAgICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IG51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHN0cmluZyxcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZm9ybSA9IG5ldyBGb3JtRGF0YSgpO1xuICAgICAgICAgICAgICAgICAgICBmb3JtLmFwcGVuZChcInVwbG9hZFwiLCBwYXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoXCJwb3NpdGlvblwiLCBTdHJpbmcocG9zaXRpb24pKTtcbiAgICAgICAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoXCJpZFwiLCBpZCk7XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Quc2VuZChmb3JtKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfY29tcGxldGVVcGxvYWQoaW5mbzogVXBsb2FkSW5mbyk6IFByb21pc2U8VXBsb2FkSW5mbz4ge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmaWxlc19tdWx0aXBhcnRfY29tcGxldGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5jb21wbGV0ZVBheWxvYWQgfHwge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpbmZvLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJlc3AucmVzcG9uc2VKU09OLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cb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AgICAgIHRocm93IG5ldyBFcnJvcihgVXBsb2FkZXIgJHthZGFwdGVyfSBpcyBub3QgcmVnaXN0ZXJlZGApO1xuICAgICAgICAgICAgfVxuICAgICAgICAgICAgcmV0dXJuIG5ldyBmYWN0b3J5KC4uLm9wdGlvbnMpO1xuICAgICAgICB9XG5cbiAgICAgICAgY2thbi5zYW5kYm94LmV4dGVuZCh7IGZpbGVzOiB7IHVwbG9hZCwgbWFrZVVwbG9hZGVyIH0gfSk7XG5cbiAgICAgICAgZXhwb3J0IG5hbWVzcGFjZSBhZGFwdGVycyB7XG4gICAgICAgICAgICBleHBvcnQgdHlwZSBTdG9yYWdlRGF0YSA9IHsgW2tleTogc3RyaW5nXTogYW55IH07XG5cbiAgICAgICAgICAgIGV4cG9ydCB0eXBlIFVwbG9hZEluZm8gPSB7XG4gICAgICAgICAgICAgICAgaWQ6IHN0cmluZztcbiAgICAgICAgICAgICAgICBzdG9yYWdlX2RhdGE6IFN0b3JhZ2VEYXRhO1xuICAgICAgICAgICAgICAgIGxvY2F0aW9uOiBzdHJpbmc7XG4gICAgICAgICAgICAgICAgaGFzaDogc3RyaW5nO1xuICAgICAgICAgICAgICAgIGNvbnRlbnRfdHlwZTogc3RyaW5nO1xuICAgICAgICAgICAgICAgIHNpemU6IG51bWJlcjtcbiAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgIGV4cG9ydCBjbGFzcyBCYXNlIGV4dGVuZHMgRXZlbnRUYXJnZXQge1xuICAgICAgICAgICAgICAgIHN0YXRpYyBkZWZhdWx0U2V0dGluZ3M6IE9iamVjdCA9IHt9O1xuICAgICAgICAgICAgICAgIHByb3RlY3RlZCBzZXR0aW5nczogVXBsb2FkZXJTZXR0aW5ncztcbiAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgc2FuZGJveDogYW55O1xuICAgICAgICAgICAgICAgIHByb3RlY3RlZCBjc3JmVG9rZW46IHN0cmluZztcblxuICAgICAgICAgICAgICAgIGNvbnN0cnVjdG9yKHNldHRpbmdzID0ge30pIHtcbiAgICAgICAgICAgICAgICAgICAgc3VwZXIoKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncyA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC4uLmRlZmF1bHRTZXR0aW5ncyxcbiAgICAgICAgICAgICAgICAgICAgICAgIC4uLih0aGlzLmNvbnN0cnVjdG9yIGFzIHR5cGVvZiBCYXNlKS5kZWZhdWx0U2V0dGluZ3MsXG4gICAgICAgICAgICAgICAgICAgICAgICAuLi5zZXR0aW5ncyxcbiAgICAgICAgICAgICAgICAgICAgfTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94ID0gY2thbi5zYW5kYm94KCk7XG5cbiAgICAgICAgICAgICAgICAgICAgY29uc3QgY3NyZkZpZWxkID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnF1ZXJ5U2VsZWN0b3IoXCJtZXRhW25hbWU9Y3NyZl9maWVsZF9uYW1lXVwiKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgID8uZ2V0QXR0cmlidXRlKFwiY29udGVudFwiKSA/PyBcIl9jc3JmX3Rva2VuXCI7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3NyZlRva2VuID1cbiAgICAgICAgICAgICAgICAgICAgICAgIGRvY3VtZW50XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLnF1ZXJ5U2VsZWN0b3IoYG1ldGFbbmFtZT0ke2NzcmZGaWVsZH1dYClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA/LmdldEF0dHJpYnV0ZShcImNvbnRlbnRcIikgfHwgXCJcIjtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICB1cGxvYWQoZmlsZTogRmlsZSwgcGFyYW1zOiB7IFtrZXk6IHN0cmluZ106IGFueSB9KSB7XG4gICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBFcnJvcihcIkJhc2UudXBsb2FkIGlzIG5vdCBpbXBsZW1lbnRlZFwiKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICByZXN1bWUoZmlsZTogRmlsZSwgaWQ6IHN0cmluZykge1xuICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCJCYXNlLnJlc3VtZSBpcyBub3QgaW1wbGVtZW50ZWRcIik7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgZGlzcGF0Y2hTdGFydChmaWxlOiBGaWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudChcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDdXN0b21FdmVudChcInN0YXJ0XCIsIHsgZGV0YWlsOiB7IGZpbGUgfSB9KSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgZGlzcGF0Y2hQcm9ncmVzcyhmaWxlOiBGaWxlLCBsb2FkZWQ6IG51bWJlciwgdG90YWw6IG51bWJlcikge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXZlbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgQ3VzdG9tRXZlbnQoXCJwcm9ncmVzc1wiLCB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGV0YWlsOiB7IGZpbGUsIGxvYWRlZCwgdG90YWwgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBkaXNwYXRjaEZpbmlzaChmaWxlOiBGaWxlLCByZXN1bHQ6IE9iamVjdCkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXZlbnQoXG4gICAgICAgICAgICAgICAgICAgICAgICBuZXcgQ3VzdG9tRXZlbnQoXCJmaW5pc2hcIiwgeyBkZXRhaWw6IHsgZmlsZSwgcmVzdWx0IH0gfSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRpc3BhdGNoRmFpbChmaWxlOiBGaWxlLCByZWFzb25zOiB7IFtrZXk6IHN0cmluZ106IHN0cmluZ1tdIH0pIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEV2ZW50KFxuICAgICAgICAgICAgICAgICAgICAgICAgbmV3IEN1c3RvbUV2ZW50KFwiZmFpbFwiLCB7IGRldGFpbDogeyBmaWxlLCByZWFzb25zIH0gfSksXG4gICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGRpc3BhdGNoRXJyb3IoZmlsZTogRmlsZSwgbWVzc2FnZTogc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFdmVudChcbiAgICAgICAgICAgICAgICAgICAgICAgIG5ldyBDdXN0b21FdmVudChcImVycm9yXCIsIHsgZGV0YWlsOiB7IGZpbGUsIG1lc3NhZ2UgfSB9KSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIGV4cG9ydCBjbGFzcyBTdGFuZGFyZCBleHRlbmRzIEJhc2Uge1xuICAgICAgICAgICAgICAgIHN0YXRpYyBkZWZhdWx0U2V0dGluZ3MgPSB7XG4gICAgICAgICAgICAgICAgICAgIHVwbG9hZEFjdGlvbjogXCJmaWxlc19maWxlX2NyZWF0ZVwiLFxuICAgICAgICAgICAgICAgIH07XG5cbiAgICAgICAgICAgICAgICB1cGxvYWQoZmlsZTogRmlsZSwgcGFyYW1zOiB7IFtrZXk6IHN0cmluZ106IGFueSB9KSB7XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgcHJvbWlzZSA9IHRoaXMuX2FkZExpc3RlbmVycyhyZXF1ZXN0LCBmaWxlKTtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fcHJlcGFyZVJlcXVlc3QocmVxdWVzdCwgZmlsZSk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX3NlbmRSZXF1ZXN0KHJlcXVlc3QsIGZpbGUsIHBhcmFtcyk7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBwcm9taXNlO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIF9hZGRMaXN0ZW5lcnMoXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Q6IFhNTEh0dHBSZXF1ZXN0LFxuICAgICAgICAgICAgICAgICAgICBmaWxlOiBGaWxlLFxuICAgICAgICAgICAgICAgICk6IFByb21pc2U8VXBsb2FkSW5mbz4ge1xuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LnVwbG9hZC5hZGRFdmVudExpc3RlbmVyKFwibG9hZHN0YXJ0XCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hTdGFydChmaWxlKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LnVwbG9hZC5hZGRFdmVudExpc3RlbmVyKFwicHJvZ3Jlc3NcIiwgKGV2ZW50KSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaFByb2dyZXNzKGZpbGUsIGV2ZW50LmxvYWRlZCwgZXZlbnQudG90YWwpLFxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBuZXcgUHJvbWlzZSgoZG9uZSwgZmFpbCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hZGRFdmVudExpc3RlbmVyKFwibG9hZFwiLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIHJlc3VsdCA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRXJyb3IoZmlsZSwgcmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChyZXN1bHQpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0gZWxzZSBpZiAocmVzdWx0LnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEZpbmlzaChmaWxlLCByZXN1bHQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShyZXN1bHQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRmFpbChmaWxlLCByZXN1bHQuZXJyb3IpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwocmVzdWx0LmVycm9yKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hZGRFdmVudExpc3RlbmVyKFwiZXJyb3JcIiwgKGV2ZW50KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEVycm9yKGZpbGUsIHJlcXVlc3QucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlcXVlc3QucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfcHJlcGFyZVJlcXVlc3QocmVxdWVzdDogWE1MSHR0cFJlcXVlc3QsIGZpbGU6IEZpbGUpIHtcbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5vcGVuKFxuICAgICAgICAgICAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LnVybChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBgL2FwaS9hY3Rpb24vJHt0aGlzLnNldHRpbmdzLnVwbG9hZEFjdGlvbn1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcblxuICAgICAgICAgICAgICAgICAgICBpZiAodGhpcy5jc3JmVG9rZW4pIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3Quc2V0UmVxdWVzdEhlYWRlcihcIlgtQ1NSRlRva2VuXCIsIHRoaXMuY3NyZlRva2VuKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIF9zZW5kUmVxdWVzdChcbiAgICAgICAgICAgICAgICAgICAgcmVxdWVzdDogWE1MSHR0cFJlcXVlc3QsXG4gICAgICAgICAgICAgICAgICAgIGZpbGU6IEZpbGUsXG4gICAgICAgICAgICAgICAgICAgIHBhcmFtczogeyBba2V5OiBzdHJpbmddOiBhbnkgfSxcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZGF0YSA9IG5ldyBGb3JtRGF0YSgpO1xuICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZChcInVwbG9hZFwiLCBmaWxlKTtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCFwYXJhbXMuc3RvcmFnZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoXCJzdG9yYWdlXCIsIHRoaXMuc2V0dGluZ3Muc3RvcmFnZSk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgZm9yIChsZXQgW2ZpZWxkLCB2YWx1ZV0gb2YgT2JqZWN0LmVudHJpZXMocGFyYW1zKSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoZmllbGQsIHZhbHVlKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0LnNlbmQoZGF0YSk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICBleHBvcnQgY2xhc3MgTXVsdGlwYXJ0IGV4dGVuZHMgQmFzZSB7XG4gICAgICAgICAgICAgICAgc3RhdGljIGRlZmF1bHRTZXR0aW5ncyA9IHsgY2h1bmtTaXplOiAxMDI0ICogMTAyNCAqIDUgfTtcbiAgICAgICAgICAgICAgICBwcm90ZWN0ZWQgaW5pdGlhbGl6ZUFjdGlvbiA9IFwiZmlsZXNfbXVsdGlwYXJ0X3N0YXJ0XCI7XG5cbiAgICAgICAgICAgICAgICBwcml2YXRlIF9hY3RpdmUgPSBuZXcgU2V0PEZpbGU+KCk7XG5cbiAgICAgICAgICAgICAgICBjb25zdHJ1Y3RvcihzZXR0aW5nczogT2JqZWN0KSB7XG4gICAgICAgICAgICAgICAgICAgIHN1cGVyKHNldHRpbmdzKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBhc3luYyB1cGxvYWQoZmlsZTogRmlsZSwgcGFyYW1zOiB7IFtrZXk6IHN0cmluZ106IGFueSB9KSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9hY3RpdmUuaGFzKGZpbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXCJGaWxlIHVwbG9hZCBpbiBwcm9ncmVzc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9hY3RpdmUuYWRkKGZpbGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmZvO1xuXG4gICAgICAgICAgICAgICAgICAgIHRyeSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpbmZvID0gYXdhaXQgdGhpcy5faW5pdGlhbGl6ZVVwbG9hZChmaWxlLCBwYXJhbXMpO1xuICAgICAgICAgICAgICAgICAgICB9IGNhdGNoIChlcnIpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICh0eXBlb2YgZXJyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaEVycm9yKGZpbGUsIGVycik7XG4gICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hGYWlsKGZpbGUsIGVyciBhcyBhbnkpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaFN0YXJ0KGZpbGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2RvVXBsb2FkKGZpbGUsIGluZm8pO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGFzeW5jIHJlc3VtZShmaWxlOiBGaWxlLCBpZDogc3RyaW5nKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLl9hY3RpdmUuaGFzKGZpbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLndhcm4oXCJGaWxlIHVwbG9hZCBpbiBwcm9ncmVzc1wiKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9hY3RpdmUuYWRkKGZpbGUpO1xuXG4gICAgICAgICAgICAgICAgICAgIGxldCBpbmZvID0gYXdhaXQgdGhpcy5fc2hvd1VwbG9hZChpZCk7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hTdGFydChmaWxlKTtcblxuICAgICAgICAgICAgICAgICAgICB0aGlzLl9kb1VwbG9hZChmaWxlLCBpbmZvKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBwYXVzZShmaWxlOiBGaWxlKSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuX2FjdGl2ZS5kZWxldGUoZmlsZSk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgYXN5bmMgX2RvVXBsb2FkKGZpbGU6IEZpbGUsIGluZm86IFVwbG9hZEluZm8pIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IHN0YXJ0ID0gaW5mby5zdG9yYWdlX2RhdGFbXCJ1cGxvYWRlZFwiXSB8fCAwO1xuXG4gICAgICAgICAgICAgICAgICAgIHdoaWxlIChzdGFydCA8IGZpbGUuc2l6ZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCF0aGlzLl9hY3RpdmUuaGFzKGZpbGUpKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5pbmZvKFwiRmlsZSB1cGxvYWQgaXMgcGF1c2VkXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybjtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaW5mbyA9IGF3YWl0IHRoaXMuX3VwbG9hZENodW5rKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluZm8sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsZS5zbGljZShzdGFydCwgc3RhcnQgKyB0aGlzLnNldHRpbmdzLmNodW5rU2l6ZSksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RhcnQsXG4gICAgICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCB1cGxvYWRlZCA9IGluZm8uc3RvcmFnZV9kYXRhLnVwbG9hZGVkO1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKHVwbG9hZGVkIDw9IHN0YXJ0KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhyb3cgbmV3IEVycm9yKFwiVXBsb2FkZWQgc2l6ZSBpcyByZWR1Y2VkXCIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoUHJvZ3Jlc3MoZmlsZSwgdXBsb2FkZWQsIGZpbGUuc2l6ZSk7XG4gICAgICAgICAgICAgICAgICAgICAgICBzdGFydCA9IHVwbG9hZGVkO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNwYXRjaFByb2dyZXNzKGZpbGUsIGZpbGUuc2l6ZSwgZmlsZS5zaXplKTtcbiAgICAgICAgICAgICAgICAgICAgdHJ5IHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGluZm8gPSBhd2FpdCB0aGlzLl9jb21wbGV0ZVVwbG9hZChpbmZvKTtcbiAgICAgICAgICAgICAgICAgICAgfSBjYXRjaCAoZXJyKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAodHlwZW9mIGVyciA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hFcnJvcihmaWxlLCBlcnIpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSBlbHNlIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc3BhdGNoRmFpbChmaWxlLCBlcnIgYXMgYW55KTtcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzcGF0Y2hGaW5pc2goZmlsZSwgaW5mbyk7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgX2luaXRpYWxpemVVcGxvYWQoZmlsZTogRmlsZSwgcGFyYW1zOiB7W2tleTogc3RyaW5nXTogYW55fSk6IFByb21pc2U8VXBsb2FkSW5mbz4ge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5pbml0aWFsaXplQWN0aW9uLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5hc3NpZ24oXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHt9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdG9yYWdlOiB0aGlzLnNldHRpbmdzLnN0b3JhZ2UsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYW1lOiBmaWxlLm5hbWUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzaXplOiBmaWxlLnNpemUsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb250ZW50X3R5cGU6IGZpbGUudHlwZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcGFyYW1zLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJlc3AucmVzcG9uc2VKU09OLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIF9zaG93VXBsb2FkKGlkOiBzdHJpbmcpOiBQcm9taXNlPFVwbG9hZEluZm8+IHtcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIG5ldyBQcm9taXNlKChkb25lLCBmYWlsKSA9PlxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC5jYWxsKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwiR0VUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmaWxlc19tdWx0aXBhcnRfcmVmcmVzaFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGA/aWQ9JHtpZH1gLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChkYXRhOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShkYXRhLnJlc3VsdCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAocmVzcDogYW55KSA9PiB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZhaWwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0eXBlb2YgcmVzcC5yZXNwb25zZUpTT04gPT09IFwic3RyaW5nXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IHJlc3AucmVzcG9uc2VUZXh0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiByZXNwLnJlc3BvbnNlSlNPTi5lcnJvcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfdXBsb2FkQ2h1bmsoXG4gICAgICAgICAgICAgICAgICAgIGluZm86IFVwbG9hZEluZm8sXG4gICAgICAgICAgICAgICAgICAgIHBhcnQ6IEJsb2IsXG4gICAgICAgICAgICAgICAgICAgIHN0YXJ0OiBudW1iZXIsXG4gICAgICAgICAgICAgICAgKTogUHJvbWlzZTxVcGxvYWRJbmZvPiB7XG4gICAgICAgICAgICAgICAgICAgIGlmICghcGFydC5zaXplKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB0aHJvdyBuZXcgRXJyb3IoXCIwLWxlbmd0aCBjaHVua3MgYXJlIG5vdCBhbGxvd2VkXCIpO1xuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIGNvbnN0IHJlcXVlc3QgPSBuZXcgWE1MSHR0cFJlcXVlc3QoKTtcblxuICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBuZXcgUHJvbWlzZTxVcGxvYWRJbmZvPigoZG9uZSwgZmFpbCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5hZGRFdmVudExpc3RlbmVyKFwibG9hZFwiLCAoZXZlbnQpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCByZXN1bHQgPSBKU09OLnBhcnNlKHJlcXVlc3QucmVzcG9uc2VUZXh0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAocmVzdWx0LnN1Y2Nlc3MpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZG9uZShyZXN1bHQucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlc3VsdC5lcnJvcik7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJlcXVlc3QuYWRkRXZlbnRMaXN0ZW5lcihcImVycm9yXCIsIChldmVudCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBmYWlsKHJlcXVlc3QucmVzcG9uc2VUZXh0KSxcbiAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgIH0pO1xuXG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Qub3BlbihcbiAgICAgICAgICAgICAgICAgICAgICAgIFwiUE9TVFwiLFxuICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zYW5kYm94LmNsaWVudC51cmwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCIvYXBpL2FjdGlvbi9maWxlc19tdWx0aXBhcnRfdXBkYXRlXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuXG4gICAgICAgICAgICAgICAgICAgIGlmICh0aGlzLmNzcmZUb2tlbikge1xuICAgICAgICAgICAgICAgICAgICAgICAgcmVxdWVzdC5zZXRSZXF1ZXN0SGVhZGVyKFwiWC1DU1JGVG9rZW5cIiwgdGhpcy5jc3JmVG9rZW4pO1xuICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5fc2VuZFJlcXVlc3QocmVxdWVzdCwgcGFydCwgc3RhcnQsIGluZm8uaWQpO1xuXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiByZXN1bHQ7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgX3NlbmRSZXF1ZXN0KFxuICAgICAgICAgICAgICAgICAgICByZXF1ZXN0OiBYTUxIdHRwUmVxdWVzdCxcbiAgICAgICAgICAgICAgICAgICAgcGFydDogQmxvYixcbiAgICAgICAgICAgICAgICAgICAgcG9zaXRpb246IG51bWJlcixcbiAgICAgICAgICAgICAgICAgICAgaWQ6IHN0cmluZyxcbiAgICAgICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICAgICAgY29uc3QgZm9ybSA9IG5ldyBGb3JtRGF0YSgpO1xuICAgICAgICAgICAgICAgICAgICBmb3JtLmFwcGVuZChcInVwbG9hZFwiLCBwYXJ0KTtcbiAgICAgICAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoXCJwb3NpdGlvblwiLCBTdHJpbmcocG9zaXRpb24pKTtcbiAgICAgICAgICAgICAgICAgICAgZm9ybS5hcHBlbmQoXCJpZFwiLCBpZCk7XG4gICAgICAgICAgICAgICAgICAgIHJlcXVlc3Quc2VuZChmb3JtKTtcbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBfY29tcGxldGVVcGxvYWQoaW5mbzogVXBsb2FkSW5mbyk6IFByb21pc2U8VXBsb2FkSW5mbz4ge1xuICAgICAgICAgICAgICAgICAgICByZXR1cm4gbmV3IFByb21pc2UoKGRvbmUsIGZhaWwpID0+XG4gICAgICAgICAgICAgICAgICAgICAgICB0aGlzLnNhbmRib3guY2xpZW50LmNhbGwoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJQT1NUXCIsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgXCJmaWxlc19tdWx0aXBhcnRfY29tcGxldGVcIixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3QuYXNzaWduKFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB7fSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5ncy5jb21wbGV0ZVBheWxvYWQgfHwge30sXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlkOiBpbmZvLmlkLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgKGRhdGE6IGFueSkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkb25lKGRhdGEucmVzdWx0KTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIChyZXNwOiBhbnkpID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZmFpbChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR5cGVvZiByZXNwLnJlc3BvbnNlSlNPTiA9PT0gXCJzdHJpbmdcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgID8gcmVzcC5yZXNwb25zZVRleHRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IHJlc3AucmVzcG9uc2VKU09OLmVycm9yLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0sXG4gICAgICAgICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgIH1cbiAgICAgICAgfVxuICAgIH1cbn1cbiJdfQ== \ No newline at end of file diff --git a/ckanext/files/assets/ts/files--modules.ts b/ckanext/files/assets/ts/files--modules.ts index 903b49d..b1383d4 100644 --- a/ckanext/files/assets/ts/files--modules.ts +++ b/ckanext/files/assets/ts/files--modules.ts @@ -97,7 +97,7 @@ ckan.module("files--auto-upload", function ($) { this.queue.add(file); this.refreshFormState(); const options: ckan.CKANEXT_FILES.UploadOptions = { - uploaderParams: [{ uploadAction: this.options.action }], + uploaderArgs: [{ uploadAction: this.options.action }], }; this.sandbox.files @@ -370,10 +370,6 @@ ckan.module("files--queue", function ($) { widget.on("click", "[data-upload-resume]", this._onWidgetResume); widget.on("click", "[data-upload-pause]", this._onWidgetPause); - info.uploader.addEventListener( - "commit", - (event: CustomEvent) => (info.id = event.detail.id), - ); info.uploader.addEventListener( "fail", ({ diff --git a/ckanext/files/assets/ts/files--shared.ts b/ckanext/files/assets/ts/files--shared.ts index b59bb78..30b3d86 100644 --- a/ckanext/files/assets/ts/files--shared.ts +++ b/ckanext/files/assets/ts/files--shared.ts @@ -11,7 +11,7 @@ namespace ckan { export interface UploadOptions { uploader?: adapters.Base; adapter?: string; - uploaderParams?: any[]; + uploaderArgs?: any[]; requestParams?: { [key: string]: any }; } @@ -25,12 +25,12 @@ namespace ckan { storage: "default", }; - function upload(file: File, options: UploadOptions) { + function upload(file: File, options: UploadOptions = {}) { const uploader = options.uploader || makeUploader( options.adapter || "Standard", - ...(options.uploaderParams || []), + ...(options.uploaderArgs || []), ); return uploader.upload(file, options.requestParams || {}); } @@ -97,11 +97,6 @@ namespace ckan { new CustomEvent("start", { detail: { file } }), ); } - dispatchCommit(file: File, id: string) { - this.dispatchEvent( - new CustomEvent("commit", { detail: { file, id } }), - ); - } dispatchProgress(file: File, loaded: number, total: number) { this.dispatchEvent( new CustomEvent("progress", { @@ -158,7 +153,6 @@ namespace ckan { this.dispatchError(file, result); fail(result); } else if (result.success) { - this.dispatchCommit(file, result.result.id); this.dispatchFinish(file, result.result); done(result.result); } else { @@ -225,7 +219,7 @@ namespace ckan { let info; try { - info = await this._initializeUpload(file); + info = await this._initializeUpload(file, params); } catch (err) { if (typeof err === "string") { this.dispatchError(file, err); @@ -235,7 +229,6 @@ namespace ckan { return; } - this.dispatchCommit(file, info.id); this.dispatchStart(file); this._doUpload(file, info); @@ -297,7 +290,7 @@ namespace ckan { this.dispatchFinish(file, info); } - _initializeUpload(file: File): Promise { + _initializeUpload(file: File, params: {[key: string]: any}): Promise { return new Promise((done, fail) => this.sandbox.client.call( "POST", @@ -310,7 +303,7 @@ namespace ckan { size: file.size, content_type: file.type, }, - this.settings.initializePayload || {}, + params, ), (data: any) => { done(data.result); diff --git a/cypress/e2e/sandbox.cy.ts b/cypress/e2e/sandbox.cy.ts index 72e59ea..28df4f5 100644 --- a/cypress/e2e/sandbox.cy.ts +++ b/cypress/e2e/sandbox.cy.ts @@ -2,6 +2,23 @@ const ckan = () => cy.window({ log: false }).then((win) => win["ckan"]); const sandbox = () => ckan().invoke({ log: false }, "sandbox"); +const intercept = ( + action: string, + success: boolean = true, + result: any = {}, + alias: string = "request", +) => + cy + .intercept("/api/action/" + action, (req) => + req.reply( + Object.assign( + { success }, + success ? { result } : { error: result }, + ), + ), + ) + .as(alias); + beforeEach(() => { cy.login(); cy.visit("/about"); @@ -30,6 +47,7 @@ describe("Sandbox extension", () => { describe("sandbox.files.upload", () => { it("uses Standard uploader by default", () => { const file = new File(["hello"], "test.txt"); + const upload = cy.stub().log(false); ckan().then( ({ @@ -46,6 +64,40 @@ describe("sandbox.files.upload", () => { .then(() => expect(upload).to.be.calledWith(file)); }); + it("accepts different adapter name", () => { + const file = new File(["hello"], "test.txt"); + const upload = cy.stub().log(false); + ckan().then( + ({ + CKANEXT_FILES: { + adapters: { Multipart }, + }, + }) => { + Multipart.prototype.upload = upload; + }, + ); + + sandbox() + .then(({ files }) => files.upload(file, { adapter: "Multipart" })) + .then(() => expect(upload).to.be.calledWith(file)); + }); + + it("passes parameters to adapter", () => { + const file = new File(["hello"], "test.txt"); + const uploader = { upload: () => {} }; + const adapter = cy.stub().log(false).returns(uploader); + + ckan().then(({ CKANEXT_FILES: { adapters } }) => { + adapters.Standard = adapter; + }); + + sandbox() + .then(({ files }) => + files.upload(file, { uploaderArgs: ["a", "b", "c"] }), + ) + .then(() => expect(adapter).to.be.calledWith("a", "b", "c")); + }); + it("accepts external uploader", () => { const file = new File(["hello"], "test.txt"); const upload = cy.stub().log(false); @@ -86,11 +138,8 @@ describe("sandbox.files.upload", () => { }); }); - it.only("accepts parameters for API action", () => { - cy.intercept("/api/action/files_file_create", (req) => - req.reply({ success: true, result: {} }), - ).as("makeFile"); - + it("accepts parameters for API action", () => { + intercept("files_file_create"); sandbox().then(({ files }) => { files.upload(new File(["test"], "test.txt"), { requestParams: { @@ -101,11 +150,57 @@ describe("sandbox.files.upload", () => { }); }); - cy.wait("@makeFile").interceptFormData((data) => { + cy.wait("@request").interceptFormData((data) => { expect(data).includes({ storage: "memory", hello: "world", - value: 42, + value: "42", + }); + }); + }); +}); + +describe("Standard uploader", () => { + beforeEach(() => + ckan() + .then( + ({ + CKANEXT_FILES: { + adapters: { Standard }, + }, + }) => Standard, + ) + .as("adapter"), + ); + + it("uploads files", () => { + intercept("files_file_create"); + cy.get("@adapter").then((adapter: any) => + new adapter().upload(new File(["test"], "test.txt"), {}), + ); + + cy.wait("@request").interceptFormData((data) => { + expect(data).deep.equal({ + storage: "default", + upload: "test.txt", + }); + }); + }); + + it.only("accepts params and even can override storage", () => { + intercept("files_file_create"); + cy.get("@adapter").then((adapter: any) => + new adapter().upload(new File(["test"], "test.txt"), { + storage: "memory", + field: "value", + }), + ); + + cy.wait("@request").interceptFormData((data) => { + expect(data).deep.equal({ + storage: "memory", + field: "value", + upload: "test.txt", }); }); }); diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts index b1dc953..21b3bbd 100644 --- a/cypress/support/commands.ts +++ b/cypress/support/commands.ts @@ -36,10 +36,6 @@ // } // } -Cypress.Commands.add("resetDb", () => { - cy.exec("yes | ckan -ctest.ini db clean"); - cy.exec("ckan -ctest.ini db upgrade"); -}); Cypress.Commands.add("seedUsers", () => { for (let name in users) { const info = users[name]; @@ -81,11 +77,6 @@ declare namespace Cypress { */ login(user?: string): Chainable; - /** - * Clean and re-initialize the database. - */ - resetDb(): Chainable; - /** * Create all default user accounts. */